@sikka/hawa 0.26.37-next → 0.26.39-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 (96) hide show
  1. package/dist/alert/index.js +4 -4
  2. package/dist/alert/index.js.map +1 -1
  3. package/dist/alert/index.mjs +4 -4
  4. package/dist/alert/index.mjs.map +1 -1
  5. package/dist/appLayout/index.js +4 -4
  6. package/dist/appLayout/index.js.map +1 -1
  7. package/dist/appLayout/index.mjs +4 -4
  8. package/dist/appLayout/index.mjs.map +1 -1
  9. package/dist/backToTop/index.js +4 -4
  10. package/dist/backToTop/index.js.map +1 -1
  11. package/dist/backToTop/index.mjs +4 -4
  12. package/dist/backToTop/index.mjs.map +1 -1
  13. package/dist/blocks/auth/index.d.mts +1 -2
  14. package/dist/blocks/auth/index.d.ts +1 -2
  15. package/dist/blocks/auth/index.js +4 -4
  16. package/dist/blocks/auth/index.mjs +4 -5
  17. package/dist/blocks/feedback/index.d.mts +1 -2
  18. package/dist/blocks/feedback/index.d.ts +1 -2
  19. package/dist/blocks/feedback/index.js +4 -4
  20. package/dist/blocks/feedback/index.mjs +5 -6
  21. package/dist/blocks/index.d.mts +10 -0
  22. package/dist/blocks/index.d.ts +10 -0
  23. package/dist/blocks/index.js +77 -12
  24. package/dist/blocks/index.mjs +75 -10
  25. package/dist/blocks/misc/index.d.mts +11 -1
  26. package/dist/blocks/misc/index.d.ts +11 -1
  27. package/dist/blocks/misc/index.js +249 -30
  28. package/dist/blocks/misc/index.mjs +80 -13
  29. package/dist/blocks/pricing/index.d.mts +1 -2
  30. package/dist/blocks/pricing/index.d.ts +1 -2
  31. package/dist/blocks/pricing/index.js +4 -4
  32. package/dist/blocks/pricing/index.mjs +4 -4
  33. package/dist/button/index.js +4 -4
  34. package/dist/button/index.js.map +1 -1
  35. package/dist/button/index.mjs +4 -4
  36. package/dist/button/index.mjs.map +1 -1
  37. package/dist/{chunk-SF6KYQ2D.mjs → chunk-AXTPTA3S.mjs} +1 -1
  38. package/dist/{chunk-AJUOAC6L.mjs → chunk-D3KUSRHL.mjs} +4 -4
  39. package/dist/{chunk-JTOXNQTS.mjs → chunk-LKPRTTIX.mjs} +1 -1
  40. package/dist/{chunk-7NRPNLHB.mjs → chunk-P7MJOYGC.mjs} +4 -4
  41. package/dist/{chunk-CLYZEJKB.mjs → chunk-PRSC2G4S.mjs} +1 -1
  42. package/dist/{chunk-RFLJK4HZ.mjs → chunk-PYUPF6LY.mjs} +1 -1
  43. package/dist/{chunk-JALRAL32.mjs → chunk-SUEL7HXM.mjs} +1 -1
  44. package/dist/{chunk-UGUBB57K.mjs → chunk-VCCUBQFI.mjs} +1 -1
  45. package/dist/{chunk-JCEW7MBG.mjs → chunk-YBMQJF4S.mjs} +1 -1
  46. package/dist/{chunk-HDFIGN6S.mjs → chunk-ZPB64CEL.mjs} +1 -1
  47. package/dist/codeBlock/index.js +4 -4
  48. package/dist/codeBlock/index.js.map +1 -1
  49. package/dist/codeBlock/index.mjs +4 -4
  50. package/dist/codeBlock/index.mjs.map +1 -1
  51. package/dist/dataTable/index.js +4 -4
  52. package/dist/dataTable/index.js.map +1 -1
  53. package/dist/dataTable/index.mjs +4 -4
  54. package/dist/dataTable/index.mjs.map +1 -1
  55. package/dist/docsLayout/index.js +4 -4
  56. package/dist/docsLayout/index.js.map +1 -1
  57. package/dist/docsLayout/index.mjs +4 -4
  58. package/dist/docsLayout/index.mjs.map +1 -1
  59. package/dist/elements/index.d.mts +31 -1
  60. package/dist/elements/index.d.ts +31 -1
  61. package/dist/elements/index.js +4 -4
  62. package/dist/elements/index.mjs +3 -3
  63. package/dist/fileDropzone/index.js +4 -4
  64. package/dist/fileDropzone/index.js.map +1 -1
  65. package/dist/fileDropzone/index.mjs +4 -4
  66. package/dist/fileDropzone/index.mjs.map +1 -1
  67. package/dist/index.d.mts +41 -1
  68. package/dist/index.d.ts +41 -1
  69. package/dist/index.js +77 -12
  70. package/dist/index.mjs +77 -12
  71. package/dist/input/index.d.mts +31 -1
  72. package/dist/input/index.d.ts +31 -1
  73. package/dist/input/index.js.map +1 -1
  74. package/dist/input/index.mjs.map +1 -1
  75. package/dist/layout/index.js +4 -4
  76. package/dist/layout/index.mjs +2 -2
  77. package/dist/loading/index.js +4 -4
  78. package/dist/loading/index.js.map +1 -1
  79. package/dist/loading/index.mjs +4 -4
  80. package/dist/loading/index.mjs.map +1 -1
  81. package/dist/passwordInput/index.js.map +1 -1
  82. package/dist/passwordInput/index.mjs.map +1 -1
  83. package/dist/sortButton/index.js +4 -4
  84. package/dist/sortButton/index.js.map +1 -1
  85. package/dist/sortButton/index.mjs +4 -4
  86. package/dist/sortButton/index.mjs.map +1 -1
  87. package/dist/splitButton/index.js +4 -4
  88. package/dist/splitButton/index.js.map +1 -1
  89. package/dist/splitButton/index.mjs +4 -4
  90. package/dist/splitButton/index.mjs.map +1 -1
  91. package/dist/{textTypes-559CaoOV.d.ts → textTypes-u4OSE-rn.d.mts} +8 -1
  92. package/dist/{textTypes-559CaoOV.d.mts → textTypes-u4OSE-rn.d.ts} +8 -1
  93. package/package.json +1 -1
  94. package/dist/chunk-WUHNPHD5.mjs +0 -0
  95. package/dist/commonTypes-MxCJyrHv.d.mts +0 -8
  96. package/dist/commonTypes-MxCJyrHv.d.ts +0 -8
@@ -396,7 +396,7 @@ var Loading = ({
396
396
  /* @__PURE__ */ import_react3.default.createElement(
397
397
  "path",
398
398
  {
399
- className: "squircle-track",
399
+ className: cn("squircle-track", classNames == null ? void 0 : classNames.track),
400
400
  fill: "none",
401
401
  strokeWidth: "5",
402
402
  pathLength: "100",
@@ -406,7 +406,7 @@ var Loading = ({
406
406
  /* @__PURE__ */ import_react3.default.createElement(
407
407
  "path",
408
408
  {
409
- className: "squircle-car",
409
+ className: cn("squircle-car", classNames == null ? void 0 : classNames.car),
410
410
  fill: "none",
411
411
  strokeWidth: "5",
412
412
  pathLength: "100",
@@ -415,9 +415,9 @@ var Loading = ({
415
415
  )
416
416
  );
417
417
  case "progress":
418
- return /* @__PURE__ */ import_react3.default.createElement("div", { className: "progress-loading" });
418
+ return /* @__PURE__ */ import_react3.default.createElement("div", { className: cn("progress-loading", classNames == null ? void 0 : classNames.container) });
419
419
  case "orbit":
420
- return /* @__PURE__ */ import_react3.default.createElement("div", { className: "orbit-container" });
420
+ return /* @__PURE__ */ import_react3.default.createElement("div", { className: cn("orbit-container", classNames == null ? void 0 : classNames.container) });
421
421
  default:
422
422
  return /* @__PURE__ */ import_react3.default.createElement(
423
423
  "svg",
@@ -997,14 +997,168 @@ var NoPermission = ({ texts }) => {
997
997
  };
998
998
 
999
999
  // blocks/misc/ContactForm.tsx
1000
- var import_react13 = __toESM(require("react"));
1000
+ var import_react14 = __toESM(require("react"));
1001
1001
  var import_react_hook_form2 = require("react-hook-form");
1002
1002
  var import_zod = require("@hookform/resolvers/zod");
1003
1003
  var z = __toESM(require("zod"));
1004
1004
 
1005
+ // elements/select/Select.tsx
1006
+ var import_react13 = __toESM(require("react"));
1007
+ var import_react_select = __toESM(require("react-select"));
1008
+ var import_creatable = __toESM(require("react-select/creatable"));
1009
+ var import_clsx2 = __toESM(require("clsx"));
1010
+ var Select = ({
1011
+ labelProps,
1012
+ labelKey = "label",
1013
+ ...props
1014
+ }) => {
1015
+ const NoOption = () => {
1016
+ var _a, _b;
1017
+ return /* @__PURE__ */ import_react13.default.createElement("div", null, (_b = (_a = props.texts) == null ? void 0 : _a.noOptions) != null ? _b : "No Items Found");
1018
+ };
1019
+ const Control = ({ children, innerProps, innerRef }) => {
1020
+ return /* @__PURE__ */ import_react13.default.createElement(
1021
+ "div",
1022
+ {
1023
+ ref: innerRef,
1024
+ className: (0, import_clsx2.default)(
1025
+ "hawa-flex hawa-w-full hawa-rounded hawa-border hawa-bg-background hawa-p-2 hawa-text-sm hawa-text-gray-900 focus:hawa-border-blue-500 focus:hawa-ring-blue-500 dark:focus:hawa-ring-blue-500"
1026
+ ),
1027
+ ...innerProps
1028
+ },
1029
+ children
1030
+ );
1031
+ };
1032
+ const Option = ({ children, innerProps, innerRef }) => {
1033
+ return /* @__PURE__ */ import_react13.default.createElement(
1034
+ "div",
1035
+ {
1036
+ ref: innerRef,
1037
+ className: cn(
1038
+ "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"
1039
+ ),
1040
+ ...innerProps
1041
+ },
1042
+ children
1043
+ );
1044
+ };
1045
+ const Menu = ({
1046
+ cx,
1047
+ children,
1048
+ getStyles,
1049
+ innerProps,
1050
+ innerRef,
1051
+ ...menuProps
1052
+ }) => {
1053
+ const menuOpen = menuProps.selectProps.menuIsOpen;
1054
+ return /* @__PURE__ */ import_react13.default.createElement(
1055
+ "div",
1056
+ {
1057
+ className: cn(
1058
+ "dark:dark-shadow hawa-absolute hawa-z-10 -hawa-mx-1 hawa-mt-1 hawa-flex hawa-flex-col hawa-justify-start hawa-rounded hawa-border hawa-bg-background hawa-shadow-md",
1059
+ props.phoneCode ? "hawa-p-1.5" : "hawa-w-full hawa-p-1.5",
1060
+ menuOpen && "hawa-animate-in hawa-fade-in-0 hawa-zoom-in-95 "
1061
+ ),
1062
+ ref: innerRef,
1063
+ ...innerProps
1064
+ },
1065
+ children
1066
+ );
1067
+ };
1068
+ return /* @__PURE__ */ import_react13.default.createElement(
1069
+ "div",
1070
+ {
1071
+ className: cn(
1072
+ "hawa-flex hawa-flex-col hawa-gap-2",
1073
+ props.width === "fit" ? "hawa-w-fit" : "hawa-w-full"
1074
+ )
1075
+ },
1076
+ props.label && /* @__PURE__ */ import_react13.default.createElement(Label, { ...labelProps }, props.label),
1077
+ props.isLoading ? /* @__PURE__ */ import_react13.default.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" }) : !props.isCreatable ? (
1078
+ // TODO: enable keyboard to go to the next item in the list
1079
+ /* @__PURE__ */ import_react13.default.createElement(
1080
+ import_react_select.default,
1081
+ {
1082
+ noOptionsMessage: NoOption,
1083
+ classNames: {
1084
+ control: () => cn(
1085
+ props.phoneCode && "hawa-rounded-r-none",
1086
+ props.controlClassNames
1087
+ ),
1088
+ container: () => cn(
1089
+ "hawa-rounded",
1090
+ props.phoneCode && "hawa-w-fit hawa-min-w-[65px] hawa-text-right hawa-w-[100px] hawa-p-0 hawa-rounded-r-none hawa-h-[40px] ",
1091
+ "hawa-block hawa-w-full hawa-rounded hawa-border hawa-transition-all hawa-bg-background hawa-p-0 hawa-px-1 hawa-text-sm",
1092
+ props.disabled ? "hawa-cursor-not-allowed" : "hawa-cursor-pointer"
1093
+ ),
1094
+ placeholder: () => "hawa-text-muted-foreground hawa-cursor-pointer hawa-px-1",
1095
+ valueContainer: () => "hawa-text-foreground hawa-px-1 ",
1096
+ singleValue: () => "hawa-text-foreground",
1097
+ indicatorsContainer: () => cn(
1098
+ "hawa-cursor-pointer hawa-text-muted-foreground",
1099
+ props.hideIndicator ? "hawa-invisible" : "hawa-px-1"
1100
+ )
1101
+ },
1102
+ unstyled: true,
1103
+ autoFocus: true,
1104
+ components: props.hideIndicator ? { Option, Menu, IndicatorsContainer: () => null } : { Option, Menu },
1105
+ onChange: (newValue, action) => props.onChange(newValue, action),
1106
+ options: props.options,
1107
+ getOptionLabel: props.getOptionLabel,
1108
+ defaultValue: props.defaultValue,
1109
+ placeholder: props.placeholder,
1110
+ isDisabled: props.disabled,
1111
+ isClearable: props.isClearable,
1112
+ isMulti: props.isMulti,
1113
+ isSearchable: props.isSearchable
1114
+ }
1115
+ )
1116
+ ) : /* @__PURE__ */ import_react13.default.createElement(
1117
+ import_creatable.default,
1118
+ {
1119
+ formatCreateLabel: (inputValue) => {
1120
+ var _a, _b;
1121
+ return `${(_b = (_a = props.texts) == null ? void 0 : _a.createLabel) != null ? _b : "Create"} "${inputValue}"`;
1122
+ },
1123
+ classNames: {
1124
+ container: () => cn(
1125
+ "hawa-rounded",
1126
+ props.disabled ? "hawa-cursor-not-allowed" : "hawa-cursor-pointer"
1127
+ ),
1128
+ placeholder: () => "hawa-px-2 hawa-text-muted-foreground",
1129
+ input: () => "hawa-text-primary hawa-px-2",
1130
+ valueContainer: () => "hawa-text-white dark:hawa-text-muted-foreground",
1131
+ singleValue: () => "hawa-text-black dark:hawa-text-white hawa-px-2",
1132
+ indicatorsContainer: () => " hawa-px-2 hawa-cursor-pointer hawa-text-muted-foreground"
1133
+ },
1134
+ unstyled: true,
1135
+ options: props.options,
1136
+ isClearable: props.isClearable,
1137
+ isMulti: props.isMulti,
1138
+ isSearchable: props.isSearchable,
1139
+ placeholder: props.placeholder,
1140
+ onCreateOption: props.handleCreateOption,
1141
+ onChange: (newValue, action) => props.onChange(newValue, action),
1142
+ components: { Control, Option, Menu },
1143
+ onInputChange: (newValue, action) => props.onInputChange(newValue, action)
1144
+ }
1145
+ ),
1146
+ !props.hideHelperText && /* @__PURE__ */ import_react13.default.createElement(
1147
+ "p",
1148
+ {
1149
+ className: cn(
1150
+ "hawa-my-0 hawa-text-start hawa-text-xs hawa-text-helper-color hawa-transition-all",
1151
+ props.helperText ? "hawa-h-4 hawa-opacity-100" : "hawa-h-0 hawa-opacity-0"
1152
+ )
1153
+ },
1154
+ props.helperText
1155
+ )
1156
+ );
1157
+ };
1158
+
1005
1159
  // elements/textarea/Textarea.tsx
1006
- var React18 = __toESM(require("react"));
1007
- var Textarea = React18.forwardRef(
1160
+ var React19 = __toESM(require("react"));
1161
+ var Textarea = React19.forwardRef(
1008
1162
  ({
1009
1163
  className,
1010
1164
  classNames,
@@ -1016,7 +1170,7 @@ var Textarea = React18.forwardRef(
1016
1170
  isLoading,
1017
1171
  ...props
1018
1172
  }, ref) => {
1019
- return /* @__PURE__ */ React18.createElement(
1173
+ return /* @__PURE__ */ React19.createElement(
1020
1174
  "div",
1021
1175
  {
1022
1176
  className: cn(
@@ -1025,7 +1179,7 @@ var Textarea = React18.forwardRef(
1025
1179
  className
1026
1180
  )
1027
1181
  },
1028
- /* @__PURE__ */ React18.createElement("div", { className: "hawa-flex hawa-flex-row hawa-justify-between" }, props.label && /* @__PURE__ */ React18.createElement(Label, { ...labelProps }, props.label), showCount && countPosition === "top" && /* @__PURE__ */ React18.createElement(
1182
+ /* @__PURE__ */ React19.createElement("div", { className: "hawa-flex hawa-flex-row hawa-justify-between" }, props.label && /* @__PURE__ */ React19.createElement(Label, { ...labelProps }, props.label), showCount && countPosition === "top" && /* @__PURE__ */ React19.createElement(
1029
1183
  "div",
1030
1184
  {
1031
1185
  className: "hawa-text-start hawa-text-xs hawa-transition-all hawa-leading-none"
@@ -1034,7 +1188,7 @@ var Textarea = React18.forwardRef(
1034
1188
  "/",
1035
1189
  textareaProps == null ? void 0 : textareaProps.maxLength
1036
1190
  )),
1037
- isLoading ? /* @__PURE__ */ React18.createElement(Skeleton, { style: { height: 40 } }) : /* @__PURE__ */ React18.createElement(
1191
+ isLoading ? /* @__PURE__ */ React19.createElement(Skeleton, { style: { height: 40 } }) : /* @__PURE__ */ React19.createElement(
1038
1192
  "textarea",
1039
1193
  {
1040
1194
  className: cn(
@@ -1045,7 +1199,7 @@ var Textarea = React18.forwardRef(
1045
1199
  ...textareaProps
1046
1200
  }
1047
1201
  ),
1048
- /* @__PURE__ */ React18.createElement("div", { className: "hawa-flex hawa-flex-row hawa-justify-between" }, !forceHideHelperText && /* @__PURE__ */ React18.createElement(
1202
+ /* @__PURE__ */ React19.createElement("div", { className: "hawa-flex hawa-flex-row hawa-justify-between" }, !forceHideHelperText && /* @__PURE__ */ React19.createElement(
1049
1203
  "p",
1050
1204
  {
1051
1205
  className: cn(
@@ -1054,7 +1208,7 @@ var Textarea = React18.forwardRef(
1054
1208
  )
1055
1209
  },
1056
1210
  props.helperText
1057
- ), showCount && countPosition === "bottom" && /* @__PURE__ */ React18.createElement("div", { className: "hawa-text-start hawa-text-xs hawa-transition-all" }, (textareaProps == null ? void 0 : textareaProps.value) ? String(textareaProps == null ? void 0 : textareaProps.value).length : 0, "/", textareaProps == null ? void 0 : textareaProps.maxLength))
1211
+ ), showCount && countPosition === "bottom" && /* @__PURE__ */ React19.createElement("div", { className: "hawa-text-start hawa-text-xs hawa-transition-all" }, (textareaProps == null ? void 0 : textareaProps.value) ? String(textareaProps == null ? void 0 : textareaProps.value).length : 0, "/", textareaProps == null ? void 0 : textareaProps.maxLength))
1058
1212
  );
1059
1213
  }
1060
1214
  );
@@ -1067,25 +1221,56 @@ var ContactForm = ({
1067
1221
  texts,
1068
1222
  formId,
1069
1223
  formAutoComplete,
1070
- onSubmit
1224
+ onSubmit,
1225
+ customFields
1071
1226
  }) => {
1072
1227
  var _a, _b, _c;
1228
+ const customFieldsSchema = z.object({
1229
+ ...customFields == null ? void 0 : customFields.reduce(
1230
+ (acc, curr) => {
1231
+ switch (curr.type) {
1232
+ case "text":
1233
+ acc[curr.name] = z.string().optional().default("");
1234
+ break;
1235
+ case "number":
1236
+ acc[curr.name] = z.string().optional().default("");
1237
+ break;
1238
+ case "select":
1239
+ acc[curr.name] = z.string().optional().default("");
1240
+ break;
1241
+ default:
1242
+ break;
1243
+ }
1244
+ return acc;
1245
+ },
1246
+ {}
1247
+ )
1248
+ });
1073
1249
  const contactFormSchema = z.object({
1074
1250
  name: z.string({ required_error: texts == null ? void 0 : texts.name.required }).min(1, texts == null ? void 0 : texts.name.required).default(""),
1075
1251
  email: z.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(""),
1076
1252
  message: z.string({ required_error: texts == null ? void 0 : texts.message.required }).min(10, texts == null ? void 0 : texts.message.invalid).default("")
1077
1253
  });
1254
+ const customFieldsDefaultValues = customFields == null ? void 0 : customFields.reduce(
1255
+ (acc, curr) => {
1256
+ acc[curr.name] = "";
1257
+ return acc;
1258
+ },
1259
+ {}
1260
+ );
1261
+ const MainSchema = contactFormSchema.merge(customFieldsSchema);
1078
1262
  const {
1079
1263
  control,
1080
1264
  handleSubmit,
1081
1265
  formState: { errors },
1082
1266
  reset
1083
1267
  } = (0, import_react_hook_form2.useForm)({
1084
- resolver: (0, import_zod.zodResolver)(contactFormSchema),
1268
+ resolver: (0, import_zod.zodResolver)(MainSchema),
1085
1269
  defaultValues: {
1086
1270
  name: "",
1087
1271
  email: "",
1088
- message: ""
1272
+ message: "",
1273
+ ...customFieldsDefaultValues
1089
1274
  }
1090
1275
  });
1091
1276
  const handleFormSubmit = (data) => {
@@ -1096,21 +1281,16 @@ var ContactForm = ({
1096
1281
  console.log("Form is submitted but onSubmit prop is missing");
1097
1282
  }
1098
1283
  };
1099
- let sizeStyle = {
1100
- sm: "hawa-max-w-sm",
1101
- default: "hawa-w-full"
1102
- };
1103
- return /* @__PURE__ */ import_react13.default.createElement(
1284
+ return /* @__PURE__ */ import_react14.default.createElement(
1104
1285
  Card,
1105
1286
  {
1106
1287
  className: cn(
1107
- // sizeStyle[size],
1108
1288
  "hawa-w-full",
1109
1289
  cardless && "hawa-border-none hawa-bg-transparent hawa-shadow-none hawa-drop-shadow-none"
1110
1290
  ),
1111
1291
  style: cardless ? { boxShadow: "none" } : void 0
1112
1292
  },
1113
- /* @__PURE__ */ import_react13.default.createElement(CardContent, { headless: true }, /* @__PURE__ */ import_react13.default.createElement(
1293
+ /* @__PURE__ */ import_react14.default.createElement(CardContent, { headless: true }, /* @__PURE__ */ import_react14.default.createElement(
1114
1294
  "form",
1115
1295
  {
1116
1296
  noValidate: true,
@@ -1119,7 +1299,7 @@ var ContactForm = ({
1119
1299
  id: formId,
1120
1300
  autoComplete: formAutoComplete
1121
1301
  },
1122
- /* @__PURE__ */ import_react13.default.createElement(
1302
+ /* @__PURE__ */ import_react14.default.createElement(
1123
1303
  "div",
1124
1304
  {
1125
1305
  className: cn(
@@ -1130,14 +1310,14 @@ var ContactForm = ({
1130
1310
  }
1131
1311
  )
1132
1312
  },
1133
- /* @__PURE__ */ import_react13.default.createElement(
1313
+ /* @__PURE__ */ import_react14.default.createElement(
1134
1314
  import_react_hook_form2.Controller,
1135
1315
  {
1136
1316
  control,
1137
1317
  name: "name",
1138
1318
  render: ({ field }) => {
1139
1319
  var _a2;
1140
- return /* @__PURE__ */ import_react13.default.createElement(
1320
+ return /* @__PURE__ */ import_react14.default.createElement(
1141
1321
  Input,
1142
1322
  {
1143
1323
  label: texts == null ? void 0 : texts.name.label,
@@ -1150,14 +1330,14 @@ var ContactForm = ({
1150
1330
  }
1151
1331
  }
1152
1332
  ),
1153
- /* @__PURE__ */ import_react13.default.createElement(
1333
+ /* @__PURE__ */ import_react14.default.createElement(
1154
1334
  import_react_hook_form2.Controller,
1155
1335
  {
1156
1336
  control,
1157
1337
  name: "email",
1158
1338
  render: ({ field }) => {
1159
1339
  var _a2;
1160
- return /* @__PURE__ */ import_react13.default.createElement(
1340
+ return /* @__PURE__ */ import_react14.default.createElement(
1161
1341
  Input,
1162
1342
  {
1163
1343
  label: texts == null ? void 0 : texts.email.label,
@@ -1171,14 +1351,53 @@ var ContactForm = ({
1171
1351
  }
1172
1352
  )
1173
1353
  ),
1174
- /* @__PURE__ */ import_react13.default.createElement(
1354
+ customFields && customFields.map((customField) => {
1355
+ console.log("custom", customField);
1356
+ return /* @__PURE__ */ import_react14.default.createElement(
1357
+ import_react_hook_form2.Controller,
1358
+ {
1359
+ control,
1360
+ name: customField.name,
1361
+ render: ({ field }) => {
1362
+ const { type, label, placeholder } = customField;
1363
+ switch (type) {
1364
+ case "text":
1365
+ case "number":
1366
+ return /* @__PURE__ */ import_react14.default.createElement(
1367
+ Input,
1368
+ {
1369
+ id: customField.name,
1370
+ type,
1371
+ label,
1372
+ placeholder,
1373
+ ...field
1374
+ }
1375
+ );
1376
+ case "select":
1377
+ return /* @__PURE__ */ import_react14.default.createElement(
1378
+ Select,
1379
+ {
1380
+ label,
1381
+ options: customField.options,
1382
+ value: field.value,
1383
+ onChange: (option) => field.onChange(option.value)
1384
+ }
1385
+ );
1386
+ default:
1387
+ return /* @__PURE__ */ import_react14.default.createElement("div", null, "Unknown type");
1388
+ }
1389
+ }
1390
+ }
1391
+ );
1392
+ }),
1393
+ /* @__PURE__ */ import_react14.default.createElement(
1175
1394
  import_react_hook_form2.Controller,
1176
1395
  {
1177
1396
  control,
1178
1397
  name: "message",
1179
1398
  render: ({ field }) => {
1180
1399
  var _a2;
1181
- return /* @__PURE__ */ import_react13.default.createElement(
1400
+ return /* @__PURE__ */ import_react14.default.createElement(
1182
1401
  Textarea,
1183
1402
  {
1184
1403
  label: texts == null ? void 0 : texts.message.label,
@@ -1193,7 +1412,7 @@ var ContactForm = ({
1193
1412
  }
1194
1413
  }
1195
1414
  ),
1196
- /* @__PURE__ */ import_react13.default.createElement(Button, { type: "submit", className: "hawa-w-full" }, (texts == null ? void 0 : texts.submit) || "Submit")
1415
+ /* @__PURE__ */ import_react14.default.createElement(Button, { type: "submit", className: "hawa-w-full" }, (texts == null ? void 0 : texts.submit) || "Submit")
1197
1416
  ))
1198
1417
  );
1199
1418
  };
@@ -1,14 +1,16 @@
1
1
  import {
2
2
  Input
3
- } from "../../chunk-CLYZEJKB.mjs";
3
+ } from "../../chunk-PRSC2G4S.mjs";
4
4
  import {
5
5
  Chip,
6
6
  ScrollArea
7
- } from "../../chunk-RFLJK4HZ.mjs";
7
+ } from "../../chunk-PYUPF6LY.mjs";
8
8
  import {
9
9
  Textarea
10
- } from "../../chunk-JALRAL32.mjs";
11
- import "../../chunk-WUHNPHD5.mjs";
10
+ } from "../../chunk-SUEL7HXM.mjs";
11
+ import {
12
+ Select
13
+ } from "../../chunk-LKPRTTIX.mjs";
12
14
  import {
13
15
  Button,
14
16
  Card,
@@ -18,7 +20,7 @@ import {
18
20
  CardHeader,
19
21
  CardTitle,
20
22
  cn
21
- } from "../../chunk-7NRPNLHB.mjs";
23
+ } from "../../chunk-P7MJOYGC.mjs";
22
24
 
23
25
  // blocks/misc/LegalTexts.tsx
24
26
  import React2 from "react";
@@ -245,25 +247,56 @@ var ContactForm = ({
245
247
  texts,
246
248
  formId,
247
249
  formAutoComplete,
248
- onSubmit
250
+ onSubmit,
251
+ customFields
249
252
  }) => {
250
253
  var _a, _b, _c;
254
+ const customFieldsSchema = z.object({
255
+ ...customFields == null ? void 0 : customFields.reduce(
256
+ (acc, curr) => {
257
+ switch (curr.type) {
258
+ case "text":
259
+ acc[curr.name] = z.string().optional().default("");
260
+ break;
261
+ case "number":
262
+ acc[curr.name] = z.string().optional().default("");
263
+ break;
264
+ case "select":
265
+ acc[curr.name] = z.string().optional().default("");
266
+ break;
267
+ default:
268
+ break;
269
+ }
270
+ return acc;
271
+ },
272
+ {}
273
+ )
274
+ });
251
275
  const contactFormSchema = z.object({
252
276
  name: z.string({ required_error: texts == null ? void 0 : texts.name.required }).min(1, texts == null ? void 0 : texts.name.required).default(""),
253
277
  email: z.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(""),
254
278
  message: z.string({ required_error: texts == null ? void 0 : texts.message.required }).min(10, texts == null ? void 0 : texts.message.invalid).default("")
255
279
  });
280
+ const customFieldsDefaultValues = customFields == null ? void 0 : customFields.reduce(
281
+ (acc, curr) => {
282
+ acc[curr.name] = "";
283
+ return acc;
284
+ },
285
+ {}
286
+ );
287
+ const MainSchema = contactFormSchema.merge(customFieldsSchema);
256
288
  const {
257
289
  control,
258
290
  handleSubmit,
259
291
  formState: { errors },
260
292
  reset
261
293
  } = useForm2({
262
- resolver: zodResolver(contactFormSchema),
294
+ resolver: zodResolver(MainSchema),
263
295
  defaultValues: {
264
296
  name: "",
265
297
  email: "",
266
- message: ""
298
+ message: "",
299
+ ...customFieldsDefaultValues
267
300
  }
268
301
  });
269
302
  const handleFormSubmit = (data) => {
@@ -274,15 +307,10 @@ var ContactForm = ({
274
307
  console.log("Form is submitted but onSubmit prop is missing");
275
308
  }
276
309
  };
277
- let sizeStyle = {
278
- sm: "hawa-max-w-sm",
279
- default: "hawa-w-full"
280
- };
281
310
  return /* @__PURE__ */ React9.createElement(
282
311
  Card,
283
312
  {
284
313
  className: cn(
285
- // sizeStyle[size],
286
314
  "hawa-w-full",
287
315
  cardless && "hawa-border-none hawa-bg-transparent hawa-shadow-none hawa-drop-shadow-none"
288
316
  ),
@@ -349,6 +377,45 @@ var ContactForm = ({
349
377
  }
350
378
  )
351
379
  ),
380
+ customFields && customFields.map((customField) => {
381
+ console.log("custom", customField);
382
+ return /* @__PURE__ */ React9.createElement(
383
+ Controller2,
384
+ {
385
+ control,
386
+ name: customField.name,
387
+ render: ({ field }) => {
388
+ const { type, label, placeholder } = customField;
389
+ switch (type) {
390
+ case "text":
391
+ case "number":
392
+ return /* @__PURE__ */ React9.createElement(
393
+ Input,
394
+ {
395
+ id: customField.name,
396
+ type,
397
+ label,
398
+ placeholder,
399
+ ...field
400
+ }
401
+ );
402
+ case "select":
403
+ return /* @__PURE__ */ React9.createElement(
404
+ Select,
405
+ {
406
+ label,
407
+ options: customField.options,
408
+ value: field.value,
409
+ onChange: (option) => field.onChange(option.value)
410
+ }
411
+ );
412
+ default:
413
+ return /* @__PURE__ */ React9.createElement("div", null, "Unknown type");
414
+ }
415
+ }
416
+ }
417
+ );
418
+ }),
352
419
  /* @__PURE__ */ React9.createElement(
353
420
  Controller2,
354
421
  {
@@ -1,6 +1,5 @@
1
1
  import { FC, InputHTMLAttributes } from 'react';
2
- import { P as PositionType, D as DirectionType, R as RadioOptionType } from '../../commonTypes-MxCJyrHv.mjs';
3
- import { P as PricingPlanTexts } from '../../textTypes-559CaoOV.mjs';
2
+ import { P as PositionType, D as DirectionType, d as PricingPlanTexts, R as RadioOptionType } from '../../textTypes-u4OSE-rn.mjs';
4
3
 
5
4
  type PlanFeature = {
6
5
  soon?: boolean;
@@ -1,6 +1,5 @@
1
1
  import { FC, InputHTMLAttributes } from 'react';
2
- import { P as PositionType, D as DirectionType, R as RadioOptionType } from '../../commonTypes-MxCJyrHv.js';
3
- import { P as PricingPlanTexts } from '../../textTypes-559CaoOV.js';
2
+ import { P as PositionType, D as DirectionType, d as PricingPlanTexts, R as RadioOptionType } from '../../textTypes-u4OSE-rn.js';
4
3
 
5
4
  type PlanFeature = {
6
5
  soon?: boolean;
@@ -183,7 +183,7 @@ var Loading = ({
183
183
  /* @__PURE__ */ import_react3.default.createElement(
184
184
  "path",
185
185
  {
186
- className: "squircle-track",
186
+ className: cn("squircle-track", classNames == null ? void 0 : classNames.track),
187
187
  fill: "none",
188
188
  strokeWidth: "5",
189
189
  pathLength: "100",
@@ -193,7 +193,7 @@ var Loading = ({
193
193
  /* @__PURE__ */ import_react3.default.createElement(
194
194
  "path",
195
195
  {
196
- className: "squircle-car",
196
+ className: cn("squircle-car", classNames == null ? void 0 : classNames.car),
197
197
  fill: "none",
198
198
  strokeWidth: "5",
199
199
  pathLength: "100",
@@ -202,9 +202,9 @@ var Loading = ({
202
202
  )
203
203
  );
204
204
  case "progress":
205
- return /* @__PURE__ */ import_react3.default.createElement("div", { className: "progress-loading" });
205
+ return /* @__PURE__ */ import_react3.default.createElement("div", { className: cn("progress-loading", classNames == null ? void 0 : classNames.container) });
206
206
  case "orbit":
207
- return /* @__PURE__ */ import_react3.default.createElement("div", { className: "orbit-container" });
207
+ return /* @__PURE__ */ import_react3.default.createElement("div", { className: cn("orbit-container", classNames == null ? void 0 : classNames.container) });
208
208
  default:
209
209
  return /* @__PURE__ */ import_react3.default.createElement(
210
210
  "svg",
@@ -1,22 +1,22 @@
1
1
  import {
2
2
  Chip,
3
3
  ScrollArea
4
- } from "../../chunk-RFLJK4HZ.mjs";
4
+ } from "../../chunk-PYUPF6LY.mjs";
5
5
  import "../../chunk-ZS3FB3PO.mjs";
6
6
  import {
7
7
  Radio
8
- } from "../../chunk-JCEW7MBG.mjs";
8
+ } from "../../chunk-YBMQJF4S.mjs";
9
9
  import {
10
10
  CheckMark,
11
11
  UncheckMark
12
- } from "../../chunk-HDFIGN6S.mjs";
12
+ } from "../../chunk-ZPB64CEL.mjs";
13
13
  import {
14
14
  Button,
15
15
  Card,
16
16
  Skeleton,
17
17
  Tooltip,
18
18
  cn
19
- } from "../../chunk-7NRPNLHB.mjs";
19
+ } from "../../chunk-P7MJOYGC.mjs";
20
20
 
21
21
  // blocks/pricing/PricingPlans.tsx
22
22
  import React8 from "react";