@sikka/hawa 0.11.2-next → 0.11.5-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.d.mts +7 -4
- package/dist/index.d.ts +7 -4
- package/dist/index.js +81 -35
- package/dist/index.mjs +79 -34
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -291,6 +291,7 @@ type RadioTypes = {
|
|
|
291
291
|
onChangeTab?: any;
|
|
292
292
|
defaultValue?: any;
|
|
293
293
|
direction?: "rtl" | "ltr";
|
|
294
|
+
helperText?: string;
|
|
294
295
|
};
|
|
295
296
|
declare const Radio: FC<RadioTypes>;
|
|
296
297
|
|
|
@@ -1191,12 +1192,14 @@ type ComponentTypes$2 = {
|
|
|
1191
1192
|
description?: string;
|
|
1192
1193
|
tag?: any;
|
|
1193
1194
|
options?: RadioOptionsTypes[];
|
|
1194
|
-
texts?: {
|
|
1195
|
-
least: string;
|
|
1196
|
-
most: string;
|
|
1197
|
-
};
|
|
1198
1195
|
position?: "bottom-right" | "bottom-left";
|
|
1199
1196
|
onOptionClicked?: (option: any) => void;
|
|
1197
|
+
direction?: "rtl" | "ltr";
|
|
1198
|
+
texts?: {
|
|
1199
|
+
pleaseSelectOption: string;
|
|
1200
|
+
textTooShort: string;
|
|
1201
|
+
submit?: string;
|
|
1202
|
+
};
|
|
1200
1203
|
};
|
|
1201
1204
|
declare const UserReferralSource: FC<ComponentTypes$2>;
|
|
1202
1205
|
|
package/dist/index.d.ts
CHANGED
|
@@ -291,6 +291,7 @@ type RadioTypes = {
|
|
|
291
291
|
onChangeTab?: any;
|
|
292
292
|
defaultValue?: any;
|
|
293
293
|
direction?: "rtl" | "ltr";
|
|
294
|
+
helperText?: string;
|
|
294
295
|
};
|
|
295
296
|
declare const Radio: FC<RadioTypes>;
|
|
296
297
|
|
|
@@ -1191,12 +1192,14 @@ type ComponentTypes$2 = {
|
|
|
1191
1192
|
description?: string;
|
|
1192
1193
|
tag?: any;
|
|
1193
1194
|
options?: RadioOptionsTypes[];
|
|
1194
|
-
texts?: {
|
|
1195
|
-
least: string;
|
|
1196
|
-
most: string;
|
|
1197
|
-
};
|
|
1198
1195
|
position?: "bottom-right" | "bottom-left";
|
|
1199
1196
|
onOptionClicked?: (option: any) => void;
|
|
1197
|
+
direction?: "rtl" | "ltr";
|
|
1198
|
+
texts?: {
|
|
1199
|
+
pleaseSelectOption: string;
|
|
1200
|
+
textTooShort: string;
|
|
1201
|
+
submit?: string;
|
|
1202
|
+
};
|
|
1200
1203
|
};
|
|
1201
1204
|
declare const UserReferralSource: FC<ComponentTypes$2>;
|
|
1202
1205
|
|
package/dist/index.js
CHANGED
|
@@ -1428,7 +1428,7 @@ var ItemCard = function(_param) {
|
|
|
1428
1428
|
className: "hawa-relative hawa-w-full hawa-p-4 xs:hawa-p-6 xs:hawa-pb-2 xs:hawa-px-2"
|
|
1429
1429
|
}, headerActions && /* @__PURE__ */ import_react6.default.createElement("div", {
|
|
1430
1430
|
className: "hawa-absolute hawa-right-0 hawa-top-0 hawa-flex hawa-justify-end hawa-pr-3 hawa-pt-3"
|
|
1431
|
-
}, /* @__PURE__ */ import_react6.default.createElement(DropdownMenu, {
|
|
1431
|
+
}, /* @__PURE__ */ import_react6.default.createElement(StopPropagationWrapper, null, /* @__PURE__ */ import_react6.default.createElement(DropdownMenu, {
|
|
1432
1432
|
items: headerActions,
|
|
1433
1433
|
trigger: /* @__PURE__ */ import_react6.default.createElement(Button, {
|
|
1434
1434
|
variant: "ghost",
|
|
@@ -1444,7 +1444,7 @@ var ItemCard = function(_param) {
|
|
|
1444
1444
|
}, /* @__PURE__ */ import_react6.default.createElement("path", {
|
|
1445
1445
|
d: "M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z"
|
|
1446
1446
|
})))
|
|
1447
|
-
})), /* @__PURE__ */ import_react6.default.createElement("div", {
|
|
1447
|
+
}))), /* @__PURE__ */ import_react6.default.createElement("div", {
|
|
1448
1448
|
className: " hawa-mx-2"
|
|
1449
1449
|
}, header && /* @__PURE__ */ import_react6.default.createElement("h5", {
|
|
1450
1450
|
className: "hawa-mb-2 hawa-text-2xl hawa-font-bold hawa-tracking-tight "
|
|
@@ -2246,12 +2246,18 @@ var Radio = function(_param) {
|
|
|
2246
2246
|
id: opt.value.toString(),
|
|
2247
2247
|
type: "radio",
|
|
2248
2248
|
value: opt.value,
|
|
2249
|
-
name: "default-radio"
|
|
2249
|
+
name: "default-radio",
|
|
2250
|
+
onChange: function() {
|
|
2251
|
+
setSelectedOption(opt.value);
|
|
2252
|
+
props.onChangeTab(opt.value);
|
|
2253
|
+
}
|
|
2250
2254
|
}), /* @__PURE__ */ import_react13.default.createElement("label", {
|
|
2251
2255
|
htmlFor: opt.value.toString(),
|
|
2252
2256
|
className: cn("hawa-text-sm hawa-font-medium dark:hawa-text-white", opt.disabled ? "hawa-text-gray-400" : "hawa-cursor-pointer hawa-text-gray-900")
|
|
2253
2257
|
}, opt.label));
|
|
2254
|
-
})
|
|
2258
|
+
}), props.helperText && /* @__PURE__ */ import_react13.default.createElement("p", {
|
|
2259
|
+
className: "hawa-text-xs hawa-text-helper-color"
|
|
2260
|
+
}, props.helperText));
|
|
2255
2261
|
}
|
|
2256
2262
|
};
|
|
2257
2263
|
// components/elements/Skeleton.tsx
|
|
@@ -7700,17 +7706,27 @@ var CodeConfirmation = function(props) {
|
|
|
7700
7706
|
};
|
|
7701
7707
|
// components/blocks/feedback/UserReferralSource.tsx
|
|
7702
7708
|
var import_react45 = __toESM(require("react"));
|
|
7703
|
-
var
|
|
7709
|
+
var import_react_hook_form6 = require("react-hook-form");
|
|
7710
|
+
var import_zod6 = require("@hookform/resolvers/zod");
|
|
7711
|
+
var z6 = __toESM(require("zod"));
|
|
7704
7712
|
var UserReferralSource = function(_param) {
|
|
7705
7713
|
var _param_position = _param.position, position = _param_position === void 0 ? "bottom-right" : _param_position, _param_options = _param.options, options = _param_options === void 0 ? [] : _param_options, props = _object_without_properties(_param, [
|
|
7706
7714
|
"position",
|
|
7707
7715
|
"options"
|
|
7708
7716
|
]);
|
|
7717
|
+
var _props_texts, _props_texts1;
|
|
7709
7718
|
var _ref = _sliced_to_array((0, import_react45.useState)(false), 2), closed = _ref[0], setClosed = _ref[1];
|
|
7710
|
-
var _ref1 = _sliced_to_array((0, import_react45.useState)(
|
|
7711
|
-
var _ref2 = _sliced_to_array((0, import_react45.useState)(null), 2), clickedOption = _ref2[0], setClickedOption = _ref2[1];
|
|
7712
|
-
var _ref3 = _sliced_to_array((0, import_react45.useState)(5), 2), closingTimer = _ref3[0], setClosingTimer = _ref3[1];
|
|
7719
|
+
var _ref1 = _sliced_to_array((0, import_react45.useState)(5), 2), closingTimer = _ref1[0], setClosingTimer = _ref1[1];
|
|
7713
7720
|
var popUpRef = (0, import_react45.useRef)(null);
|
|
7721
|
+
var formSchema = z6.object({
|
|
7722
|
+
source: z6.string({
|
|
7723
|
+
required_error: (_props_texts = props.texts) === null || _props_texts === void 0 ? void 0 : _props_texts.pleaseSelectOption
|
|
7724
|
+
}),
|
|
7725
|
+
feedback: z6.string().optional()
|
|
7726
|
+
});
|
|
7727
|
+
var _ref2 = (0, import_react_hook_form6.useForm)({
|
|
7728
|
+
resolver: (0, import_zod6.zodResolver)(formSchema)
|
|
7729
|
+
}), handleSubmit = _ref2.handleSubmit, control = _ref2.control, formState = _ref2.formState;
|
|
7714
7730
|
var boxPosition = {
|
|
7715
7731
|
"bottom-right": "hawa-right-4",
|
|
7716
7732
|
"bottom-left": "hawa-left-4"
|
|
@@ -7737,10 +7753,11 @@ var UserReferralSource = function(_param) {
|
|
|
7737
7753
|
};
|
|
7738
7754
|
return /* @__PURE__ */ import_react45.default.createElement(Card, {
|
|
7739
7755
|
ref: popUpRef,
|
|
7740
|
-
className: (
|
|
7756
|
+
className: cn("hawa-fixed hawa-bottom-4 hawa-p-0 ", boxPosition[position]),
|
|
7757
|
+
dir: props.direction
|
|
7741
7758
|
}, /* @__PURE__ */ import_react45.default.createElement("button", {
|
|
7742
7759
|
type: "button",
|
|
7743
|
-
className: "hawa-
|
|
7760
|
+
className: cn(props.direction === "rtl" ? "hawa-left-2" : "hawa-right-2", "hawa-absolute hawa-top-2 hawa-inline-flex hawa-h-8 hawa-w-8 hawa-rounded hawa-p-1.5 hawa-text-gray-400 hawa-transition-all hover:hawa-bg-gray-100 hover:hawa-text-gray-900 focus:hawa-ring-2 focus:hawa-ring-gray-300 dark:hawa-bg-gray-800 dark:hawa-text-gray-500 dark:hover:hawa-bg-gray-700 dark:hover:hawa-text-white"),
|
|
7744
7761
|
"data-dismiss-target": "#toast-default",
|
|
7745
7762
|
"aria-label": "Close",
|
|
7746
7763
|
onClick: function() {
|
|
@@ -7757,22 +7774,51 @@ var UserReferralSource = function(_param) {
|
|
|
7757
7774
|
clipRule: "evenodd"
|
|
7758
7775
|
}))), /* @__PURE__ */ import_react45.default.createElement(CardContent, {
|
|
7759
7776
|
headless: true
|
|
7777
|
+
}, /* @__PURE__ */ import_react45.default.createElement("form", {
|
|
7778
|
+
onSubmit: handleSubmit(function(e) {
|
|
7779
|
+
return console.log("e is ", e);
|
|
7780
|
+
})
|
|
7760
7781
|
}, /* @__PURE__ */ import_react45.default.createElement("div", {
|
|
7761
|
-
className: (
|
|
7782
|
+
className: cn("hawa-flex hawa-flex-col hawa-gap-4", closed ? "hawa-opacity-0" : "hawa-opacity-100")
|
|
7762
7783
|
}, /* @__PURE__ */ import_react45.default.createElement("div", {
|
|
7763
7784
|
className: "hawa-mt-4 hawa-font-bold"
|
|
7764
7785
|
}, props.question), /* @__PURE__ */ import_react45.default.createElement("div", {
|
|
7765
7786
|
className: "hawa-flex hawa-w-full hawa-flex-row hawa-gap-1 hawa-rounded "
|
|
7766
|
-
}, /* @__PURE__ */ import_react45.default.createElement(
|
|
7767
|
-
|
|
7768
|
-
|
|
7769
|
-
|
|
7787
|
+
}, /* @__PURE__ */ import_react45.default.createElement(import_react_hook_form6.Controller, {
|
|
7788
|
+
control: control,
|
|
7789
|
+
name: "source",
|
|
7790
|
+
render: function(param) {
|
|
7791
|
+
var field = param.field;
|
|
7792
|
+
var _formState_errors_source_message, _formState_errors_source;
|
|
7793
|
+
return /* @__PURE__ */ import_react45.default.createElement(Radio, {
|
|
7794
|
+
direction: props.direction,
|
|
7795
|
+
orientation: "vertical",
|
|
7796
|
+
options: options,
|
|
7797
|
+
defaultValue: field.value,
|
|
7798
|
+
onChangeTab: function(e) {
|
|
7799
|
+
return field.onChange(e);
|
|
7800
|
+
},
|
|
7801
|
+
helperText: (_formState_errors_source = formState.errors.source) === null || _formState_errors_source === void 0 ? void 0 : (_formState_errors_source_message = _formState_errors_source.message) === null || _formState_errors_source_message === void 0 ? void 0 : _formState_errors_source_message.toString()
|
|
7802
|
+
});
|
|
7803
|
+
}
|
|
7804
|
+
})), /* @__PURE__ */ import_react45.default.createElement("div", null, /* @__PURE__ */ import_react45.default.createElement(import_react_hook_form6.Controller, {
|
|
7805
|
+
control: control,
|
|
7806
|
+
name: "feedback",
|
|
7807
|
+
render: function(param) {
|
|
7808
|
+
var field = param.field;
|
|
7809
|
+
var _formState_errors_feedback_message, _formState_errors_feedback;
|
|
7810
|
+
return /* @__PURE__ */ import_react45.default.createElement(Textarea, _object_spread_props(_object_spread({}, field), {
|
|
7811
|
+
helperText: (_formState_errors_feedback = formState.errors.feedback) === null || _formState_errors_feedback === void 0 ? void 0 : (_formState_errors_feedback_message = _formState_errors_feedback.message) === null || _formState_errors_feedback_message === void 0 ? void 0 : _formState_errors_feedback_message.toString()
|
|
7812
|
+
}));
|
|
7813
|
+
}
|
|
7814
|
+
}))), /* @__PURE__ */ import_react45.default.createElement(Button, {
|
|
7815
|
+
type: "submit",
|
|
7770
7816
|
className: "hawa-mt-4 hawa-w-full"
|
|
7771
|
-
}, "Submit")));
|
|
7817
|
+
}, ((_props_texts1 = props.texts) === null || _props_texts1 === void 0 ? void 0 : _props_texts1.submit) || "Submit"))));
|
|
7772
7818
|
};
|
|
7773
7819
|
// components/blocks/feedback/FeedbackRating.tsx
|
|
7774
7820
|
var import_react46 = __toESM(require("react"));
|
|
7775
|
-
var
|
|
7821
|
+
var import_clsx12 = __toESM(require("clsx"));
|
|
7776
7822
|
var FeedbackRating = function(_param) {
|
|
7777
7823
|
var _param_position = _param.position, position = _param_position === void 0 ? "bottom-right" : _param_position, props = _object_without_properties(_param, [
|
|
7778
7824
|
"position"
|
|
@@ -7808,9 +7854,9 @@ var FeedbackRating = function(_param) {
|
|
|
7808
7854
|
};
|
|
7809
7855
|
return /* @__PURE__ */ import_react46.default.createElement("div", {
|
|
7810
7856
|
ref: popUpRef,
|
|
7811
|
-
className: (0,
|
|
7857
|
+
className: (0, import_clsx12.default)(props.banner ? "hawa-w-full hawa-left-0 hawa-fixed hawa-bottom-0 hawa-px-0 md:hawa-px-4" : "hawa-fixed hawa-bottom-4 ", boxPosition[position])
|
|
7812
7858
|
}, /* @__PURE__ */ import_react46.default.createElement("div", {
|
|
7813
|
-
className: (0,
|
|
7859
|
+
className: (0, import_clsx12.default)("hawa-relative hawa-flex hawa-w-full hawa-flex-col hawa-gap-2 hawa-rounded hawa-border hawa-bg-background hawa-p-4 hawa-shadow-md hawa-transition-all", closed ? "hawa-opacity-0" : "hawa-opacity-100", props.banner && "hawa-rounded-none md:hawa-rounded hawa-px-4 md:hawa-px-64")
|
|
7814
7860
|
}, /* @__PURE__ */ import_react46.default.createElement("div", {
|
|
7815
7861
|
className: "hawa-absolute hawa-left-2 hawa-top-2 hawa-p-1.5 hawa-text-sm"
|
|
7816
7862
|
}, props.title), /* @__PURE__ */ import_react46.default.createElement("button", {
|
|
@@ -7852,7 +7898,7 @@ var FeedbackRating = function(_param) {
|
|
|
7852
7898
|
clearTimeout(timeoutDestroy);
|
|
7853
7899
|
}, 5300);
|
|
7854
7900
|
},
|
|
7855
|
-
className: (0,
|
|
7901
|
+
className: (0, import_clsx12.default)("hawa-w-full hawa-cursor-pointer hawa-rounded hawa-border hawa-p-4 hawa-text-center hawa-transition-all ", clickedOption === op ? "hawa-bg-gray-500 hawa-text-white" : "hawa-border hawa-bg-background hover:hawa-bg-gray-300 dark:hover:hawa-bg-gray-700")
|
|
7856
7902
|
}, op);
|
|
7857
7903
|
})), props.texts && /* @__PURE__ */ import_react46.default.createElement("div", {
|
|
7858
7904
|
className: " hawa-flex hawa-flex-row hawa-justify-between hawa-text-xs"
|
|
@@ -8097,25 +8143,25 @@ var VeryBadEmoji = function() {
|
|
|
8097
8143
|
};
|
|
8098
8144
|
// components/blocks/feedback/FeedbackForm.tsx
|
|
8099
8145
|
var import_react48 = __toESM(require("react"));
|
|
8100
|
-
var
|
|
8101
|
-
var
|
|
8102
|
-
var
|
|
8146
|
+
var import_react_hook_form7 = require("react-hook-form");
|
|
8147
|
+
var import_zod7 = require("@hookform/resolvers/zod");
|
|
8148
|
+
var z7 = __toESM(require("zod"));
|
|
8103
8149
|
var FeedbackForm = function(props) {
|
|
8104
8150
|
var _props_texts, _props_texts1;
|
|
8105
|
-
var formSchema =
|
|
8106
|
-
requestType:
|
|
8151
|
+
var formSchema = z7.object({
|
|
8152
|
+
requestType: z7.string({
|
|
8107
8153
|
required_error: props.texts.requestTypeRequired
|
|
8108
8154
|
}).nonempty({
|
|
8109
8155
|
message: props.texts.requestTypeRequired
|
|
8110
8156
|
}),
|
|
8111
|
-
description:
|
|
8157
|
+
description: z7.string({
|
|
8112
8158
|
required_error: props.texts.descriptionRequired
|
|
8113
8159
|
}).min(10, {
|
|
8114
8160
|
message: props.texts.descriptionTooShort
|
|
8115
8161
|
})
|
|
8116
8162
|
});
|
|
8117
|
-
var _ref = (0,
|
|
8118
|
-
resolver: (0,
|
|
8163
|
+
var _ref = (0, import_react_hook_form7.useForm)({
|
|
8164
|
+
resolver: (0, import_zod7.zodResolver)(formSchema)
|
|
8119
8165
|
}), handleSubmit = _ref.handleSubmit, control = _ref.control, formState = _ref.formState;
|
|
8120
8166
|
return /* @__PURE__ */ import_react48.default.createElement(Card, null, /* @__PURE__ */ import_react48.default.createElement(CardContent, {
|
|
8121
8167
|
headless: true
|
|
@@ -8128,7 +8174,7 @@ var FeedbackForm = function(props) {
|
|
|
8128
8174
|
}
|
|
8129
8175
|
}),
|
|
8130
8176
|
className: "hawa-flex hawa-flex-col hawa-gap-4"
|
|
8131
|
-
}, /* @__PURE__ */ import_react48.default.createElement(Label2, null, (_props_texts = props.texts) === null || _props_texts === void 0 ? void 0 : _props_texts.requestType), /* @__PURE__ */ import_react48.default.createElement(
|
|
8177
|
+
}, /* @__PURE__ */ import_react48.default.createElement(Label2, null, (_props_texts = props.texts) === null || _props_texts === void 0 ? void 0 : _props_texts.requestType), /* @__PURE__ */ import_react48.default.createElement(import_react_hook_form7.Controller, {
|
|
8132
8178
|
name: "requestType",
|
|
8133
8179
|
control: control,
|
|
8134
8180
|
render: function(param) {
|
|
@@ -8142,7 +8188,7 @@ var FeedbackForm = function(props) {
|
|
|
8142
8188
|
helperText: (_formState_errors_requestType = formState.errors.requestType) === null || _formState_errors_requestType === void 0 ? void 0 : (_formState_errors_requestType_message = _formState_errors_requestType.message) === null || _formState_errors_requestType_message === void 0 ? void 0 : _formState_errors_requestType_message.toString()
|
|
8143
8189
|
}));
|
|
8144
8190
|
}
|
|
8145
|
-
}), /* @__PURE__ */ import_react48.default.createElement(Label2, null, props.texts.description), /* @__PURE__ */ import_react48.default.createElement(
|
|
8191
|
+
}), /* @__PURE__ */ import_react48.default.createElement(Label2, null, props.texts.description), /* @__PURE__ */ import_react48.default.createElement(import_react_hook_form7.Controller, {
|
|
8146
8192
|
name: "description",
|
|
8147
8193
|
control: control,
|
|
8148
8194
|
render: function(param) {
|
|
@@ -8243,10 +8289,10 @@ var Testimonial = function(props) {
|
|
|
8243
8289
|
};
|
|
8244
8290
|
// components/blocks/misc/LeadGenerator.tsx
|
|
8245
8291
|
var import_react52 = __toESM(require("react"));
|
|
8246
|
-
var
|
|
8292
|
+
var import_react_hook_form8 = require("react-hook-form");
|
|
8247
8293
|
var LeadGenerator = function(param) {
|
|
8248
8294
|
var texts = param.texts, submitHandler = param.submitHandler;
|
|
8249
|
-
var _ref = (0,
|
|
8295
|
+
var _ref = (0, import_react_hook_form8.useForm)(), handleSubmit = _ref.handleSubmit, control = _ref.control, formState = _ref.formState;
|
|
8250
8296
|
var onSubmit = function(data) {
|
|
8251
8297
|
if (submitHandler) {
|
|
8252
8298
|
submitHandler(data.email);
|
|
@@ -8258,7 +8304,7 @@ var LeadGenerator = function(param) {
|
|
|
8258
8304
|
return /* @__PURE__ */ import_react52.default.createElement(Card, null, /* @__PURE__ */ import_react52.default.createElement(CardHeader, null, /* @__PURE__ */ import_react52.default.createElement(CardTitle, null, texts === null || texts === void 0 ? void 0 : texts.title), /* @__PURE__ */ import_react52.default.createElement(CardDescription, null, texts === null || texts === void 0 ? void 0 : texts.subtitle)), /* @__PURE__ */ import_react52.default.createElement(CardContent, null, /* @__PURE__ */ import_react52.default.createElement("form", {
|
|
8259
8305
|
className: "hawa-flex hawa-flex-row hawa-gap-2",
|
|
8260
8306
|
onSubmit: handleSubmit(onSubmit)
|
|
8261
|
-
}, /* @__PURE__ */ import_react52.default.createElement(
|
|
8307
|
+
}, /* @__PURE__ */ import_react52.default.createElement(import_react_hook_form8.Controller, {
|
|
8262
8308
|
name: "email",
|
|
8263
8309
|
control: control,
|
|
8264
8310
|
rules: {
|
|
@@ -8498,7 +8544,7 @@ var ComparingPlans = function(props) {
|
|
|
8498
8544
|
};
|
|
8499
8545
|
// components/blocks/pricing/HorizontalPricing.tsx
|
|
8500
8546
|
var import_react58 = __toESM(require("react"));
|
|
8501
|
-
var
|
|
8547
|
+
var import_clsx13 = __toESM(require("clsx"));
|
|
8502
8548
|
var HorizontalPricing = function(props) {
|
|
8503
8549
|
var _ref = _sliced_to_array((0, import_react58.useState)(""), 2), selectedCard = _ref[0], setSelectedCard = _ref[1];
|
|
8504
8550
|
var data = [
|
|
@@ -8546,7 +8592,7 @@ var HorizontalPricing = function(props) {
|
|
|
8546
8592
|
id: d.title,
|
|
8547
8593
|
className: "hawa-peer hawa-appearance-none"
|
|
8548
8594
|
}), /* @__PURE__ */ import_react58.default.createElement("div", {
|
|
8549
|
-
className: (0,
|
|
8595
|
+
className: (0, import_clsx13.default)(selectedCard === d.title ? "peer-checked:hawa-border-blue-500" : "", "hawa-peer hawa-flex hawa-cursor-pointer hawa-items-center hawa-justify-between hawa-rounded-xl hawa-border hawa-bg-background hawa-px-5 hawa-py-4 hawa-shadow dark:hawa-text-white peer-checked:[&_.active]:hawa-block peer-checked:[&_.default]:hawa-hidden")
|
|
8550
8596
|
}, /* @__PURE__ */ import_react58.default.createElement("div", {
|
|
8551
8597
|
className: "hawa-peer hawa-flex hawa-items-center hawa-gap-4"
|
|
8552
8598
|
}, /* @__PURE__ */ import_react58.default.createElement(CheckIcons, null), /* @__PURE__ */ import_react58.default.createElement(CardText, {
|
package/dist/index.mjs
CHANGED
|
@@ -812,7 +812,7 @@ var ItemCard = ({
|
|
|
812
812
|
clickableImageActionIcon,
|
|
813
813
|
clickableImageActionText
|
|
814
814
|
))),
|
|
815
|
-
/* @__PURE__ */ React9.createElement("div", { className: "hawa-relative hawa-w-full hawa-p-4 xs:hawa-p-6 xs:hawa-pb-2 xs:hawa-px-2" }, headerActions && /* @__PURE__ */ React9.createElement("div", { className: "hawa-absolute hawa-right-0 hawa-top-0 hawa-flex hawa-justify-end hawa-pr-3 hawa-pt-3" }, /* @__PURE__ */ React9.createElement(
|
|
815
|
+
/* @__PURE__ */ React9.createElement("div", { className: "hawa-relative hawa-w-full hawa-p-4 xs:hawa-p-6 xs:hawa-pb-2 xs:hawa-px-2" }, headerActions && /* @__PURE__ */ React9.createElement("div", { className: "hawa-absolute hawa-right-0 hawa-top-0 hawa-flex hawa-justify-end hawa-pr-3 hawa-pt-3" }, /* @__PURE__ */ React9.createElement(StopPropagationWrapper, null, /* @__PURE__ */ React9.createElement(
|
|
816
816
|
DropdownMenu,
|
|
817
817
|
{
|
|
818
818
|
items: headerActions,
|
|
@@ -836,7 +836,7 @@ var ItemCard = ({
|
|
|
836
836
|
)
|
|
837
837
|
)
|
|
838
838
|
}
|
|
839
|
-
)), /* @__PURE__ */ React9.createElement("div", { className: " hawa-mx-2" }, header && /* @__PURE__ */ React9.createElement("h5", { className: "hawa-mb-2 hawa-text-2xl hawa-font-bold hawa-tracking-tight " }, header), content && /* @__PURE__ */ React9.createElement("span", { className: "hawa-w-full hawa-font-normal " }, content)), actions || counts ? /* @__PURE__ */ React9.createElement(
|
|
839
|
+
))), /* @__PURE__ */ React9.createElement("div", { className: " hawa-mx-2" }, header && /* @__PURE__ */ React9.createElement("h5", { className: "hawa-mb-2 hawa-text-2xl hawa-font-bold hawa-tracking-tight " }, header), content && /* @__PURE__ */ React9.createElement("span", { className: "hawa-w-full hawa-font-normal " }, content)), actions || counts ? /* @__PURE__ */ React9.createElement(
|
|
840
840
|
"div",
|
|
841
841
|
{
|
|
842
842
|
className: clsx5(
|
|
@@ -1764,7 +1764,11 @@ var Radio = ({
|
|
|
1764
1764
|
id: opt.value.toString(),
|
|
1765
1765
|
type: "radio",
|
|
1766
1766
|
value: opt.value,
|
|
1767
|
-
name: "default-radio"
|
|
1767
|
+
name: "default-radio",
|
|
1768
|
+
onChange: () => {
|
|
1769
|
+
setSelectedOption(opt.value);
|
|
1770
|
+
props.onChangeTab(opt.value);
|
|
1771
|
+
}
|
|
1768
1772
|
}
|
|
1769
1773
|
),
|
|
1770
1774
|
/* @__PURE__ */ React20.createElement(
|
|
@@ -1778,7 +1782,7 @@ var Radio = ({
|
|
|
1778
1782
|
},
|
|
1779
1783
|
opt.label
|
|
1780
1784
|
)
|
|
1781
|
-
)));
|
|
1785
|
+
)), props.helperText && /* @__PURE__ */ React20.createElement("p", { className: "hawa-text-xs hawa-text-helper-color" }, props.helperText));
|
|
1782
1786
|
}
|
|
1783
1787
|
};
|
|
1784
1788
|
|
|
@@ -7621,17 +7625,24 @@ var CodeConfirmation = (props) => {
|
|
|
7621
7625
|
|
|
7622
7626
|
// components/blocks/feedback/UserReferralSource.tsx
|
|
7623
7627
|
import React64, { useEffect as useEffect15, useRef as useRef8, useState as useState25 } from "react";
|
|
7624
|
-
import
|
|
7628
|
+
import { Controller as Controller6, useForm as useForm6 } from "react-hook-form";
|
|
7629
|
+
import { zodResolver as zodResolver6 } from "@hookform/resolvers/zod";
|
|
7630
|
+
import * as z6 from "zod";
|
|
7625
7631
|
var UserReferralSource = ({
|
|
7626
7632
|
position = "bottom-right",
|
|
7627
7633
|
options = [],
|
|
7628
7634
|
...props
|
|
7629
7635
|
}) => {
|
|
7630
7636
|
const [closed, setClosed] = useState25(false);
|
|
7631
|
-
const [answered, setAnswered] = useState25(false);
|
|
7632
|
-
const [clickedOption, setClickedOption] = useState25(null);
|
|
7633
7637
|
const [closingTimer, setClosingTimer] = useState25(5);
|
|
7634
7638
|
const popUpRef = useRef8(null);
|
|
7639
|
+
const formSchema = z6.object({
|
|
7640
|
+
source: z6.string({ required_error: props.texts?.pleaseSelectOption }),
|
|
7641
|
+
feedback: z6.string().optional()
|
|
7642
|
+
});
|
|
7643
|
+
const { handleSubmit, control, formState } = useForm6({
|
|
7644
|
+
resolver: zodResolver6(formSchema)
|
|
7645
|
+
});
|
|
7635
7646
|
const boxPosition = {
|
|
7636
7647
|
"bottom-right": "hawa-right-4",
|
|
7637
7648
|
"bottom-left": "hawa-left-4"
|
|
@@ -7658,16 +7669,20 @@ var UserReferralSource = ({
|
|
|
7658
7669
|
Card,
|
|
7659
7670
|
{
|
|
7660
7671
|
ref: popUpRef,
|
|
7661
|
-
className:
|
|
7672
|
+
className: cn(
|
|
7662
7673
|
"hawa-fixed hawa-bottom-4 hawa-p-0 ",
|
|
7663
7674
|
boxPosition[position]
|
|
7664
|
-
)
|
|
7675
|
+
),
|
|
7676
|
+
dir: props.direction
|
|
7665
7677
|
},
|
|
7666
7678
|
/* @__PURE__ */ React64.createElement(
|
|
7667
7679
|
"button",
|
|
7668
7680
|
{
|
|
7669
7681
|
type: "button",
|
|
7670
|
-
className:
|
|
7682
|
+
className: cn(
|
|
7683
|
+
props.direction === "rtl" ? "hawa-left-2" : "hawa-right-2",
|
|
7684
|
+
"hawa-absolute hawa-top-2 hawa-inline-flex hawa-h-8 hawa-w-8 hawa-rounded hawa-p-1.5 hawa-text-gray-400 hawa-transition-all hover:hawa-bg-gray-100 hover:hawa-text-gray-900 focus:hawa-ring-2 focus:hawa-ring-gray-300 dark:hawa-bg-gray-800 dark:hawa-text-gray-500 dark:hover:hawa-bg-gray-700 dark:hover:hawa-text-white"
|
|
7685
|
+
),
|
|
7671
7686
|
"data-dismiss-target": "#toast-default",
|
|
7672
7687
|
"aria-label": "Close",
|
|
7673
7688
|
onClick: () => slowClose()
|
|
@@ -7690,24 +7705,54 @@ var UserReferralSource = ({
|
|
|
7690
7705
|
)
|
|
7691
7706
|
)
|
|
7692
7707
|
),
|
|
7693
|
-
/* @__PURE__ */ React64.createElement(CardContent, { headless: true }, /* @__PURE__ */ React64.createElement(
|
|
7708
|
+
/* @__PURE__ */ React64.createElement(CardContent, { headless: true }, /* @__PURE__ */ React64.createElement("form", { onSubmit: handleSubmit((e) => console.log("e is ", e)) }, /* @__PURE__ */ React64.createElement(
|
|
7694
7709
|
"div",
|
|
7695
7710
|
{
|
|
7696
|
-
className:
|
|
7711
|
+
className: cn(
|
|
7697
7712
|
"hawa-flex hawa-flex-col hawa-gap-4",
|
|
7698
7713
|
closed ? "hawa-opacity-0" : "hawa-opacity-100"
|
|
7699
7714
|
)
|
|
7700
7715
|
},
|
|
7701
7716
|
/* @__PURE__ */ React64.createElement("div", { className: "hawa-mt-4 hawa-font-bold" }, props.question),
|
|
7702
|
-
/* @__PURE__ */ React64.createElement("div", { className: "hawa-flex hawa-w-full hawa-flex-row hawa-gap-1 hawa-rounded " }, /* @__PURE__ */ React64.createElement(
|
|
7703
|
-
|
|
7704
|
-
|
|
7717
|
+
/* @__PURE__ */ React64.createElement("div", { className: "hawa-flex hawa-w-full hawa-flex-row hawa-gap-1 hawa-rounded " }, /* @__PURE__ */ React64.createElement(
|
|
7718
|
+
Controller6,
|
|
7719
|
+
{
|
|
7720
|
+
control,
|
|
7721
|
+
name: "source",
|
|
7722
|
+
render: ({ field }) => /* @__PURE__ */ React64.createElement(
|
|
7723
|
+
Radio,
|
|
7724
|
+
{
|
|
7725
|
+
direction: props.direction,
|
|
7726
|
+
orientation: "vertical",
|
|
7727
|
+
options,
|
|
7728
|
+
defaultValue: field.value,
|
|
7729
|
+
onChangeTab: (e) => field.onChange(e),
|
|
7730
|
+
helperText: formState.errors.source?.message?.toString()
|
|
7731
|
+
}
|
|
7732
|
+
)
|
|
7733
|
+
}
|
|
7734
|
+
)),
|
|
7735
|
+
/* @__PURE__ */ React64.createElement("div", null, /* @__PURE__ */ React64.createElement(
|
|
7736
|
+
Controller6,
|
|
7737
|
+
{
|
|
7738
|
+
control,
|
|
7739
|
+
name: "feedback",
|
|
7740
|
+
render: ({ field }) => /* @__PURE__ */ React64.createElement(
|
|
7741
|
+
Textarea,
|
|
7742
|
+
{
|
|
7743
|
+
...field,
|
|
7744
|
+
helperText: formState.errors.feedback?.message?.toString()
|
|
7745
|
+
}
|
|
7746
|
+
)
|
|
7747
|
+
}
|
|
7748
|
+
))
|
|
7749
|
+
), /* @__PURE__ */ React64.createElement(Button, { type: "submit", className: "hawa-mt-4 hawa-w-full" }, props.texts?.submit || "Submit")))
|
|
7705
7750
|
);
|
|
7706
7751
|
};
|
|
7707
7752
|
|
|
7708
7753
|
// components/blocks/feedback/FeedbackRating.tsx
|
|
7709
7754
|
import React65, { useEffect as useEffect16, useRef as useRef9, useState as useState26 } from "react";
|
|
7710
|
-
import
|
|
7755
|
+
import clsx12 from "clsx";
|
|
7711
7756
|
var FeedbackRating = ({
|
|
7712
7757
|
position = "bottom-right",
|
|
7713
7758
|
...props
|
|
@@ -7743,7 +7788,7 @@ var FeedbackRating = ({
|
|
|
7743
7788
|
"div",
|
|
7744
7789
|
{
|
|
7745
7790
|
ref: popUpRef,
|
|
7746
|
-
className:
|
|
7791
|
+
className: clsx12(
|
|
7747
7792
|
props.banner ? "hawa-w-full hawa-left-0 hawa-fixed hawa-bottom-0 hawa-px-0 md:hawa-px-4" : "hawa-fixed hawa-bottom-4 ",
|
|
7748
7793
|
boxPosition[position]
|
|
7749
7794
|
)
|
|
@@ -7751,7 +7796,7 @@ var FeedbackRating = ({
|
|
|
7751
7796
|
/* @__PURE__ */ React65.createElement(
|
|
7752
7797
|
"div",
|
|
7753
7798
|
{
|
|
7754
|
-
className:
|
|
7799
|
+
className: clsx12(
|
|
7755
7800
|
"hawa-relative hawa-flex hawa-w-full hawa-flex-col hawa-gap-2 hawa-rounded hawa-border hawa-bg-background hawa-p-4 hawa-shadow-md hawa-transition-all",
|
|
7756
7801
|
closed ? "hawa-opacity-0" : "hawa-opacity-100",
|
|
7757
7802
|
props.banner && "hawa-rounded-none md:hawa-rounded hawa-px-4 md:hawa-px-64"
|
|
@@ -7806,7 +7851,7 @@ var FeedbackRating = ({
|
|
|
7806
7851
|
clearTimeout(timeoutDestroy);
|
|
7807
7852
|
}, 5300);
|
|
7808
7853
|
},
|
|
7809
|
-
className:
|
|
7854
|
+
className: clsx12(
|
|
7810
7855
|
"hawa-w-full hawa-cursor-pointer hawa-rounded hawa-border hawa-p-4 hawa-text-center hawa-transition-all ",
|
|
7811
7856
|
clickedOption === op ? "hawa-bg-gray-500 hawa-text-white" : "hawa-border hawa-bg-background hover:hawa-bg-gray-300 dark:hover:hawa-bg-gray-700"
|
|
7812
7857
|
)
|
|
@@ -8025,16 +8070,16 @@ var VeryBadEmoji = () => /* @__PURE__ */ React66.createElement(
|
|
|
8025
8070
|
|
|
8026
8071
|
// components/blocks/feedback/FeedbackForm.tsx
|
|
8027
8072
|
import React67 from "react";
|
|
8028
|
-
import { useForm as
|
|
8029
|
-
import { zodResolver as
|
|
8030
|
-
import * as
|
|
8073
|
+
import { useForm as useForm7, Controller as Controller7 } from "react-hook-form";
|
|
8074
|
+
import { zodResolver as zodResolver7 } from "@hookform/resolvers/zod";
|
|
8075
|
+
import * as z7 from "zod";
|
|
8031
8076
|
var FeedbackForm = (props) => {
|
|
8032
|
-
const formSchema =
|
|
8033
|
-
requestType:
|
|
8034
|
-
description:
|
|
8077
|
+
const formSchema = z7.object({
|
|
8078
|
+
requestType: z7.string({ required_error: props.texts.requestTypeRequired }).nonempty({ message: props.texts.requestTypeRequired }),
|
|
8079
|
+
description: z7.string({ required_error: props.texts.descriptionRequired }).min(10, { message: props.texts.descriptionTooShort })
|
|
8035
8080
|
});
|
|
8036
|
-
const { handleSubmit, control, formState } =
|
|
8037
|
-
resolver:
|
|
8081
|
+
const { handleSubmit, control, formState } = useForm7({
|
|
8082
|
+
resolver: zodResolver7(formSchema)
|
|
8038
8083
|
});
|
|
8039
8084
|
return /* @__PURE__ */ React67.createElement(Card, null, /* @__PURE__ */ React67.createElement(CardContent, { headless: true }, /* @__PURE__ */ React67.createElement(
|
|
8040
8085
|
"form",
|
|
@@ -8050,7 +8095,7 @@ var FeedbackForm = (props) => {
|
|
|
8050
8095
|
},
|
|
8051
8096
|
/* @__PURE__ */ React67.createElement(Label2, null, props.texts?.requestType),
|
|
8052
8097
|
/* @__PURE__ */ React67.createElement(
|
|
8053
|
-
|
|
8098
|
+
Controller7,
|
|
8054
8099
|
{
|
|
8055
8100
|
name: "requestType",
|
|
8056
8101
|
control,
|
|
@@ -8067,7 +8112,7 @@ var FeedbackForm = (props) => {
|
|
|
8067
8112
|
),
|
|
8068
8113
|
/* @__PURE__ */ React67.createElement(Label2, null, props.texts.description),
|
|
8069
8114
|
/* @__PURE__ */ React67.createElement(
|
|
8070
|
-
|
|
8115
|
+
Controller7,
|
|
8071
8116
|
{
|
|
8072
8117
|
name: "description",
|
|
8073
8118
|
control,
|
|
@@ -8146,9 +8191,9 @@ var Testimonial = (props) => {
|
|
|
8146
8191
|
|
|
8147
8192
|
// components/blocks/misc/LeadGenerator.tsx
|
|
8148
8193
|
import React71 from "react";
|
|
8149
|
-
import { useForm as
|
|
8194
|
+
import { useForm as useForm8, Controller as Controller8 } from "react-hook-form";
|
|
8150
8195
|
var LeadGenerator = ({ texts, submitHandler }) => {
|
|
8151
|
-
const { handleSubmit, control, formState } =
|
|
8196
|
+
const { handleSubmit, control, formState } = useForm8();
|
|
8152
8197
|
const onSubmit = (data) => {
|
|
8153
8198
|
if (submitHandler) {
|
|
8154
8199
|
submitHandler(data.email);
|
|
@@ -8163,7 +8208,7 @@ var LeadGenerator = ({ texts, submitHandler }) => {
|
|
|
8163
8208
|
onSubmit: handleSubmit(onSubmit)
|
|
8164
8209
|
},
|
|
8165
8210
|
/* @__PURE__ */ React71.createElement(
|
|
8166
|
-
|
|
8211
|
+
Controller8,
|
|
8167
8212
|
{
|
|
8168
8213
|
name: "email",
|
|
8169
8214
|
control,
|
|
@@ -8382,7 +8427,7 @@ var ComparingPlans = (props) => {
|
|
|
8382
8427
|
|
|
8383
8428
|
// components/blocks/pricing/HorizontalPricing.tsx
|
|
8384
8429
|
import React77, { useState as useState29 } from "react";
|
|
8385
|
-
import
|
|
8430
|
+
import clsx13 from "clsx";
|
|
8386
8431
|
var HorizontalPricing = (props) => {
|
|
8387
8432
|
const [selectedCard, setSelectedCard] = useState29("");
|
|
8388
8433
|
let data = [
|
|
@@ -8424,7 +8469,7 @@ var HorizontalPricing = (props) => {
|
|
|
8424
8469
|
/* @__PURE__ */ React77.createElement(
|
|
8425
8470
|
"div",
|
|
8426
8471
|
{
|
|
8427
|
-
className:
|
|
8472
|
+
className: clsx13(
|
|
8428
8473
|
selectedCard === d.title ? "peer-checked:hawa-border-blue-500" : "",
|
|
8429
8474
|
"hawa-peer hawa-flex hawa-cursor-pointer hawa-items-center hawa-justify-between hawa-rounded-xl hawa-border hawa-bg-background hawa-px-5 hawa-py-4 hawa-shadow dark:hawa-text-white peer-checked:[&_.active]:hawa-block peer-checked:[&_.default]:hawa-hidden"
|
|
8430
8475
|
)
|