@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.
- package/dist/components/Checkbox/Checkbox.d.ts +4 -4
- package/dist/components/Checkbox/Checkbox.types.d.ts +4 -19
- package/dist/components/Checkbox/__tests__/Checkbox.test.d.ts +1 -0
- package/dist/components/Radio/Radio.d.ts +3 -3
- package/dist/components/Radio/Radio.types.d.ts +11 -14
- package/dist/components/Radio/__tests__/Radio.test.d.ts +1 -0
- package/dist/components/Radio/index.d.ts +1 -0
- package/dist/components/SelectRadix/SelectRadix.types.d.ts +5 -3
- package/dist/components/Switch/Switch.d.ts +4 -0
- package/dist/components/Switch/Switch.types.d.ts +8 -0
- package/dist/components/Switch/__tests__/Switch.test.d.ts +1 -0
- package/dist/components/Switch/index.d.ts +2 -0
- package/dist/components/TextField/TextField.d.ts +2 -2
- package/dist/components/TextField/TextField.types.d.ts +23 -14
- package/dist/components/TextField/__tests__/Textfield.test.d.ts +1 -0
- package/dist/components/TextField/utils/__tests__/validation.test.d.ts +1 -0
- package/dist/components/TextField/utils/index.d.ts +2 -0
- package/dist/components/TextField/utils/validation.d.ts +8 -0
- package/dist/components/Tooltip/Tooltip.d.ts +1 -1
- package/dist/components/Tooltip/Tooltip.types.d.ts +5 -1
- package/dist/components/Tooltip/__tests__/Tooltip.test.d.ts +1 -0
- package/dist/components/Tooltip/index.d.ts +1 -0
- package/dist/components/index.d.ts +3 -5
- package/dist/index.cjs +202 -327
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +42 -72
- package/dist/index.esm.js +215 -321
- package/dist/index.esm.js.map +1 -1
- package/dist/shared/Label/index.d.ts +4 -2
- package/dist/styles.css +1 -1
- package/package.json +15 -13
- package/dist/components/CheckboxRadix/CheckboxRadix.d.ts +0 -4
- package/dist/components/CheckboxRadix/CheckboxRadix.types.d.ts +0 -10
- package/dist/components/CheckboxRadix/index.d.ts +0 -2
- package/dist/components/RadioRadix/RadioRadix.d.ts +0 -4
- package/dist/components/RadioRadix/RadioRadix.types.d.ts +0 -15
- package/dist/components/RadioRadix/index.d.ts +0 -2
- package/dist/components/TextField/ValidationUtils.d.ts +0 -8
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import
|
|
3
|
-
declare const
|
|
4
|
-
export default
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { CheckboxProps } from './Checkbox.types';
|
|
3
|
+
declare const Checkbox: React.FC<CheckboxProps>;
|
|
4
|
+
export default Checkbox;
|
|
@@ -1,25 +1,10 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
export interface CheckboxProps {
|
|
3
|
-
/** Unique identifier for the checkbox input */
|
|
4
2
|
id?: string;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
label?: React.ReactNode;
|
|
4
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
5
|
+
defaultChecked?: boolean;
|
|
8
6
|
checked?: boolean;
|
|
9
|
-
/** Callback function triggered when the checkbox value changes */
|
|
10
|
-
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
11
|
-
/** Label text displayed next to the checkbox */
|
|
12
|
-
label?: string | React.ReactNode;
|
|
13
|
-
/** Additional CSS classes for custom styling */
|
|
14
|
-
className?: string;
|
|
15
|
-
/** Value attribute for the checkbox input element */
|
|
16
|
-
value?: string;
|
|
17
|
-
/** AriaDescribedBy for the checkbox input element */
|
|
18
|
-
ariaDescribedby?: string;
|
|
19
|
-
/** Disables the checkbox, preventing user interaction */
|
|
20
7
|
disabled?: boolean;
|
|
21
|
-
|
|
8
|
+
className?: string;
|
|
22
9
|
indeterminate?: boolean;
|
|
23
|
-
/** Additional props passed to the checkbox input element */
|
|
24
|
-
[key: string]: any;
|
|
25
10
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
3
|
-
declare const
|
|
4
|
-
export default
|
|
2
|
+
import { RadioGroupProps } from './Radio.types';
|
|
3
|
+
declare const Radio: React.FC<RadioGroupProps>;
|
|
4
|
+
export default Radio;
|
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
export interface RadioProps {
|
|
2
|
-
|
|
3
|
-
name?: string;
|
|
4
|
-
/** O valor associado ao botão de rádio */
|
|
2
|
+
id?: string | number;
|
|
5
3
|
value: string;
|
|
6
|
-
|
|
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 */
|
|
4
|
+
label: string;
|
|
17
5
|
disabled?: boolean;
|
|
18
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 @@
|
|
|
1
|
+
export {};
|
|
@@ -10,7 +10,7 @@ export interface SelectItemProps {
|
|
|
10
10
|
}
|
|
11
11
|
export interface CheckboxItemProps extends SelectItemProps {
|
|
12
12
|
checked: boolean;
|
|
13
|
-
|
|
13
|
+
onCheckedChange: (checked: boolean) => void;
|
|
14
14
|
}
|
|
15
15
|
export type SelectVariant = 'text' | 'icon' | 'checkbox';
|
|
16
16
|
export interface SelectRadixProps {
|
|
@@ -23,8 +23,6 @@ export interface SelectRadixProps {
|
|
|
23
23
|
multiple?: boolean;
|
|
24
24
|
placeholder?: string;
|
|
25
25
|
search?: boolean;
|
|
26
|
-
tooltip?: boolean;
|
|
27
|
-
tooltipMessage?: string;
|
|
28
26
|
label?: string;
|
|
29
27
|
helperText?: string;
|
|
30
28
|
maxWidth?: string | number;
|
|
@@ -33,6 +31,10 @@ export interface SelectRadixProps {
|
|
|
33
31
|
className?: string;
|
|
34
32
|
'aria-label'?: string;
|
|
35
33
|
'data-testid'?: string;
|
|
34
|
+
tooltip?: boolean;
|
|
35
|
+
tooltipText?: string;
|
|
36
|
+
side?: "top" | "right" | "bottom" | "left";
|
|
37
|
+
align?: "start" | "center" | "end";
|
|
36
38
|
enableInfiniteScroll?: boolean;
|
|
37
39
|
onScrollEnd?: () => void;
|
|
38
40
|
isLoadingMore?: boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { TextFieldProps } from './TextField.types';
|
|
3
|
-
declare const
|
|
4
|
-
export default
|
|
3
|
+
declare const _default: React.NamedExoticComponent<TextFieldProps & React.RefAttributes<HTMLInputElement>>;
|
|
4
|
+
export default _default;
|
|
@@ -1,22 +1,31 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
export type TextFieldType = 'text' | 'email' | 'password' | 'number' | 'tel' | 'url';
|
|
3
|
+
export type TooltipPosition = 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left';
|
|
4
|
+
export interface TextFieldProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'value' | 'type'> {
|
|
5
|
+
/** Controlled value */
|
|
6
|
+
value?: string;
|
|
7
|
+
/** Change handler - receives string value */
|
|
8
|
+
onChange?: (value: string) => void;
|
|
9
|
+
/** Label text */
|
|
6
10
|
label?: string;
|
|
7
|
-
|
|
8
|
-
type?:
|
|
9
|
-
|
|
10
|
-
disabled?: boolean;
|
|
11
|
-
maxLength?: number;
|
|
12
|
-
required?: boolean;
|
|
13
|
-
helper?: boolean;
|
|
11
|
+
/** Input type */
|
|
12
|
+
type?: TextFieldType;
|
|
13
|
+
/** Helper text (shown below input) */
|
|
14
14
|
helperText?: string;
|
|
15
|
+
/** Show tooltip with info icon */
|
|
15
16
|
tooltip?: boolean;
|
|
17
|
+
/** Tooltip content */
|
|
16
18
|
tooltipText?: string;
|
|
17
|
-
|
|
19
|
+
side?: "top" | "right" | "bottom" | "left";
|
|
20
|
+
align?: "start" | "center" | "end";
|
|
18
21
|
errorMessage?: string;
|
|
19
|
-
|
|
20
|
-
id?: string;
|
|
22
|
+
/** Leading icon */
|
|
21
23
|
icon?: React.ReactNode;
|
|
22
24
|
}
|
|
25
|
+
export interface ValidationParams {
|
|
26
|
+
value: string;
|
|
27
|
+
maxLength?: number;
|
|
28
|
+
type?: TextFieldType;
|
|
29
|
+
errorMessage?: string;
|
|
30
|
+
required?: boolean;
|
|
31
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -2,6 +2,10 @@ import React from 'react';
|
|
|
2
2
|
export interface TooltipProps {
|
|
3
3
|
id?: string;
|
|
4
4
|
text: React.ReactNode;
|
|
5
|
-
|
|
5
|
+
side?: "top" | "right" | "bottom" | "left";
|
|
6
|
+
align?: "start" | "center" | "end";
|
|
7
|
+
sideOffset?: number;
|
|
8
|
+
alignOffset?: number;
|
|
9
|
+
maxWidth?: number;
|
|
6
10
|
children: React.ReactNode;
|
|
7
11
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -10,8 +10,6 @@ export { default as Callout } from './Callout';
|
|
|
10
10
|
export { type CalloutProps } from './Callout/Callout.types';
|
|
11
11
|
export { default as Checkbox } from './Checkbox';
|
|
12
12
|
export { type CheckboxProps } from './Checkbox/Checkbox.types';
|
|
13
|
-
export { default as CheckboxRadix } from './CheckboxRadix';
|
|
14
|
-
export { type CheckboxRadixProps } from './CheckboxRadix/CheckboxRadix.types';
|
|
15
13
|
export { default as Chips } from './Chips';
|
|
16
14
|
export { type ChipsProps } from './Chips/Chips.types';
|
|
17
15
|
export { default as Container } from './Container';
|
|
@@ -35,9 +33,7 @@ export { type MenuRadixProps } from './MenuRadix/MenuRadix.types';
|
|
|
35
33
|
export { default as Quantity } from './Quantity';
|
|
36
34
|
export { type QuantityProps } from './Quantity/Quantity.types';
|
|
37
35
|
export { default as Radio } from './Radio';
|
|
38
|
-
export { type RadioProps } from './Radio/Radio.types';
|
|
39
|
-
export { default as RadioRadix } from './RadioRadix';
|
|
40
|
-
export { type RadioGroupProps as RadioRadixProps, type RadioProps as RadioRadixItemProps } from './RadioRadix/RadioRadix.types';
|
|
36
|
+
export { type RadioGroupProps, type RadioProps } from './Radio/Radio.types';
|
|
41
37
|
export { default as Search } from './Search';
|
|
42
38
|
export { type SearchProps } from './Search/Search.types';
|
|
43
39
|
export { default as Select } from './Select';
|
|
@@ -58,6 +54,8 @@ export { default as Toast, ToastProvider, useToast } from './Toast';
|
|
|
58
54
|
export { type ToastType, type ToastMessage, type ToastOptions, type ToastContextType } from './Toast/Toast.types';
|
|
59
55
|
export { default as Tooltip } from './Tooltip';
|
|
60
56
|
export { type TooltipProps } from './Tooltip/Tooltip.types';
|
|
57
|
+
export { default as Switch } from './Switch';
|
|
58
|
+
export { type SwitchProps } from './Switch/Switch.types';
|
|
61
59
|
export { default as VerificationCode } from './VerificationCode';
|
|
62
60
|
export { type VerificationCodeProps } from './VerificationCode/VerificationCode.types';
|
|
63
61
|
export { default as useApiSimulation } from '../hooks/ApiSimulation';
|