@sikka/hawa 0.26.38-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.
- package/dist/blocks/auth/index.d.mts +1 -2
- package/dist/blocks/auth/index.d.ts +1 -2
- package/dist/blocks/auth/index.mjs +1 -2
- package/dist/blocks/feedback/index.d.mts +1 -2
- package/dist/blocks/feedback/index.d.ts +1 -2
- package/dist/blocks/feedback/index.mjs +1 -2
- package/dist/blocks/index.d.mts +10 -0
- package/dist/blocks/index.d.ts +10 -0
- package/dist/blocks/index.js +73 -8
- package/dist/blocks/index.mjs +73 -8
- package/dist/blocks/misc/index.d.mts +11 -1
- package/dist/blocks/misc/index.d.ts +11 -1
- package/dist/blocks/misc/index.js +245 -26
- package/dist/blocks/misc/index.mjs +76 -9
- package/dist/blocks/pricing/index.d.mts +1 -2
- package/dist/blocks/pricing/index.d.ts +1 -2
- package/dist/dataTable/index.js.map +1 -1
- package/dist/dataTable/index.mjs.map +1 -1
- package/dist/elements/index.d.mts +31 -1
- package/dist/elements/index.d.ts +31 -1
- package/dist/index.d.mts +41 -1
- package/dist/index.d.ts +41 -1
- package/dist/index.js +73 -8
- package/dist/index.mjs +73 -8
- package/dist/input/index.d.mts +31 -1
- package/dist/input/index.d.ts +31 -1
- package/dist/input/index.js.map +1 -1
- package/dist/input/index.mjs.map +1 -1
- package/dist/passwordInput/index.js.map +1 -1
- package/dist/passwordInput/index.mjs.map +1 -1
- package/dist/{textTypes-559CaoOV.d.mts → textTypes-u4OSE-rn.d.mts} +8 -1
- package/dist/{textTypes-559CaoOV.d.ts → textTypes-u4OSE-rn.d.ts} +8 -1
- package/package.json +1 -1
- package/dist/chunk-WUHNPHD5.mjs +0 -0
- package/dist/commonTypes-MxCJyrHv.d.mts +0 -8
- package/dist/commonTypes-MxCJyrHv.d.ts +0 -8
- /package/dist/{chunk-DUHB245X.mjs → chunk-LKPRTTIX.mjs} +0 -0
@@ -1,6 +1,5 @@
|
|
1
1
|
import { FC } from 'react';
|
2
|
-
import { D as DirectionType } from '../../
|
3
|
-
import { L as LoginFormTextsTypes, R as RegisterFormTextsTypes, a as ThirdPartyAuthTextsTypes, N as NewPasswordTextsTypes, b as ResetPasswordTextsTypes } from '../../textTypes-559CaoOV.mjs';
|
2
|
+
import { L as LoginFormTextsTypes, D as DirectionType, a as RegisterFormTextsTypes, b as ThirdPartyAuthTextsTypes, N as NewPasswordTextsTypes, c as ResetPasswordTextsTypes } from '../../textTypes-u4OSE-rn.mjs';
|
4
3
|
|
5
4
|
type LoginFormTypes = {
|
6
5
|
/** Object containing text labels used throughout the form. */
|
@@ -1,6 +1,5 @@
|
|
1
1
|
import { FC } from 'react';
|
2
|
-
import { D as DirectionType } from '../../
|
3
|
-
import { L as LoginFormTextsTypes, R as RegisterFormTextsTypes, a as ThirdPartyAuthTextsTypes, N as NewPasswordTextsTypes, b as ResetPasswordTextsTypes } from '../../textTypes-559CaoOV.js';
|
2
|
+
import { L as LoginFormTextsTypes, D as DirectionType, a as RegisterFormTextsTypes, b as ThirdPartyAuthTextsTypes, N as NewPasswordTextsTypes, c as ResetPasswordTextsTypes } from '../../textTypes-u4OSE-rn.js';
|
4
3
|
|
5
4
|
type LoginFormTypes = {
|
6
5
|
/** Object containing text labels used throughout the form. */
|
@@ -1,6 +1,5 @@
|
|
1
1
|
import React, { FC } from 'react';
|
2
|
-
import { D as DirectionType } from '../../
|
3
|
-
import { B as BaseInputType } from '../../textTypes-559CaoOV.mjs';
|
2
|
+
import { D as DirectionType, B as BaseInputType } from '../../textTypes-u4OSE-rn.mjs';
|
4
3
|
|
5
4
|
type RadioOptionsTypes = {
|
6
5
|
value: any;
|
@@ -1,6 +1,5 @@
|
|
1
1
|
import React, { FC } from 'react';
|
2
|
-
import { D as DirectionType } from '../../
|
3
|
-
import { B as BaseInputType } from '../../textTypes-559CaoOV.js';
|
2
|
+
import { D as DirectionType, B as BaseInputType } from '../../textTypes-u4OSE-rn.js';
|
4
3
|
|
5
4
|
type RadioOptionsTypes = {
|
6
5
|
value: any;
|
package/dist/blocks/index.d.mts
CHANGED
@@ -328,6 +328,15 @@ type ContactFormData = {
|
|
328
328
|
name: string;
|
329
329
|
email: string;
|
330
330
|
message: string;
|
331
|
+
} & {
|
332
|
+
[key: string]: string;
|
333
|
+
};
|
334
|
+
type CustomField = {
|
335
|
+
label: string;
|
336
|
+
type: "text" | "number" | "select";
|
337
|
+
name: string;
|
338
|
+
placeholder?: string;
|
339
|
+
options?: RadioOptionType[];
|
331
340
|
};
|
332
341
|
type ContactFormProps = {
|
333
342
|
cardless?: boolean;
|
@@ -341,6 +350,7 @@ type ContactFormProps = {
|
|
341
350
|
email: TextInputType;
|
342
351
|
message: TextInputType;
|
343
352
|
};
|
353
|
+
customFields?: CustomField[];
|
344
354
|
};
|
345
355
|
declare const ContactForm: React__default.FC<ContactFormProps>;
|
346
356
|
|
package/dist/blocks/index.d.ts
CHANGED
@@ -328,6 +328,15 @@ type ContactFormData = {
|
|
328
328
|
name: string;
|
329
329
|
email: string;
|
330
330
|
message: string;
|
331
|
+
} & {
|
332
|
+
[key: string]: string;
|
333
|
+
};
|
334
|
+
type CustomField = {
|
335
|
+
label: string;
|
336
|
+
type: "text" | "number" | "select";
|
337
|
+
name: string;
|
338
|
+
placeholder?: string;
|
339
|
+
options?: RadioOptionType[];
|
331
340
|
};
|
332
341
|
type ContactFormProps = {
|
333
342
|
cardless?: boolean;
|
@@ -341,6 +350,7 @@ type ContactFormProps = {
|
|
341
350
|
email: TextInputType;
|
342
351
|
message: TextInputType;
|
343
352
|
};
|
353
|
+
customFields?: CustomField[];
|
344
354
|
};
|
345
355
|
declare const ContactForm: React__default.FC<ContactFormProps>;
|
346
356
|
|
package/dist/blocks/index.js
CHANGED
@@ -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)(
|
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
|
{
|
package/dist/blocks/index.mjs
CHANGED
@@ -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(
|
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-
|
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-
|
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
|
|