@sikka/hawa 0.26.27 → 0.26.29
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/tooltip/index.js +1 -0
- package/dist/tooltip/index.js.map +1 -0
- package/dist/tooltip/index.mjs +1 -0
- package/dist/tooltip/index.mjs.map +1 -0
- package/package.json +1 -1
- package/dist/Chip-H5BnuDdx.d.ts +0 -36
- package/dist/Chip-hr2gRBJ-.d.mts +0 -36
- package/dist/DropdownMenu-EUL-D3I3.d.mts +0 -95
- package/dist/DropdownMenu-SPisqCzV.d.ts +0 -95
- package/dist/Radio-K1WGpnGA.d.ts +0 -75
- package/dist/Radio-hsrLKNxE.d.mts +0 -75
- package/dist/Toast-VBd4UvlM.d.mts +0 -26
- package/dist/Toast-pOd4uGZz.d.ts +0 -26
- package/dist/accordion/index.d.mts +0 -51
- package/dist/accordion/index.d.ts +0 -51
- package/dist/accordion/index.js +0 -271
- package/dist/accordion/index.mjs +0 -227
- package/dist/alert/index.d.mts +0 -29
- package/dist/alert/index.d.ts +0 -29
- package/dist/alert/index.js +0 -442
- package/dist/alert/index.mjs +0 -402
- package/dist/appLayout/index.d.mts +0 -126
- package/dist/appLayout/index.d.ts +0 -126
- package/dist/appLayout/index.js +0 -1326
- package/dist/appLayout/index.mjs +0 -1286
- package/dist/appMenubar/index.d.mts +0 -33
- package/dist/appMenubar/index.d.ts +0 -33
- package/dist/appMenubar/index.js +0 -281
- package/dist/appMenubar/index.mjs +0 -224
- package/dist/appStores/index.d.mts +0 -8
- package/dist/appStores/index.d.ts +0 -8
- package/dist/appStores/index.js +0 -75
- package/dist/appStores/index.mjs +0 -38
- package/dist/appTabs/index.d.mts +0 -18
- package/dist/appTabs/index.d.ts +0 -18
- package/dist/appTabs/index.js +0 -92
- package/dist/appTabs/index.mjs +0 -50
- package/dist/appTopbar/index.d.mts +0 -44
- package/dist/appTopbar/index.d.ts +0 -44
- package/dist/appTopbar/index.js +0 -483
- package/dist/appTopbar/index.mjs +0 -441
- package/dist/avatar/index.d.mts +0 -16
- package/dist/avatar/index.d.ts +0 -16
- package/dist/avatar/index.js +0 -162
- package/dist/avatar/index.mjs +0 -122
- package/dist/backToTop/index.d.mts +0 -15
- package/dist/backToTop/index.d.ts +0 -15
- package/dist/backToTop/index.js +0 -398
- package/dist/backToTop/index.mjs +0 -358
- package/dist/badge/index.d.mts +0 -13
- package/dist/badge/index.d.ts +0 -13
- package/dist/badge/index.js +0 -127
- package/dist/badge/index.mjs +0 -84
- package/dist/blocks/auth/index.d.mts +0 -202
- package/dist/blocks/auth/index.d.ts +0 -202
- package/dist/blocks/auth/index.js +0 -4197
- package/dist/blocks/auth/index.mjs +0 -3389
- package/dist/blocks/feedback/index.d.mts +0 -74
- package/dist/blocks/feedback/index.d.ts +0 -74
- package/dist/blocks/feedback/index.js +0 -1544
- package/dist/blocks/feedback/index.mjs +0 -558
- package/dist/blocks/index.d.mts +0 -480
- package/dist/blocks/index.d.ts +0 -480
- package/dist/blocks/index.js +0 -6700
- package/dist/blocks/index.mjs +0 -2550
- package/dist/blocks/misc/index.d.mts +0 -90
- package/dist/blocks/misc/index.d.ts +0 -90
- package/dist/blocks/misc/index.js +0 -1186
- package/dist/blocks/misc/index.mjs +0 -387
- package/dist/blocks/pricing/index.d.mts +0 -93
- package/dist/blocks/pricing/index.d.ts +0 -93
- package/dist/blocks/pricing/index.js +0 -1528
- package/dist/blocks/pricing/index.mjs +0 -677
- package/dist/breadcrumb/index.d.mts +0 -14
- package/dist/breadcrumb/index.d.ts +0 -14
- package/dist/breadcrumb/index.js +0 -63
- package/dist/breadcrumb/index.mjs +0 -26
- package/dist/button/index.d.mts +0 -16
- package/dist/button/index.d.ts +0 -16
- package/dist/button/index.js +0 -301
- package/dist/button/index.mjs +0 -260
- package/dist/card/index.d.mts +0 -17
- package/dist/card/index.d.ts +0 -17
- package/dist/card/index.js +0 -139
- package/dist/card/index.mjs +0 -92
- package/dist/carousel/index.d.mts +0 -15
- package/dist/carousel/index.d.ts +0 -15
- package/dist/carousel/index.js +0 -193
- package/dist/carousel/index.mjs +0 -151
- package/dist/checkbox/index.d.mts +0 -20
- package/dist/checkbox/index.d.ts +0 -20
- package/dist/checkbox/index.js +0 -184
- package/dist/checkbox/index.mjs +0 -142
- package/dist/chip/index.d.mts +0 -36
- package/dist/chip/index.d.ts +0 -36
- package/dist/chip/index.js +0 -129
- package/dist/chip/index.mjs +0 -87
- package/dist/chunk-2R7F2GL7.mjs +0 -82
- package/dist/chunk-4EGKGSGY.mjs +0 -129
- package/dist/chunk-5YXZXYLH.mjs +0 -67
- package/dist/chunk-65TG6EVD.mjs +0 -264
- package/dist/chunk-D22AALLE.mjs +0 -22
- package/dist/chunk-D36MPDGE.mjs +0 -476
- package/dist/chunk-F3DQJHTG.mjs +0 -3113
- package/dist/chunk-FQ6WVEHW.mjs +0 -151
- package/dist/chunk-GVJYACGA.mjs +0 -189
- package/dist/chunk-JNUGOUYJ.mjs +0 -154
- package/dist/chunk-KMCIHW76.mjs +0 -150
- package/dist/chunk-MQUAGP7K.mjs +0 -1098
- package/dist/chunk-NMS5LCSQ.mjs +0 -195
- package/dist/chunk-OY66MBXP.mjs +0 -163
- package/dist/chunk-R4HAAT6R.mjs +0 -131
- package/dist/chunk-SJ2Z6ZOG.mjs +0 -442
- package/dist/chunk-TGZRVRLP.mjs +0 -107
- package/dist/chunk-TWNGV3RE.mjs +0 -10
- package/dist/chunk-WUHNPHD5.mjs +0 -0
- package/dist/chunk-ZFXKCRJC.mjs +0 -11
- package/dist/chunk-ZS3FB3PO.mjs +0 -12
- package/dist/codeBlock/index.d.mts +0 -24
- package/dist/codeBlock/index.d.ts +0 -24
- package/dist/codeBlock/index.js +0 -517
- package/dist/codeBlock/index.mjs +0 -432
- package/dist/collapsible/index.d.mts +0 -8
- package/dist/collapsible/index.d.ts +0 -8
- package/dist/collapsible/index.js +0 -49
- package/dist/collapsible/index.mjs +0 -12
- package/dist/colorPicker/index.d.mts +0 -34
- package/dist/colorPicker/index.d.ts +0 -34
- package/dist/colorPicker/index.js +0 -276
- package/dist/colorPicker/index.mjs +0 -170
- package/dist/combobox/index.d.mts +0 -41
- package/dist/combobox/index.d.ts +0 -41
- package/dist/combobox/index.js +0 -749
- package/dist/combobox/index.mjs +0 -295
- package/dist/command/index.d.mts +0 -48
- package/dist/command/index.d.ts +0 -48
- package/dist/command/index.js +0 -485
- package/dist/command/index.mjs +0 -22
- package/dist/commonTypes-2IGtJ5cq.d.mts +0 -3
- package/dist/commonTypes-2IGtJ5cq.d.ts +0 -3
- package/dist/commonTypes-2k6FnHw5.d.mts +0 -4
- package/dist/commonTypes-2k6FnHw5.d.ts +0 -4
- package/dist/commonTypes-3k5cNB1s.d.mts +0 -4
- package/dist/commonTypes-3k5cNB1s.d.ts +0 -4
- package/dist/commonTypes-CKtkuNFH.d.mts +0 -11
- package/dist/commonTypes-CKtkuNFH.d.ts +0 -11
- package/dist/commonTypes-GhKAraJw.d.mts +0 -4
- package/dist/commonTypes-GhKAraJw.d.ts +0 -4
- package/dist/commonTypes-MxCJyrHv.d.mts +0 -8
- package/dist/commonTypes-MxCJyrHv.d.ts +0 -8
- package/dist/commonTypes-PBumfOBg.d.mts +0 -3
- package/dist/commonTypes-PBumfOBg.d.ts +0 -3
- package/dist/commonTypes-WPhcN3Vr.d.mts +0 -5
- package/dist/commonTypes-WPhcN3Vr.d.ts +0 -5
- package/dist/commonTypes-_11epZYh.d.mts +0 -4
- package/dist/commonTypes-_11epZYh.d.ts +0 -4
- package/dist/commonTypes-ko_NGEoT.d.mts +0 -3
- package/dist/commonTypes-ko_NGEoT.d.ts +0 -3
- package/dist/copyrights/index.d.mts +0 -17
- package/dist/copyrights/index.d.ts +0 -17
- package/dist/copyrights/index.js +0 -45
- package/dist/copyrights/index.mjs +0 -8
- package/dist/count/index.d.mts +0 -11
- package/dist/count/index.d.ts +0 -11
- package/dist/count/index.js +0 -45
- package/dist/count/index.mjs +0 -8
- package/dist/dataTable/index.d.mts +0 -41
- package/dist/dataTable/index.d.ts +0 -41
- package/dist/dataTable/index.js +0 -1313
- package/dist/dataTable/index.mjs +0 -1281
- package/dist/destroyableCard/index.d.mts +0 -12
- package/dist/destroyableCard/index.d.ts +0 -12
- package/dist/destroyableCard/index.js +0 -203
- package/dist/destroyableCard/index.mjs +0 -163
- package/dist/dialog/index.d.mts +0 -57
- package/dist/dialog/index.d.ts +0 -57
- package/dist/dialog/index.js +0 -368
- package/dist/dialog/index.mjs +0 -314
- package/dist/docsLayout/index.d.mts +0 -37
- package/dist/docsLayout/index.d.ts +0 -37
- package/dist/docsLayout/index.js +0 -927
- package/dist/docsLayout/index.mjs +0 -887
- package/dist/docsSidebar/index.d.mts +0 -11
- package/dist/docsSidebar/index.d.ts +0 -11
- package/dist/docsSidebar/index.js +0 -111
- package/dist/docsSidebar/index.mjs +0 -69
- package/dist/dropdownMenu/index.d.mts +0 -96
- package/dist/dropdownMenu/index.d.ts +0 -96
- package/dist/dropdownMenu/index.js +0 -420
- package/dist/dropdownMenu/index.mjs +0 -362
- package/dist/elements/index.d.mts +0 -788
- package/dist/elements/index.d.ts +0 -788
- package/dist/elements/index.js +0 -7832
- package/dist/elements/index.mjs +0 -3415
- package/dist/fileDropzone/index.d.mts +0 -37
- package/dist/fileDropzone/index.d.ts +0 -37
- package/dist/fileDropzone/index.js +0 -665
- package/dist/fileDropzone/index.mjs +0 -625
- package/dist/fileUploader/index.d.mts +0 -5
- package/dist/fileUploader/index.d.ts +0 -5
- package/dist/fileUploader/index.js +0 -62
- package/dist/fileUploader/index.mjs +0 -25
- package/dist/glow/index.d.mts +0 -16
- package/dist/glow/index.d.ts +0 -16
- package/dist/glow/index.js +0 -155
- package/dist/glow/index.mjs +0 -117
- package/dist/hooks/index.d.mts +0 -108
- package/dist/hooks/index.d.ts +0 -108
- package/dist/hooks/index.js +0 -459
- package/dist/hooks/index.mjs +0 -255
- package/dist/index.d.mts +0 -1932
- package/dist/index.d.ts +0 -1932
- package/dist/index.js +0 -12123
- package/dist/index.mjs +0 -11908
- package/dist/input/index.d.mts +0 -43
- package/dist/input/index.d.ts +0 -43
- package/dist/input/index.js +0 -293
- package/dist/input/index.mjs +0 -158
- package/dist/interfaceSettings/index.d.mts +0 -18
- package/dist/interfaceSettings/index.d.ts +0 -18
- package/dist/interfaceSettings/index.js +0 -420
- package/dist/interfaceSettings/index.mjs +0 -283
- package/dist/label/index.d.mts +0 -13
- package/dist/label/index.d.ts +0 -13
- package/dist/label/index.js +0 -142
- package/dist/label/index.mjs +0 -102
- package/dist/layout/index.d.mts +0 -256
- package/dist/layout/index.d.ts +0 -256
- package/dist/layout/index.js +0 -2627
- package/dist/layout/index.mjs +0 -1393
- package/dist/loading/index.d.mts +0 -15
- package/dist/loading/index.d.ts +0 -15
- package/dist/loading/index.js +0 -225
- package/dist/loading/index.mjs +0 -183
- package/dist/logos/index.d.mts +0 -27
- package/dist/logos/index.d.ts +0 -27
- package/dist/logos/index.js +0 -244
- package/dist/logos/index.mjs +0 -207
- package/dist/navbar/index.d.mts +0 -17
- package/dist/navbar/index.d.ts +0 -17
- package/dist/navbar/index.js +0 -166
- package/dist/navbar/index.mjs +0 -126
- package/dist/navigationMenu/index.d.mts +0 -39
- package/dist/navigationMenu/index.d.ts +0 -39
- package/dist/navigationMenu/index.js +0 -221
- package/dist/navigationMenu/index.mjs +0 -169
- package/dist/pagination/index.d.mts +0 -11
- package/dist/pagination/index.d.ts +0 -11
- package/dist/pagination/index.js +0 -160
- package/dist/pagination/index.mjs +0 -118
- package/dist/passwordInput/index.d.mts +0 -13
- package/dist/passwordInput/index.d.ts +0 -13
- package/dist/passwordInput/index.js +0 -577
- package/dist/passwordInput/index.mjs +0 -534
- package/dist/phoneInput/index.d.mts +0 -23
- package/dist/phoneInput/index.d.ts +0 -23
- package/dist/phoneInput/index.js +0 -2085
- package/dist/phoneInput/index.mjs +0 -2045
- package/dist/pinInput/index.d.mts +0 -20
- package/dist/pinInput/index.d.ts +0 -20
- package/dist/pinInput/index.js +0 -131
- package/dist/pinInput/index.mjs +0 -89
- package/dist/popover/index.d.mts +0 -23
- package/dist/popover/index.d.ts +0 -23
- package/dist/popover/index.js +0 -112
- package/dist/popover/index.mjs +0 -68
- package/dist/progress/index.d.mts +0 -6
- package/dist/progress/index.d.ts +0 -6
- package/dist/progress/index.js +0 -71
- package/dist/progress/index.mjs +0 -29
- package/dist/progressCircle/index.d.mts +0 -16
- package/dist/progressCircle/index.d.ts +0 -16
- package/dist/progressCircle/index.js +0 -159
- package/dist/progressCircle/index.mjs +0 -117
- package/dist/radio/index.d.mts +0 -39
- package/dist/radio/index.d.ts +0 -39
- package/dist/radio/index.js +0 -331
- package/dist/radio/index.mjs +0 -291
- package/dist/scrollArea/index.d.mts +0 -10
- package/dist/scrollArea/index.d.ts +0 -10
- package/dist/scrollArea/index.js +0 -90
- package/dist/scrollArea/index.mjs +0 -47
- package/dist/scrollIndicator/index.d.mts +0 -9
- package/dist/scrollIndicator/index.d.ts +0 -9
- package/dist/scrollIndicator/index.js +0 -80
- package/dist/scrollIndicator/index.mjs +0 -43
- package/dist/select/index.d.mts +0 -50
- package/dist/select/index.d.ts +0 -50
- package/dist/select/index.js +0 -325
- package/dist/select/index.mjs +0 -285
- package/dist/separator/index.d.mts +0 -10
- package/dist/separator/index.d.ts +0 -10
- package/dist/separator/index.js +0 -66
- package/dist/separator/index.mjs +0 -24
- package/dist/sheet/index.d.mts +0 -30
- package/dist/sheet/index.d.ts +0 -30
- package/dist/sheet/index.js +0 -201
- package/dist/sheet/index.mjs +0 -150
- package/dist/sidebar/index.d.mts +0 -48
- package/dist/sidebar/index.d.ts +0 -48
- package/dist/sidebar/index.js +0 -341
- package/dist/sidebar/index.mjs +0 -298
- package/dist/signature/index.d.mts +0 -27
- package/dist/signature/index.d.ts +0 -27
- package/dist/signature/index.js +0 -261
- package/dist/signature/index.mjs +0 -219
- package/dist/simpleTable/index.d.mts +0 -30
- package/dist/simpleTable/index.d.ts +0 -30
- package/dist/simpleTable/index.js +0 -253
- package/dist/simpleTable/index.mjs +0 -217
- package/dist/skeleton/index.d.mts +0 -10
- package/dist/skeleton/index.d.ts +0 -10
- package/dist/skeleton/index.js +0 -75
- package/dist/skeleton/index.mjs +0 -33
- package/dist/slider/index.d.mts +0 -6
- package/dist/slider/index.d.ts +0 -6
- package/dist/slider/index.js +0 -66
- package/dist/slider/index.mjs +0 -24
- package/dist/sortButton/index.d.mts +0 -10
- package/dist/sortButton/index.d.ts +0 -10
- package/dist/sortButton/index.js +0 -336
- package/dist/sortButton/index.mjs +0 -42
- package/dist/splitButton/index.d.mts +0 -52
- package/dist/splitButton/index.d.ts +0 -52
- package/dist/splitButton/index.js +0 -692
- package/dist/splitButton/index.mjs +0 -400
- package/dist/stats/index.d.mts +0 -19
- package/dist/stats/index.d.ts +0 -19
- package/dist/stats/index.js +0 -191
- package/dist/stats/index.mjs +0 -154
- package/dist/stopPropagationWrapper/index.d.mts +0 -5
- package/dist/stopPropagationWrapper/index.d.ts +0 -5
- package/dist/stopPropagationWrapper/index.js +0 -48
- package/dist/stopPropagationWrapper/index.mjs +0 -11
- package/dist/switch/index.d.mts +0 -12
- package/dist/switch/index.d.ts +0 -12
- package/dist/switch/index.js +0 -125
- package/dist/switch/index.mjs +0 -83
- package/dist/table/index.d.mts +0 -21
- package/dist/table/index.d.ts +0 -21
- package/dist/table/index.js +0 -172
- package/dist/table/index.mjs +0 -123
- package/dist/tabs/index.d.mts +0 -33
- package/dist/tabs/index.d.ts +0 -33
- package/dist/tabs/index.js +0 -200
- package/dist/tabs/index.mjs +0 -157
- package/dist/textTypes-559CaoOV.d.mts +0 -88
- package/dist/textTypes-559CaoOV.d.ts +0 -88
- package/dist/textarea/index.d.mts +0 -27
- package/dist/textarea/index.d.ts +0 -27
- package/dist/textarea/index.js +0 -229
- package/dist/textarea/index.mjs +0 -189
- package/dist/toast/index.d.mts +0 -26
- package/dist/toast/index.d.ts +0 -26
- package/dist/toast/index.js +0 -197
- package/dist/toast/index.mjs +0 -19
- package/dist/toaster/index.d.mts +0 -9
- package/dist/toaster/index.d.ts +0 -9
- package/dist/toaster/index.js +0 -350
- package/dist/toaster/index.mjs +0 -181
- package/dist/types/index.d.mts +0 -115
- package/dist/types/index.d.ts +0 -115
- package/dist/types/index.js +0 -18
- package/dist/types/index.mjs +0 -0
@@ -1,1544 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __create = Object.create;
|
3
|
-
var __defProp = Object.defineProperty;
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
8
|
-
var __export = (target, all) => {
|
9
|
-
for (var name in all)
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
11
|
-
};
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
14
|
-
for (let key of __getOwnPropNames(from))
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
17
|
-
}
|
18
|
-
return to;
|
19
|
-
};
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
26
|
-
mod
|
27
|
-
));
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
29
|
-
|
30
|
-
// blocks/feedback/index.ts
|
31
|
-
var feedback_exports = {};
|
32
|
-
__export(feedback_exports, {
|
33
|
-
FeedbackEmoji: () => FeedbackEmoji,
|
34
|
-
FeedbackForm: () => FeedbackForm,
|
35
|
-
FeedbackRating: () => FeedbackRating,
|
36
|
-
UserReferralSource: () => UserReferralSource
|
37
|
-
});
|
38
|
-
module.exports = __toCommonJS(feedback_exports);
|
39
|
-
|
40
|
-
// blocks/feedback/UserReferralSource.tsx
|
41
|
-
var import_react5 = __toESM(require("react"));
|
42
|
-
var import_react_hook_form = require("react-hook-form");
|
43
|
-
var import_zod = require("@hookform/resolvers/zod");
|
44
|
-
var z = __toESM(require("zod"));
|
45
|
-
|
46
|
-
// elements/button/Button.tsx
|
47
|
-
var React2 = __toESM(require("react"));
|
48
|
-
var import_class_variance_authority = require("class-variance-authority");
|
49
|
-
|
50
|
-
// util/index.ts
|
51
|
-
var import_clsx = require("clsx");
|
52
|
-
var import_tailwind_merge = require("tailwind-merge");
|
53
|
-
function cn(...inputs) {
|
54
|
-
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
|
55
|
-
}
|
56
|
-
|
57
|
-
// elements/loading/Loading.tsx
|
58
|
-
var import_react = __toESM(require("react"));
|
59
|
-
var Loading = ({
|
60
|
-
design = "spinner",
|
61
|
-
size = "sm",
|
62
|
-
themeMode = "light",
|
63
|
-
color,
|
64
|
-
...props
|
65
|
-
}) => {
|
66
|
-
let sizeStyles = {
|
67
|
-
button: "hawa-h-4 hawa-w-4",
|
68
|
-
xs: "hawa-h-1 hawa-w-1",
|
69
|
-
sm: "hawa-h-6 hawa-w-6",
|
70
|
-
normal: "hawa-h-8 hawa-w-8",
|
71
|
-
lg: "hawa-h-14 hawa-w-14",
|
72
|
-
xl: "hawa-h-24 hawa-w-24"
|
73
|
-
};
|
74
|
-
let animationStyles = {
|
75
|
-
pulse: "hawa-animate-in hawa-fade-in hawa-duration-1000",
|
76
|
-
bounce: "hawa-animate-bounce"
|
77
|
-
};
|
78
|
-
switch (design.split("-")[0]) {
|
79
|
-
case "dots":
|
80
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
81
|
-
"div",
|
82
|
-
{
|
83
|
-
className: cn("hawa-flex hawa-flex-row hawa-gap-2", props.className)
|
84
|
-
},
|
85
|
-
/* @__PURE__ */ import_react.default.createElement(
|
86
|
-
"div",
|
87
|
-
{
|
88
|
-
className: cn(
|
89
|
-
"hawa-animate-bounce hawa-rounded-full hawa-delay-100 hawa-repeat-infinite",
|
90
|
-
size === "button" ? "hawa-h-2 hawa-w-2" : sizeStyles[size],
|
91
|
-
animationStyles[design.split("-")[1]],
|
92
|
-
color ? color : "hawa-bg-primary"
|
93
|
-
)
|
94
|
-
}
|
95
|
-
),
|
96
|
-
/* @__PURE__ */ import_react.default.createElement(
|
97
|
-
"div",
|
98
|
-
{
|
99
|
-
className: cn(
|
100
|
-
"hawa-animate-bounce hawa-rounded-full hawa-delay-200 hawa-repeat-infinite",
|
101
|
-
size === "button" ? "hawa-h-2 hawa-w-2" : sizeStyles[size],
|
102
|
-
animationStyles[design.split("-")[1]],
|
103
|
-
color ? color : "hawa-bg-primary"
|
104
|
-
)
|
105
|
-
}
|
106
|
-
),
|
107
|
-
/* @__PURE__ */ import_react.default.createElement(
|
108
|
-
"div",
|
109
|
-
{
|
110
|
-
className: cn(
|
111
|
-
"hawa-animate-bounce hawa-rounded-full hawa-delay-300 hawa-repeat-infinite",
|
112
|
-
size === "button" ? "hawa-h-2 hawa-w-2" : sizeStyles[size],
|
113
|
-
animationStyles[design.split("-")[1]],
|
114
|
-
color ? color : "hawa-bg-primary"
|
115
|
-
)
|
116
|
-
}
|
117
|
-
)
|
118
|
-
);
|
119
|
-
case "square":
|
120
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
121
|
-
"svg",
|
122
|
-
{
|
123
|
-
className: cn("squircle-container", sizeStyles[size]),
|
124
|
-
viewBox: "0 0 35 35",
|
125
|
-
height: "35",
|
126
|
-
width: "35"
|
127
|
-
},
|
128
|
-
/* @__PURE__ */ import_react.default.createElement(
|
129
|
-
"rect",
|
130
|
-
{
|
131
|
-
className: "squircle-track",
|
132
|
-
x: "2.5",
|
133
|
-
y: "2.5",
|
134
|
-
fill: "none",
|
135
|
-
strokeWidth: "5px",
|
136
|
-
width: "32.5",
|
137
|
-
height: "32.5"
|
138
|
-
}
|
139
|
-
),
|
140
|
-
/* @__PURE__ */ import_react.default.createElement(
|
141
|
-
"rect",
|
142
|
-
{
|
143
|
-
className: "square-car",
|
144
|
-
x: "2.5",
|
145
|
-
y: "2.5",
|
146
|
-
fill: "none",
|
147
|
-
strokeWidth: "5px",
|
148
|
-
width: "32.5",
|
149
|
-
height: "32.5",
|
150
|
-
pathLength: "100"
|
151
|
-
}
|
152
|
-
)
|
153
|
-
);
|
154
|
-
case "squircle":
|
155
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
156
|
-
"svg",
|
157
|
-
{
|
158
|
-
className: cn("squircle-container", sizeStyles[size]),
|
159
|
-
x: "0px",
|
160
|
-
y: "0px",
|
161
|
-
viewBox: "0 0 37 37",
|
162
|
-
height: "37",
|
163
|
-
width: "37",
|
164
|
-
preserveAspectRatio: "xMidYMid meet"
|
165
|
-
},
|
166
|
-
/* @__PURE__ */ import_react.default.createElement(
|
167
|
-
"path",
|
168
|
-
{
|
169
|
-
className: "squircle-track",
|
170
|
-
fill: "none",
|
171
|
-
strokeWidth: "5",
|
172
|
-
pathLength: "100",
|
173
|
-
d: "M0.37 18.5 C0.37 5.772 5.772 0.37 18.5 0.37 S36.63 5.772 36.63 18.5 S31.228 36.63 18.5 36.63 S0.37 31.228 0.37 18.5"
|
174
|
-
}
|
175
|
-
),
|
176
|
-
/* @__PURE__ */ import_react.default.createElement(
|
177
|
-
"path",
|
178
|
-
{
|
179
|
-
className: "squircle-car",
|
180
|
-
fill: "none",
|
181
|
-
strokeWidth: "5",
|
182
|
-
pathLength: "100",
|
183
|
-
d: "M0.37 18.5 C0.37 5.772 5.772 0.37 18.5 0.37 S36.63 5.772 36.63 18.5 S31.228 36.63 18.5 36.63 S0.37 31.228 0.37 18.5"
|
184
|
-
}
|
185
|
-
)
|
186
|
-
);
|
187
|
-
case "progress":
|
188
|
-
return /* @__PURE__ */ import_react.default.createElement("div", { className: "progress-loading" });
|
189
|
-
case "orbit":
|
190
|
-
return /* @__PURE__ */ import_react.default.createElement("div", { className: "orbit-container" });
|
191
|
-
default:
|
192
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
193
|
-
"svg",
|
194
|
-
{
|
195
|
-
className: cn("circle-container", sizeStyles[size]),
|
196
|
-
viewBox: "0 0 40 40",
|
197
|
-
height: "40",
|
198
|
-
width: "40"
|
199
|
-
},
|
200
|
-
/* @__PURE__ */ import_react.default.createElement(
|
201
|
-
"circle",
|
202
|
-
{
|
203
|
-
className: cn("circle-track", {
|
204
|
-
"hawa-stroke-primary-foreground": themeMode === "dark",
|
205
|
-
"hawa-stroke-primary": themeMode === "light"
|
206
|
-
}),
|
207
|
-
cx: "20",
|
208
|
-
cy: "20",
|
209
|
-
r: "17.5",
|
210
|
-
pathLength: "100",
|
211
|
-
strokeWidth: "5px",
|
212
|
-
fill: "none"
|
213
|
-
}
|
214
|
-
),
|
215
|
-
/* @__PURE__ */ import_react.default.createElement(
|
216
|
-
"circle",
|
217
|
-
{
|
218
|
-
className: cn("circle-car", {
|
219
|
-
"hawa-stroke-primary-foreground": themeMode === "dark",
|
220
|
-
"hawa-stroke-primary": themeMode === "light"
|
221
|
-
}),
|
222
|
-
cx: "20",
|
223
|
-
cy: "20",
|
224
|
-
r: "17.5",
|
225
|
-
pathLength: "100",
|
226
|
-
strokeWidth: "5px",
|
227
|
-
fill: "none"
|
228
|
-
}
|
229
|
-
)
|
230
|
-
);
|
231
|
-
}
|
232
|
-
};
|
233
|
-
|
234
|
-
// elements/button/Button.tsx
|
235
|
-
var buttonVariants = (0, import_class_variance_authority.cva)(
|
236
|
-
"hawa-inline-flex hawa-items-center hawa-select-none hawa-rounded-md hawa-text-sm hawa-font-medium hawa-ring-offset-background hawa-transition-colors focus-visible:hawa-outline-none focus-visible:hawa-ring-2 focus-visible:hawa-ring-ring focus-visible:hawa-ring-offset-2 disabled:hawa-pointer-events-none disabled:hawa-opacity-50",
|
237
|
-
{
|
238
|
-
variants: {
|
239
|
-
variant: {
|
240
|
-
default: "hawa-bg-primary hawa-text-primary-foreground hover:hawa-bg-primary/90",
|
241
|
-
light: "hawa-bg-primary/20 hawa-text-primary hover:hawa-bg-primary/40",
|
242
|
-
destructive: "hawa-bg-destructive hawa-text-destructive-foreground hover:hawa-bg-destructive/90",
|
243
|
-
outline: "hawa-border hawa-border-input hawa-bg-transparent hover:hawa-bg-accent hover:hawa-text-accent-foreground",
|
244
|
-
secondary: "hawa-bg-secondary hawa-text-secondary-foreground hover:hawa-bg-secondary/80",
|
245
|
-
ghost: "hover:hawa-bg-accent hover:hawa-text-accent-foreground",
|
246
|
-
link: "hawa-text-primary hawa-underline-offset-4 hover:hawa-underline",
|
247
|
-
combobox: "hawa-bg-background hawa-border",
|
248
|
-
neoBrutalism: "neo-brutalism"
|
249
|
-
// "hawa-cursor-pointer hawa-transition-all hawa-uppercase hawa-font-mono dark:hawa-bg-black hawa-font-bold hawa-py-2 hawa-px-4 hawa-rounded hawa-border-2 hawa-border-primary hawa-shadow-color-primary hawa-transition-[hawa-transform_50ms, hawa-box-shadow_50ms] active:hawa-translate-x-0.5 active:hawa-translate-y-0.5 active:hawa-shadow-color-primary-active shadow-color-primary active:shadow-color-primary-active",
|
250
|
-
},
|
251
|
-
size: {
|
252
|
-
default: "hawa-h-10 hawa-px-4 hawa-py-2",
|
253
|
-
heightless: "hawa-px-4 hawa-py-4",
|
254
|
-
xs: "hawa-h-fit hawa-min-h-[25px] hawa-py-1 hawa-text-[10px] hawa-px-2 ",
|
255
|
-
sm: "hawa-h-9 hawa-text-[11px] hawa-rounded-md hawa-px-3",
|
256
|
-
lg: "hawa-h-11 hawa-rounded-md hawa-px-8",
|
257
|
-
xl: "hawa-h-14 hawa-rounded-md hawa-px-10",
|
258
|
-
icon: "hawa-h-10 hawa-w-10",
|
259
|
-
smallIcon: "hawa-h-7 hawa-w-7"
|
260
|
-
}
|
261
|
-
},
|
262
|
-
defaultVariants: {
|
263
|
-
variant: "default",
|
264
|
-
size: "default"
|
265
|
-
}
|
266
|
-
}
|
267
|
-
);
|
268
|
-
var Button = React2.forwardRef(
|
269
|
-
({
|
270
|
-
className,
|
271
|
-
variant,
|
272
|
-
size,
|
273
|
-
asChild = false,
|
274
|
-
centered = true,
|
275
|
-
isLoading,
|
276
|
-
children,
|
277
|
-
...props
|
278
|
-
}, ref) => {
|
279
|
-
const Comp = "button";
|
280
|
-
const loadingColor = variant === "outline" || variant === "ghost" || variant === "neoBrutalism" ? "hawa-bg-primary" : "hawa-bg-primary-foreground";
|
281
|
-
return /* @__PURE__ */ React2.createElement(
|
282
|
-
Comp,
|
283
|
-
{
|
284
|
-
className: cn(
|
285
|
-
buttonVariants({ variant, size, className }),
|
286
|
-
centered && "hawa-justify-center"
|
287
|
-
// "hawa-bg-red-500"
|
288
|
-
),
|
289
|
-
ref,
|
290
|
-
...props
|
291
|
-
},
|
292
|
-
isLoading ? /* @__PURE__ */ React2.createElement(
|
293
|
-
Loading,
|
294
|
-
{
|
295
|
-
design: size === "icon" || size === "smallIcon" ? "spinner" : "dots-pulse",
|
296
|
-
themeMode: variant === "outline" ? "light" : "dark",
|
297
|
-
color: loadingColor,
|
298
|
-
size: size === "sm" || size === "xs" ? "xs" : "button"
|
299
|
-
}
|
300
|
-
) : children
|
301
|
-
);
|
302
|
-
}
|
303
|
-
);
|
304
|
-
Button.displayName = "Button";
|
305
|
-
|
306
|
-
// elements/card/Card.tsx
|
307
|
-
var React3 = __toESM(require("react"));
|
308
|
-
var Card = React3.forwardRef(
|
309
|
-
({ className, variant = "default", clickable = false, ...props }, ref) => {
|
310
|
-
let variantStyles = {
|
311
|
-
default: cn(
|
312
|
-
"hawa-rounded-lg hawa-border hawa-bg-card hawa-text-card-foreground hawa-shadow-sm",
|
313
|
-
clickable && "hawa-cursor-pointer hawa-transition-all hover:hawa-drop-shadow-md dark:hover:dark-shadow"
|
314
|
-
),
|
315
|
-
neoBrutalism: cn(
|
316
|
-
"neo-brutalism",
|
317
|
-
// "hawa-transition-all hawa-uppercase hawa-font-mono dark:hawa-bg-black hawa-font-bold hawa-py-2 hawa-px-4 hawa-rounded hawa-border-2 hawa-border-primary hawa-shadow-color-primary hawa-transition-[hawa-transform_50ms, hawa-box-shadow_50ms] transition-all uppercase font-mono dark:bg-black font-bold py-2 px-4 rounded border-2 border-primary shadow-color-primary transition-[transform_50ms, box-shadow_50ms]",
|
318
|
-
clickable && "hawa-cursor-pointer active:hawa-translate-x-0.5 active:hawa-translate-y-0.5 active:hawa-shadow-color-primary-active active:translate-x-0.5 active:translate-y-0.5 active:shadow-color-primary-active"
|
319
|
-
)
|
320
|
-
};
|
321
|
-
return /* @__PURE__ */ React3.createElement(
|
322
|
-
"div",
|
323
|
-
{
|
324
|
-
ref,
|
325
|
-
className: cn(className, variantStyles[variant]),
|
326
|
-
...props
|
327
|
-
}
|
328
|
-
);
|
329
|
-
}
|
330
|
-
);
|
331
|
-
var CardHeader = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React3.createElement(
|
332
|
-
"div",
|
333
|
-
{
|
334
|
-
ref,
|
335
|
-
className: cn(
|
336
|
-
"hawa-flex hawa-flex-col hawa-space-y-1.5 hawa-p-6",
|
337
|
-
className
|
338
|
-
),
|
339
|
-
...props
|
340
|
-
}
|
341
|
-
));
|
342
|
-
var CardTitle = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React3.createElement(
|
343
|
-
"h3",
|
344
|
-
{
|
345
|
-
ref,
|
346
|
-
className: cn("hawa-text-2xl hawa-font-semibold ", className),
|
347
|
-
...props
|
348
|
-
}
|
349
|
-
));
|
350
|
-
var CardDescription = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React3.createElement(
|
351
|
-
"p",
|
352
|
-
{
|
353
|
-
ref,
|
354
|
-
className: cn("hawa-text-sm hawa-text-muted-foreground", className),
|
355
|
-
...props
|
356
|
-
}
|
357
|
-
));
|
358
|
-
var CardContent = React3.forwardRef(
|
359
|
-
({ headless, noPadding, className, ...props }, ref) => /* @__PURE__ */ React3.createElement(
|
360
|
-
"div",
|
361
|
-
{
|
362
|
-
ref,
|
363
|
-
className: cn(
|
364
|
-
noPadding ? "hawa-p-0" : "hawa-p-6",
|
365
|
-
headless ? "hawa-pt-6" : "hawa-pt-0",
|
366
|
-
className
|
367
|
-
),
|
368
|
-
...props
|
369
|
-
}
|
370
|
-
)
|
371
|
-
);
|
372
|
-
var CardFooter = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React3.createElement(
|
373
|
-
"div",
|
374
|
-
{
|
375
|
-
ref,
|
376
|
-
className: cn("hawa-flex hawa-items-center hawa-p-6 hawa-pt-0", className),
|
377
|
-
...props
|
378
|
-
}
|
379
|
-
));
|
380
|
-
CardDescription.displayName = "CardDescription";
|
381
|
-
CardContent.displayName = "CardContent";
|
382
|
-
CardHeader.displayName = "CardHeader";
|
383
|
-
CardFooter.displayName = "CardFooter";
|
384
|
-
CardTitle.displayName = "CardTitle";
|
385
|
-
Card.displayName = "Card";
|
386
|
-
|
387
|
-
// elements/radio/Radio.tsx
|
388
|
-
var import_react3 = __toESM(require("react"));
|
389
|
-
|
390
|
-
// elements/label/Label.tsx
|
391
|
-
var React5 = __toESM(require("react"));
|
392
|
-
|
393
|
-
// elements/tooltip/Tooltip.tsx
|
394
|
-
var import_react2 = __toESM(require("react"));
|
395
|
-
var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"));
|
396
|
-
var TooltipContent = import_react2.default.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ import_react2.default.createElement(
|
397
|
-
TooltipPrimitive.Content,
|
398
|
-
{
|
399
|
-
ref,
|
400
|
-
sideOffset,
|
401
|
-
className: cn(
|
402
|
-
"hawa-z-50 hawa-overflow-hidden hawa-rounded-md hawa-border hawa-bg-popover hawa-px-3 hawa-py-1.5 hawa-text-sm hawa-text-popover-foreground hawa-shadow-md hawa-animate-in hawa-fade-in-0 hawa-zoom-in-95 data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=closed]:hawa-zoom-out-95 data-[side=bottom]:hawa-slide-in-from-top-2 data-[side=left]:hawa-slide-in-from-right-2 data-[side=right]:hawa-slide-in-from-left-2 data-[side=top]:hawa-slide-in-from-bottom-2",
|
403
|
-
className
|
404
|
-
),
|
405
|
-
...props
|
406
|
-
}
|
407
|
-
));
|
408
|
-
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
409
|
-
var TooltipArrow = import_react2.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ import_react2.default.createElement(TooltipPrimitive.Arrow, { ref, className: cn(className), ...props }));
|
410
|
-
TooltipArrow.displayName = TooltipPrimitive.Arrow.displayName;
|
411
|
-
var Tooltip = ({
|
412
|
-
side,
|
413
|
-
open,
|
414
|
-
content,
|
415
|
-
children,
|
416
|
-
defaultOpen,
|
417
|
-
onOpenChange,
|
418
|
-
triggerProps,
|
419
|
-
contentProps,
|
420
|
-
providerProps,
|
421
|
-
delayDuration = 300,
|
422
|
-
...props
|
423
|
-
}) => {
|
424
|
-
return /* @__PURE__ */ import_react2.default.createElement(
|
425
|
-
TooltipPrimitive.TooltipProvider,
|
426
|
-
{
|
427
|
-
delayDuration,
|
428
|
-
...providerProps
|
429
|
-
},
|
430
|
-
/* @__PURE__ */ import_react2.default.createElement(
|
431
|
-
TooltipPrimitive.Root,
|
432
|
-
{
|
433
|
-
open,
|
434
|
-
defaultOpen,
|
435
|
-
onOpenChange,
|
436
|
-
...props
|
437
|
-
},
|
438
|
-
/* @__PURE__ */ import_react2.default.createElement(TooltipPrimitive.Trigger, { ...triggerProps }, children),
|
439
|
-
/* @__PURE__ */ import_react2.default.createElement(TooltipContent, { side, align: "center", ...contentProps }, content)
|
440
|
-
)
|
441
|
-
);
|
442
|
-
};
|
443
|
-
|
444
|
-
// elements/label/Label.tsx
|
445
|
-
var Label = React5.forwardRef(({ className, hint, hintSide, required, children, ...props }, ref) => /* @__PURE__ */ React5.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-gap-1 hawa-transition-all" }, /* @__PURE__ */ React5.createElement(
|
446
|
-
"label",
|
447
|
-
{
|
448
|
-
ref,
|
449
|
-
className: cn(
|
450
|
-
"hawa-text-sm hawa-font-medium hawa-leading-none peer-disabled:hawa-cursor-not-allowed peer-disabled:hawa-opacity-70",
|
451
|
-
className
|
452
|
-
),
|
453
|
-
...props
|
454
|
-
},
|
455
|
-
children,
|
456
|
-
required && /* @__PURE__ */ React5.createElement("span", { className: "hawa-mx-0.5 hawa-text-red-500" }, "*")
|
457
|
-
), hint && /* @__PURE__ */ React5.createElement(
|
458
|
-
Tooltip,
|
459
|
-
{
|
460
|
-
content: hint,
|
461
|
-
side: hintSide,
|
462
|
-
triggerProps: {
|
463
|
-
tabIndex: -1,
|
464
|
-
onClick: (event) => event.preventDefault()
|
465
|
-
}
|
466
|
-
},
|
467
|
-
/* @__PURE__ */ React5.createElement("div", null, /* @__PURE__ */ React5.createElement(
|
468
|
-
"svg",
|
469
|
-
{
|
470
|
-
xmlns: "http://www.w3.org/2000/svg",
|
471
|
-
className: "hawa-h-[14px] hawa-w-[14px] hawa-cursor-help",
|
472
|
-
viewBox: "0 0 24 24",
|
473
|
-
fill: "none",
|
474
|
-
stroke: "currentColor",
|
475
|
-
strokeWidth: "2",
|
476
|
-
strokeLinecap: "round",
|
477
|
-
strokeLinejoin: "round"
|
478
|
-
},
|
479
|
-
/* @__PURE__ */ React5.createElement("circle", { cx: "12", cy: "12", r: "10" }),
|
480
|
-
/* @__PURE__ */ React5.createElement("path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" }),
|
481
|
-
/* @__PURE__ */ React5.createElement("path", { d: "M12 17h.01" })
|
482
|
-
))
|
483
|
-
)));
|
484
|
-
Label.displayName = "Label";
|
485
|
-
|
486
|
-
// elements/radio/Radio.tsx
|
487
|
-
var Radio = ({
|
488
|
-
design = "default",
|
489
|
-
width = "default",
|
490
|
-
size = "default",
|
491
|
-
orientation = "horizontal",
|
492
|
-
name,
|
493
|
-
labelProps,
|
494
|
-
tabsContainerClassName,
|
495
|
-
onChange,
|
496
|
-
...props
|
497
|
-
}) => {
|
498
|
-
var _a, _b, _c;
|
499
|
-
const [selectedOption, setSelectedOption] = (0, import_react3.useState)(props.defaultValue);
|
500
|
-
let activeTabStyle = "hawa-inline-block hawa-w-full hawa-text-primary-foreground hawa-bg-primary hawa-active dark:hawa-bg-primary";
|
501
|
-
let inactiveTabStyle = "hawa-inline-block hawa-w-full hawa-transition-all hover:hawa-bg-muted hawa-bg-primary-foreground dark:hover:hawa-text-white";
|
502
|
-
let orientationStyle = {
|
503
|
-
horizontal: "hawa-flex hawa-flex-row",
|
504
|
-
vertical: "hawa-flex hawa-flex-col"
|
505
|
-
};
|
506
|
-
let tabSizeStyle = {
|
507
|
-
default: "hawa-py-2 hawa-px-4 hawa-text-sm",
|
508
|
-
lg: "hawa-py-2 hawa-px-4",
|
509
|
-
sm: "hawa-p-1.5 hawa-text-xs",
|
510
|
-
xs: "hawa-p-1 hawa-text-[10px]"
|
511
|
-
};
|
512
|
-
let widthStyle = {
|
513
|
-
none: "",
|
514
|
-
default: "hawa-max-w-fit",
|
515
|
-
full: "hawa-w-full"
|
516
|
-
};
|
517
|
-
const [parentDirection, setParentDirection] = import_react3.default.useState(
|
518
|
-
null
|
519
|
-
);
|
520
|
-
const parentRef = (0, import_react3.useRef)(null);
|
521
|
-
(0, import_react3.useEffect)(() => {
|
522
|
-
var _a2;
|
523
|
-
const parentNode = (_a2 = parentRef.current) == null ? void 0 : _a2.parentNode;
|
524
|
-
if (parentNode) {
|
525
|
-
const dir = window.getComputedStyle(parentNode).direction;
|
526
|
-
setParentDirection(dir);
|
527
|
-
}
|
528
|
-
});
|
529
|
-
const handleChange = (opt) => {
|
530
|
-
setSelectedOption(opt.value);
|
531
|
-
if (onChange) {
|
532
|
-
onChange(opt.value);
|
533
|
-
} else {
|
534
|
-
console.log("onChange was not provided");
|
535
|
-
}
|
536
|
-
};
|
537
|
-
switch (design) {
|
538
|
-
case "tabs":
|
539
|
-
return /* @__PURE__ */ import_react3.default.createElement(
|
540
|
-
"ul",
|
541
|
-
{
|
542
|
-
ref: parentRef,
|
543
|
-
className: cn(
|
544
|
-
props.options && ((_a = props.options) == null ? void 0 : _a.length) > 2 ? "hawa-flex-wrap xs:hawa-max-w-full xs:hawa-flex-nowrap" : "",
|
545
|
-
"hawa-select-none hawa-whitespace-nowrap hawa-rounded hawa-border hawa-text-center hawa-font-medium",
|
546
|
-
orientationStyle[orientation],
|
547
|
-
widthStyle[width],
|
548
|
-
tabsContainerClassName
|
549
|
-
)
|
550
|
-
},
|
551
|
-
(_b = props.options) == null ? void 0 : _b.map((opt, o) => /* @__PURE__ */ import_react3.default.createElement(
|
552
|
-
"li",
|
553
|
-
{
|
554
|
-
"aria-current": "page",
|
555
|
-
onClick: () => handleChange(opt),
|
556
|
-
className: cn(
|
557
|
-
"hawa-w-full hawa-cursor-pointer ",
|
558
|
-
orientation === "horizontal" && parentDirection === "ltr" && "hawa-rounded-none first:hawa-rounded-l last:hawa-rounded-r",
|
559
|
-
orientation === "horizontal" && parentDirection === "rtl" && "hawa-rounded-none first:hawa-rounded-r last:hawa-rounded-l",
|
560
|
-
orientation === "vertical" && "hawa-rounded-none first:hawa-rounded-t last:hawa-rounded-b",
|
561
|
-
tabSizeStyle[size],
|
562
|
-
"hawa-last hawa-flex hawa-flex-row hawa-items-center hawa-justify-center hawa-gap-2 ",
|
563
|
-
selectedOption === opt.value ? activeTabStyle : inactiveTabStyle
|
564
|
-
),
|
565
|
-
key: o
|
566
|
-
},
|
567
|
-
opt.icon && opt.icon,
|
568
|
-
opt.label
|
569
|
-
))
|
570
|
-
);
|
571
|
-
case "bordered":
|
572
|
-
return /* @__PURE__ */ import_react3.default.createElement("div", { className: cn(orientationStyle[orientation], "hawa-gap-4") }, props.options && props.options.map((opt, i) => /* @__PURE__ */ import_react3.default.createElement("div", { key: i, className: "hawa-w-full hawa-rounded hawa-border" }, /* @__PURE__ */ import_react3.default.createElement(
|
573
|
-
"div",
|
574
|
-
{
|
575
|
-
className: cn(
|
576
|
-
"radio-item radio-item-bordered hawa-flex hawa-items-center hawa-transition-all",
|
577
|
-
props.direction === "rtl" ? "margin-left right-19px" : "margin-right left-23px"
|
578
|
-
),
|
579
|
-
key: i + 1
|
580
|
-
},
|
581
|
-
/* @__PURE__ */ import_react3.default.createElement(
|
582
|
-
"input",
|
583
|
-
{
|
584
|
-
disabled: opt.disabled,
|
585
|
-
id: opt.value.toString(),
|
586
|
-
type: "radio",
|
587
|
-
value: opt.value,
|
588
|
-
name,
|
589
|
-
onChange: () => handleChange(opt)
|
590
|
-
}
|
591
|
-
),
|
592
|
-
/* @__PURE__ */ import_react3.default.createElement(
|
593
|
-
"label",
|
594
|
-
{
|
595
|
-
htmlFor: opt.value.toString(),
|
596
|
-
className: cn(
|
597
|
-
"hawa-ml-2 hawa-w-full hawa-select-none hawa-p-4 hawa-pl-3 hawa-text-sm hawa-font-medium hawa-text-black dark:hawa-text-white",
|
598
|
-
opt.disabled ? "hawa-opacity-50" : "hawa-cursor-pointer hawa-text-gray-900"
|
599
|
-
)
|
600
|
-
},
|
601
|
-
opt.label
|
602
|
-
)
|
603
|
-
))));
|
604
|
-
case "cards":
|
605
|
-
return /* @__PURE__ */ import_react3.default.createElement("ul", { className: cn(orientationStyle[orientation], "hawa-gap-4") }, (_c = props.options) == null ? void 0 : _c.map((opt, o) => /* @__PURE__ */ import_react3.default.createElement("li", { key: o, onClick: () => handleChange(opt) }, /* @__PURE__ */ import_react3.default.createElement(
|
606
|
-
"input",
|
607
|
-
{
|
608
|
-
type: "radio",
|
609
|
-
id: opt.value.toString(),
|
610
|
-
name,
|
611
|
-
value: opt.value.toString(),
|
612
|
-
className: "hawa-peer hawa-hidden",
|
613
|
-
required: true,
|
614
|
-
disabled: opt.disabled
|
615
|
-
}
|
616
|
-
), /* @__PURE__ */ import_react3.default.createElement(
|
617
|
-
"label",
|
618
|
-
{
|
619
|
-
htmlFor: opt.value.toString(),
|
620
|
-
className: cn(
|
621
|
-
"hawa-inline-flex hawa-h-full hawa-w-full hawa-items-center hawa-justify-between hawa-rounded-lg hawa-border hawa-border-gray-200 hawa-bg-white hawa-p-5 hawa-text-gray-500 peer-checked:hawa-border-primary peer-checked:hawa-text-primary dark:hawa-border-gray-700 dark:hawa-bg-gray-800 dark:hawa-text-gray-400 dark:peer-checked:hawa-text-primary",
|
622
|
-
opt.disabled ? "hawa-opacity-50" : "hawa-cursor-pointer hover:hawa-bg-gray-100 hover:hawa-text-gray-600 dark:hover:hawa-bg-gray-700 dark:hover:hawa-text-gray-300"
|
623
|
-
)
|
624
|
-
},
|
625
|
-
/* @__PURE__ */ import_react3.default.createElement("div", { className: "hawa-block hawa-h-full hawa-w-full" }, /* @__PURE__ */ import_react3.default.createElement("div", { className: "hawa-w-full hawa-text-lg hawa-font-semibold" }, opt.label), /* @__PURE__ */ import_react3.default.createElement("div", { className: "hawa-w-full" }, opt.sublabel))
|
626
|
-
))));
|
627
|
-
default:
|
628
|
-
return /* @__PURE__ */ import_react3.default.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-2" }, props.label && /* @__PURE__ */ import_react3.default.createElement(Label, { ...labelProps }, props.label), /* @__PURE__ */ import_react3.default.createElement("div", { className: cn(orientationStyle[orientation], "hawa-gap-2") }, props.options && props.options.map((opt, i) => /* @__PURE__ */ import_react3.default.createElement(
|
629
|
-
"div",
|
630
|
-
{
|
631
|
-
className: cn(
|
632
|
-
"radio-item radio-item-default hawa-flex hawa-items-center hawa-transition-all",
|
633
|
-
props.direction === "rtl" ? "margin-left right-3px" : "margin-right left-3px"
|
634
|
-
),
|
635
|
-
key: i + 1
|
636
|
-
},
|
637
|
-
/* @__PURE__ */ import_react3.default.createElement(
|
638
|
-
"input",
|
639
|
-
{
|
640
|
-
disabled: opt.disabled,
|
641
|
-
id: opt.value.toString(),
|
642
|
-
type: "radio",
|
643
|
-
value: opt.value,
|
644
|
-
name,
|
645
|
-
onChange: () => handleChange(opt)
|
646
|
-
}
|
647
|
-
),
|
648
|
-
/* @__PURE__ */ import_react3.default.createElement(
|
649
|
-
"label",
|
650
|
-
{
|
651
|
-
htmlFor: opt.value.toString(),
|
652
|
-
className: cn(
|
653
|
-
"hawa-text-sm hawa-font-medium dark:hawa-text-white",
|
654
|
-
opt.disabled ? "hawa-text-gray-400" : "hawa-cursor-pointer hawa-text-gray-900"
|
655
|
-
)
|
656
|
-
},
|
657
|
-
opt.label
|
658
|
-
)
|
659
|
-
))), /* @__PURE__ */ import_react3.default.createElement(
|
660
|
-
"p",
|
661
|
-
{
|
662
|
-
className: cn(
|
663
|
-
"hawa-my-0 hawa-text-start hawa-text-xs hawa-text-helper-color hawa-transition-all",
|
664
|
-
props.helperText ? "hawa-h-4 hawa-opacity-100" : "hawa-h-0 hawa-opacity-0"
|
665
|
-
)
|
666
|
-
},
|
667
|
-
props.helperText
|
668
|
-
));
|
669
|
-
}
|
670
|
-
};
|
671
|
-
|
672
|
-
// elements/textarea/Textarea.tsx
|
673
|
-
var React8 = __toESM(require("react"));
|
674
|
-
|
675
|
-
// elements/skeleton/Skeleton.tsx
|
676
|
-
var import_react4 = __toESM(require("react"));
|
677
|
-
function Skeleton({
|
678
|
-
className,
|
679
|
-
content,
|
680
|
-
animation = "pulse",
|
681
|
-
...props
|
682
|
-
}) {
|
683
|
-
const animationStyles = {
|
684
|
-
none: "hawa-rounded hawa-bg-muted",
|
685
|
-
pulse: "hawa-animate-pulse hawa-rounded hawa-bg-muted",
|
686
|
-
shimmer: "hawa-space-y-5 hawa-rounded hawa-bg-muted hawa-p-4 hawa-relative before:hawa-absolute before:hawa-inset-0 before:hawa--translate-x-full before:hawa-animate-[shimmer_2s_infinite] before:hawa-bg-gradient-to-r before:hawa-from-transparent before:hawa-via-gray-300/40 dark:before:hawa-via-white/10 before:hawa-to-transparent hawa-isolate hawa-overflow-hidden before:hawa-border-t before:hawa-border-rose-100/10"
|
687
|
-
};
|
688
|
-
return /* @__PURE__ */ import_react4.default.createElement(
|
689
|
-
"div",
|
690
|
-
{
|
691
|
-
className: cn(
|
692
|
-
animationStyles[animation],
|
693
|
-
content && "hawa-flex hawa-flex-col hawa-items-center hawa-justify-center",
|
694
|
-
className
|
695
|
-
),
|
696
|
-
...props
|
697
|
-
},
|
698
|
-
content && content
|
699
|
-
);
|
700
|
-
}
|
701
|
-
|
702
|
-
// elements/textarea/Textarea.tsx
|
703
|
-
var Textarea = React8.forwardRef(
|
704
|
-
({
|
705
|
-
className,
|
706
|
-
classNames,
|
707
|
-
labelProps,
|
708
|
-
showCount,
|
709
|
-
forceHideHelperText,
|
710
|
-
textareaProps,
|
711
|
-
countPosition = "bottom",
|
712
|
-
isLoading,
|
713
|
-
...props
|
714
|
-
}, ref) => {
|
715
|
-
return /* @__PURE__ */ React8.createElement(
|
716
|
-
"div",
|
717
|
-
{
|
718
|
-
className: cn(
|
719
|
-
"textarea-main hawa-relative hawa-flex hawa-h-full hawa-w-full hawa-flex-col",
|
720
|
-
!forceHideHelperText && "hawa-gap-2",
|
721
|
-
className
|
722
|
-
)
|
723
|
-
},
|
724
|
-
/* @__PURE__ */ React8.createElement("div", { className: "hawa-flex hawa-flex-row hawa-justify-between" }, props.label && /* @__PURE__ */ React8.createElement(Label, { ...labelProps }, props.label), showCount && countPosition === "top" && /* @__PURE__ */ React8.createElement(
|
725
|
-
"div",
|
726
|
-
{
|
727
|
-
className: "hawa-text-start hawa-text-xs hawa-transition-all hawa-leading-none"
|
728
|
-
},
|
729
|
-
(textareaProps == null ? void 0 : textareaProps.value) ? String(textareaProps == null ? void 0 : textareaProps.value).length : 0,
|
730
|
-
"/",
|
731
|
-
textareaProps == null ? void 0 : textareaProps.maxLength
|
732
|
-
)),
|
733
|
-
isLoading ? /* @__PURE__ */ React8.createElement(Skeleton, { style: { height: 40 } }) : /* @__PURE__ */ React8.createElement(
|
734
|
-
"textarea",
|
735
|
-
{
|
736
|
-
className: cn(
|
737
|
-
"hawa-flex hawa-min-h-[40px] hawa-h-[40px] hawa-w-full hawa-rounded-md hawa-border hawa-border-input hawa-bg-background hawa-px-3 hawa-py-2 hawa-text-sm hawa-ring-offset-background placeholder:hawa-text-gray-400 placeholder:hawa-text-muted-foreground focus-visible:hawa-outline-none focus-visible:hawa-ring-2 focus-visible:hawa-ring-ring focus-visible:hawa-ring-offset-0 disabled:hawa-cursor-not-allowed disabled:hawa-opacity-50",
|
738
|
-
classNames == null ? void 0 : classNames.textarea
|
739
|
-
),
|
740
|
-
ref,
|
741
|
-
...textareaProps
|
742
|
-
}
|
743
|
-
),
|
744
|
-
/* @__PURE__ */ React8.createElement("div", { className: "hawa-flex hawa-flex-row hawa-justify-between" }, !forceHideHelperText && /* @__PURE__ */ React8.createElement(
|
745
|
-
"p",
|
746
|
-
{
|
747
|
-
className: cn(
|
748
|
-
"hawa-my-0 hawa-text-start hawa-text-xs hawa-text-helper-color hawa-transition-all",
|
749
|
-
props.helperText ? "hawa-h-4 hawa-opacity-100" : "hawa-h-0 hawa-opacity-0"
|
750
|
-
)
|
751
|
-
},
|
752
|
-
props.helperText
|
753
|
-
), showCount && countPosition === "bottom" && /* @__PURE__ */ React8.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))
|
754
|
-
);
|
755
|
-
}
|
756
|
-
);
|
757
|
-
Textarea.displayName = "Textarea";
|
758
|
-
|
759
|
-
// blocks/feedback/UserReferralSource.tsx
|
760
|
-
var UserReferralSource = ({
|
761
|
-
position = "bottom-right",
|
762
|
-
options = [],
|
763
|
-
...props
|
764
|
-
}) => {
|
765
|
-
var _a, _b;
|
766
|
-
const [closed, setClosed] = (0, import_react5.useState)(false);
|
767
|
-
const popUpRef = (0, import_react5.useRef)(null);
|
768
|
-
const formSchema = z.object({
|
769
|
-
source: z.string({ required_error: (_a = props.texts) == null ? void 0 : _a.pleaseSelectOption }),
|
770
|
-
feedback: z.string().optional()
|
771
|
-
});
|
772
|
-
const { handleSubmit, control, formState, watch } = (0, import_react_hook_form.useForm)({
|
773
|
-
resolver: (0, import_zod.zodResolver)(formSchema)
|
774
|
-
});
|
775
|
-
const selectedSource = watch("source");
|
776
|
-
const boxPosition = {
|
777
|
-
"bottom-right": "hawa-right-4",
|
778
|
-
"bottom-left": "hawa-left-4"
|
779
|
-
};
|
780
|
-
const optionsWithOther = [
|
781
|
-
...options,
|
782
|
-
{
|
783
|
-
value: "other",
|
784
|
-
label: "Other"
|
785
|
-
}
|
786
|
-
];
|
787
|
-
return /* @__PURE__ */ import_react5.default.createElement(
|
788
|
-
"div",
|
789
|
-
{
|
790
|
-
className: cn(
|
791
|
-
"hawa-transition-all",
|
792
|
-
closed ? "hawa-opacity-0" : "hawa-opacity-100"
|
793
|
-
),
|
794
|
-
ref: popUpRef
|
795
|
-
},
|
796
|
-
/* @__PURE__ */ import_react5.default.createElement(
|
797
|
-
Card,
|
798
|
-
{
|
799
|
-
className: cn(
|
800
|
-
"hawa-fixed hawa-bottom-4 hawa-p-0 ",
|
801
|
-
boxPosition[position]
|
802
|
-
),
|
803
|
-
dir: props.direction
|
804
|
-
},
|
805
|
-
/* @__PURE__ */ import_react5.default.createElement(
|
806
|
-
"button",
|
807
|
-
{
|
808
|
-
type: "button",
|
809
|
-
className: cn(
|
810
|
-
props.direction === "rtl" ? "hawa-left-2" : "hawa-right-2",
|
811
|
-
"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"
|
812
|
-
),
|
813
|
-
"data-dismiss-target": "#toast-default",
|
814
|
-
"aria-label": "Close",
|
815
|
-
onClick: () => {
|
816
|
-
setClosed(true);
|
817
|
-
setTimeout(() => {
|
818
|
-
if (popUpRef == null ? void 0 : popUpRef.current) {
|
819
|
-
popUpRef == null ? void 0 : popUpRef.current.removeChild(popUpRef == null ? void 0 : popUpRef.current.children[0]);
|
820
|
-
}
|
821
|
-
}, 200);
|
822
|
-
}
|
823
|
-
},
|
824
|
-
/* @__PURE__ */ import_react5.default.createElement(
|
825
|
-
"svg",
|
826
|
-
{
|
827
|
-
"aria-hidden": "true",
|
828
|
-
className: "hawa-h-5 hawa-w-5",
|
829
|
-
fill: "currentColor",
|
830
|
-
viewBox: "0 0 20 20"
|
831
|
-
},
|
832
|
-
/* @__PURE__ */ import_react5.default.createElement(
|
833
|
-
"path",
|
834
|
-
{
|
835
|
-
fillRule: "evenodd",
|
836
|
-
d: "M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",
|
837
|
-
clipRule: "evenodd"
|
838
|
-
}
|
839
|
-
)
|
840
|
-
)
|
841
|
-
),
|
842
|
-
/* @__PURE__ */ import_react5.default.createElement(CardContent, { headless: true }, /* @__PURE__ */ import_react5.default.createElement(
|
843
|
-
"form",
|
844
|
-
{
|
845
|
-
noValidate: true,
|
846
|
-
onSubmit: handleSubmit((e) => {
|
847
|
-
if (props.onSubmitForm) {
|
848
|
-
props.onSubmitForm(e);
|
849
|
-
} else {
|
850
|
-
console.log("onSubmitForm was not provided");
|
851
|
-
}
|
852
|
-
})
|
853
|
-
},
|
854
|
-
/* @__PURE__ */ import_react5.default.createElement(
|
855
|
-
"div",
|
856
|
-
{
|
857
|
-
className: cn(
|
858
|
-
"hawa-flex hawa-flex-col hawa-gap-4 hawa-transition-all",
|
859
|
-
closed ? "hawa-opacity-0" : "hawa-opacity-100"
|
860
|
-
)
|
861
|
-
},
|
862
|
-
/* @__PURE__ */ import_react5.default.createElement("div", { className: "hawa-mt-4 hawa-font-bold" }, props.question),
|
863
|
-
/* @__PURE__ */ import_react5.default.createElement("div", { className: "hawa-flex hawa-w-full hawa-flex-row hawa-gap-1 hawa-rounded " }, /* @__PURE__ */ import_react5.default.createElement(
|
864
|
-
import_react_hook_form.Controller,
|
865
|
-
{
|
866
|
-
control,
|
867
|
-
name: "source",
|
868
|
-
render: ({ field }) => {
|
869
|
-
var _a2, _b2;
|
870
|
-
return /* @__PURE__ */ import_react5.default.createElement(
|
871
|
-
Radio,
|
872
|
-
{
|
873
|
-
direction: props.direction,
|
874
|
-
orientation: "vertical",
|
875
|
-
options: optionsWithOther,
|
876
|
-
defaultValue: field.value,
|
877
|
-
onChange: (e) => field.onChange(e.value),
|
878
|
-
helperText: (_b2 = (_a2 = formState.errors.source) == null ? void 0 : _a2.message) == null ? void 0 : _b2.toString()
|
879
|
-
}
|
880
|
-
);
|
881
|
-
}
|
882
|
-
}
|
883
|
-
)),
|
884
|
-
/* @__PURE__ */ import_react5.default.createElement("div", null, /* @__PURE__ */ import_react5.default.createElement(
|
885
|
-
import_react_hook_form.Controller,
|
886
|
-
{
|
887
|
-
control,
|
888
|
-
name: "feedback",
|
889
|
-
render: ({ field }) => {
|
890
|
-
var _a2, _b2;
|
891
|
-
return /* @__PURE__ */ import_react5.default.createElement(
|
892
|
-
Textarea,
|
893
|
-
{
|
894
|
-
...field,
|
895
|
-
textareaProps: {
|
896
|
-
onChange: (e) => field.onChange(e.target.value),
|
897
|
-
disabled: selectedSource !== "other"
|
898
|
-
},
|
899
|
-
helperText: (_b2 = (_a2 = formState.errors.feedback) == null ? void 0 : _a2.message) == null ? void 0 : _b2.toString()
|
900
|
-
}
|
901
|
-
);
|
902
|
-
}
|
903
|
-
}
|
904
|
-
))
|
905
|
-
),
|
906
|
-
/* @__PURE__ */ import_react5.default.createElement(Button, { type: "submit", className: "hawa-mt-4 hawa-w-full" }, ((_b = props.texts) == null ? void 0 : _b.submit) || "Submit")
|
907
|
-
))
|
908
|
-
)
|
909
|
-
);
|
910
|
-
};
|
911
|
-
|
912
|
-
// blocks/feedback/FeedbackRating.tsx
|
913
|
-
var import_react6 = __toESM(require("react"));
|
914
|
-
var FeedbackRating = ({
|
915
|
-
position = "bottom-right",
|
916
|
-
...props
|
917
|
-
}) => {
|
918
|
-
const [closed, setClosed] = (0, import_react6.useState)(false);
|
919
|
-
const [answered, setAnswered] = (0, import_react6.useState)(false);
|
920
|
-
const [clickedOption, setClickedOption] = (0, import_react6.useState)(null);
|
921
|
-
const [closingTimer, setClosingTimer] = (0, import_react6.useState)(5);
|
922
|
-
const popUpRef = (0, import_react6.useRef)(null);
|
923
|
-
const boxPosition = {
|
924
|
-
"bottom-right": "hawa-right-4",
|
925
|
-
"bottom-left": "hawa-left-4"
|
926
|
-
};
|
927
|
-
(0, import_react6.useEffect)(() => {
|
928
|
-
const timeoutHide = setTimeout(() => {
|
929
|
-
if (closingTimer >= 0) {
|
930
|
-
setClosingTimer(closingTimer - 1);
|
931
|
-
}
|
932
|
-
}, 1e3);
|
933
|
-
return () => {
|
934
|
-
clearTimeout(timeoutHide);
|
935
|
-
};
|
936
|
-
}, [closingTimer]);
|
937
|
-
const slowClose = () => {
|
938
|
-
setClosed(true);
|
939
|
-
setTimeout(() => {
|
940
|
-
if (popUpRef.current) {
|
941
|
-
popUpRef.current.removeChild(popUpRef.current.children[0]);
|
942
|
-
}
|
943
|
-
}, 200);
|
944
|
-
};
|
945
|
-
return /* @__PURE__ */ import_react6.default.createElement(
|
946
|
-
"div",
|
947
|
-
{
|
948
|
-
ref: popUpRef,
|
949
|
-
className: cn(
|
950
|
-
props.banner ? "hawa-fixed hawa-bottom-0 hawa-left-0 hawa-w-full hawa-px-0 md:hawa-px-4" : "hawa-fixed hawa-bottom-4 ",
|
951
|
-
boxPosition[position]
|
952
|
-
)
|
953
|
-
},
|
954
|
-
/* @__PURE__ */ import_react6.default.createElement(
|
955
|
-
"div",
|
956
|
-
{
|
957
|
-
className: cn(
|
958
|
-
"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",
|
959
|
-
closed ? "hawa-opacity-0" : "hawa-opacity-100",
|
960
|
-
props.banner && "hawa-rounded-none hawa-px-4 md:hawa-rounded-t md:hawa-px-64"
|
961
|
-
)
|
962
|
-
},
|
963
|
-
/* @__PURE__ */ import_react6.default.createElement("div", { className: "hawa-absolute hawa-left-2 hawa-top-2 hawa-p-1.5 hawa-text-sm" }, props.title),
|
964
|
-
/* @__PURE__ */ import_react6.default.createElement(
|
965
|
-
"button",
|
966
|
-
{
|
967
|
-
type: "button",
|
968
|
-
className: "hawa-absolute hawa-right-2 hawa-top-2 hawa-inline-flex hawa-h-8 hawa-w-8 hawa-rounded hawa-p-1.5 hawa-text-gray-400 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",
|
969
|
-
"data-dismiss-target": "#toast-default",
|
970
|
-
"aria-label": "Close",
|
971
|
-
onClick: () => slowClose()
|
972
|
-
},
|
973
|
-
/* @__PURE__ */ import_react6.default.createElement(
|
974
|
-
"svg",
|
975
|
-
{
|
976
|
-
"aria-hidden": "true",
|
977
|
-
className: "hawa-h-5 hawa-w-5",
|
978
|
-
fill: "currentColor",
|
979
|
-
viewBox: "0 0 20 20"
|
980
|
-
},
|
981
|
-
/* @__PURE__ */ import_react6.default.createElement(
|
982
|
-
"path",
|
983
|
-
{
|
984
|
-
fillRule: "evenodd",
|
985
|
-
d: "M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",
|
986
|
-
clipRule: "evenodd"
|
987
|
-
}
|
988
|
-
)
|
989
|
-
)
|
990
|
-
),
|
991
|
-
/* @__PURE__ */ import_react6.default.createElement("div", { className: "hawa-mt-8" }, props.question),
|
992
|
-
/* @__PURE__ */ import_react6.default.createElement("div", { className: "hawa-flex hawa-w-full hawa-flex-row hawa-gap-1 hawa-rounded" }, props.options && props.options.map((op, i) => /* @__PURE__ */ import_react6.default.createElement(
|
993
|
-
"span",
|
994
|
-
{
|
995
|
-
key: i,
|
996
|
-
onClick: () => {
|
997
|
-
if (props.onOptionClicked) {
|
998
|
-
props.onOptionClicked(op);
|
999
|
-
}
|
1000
|
-
setClickedOption(op);
|
1001
|
-
setAnswered(true);
|
1002
|
-
const timeoutDestroy = setTimeout(() => {
|
1003
|
-
setClosed(true);
|
1004
|
-
}, 4800);
|
1005
|
-
setTimeout(() => {
|
1006
|
-
var _a, _b;
|
1007
|
-
(_b = popUpRef.current) == null ? void 0 : _b.removeChild(
|
1008
|
-
(_a = popUpRef.current) == null ? void 0 : _a.children[0]
|
1009
|
-
);
|
1010
|
-
clearTimeout(timeoutDestroy);
|
1011
|
-
}, 5300);
|
1012
|
-
},
|
1013
|
-
className: cn(
|
1014
|
-
"hawa-w-full hawa-cursor-pointer hawa-rounded hawa-border hawa-p-4 hawa-text-center hawa-transition-all ",
|
1015
|
-
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"
|
1016
|
-
)
|
1017
|
-
},
|
1018
|
-
op
|
1019
|
-
))),
|
1020
|
-
props.texts && /* @__PURE__ */ import_react6.default.createElement("div", { className: " hawa-flex hawa-flex-row hawa-justify-between hawa-text-xs" }, /* @__PURE__ */ import_react6.default.createElement("span", null, props.texts.least), /* @__PURE__ */ import_react6.default.createElement("span", null, props.texts.most)),
|
1021
|
-
answered && /* @__PURE__ */ import_react6.default.createElement("div", { className: "hawa-absolute hawa-left-0 hawa-top-0 hawa-flex hawa-h-full hawa-w-full hawa-flex-col hawa-items-center hawa-justify-center hawa-gap-2 hawa-rounded hawa-bg-black hawa-bg-opacity-80 hawa-p-4 hawa-text-center hawa-transition-all" }, /* @__PURE__ */ import_react6.default.createElement("span", { className: "hawa-font-bold hawa-text-white" }, "Thank you for your answer. This box will disappear in", " " + closingTimer, " seconds"), /* @__PURE__ */ import_react6.default.createElement("div", { className: "hawa-flex hawa-flex-row hawa-gap-2" }, /* @__PURE__ */ import_react6.default.createElement(Button, { variant: "secondary", onClick: () => slowClose() }, "Close")))
|
1022
|
-
)
|
1023
|
-
);
|
1024
|
-
};
|
1025
|
-
|
1026
|
-
// blocks/feedback/FeedbackEmoji.tsx
|
1027
|
-
var import_react10 = __toESM(require("react"));
|
1028
|
-
|
1029
|
-
// elements/popover/Popover.tsx
|
1030
|
-
var React11 = __toESM(require("react"));
|
1031
|
-
var PopoverPrimitive = __toESM(require("@radix-ui/react-popover"));
|
1032
|
-
var PopoverContent = React11.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ React11.createElement(PopoverPrimitive.Portal, null, /* @__PURE__ */ React11.createElement(
|
1033
|
-
PopoverPrimitive.Content,
|
1034
|
-
{
|
1035
|
-
ref,
|
1036
|
-
align,
|
1037
|
-
sideOffset,
|
1038
|
-
className: cn(
|
1039
|
-
"dark:dark-shadow hawa-z-50 hawa-rounded hawa-border hawa-bg-popover hawa-text-popover-foreground hawa-shadow-md hawa-outline-none data-[state=open]:hawa-animate-in data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=open]:hawa-fade-in-0 data-[state=closed]:hawa-zoom-out-95 data-[state=open]:hawa-zoom-in-95 data-[side=bottom]:hawa-slide-in-from-top-2 data-[side=left]:hawa-slide-in-from-right-2 data-[side=right]:hawa-slide-in-from-left-2 data-[side=top]:hawa-slide-in-from-bottom-2",
|
1040
|
-
className
|
1041
|
-
),
|
1042
|
-
...props
|
1043
|
-
}
|
1044
|
-
)));
|
1045
|
-
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
1046
|
-
var Popover = ({
|
1047
|
-
trigger,
|
1048
|
-
children,
|
1049
|
-
className,
|
1050
|
-
align = "center",
|
1051
|
-
side,
|
1052
|
-
sideOffset = 4,
|
1053
|
-
open,
|
1054
|
-
width = "default",
|
1055
|
-
disableTrigger,
|
1056
|
-
contentProps,
|
1057
|
-
triggerProps,
|
1058
|
-
...props
|
1059
|
-
}) => {
|
1060
|
-
let widthStyles = {
|
1061
|
-
trigger: "var(--radix-popover-trigger-width)",
|
1062
|
-
default: "auto"
|
1063
|
-
};
|
1064
|
-
return /* @__PURE__ */ React11.createElement(PopoverPrimitive.Root, { open, ...props }, /* @__PURE__ */ React11.createElement(
|
1065
|
-
PopoverPrimitive.Trigger,
|
1066
|
-
{
|
1067
|
-
className: "hawa-w-full",
|
1068
|
-
disabled: disableTrigger,
|
1069
|
-
...triggerProps
|
1070
|
-
},
|
1071
|
-
trigger
|
1072
|
-
), /* @__PURE__ */ React11.createElement(
|
1073
|
-
PopoverContent,
|
1074
|
-
{
|
1075
|
-
side,
|
1076
|
-
className,
|
1077
|
-
align,
|
1078
|
-
sideOffset,
|
1079
|
-
style: {
|
1080
|
-
width: widthStyles[width]
|
1081
|
-
},
|
1082
|
-
...contentProps
|
1083
|
-
},
|
1084
|
-
children
|
1085
|
-
));
|
1086
|
-
};
|
1087
|
-
|
1088
|
-
// icons/Emojis.tsx
|
1089
|
-
var import_react7 = __toESM(require("react"));
|
1090
|
-
var VeryGoodEmoji = () => /* @__PURE__ */ import_react7.default.createElement(
|
1091
|
-
"svg",
|
1092
|
-
{
|
1093
|
-
fill: "none",
|
1094
|
-
height: "16",
|
1095
|
-
viewBox: "0 0 16 16",
|
1096
|
-
width: "16",
|
1097
|
-
xmlns: "http://www.w3.org/2000/svg"
|
1098
|
-
},
|
1099
|
-
/* @__PURE__ */ import_react7.default.createElement("g", { clipPath: "url(#clip0_53_166)" }, /* @__PURE__ */ import_react7.default.createElement(
|
1100
|
-
"path",
|
1101
|
-
{
|
1102
|
-
clipRule: "evenodd",
|
1103
|
-
d: "M14.5 8C14.5 11.5899 11.5899 14.5 8 14.5C4.41015 14.5 1.5 11.5899 1.5 8C1.5 4.41015 4.41015 1.5 8 1.5C11.5899 1.5 14.5 4.41015 14.5 8ZM16 8C16 12.4183 12.4183 16 8 16C3.58172 16 0 12.4183 0 8C0 3.58172 3.58172 0 8 0C12.4183 0 16 3.58172 16 8ZM4.5 8.97498H3.875V9.59998C3.875 11.4747 5.81046 12.8637 7.99817 12.8637C10.1879 12.8637 12.125 11.4832 12.125 9.59998V8.97498H11.5H4.5ZM7.99817 11.6137C6.59406 11.6137 5.63842 10.9482 5.28118 10.225H10.7202C10.3641 10.9504 9.40797 11.6137 7.99817 11.6137Z",
|
1104
|
-
fill: "currentColor",
|
1105
|
-
fillRule: "evenodd"
|
1106
|
-
}
|
1107
|
-
), /* @__PURE__ */ import_react7.default.createElement(
|
1108
|
-
"path",
|
1109
|
-
{
|
1110
|
-
clipRule: "evenodd",
|
1111
|
-
d: "M6.15295 4.92093L5.375 3.5L4.59705 4.92093L3 5.21885L4.11625 6.39495L3.90717 8L5.375 7.30593L6.84283 8L6.63375 6.39495L7.75 5.21885L6.15295 4.92093ZM11.403 4.92093L10.625 3.5L9.84705 4.92093L8.25 5.21885L9.36625 6.39495L9.15717 8L10.625 7.30593L12.0928 8L11.8837 6.39495L13 5.21885L11.403 4.92093Z",
|
1112
|
-
fill: "#FF990A",
|
1113
|
-
fillRule: "evenodd"
|
1114
|
-
}
|
1115
|
-
))
|
1116
|
-
);
|
1117
|
-
var GoodEmoji = () => /* @__PURE__ */ import_react7.default.createElement(
|
1118
|
-
"svg",
|
1119
|
-
{
|
1120
|
-
fill: "none",
|
1121
|
-
height: "16",
|
1122
|
-
viewBox: "0 0 16 16",
|
1123
|
-
width: "16",
|
1124
|
-
xmlns: "http://www.w3.org/2000/svg"
|
1125
|
-
},
|
1126
|
-
/* @__PURE__ */ import_react7.default.createElement("g", { clipPath: "url(#clip0_53_167)" }, /* @__PURE__ */ import_react7.default.createElement(
|
1127
|
-
"path",
|
1128
|
-
{
|
1129
|
-
clipRule: "evenodd",
|
1130
|
-
d: "M14.5 8C14.5 11.5899 11.5899 14.5 8 14.5C4.41015 14.5 1.5 11.5899 1.5 8C1.5 4.41015 4.41015 1.5 8 1.5C11.5899 1.5 14.5 4.41015 14.5 8ZM16 8C16 12.4183 12.4183 16 8 16C3.58172 16 0 12.4183 0 8C0 3.58172 3.58172 0 8 0C12.4183 0 16 3.58172 16 8ZM11.5249 10.8478L11.8727 10.3286L10.8342 9.6329L10.4863 10.1522C9.94904 10.9543 9.0363 11.4802 8.00098 11.4802C6.96759 11.4802 6.05634 10.9563 5.51863 10.1567L5.16986 9.63804L4.13259 10.3356L4.48137 10.8542C5.2414 11.9844 6.53398 12.7302 8.00098 12.7302C9.47073 12.7302 10.7654 11.9816 11.5249 10.8478ZM6.75 6.75C6.75 7.30228 6.30228 7.75 5.75 7.75C5.19772 7.75 4.75 7.30228 4.75 6.75C4.75 6.19772 5.19772 5.75 5.75 5.75C6.30228 5.75 6.75 6.19772 6.75 6.75ZM10.25 7.75C10.8023 7.75 11.25 7.30228 11.25 6.75C11.25 6.19772 10.8023 5.75 10.25 5.75C9.69771 5.75 9.25 6.19772 9.25 6.75C9.25 7.30228 9.69771 7.75 10.25 7.75Z",
|
1131
|
-
fill: "currentColor",
|
1132
|
-
fillRule: "evenodd"
|
1133
|
-
}
|
1134
|
-
))
|
1135
|
-
);
|
1136
|
-
var BadEmoji = () => /* @__PURE__ */ import_react7.default.createElement(
|
1137
|
-
"svg",
|
1138
|
-
{
|
1139
|
-
fill: "none",
|
1140
|
-
height: "16",
|
1141
|
-
viewBox: "0 0 16 16",
|
1142
|
-
width: "16",
|
1143
|
-
xmlns: "http://www.w3.org/2000/svg"
|
1144
|
-
},
|
1145
|
-
/* @__PURE__ */ import_react7.default.createElement("g", { clipPath: "url(#clip0_53_152)" }, /* @__PURE__ */ import_react7.default.createElement(
|
1146
|
-
"path",
|
1147
|
-
{
|
1148
|
-
clipRule: "evenodd",
|
1149
|
-
d: "M14.5 8C14.5 11.5899 11.5899 14.5 8 14.5C4.41015 14.5 1.5 11.5899 1.5 8C1.5 4.41015 4.41015 1.5 8 1.5C11.5899 1.5 14.5 4.41015 14.5 8ZM16 8C16 12.4183 12.4183 16 8 16C3.58172 16 0 12.4183 0 8C0 3.58172 3.58172 0 8 0C12.4183 0 16 3.58172 16 8ZM5.75 7.75C6.30228 7.75 6.75 7.30228 6.75 6.75C6.75 6.19772 6.30228 5.75 5.75 5.75C5.19772 5.75 4.75 6.19772 4.75 6.75C4.75 7.30228 5.19772 7.75 5.75 7.75ZM11.25 6.75C11.25 7.30228 10.8023 7.75 10.25 7.75C9.69771 7.75 9.25 7.30228 9.25 6.75C9.25 6.19772 9.69771 5.75 10.25 5.75C10.8023 5.75 11.25 6.19772 11.25 6.75ZM11.5249 11.2622L11.8727 11.7814L10.8342 12.4771L10.4863 11.9578C9.94904 11.1557 9.0363 10.6298 8.00098 10.6298C6.96759 10.6298 6.05634 11.1537 5.51863 11.9533L5.16986 12.4719L4.13259 11.7744L4.48137 11.2558C5.2414 10.1256 6.53398 9.37982 8.00098 9.37982C9.47073 9.37982 10.7654 10.1284 11.5249 11.2622Z",
|
1150
|
-
fill: "currentColor",
|
1151
|
-
fillRule: "evenodd"
|
1152
|
-
}
|
1153
|
-
))
|
1154
|
-
);
|
1155
|
-
var VeryBadEmoji = () => /* @__PURE__ */ import_react7.default.createElement(
|
1156
|
-
"svg",
|
1157
|
-
{
|
1158
|
-
fill: "none",
|
1159
|
-
height: "16",
|
1160
|
-
viewBox: "0 0 16 16",
|
1161
|
-
width: "16",
|
1162
|
-
xmlns: "http://www.w3.org/2000/svg"
|
1163
|
-
},
|
1164
|
-
/* @__PURE__ */ import_react7.default.createElement("g", { clipPath: "url(#clip0_53_151)" }, /* @__PURE__ */ import_react7.default.createElement(
|
1165
|
-
"path",
|
1166
|
-
{
|
1167
|
-
d: "M11.841 12.0225C12.7197 12.9324 12.7197 14.4077 11.841 15.3176C10.9623 16.2275 9.53769 16.2275 8.65901 15.3176C7.78033 14.4077 7.78033 12.9324 8.65901 12.0225L10.25 10.375L11.841 12.0225Z",
|
1168
|
-
fill: "#0070F3"
|
1169
|
-
}
|
1170
|
-
), /* @__PURE__ */ import_react7.default.createElement(
|
1171
|
-
"path",
|
1172
|
-
{
|
1173
|
-
clipRule: "evenodd",
|
1174
|
-
d: "M8 1.5C4.41015 1.5 1.5 4.41015 1.5 8C1.5 10.9668 3.48826 13.4711 6.20649 14.2496L5.79351 15.6916C2.44895 14.7338 0 11.6539 0 8C0 3.58172 3.58172 0 8 0C12.4183 0 16 3.58172 16 8C16 9.4652 15.6054 10.8405 14.9162 12.023L13.6203 11.2677C14.1794 10.3083 14.5 9.19272 14.5 8C14.5 4.41015 11.5899 1.5 8 1.5ZM6.75 6.75C6.75 7.30228 6.30228 7.75 5.75 7.75C5.19772 7.75 4.75 7.30228 4.75 6.75C4.75 6.19772 5.19772 5.75 5.75 5.75C6.30228 5.75 6.75 6.19772 6.75 6.75ZM10.25 7.75C10.8023 7.75 11.25 7.30228 11.25 6.75C11.25 6.19772 10.8023 5.75 10.25 5.75C9.69771 5.75 9.25 6.19772 9.25 6.75C9.25 7.30228 9.69771 7.75 10.25 7.75Z",
|
1175
|
-
fill: "currentColor",
|
1176
|
-
fillRule: "evenodd"
|
1177
|
-
}
|
1178
|
-
))
|
1179
|
-
);
|
1180
|
-
|
1181
|
-
// icons/InputIcons.tsx
|
1182
|
-
var import_react8 = __toESM(require("react"));
|
1183
|
-
|
1184
|
-
// icons/CommonIcons.tsx
|
1185
|
-
var import_react9 = __toESM(require("react"));
|
1186
|
-
|
1187
|
-
// blocks/feedback/FeedbackEmoji.tsx
|
1188
|
-
var FeedbackEmoji = (props) => {
|
1189
|
-
const [selectedEmoji, setSelectedEmoji] = (0, import_react10.useState)(null);
|
1190
|
-
const [loadingSubmit, setLoadingSubmit] = (0, import_react10.useState)(false);
|
1191
|
-
const [feedbackText, setFeedbackText] = (0, import_react10.useState)("");
|
1192
|
-
const [helperText, setHelperText] = (0, import_react10.useState)(false);
|
1193
|
-
let emojis = [
|
1194
|
-
{ icon: /* @__PURE__ */ import_react10.default.createElement(VeryGoodEmoji, null), value: "very-good" },
|
1195
|
-
{ icon: /* @__PURE__ */ import_react10.default.createElement(GoodEmoji, null), value: "good" },
|
1196
|
-
{ icon: /* @__PURE__ */ import_react10.default.createElement(BadEmoji, null), value: "bad" },
|
1197
|
-
{ icon: /* @__PURE__ */ import_react10.default.createElement(VeryBadEmoji, null), value: "very-bad" }
|
1198
|
-
];
|
1199
|
-
const onFeedbackSubmit = async () => {
|
1200
|
-
if (feedbackText) {
|
1201
|
-
setLoadingSubmit(true);
|
1202
|
-
try {
|
1203
|
-
await props.handleSubmit({
|
1204
|
-
choice: selectedEmoji,
|
1205
|
-
feedback: feedbackText
|
1206
|
-
});
|
1207
|
-
} catch (error) {
|
1208
|
-
console.error("Error during submission:", error);
|
1209
|
-
setLoadingSubmit(false);
|
1210
|
-
}
|
1211
|
-
await setLoadingSubmit(false);
|
1212
|
-
} else {
|
1213
|
-
setLoadingSubmit(false);
|
1214
|
-
setHelperText(true);
|
1215
|
-
}
|
1216
|
-
};
|
1217
|
-
return /* @__PURE__ */ import_react10.default.createElement(
|
1218
|
-
"div",
|
1219
|
-
{
|
1220
|
-
className: cn(
|
1221
|
-
"hawa-flex hawa-flex-col hawa-rounded hawa-border hawa-p-2 hawa-transition-all",
|
1222
|
-
selectedEmoji ? "hawa-h-[189px] hawa-min-w-fit" : "hawa-h-[44px] "
|
1223
|
-
)
|
1224
|
-
},
|
1225
|
-
/* @__PURE__ */ import_react10.default.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-justify-center hawa-gap-2 " }, /* @__PURE__ */ import_react10.default.createElement("div", { className: "hawa-flex hawa-flex-row hawa-justify-center hawa-gap-0.5 " }, emojis.map((emoji, i) => /* @__PURE__ */ import_react10.default.createElement(
|
1226
|
-
Button,
|
1227
|
-
{
|
1228
|
-
key: i,
|
1229
|
-
onClick: () => {
|
1230
|
-
if (selectedEmoji === emoji.value) {
|
1231
|
-
setSelectedEmoji("");
|
1232
|
-
} else {
|
1233
|
-
setSelectedEmoji(emoji.value);
|
1234
|
-
}
|
1235
|
-
},
|
1236
|
-
variant: "ghost",
|
1237
|
-
size: "smallIcon",
|
1238
|
-
className: cn(
|
1239
|
-
selectedEmoji === emoji.value ? "hawa-bg-primary/10 hover:hawa-bg-primary/10 " : "hawa-text-[#666666]"
|
1240
|
-
)
|
1241
|
-
},
|
1242
|
-
emoji.icon
|
1243
|
-
)))),
|
1244
|
-
/* @__PURE__ */ import_react10.default.createElement(
|
1245
|
-
"div",
|
1246
|
-
{
|
1247
|
-
className: cn(
|
1248
|
-
"hawa-flex hawa-flex-col hawa-overflow-clip hawa-transition-all hawa-duration-500 hawa-ease-in-out ",
|
1249
|
-
selectedEmoji ? "hawa-visible hawa-opacity-100" : "hawa-invisible hawa-opacity-0 "
|
1250
|
-
)
|
1251
|
-
},
|
1252
|
-
props.showSuccess ? /* @__PURE__ */ import_react10.default.createElement("div", { className: "hawa-flex hawa-h-full hawa-flex-col hawa-items-center hawa-justify-center hawa-gap-2 hawa-pt-4" }, /* @__PURE__ */ import_react10.default.createElement("div", { className: "hawa-rounded hawa-bg-primary hawa-p-2 hawa-text-primary-foreground" }, /* @__PURE__ */ import_react10.default.createElement(
|
1253
|
-
"svg",
|
1254
|
-
{
|
1255
|
-
stroke: "currentColor",
|
1256
|
-
fill: "currentColor",
|
1257
|
-
strokeWidth: "0",
|
1258
|
-
viewBox: "0 0 512 512",
|
1259
|
-
height: "0.5em",
|
1260
|
-
width: "0.5em"
|
1261
|
-
},
|
1262
|
-
/* @__PURE__ */ import_react10.default.createElement("path", { d: "M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z" })
|
1263
|
-
)), /* @__PURE__ */ import_react10.default.createElement("div", { className: "hawa-flex hawa-flex-col hawa-text-center hawa-text-sm" }, /* @__PURE__ */ import_react10.default.createElement("span", null, "Your feedback has been received!"), /* @__PURE__ */ import_react10.default.createElement("span", null, "Thank you for your help"))) : /* @__PURE__ */ import_react10.default.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-1 hawa-p-1" }, /* @__PURE__ */ import_react10.default.createElement(
|
1264
|
-
Popover,
|
1265
|
-
{
|
1266
|
-
className: "hawa-select-none hawa-p-1 hawa-text-xs ",
|
1267
|
-
open: helperText,
|
1268
|
-
trigger: /* @__PURE__ */ import_react10.default.createElement(
|
1269
|
-
Textarea,
|
1270
|
-
{
|
1271
|
-
classNames: {
|
1272
|
-
textarea: "hawa-mt-2 hawa-h-full hawa-resize-none"
|
1273
|
-
},
|
1274
|
-
placeholder: "Your feedback",
|
1275
|
-
onChange: (e) => {
|
1276
|
-
if (e.target.value) {
|
1277
|
-
setHelperText(false);
|
1278
|
-
}
|
1279
|
-
setFeedbackText(e.target.value);
|
1280
|
-
}
|
1281
|
-
}
|
1282
|
-
)
|
1283
|
-
},
|
1284
|
-
/* @__PURE__ */ import_react10.default.createElement("span", { className: "hawa-m-0" }, "Please enter your feedback")
|
1285
|
-
), /* @__PURE__ */ import_react10.default.createElement(
|
1286
|
-
Button,
|
1287
|
-
{
|
1288
|
-
isLoading: loadingSubmit,
|
1289
|
-
onClick: onFeedbackSubmit,
|
1290
|
-
className: "hawa-w-full",
|
1291
|
-
size: "sm"
|
1292
|
-
},
|
1293
|
-
"Submit"
|
1294
|
-
))
|
1295
|
-
)
|
1296
|
-
);
|
1297
|
-
};
|
1298
|
-
|
1299
|
-
// blocks/feedback/FeedbackForm.tsx
|
1300
|
-
var import_react12 = __toESM(require("react"));
|
1301
|
-
var import_react_hook_form2 = require("react-hook-form");
|
1302
|
-
var import_zod2 = require("@hookform/resolvers/zod");
|
1303
|
-
var z2 = __toESM(require("zod"));
|
1304
|
-
|
1305
|
-
// elements/select/Select.tsx
|
1306
|
-
var import_react11 = __toESM(require("react"));
|
1307
|
-
var import_react_select = __toESM(require("react-select"));
|
1308
|
-
var import_creatable = __toESM(require("react-select/creatable"));
|
1309
|
-
var import_clsx2 = __toESM(require("clsx"));
|
1310
|
-
var Select = ({
|
1311
|
-
labelProps,
|
1312
|
-
labelKey = "label",
|
1313
|
-
...props
|
1314
|
-
}) => {
|
1315
|
-
const NoOption = () => {
|
1316
|
-
var _a, _b;
|
1317
|
-
return /* @__PURE__ */ import_react11.default.createElement("div", null, (_b = (_a = props.texts) == null ? void 0 : _a.noOptions) != null ? _b : "No Items Found");
|
1318
|
-
};
|
1319
|
-
const Control = ({ children, innerProps, innerRef }) => {
|
1320
|
-
return /* @__PURE__ */ import_react11.default.createElement(
|
1321
|
-
"div",
|
1322
|
-
{
|
1323
|
-
ref: innerRef,
|
1324
|
-
className: (0, import_clsx2.default)(
|
1325
|
-
"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"
|
1326
|
-
),
|
1327
|
-
...innerProps
|
1328
|
-
},
|
1329
|
-
children
|
1330
|
-
);
|
1331
|
-
};
|
1332
|
-
const Option = ({ children, innerProps, innerRef }) => {
|
1333
|
-
return /* @__PURE__ */ import_react11.default.createElement(
|
1334
|
-
"div",
|
1335
|
-
{
|
1336
|
-
ref: innerRef,
|
1337
|
-
className: cn(
|
1338
|
-
"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"
|
1339
|
-
),
|
1340
|
-
...innerProps
|
1341
|
-
},
|
1342
|
-
children
|
1343
|
-
);
|
1344
|
-
};
|
1345
|
-
const Menu = ({
|
1346
|
-
cx,
|
1347
|
-
children,
|
1348
|
-
getStyles,
|
1349
|
-
innerProps,
|
1350
|
-
innerRef,
|
1351
|
-
...menuProps
|
1352
|
-
}) => {
|
1353
|
-
const menuOpen = menuProps.selectProps.menuIsOpen;
|
1354
|
-
return /* @__PURE__ */ import_react11.default.createElement(
|
1355
|
-
"div",
|
1356
|
-
{
|
1357
|
-
className: cn(
|
1358
|
-
"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",
|
1359
|
-
props.phoneCode ? "hawa-p-1.5" : "hawa-w-full hawa-p-1.5",
|
1360
|
-
menuOpen && "hawa-animate-in hawa-fade-in-0 hawa-zoom-in-95 "
|
1361
|
-
),
|
1362
|
-
ref: innerRef,
|
1363
|
-
...innerProps
|
1364
|
-
},
|
1365
|
-
children
|
1366
|
-
);
|
1367
|
-
};
|
1368
|
-
return /* @__PURE__ */ import_react11.default.createElement(
|
1369
|
-
"div",
|
1370
|
-
{
|
1371
|
-
className: cn(
|
1372
|
-
"hawa-flex hawa-flex-col hawa-gap-2",
|
1373
|
-
props.width === "fit" ? "hawa-w-fit" : "hawa-w-full"
|
1374
|
-
)
|
1375
|
-
},
|
1376
|
-
props.label && /* @__PURE__ */ import_react11.default.createElement(Label, { ...labelProps }, props.label),
|
1377
|
-
props.isLoading ? /* @__PURE__ */ import_react11.default.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" }) : !props.isCreatable ? (
|
1378
|
-
// TODO: enable keyboard to go to the next item in the list
|
1379
|
-
/* @__PURE__ */ import_react11.default.createElement(
|
1380
|
-
import_react_select.default,
|
1381
|
-
{
|
1382
|
-
noOptionsMessage: NoOption,
|
1383
|
-
classNames: {
|
1384
|
-
control: () => cn(
|
1385
|
-
props.phoneCode && "hawa-rounded-r-none",
|
1386
|
-
props.controlClassNames
|
1387
|
-
),
|
1388
|
-
container: () => cn(
|
1389
|
-
"hawa-rounded",
|
1390
|
-
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] ",
|
1391
|
-
"hawa-block hawa-w-full hawa-rounded hawa-border hawa-transition-all hawa-bg-background hawa-p-0 hawa-px-1 hawa-text-sm",
|
1392
|
-
props.disabled ? "hawa-cursor-not-allowed" : "hawa-cursor-pointer"
|
1393
|
-
),
|
1394
|
-
placeholder: () => "hawa-text-muted-foreground hawa-cursor-pointer hawa-px-1",
|
1395
|
-
valueContainer: () => "hawa-text-foreground hawa-px-1 ",
|
1396
|
-
singleValue: () => "hawa-text-foreground",
|
1397
|
-
indicatorsContainer: () => cn(
|
1398
|
-
"hawa-cursor-pointer hawa-text-muted-foreground",
|
1399
|
-
props.hideIndicator ? "hawa-invisible" : "hawa-px-1"
|
1400
|
-
)
|
1401
|
-
},
|
1402
|
-
unstyled: true,
|
1403
|
-
autoFocus: true,
|
1404
|
-
components: props.hideIndicator ? { Option, Menu, IndicatorsContainer: () => null } : { Option, Menu },
|
1405
|
-
onChange: (newValue, action) => props.onChange(newValue, action),
|
1406
|
-
options: props.options,
|
1407
|
-
getOptionLabel: props.getOptionLabel,
|
1408
|
-
defaultValue: props.defaultValue,
|
1409
|
-
placeholder: props.placeholder,
|
1410
|
-
isDisabled: props.disabled,
|
1411
|
-
isClearable: props.isClearable,
|
1412
|
-
isMulti: props.isMulti,
|
1413
|
-
isSearchable: props.isSearchable
|
1414
|
-
}
|
1415
|
-
)
|
1416
|
-
) : /* @__PURE__ */ import_react11.default.createElement(
|
1417
|
-
import_creatable.default,
|
1418
|
-
{
|
1419
|
-
formatCreateLabel: (inputValue) => {
|
1420
|
-
var _a, _b;
|
1421
|
-
return `${(_b = (_a = props.texts) == null ? void 0 : _a.createLabel) != null ? _b : "Create"} "${inputValue}"`;
|
1422
|
-
},
|
1423
|
-
classNames: {
|
1424
|
-
container: () => cn(
|
1425
|
-
"hawa-rounded",
|
1426
|
-
props.disabled ? "hawa-cursor-not-allowed" : "hawa-cursor-pointer"
|
1427
|
-
),
|
1428
|
-
placeholder: () => "hawa-px-2 hawa-text-muted-foreground",
|
1429
|
-
input: () => "hawa-text-primary hawa-px-2",
|
1430
|
-
valueContainer: () => "hawa-text-white dark:hawa-text-muted-foreground",
|
1431
|
-
singleValue: () => "hawa-text-black dark:hawa-text-white hawa-px-2",
|
1432
|
-
indicatorsContainer: () => " hawa-px-2 hawa-cursor-pointer hawa-text-muted-foreground"
|
1433
|
-
},
|
1434
|
-
unstyled: true,
|
1435
|
-
options: props.options,
|
1436
|
-
isClearable: props.isClearable,
|
1437
|
-
isMulti: props.isMulti,
|
1438
|
-
isSearchable: props.isSearchable,
|
1439
|
-
placeholder: props.placeholder,
|
1440
|
-
onCreateOption: props.handleCreateOption,
|
1441
|
-
onChange: (newValue, action) => props.onChange(newValue, action),
|
1442
|
-
components: { Control, Option, Menu },
|
1443
|
-
onInputChange: (newValue, action) => props.onInputChange(newValue, action)
|
1444
|
-
}
|
1445
|
-
),
|
1446
|
-
!props.hideHelperText && /* @__PURE__ */ import_react11.default.createElement(
|
1447
|
-
"p",
|
1448
|
-
{
|
1449
|
-
className: cn(
|
1450
|
-
"hawa-my-0 hawa-text-start hawa-text-xs hawa-text-helper-color hawa-transition-all",
|
1451
|
-
props.helperText ? "hawa-h-4 hawa-opacity-100" : "hawa-h-0 hawa-opacity-0"
|
1452
|
-
)
|
1453
|
-
},
|
1454
|
-
props.helperText
|
1455
|
-
)
|
1456
|
-
);
|
1457
|
-
};
|
1458
|
-
|
1459
|
-
// blocks/feedback/FeedbackForm.tsx
|
1460
|
-
var FeedbackForm = (props) => {
|
1461
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
1462
|
-
const formSchema = z2.object({
|
1463
|
-
requestType: z2.string({ required_error: (_b = (_a = props.texts) == null ? void 0 : _a.requestType) == null ? void 0 : _b.required }).min(1, { message: (_d = (_c = props.texts) == null ? void 0 : _c.requestType) == null ? void 0 : _d.required }),
|
1464
|
-
description: z2.string({ required_error: (_f = (_e = props.texts) == null ? void 0 : _e.description) == null ? void 0 : _f.required }).min(10, { message: (_h = (_g = props.texts) == null ? void 0 : _g.description) == null ? void 0 : _h.tooShort })
|
1465
|
-
});
|
1466
|
-
const { handleSubmit, control, formState } = (0, import_react_hook_form2.useForm)({
|
1467
|
-
resolver: (0, import_zod2.zodResolver)(formSchema)
|
1468
|
-
});
|
1469
|
-
return /* @__PURE__ */ import_react12.default.createElement(
|
1470
|
-
Card,
|
1471
|
-
{
|
1472
|
-
className: cn(
|
1473
|
-
props.cardless ? "hawa-border-none hawa-bg-transparent hawa-shadow-none" : ""
|
1474
|
-
),
|
1475
|
-
style: props.cardless ? { boxShadow: "none" } : void 0
|
1476
|
-
},
|
1477
|
-
/* @__PURE__ */ import_react12.default.createElement(CardContent, { headless: true }, /* @__PURE__ */ import_react12.default.createElement(
|
1478
|
-
"form",
|
1479
|
-
{
|
1480
|
-
noValidate: true,
|
1481
|
-
onSubmit: handleSubmit((e) => {
|
1482
|
-
if (props.onSubmit) {
|
1483
|
-
return props.onSubmit(e);
|
1484
|
-
} else {
|
1485
|
-
console.log("Form is submitted but onSubmit prop is missing");
|
1486
|
-
}
|
1487
|
-
}),
|
1488
|
-
className: "hawa-flex hawa-flex-col hawa-gap-4"
|
1489
|
-
},
|
1490
|
-
/* @__PURE__ */ import_react12.default.createElement(Label, null, (_j = (_i = props.texts) == null ? void 0 : _i.requestType) == null ? void 0 : _j.label),
|
1491
|
-
/* @__PURE__ */ import_react12.default.createElement(
|
1492
|
-
import_react_hook_form2.Controller,
|
1493
|
-
{
|
1494
|
-
name: "requestType",
|
1495
|
-
control,
|
1496
|
-
render: ({ field }) => {
|
1497
|
-
var _a2, _b2, _c2, _d2, _e2, _f2;
|
1498
|
-
return /* @__PURE__ */ import_react12.default.createElement(
|
1499
|
-
Select,
|
1500
|
-
{
|
1501
|
-
...field,
|
1502
|
-
...props.selectProps,
|
1503
|
-
onChange: (option) => field.onChange(option.value),
|
1504
|
-
options: props.requestTypes,
|
1505
|
-
helperText: (_b2 = (_a2 = formState.errors.requestType) == null ? void 0 : _a2.message) == null ? void 0 : _b2.toString(),
|
1506
|
-
placeholder: (_d2 = (_c2 = props.texts) == null ? void 0 : _c2.requestType) == null ? void 0 : _d2.placeholder,
|
1507
|
-
texts: {
|
1508
|
-
noOptions: (_f2 = (_e2 = props.texts) == null ? void 0 : _e2.requestType) == null ? void 0 : _f2.noOptions
|
1509
|
-
}
|
1510
|
-
}
|
1511
|
-
);
|
1512
|
-
}
|
1513
|
-
}
|
1514
|
-
),
|
1515
|
-
/* @__PURE__ */ import_react12.default.createElement(Label, null, (_l = (_k = props.texts) == null ? void 0 : _k.description) == null ? void 0 : _l.label),
|
1516
|
-
/* @__PURE__ */ import_react12.default.createElement(
|
1517
|
-
import_react_hook_form2.Controller,
|
1518
|
-
{
|
1519
|
-
name: "description",
|
1520
|
-
control,
|
1521
|
-
render: ({ field }) => {
|
1522
|
-
var _a2, _b2, _c2, _d2;
|
1523
|
-
return /* @__PURE__ */ import_react12.default.createElement(
|
1524
|
-
Textarea,
|
1525
|
-
{
|
1526
|
-
...field,
|
1527
|
-
helperText: formState.errors.description && ((_b2 = (_a2 = formState.errors.description) == null ? void 0 : _a2.message) == null ? void 0 : _b2.toString()),
|
1528
|
-
placeholder: (_d2 = (_c2 = props.texts) == null ? void 0 : _c2.description) == null ? void 0 : _d2.placeholder
|
1529
|
-
}
|
1530
|
-
);
|
1531
|
-
}
|
1532
|
-
}
|
1533
|
-
),
|
1534
|
-
/* @__PURE__ */ import_react12.default.createElement(Button, { type: "submit" }, (_m = props.texts) == null ? void 0 : _m.submit)
|
1535
|
-
))
|
1536
|
-
);
|
1537
|
-
};
|
1538
|
-
// Annotate the CommonJS export names for ESM import in node:
|
1539
|
-
0 && (module.exports = {
|
1540
|
-
FeedbackEmoji,
|
1541
|
-
FeedbackForm,
|
1542
|
-
FeedbackRating,
|
1543
|
-
UserReferralSource
|
1544
|
-
});
|