@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
@@ -206,7 +206,7 @@ var Loading = ({
206
206
  /* @__PURE__ */ import_react.default.createElement(
207
207
  "path",
208
208
  {
209
- className: "squircle-track",
209
+ className: cn("squircle-track", classNames == null ? void 0 : classNames.track),
210
210
  fill: "none",
211
211
  strokeWidth: "5",
212
212
  pathLength: "100",
@@ -216,7 +216,7 @@ var Loading = ({
216
216
  /* @__PURE__ */ import_react.default.createElement(
217
217
  "path",
218
218
  {
219
- className: "squircle-car",
219
+ className: cn("squircle-car", classNames == null ? void 0 : classNames.car),
220
220
  fill: "none",
221
221
  strokeWidth: "5",
222
222
  pathLength: "100",
@@ -225,9 +225,9 @@ var Loading = ({
225
225
  )
226
226
  );
227
227
  case "progress":
228
- return /* @__PURE__ */ import_react.default.createElement("div", { className: "progress-loading" });
228
+ return /* @__PURE__ */ import_react.default.createElement("div", { className: cn("progress-loading", classNames == null ? void 0 : classNames.container) });
229
229
  case "orbit":
230
- return /* @__PURE__ */ import_react.default.createElement("div", { className: "orbit-container" });
230
+ return /* @__PURE__ */ import_react.default.createElement("div", { className: cn("orbit-container", classNames == null ? void 0 : classNames.container) });
231
231
  default:
232
232
  return /* @__PURE__ */ import_react.default.createElement(
233
233
  "svg",
@@ -5491,25 +5491,56 @@ var ContactForm = ({
5491
5491
  texts,
5492
5492
  formId,
5493
5493
  formAutoComplete,
5494
- onSubmit
5494
+ onSubmit,
5495
+ customFields
5495
5496
  }) => {
5496
5497
  var _a, _b, _c;
5498
+ const customFieldsSchema = z8.object({
5499
+ ...customFields == null ? void 0 : customFields.reduce(
5500
+ (acc, curr) => {
5501
+ switch (curr.type) {
5502
+ case "text":
5503
+ acc[curr.name] = z8.string().optional().default("");
5504
+ break;
5505
+ case "number":
5506
+ acc[curr.name] = z8.string().optional().default("");
5507
+ break;
5508
+ case "select":
5509
+ acc[curr.name] = z8.string().optional().default("");
5510
+ break;
5511
+ default:
5512
+ break;
5513
+ }
5514
+ return acc;
5515
+ },
5516
+ {}
5517
+ )
5518
+ });
5497
5519
  const contactFormSchema = z8.object({
5498
5520
  name: z8.string({ required_error: texts == null ? void 0 : texts.name.required }).min(1, texts == null ? void 0 : texts.name.required).default(""),
5499
5521
  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(""),
5500
5522
  message: z8.string({ required_error: texts == null ? void 0 : texts.message.required }).min(10, texts == null ? void 0 : texts.message.invalid).default("")
5501
5523
  });
5524
+ const customFieldsDefaultValues = customFields == null ? void 0 : customFields.reduce(
5525
+ (acc, curr) => {
5526
+ acc[curr.name] = "";
5527
+ return acc;
5528
+ },
5529
+ {}
5530
+ );
5531
+ const MainSchema = contactFormSchema.merge(customFieldsSchema);
5502
5532
  const {
5503
5533
  control,
5504
5534
  handleSubmit,
5505
5535
  formState: { errors },
5506
5536
  reset
5507
5537
  } = (0, import_react_hook_form9.useForm)({
5508
- resolver: (0, import_zod8.zodResolver)(contactFormSchema),
5538
+ resolver: (0, import_zod8.zodResolver)(MainSchema),
5509
5539
  defaultValues: {
5510
5540
  name: "",
5511
5541
  email: "",
5512
- message: ""
5542
+ message: "",
5543
+ ...customFieldsDefaultValues
5513
5544
  }
5514
5545
  });
5515
5546
  const handleFormSubmit = (data) => {
@@ -5520,15 +5551,10 @@ var ContactForm = ({
5520
5551
  console.log("Form is submitted but onSubmit prop is missing");
5521
5552
  }
5522
5553
  };
5523
- let sizeStyle = {
5524
- sm: "hawa-max-w-sm",
5525
- default: "hawa-w-full"
5526
- };
5527
5554
  return /* @__PURE__ */ import_react35.default.createElement(
5528
5555
  Card,
5529
5556
  {
5530
5557
  className: cn(
5531
- // sizeStyle[size],
5532
5558
  "hawa-w-full",
5533
5559
  cardless && "hawa-border-none hawa-bg-transparent hawa-shadow-none hawa-drop-shadow-none"
5534
5560
  ),
@@ -5595,6 +5621,45 @@ var ContactForm = ({
5595
5621
  }
5596
5622
  )
5597
5623
  ),
5624
+ customFields && customFields.map((customField) => {
5625
+ console.log("custom", customField);
5626
+ return /* @__PURE__ */ import_react35.default.createElement(
5627
+ import_react_hook_form9.Controller,
5628
+ {
5629
+ control,
5630
+ name: customField.name,
5631
+ render: ({ field }) => {
5632
+ const { type, label, placeholder } = customField;
5633
+ switch (type) {
5634
+ case "text":
5635
+ case "number":
5636
+ return /* @__PURE__ */ import_react35.default.createElement(
5637
+ Input,
5638
+ {
5639
+ id: customField.name,
5640
+ type,
5641
+ label,
5642
+ placeholder,
5643
+ ...field
5644
+ }
5645
+ );
5646
+ case "select":
5647
+ return /* @__PURE__ */ import_react35.default.createElement(
5648
+ Select,
5649
+ {
5650
+ label,
5651
+ options: customField.options,
5652
+ value: field.value,
5653
+ onChange: (option) => field.onChange(option.value)
5654
+ }
5655
+ );
5656
+ default:
5657
+ return /* @__PURE__ */ import_react35.default.createElement("div", null, "Unknown type");
5658
+ }
5659
+ }
5660
+ }
5661
+ );
5662
+ }),
5598
5663
  /* @__PURE__ */ import_react35.default.createElement(
5599
5664
  import_react_hook_form9.Controller,
5600
5665
  {
@@ -25,7 +25,7 @@ import {
25
25
  UncheckMark,
26
26
  VeryBadEmoji,
27
27
  VeryGoodEmoji
28
- } from "../chunk-UGUBB57K.mjs";
28
+ } from "../chunk-VCCUBQFI.mjs";
29
29
  import {
30
30
  Button,
31
31
  Card,
@@ -41,7 +41,7 @@ import {
41
41
  Skeleton,
42
42
  Tooltip,
43
43
  cn
44
- } from "../chunk-AJUOAC6L.mjs";
44
+ } from "../chunk-D3KUSRHL.mjs";
45
45
  import "../chunk-ZFXKCRJC.mjs";
46
46
 
47
47
  // blocks/auth/LoginForm.tsx
@@ -1693,25 +1693,56 @@ var ContactForm = ({
1693
1693
  texts,
1694
1694
  formId,
1695
1695
  formAutoComplete,
1696
- onSubmit
1696
+ onSubmit,
1697
+ customFields
1697
1698
  }) => {
1698
1699
  var _a, _b, _c;
1700
+ const customFieldsSchema = z8.object({
1701
+ ...customFields == null ? void 0 : customFields.reduce(
1702
+ (acc, curr) => {
1703
+ switch (curr.type) {
1704
+ case "text":
1705
+ acc[curr.name] = z8.string().optional().default("");
1706
+ break;
1707
+ case "number":
1708
+ acc[curr.name] = z8.string().optional().default("");
1709
+ break;
1710
+ case "select":
1711
+ acc[curr.name] = z8.string().optional().default("");
1712
+ break;
1713
+ default:
1714
+ break;
1715
+ }
1716
+ return acc;
1717
+ },
1718
+ {}
1719
+ )
1720
+ });
1699
1721
  const contactFormSchema = z8.object({
1700
1722
  name: z8.string({ required_error: texts == null ? void 0 : texts.name.required }).min(1, texts == null ? void 0 : texts.name.required).default(""),
1701
1723
  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(""),
1702
1724
  message: z8.string({ required_error: texts == null ? void 0 : texts.message.required }).min(10, texts == null ? void 0 : texts.message.invalid).default("")
1703
1725
  });
1726
+ const customFieldsDefaultValues = customFields == null ? void 0 : customFields.reduce(
1727
+ (acc, curr) => {
1728
+ acc[curr.name] = "";
1729
+ return acc;
1730
+ },
1731
+ {}
1732
+ );
1733
+ const MainSchema = contactFormSchema.merge(customFieldsSchema);
1704
1734
  const {
1705
1735
  control,
1706
1736
  handleSubmit,
1707
1737
  formState: { errors },
1708
1738
  reset
1709
1739
  } = useForm9({
1710
- resolver: zodResolver8(contactFormSchema),
1740
+ resolver: zodResolver8(MainSchema),
1711
1741
  defaultValues: {
1712
1742
  name: "",
1713
1743
  email: "",
1714
- message: ""
1744
+ message: "",
1745
+ ...customFieldsDefaultValues
1715
1746
  }
1716
1747
  });
1717
1748
  const handleFormSubmit = (data) => {
@@ -1722,15 +1753,10 @@ var ContactForm = ({
1722
1753
  console.log("Form is submitted but onSubmit prop is missing");
1723
1754
  }
1724
1755
  };
1725
- let sizeStyle = {
1726
- sm: "hawa-max-w-sm",
1727
- default: "hawa-w-full"
1728
- };
1729
1756
  return /* @__PURE__ */ React20.createElement(
1730
1757
  Card,
1731
1758
  {
1732
1759
  className: cn(
1733
- // sizeStyle[size],
1734
1760
  "hawa-w-full",
1735
1761
  cardless && "hawa-border-none hawa-bg-transparent hawa-shadow-none hawa-drop-shadow-none"
1736
1762
  ),
@@ -1797,6 +1823,45 @@ var ContactForm = ({
1797
1823
  }
1798
1824
  )
1799
1825
  ),
1826
+ customFields && customFields.map((customField) => {
1827
+ console.log("custom", customField);
1828
+ return /* @__PURE__ */ React20.createElement(
1829
+ Controller9,
1830
+ {
1831
+ control,
1832
+ name: customField.name,
1833
+ render: ({ field }) => {
1834
+ const { type, label, placeholder } = customField;
1835
+ switch (type) {
1836
+ case "text":
1837
+ case "number":
1838
+ return /* @__PURE__ */ React20.createElement(
1839
+ Input,
1840
+ {
1841
+ id: customField.name,
1842
+ type,
1843
+ label,
1844
+ placeholder,
1845
+ ...field
1846
+ }
1847
+ );
1848
+ case "select":
1849
+ return /* @__PURE__ */ React20.createElement(
1850
+ Select,
1851
+ {
1852
+ label,
1853
+ options: customField.options,
1854
+ value: field.value,
1855
+ onChange: (option) => field.onChange(option.value)
1856
+ }
1857
+ );
1858
+ default:
1859
+ return /* @__PURE__ */ React20.createElement("div", null, "Unknown type");
1860
+ }
1861
+ }
1862
+ }
1863
+ );
1864
+ }),
1800
1865
  /* @__PURE__ */ React20.createElement(
1801
1866
  Controller9,
1802
1867
  {
@@ -1,5 +1,5 @@
1
1
  import React, { FC } from 'react';
2
- import { T as TextInputType } from '../../textTypes-559CaoOV.mjs';
2
+ import { T as TextInputType, R as RadioOptionType } from '../../textTypes-u4OSE-rn.mjs';
3
3
 
4
4
  type TabType = {
5
5
  title: string;
@@ -71,6 +71,15 @@ type ContactFormData = {
71
71
  name: string;
72
72
  email: string;
73
73
  message: string;
74
+ } & {
75
+ [key: string]: string;
76
+ };
77
+ type CustomField = {
78
+ label: string;
79
+ type: "text" | "number" | "select";
80
+ name: string;
81
+ placeholder?: string;
82
+ options?: RadioOptionType[];
74
83
  };
75
84
  type ContactFormProps = {
76
85
  cardless?: boolean;
@@ -84,6 +93,7 @@ type ContactFormProps = {
84
93
  email: TextInputType;
85
94
  message: TextInputType;
86
95
  };
96
+ customFields?: CustomField[];
87
97
  };
88
98
  declare const ContactForm: React.FC<ContactFormProps>;
89
99
 
@@ -1,5 +1,5 @@
1
1
  import React, { FC } from 'react';
2
- import { T as TextInputType } from '../../textTypes-559CaoOV.js';
2
+ import { T as TextInputType, R as RadioOptionType } from '../../textTypes-u4OSE-rn.js';
3
3
 
4
4
  type TabType = {
5
5
  title: string;
@@ -71,6 +71,15 @@ type ContactFormData = {
71
71
  name: string;
72
72
  email: string;
73
73
  message: string;
74
+ } & {
75
+ [key: string]: string;
76
+ };
77
+ type CustomField = {
78
+ label: string;
79
+ type: "text" | "number" | "select";
80
+ name: string;
81
+ placeholder?: string;
82
+ options?: RadioOptionType[];
74
83
  };
75
84
  type ContactFormProps = {
76
85
  cardless?: boolean;
@@ -84,6 +93,7 @@ type ContactFormProps = {
84
93
  email: TextInputType;
85
94
  message: TextInputType;
86
95
  };
96
+ customFields?: CustomField[];
87
97
  };
88
98
  declare const ContactForm: React.FC<ContactFormProps>;
89
99