@sikka/hawa 0.26.38-next → 0.27.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 (83) hide show
  1. package/dist/accordion/index.js +1 -1
  2. package/dist/accordion/index.js.map +1 -1
  3. package/dist/accordion/index.mjs +1 -1
  4. package/dist/accordion/index.mjs.map +1 -1
  5. package/dist/appLayout/index.js +4 -1
  6. package/dist/appLayout/index.js.map +1 -1
  7. package/dist/appLayout/index.mjs +4 -1
  8. package/dist/appLayout/index.mjs.map +1 -1
  9. package/dist/appTopbar/index.js +4 -1
  10. package/dist/appTopbar/index.js.map +1 -1
  11. package/dist/appTopbar/index.mjs +4 -1
  12. package/dist/appTopbar/index.mjs.map +1 -1
  13. package/dist/blocks/auth/index.d.mts +13 -2
  14. package/dist/blocks/auth/index.d.ts +13 -2
  15. package/dist/blocks/auth/index.js +6 -3
  16. package/dist/blocks/auth/index.mjs +7 -5
  17. package/dist/blocks/feedback/index.d.mts +3 -4
  18. package/dist/blocks/feedback/index.d.ts +3 -4
  19. package/dist/blocks/feedback/index.mjs +1 -2
  20. package/dist/blocks/index.d.mts +15 -1
  21. package/dist/blocks/index.d.ts +15 -1
  22. package/dist/blocks/index.js +84 -12
  23. package/dist/blocks/index.mjs +82 -13
  24. package/dist/blocks/misc/index.d.mts +14 -4
  25. package/dist/blocks/misc/index.d.ts +14 -4
  26. package/dist/blocks/misc/index.js +246 -26
  27. package/dist/blocks/misc/index.mjs +77 -9
  28. package/dist/blocks/pricing/index.d.mts +1 -2
  29. package/dist/blocks/pricing/index.d.ts +1 -2
  30. package/dist/{chunk-D3KUSRHL.mjs → chunk-3MC4JLSW.mjs} +4 -1
  31. package/dist/{chunk-AXTPTA3S.mjs → chunk-BOVZAUWD.mjs} +1 -1
  32. package/dist/{chunk-VCCUBQFI.mjs → chunk-U7BFMH2T.mjs} +1 -1
  33. package/dist/codeBlock/index.d.mts +12 -2
  34. package/dist/codeBlock/index.d.ts +12 -2
  35. package/dist/codeBlock/index.js +72 -44
  36. package/dist/codeBlock/index.js.map +1 -1
  37. package/dist/codeBlock/index.mjs +73 -49
  38. package/dist/codeBlock/index.mjs.map +1 -1
  39. package/dist/combobox/index.js.map +1 -1
  40. package/dist/combobox/index.mjs.map +1 -1
  41. package/dist/command/index.d.mts +24 -37
  42. package/dist/command/index.d.ts +24 -37
  43. package/dist/command/index.js +3 -1
  44. package/dist/command/index.js.map +1 -1
  45. package/dist/command/index.mjs +3 -1
  46. package/dist/command/index.mjs.map +1 -1
  47. package/dist/dataTable/index.js +4 -1
  48. package/dist/dataTable/index.js.map +1 -1
  49. package/dist/dataTable/index.mjs +4 -1
  50. package/dist/dataTable/index.mjs.map +1 -1
  51. package/dist/dropdownMenu/index.js +4 -1
  52. package/dist/dropdownMenu/index.js.map +1 -1
  53. package/dist/dropdownMenu/index.mjs +4 -1
  54. package/dist/dropdownMenu/index.mjs.map +1 -1
  55. package/dist/elements/index.d.mts +67 -40
  56. package/dist/elements/index.d.ts +67 -40
  57. package/dist/elements/index.js +77 -46
  58. package/dist/elements/index.mjs +80 -56
  59. package/dist/index.css +30 -11
  60. package/dist/index.d.mts +81 -40
  61. package/dist/index.d.ts +81 -40
  62. package/dist/index.js +157 -57
  63. package/dist/index.mjs +196 -100
  64. package/dist/input/index.d.mts +31 -1
  65. package/dist/input/index.d.ts +31 -1
  66. package/dist/input/index.js.map +1 -1
  67. package/dist/input/index.mjs.map +1 -1
  68. package/dist/layout/index.js +4 -1
  69. package/dist/layout/index.mjs +2 -2
  70. package/dist/passwordInput/index.js.map +1 -1
  71. package/dist/passwordInput/index.mjs.map +1 -1
  72. package/dist/splitButton/index.js +4 -1
  73. package/dist/splitButton/index.js.map +1 -1
  74. package/dist/splitButton/index.mjs +4 -1
  75. package/dist/splitButton/index.mjs.map +1 -1
  76. package/dist/{textTypes-559CaoOV.d.mts → textTypes-u4OSE-rn.d.mts} +8 -1
  77. package/dist/{textTypes-559CaoOV.d.ts → textTypes-u4OSE-rn.d.ts} +8 -1
  78. package/package.json +8 -8
  79. package/README.md +0 -91
  80. package/dist/chunk-WUHNPHD5.mjs +0 -0
  81. package/dist/commonTypes-MxCJyrHv.d.mts +0 -8
  82. package/dist/commonTypes-MxCJyrHv.d.ts +0 -8
  83. /package/dist/{chunk-DUHB245X.mjs → chunk-LKPRTTIX.mjs} +0 -0
package/dist/index.mjs CHANGED
@@ -623,8 +623,11 @@ var DropdownMenu = ({
623
623
  className: cn(
624
624
  className,
625
625
  widthStyles[width],
626
- "hawa-flex hawa-flex-col hawa-gap-1"
626
+ "hawa-flex hawa-flex-col hawa-gap-1 hawa-overflow-y-auto"
627
627
  ),
628
+ style: {
629
+ maxHeight: "var(--radix-dropdown-menu-content-available-height)"
630
+ },
628
631
  align,
629
632
  alignOffset
630
633
  },
@@ -901,7 +904,7 @@ var Accordion = React9.forwardRef(
901
904
  {
902
905
  disabled: item.disabled || false,
903
906
  className: cn(
904
- "hawa-transition-all",
907
+ "hawa-transition-all hawa-text-start",
905
908
  design === "separated" ? "hawa-rounded data-[state=open]:hawa-rounded-b-none" : {
906
909
  "hawa-rounded-t": index === 0,
907
910
  "data-[state=closed]:hawa-rounded-b": index === items.length - 1
@@ -6871,11 +6874,7 @@ var ScrollIndicator = ({
6871
6874
 
6872
6875
  // elements/codeBlock/CodeBlock.tsx
6873
6876
  import React54, { useState as useState16 } from "react";
6874
- import {
6875
- Highlight,
6876
- themes,
6877
- Prism
6878
- } from "prism-react-renderer";
6877
+ import { Highlight, themes, Prism } from "prism-react-renderer";
6879
6878
 
6880
6879
  // hooks/useClipboard.ts
6881
6880
  import { useState as useState15 } from "react";
@@ -6906,13 +6905,30 @@ function useClipboard({ timeout = 2e3 } = {}) {
6906
6905
  // elements/codeBlock/CodeBlock.tsx
6907
6906
  (typeof global !== "undefined" ? global : window).Prism = Prism;
6908
6907
  __require("prismjs/components/prism-bash");
6908
+ var CopyIcon = () => /* @__PURE__ */ React54.createElement(
6909
+ "svg",
6910
+ {
6911
+ "aria-label": "Copy",
6912
+ stroke: "currentColor",
6913
+ fill: "none",
6914
+ strokeWidth: "2",
6915
+ viewBox: "0 0 24 24",
6916
+ strokeLinecap: "round",
6917
+ strokeLinejoin: "round",
6918
+ height: "1em",
6919
+ width: "1em"
6920
+ },
6921
+ /* @__PURE__ */ React54.createElement("rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2" }),
6922
+ /* @__PURE__ */ React54.createElement("path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" })
6923
+ );
6909
6924
  var CodeBlock = ({
6910
6925
  tabs,
6911
6926
  code,
6912
6927
  fileName,
6913
- className,
6928
+ classNames,
6914
6929
  language = "javascript",
6915
6930
  // default to JavaScript if no language is provided
6931
+ wrapText = false,
6916
6932
  width = "full",
6917
6933
  ...props
6918
6934
  }) => {
@@ -6930,16 +6946,50 @@ var CodeBlock = ({
6930
6946
  {
6931
6947
  className: cn(
6932
6948
  widthStyles[width],
6933
- "hawa-w-full hawa-flex-col hawa-items-center hawa-rounded hawa-bg-background hawa-text-left hawa-my-2 hawa-text-white sm:hawa-text-base",
6934
- className
6949
+ "hawa-w-full hawa-flex-col hawa-relative hawa-items-center hawa-rounded hawa-bg-background hawa-text-left hawa-my-2 hawa-text-white sm:hawa-text-base",
6950
+ classNames == null ? void 0 : classNames.root
6935
6951
  )
6936
6952
  },
6953
+ /* @__PURE__ */ React54.createElement(
6954
+ "div",
6955
+ {
6956
+ className: cn(
6957
+ "hawa-flex hawa-absolute hawa-w-fit hawa-flex-row hawa-items-center hawa-gap-2 hawa-z-50 hawa-right-3.5",
6958
+ {
6959
+ "hawa-top-3.5": !tabs && !fileName,
6960
+ "hawa-top-[50px]": tabs && !fileName,
6961
+ "hawa-top-11": !tabs && fileName,
6962
+ "hawa-top-[80px]": tabs && fileName
6963
+ }
6964
+ )
6965
+ },
6966
+ /* @__PURE__ */ React54.createElement(
6967
+ Tooltip,
6968
+ {
6969
+ open: clipboard.copied,
6970
+ side: "left",
6971
+ content: /* @__PURE__ */ React54.createElement("div", null, "Copied!"),
6972
+ triggerProps: { asChild: true }
6973
+ },
6974
+ /* @__PURE__ */ React54.createElement(
6975
+ Button,
6976
+ {
6977
+ size: "smallIcon",
6978
+ onClick: () => clipboard.copy(tabs ? tabs[selectedTab].code : code),
6979
+ variant: "outline",
6980
+ className: "hawa-text-gray-200 hawa-opacity-50 "
6981
+ },
6982
+ /* @__PURE__ */ React54.createElement(CopyIcon, null)
6983
+ )
6984
+ )
6985
+ ),
6937
6986
  fileName && /* @__PURE__ */ React54.createElement(
6938
6987
  "div",
6939
6988
  {
6940
6989
  className: cn(
6941
6990
  "hawa-flex hawa-flex-row hawa-gap-2 hawa-rounded-t hawa-p-2 hawa-py-0.5 hawa-pb-0 hawa-font-mono hawa-text-foreground",
6942
- fileName && tabs ? "hawa-bg-primary/10" : "hawa-bg-primary/15"
6991
+ fileName && tabs ? "hawa-bg-primary/10" : "hawa-bg-primary/15",
6992
+ classNames == null ? void 0 : classNames.fileName
6943
6993
  )
6944
6994
  },
6945
6995
  /* @__PURE__ */ React54.createElement(
@@ -6956,9 +7006,9 @@ var CodeBlock = ({
6956
7006
  "div",
6957
7007
  {
6958
7008
  className: cn(
6959
- // hawa-bg-gray-300 dark:hawa-bg-red-600
6960
7009
  "hawa-flex hawa-flex-row hawa-gap-2 hawa-rounded-t hawa-p-1 hawa-bg-primary/15 hawa-pb-0 hawa-font-mono hawa-text-foreground",
6961
- tabs && fileName && "hawa-rounded-t-none"
7010
+ tabs && fileName && "hawa-rounded-t-none",
7011
+ classNames == null ? void 0 : classNames.tabs
6962
7012
  )
6963
7013
  },
6964
7014
  tabs.map((tab, i) => /* @__PURE__ */ React54.createElement(
@@ -6966,7 +7016,8 @@ var CodeBlock = ({
6966
7016
  {
6967
7017
  key: i,
6968
7018
  className: cn(
6969
- selectedTab === i ? " hawa-border-b-2 hawa-border-primary" : "hawa-bg-transparent"
7019
+ selectedTab === i ? " hawa-border-b-2 hawa-border-primary" : "hawa-bg-transparent",
7020
+ classNames == null ? void 0 : classNames.tab
6970
7021
  )
6971
7022
  },
6972
7023
  /* @__PURE__ */ React54.createElement(
@@ -6985,8 +7036,10 @@ var CodeBlock = ({
6985
7036
  "div",
6986
7037
  {
6987
7038
  className: cn(
6988
- "hawa-flex hawa-w-full hawa-flex-row hawa-items-start hawa-justify-between hawa-border hawa-bg-gray-800 hawa-p-0 hawa-text-left hawa-text-sm sm:hawa-text-base ",
6989
- tabs || fileName ? "hawa-rounded-b hawa-rounded-t-none" : "hawa-rounded"
7039
+ "hawa-flex hawa-w-full hawa-relative hawa-flex-row hawa-items-start hawa-justify-between hawa-border hawa-bg-gray-800 hawa-p-0 hawa-text-left hawa-text-sm sm:hawa-text-base",
7040
+ tabs || fileName ? "hawa-rounded-b hawa-rounded-t-none" : "hawa-rounded",
7041
+ classNames == null ? void 0 : classNames.codeBlockContainer,
7042
+ "hawa-overflow-y-auto"
6990
7043
  )
6991
7044
  },
6992
7045
  /* @__PURE__ */ React54.createElement(
@@ -6996,50 +7049,24 @@ var CodeBlock = ({
6996
7049
  code: tabs ? tabs[selectedTab].code : code || "",
6997
7050
  language
6998
7051
  },
6999
- ({ className: className2, style, tokens, getLineProps, getTokenProps }) => /* @__PURE__ */ React54.createElement("pre", { className: "hawa-min-h-[37.75px] hawa-w-full hawa-overflow-auto hawa-p-4 hawa-font-mono hawa-text-foreground" }, tokens.map((line, i) => /* @__PURE__ */ React54.createElement("div", { key: i, ...getLineProps({ line }) }, props.lineNumbers && /* @__PURE__ */ React54.createElement("span", { className: "hawa-mr-4" }, i + 1), line.map((token, key) => /* @__PURE__ */ React54.createElement("span", { key, ...getTokenProps({ token }) })))))
7000
- ),
7001
- /* @__PURE__ */ React54.createElement("div", { className: "hawa-flex hawa-w-fit hawa-flex-row hawa-items-center hawa-gap-2 hawa-p-2" }, /* @__PURE__ */ React54.createElement(
7002
- Tooltip,
7003
- {
7004
- open: clipboard.copied,
7005
- side: "left",
7006
- content: /* @__PURE__ */ React54.createElement("div", null, "Copied!"),
7007
- triggerProps: {
7008
- asChild: true
7009
- }
7010
- },
7011
- /* @__PURE__ */ React54.createElement(
7012
- Button,
7052
+ ({ tokens, getLineProps, getTokenProps }) => /* @__PURE__ */ React54.createElement(
7053
+ "pre",
7013
7054
  {
7014
- size: "icon",
7015
- onClick: () => clipboard.copy(tabs ? tabs[selectedTab].code : code),
7016
- variant: "outline",
7017
- className: "hawa-text-gray-200 hawa-opacity-50 "
7055
+ className: cn(
7056
+ "hawa-min-h-[37.75px] !hawa-pe-12 hawa-w-full hawa-p-4 hawa-font-mono hawa-text-foreground",
7057
+ classNames == null ? void 0 : classNames.code,
7058
+ wrapText && "hawa-text-wrap"
7059
+ )
7018
7060
  },
7019
- /* @__PURE__ */ React54.createElement(
7020
- "svg",
7021
- {
7022
- "aria-label": "Copy",
7023
- stroke: "currentColor",
7024
- fill: "none",
7025
- strokeWidth: "2",
7026
- viewBox: "0 0 24 24",
7027
- strokeLinecap: "round",
7028
- strokeLinejoin: "round",
7029
- height: "1em",
7030
- width: "1em"
7031
- },
7032
- /* @__PURE__ */ React54.createElement("rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2" }),
7033
- /* @__PURE__ */ React54.createElement("path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" })
7034
- )
7061
+ tokens.map((line, i) => /* @__PURE__ */ React54.createElement("div", { key: i, ...getLineProps({ line }) }, props.lineNumbers && /* @__PURE__ */ React54.createElement("span", { className: "hawa-mr-4" }, i + 1), line.map((token, key) => /* @__PURE__ */ React54.createElement("span", { key, ...getTokenProps({ token }) }))))
7035
7062
  )
7036
- ))
7063
+ )
7037
7064
  )
7038
7065
  );
7039
7066
  };
7040
7067
 
7041
7068
  // elements/carousel/Carousel.tsx
7042
- import React55, { useEffect as useEffect14, useState as useState17 } from "react";
7069
+ import React55, { useEffect as useEffect13, useState as useState17 } from "react";
7043
7070
  import useEmblaCarousel from "embla-carousel-react";
7044
7071
  var Carousel = ({
7045
7072
  items,
@@ -7056,7 +7083,7 @@ var Carousel = ({
7056
7083
  loop: autoplay ? true : (options == null ? void 0 : options.loop) || false
7057
7084
  });
7058
7085
  const [selectedIndex, setSelectedIndex] = useState17(0);
7059
- useEffect14(() => {
7086
+ useEffect13(() => {
7060
7087
  function selectHandler() {
7061
7088
  const index = emblaApi == null ? void 0 : emblaApi.selectedScrollSnap();
7062
7089
  setSelectedIndex(index || 0);
@@ -7066,7 +7093,7 @@ var Carousel = ({
7066
7093
  emblaApi == null ? void 0 : emblaApi.off("select", selectHandler);
7067
7094
  };
7068
7095
  }, [emblaApi]);
7069
- useEffect14(() => {
7096
+ useEffect13(() => {
7070
7097
  let autoplayTimer;
7071
7098
  if (autoplay && emblaApi) {
7072
7099
  autoplayTimer = setInterval(() => {
@@ -7898,7 +7925,7 @@ var Navbar = ({
7898
7925
  };
7899
7926
 
7900
7927
  // layout/appLayout/AppLayout.tsx
7901
- import React65, { useEffect as useEffect15, useRef as useRef9, useState as useState21 } from "react";
7928
+ import React65, { useEffect as useEffect14, useRef as useRef9, useState as useState21 } from "react";
7902
7929
  var AppLayout = ({
7903
7930
  profileMenuWidth = "default",
7904
7931
  DrawerFooterActions,
@@ -7932,7 +7959,7 @@ var AppLayout = ({
7932
7959
  const [size, setSize] = useState21(1200);
7933
7960
  const [openSideMenu, setOpenSideMenu] = useState21(true);
7934
7961
  const drawerSizeCondition = size > 600 ? drawerSizeStyle[keepOpen ? "opened" : "closed"][drawerSize] : 0;
7935
- useEffect15(() => {
7962
+ useEffect14(() => {
7936
7963
  if (typeof window !== "undefined") {
7937
7964
  const resize = () => {
7938
7965
  setSize(window.innerWidth);
@@ -7944,14 +7971,14 @@ var AppLayout = ({
7944
7971
  };
7945
7972
  }
7946
7973
  }, []);
7947
- useEffect15(() => {
7974
+ useEffect14(() => {
7948
7975
  if (size > 600) {
7949
7976
  setOpenSideMenu(keepOpen);
7950
7977
  } else {
7951
7978
  setOpenSideMenu(false);
7952
7979
  }
7953
7980
  }, [size]);
7954
- useEffect15(() => {
7981
+ useEffect14(() => {
7955
7982
  const handleClickOutside = (event) => {
7956
7983
  if (ref.current && !ref.current.contains(event.target) && !keepOpen) {
7957
7984
  setOpenSideMenu(false);
@@ -8605,13 +8632,13 @@ var AppTabs = ({ tabs, className }) => {
8605
8632
  };
8606
8633
 
8607
8634
  // layout/docsLayout/DocsLayout.tsx
8608
- import React71, { useEffect as useEffect17, useRef as useRef10, useState as useState24 } from "react";
8635
+ import React71, { useEffect as useEffect16, useRef as useRef10, useState as useState24 } from "react";
8609
8636
 
8610
8637
  // hooks/useBreakpoint.ts
8611
- import { useState as useState23, useEffect as useEffect16 } from "react";
8638
+ import { useState as useState23, useEffect as useEffect15 } from "react";
8612
8639
  var useBreakpoint = () => {
8613
8640
  const [breakpoint, setBreakpoint] = useState23(null);
8614
- useEffect16(() => {
8641
+ useEffect15(() => {
8615
8642
  if (typeof window !== "undefined") {
8616
8643
  const resize = () => {
8617
8644
  setBreakpoint(window.innerWidth);
@@ -8722,7 +8749,7 @@ var DocsLayout = ({
8722
8749
  }
8723
8750
  const [currentPage, setCurrentPage] = useState24("Introduction");
8724
8751
  const [openSideMenu, setOpenSideMenu] = useState24(true);
8725
- useEffect17(() => {
8752
+ useEffect16(() => {
8726
8753
  const handleClickOutside = (event) => {
8727
8754
  if (ref.current && !ref.current.contains(event.target) && !openSideMenu) {
8728
8755
  setOpenSideMenu(false);
@@ -8733,7 +8760,7 @@ var DocsLayout = ({
8733
8760
  document.removeEventListener("click", handleClickOutside, true);
8734
8761
  };
8735
8762
  }, [openSideMenu]);
8736
- useEffect17(() => {
8763
+ useEffect16(() => {
8737
8764
  const handleResize = () => {
8738
8765
  setOpenSideMenu(window.innerWidth > 600 ? true : false);
8739
8766
  };
@@ -8750,7 +8777,7 @@ var DocsLayout = ({
8750
8777
  setCurrentPage(entry.target.id);
8751
8778
  }
8752
8779
  };
8753
- useEffect17(() => {
8780
+ useEffect16(() => {
8754
8781
  observerRef.current = new IntersectionObserver(handleIntersection, {
8755
8782
  threshold: 0.5
8756
8783
  // Adjust threshold as needed to determine when a section is in view
@@ -9410,15 +9437,18 @@ var RegisterForm = ({
9410
9437
  control,
9411
9438
  name: "username",
9412
9439
  render: ({ field }) => {
9413
- var _a2, _b2, _c2;
9440
+ var _a2, _b2, _c2, _d2;
9414
9441
  return /* @__PURE__ */ React74.createElement(
9415
9442
  Input,
9416
9443
  {
9417
9444
  width: "full",
9418
9445
  autoComplete: "username",
9419
9446
  label: (_a2 = texts == null ? void 0 : texts.username) == null ? void 0 : _a2.label,
9420
- helperText: (_b2 = formState.errors.username) == null ? void 0 : _b2.message,
9421
- placeholder: (_c2 = texts == null ? void 0 : texts.username) == null ? void 0 : _c2.placeholder,
9447
+ labelProps: {
9448
+ ...(_b2 = props.usernameOptions) == null ? void 0 : _b2.label
9449
+ },
9450
+ helperText: (_c2 = formState.errors.username) == null ? void 0 : _c2.message,
9451
+ placeholder: (_d2 = texts == null ? void 0 : texts.username) == null ? void 0 : _d2.placeholder,
9422
9452
  ...field
9423
9453
  }
9424
9454
  );
@@ -9818,7 +9848,7 @@ var ResetPasswordForm = (props) => {
9818
9848
  };
9819
9849
 
9820
9850
  // blocks/auth/CodeConfirmation.tsx
9821
- import React79, { useEffect as useEffect18, useState as useState28 } from "react";
9851
+ import React79, { useEffect as useEffect17, useState as useState28 } from "react";
9822
9852
  import { Controller as Controller5, useForm as useForm5 } from "react-hook-form";
9823
9853
  import { zodResolver as zodResolver5 } from "@hookform/resolvers/zod";
9824
9854
  import * as z5 from "zod";
@@ -9854,7 +9884,7 @@ var CodeConfirmation = (props) => {
9854
9884
  }, 1e3);
9855
9885
  setResendTimer(newTimer);
9856
9886
  };
9857
- useEffect18(() => {
9887
+ useEffect17(() => {
9858
9888
  return () => {
9859
9889
  if (resendTimer !== null) {
9860
9890
  clearInterval(resendTimer);
@@ -10074,7 +10104,7 @@ var UserReferralSource = ({
10074
10104
  };
10075
10105
 
10076
10106
  // blocks/feedback/FeedbackRating.tsx
10077
- import React81, { useEffect as useEffect19, useRef as useRef12, useState as useState30 } from "react";
10107
+ import React81, { useEffect as useEffect18, useRef as useRef12, useState as useState30 } from "react";
10078
10108
  var FeedbackRating = ({
10079
10109
  position = "bottom-right",
10080
10110
  ...props
@@ -10088,7 +10118,7 @@ var FeedbackRating = ({
10088
10118
  "bottom-right": "hawa-right-4",
10089
10119
  "bottom-left": "hawa-left-4"
10090
10120
  };
10091
- useEffect19(() => {
10121
+ useEffect18(() => {
10092
10122
  const timeoutHide = setTimeout(() => {
10093
10123
  if (closingTimer >= 0) {
10094
10124
  setClosingTimer(closingTimer - 1);
@@ -10542,25 +10572,56 @@ var ContactForm = ({
10542
10572
  texts,
10543
10573
  formId,
10544
10574
  formAutoComplete,
10545
- onSubmit
10575
+ onSubmit,
10576
+ customFields
10546
10577
  }) => {
10547
10578
  var _a, _b, _c;
10579
+ const customFieldsSchema = z8.object({
10580
+ ...customFields == null ? void 0 : customFields.reduce(
10581
+ (acc, curr) => {
10582
+ switch (curr.type) {
10583
+ case "text":
10584
+ acc[curr.name] = z8.string().optional().default("");
10585
+ break;
10586
+ case "number":
10587
+ acc[curr.name] = z8.string().optional().default("");
10588
+ break;
10589
+ case "select":
10590
+ acc[curr.name] = z8.string().optional().default("");
10591
+ break;
10592
+ default:
10593
+ break;
10594
+ }
10595
+ return acc;
10596
+ },
10597
+ {}
10598
+ )
10599
+ });
10548
10600
  const contactFormSchema = z8.object({
10549
10601
  name: z8.string({ required_error: texts == null ? void 0 : texts.name.required }).min(1, texts == null ? void 0 : texts.name.required).default(""),
10550
10602
  email: z8.string({ required_error: (_a = texts == null ? void 0 : texts.email) == null ? void 0 : _a.required }).min(1, { message: (_b = texts == null ? void 0 : texts.email) == null ? void 0 : _b.required }).email({ message: (_c = texts == null ? void 0 : texts.email) == null ? void 0 : _c.invalid }).default(""),
10551
10603
  message: z8.string({ required_error: texts == null ? void 0 : texts.message.required }).min(10, texts == null ? void 0 : texts.message.invalid).default("")
10552
10604
  });
10605
+ const customFieldsDefaultValues = customFields == null ? void 0 : customFields.reduce(
10606
+ (acc, curr) => {
10607
+ acc[curr.name] = "";
10608
+ return acc;
10609
+ },
10610
+ {}
10611
+ );
10612
+ const MainSchema = contactFormSchema.merge(customFieldsSchema);
10553
10613
  const {
10554
10614
  control,
10555
10615
  handleSubmit,
10556
10616
  formState: { errors },
10557
10617
  reset
10558
10618
  } = useForm9({
10559
- resolver: zodResolver8(contactFormSchema),
10619
+ resolver: zodResolver8(MainSchema),
10560
10620
  defaultValues: {
10561
10621
  name: "",
10562
10622
  email: "",
10563
- message: ""
10623
+ message: "",
10624
+ ...customFieldsDefaultValues
10564
10625
  }
10565
10626
  });
10566
10627
  const handleFormSubmit = (data) => {
@@ -10571,15 +10632,10 @@ var ContactForm = ({
10571
10632
  console.log("Form is submitted but onSubmit prop is missing");
10572
10633
  }
10573
10634
  };
10574
- let sizeStyle = {
10575
- sm: "hawa-max-w-sm",
10576
- default: "hawa-w-full"
10577
- };
10578
10635
  return /* @__PURE__ */ React91.createElement(
10579
10636
  Card,
10580
10637
  {
10581
10638
  className: cn(
10582
- // sizeStyle[size],
10583
10639
  "hawa-w-full",
10584
10640
  cardless && "hawa-border-none hawa-bg-transparent hawa-shadow-none hawa-drop-shadow-none"
10585
10641
  ),
@@ -10646,6 +10702,45 @@ var ContactForm = ({
10646
10702
  }
10647
10703
  )
10648
10704
  ),
10705
+ customFields && customFields.map((customField) => {
10706
+ console.log("custom", customField);
10707
+ return /* @__PURE__ */ React91.createElement(
10708
+ Controller9,
10709
+ {
10710
+ control,
10711
+ name: customField.name,
10712
+ render: ({ field }) => {
10713
+ const { type, label, placeholder } = customField;
10714
+ switch (type) {
10715
+ case "text":
10716
+ case "number":
10717
+ return /* @__PURE__ */ React91.createElement(
10718
+ Input,
10719
+ {
10720
+ id: customField.name,
10721
+ type,
10722
+ label,
10723
+ placeholder,
10724
+ ...field
10725
+ }
10726
+ );
10727
+ case "select":
10728
+ return /* @__PURE__ */ React91.createElement(
10729
+ Select,
10730
+ {
10731
+ label,
10732
+ options: customField.options,
10733
+ value: field.value,
10734
+ onChange: (option) => field.onChange(option.value)
10735
+ }
10736
+ );
10737
+ default:
10738
+ return /* @__PURE__ */ React91.createElement("div", null, "Unknown type");
10739
+ }
10740
+ }
10741
+ }
10742
+ );
10743
+ }),
10649
10744
  /* @__PURE__ */ React91.createElement(
10650
10745
  Controller9,
10651
10746
  {
@@ -10662,6 +10757,7 @@ var ContactForm = ({
10662
10757
  placeholder: texts == null ? void 0 : texts.message.placeholder,
10663
10758
  ...field
10664
10759
  },
10760
+ classNames: { textarea: "hawa-min-h-20" },
10665
10761
  helperText: (_a2 = errors.message) == null ? void 0 : _a2.message
10666
10762
  }
10667
10763
  );
@@ -10716,7 +10812,7 @@ var ActionCard = (props) => {
10716
10812
  };
10717
10813
 
10718
10814
  // blocks/cards/AdCard.tsx
10719
- import React93, { useState as useState33, useEffect as useEffect20, useRef as useRef13 } from "react";
10815
+ import React93, { useState as useState33, useEffect as useEffect19, useRef as useRef13 } from "react";
10720
10816
  var AdCard = ({
10721
10817
  orientation = "vertical",
10722
10818
  ...props
@@ -10724,7 +10820,7 @@ var AdCard = ({
10724
10820
  const adRef = useRef13(null);
10725
10821
  const [closed, setClosed] = useState33(false);
10726
10822
  let duration = 0;
10727
- useEffect20(() => {
10823
+ useEffect19(() => {
10728
10824
  if (duration) {
10729
10825
  const timeoutHide = setTimeout(() => {
10730
10826
  setClosed(true);
@@ -10899,7 +10995,7 @@ var PricingCard = ({
10899
10995
  };
10900
10996
 
10901
10997
  // blocks/cards/ItemCard.tsx
10902
- import React95, { useEffect as useEffect21, useState as useState34 } from "react";
10998
+ import React95, { useEffect as useEffect20, useState as useState34 } from "react";
10903
10999
  var ItemCard = ({
10904
11000
  actions,
10905
11001
  counts,
@@ -10933,7 +11029,7 @@ var ItemCard = ({
10933
11029
  e.stopPropagation();
10934
11030
  setOpenActionHeader(!openActionHeader);
10935
11031
  }
10936
- useEffect21(() => {
11032
+ useEffect20(() => {
10937
11033
  window.onclick = () => {
10938
11034
  if (openActionHeader) {
10939
11035
  setOpenActionHeader(false);
@@ -11369,14 +11465,14 @@ var Usage = (props) => {
11369
11465
  };
11370
11466
 
11371
11467
  // hooks/useIsomorphicEffect.ts
11372
- import { useEffect as useEffect22, useLayoutEffect } from "react";
11373
- var useIsomorphicEffect = typeof document !== "undefined" ? useLayoutEffect : useEffect22;
11468
+ import { useEffect as useEffect21, useLayoutEffect } from "react";
11469
+ var useIsomorphicEffect = typeof document !== "undefined" ? useLayoutEffect : useEffect21;
11374
11470
 
11375
11471
  // hooks/useDiscloser.ts
11376
11472
  import { useState as useState36 } from "react";
11377
11473
 
11378
11474
  // hooks/useHover.ts
11379
- import { useEffect as useEffect23, useRef as useRef14, useState as useState37 } from "react";
11475
+ import { useEffect as useEffect22, useRef as useRef14, useState as useState37 } from "react";
11380
11476
 
11381
11477
  // hooks/useToast.ts
11382
11478
  import * as React103 from "react";
@@ -11486,7 +11582,7 @@ function useToast() {
11486
11582
  import { useState as useState39, useRef as useRef15 } from "react";
11487
11583
 
11488
11584
  // hooks/useDialogCarousel.ts
11489
- import { useEffect as useEffect25, useState as useState40 } from "react";
11585
+ import { useEffect as useEffect24, useState as useState40 } from "react";
11490
11586
  import AutoHeight from "embla-carousel-auto-height";
11491
11587
  import useEmblaCarousel2 from "embla-carousel-react";
11492
11588
  var useDialogCarousel = (options) => {
@@ -11512,7 +11608,7 @@ var useDialogCarousel = (options) => {
11512
11608
  emblaApi.scrollPrev();
11513
11609
  }
11514
11610
  };
11515
- useEffect25(() => {
11611
+ useEffect24(() => {
11516
11612
  checkCanScrollPrev();
11517
11613
  emblaApi && emblaApi.on("select", checkCanScrollPrev);
11518
11614
  return () => {
@@ -11529,12 +11625,12 @@ var useDialogCarousel = (options) => {
11529
11625
  };
11530
11626
 
11531
11627
  // hooks/useDialogSteps.ts
11532
- import { useState as useState41, useEffect as useEffect26, useRef as useRef16 } from "react";
11628
+ import { useState as useState41, useEffect as useEffect25, useRef as useRef16 } from "react";
11533
11629
  var useMultiStepDialog = (initialStep, stepIds, setOpenDialog) => {
11534
11630
  const [currentStep, setCurrentStep] = useState41(initialStep);
11535
11631
  const [dialogHeight, setDialogHeight] = useState41(null);
11536
11632
  const visibleStepRef = useRef16(null);
11537
- useEffect26(() => {
11633
+ useEffect25(() => {
11538
11634
  if (visibleStepRef.current) {
11539
11635
  setDialogHeight(visibleStepRef.current.offsetHeight);
11540
11636
  }
@@ -11565,13 +11661,13 @@ var useMultiStepDialog = (initialStep, stepIds, setOpenDialog) => {
11565
11661
  };
11566
11662
 
11567
11663
  // hooks/useWindowSize.ts
11568
- import { useEffect as useEffect27, useState as useState42 } from "react";
11664
+ import { useEffect as useEffect26, useState as useState42 } from "react";
11569
11665
  var useWindowSize = () => {
11570
11666
  const [windowSize, setWindowSize] = useState42({
11571
11667
  width: void 0,
11572
11668
  height: void 0
11573
11669
  });
11574
- useEffect27(() => {
11670
+ useEffect26(() => {
11575
11671
  function handleResize() {
11576
11672
  setWindowSize({
11577
11673
  width: window.innerWidth,
@@ -11586,7 +11682,7 @@ var useWindowSize = () => {
11586
11682
  };
11587
11683
 
11588
11684
  // hooks/useFocusWithin.ts
11589
- import { useRef as useRef17, useState as useState43, useEffect as useEffect28 } from "react";
11685
+ import { useRef as useRef17, useState as useState43, useEffect as useEffect27 } from "react";
11590
11686
  function containsRelatedTarget(event) {
11591
11687
  if (event.currentTarget instanceof HTMLElement && event.relatedTarget instanceof HTMLElement) {
11592
11688
  return event.currentTarget.contains(event.relatedTarget);
@@ -11616,7 +11712,7 @@ function useFocusWithin({
11616
11712
  onBlur == null ? void 0 : onBlur(event);
11617
11713
  }
11618
11714
  };
11619
- useEffect28(() => {
11715
+ useEffect27(() => {
11620
11716
  if (ref.current) {
11621
11717
  ref.current.addEventListener("focusin", handleFocusIn);
11622
11718
  ref.current.addEventListener("focusout", handleFocusOut);
@@ -11632,7 +11728,7 @@ function useFocusWithin({
11632
11728
  }
11633
11729
 
11634
11730
  // hooks/useMediaQuery.ts
11635
- import { useState as useState44, useEffect as useEffect29, useRef as useRef18 } from "react";
11731
+ import { useState as useState44, useEffect as useEffect28, useRef as useRef18 } from "react";
11636
11732
  function attachMediaListener(query, callback) {
11637
11733
  try {
11638
11734
  query.addEventListener("change", callback);
@@ -11658,7 +11754,7 @@ function useMediaQuery(query, initialValue, { getInitialValueInEffect } = {
11658
11754
  getInitialValueInEffect ? initialValue : getInitialValue(query, initialValue)
11659
11755
  );
11660
11756
  const queryRef = useRef18();
11661
- useEffect29(() => {
11757
+ useEffect28(() => {
11662
11758
  if ("matchMedia" in window) {
11663
11759
  queryRef.current = window.matchMedia(query);
11664
11760
  setMatches(queryRef.current.matches);
@@ -11673,16 +11769,16 @@ function useMediaQuery(query, initialValue, { getInitialValueInEffect } = {
11673
11769
  }
11674
11770
 
11675
11771
  // hooks/useScrollPosition.ts
11676
- import { useState as useState45, useEffect as useEffect30 } from "react";
11772
+ import { useState as useState45, useEffect as useEffect29 } from "react";
11677
11773
 
11678
11774
  // hooks/useTable.ts
11679
- import { useState as useState46, useEffect as useEffect31 } from "react";
11775
+ import { useState as useState46, useEffect as useEffect30 } from "react";
11680
11776
 
11681
11777
  // hooks/useTabs.ts
11682
- import { useEffect as useEffect32, useState as useState47 } from "react";
11778
+ import { useEffect as useEffect31, useState as useState47 } from "react";
11683
11779
  function useTabs(initialTab = "") {
11684
11780
  const [activeTab, setActiveTab] = useState47(initialTab);
11685
- useEffect32(() => {
11781
+ useEffect31(() => {
11686
11782
  const handleHashChange = () => {
11687
11783
  const hash = window.location.hash.substring(1);
11688
11784
  setActiveTab(hash || initialTab);