@lets-events/react 12.1.4 → 12.1.6

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.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,
@@ -2503,6 +2504,7 @@ __export(index_exports, {
2503
2504
  TimePickerDropdownStyled: () => TimePickerDropdownStyled,
2504
2505
  TimePickerFooterStyled: () => TimePickerFooterStyled,
2505
2506
  TimePickerFormField: () => TimePickerFormField,
2507
+ TimePickerIconButton: () => TimePickerIconButton,
2506
2508
  TimePickerStyled: () => TimePickerStyled,
2507
2509
  TimerPickerContentStyled: () => TimerPickerContentStyled,
2508
2510
  ToastItem: () => ToastItem,
@@ -9092,6 +9094,7 @@ init_styles();
9092
9094
  var import_jsx_runtime17 = require("react/jsx-runtime");
9093
9095
  var TimePickerStyled = styled("div", {
9094
9096
  position: "relative",
9097
+ width: "fit-content",
9095
9098
  fontFamily: "$default",
9096
9099
  lineHeight: "$base",
9097
9100
  fontSize: "$14",
@@ -9115,7 +9118,7 @@ var TimePickerDropdownStyled = styled("div", {
9115
9118
  position: "absolute",
9116
9119
  zIndex: 10,
9117
9120
  width: "100%",
9118
- maxWidth: "8.875rem",
9121
+ maxWidth: "min-content",
9119
9122
  backgroundColor: "$neutral50",
9120
9123
  border: "1px solid $neutral300",
9121
9124
  borderRadius: "$sm",
@@ -9199,6 +9202,9 @@ var TimePickerButtonStyled = styled("button", {
9199
9202
  }
9200
9203
  }
9201
9204
  });
9205
+ var TimePickerIconButton = styled(Button, {
9206
+ padding: "0 !important"
9207
+ });
9202
9208
  var pad = (num) => String(num).padStart(2, "0");
9203
9209
  function TimePicker({
9204
9210
  selected,
@@ -9280,7 +9286,7 @@ function TimePicker({
9280
9286
  },
9281
9287
  children: [
9282
9288
  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
9283
- Button,
9289
+ TimePickerIconButton,
9284
9290
  {
9285
9291
  type: "button",
9286
9292
  variant: "text",
@@ -9352,7 +9358,7 @@ function TimePicker({
9352
9358
  }
9353
9359
  ),
9354
9360
  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
9355
- Button,
9361
+ TimePickerIconButton,
9356
9362
  {
9357
9363
  type: "button",
9358
9364
  variant: "text",
@@ -11662,15 +11668,53 @@ var CheckboxGroupFormField = ({
11662
11668
  ] });
11663
11669
  };
11664
11670
 
11665
- // src/components/FormFields/EmailFormField.tsx
11671
+ // src/components/FormFields/SwitchFormField.tsx
11672
+ var import_react_hook_form11 = require("react-hook-form");
11673
+ init_Flex();
11674
+ init_Text();
11666
11675
  var import_jsx_runtime49 = require("react/jsx-runtime");
11676
+ var SwitchFormField = ({
11677
+ name,
11678
+ label,
11679
+ defaultValue = false,
11680
+ watch = false
11681
+ }) => {
11682
+ const {
11683
+ control,
11684
+ watch: watchForm
11685
+ } = (0, import_react_hook_form11.useFormContext)();
11686
+ if (watch) {
11687
+ watchForm(name);
11688
+ }
11689
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(Flex2, { justify: "between", style: { margin: "1rem 0" }, children: [
11690
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Text, { typography: "labelMedium", fontWeight: "regular", children: label }),
11691
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
11692
+ import_react_hook_form11.Controller,
11693
+ {
11694
+ control,
11695
+ name,
11696
+ defaultValue,
11697
+ render: ({ field }) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
11698
+ Switch,
11699
+ {
11700
+ checked: field.value,
11701
+ onCheckedChange: field.onChange
11702
+ }
11703
+ )
11704
+ }
11705
+ )
11706
+ ] });
11707
+ };
11708
+
11709
+ // src/components/FormFields/EmailFormField.tsx
11710
+ var import_jsx_runtime50 = require("react/jsx-runtime");
11667
11711
  var EmailFormField = ({
11668
11712
  name,
11669
11713
  label,
11670
11714
  required,
11671
11715
  placeholder
11672
11716
  }) => {
11673
- return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
11717
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
11674
11718
  TextFormField,
11675
11719
  {
11676
11720
  name,
@@ -11684,12 +11728,12 @@ var EmailFormField = ({
11684
11728
  };
11685
11729
 
11686
11730
  // src/components/FormFields/RichEditorFormField.tsx
11687
- var import_react_hook_form11 = require("react-hook-form");
11731
+ var import_react_hook_form12 = require("react-hook-form");
11688
11732
  init_Flex();
11689
11733
 
11690
11734
  // src/components/RichEditor/RichEditor.tsx
11691
11735
  var import_react21 = require("react");
11692
- var import_jsx_runtime51 = require("react/jsx-runtime");
11736
+ var import_jsx_runtime52 = require("react/jsx-runtime");
11693
11737
  var QuillComponent2 = (0, import_react21.lazy)(() => Promise.resolve().then(() => (init_QuillComponent(), QuillComponent_exports)));
11694
11738
  var RichEditor = (props) => {
11695
11739
  const [isClient, setIsClient] = (0, import_react21.useState)(false);
@@ -11697,12 +11741,12 @@ var RichEditor = (props) => {
11697
11741
  setIsClient(typeof window !== "undefined");
11698
11742
  }, []);
11699
11743
  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)) }) }) });
11744
+ 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
11745
  };
11702
11746
  var RichEditor_default = RichEditor;
11703
11747
 
11704
11748
  // src/components/FormFields/RichEditorFormField.tsx
11705
- var import_jsx_runtime52 = require("react/jsx-runtime");
11749
+ var import_jsx_runtime53 = require("react/jsx-runtime");
11706
11750
  var RichEditorFormField = (_a) => {
11707
11751
  var _b = _a, {
11708
11752
  name,
@@ -11717,7 +11761,7 @@ var RichEditorFormField = (_a) => {
11717
11761
  "validate",
11718
11762
  "validationErrorMessage"
11719
11763
  ]);
11720
- const { field, fieldState } = (0, import_react_hook_form11.useController)({
11764
+ const { field, fieldState } = (0, import_react_hook_form12.useController)({
11721
11765
  name,
11722
11766
  rules: {
11723
11767
  required: required ? validationErrorMessage : false,
@@ -11733,8 +11777,8 @@ var RichEditorFormField = (_a) => {
11733
11777
  const fieldError = fieldState.error;
11734
11778
  const haveError = !!fieldError;
11735
11779
  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)(
11780
+ return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(Flex2, { direction: "column", children: [
11781
+ label && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
11738
11782
  FormLabel,
11739
11783
  {
11740
11784
  name,
@@ -11743,7 +11787,7 @@ var RichEditorFormField = (_a) => {
11743
11787
  haveError
11744
11788
  }
11745
11789
  ),
11746
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
11790
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
11747
11791
  RichEditor_default,
11748
11792
  __spreadProps(__spreadValues({}, props), {
11749
11793
  value: field.value,
@@ -11751,15 +11795,15 @@ var RichEditorFormField = (_a) => {
11751
11795
  "aria-labelledby": `${name}-label`
11752
11796
  })
11753
11797
  ),
11754
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(ErrorFormMessage, { message: errorMsg })
11798
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(ErrorFormMessage, { message: errorMsg })
11755
11799
  ] });
11756
11800
  };
11757
11801
 
11758
11802
  // src/components/FormFields/CalendarFormField.tsx
11759
- var import_react_hook_form12 = require("react-hook-form");
11803
+ var import_react_hook_form13 = require("react-hook-form");
11760
11804
  init_Flex();
11761
11805
  var import_react22 = require("react");
11762
- var import_jsx_runtime53 = require("react/jsx-runtime");
11806
+ var import_jsx_runtime54 = require("react/jsx-runtime");
11763
11807
  var CalendarFormField = (_a) => {
11764
11808
  var _b = _a, {
11765
11809
  name,
@@ -11791,7 +11835,7 @@ var CalendarFormField = (_a) => {
11791
11835
  },
11792
11836
  [validate, required, validationErrorMessage]
11793
11837
  );
11794
- const { field, fieldState } = (0, import_react_hook_form12.useController)({
11838
+ const { field, fieldState } = (0, import_react_hook_form13.useController)({
11795
11839
  name,
11796
11840
  rules: __spreadValues({
11797
11841
  required: required ? validationErrorMessage : false,
@@ -11806,8 +11850,8 @@ var CalendarFormField = (_a) => {
11806
11850
  const handleCalendarChange = (date) => {
11807
11851
  setSelected(date);
11808
11852
  };
11809
- return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(Flex2, { direction: "column", style: { flex: "1" }, children: [
11810
- label && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
11853
+ return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(Flex2, { direction: "column", style: { flex: "1" }, children: [
11854
+ label && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
11811
11855
  FormLabel,
11812
11856
  {
11813
11857
  name,
@@ -11816,7 +11860,7 @@ var CalendarFormField = (_a) => {
11816
11860
  haveError
11817
11861
  }
11818
11862
  ),
11819
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
11863
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
11820
11864
  Calendar,
11821
11865
  __spreadValues({
11822
11866
  selected,
@@ -11828,15 +11872,15 @@ var CalendarFormField = (_a) => {
11828
11872
  allowPastDates
11829
11873
  }, calendarProps)
11830
11874
  ),
11831
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(ErrorFormMessage, { message: errorMsg })
11875
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(ErrorFormMessage, { message: errorMsg })
11832
11876
  ] });
11833
11877
  };
11834
11878
 
11835
11879
  // src/components/FormFields/TimePickerFormField.tsx
11836
- var import_react_hook_form13 = require("react-hook-form");
11880
+ var import_react_hook_form14 = require("react-hook-form");
11837
11881
  init_Flex();
11838
11882
  var import_react23 = require("react");
11839
- var import_jsx_runtime54 = require("react/jsx-runtime");
11883
+ var import_jsx_runtime55 = require("react/jsx-runtime");
11840
11884
  var TimePickerFormField = (_a) => {
11841
11885
  var _b = _a, {
11842
11886
  name,
@@ -11864,7 +11908,7 @@ var TimePickerFormField = (_a) => {
11864
11908
  },
11865
11909
  [validate, required, validationErrorMessage]
11866
11910
  );
11867
- const { field, fieldState } = (0, import_react_hook_form13.useController)({
11911
+ const { field, fieldState } = (0, import_react_hook_form14.useController)({
11868
11912
  name,
11869
11913
  rules: __spreadValues({
11870
11914
  required: required ? validationErrorMessage : false,
@@ -11879,8 +11923,8 @@ var TimePickerFormField = (_a) => {
11879
11923
  const handleTimePickerChange = (time) => {
11880
11924
  setSelected(time);
11881
11925
  };
11882
- return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(Flex2, { direction: "column", style: { flex: "1" }, children: [
11883
- label && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
11926
+ return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(Flex2, { direction: "column", style: { flex: "1" }, children: [
11927
+ label && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
11884
11928
  FormLabel,
11885
11929
  {
11886
11930
  name,
@@ -11889,7 +11933,7 @@ var TimePickerFormField = (_a) => {
11889
11933
  haveError
11890
11934
  }
11891
11935
  ),
11892
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
11936
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
11893
11937
  TimePicker,
11894
11938
  __spreadValues({
11895
11939
  selected,
@@ -11900,7 +11944,7 @@ var TimePickerFormField = (_a) => {
11900
11944
  hasError: haveError
11901
11945
  }, timePickerProps)
11902
11946
  ),
11903
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(ErrorFormMessage, { message: errorMsg })
11947
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(ErrorFormMessage, { message: errorMsg })
11904
11948
  ] });
11905
11949
  };
11906
11950
 
@@ -12079,6 +12123,7 @@ init_uploadService();
12079
12123
  StepTrigger,
12080
12124
  StepWrapper,
12081
12125
  Switch,
12126
+ SwitchFormField,
12082
12127
  SwitchStyled,
12083
12128
  Text,
12084
12129
  TextAreaFormField,
@@ -12095,6 +12140,7 @@ init_uploadService();
12095
12140
  TimePickerDropdownStyled,
12096
12141
  TimePickerFooterStyled,
12097
12142
  TimePickerFormField,
12143
+ TimePickerIconButton,
12098
12144
  TimePickerStyled,
12099
12145
  TimerPickerContentStyled,
12100
12146
  ToastItem,
package/dist/index.mjs CHANGED
@@ -6557,6 +6557,7 @@ import { useCallback, useRef as useRef5, useState as useState3 } from "react";
6557
6557
  import { jsx as jsx14, jsxs as jsxs8 } from "react/jsx-runtime";
6558
6558
  var TimePickerStyled = styled("div", {
6559
6559
  position: "relative",
6560
+ width: "fit-content",
6560
6561
  fontFamily: "$default",
6561
6562
  lineHeight: "$base",
6562
6563
  fontSize: "$14",
@@ -6580,7 +6581,7 @@ var TimePickerDropdownStyled = styled("div", {
6580
6581
  position: "absolute",
6581
6582
  zIndex: 10,
6582
6583
  width: "100%",
6583
- maxWidth: "8.875rem",
6584
+ maxWidth: "min-content",
6584
6585
  backgroundColor: "$neutral50",
6585
6586
  border: "1px solid $neutral300",
6586
6587
  borderRadius: "$sm",
@@ -6664,6 +6665,9 @@ var TimePickerButtonStyled = styled("button", {
6664
6665
  }
6665
6666
  }
6666
6667
  });
6668
+ var TimePickerIconButton = styled(Button, {
6669
+ padding: "0 !important"
6670
+ });
6667
6671
  var pad = (num) => String(num).padStart(2, "0");
6668
6672
  function TimePicker({
6669
6673
  selected,
@@ -6745,7 +6749,7 @@ function TimePicker({
6745
6749
  },
6746
6750
  children: [
6747
6751
  /* @__PURE__ */ jsx14(
6748
- Button,
6752
+ TimePickerIconButton,
6749
6753
  {
6750
6754
  type: "button",
6751
6755
  variant: "text",
@@ -6817,7 +6821,7 @@ function TimePicker({
6817
6821
  }
6818
6822
  ),
6819
6823
  /* @__PURE__ */ jsx14(
6820
- Button,
6824
+ TimePickerIconButton,
6821
6825
  {
6822
6826
  type: "button",
6823
6827
  variant: "text",
@@ -9094,15 +9098,51 @@ var CheckboxGroupFormField = ({
9094
9098
  ] });
9095
9099
  };
9096
9100
 
9101
+ // src/components/FormFields/SwitchFormField.tsx
9102
+ import { useFormContext as useFormContext10, Controller as Controller5 } from "react-hook-form";
9103
+ import { jsx as jsx44, jsxs as jsxs23 } from "react/jsx-runtime";
9104
+ var SwitchFormField = ({
9105
+ name,
9106
+ label,
9107
+ defaultValue = false,
9108
+ watch = false
9109
+ }) => {
9110
+ const {
9111
+ control,
9112
+ watch: watchForm
9113
+ } = useFormContext10();
9114
+ if (watch) {
9115
+ watchForm(name);
9116
+ }
9117
+ return /* @__PURE__ */ jsxs23(Flex, { justify: "between", style: { margin: "1rem 0" }, children: [
9118
+ /* @__PURE__ */ jsx44(Text, { typography: "labelMedium", fontWeight: "regular", children: label }),
9119
+ /* @__PURE__ */ jsx44(
9120
+ Controller5,
9121
+ {
9122
+ control,
9123
+ name,
9124
+ defaultValue,
9125
+ render: ({ field }) => /* @__PURE__ */ jsx44(
9126
+ Switch,
9127
+ {
9128
+ checked: field.value,
9129
+ onCheckedChange: field.onChange
9130
+ }
9131
+ )
9132
+ }
9133
+ )
9134
+ ] });
9135
+ };
9136
+
9097
9137
  // src/components/FormFields/EmailFormField.tsx
9098
- import { jsx as jsx44 } from "react/jsx-runtime";
9138
+ import { jsx as jsx45 } from "react/jsx-runtime";
9099
9139
  var EmailFormField = ({
9100
9140
  name,
9101
9141
  label,
9102
9142
  required,
9103
9143
  placeholder
9104
9144
  }) => {
9105
- return /* @__PURE__ */ jsx44(
9145
+ return /* @__PURE__ */ jsx45(
9106
9146
  TextFormField,
9107
9147
  {
9108
9148
  name,
@@ -9120,7 +9160,7 @@ import { useController as useController3 } from "react-hook-form";
9120
9160
 
9121
9161
  // src/components/RichEditor/RichEditor.tsx
9122
9162
  import { lazy, useEffect as useEffect6, useState as useState7, Suspense } from "react";
9123
- import { jsx as jsx45 } from "react/jsx-runtime";
9163
+ import { jsx as jsx46 } from "react/jsx-runtime";
9124
9164
  var QuillComponent = lazy(() => import("./QuillComponent-A5KIFPCL.mjs"));
9125
9165
  var RichEditor = (props) => {
9126
9166
  const [isClient, setIsClient] = useState7(false);
@@ -9128,12 +9168,12 @@ var RichEditor = (props) => {
9128
9168
  setIsClient(typeof window !== "undefined");
9129
9169
  }, []);
9130
9170
  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)) }) }) });
9171
+ return /* @__PURE__ */ jsx46("div", { children: /* @__PURE__ */ jsx46(ToastProvider, { children: /* @__PURE__ */ jsx46(Suspense, { fallback: null, children: /* @__PURE__ */ jsx46(QuillComponent, __spreadValues({}, props)) }) }) });
9132
9172
  };
9133
9173
  var RichEditor_default = RichEditor;
9134
9174
 
9135
9175
  // src/components/FormFields/RichEditorFormField.tsx
9136
- import { jsx as jsx46, jsxs as jsxs23 } from "react/jsx-runtime";
9176
+ import { jsx as jsx47, jsxs as jsxs24 } from "react/jsx-runtime";
9137
9177
  var RichEditorFormField = (_a) => {
9138
9178
  var _b = _a, {
9139
9179
  name,
@@ -9164,8 +9204,8 @@ var RichEditorFormField = (_a) => {
9164
9204
  const fieldError = fieldState.error;
9165
9205
  const haveError = !!fieldError;
9166
9206
  const errorMsg = fieldError == null ? void 0 : fieldError.message;
9167
- return /* @__PURE__ */ jsxs23(Flex, { direction: "column", children: [
9168
- label && /* @__PURE__ */ jsx46(
9207
+ return /* @__PURE__ */ jsxs24(Flex, { direction: "column", children: [
9208
+ label && /* @__PURE__ */ jsx47(
9169
9209
  FormLabel,
9170
9210
  {
9171
9211
  name,
@@ -9174,7 +9214,7 @@ var RichEditorFormField = (_a) => {
9174
9214
  haveError
9175
9215
  }
9176
9216
  ),
9177
- /* @__PURE__ */ jsx46(
9217
+ /* @__PURE__ */ jsx47(
9178
9218
  RichEditor_default,
9179
9219
  __spreadProps(__spreadValues({}, props), {
9180
9220
  value: field.value,
@@ -9182,14 +9222,14 @@ var RichEditorFormField = (_a) => {
9182
9222
  "aria-labelledby": `${name}-label`
9183
9223
  })
9184
9224
  ),
9185
- /* @__PURE__ */ jsx46(ErrorFormMessage, { message: errorMsg })
9225
+ /* @__PURE__ */ jsx47(ErrorFormMessage, { message: errorMsg })
9186
9226
  ] });
9187
9227
  };
9188
9228
 
9189
9229
  // src/components/FormFields/CalendarFormField.tsx
9190
9230
  import { useController as useController4 } from "react-hook-form";
9191
9231
  import { useCallback as useCallback4 } from "react";
9192
- import { jsx as jsx47, jsxs as jsxs24 } from "react/jsx-runtime";
9232
+ import { jsx as jsx48, jsxs as jsxs25 } from "react/jsx-runtime";
9193
9233
  var CalendarFormField = (_a) => {
9194
9234
  var _b = _a, {
9195
9235
  name,
@@ -9236,8 +9276,8 @@ var CalendarFormField = (_a) => {
9236
9276
  const handleCalendarChange = (date) => {
9237
9277
  setSelected(date);
9238
9278
  };
9239
- return /* @__PURE__ */ jsxs24(Flex, { direction: "column", style: { flex: "1" }, children: [
9240
- label && /* @__PURE__ */ jsx47(
9279
+ return /* @__PURE__ */ jsxs25(Flex, { direction: "column", style: { flex: "1" }, children: [
9280
+ label && /* @__PURE__ */ jsx48(
9241
9281
  FormLabel,
9242
9282
  {
9243
9283
  name,
@@ -9246,7 +9286,7 @@ var CalendarFormField = (_a) => {
9246
9286
  haveError
9247
9287
  }
9248
9288
  ),
9249
- /* @__PURE__ */ jsx47(
9289
+ /* @__PURE__ */ jsx48(
9250
9290
  Calendar,
9251
9291
  __spreadValues({
9252
9292
  selected,
@@ -9258,14 +9298,14 @@ var CalendarFormField = (_a) => {
9258
9298
  allowPastDates
9259
9299
  }, calendarProps)
9260
9300
  ),
9261
- /* @__PURE__ */ jsx47(ErrorFormMessage, { message: errorMsg })
9301
+ /* @__PURE__ */ jsx48(ErrorFormMessage, { message: errorMsg })
9262
9302
  ] });
9263
9303
  };
9264
9304
 
9265
9305
  // src/components/FormFields/TimePickerFormField.tsx
9266
9306
  import { useController as useController5 } from "react-hook-form";
9267
9307
  import { useCallback as useCallback5 } from "react";
9268
- import { jsx as jsx48, jsxs as jsxs25 } from "react/jsx-runtime";
9308
+ import { jsx as jsx49, jsxs as jsxs26 } from "react/jsx-runtime";
9269
9309
  var TimePickerFormField = (_a) => {
9270
9310
  var _b = _a, {
9271
9311
  name,
@@ -9308,8 +9348,8 @@ var TimePickerFormField = (_a) => {
9308
9348
  const handleTimePickerChange = (time) => {
9309
9349
  setSelected(time);
9310
9350
  };
9311
- return /* @__PURE__ */ jsxs25(Flex, { direction: "column", style: { flex: "1" }, children: [
9312
- label && /* @__PURE__ */ jsx48(
9351
+ return /* @__PURE__ */ jsxs26(Flex, { direction: "column", style: { flex: "1" }, children: [
9352
+ label && /* @__PURE__ */ jsx49(
9313
9353
  FormLabel,
9314
9354
  {
9315
9355
  name,
@@ -9318,7 +9358,7 @@ var TimePickerFormField = (_a) => {
9318
9358
  haveError
9319
9359
  }
9320
9360
  ),
9321
- /* @__PURE__ */ jsx48(
9361
+ /* @__PURE__ */ jsx49(
9322
9362
  TimePicker,
9323
9363
  __spreadValues({
9324
9364
  selected,
@@ -9329,7 +9369,7 @@ var TimePickerFormField = (_a) => {
9329
9369
  hasError: haveError
9330
9370
  }, timePickerProps)
9331
9371
  ),
9332
- /* @__PURE__ */ jsx48(ErrorFormMessage, { message: errorMsg })
9372
+ /* @__PURE__ */ jsx49(ErrorFormMessage, { message: errorMsg })
9333
9373
  ] });
9334
9374
  };
9335
9375
 
@@ -9503,6 +9543,7 @@ export {
9503
9543
  StepTrigger,
9504
9544
  StepWrapper,
9505
9545
  Switch,
9546
+ SwitchFormField,
9506
9547
  SwitchStyled,
9507
9548
  Text,
9508
9549
  TextAreaFormField,
@@ -9519,6 +9560,7 @@ export {
9519
9560
  TimePickerDropdownStyled,
9520
9561
  TimePickerFooterStyled,
9521
9562
  TimePickerFormField,
9563
+ TimePickerIconButton,
9522
9564
  TimePickerStyled,
9523
9565
  TimerPickerContentStyled,
9524
9566
  ToastItem,
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.6",
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
+ };