@giro-ds/react 1.0.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.
Files changed (119) hide show
  1. package/LICENCE +11 -0
  2. package/dist/components/Avatar/Avatar.d.ts +3 -0
  3. package/dist/components/Avatar/Avatar.types.d.ts +7 -0
  4. package/dist/components/Avatar/index.d.ts +1 -0
  5. package/dist/components/Badge/Badge.d.ts +4 -0
  6. package/dist/components/Badge/Badge.types.d.ts +19 -0
  7. package/dist/components/Badge/index.d.ts +2 -0
  8. package/dist/components/Button/Button.d.ts +4 -0
  9. package/dist/components/Button/Button.types.d.ts +43 -0
  10. package/dist/components/Button/index.d.ts +2 -0
  11. package/dist/components/Calendar/Calendar.d.ts +6 -0
  12. package/dist/components/Calendar/Calendar.types.d.ts +42 -0
  13. package/dist/components/Calendar/i18n.d.ts +56 -0
  14. package/dist/components/Calendar/index.d.ts +1 -0
  15. package/dist/components/Callout/Callout.d.ts +4 -0
  16. package/dist/components/Callout/Callout.types.d.ts +17 -0
  17. package/dist/components/Callout/index.d.ts +1 -0
  18. package/dist/components/Checkbox/Checkbox.d.ts +4 -0
  19. package/dist/components/Checkbox/Checkbox.types.d.ts +25 -0
  20. package/dist/components/Checkbox/index.d.ts +2 -0
  21. package/dist/components/CheckboxRadix/CheckboxRadix.d.ts +4 -0
  22. package/dist/components/CheckboxRadix/CheckboxRadix.types.d.ts +10 -0
  23. package/dist/components/CheckboxRadix/index.d.ts +2 -0
  24. package/dist/components/Chips/Chips.d.ts +4 -0
  25. package/dist/components/Chips/Chips.types.d.ts +17 -0
  26. package/dist/components/Chips/index.d.ts +1 -0
  27. package/dist/components/Container/Container.types.d.ts +4 -0
  28. package/dist/components/Container/index.d.ts +2 -0
  29. package/dist/components/DatePicker/DatePicker.d.ts +4 -0
  30. package/dist/components/DatePicker/DatePicker.types.d.ts +32 -0
  31. package/dist/components/DatePicker/DateUtils.d.ts +23 -0
  32. package/dist/components/DatePicker/index.d.ts +2 -0
  33. package/dist/components/Dialog/Dialog.d.ts +4 -0
  34. package/dist/components/Dialog/Dialog.types.d.ts +24 -0
  35. package/dist/components/Dialog/index.d.ts +2 -0
  36. package/dist/components/Dialog/utils/DialogUtils.d.ts +1 -0
  37. package/dist/components/Drawer/Drawer.d.ts +9 -0
  38. package/dist/components/Drawer/Drawer.types.d.ts +43 -0
  39. package/dist/components/Drawer/index.d.ts +1 -0
  40. package/dist/components/Dropdown/Dropdown.d.ts +4 -0
  41. package/dist/components/Dropdown/Dropdown.types.d.ts +64 -0
  42. package/dist/components/Dropdown/DropdownUtils.d.ts +8 -0
  43. package/dist/components/Dropdown/index.d.ts +2 -0
  44. package/dist/components/Filter/Filter.d.ts +4 -0
  45. package/dist/components/Filter/Filter.types.d.ts +46 -0
  46. package/dist/components/Filter/index.d.ts +2 -0
  47. package/dist/components/ListItem/ListItem.d.ts +9 -0
  48. package/dist/components/ListItem/ListItem.types.d.ts +34 -0
  49. package/dist/components/ListItem/index.d.ts +2 -0
  50. package/dist/components/Menu/Menu.d.ts +4 -0
  51. package/dist/components/Menu/Menu.types.d.ts +41 -0
  52. package/dist/components/Menu/index.d.ts +2 -0
  53. package/dist/components/MenuRadix/MenuRadix.d.ts +4 -0
  54. package/dist/components/MenuRadix/MenuRadix.types.d.ts +27 -0
  55. package/dist/components/MenuRadix/components/MenuItem.d.ts +8 -0
  56. package/dist/components/MenuRadix/hooks/useMenuLogic.d.ts +15 -0
  57. package/dist/components/MenuRadix/hooks/useSearchLogic.d.ts +13 -0
  58. package/dist/components/MenuRadix/index.d.ts +2 -0
  59. package/dist/components/Quantity/Quantity.d.ts +4 -0
  60. package/dist/components/Quantity/Quantity.types.d.ts +20 -0
  61. package/dist/components/Quantity/index.d.ts +2 -0
  62. package/dist/components/Radio/Radio.d.ts +4 -0
  63. package/dist/components/Radio/Radio.types.d.ts +18 -0
  64. package/dist/components/Radio/index.d.ts +1 -0
  65. package/dist/components/RadioRadix/RadioRadix.d.ts +4 -0
  66. package/dist/components/RadioRadix/RadioRadix.types.d.ts +15 -0
  67. package/dist/components/RadioRadix/index.d.ts +2 -0
  68. package/dist/components/Search/Search.d.ts +4 -0
  69. package/dist/components/Search/Search.types.d.ts +15 -0
  70. package/dist/components/Search/index.d.ts +2 -0
  71. package/dist/components/Select/Select.d.ts +4 -0
  72. package/dist/components/Select/Select.types.d.ts +67 -0
  73. package/dist/components/Select/index.d.ts +2 -0
  74. package/dist/components/SelectField/SelectField.d.ts +4 -0
  75. package/dist/components/SelectField/SelectField.types.d.ts +35 -0
  76. package/dist/components/SelectRadix/SelectRadix.d.ts +4 -0
  77. package/dist/components/SelectRadix/SelectRadix.types.d.ts +112 -0
  78. package/dist/components/SelectRadix/components/CheckboxSelectItem.d.ts +4 -0
  79. package/dist/components/SelectRadix/components/SelectItem.d.ts +7 -0
  80. package/dist/components/SelectRadix/hooks/useSelectLogic.d.ts +3 -0
  81. package/dist/components/SelectRadix/index.d.ts +5 -0
  82. package/dist/components/Table/EmptyRows150Color.d.ts +8 -0
  83. package/dist/components/Table/LoaderList.d.ts +10 -0
  84. package/dist/components/Table/MultiLineText/MultiLineText.d.ts +14 -0
  85. package/dist/components/Table/MultiLineText/index.d.ts +2 -0
  86. package/dist/components/Table/Table.d.ts +4 -0
  87. package/dist/components/Table/Table.types.d.ts +35 -0
  88. package/dist/components/Table/TableHeader.d.ts +47 -0
  89. package/dist/components/Table/TablePagination.d.ts +21 -0
  90. package/dist/components/Table/index.d.ts +7 -0
  91. package/dist/components/Table/utils/tableActions.d.ts +21 -0
  92. package/dist/components/TextField/TextField.d.ts +4 -0
  93. package/dist/components/TextField/TextField.types.d.ts +22 -0
  94. package/dist/components/TextField/ValidationUtils.d.ts +8 -0
  95. package/dist/components/TextField/index.d.ts +2 -0
  96. package/dist/components/Toast/Toast.d.ts +13 -0
  97. package/dist/components/Toast/Toast.types.d.ts +22 -0
  98. package/dist/components/Toast/index.d.ts +2 -0
  99. package/dist/components/Tooltip/Tooltip.d.ts +4 -0
  100. package/dist/components/Tooltip/Tooltip.types.d.ts +7 -0
  101. package/dist/components/Tooltip/index.d.ts +1 -0
  102. package/dist/components/VerificationCode/VerificationCode.d.ts +20 -0
  103. package/dist/components/VerificationCode/VerificationCode.types.d.ts +19 -0
  104. package/dist/components/VerificationCode/index.d.ts +2 -0
  105. package/dist/components/index.d.ts +65 -0
  106. package/dist/hooks/ApiSimulation.d.ts +53 -0
  107. package/dist/hooks/InfiniteScroll.d.ts +41 -0
  108. package/dist/hooks/NormalizeText.d.ts +1 -0
  109. package/dist/index.cjs +7354 -0
  110. package/dist/index.cjs.map +1 -0
  111. package/dist/index.d.ts +1045 -0
  112. package/dist/index.esm.js +7299 -0
  113. package/dist/index.esm.js.map +1 -0
  114. package/dist/shared/Label/index.d.ts +13 -0
  115. package/dist/shared/icons/CheckHalf.d.ts +10 -0
  116. package/dist/shared/icons/CheckSmall.d.ts +10 -0
  117. package/dist/shared/icons/index.d.ts +4 -0
  118. package/dist/styles.css +1 -0
  119. package/package.json +72 -0
@@ -0,0 +1,2 @@
1
+ export { default } from './Filter';
2
+ export type { FilterProps } from './Filter.types';
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ import type { ListItemProps } from './ListItem.types';
3
+ /**
4
+ * Componente ListItem do Zanthus Design System
5
+ * Implementa item de lista unificado com variações text, checkbox, radio e icon
6
+ * Segue padrões WCAG 2.1 AA para acessibilidade
7
+ */
8
+ declare const ListItem: React.FC<ListItemProps>;
9
+ export default ListItem;
@@ -0,0 +1,34 @@
1
+ import React from 'react';
2
+ export type ListItemVariant = 'text' | 'checkbox' | 'radio' | 'icon';
3
+ export interface ListItemProps {
4
+ /** ID único do componente */
5
+ id?: string;
6
+ /** Classes CSS customizadas */
7
+ className?: string;
8
+ /** Variante do item da lista */
9
+ variant?: ListItemVariant;
10
+ /** Texto principal do item */
11
+ text?: string;
12
+ /** Nome do input (para checkbox/radio) */
13
+ name?: string;
14
+ /** Texto secundário/descrição */
15
+ subText?: string;
16
+ /** Se o item está desabilitado */
17
+ disabled?: boolean;
18
+ /** Estado de checked (para checkbox/radio) */
19
+ checked?: boolean;
20
+ /** Estado de selecionado (para text/icon) */
21
+ selected?: boolean;
22
+ /** Callback para clique no item */
23
+ onClick?: (event: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>) => void;
24
+ /** Callback para mudança de estado */
25
+ onChange?: (checked: boolean) => void;
26
+ /** Ícone do item (para variant icon) */
27
+ icon?: React.ReactNode;
28
+ /** Valor do input (para checkbox/radio) */
29
+ value?: string;
30
+ /** Se deve mostrar o subtexto */
31
+ showSubText?: boolean;
32
+ /** Estado de hover */
33
+ hovered?: boolean;
34
+ }
@@ -0,0 +1,2 @@
1
+ export { default } from './ListItem';
2
+ export type { ListItemProps } from './ListItem.types';
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import type { MenuProps } from './Menu.types';
3
+ declare const Menu: React.FC<MenuProps>;
4
+ export default Menu;
@@ -0,0 +1,41 @@
1
+ import { ReactNode, ReactElement } from 'react';
2
+ export interface MenuItem {
3
+ /** ID único do item */
4
+ id: string;
5
+ /** Texto principal do item */
6
+ text: string;
7
+ /** Texto secundário opcional */
8
+ subText?: string;
9
+ /** Ícone do item */
10
+ icon?: ReactNode;
11
+ /** Estado desabilitado */
12
+ disabled?: boolean;
13
+ /** Valor customizado do item */
14
+ value?: unknown;
15
+ }
16
+ export interface MenuProps {
17
+ /** Elemento React que será usado como âncora do menu (obrigatório) */
18
+ children: ReactElement<any, any>;
19
+ /** Array de itens do menu */
20
+ menuItems?: MenuItem[];
21
+ /** Callback executado quando um item do menu é clicado */
22
+ onMenuItemClick?: (item: MenuItem) => void;
23
+ /** Callback executado quando o menu é aberto/fechado */
24
+ onToggle?: (isOpen: boolean) => void;
25
+ /** Tipo do dropdown */
26
+ type?: 'text' | 'icon';
27
+ /** Habilita campo de busca */
28
+ applySearch?: boolean;
29
+ /** Placeholder do campo de busca */
30
+ placeholder?: string;
31
+ /** Controla exibição do subtexto */
32
+ showSubText?: boolean;
33
+ /** Classes CSS adicionais */
34
+ className?: string;
35
+ /** ID único do componente */
36
+ id?: string;
37
+ maxWidth?: string | number;
38
+ minWidth?: string | number;
39
+ /** Posição do menu em relação ao elemento âncora */
40
+ position?: 'left' | 'right';
41
+ }
@@ -0,0 +1,2 @@
1
+ export { default } from './Menu';
2
+ export type { MenuProps, MenuItem } from './Menu.types';
@@ -0,0 +1,4 @@
1
+ import { MenuRadixProps } from './MenuRadix.types';
2
+ import React from 'react';
3
+ declare const MenuRadix: React.FC<MenuRadixProps>;
4
+ export default MenuRadix;
@@ -0,0 +1,27 @@
1
+ import { ReactElement } from 'react';
2
+ export interface MenuItemProps {
3
+ id?: string;
4
+ text?: string;
5
+ subText?: string;
6
+ disabled?: boolean;
7
+ icon?: React.ReactNode;
8
+ children?: MenuItemProps[];
9
+ value?: string;
10
+ }
11
+ export interface MenuRadixProps {
12
+ items: MenuItemProps[];
13
+ children?: ReactElement;
14
+ type?: 'text' | 'icon';
15
+ className?: string;
16
+ onItemSelect?: (items: MenuItemProps) => void;
17
+ selectedItems?: MenuItemProps[];
18
+ search?: boolean;
19
+ align?: 'start' | 'end' | 'center';
20
+ maxHeight?: number | string;
21
+ enableInfiniteScroll?: boolean;
22
+ onScrollEnd?: () => void;
23
+ isLoadingMore?: boolean;
24
+ enableApiSearch?: boolean;
25
+ onApiSearch?: (searchTerm: string) => void;
26
+ onOpenChange?: (open: boolean) => void;
27
+ }
@@ -0,0 +1,8 @@
1
+ import { MenuItemProps } from '../MenuRadix.types';
2
+ interface DefaultMenuItemProps {
3
+ item: MenuItemProps;
4
+ isSelected: boolean;
5
+ onSelect: (item: MenuItemProps) => void;
6
+ }
7
+ export declare const MenuItem: import("react").MemoExoticComponent<({ item, isSelected, onSelect }: DefaultMenuItemProps) => import("react/jsx-runtime").JSX.Element>;
8
+ export default MenuItem;
@@ -0,0 +1,15 @@
1
+ import { MenuItemProps } from '../MenuRadix.types';
2
+ export interface UseMenuLogicProps {
3
+ selectedItems?: MenuItemProps[];
4
+ onItemSelect?: (items: MenuItemProps) => void;
5
+ onOpenChange?: (open: boolean) => void;
6
+ }
7
+ export interface UseMenuLogicReturn {
8
+ open: boolean;
9
+ internalSelectedItems: MenuItemProps[];
10
+ setOpen: (open: boolean) => void;
11
+ handleItemSelect: (item: MenuItemProps) => void;
12
+ isItemSelected: (item: MenuItemProps) => boolean;
13
+ }
14
+ export declare function useMenuLogic({ selectedItems, onItemSelect, onOpenChange, }: UseMenuLogicProps): UseMenuLogicReturn;
15
+ export default useMenuLogic;
@@ -0,0 +1,13 @@
1
+ import { MenuItemProps } from '../MenuRadix.types';
2
+ interface UseSearchLogicProps {
3
+ items: MenuItemProps[];
4
+ searchValue: string;
5
+ searchTerm: string;
6
+ enableApiSearch?: boolean;
7
+ onApiSearch?: (term: string) => void;
8
+ }
9
+ interface UseSearchLogicReturn {
10
+ filteredItems: MenuItemProps[];
11
+ }
12
+ export declare const useSearchLogic: ({ items, searchValue, searchTerm, enableApiSearch, onApiSearch, }: UseSearchLogicProps) => UseSearchLogicReturn;
13
+ export {};
@@ -0,0 +1,2 @@
1
+ export { default } from './MenuRadix';
2
+ export type { MenuRadixProps, MenuItemProps } from './MenuRadix.types';
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import type { QuantityProps } from './Quantity.types';
3
+ declare const memorizedQuantity: React.NamedExoticComponent<QuantityProps>;
4
+ export default memorizedQuantity;
@@ -0,0 +1,20 @@
1
+ export interface QuantityProps {
2
+ /** Valor padrão inicial */
3
+ defaultValue?: number;
4
+ /** Valor controlado externamente */
5
+ value?: number;
6
+ /** Callback chamado quando o valor muda */
7
+ onChange?: (value: number) => void;
8
+ /** Define se o componente está desabilitado */
9
+ disabled?: boolean;
10
+ /** Define se o valor do input será decimal ou inteiro */
11
+ decimal?: boolean;
12
+ /** Define o tamanho do componente */
13
+ size?: 'lg' | 'sm';
14
+ /** Define o número de casas decimais quando decimal for true */
15
+ decimalPlaces?: number;
16
+ step?: number;
17
+ id?: string;
18
+ /** ClassName adicional para customização */
19
+ className?: string;
20
+ }
@@ -0,0 +1,2 @@
1
+ export { default } from './Quantity';
2
+ export type { QuantityProps } from './Quantity.types';
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import type { RadioProps } from './Radio.types';
3
+ declare const MemoizedRadio: React.NamedExoticComponent<RadioProps>;
4
+ export default MemoizedRadio;
@@ -0,0 +1,18 @@
1
+ export interface RadioProps {
2
+ /** Definirá o nome do grupo de radio */
3
+ name?: string;
4
+ /** O valor associado ao botão de rádio */
5
+ value: string;
6
+ /** O identificador único para o input do rádio */
7
+ id?: string;
8
+ /** Indica se o botão de rádio está selecionado */
9
+ checked?: boolean;
10
+ /** Classes adicionais para estilização personalizada */
11
+ className?: string;
12
+ /** Função de callback acionada quando o valor do botão de rádio muda */
13
+ onChange?: (value: string) => void;
14
+ /** O texto do rótulo exibido ao lado do botão de rádio */
15
+ label?: string;
16
+ /** Indica se o botão de rádio está desabilitado */
17
+ disabled?: boolean;
18
+ }
@@ -0,0 +1 @@
1
+ export { default } from './Radio';
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { RadioGroupProps } from './RadioRadix.types';
3
+ declare const RadioRadix: React.FC<RadioGroupProps>;
4
+ export default RadioRadix;
@@ -0,0 +1,15 @@
1
+ export interface RadioProps {
2
+ id?: string | number;
3
+ value: string;
4
+ label: string;
5
+ disabled?: boolean;
6
+ }
7
+ export interface RadioGroupProps {
8
+ id?: string;
9
+ items: RadioProps[];
10
+ onValueChange?: (value: string) => void;
11
+ defaultValue?: string;
12
+ name?: string;
13
+ ariaLabel?: string;
14
+ orientation?: "horizontal" | "vertical";
15
+ }
@@ -0,0 +1,2 @@
1
+ export { default } from './RadioRadix';
2
+ export type { RadioProps, RadioGroupProps } from './RadioRadix.types';
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import type { SearchProps } from './Search.types';
3
+ declare const Search: React.ForwardRefExoticComponent<SearchProps & React.RefAttributes<HTMLInputElement>>;
4
+ export default Search;
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ export interface SearchProps {
3
+ placeholder?: string;
4
+ disabled?: boolean;
5
+ value?: string;
6
+ onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
7
+ onKeyDown?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
8
+ onFocus?: (e: React.FocusEvent<HTMLInputElement>) => void;
9
+ onBlur?: (e: React.FocusEvent<HTMLInputElement>) => void;
10
+ onClear?: () => void;
11
+ onClick?: (e: React.MouseEvent<HTMLDivElement>) => void;
12
+ onMouseDown?: (e: React.MouseEvent<HTMLDivElement>) => void;
13
+ className?: string;
14
+ id?: string;
15
+ }
@@ -0,0 +1,2 @@
1
+ export { default } from './Search';
2
+ export type { SearchProps } from './Search.types';
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import type { SelectProps } from './Select.types';
3
+ declare const Select: React.NamedExoticComponent<SelectProps>;
4
+ export default Select;
@@ -0,0 +1,67 @@
1
+ import React from 'react';
2
+ import { DropdownType } from '../Dropdown/Dropdown.types';
3
+ export interface SelectOption {
4
+ /** ID único da opção (opcional, será gerado automaticamente se não fornecido) */
5
+ id?: string;
6
+ /** Texto principal da opção */
7
+ text: string;
8
+ /** Texto secundário/descrição da opção */
9
+ subText?: string;
10
+ /** Ícone da opção (React node) */
11
+ icon?: React.ReactNode;
12
+ /** Define se a opção está desabilitada */
13
+ disabled?: boolean;
14
+ }
15
+ export interface SelectProps {
16
+ /** ID único do componente */
17
+ id?: string;
18
+ /** Array de opções para seleção - obrigatório */
19
+ options: SelectOption[];
20
+ /** Valor(es) selecionado(s) */
21
+ value?: string | string[];
22
+ /** Valor inicial para seleção (usado apenas na primeira renderização) */
23
+ initialValue?: string | string[];
24
+ /** Callback para mudanças na seleção */
25
+ onChange?: (selectedItems: SelectOption[]) => void;
26
+ /** Placeholder do campo */
27
+ placeholder?: string;
28
+ /** Tipo do dropdown (single ou multiple) */
29
+ type?: DropdownType;
30
+ maxHeight?: string;
31
+ /** Label do campo */
32
+ label?: string;
33
+ /** Texto de ajuda */
34
+ helperText?: string;
35
+ /** Mensagem de erro */
36
+ errorMessage?: string;
37
+ /** Campo obrigatório */
38
+ required?: boolean;
39
+ /** Campo desabilitado */
40
+ disabled?: boolean;
41
+ /** Classes CSS adicionais */
42
+ className?: string;
43
+ /** Texto para acessibilidade */
44
+ showSubText?: boolean;
45
+ /** Aria-label do campo */
46
+ ariaLabel?: string;
47
+ /** Habilita campo de busca */
48
+ applySearch?: boolean;
49
+ /** Placeholder do campo de busca */
50
+ searchPlaceholder?: string;
51
+ maxWidth?: string;
52
+ minWidth?: string;
53
+ tooltip?: boolean;
54
+ tooltipText?: string;
55
+ width?: string;
56
+ /** Força posição do dropdown: 'top' abre para cima, 'bottom' abre para baixo. Se não especificado, usa detecção automática */
57
+ position?: 'top' | 'bottom';
58
+ positionTooltip?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left' | 'left' | 'right';
59
+ infiniteScroll?: {
60
+ status: 'idle' | 'loading' | 'succeeded' | 'failed';
61
+ page: number;
62
+ lastPage: number;
63
+ onLoadMore: () => void;
64
+ threshold?: number;
65
+ rootMargin?: string;
66
+ };
67
+ }
@@ -0,0 +1,2 @@
1
+ export { default } from './Select';
2
+ export type { SelectProps, SelectOption } from './Select.types';
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import type { SelectFieldProps } from './SelectField.types';
3
+ declare const SelectField: React.ForwardRefExoticComponent<SelectFieldProps & React.RefAttributes<HTMLDivElement>>;
4
+ export default SelectField;
@@ -0,0 +1,35 @@
1
+ import React from 'react';
2
+ export interface SelectFieldProps {
3
+ /** ID do campo */
4
+ id?: string;
5
+ /** Nome do campo */
6
+ name?: string;
7
+ /** Valor exibido */
8
+ value?: string;
9
+ /** Placeholder */
10
+ placeholder?: string;
11
+ /** Label do campo */
12
+ label?: string;
13
+ /** Texto de ajuda */
14
+ helperText?: string;
15
+ /** Mensagem de erro */
16
+ errorMessage?: string;
17
+ /** Campo obrigatório */
18
+ required?: boolean;
19
+ /** Campo desabilitado */
20
+ disabled?: boolean;
21
+ /** Ícone (chevron) */
22
+ icon?: React.ReactNode;
23
+ /** Estado aberto */
24
+ isOpen?: boolean;
25
+ /** Classes CSS adicionais */
26
+ className?: string;
27
+ /** Tooltip info */
28
+ tooltip?: React.ReactNode;
29
+ tooltipText?: string;
30
+ positionTooltip?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left' | 'left' | 'right';
31
+ /** Indica se o campo foi "tocado" (aberto e fechado) */
32
+ isTouched?: boolean;
33
+ /** Força estado de erro independente da validação interna */
34
+ hasError?: boolean;
35
+ }
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { SelectRadixProps } from './SelectRadix.types';
3
+ declare const SelectRadix: React.FC<SelectRadixProps>;
4
+ export default SelectRadix;
@@ -0,0 +1,112 @@
1
+ import { ReactNode } from 'react';
2
+ export interface SelectItemProps {
3
+ id?: string;
4
+ text: ReactNode;
5
+ subTitle?: ReactNode;
6
+ icon?: ReactNode;
7
+ disabled?: boolean;
8
+ value: string;
9
+ selected?: boolean;
10
+ }
11
+ export interface CheckboxItemProps extends SelectItemProps {
12
+ checked: boolean;
13
+ onChange: (checked: boolean) => void;
14
+ }
15
+ export type SelectVariant = 'text' | 'icon' | 'checkbox';
16
+ export interface SelectRadixProps {
17
+ items: SelectItemProps[];
18
+ onValueChange?: (value: string | string[]) => void;
19
+ onOpenChange?: (open: boolean) => void;
20
+ variant: SelectVariant;
21
+ required?: boolean;
22
+ value?: string | string[];
23
+ multiple?: boolean;
24
+ placeholder?: string;
25
+ search?: boolean;
26
+ tooltip?: boolean;
27
+ tooltipMessage?: string;
28
+ label?: string;
29
+ helperText?: string;
30
+ maxWidth?: string | number;
31
+ errorMessage?: string;
32
+ disabled?: boolean;
33
+ className?: string;
34
+ 'aria-label'?: string;
35
+ 'data-testid'?: string;
36
+ enableInfiniteScroll?: boolean;
37
+ onScrollEnd?: () => void;
38
+ isLoadingMore?: boolean;
39
+ enableApiSearch?: boolean;
40
+ onApiSearch?: (term: string) => void;
41
+ isSearching?: boolean;
42
+ }
43
+ export interface SelectState {
44
+ isOpen: boolean;
45
+ selectedValues: string[];
46
+ searchInput: string;
47
+ searchTerm: string;
48
+ touched: boolean;
49
+ hasError: boolean;
50
+ }
51
+ export type SelectAction = {
52
+ type: 'SET_OPEN';
53
+ payload: boolean;
54
+ } | {
55
+ type: 'SET_SELECTED_VALUES';
56
+ payload: string[];
57
+ } | {
58
+ type: 'SET_SEARCH_INPUT';
59
+ payload: string;
60
+ } | {
61
+ type: 'SET_SEARCH_TERM';
62
+ payload: string;
63
+ } | {
64
+ type: 'SET_TOUCHED';
65
+ payload: boolean;
66
+ } | {
67
+ type: 'SET_ERROR';
68
+ payload: boolean;
69
+ } | {
70
+ type: 'RESET_SEARCH';
71
+ } | {
72
+ type: 'VALIDATE';
73
+ payload: {
74
+ required: boolean;
75
+ };
76
+ };
77
+ export interface UseSelectLogicProps {
78
+ value?: string | string[];
79
+ required?: boolean;
80
+ search?: boolean;
81
+ onValueChange?: (value: string | string[]) => void;
82
+ onOpenChange?: (open: boolean) => void;
83
+ enableApiSearch?: boolean;
84
+ onApiSearch?: (term: string) => void;
85
+ isSearching?: boolean;
86
+ }
87
+ export interface UseSelectLogicReturn {
88
+ state: SelectState;
89
+ actions: {
90
+ setOpen: (open: boolean) => void;
91
+ setSelectedValues: (values: string[]) => void;
92
+ setSearchInput: (input: string) => void;
93
+ setSearchTerm: (term: string) => void;
94
+ setTouched: (touched: boolean) => void;
95
+ setError: (error: boolean) => void;
96
+ resetSearch: () => void;
97
+ validate: () => void;
98
+ handleSingleSelect: (value: string) => void;
99
+ handleMultipleSelect: (value: string, checked: boolean) => void;
100
+ };
101
+ computed: {
102
+ displayText: string;
103
+ filteredItems: SelectItemProps[];
104
+ };
105
+ refs: {
106
+ searchInputRef: React.RefObject<HTMLInputElement | null>;
107
+ };
108
+ utils: {
109
+ getDisplayText: (selectedValues: string[], placeholder: string, variant: string, items: SelectItemProps[]) => string;
110
+ getFilteredItems: (items: SelectItemProps[], searchTerm: string) => SelectItemProps[];
111
+ };
112
+ }
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { CheckboxItemProps } from '../SelectRadix.types';
3
+ declare const CheckboxSelectItem: React.FC<CheckboxItemProps>;
4
+ export default CheckboxSelectItem;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { SelectItemProps, SelectVariant } from '../SelectRadix.types';
3
+ interface SelectItemComponentProps extends SelectItemProps {
4
+ variant?: SelectVariant;
5
+ }
6
+ declare const SelectItem: React.ForwardRefExoticComponent<SelectItemComponentProps & React.RefAttributes<HTMLDivElement>>;
7
+ export default SelectItem;
@@ -0,0 +1,3 @@
1
+ import { UseSelectLogicProps, UseSelectLogicReturn } from '../SelectRadix.types';
2
+ export declare function useSelectLogic({ value, required, search, onValueChange, onOpenChange, enableApiSearch, onApiSearch, isSearching, }: UseSelectLogicProps): UseSelectLogicReturn;
3
+ export default useSelectLogic;
@@ -0,0 +1,5 @@
1
+ export { default } from './SelectRadix';
2
+ export type { SelectRadixProps, SelectItemProps, CheckboxItemProps, SelectVariant, SelectState, SelectAction, UseSelectLogicProps, UseSelectLogicReturn } from './SelectRadix.types';
3
+ export { useSelectLogic } from './hooks/useSelectLogic';
4
+ export { default as CheckboxSelectItem } from './components/CheckboxSelectItem';
5
+ export { default as SelectItem } from './components/SelectItem';
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ /**
3
+ * Componente de ícone SVG para estado vazio da tabela
4
+ * Exibe um ícone de lupa com design personalizado do Zanthus Design System
5
+ * @returns Elemento SVG para estado vazio
6
+ */
7
+ declare const EmptyRows150Color: React.FC;
8
+ export default EmptyRows150Color;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { IContentLoaderProps } from 'react-content-loader';
3
+ /**
4
+ * Componente de loading para lista de tabela
5
+ * Simula o carregamento de dados em formato de tabela usando ContentLoader
6
+ * @param props - Propriedades adicionais para o ContentLoader
7
+ * @returns Elemento de loading animado
8
+ */
9
+ declare const LoaderList: React.FC<IContentLoaderProps>;
10
+ export default LoaderList;
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ interface MultiLineTextProps {
3
+ /** Texto a ser exibido como linha principal */
4
+ text1: string;
5
+ /** Texto a ser exibido como linha secundária */
6
+ text2: string;
7
+ }
8
+ /**
9
+ * Componente para exibir texto em duas linhas
10
+ * Utilizado principalmente em tabelas para mostrar informações hierárquicas
11
+ */
12
+ declare const MultiLineText: React.FC<MultiLineTextProps>;
13
+ export default MultiLineText;
14
+ export type { MultiLineTextProps };
@@ -0,0 +1,2 @@
1
+ export { default } from './MultiLineText';
2
+ export type { MultiLineTextProps } from './MultiLineText';
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import type { TableProps } from './Table.types';
3
+ declare const Table: React.FC<TableProps>;
4
+ export default Table;
@@ -0,0 +1,35 @@
1
+ import { ReactNode, CSSProperties } from 'react';
2
+ export type TableColumnType = 'text' | 'datetime' | 'custom';
3
+ export type TableAlign = 'left' | 'center' | 'right';
4
+ export interface TableColumn {
5
+ key: string;
6
+ label: ReactNode;
7
+ type?: TableColumnType;
8
+ format?: string;
9
+ render?: (row: TableRowData, index: number) => ReactNode;
10
+ align?: TableAlign;
11
+ style?: CSSProperties;
12
+ }
13
+ export type TableRowData = Record<string, any>;
14
+ export interface TableProps {
15
+ columns: TableColumn[];
16
+ dataSource: TableRowData[];
17
+ className?: string;
18
+ loading?: boolean;
19
+ rowSelection?: {
20
+ selectedRowKeys?: (string | number)[];
21
+ onChange?: (keys: (string | number)[], rows: TableRowData[]) => void;
22
+ getCheckboxProps?: (row: TableRowData, index: number) => {
23
+ disabled?: boolean;
24
+ };
25
+ };
26
+ locale?: {
27
+ emptyText?: ReactNode;
28
+ };
29
+ /** Eventos de linha */
30
+ onRow?: (row: TableRowData, index: number) => {
31
+ onClick?: () => void;
32
+ onDoubleClick?: () => void;
33
+ className?: string;
34
+ };
35
+ }