@sikka/hawa 0.20.7-next → 0.20.8-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/index.js CHANGED
@@ -11114,10 +11114,19 @@ var ContactForm = ({
11114
11114
  const {
11115
11115
  control,
11116
11116
  handleSubmit,
11117
- formState: { errors }
11117
+ formState: { errors },
11118
+ reset
11118
11119
  } = (0, import_react_hook_form9.useForm)({
11119
11120
  resolver: (0, import_zod8.zodResolver)(contactFormSchema)
11120
11121
  });
11122
+ const handleFormSubmit = (data) => {
11123
+ if (onSubmit) {
11124
+ onSubmit(data);
11125
+ reset();
11126
+ } else {
11127
+ console.log("Form is submitted but onSubmit prop is missing");
11128
+ }
11129
+ };
11121
11130
  let sizeStyle = {
11122
11131
  sm: "hawa-max-w-sm",
11123
11132
  default: "hawa-w-full"
@@ -11135,13 +11144,7 @@ var ContactForm = ({
11135
11144
  "form",
11136
11145
  {
11137
11146
  noValidate: true,
11138
- onSubmit: handleSubmit((e) => {
11139
- if (onSubmit) {
11140
- return onSubmit(e);
11141
- } else {
11142
- console.log("Form is submitted but onSubmit prop is missing");
11143
- }
11144
- }),
11147
+ onSubmit: handleSubmit(handleFormSubmit),
11145
11148
  className: "hawa-space-y-2",
11146
11149
  id: formId,
11147
11150
  autoComplete: formAutoComplete
package/dist/index.mjs CHANGED
@@ -10889,10 +10889,19 @@ var ContactForm = ({
10889
10889
  const {
10890
10890
  control,
10891
10891
  handleSubmit,
10892
- formState: { errors }
10892
+ formState: { errors },
10893
+ reset
10893
10894
  } = useForm9({
10894
10895
  resolver: zodResolver8(contactFormSchema)
10895
10896
  });
10897
+ const handleFormSubmit = (data) => {
10898
+ if (onSubmit) {
10899
+ onSubmit(data);
10900
+ reset();
10901
+ } else {
10902
+ console.log("Form is submitted but onSubmit prop is missing");
10903
+ }
10904
+ };
10896
10905
  let sizeStyle = {
10897
10906
  sm: "hawa-max-w-sm",
10898
10907
  default: "hawa-w-full"
@@ -10910,13 +10919,7 @@ var ContactForm = ({
10910
10919
  "form",
10911
10920
  {
10912
10921
  noValidate: true,
10913
- onSubmit: handleSubmit((e) => {
10914
- if (onSubmit) {
10915
- return onSubmit(e);
10916
- } else {
10917
- console.log("Form is submitted but onSubmit prop is missing");
10918
- }
10919
- }),
10922
+ onSubmit: handleSubmit(handleFormSubmit),
10920
10923
  className: "hawa-space-y-2",
10921
10924
  id: formId,
10922
10925
  autoComplete: formAutoComplete
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sikka/hawa",
3
- "version": "0.20.7-next",
3
+ "version": "0.20.8-next",
4
4
  "description": "Modern UI Kit made with Tailwind",
5
5
  "author": {
6
6
  "name": "Sikka Software",