@lets-events/react 12.1.4 → 12.1.5

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.
@@ -1,6 +1,6 @@
1
1
 
2
2
 
3
- > @lets-events/react@12.1.4 build
3
+ > @lets-events/react@12.1.5 build
4
4
  > tsup src/index.tsx --format esm,cjs --dts --external react
5
5
 
6
6
  CLI Building entry: src/index.tsx
@@ -10,14 +10,14 @@
10
10
  CLI Target: es6
11
11
  ESM Build start
12
12
  CJS Build start
13
- ESM dist/QuillComponent-A5KIFPCL.mjs 13.19 KB
13
+ CJS dist/index.js 374.46 KB
14
+ CJS ⚡️ Build success in 337ms
14
15
  ESM dist/chunk-TU7LKUXZ.mjs 61.98 KB
15
- ESM dist/index.mjs 276.08 KB
16
- ESM ⚡️ Build success in 340ms
17
- CJS dist/index.js 373.37 KB
18
- CJS ⚡️ Build success in 340ms
16
+ ESM dist/QuillComponent-A5KIFPCL.mjs 13.19 KB
17
+ ESM dist/index.mjs 277.01 KB
18
+ ESM ⚡️ Build success in 339ms
19
19
  DTS Build start
20
- DTS ⚡️ Build success in 6489ms
21
- DTS dist/index.d.mts 379.15 KB
22
- DTS dist/index.d.ts 379.15 KB
20
+ DTS ⚡️ Build success in 5967ms
21
+ DTS dist/index.d.mts 379.43 KB
22
+ DTS dist/index.d.ts 379.43 KB
23
23
  ⠙
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @lets-events/react
2
2
 
3
+ ## 12.1.5
4
+
5
+ ### Patch Changes
6
+
7
+ - SwitchFormField
8
+
3
9
  ## 12.1.4
4
10
 
5
11
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -14319,6 +14319,14 @@ type SelectFormFieldProps = {
14319
14319
  };
14320
14320
  declare const SelectFormField: ({ name, label, required, placeholder, options, validation, validationErrorMessage, defaultValue, }: SelectFormFieldProps) => react_jsx_runtime.JSX.Element;
14321
14321
 
14322
+ type SwitchFormFieldProps = {
14323
+ name: string;
14324
+ label: string;
14325
+ defaultValue?: boolean;
14326
+ watch?: boolean;
14327
+ };
14328
+ declare const SwitchFormField: ({ name, label, defaultValue, watch, }: SwitchFormFieldProps) => react_jsx_runtime.JSX.Element;
14329
+
14322
14330
  type EmailFormFieldProps = {
14323
14331
  name: string;
14324
14332
  label?: string;
@@ -14435,4 +14443,4 @@ declare const useImageUpload: (options: UseImageUploadOptions) => {
14435
14443
  reset: () => void;
14436
14444
  };
14437
14445
 
14438
- 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, CalendarFormField, type CalendarFormFieldProps, 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, RichEditor, RichEditorFormField, type RichEditorFormFieldProps, type RichEditorProps, 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, TimePickerFormField, type TimePickerFormFieldProps, 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, type UploadConfig, UploadService, isValidCNPJ, maskFormat, maskUnformat, useImageUpload, useToast };
14446
+ 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, CalendarFormField, type CalendarFormFieldProps, 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, RichEditor, RichEditorFormField, type RichEditorFormFieldProps, type RichEditorProps, Section, type SectionProps, SectionStyled, SelectFormField, type SelectFormFieldProps, Step, StepContent, StepList, type StepProps, StepStyled, StepTrigger, StepWrapper, Switch, SwitchFormField, type SwitchFormFieldProps, 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, TimePickerFormField, type TimePickerFormFieldProps, 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, type UploadConfig, UploadService, isValidCNPJ, maskFormat, maskUnformat, useImageUpload, useToast };
package/dist/index.d.ts CHANGED
@@ -14319,6 +14319,14 @@ type SelectFormFieldProps = {
14319
14319
  };
14320
14320
  declare const SelectFormField: ({ name, label, required, placeholder, options, validation, validationErrorMessage, defaultValue, }: SelectFormFieldProps) => react_jsx_runtime.JSX.Element;
14321
14321
 
14322
+ type SwitchFormFieldProps = {
14323
+ name: string;
14324
+ label: string;
14325
+ defaultValue?: boolean;
14326
+ watch?: boolean;
14327
+ };
14328
+ declare const SwitchFormField: ({ name, label, defaultValue, watch, }: SwitchFormFieldProps) => react_jsx_runtime.JSX.Element;
14329
+
14322
14330
  type EmailFormFieldProps = {
14323
14331
  name: string;
14324
14332
  label?: string;
@@ -14435,4 +14443,4 @@ declare const useImageUpload: (options: UseImageUploadOptions) => {
14435
14443
  reset: () => void;
14436
14444
  };
14437
14445
 
14438
- 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, CalendarFormField, type CalendarFormFieldProps, 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, RichEditor, RichEditorFormField, type RichEditorFormFieldProps, type RichEditorProps, 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, TimePickerFormField, type TimePickerFormFieldProps, 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, type UploadConfig, UploadService, isValidCNPJ, maskFormat, maskUnformat, useImageUpload, useToast };
14446
+ 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, CalendarFormField, type CalendarFormFieldProps, 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, RichEditor, RichEditorFormField, type RichEditorFormFieldProps, type RichEditorProps, Section, type SectionProps, SectionStyled, SelectFormField, type SelectFormFieldProps, Step, StepContent, StepList, type StepProps, StepStyled, StepTrigger, StepWrapper, Switch, SwitchFormField, type SwitchFormFieldProps, 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, TimePickerFormField, type TimePickerFormFieldProps, 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, type UploadConfig, UploadService, isValidCNPJ, maskFormat, maskUnformat, useImageUpload, useToast };
package/dist/index.js CHANGED
@@ -2034,7 +2034,7 @@ var QuillComponent_exports = {};
2034
2034
  __export(QuillComponent_exports, {
2035
2035
  default: () => QuillComponent_default
2036
2036
  });
2037
- var import_react20, import_react_quilljs, import_quill_snow, import_jsx_runtime50, QuillComponent, QuillComponent_default;
2037
+ var import_react20, import_react_quilljs, import_quill_snow, import_jsx_runtime51, QuillComponent, QuillComponent_default;
2038
2038
  var init_QuillComponent = __esm({
2039
2039
  "src/components/RichEditor/QuillComponent.tsx"() {
2040
2040
  "use strict";
@@ -2046,7 +2046,7 @@ var init_QuillComponent = __esm({
2046
2046
  init_useToast();
2047
2047
  init_uploadService();
2048
2048
  init_styledComponents();
2049
- import_jsx_runtime50 = require("react/jsx-runtime");
2049
+ import_jsx_runtime51 = require("react/jsx-runtime");
2050
2050
  QuillComponent = ({
2051
2051
  value = "",
2052
2052
  onChange,
@@ -2265,9 +2265,9 @@ var init_QuillComponent = __esm({
2265
2265
  document.addEventListener("mousedown", handleClickOutside);
2266
2266
  return () => document.removeEventListener("mousedown", handleClickOutside);
2267
2267
  }, [showVideoModal, showLinkModal, handleVideoCancel, handleLinkCancel]);
2268
- return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(QuillContainer, { className, children: /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(QuillEditor, { style: { position: "relative" }, children: [
2269
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { ref: quillRef }),
2270
- showVideoModal && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
2268
+ return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(QuillContainer, { className, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(QuillEditor, { style: { position: "relative" }, children: [
2269
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { ref: quillRef }),
2270
+ showVideoModal && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
2271
2271
  "div",
2272
2272
  {
2273
2273
  ref: videoModalRef,
@@ -2284,15 +2284,15 @@ var init_QuillComponent = __esm({
2284
2284
  zIndex: 1e3,
2285
2285
  width: "fit-content"
2286
2286
  },
2287
- children: /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(Flex2, { gap: 8, align: "center", children: [
2288
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
2287
+ children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(Flex2, { gap: 8, align: "center", children: [
2288
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
2289
2289
  Text,
2290
2290
  {
2291
2291
  style: { fontSize: "14px", fontWeight: "500", color: "#333" },
2292
2292
  children: "V\xEDdeo:"
2293
2293
  }
2294
2294
  ),
2295
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
2295
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
2296
2296
  "input",
2297
2297
  {
2298
2298
  type: "text",
@@ -2316,7 +2316,7 @@ var init_QuillComponent = __esm({
2316
2316
  autoFocus: true
2317
2317
  }
2318
2318
  ),
2319
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
2319
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
2320
2320
  "button",
2321
2321
  {
2322
2322
  onClick: handleVideoSubmit,
@@ -2337,7 +2337,7 @@ var init_QuillComponent = __esm({
2337
2337
  ] })
2338
2338
  }
2339
2339
  ),
2340
- showLinkModal && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
2340
+ showLinkModal && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
2341
2341
  "div",
2342
2342
  {
2343
2343
  ref: linkModalRef,
@@ -2354,15 +2354,15 @@ var init_QuillComponent = __esm({
2354
2354
  zIndex: 1e3,
2355
2355
  width: "fit-content"
2356
2356
  },
2357
- children: /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(Flex2, { gap: 8, align: "center", children: [
2358
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
2357
+ children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(Flex2, { gap: 8, align: "center", children: [
2358
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
2359
2359
  Text,
2360
2360
  {
2361
2361
  style: { fontSize: "14px", fontWeight: "500", color: "#333" },
2362
2362
  children: "Link:"
2363
2363
  }
2364
2364
  ),
2365
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
2365
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
2366
2366
  "input",
2367
2367
  {
2368
2368
  type: "text",
@@ -2387,7 +2387,7 @@ var init_QuillComponent = __esm({
2387
2387
  autoFocus: true
2388
2388
  }
2389
2389
  ),
2390
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
2390
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
2391
2391
  "button",
2392
2392
  {
2393
2393
  onClick: handleLinkSubmit,
@@ -2487,6 +2487,7 @@ __export(index_exports, {
2487
2487
  StepTrigger: () => StepTrigger,
2488
2488
  StepWrapper: () => StepWrapper,
2489
2489
  Switch: () => Switch,
2490
+ SwitchFormField: () => SwitchFormField,
2490
2491
  SwitchStyled: () => SwitchStyled,
2491
2492
  Text: () => Text,
2492
2493
  TextAreaFormField: () => TextAreaFormField,
@@ -11662,15 +11663,53 @@ var CheckboxGroupFormField = ({
11662
11663
  ] });
11663
11664
  };
11664
11665
 
11665
- // src/components/FormFields/EmailFormField.tsx
11666
+ // src/components/FormFields/SwitchFormField.tsx
11667
+ var import_react_hook_form11 = require("react-hook-form");
11668
+ init_Flex();
11669
+ init_Text();
11666
11670
  var import_jsx_runtime49 = require("react/jsx-runtime");
11671
+ var SwitchFormField = ({
11672
+ name,
11673
+ label,
11674
+ defaultValue = false,
11675
+ watch = false
11676
+ }) => {
11677
+ const {
11678
+ control,
11679
+ watch: watchForm
11680
+ } = (0, import_react_hook_form11.useFormContext)();
11681
+ if (watch) {
11682
+ watchForm(name);
11683
+ }
11684
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(Flex2, { justify: "between", style: { margin: "1rem 0" }, children: [
11685
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Text, { typography: "labelMedium", fontWeight: "regular", children: label }),
11686
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
11687
+ import_react_hook_form11.Controller,
11688
+ {
11689
+ control,
11690
+ name,
11691
+ defaultValue,
11692
+ render: ({ field }) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
11693
+ Switch,
11694
+ {
11695
+ checked: field.value,
11696
+ onCheckedChange: field.onChange
11697
+ }
11698
+ )
11699
+ }
11700
+ )
11701
+ ] });
11702
+ };
11703
+
11704
+ // src/components/FormFields/EmailFormField.tsx
11705
+ var import_jsx_runtime50 = require("react/jsx-runtime");
11667
11706
  var EmailFormField = ({
11668
11707
  name,
11669
11708
  label,
11670
11709
  required,
11671
11710
  placeholder
11672
11711
  }) => {
11673
- return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
11712
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
11674
11713
  TextFormField,
11675
11714
  {
11676
11715
  name,
@@ -11684,12 +11723,12 @@ var EmailFormField = ({
11684
11723
  };
11685
11724
 
11686
11725
  // src/components/FormFields/RichEditorFormField.tsx
11687
- var import_react_hook_form11 = require("react-hook-form");
11726
+ var import_react_hook_form12 = require("react-hook-form");
11688
11727
  init_Flex();
11689
11728
 
11690
11729
  // src/components/RichEditor/RichEditor.tsx
11691
11730
  var import_react21 = require("react");
11692
- var import_jsx_runtime51 = require("react/jsx-runtime");
11731
+ var import_jsx_runtime52 = require("react/jsx-runtime");
11693
11732
  var QuillComponent2 = (0, import_react21.lazy)(() => Promise.resolve().then(() => (init_QuillComponent(), QuillComponent_exports)));
11694
11733
  var RichEditor = (props) => {
11695
11734
  const [isClient, setIsClient] = (0, import_react21.useState)(false);
@@ -11697,12 +11736,12 @@ var RichEditor = (props) => {
11697
11736
  setIsClient(typeof window !== "undefined");
11698
11737
  }, []);
11699
11738
  if (!isClient) return null;
11700
- return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(ToastProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_react21.Suspense, { fallback: null, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(QuillComponent2, __spreadValues({}, props)) }) }) });
11739
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(ToastProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react21.Suspense, { fallback: null, children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(QuillComponent2, __spreadValues({}, props)) }) }) });
11701
11740
  };
11702
11741
  var RichEditor_default = RichEditor;
11703
11742
 
11704
11743
  // src/components/FormFields/RichEditorFormField.tsx
11705
- var import_jsx_runtime52 = require("react/jsx-runtime");
11744
+ var import_jsx_runtime53 = require("react/jsx-runtime");
11706
11745
  var RichEditorFormField = (_a) => {
11707
11746
  var _b = _a, {
11708
11747
  name,
@@ -11717,7 +11756,7 @@ var RichEditorFormField = (_a) => {
11717
11756
  "validate",
11718
11757
  "validationErrorMessage"
11719
11758
  ]);
11720
- const { field, fieldState } = (0, import_react_hook_form11.useController)({
11759
+ const { field, fieldState } = (0, import_react_hook_form12.useController)({
11721
11760
  name,
11722
11761
  rules: {
11723
11762
  required: required ? validationErrorMessage : false,
@@ -11733,8 +11772,8 @@ var RichEditorFormField = (_a) => {
11733
11772
  const fieldError = fieldState.error;
11734
11773
  const haveError = !!fieldError;
11735
11774
  const errorMsg = fieldError == null ? void 0 : fieldError.message;
11736
- return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(Flex2, { direction: "column", children: [
11737
- label && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
11775
+ return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(Flex2, { direction: "column", children: [
11776
+ label && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
11738
11777
  FormLabel,
11739
11778
  {
11740
11779
  name,
@@ -11743,7 +11782,7 @@ var RichEditorFormField = (_a) => {
11743
11782
  haveError
11744
11783
  }
11745
11784
  ),
11746
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
11785
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
11747
11786
  RichEditor_default,
11748
11787
  __spreadProps(__spreadValues({}, props), {
11749
11788
  value: field.value,
@@ -11751,15 +11790,15 @@ var RichEditorFormField = (_a) => {
11751
11790
  "aria-labelledby": `${name}-label`
11752
11791
  })
11753
11792
  ),
11754
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(ErrorFormMessage, { message: errorMsg })
11793
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(ErrorFormMessage, { message: errorMsg })
11755
11794
  ] });
11756
11795
  };
11757
11796
 
11758
11797
  // src/components/FormFields/CalendarFormField.tsx
11759
- var import_react_hook_form12 = require("react-hook-form");
11798
+ var import_react_hook_form13 = require("react-hook-form");
11760
11799
  init_Flex();
11761
11800
  var import_react22 = require("react");
11762
- var import_jsx_runtime53 = require("react/jsx-runtime");
11801
+ var import_jsx_runtime54 = require("react/jsx-runtime");
11763
11802
  var CalendarFormField = (_a) => {
11764
11803
  var _b = _a, {
11765
11804
  name,
@@ -11791,7 +11830,7 @@ var CalendarFormField = (_a) => {
11791
11830
  },
11792
11831
  [validate, required, validationErrorMessage]
11793
11832
  );
11794
- const { field, fieldState } = (0, import_react_hook_form12.useController)({
11833
+ const { field, fieldState } = (0, import_react_hook_form13.useController)({
11795
11834
  name,
11796
11835
  rules: __spreadValues({
11797
11836
  required: required ? validationErrorMessage : false,
@@ -11806,8 +11845,8 @@ var CalendarFormField = (_a) => {
11806
11845
  const handleCalendarChange = (date) => {
11807
11846
  setSelected(date);
11808
11847
  };
11809
- return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(Flex2, { direction: "column", style: { flex: "1" }, children: [
11810
- label && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
11848
+ return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(Flex2, { direction: "column", style: { flex: "1" }, children: [
11849
+ label && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
11811
11850
  FormLabel,
11812
11851
  {
11813
11852
  name,
@@ -11816,7 +11855,7 @@ var CalendarFormField = (_a) => {
11816
11855
  haveError
11817
11856
  }
11818
11857
  ),
11819
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
11858
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
11820
11859
  Calendar,
11821
11860
  __spreadValues({
11822
11861
  selected,
@@ -11828,15 +11867,15 @@ var CalendarFormField = (_a) => {
11828
11867
  allowPastDates
11829
11868
  }, calendarProps)
11830
11869
  ),
11831
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(ErrorFormMessage, { message: errorMsg })
11870
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(ErrorFormMessage, { message: errorMsg })
11832
11871
  ] });
11833
11872
  };
11834
11873
 
11835
11874
  // src/components/FormFields/TimePickerFormField.tsx
11836
- var import_react_hook_form13 = require("react-hook-form");
11875
+ var import_react_hook_form14 = require("react-hook-form");
11837
11876
  init_Flex();
11838
11877
  var import_react23 = require("react");
11839
- var import_jsx_runtime54 = require("react/jsx-runtime");
11878
+ var import_jsx_runtime55 = require("react/jsx-runtime");
11840
11879
  var TimePickerFormField = (_a) => {
11841
11880
  var _b = _a, {
11842
11881
  name,
@@ -11864,7 +11903,7 @@ var TimePickerFormField = (_a) => {
11864
11903
  },
11865
11904
  [validate, required, validationErrorMessage]
11866
11905
  );
11867
- const { field, fieldState } = (0, import_react_hook_form13.useController)({
11906
+ const { field, fieldState } = (0, import_react_hook_form14.useController)({
11868
11907
  name,
11869
11908
  rules: __spreadValues({
11870
11909
  required: required ? validationErrorMessage : false,
@@ -11879,8 +11918,8 @@ var TimePickerFormField = (_a) => {
11879
11918
  const handleTimePickerChange = (time) => {
11880
11919
  setSelected(time);
11881
11920
  };
11882
- return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(Flex2, { direction: "column", style: { flex: "1" }, children: [
11883
- label && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
11921
+ return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(Flex2, { direction: "column", style: { flex: "1" }, children: [
11922
+ label && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
11884
11923
  FormLabel,
11885
11924
  {
11886
11925
  name,
@@ -11889,7 +11928,7 @@ var TimePickerFormField = (_a) => {
11889
11928
  haveError
11890
11929
  }
11891
11930
  ),
11892
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
11931
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
11893
11932
  TimePicker,
11894
11933
  __spreadValues({
11895
11934
  selected,
@@ -11900,7 +11939,7 @@ var TimePickerFormField = (_a) => {
11900
11939
  hasError: haveError
11901
11940
  }, timePickerProps)
11902
11941
  ),
11903
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(ErrorFormMessage, { message: errorMsg })
11942
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(ErrorFormMessage, { message: errorMsg })
11904
11943
  ] });
11905
11944
  };
11906
11945
 
@@ -12079,6 +12118,7 @@ init_uploadService();
12079
12118
  StepTrigger,
12080
12119
  StepWrapper,
12081
12120
  Switch,
12121
+ SwitchFormField,
12082
12122
  SwitchStyled,
12083
12123
  Text,
12084
12124
  TextAreaFormField,
package/dist/index.mjs CHANGED
@@ -9094,15 +9094,51 @@ var CheckboxGroupFormField = ({
9094
9094
  ] });
9095
9095
  };
9096
9096
 
9097
+ // src/components/FormFields/SwitchFormField.tsx
9098
+ import { useFormContext as useFormContext10, Controller as Controller5 } from "react-hook-form";
9099
+ import { jsx as jsx44, jsxs as jsxs23 } from "react/jsx-runtime";
9100
+ var SwitchFormField = ({
9101
+ name,
9102
+ label,
9103
+ defaultValue = false,
9104
+ watch = false
9105
+ }) => {
9106
+ const {
9107
+ control,
9108
+ watch: watchForm
9109
+ } = useFormContext10();
9110
+ if (watch) {
9111
+ watchForm(name);
9112
+ }
9113
+ return /* @__PURE__ */ jsxs23(Flex, { justify: "between", style: { margin: "1rem 0" }, children: [
9114
+ /* @__PURE__ */ jsx44(Text, { typography: "labelMedium", fontWeight: "regular", children: label }),
9115
+ /* @__PURE__ */ jsx44(
9116
+ Controller5,
9117
+ {
9118
+ control,
9119
+ name,
9120
+ defaultValue,
9121
+ render: ({ field }) => /* @__PURE__ */ jsx44(
9122
+ Switch,
9123
+ {
9124
+ checked: field.value,
9125
+ onCheckedChange: field.onChange
9126
+ }
9127
+ )
9128
+ }
9129
+ )
9130
+ ] });
9131
+ };
9132
+
9097
9133
  // src/components/FormFields/EmailFormField.tsx
9098
- import { jsx as jsx44 } from "react/jsx-runtime";
9134
+ import { jsx as jsx45 } from "react/jsx-runtime";
9099
9135
  var EmailFormField = ({
9100
9136
  name,
9101
9137
  label,
9102
9138
  required,
9103
9139
  placeholder
9104
9140
  }) => {
9105
- return /* @__PURE__ */ jsx44(
9141
+ return /* @__PURE__ */ jsx45(
9106
9142
  TextFormField,
9107
9143
  {
9108
9144
  name,
@@ -9120,7 +9156,7 @@ import { useController as useController3 } from "react-hook-form";
9120
9156
 
9121
9157
  // src/components/RichEditor/RichEditor.tsx
9122
9158
  import { lazy, useEffect as useEffect6, useState as useState7, Suspense } from "react";
9123
- import { jsx as jsx45 } from "react/jsx-runtime";
9159
+ import { jsx as jsx46 } from "react/jsx-runtime";
9124
9160
  var QuillComponent = lazy(() => import("./QuillComponent-A5KIFPCL.mjs"));
9125
9161
  var RichEditor = (props) => {
9126
9162
  const [isClient, setIsClient] = useState7(false);
@@ -9128,12 +9164,12 @@ var RichEditor = (props) => {
9128
9164
  setIsClient(typeof window !== "undefined");
9129
9165
  }, []);
9130
9166
  if (!isClient) return null;
9131
- return /* @__PURE__ */ jsx45("div", { children: /* @__PURE__ */ jsx45(ToastProvider, { children: /* @__PURE__ */ jsx45(Suspense, { fallback: null, children: /* @__PURE__ */ jsx45(QuillComponent, __spreadValues({}, props)) }) }) });
9167
+ return /* @__PURE__ */ jsx46("div", { children: /* @__PURE__ */ jsx46(ToastProvider, { children: /* @__PURE__ */ jsx46(Suspense, { fallback: null, children: /* @__PURE__ */ jsx46(QuillComponent, __spreadValues({}, props)) }) }) });
9132
9168
  };
9133
9169
  var RichEditor_default = RichEditor;
9134
9170
 
9135
9171
  // src/components/FormFields/RichEditorFormField.tsx
9136
- import { jsx as jsx46, jsxs as jsxs23 } from "react/jsx-runtime";
9172
+ import { jsx as jsx47, jsxs as jsxs24 } from "react/jsx-runtime";
9137
9173
  var RichEditorFormField = (_a) => {
9138
9174
  var _b = _a, {
9139
9175
  name,
@@ -9164,8 +9200,8 @@ var RichEditorFormField = (_a) => {
9164
9200
  const fieldError = fieldState.error;
9165
9201
  const haveError = !!fieldError;
9166
9202
  const errorMsg = fieldError == null ? void 0 : fieldError.message;
9167
- return /* @__PURE__ */ jsxs23(Flex, { direction: "column", children: [
9168
- label && /* @__PURE__ */ jsx46(
9203
+ return /* @__PURE__ */ jsxs24(Flex, { direction: "column", children: [
9204
+ label && /* @__PURE__ */ jsx47(
9169
9205
  FormLabel,
9170
9206
  {
9171
9207
  name,
@@ -9174,7 +9210,7 @@ var RichEditorFormField = (_a) => {
9174
9210
  haveError
9175
9211
  }
9176
9212
  ),
9177
- /* @__PURE__ */ jsx46(
9213
+ /* @__PURE__ */ jsx47(
9178
9214
  RichEditor_default,
9179
9215
  __spreadProps(__spreadValues({}, props), {
9180
9216
  value: field.value,
@@ -9182,14 +9218,14 @@ var RichEditorFormField = (_a) => {
9182
9218
  "aria-labelledby": `${name}-label`
9183
9219
  })
9184
9220
  ),
9185
- /* @__PURE__ */ jsx46(ErrorFormMessage, { message: errorMsg })
9221
+ /* @__PURE__ */ jsx47(ErrorFormMessage, { message: errorMsg })
9186
9222
  ] });
9187
9223
  };
9188
9224
 
9189
9225
  // src/components/FormFields/CalendarFormField.tsx
9190
9226
  import { useController as useController4 } from "react-hook-form";
9191
9227
  import { useCallback as useCallback4 } from "react";
9192
- import { jsx as jsx47, jsxs as jsxs24 } from "react/jsx-runtime";
9228
+ import { jsx as jsx48, jsxs as jsxs25 } from "react/jsx-runtime";
9193
9229
  var CalendarFormField = (_a) => {
9194
9230
  var _b = _a, {
9195
9231
  name,
@@ -9236,8 +9272,8 @@ var CalendarFormField = (_a) => {
9236
9272
  const handleCalendarChange = (date) => {
9237
9273
  setSelected(date);
9238
9274
  };
9239
- return /* @__PURE__ */ jsxs24(Flex, { direction: "column", style: { flex: "1" }, children: [
9240
- label && /* @__PURE__ */ jsx47(
9275
+ return /* @__PURE__ */ jsxs25(Flex, { direction: "column", style: { flex: "1" }, children: [
9276
+ label && /* @__PURE__ */ jsx48(
9241
9277
  FormLabel,
9242
9278
  {
9243
9279
  name,
@@ -9246,7 +9282,7 @@ var CalendarFormField = (_a) => {
9246
9282
  haveError
9247
9283
  }
9248
9284
  ),
9249
- /* @__PURE__ */ jsx47(
9285
+ /* @__PURE__ */ jsx48(
9250
9286
  Calendar,
9251
9287
  __spreadValues({
9252
9288
  selected,
@@ -9258,14 +9294,14 @@ var CalendarFormField = (_a) => {
9258
9294
  allowPastDates
9259
9295
  }, calendarProps)
9260
9296
  ),
9261
- /* @__PURE__ */ jsx47(ErrorFormMessage, { message: errorMsg })
9297
+ /* @__PURE__ */ jsx48(ErrorFormMessage, { message: errorMsg })
9262
9298
  ] });
9263
9299
  };
9264
9300
 
9265
9301
  // src/components/FormFields/TimePickerFormField.tsx
9266
9302
  import { useController as useController5 } from "react-hook-form";
9267
9303
  import { useCallback as useCallback5 } from "react";
9268
- import { jsx as jsx48, jsxs as jsxs25 } from "react/jsx-runtime";
9304
+ import { jsx as jsx49, jsxs as jsxs26 } from "react/jsx-runtime";
9269
9305
  var TimePickerFormField = (_a) => {
9270
9306
  var _b = _a, {
9271
9307
  name,
@@ -9308,8 +9344,8 @@ var TimePickerFormField = (_a) => {
9308
9344
  const handleTimePickerChange = (time) => {
9309
9345
  setSelected(time);
9310
9346
  };
9311
- return /* @__PURE__ */ jsxs25(Flex, { direction: "column", style: { flex: "1" }, children: [
9312
- label && /* @__PURE__ */ jsx48(
9347
+ return /* @__PURE__ */ jsxs26(Flex, { direction: "column", style: { flex: "1" }, children: [
9348
+ label && /* @__PURE__ */ jsx49(
9313
9349
  FormLabel,
9314
9350
  {
9315
9351
  name,
@@ -9318,7 +9354,7 @@ var TimePickerFormField = (_a) => {
9318
9354
  haveError
9319
9355
  }
9320
9356
  ),
9321
- /* @__PURE__ */ jsx48(
9357
+ /* @__PURE__ */ jsx49(
9322
9358
  TimePicker,
9323
9359
  __spreadValues({
9324
9360
  selected,
@@ -9329,7 +9365,7 @@ var TimePickerFormField = (_a) => {
9329
9365
  hasError: haveError
9330
9366
  }, timePickerProps)
9331
9367
  ),
9332
- /* @__PURE__ */ jsx48(ErrorFormMessage, { message: errorMsg })
9368
+ /* @__PURE__ */ jsx49(ErrorFormMessage, { message: errorMsg })
9333
9369
  ] });
9334
9370
  };
9335
9371
 
@@ -9503,6 +9539,7 @@ export {
9503
9539
  StepTrigger,
9504
9540
  StepWrapper,
9505
9541
  Switch,
9542
+ SwitchFormField,
9506
9543
  SwitchStyled,
9507
9544
  Text,
9508
9545
  TextAreaFormField,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lets-events/react",
3
- "version": "12.1.4",
3
+ "version": "12.1.5",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -0,0 +1,46 @@
1
+ import { useFormContext, Controller } from "react-hook-form";
2
+ import { Flex } from "../Flex";
3
+ import { Switch } from "../Switch";
4
+ import { Text } from "../Text";
5
+
6
+
7
+ export type SwitchFormFieldProps = {
8
+ name: string;
9
+ label: string;
10
+ defaultValue?: boolean;
11
+ watch?: boolean;
12
+ };
13
+
14
+ export const SwitchFormField = ({
15
+ name,
16
+ label,
17
+ defaultValue = false,
18
+ watch = false,
19
+ }: SwitchFormFieldProps) => {
20
+ const {
21
+ control,
22
+ watch: watchForm,
23
+ } = useFormContext();
24
+
25
+ if (watch) {
26
+ watchForm(name);
27
+ }
28
+ return (
29
+ <Flex justify="between" style={{ margin: '1rem 0' }}>
30
+ <Text typography="labelMedium" fontWeight="regular">
31
+ {label}
32
+ </Text>
33
+ <Controller
34
+ control={control}
35
+ name={name}
36
+ defaultValue={defaultValue}
37
+ render={({ field }) => (
38
+ <Switch
39
+ checked={field.value}
40
+ onCheckedChange={field.onChange}
41
+ />
42
+ )}
43
+ />
44
+ </Flex>
45
+ );
46
+ };
package/src/index.tsx CHANGED
@@ -52,6 +52,7 @@ export * from "./components/FormFields/RadioGroupFormField";
52
52
  export * from "./components/FormFields/CheckboxGroupFormField";
53
53
  export * from "./components/FormFields/AddressFormFields/CountryFormField";
54
54
  export * from "./components/FormFields/SelectFormField";
55
+ export * from "./components/FormFields/SwitchFormField";
55
56
  export * from "./components/FormFields/EmailFormField";
56
57
  export * from "./components/FormFields/RichEditorFormField";
57
58
  export * from "./components/FormFields/CalendarFormField";