@sikka/hawa 0.43.6-next → 0.45.0-next

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.
Files changed (51) hide show
  1. package/dist/blocks/auth/index.d.mts +3 -2
  2. package/dist/blocks/auth/index.d.ts +3 -2
  3. package/dist/blocks/auth/index.js +62 -34
  4. package/dist/blocks/auth/index.mjs +44 -23
  5. package/dist/blocks/feedback/index.js +35 -20
  6. package/dist/blocks/feedback/index.mjs +2 -2
  7. package/dist/blocks/index.d.mts +5 -2
  8. package/dist/blocks/index.d.ts +5 -2
  9. package/dist/blocks/index.js +164 -56
  10. package/dist/blocks/index.mjs +45 -15
  11. package/dist/blocks/misc/index.d.mts +2 -0
  12. package/dist/blocks/misc/index.d.ts +2 -0
  13. package/dist/blocks/misc/index.js +97 -18
  14. package/dist/blocks/misc/index.mjs +79 -7
  15. package/dist/blocks/pricing/index.js +16 -8
  16. package/dist/blocks/pricing/index.mjs +1 -1
  17. package/dist/{chunk-DYYINLRJ.mjs → chunk-LMYT23CT.mjs} +19 -12
  18. package/dist/{chunk-A6PONMZ6.mjs → chunk-OE6XZ6LW.mjs} +16 -8
  19. package/dist/{chunk-VVUNGE7V.mjs → chunk-QMNXTGM4.mjs} +66 -44
  20. package/dist/datePicker/index.js +10 -1
  21. package/dist/datePicker/index.js.map +1 -1
  22. package/dist/datePicker/index.mjs +10 -1
  23. package/dist/datePicker/index.mjs.map +1 -1
  24. package/dist/elements/index.js +66 -44
  25. package/dist/elements/index.mjs +1 -1
  26. package/dist/index.css +3 -0
  27. package/dist/index.d.mts +5 -2
  28. package/dist/index.d.ts +5 -2
  29. package/dist/index.js +109 -59
  30. package/dist/index.mjs +109 -59
  31. package/dist/interfaceSettings/index.js +16 -8
  32. package/dist/interfaceSettings/index.js.map +1 -1
  33. package/dist/interfaceSettings/index.mjs +16 -8
  34. package/dist/interfaceSettings/index.mjs.map +1 -1
  35. package/dist/phoneInput/index.js +19 -12
  36. package/dist/phoneInput/index.js.map +1 -1
  37. package/dist/phoneInput/index.mjs +19 -12
  38. package/dist/phoneInput/index.mjs.map +1 -1
  39. package/dist/pinInput/index.js +22 -15
  40. package/dist/pinInput/index.js.map +1 -1
  41. package/dist/pinInput/index.mjs +22 -15
  42. package/dist/pinInput/index.mjs.map +1 -1
  43. package/dist/radio/index.js +16 -8
  44. package/dist/radio/index.js.map +1 -1
  45. package/dist/radio/index.mjs +16 -8
  46. package/dist/radio/index.mjs.map +1 -1
  47. package/dist/select/index.js +19 -12
  48. package/dist/select/index.js.map +1 -1
  49. package/dist/select/index.mjs +19 -12
  50. package/dist/select/index.mjs.map +1 -1
  51. package/package.json +11 -11
package/dist/index.js CHANGED
@@ -216,10 +216,10 @@ __export(components_exports, {
216
216
  TableHead: () => TableHead,
217
217
  TableHeader: () => TableHeader,
218
218
  TableRow: () => TableRow,
219
- Tabs: () => Tabs,
219
+ Tabs: () => Tabs2,
220
220
  TabsContent: () => TabsContent,
221
- TabsList: () => TabsList,
222
- TabsTrigger: () => TabsTrigger,
221
+ TabsList: () => TabsList2,
222
+ TabsTrigger: () => TabsTrigger2,
223
223
  Testimonial: () => Testimonial,
224
224
  Textarea: () => Textarea,
225
225
  Toast: () => Toast,
@@ -3913,6 +3913,7 @@ var BackToTop = ({ ...props }) => {
3913
3913
 
3914
3914
  // elements/radio/Radio.tsx
3915
3915
  var import_react13 = __toESM(require("react"));
3916
+ var import_react_tabs = require("@radix-ui/react-tabs");
3916
3917
 
3917
3918
  // elements/popover/Popover.tsx
3918
3919
  var React26 = __toESM(require("react"));
@@ -4057,9 +4058,10 @@ var Radio = (0, import_react13.forwardRef)(
4057
4058
  )
4058
4059
  },
4059
4060
  props.label && /* @__PURE__ */ import_react13.default.createElement(Label2, { ...labelProps }, props.label),
4060
- /* @__PURE__ */ import_react13.default.createElement(
4061
- "ul",
4061
+ /* @__PURE__ */ import_react13.default.createElement(import_react_tabs.Tabs, null, /* @__PURE__ */ import_react13.default.createElement(
4062
+ import_react_tabs.TabsList,
4062
4063
  {
4064
+ role: "tablist",
4063
4065
  ref: parentRef,
4064
4066
  className: cn(
4065
4067
  props.options && ((_a = props.options) == null ? void 0 : _a.length) > 2 ? "hawa-flex-wrap xs:hawa-max-w-full xs:hawa-flex-nowrap" : "",
@@ -4085,9 +4087,12 @@ var Radio = (0, import_react13.forwardRef)(
4085
4087
  asChild: true
4086
4088
  },
4087
4089
  /* @__PURE__ */ import_react13.default.createElement(
4088
- "li",
4090
+ import_react_tabs.TabsTrigger,
4089
4091
  {
4090
- "aria-current": "page",
4092
+ "aria-current": selectedOption === opt.value ? "page" : void 0,
4093
+ value: opt.value,
4094
+ role: "tab",
4095
+ tabIndex: 0,
4091
4096
  onClick: () => {
4092
4097
  if (props.disabled || opt.disabled) return;
4093
4098
  handleChange(opt);
@@ -4103,10 +4108,12 @@ var Radio = (0, import_react13.forwardRef)(
4103
4108
  ),
4104
4109
  /* @__PURE__ */ import_react13.default.createElement(PopoverContent, { ...opt.tooltipContentProps }, opt.tooltip)
4105
4110
  ) : /* @__PURE__ */ import_react13.default.createElement(
4106
- "li",
4111
+ import_react_tabs.TabsTrigger,
4107
4112
  {
4108
4113
  key: o,
4109
- "aria-current": "page",
4114
+ role: "tab",
4115
+ tabIndex: 0,
4116
+ "aria-current": selectedOption === opt.value ? "page" : void 0,
4110
4117
  onClick: () => {
4111
4118
  if (props.disabled || opt.disabled) return;
4112
4119
  handleChange(opt);
@@ -4114,13 +4121,14 @@ var Radio = (0, import_react13.forwardRef)(
4114
4121
  className: cn(
4115
4122
  ...radio_option_tabs_styling,
4116
4123
  selectedOption === opt.value ? activeTabStyle : inactiveTabStyle
4117
- )
4124
+ ),
4125
+ value: opt.value
4118
4126
  },
4119
4127
  opt.icon && opt.icon,
4120
4128
  opt.label
4121
4129
  );
4122
4130
  })
4123
- ),
4131
+ )),
4124
4132
  !forceHideHelperText && /* @__PURE__ */ import_react13.default.createElement(HelperText, { helperText: props.helperText })
4125
4133
  );
4126
4134
  case "bordered":
@@ -5649,7 +5657,7 @@ var tabsTriggerVariant = (0, import_tailwind_variants.tv)({
5649
5657
  defaultVariants: { variant: "default", orientation: "horizontal" }
5650
5658
  });
5651
5659
  var TabsContext = React42.createContext({ orientation: "horizontal", variant: "default", scrollable: false });
5652
- var Tabs = React42.forwardRef(
5660
+ var Tabs2 = React42.forwardRef(
5653
5661
  ({ className, orientation, scrollable, variant = "default", ...props }, ref) => /* @__PURE__ */ React42.createElement(
5654
5662
  TabsPrimitive.Root,
5655
5663
  {
@@ -5664,7 +5672,7 @@ var Tabs = React42.forwardRef(
5664
5672
  /* @__PURE__ */ React42.createElement(TabsContext.Provider, { value: { orientation, variant, scrollable } }, props.children)
5665
5673
  )
5666
5674
  );
5667
- var TabsList = React42.forwardRef(({ className, classNames, ...props }, ref) => {
5675
+ var TabsList2 = React42.forwardRef(({ className, classNames, ...props }, ref) => {
5668
5676
  const { orientation, variant, scrollable } = React42.useContext(TabsContext);
5669
5677
  const { width } = useViewportSize();
5670
5678
  if (scrollable && width < 768 && orientation === "horizontal") {
@@ -5696,7 +5704,7 @@ var TabsList = React42.forwardRef(({ className, classNames, ...props }, ref) =>
5696
5704
  );
5697
5705
  }
5698
5706
  });
5699
- var TabsTrigger = React42.forwardRef(
5707
+ var TabsTrigger2 = React42.forwardRef(
5700
5708
  ({ className, chipProps, withPopover = false, onPopoverClick, ...props }, ref) => {
5701
5709
  const { orientation, variant } = React42.useContext(TabsContext);
5702
5710
  if (withPopover) {
@@ -5752,9 +5760,9 @@ var TabsContent = React42.forwardRef(({ className, ...props }, ref) => /* @__PUR
5752
5760
  ...props
5753
5761
  }
5754
5762
  ));
5755
- Tabs.displayName = TabsPrimitive.Root.displayName;
5756
- TabsList.displayName = TabsPrimitive.List.displayName;
5757
- TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
5763
+ Tabs2.displayName = TabsPrimitive.Root.displayName;
5764
+ TabsList2.displayName = TabsPrimitive.List.displayName;
5765
+ TabsTrigger2.displayName = TabsPrimitive.Trigger.displayName;
5758
5766
  TabsContent.displayName = TabsPrimitive.Content.displayName;
5759
5767
 
5760
5768
  // elements/select/Select.tsx
@@ -5784,13 +5792,21 @@ var Select = ({
5784
5792
  children
5785
5793
  );
5786
5794
  };
5787
- const Option = ({ children, innerProps, innerRef }) => {
5795
+ const Option = ({
5796
+ children,
5797
+ innerProps,
5798
+ innerRef,
5799
+ isFocused,
5800
+ isSelected
5801
+ }) => {
5788
5802
  return /* @__PURE__ */ import_react35.default.createElement(
5789
5803
  "div",
5790
5804
  {
5791
5805
  ref: innerRef,
5792
5806
  className: cn(
5793
- "hawa-flex hawa-cursor-pointer hawa-select-none hawa-flex-row hawa-items-center hawa-justify-between hawa-rounded-inner hawa-p-1 hawa-px-2 hawa-transition-all hover:hawa-bg-primary hover:hawa-text-primary-foreground"
5807
+ "hawa-flex hawa-cursor-pointer hawa-select-none hawa-flex-row hawa-items-center hawa-justify-between hawa-rounded-inner hawa-p-1 hawa-px-2 hawa-transition-all",
5808
+ isFocused ? "hawa-bg-accent hawa-text-bg-accent-foreground" : "hover:hawa-bg-accent hover:hawa-text-accent-foreground",
5809
+ isSelected && "hawa-bg-primary hawa-text-primary-foreground"
5794
5810
  ),
5795
5811
  ...innerProps
5796
5812
  },
@@ -5847,15 +5863,20 @@ var Select = ({
5847
5863
  container: () => cn(
5848
5864
  selectContainerStyles,
5849
5865
  props.phoneCode && phoneCodeStyles,
5850
- props.disabled ? "hawa-cursor-not-allowed" : "hawa-cursor-pointer",
5851
5866
  props.isMulti && "hawa-ps-0 "
5852
5867
  ),
5853
- placeholder: () => selectPlaceholderStyles,
5868
+ placeholder: () => cn(
5869
+ selectPlaceholderStyles,
5870
+ props.disabled && "hawa-text-muted-foreground"
5871
+ ),
5854
5872
  valueContainer: () => "hawa-text-foreground hawa-px-1 ",
5855
- singleValue: () => "hawa-text-foreground",
5873
+ singleValue: () => cn(
5874
+ props.disabled ? "hawa-text-muted-foreground hawa-opacity-30" : "hawa-text-foreground"
5875
+ ),
5856
5876
  indicatorsContainer: () => cn(
5857
5877
  selectIndicatorContainerStyles,
5858
- props.hideIndicator ? "hawa-invisible" : "hawa-px-1"
5878
+ props.hideIndicator ? "hawa-invisible" : "hawa-px-1",
5879
+ props.disabled && "hawa-opacity-30"
5859
5880
  )
5860
5881
  },
5861
5882
  unstyled: true,
@@ -5863,12 +5884,6 @@ var Select = ({
5863
5884
  components: props.hideIndicator ? { Option, Menu: Menu2, IndicatorsContainer: () => null } : {
5864
5885
  Option,
5865
5886
  Menu: Menu2,
5866
- // Control: (e) => (
5867
- // <div
5868
- // className={cn(e.className, "hawa-flex hawa-flex-row")}
5869
- // {...e}
5870
- // />
5871
- // ),
5872
5887
  ValueContainer: (e) => /* @__PURE__ */ import_react35.default.createElement(
5873
5888
  "div",
5874
5889
  {
@@ -7940,19 +7955,19 @@ var PhoneInput = ({
7940
7955
  var React50 = __toESM(require("react"));
7941
7956
  var import_input_otp = require("input-otp");
7942
7957
 
7943
- // ../../node_modules/.pnpm/lucide-react@0.417.0_react@18.3.1/node_modules/lucide-react/dist/esm/createLucideIcon.js
7958
+ // ../../node_modules/.pnpm/lucide-react@0.424.0_react@18.3.1/node_modules/lucide-react/dist/esm/createLucideIcon.js
7944
7959
  var import_react41 = require("react");
7945
7960
 
7946
- // ../../node_modules/.pnpm/lucide-react@0.417.0_react@18.3.1/node_modules/lucide-react/dist/esm/shared/src/utils.js
7961
+ // ../../node_modules/.pnpm/lucide-react@0.424.0_react@18.3.1/node_modules/lucide-react/dist/esm/shared/src/utils.js
7947
7962
  var toKebabCase = (string9) => string9.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
7948
7963
  var mergeClasses = (...classes) => classes.filter((className, index, array) => {
7949
7964
  return Boolean(className) && array.indexOf(className) === index;
7950
7965
  }).join(" ");
7951
7966
 
7952
- // ../../node_modules/.pnpm/lucide-react@0.417.0_react@18.3.1/node_modules/lucide-react/dist/esm/Icon.js
7967
+ // ../../node_modules/.pnpm/lucide-react@0.424.0_react@18.3.1/node_modules/lucide-react/dist/esm/Icon.js
7953
7968
  var import_react40 = require("react");
7954
7969
 
7955
- // ../../node_modules/.pnpm/lucide-react@0.417.0_react@18.3.1/node_modules/lucide-react/dist/esm/defaultAttributes.js
7970
+ // ../../node_modules/.pnpm/lucide-react@0.424.0_react@18.3.1/node_modules/lucide-react/dist/esm/defaultAttributes.js
7956
7971
  var defaultAttributes = {
7957
7972
  xmlns: "http://www.w3.org/2000/svg",
7958
7973
  width: 24,
@@ -7965,7 +7980,7 @@ var defaultAttributes = {
7965
7980
  strokeLinejoin: "round"
7966
7981
  };
7967
7982
 
7968
- // ../../node_modules/.pnpm/lucide-react@0.417.0_react@18.3.1/node_modules/lucide-react/dist/esm/Icon.js
7983
+ // ../../node_modules/.pnpm/lucide-react@0.424.0_react@18.3.1/node_modules/lucide-react/dist/esm/Icon.js
7969
7984
  var Icon = (0, import_react40.forwardRef)(
7970
7985
  ({
7971
7986
  color = "currentColor",
@@ -7997,7 +8012,7 @@ var Icon = (0, import_react40.forwardRef)(
7997
8012
  }
7998
8013
  );
7999
8014
 
8000
- // ../../node_modules/.pnpm/lucide-react@0.417.0_react@18.3.1/node_modules/lucide-react/dist/esm/createLucideIcon.js
8015
+ // ../../node_modules/.pnpm/lucide-react@0.424.0_react@18.3.1/node_modules/lucide-react/dist/esm/createLucideIcon.js
8001
8016
  var createLucideIcon = (iconName, iconNode) => {
8002
8017
  const Component = (0, import_react41.forwardRef)(
8003
8018
  ({ className, ...props }, ref) => (0, import_react41.createElement)(Icon, {
@@ -8011,7 +8026,7 @@ var createLucideIcon = (iconName, iconNode) => {
8011
8026
  return Component;
8012
8027
  };
8013
8028
 
8014
- // ../../node_modules/.pnpm/lucide-react@0.417.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/dot.js
8029
+ // ../../node_modules/.pnpm/lucide-react@0.424.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/dot.js
8015
8030
  var Dot = createLucideIcon("Dot", [
8016
8031
  ["circle", { cx: "12.1", cy: "12.1", r: "1", key: "18d7e5" }]
8017
8032
  ]);
@@ -8068,12 +8083,19 @@ var PinInput = ({
8068
8083
  const clampedSeparatorPosition = Math.min(separatorPosition, maxLength);
8069
8084
  const firstGroupLength = clampedSeparatorPosition > 0 ? clampedSeparatorPosition : 0;
8070
8085
  const secondGroupLength = maxLength - firstGroupLength;
8071
- return /* @__PURE__ */ React50.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-2" }, /* @__PURE__ */ React50.createElement(PinInputRoot, { ...props }, firstGroupLength > 0 && /* @__PURE__ */ React50.createElement(PinInputGroup, { className: "hawa-w-full" }, [...Array(firstGroupLength)].map((_, index) => /* @__PURE__ */ React50.createElement(PinInputSlot, { key: index, index, className: "hawa-w-full" }))), separatorPosition > 0 && separatorPosition < props.maxLength && /* @__PURE__ */ React50.createElement(PinInputSeperator, null), secondGroupLength > 0 && /* @__PURE__ */ React50.createElement(PinInputGroup, { className: "hawa-w-full" }, [...Array(secondGroupLength)].map((_, index) => /* @__PURE__ */ React50.createElement(
8086
+ return /* @__PURE__ */ React50.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-2" }, /* @__PURE__ */ React50.createElement(PinInputRoot, { ...props }, firstGroupLength > 0 && /* @__PURE__ */ React50.createElement(PinInputGroup, { className: "hawa-w-full hawa-gap-2" }, [...Array(firstGroupLength)].map((_, index) => /* @__PURE__ */ React50.createElement(
8087
+ PinInputSlot,
8088
+ {
8089
+ key: index,
8090
+ index,
8091
+ className: "hawa-w-full hawa-border"
8092
+ }
8093
+ ))), separatorPosition > 0 && separatorPosition < props.maxLength && /* @__PURE__ */ React50.createElement(PinInputSeperator, null), secondGroupLength > 0 && /* @__PURE__ */ React50.createElement(PinInputGroup, { className: "hawa-w-full hawa-gap-2" }, [...Array(secondGroupLength)].map((_, index) => /* @__PURE__ */ React50.createElement(
8072
8094
  PinInputSlot,
8073
8095
  {
8074
8096
  key: index + firstGroupLength,
8075
8097
  index: index + firstGroupLength,
8076
- className: "hawa-w-full"
8098
+ className: "hawa-w-full hawa-border"
8077
8099
  }
8078
8100
  )))), /* @__PURE__ */ React50.createElement(HelperText, { helperText: props.helperText }));
8079
8101
  };
@@ -12011,12 +12033,10 @@ var CodeConfirmation = ({
12011
12033
  {
12012
12034
  noValidate: true,
12013
12035
  onSubmit: handleSubmit((e) => {
12014
- if (props.handleConfirm) {
12015
- return props.handleConfirm(e);
12036
+ if (props.onConfirm) {
12037
+ return props.onConfirm(e);
12016
12038
  } else {
12017
- console.log(
12018
- "Form is submitted but handleConfirm prop is missing"
12019
- );
12039
+ console.log("Form is submitted but onConfirm prop is missing");
12020
12040
  }
12021
12041
  })
12022
12042
  },
@@ -12044,12 +12064,28 @@ var CodeConfirmation = ({
12044
12064
  className: "clickable-link",
12045
12065
  onClick: () => {
12046
12066
  startResendTimer();
12047
- props.handleResend();
12067
+ props.onResend();
12048
12068
  }
12049
12069
  },
12050
12070
  ((_i = props.texts) == null ? void 0 : _i.resendCode) || "Click to resend"
12051
12071
  )),
12052
- /* @__PURE__ */ import_react74.default.createElement("div", { className: "hawa-mt-4 hawa-grid hawa-grid-cols-2 hawa-gap-2" }, /* @__PURE__ */ import_react74.default.createElement(Button, { variant: "outline" }, ((_j = props.texts) == null ? void 0 : _j.cancel) || "Cancel"), /* @__PURE__ */ import_react74.default.createElement(Button, { isLoading: props.confirmLoading }, ((_k = props.texts) == null ? void 0 : _k.confirm) || "Confirm"))
12072
+ /* @__PURE__ */ import_react74.default.createElement("div", { className: "hawa-mt-4 hawa-grid hawa-grid-cols-2 hawa-gap-2" }, /* @__PURE__ */ import_react74.default.createElement(
12073
+ Button,
12074
+ {
12075
+ type: "button",
12076
+ onClick: () => {
12077
+ if (props.onCancel) {
12078
+ return props.onCancel();
12079
+ } else {
12080
+ console.log(
12081
+ "Cancel button clicked but onCancel prop is missing"
12082
+ );
12083
+ }
12084
+ },
12085
+ variant: "outline"
12086
+ },
12087
+ ((_j = props.texts) == null ? void 0 : _j.cancel) || "Cancel"
12088
+ ), /* @__PURE__ */ import_react74.default.createElement(Button, { isLoading: props.confirmLoading }, ((_k = props.texts) == null ? void 0 : _k.confirm) || "Confirm"))
12053
12089
  )));
12054
12090
  };
12055
12091
 
@@ -12535,14 +12571,14 @@ var FeedbackForm = (props) => {
12535
12571
  var import_react79 = __toESM(require("react"));
12536
12572
  var LegalTexts = ({ tabs, ...props }) => {
12537
12573
  return /* @__PURE__ */ import_react79.default.createElement(
12538
- Tabs,
12574
+ Tabs2,
12539
12575
  {
12540
12576
  value: props.activeTab,
12541
12577
  onValueChange: props.handleTabChange,
12542
12578
  defaultValue: props.defaultTab || tabs[0].value,
12543
12579
  dir: props.direction
12544
12580
  },
12545
- /* @__PURE__ */ import_react79.default.createElement(TabsList, { className: "hawa-w-full" }, tabs.map((tab, index) => /* @__PURE__ */ import_react79.default.createElement(TabsTrigger, { key: index, value: tab.value }, tab.title))),
12581
+ /* @__PURE__ */ import_react79.default.createElement(TabsList2, { className: "hawa-w-full" }, tabs.map((tab, index) => /* @__PURE__ */ import_react79.default.createElement(TabsTrigger2, { key: index, value: tab.value }, tab.title))),
12546
12582
  tabs.map((tab, index) => /* @__PURE__ */ import_react79.default.createElement(TabsContent, { key: index, value: tab.value }, /* @__PURE__ */ import_react79.default.createElement(
12547
12583
  ScrollArea,
12548
12584
  {
@@ -12692,6 +12728,7 @@ var ContactForm = ({
12692
12728
  onSubmit,
12693
12729
  customFields,
12694
12730
  classNames,
12731
+ clearOnSubmit = true,
12695
12732
  ...props
12696
12733
  }) => {
12697
12734
  var _a, _b, _c, _d, _e;
@@ -12735,8 +12772,11 @@ var ContactForm = ({
12735
12772
  control,
12736
12773
  handleSubmit,
12737
12774
  formState: { errors },
12738
- reset
12775
+ reset,
12776
+ getValues,
12777
+ trigger
12739
12778
  } = (0, import_react_hook_form9.useForm)({
12779
+ mode: "all",
12740
12780
  resolver: (0, import_zod8.zodResolver)(MainSchema),
12741
12781
  defaultValues: {
12742
12782
  name: "",
@@ -12745,10 +12785,16 @@ var ContactForm = ({
12745
12785
  ...customFieldsDefaultValues
12746
12786
  }
12747
12787
  });
12748
- const handleFormSubmit = (data) => {
12788
+ const SubmitForm = async (data) => {
12789
+ const isValid = await trigger();
12790
+ if (!isValid) {
12791
+ return;
12792
+ }
12749
12793
  if (onSubmit) {
12750
12794
  onSubmit(data);
12751
- reset();
12795
+ if (clearOnSubmit) {
12796
+ reset();
12797
+ }
12752
12798
  } else {
12753
12799
  console.log("Form is submitted but onSubmit prop is missing");
12754
12800
  }
@@ -12758,7 +12804,8 @@ var ContactForm = ({
12758
12804
  {
12759
12805
  className: cn(
12760
12806
  "hawa-w-full",
12761
- cardless && "hawa-border-none hawa-bg-transparent hawa-shadow-none hawa-drop-shadow-none"
12807
+ cardless && "hawa-border-none hawa-bg-transparent hawa-shadow-none hawa-drop-shadow-none",
12808
+ classNames == null ? void 0 : classNames.container
12762
12809
  ),
12763
12810
  style: cardless ? { boxShadow: "none" } : void 0
12764
12811
  },
@@ -12766,7 +12813,7 @@ var ContactForm = ({
12766
12813
  "form",
12767
12814
  {
12768
12815
  noValidate: true,
12769
- onSubmit: handleSubmit(handleFormSubmit),
12816
+ onSubmit: handleSubmit(SubmitForm),
12770
12817
  className: "hawa-space-y-2",
12771
12818
  id: formId,
12772
12819
  autoComplete: formAutoComplete
@@ -12877,7 +12924,10 @@ var ContactForm = ({
12877
12924
  textareaProps: {
12878
12925
  placeholder: texts == null ? void 0 : texts.message.placeholder,
12879
12926
  className: "hawa-min-h-20",
12880
- ...field
12927
+ ...field,
12928
+ onKeyDown: getHotkeyHandler([
12929
+ ["mod+enter", () => SubmitForm(getValues())]
12930
+ ])
12881
12931
  },
12882
12932
  classNames: { textarea: "hawa-min-h-40 hawa-h-full" },
12883
12933
  helperText: (_a2 = errors.message) == null ? void 0 : _a2.message
@@ -13843,7 +13893,7 @@ var Usage = (props) => {
13843
13893
 
13844
13894
  lucide-react/dist/esm/shared/src/utils.js:
13845
13895
  (**
13846
- * @license lucide-react v0.417.0 - ISC
13896
+ * @license lucide-react v0.424.0 - ISC
13847
13897
  *
13848
13898
  * This source code is licensed under the ISC license.
13849
13899
  * See the LICENSE file in the root directory of this source tree.
@@ -13851,7 +13901,7 @@ lucide-react/dist/esm/shared/src/utils.js:
13851
13901
 
13852
13902
  lucide-react/dist/esm/defaultAttributes.js:
13853
13903
  (**
13854
- * @license lucide-react v0.417.0 - ISC
13904
+ * @license lucide-react v0.424.0 - ISC
13855
13905
  *
13856
13906
  * This source code is licensed under the ISC license.
13857
13907
  * See the LICENSE file in the root directory of this source tree.
@@ -13859,7 +13909,7 @@ lucide-react/dist/esm/defaultAttributes.js:
13859
13909
 
13860
13910
  lucide-react/dist/esm/Icon.js:
13861
13911
  (**
13862
- * @license lucide-react v0.417.0 - ISC
13912
+ * @license lucide-react v0.424.0 - ISC
13863
13913
  *
13864
13914
  * This source code is licensed under the ISC license.
13865
13915
  * See the LICENSE file in the root directory of this source tree.
@@ -13867,7 +13917,7 @@ lucide-react/dist/esm/Icon.js:
13867
13917
 
13868
13918
  lucide-react/dist/esm/createLucideIcon.js:
13869
13919
  (**
13870
- * @license lucide-react v0.417.0 - ISC
13920
+ * @license lucide-react v0.424.0 - ISC
13871
13921
  *
13872
13922
  * This source code is licensed under the ISC license.
13873
13923
  * See the LICENSE file in the root directory of this source tree.
@@ -13875,7 +13925,7 @@ lucide-react/dist/esm/createLucideIcon.js:
13875
13925
 
13876
13926
  lucide-react/dist/esm/icons/dot.js:
13877
13927
  (**
13878
- * @license lucide-react v0.417.0 - ISC
13928
+ * @license lucide-react v0.424.0 - ISC
13879
13929
  *
13880
13930
  * This source code is licensed under the ISC license.
13881
13931
  * See the LICENSE file in the root directory of this source tree.
@@ -13883,7 +13933,7 @@ lucide-react/dist/esm/icons/dot.js:
13883
13933
 
13884
13934
  lucide-react/dist/esm/lucide-react.js:
13885
13935
  (**
13886
- * @license lucide-react v0.417.0 - ISC
13936
+ * @license lucide-react v0.424.0 - ISC
13887
13937
  *
13888
13938
  * This source code is licensed under the ISC license.
13889
13939
  * See the LICENSE file in the root directory of this source tree.