@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
@@ -3320,13 +3320,21 @@ var Select = ({
3320
3320
  children
3321
3321
  );
3322
3322
  };
3323
- const Option = ({ children, innerProps, innerRef }) => {
3323
+ const Option = ({
3324
+ children,
3325
+ innerProps,
3326
+ innerRef,
3327
+ isFocused,
3328
+ isSelected
3329
+ }) => {
3324
3330
  return /* @__PURE__ */ import_react9.default.createElement(
3325
3331
  "div",
3326
3332
  {
3327
3333
  ref: innerRef,
3328
3334
  className: cn(
3329
- "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"
3335
+ "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",
3336
+ isFocused ? "hawa-bg-accent hawa-text-bg-accent-foreground" : "hover:hawa-bg-accent hover:hawa-text-accent-foreground",
3337
+ isSelected && "hawa-bg-primary hawa-text-primary-foreground"
3330
3338
  ),
3331
3339
  ...innerProps
3332
3340
  },
@@ -3383,15 +3391,20 @@ var Select = ({
3383
3391
  container: () => cn(
3384
3392
  selectContainerStyles,
3385
3393
  props.phoneCode && phoneCodeStyles,
3386
- props.disabled ? "hawa-cursor-not-allowed" : "hawa-cursor-pointer",
3387
3394
  props.isMulti && "hawa-ps-0 "
3388
3395
  ),
3389
- placeholder: () => selectPlaceholderStyles,
3396
+ placeholder: () => cn(
3397
+ selectPlaceholderStyles,
3398
+ props.disabled && "hawa-text-muted-foreground"
3399
+ ),
3390
3400
  valueContainer: () => "hawa-text-foreground hawa-px-1 ",
3391
- singleValue: () => "hawa-text-foreground",
3401
+ singleValue: () => cn(
3402
+ props.disabled ? "hawa-text-muted-foreground hawa-opacity-30" : "hawa-text-foreground"
3403
+ ),
3392
3404
  indicatorsContainer: () => cn(
3393
3405
  selectIndicatorContainerStyles,
3394
- props.hideIndicator ? "hawa-invisible" : "hawa-px-1"
3406
+ props.hideIndicator ? "hawa-invisible" : "hawa-px-1",
3407
+ props.disabled && "hawa-opacity-30"
3395
3408
  )
3396
3409
  },
3397
3410
  unstyled: true,
@@ -3399,12 +3412,6 @@ var Select = ({
3399
3412
  components: props.hideIndicator ? { Option, Menu, IndicatorsContainer: () => null } : {
3400
3413
  Option,
3401
3414
  Menu,
3402
- // Control: (e) => (
3403
- // <div
3404
- // className={cn(e.className, "hawa-flex hawa-flex-row")}
3405
- // {...e}
3406
- // />
3407
- // ),
3408
3415
  ValueContainer: (e) => /* @__PURE__ */ import_react9.default.createElement(
3409
3416
  "div",
3410
3417
  {
@@ -4823,19 +4830,19 @@ var z5 = __toESM(require("zod"));
4823
4830
  var React25 = __toESM(require("react"));
4824
4831
  var import_input_otp = require("input-otp");
4825
4832
 
4826
- // ../../node_modules/.pnpm/lucide-react@0.417.0_react@18.3.1/node_modules/lucide-react/dist/esm/createLucideIcon.js
4833
+ // ../../node_modules/.pnpm/lucide-react@0.424.0_react@18.3.1/node_modules/lucide-react/dist/esm/createLucideIcon.js
4827
4834
  var import_react23 = require("react");
4828
4835
 
4829
- // ../../node_modules/.pnpm/lucide-react@0.417.0_react@18.3.1/node_modules/lucide-react/dist/esm/shared/src/utils.js
4836
+ // ../../node_modules/.pnpm/lucide-react@0.424.0_react@18.3.1/node_modules/lucide-react/dist/esm/shared/src/utils.js
4830
4837
  var toKebabCase = (string9) => string9.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
4831
4838
  var mergeClasses = (...classes) => classes.filter((className, index, array) => {
4832
4839
  return Boolean(className) && array.indexOf(className) === index;
4833
4840
  }).join(" ");
4834
4841
 
4835
- // ../../node_modules/.pnpm/lucide-react@0.417.0_react@18.3.1/node_modules/lucide-react/dist/esm/Icon.js
4842
+ // ../../node_modules/.pnpm/lucide-react@0.424.0_react@18.3.1/node_modules/lucide-react/dist/esm/Icon.js
4836
4843
  var import_react22 = require("react");
4837
4844
 
4838
- // ../../node_modules/.pnpm/lucide-react@0.417.0_react@18.3.1/node_modules/lucide-react/dist/esm/defaultAttributes.js
4845
+ // ../../node_modules/.pnpm/lucide-react@0.424.0_react@18.3.1/node_modules/lucide-react/dist/esm/defaultAttributes.js
4839
4846
  var defaultAttributes = {
4840
4847
  xmlns: "http://www.w3.org/2000/svg",
4841
4848
  width: 24,
@@ -4848,7 +4855,7 @@ var defaultAttributes = {
4848
4855
  strokeLinejoin: "round"
4849
4856
  };
4850
4857
 
4851
- // ../../node_modules/.pnpm/lucide-react@0.417.0_react@18.3.1/node_modules/lucide-react/dist/esm/Icon.js
4858
+ // ../../node_modules/.pnpm/lucide-react@0.424.0_react@18.3.1/node_modules/lucide-react/dist/esm/Icon.js
4852
4859
  var Icon = (0, import_react22.forwardRef)(
4853
4860
  ({
4854
4861
  color = "currentColor",
@@ -4880,7 +4887,7 @@ var Icon = (0, import_react22.forwardRef)(
4880
4887
  }
4881
4888
  );
4882
4889
 
4883
- // ../../node_modules/.pnpm/lucide-react@0.417.0_react@18.3.1/node_modules/lucide-react/dist/esm/createLucideIcon.js
4890
+ // ../../node_modules/.pnpm/lucide-react@0.424.0_react@18.3.1/node_modules/lucide-react/dist/esm/createLucideIcon.js
4884
4891
  var createLucideIcon = (iconName, iconNode) => {
4885
4892
  const Component = (0, import_react23.forwardRef)(
4886
4893
  ({ className, ...props }, ref) => (0, import_react23.createElement)(Icon, {
@@ -4894,7 +4901,7 @@ var createLucideIcon = (iconName, iconNode) => {
4894
4901
  return Component;
4895
4902
  };
4896
4903
 
4897
- // ../../node_modules/.pnpm/lucide-react@0.417.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/dot.js
4904
+ // ../../node_modules/.pnpm/lucide-react@0.424.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/dot.js
4898
4905
  var Dot = createLucideIcon("Dot", [
4899
4906
  ["circle", { cx: "12.1", cy: "12.1", r: "1", key: "18d7e5" }]
4900
4907
  ]);
@@ -4951,12 +4958,19 @@ var PinInput = ({
4951
4958
  const clampedSeparatorPosition = Math.min(separatorPosition, maxLength);
4952
4959
  const firstGroupLength = clampedSeparatorPosition > 0 ? clampedSeparatorPosition : 0;
4953
4960
  const secondGroupLength = maxLength - firstGroupLength;
4954
- return /* @__PURE__ */ React25.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-2" }, /* @__PURE__ */ React25.createElement(PinInputRoot, { ...props }, firstGroupLength > 0 && /* @__PURE__ */ React25.createElement(PinInputGroup, { className: "hawa-w-full" }, [...Array(firstGroupLength)].map((_, index) => /* @__PURE__ */ React25.createElement(PinInputSlot, { key: index, index, className: "hawa-w-full" }))), separatorPosition > 0 && separatorPosition < props.maxLength && /* @__PURE__ */ React25.createElement(PinInputSeperator, null), secondGroupLength > 0 && /* @__PURE__ */ React25.createElement(PinInputGroup, { className: "hawa-w-full" }, [...Array(secondGroupLength)].map((_, index) => /* @__PURE__ */ React25.createElement(
4961
+ return /* @__PURE__ */ React25.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-2" }, /* @__PURE__ */ React25.createElement(PinInputRoot, { ...props }, firstGroupLength > 0 && /* @__PURE__ */ React25.createElement(PinInputGroup, { className: "hawa-w-full hawa-gap-2" }, [...Array(firstGroupLength)].map((_, index) => /* @__PURE__ */ React25.createElement(
4962
+ PinInputSlot,
4963
+ {
4964
+ key: index,
4965
+ index,
4966
+ className: "hawa-w-full hawa-border"
4967
+ }
4968
+ ))), separatorPosition > 0 && separatorPosition < props.maxLength && /* @__PURE__ */ React25.createElement(PinInputSeperator, null), secondGroupLength > 0 && /* @__PURE__ */ React25.createElement(PinInputGroup, { className: "hawa-w-full hawa-gap-2" }, [...Array(secondGroupLength)].map((_, index) => /* @__PURE__ */ React25.createElement(
4955
4969
  PinInputSlot,
4956
4970
  {
4957
4971
  key: index + firstGroupLength,
4958
4972
  index: index + firstGroupLength,
4959
- className: "hawa-w-full"
4973
+ className: "hawa-w-full hawa-border"
4960
4974
  }
4961
4975
  )))), /* @__PURE__ */ React25.createElement(HelperText, { helperText: props.helperText }));
4962
4976
  };
@@ -5016,12 +5030,10 @@ var CodeConfirmation = ({
5016
5030
  {
5017
5031
  noValidate: true,
5018
5032
  onSubmit: handleSubmit((e) => {
5019
- if (props.handleConfirm) {
5020
- return props.handleConfirm(e);
5033
+ if (props.onConfirm) {
5034
+ return props.onConfirm(e);
5021
5035
  } else {
5022
- console.log(
5023
- "Form is submitted but handleConfirm prop is missing"
5024
- );
5036
+ console.log("Form is submitted but onConfirm prop is missing");
5025
5037
  }
5026
5038
  })
5027
5039
  },
@@ -5049,12 +5061,28 @@ var CodeConfirmation = ({
5049
5061
  className: "clickable-link",
5050
5062
  onClick: () => {
5051
5063
  startResendTimer();
5052
- props.handleResend();
5064
+ props.onResend();
5053
5065
  }
5054
5066
  },
5055
5067
  ((_i = props.texts) == null ? void 0 : _i.resendCode) || "Click to resend"
5056
5068
  )),
5057
- /* @__PURE__ */ import_react24.default.createElement("div", { className: "hawa-mt-4 hawa-grid hawa-grid-cols-2 hawa-gap-2" }, /* @__PURE__ */ import_react24.default.createElement(Button, { variant: "outline" }, ((_j = props.texts) == null ? void 0 : _j.cancel) || "Cancel"), /* @__PURE__ */ import_react24.default.createElement(Button, { isLoading: props.confirmLoading }, ((_k = props.texts) == null ? void 0 : _k.confirm) || "Confirm"))
5069
+ /* @__PURE__ */ import_react24.default.createElement("div", { className: "hawa-mt-4 hawa-grid hawa-grid-cols-2 hawa-gap-2" }, /* @__PURE__ */ import_react24.default.createElement(
5070
+ Button,
5071
+ {
5072
+ type: "button",
5073
+ onClick: () => {
5074
+ if (props.onCancel) {
5075
+ return props.onCancel();
5076
+ } else {
5077
+ console.log(
5078
+ "Cancel button clicked but onCancel prop is missing"
5079
+ );
5080
+ }
5081
+ },
5082
+ variant: "outline"
5083
+ },
5084
+ ((_j = props.texts) == null ? void 0 : _j.cancel) || "Cancel"
5085
+ ), /* @__PURE__ */ import_react24.default.createElement(Button, { isLoading: props.confirmLoading }, ((_k = props.texts) == null ? void 0 : _k.confirm) || "Confirm"))
5058
5086
  )));
5059
5087
  };
5060
5088
 
@@ -5066,6 +5094,7 @@ var z6 = __toESM(require("zod"));
5066
5094
 
5067
5095
  // elements/radio/Radio.tsx
5068
5096
  var import_react25 = __toESM(require("react"));
5097
+ var import_react_tabs = require("@radix-ui/react-tabs");
5069
5098
 
5070
5099
  // elements/popover/Popover.tsx
5071
5100
  var React27 = __toESM(require("react"));
@@ -5209,9 +5238,10 @@ var Radio = (0, import_react25.forwardRef)(
5209
5238
  )
5210
5239
  },
5211
5240
  props.label && /* @__PURE__ */ import_react25.default.createElement(Label, { ...labelProps }, props.label),
5212
- /* @__PURE__ */ import_react25.default.createElement(
5213
- "ul",
5241
+ /* @__PURE__ */ import_react25.default.createElement(import_react_tabs.Tabs, null, /* @__PURE__ */ import_react25.default.createElement(
5242
+ import_react_tabs.TabsList,
5214
5243
  {
5244
+ role: "tablist",
5215
5245
  ref: parentRef,
5216
5246
  className: cn(
5217
5247
  props.options && ((_a = props.options) == null ? void 0 : _a.length) > 2 ? "hawa-flex-wrap xs:hawa-max-w-full xs:hawa-flex-nowrap" : "",
@@ -5237,9 +5267,12 @@ var Radio = (0, import_react25.forwardRef)(
5237
5267
  asChild: true
5238
5268
  },
5239
5269
  /* @__PURE__ */ import_react25.default.createElement(
5240
- "li",
5270
+ import_react_tabs.TabsTrigger,
5241
5271
  {
5242
- "aria-current": "page",
5272
+ "aria-current": selectedOption === opt.value ? "page" : void 0,
5273
+ value: opt.value,
5274
+ role: "tab",
5275
+ tabIndex: 0,
5243
5276
  onClick: () => {
5244
5277
  if (props.disabled || opt.disabled) return;
5245
5278
  handleChange(opt);
@@ -5255,10 +5288,12 @@ var Radio = (0, import_react25.forwardRef)(
5255
5288
  ),
5256
5289
  /* @__PURE__ */ import_react25.default.createElement(PopoverContent, { ...opt.tooltipContentProps }, opt.tooltip)
5257
5290
  ) : /* @__PURE__ */ import_react25.default.createElement(
5258
- "li",
5291
+ import_react_tabs.TabsTrigger,
5259
5292
  {
5260
5293
  key: o,
5261
- "aria-current": "page",
5294
+ role: "tab",
5295
+ tabIndex: 0,
5296
+ "aria-current": selectedOption === opt.value ? "page" : void 0,
5262
5297
  onClick: () => {
5263
5298
  if (props.disabled || opt.disabled) return;
5264
5299
  handleChange(opt);
@@ -5266,13 +5301,14 @@ var Radio = (0, import_react25.forwardRef)(
5266
5301
  className: cn(
5267
5302
  ...radio_option_tabs_styling,
5268
5303
  selectedOption === opt.value ? activeTabStyle : inactiveTabStyle
5269
- )
5304
+ ),
5305
+ value: opt.value
5270
5306
  },
5271
5307
  opt.icon && opt.icon,
5272
5308
  opt.label
5273
5309
  );
5274
5310
  })
5275
- ),
5311
+ )),
5276
5312
  !forceHideHelperText && /* @__PURE__ */ import_react25.default.createElement(HelperText, { helperText: props.helperText })
5277
5313
  );
5278
5314
  case "bordered":
@@ -6105,6 +6141,64 @@ var import_react45 = require("react");
6105
6141
 
6106
6142
  // hooks/useShortcuts.ts
6107
6143
  var import_react46 = require("react");
6144
+ function parseHotkey(hotkey) {
6145
+ const keys = hotkey.toLowerCase().split("+").map((part) => part.trim());
6146
+ const modifiers = {
6147
+ alt: keys.includes("alt"),
6148
+ ctrl: keys.includes("ctrl"),
6149
+ meta: keys.includes("meta"),
6150
+ mod: keys.includes("mod"),
6151
+ shift: keys.includes("shift")
6152
+ };
6153
+ const reservedKeys = ["alt", "ctrl", "meta", "shift", "mod"];
6154
+ const freeKey = keys.find((key) => !reservedKeys.includes(key));
6155
+ return {
6156
+ ...modifiers,
6157
+ key: freeKey
6158
+ };
6159
+ }
6160
+ function isExactHotkey(hotkey, event) {
6161
+ const { alt, ctrl, meta, mod, shift, key } = hotkey;
6162
+ const { altKey, ctrlKey, metaKey, shiftKey, key: pressedKey } = event;
6163
+ if (alt !== altKey) {
6164
+ return false;
6165
+ }
6166
+ if (mod) {
6167
+ if (!ctrlKey && !metaKey) {
6168
+ return false;
6169
+ }
6170
+ } else {
6171
+ if (ctrl !== ctrlKey) {
6172
+ return false;
6173
+ }
6174
+ if (meta !== metaKey) {
6175
+ return false;
6176
+ }
6177
+ }
6178
+ if (shift !== shiftKey) {
6179
+ return false;
6180
+ }
6181
+ if (key && (pressedKey.toLowerCase() === key.toLowerCase() || event.code.replace("Key", "").toLowerCase() === key.toLowerCase())) {
6182
+ return true;
6183
+ }
6184
+ return false;
6185
+ }
6186
+ function getHotkeyMatcher(hotkey) {
6187
+ return (event) => isExactHotkey(parseHotkey(hotkey), event);
6188
+ }
6189
+ function getHotkeyHandler(hotkeys) {
6190
+ return (event) => {
6191
+ const _event = "nativeEvent" in event ? event.nativeEvent : event;
6192
+ hotkeys.forEach(([hotkey, handler, options = { preventDefault: true }]) => {
6193
+ if (getHotkeyMatcher(hotkey)(_event)) {
6194
+ if (options.preventDefault) {
6195
+ event.preventDefault();
6196
+ }
6197
+ handler(_event);
6198
+ }
6199
+ });
6200
+ };
6201
+ }
6108
6202
 
6109
6203
  // hooks/useWindowEvent.ts
6110
6204
  var import_react47 = require("react");
@@ -6286,7 +6380,7 @@ var tabsTriggerVariant = (0, import_tailwind_variants.tv)({
6286
6380
  defaultVariants: { variant: "default", orientation: "horizontal" }
6287
6381
  });
6288
6382
  var TabsContext = React44.createContext({ orientation: "horizontal", variant: "default", scrollable: false });
6289
- var Tabs = React44.forwardRef(
6383
+ var Tabs2 = React44.forwardRef(
6290
6384
  ({ className, orientation, scrollable, variant = "default", ...props }, ref) => /* @__PURE__ */ React44.createElement(
6291
6385
  TabsPrimitive.Root,
6292
6386
  {
@@ -6301,7 +6395,7 @@ var Tabs = React44.forwardRef(
6301
6395
  /* @__PURE__ */ React44.createElement(TabsContext.Provider, { value: { orientation, variant, scrollable } }, props.children)
6302
6396
  )
6303
6397
  );
6304
- var TabsList = React44.forwardRef(({ className, classNames, ...props }, ref) => {
6398
+ var TabsList2 = React44.forwardRef(({ className, classNames, ...props }, ref) => {
6305
6399
  const { orientation, variant, scrollable } = React44.useContext(TabsContext);
6306
6400
  const { width } = useViewportSize();
6307
6401
  if (scrollable && width < 768 && orientation === "horizontal") {
@@ -6333,7 +6427,7 @@ var TabsList = React44.forwardRef(({ className, classNames, ...props }, ref) =>
6333
6427
  );
6334
6428
  }
6335
6429
  });
6336
- var TabsTrigger = React44.forwardRef(
6430
+ var TabsTrigger2 = React44.forwardRef(
6337
6431
  ({ className, chipProps, withPopover = false, onPopoverClick, ...props }, ref) => {
6338
6432
  const { orientation, variant } = React44.useContext(TabsContext);
6339
6433
  if (withPopover) {
@@ -6389,22 +6483,22 @@ var TabsContent = React44.forwardRef(({ className, ...props }, ref) => /* @__PUR
6389
6483
  ...props
6390
6484
  }
6391
6485
  ));
6392
- Tabs.displayName = TabsPrimitive.Root.displayName;
6393
- TabsList.displayName = TabsPrimitive.List.displayName;
6394
- TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
6486
+ Tabs2.displayName = TabsPrimitive.Root.displayName;
6487
+ TabsList2.displayName = TabsPrimitive.List.displayName;
6488
+ TabsTrigger2.displayName = TabsPrimitive.Trigger.displayName;
6395
6489
  TabsContent.displayName = TabsPrimitive.Content.displayName;
6396
6490
 
6397
6491
  // blocks/misc/LegalTexts.tsx
6398
6492
  var LegalTexts = ({ tabs, ...props }) => {
6399
6493
  return /* @__PURE__ */ import_react50.default.createElement(
6400
- Tabs,
6494
+ Tabs2,
6401
6495
  {
6402
6496
  value: props.activeTab,
6403
6497
  onValueChange: props.handleTabChange,
6404
6498
  defaultValue: props.defaultTab || tabs[0].value,
6405
6499
  dir: props.direction
6406
6500
  },
6407
- /* @__PURE__ */ import_react50.default.createElement(TabsList, { className: "hawa-w-full" }, tabs.map((tab, index) => /* @__PURE__ */ import_react50.default.createElement(TabsTrigger, { key: index, value: tab.value }, tab.title))),
6501
+ /* @__PURE__ */ import_react50.default.createElement(TabsList2, { className: "hawa-w-full" }, tabs.map((tab, index) => /* @__PURE__ */ import_react50.default.createElement(TabsTrigger2, { key: index, value: tab.value }, tab.title))),
6408
6502
  tabs.map((tab, index) => /* @__PURE__ */ import_react50.default.createElement(TabsContent, { key: index, value: tab.value }, /* @__PURE__ */ import_react50.default.createElement(
6409
6503
  ScrollArea,
6410
6504
  {
@@ -6554,6 +6648,7 @@ var ContactForm = ({
6554
6648
  onSubmit,
6555
6649
  customFields,
6556
6650
  classNames,
6651
+ clearOnSubmit = true,
6557
6652
  ...props
6558
6653
  }) => {
6559
6654
  var _a, _b, _c, _d, _e;
@@ -6597,8 +6692,11 @@ var ContactForm = ({
6597
6692
  control,
6598
6693
  handleSubmit,
6599
6694
  formState: { errors },
6600
- reset
6695
+ reset,
6696
+ getValues,
6697
+ trigger
6601
6698
  } = (0, import_react_hook_form9.useForm)({
6699
+ mode: "all",
6602
6700
  resolver: (0, import_zod8.zodResolver)(MainSchema),
6603
6701
  defaultValues: {
6604
6702
  name: "",
@@ -6607,10 +6705,16 @@ var ContactForm = ({
6607
6705
  ...customFieldsDefaultValues
6608
6706
  }
6609
6707
  });
6610
- const handleFormSubmit = (data) => {
6708
+ const SubmitForm = async (data) => {
6709
+ const isValid = await trigger();
6710
+ if (!isValid) {
6711
+ return;
6712
+ }
6611
6713
  if (onSubmit) {
6612
6714
  onSubmit(data);
6613
- reset();
6715
+ if (clearOnSubmit) {
6716
+ reset();
6717
+ }
6614
6718
  } else {
6615
6719
  console.log("Form is submitted but onSubmit prop is missing");
6616
6720
  }
@@ -6620,7 +6724,8 @@ var ContactForm = ({
6620
6724
  {
6621
6725
  className: cn(
6622
6726
  "hawa-w-full",
6623
- cardless && "hawa-border-none hawa-bg-transparent hawa-shadow-none hawa-drop-shadow-none"
6727
+ cardless && "hawa-border-none hawa-bg-transparent hawa-shadow-none hawa-drop-shadow-none",
6728
+ classNames == null ? void 0 : classNames.container
6624
6729
  ),
6625
6730
  style: cardless ? { boxShadow: "none" } : void 0
6626
6731
  },
@@ -6628,7 +6733,7 @@ var ContactForm = ({
6628
6733
  "form",
6629
6734
  {
6630
6735
  noValidate: true,
6631
- onSubmit: handleSubmit(handleFormSubmit),
6736
+ onSubmit: handleSubmit(SubmitForm),
6632
6737
  className: "hawa-space-y-2",
6633
6738
  id: formId,
6634
6739
  autoComplete: formAutoComplete
@@ -6739,7 +6844,10 @@ var ContactForm = ({
6739
6844
  textareaProps: {
6740
6845
  placeholder: texts == null ? void 0 : texts.message.placeholder,
6741
6846
  className: "hawa-min-h-20",
6742
- ...field
6847
+ ...field,
6848
+ onKeyDown: getHotkeyHandler([
6849
+ ["mod+enter", () => SubmitForm(getValues())]
6850
+ ])
6743
6851
  },
6744
6852
  classNames: { textarea: "hawa-min-h-40 hawa-h-full" },
6745
6853
  helperText: (_a2 = errors.message) == null ? void 0 : _a2.message
@@ -7946,7 +8054,7 @@ var Usage = (props) => {
7946
8054
 
7947
8055
  lucide-react/dist/esm/shared/src/utils.js:
7948
8056
  (**
7949
- * @license lucide-react v0.417.0 - ISC
8057
+ * @license lucide-react v0.424.0 - ISC
7950
8058
  *
7951
8059
  * This source code is licensed under the ISC license.
7952
8060
  * See the LICENSE file in the root directory of this source tree.
@@ -7954,7 +8062,7 @@ lucide-react/dist/esm/shared/src/utils.js:
7954
8062
 
7955
8063
  lucide-react/dist/esm/defaultAttributes.js:
7956
8064
  (**
7957
- * @license lucide-react v0.417.0 - ISC
8065
+ * @license lucide-react v0.424.0 - ISC
7958
8066
  *
7959
8067
  * This source code is licensed under the ISC license.
7960
8068
  * See the LICENSE file in the root directory of this source tree.
@@ -7962,7 +8070,7 @@ lucide-react/dist/esm/defaultAttributes.js:
7962
8070
 
7963
8071
  lucide-react/dist/esm/Icon.js:
7964
8072
  (**
7965
- * @license lucide-react v0.417.0 - ISC
8073
+ * @license lucide-react v0.424.0 - ISC
7966
8074
  *
7967
8075
  * This source code is licensed under the ISC license.
7968
8076
  * See the LICENSE file in the root directory of this source tree.
@@ -7970,7 +8078,7 @@ lucide-react/dist/esm/Icon.js:
7970
8078
 
7971
8079
  lucide-react/dist/esm/createLucideIcon.js:
7972
8080
  (**
7973
- * @license lucide-react v0.417.0 - ISC
8081
+ * @license lucide-react v0.424.0 - ISC
7974
8082
  *
7975
8083
  * This source code is licensed under the ISC license.
7976
8084
  * See the LICENSE file in the root directory of this source tree.
@@ -7978,7 +8086,7 @@ lucide-react/dist/esm/createLucideIcon.js:
7978
8086
 
7979
8087
  lucide-react/dist/esm/icons/dot.js:
7980
8088
  (**
7981
- * @license lucide-react v0.417.0 - ISC
8089
+ * @license lucide-react v0.424.0 - ISC
7982
8090
  *
7983
8091
  * This source code is licensed under the ISC license.
7984
8092
  * See the LICENSE file in the root directory of this source tree.
@@ -7986,7 +8094,7 @@ lucide-react/dist/esm/icons/dot.js:
7986
8094
 
7987
8095
  lucide-react/dist/esm/lucide-react.js:
7988
8096
  (**
7989
- * @license lucide-react v0.417.0 - ISC
8097
+ * @license lucide-react v0.424.0 - ISC
7990
8098
  *
7991
8099
  * This source code is licensed under the ISC license.
7992
8100
  * See the LICENSE file in the root directory of this source tree.
@@ -17,8 +17,10 @@ import {
17
17
  TabsList,
18
18
  TabsTrigger,
19
19
  Textarea
20
- } from "../chunk-VVUNGE7V.mjs";
21
- import "../chunk-WL7C2A5D.mjs";
20
+ } from "../chunk-QMNXTGM4.mjs";
21
+ import {
22
+ getHotkeyHandler
23
+ } from "../chunk-WL7C2A5D.mjs";
22
24
  import {
23
25
  BadEmoji,
24
26
  Button,
@@ -1179,12 +1181,10 @@ var CodeConfirmation = ({
1179
1181
  {
1180
1182
  noValidate: true,
1181
1183
  onSubmit: handleSubmit((e) => {
1182
- if (props.handleConfirm) {
1183
- return props.handleConfirm(e);
1184
+ if (props.onConfirm) {
1185
+ return props.onConfirm(e);
1184
1186
  } else {
1185
- console.log(
1186
- "Form is submitted but handleConfirm prop is missing"
1187
- );
1187
+ console.log("Form is submitted but onConfirm prop is missing");
1188
1188
  }
1189
1189
  })
1190
1190
  },
@@ -1212,12 +1212,28 @@ var CodeConfirmation = ({
1212
1212
  className: "clickable-link",
1213
1213
  onClick: () => {
1214
1214
  startResendTimer();
1215
- props.handleResend();
1215
+ props.onResend();
1216
1216
  }
1217
1217
  },
1218
1218
  ((_i = props.texts) == null ? void 0 : _i.resendCode) || "Click to resend"
1219
1219
  )),
1220
- /* @__PURE__ */ React8.createElement("div", { className: "hawa-mt-4 hawa-grid hawa-grid-cols-2 hawa-gap-2" }, /* @__PURE__ */ React8.createElement(Button, { variant: "outline" }, ((_j = props.texts) == null ? void 0 : _j.cancel) || "Cancel"), /* @__PURE__ */ React8.createElement(Button, { isLoading: props.confirmLoading }, ((_k = props.texts) == null ? void 0 : _k.confirm) || "Confirm"))
1220
+ /* @__PURE__ */ React8.createElement("div", { className: "hawa-mt-4 hawa-grid hawa-grid-cols-2 hawa-gap-2" }, /* @__PURE__ */ React8.createElement(
1221
+ Button,
1222
+ {
1223
+ type: "button",
1224
+ onClick: () => {
1225
+ if (props.onCancel) {
1226
+ return props.onCancel();
1227
+ } else {
1228
+ console.log(
1229
+ "Cancel button clicked but onCancel prop is missing"
1230
+ );
1231
+ }
1232
+ },
1233
+ variant: "outline"
1234
+ },
1235
+ ((_j = props.texts) == null ? void 0 : _j.cancel) || "Cancel"
1236
+ ), /* @__PURE__ */ React8.createElement(Button, { isLoading: props.confirmLoading }, ((_k = props.texts) == null ? void 0 : _k.confirm) || "Confirm"))
1221
1237
  )));
1222
1238
  };
1223
1239
 
@@ -1860,6 +1876,7 @@ var ContactForm = ({
1860
1876
  onSubmit,
1861
1877
  customFields,
1862
1878
  classNames,
1879
+ clearOnSubmit = true,
1863
1880
  ...props
1864
1881
  }) => {
1865
1882
  var _a, _b, _c, _d, _e;
@@ -1903,8 +1920,11 @@ var ContactForm = ({
1903
1920
  control,
1904
1921
  handleSubmit,
1905
1922
  formState: { errors },
1906
- reset
1923
+ reset,
1924
+ getValues,
1925
+ trigger
1907
1926
  } = useForm9({
1927
+ mode: "all",
1908
1928
  resolver: zodResolver8(MainSchema),
1909
1929
  defaultValues: {
1910
1930
  name: "",
@@ -1913,10 +1933,16 @@ var ContactForm = ({
1913
1933
  ...customFieldsDefaultValues
1914
1934
  }
1915
1935
  });
1916
- const handleFormSubmit = (data) => {
1936
+ const SubmitForm = async (data) => {
1937
+ const isValid = await trigger();
1938
+ if (!isValid) {
1939
+ return;
1940
+ }
1917
1941
  if (onSubmit) {
1918
1942
  onSubmit(data);
1919
- reset();
1943
+ if (clearOnSubmit) {
1944
+ reset();
1945
+ }
1920
1946
  } else {
1921
1947
  console.log("Form is submitted but onSubmit prop is missing");
1922
1948
  }
@@ -1926,7 +1952,8 @@ var ContactForm = ({
1926
1952
  {
1927
1953
  className: cn(
1928
1954
  "hawa-w-full",
1929
- cardless && "hawa-border-none hawa-bg-transparent hawa-shadow-none hawa-drop-shadow-none"
1955
+ cardless && "hawa-border-none hawa-bg-transparent hawa-shadow-none hawa-drop-shadow-none",
1956
+ classNames == null ? void 0 : classNames.container
1930
1957
  ),
1931
1958
  style: cardless ? { boxShadow: "none" } : void 0
1932
1959
  },
@@ -1934,7 +1961,7 @@ var ContactForm = ({
1934
1961
  "form",
1935
1962
  {
1936
1963
  noValidate: true,
1937
- onSubmit: handleSubmit(handleFormSubmit),
1964
+ onSubmit: handleSubmit(SubmitForm),
1938
1965
  className: "hawa-space-y-2",
1939
1966
  id: formId,
1940
1967
  autoComplete: formAutoComplete
@@ -2045,7 +2072,10 @@ var ContactForm = ({
2045
2072
  textareaProps: {
2046
2073
  placeholder: texts == null ? void 0 : texts.message.placeholder,
2047
2074
  className: "hawa-min-h-20",
2048
- ...field
2075
+ ...field,
2076
+ onKeyDown: getHotkeyHandler([
2077
+ ["mod+enter", () => SubmitForm(getValues())]
2078
+ ])
2049
2079
  },
2050
2080
  classNames: { textarea: "hawa-min-h-40 hawa-h-full" },
2051
2081
  helperText: (_a2 = errors.message) == null ? void 0 : _a2.message
@@ -85,12 +85,14 @@ type ContactFormProps = {
85
85
  cardless?: boolean;
86
86
  formId?: string;
87
87
  formAutoComplete?: "on" | "off";
88
+ clearOnSubmit?: boolean;
88
89
  size?: "sm" | "default";
89
90
  onSubmit: (e: ContactFormData) => void;
90
91
  customFields?: CustomField[];
91
92
  showSuccess?: boolean;
92
93
  classNames?: {
93
94
  submitButton?: string;
95
+ container?: string;
94
96
  };
95
97
  texts?: {
96
98
  submit: string;
@@ -85,12 +85,14 @@ type ContactFormProps = {
85
85
  cardless?: boolean;
86
86
  formId?: string;
87
87
  formAutoComplete?: "on" | "off";
88
+ clearOnSubmit?: boolean;
88
89
  size?: "sm" | "default";
89
90
  onSubmit: (e: ContactFormData) => void;
90
91
  customFields?: CustomField[];
91
92
  showSuccess?: boolean;
92
93
  classNames?: {
93
94
  submitButton?: string;
95
+ container?: string;
94
96
  };
95
97
  texts?: {
96
98
  submit: string;