@lets-events/react 11.7.1 → 11.7.3
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/.turbo/turbo-build.log +8 -8
- package/CHANGELOG.md +12 -0
- package/dist/index.d.mts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.js +9 -3
- package/dist/index.mjs +9 -3
- package/package.json +1 -1
- package/src/components/FormFields/EmailFormField.tsx +3 -1
- package/src/components/FormFields/Form.tsx +12 -4
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @lets-events/react@11.7.
|
|
2
|
+
> @lets-events/react@11.7.3 build
|
|
3
3
|
> tsup src/index.tsx --format esm,cjs --dts --external react
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.tsx
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
[34mCLI[39m Target: es6
|
|
9
9
|
[34mESM[39m Build start
|
|
10
10
|
[34mCJS[39m Build start
|
|
11
|
-
[32mCJS[39m [1mdist\index.js [22m[32m332.02 KB[39m
|
|
12
|
-
[32mCJS[39m ⚡️ Build success in 316ms
|
|
13
|
-
[32mESM[39m [1mdist\index.mjs [22m[32m319.88 KB[39m
|
|
14
|
-
[32mESM[39m ⚡️ Build success in 318ms
|
|
15
11
|
[34mDTS[39m Build start
|
|
16
|
-
[
|
|
17
|
-
[
|
|
18
|
-
[
|
|
12
|
+
[32mCJS[39m [1mdist\index.js [22m[32m332.14 KB[39m
|
|
13
|
+
[32mCJS[39m ⚡️ Build success in 908ms
|
|
14
|
+
[32mESM[39m [1mdist\index.mjs [22m[32m320.00 KB[39m
|
|
15
|
+
[32mESM[39m ⚡️ Build success in 909ms
|
|
16
|
+
[32mDTS[39m ⚡️ Build success in 4528ms
|
|
17
|
+
[32mDTS[39m [1mdist\index.d.mts [22m[32m383.65 KB[39m
|
|
18
|
+
[32mDTS[39m [1mdist\index.d.ts [22m[32m383.65 KB[39m
|
package/CHANGELOG.md
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -13,7 +13,7 @@ import { VariantProps } from '@stitches/react';
|
|
|
13
13
|
import { MaskOptions, format, unformat } from '@react-input/mask';
|
|
14
14
|
import { Dialog } from 'radix-ui';
|
|
15
15
|
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
16
|
-
import { FieldError, Merge, FieldErrorsImpl, FieldValues, UseFormProps, SubmitHandler, useForm } from 'react-hook-form';
|
|
16
|
+
import { FieldError, Merge, FieldErrorsImpl, FieldValues, UseFormProps, SubmitHandler, UseFormReturn, useForm } from 'react-hook-form';
|
|
17
17
|
|
|
18
18
|
interface IconProps extends Omit<FontAwesomeIconProps, "icon" | "size"> {
|
|
19
19
|
name: IconName;
|
|
@@ -14535,7 +14535,7 @@ declare const TextFormField: ({ name, label, required, mask, validate, validatio
|
|
|
14535
14535
|
|
|
14536
14536
|
type FormProps<T extends FieldValues = FieldValues> = UseFormProps<T> & {
|
|
14537
14537
|
onSubmit: SubmitHandler<T>;
|
|
14538
|
-
children: JSX.Element;
|
|
14538
|
+
children: JSX.Element | ((p: UseFormReturn<T, any, T>) => JSX.Element);
|
|
14539
14539
|
methods?: ReturnType<typeof useForm<T>>;
|
|
14540
14540
|
};
|
|
14541
14541
|
declare const Form: <T extends FieldValues = FieldValues>({ onSubmit, children, ...props }: FormProps<T>) => react_jsx_runtime.JSX.Element;
|
|
@@ -14668,7 +14668,8 @@ type EmailFormFieldProps = {
|
|
|
14668
14668
|
name: string;
|
|
14669
14669
|
label?: string;
|
|
14670
14670
|
required?: boolean;
|
|
14671
|
+
placeholder?: string;
|
|
14671
14672
|
};
|
|
14672
|
-
declare const EmailFormField: ({ name, label, required, }: EmailFormFieldProps) => react_jsx_runtime.JSX.Element;
|
|
14673
|
+
declare const EmailFormField: ({ name, label, required, placeholder, }: EmailFormFieldProps) => react_jsx_runtime.JSX.Element;
|
|
14673
14674
|
|
|
14674
14675
|
export { AddressFormFields, Alert, AlertDialogCompleteStyled, AlertDialogDescriptionStyled, AlertDialogRowStyled, AlertDialogSimpleStyled, AlertDialogSubtitleStyled, AlertDialogTitleStyled, AlertDialoghrStyled, type AlertProps, Avatar, type AvatarProps, AvatarStyled, Badge, type BadgeProps, BadgeStyled, BirthDateFormField, Box, Button, ButtonGroup, type ButtonGroupProps, ButtonGroupStyled, ButtonItem, type ButtonItemProps, ButtonItemStyled, type ButtonProps, CNPJFormField, CPFFormField, Calendar, type CalendarProps, Card, type CardProps, CardStyled, CheckboxGroup, CheckboxGroupFormField, type CheckboxGroupFormFieldProps, type CheckboxGroupProps, CheckboxGroupStyled, CheckboxItem, type CheckboxItemProps, Container, type ContainerProps, ContainerStyled, CountryFormField, Drawer, type DrawerProps, DropdownMenu, DropdownMenuItem, type DropdownMenuItemProps, type DropdownMenuProps, EmailFormField, type EmailFormFieldProps, ErrorFormMessage, type ErrorFormMessageProps, Filter, FilterItem, type FilterItemProps, type FilterProps, Flex, type FlexProps, FlexStyled, Form, FormLabel, type FormLabelProps, type FormProps, Grid, type GridProps, GridStyled, Icon, IdentityDocumentNumberFormField, InputStyled, MenuDropdown, type MenuDropdownProps, Modal, type ModalProps, MultiSelect, MultiSelectFormField, type MultiSelectFormFieldProps, type MultiSelectProps, PhoneFormField, type PhoneFormFieldProps, RadioGroup, RadioGroupFormField, type RadioGroupFormFieldProps, type RadioGroupProps, RadioGroupStyled, RadioItem, type RadioItemProps, Section, type SectionProps, SectionStyled, SelectFormField, type SelectFormFieldProps, Step, StepContent, StepList, type StepProps, StepStyled, StepTrigger, StepWrapper, Switch, type SwitchProps, SwitchStyled, Text, TextAreaFormField, type TextAreaFormFieldProps, TextField, type TextFieldProps, TextFieldSlot, type TextFieldSlotProps, TextFieldSlotStyled, TextFieldStyled, TextFormField, type TextFormFieldProps, type TextProps, TextStyle, TextareaField, type TextareaFieldProps, TextareaFieldStyle, TimePicker, TimePickerButtonStyled, TimePickerDropdownStyled, TimePickerFooterStyled, type TimePickerProps, TimePickerStyled, TimerPickerContentStyled, type Toast, type ToastComponentProps, type ToastConfig, type ToastContextType, ToastItem, type ToastOptions, ToastProvider, type ToastProviderProps, type ToastType, type ToasterShowOptions, Tooltip, TooltipContent, type TooltipProps, TooltipProvider, TooltipRoot, TooltipTrigger, isValidCNPJ, maskFormat, maskUnformat, useToast };
|
package/dist/index.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ import { VariantProps } from '@stitches/react';
|
|
|
13
13
|
import { MaskOptions, format, unformat } from '@react-input/mask';
|
|
14
14
|
import { Dialog } from 'radix-ui';
|
|
15
15
|
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
16
|
-
import { FieldError, Merge, FieldErrorsImpl, FieldValues, UseFormProps, SubmitHandler, useForm } from 'react-hook-form';
|
|
16
|
+
import { FieldError, Merge, FieldErrorsImpl, FieldValues, UseFormProps, SubmitHandler, UseFormReturn, useForm } from 'react-hook-form';
|
|
17
17
|
|
|
18
18
|
interface IconProps extends Omit<FontAwesomeIconProps, "icon" | "size"> {
|
|
19
19
|
name: IconName;
|
|
@@ -14535,7 +14535,7 @@ declare const TextFormField: ({ name, label, required, mask, validate, validatio
|
|
|
14535
14535
|
|
|
14536
14536
|
type FormProps<T extends FieldValues = FieldValues> = UseFormProps<T> & {
|
|
14537
14537
|
onSubmit: SubmitHandler<T>;
|
|
14538
|
-
children: JSX.Element;
|
|
14538
|
+
children: JSX.Element | ((p: UseFormReturn<T, any, T>) => JSX.Element);
|
|
14539
14539
|
methods?: ReturnType<typeof useForm<T>>;
|
|
14540
14540
|
};
|
|
14541
14541
|
declare const Form: <T extends FieldValues = FieldValues>({ onSubmit, children, ...props }: FormProps<T>) => react_jsx_runtime.JSX.Element;
|
|
@@ -14668,7 +14668,8 @@ type EmailFormFieldProps = {
|
|
|
14668
14668
|
name: string;
|
|
14669
14669
|
label?: string;
|
|
14670
14670
|
required?: boolean;
|
|
14671
|
+
placeholder?: string;
|
|
14671
14672
|
};
|
|
14672
|
-
declare const EmailFormField: ({ name, label, required, }: EmailFormFieldProps) => react_jsx_runtime.JSX.Element;
|
|
14673
|
+
declare const EmailFormField: ({ name, label, required, placeholder, }: EmailFormFieldProps) => react_jsx_runtime.JSX.Element;
|
|
14673
14674
|
|
|
14674
14675
|
export { AddressFormFields, Alert, AlertDialogCompleteStyled, AlertDialogDescriptionStyled, AlertDialogRowStyled, AlertDialogSimpleStyled, AlertDialogSubtitleStyled, AlertDialogTitleStyled, AlertDialoghrStyled, type AlertProps, Avatar, type AvatarProps, AvatarStyled, Badge, type BadgeProps, BadgeStyled, BirthDateFormField, Box, Button, ButtonGroup, type ButtonGroupProps, ButtonGroupStyled, ButtonItem, type ButtonItemProps, ButtonItemStyled, type ButtonProps, CNPJFormField, CPFFormField, Calendar, type CalendarProps, Card, type CardProps, CardStyled, CheckboxGroup, CheckboxGroupFormField, type CheckboxGroupFormFieldProps, type CheckboxGroupProps, CheckboxGroupStyled, CheckboxItem, type CheckboxItemProps, Container, type ContainerProps, ContainerStyled, CountryFormField, Drawer, type DrawerProps, DropdownMenu, DropdownMenuItem, type DropdownMenuItemProps, type DropdownMenuProps, EmailFormField, type EmailFormFieldProps, ErrorFormMessage, type ErrorFormMessageProps, Filter, FilterItem, type FilterItemProps, type FilterProps, Flex, type FlexProps, FlexStyled, Form, FormLabel, type FormLabelProps, type FormProps, Grid, type GridProps, GridStyled, Icon, IdentityDocumentNumberFormField, InputStyled, MenuDropdown, type MenuDropdownProps, Modal, type ModalProps, MultiSelect, MultiSelectFormField, type MultiSelectFormFieldProps, type MultiSelectProps, PhoneFormField, type PhoneFormFieldProps, RadioGroup, RadioGroupFormField, type RadioGroupFormFieldProps, type RadioGroupProps, RadioGroupStyled, RadioItem, type RadioItemProps, Section, type SectionProps, SectionStyled, SelectFormField, type SelectFormFieldProps, Step, StepContent, StepList, type StepProps, StepStyled, StepTrigger, StepWrapper, Switch, type SwitchProps, SwitchStyled, Text, TextAreaFormField, type TextAreaFormFieldProps, TextField, type TextFieldProps, TextFieldSlot, type TextFieldSlotProps, TextFieldSlotStyled, TextFieldStyled, TextFormField, type TextFormFieldProps, type TextProps, TextStyle, TextareaField, type TextareaFieldProps, TextareaFieldStyle, TimePicker, TimePickerButtonStyled, TimePickerDropdownStyled, TimePickerFooterStyled, type TimePickerProps, TimePickerStyled, TimerPickerContentStyled, type Toast, type ToastComponentProps, type ToastConfig, type ToastContextType, ToastItem, type ToastOptions, ToastProvider, type ToastProviderProps, type ToastType, type ToasterShowOptions, Tooltip, TooltipContent, type TooltipProps, TooltipProvider, TooltipRoot, TooltipTrigger, isValidCNPJ, maskFormat, maskUnformat, useToast };
|
package/dist/index.js
CHANGED
|
@@ -9915,7 +9915,12 @@ var Form = (_a) => {
|
|
|
9915
9915
|
const formMethods = (0, import_react_hook_form3.useForm)(__spreadValues({
|
|
9916
9916
|
mode: "onTouched"
|
|
9917
9917
|
}, props));
|
|
9918
|
-
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_react_hook_form3.FormProvider, __spreadProps(__spreadValues({}, formMethods), { children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("form", { onSubmit: formMethods.handleSubmit(onSubmit), children
|
|
9918
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_react_hook_form3.FormProvider, __spreadProps(__spreadValues({}, formMethods), { children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("form", { onSubmit: formMethods.handleSubmit(onSubmit), children: (() => {
|
|
9919
|
+
if (typeof children === "function") {
|
|
9920
|
+
return children(formMethods);
|
|
9921
|
+
}
|
|
9922
|
+
return children;
|
|
9923
|
+
})() }) }));
|
|
9919
9924
|
};
|
|
9920
9925
|
|
|
9921
9926
|
// src/components/FormFields/MultiSelectFormField.tsx
|
|
@@ -10795,7 +10800,8 @@ var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
|
10795
10800
|
var EmailFormField = ({
|
|
10796
10801
|
name,
|
|
10797
10802
|
label,
|
|
10798
|
-
required
|
|
10803
|
+
required,
|
|
10804
|
+
placeholder
|
|
10799
10805
|
}) => {
|
|
10800
10806
|
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
10801
10807
|
TextFormField,
|
|
@@ -10803,7 +10809,7 @@ var EmailFormField = ({
|
|
|
10803
10809
|
name,
|
|
10804
10810
|
label,
|
|
10805
10811
|
required,
|
|
10806
|
-
placeholder
|
|
10812
|
+
placeholder,
|
|
10807
10813
|
type: "email",
|
|
10808
10814
|
validate: validateEmail("E-mail inv\xE1lido.")
|
|
10809
10815
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -9821,7 +9821,12 @@ var Form = (_a) => {
|
|
|
9821
9821
|
const formMethods = useForm(__spreadValues({
|
|
9822
9822
|
mode: "onTouched"
|
|
9823
9823
|
}, props));
|
|
9824
|
-
return /* @__PURE__ */ jsx34(FormProvider, __spreadProps(__spreadValues({}, formMethods), { children: /* @__PURE__ */ jsx34("form", { onSubmit: formMethods.handleSubmit(onSubmit), children
|
|
9824
|
+
return /* @__PURE__ */ jsx34(FormProvider, __spreadProps(__spreadValues({}, formMethods), { children: /* @__PURE__ */ jsx34("form", { onSubmit: formMethods.handleSubmit(onSubmit), children: (() => {
|
|
9825
|
+
if (typeof children === "function") {
|
|
9826
|
+
return children(formMethods);
|
|
9827
|
+
}
|
|
9828
|
+
return children;
|
|
9829
|
+
})() }) }));
|
|
9825
9830
|
};
|
|
9826
9831
|
|
|
9827
9832
|
// src/components/FormFields/MultiSelectFormField.tsx
|
|
@@ -10701,7 +10706,8 @@ import { jsx as jsx49 } from "react/jsx-runtime";
|
|
|
10701
10706
|
var EmailFormField = ({
|
|
10702
10707
|
name,
|
|
10703
10708
|
label,
|
|
10704
|
-
required
|
|
10709
|
+
required,
|
|
10710
|
+
placeholder
|
|
10705
10711
|
}) => {
|
|
10706
10712
|
return /* @__PURE__ */ jsx49(
|
|
10707
10713
|
TextFormField,
|
|
@@ -10709,7 +10715,7 @@ var EmailFormField = ({
|
|
|
10709
10715
|
name,
|
|
10710
10716
|
label,
|
|
10711
10717
|
required,
|
|
10712
|
-
placeholder
|
|
10718
|
+
placeholder,
|
|
10713
10719
|
type: "email",
|
|
10714
10720
|
validate: validateEmail("E-mail inv\xE1lido.")
|
|
10715
10721
|
}
|
package/package.json
CHANGED
|
@@ -5,19 +5,21 @@ export type EmailFormFieldProps = {
|
|
|
5
5
|
name: string;
|
|
6
6
|
label?: string;
|
|
7
7
|
required?: boolean;
|
|
8
|
+
placeholder?: string;
|
|
8
9
|
};
|
|
9
10
|
|
|
10
11
|
export const EmailFormField = ({
|
|
11
12
|
name,
|
|
12
13
|
label,
|
|
13
14
|
required,
|
|
15
|
+
placeholder,
|
|
14
16
|
}: EmailFormFieldProps) => {
|
|
15
17
|
return (
|
|
16
18
|
<TextFormField
|
|
17
19
|
name={name}
|
|
18
20
|
label={label}
|
|
19
21
|
required={required}
|
|
20
|
-
placeholder=
|
|
22
|
+
placeholder={placeholder}
|
|
21
23
|
type="email"
|
|
22
24
|
validate={validateEmail("E-mail inválido.")}
|
|
23
25
|
/>
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { JSX } from "react";
|
|
1
|
+
import { JSX, useMemo } from "react";
|
|
2
2
|
import {
|
|
3
3
|
FormProvider,
|
|
4
4
|
useForm,
|
|
5
5
|
SubmitHandler,
|
|
6
6
|
FieldValues,
|
|
7
7
|
UseFormProps,
|
|
8
|
+
UseFormReturn,
|
|
8
9
|
} from "react-hook-form";
|
|
9
10
|
|
|
10
11
|
export type FormProps<T extends FieldValues = FieldValues> = UseFormProps<T> & {
|
|
11
12
|
onSubmit: SubmitHandler<T>;
|
|
12
|
-
children: JSX.Element;
|
|
13
|
+
children: JSX.Element | ((p: UseFormReturn<T, any, T>) => JSX.Element);
|
|
13
14
|
methods?: ReturnType<typeof useForm<T>>;
|
|
14
15
|
};
|
|
15
16
|
|
|
@@ -22,10 +23,17 @@ export const Form = <T extends FieldValues = FieldValues>({
|
|
|
22
23
|
mode: "onTouched",
|
|
23
24
|
...props,
|
|
24
25
|
});
|
|
25
|
-
|
|
26
|
+
|
|
26
27
|
return (
|
|
27
28
|
<FormProvider {...formMethods}>
|
|
28
|
-
<form onSubmit={formMethods.handleSubmit(onSubmit)}>
|
|
29
|
+
<form onSubmit={formMethods.handleSubmit(onSubmit)}>
|
|
30
|
+
{(() => {
|
|
31
|
+
if (typeof children === "function") {
|
|
32
|
+
return children(formMethods);
|
|
33
|
+
}
|
|
34
|
+
return children;
|
|
35
|
+
})()}
|
|
36
|
+
</form>
|
|
29
37
|
</FormProvider>
|
|
30
38
|
);
|
|
31
39
|
};
|