@sigep/react 1.0.0 → 1.1.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.mts +142 -2
- package/dist/index.d.ts +142 -2
- package/dist/index.js +788 -2
- package/dist/index.mjs +767 -1
- package/package.json +4 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { ComponentProps } from 'react';
|
|
2
|
+
import { ComponentProps, InputHTMLAttributes, ReactNode, TextareaHTMLAttributes } from 'react';
|
|
3
3
|
import * as tailwind_variants from 'tailwind-variants';
|
|
4
4
|
import { VariantProps } from 'tailwind-variants';
|
|
5
5
|
import * as tailwind_variants_dist_config_js from 'tailwind-variants/dist/config.js';
|
|
@@ -94,4 +94,144 @@ interface ButtonProps extends ComponentProps<"button">, ButtonVariants {
|
|
|
94
94
|
}
|
|
95
95
|
declare const Button: react.ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & react.RefAttributes<HTMLButtonElement>>;
|
|
96
96
|
|
|
97
|
-
|
|
97
|
+
interface InputBaseProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "onChange" | "size"> {
|
|
98
|
+
label?: string;
|
|
99
|
+
error?: boolean;
|
|
100
|
+
errorMessage?: string;
|
|
101
|
+
required?: boolean;
|
|
102
|
+
size?: "sm" | "md" | "lg";
|
|
103
|
+
leftIcon?: ReactNode;
|
|
104
|
+
rightIcon?: ReactNode;
|
|
105
|
+
classContainer?: string;
|
|
106
|
+
classInput?: string;
|
|
107
|
+
}
|
|
108
|
+
interface InputStringProps extends InputBaseProps {
|
|
109
|
+
value?: string;
|
|
110
|
+
onChange?: (value: string) => void;
|
|
111
|
+
showClearButton?: boolean;
|
|
112
|
+
}
|
|
113
|
+
interface InputEmailProps extends InputBaseProps {
|
|
114
|
+
value?: string;
|
|
115
|
+
onChange?: (value: string) => void;
|
|
116
|
+
}
|
|
117
|
+
interface InputPasswordProps extends InputBaseProps {
|
|
118
|
+
value?: string;
|
|
119
|
+
onChange?: (value: string) => void;
|
|
120
|
+
}
|
|
121
|
+
interface InputNumberProps extends InputBaseProps {
|
|
122
|
+
value?: number;
|
|
123
|
+
onChange?: (value: number | undefined) => void;
|
|
124
|
+
min?: number;
|
|
125
|
+
max?: number;
|
|
126
|
+
}
|
|
127
|
+
interface InputCPFProps extends InputBaseProps {
|
|
128
|
+
value?: string;
|
|
129
|
+
onChange?: (value: string) => void;
|
|
130
|
+
}
|
|
131
|
+
interface InputCNPJProps extends InputBaseProps {
|
|
132
|
+
value?: string;
|
|
133
|
+
onChange?: (value: string) => void;
|
|
134
|
+
}
|
|
135
|
+
interface InputPhoneProps extends InputBaseProps {
|
|
136
|
+
value?: string;
|
|
137
|
+
onChange?: (value: string) => void;
|
|
138
|
+
}
|
|
139
|
+
interface InputCurrencyProps extends InputBaseProps {
|
|
140
|
+
value?: number;
|
|
141
|
+
onChange?: (value: number | undefined) => void;
|
|
142
|
+
prefix?: string;
|
|
143
|
+
decimalScale?: number;
|
|
144
|
+
allowNegative?: boolean;
|
|
145
|
+
}
|
|
146
|
+
interface InputCepProps extends InputBaseProps {
|
|
147
|
+
value?: string;
|
|
148
|
+
onChange?: (value: string) => void;
|
|
149
|
+
}
|
|
150
|
+
interface InputCheckboxProps {
|
|
151
|
+
label?: string;
|
|
152
|
+
checked?: boolean;
|
|
153
|
+
indeterminate?: boolean;
|
|
154
|
+
onChange?: (checked: boolean) => void;
|
|
155
|
+
disabled?: boolean;
|
|
156
|
+
error?: boolean;
|
|
157
|
+
labelPosition?: "left" | "right";
|
|
158
|
+
className?: string;
|
|
159
|
+
name?: string;
|
|
160
|
+
required?: boolean;
|
|
161
|
+
}
|
|
162
|
+
interface InputRadioOption {
|
|
163
|
+
label: string;
|
|
164
|
+
value: string | number;
|
|
165
|
+
disabled?: boolean;
|
|
166
|
+
}
|
|
167
|
+
interface InputRadioProps {
|
|
168
|
+
label?: string;
|
|
169
|
+
options: InputRadioOption[];
|
|
170
|
+
value?: string | number;
|
|
171
|
+
onChange?: (value: string | number) => void;
|
|
172
|
+
disabled?: boolean;
|
|
173
|
+
error?: boolean;
|
|
174
|
+
required?: boolean;
|
|
175
|
+
name: string;
|
|
176
|
+
className?: string;
|
|
177
|
+
direction?: "horizontal" | "vertical";
|
|
178
|
+
}
|
|
179
|
+
interface TextareaProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, "onChange" | "size"> {
|
|
180
|
+
label?: string;
|
|
181
|
+
error?: boolean;
|
|
182
|
+
errorMessage?: string;
|
|
183
|
+
required?: boolean;
|
|
184
|
+
size?: "sm" | "md" | "lg";
|
|
185
|
+
classInput?: string;
|
|
186
|
+
value?: string;
|
|
187
|
+
onChange?: (value: string) => void;
|
|
188
|
+
rows?: number;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
declare const InputString: react.ForwardRefExoticComponent<InputStringProps & react.RefAttributes<HTMLInputElement>>;
|
|
192
|
+
|
|
193
|
+
declare const InputEmail: react.ForwardRefExoticComponent<InputEmailProps & react.RefAttributes<HTMLInputElement>>;
|
|
194
|
+
|
|
195
|
+
declare const InputPassword: react.ForwardRefExoticComponent<InputPasswordProps & react.RefAttributes<HTMLInputElement>>;
|
|
196
|
+
|
|
197
|
+
declare const InputNumber: react.ForwardRefExoticComponent<InputNumberProps & react.RefAttributes<HTMLInputElement>>;
|
|
198
|
+
|
|
199
|
+
declare const InputCPF: react.ForwardRefExoticComponent<InputCPFProps & react.RefAttributes<HTMLInputElement>>;
|
|
200
|
+
|
|
201
|
+
declare const InputCNPJ: react.ForwardRefExoticComponent<InputCNPJProps & react.RefAttributes<HTMLInputElement>>;
|
|
202
|
+
|
|
203
|
+
declare const InputPhone: react.ForwardRefExoticComponent<InputPhoneProps & react.RefAttributes<HTMLInputElement>>;
|
|
204
|
+
|
|
205
|
+
declare const InputCurrency: react.ForwardRefExoticComponent<InputCurrencyProps & react.RefAttributes<HTMLInputElement>>;
|
|
206
|
+
|
|
207
|
+
declare const InputCep: react.ForwardRefExoticComponent<InputCepProps & react.RefAttributes<HTMLInputElement>>;
|
|
208
|
+
|
|
209
|
+
declare const InputCheckbox: react.ForwardRefExoticComponent<InputCheckboxProps & react.RefAttributes<HTMLButtonElement>>;
|
|
210
|
+
|
|
211
|
+
declare const InputRadio: react.ForwardRefExoticComponent<InputRadioProps & react.RefAttributes<HTMLDivElement>>;
|
|
212
|
+
|
|
213
|
+
declare const Textarea: react.ForwardRefExoticComponent<TextareaProps & react.RefAttributes<HTMLTextAreaElement>>;
|
|
214
|
+
|
|
215
|
+
interface InputWrapperProps {
|
|
216
|
+
label?: string;
|
|
217
|
+
error?: boolean;
|
|
218
|
+
errorMessage?: string;
|
|
219
|
+
required?: boolean;
|
|
220
|
+
disabled?: boolean;
|
|
221
|
+
size?: 'sm' | 'md' | 'lg';
|
|
222
|
+
children: ReactNode;
|
|
223
|
+
className?: string;
|
|
224
|
+
classContainer?: string;
|
|
225
|
+
htmlFor?: string;
|
|
226
|
+
}
|
|
227
|
+
declare const InputWrapper: react.ForwardRefExoticComponent<InputWrapperProps & react.RefAttributes<HTMLDivElement>>;
|
|
228
|
+
|
|
229
|
+
declare function maskCPF(value: string): string;
|
|
230
|
+
declare function maskCNPJ(value: string): string;
|
|
231
|
+
declare function maskPhone(value: string): string;
|
|
232
|
+
declare function maskCEP(value: string): string;
|
|
233
|
+
declare function unmask(value: string): string;
|
|
234
|
+
declare function maskCurrency(value: number, prefix?: string, decimalScale?: number): string;
|
|
235
|
+
declare function unmaskCurrency(value: string): number;
|
|
236
|
+
|
|
237
|
+
export { Button, type ButtonProps, type InputBaseProps, InputCNPJ, type InputCNPJProps, InputCPF, type InputCPFProps, InputCep, type InputCepProps, InputCheckbox, type InputCheckboxProps, InputCurrency, type InputCurrencyProps, InputEmail, type InputEmailProps, InputNumber, type InputNumberProps, InputPassword, type InputPasswordProps, InputPhone, type InputPhoneProps, InputRadio, type InputRadioOption, type InputRadioProps, InputString, type InputStringProps, InputWrapper, Textarea, type TextareaProps, button, maskCEP, maskCNPJ, maskCPF, maskCurrency, maskPhone, unmask, unmaskCurrency };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { ComponentProps } from 'react';
|
|
2
|
+
import { ComponentProps, InputHTMLAttributes, ReactNode, TextareaHTMLAttributes } from 'react';
|
|
3
3
|
import * as tailwind_variants from 'tailwind-variants';
|
|
4
4
|
import { VariantProps } from 'tailwind-variants';
|
|
5
5
|
import * as tailwind_variants_dist_config_js from 'tailwind-variants/dist/config.js';
|
|
@@ -94,4 +94,144 @@ interface ButtonProps extends ComponentProps<"button">, ButtonVariants {
|
|
|
94
94
|
}
|
|
95
95
|
declare const Button: react.ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & react.RefAttributes<HTMLButtonElement>>;
|
|
96
96
|
|
|
97
|
-
|
|
97
|
+
interface InputBaseProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "onChange" | "size"> {
|
|
98
|
+
label?: string;
|
|
99
|
+
error?: boolean;
|
|
100
|
+
errorMessage?: string;
|
|
101
|
+
required?: boolean;
|
|
102
|
+
size?: "sm" | "md" | "lg";
|
|
103
|
+
leftIcon?: ReactNode;
|
|
104
|
+
rightIcon?: ReactNode;
|
|
105
|
+
classContainer?: string;
|
|
106
|
+
classInput?: string;
|
|
107
|
+
}
|
|
108
|
+
interface InputStringProps extends InputBaseProps {
|
|
109
|
+
value?: string;
|
|
110
|
+
onChange?: (value: string) => void;
|
|
111
|
+
showClearButton?: boolean;
|
|
112
|
+
}
|
|
113
|
+
interface InputEmailProps extends InputBaseProps {
|
|
114
|
+
value?: string;
|
|
115
|
+
onChange?: (value: string) => void;
|
|
116
|
+
}
|
|
117
|
+
interface InputPasswordProps extends InputBaseProps {
|
|
118
|
+
value?: string;
|
|
119
|
+
onChange?: (value: string) => void;
|
|
120
|
+
}
|
|
121
|
+
interface InputNumberProps extends InputBaseProps {
|
|
122
|
+
value?: number;
|
|
123
|
+
onChange?: (value: number | undefined) => void;
|
|
124
|
+
min?: number;
|
|
125
|
+
max?: number;
|
|
126
|
+
}
|
|
127
|
+
interface InputCPFProps extends InputBaseProps {
|
|
128
|
+
value?: string;
|
|
129
|
+
onChange?: (value: string) => void;
|
|
130
|
+
}
|
|
131
|
+
interface InputCNPJProps extends InputBaseProps {
|
|
132
|
+
value?: string;
|
|
133
|
+
onChange?: (value: string) => void;
|
|
134
|
+
}
|
|
135
|
+
interface InputPhoneProps extends InputBaseProps {
|
|
136
|
+
value?: string;
|
|
137
|
+
onChange?: (value: string) => void;
|
|
138
|
+
}
|
|
139
|
+
interface InputCurrencyProps extends InputBaseProps {
|
|
140
|
+
value?: number;
|
|
141
|
+
onChange?: (value: number | undefined) => void;
|
|
142
|
+
prefix?: string;
|
|
143
|
+
decimalScale?: number;
|
|
144
|
+
allowNegative?: boolean;
|
|
145
|
+
}
|
|
146
|
+
interface InputCepProps extends InputBaseProps {
|
|
147
|
+
value?: string;
|
|
148
|
+
onChange?: (value: string) => void;
|
|
149
|
+
}
|
|
150
|
+
interface InputCheckboxProps {
|
|
151
|
+
label?: string;
|
|
152
|
+
checked?: boolean;
|
|
153
|
+
indeterminate?: boolean;
|
|
154
|
+
onChange?: (checked: boolean) => void;
|
|
155
|
+
disabled?: boolean;
|
|
156
|
+
error?: boolean;
|
|
157
|
+
labelPosition?: "left" | "right";
|
|
158
|
+
className?: string;
|
|
159
|
+
name?: string;
|
|
160
|
+
required?: boolean;
|
|
161
|
+
}
|
|
162
|
+
interface InputRadioOption {
|
|
163
|
+
label: string;
|
|
164
|
+
value: string | number;
|
|
165
|
+
disabled?: boolean;
|
|
166
|
+
}
|
|
167
|
+
interface InputRadioProps {
|
|
168
|
+
label?: string;
|
|
169
|
+
options: InputRadioOption[];
|
|
170
|
+
value?: string | number;
|
|
171
|
+
onChange?: (value: string | number) => void;
|
|
172
|
+
disabled?: boolean;
|
|
173
|
+
error?: boolean;
|
|
174
|
+
required?: boolean;
|
|
175
|
+
name: string;
|
|
176
|
+
className?: string;
|
|
177
|
+
direction?: "horizontal" | "vertical";
|
|
178
|
+
}
|
|
179
|
+
interface TextareaProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, "onChange" | "size"> {
|
|
180
|
+
label?: string;
|
|
181
|
+
error?: boolean;
|
|
182
|
+
errorMessage?: string;
|
|
183
|
+
required?: boolean;
|
|
184
|
+
size?: "sm" | "md" | "lg";
|
|
185
|
+
classInput?: string;
|
|
186
|
+
value?: string;
|
|
187
|
+
onChange?: (value: string) => void;
|
|
188
|
+
rows?: number;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
declare const InputString: react.ForwardRefExoticComponent<InputStringProps & react.RefAttributes<HTMLInputElement>>;
|
|
192
|
+
|
|
193
|
+
declare const InputEmail: react.ForwardRefExoticComponent<InputEmailProps & react.RefAttributes<HTMLInputElement>>;
|
|
194
|
+
|
|
195
|
+
declare const InputPassword: react.ForwardRefExoticComponent<InputPasswordProps & react.RefAttributes<HTMLInputElement>>;
|
|
196
|
+
|
|
197
|
+
declare const InputNumber: react.ForwardRefExoticComponent<InputNumberProps & react.RefAttributes<HTMLInputElement>>;
|
|
198
|
+
|
|
199
|
+
declare const InputCPF: react.ForwardRefExoticComponent<InputCPFProps & react.RefAttributes<HTMLInputElement>>;
|
|
200
|
+
|
|
201
|
+
declare const InputCNPJ: react.ForwardRefExoticComponent<InputCNPJProps & react.RefAttributes<HTMLInputElement>>;
|
|
202
|
+
|
|
203
|
+
declare const InputPhone: react.ForwardRefExoticComponent<InputPhoneProps & react.RefAttributes<HTMLInputElement>>;
|
|
204
|
+
|
|
205
|
+
declare const InputCurrency: react.ForwardRefExoticComponent<InputCurrencyProps & react.RefAttributes<HTMLInputElement>>;
|
|
206
|
+
|
|
207
|
+
declare const InputCep: react.ForwardRefExoticComponent<InputCepProps & react.RefAttributes<HTMLInputElement>>;
|
|
208
|
+
|
|
209
|
+
declare const InputCheckbox: react.ForwardRefExoticComponent<InputCheckboxProps & react.RefAttributes<HTMLButtonElement>>;
|
|
210
|
+
|
|
211
|
+
declare const InputRadio: react.ForwardRefExoticComponent<InputRadioProps & react.RefAttributes<HTMLDivElement>>;
|
|
212
|
+
|
|
213
|
+
declare const Textarea: react.ForwardRefExoticComponent<TextareaProps & react.RefAttributes<HTMLTextAreaElement>>;
|
|
214
|
+
|
|
215
|
+
interface InputWrapperProps {
|
|
216
|
+
label?: string;
|
|
217
|
+
error?: boolean;
|
|
218
|
+
errorMessage?: string;
|
|
219
|
+
required?: boolean;
|
|
220
|
+
disabled?: boolean;
|
|
221
|
+
size?: 'sm' | 'md' | 'lg';
|
|
222
|
+
children: ReactNode;
|
|
223
|
+
className?: string;
|
|
224
|
+
classContainer?: string;
|
|
225
|
+
htmlFor?: string;
|
|
226
|
+
}
|
|
227
|
+
declare const InputWrapper: react.ForwardRefExoticComponent<InputWrapperProps & react.RefAttributes<HTMLDivElement>>;
|
|
228
|
+
|
|
229
|
+
declare function maskCPF(value: string): string;
|
|
230
|
+
declare function maskCNPJ(value: string): string;
|
|
231
|
+
declare function maskPhone(value: string): string;
|
|
232
|
+
declare function maskCEP(value: string): string;
|
|
233
|
+
declare function unmask(value: string): string;
|
|
234
|
+
declare function maskCurrency(value: number, prefix?: string, decimalScale?: number): string;
|
|
235
|
+
declare function unmaskCurrency(value: string): number;
|
|
236
|
+
|
|
237
|
+
export { Button, type ButtonProps, type InputBaseProps, InputCNPJ, type InputCNPJProps, InputCPF, type InputCPFProps, InputCep, type InputCepProps, InputCheckbox, type InputCheckboxProps, InputCurrency, type InputCurrencyProps, InputEmail, type InputEmailProps, InputNumber, type InputNumberProps, InputPassword, type InputPasswordProps, InputPhone, type InputPhoneProps, InputRadio, type InputRadioOption, type InputRadioProps, InputString, type InputStringProps, InputWrapper, Textarea, type TextareaProps, button, maskCEP, maskCNPJ, maskCPF, maskCurrency, maskPhone, unmask, unmaskCurrency };
|