@lets-events/react 11.1.0 → 11.2.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/.turbo/turbo-build.log +8 -8
- package/CHANGELOG.md +6 -0
- package/dist/index.d.mts +10 -4
- package/dist/index.d.ts +10 -4
- package/dist/index.js +13 -1
- package/dist/index.mjs +15 -1
- package/package.json +1 -1
- package/src/components/FormFields/ErrorFormMessage.tsx +1 -1
- package/src/components/FormFields/Form.tsx +25 -0
- package/src/index.tsx +31 -31
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @lets-events/react@11.
|
|
2
|
+
> @lets-events/react@11.2.0 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[32m288.
|
|
12
|
-
[32mCJS[39m ⚡️ Build success in
|
|
13
|
-
[32mESM[39m [1mdist\index.mjs [22m[32m279.
|
|
14
|
-
[32mESM[39m ⚡️ Build success in
|
|
11
|
+
[32mCJS[39m [1mdist\index.js [22m[32m288.75 KB[39m
|
|
12
|
+
[32mCJS[39m ⚡️ Build success in 229ms
|
|
13
|
+
[32mESM[39m [1mdist\index.mjs [22m[32m279.75 KB[39m
|
|
14
|
+
[32mESM[39m ⚡️ Build success in 230ms
|
|
15
15
|
[34mDTS[39m Build start
|
|
16
|
-
[32mDTS[39m ⚡️ Build success in
|
|
17
|
-
[32mDTS[39m [1mdist\index.d.mts [22m[
|
|
18
|
-
[32mDTS[39m [1mdist\index.d.ts [22m[
|
|
16
|
+
[32mDTS[39m ⚡️ Build success in 3614ms
|
|
17
|
+
[32mDTS[39m [1mdist\index.d.mts [22m[32m349.19 KB[39m
|
|
18
|
+
[32mDTS[39m [1mdist\index.d.ts [22m[32m349.19 KB[39m
|
package/CHANGELOG.md
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -5,14 +5,14 @@ import PropTypes from 'prop-types';
|
|
|
5
5
|
import * as _stitches_react_types_styled_component from '@stitches/react/types/styled-component';
|
|
6
6
|
import * as _stitches_react_types_css_util from '@stitches/react/types/css-util';
|
|
7
7
|
import * as react from 'react';
|
|
8
|
-
import react__default, { ComponentProps, ElementType, ReactNode } from 'react';
|
|
8
|
+
import react__default, { ComponentProps, ElementType, ReactNode, JSX } from 'react';
|
|
9
9
|
import * as _radix_ui_themes from '@radix-ui/themes';
|
|
10
10
|
import { TextField as TextField$1, RadioGroup as RadioGroup$1, CheckboxGroup as CheckboxGroup$1, DropdownMenu as DropdownMenu$1, AlertDialog, Switch as Switch$1 } from '@radix-ui/themes';
|
|
11
11
|
import { Colors } from '@lets-events/tokens';
|
|
12
12
|
import { MaskOptions, format, unformat } from '@react-input/mask';
|
|
13
13
|
import { Dialog } from 'radix-ui';
|
|
14
14
|
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
15
|
-
import { FieldError, Merge, FieldErrorsImpl } from 'react-hook-form';
|
|
15
|
+
import { FieldError, Merge, FieldErrorsImpl, UseFormProps, SubmitHandler, FieldValues } from 'react-hook-form';
|
|
16
16
|
|
|
17
17
|
interface IconProps extends Omit<FontAwesomeIconProps, "icon" | "size"> {
|
|
18
18
|
name: IconName;
|
|
@@ -13354,7 +13354,7 @@ declare function Section({ children, ...props }: SectionProps): react_jsx_runtim
|
|
|
13354
13354
|
type ErrorFormMessageProps = {
|
|
13355
13355
|
message?: string | FieldError | Merge<FieldError, FieldErrorsImpl<any>> | undefined;
|
|
13356
13356
|
};
|
|
13357
|
-
declare const ErrorFormMessage: ({ message }: ErrorFormMessageProps) => react_jsx_runtime.JSX.Element | null
|
|
13357
|
+
declare const ErrorFormMessage: ({ message }: ErrorFormMessageProps) => react_jsx_runtime.JSX.Element | null;
|
|
13358
13358
|
|
|
13359
13359
|
type FormLabelProps = {
|
|
13360
13360
|
name: string;
|
|
@@ -13380,4 +13380,10 @@ type TextFormFieldProps = {
|
|
|
13380
13380
|
};
|
|
13381
13381
|
declare const TextFormField: ({ name, label, required, placeholder, }: TextFormFieldProps) => react_jsx_runtime.JSX.Element;
|
|
13382
13382
|
|
|
13383
|
-
|
|
13383
|
+
type FormProps = UseFormProps & {
|
|
13384
|
+
onSubmit: SubmitHandler<FieldValues>;
|
|
13385
|
+
children: JSX.Element;
|
|
13386
|
+
};
|
|
13387
|
+
declare const Form: ({ onSubmit, children, ...props }: FormProps) => react_jsx_runtime.JSX.Element;
|
|
13388
|
+
|
|
13389
|
+
export { Alert, AlertDialogCompleteStyled, AlertDialogDescriptionStyled, AlertDialogRowStyled, AlertDialogSimpleStyled, AlertDialogSubtitleStyled, AlertDialogTitleStyled, AlertDialoghrStyled, type AlertProps, Avatar, type AvatarProps, AvatarStyled, Badge, type BadgeProps, BadgeStyled, Box, Button, ButtonGroup, type ButtonGroupProps, ButtonGroupStyled, ButtonItem, type ButtonItemProps, ButtonItemStyled, type ButtonProps, Calendar, type CalendarProps, Card, type CardProps, CardStyled, CheckboxGroup, type CheckboxGroupProps, CheckboxGroupStyled, CheckboxItem, type CheckboxItemProps, Container, type ContainerProps, ContainerStyled, DropdownMenu, DropdownMenuItem, type DropdownMenuItemProps, type DropdownMenuProps, ErrorFormMessage, type ErrorFormMessageProps, Filter, FilterItem, type FilterItemProps, type FilterProps, Flex, type FlexProps, FlexStyled, Form, FormLabel, type FormLabelProps, type FormProps, Grid, type GridProps, GridStyled, Icon, InputStyled, Modal, type ModalProps, RadioGroup, type RadioGroupProps, RadioGroupStyled, RadioItem, type RadioItemProps, Section, type SectionProps, SectionStyled, 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, maskFormat, maskUnformat, useToast };
|
package/dist/index.d.ts
CHANGED
|
@@ -5,14 +5,14 @@ import PropTypes from 'prop-types';
|
|
|
5
5
|
import * as _stitches_react_types_styled_component from '@stitches/react/types/styled-component';
|
|
6
6
|
import * as _stitches_react_types_css_util from '@stitches/react/types/css-util';
|
|
7
7
|
import * as react from 'react';
|
|
8
|
-
import react__default, { ComponentProps, ElementType, ReactNode } from 'react';
|
|
8
|
+
import react__default, { ComponentProps, ElementType, ReactNode, JSX } from 'react';
|
|
9
9
|
import * as _radix_ui_themes from '@radix-ui/themes';
|
|
10
10
|
import { TextField as TextField$1, RadioGroup as RadioGroup$1, CheckboxGroup as CheckboxGroup$1, DropdownMenu as DropdownMenu$1, AlertDialog, Switch as Switch$1 } from '@radix-ui/themes';
|
|
11
11
|
import { Colors } from '@lets-events/tokens';
|
|
12
12
|
import { MaskOptions, format, unformat } from '@react-input/mask';
|
|
13
13
|
import { Dialog } from 'radix-ui';
|
|
14
14
|
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
15
|
-
import { FieldError, Merge, FieldErrorsImpl } from 'react-hook-form';
|
|
15
|
+
import { FieldError, Merge, FieldErrorsImpl, UseFormProps, SubmitHandler, FieldValues } from 'react-hook-form';
|
|
16
16
|
|
|
17
17
|
interface IconProps extends Omit<FontAwesomeIconProps, "icon" | "size"> {
|
|
18
18
|
name: IconName;
|
|
@@ -13354,7 +13354,7 @@ declare function Section({ children, ...props }: SectionProps): react_jsx_runtim
|
|
|
13354
13354
|
type ErrorFormMessageProps = {
|
|
13355
13355
|
message?: string | FieldError | Merge<FieldError, FieldErrorsImpl<any>> | undefined;
|
|
13356
13356
|
};
|
|
13357
|
-
declare const ErrorFormMessage: ({ message }: ErrorFormMessageProps) => react_jsx_runtime.JSX.Element | null
|
|
13357
|
+
declare const ErrorFormMessage: ({ message }: ErrorFormMessageProps) => react_jsx_runtime.JSX.Element | null;
|
|
13358
13358
|
|
|
13359
13359
|
type FormLabelProps = {
|
|
13360
13360
|
name: string;
|
|
@@ -13380,4 +13380,10 @@ type TextFormFieldProps = {
|
|
|
13380
13380
|
};
|
|
13381
13381
|
declare const TextFormField: ({ name, label, required, placeholder, }: TextFormFieldProps) => react_jsx_runtime.JSX.Element;
|
|
13382
13382
|
|
|
13383
|
-
|
|
13383
|
+
type FormProps = UseFormProps & {
|
|
13384
|
+
onSubmit: SubmitHandler<FieldValues>;
|
|
13385
|
+
children: JSX.Element;
|
|
13386
|
+
};
|
|
13387
|
+
declare const Form: ({ onSubmit, children, ...props }: FormProps) => react_jsx_runtime.JSX.Element;
|
|
13388
|
+
|
|
13389
|
+
export { Alert, AlertDialogCompleteStyled, AlertDialogDescriptionStyled, AlertDialogRowStyled, AlertDialogSimpleStyled, AlertDialogSubtitleStyled, AlertDialogTitleStyled, AlertDialoghrStyled, type AlertProps, Avatar, type AvatarProps, AvatarStyled, Badge, type BadgeProps, BadgeStyled, Box, Button, ButtonGroup, type ButtonGroupProps, ButtonGroupStyled, ButtonItem, type ButtonItemProps, ButtonItemStyled, type ButtonProps, Calendar, type CalendarProps, Card, type CardProps, CardStyled, CheckboxGroup, type CheckboxGroupProps, CheckboxGroupStyled, CheckboxItem, type CheckboxItemProps, Container, type ContainerProps, ContainerStyled, DropdownMenu, DropdownMenuItem, type DropdownMenuItemProps, type DropdownMenuProps, ErrorFormMessage, type ErrorFormMessageProps, Filter, FilterItem, type FilterItemProps, type FilterProps, Flex, type FlexProps, FlexStyled, Form, FormLabel, type FormLabelProps, type FormProps, Grid, type GridProps, GridStyled, Icon, InputStyled, Modal, type ModalProps, RadioGroup, type RadioGroupProps, RadioGroupStyled, RadioItem, type RadioItemProps, Section, type SectionProps, SectionStyled, 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, maskFormat, maskUnformat, useToast };
|
package/dist/index.js
CHANGED
|
@@ -1044,6 +1044,7 @@ __export(index_exports, {
|
|
|
1044
1044
|
FilterItem: () => FilterItem,
|
|
1045
1045
|
Flex: () => Flex2,
|
|
1046
1046
|
FlexStyled: () => FlexStyled,
|
|
1047
|
+
Form: () => Form,
|
|
1047
1048
|
FormLabel: () => FormLabel,
|
|
1048
1049
|
Grid: () => Grid,
|
|
1049
1050
|
GridStyled: () => GridStyled,
|
|
@@ -9319,7 +9320,7 @@ var import_free_solid_svg_icons2 = require("@fortawesome/free-solid-svg-icons");
|
|
|
9319
9320
|
var import_react_fontawesome2 = require("@fortawesome/react-fontawesome");
|
|
9320
9321
|
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
9321
9322
|
var ErrorFormMessage = ({ message: message2 }) => {
|
|
9322
|
-
if (!message2) return;
|
|
9323
|
+
if (!message2) return null;
|
|
9323
9324
|
if (typeof message2 !== "string") {
|
|
9324
9325
|
return null;
|
|
9325
9326
|
}
|
|
@@ -9428,6 +9429,16 @@ var TextFormField = ({
|
|
|
9428
9429
|
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ErrorFormMessage, { message: errorMsg })
|
|
9429
9430
|
] });
|
|
9430
9431
|
};
|
|
9432
|
+
|
|
9433
|
+
// src/components/FormFields/Form.tsx
|
|
9434
|
+
var import_react_hook_form3 = require("react-hook-form");
|
|
9435
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
9436
|
+
var Form = (_a) => {
|
|
9437
|
+
var _b = _a, { onSubmit, children } = _b, props = __objRest(_b, ["onSubmit", "children"]);
|
|
9438
|
+
const methods = (0, import_react_hook_form3.useForm)(props);
|
|
9439
|
+
const { handleSubmit } = methods;
|
|
9440
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react_hook_form3.FormProvider, __spreadProps(__spreadValues({}, methods), { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("form", { onSubmit: handleSubmit(onSubmit), children }) }));
|
|
9441
|
+
};
|
|
9431
9442
|
// Annotate the CommonJS export names for ESM import in node:
|
|
9432
9443
|
0 && (module.exports = {
|
|
9433
9444
|
Alert,
|
|
@@ -9463,6 +9474,7 @@ var TextFormField = ({
|
|
|
9463
9474
|
FilterItem,
|
|
9464
9475
|
Flex,
|
|
9465
9476
|
FlexStyled,
|
|
9477
|
+
Form,
|
|
9466
9478
|
FormLabel,
|
|
9467
9479
|
Grid,
|
|
9468
9480
|
GridStyled,
|
package/dist/index.mjs
CHANGED
|
@@ -9229,7 +9229,7 @@ import { faXmarkCircle } from "@fortawesome/free-solid-svg-icons";
|
|
|
9229
9229
|
import { FontAwesomeIcon as FontAwesomeIcon2 } from "@fortawesome/react-fontawesome";
|
|
9230
9230
|
import { jsx as jsx27, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
9231
9231
|
var ErrorFormMessage = ({ message: message2 }) => {
|
|
9232
|
-
if (!message2) return;
|
|
9232
|
+
if (!message2) return null;
|
|
9233
9233
|
if (typeof message2 !== "string") {
|
|
9234
9234
|
return null;
|
|
9235
9235
|
}
|
|
@@ -9338,6 +9338,19 @@ var TextFormField = ({
|
|
|
9338
9338
|
/* @__PURE__ */ jsx30(ErrorFormMessage, { message: errorMsg })
|
|
9339
9339
|
] });
|
|
9340
9340
|
};
|
|
9341
|
+
|
|
9342
|
+
// src/components/FormFields/Form.tsx
|
|
9343
|
+
import {
|
|
9344
|
+
FormProvider,
|
|
9345
|
+
useForm
|
|
9346
|
+
} from "react-hook-form";
|
|
9347
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
9348
|
+
var Form = (_a) => {
|
|
9349
|
+
var _b = _a, { onSubmit, children } = _b, props = __objRest(_b, ["onSubmit", "children"]);
|
|
9350
|
+
const methods = useForm(props);
|
|
9351
|
+
const { handleSubmit } = methods;
|
|
9352
|
+
return /* @__PURE__ */ jsx31(FormProvider, __spreadProps(__spreadValues({}, methods), { children: /* @__PURE__ */ jsx31("form", { onSubmit: handleSubmit(onSubmit), children }) }));
|
|
9353
|
+
};
|
|
9341
9354
|
export {
|
|
9342
9355
|
Alert,
|
|
9343
9356
|
AlertDialogCompleteStyled,
|
|
@@ -9372,6 +9385,7 @@ export {
|
|
|
9372
9385
|
FilterItem,
|
|
9373
9386
|
Flex2 as Flex,
|
|
9374
9387
|
FlexStyled,
|
|
9388
|
+
Form,
|
|
9375
9389
|
FormLabel,
|
|
9376
9390
|
Grid,
|
|
9377
9391
|
GridStyled,
|
package/package.json
CHANGED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { JSX } from "react";
|
|
2
|
+
import {
|
|
3
|
+
FormProvider,
|
|
4
|
+
useForm,
|
|
5
|
+
SubmitHandler,
|
|
6
|
+
FieldValues,
|
|
7
|
+
UseFormProps,
|
|
8
|
+
} from "react-hook-form";
|
|
9
|
+
|
|
10
|
+
export type FormProps = UseFormProps & {
|
|
11
|
+
onSubmit: SubmitHandler<FieldValues>;
|
|
12
|
+
children: JSX.Element;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const Form = ({ onSubmit, children, ...props }: FormProps) => {
|
|
16
|
+
const methods = useForm(props);
|
|
17
|
+
|
|
18
|
+
const { handleSubmit } = methods;
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<FormProvider {...methods}>
|
|
22
|
+
<form onSubmit={handleSubmit(onSubmit)}>{children}</form>
|
|
23
|
+
</FormProvider>
|
|
24
|
+
);
|
|
25
|
+
};
|
package/src/index.tsx
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
// Icon
|
|
2
|
-
export * from
|
|
2
|
+
export * from "./components/Icon";
|
|
3
3
|
|
|
4
4
|
// Text
|
|
5
|
-
export * from
|
|
5
|
+
export * from "./components/Text";
|
|
6
6
|
|
|
7
7
|
// Components
|
|
8
|
-
export * from
|
|
9
|
-
export * from
|
|
10
|
-
export * from
|
|
11
|
-
export * from
|
|
12
|
-
export * from
|
|
13
|
-
export * from
|
|
14
|
-
export * from
|
|
15
|
-
export * from
|
|
16
|
-
export * from
|
|
17
|
-
export * from
|
|
18
|
-
export * from
|
|
19
|
-
export * from
|
|
20
|
-
export * from
|
|
21
|
-
export * from
|
|
22
|
-
export * from
|
|
23
|
-
export * from
|
|
24
|
-
export * from
|
|
25
|
-
export * from
|
|
26
|
-
export * from
|
|
8
|
+
export * from "./components/Button";
|
|
9
|
+
export * from "./components/ButtonGroup";
|
|
10
|
+
export * from "./components/Avatar";
|
|
11
|
+
export * from "./components/TextField";
|
|
12
|
+
export * from "./components/RadioGroup";
|
|
13
|
+
export * from "./components/CheckboxGroup";
|
|
14
|
+
export * from "./components/Filter";
|
|
15
|
+
export * from "./components/Dropdown";
|
|
16
|
+
export * from "./components/Badge";
|
|
17
|
+
export * from "./components/Modal";
|
|
18
|
+
export * from "./components/Calendar";
|
|
19
|
+
export * from "./components/TimePicker";
|
|
20
|
+
export * from "./components/Alert";
|
|
21
|
+
export * from "./components/Switch";
|
|
22
|
+
export * from "./components/Step";
|
|
23
|
+
export * from "./components/Card";
|
|
24
|
+
export * from "./components/TextareaField";
|
|
25
|
+
export * from "./components/Toast";
|
|
26
|
+
export * from "./components/Tooltip";
|
|
27
27
|
|
|
28
28
|
// Layouts
|
|
29
|
-
export * from
|
|
30
|
-
export * from
|
|
31
|
-
export * from
|
|
32
|
-
export * from
|
|
33
|
-
export * from
|
|
34
|
-
|
|
29
|
+
export * from "./components/Flex";
|
|
30
|
+
export * from "./components/Box";
|
|
31
|
+
export * from "./components/Grid";
|
|
32
|
+
export * from "./components/Container";
|
|
33
|
+
export * from "./components/Section";
|
|
35
34
|
|
|
36
35
|
//Form
|
|
37
|
-
export * from
|
|
38
|
-
export * from
|
|
39
|
-
export * from
|
|
40
|
-
export * from
|
|
36
|
+
export * from "./components/FormFields/ErrorFormMessage";
|
|
37
|
+
export * from "./components/FormFields/FormLabel";
|
|
38
|
+
export * from "./components/FormFields/TextAreaFormField";
|
|
39
|
+
export * from "./components/FormFields/TextFormField";
|
|
40
|
+
export * from "./components/FormFields/Form";
|