@giro-ds/react 2.0.0 → 3.0.1

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 (39) hide show
  1. package/dist/components/Button/Button.d.ts +1 -1
  2. package/dist/components/Button/Button.types.d.ts +3 -23
  3. package/dist/components/Button/__tests__/Button.test.d.ts +1 -0
  4. package/dist/components/Menu/Menu.d.ts +1 -1
  5. package/dist/components/Menu/Menu.types.d.ts +25 -34
  6. package/dist/components/Menu/__tests__/Menu.test.d.ts +1 -0
  7. package/dist/components/{MenuRadix → Menu}/components/MenuItem.d.ts +1 -6
  8. package/dist/components/{MenuRadix → Menu}/hooks/useMenuLogic.d.ts +1 -1
  9. package/dist/components/{MenuRadix → Menu}/hooks/useSearchLogic.d.ts +1 -1
  10. package/dist/components/Menu/index.d.ts +1 -1
  11. package/dist/components/Search/Search.types.d.ts +1 -0
  12. package/dist/components/Select/Select.d.ts +2 -2
  13. package/dist/components/Select/Select.types.d.ts +100 -52
  14. package/dist/components/Select/__tests__/SelectRadix.test.d.ts +1 -0
  15. package/dist/components/{SelectRadix → Select}/components/CheckboxSelectItem.d.ts +1 -1
  16. package/dist/components/Select/components/ExpandableSelectItem.d.ts +11 -0
  17. package/dist/components/{SelectRadix → Select}/components/SelectItem.d.ts +1 -1
  18. package/dist/components/{SelectRadix → Select}/hooks/useSelectLogic.d.ts +1 -1
  19. package/dist/components/Select/index.d.ts +4 -1
  20. package/dist/components/Switch/Switch.types.d.ts +2 -2
  21. package/dist/components/Table/Table.d.ts +2 -3
  22. package/dist/components/Table/Table.types.d.ts +46 -10
  23. package/dist/components/Table/index.d.ts +1 -1
  24. package/dist/components/index.d.ts +2 -8
  25. package/dist/index.cjs +242 -683
  26. package/dist/index.cjs.map +1 -1
  27. package/dist/index.d.ts +62 -192
  28. package/dist/index.esm.js +245 -683
  29. package/dist/index.esm.js.map +1 -1
  30. package/dist/styles.css +1 -1
  31. package/package.json +3 -2
  32. package/dist/components/MenuRadix/MenuRadix.d.ts +0 -4
  33. package/dist/components/MenuRadix/MenuRadix.types.d.ts +0 -27
  34. package/dist/components/MenuRadix/index.d.ts +0 -2
  35. package/dist/components/SelectField/SelectField.d.ts +0 -4
  36. package/dist/components/SelectField/SelectField.types.d.ts +0 -35
  37. package/dist/components/SelectRadix/SelectRadix.d.ts +0 -4
  38. package/dist/components/SelectRadix/SelectRadix.types.d.ts +0 -114
  39. package/dist/components/SelectRadix/index.d.ts +0 -5
@@ -1,114 +0,0 @@
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
- onCheckedChange: (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
- label?: string;
27
- helperText?: string;
28
- maxWidth?: string | number;
29
- errorMessage?: string;
30
- disabled?: boolean;
31
- className?: string;
32
- 'aria-label'?: string;
33
- 'data-testid'?: string;
34
- tooltip?: boolean;
35
- tooltipText?: string;
36
- side?: "top" | "right" | "bottom" | "left";
37
- align?: "start" | "center" | "end";
38
- enableInfiniteScroll?: boolean;
39
- onScrollEnd?: () => void;
40
- isLoadingMore?: boolean;
41
- enableApiSearch?: boolean;
42
- onApiSearch?: (term: string) => void;
43
- isSearching?: boolean;
44
- }
45
- export interface SelectState {
46
- isOpen: boolean;
47
- selectedValues: string[];
48
- searchInput: string;
49
- searchTerm: string;
50
- touched: boolean;
51
- hasError: boolean;
52
- }
53
- export type SelectAction = {
54
- type: 'SET_OPEN';
55
- payload: boolean;
56
- } | {
57
- type: 'SET_SELECTED_VALUES';
58
- payload: string[];
59
- } | {
60
- type: 'SET_SEARCH_INPUT';
61
- payload: string;
62
- } | {
63
- type: 'SET_SEARCH_TERM';
64
- payload: string;
65
- } | {
66
- type: 'SET_TOUCHED';
67
- payload: boolean;
68
- } | {
69
- type: 'SET_ERROR';
70
- payload: boolean;
71
- } | {
72
- type: 'RESET_SEARCH';
73
- } | {
74
- type: 'VALIDATE';
75
- payload: {
76
- required: boolean;
77
- };
78
- };
79
- export interface UseSelectLogicProps {
80
- value?: string | string[];
81
- required?: boolean;
82
- search?: boolean;
83
- onValueChange?: (value: string | string[]) => void;
84
- onOpenChange?: (open: boolean) => void;
85
- enableApiSearch?: boolean;
86
- onApiSearch?: (term: string) => void;
87
- isSearching?: boolean;
88
- }
89
- export interface UseSelectLogicReturn {
90
- state: SelectState;
91
- actions: {
92
- setOpen: (open: boolean) => void;
93
- setSelectedValues: (values: string[]) => void;
94
- setSearchInput: (input: string) => void;
95
- setSearchTerm: (term: string) => void;
96
- setTouched: (touched: boolean) => void;
97
- setError: (error: boolean) => void;
98
- resetSearch: () => void;
99
- validate: () => void;
100
- handleSingleSelect: (value: string) => void;
101
- handleMultipleSelect: (value: string, checked: boolean) => void;
102
- };
103
- computed: {
104
- displayText: string;
105
- filteredItems: SelectItemProps[];
106
- };
107
- refs: {
108
- searchInputRef: React.RefObject<HTMLInputElement | null>;
109
- };
110
- utils: {
111
- getDisplayText: (selectedValues: string[], placeholder: string, variant: string, items: SelectItemProps[]) => string;
112
- getFilteredItems: (items: SelectItemProps[], searchTerm: string) => SelectItemProps[];
113
- };
114
- }
@@ -1,5 +0,0 @@
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';