@giro-ds/react 1.0.4 → 2.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 (38) hide show
  1. package/dist/components/Checkbox/Checkbox.d.ts +4 -4
  2. package/dist/components/Checkbox/Checkbox.types.d.ts +4 -19
  3. package/dist/components/Checkbox/__tests__/Checkbox.test.d.ts +1 -0
  4. package/dist/components/Radio/Radio.d.ts +3 -3
  5. package/dist/components/Radio/Radio.types.d.ts +11 -14
  6. package/dist/components/Radio/__tests__/Radio.test.d.ts +1 -0
  7. package/dist/components/Radio/index.d.ts +1 -0
  8. package/dist/components/SelectRadix/SelectRadix.types.d.ts +5 -3
  9. package/dist/components/Switch/Switch.d.ts +4 -0
  10. package/dist/components/Switch/Switch.types.d.ts +8 -0
  11. package/dist/components/Switch/__tests__/Switch.test.d.ts +1 -0
  12. package/dist/components/Switch/index.d.ts +2 -0
  13. package/dist/components/TextField/TextField.d.ts +2 -2
  14. package/dist/components/TextField/TextField.types.d.ts +23 -14
  15. package/dist/components/TextField/__tests__/Textfield.test.d.ts +1 -0
  16. package/dist/components/TextField/utils/__tests__/validation.test.d.ts +1 -0
  17. package/dist/components/TextField/utils/index.d.ts +2 -0
  18. package/dist/components/TextField/utils/validation.d.ts +8 -0
  19. package/dist/components/Tooltip/Tooltip.d.ts +1 -1
  20. package/dist/components/Tooltip/Tooltip.types.d.ts +5 -1
  21. package/dist/components/Tooltip/__tests__/Tooltip.test.d.ts +1 -0
  22. package/dist/components/Tooltip/index.d.ts +1 -0
  23. package/dist/components/index.d.ts +3 -5
  24. package/dist/index.cjs +202 -327
  25. package/dist/index.cjs.map +1 -1
  26. package/dist/index.d.ts +42 -72
  27. package/dist/index.esm.js +215 -321
  28. package/dist/index.esm.js.map +1 -1
  29. package/dist/shared/Label/index.d.ts +4 -2
  30. package/dist/styles.css +1 -1
  31. package/package.json +15 -13
  32. package/dist/components/CheckboxRadix/CheckboxRadix.d.ts +0 -4
  33. package/dist/components/CheckboxRadix/CheckboxRadix.types.d.ts +0 -10
  34. package/dist/components/CheckboxRadix/index.d.ts +0 -2
  35. package/dist/components/RadioRadix/RadioRadix.d.ts +0 -4
  36. package/dist/components/RadioRadix/RadioRadix.types.d.ts +0 -15
  37. package/dist/components/RadioRadix/index.d.ts +0 -2
  38. package/dist/components/TextField/ValidationUtils.d.ts +0 -8
package/dist/index.d.ts CHANGED
@@ -142,35 +142,8 @@ interface CalloutProps {
142
142
  declare const Callout: React__default.FC<CalloutProps>;
143
143
 
144
144
  interface CheckboxProps {
145
- /** Unique identifier for the checkbox input */
146
145
  id?: string;
147
- /** Name attribute for the checkbox, used for form identification */
148
- name?: string;
149
- /** Controlled value indicating whether the checkbox is checked */
150
- checked?: boolean;
151
- /** Callback function triggered when the checkbox value changes */
152
- onChange?: (event: React__default.ChangeEvent<HTMLInputElement>) => void;
153
- /** Label text displayed next to the checkbox */
154
- label?: string | React__default.ReactNode;
155
- /** Additional CSS classes for custom styling */
156
- className?: string;
157
- /** Value attribute for the checkbox input element */
158
- value?: string;
159
- /** AriaDescribedBy for the checkbox input element */
160
- ariaDescribedby?: string;
161
- /** Disables the checkbox, preventing user interaction */
162
- disabled?: boolean;
163
- /** Sets the checkbox to an indeterminate state (useful for parent-child relationships) */
164
- indeterminate?: boolean;
165
- /** Additional props passed to the checkbox input element */
166
- [key: string]: any;
167
- }
168
-
169
- declare const MemoizedCheckbox: React__default.NamedExoticComponent<CheckboxProps>;
170
-
171
- interface CheckboxRadixProps {
172
- id?: string;
173
- label: string;
146
+ label?: React.ReactNode;
174
147
  onCheckedChange?: (checked: boolean) => void;
175
148
  defaultChecked?: boolean;
176
149
  checked?: boolean;
@@ -179,7 +152,7 @@ interface CheckboxRadixProps {
179
152
  indeterminate?: boolean;
180
153
  }
181
154
 
182
- declare const CheckboxRadix: React$1.FC<CheckboxRadixProps>;
155
+ declare const Checkbox: React$1.FC<CheckboxProps>;
183
156
 
184
157
  interface ChipsProps {
185
158
  /** Variante a ser escolhida para utilizar padrões de estilizações pré-definidos */
@@ -239,7 +212,7 @@ interface DatePickerProps {
239
212
  'data-testid'?: string;
240
213
  }
241
214
 
242
- declare const _default: React__default.NamedExoticComponent<DatePickerProps>;
215
+ declare const _default$1: React__default.NamedExoticComponent<DatePickerProps>;
243
216
 
244
217
  interface DialogProps {
245
218
  children?: ReactNode;
@@ -549,27 +522,6 @@ interface QuantityProps {
549
522
 
550
523
  declare const memorizedQuantity: React__default.NamedExoticComponent<QuantityProps>;
551
524
 
552
- interface RadioProps$1 {
553
- /** Definirá o nome do grupo de radio */
554
- name?: string;
555
- /** O valor associado ao botão de rádio */
556
- value: string;
557
- /** O identificador único para o input do rádio */
558
- id?: string;
559
- /** Indica se o botão de rádio está selecionado */
560
- checked?: boolean;
561
- /** Classes adicionais para estilização personalizada */
562
- className?: string;
563
- /** Função de callback acionada quando o valor do botão de rádio muda */
564
- onChange?: (value: string) => void;
565
- /** O texto do rótulo exibido ao lado do botão de rádio */
566
- label?: string;
567
- /** Indica se o botão de rádio está desabilitado */
568
- disabled?: boolean;
569
- }
570
-
571
- declare const MemoizedRadio: React__default.NamedExoticComponent<RadioProps$1>;
572
-
573
525
  interface RadioProps {
574
526
  id?: string | number;
575
527
  value: string;
@@ -586,7 +538,7 @@ interface RadioGroupProps {
586
538
  orientation?: "horizontal" | "vertical";
587
539
  }
588
540
 
589
- declare const RadioRadix: React__default.FC<RadioGroupProps>;
541
+ declare const Radio: React__default.FC<RadioGroupProps>;
590
542
 
591
543
  interface SearchProps {
592
544
  placeholder?: string;
@@ -730,8 +682,6 @@ interface SelectRadixProps {
730
682
  multiple?: boolean;
731
683
  placeholder?: string;
732
684
  search?: boolean;
733
- tooltip?: boolean;
734
- tooltipMessage?: string;
735
685
  label?: string;
736
686
  helperText?: string;
737
687
  maxWidth?: string | number;
@@ -740,6 +690,10 @@ interface SelectRadixProps {
740
690
  className?: string;
741
691
  'aria-label'?: string;
742
692
  'data-testid'?: string;
693
+ tooltip?: boolean;
694
+ tooltipText?: string;
695
+ side?: "top" | "right" | "bottom" | "left";
696
+ align?: "start" | "center" | "end";
743
697
  enableInfiniteScroll?: boolean;
744
698
  onScrollEnd?: () => void;
745
699
  isLoadingMore?: boolean;
@@ -849,29 +803,30 @@ interface TablePaginationProps {
849
803
  }
850
804
  declare const TablePagination: React__default.FC<TablePaginationProps>;
851
805
 
852
- interface TextFieldProps {
853
- name?: string;
854
- className?: string;
855
- value?: string | number;
806
+ type TextFieldType = 'text' | 'email' | 'password' | 'number' | 'tel' | 'url';
807
+ interface TextFieldProps extends Omit<React__default.InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'value' | 'type'> {
808
+ /** Controlled value */
809
+ value?: string;
810
+ /** Change handler - receives string value */
811
+ onChange?: (value: string) => void;
812
+ /** Label text */
856
813
  label?: string;
857
- placeholder?: string;
858
- type?: string;
859
- onChange?: (value: string | number) => void;
860
- disabled?: boolean;
861
- maxLength?: number;
862
- required?: boolean;
863
- helper?: boolean;
814
+ /** Input type */
815
+ type?: TextFieldType;
816
+ /** Helper text (shown below input) */
864
817
  helperText?: string;
818
+ /** Show tooltip with info icon */
865
819
  tooltip?: boolean;
820
+ /** Tooltip content */
866
821
  tooltipText?: string;
867
- positionTooltip?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left';
822
+ side?: "top" | "right" | "bottom" | "left";
823
+ align?: "start" | "center" | "end";
868
824
  errorMessage?: string;
869
- trailingIcon?: boolean;
870
- id?: string;
825
+ /** Leading icon */
871
826
  icon?: React__default.ReactNode;
872
827
  }
873
828
 
874
- declare const MemoizedTextField: React__default.NamedExoticComponent<TextFieldProps>;
829
+ declare const _default: React__default.NamedExoticComponent<TextFieldProps & React__default.RefAttributes<HTMLInputElement>>;
875
830
 
876
831
  type ToastType = 'success' | 'alert' | 'info';
877
832
  interface ToastMessage {
@@ -902,12 +857,27 @@ declare const useToast: () => ToastContextType;
902
857
  interface TooltipProps {
903
858
  id?: string;
904
859
  text: React__default.ReactNode;
905
- position?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left' | 'left' | 'right';
860
+ side?: "top" | "right" | "bottom" | "left";
861
+ align?: "start" | "center" | "end";
862
+ sideOffset?: number;
863
+ alignOffset?: number;
864
+ maxWidth?: number;
906
865
  children: React__default.ReactNode;
907
866
  }
908
867
 
909
868
  declare const Tooltip: React__default.FC<TooltipProps>;
910
869
 
870
+ interface SwitchProps {
871
+ defaultChecked: boolean;
872
+ disabled: boolean;
873
+ onCheckedChange?: (checked: boolean) => void;
874
+ name?: string;
875
+ value?: string;
876
+ checked?: boolean;
877
+ }
878
+
879
+ declare const Switch: React$1.FC<SwitchProps>;
880
+
911
881
  type InputType = 'numeric' | 'alpha' | 'alphanumeric';
912
882
  interface VerificationCodeProps {
913
883
  /** Define o número de dígitos do código (padrão: 6) */
@@ -1042,5 +1012,5 @@ declare function useInfiniteScroll({ status, page, lastPage, onLoadMore, thresho
1042
1012
 
1043
1013
  declare const normalizeText: (text: React.ReactNode) => string;
1044
1014
 
1045
- export { Avatar, Badge, Button, MemoizedCalendar as Calendar, Callout, MemoizedCheckbox as Checkbox, CheckboxRadix, MemoizedChips as Chips, Container, _default as DatePicker, MemoizedDialog as Dialog, Drawer, MemoizedDropdown as Dropdown, Filter, ListItem, Menu, MenuRadix, memorizedQuantity as Quantity, MemoizedRadio as Radio, RadioRadix, Search, Select, SelectField, SelectRadix, Table, TableHeader, TablePagination, MemoizedTextField as TextField, ToastProvider as Toast, ToastProvider, Tooltip, VerificationCode, normalizeText, useApiSimulation, useInfiniteScroll, useToast };
1046
- export type { AvatarProps, BadgeProps, ButtonProps, CalendarItem, CalendarProps, CalloutProps, CheckboxProps, CheckboxRadixProps, ChipsProps, ContainerProps, DateFormat, DatePickerProps, DayItem, DialogProps, DrawerProps, DropdownItem, DropdownProps, DropdownType, EmptyItem, FilterItem, FilterProps, ListItemProps, Locale, MenuItem, MenuProps, MenuRadixProps, QuantityProps, RadioProps$1 as RadioProps, RadioProps as RadioRadixItemProps, RadioGroupProps as RadioRadixProps, SearchProps, SelectFieldProps, SelectOption, SelectProps, SelectRadixProps, TableHeaderProps, TablePaginationProps, TableProps, TextFieldProps, ToastContextType, ToastMessage, ToastOptions, ToastType, TooltipProps, VerificationCodeProps, YearItem };
1015
+ export { Avatar, Badge, Button, MemoizedCalendar as Calendar, Callout, Checkbox, MemoizedChips as Chips, Container, _default$1 as DatePicker, MemoizedDialog as Dialog, Drawer, MemoizedDropdown as Dropdown, Filter, ListItem, Menu, MenuRadix, memorizedQuantity as Quantity, Radio, Search, Select, SelectField, SelectRadix, Switch, Table, TableHeader, TablePagination, _default as TextField, ToastProvider as Toast, ToastProvider, Tooltip, VerificationCode, normalizeText, useApiSimulation, useInfiniteScroll, useToast };
1016
+ export type { AvatarProps, BadgeProps, ButtonProps, CalendarItem, CalendarProps, CalloutProps, CheckboxProps, ChipsProps, ContainerProps, DateFormat, DatePickerProps, DayItem, DialogProps, DrawerProps, DropdownItem, DropdownProps, DropdownType, EmptyItem, FilterItem, FilterProps, ListItemProps, Locale, MenuItem, MenuProps, MenuRadixProps, QuantityProps, RadioGroupProps, RadioProps, SearchProps, SelectFieldProps, SelectOption, SelectProps, SelectRadixProps, SwitchProps, TableHeaderProps, TablePaginationProps, TableProps, TextFieldProps, ToastContextType, ToastMessage, ToastOptions, ToastType, TooltipProps, VerificationCodeProps, YearItem };