@sikka/hawa 0.26.29 → 0.26.30
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/Chip-H5BnuDdx.d.ts +36 -0
- package/dist/Chip-hr2gRBJ-.d.mts +36 -0
- package/dist/DropdownMenu-EUL-D3I3.d.mts +95 -0
- package/dist/DropdownMenu-SPisqCzV.d.ts +95 -0
- package/dist/Radio-K1WGpnGA.d.ts +75 -0
- package/dist/Radio-hsrLKNxE.d.mts +75 -0
- package/dist/Toast-VBd4UvlM.d.mts +26 -0
- package/dist/Toast-pOd4uGZz.d.ts +26 -0
- package/dist/accordion/index.d.mts +51 -0
- package/dist/accordion/index.d.ts +51 -0
- package/dist/accordion/index.js +272 -0
- package/dist/accordion/index.js.map +1 -0
- package/dist/accordion/index.mjs +228 -0
- package/dist/accordion/index.mjs.map +1 -0
- package/dist/alert/index.d.mts +29 -0
- package/dist/alert/index.d.ts +29 -0
- package/dist/alert/index.js +443 -0
- package/dist/alert/index.js.map +1 -0
- package/dist/alert/index.mjs +403 -0
- package/dist/alert/index.mjs.map +1 -0
- package/dist/appLayout/index.d.mts +126 -0
- package/dist/appLayout/index.d.ts +126 -0
- package/dist/appLayout/index.js +1326 -0
- package/dist/appLayout/index.js.map +1 -0
- package/dist/appLayout/index.mjs +1286 -0
- package/dist/appLayout/index.mjs.map +1 -0
- package/dist/appMenubar/index.d.mts +33 -0
- package/dist/appMenubar/index.d.ts +33 -0
- package/dist/appMenubar/index.js +282 -0
- package/dist/appMenubar/index.js.map +1 -0
- package/dist/appMenubar/index.mjs +225 -0
- package/dist/appMenubar/index.mjs.map +1 -0
- package/dist/appStores/index.d.mts +8 -0
- package/dist/appStores/index.d.ts +8 -0
- package/dist/appStores/index.js +76 -0
- package/dist/appStores/index.js.map +1 -0
- package/dist/appStores/index.mjs +39 -0
- package/dist/appStores/index.mjs.map +1 -0
- package/dist/appTabs/index.d.mts +18 -0
- package/dist/appTabs/index.d.ts +18 -0
- package/dist/appTabs/index.js +93 -0
- package/dist/appTabs/index.js.map +1 -0
- package/dist/appTabs/index.mjs +51 -0
- package/dist/appTabs/index.mjs.map +1 -0
- package/dist/appTopbar/index.d.mts +44 -0
- package/dist/appTopbar/index.d.ts +44 -0
- package/dist/appTopbar/index.js +484 -0
- package/dist/appTopbar/index.js.map +1 -0
- package/dist/appTopbar/index.mjs +442 -0
- package/dist/appTopbar/index.mjs.map +1 -0
- package/dist/avatar/index.d.mts +16 -0
- package/dist/avatar/index.d.ts +16 -0
- package/dist/avatar/index.js +162 -0
- package/dist/avatar/index.js.map +1 -0
- package/dist/avatar/index.mjs +122 -0
- package/dist/avatar/index.mjs.map +1 -0
- package/dist/backToTop/index.d.mts +15 -0
- package/dist/backToTop/index.d.ts +15 -0
- package/dist/backToTop/index.js +396 -0
- package/dist/backToTop/index.js.map +1 -0
- package/dist/backToTop/index.mjs +356 -0
- package/dist/backToTop/index.mjs.map +1 -0
- package/dist/badge/index.d.mts +13 -0
- package/dist/badge/index.d.ts +13 -0
- package/dist/badge/index.js +127 -0
- package/dist/badge/index.js.map +1 -0
- package/dist/badge/index.mjs +84 -0
- package/dist/badge/index.mjs.map +1 -0
- package/dist/blocks/auth/index.d.mts +202 -0
- package/dist/blocks/auth/index.d.ts +202 -0
- package/dist/blocks/auth/index.js +4197 -0
- package/dist/blocks/auth/index.mjs +3389 -0
- package/dist/blocks/feedback/index.d.mts +74 -0
- package/dist/blocks/feedback/index.d.ts +74 -0
- package/dist/blocks/feedback/index.js +1544 -0
- package/dist/blocks/feedback/index.mjs +558 -0
- package/dist/blocks/index.d.mts +480 -0
- package/dist/blocks/index.d.ts +480 -0
- package/dist/blocks/index.js +6700 -0
- package/dist/blocks/index.mjs +2550 -0
- package/dist/blocks/misc/index.d.mts +90 -0
- package/dist/blocks/misc/index.d.ts +90 -0
- package/dist/blocks/misc/index.js +1186 -0
- package/dist/blocks/misc/index.mjs +387 -0
- package/dist/blocks/pricing/index.d.mts +93 -0
- package/dist/blocks/pricing/index.d.ts +93 -0
- package/dist/blocks/pricing/index.js +1528 -0
- package/dist/blocks/pricing/index.mjs +677 -0
- package/dist/breadcrumb/index.d.mts +14 -0
- package/dist/breadcrumb/index.d.ts +14 -0
- package/dist/breadcrumb/index.js +64 -0
- package/dist/breadcrumb/index.js.map +1 -0
- package/dist/breadcrumb/index.mjs +27 -0
- package/dist/breadcrumb/index.mjs.map +1 -0
- package/dist/button/index.d.mts +16 -0
- package/dist/button/index.d.ts +16 -0
- package/dist/button/index.js +302 -0
- package/dist/button/index.js.map +1 -0
- package/dist/button/index.mjs +261 -0
- package/dist/button/index.mjs.map +1 -0
- package/dist/card/index.d.mts +17 -0
- package/dist/card/index.d.ts +17 -0
- package/dist/card/index.js +140 -0
- package/dist/card/index.js.map +1 -0
- package/dist/card/index.mjs +93 -0
- package/dist/card/index.mjs.map +1 -0
- package/dist/carousel/index.d.mts +15 -0
- package/dist/carousel/index.d.ts +15 -0
- package/dist/carousel/index.js +194 -0
- package/dist/carousel/index.js.map +1 -0
- package/dist/carousel/index.mjs +152 -0
- package/dist/carousel/index.mjs.map +1 -0
- package/dist/checkbox/index.d.mts +20 -0
- package/dist/checkbox/index.d.ts +20 -0
- package/dist/checkbox/index.js +185 -0
- package/dist/checkbox/index.js.map +1 -0
- package/dist/checkbox/index.mjs +143 -0
- package/dist/checkbox/index.mjs.map +1 -0
- package/dist/chip/index.d.mts +36 -0
- package/dist/chip/index.d.ts +36 -0
- package/dist/chip/index.js +130 -0
- package/dist/chip/index.js.map +1 -0
- package/dist/chip/index.mjs +88 -0
- package/dist/chip/index.mjs.map +1 -0
- package/dist/chunk-3ODWQVIA.mjs +12 -0
- package/dist/chunk-3ODWQVIA.mjs.map +1 -0
- package/dist/chunk-4EGKGSGY.mjs +129 -0
- package/dist/chunk-53OZVR57.mjs +108 -0
- package/dist/chunk-53OZVR57.mjs.map +1 -0
- package/dist/chunk-5YXZXYLH.mjs +67 -0
- package/dist/chunk-CBRGWUZG.mjs +11 -0
- package/dist/chunk-CBRGWUZG.mjs.map +1 -0
- package/dist/chunk-D22AALLE.mjs +22 -0
- package/dist/chunk-D36MPDGE.mjs +476 -0
- package/dist/chunk-F3DQJHTG.mjs +3113 -0
- package/dist/chunk-FQ6WVEHW.mjs +151 -0
- package/dist/chunk-GVJYACGA.mjs +189 -0
- package/dist/chunk-HYXZRCZW.mjs +265 -0
- package/dist/chunk-HYXZRCZW.mjs.map +1 -0
- package/dist/chunk-JNUGOUYJ.mjs +154 -0
- package/dist/chunk-JX5YLRCU.mjs +443 -0
- package/dist/chunk-JX5YLRCU.mjs.map +1 -0
- package/dist/chunk-MQUAGP7K.mjs +1098 -0
- package/dist/chunk-NMS5LCSQ.mjs +195 -0
- package/dist/chunk-NV3KR5Y7.mjs +82 -0
- package/dist/chunk-NV3KR5Y7.mjs.map +1 -0
- package/dist/chunk-OQ7MNEYW.mjs +151 -0
- package/dist/chunk-OQ7MNEYW.mjs.map +1 -0
- package/dist/chunk-OY66MBXP.mjs +163 -0
- package/dist/chunk-R4HAAT6R.mjs +131 -0
- package/dist/chunk-WUHNPHD5.mjs +0 -0
- package/dist/chunk-ZFXKCRJC.mjs +11 -0
- package/dist/chunk-ZS3FB3PO.mjs +12 -0
- package/dist/codeBlock/index.d.mts +24 -0
- package/dist/codeBlock/index.d.ts +24 -0
- package/dist/codeBlock/index.js +518 -0
- package/dist/codeBlock/index.js.map +1 -0
- package/dist/codeBlock/index.mjs +433 -0
- package/dist/codeBlock/index.mjs.map +1 -0
- package/dist/collapsible/index.d.mts +8 -0
- package/dist/collapsible/index.d.ts +8 -0
- package/dist/collapsible/index.js +50 -0
- package/dist/collapsible/index.js.map +1 -0
- package/dist/collapsible/index.mjs +13 -0
- package/dist/collapsible/index.mjs.map +1 -0
- package/dist/colorPicker/index.d.mts +34 -0
- package/dist/colorPicker/index.d.ts +34 -0
- package/dist/colorPicker/index.js +276 -0
- package/dist/colorPicker/index.js.map +1 -0
- package/dist/colorPicker/index.mjs +171 -0
- package/dist/colorPicker/index.mjs.map +1 -0
- package/dist/combobox/index.d.mts +41 -0
- package/dist/combobox/index.d.ts +41 -0
- package/dist/combobox/index.js +749 -0
- package/dist/combobox/index.js.map +1 -0
- package/dist/combobox/index.mjs +295 -0
- package/dist/combobox/index.mjs.map +1 -0
- package/dist/command/index.d.mts +48 -0
- package/dist/command/index.d.ts +48 -0
- package/dist/command/index.js +486 -0
- package/dist/command/index.js.map +1 -0
- package/dist/command/index.mjs +23 -0
- package/dist/command/index.mjs.map +1 -0
- package/dist/commonTypes-2IGtJ5cq.d.mts +3 -0
- package/dist/commonTypes-2IGtJ5cq.d.ts +3 -0
- package/dist/commonTypes-2k6FnHw5.d.mts +4 -0
- package/dist/commonTypes-2k6FnHw5.d.ts +4 -0
- package/dist/commonTypes-3k5cNB1s.d.mts +4 -0
- package/dist/commonTypes-3k5cNB1s.d.ts +4 -0
- package/dist/commonTypes-CKtkuNFH.d.mts +11 -0
- package/dist/commonTypes-CKtkuNFH.d.ts +11 -0
- package/dist/commonTypes-GhKAraJw.d.mts +4 -0
- package/dist/commonTypes-GhKAraJw.d.ts +4 -0
- package/dist/commonTypes-MxCJyrHv.d.mts +8 -0
- package/dist/commonTypes-MxCJyrHv.d.ts +8 -0
- package/dist/commonTypes-PBumfOBg.d.mts +3 -0
- package/dist/commonTypes-PBumfOBg.d.ts +3 -0
- package/dist/commonTypes-WPhcN3Vr.d.mts +5 -0
- package/dist/commonTypes-WPhcN3Vr.d.ts +5 -0
- package/dist/commonTypes-_11epZYh.d.mts +4 -0
- package/dist/commonTypes-_11epZYh.d.ts +4 -0
- package/dist/commonTypes-ko_NGEoT.d.mts +3 -0
- package/dist/commonTypes-ko_NGEoT.d.ts +3 -0
- package/dist/copyrights/index.d.mts +17 -0
- package/dist/copyrights/index.d.ts +17 -0
- package/dist/copyrights/index.js +46 -0
- package/dist/copyrights/index.js.map +1 -0
- package/dist/copyrights/index.mjs +9 -0
- package/dist/copyrights/index.mjs.map +1 -0
- package/dist/count/index.d.mts +11 -0
- package/dist/count/index.d.ts +11 -0
- package/dist/count/index.js +46 -0
- package/dist/count/index.js.map +1 -0
- package/dist/count/index.mjs +9 -0
- package/dist/count/index.mjs.map +1 -0
- package/dist/dataTable/index.d.mts +41 -0
- package/dist/dataTable/index.d.ts +41 -0
- package/dist/dataTable/index.js +1305 -0
- package/dist/dataTable/index.js.map +1 -0
- package/dist/dataTable/index.mjs +1273 -0
- package/dist/dataTable/index.mjs.map +1 -0
- package/dist/destroyableCard/index.d.mts +12 -0
- package/dist/destroyableCard/index.d.ts +12 -0
- package/dist/destroyableCard/index.js +204 -0
- package/dist/destroyableCard/index.js.map +1 -0
- package/dist/destroyableCard/index.mjs +164 -0
- package/dist/destroyableCard/index.mjs.map +1 -0
- package/dist/dialog/index.d.mts +57 -0
- package/dist/dialog/index.d.ts +57 -0
- package/dist/dialog/index.js +369 -0
- package/dist/dialog/index.js.map +1 -0
- package/dist/dialog/index.mjs +315 -0
- package/dist/dialog/index.mjs.map +1 -0
- package/dist/docsLayout/index.d.mts +37 -0
- package/dist/docsLayout/index.d.ts +37 -0
- package/dist/docsLayout/index.js +928 -0
- package/dist/docsLayout/index.js.map +1 -0
- package/dist/docsLayout/index.mjs +888 -0
- package/dist/docsLayout/index.mjs.map +1 -0
- package/dist/docsSidebar/index.d.mts +11 -0
- package/dist/docsSidebar/index.d.ts +11 -0
- package/dist/docsSidebar/index.js +112 -0
- package/dist/docsSidebar/index.js.map +1 -0
- package/dist/docsSidebar/index.mjs +70 -0
- package/dist/docsSidebar/index.mjs.map +1 -0
- package/dist/dropdownMenu/index.d.mts +96 -0
- package/dist/dropdownMenu/index.d.ts +96 -0
- package/dist/dropdownMenu/index.js +421 -0
- package/dist/dropdownMenu/index.js.map +1 -0
- package/dist/dropdownMenu/index.mjs +363 -0
- package/dist/dropdownMenu/index.mjs.map +1 -0
- package/dist/elements/index.d.mts +788 -0
- package/dist/elements/index.d.ts +788 -0
- package/dist/elements/index.js +7835 -0
- package/dist/elements/index.mjs +3418 -0
- package/dist/fileDropzone/index.d.mts +37 -0
- package/dist/fileDropzone/index.d.ts +37 -0
- package/dist/fileDropzone/index.js +665 -0
- package/dist/fileDropzone/index.js.map +1 -0
- package/dist/fileDropzone/index.mjs +625 -0
- package/dist/fileDropzone/index.mjs.map +1 -0
- package/dist/fileUploader/index.d.mts +5 -0
- package/dist/fileUploader/index.d.ts +5 -0
- package/dist/fileUploader/index.js +62 -0
- package/dist/fileUploader/index.js.map +1 -0
- package/dist/fileUploader/index.mjs +25 -0
- package/dist/fileUploader/index.mjs.map +1 -0
- package/dist/glow/index.d.mts +16 -0
- package/dist/glow/index.d.ts +16 -0
- package/dist/glow/index.js +149 -0
- package/dist/glow/index.js.map +1 -0
- package/dist/glow/index.mjs +111 -0
- package/dist/glow/index.mjs.map +1 -0
- package/dist/hooks/index.d.mts +108 -0
- package/dist/hooks/index.d.ts +108 -0
- package/dist/hooks/index.js +459 -0
- package/dist/hooks/index.mjs +255 -0
- package/dist/index.d.mts +1932 -0
- package/dist/index.d.ts +1932 -0
- package/dist/index.js +12126 -0
- package/dist/index.mjs +11911 -0
- package/dist/input/index.d.mts +43 -0
- package/dist/input/index.d.ts +43 -0
- package/dist/input/index.js +293 -0
- package/dist/input/index.js.map +1 -0
- package/dist/input/index.mjs +158 -0
- package/dist/input/index.mjs.map +1 -0
- package/dist/interfaceSettings/index.d.mts +18 -0
- package/dist/interfaceSettings/index.d.ts +18 -0
- package/dist/interfaceSettings/index.js +419 -0
- package/dist/interfaceSettings/index.js.map +1 -0
- package/dist/interfaceSettings/index.mjs +282 -0
- package/dist/interfaceSettings/index.mjs.map +1 -0
- package/dist/label/index.d.mts +13 -0
- package/dist/label/index.d.ts +13 -0
- package/dist/label/index.js +143 -0
- package/dist/label/index.js.map +1 -0
- package/dist/label/index.mjs +103 -0
- package/dist/label/index.mjs.map +1 -0
- package/dist/layout/index.d.mts +256 -0
- package/dist/layout/index.d.ts +256 -0
- package/dist/layout/index.js +2627 -0
- package/dist/layout/index.mjs +1393 -0
- package/dist/loading/index.d.mts +15 -0
- package/dist/loading/index.d.ts +15 -0
- package/dist/loading/index.js +226 -0
- package/dist/loading/index.js.map +1 -0
- package/dist/loading/index.mjs +184 -0
- package/dist/loading/index.mjs.map +1 -0
- package/dist/logos/index.d.mts +27 -0
- package/dist/logos/index.d.ts +27 -0
- package/dist/logos/index.js +245 -0
- package/dist/logos/index.js.map +1 -0
- package/dist/logos/index.mjs +208 -0
- package/dist/logos/index.mjs.map +1 -0
- package/dist/navbar/index.d.mts +17 -0
- package/dist/navbar/index.d.ts +17 -0
- package/dist/navbar/index.js +166 -0
- package/dist/navbar/index.js.map +1 -0
- package/dist/navbar/index.mjs +126 -0
- package/dist/navbar/index.mjs.map +1 -0
- package/dist/navigationMenu/index.d.mts +39 -0
- package/dist/navigationMenu/index.d.ts +39 -0
- package/dist/navigationMenu/index.js +222 -0
- package/dist/navigationMenu/index.js.map +1 -0
- package/dist/navigationMenu/index.mjs +170 -0
- package/dist/navigationMenu/index.mjs.map +1 -0
- package/dist/pagination/index.d.mts +11 -0
- package/dist/pagination/index.d.ts +11 -0
- package/dist/pagination/index.js +161 -0
- package/dist/pagination/index.js.map +1 -0
- package/dist/pagination/index.mjs +119 -0
- package/dist/pagination/index.mjs.map +1 -0
- package/dist/passwordInput/index.d.mts +13 -0
- package/dist/passwordInput/index.d.ts +13 -0
- package/dist/passwordInput/index.js +577 -0
- package/dist/passwordInput/index.js.map +1 -0
- package/dist/passwordInput/index.mjs +534 -0
- package/dist/passwordInput/index.mjs.map +1 -0
- package/dist/phoneInput/index.d.mts +23 -0
- package/dist/phoneInput/index.d.ts +23 -0
- package/dist/phoneInput/index.js +2081 -0
- package/dist/phoneInput/index.js.map +1 -0
- package/dist/phoneInput/index.mjs +2041 -0
- package/dist/phoneInput/index.mjs.map +1 -0
- package/dist/pinInput/index.d.mts +20 -0
- package/dist/pinInput/index.d.ts +20 -0
- package/dist/pinInput/index.js +132 -0
- package/dist/pinInput/index.js.map +1 -0
- package/dist/pinInput/index.mjs +90 -0
- package/dist/pinInput/index.mjs.map +1 -0
- package/dist/popover/index.d.mts +23 -0
- package/dist/popover/index.d.ts +23 -0
- package/dist/popover/index.js +113 -0
- package/dist/popover/index.js.map +1 -0
- package/dist/popover/index.mjs +69 -0
- package/dist/popover/index.mjs.map +1 -0
- package/dist/progress/index.d.mts +6 -0
- package/dist/progress/index.d.ts +6 -0
- package/dist/progress/index.js +72 -0
- package/dist/progress/index.js.map +1 -0
- package/dist/progress/index.mjs +30 -0
- package/dist/progress/index.mjs.map +1 -0
- package/dist/progressCircle/index.d.mts +16 -0
- package/dist/progressCircle/index.d.ts +16 -0
- package/dist/progressCircle/index.js +160 -0
- package/dist/progressCircle/index.js.map +1 -0
- package/dist/progressCircle/index.mjs +118 -0
- package/dist/progressCircle/index.mjs.map +1 -0
- package/dist/radio/index.d.mts +39 -0
- package/dist/radio/index.d.ts +39 -0
- package/dist/radio/index.js +330 -0
- package/dist/radio/index.js.map +1 -0
- package/dist/radio/index.mjs +290 -0
- package/dist/radio/index.mjs.map +1 -0
- package/dist/scrollArea/index.d.mts +10 -0
- package/dist/scrollArea/index.d.ts +10 -0
- package/dist/scrollArea/index.js +91 -0
- package/dist/scrollArea/index.js.map +1 -0
- package/dist/scrollArea/index.mjs +48 -0
- package/dist/scrollArea/index.mjs.map +1 -0
- package/dist/scrollIndicator/index.d.mts +9 -0
- package/dist/scrollIndicator/index.d.ts +9 -0
- package/dist/scrollIndicator/index.js +80 -0
- package/dist/scrollIndicator/index.js.map +1 -0
- package/dist/scrollIndicator/index.mjs +43 -0
- package/dist/scrollIndicator/index.mjs.map +1 -0
- package/dist/select/index.d.mts +50 -0
- package/dist/select/index.d.ts +50 -0
- package/dist/select/index.js +322 -0
- package/dist/select/index.js.map +1 -0
- package/dist/select/index.mjs +282 -0
- package/dist/select/index.mjs.map +1 -0
- package/dist/separator/index.d.mts +10 -0
- package/dist/separator/index.d.ts +10 -0
- package/dist/separator/index.js +67 -0
- package/dist/separator/index.js.map +1 -0
- package/dist/separator/index.mjs +25 -0
- package/dist/separator/index.mjs.map +1 -0
- package/dist/sheet/index.d.mts +30 -0
- package/dist/sheet/index.d.ts +30 -0
- package/dist/sheet/index.js +202 -0
- package/dist/sheet/index.js.map +1 -0
- package/dist/sheet/index.mjs +151 -0
- package/dist/sheet/index.mjs.map +1 -0
- package/dist/sidebar/index.d.mts +48 -0
- package/dist/sidebar/index.d.ts +48 -0
- package/dist/sidebar/index.js +342 -0
- package/dist/sidebar/index.js.map +1 -0
- package/dist/sidebar/index.mjs +299 -0
- package/dist/sidebar/index.mjs.map +1 -0
- package/dist/signature/index.d.mts +27 -0
- package/dist/signature/index.d.ts +27 -0
- package/dist/signature/index.js +242 -0
- package/dist/signature/index.js.map +1 -0
- package/dist/signature/index.mjs +200 -0
- package/dist/signature/index.mjs.map +1 -0
- package/dist/simpleTable/index.d.mts +30 -0
- package/dist/simpleTable/index.d.ts +30 -0
- package/dist/simpleTable/index.js +250 -0
- package/dist/simpleTable/index.js.map +1 -0
- package/dist/simpleTable/index.mjs +214 -0
- package/dist/simpleTable/index.mjs.map +1 -0
- package/dist/skeleton/index.d.mts +10 -0
- package/dist/skeleton/index.d.ts +10 -0
- package/dist/skeleton/index.js +76 -0
- package/dist/skeleton/index.js.map +1 -0
- package/dist/skeleton/index.mjs +34 -0
- package/dist/skeleton/index.mjs.map +1 -0
- package/dist/slider/index.d.mts +6 -0
- package/dist/slider/index.d.ts +6 -0
- package/dist/slider/index.js +67 -0
- package/dist/slider/index.js.map +1 -0
- package/dist/slider/index.mjs +25 -0
- package/dist/slider/index.mjs.map +1 -0
- package/dist/sortButton/index.d.mts +10 -0
- package/dist/sortButton/index.d.ts +10 -0
- package/dist/sortButton/index.js +337 -0
- package/dist/sortButton/index.js.map +1 -0
- package/dist/sortButton/index.mjs +43 -0
- package/dist/sortButton/index.mjs.map +1 -0
- package/dist/splitButton/index.d.mts +52 -0
- package/dist/splitButton/index.d.ts +52 -0
- package/dist/splitButton/index.js +693 -0
- package/dist/splitButton/index.js.map +1 -0
- package/dist/splitButton/index.mjs +401 -0
- package/dist/splitButton/index.mjs.map +1 -0
- package/dist/stats/index.d.mts +19 -0
- package/dist/stats/index.d.ts +19 -0
- package/dist/stats/index.js +192 -0
- package/dist/stats/index.js.map +1 -0
- package/dist/stats/index.mjs +155 -0
- package/dist/stats/index.mjs.map +1 -0
- package/dist/stopPropagationWrapper/index.d.mts +5 -0
- package/dist/stopPropagationWrapper/index.d.ts +5 -0
- package/dist/stopPropagationWrapper/index.js +49 -0
- package/dist/stopPropagationWrapper/index.js.map +1 -0
- package/dist/stopPropagationWrapper/index.mjs +12 -0
- package/dist/stopPropagationWrapper/index.mjs.map +1 -0
- package/dist/switch/index.d.mts +12 -0
- package/dist/switch/index.d.ts +12 -0
- package/dist/switch/index.js +125 -0
- package/dist/switch/index.js.map +1 -0
- package/dist/switch/index.mjs +83 -0
- package/dist/switch/index.mjs.map +1 -0
- package/dist/table/index.d.mts +21 -0
- package/dist/table/index.d.ts +21 -0
- package/dist/table/index.js +173 -0
- package/dist/table/index.js.map +1 -0
- package/dist/table/index.mjs +124 -0
- package/dist/table/index.mjs.map +1 -0
- package/dist/tabs/index.d.mts +33 -0
- package/dist/tabs/index.d.ts +33 -0
- package/dist/tabs/index.js +201 -0
- package/dist/tabs/index.js.map +1 -0
- package/dist/tabs/index.mjs +158 -0
- package/dist/tabs/index.mjs.map +1 -0
- package/dist/textTypes-559CaoOV.d.mts +88 -0
- package/dist/textTypes-559CaoOV.d.ts +88 -0
- package/dist/textarea/index.d.mts +27 -0
- package/dist/textarea/index.d.ts +27 -0
- package/dist/textarea/index.js +230 -0
- package/dist/textarea/index.js.map +1 -0
- package/dist/textarea/index.mjs +190 -0
- package/dist/textarea/index.mjs.map +1 -0
- package/dist/toast/index.d.mts +26 -0
- package/dist/toast/index.d.ts +26 -0
- package/dist/toast/index.js +198 -0
- package/dist/toast/index.js.map +1 -0
- package/dist/toast/index.mjs +20 -0
- package/dist/toast/index.mjs.map +1 -0
- package/dist/toaster/index.d.mts +9 -0
- package/dist/toaster/index.d.ts +9 -0
- package/dist/toaster/index.js +354 -0
- package/dist/toaster/index.js.map +1 -0
- package/dist/toaster/index.mjs +185 -0
- package/dist/toaster/index.mjs.map +1 -0
- package/dist/types/index.d.mts +115 -0
- package/dist/types/index.d.ts +115 -0
- package/dist/types/index.js +18 -0
- package/dist/types/index.mjs +0 -0
- package/package.json +1 -1
@@ -0,0 +1,2550 @@
|
|
1
|
+
import {
|
2
|
+
Alert,
|
3
|
+
BadEmoji,
|
4
|
+
CheckMark,
|
5
|
+
Checkbox,
|
6
|
+
EyeIcon,
|
7
|
+
GoodEmoji,
|
8
|
+
HiddenEyeIcon,
|
9
|
+
Input,
|
10
|
+
Label,
|
11
|
+
PhoneInput,
|
12
|
+
PinInput,
|
13
|
+
Popover,
|
14
|
+
Progress,
|
15
|
+
Radio,
|
16
|
+
ScrollArea,
|
17
|
+
Select,
|
18
|
+
Separator,
|
19
|
+
StopPropagationWrapper,
|
20
|
+
Tabs,
|
21
|
+
TabsContent,
|
22
|
+
TabsList,
|
23
|
+
TabsTrigger,
|
24
|
+
Textarea,
|
25
|
+
UncheckMark,
|
26
|
+
VeryBadEmoji,
|
27
|
+
VeryGoodEmoji
|
28
|
+
} from "../chunk-F3DQJHTG.mjs";
|
29
|
+
import {
|
30
|
+
Button,
|
31
|
+
Card,
|
32
|
+
CardContent,
|
33
|
+
CardDescription,
|
34
|
+
CardFooter,
|
35
|
+
CardHeader,
|
36
|
+
CardTitle,
|
37
|
+
Chip,
|
38
|
+
DropdownMenu,
|
39
|
+
Loading,
|
40
|
+
Logos,
|
41
|
+
Skeleton,
|
42
|
+
Tooltip,
|
43
|
+
cn
|
44
|
+
} from "../chunk-MQUAGP7K.mjs";
|
45
|
+
import "../chunk-ZFXKCRJC.mjs";
|
46
|
+
|
47
|
+
// blocks/auth/LoginForm.tsx
|
48
|
+
import React2, { useState } from "react";
|
49
|
+
import { Controller, useForm } from "react-hook-form";
|
50
|
+
import { zodResolver } from "@hookform/resolvers/zod";
|
51
|
+
import { parsePhoneNumber } from "libphonenumber-js";
|
52
|
+
import * as z from "zod";
|
53
|
+
|
54
|
+
// blocks/auth/AuthButtons.tsx
|
55
|
+
import React from "react";
|
56
|
+
var AuthButtons = (props) => {
|
57
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
|
58
|
+
return /* @__PURE__ */ React.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-4" }, props.viaGoogle && /* @__PURE__ */ React.createElement(
|
59
|
+
Button,
|
60
|
+
{
|
61
|
+
disabled: props.isGoogleLoading,
|
62
|
+
className: "hawa-flex hawa-flex-row hawa-items-center hawa-gap-2",
|
63
|
+
variant: "outline",
|
64
|
+
onClick: props.handleGoogle
|
65
|
+
},
|
66
|
+
props.isGoogleLoading ? /* @__PURE__ */ React.createElement(Loading, { size: "button" }) : /* @__PURE__ */ React.createElement(Logos.google, { className: "hawa-icon" }),
|
67
|
+
(_b = (_a = props.texts) == null ? void 0 : _a.continueWithGoogle) != null ? _b : "Continue With Google"
|
68
|
+
), props.viaGithub && /* @__PURE__ */ React.createElement(
|
69
|
+
Button,
|
70
|
+
{
|
71
|
+
disabled: props.isGithubLoading,
|
72
|
+
className: "hawa-flex hawa-flex-row hawa-items-center hawa-gap-2",
|
73
|
+
variant: "outline",
|
74
|
+
onClick: props.handleGithub
|
75
|
+
},
|
76
|
+
props.isGithubLoading ? /* @__PURE__ */ React.createElement(Loading, { size: "button" }) : /* @__PURE__ */ React.createElement(Logos.github, { className: "hawa-icon" }),
|
77
|
+
(_d = (_c = props.texts) == null ? void 0 : _c.continueWithGithub) != null ? _d : "Continue With Github"
|
78
|
+
), props.viaTwitter && /* @__PURE__ */ React.createElement(
|
79
|
+
Button,
|
80
|
+
{
|
81
|
+
disabled: props.isTwitterLoading,
|
82
|
+
className: "hawa-flex hawa-flex-row hawa-items-center hawa-gap-2",
|
83
|
+
variant: "outline",
|
84
|
+
onClick: props.handleTwitter
|
85
|
+
},
|
86
|
+
props.isTwitterLoading ? /* @__PURE__ */ React.createElement(Loading, { size: "button" }) : /* @__PURE__ */ React.createElement(Logos.twitter, { className: "hawa-icon" }),
|
87
|
+
(_f = (_e = props.texts) == null ? void 0 : _e.continueWithTwitter) != null ? _f : "Continue With Twitter"
|
88
|
+
), props.viaApple && /* @__PURE__ */ React.createElement(
|
89
|
+
Button,
|
90
|
+
{
|
91
|
+
disabled: props.isAppleLoading,
|
92
|
+
className: "hawa-flex hawa-flex-row hawa-items-center hawa-gap-2",
|
93
|
+
variant: "outline",
|
94
|
+
onClick: props.handleApple
|
95
|
+
},
|
96
|
+
props.isAppleLoading ? /* @__PURE__ */ React.createElement(Loading, { size: "button" }) : /* @__PURE__ */ React.createElement(Logos.apple, { className: "hawa-icon" }),
|
97
|
+
(_h = (_g = props.texts) == null ? void 0 : _g.continueWithApple) != null ? _h : "Continue With Apple"
|
98
|
+
), props.viaMicrosoft && /* @__PURE__ */ React.createElement(
|
99
|
+
Button,
|
100
|
+
{
|
101
|
+
disabled: props.isMicrosoftLoading,
|
102
|
+
className: "hawa-flex hawa-flex-row hawa-items-center hawa-gap-2",
|
103
|
+
variant: "outline",
|
104
|
+
onClick: props.handleMicrosoft
|
105
|
+
},
|
106
|
+
props.isMicrosoftLoading ? /* @__PURE__ */ React.createElement(Loading, { size: "button" }) : /* @__PURE__ */ React.createElement(Logos.microsoft, { className: "hawa-icon" }),
|
107
|
+
(_j = (_i = props.texts) == null ? void 0 : _i.continueWithMicrosoft) != null ? _j : "Continue With Microsoft"
|
108
|
+
), props.viaEmail && /* @__PURE__ */ React.createElement(
|
109
|
+
Button,
|
110
|
+
{
|
111
|
+
disabled: props.isEmailLoading,
|
112
|
+
className: "hawa-flex hawa-flex-row hawa-items-center hawa-gap-2",
|
113
|
+
variant: "outline",
|
114
|
+
onClick: props.handleEmail
|
115
|
+
},
|
116
|
+
props.isEmailLoading ? /* @__PURE__ */ React.createElement(Loading, { size: "button" }) : /* @__PURE__ */ React.createElement(Logos.mail, { className: "hawa-icon" }),
|
117
|
+
(_l = (_k = props.texts) == null ? void 0 : _k.continueWithEmail) != null ? _l : "Continue With Email"
|
118
|
+
), props.viaPhone && /* @__PURE__ */ React.createElement(
|
119
|
+
Button,
|
120
|
+
{
|
121
|
+
disabled: props.isPhoneLoading,
|
122
|
+
className: "hawa-flex hawa-flex-row hawa-items-center hawa-gap-2",
|
123
|
+
variant: "outline",
|
124
|
+
onClick: props.handlePhone
|
125
|
+
},
|
126
|
+
props.isPhoneLoading ? /* @__PURE__ */ React.createElement(Loading, { size: "button" }) : /* @__PURE__ */ React.createElement(Logos.phone, { className: "hawa-icon" }),
|
127
|
+
(_n = (_m = props.texts) == null ? void 0 : _m.continueWithPhone) != null ? _n : "Continue With Phone"
|
128
|
+
));
|
129
|
+
};
|
130
|
+
|
131
|
+
// blocks/auth/LoginForm.tsx
|
132
|
+
var LoginForm = ({
|
133
|
+
loginType,
|
134
|
+
texts,
|
135
|
+
passwordLength = 8,
|
136
|
+
...props
|
137
|
+
}) => {
|
138
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
|
139
|
+
const [passwordVisible, setPasswordVisible] = useState(false);
|
140
|
+
const thirdPartyAuthTexts = {
|
141
|
+
continueWithGoogle: texts == null ? void 0 : texts.continueWithGoogle,
|
142
|
+
continueWithTwitter: texts == null ? void 0 : texts.continueWithTwitter,
|
143
|
+
continueWithApple: texts == null ? void 0 : texts.continueWithApple,
|
144
|
+
continueWithMicrosoft: texts == null ? void 0 : texts.continueWithMicrosoft,
|
145
|
+
continueWithGithub: texts == null ? void 0 : texts.continueWithGithub,
|
146
|
+
continueWithEmail: texts == null ? void 0 : texts.continueWithEmail,
|
147
|
+
continueWithPhone: texts == null ? void 0 : texts.continueWithPhone
|
148
|
+
};
|
149
|
+
let formSchema;
|
150
|
+
if (loginType === "email") {
|
151
|
+
formSchema = z.object({
|
152
|
+
email: z.string({ required_error: (_a = texts == null ? void 0 : texts.email) == null ? void 0 : _a.required }).min(1, { message: (_b = texts == null ? void 0 : texts.email) == null ? void 0 : _b.required }).email({ message: (_c = texts == null ? void 0 : texts.email) == null ? void 0 : _c.invalid }),
|
153
|
+
password: z.string({ required_error: (_d = texts == null ? void 0 : texts.password) == null ? void 0 : _d.required }).min(1, { message: (_e = texts == null ? void 0 : texts.password) == null ? void 0 : _e.required }).min(passwordLength, { message: (_f = texts == null ? void 0 : texts.password) == null ? void 0 : _f.tooShort })
|
154
|
+
});
|
155
|
+
} else if (loginType === "username") {
|
156
|
+
formSchema = z.object({
|
157
|
+
username: z.string({ required_error: (_g = texts == null ? void 0 : texts.username) == null ? void 0 : _g.required }).min(2, { message: (_h = texts == null ? void 0 : texts.username) == null ? void 0 : _h.tooShort }).refine(
|
158
|
+
(value) => {
|
159
|
+
const isValid = /^[a-zA-Z][a-zA-Z0-9_-]{2,14}$/.test(value);
|
160
|
+
return isValid;
|
161
|
+
},
|
162
|
+
{ message: (_i = texts == null ? void 0 : texts.username) == null ? void 0 : _i.invalid }
|
163
|
+
),
|
164
|
+
password: z.string({ required_error: (_j = texts == null ? void 0 : texts.password) == null ? void 0 : _j.required }).min(1, { message: (_k = texts == null ? void 0 : texts.password) == null ? void 0 : _k.required }).min(passwordLength, { message: (_l = texts == null ? void 0 : texts.password) == null ? void 0 : _l.tooShort })
|
165
|
+
});
|
166
|
+
} else if (loginType === "phone") {
|
167
|
+
formSchema = z.object({
|
168
|
+
phone: z.string({ required_error: (_m = texts == null ? void 0 : texts.phone) == null ? void 0 : _m.required }).refine(
|
169
|
+
(value) => {
|
170
|
+
let phoneNumber = parsePhoneNumber(value);
|
171
|
+
return phoneNumber.isValid();
|
172
|
+
},
|
173
|
+
{ message: (_n = texts == null ? void 0 : texts.phone) == null ? void 0 : _n.invalid }
|
174
|
+
)
|
175
|
+
});
|
176
|
+
} else if (loginType === "link") {
|
177
|
+
formSchema = z.object({
|
178
|
+
email: z.string({ required_error: (_o = texts == null ? void 0 : texts.email) == null ? void 0 : _o.required }).min(1, { message: (_p = texts == null ? void 0 : texts.email) == null ? void 0 : _p.required }).email({ message: (_q = texts == null ? void 0 : texts.email) == null ? void 0 : _q.invalid })
|
179
|
+
});
|
180
|
+
} else {
|
181
|
+
formSchema = z.object({});
|
182
|
+
}
|
183
|
+
const { handleSubmit, control, formState } = useForm({
|
184
|
+
resolver: zodResolver(formSchema)
|
185
|
+
});
|
186
|
+
const renderFields = () => {
|
187
|
+
switch (loginType) {
|
188
|
+
case "email":
|
189
|
+
return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(
|
190
|
+
Controller,
|
191
|
+
{
|
192
|
+
control,
|
193
|
+
name: "email",
|
194
|
+
render: ({ field }) => {
|
195
|
+
var _a2, _b2, _c2;
|
196
|
+
return /* @__PURE__ */ React2.createElement(
|
197
|
+
Input,
|
198
|
+
{
|
199
|
+
inputProps: {
|
200
|
+
className: props.direction === "rtl" ? "hawa-text-right" : "hawa-text-left"
|
201
|
+
},
|
202
|
+
dir: "ltr",
|
203
|
+
width: "full",
|
204
|
+
autoComplete: "email",
|
205
|
+
label: (_a2 = texts == null ? void 0 : texts.email) == null ? void 0 : _a2.label,
|
206
|
+
helperText: (_b2 = formState.errors.email) == null ? void 0 : _b2.message,
|
207
|
+
placeholder: ((_c2 = texts == null ? void 0 : texts.email) == null ? void 0 : _c2.placeholder) || "contact@sikka.io",
|
208
|
+
...field
|
209
|
+
}
|
210
|
+
);
|
211
|
+
}
|
212
|
+
}
|
213
|
+
), /* @__PURE__ */ React2.createElement("div", null, /* @__PURE__ */ React2.createElement(
|
214
|
+
Controller,
|
215
|
+
{
|
216
|
+
control,
|
217
|
+
name: "password",
|
218
|
+
render: ({ field }) => {
|
219
|
+
var _a2, _b2, _c2;
|
220
|
+
return /* @__PURE__ */ React2.createElement(
|
221
|
+
Input,
|
222
|
+
{
|
223
|
+
width: "full",
|
224
|
+
autoComplete: "current-password",
|
225
|
+
type: passwordVisible ? "text" : "password",
|
226
|
+
label: ((_a2 = texts == null ? void 0 : texts.password) == null ? void 0 : _a2.label) || "Password",
|
227
|
+
endIcon: /* @__PURE__ */ React2.createElement(
|
228
|
+
"div",
|
229
|
+
{
|
230
|
+
className: "hawa-cursor-pointer",
|
231
|
+
onClick: () => setPasswordVisible(!passwordVisible)
|
232
|
+
},
|
233
|
+
passwordVisible ? /* @__PURE__ */ React2.createElement(EyeIcon, { className: "hawa-text-gray-500" }) : /* @__PURE__ */ React2.createElement(HiddenEyeIcon, { className: "hawa-text-gray-500" })
|
234
|
+
),
|
235
|
+
placeholder: ((_b2 = texts == null ? void 0 : texts.password) == null ? void 0 : _b2.placeholder) || "Enter your password",
|
236
|
+
helperText: (_c2 = formState.errors.password) == null ? void 0 : _c2.message,
|
237
|
+
...field
|
238
|
+
}
|
239
|
+
);
|
240
|
+
}
|
241
|
+
}
|
242
|
+
), !props.withoutResetPassword && /* @__PURE__ */ React2.createElement(
|
243
|
+
"div",
|
244
|
+
{
|
245
|
+
onClick: props.onForgotPassword,
|
246
|
+
className: "hawa-mb-3 hawa-mt-2 hawa-w-fit hawa-cursor-pointer hawa-select-none hawa-text-xs dark:hawa-text-gray-300"
|
247
|
+
},
|
248
|
+
(texts == null ? void 0 : texts.forgotPassword) || "Forgot Password?"
|
249
|
+
)));
|
250
|
+
case "username":
|
251
|
+
return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(
|
252
|
+
Controller,
|
253
|
+
{
|
254
|
+
control,
|
255
|
+
name: "username",
|
256
|
+
render: ({ field }) => {
|
257
|
+
var _a2, _b2, _c2;
|
258
|
+
return /* @__PURE__ */ React2.createElement(
|
259
|
+
Input,
|
260
|
+
{
|
261
|
+
width: "full",
|
262
|
+
autoComplete: "username",
|
263
|
+
label: ((_a2 = texts == null ? void 0 : texts.username) == null ? void 0 : _a2.label) || "Username",
|
264
|
+
helperText: (_b2 = formState.errors.username) == null ? void 0 : _b2.message,
|
265
|
+
placeholder: ((_c2 = texts == null ? void 0 : texts.username) == null ? void 0 : _c2.placeholder) || "sikka_sa",
|
266
|
+
...field
|
267
|
+
}
|
268
|
+
);
|
269
|
+
}
|
270
|
+
}
|
271
|
+
), /* @__PURE__ */ React2.createElement("div", null, /* @__PURE__ */ React2.createElement(
|
272
|
+
Controller,
|
273
|
+
{
|
274
|
+
control,
|
275
|
+
name: "password",
|
276
|
+
render: ({ field }) => {
|
277
|
+
var _a2, _b2, _c2;
|
278
|
+
return /* @__PURE__ */ React2.createElement(
|
279
|
+
Input,
|
280
|
+
{
|
281
|
+
width: "full",
|
282
|
+
autoComplete: "current-password",
|
283
|
+
type: passwordVisible ? "text" : "password",
|
284
|
+
label: (_a2 = texts == null ? void 0 : texts.password) == null ? void 0 : _a2.label,
|
285
|
+
endIcon: /* @__PURE__ */ React2.createElement(
|
286
|
+
"div",
|
287
|
+
{
|
288
|
+
className: "hawa-cursor-pointer",
|
289
|
+
onClick: () => setPasswordVisible(!passwordVisible)
|
290
|
+
},
|
291
|
+
passwordVisible ? /* @__PURE__ */ React2.createElement(EyeIcon, { className: "hawa-text-gray-500" }) : /* @__PURE__ */ React2.createElement(HiddenEyeIcon, { className: "hawa-text-gray-500" })
|
292
|
+
),
|
293
|
+
placeholder: ((_b2 = texts == null ? void 0 : texts.password) == null ? void 0 : _b2.placeholder) || "Enter your password",
|
294
|
+
helperText: (_c2 = formState.errors.password) == null ? void 0 : _c2.message,
|
295
|
+
...field
|
296
|
+
}
|
297
|
+
);
|
298
|
+
}
|
299
|
+
}
|
300
|
+
), !props.withoutResetPassword && /* @__PURE__ */ React2.createElement(
|
301
|
+
"div",
|
302
|
+
{
|
303
|
+
onClick: props.onForgotPassword,
|
304
|
+
className: "hawa-mb-3 hawa-mt-2 hawa-w-fit hawa-cursor-pointer hawa-select-none hawa-text-xs dark:hawa-text-gray-300"
|
305
|
+
},
|
306
|
+
(texts == null ? void 0 : texts.forgotPassword) || "Forgot Password?"
|
307
|
+
)));
|
308
|
+
case "phone":
|
309
|
+
return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(
|
310
|
+
Controller,
|
311
|
+
{
|
312
|
+
control,
|
313
|
+
name: "phone",
|
314
|
+
render: ({ field }) => {
|
315
|
+
var _a2, _b2;
|
316
|
+
return /* @__PURE__ */ React2.createElement(
|
317
|
+
PhoneInput,
|
318
|
+
{
|
319
|
+
label: (_a2 = texts == null ? void 0 : texts.phone) == null ? void 0 : _a2.label,
|
320
|
+
helperText: (_b2 = formState.errors.phone) == null ? void 0 : _b2.message,
|
321
|
+
preferredCountry: { label: "+966" },
|
322
|
+
handleChange: (e) => field.onChange(parsePhoneNumber(e).number)
|
323
|
+
}
|
324
|
+
);
|
325
|
+
}
|
326
|
+
}
|
327
|
+
));
|
328
|
+
case "link":
|
329
|
+
return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(
|
330
|
+
Controller,
|
331
|
+
{
|
332
|
+
control,
|
333
|
+
name: "email",
|
334
|
+
render: ({ field }) => {
|
335
|
+
var _a2, _b2, _c2;
|
336
|
+
return /* @__PURE__ */ React2.createElement(
|
337
|
+
Input,
|
338
|
+
{
|
339
|
+
width: "full",
|
340
|
+
autoComplete: "email",
|
341
|
+
label: ((_a2 = texts == null ? void 0 : texts.email) == null ? void 0 : _a2.label) || "Email",
|
342
|
+
helperText: (_b2 = formState.errors.email) == null ? void 0 : _b2.message,
|
343
|
+
placeholder: ((_c2 = texts == null ? void 0 : texts.email) == null ? void 0 : _c2.placeholder) || "contact@sikka.io",
|
344
|
+
...field
|
345
|
+
}
|
346
|
+
);
|
347
|
+
}
|
348
|
+
}
|
349
|
+
));
|
350
|
+
default:
|
351
|
+
break;
|
352
|
+
}
|
353
|
+
};
|
354
|
+
return /* @__PURE__ */ React2.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-4" }, /* @__PURE__ */ React2.createElement(Card, { dir: props.direction }, /* @__PURE__ */ React2.createElement(CardContent, { headless: true }, props.showError && /* @__PURE__ */ React2.createElement(
|
355
|
+
Alert,
|
356
|
+
{
|
357
|
+
direction: props.direction,
|
358
|
+
title: props.errorTitle,
|
359
|
+
text: props.errorText,
|
360
|
+
severity: "error"
|
361
|
+
}
|
362
|
+
), /* @__PURE__ */ React2.createElement(
|
363
|
+
"form",
|
364
|
+
{
|
365
|
+
noValidate: true,
|
366
|
+
className: "hawa-flex hawa-flex-col hawa-gap-4",
|
367
|
+
onSubmit: handleSubmit((e) => {
|
368
|
+
if (props.onLogin) {
|
369
|
+
return props.onLogin(e);
|
370
|
+
} else {
|
371
|
+
console.log("Form is submitted but onLogin prop is missing");
|
372
|
+
}
|
373
|
+
})
|
374
|
+
},
|
375
|
+
renderFields(),
|
376
|
+
/* @__PURE__ */ React2.createElement(
|
377
|
+
Button,
|
378
|
+
{
|
379
|
+
className: "hawa-mt-0 hawa-w-full",
|
380
|
+
type: "submit",
|
381
|
+
isLoading: props.isLoading,
|
382
|
+
disabled: props.isLoading
|
383
|
+
},
|
384
|
+
(texts == null ? void 0 : texts.loginText) || "Login"
|
385
|
+
),
|
386
|
+
props.additionalButtons,
|
387
|
+
props.allowRegister && /* @__PURE__ */ React2.createElement("div", { className: "hawa-select-none hawa-p-3 hawa-text-center hawa-text-sm hawa-font-normal dark:hawa-text-gray-300" }, (texts == null ? void 0 : texts.newUserText) || "New user?", " ", /* @__PURE__ */ React2.createElement(
|
388
|
+
"span",
|
389
|
+
{
|
390
|
+
onClick: props.onRouteToRegister,
|
391
|
+
className: "clickable-link"
|
392
|
+
},
|
393
|
+
(texts == null ? void 0 : texts.createAccount) || "Create Account"
|
394
|
+
))
|
395
|
+
)), props.viaGithub || props.viaGoogle || props.viaTwitter ? /* @__PURE__ */ React2.createElement(
|
396
|
+
CardFooter,
|
397
|
+
{
|
398
|
+
className: cn(
|
399
|
+
props.logosOnly ? "hawa-flex hawa-flex-row hawa-justify-center hawa-gap-2" : "hawa-grid hawa-grid-cols-1 hawa-gap-2"
|
400
|
+
)
|
401
|
+
},
|
402
|
+
/* @__PURE__ */ React2.createElement(
|
403
|
+
AuthButtons,
|
404
|
+
{
|
405
|
+
texts: thirdPartyAuthTexts,
|
406
|
+
viaGoogle: props.viaGoogle,
|
407
|
+
viaGithub: props.viaGithub,
|
408
|
+
viaTwitter: props.viaTwitter,
|
409
|
+
isGoogleLoading: props.isGoogleLoading,
|
410
|
+
isGithubLoading: props.isGithubLoading,
|
411
|
+
isTwitterLoading: props.isTwitterLoading,
|
412
|
+
handleGoogle: props.onGoogleLogin,
|
413
|
+
handleGithub: props.onGithubLogin,
|
414
|
+
handleTwitter: props.onTwitterLogin
|
415
|
+
}
|
416
|
+
)
|
417
|
+
) : null));
|
418
|
+
};
|
419
|
+
|
420
|
+
// blocks/auth/RegisterForm.tsx
|
421
|
+
import React3, { useState as useState2 } from "react";
|
422
|
+
import { Controller as Controller2, FormProvider, useForm as useForm2 } from "react-hook-form";
|
423
|
+
import { zodResolver as zodResolver2 } from "@hookform/resolvers/zod";
|
424
|
+
import * as z2 from "zod";
|
425
|
+
var RegisterForm = ({
|
426
|
+
texts,
|
427
|
+
registerFields = ["email"],
|
428
|
+
...props
|
429
|
+
}) => {
|
430
|
+
var _a, _b, _c, _d, _e, _f;
|
431
|
+
const [passwordVisible, setPasswordVisible] = useState2(false);
|
432
|
+
const thirdPartyAuthTexts = {
|
433
|
+
continueWithGoogle: texts == null ? void 0 : texts.continueWithGoogle,
|
434
|
+
continueWithTwitter: texts == null ? void 0 : texts.continueWithTwitter,
|
435
|
+
continueWithApple: texts == null ? void 0 : texts.continueWithApple,
|
436
|
+
continueWithMicrosoft: texts == null ? void 0 : texts.continueWithMicrosoft,
|
437
|
+
continueWithGithub: texts == null ? void 0 : texts.continueWithGithub,
|
438
|
+
continueWithEmail: texts == null ? void 0 : texts.continueWithEmail,
|
439
|
+
continueWithPhone: texts == null ? void 0 : texts.continueWithPhone
|
440
|
+
};
|
441
|
+
const methods = useForm2();
|
442
|
+
let fieldSchemas = {};
|
443
|
+
registerFields.forEach((field) => {
|
444
|
+
var _a2, _b2, _c2, _d2, _e2, _f2;
|
445
|
+
switch (field) {
|
446
|
+
case "fullname":
|
447
|
+
fieldSchemas["fullName"] = z2.string().optional();
|
448
|
+
break;
|
449
|
+
case "email":
|
450
|
+
fieldSchemas["email"] = z2.string({ required_error: (_a2 = texts == null ? void 0 : texts.email) == null ? void 0 : _a2.required }).email({ message: (_b2 = texts == null ? void 0 : texts.email) == null ? void 0 : _b2.invalid }).min(1, { message: (_c2 = texts == null ? void 0 : texts.email) == null ? void 0 : _c2.required });
|
451
|
+
break;
|
452
|
+
case "username":
|
453
|
+
fieldSchemas["username"] = z2.string({ required_error: (_d2 = texts == null ? void 0 : texts.username) == null ? void 0 : _d2.required }).min(1, { message: (_e2 = texts == null ? void 0 : texts.username) == null ? void 0 : _e2.required }).refine(
|
454
|
+
(value) => {
|
455
|
+
const isValid = /^[a-zA-Z][a-zA-Z0-9_-]{2,14}$/.test(value);
|
456
|
+
return isValid;
|
457
|
+
},
|
458
|
+
{ message: (_f2 = texts == null ? void 0 : texts.username) == null ? void 0 : _f2.invalid }
|
459
|
+
);
|
460
|
+
break;
|
461
|
+
}
|
462
|
+
});
|
463
|
+
const formSchema = z2.object({
|
464
|
+
...fieldSchemas,
|
465
|
+
password: z2.string({ required_error: (_a = texts == null ? void 0 : texts.password) == null ? void 0 : _a.required }).min(5, { message: (_b = texts == null ? void 0 : texts.password) == null ? void 0 : _b.tooShort }).refine((value) => value !== "", {
|
466
|
+
message: (_c = texts == null ? void 0 : texts.password) == null ? void 0 : _c.required
|
467
|
+
}),
|
468
|
+
confirm_password: z2.string({ required_error: (_d = texts == null ? void 0 : texts.confirm) == null ? void 0 : _d.required }).refine((value) => value !== "", {
|
469
|
+
message: (_e = texts == null ? void 0 : texts.password) == null ? void 0 : _e.required
|
470
|
+
}),
|
471
|
+
refCode: z2.string().optional(),
|
472
|
+
reference: z2.string().optional(),
|
473
|
+
terms_accepted: z2.boolean({ required_error: texts == null ? void 0 : texts.termsRequired }).refine((value) => value, { message: texts == null ? void 0 : texts.termsRequired }),
|
474
|
+
newsletter_accepted: z2.boolean().optional()
|
475
|
+
}).refine((data) => data.password === data.confirm_password, {
|
476
|
+
message: (_f = texts == null ? void 0 : texts.confirm) == null ? void 0 : _f.dontMatch,
|
477
|
+
path: ["confirm_password"]
|
478
|
+
});
|
479
|
+
const { handleSubmit, control, formState } = useForm2({
|
480
|
+
resolver: zodResolver2(formSchema)
|
481
|
+
});
|
482
|
+
return /* @__PURE__ */ React3.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-4" }, /* @__PURE__ */ React3.createElement(Card, { dir: props.direction }, /* @__PURE__ */ React3.createElement(CardContent, { headless: true }, /* @__PURE__ */ React3.createElement("div", null, props.showError && /* @__PURE__ */ React3.createElement(
|
483
|
+
Alert,
|
484
|
+
{
|
485
|
+
title: props.errorTitle,
|
486
|
+
text: props.errorText,
|
487
|
+
severity: "error"
|
488
|
+
}
|
489
|
+
), /* @__PURE__ */ React3.createElement(FormProvider, { ...methods }, /* @__PURE__ */ React3.createElement(
|
490
|
+
"form",
|
491
|
+
{
|
492
|
+
noValidate: true,
|
493
|
+
onSubmit: handleSubmit((e) => {
|
494
|
+
if (props.onRegister) {
|
495
|
+
return props.onRegister(e);
|
496
|
+
} else {
|
497
|
+
console.log(
|
498
|
+
"Form is submitted but onRegister prop is missing"
|
499
|
+
);
|
500
|
+
}
|
501
|
+
}),
|
502
|
+
className: "hawa-flex hawa-flex-col hawa-gap-4"
|
503
|
+
},
|
504
|
+
/* @__PURE__ */ React3.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-4" }, registerFields.map((fld, i) => {
|
505
|
+
if (fld === "fullname") {
|
506
|
+
return /* @__PURE__ */ React3.createElement(
|
507
|
+
Controller2,
|
508
|
+
{
|
509
|
+
key: i,
|
510
|
+
control,
|
511
|
+
name: "fullName",
|
512
|
+
render: ({ field }) => {
|
513
|
+
var _a2, _b2, _c2;
|
514
|
+
return /* @__PURE__ */ React3.createElement(
|
515
|
+
Input,
|
516
|
+
{
|
517
|
+
width: "full",
|
518
|
+
label: (_a2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _a2.label,
|
519
|
+
placeholder: (_b2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _b2.placeholder,
|
520
|
+
helperText: (_c2 = formState.errors.fullName) == null ? void 0 : _c2.message,
|
521
|
+
...field
|
522
|
+
}
|
523
|
+
);
|
524
|
+
}
|
525
|
+
}
|
526
|
+
);
|
527
|
+
}
|
528
|
+
if (fld === "email") {
|
529
|
+
return /* @__PURE__ */ React3.createElement(
|
530
|
+
Controller2,
|
531
|
+
{
|
532
|
+
key: i,
|
533
|
+
control,
|
534
|
+
name: "email",
|
535
|
+
render: ({ field }) => {
|
536
|
+
var _a2, _b2, _c2;
|
537
|
+
return /* @__PURE__ */ React3.createElement(
|
538
|
+
Input,
|
539
|
+
{
|
540
|
+
dir: "ltr",
|
541
|
+
inputProps: {
|
542
|
+
className: props.direction === "rtl" ? "hawa-text-right" : "hawa-text-left"
|
543
|
+
},
|
544
|
+
width: "full",
|
545
|
+
autoComplete: "email",
|
546
|
+
label: (_a2 = texts == null ? void 0 : texts.email) == null ? void 0 : _a2.label,
|
547
|
+
helperText: (_b2 = formState.errors.email) == null ? void 0 : _b2.message,
|
548
|
+
placeholder: ((_c2 = texts == null ? void 0 : texts.email) == null ? void 0 : _c2.placeholder) || "Enter your email",
|
549
|
+
...field
|
550
|
+
}
|
551
|
+
);
|
552
|
+
}
|
553
|
+
}
|
554
|
+
);
|
555
|
+
}
|
556
|
+
if (fld === "username") {
|
557
|
+
return /* @__PURE__ */ React3.createElement(
|
558
|
+
Controller2,
|
559
|
+
{
|
560
|
+
key: i,
|
561
|
+
control,
|
562
|
+
name: "username",
|
563
|
+
render: ({ field }) => {
|
564
|
+
var _a2, _b2, _c2;
|
565
|
+
return /* @__PURE__ */ React3.createElement(
|
566
|
+
Input,
|
567
|
+
{
|
568
|
+
width: "full",
|
569
|
+
autoComplete: "username",
|
570
|
+
label: (_a2 = texts == null ? void 0 : texts.username) == null ? void 0 : _a2.label,
|
571
|
+
helperText: (_b2 = formState.errors.username) == null ? void 0 : _b2.message,
|
572
|
+
placeholder: (_c2 = texts == null ? void 0 : texts.username) == null ? void 0 : _c2.placeholder,
|
573
|
+
...field
|
574
|
+
}
|
575
|
+
);
|
576
|
+
}
|
577
|
+
}
|
578
|
+
);
|
579
|
+
}
|
580
|
+
})),
|
581
|
+
/* @__PURE__ */ React3.createElement(
|
582
|
+
Controller2,
|
583
|
+
{
|
584
|
+
control,
|
585
|
+
name: "password",
|
586
|
+
render: ({ field }) => {
|
587
|
+
var _a2, _b2, _c2;
|
588
|
+
return /* @__PURE__ */ React3.createElement(
|
589
|
+
Input,
|
590
|
+
{
|
591
|
+
width: "full",
|
592
|
+
type: passwordVisible ? "text" : "password",
|
593
|
+
endIcon: /* @__PURE__ */ React3.createElement(
|
594
|
+
"div",
|
595
|
+
{
|
596
|
+
className: "hawa-cursor-pointer",
|
597
|
+
onClick: () => setPasswordVisible(!passwordVisible)
|
598
|
+
},
|
599
|
+
passwordVisible ? /* @__PURE__ */ React3.createElement(EyeIcon, { className: "hawa-text-gray-500" }) : /* @__PURE__ */ React3.createElement(HiddenEyeIcon, { className: "hawa-text-gray-500" }),
|
600
|
+
" "
|
601
|
+
),
|
602
|
+
autoComplete: "new-password",
|
603
|
+
label: (_a2 = texts == null ? void 0 : texts.password) == null ? void 0 : _a2.label,
|
604
|
+
placeholder: (_b2 = texts == null ? void 0 : texts.password) == null ? void 0 : _b2.placeholder,
|
605
|
+
helperText: (_c2 = formState.errors.password) == null ? void 0 : _c2.message,
|
606
|
+
...field
|
607
|
+
}
|
608
|
+
);
|
609
|
+
}
|
610
|
+
}
|
611
|
+
),
|
612
|
+
/* @__PURE__ */ React3.createElement(
|
613
|
+
Controller2,
|
614
|
+
{
|
615
|
+
control,
|
616
|
+
name: "confirm_password",
|
617
|
+
render: ({ field }) => {
|
618
|
+
var _a2, _b2, _c2;
|
619
|
+
return /* @__PURE__ */ React3.createElement(
|
620
|
+
Input,
|
621
|
+
{
|
622
|
+
width: "full",
|
623
|
+
type: "password",
|
624
|
+
autoComplete: "new-password",
|
625
|
+
label: (_a2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _a2.label,
|
626
|
+
placeholder: (_b2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _b2.placeholder,
|
627
|
+
helperText: (_c2 = formState.errors.confirm_password) == null ? void 0 : _c2.message,
|
628
|
+
...field
|
629
|
+
}
|
630
|
+
);
|
631
|
+
}
|
632
|
+
}
|
633
|
+
),
|
634
|
+
props.additionalInputs,
|
635
|
+
props.showRefCode && /* @__PURE__ */ React3.createElement(
|
636
|
+
Controller2,
|
637
|
+
{
|
638
|
+
control,
|
639
|
+
name: "refCode",
|
640
|
+
render: ({ field }) => {
|
641
|
+
var _a2;
|
642
|
+
return /* @__PURE__ */ React3.createElement(
|
643
|
+
Input,
|
644
|
+
{
|
645
|
+
width: "full",
|
646
|
+
label: texts == null ? void 0 : texts.refCode,
|
647
|
+
placeholder: (texts == null ? void 0 : texts.refCodePlaceholder) || "Enter the referral code",
|
648
|
+
helperText: (_a2 = formState.errors.refCode) == null ? void 0 : _a2.message,
|
649
|
+
...field
|
650
|
+
}
|
651
|
+
);
|
652
|
+
}
|
653
|
+
}
|
654
|
+
),
|
655
|
+
props.showUserSource && /* @__PURE__ */ React3.createElement(
|
656
|
+
Controller2,
|
657
|
+
{
|
658
|
+
control,
|
659
|
+
name: "reference",
|
660
|
+
render: ({ field }) => {
|
661
|
+
var _a2, _b2;
|
662
|
+
return /* @__PURE__ */ React3.createElement(
|
663
|
+
Select,
|
664
|
+
{
|
665
|
+
label: ((_a2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _a2.label) || "How did you learn about us?",
|
666
|
+
placeholder: (_b2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _b2.placeholder,
|
667
|
+
isCreatable: false,
|
668
|
+
isMulti: false,
|
669
|
+
isSearchable: false,
|
670
|
+
isClearable: false,
|
671
|
+
options: props.userReferenceOptions,
|
672
|
+
onChange: (e) => {
|
673
|
+
field.onChange(e.value);
|
674
|
+
}
|
675
|
+
}
|
676
|
+
);
|
677
|
+
}
|
678
|
+
}
|
679
|
+
),
|
680
|
+
/* @__PURE__ */ React3.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-3" }, props.showTermsOption && /* @__PURE__ */ React3.createElement(
|
681
|
+
Controller2,
|
682
|
+
{
|
683
|
+
control,
|
684
|
+
name: "terms_accepted",
|
685
|
+
render: ({ field }) => {
|
686
|
+
var _a2, _b2;
|
687
|
+
return /* @__PURE__ */ React3.createElement(
|
688
|
+
Checkbox,
|
689
|
+
{
|
690
|
+
id: "terms_accepted",
|
691
|
+
helperText: (_b2 = (_a2 = formState.errors.terms_accepted) == null ? void 0 : _a2.message) == null ? void 0 : _b2.toString(),
|
692
|
+
onCheckedChange: (e) => field.onChange(e),
|
693
|
+
label: /* @__PURE__ */ React3.createElement("div", { className: "hawa-flex hawa-flex-row hawa-gap-0.5" }, /* @__PURE__ */ React3.createElement("span", null, texts == null ? void 0 : texts.iAcceptText), " ", /* @__PURE__ */ React3.createElement(StopPropagationWrapper, null, /* @__PURE__ */ React3.createElement(
|
694
|
+
"a",
|
695
|
+
{
|
696
|
+
onClick: props.onRouteToTOS,
|
697
|
+
className: "clickable-link"
|
698
|
+
},
|
699
|
+
texts == null ? void 0 : texts.termsText
|
700
|
+
)))
|
701
|
+
}
|
702
|
+
);
|
703
|
+
}
|
704
|
+
}
|
705
|
+
), props.showNewsletterOption && /* @__PURE__ */ React3.createElement(
|
706
|
+
Controller2,
|
707
|
+
{
|
708
|
+
control,
|
709
|
+
name: "newsletter_accepted",
|
710
|
+
render: ({ field }) => /* @__PURE__ */ React3.createElement(
|
711
|
+
Checkbox,
|
712
|
+
{
|
713
|
+
id: "newsletter_accepted",
|
714
|
+
label: texts == null ? void 0 : texts.subscribeToNewsletter,
|
715
|
+
onCheckedChange: field.onChange
|
716
|
+
}
|
717
|
+
)
|
718
|
+
}
|
719
|
+
)),
|
720
|
+
/* @__PURE__ */ React3.createElement(
|
721
|
+
Button,
|
722
|
+
{
|
723
|
+
className: "hawa-mt-4 hawa-w-full",
|
724
|
+
type: "submit",
|
725
|
+
isLoading: props.isLoading,
|
726
|
+
disabled: props.isLoading
|
727
|
+
},
|
728
|
+
(texts == null ? void 0 : texts.registerText) || "Register"
|
729
|
+
),
|
730
|
+
props.additionalButtons
|
731
|
+
)), /* @__PURE__ */ React3.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-justify-center hawa-gap-1 hawa-p-3 hawa-text-center hawa-text-sm hawa-font-normal dark:hawa-text-white" }, /* @__PURE__ */ React3.createElement("span", null, texts == null ? void 0 : texts.existingUserText), /* @__PURE__ */ React3.createElement("span", { onClick: props.onRouteToLogin, className: "clickable-link" }, (texts == null ? void 0 : texts.loginText) || "Login")))), props.viaGithub || props.viaGoogle || props.viaTwitter ? /* @__PURE__ */ React3.createElement(
|
732
|
+
CardFooter,
|
733
|
+
{
|
734
|
+
className: cn(
|
735
|
+
props.logosOnly ? "hawa-flex hawa-flex-row hawa-justify-center hawa-gap-2" : "hawa-grid hawa-grid-cols-1 hawa-gap-2"
|
736
|
+
)
|
737
|
+
},
|
738
|
+
/* @__PURE__ */ React3.createElement(
|
739
|
+
AuthButtons,
|
740
|
+
{
|
741
|
+
texts: thirdPartyAuthTexts,
|
742
|
+
viaGoogle: props.viaGoogle,
|
743
|
+
viaGithub: props.viaGithub,
|
744
|
+
viaTwitter: props.viaTwitter,
|
745
|
+
isGoogleLoading: props.isGoogleLoading,
|
746
|
+
isGithubLoading: props.isGithubLoading,
|
747
|
+
isTwitterLoading: props.isTwitterLoading,
|
748
|
+
handleGoogle: props.onGoogleRegister,
|
749
|
+
handleGithub: props.onGithubRegister,
|
750
|
+
handleTwitter: props.onTwitterRegister
|
751
|
+
}
|
752
|
+
)
|
753
|
+
) : null));
|
754
|
+
};
|
755
|
+
|
756
|
+
// blocks/auth/AppLanding.tsx
|
757
|
+
import React4 from "react";
|
758
|
+
var AppLanding = ({ texts, ...props }) => {
|
759
|
+
const thirdPartyAuthTexts = {
|
760
|
+
continueWithGoogle: texts == null ? void 0 : texts.continueWithGoogle,
|
761
|
+
continueWithTwitter: texts == null ? void 0 : texts.continueWithTwitter,
|
762
|
+
continueWithApple: texts == null ? void 0 : texts.continueWithApple,
|
763
|
+
continueWithMicrosoft: texts == null ? void 0 : texts.continueWithMicrosoft,
|
764
|
+
continueWithGithub: texts == null ? void 0 : texts.continueWithGithub,
|
765
|
+
continueWithEmail: texts == null ? void 0 : texts.continueWithEmail,
|
766
|
+
continueWithPhone: texts == null ? void 0 : texts.continueWithPhone
|
767
|
+
};
|
768
|
+
return /* @__PURE__ */ React4.createElement("div", { dir: props.direction }, /* @__PURE__ */ React4.createElement(Card, null, /* @__PURE__ */ React4.createElement(CardContent, { headless: true, className: "hawa-flex hawa-flex-col hawa-gap-6" }, /* @__PURE__ */ React4.createElement(
|
769
|
+
AuthButtons,
|
770
|
+
{
|
771
|
+
texts: thirdPartyAuthTexts,
|
772
|
+
viaApple: props.viaApple,
|
773
|
+
viaGoogle: props.viaGoogle,
|
774
|
+
viaEmail: props.viaEmail,
|
775
|
+
viaGithub: props.viaGithub,
|
776
|
+
viaMicrosoft: props.viaMicrosoft,
|
777
|
+
viaPhone: props.viaPhone,
|
778
|
+
viaTwitter: props.viaTwitter,
|
779
|
+
handleApple: props.handleApple,
|
780
|
+
handleGoogle: props.handleGoogle,
|
781
|
+
handleTwitter: props.handleTwitter,
|
782
|
+
handleMicrosoft: props.handleMicrosoft,
|
783
|
+
handleGithub: props.handleGithub,
|
784
|
+
handleEmail: props.handleEmail,
|
785
|
+
handlePhone: props.handlePhone
|
786
|
+
}
|
787
|
+
), props.allowRegister && /* @__PURE__ */ React4.createElement("div", { className: "hawa-p-3 hawa-text-center hawa-text-sm hawa-font-normal dark:hawa-text-gray-300" }, texts == null ? void 0 : texts.newUserText, " ", /* @__PURE__ */ React4.createElement(
|
788
|
+
"span",
|
789
|
+
{
|
790
|
+
onClick: props.handleRouteToRegister,
|
791
|
+
className: "clickable-link"
|
792
|
+
},
|
793
|
+
texts == null ? void 0 : texts.createAccount
|
794
|
+
)))));
|
795
|
+
};
|
796
|
+
|
797
|
+
// blocks/auth/CheckEmail.tsx
|
798
|
+
import React5 from "react";
|
799
|
+
var CheckEmail = ({ texts, handleResend }) => {
|
800
|
+
return /* @__PURE__ */ React5.createElement(Card, null, /* @__PURE__ */ React5.createElement(CardContent, { headless: true }, /* @__PURE__ */ React5.createElement("div", { className: "hawa-flex hawa-flex-col hawa-items-center hawa-justify-center hawa-text-center" }, /* @__PURE__ */ React5.createElement("div", { className: "hawa-flex hawa-h-16 hawa-w-16 hawa-flex-col hawa-items-center hawa-justify-center hawa-rounded-3xl hawa-bg-primary hawa-text-6xl hawa-font-bold hawa-text-primary-foreground" }, /* @__PURE__ */ React5.createElement(
|
801
|
+
"svg",
|
802
|
+
{
|
803
|
+
stroke: "currentColor",
|
804
|
+
fill: "none",
|
805
|
+
strokeWidth: "2",
|
806
|
+
viewBox: "0 0 24 24",
|
807
|
+
strokeLinecap: "round",
|
808
|
+
strokeLinejoin: "round",
|
809
|
+
height: "0.5em",
|
810
|
+
width: "0.5em",
|
811
|
+
xmlns: "http://www.w3.org/2000/svg"
|
812
|
+
},
|
813
|
+
/* @__PURE__ */ React5.createElement("path", { d: "M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z" }),
|
814
|
+
/* @__PURE__ */ React5.createElement("polyline", { points: "22,6 12,13 2,6" })
|
815
|
+
)), /* @__PURE__ */ React5.createElement("div", { className: "hawa-m-2 hawa-text-xl hawa-font-bold" }, (texts == null ? void 0 : texts.checkEmail) || "Check your Email"), /* @__PURE__ */ React5.createElement("div", { className: "hawa-text-sm" }, (texts == null ? void 0 : texts.pleaseVerify) || "Thank you for signing up! To complete your registration, we've sent a verification email to the address you provided. Please check your inbox and follow the instructions in the email to activate your account."))), /* @__PURE__ */ React5.createElement(CardFooter, { className: "hawa-flex hawa-flex-col hawa-justify-center " }, /* @__PURE__ */ React5.createElement("span", { className: "clickable-link hawa-text-sm", onClick: handleResend }, (texts == null ? void 0 : texts.resendEmail) || "Resend Email")));
|
816
|
+
};
|
817
|
+
|
818
|
+
// blocks/auth/NewPassword.tsx
|
819
|
+
import React6, { useState as useState3 } from "react";
|
820
|
+
import { Controller as Controller3, useForm as useForm3 } from "react-hook-form";
|
821
|
+
import { zodResolver as zodResolver3 } from "@hookform/resolvers/zod";
|
822
|
+
import * as z3 from "zod";
|
823
|
+
var NewPasswordForm = ({ texts, ...props }) => {
|
824
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
825
|
+
const formSchema = z3.object({
|
826
|
+
password: z3.string({ required_error: (_a = texts == null ? void 0 : texts.password) == null ? void 0 : _a.required }).min(1, { message: (_b = texts == null ? void 0 : texts.password) == null ? void 0 : _b.required }).min(8, { message: (_c = texts == null ? void 0 : texts.password) == null ? void 0 : _c.tooShort }),
|
827
|
+
confirm_password: z3.string({ required_error: (_d = texts == null ? void 0 : texts.confirm) == null ? void 0 : _d.required }).refine((value) => value !== "", {
|
828
|
+
message: (_e = texts == null ? void 0 : texts.password) == null ? void 0 : _e.required
|
829
|
+
})
|
830
|
+
}).refine((data) => data.password === data.confirm_password, {
|
831
|
+
message: (_f = texts == null ? void 0 : texts.confirm) == null ? void 0 : _f.dontMatch,
|
832
|
+
path: ["confirm_password"]
|
833
|
+
});
|
834
|
+
const { handleSubmit, control, formState } = useForm3({
|
835
|
+
resolver: zodResolver3(formSchema)
|
836
|
+
});
|
837
|
+
const [matchError, setMatchError] = useState3(false);
|
838
|
+
return /* @__PURE__ */ React6.createElement(Card, { dir: props.direction }, matchError && /* @__PURE__ */ React6.createElement(Alert, { text: (_g = texts == null ? void 0 : texts.confirm) == null ? void 0 : _g.dontMatch, severity: "error" }), props.passwordChanged ? /* @__PURE__ */ React6.createElement(CardContent, { headless: true }, /* @__PURE__ */ React6.createElement("div", { className: "hawa-text-center" }, texts == null ? void 0 : texts.passwordChanged)) : /* @__PURE__ */ React6.createElement(
|
839
|
+
"form",
|
840
|
+
{
|
841
|
+
noValidate: true,
|
842
|
+
onSubmit: handleSubmit((e) => {
|
843
|
+
if (props.handleNewPassword) {
|
844
|
+
return props.handleNewPassword(e);
|
845
|
+
} else {
|
846
|
+
console.log(
|
847
|
+
"Form is submitted but handleSubmission prop is missing"
|
848
|
+
);
|
849
|
+
}
|
850
|
+
})
|
851
|
+
},
|
852
|
+
!props.headless && /* @__PURE__ */ React6.createElement(CardHeader, null, /* @__PURE__ */ React6.createElement(CardTitle, null, "Create Password"), /* @__PURE__ */ React6.createElement(CardDescription, null, "Set a new password for your account")),
|
853
|
+
/* @__PURE__ */ React6.createElement(
|
854
|
+
CardContent,
|
855
|
+
{
|
856
|
+
headless: props.headless,
|
857
|
+
className: "hawa-flex hawa-flex-col hawa-gap-4"
|
858
|
+
},
|
859
|
+
/* @__PURE__ */ React6.createElement(
|
860
|
+
Controller3,
|
861
|
+
{
|
862
|
+
control,
|
863
|
+
name: "password",
|
864
|
+
render: ({ field }) => {
|
865
|
+
var _a2, _b2, _c2;
|
866
|
+
return /* @__PURE__ */ React6.createElement(
|
867
|
+
Input,
|
868
|
+
{
|
869
|
+
width: "full",
|
870
|
+
type: "password",
|
871
|
+
autoComplete: "new-password",
|
872
|
+
label: (_a2 = texts == null ? void 0 : texts.password) == null ? void 0 : _a2.label,
|
873
|
+
placeholder: (_b2 = texts == null ? void 0 : texts.password) == null ? void 0 : _b2.placeholder,
|
874
|
+
helperText: (_c2 = formState.errors.password) == null ? void 0 : _c2.message,
|
875
|
+
...field
|
876
|
+
}
|
877
|
+
);
|
878
|
+
}
|
879
|
+
}
|
880
|
+
),
|
881
|
+
/* @__PURE__ */ React6.createElement(
|
882
|
+
Controller3,
|
883
|
+
{
|
884
|
+
control,
|
885
|
+
name: "confirm_password",
|
886
|
+
render: ({ field }) => {
|
887
|
+
var _a2, _b2, _c2;
|
888
|
+
return /* @__PURE__ */ React6.createElement(
|
889
|
+
Input,
|
890
|
+
{
|
891
|
+
width: "full",
|
892
|
+
type: "password",
|
893
|
+
autoComplete: "new-password",
|
894
|
+
label: (_a2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _a2.label,
|
895
|
+
placeholder: (_b2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _b2.placeholder,
|
896
|
+
helperText: (_c2 = formState.errors.confirm_password) == null ? void 0 : _c2.message,
|
897
|
+
...field
|
898
|
+
}
|
899
|
+
);
|
900
|
+
}
|
901
|
+
}
|
902
|
+
)
|
903
|
+
),
|
904
|
+
/* @__PURE__ */ React6.createElement(CardFooter, { className: "hawa-flex hawa-flex-col" }, /* @__PURE__ */ React6.createElement(Button, { className: "hawa-w-full", type: "submit" }, texts == null ? void 0 : texts.updatePassword), props.allowRegister && /* @__PURE__ */ React6.createElement("div", { className: "hawa-mt-4 hawa-pb-0 hawa-text-center hawa-text-sm dark:hawa-text-gray-300" }, (_h = texts == null ? void 0 : texts.dontHaveAccount) != null ? _h : "Don't have an account? ", /* @__PURE__ */ React6.createElement(
|
905
|
+
"span",
|
906
|
+
{
|
907
|
+
className: "clickable-link",
|
908
|
+
onClick: props.handleRouteToRegister
|
909
|
+
},
|
910
|
+
(_i = texts == null ? void 0 : texts.registerText) != null ? _i : "Register"
|
911
|
+
)))
|
912
|
+
));
|
913
|
+
};
|
914
|
+
|
915
|
+
// blocks/auth/ResetPassword.tsx
|
916
|
+
import React7 from "react";
|
917
|
+
import { Controller as Controller4, useForm as useForm4 } from "react-hook-form";
|
918
|
+
import { zodResolver as zodResolver4 } from "@hookform/resolvers/zod";
|
919
|
+
import * as z4 from "zod";
|
920
|
+
var ResetPasswordForm = (props) => {
|
921
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
|
922
|
+
const formSchema = z4.object({
|
923
|
+
email: z4.string({ required_error: (_b = (_a = props.texts) == null ? void 0 : _a.email) == null ? void 0 : _b.required }).email({ message: (_d = (_c = props.texts) == null ? void 0 : _c.email) == null ? void 0 : _d.invalid }).min(1, { message: (_f = (_e = props.texts) == null ? void 0 : _e.email) == null ? void 0 : _f.required })
|
924
|
+
});
|
925
|
+
const { handleSubmit, control, formState } = useForm4({
|
926
|
+
resolver: zodResolver4(formSchema)
|
927
|
+
});
|
928
|
+
return /* @__PURE__ */ React7.createElement(Card, { dir: props.direction }, !props.sent ? /* @__PURE__ */ React7.createElement(React7.Fragment, null, !props.headless && /* @__PURE__ */ React7.createElement(CardHeader, null, /* @__PURE__ */ React7.createElement(CardTitle, null, ((_g = props.texts) == null ? void 0 : _g.headTitle) || "Reset Password"), /* @__PURE__ */ React7.createElement(CardDescription, null, ((_h = props.texts) == null ? void 0 : _h.headDescription) || "Enter your email to reset your account password")), /* @__PURE__ */ React7.createElement(
|
929
|
+
"form",
|
930
|
+
{
|
931
|
+
noValidate: true,
|
932
|
+
onSubmit: handleSubmit((e) => {
|
933
|
+
if (props.handleResetPassword) {
|
934
|
+
return props.handleResetPassword(e);
|
935
|
+
} else {
|
936
|
+
console.log("handleResetPassword prop is missing");
|
937
|
+
}
|
938
|
+
})
|
939
|
+
},
|
940
|
+
/* @__PURE__ */ React7.createElement(CardContent, { headless: props.headless }, /* @__PURE__ */ React7.createElement(
|
941
|
+
Controller4,
|
942
|
+
{
|
943
|
+
control,
|
944
|
+
name: "email",
|
945
|
+
render: ({ field }) => {
|
946
|
+
var _a2, _b2, _c2, _d2, _e2;
|
947
|
+
return /* @__PURE__ */ React7.createElement(
|
948
|
+
Input,
|
949
|
+
{
|
950
|
+
width: "full",
|
951
|
+
label: (_b2 = (_a2 = props.texts) == null ? void 0 : _a2.email) == null ? void 0 : _b2.label,
|
952
|
+
helperText: (_c2 = formState.errors.email) == null ? void 0 : _c2.message,
|
953
|
+
placeholder: (_e2 = (_d2 = props.texts) == null ? void 0 : _d2.email) == null ? void 0 : _e2.placeholder,
|
954
|
+
...field
|
955
|
+
}
|
956
|
+
);
|
957
|
+
}
|
958
|
+
}
|
959
|
+
)),
|
960
|
+
/* @__PURE__ */ React7.createElement(CardFooter, { className: "hawa-flex hawa-flex-col" }, /* @__PURE__ */ React7.createElement(Button, { type: "submit", className: "hawa-w-full" }, (_i = props.texts) == null ? void 0 : _i.resetPassword), props.allowRegister && /* @__PURE__ */ React7.createElement("div", { className: "hawa-mt-4 hawa-pb-0 hawa-text-center hawa-text-sm dark:hawa-text-gray-300" }, (_k = (_j = props.texts) == null ? void 0 : _j.dontHaveAccount) != null ? _k : "Don't have an account? ", /* @__PURE__ */ React7.createElement(
|
961
|
+
"span",
|
962
|
+
{
|
963
|
+
className: "clickable-link",
|
964
|
+
onClick: props.handleRouteToRegister
|
965
|
+
},
|
966
|
+
(_m = (_l = props.texts) == null ? void 0 : _l.registerText) != null ? _m : "Register"
|
967
|
+
)))
|
968
|
+
)) : /* @__PURE__ */ React7.createElement(CardContent, { headless: true }, /* @__PURE__ */ React7.createElement("div", { className: "hawa-text-center" }, (_n = props.texts) == null ? void 0 : _n.emailSentText)));
|
969
|
+
};
|
970
|
+
|
971
|
+
// blocks/auth/CodeConfirmation.tsx
|
972
|
+
import React8, { useEffect, useState as useState4 } from "react";
|
973
|
+
import { Controller as Controller5, useForm as useForm5 } from "react-hook-form";
|
974
|
+
import { zodResolver as zodResolver5 } from "@hookform/resolvers/zod";
|
975
|
+
import * as z5 from "zod";
|
976
|
+
var CodeConfirmation = (props) => {
|
977
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
978
|
+
const formSchema = z5.object({
|
979
|
+
otp_code: z5.string({ required_error: (_a = props.texts) == null ? void 0 : _a.codeRequiredText }).min(6, { message: (_b = props.texts) == null ? void 0 : _b.codeTooShort })
|
980
|
+
});
|
981
|
+
const { handleSubmit, control, formState, setValue } = useForm5({
|
982
|
+
resolver: zodResolver5(formSchema)
|
983
|
+
});
|
984
|
+
const [resendTimer, setResendTimer] = useState4(null);
|
985
|
+
const [remainingTime, setRemainingTime] = useState4(0);
|
986
|
+
const [showResendTimer, setShowResendTimer] = useState4(false);
|
987
|
+
const startResendTimer = () => {
|
988
|
+
if (resendTimer !== null) {
|
989
|
+
clearInterval(resendTimer);
|
990
|
+
setResendTimer(null);
|
991
|
+
}
|
992
|
+
const timerDuration = 60;
|
993
|
+
setRemainingTime(timerDuration);
|
994
|
+
setShowResendTimer(true);
|
995
|
+
const newTimer = window.setInterval(() => {
|
996
|
+
setRemainingTime((prevTime) => {
|
997
|
+
if (prevTime > 0) {
|
998
|
+
return prevTime - 1;
|
999
|
+
} else {
|
1000
|
+
clearInterval(newTimer);
|
1001
|
+
setShowResendTimer(false);
|
1002
|
+
return 0;
|
1003
|
+
}
|
1004
|
+
});
|
1005
|
+
}, 1e3);
|
1006
|
+
setResendTimer(newTimer);
|
1007
|
+
};
|
1008
|
+
useEffect(() => {
|
1009
|
+
return () => {
|
1010
|
+
if (resendTimer !== null) {
|
1011
|
+
clearInterval(resendTimer);
|
1012
|
+
}
|
1013
|
+
};
|
1014
|
+
}, []);
|
1015
|
+
return /* @__PURE__ */ React8.createElement(Card, null, /* @__PURE__ */ React8.createElement(CardContent, { headless: true }, props.showError && /* @__PURE__ */ React8.createElement(
|
1016
|
+
Alert,
|
1017
|
+
{
|
1018
|
+
title: props.errorTitle,
|
1019
|
+
text: props.errorText,
|
1020
|
+
severity: "error"
|
1021
|
+
}
|
1022
|
+
), /* @__PURE__ */ React8.createElement("div", { className: "hawa-mb-4 dark:hawa-text-white" }, /* @__PURE__ */ React8.createElement("div", { className: "hawa-text-lg hawa-font-bold" }, ((_c = props.texts) == null ? void 0 : _c.checkYourPhone) || "Please check your phone"), /* @__PURE__ */ React8.createElement("div", { className: "hawa-text-muted-foreground" }, /* @__PURE__ */ React8.createElement("span", null, ((_d = props.texts) == null ? void 0 : _d.weSentCode) || "We've sent a code to "), /* @__PURE__ */ React8.createElement("span", null, props.phoneNumber))), /* @__PURE__ */ React8.createElement(
|
1023
|
+
"form",
|
1024
|
+
{
|
1025
|
+
noValidate: true,
|
1026
|
+
onSubmit: handleSubmit((e) => {
|
1027
|
+
if (props.handleConfirm) {
|
1028
|
+
return props.handleConfirm(e);
|
1029
|
+
} else {
|
1030
|
+
console.log(
|
1031
|
+
"Form is submitted but handleConfirm prop is missing"
|
1032
|
+
);
|
1033
|
+
}
|
1034
|
+
})
|
1035
|
+
},
|
1036
|
+
/* @__PURE__ */ React8.createElement(
|
1037
|
+
Controller5,
|
1038
|
+
{
|
1039
|
+
control,
|
1040
|
+
name: "otp_code",
|
1041
|
+
render: ({ field }) => {
|
1042
|
+
var _a2;
|
1043
|
+
return /* @__PURE__ */ React8.createElement(
|
1044
|
+
PinInput,
|
1045
|
+
{
|
1046
|
+
width: "full",
|
1047
|
+
digits: 6,
|
1048
|
+
getPins: (e) => setValue("otp_code", e.join("")),
|
1049
|
+
helperText: (_a2 = formState.errors.otp_code) == null ? void 0 : _a2.message
|
1050
|
+
}
|
1051
|
+
);
|
1052
|
+
}
|
1053
|
+
}
|
1054
|
+
),
|
1055
|
+
showResendTimer ? /* @__PURE__ */ React8.createElement("div", { className: " hawa-py-2 hawa-text-center hawa-text-xs hawa-text-muted-foreground" }, (_e = props.texts) == null ? void 0 : _e.resendCodeTimer, " ", /* @__PURE__ */ React8.createElement("strong", null, remainingTime), " ", (_f = props.texts) == null ? void 0 : _f.seconds) : /* @__PURE__ */ React8.createElement("div", { className: " hawa-py-2 hawa-text-center hawa-text-xs hawa-text-muted-foreground" }, /* @__PURE__ */ React8.createElement("span", null, (_h = (_g = props.texts) == null ? void 0 : _g.didntGetCode) != null ? _h : "Didn't get the code?"), " ", /* @__PURE__ */ React8.createElement(
|
1056
|
+
"span",
|
1057
|
+
{
|
1058
|
+
className: "clickable-link",
|
1059
|
+
onClick: () => {
|
1060
|
+
startResendTimer();
|
1061
|
+
props.handleResend();
|
1062
|
+
}
|
1063
|
+
},
|
1064
|
+
((_i = props.texts) == null ? void 0 : _i.resendCode) || "Click to resend"
|
1065
|
+
)),
|
1066
|
+
/* @__PURE__ */ React8.createElement("div", { className: "hawa-mt-4 hawa-grid hawa-grid-cols-2 hawa-gap-2" }, /* @__PURE__ */ React8.createElement(Button, { variant: "secondary" }, ((_j = props.texts) == null ? void 0 : _j.cancel) || "Cancel"), /* @__PURE__ */ React8.createElement(Button, { isLoading: props.confirmLoading }, ((_k = props.texts) == null ? void 0 : _k.confirm) || "Confirm"))
|
1067
|
+
)));
|
1068
|
+
};
|
1069
|
+
|
1070
|
+
// blocks/feedback/UserReferralSource.tsx
|
1071
|
+
import React9, { useRef, useState as useState5 } from "react";
|
1072
|
+
import { Controller as Controller6, useForm as useForm6 } from "react-hook-form";
|
1073
|
+
import { zodResolver as zodResolver6 } from "@hookform/resolvers/zod";
|
1074
|
+
import * as z6 from "zod";
|
1075
|
+
var UserReferralSource = ({
|
1076
|
+
position = "bottom-right",
|
1077
|
+
options = [],
|
1078
|
+
...props
|
1079
|
+
}) => {
|
1080
|
+
var _a, _b;
|
1081
|
+
const [closed, setClosed] = useState5(false);
|
1082
|
+
const popUpRef = useRef(null);
|
1083
|
+
const formSchema = z6.object({
|
1084
|
+
source: z6.string({ required_error: (_a = props.texts) == null ? void 0 : _a.pleaseSelectOption }),
|
1085
|
+
feedback: z6.string().optional()
|
1086
|
+
});
|
1087
|
+
const { handleSubmit, control, formState, watch } = useForm6({
|
1088
|
+
resolver: zodResolver6(formSchema)
|
1089
|
+
});
|
1090
|
+
const selectedSource = watch("source");
|
1091
|
+
const boxPosition = {
|
1092
|
+
"bottom-right": "hawa-right-4",
|
1093
|
+
"bottom-left": "hawa-left-4"
|
1094
|
+
};
|
1095
|
+
const optionsWithOther = [
|
1096
|
+
...options,
|
1097
|
+
{
|
1098
|
+
value: "other",
|
1099
|
+
label: "Other"
|
1100
|
+
}
|
1101
|
+
];
|
1102
|
+
return /* @__PURE__ */ React9.createElement(
|
1103
|
+
"div",
|
1104
|
+
{
|
1105
|
+
className: cn(
|
1106
|
+
"hawa-transition-all",
|
1107
|
+
closed ? "hawa-opacity-0" : "hawa-opacity-100"
|
1108
|
+
),
|
1109
|
+
ref: popUpRef
|
1110
|
+
},
|
1111
|
+
/* @__PURE__ */ React9.createElement(
|
1112
|
+
Card,
|
1113
|
+
{
|
1114
|
+
className: cn(
|
1115
|
+
"hawa-fixed hawa-bottom-4 hawa-p-0 ",
|
1116
|
+
boxPosition[position]
|
1117
|
+
),
|
1118
|
+
dir: props.direction
|
1119
|
+
},
|
1120
|
+
/* @__PURE__ */ React9.createElement(
|
1121
|
+
"button",
|
1122
|
+
{
|
1123
|
+
type: "button",
|
1124
|
+
className: cn(
|
1125
|
+
props.direction === "rtl" ? "hawa-left-2" : "hawa-right-2",
|
1126
|
+
"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"
|
1127
|
+
),
|
1128
|
+
"data-dismiss-target": "#toast-default",
|
1129
|
+
"aria-label": "Close",
|
1130
|
+
onClick: () => {
|
1131
|
+
setClosed(true);
|
1132
|
+
setTimeout(() => {
|
1133
|
+
if (popUpRef == null ? void 0 : popUpRef.current) {
|
1134
|
+
popUpRef == null ? void 0 : popUpRef.current.removeChild(popUpRef == null ? void 0 : popUpRef.current.children[0]);
|
1135
|
+
}
|
1136
|
+
}, 200);
|
1137
|
+
}
|
1138
|
+
},
|
1139
|
+
/* @__PURE__ */ React9.createElement(
|
1140
|
+
"svg",
|
1141
|
+
{
|
1142
|
+
"aria-hidden": "true",
|
1143
|
+
className: "hawa-h-5 hawa-w-5",
|
1144
|
+
fill: "currentColor",
|
1145
|
+
viewBox: "0 0 20 20"
|
1146
|
+
},
|
1147
|
+
/* @__PURE__ */ React9.createElement(
|
1148
|
+
"path",
|
1149
|
+
{
|
1150
|
+
fillRule: "evenodd",
|
1151
|
+
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",
|
1152
|
+
clipRule: "evenodd"
|
1153
|
+
}
|
1154
|
+
)
|
1155
|
+
)
|
1156
|
+
),
|
1157
|
+
/* @__PURE__ */ React9.createElement(CardContent, { headless: true }, /* @__PURE__ */ React9.createElement(
|
1158
|
+
"form",
|
1159
|
+
{
|
1160
|
+
noValidate: true,
|
1161
|
+
onSubmit: handleSubmit((e) => {
|
1162
|
+
if (props.onSubmitForm) {
|
1163
|
+
props.onSubmitForm(e);
|
1164
|
+
} else {
|
1165
|
+
console.log("onSubmitForm was not provided");
|
1166
|
+
}
|
1167
|
+
})
|
1168
|
+
},
|
1169
|
+
/* @__PURE__ */ React9.createElement(
|
1170
|
+
"div",
|
1171
|
+
{
|
1172
|
+
className: cn(
|
1173
|
+
"hawa-flex hawa-flex-col hawa-gap-4 hawa-transition-all",
|
1174
|
+
closed ? "hawa-opacity-0" : "hawa-opacity-100"
|
1175
|
+
)
|
1176
|
+
},
|
1177
|
+
/* @__PURE__ */ React9.createElement("div", { className: "hawa-mt-4 hawa-font-bold" }, props.question),
|
1178
|
+
/* @__PURE__ */ React9.createElement("div", { className: "hawa-flex hawa-w-full hawa-flex-row hawa-gap-1 hawa-rounded " }, /* @__PURE__ */ React9.createElement(
|
1179
|
+
Controller6,
|
1180
|
+
{
|
1181
|
+
control,
|
1182
|
+
name: "source",
|
1183
|
+
render: ({ field }) => {
|
1184
|
+
var _a2, _b2;
|
1185
|
+
return /* @__PURE__ */ React9.createElement(
|
1186
|
+
Radio,
|
1187
|
+
{
|
1188
|
+
direction: props.direction,
|
1189
|
+
orientation: "vertical",
|
1190
|
+
options: optionsWithOther,
|
1191
|
+
defaultValue: field.value,
|
1192
|
+
onChange: (e) => field.onChange(e.value),
|
1193
|
+
helperText: (_b2 = (_a2 = formState.errors.source) == null ? void 0 : _a2.message) == null ? void 0 : _b2.toString()
|
1194
|
+
}
|
1195
|
+
);
|
1196
|
+
}
|
1197
|
+
}
|
1198
|
+
)),
|
1199
|
+
/* @__PURE__ */ React9.createElement("div", null, /* @__PURE__ */ React9.createElement(
|
1200
|
+
Controller6,
|
1201
|
+
{
|
1202
|
+
control,
|
1203
|
+
name: "feedback",
|
1204
|
+
render: ({ field }) => {
|
1205
|
+
var _a2, _b2;
|
1206
|
+
return /* @__PURE__ */ React9.createElement(
|
1207
|
+
Textarea,
|
1208
|
+
{
|
1209
|
+
...field,
|
1210
|
+
textareaProps: {
|
1211
|
+
onChange: (e) => field.onChange(e.target.value),
|
1212
|
+
disabled: selectedSource !== "other"
|
1213
|
+
},
|
1214
|
+
helperText: (_b2 = (_a2 = formState.errors.feedback) == null ? void 0 : _a2.message) == null ? void 0 : _b2.toString()
|
1215
|
+
}
|
1216
|
+
);
|
1217
|
+
}
|
1218
|
+
}
|
1219
|
+
))
|
1220
|
+
),
|
1221
|
+
/* @__PURE__ */ React9.createElement(Button, { type: "submit", className: "hawa-mt-4 hawa-w-full" }, ((_b = props.texts) == null ? void 0 : _b.submit) || "Submit")
|
1222
|
+
))
|
1223
|
+
)
|
1224
|
+
);
|
1225
|
+
};
|
1226
|
+
|
1227
|
+
// blocks/feedback/FeedbackRating.tsx
|
1228
|
+
import React10, { useEffect as useEffect2, useRef as useRef2, useState as useState6 } from "react";
|
1229
|
+
var FeedbackRating = ({
|
1230
|
+
position = "bottom-right",
|
1231
|
+
...props
|
1232
|
+
}) => {
|
1233
|
+
const [closed, setClosed] = useState6(false);
|
1234
|
+
const [answered, setAnswered] = useState6(false);
|
1235
|
+
const [clickedOption, setClickedOption] = useState6(null);
|
1236
|
+
const [closingTimer, setClosingTimer] = useState6(5);
|
1237
|
+
const popUpRef = useRef2(null);
|
1238
|
+
const boxPosition = {
|
1239
|
+
"bottom-right": "hawa-right-4",
|
1240
|
+
"bottom-left": "hawa-left-4"
|
1241
|
+
};
|
1242
|
+
useEffect2(() => {
|
1243
|
+
const timeoutHide = setTimeout(() => {
|
1244
|
+
if (closingTimer >= 0) {
|
1245
|
+
setClosingTimer(closingTimer - 1);
|
1246
|
+
}
|
1247
|
+
}, 1e3);
|
1248
|
+
return () => {
|
1249
|
+
clearTimeout(timeoutHide);
|
1250
|
+
};
|
1251
|
+
}, [closingTimer]);
|
1252
|
+
const slowClose = () => {
|
1253
|
+
setClosed(true);
|
1254
|
+
setTimeout(() => {
|
1255
|
+
if (popUpRef.current) {
|
1256
|
+
popUpRef.current.removeChild(popUpRef.current.children[0]);
|
1257
|
+
}
|
1258
|
+
}, 200);
|
1259
|
+
};
|
1260
|
+
return /* @__PURE__ */ React10.createElement(
|
1261
|
+
"div",
|
1262
|
+
{
|
1263
|
+
ref: popUpRef,
|
1264
|
+
className: cn(
|
1265
|
+
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 ",
|
1266
|
+
boxPosition[position]
|
1267
|
+
)
|
1268
|
+
},
|
1269
|
+
/* @__PURE__ */ React10.createElement(
|
1270
|
+
"div",
|
1271
|
+
{
|
1272
|
+
className: cn(
|
1273
|
+
"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",
|
1274
|
+
closed ? "hawa-opacity-0" : "hawa-opacity-100",
|
1275
|
+
props.banner && "hawa-rounded-none hawa-px-4 md:hawa-rounded-t md:hawa-px-64"
|
1276
|
+
)
|
1277
|
+
},
|
1278
|
+
/* @__PURE__ */ React10.createElement("div", { className: "hawa-absolute hawa-left-2 hawa-top-2 hawa-p-1.5 hawa-text-sm" }, props.title),
|
1279
|
+
/* @__PURE__ */ React10.createElement(
|
1280
|
+
"button",
|
1281
|
+
{
|
1282
|
+
type: "button",
|
1283
|
+
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",
|
1284
|
+
"data-dismiss-target": "#toast-default",
|
1285
|
+
"aria-label": "Close",
|
1286
|
+
onClick: () => slowClose()
|
1287
|
+
},
|
1288
|
+
/* @__PURE__ */ React10.createElement(
|
1289
|
+
"svg",
|
1290
|
+
{
|
1291
|
+
"aria-hidden": "true",
|
1292
|
+
className: "hawa-h-5 hawa-w-5",
|
1293
|
+
fill: "currentColor",
|
1294
|
+
viewBox: "0 0 20 20"
|
1295
|
+
},
|
1296
|
+
/* @__PURE__ */ React10.createElement(
|
1297
|
+
"path",
|
1298
|
+
{
|
1299
|
+
fillRule: "evenodd",
|
1300
|
+
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",
|
1301
|
+
clipRule: "evenodd"
|
1302
|
+
}
|
1303
|
+
)
|
1304
|
+
)
|
1305
|
+
),
|
1306
|
+
/* @__PURE__ */ React10.createElement("div", { className: "hawa-mt-8" }, props.question),
|
1307
|
+
/* @__PURE__ */ React10.createElement("div", { className: "hawa-flex hawa-w-full hawa-flex-row hawa-gap-1 hawa-rounded" }, props.options && props.options.map((op, i) => /* @__PURE__ */ React10.createElement(
|
1308
|
+
"span",
|
1309
|
+
{
|
1310
|
+
key: i,
|
1311
|
+
onClick: () => {
|
1312
|
+
if (props.onOptionClicked) {
|
1313
|
+
props.onOptionClicked(op);
|
1314
|
+
}
|
1315
|
+
setClickedOption(op);
|
1316
|
+
setAnswered(true);
|
1317
|
+
const timeoutDestroy = setTimeout(() => {
|
1318
|
+
setClosed(true);
|
1319
|
+
}, 4800);
|
1320
|
+
setTimeout(() => {
|
1321
|
+
var _a, _b;
|
1322
|
+
(_b = popUpRef.current) == null ? void 0 : _b.removeChild(
|
1323
|
+
(_a = popUpRef.current) == null ? void 0 : _a.children[0]
|
1324
|
+
);
|
1325
|
+
clearTimeout(timeoutDestroy);
|
1326
|
+
}, 5300);
|
1327
|
+
},
|
1328
|
+
className: cn(
|
1329
|
+
"hawa-w-full hawa-cursor-pointer hawa-rounded hawa-border hawa-p-4 hawa-text-center hawa-transition-all ",
|
1330
|
+
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"
|
1331
|
+
)
|
1332
|
+
},
|
1333
|
+
op
|
1334
|
+
))),
|
1335
|
+
props.texts && /* @__PURE__ */ React10.createElement("div", { className: " hawa-flex hawa-flex-row hawa-justify-between hawa-text-xs" }, /* @__PURE__ */ React10.createElement("span", null, props.texts.least), /* @__PURE__ */ React10.createElement("span", null, props.texts.most)),
|
1336
|
+
answered && /* @__PURE__ */ React10.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__ */ React10.createElement("span", { className: "hawa-font-bold hawa-text-white" }, "Thank you for your answer. This box will disappear in", " " + closingTimer, " seconds"), /* @__PURE__ */ React10.createElement("div", { className: "hawa-flex hawa-flex-row hawa-gap-2" }, /* @__PURE__ */ React10.createElement(Button, { variant: "secondary", onClick: () => slowClose() }, "Close")))
|
1337
|
+
)
|
1338
|
+
);
|
1339
|
+
};
|
1340
|
+
|
1341
|
+
// blocks/feedback/FeedbackEmoji.tsx
|
1342
|
+
import React11, { useState as useState7 } from "react";
|
1343
|
+
var FeedbackEmoji = (props) => {
|
1344
|
+
const [selectedEmoji, setSelectedEmoji] = useState7(null);
|
1345
|
+
const [loadingSubmit, setLoadingSubmit] = useState7(false);
|
1346
|
+
const [feedbackText, setFeedbackText] = useState7("");
|
1347
|
+
const [helperText, setHelperText] = useState7(false);
|
1348
|
+
let emojis = [
|
1349
|
+
{ icon: /* @__PURE__ */ React11.createElement(VeryGoodEmoji, null), value: "very-good" },
|
1350
|
+
{ icon: /* @__PURE__ */ React11.createElement(GoodEmoji, null), value: "good" },
|
1351
|
+
{ icon: /* @__PURE__ */ React11.createElement(BadEmoji, null), value: "bad" },
|
1352
|
+
{ icon: /* @__PURE__ */ React11.createElement(VeryBadEmoji, null), value: "very-bad" }
|
1353
|
+
];
|
1354
|
+
const onFeedbackSubmit = async () => {
|
1355
|
+
if (feedbackText) {
|
1356
|
+
setLoadingSubmit(true);
|
1357
|
+
try {
|
1358
|
+
await props.handleSubmit({
|
1359
|
+
choice: selectedEmoji,
|
1360
|
+
feedback: feedbackText
|
1361
|
+
});
|
1362
|
+
} catch (error) {
|
1363
|
+
console.error("Error during submission:", error);
|
1364
|
+
setLoadingSubmit(false);
|
1365
|
+
}
|
1366
|
+
await setLoadingSubmit(false);
|
1367
|
+
} else {
|
1368
|
+
setLoadingSubmit(false);
|
1369
|
+
setHelperText(true);
|
1370
|
+
}
|
1371
|
+
};
|
1372
|
+
return /* @__PURE__ */ React11.createElement(
|
1373
|
+
"div",
|
1374
|
+
{
|
1375
|
+
className: cn(
|
1376
|
+
"hawa-flex hawa-flex-col hawa-rounded hawa-border hawa-p-2 hawa-transition-all",
|
1377
|
+
selectedEmoji ? "hawa-h-[189px] hawa-min-w-fit" : "hawa-h-[44px] "
|
1378
|
+
)
|
1379
|
+
},
|
1380
|
+
/* @__PURE__ */ React11.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-justify-center hawa-gap-2 " }, /* @__PURE__ */ React11.createElement("div", { className: "hawa-flex hawa-flex-row hawa-justify-center hawa-gap-0.5 " }, emojis.map((emoji, i) => /* @__PURE__ */ React11.createElement(
|
1381
|
+
Button,
|
1382
|
+
{
|
1383
|
+
key: i,
|
1384
|
+
onClick: () => {
|
1385
|
+
if (selectedEmoji === emoji.value) {
|
1386
|
+
setSelectedEmoji("");
|
1387
|
+
} else {
|
1388
|
+
setSelectedEmoji(emoji.value);
|
1389
|
+
}
|
1390
|
+
},
|
1391
|
+
variant: "ghost",
|
1392
|
+
size: "smallIcon",
|
1393
|
+
className: cn(
|
1394
|
+
selectedEmoji === emoji.value ? "hawa-bg-primary/10 hover:hawa-bg-primary/10 " : "hawa-text-[#666666]"
|
1395
|
+
)
|
1396
|
+
},
|
1397
|
+
emoji.icon
|
1398
|
+
)))),
|
1399
|
+
/* @__PURE__ */ React11.createElement(
|
1400
|
+
"div",
|
1401
|
+
{
|
1402
|
+
className: cn(
|
1403
|
+
"hawa-flex hawa-flex-col hawa-overflow-clip hawa-transition-all hawa-duration-500 hawa-ease-in-out ",
|
1404
|
+
selectedEmoji ? "hawa-visible hawa-opacity-100" : "hawa-invisible hawa-opacity-0 "
|
1405
|
+
)
|
1406
|
+
},
|
1407
|
+
props.showSuccess ? /* @__PURE__ */ React11.createElement("div", { className: "hawa-flex hawa-h-full hawa-flex-col hawa-items-center hawa-justify-center hawa-gap-2 hawa-pt-4" }, /* @__PURE__ */ React11.createElement("div", { className: "hawa-rounded hawa-bg-primary hawa-p-2 hawa-text-primary-foreground" }, /* @__PURE__ */ React11.createElement(
|
1408
|
+
"svg",
|
1409
|
+
{
|
1410
|
+
stroke: "currentColor",
|
1411
|
+
fill: "currentColor",
|
1412
|
+
strokeWidth: "0",
|
1413
|
+
viewBox: "0 0 512 512",
|
1414
|
+
height: "0.5em",
|
1415
|
+
width: "0.5em"
|
1416
|
+
},
|
1417
|
+
/* @__PURE__ */ React11.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" })
|
1418
|
+
)), /* @__PURE__ */ React11.createElement("div", { className: "hawa-flex hawa-flex-col hawa-text-center hawa-text-sm" }, /* @__PURE__ */ React11.createElement("span", null, "Your feedback has been received!"), /* @__PURE__ */ React11.createElement("span", null, "Thank you for your help"))) : /* @__PURE__ */ React11.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-1 hawa-p-1" }, /* @__PURE__ */ React11.createElement(
|
1419
|
+
Popover,
|
1420
|
+
{
|
1421
|
+
className: "hawa-select-none hawa-p-1 hawa-text-xs ",
|
1422
|
+
open: helperText,
|
1423
|
+
trigger: /* @__PURE__ */ React11.createElement(
|
1424
|
+
Textarea,
|
1425
|
+
{
|
1426
|
+
classNames: {
|
1427
|
+
textarea: "hawa-mt-2 hawa-h-full hawa-resize-none"
|
1428
|
+
},
|
1429
|
+
placeholder: "Your feedback",
|
1430
|
+
onChange: (e) => {
|
1431
|
+
if (e.target.value) {
|
1432
|
+
setHelperText(false);
|
1433
|
+
}
|
1434
|
+
setFeedbackText(e.target.value);
|
1435
|
+
}
|
1436
|
+
}
|
1437
|
+
)
|
1438
|
+
},
|
1439
|
+
/* @__PURE__ */ React11.createElement("span", { className: "hawa-m-0" }, "Please enter your feedback")
|
1440
|
+
), /* @__PURE__ */ React11.createElement(
|
1441
|
+
Button,
|
1442
|
+
{
|
1443
|
+
isLoading: loadingSubmit,
|
1444
|
+
onClick: onFeedbackSubmit,
|
1445
|
+
className: "hawa-w-full",
|
1446
|
+
size: "sm"
|
1447
|
+
},
|
1448
|
+
"Submit"
|
1449
|
+
))
|
1450
|
+
)
|
1451
|
+
);
|
1452
|
+
};
|
1453
|
+
|
1454
|
+
// blocks/feedback/FeedbackForm.tsx
|
1455
|
+
import React12 from "react";
|
1456
|
+
import { useForm as useForm7, Controller as Controller7 } from "react-hook-form";
|
1457
|
+
import { zodResolver as zodResolver7 } from "@hookform/resolvers/zod";
|
1458
|
+
import * as z7 from "zod";
|
1459
|
+
var FeedbackForm = (props) => {
|
1460
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
1461
|
+
const formSchema = z7.object({
|
1462
|
+
requestType: z7.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 }),
|
1463
|
+
description: z7.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 })
|
1464
|
+
});
|
1465
|
+
const { handleSubmit, control, formState } = useForm7({
|
1466
|
+
resolver: zodResolver7(formSchema)
|
1467
|
+
});
|
1468
|
+
return /* @__PURE__ */ React12.createElement(
|
1469
|
+
Card,
|
1470
|
+
{
|
1471
|
+
className: cn(
|
1472
|
+
props.cardless ? "hawa-border-none hawa-bg-transparent hawa-shadow-none" : ""
|
1473
|
+
),
|
1474
|
+
style: props.cardless ? { boxShadow: "none" } : void 0
|
1475
|
+
},
|
1476
|
+
/* @__PURE__ */ React12.createElement(CardContent, { headless: true }, /* @__PURE__ */ React12.createElement(
|
1477
|
+
"form",
|
1478
|
+
{
|
1479
|
+
noValidate: true,
|
1480
|
+
onSubmit: handleSubmit((e) => {
|
1481
|
+
if (props.onSubmit) {
|
1482
|
+
return props.onSubmit(e);
|
1483
|
+
} else {
|
1484
|
+
console.log("Form is submitted but onSubmit prop is missing");
|
1485
|
+
}
|
1486
|
+
}),
|
1487
|
+
className: "hawa-flex hawa-flex-col hawa-gap-4"
|
1488
|
+
},
|
1489
|
+
/* @__PURE__ */ React12.createElement(Label, null, (_j = (_i = props.texts) == null ? void 0 : _i.requestType) == null ? void 0 : _j.label),
|
1490
|
+
/* @__PURE__ */ React12.createElement(
|
1491
|
+
Controller7,
|
1492
|
+
{
|
1493
|
+
name: "requestType",
|
1494
|
+
control,
|
1495
|
+
render: ({ field }) => {
|
1496
|
+
var _a2, _b2, _c2, _d2, _e2, _f2;
|
1497
|
+
return /* @__PURE__ */ React12.createElement(
|
1498
|
+
Select,
|
1499
|
+
{
|
1500
|
+
...field,
|
1501
|
+
...props.selectProps,
|
1502
|
+
onChange: (option) => field.onChange(option.value),
|
1503
|
+
options: props.requestTypes,
|
1504
|
+
helperText: (_b2 = (_a2 = formState.errors.requestType) == null ? void 0 : _a2.message) == null ? void 0 : _b2.toString(),
|
1505
|
+
placeholder: (_d2 = (_c2 = props.texts) == null ? void 0 : _c2.requestType) == null ? void 0 : _d2.placeholder,
|
1506
|
+
texts: {
|
1507
|
+
noOptions: (_f2 = (_e2 = props.texts) == null ? void 0 : _e2.requestType) == null ? void 0 : _f2.noOptions
|
1508
|
+
}
|
1509
|
+
}
|
1510
|
+
);
|
1511
|
+
}
|
1512
|
+
}
|
1513
|
+
),
|
1514
|
+
/* @__PURE__ */ React12.createElement(Label, null, (_l = (_k = props.texts) == null ? void 0 : _k.description) == null ? void 0 : _l.label),
|
1515
|
+
/* @__PURE__ */ React12.createElement(
|
1516
|
+
Controller7,
|
1517
|
+
{
|
1518
|
+
name: "description",
|
1519
|
+
control,
|
1520
|
+
render: ({ field }) => {
|
1521
|
+
var _a2, _b2, _c2, _d2;
|
1522
|
+
return /* @__PURE__ */ React12.createElement(
|
1523
|
+
Textarea,
|
1524
|
+
{
|
1525
|
+
...field,
|
1526
|
+
helperText: formState.errors.description && ((_b2 = (_a2 = formState.errors.description) == null ? void 0 : _a2.message) == null ? void 0 : _b2.toString()),
|
1527
|
+
placeholder: (_d2 = (_c2 = props.texts) == null ? void 0 : _c2.description) == null ? void 0 : _d2.placeholder
|
1528
|
+
}
|
1529
|
+
);
|
1530
|
+
}
|
1531
|
+
}
|
1532
|
+
),
|
1533
|
+
/* @__PURE__ */ React12.createElement(Button, { type: "submit" }, (_m = props.texts) == null ? void 0 : _m.submit)
|
1534
|
+
))
|
1535
|
+
);
|
1536
|
+
};
|
1537
|
+
|
1538
|
+
// blocks/misc/LegalTexts.tsx
|
1539
|
+
import React13 from "react";
|
1540
|
+
var LegalTexts = ({ tabs, ...props }) => {
|
1541
|
+
return /* @__PURE__ */ React13.createElement(
|
1542
|
+
Tabs,
|
1543
|
+
{
|
1544
|
+
value: props.activeTab,
|
1545
|
+
onValueChange: props.handleTabChange,
|
1546
|
+
defaultValue: props.defaultTab || tabs[0].value,
|
1547
|
+
dir: props.direction
|
1548
|
+
},
|
1549
|
+
/* @__PURE__ */ React13.createElement(TabsList, { className: "hawa-w-full" }, tabs.map((tab, index) => /* @__PURE__ */ React13.createElement(TabsTrigger, { key: index, value: tab.value }, tab.title))),
|
1550
|
+
tabs.map((tab, index) => /* @__PURE__ */ React13.createElement(TabsContent, { key: index, value: tab.value }, /* @__PURE__ */ React13.createElement(
|
1551
|
+
ScrollArea,
|
1552
|
+
{
|
1553
|
+
className: cn(
|
1554
|
+
"hawa-rounded hawa-border hawa-bg-muted hawa-p-4",
|
1555
|
+
props.scrollAreaClassName
|
1556
|
+
)
|
1557
|
+
},
|
1558
|
+
tab.content
|
1559
|
+
)))
|
1560
|
+
);
|
1561
|
+
};
|
1562
|
+
|
1563
|
+
// blocks/misc/EmptyState.tsx
|
1564
|
+
import React14 from "react";
|
1565
|
+
var EmptyState = ({ texts, onActionClick }) => {
|
1566
|
+
return /* @__PURE__ */ React14.createElement(Card, null, /* @__PURE__ */ React14.createElement(CardContent, { headless: true }, /* @__PURE__ */ React14.createElement("div", { className: "hawa-flex hawa-flex-col hawa-items-center hawa-justify-center hawa-text-center " }, /* @__PURE__ */ React14.createElement("div", { className: "hawa-flex hawa-h-10 hawa-w-10 hawa-flex-col hawa-items-center hawa-justify-center hawa-rounded-3xl hawa-bg-primary hawa-text-6xl hawa-font-bold hawa-text-primary-foreground" }, /* @__PURE__ */ React14.createElement(
|
1567
|
+
"svg",
|
1568
|
+
{
|
1569
|
+
stroke: "currentColor",
|
1570
|
+
fill: "currentColor",
|
1571
|
+
strokeWidth: "0",
|
1572
|
+
viewBox: "0 0 512 512",
|
1573
|
+
height: "0.35em",
|
1574
|
+
width: "0.35em"
|
1575
|
+
},
|
1576
|
+
/* @__PURE__ */ React14.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" })
|
1577
|
+
)), /* @__PURE__ */ React14.createElement("div", { className: "hawa-m-2 hawa-text-xl hawa-font-bold" }, (texts == null ? void 0 : texts.youreCaughtUp) || "You're all caught up"))), /* @__PURE__ */ React14.createElement(CardFooter, null, /* @__PURE__ */ React14.createElement(Button, { className: "hawa-w-full", onClick: () => onActionClick() }, (texts == null ? void 0 : texts.actionText) || "Go Home")));
|
1578
|
+
};
|
1579
|
+
|
1580
|
+
// blocks/misc/Testimonial.tsx
|
1581
|
+
import React15 from "react";
|
1582
|
+
var Testimonial = () => {
|
1583
|
+
return /* @__PURE__ */ React15.createElement(Card, null, /* @__PURE__ */ React15.createElement(CardContent, { headless: true }, /* @__PURE__ */ React15.createElement("div", null, /* @__PURE__ */ React15.createElement("p", { className: "mb-4 max-w-sm" }, "The team at Sikka Software is simply amazing. The tech is easy to follow, easy to work with, and infinitely flexible. The solution opportunities created by Tines are endless.")), /* @__PURE__ */ React15.createElement("div", { className: "flex flex-row gap-4" }, /* @__PURE__ */ React15.createElement("svg", { width: "48", height: "48", viewBox: "0 0 48 48", fill: "none" }, /* @__PURE__ */ React15.createElement("rect", { width: "48", height: "48", rx: "24", fill: "#45BE8B" }), /* @__PURE__ */ React15.createElement(
|
1584
|
+
"path",
|
1585
|
+
{
|
1586
|
+
d: "M14.1412 22.4427L17.5803 16.5199C17.7671 16.1981 18.1112 16 18.4834 16H20.8581C21.653 16 22.1565 16.8528 21.7725 17.5488L19.3042 22.0225C19.2202 22.1747 19.1762 22.3458 19.1762 22.5196C19.1762 23.0879 19.6369 23.5486 20.2052 23.5486H21.5827C22.1594 23.5486 22.627 24.0162 22.627 24.5929V31.347C22.627 31.9237 22.1594 32.3913 21.5827 32.3913H15.0443C14.4676 32.3913 14 31.9237 14 31.347V22.9671C14 22.7829 14.0487 22.602 14.1412 22.4427Z",
|
1587
|
+
fill: "#FFFFFF"
|
1588
|
+
}
|
1589
|
+
), /* @__PURE__ */ React15.createElement(
|
1590
|
+
"path",
|
1591
|
+
{
|
1592
|
+
d: "M25.356 22.4427L28.7951 16.5199C28.982 16.1981 29.326 16 29.6982 16H32.0729C32.8679 16 33.3713 16.8528 32.9873 17.5488L30.5191 22.0225C30.4351 22.1747 30.391 22.3458 30.391 22.5196C30.391 23.0879 30.8518 23.5486 31.4201 23.5486H32.7975C33.3743 23.5486 33.8418 24.0162 33.8418 24.5929V31.347C33.8418 31.9237 33.3743 32.3913 32.7975 32.3913H26.2592C25.6824 32.3913 25.2148 31.9237 25.2148 31.347V22.9671C25.2148 22.7829 25.2636 22.602 25.356 22.4427Z",
|
1593
|
+
fill: "#FFFFFF"
|
1594
|
+
}
|
1595
|
+
)), /* @__PURE__ */ React15.createElement("span", { className: "border border-l " }), " ", /* @__PURE__ */ React15.createElement("div", null, /* @__PURE__ */ React15.createElement("strong", null, "Brent Lassi"), /* @__PURE__ */ React15.createElement("div", null, " Chief Information Security Officer")))));
|
1596
|
+
};
|
1597
|
+
|
1598
|
+
// blocks/misc/LeadGenerator.tsx
|
1599
|
+
import React16 from "react";
|
1600
|
+
import { useForm as useForm8, Controller as Controller8 } from "react-hook-form";
|
1601
|
+
var LeadGenerator = ({ texts, submitHandler }) => {
|
1602
|
+
var _a;
|
1603
|
+
const { handleSubmit, control, formState } = useForm8();
|
1604
|
+
const onSubmit = (data) => {
|
1605
|
+
if (submitHandler) {
|
1606
|
+
submitHandler(data.email);
|
1607
|
+
} else {
|
1608
|
+
console.log("handleNewsletterSub props was not provided");
|
1609
|
+
}
|
1610
|
+
};
|
1611
|
+
return /* @__PURE__ */ React16.createElement(Card, null, /* @__PURE__ */ React16.createElement(CardHeader, null, /* @__PURE__ */ React16.createElement(CardTitle, null, texts == null ? void 0 : texts.title), /* @__PURE__ */ React16.createElement(CardDescription, null, texts == null ? void 0 : texts.subtitle)), /* @__PURE__ */ React16.createElement(CardContent, null, /* @__PURE__ */ React16.createElement(
|
1612
|
+
"form",
|
1613
|
+
{
|
1614
|
+
noValidate: true,
|
1615
|
+
className: "hawa-flex hawa-flex-row hawa-gap-2",
|
1616
|
+
onSubmit: handleSubmit(onSubmit)
|
1617
|
+
},
|
1618
|
+
/* @__PURE__ */ React16.createElement(
|
1619
|
+
Controller8,
|
1620
|
+
{
|
1621
|
+
name: "email",
|
1622
|
+
control,
|
1623
|
+
rules: {
|
1624
|
+
required: true,
|
1625
|
+
pattern: {
|
1626
|
+
value: /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i,
|
1627
|
+
message: (texts == null ? void 0 : texts.invalidEmail) || "Invalid email address"
|
1628
|
+
}
|
1629
|
+
},
|
1630
|
+
defaultValue: "",
|
1631
|
+
render: ({ field }) => /* @__PURE__ */ React16.createElement(Input, { ...field, type: "email", placeholder: "example@sikka.io" })
|
1632
|
+
}
|
1633
|
+
),
|
1634
|
+
/* @__PURE__ */ React16.createElement(Button, { type: "submit", disabled: !formState.isValid }, (_a = texts == null ? void 0 : texts.submit) != null ? _a : "Submit")
|
1635
|
+
)));
|
1636
|
+
};
|
1637
|
+
|
1638
|
+
// blocks/misc/Announcement.tsx
|
1639
|
+
import React17 from "react";
|
1640
|
+
var Announcement = ({
|
1641
|
+
onActionClick,
|
1642
|
+
...props
|
1643
|
+
}) => {
|
1644
|
+
return /* @__PURE__ */ React17.createElement(Card, null, /* @__PURE__ */ React17.createElement(
|
1645
|
+
CardContent,
|
1646
|
+
{
|
1647
|
+
headless: true,
|
1648
|
+
className: "hawa-flex hawa-flex-row hawa-items-center hawa-justify-between"
|
1649
|
+
},
|
1650
|
+
/* @__PURE__ */ React17.createElement("div", { className: "hawa-flex hawa-flex-col hawa-items-start hawa-justify-center " }, /* @__PURE__ */ React17.createElement("span", { className: "hawa-text-lg hawa-font-bold" }, props.title), /* @__PURE__ */ React17.createElement("span", { className: "hawa-text-sm" }, props.subtitle)),
|
1651
|
+
/* @__PURE__ */ React17.createElement(
|
1652
|
+
Button,
|
1653
|
+
{
|
1654
|
+
onClick: () => onActionClick(),
|
1655
|
+
className: "hawa-whitespace-nowrap"
|
1656
|
+
},
|
1657
|
+
props.actionText
|
1658
|
+
)
|
1659
|
+
));
|
1660
|
+
};
|
1661
|
+
|
1662
|
+
// blocks/misc/NotFound.tsx
|
1663
|
+
import React18 from "react";
|
1664
|
+
var NotFound = ({ texts }) => {
|
1665
|
+
return /* @__PURE__ */ React18.createElement(Card, null, /* @__PURE__ */ React18.createElement(CardContent, { headless: true }, /* @__PURE__ */ React18.createElement("div", { className: "hawa-flex hawa-flex-col hawa-items-center dark:hawa-text-white" }, /* @__PURE__ */ React18.createElement("div", { className: "hawa-text-center hawa-text-6xl hawa-font-bold " }, "404"), /* @__PURE__ */ React18.createElement("div", { className: "hawa-m-2 hawa-text-center hawa-text-xl hawa-font-bold " }, (texts == null ? void 0 : texts.pageNotFound) || "Page Not Found"), /* @__PURE__ */ React18.createElement("div", { className: "hawa-mb-4 hawa-text-center" }, (texts == null ? void 0 : texts.ifLost) || /* @__PURE__ */ React18.createElement(React18.Fragment, null, "If you're lost please contact us ", /* @__PURE__ */ React18.createElement("span", { className: "clickable-link" }, "help@sikka.io"))), /* @__PURE__ */ React18.createElement(Button, { className: "hawa-w-full" }, (texts == null ? void 0 : texts.home) || "Home"))));
|
1666
|
+
};
|
1667
|
+
|
1668
|
+
// blocks/misc/NoPermission.tsx
|
1669
|
+
import React19 from "react";
|
1670
|
+
var NoPermission = ({ texts }) => {
|
1671
|
+
return /* @__PURE__ */ React19.createElement(Card, null, /* @__PURE__ */ React19.createElement(CardContent, { headless: true }, /* @__PURE__ */ React19.createElement("div", { className: "hawa-flex hawa-flex-col hawa-items-center hawa-justify-center hawa-text-center" }, /* @__PURE__ */ React19.createElement("div", { className: "hawa-flex hawa-h-10 hawa-w-10 hawa-flex-col hawa-items-center hawa-justify-center hawa-rounded-3xl hawa-bg-primary hawa-text-6xl hawa-font-bold hawa-text-primary-foreground" }, /* @__PURE__ */ React19.createElement(
|
1672
|
+
"svg",
|
1673
|
+
{
|
1674
|
+
stroke: "currentColor",
|
1675
|
+
fill: "currentColor",
|
1676
|
+
strokeWidth: "0",
|
1677
|
+
viewBox: "0 0 448 512",
|
1678
|
+
height: "0.35em",
|
1679
|
+
width: "0.35em"
|
1680
|
+
},
|
1681
|
+
/* @__PURE__ */ React19.createElement("path", { d: "M400 224h-24v-72C376 68.2 307.8 0 224 0S72 68.2 72 152v72H48c-26.5 0-48 21.5-48 48v192c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V272c0-26.5-21.5-48-48-48zm-104 0H152v-72c0-39.7 32.3-72 72-72s72 32.3 72 72v72z" })
|
1682
|
+
)), /* @__PURE__ */ React19.createElement("div", { className: "hawa-m-2 hawa-text-xl hawa-font-bold" }, (texts == null ? void 0 : texts.title) || "You don't have permission"), /* @__PURE__ */ React19.createElement("div", null, (texts == null ? void 0 : texts.subtitle) || "If you think this is a problem please contact your administrator or our customer support"))));
|
1683
|
+
};
|
1684
|
+
|
1685
|
+
// blocks/misc/ContactForm.tsx
|
1686
|
+
import React20 from "react";
|
1687
|
+
import { useForm as useForm9, Controller as Controller9 } from "react-hook-form";
|
1688
|
+
import { zodResolver as zodResolver8 } from "@hookform/resolvers/zod";
|
1689
|
+
import * as z8 from "zod";
|
1690
|
+
var ContactForm = ({
|
1691
|
+
cardless,
|
1692
|
+
size = "default",
|
1693
|
+
texts,
|
1694
|
+
formId,
|
1695
|
+
formAutoComplete,
|
1696
|
+
onSubmit
|
1697
|
+
}) => {
|
1698
|
+
var _a, _b, _c;
|
1699
|
+
const contactFormSchema = z8.object({
|
1700
|
+
name: z8.string({ required_error: texts == null ? void 0 : texts.name.required }).min(1, texts == null ? void 0 : texts.name.required).default(""),
|
1701
|
+
email: z8.string({ required_error: (_a = texts == null ? void 0 : texts.email) == null ? void 0 : _a.required }).min(1, { message: (_b = texts == null ? void 0 : texts.email) == null ? void 0 : _b.required }).email({ message: (_c = texts == null ? void 0 : texts.email) == null ? void 0 : _c.invalid }).default(""),
|
1702
|
+
message: z8.string({ required_error: texts == null ? void 0 : texts.message.required }).min(10, texts == null ? void 0 : texts.message.invalid).default("")
|
1703
|
+
});
|
1704
|
+
const {
|
1705
|
+
control,
|
1706
|
+
handleSubmit,
|
1707
|
+
formState: { errors },
|
1708
|
+
reset
|
1709
|
+
} = useForm9({
|
1710
|
+
resolver: zodResolver8(contactFormSchema),
|
1711
|
+
defaultValues: {
|
1712
|
+
name: "",
|
1713
|
+
email: "",
|
1714
|
+
message: ""
|
1715
|
+
}
|
1716
|
+
});
|
1717
|
+
const handleFormSubmit = (data) => {
|
1718
|
+
if (onSubmit) {
|
1719
|
+
onSubmit(data);
|
1720
|
+
reset();
|
1721
|
+
} else {
|
1722
|
+
console.log("Form is submitted but onSubmit prop is missing");
|
1723
|
+
}
|
1724
|
+
};
|
1725
|
+
let sizeStyle = {
|
1726
|
+
sm: "hawa-max-w-sm",
|
1727
|
+
default: "hawa-w-full"
|
1728
|
+
};
|
1729
|
+
return /* @__PURE__ */ React20.createElement(
|
1730
|
+
Card,
|
1731
|
+
{
|
1732
|
+
className: cn(
|
1733
|
+
// sizeStyle[size],
|
1734
|
+
"hawa-w-full",
|
1735
|
+
cardless && "hawa-border-none hawa-bg-transparent hawa-shadow-none hawa-drop-shadow-none"
|
1736
|
+
),
|
1737
|
+
style: cardless ? { boxShadow: "none" } : void 0
|
1738
|
+
},
|
1739
|
+
/* @__PURE__ */ React20.createElement(CardContent, { headless: true }, /* @__PURE__ */ React20.createElement(
|
1740
|
+
"form",
|
1741
|
+
{
|
1742
|
+
noValidate: true,
|
1743
|
+
onSubmit: handleSubmit(handleFormSubmit),
|
1744
|
+
className: "hawa-space-y-2",
|
1745
|
+
id: formId,
|
1746
|
+
autoComplete: formAutoComplete
|
1747
|
+
},
|
1748
|
+
/* @__PURE__ */ React20.createElement(
|
1749
|
+
"div",
|
1750
|
+
{
|
1751
|
+
className: cn(
|
1752
|
+
"hawa-flex hawa-items-start hawa-justify-start hawa-gap-2",
|
1753
|
+
{
|
1754
|
+
"hawa-flex-row": size === "default",
|
1755
|
+
"hawa-flex-col": size === "sm"
|
1756
|
+
}
|
1757
|
+
)
|
1758
|
+
},
|
1759
|
+
/* @__PURE__ */ React20.createElement(
|
1760
|
+
Controller9,
|
1761
|
+
{
|
1762
|
+
control,
|
1763
|
+
name: "name",
|
1764
|
+
render: ({ field }) => {
|
1765
|
+
var _a2;
|
1766
|
+
return /* @__PURE__ */ React20.createElement(
|
1767
|
+
Input,
|
1768
|
+
{
|
1769
|
+
label: texts == null ? void 0 : texts.name.label,
|
1770
|
+
id: texts == null ? void 0 : texts.name.label,
|
1771
|
+
...field,
|
1772
|
+
placeholder: texts == null ? void 0 : texts.name.placeholder,
|
1773
|
+
helperText: (_a2 = errors.name) == null ? void 0 : _a2.message
|
1774
|
+
}
|
1775
|
+
);
|
1776
|
+
}
|
1777
|
+
}
|
1778
|
+
),
|
1779
|
+
/* @__PURE__ */ React20.createElement(
|
1780
|
+
Controller9,
|
1781
|
+
{
|
1782
|
+
control,
|
1783
|
+
name: "email",
|
1784
|
+
render: ({ field }) => {
|
1785
|
+
var _a2;
|
1786
|
+
return /* @__PURE__ */ React20.createElement(
|
1787
|
+
Input,
|
1788
|
+
{
|
1789
|
+
label: texts == null ? void 0 : texts.email.label,
|
1790
|
+
id: texts == null ? void 0 : texts.email.label,
|
1791
|
+
...field,
|
1792
|
+
placeholder: texts == null ? void 0 : texts.email.placeholder,
|
1793
|
+
helperText: (_a2 = errors.email) == null ? void 0 : _a2.message
|
1794
|
+
}
|
1795
|
+
);
|
1796
|
+
}
|
1797
|
+
}
|
1798
|
+
)
|
1799
|
+
),
|
1800
|
+
/* @__PURE__ */ React20.createElement(
|
1801
|
+
Controller9,
|
1802
|
+
{
|
1803
|
+
control,
|
1804
|
+
name: "message",
|
1805
|
+
render: ({ field }) => {
|
1806
|
+
var _a2;
|
1807
|
+
return /* @__PURE__ */ React20.createElement(
|
1808
|
+
Textarea,
|
1809
|
+
{
|
1810
|
+
label: texts == null ? void 0 : texts.message.label,
|
1811
|
+
id: texts == null ? void 0 : texts.message.label,
|
1812
|
+
textareaProps: {
|
1813
|
+
placeholder: texts == null ? void 0 : texts.message.placeholder,
|
1814
|
+
...field
|
1815
|
+
},
|
1816
|
+
helperText: (_a2 = errors.message) == null ? void 0 : _a2.message
|
1817
|
+
}
|
1818
|
+
);
|
1819
|
+
}
|
1820
|
+
}
|
1821
|
+
),
|
1822
|
+
/* @__PURE__ */ React20.createElement(Button, { type: "submit", className: "hawa-w-full" }, (texts == null ? void 0 : texts.submit) || "Submit")
|
1823
|
+
))
|
1824
|
+
);
|
1825
|
+
};
|
1826
|
+
|
1827
|
+
// blocks/pricing/PricingPlans.tsx
|
1828
|
+
import React26 from "react";
|
1829
|
+
|
1830
|
+
// blocks/cards/ActionCard.tsx
|
1831
|
+
import React21, { useState as useState8 } from "react";
|
1832
|
+
var ActionCard = (props) => {
|
1833
|
+
const [hovered, setHovered] = useState8(false);
|
1834
|
+
return /* @__PURE__ */ React21.createElement("div", { className: "hawa-flex hawa-h-full hawa-w-full hawa-flex-col hawa-gap-1" }, /* @__PURE__ */ React21.createElement(
|
1835
|
+
"div",
|
1836
|
+
{
|
1837
|
+
className: "hawa-group hawa-relative hawa-h-full hawa-w-full hawa-rounded hawa-border hawa-bg-background hawa-bg-cover hawa-bg-center hawa-transition-all hawa-duration-500 hover:hawa-drop-shadow-2xl",
|
1838
|
+
style: {
|
1839
|
+
backgroundImage: `url(${props.blank ? "" : props.cardImage})`
|
1840
|
+
},
|
1841
|
+
onMouseEnter: () => setHovered(true),
|
1842
|
+
onMouseLeave: () => setHovered(false)
|
1843
|
+
},
|
1844
|
+
props.blank ? /* @__PURE__ */ React21.createElement("div", { className: "hawa-flex hawa-h-full hawa-flex-col hawa-items-center hawa-justify-center " }, /* @__PURE__ */ React21.createElement(
|
1845
|
+
"svg",
|
1846
|
+
{
|
1847
|
+
className: "hawa-h-10 hawa-w-10 hawa-text-foreground",
|
1848
|
+
stroke: "currentColor",
|
1849
|
+
fill: "currentColor",
|
1850
|
+
strokeWidth: "0",
|
1851
|
+
viewBox: "0 0 24 24",
|
1852
|
+
height: "1em",
|
1853
|
+
width: "1em",
|
1854
|
+
xmlns: "http://www.w3.org/2000/svg"
|
1855
|
+
},
|
1856
|
+
/* @__PURE__ */ React21.createElement("path", { d: "M19 11h-6V5h-2v6H5v2h6v6h2v-6h6z" })
|
1857
|
+
)) : /* @__PURE__ */ React21.createElement("div", { className: "hawa-absolute hawa-inset-0 hawa-rounded hawa-bg-black hawa-opacity-50" }),
|
1858
|
+
/* @__PURE__ */ React21.createElement("div", { className: "hawa-absolute hawa-bottom-2 hawa-right-2 hawa-z-10 hawa-opacity-0 hawa-transition-all hawa-duration-200 group-hover:hawa-opacity-100" }, props.inCardActions),
|
1859
|
+
!props.blank && /* @__PURE__ */ React21.createElement("div", { className: "hawa-relative hawa-p-4" }, /* @__PURE__ */ React21.createElement("h1", { className: "hawa-text-white" }, props.title), /* @__PURE__ */ React21.createElement("p", { className: "hawa-text-white" }, props.subtitle))
|
1860
|
+
), /* @__PURE__ */ React21.createElement(
|
1861
|
+
"div",
|
1862
|
+
{
|
1863
|
+
className: `hawa-flex hawa-flex-row hawa-justify-between hawa-text-sm hawa-transition-all hawa-duration-200 ${hovered ? "hawa-opacity-100" : "hawa-opacity-0"}`
|
1864
|
+
},
|
1865
|
+
props.bottomElement
|
1866
|
+
));
|
1867
|
+
};
|
1868
|
+
|
1869
|
+
// blocks/cards/AdCard.tsx
|
1870
|
+
import React22, { useState as useState9, useEffect as useEffect3, useRef as useRef3 } from "react";
|
1871
|
+
var AdCard = ({
|
1872
|
+
orientation = "vertical",
|
1873
|
+
...props
|
1874
|
+
}) => {
|
1875
|
+
const adRef = useRef3(null);
|
1876
|
+
const [closed, setClosed] = useState9(false);
|
1877
|
+
let duration = 0;
|
1878
|
+
useEffect3(() => {
|
1879
|
+
if (duration) {
|
1880
|
+
const timeoutHide = setTimeout(() => {
|
1881
|
+
setClosed(true);
|
1882
|
+
}, duration);
|
1883
|
+
const timeoutDestroy = setTimeout(() => {
|
1884
|
+
setClosed(true);
|
1885
|
+
if (adRef.current) {
|
1886
|
+
adRef.current.removeChild(adRef.current.children[0]);
|
1887
|
+
}
|
1888
|
+
}, duration + 1e3);
|
1889
|
+
return () => {
|
1890
|
+
clearTimeout(timeoutHide);
|
1891
|
+
clearTimeout(timeoutDestroy);
|
1892
|
+
};
|
1893
|
+
}
|
1894
|
+
}, [duration]);
|
1895
|
+
let cardStyles = {
|
1896
|
+
horizontal: "hawa-flex hawa-flex-row hawa-max-w-xl hawa-rounded hawa-border hawa-bg-card hawa-p-2 hawa-gap-2 hawa-items-center hawa-relative ",
|
1897
|
+
vertical: "hawa-flex hawa-flex-col hawa-max-w-[200px] hawa-justify-start hawa-rounded hawa-border hawa-bg-card hawa-gap-2 hawa-p-2 hawa-relative"
|
1898
|
+
};
|
1899
|
+
let imageStyles = {
|
1900
|
+
horizontal: "hawa-w-auto hawa-h-full hawa-bg-blue-500 hawa-rounded-inner",
|
1901
|
+
vertical: "hawa-bg-blue-500 hawa-rounded-inner hawa-w-auto "
|
1902
|
+
};
|
1903
|
+
return /* @__PURE__ */ React22.createElement("div", { ref: adRef }, /* @__PURE__ */ React22.createElement(
|
1904
|
+
"div",
|
1905
|
+
{
|
1906
|
+
className: cn(cardStyles[orientation], props.className),
|
1907
|
+
onClick: props.handleClick
|
1908
|
+
},
|
1909
|
+
/* @__PURE__ */ React22.createElement("div", { className: "hawa-flex hawa-aspect-square hawa-w-full hawa-max-w-fit hawa-items-start " }, /* @__PURE__ */ React22.createElement(
|
1910
|
+
"img",
|
1911
|
+
{
|
1912
|
+
src: props.imageURL ? props.imageURL : "https://via.placeholder.com/50",
|
1913
|
+
className: imageStyles[orientation]
|
1914
|
+
}
|
1915
|
+
)),
|
1916
|
+
/* @__PURE__ */ React22.createElement("div", { className: "hawa-w-full hawa-text-xs" }, /* @__PURE__ */ React22.createElement("div", { className: "hawa-font-bold" }, props.title), /* @__PURE__ */ React22.createElement("div", { className: "hawa-text-[12px]" }, props.description)),
|
1917
|
+
props.canHide && /* @__PURE__ */ React22.createElement(
|
1918
|
+
"span",
|
1919
|
+
{
|
1920
|
+
onClick: (e) => {
|
1921
|
+
e.stopPropagation();
|
1922
|
+
if (props.canHide) {
|
1923
|
+
setClosed(true);
|
1924
|
+
setTimeout(() => {
|
1925
|
+
if (adRef.current) {
|
1926
|
+
adRef.current.removeChild(adRef.current.children[0]);
|
1927
|
+
}
|
1928
|
+
}, 200);
|
1929
|
+
} else {
|
1930
|
+
if (props.handleCantHide) {
|
1931
|
+
props.handleCantHide();
|
1932
|
+
}
|
1933
|
+
}
|
1934
|
+
},
|
1935
|
+
className: "hawa-absolute hawa-right-0 hawa-top-0 hawa-h-fit hawa-cursor-pointer hawa-select-none hawa-rounded-bl-lg hawa-rounded-tr-lg hawa-bg-primary/50 hawa-px-2.5 hawa-py-0.5 hawa-text-[10px] hawa-font-semibold hawa-text-primary-foreground"
|
1936
|
+
},
|
1937
|
+
"Hide"
|
1938
|
+
)
|
1939
|
+
));
|
1940
|
+
};
|
1941
|
+
|
1942
|
+
// blocks/cards/PricingCard.tsx
|
1943
|
+
import React23 from "react";
|
1944
|
+
var PricingCard = ({
|
1945
|
+
size = "medium",
|
1946
|
+
direction = "ltr",
|
1947
|
+
endButton = true,
|
1948
|
+
recommended,
|
1949
|
+
currentPlan = false,
|
1950
|
+
...props
|
1951
|
+
}) => {
|
1952
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
1953
|
+
let cardSizes = {
|
1954
|
+
small: "hawa-w-full hawa-max-w-sm hawa-rounded hawa-border dark:hawa-border-gray-700 hawa-bg-background ",
|
1955
|
+
medium: "hawa-w-full hawa-rounded hawa-min-w-fit hawa-border dark:hawa-border-gray-700 hawa-bg-background ",
|
1956
|
+
large: "hawa-w-full hawa-max-w-lg hawa-rounded hawa-border dark:hawa-border-gray-700 hawa-bg-background "
|
1957
|
+
};
|
1958
|
+
return /* @__PURE__ */ React23.createElement(
|
1959
|
+
Card,
|
1960
|
+
{
|
1961
|
+
dir: direction,
|
1962
|
+
className: cn(
|
1963
|
+
currentPlan ? "hawa-border-2 hawa-border-primary dark:hawa-border-primary/70 " : "hawa-border",
|
1964
|
+
cardSizes[size],
|
1965
|
+
"hawa-relative hawa-flex hawa-flex-col hawa-justify-between hawa-gap-4 hawa-p-4",
|
1966
|
+
recommended ? "hawa-rounded hawa-rounded-t-none" : "hawa-rounded"
|
1967
|
+
)
|
1968
|
+
},
|
1969
|
+
recommended && /* @__PURE__ */ React23.createElement(
|
1970
|
+
"div",
|
1971
|
+
{
|
1972
|
+
className: "hawa-absolute -hawa-left-[1px] hawa-top-0 -hawa-translate-y-full hawa-rounded-t hawa-border hawa-bg-primary hawa-p-2 hawa-text-center hawa-text-primary-foreground",
|
1973
|
+
style: { width: "calc(100% + 2px)" }
|
1974
|
+
},
|
1975
|
+
((_a = props.texts) == null ? void 0 : _a.recommended) || "RECOMMENDED"
|
1976
|
+
),
|
1977
|
+
/* @__PURE__ */ React23.createElement("div", { className: "hawa-flex hawa-h-full hawa-flex-col hawa-gap-4" }, /* @__PURE__ */ React23.createElement("div", { className: "hawa-text-md hawa-relative hawa-flex hawa-flex-col hawa-justify-between hawa-font-bold hawa-text-primary/70" }, /* @__PURE__ */ React23.createElement("span", null, (_b = props.texts) == null ? void 0 : _b.title), /* @__PURE__ */ React23.createElement("h5", { className: "hawa-text-sm hawa-font-normal hawa-text-primary/70" }, (_c = props.texts) == null ? void 0 : _c.subtitle), props.discount && /* @__PURE__ */ React23.createElement("span", { className: "hawa-absolute hawa-end-0" }, /* @__PURE__ */ React23.createElement(Chip, { label: props.discount, size: "large", color: "hyper" }))), /* @__PURE__ */ React23.createElement("div", { className: " hawa-flex hawa-items-baseline hawa-text-primary" }, props.isLoading ? /* @__PURE__ */ React23.createElement(Skeleton, { className: "hawa-h-[48px] hawa-w-full hawa-max-w-[200px] hawa-p-0 " }) : /* @__PURE__ */ React23.createElement(React23.Fragment, null, props.noPrice ? /* @__PURE__ */ React23.createElement("div", { className: "hawa-text-5xl hawa-font-extrabold hawa-tracking-tight" }, ((_d = props.texts) == null ? void 0 : _d.priceless) || "Contact Us") : /* @__PURE__ */ React23.createElement(React23.Fragment, null, /* @__PURE__ */ React23.createElement(React23.Fragment, null, /* @__PURE__ */ React23.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-end hawa-gap-2" }, props.oldPrice && props.oldPrice > 0 && /* @__PURE__ */ React23.createElement("span", { className: "hawa-line-through hawa-opacity-70" }, props.oldPrice + " " + ((_e = props.texts) == null ? void 0 : _e.currencyText)), /* @__PURE__ */ React23.createElement("span", { className: "hawa-text-5xl hawa-font-extrabold hawa-tracking-tight" }, props.price)), /* @__PURE__ */ React23.createElement("span", { className: "hawa-mx-1 hawa-text-sm hawa-font-semibold" }, (_f = props.texts) == null ? void 0 : _f.currencyText)), /* @__PURE__ */ React23.createElement("span", { className: "hawa-ml-1 hawa-whitespace-nowrap hawa-text-xl hawa-font-normal hawa-text-primary/70" }, "/ ", (_g = props.texts) == null ? void 0 : _g.cycleText)))), endButton && /* @__PURE__ */ React23.createElement(Separator, null), /* @__PURE__ */ React23.createElement(
|
1978
|
+
"div",
|
1979
|
+
{
|
1980
|
+
className: cn(
|
1981
|
+
"hawa-flex hawa-h-full hawa-justify-between hawa-gap-4",
|
1982
|
+
endButton ? "hawa-flex-col" : "hawa-flex-col-reverse"
|
1983
|
+
)
|
1984
|
+
},
|
1985
|
+
props.features && /* @__PURE__ */ React23.createElement("ul", { role: "list", className: "hawa-space-y-0 hawa-overflow-x-auto" }, (_h = props.features) == null ? void 0 : _h.map((feature, o) => {
|
1986
|
+
var _a2;
|
1987
|
+
return /* @__PURE__ */ React23.createElement(
|
1988
|
+
"li",
|
1989
|
+
{
|
1990
|
+
key: o,
|
1991
|
+
className: cn(
|
1992
|
+
"hawa-flex hawa-flex-row hawa-justify-between hawa-gap-2",
|
1993
|
+
!feature.included && "hawa-line-through"
|
1994
|
+
)
|
1995
|
+
},
|
1996
|
+
/* @__PURE__ */ React23.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center" }, feature.included ? /* @__PURE__ */ React23.createElement(
|
1997
|
+
"svg",
|
1998
|
+
{
|
1999
|
+
"aria-label": "Check Icon",
|
2000
|
+
"aria-hidden": "true",
|
2001
|
+
className: "hawa-m-2 hawa-h-5 hawa-w-5 hawa-flex-shrink-0 hawa-text-primary",
|
2002
|
+
fill: "currentColor",
|
2003
|
+
viewBox: "0 0 20 20"
|
2004
|
+
},
|
2005
|
+
/* @__PURE__ */ React23.createElement(
|
2006
|
+
"path",
|
2007
|
+
{
|
2008
|
+
fillRule: "evenodd",
|
2009
|
+
d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",
|
2010
|
+
clipRule: "evenodd"
|
2011
|
+
}
|
2012
|
+
)
|
2013
|
+
) : /* @__PURE__ */ React23.createElement("div", { className: "hawa-m-2 hawa-mx-2.5 hawa-h-4 hawa-w-4 hawa-rounded-full hawa-bg-primary/10" }), /* @__PURE__ */ React23.createElement("span", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-gap-2 hawa-whitespace-nowrap hawa-text-start hawa-font-normal hawa-leading-tight hawa-text-primary/70 " }, feature.text, " ", feature.soon && feature.included && /* @__PURE__ */ React23.createElement(
|
2014
|
+
Chip,
|
2015
|
+
{
|
2016
|
+
label: ((_a2 = props.texts) == null ? void 0 : _a2.soon) || "",
|
2017
|
+
color: "oceanic",
|
2018
|
+
size: "small"
|
2019
|
+
}
|
2020
|
+
))),
|
2021
|
+
feature.hint && /* @__PURE__ */ React23.createElement(Tooltip, { content: feature.hint, side: feature.hintSide }, /* @__PURE__ */ React23.createElement(
|
2022
|
+
"svg",
|
2023
|
+
{
|
2024
|
+
xmlns: "http://www.w3.org/2000/svg",
|
2025
|
+
className: "hawa-h-[14px] hawa-w-[14px] hawa-cursor-help",
|
2026
|
+
viewBox: "0 0 24 24",
|
2027
|
+
fill: "none",
|
2028
|
+
stroke: "currentColor",
|
2029
|
+
strokeWidth: "2",
|
2030
|
+
strokeLinecap: "round",
|
2031
|
+
strokeLinejoin: "round"
|
2032
|
+
},
|
2033
|
+
/* @__PURE__ */ React23.createElement("circle", { cx: "12", cy: "12", r: "10" }),
|
2034
|
+
/* @__PURE__ */ React23.createElement("path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" }),
|
2035
|
+
/* @__PURE__ */ React23.createElement("path", { d: "M12 17h.01" })
|
2036
|
+
))
|
2037
|
+
);
|
2038
|
+
})),
|
2039
|
+
/* @__PURE__ */ React23.createElement(
|
2040
|
+
Button,
|
2041
|
+
{
|
2042
|
+
onClick: props.onPlanClicked,
|
2043
|
+
disabled: currentPlan,
|
2044
|
+
className: "hawa-w-full"
|
2045
|
+
},
|
2046
|
+
(_i = props.texts) == null ? void 0 : _i.buttonText
|
2047
|
+
)
|
2048
|
+
))
|
2049
|
+
);
|
2050
|
+
};
|
2051
|
+
|
2052
|
+
// blocks/cards/ItemCard.tsx
|
2053
|
+
import React24, { useEffect as useEffect4, useState as useState10 } from "react";
|
2054
|
+
var ItemCard = ({
|
2055
|
+
actions,
|
2056
|
+
counts,
|
2057
|
+
content,
|
2058
|
+
headerActions,
|
2059
|
+
clickableImage,
|
2060
|
+
onImageClick,
|
2061
|
+
clickableImageActionText,
|
2062
|
+
clickableImageActionIcon,
|
2063
|
+
header,
|
2064
|
+
cardImage,
|
2065
|
+
orientation = "vertical",
|
2066
|
+
...props
|
2067
|
+
}) => {
|
2068
|
+
let defaultStyle = "hawa-block hawa-rounded hawa-border hawa-bg-card hawa-text-card-foreground hawa-shadow-sm hawa-transition-all";
|
2069
|
+
let orientationStyles = {
|
2070
|
+
vertical: "hawa-max-w-sm",
|
2071
|
+
horizontal: "hawa-flex hawa-flex-row hawa-w-full"
|
2072
|
+
};
|
2073
|
+
let imageStyles = {
|
2074
|
+
vertical: "hawa-h-auto hawa-max-h-56 hawa-w-full hawa-rounded-t-lg hawa-object-cover",
|
2075
|
+
horizontal: (
|
2076
|
+
// "h-auto w-full rounded-l-lg object-cover md:h-auto md:w-48 md:rounded-none md:rounded-l-lg",
|
2077
|
+
// "h-full w-full rounded-l-lg object-cover md:w-48 md:rounded-none md:rounded-l-lg",
|
2078
|
+
"hawa-h-full hawa-w-48 hawa-rounded-l hawa-object-cover"
|
2079
|
+
)
|
2080
|
+
};
|
2081
|
+
let headerActionsButtonStyle = "hawa-inline-block hawa-rounded hawa-p-1 hawa-text-sm hawa-text-gray-500 hover:hawa-bg-gray-100 focus:hawa-outline-none focus:hawa-ring-4 focus:hawa-ring-gray-200 dark:hawa-text-gray-400 dark:hover:hawa-bg-gray-700 dark:focus:hawa-ring-gray-700";
|
2082
|
+
const [openActionHeader, setOpenActionHeader] = useState10(false);
|
2083
|
+
function handleOpenActionHeader(e) {
|
2084
|
+
e.stopPropagation();
|
2085
|
+
setOpenActionHeader(!openActionHeader);
|
2086
|
+
}
|
2087
|
+
useEffect4(() => {
|
2088
|
+
window.onclick = () => {
|
2089
|
+
if (openActionHeader) {
|
2090
|
+
setOpenActionHeader(false);
|
2091
|
+
}
|
2092
|
+
};
|
2093
|
+
return () => window.onclick = null;
|
2094
|
+
}, [openActionHeader]);
|
2095
|
+
return /* @__PURE__ */ React24.createElement(
|
2096
|
+
"div",
|
2097
|
+
{
|
2098
|
+
className: cn(
|
2099
|
+
defaultStyle,
|
2100
|
+
props.onCardClick && " hawa-cursor-pointer hover:hawa-shadow-lg",
|
2101
|
+
orientationStyles[orientation],
|
2102
|
+
props.className
|
2103
|
+
),
|
2104
|
+
onClick: (e) => {
|
2105
|
+
e.stopPropagation();
|
2106
|
+
if (props.onCardClick) {
|
2107
|
+
props.onCardClick(e);
|
2108
|
+
}
|
2109
|
+
}
|
2110
|
+
},
|
2111
|
+
cardImage && /* @__PURE__ */ React24.createElement("div", { className: "hawa-group hawa-relative hawa-overflow-clip" }, /* @__PURE__ */ React24.createElement(
|
2112
|
+
"img",
|
2113
|
+
{
|
2114
|
+
src: cardImage,
|
2115
|
+
className: cn(
|
2116
|
+
imageStyles[orientation],
|
2117
|
+
clickableImage ? "hawa-overflow-clip hawa-transition-all group-hover:hawa-blur-lg" : ""
|
2118
|
+
)
|
2119
|
+
}
|
2120
|
+
), clickableImage && /* @__PURE__ */ React24.createElement(StopPropagationWrapper, null, /* @__PURE__ */ React24.createElement("div", { className: "hawa-absolute hawa-left-0 hawa-top-0 hawa-flex hawa-h-full hawa-w-full hawa-items-center hawa-justify-center hawa-opacity-0 hawa-transition-all group-hover:hawa-opacity-100 " }, /* @__PURE__ */ React24.createElement(
|
2121
|
+
Button,
|
2122
|
+
{
|
2123
|
+
variant: "secondary",
|
2124
|
+
onClick: onImageClick,
|
2125
|
+
className: "hawa-flex hawa-flex-row hawa-gap-2"
|
2126
|
+
},
|
2127
|
+
clickableImageActionIcon,
|
2128
|
+
clickableImageActionText || "Click"
|
2129
|
+
)))),
|
2130
|
+
/* @__PURE__ */ React24.createElement("div", { className: "hawa-relative hawa-flex hawa-h-full hawa-w-full hawa-flex-col hawa-justify-between hawa-p-4 xs:hawa-p-6 xs:hawa-px-2 xs:hawa-pb-2" }, headerActions && /* @__PURE__ */ React24.createElement("div", { className: "hawa-absolute hawa-end-0 hawa-top-0 hawa-flex hawa-justify-end hawa-pe-3 hawa-pt-3" }, /* @__PURE__ */ React24.createElement(StopPropagationWrapper, null, /* @__PURE__ */ React24.createElement(
|
2131
|
+
DropdownMenu,
|
2132
|
+
{
|
2133
|
+
items: headerActions,
|
2134
|
+
trigger: /* @__PURE__ */ React24.createElement(
|
2135
|
+
Button,
|
2136
|
+
{
|
2137
|
+
variant: "ghost",
|
2138
|
+
size: "smallIcon",
|
2139
|
+
onClick: handleOpenActionHeader
|
2140
|
+
},
|
2141
|
+
/* @__PURE__ */ React24.createElement("span", { className: "hawa-sr-only" }, "Open dropdown"),
|
2142
|
+
/* @__PURE__ */ React24.createElement(
|
2143
|
+
"svg",
|
2144
|
+
{
|
2145
|
+
className: "hawa-h-5 hawa-w-5",
|
2146
|
+
"aria-hidden": "true",
|
2147
|
+
fill: "currentColor",
|
2148
|
+
viewBox: "0 0 20 20"
|
2149
|
+
},
|
2150
|
+
/* @__PURE__ */ React24.createElement("path", { 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" })
|
2151
|
+
)
|
2152
|
+
)
|
2153
|
+
}
|
2154
|
+
))), /* @__PURE__ */ React24.createElement("div", { className: " hawa-mx-2" }, header && /* @__PURE__ */ React24.createElement("h5", { className: "hawa-mb-2 hawa-text-2xl hawa-font-bold hawa-tracking-tight " }, header), content && /* @__PURE__ */ React24.createElement("span", { className: "hawa-w-full hawa-font-normal " }, content)), actions || counts ? /* @__PURE__ */ React24.createElement(
|
2155
|
+
"div",
|
2156
|
+
{
|
2157
|
+
className: cn(
|
2158
|
+
"hawa-mt-3 hawa-flex hawa-flex-col hawa-items-center hawa-rounded-b-lg dark:hawa-text-white xs:hawa-flex-row",
|
2159
|
+
actions || counts ? "hawa-justify-between" : "hawa-justify-end",
|
2160
|
+
!actions && counts ? "hawa-py-3" : ""
|
2161
|
+
)
|
2162
|
+
},
|
2163
|
+
counts,
|
2164
|
+
/* @__PURE__ */ React24.createElement(StopPropagationWrapper, null, actions)
|
2165
|
+
) : null)
|
2166
|
+
);
|
2167
|
+
};
|
2168
|
+
|
2169
|
+
// blocks/cards/LandingCard.tsx
|
2170
|
+
import React25 from "react";
|
2171
|
+
var LandingCard = (props) => {
|
2172
|
+
return /* @__PURE__ */ React25.createElement(Card, { className: props.className }, /* @__PURE__ */ React25.createElement(CardHeader, null, props.icon, /* @__PURE__ */ React25.createElement(CardTitle, null, props.title), /* @__PURE__ */ React25.createElement(CardDescription, null, props.subtitle)));
|
2173
|
+
};
|
2174
|
+
|
2175
|
+
// blocks/pricing/PricingPlans.tsx
|
2176
|
+
var PricingPlans = ({
|
2177
|
+
mainContainerProps,
|
2178
|
+
cardsContainerProps,
|
2179
|
+
...props
|
2180
|
+
}) => {
|
2181
|
+
return /* @__PURE__ */ React26.createElement("div", { ...mainContainerProps }, /* @__PURE__ */ React26.createElement("div", { className: "hawa-mb-2 hawa-flex hawa-w-full hawa-justify-between" }, /* @__PURE__ */ React26.createElement(
|
2182
|
+
Radio,
|
2183
|
+
{
|
2184
|
+
design: "tabs",
|
2185
|
+
defaultValue: props.currentCycle.value,
|
2186
|
+
options: props.billingCycles,
|
2187
|
+
onChange: (e) => {
|
2188
|
+
if (props.onCycleChange) {
|
2189
|
+
props.onCycleChange(e);
|
2190
|
+
}
|
2191
|
+
}
|
2192
|
+
}
|
2193
|
+
), /* @__PURE__ */ React26.createElement(
|
2194
|
+
Radio,
|
2195
|
+
{
|
2196
|
+
design: "tabs",
|
2197
|
+
defaultValue: props.currentCurrency.value,
|
2198
|
+
options: props.currencies,
|
2199
|
+
onChange: (e) => {
|
2200
|
+
if (props.onCurrencyChange) {
|
2201
|
+
props.onCurrencyChange(e);
|
2202
|
+
}
|
2203
|
+
}
|
2204
|
+
}
|
2205
|
+
)), /* @__PURE__ */ React26.createElement(
|
2206
|
+
"div",
|
2207
|
+
{
|
2208
|
+
className: "hawa-inline-grid hawa-w-full hawa-grid-cols-[repeat(auto-fit,_minmax(300px,_1fr))] hawa-gap-4",
|
2209
|
+
...cardsContainerProps
|
2210
|
+
},
|
2211
|
+
props.plans.map((plan, index) => {
|
2212
|
+
var _a, _b;
|
2213
|
+
return /* @__PURE__ */ React26.createElement(
|
2214
|
+
PricingCard,
|
2215
|
+
{
|
2216
|
+
key: index,
|
2217
|
+
onPlanClicked: () => {
|
2218
|
+
var _a2, _b2;
|
2219
|
+
if (props.onPlanClicked) {
|
2220
|
+
let clickedData = {
|
2221
|
+
// plan: plan.id,
|
2222
|
+
currency: (_a2 = props.currentCurrency) == null ? void 0 : _a2.value,
|
2223
|
+
cycle: (_b2 = props.currentCycle) == null ? void 0 : _b2.value,
|
2224
|
+
...plan
|
2225
|
+
};
|
2226
|
+
props.onPlanClicked(clickedData);
|
2227
|
+
}
|
2228
|
+
},
|
2229
|
+
...plan,
|
2230
|
+
price: plan.price,
|
2231
|
+
texts: {
|
2232
|
+
...plan.texts,
|
2233
|
+
currencyText: (_a = props.currentCurrency) == null ? void 0 : _a.label,
|
2234
|
+
cycleText: (_b = props.currentCycle) == null ? void 0 : _b.label
|
2235
|
+
}
|
2236
|
+
}
|
2237
|
+
);
|
2238
|
+
})
|
2239
|
+
));
|
2240
|
+
};
|
2241
|
+
|
2242
|
+
// blocks/pricing/ComparingPlans.tsx
|
2243
|
+
import React27 from "react";
|
2244
|
+
var ComparingPlans = (props) => {
|
2245
|
+
const uniqueFeatures = Array.from(
|
2246
|
+
new Set(
|
2247
|
+
props.plans.flatMap(
|
2248
|
+
(plan) => plan.features.map((feature) => feature.text)
|
2249
|
+
)
|
2250
|
+
)
|
2251
|
+
);
|
2252
|
+
return /* @__PURE__ */ React27.createElement("div", { id: "detailed-pricing", className: "hawa-w-full" }, /* @__PURE__ */ React27.createElement("div", { className: "hawa-mb-2 hawa-flex hawa-w-full hawa-flex-col hawa-justify-between hawa-gap-2 sm:hawa-flex-row" }, /* @__PURE__ */ React27.createElement(
|
2253
|
+
Radio,
|
2254
|
+
{
|
2255
|
+
tabsContainerClassName: "hawa-w-full sm:hawa-max-w-fit",
|
2256
|
+
width: "none",
|
2257
|
+
design: "tabs",
|
2258
|
+
defaultValue: props.currentCycle.value,
|
2259
|
+
options: props.billingCycles,
|
2260
|
+
onChange: (e) => {
|
2261
|
+
if (props.onCycleChange) {
|
2262
|
+
props.onCycleChange(e);
|
2263
|
+
}
|
2264
|
+
}
|
2265
|
+
}
|
2266
|
+
), /* @__PURE__ */ React27.createElement(
|
2267
|
+
Radio,
|
2268
|
+
{
|
2269
|
+
tabsContainerClassName: "hawa-w-full sm:hawa-max-w-fit",
|
2270
|
+
width: "none",
|
2271
|
+
design: "tabs",
|
2272
|
+
defaultValue: props.currentCurrency.value,
|
2273
|
+
options: props.currencies,
|
2274
|
+
onChange: (e) => {
|
2275
|
+
if (props.onCurrencyChange) {
|
2276
|
+
props.onCurrencyChange(e);
|
2277
|
+
}
|
2278
|
+
}
|
2279
|
+
}
|
2280
|
+
)), /* @__PURE__ */ React27.createElement(
|
2281
|
+
"div",
|
2282
|
+
{
|
2283
|
+
className: cn(
|
2284
|
+
"hawa-sticky hawa-z-10 hawa-grid hawa-grid-cols-4 hawa-gap-x-2 hawa-rounded-t hawa-border hawa-p-4 hawa-text-sm hawa-font-medium",
|
2285
|
+
"hawa-bg-primary-foreground"
|
2286
|
+
),
|
2287
|
+
style: {
|
2288
|
+
top: props.topPosition || 0
|
2289
|
+
}
|
2290
|
+
},
|
2291
|
+
/* @__PURE__ */ React27.createElement("div", { className: "hawa-flex hawa-items-center" }),
|
2292
|
+
props.plans.map((plan, i) => /* @__PURE__ */ React27.createElement(
|
2293
|
+
"div",
|
2294
|
+
{
|
2295
|
+
key: i,
|
2296
|
+
className: "hawa-flex hawa-flex-col hawa-items-center hawa-justify-center hawa-gap-2"
|
2297
|
+
},
|
2298
|
+
/* @__PURE__ */ React27.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-2" }, /* @__PURE__ */ React27.createElement("div", { className: "hawa-flex hawa-flex-col" }, /* @__PURE__ */ React27.createElement("span", { className: "hawa-text-md hawa-font-bold " }, plan.texts.title), /* @__PURE__ */ React27.createElement("span", { className: "hawa-text-md hawa-font-normal hawa-text-muted-foreground " }, plan.texts.subtitle)), /* @__PURE__ */ React27.createElement("div", { className: " hawa-flex hawa-items-baseline " }, /* @__PURE__ */ React27.createElement(React27.Fragment, null, /* @__PURE__ */ React27.createElement("span", { className: "hawa-text-5xl hawa-font-extrabold hawa-tracking-tight" }, plan.price), /* @__PURE__ */ React27.createElement("span", { className: "hawa-mx-1 hawa-text-sm hawa-font-semibold" }, plan.texts.currencyText)), /* @__PURE__ */ React27.createElement("span", { className: "hawa-ml-1 hawa-text-xl hawa-font-normal " }, "/ ", plan.texts.cycleText)))
|
2299
|
+
))
|
2300
|
+
), /* @__PURE__ */ React27.createElement(
|
2301
|
+
ScrollArea,
|
2302
|
+
{
|
2303
|
+
className: "hawa-h-fit hawa-rounded hawa-rounded-t-none hawa-border hawa-border-t-0 hawa-bg-background",
|
2304
|
+
dir: props.direction
|
2305
|
+
},
|
2306
|
+
uniqueFeatures.map((featureText, featureIndex) => {
|
2307
|
+
var _a, _b, _c, _d;
|
2308
|
+
return /* @__PURE__ */ React27.createElement(
|
2309
|
+
"div",
|
2310
|
+
{
|
2311
|
+
key: featureIndex,
|
2312
|
+
className: cn(
|
2313
|
+
"hawa-border-foreground-muted hawa-grid hawa-grid-cols-[1fr_repeat(3,_minmax(0,_1fr))] hawa-gap-x-16 hawa-px-4 hawa-py-5 hawa-text-sm hawa-text-gray-700 dark:text-white",
|
2314
|
+
featureIndex === 0 ? "" : "hawa-border-t"
|
2315
|
+
)
|
2316
|
+
},
|
2317
|
+
/* @__PURE__ */ React27.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-gap-2 hawa-text-foreground" }, featureText, props.plans.some(
|
2318
|
+
(plan) => plan.features.some(
|
2319
|
+
(feature) => feature.text === featureText && feature.hint
|
2320
|
+
)
|
2321
|
+
) && /* @__PURE__ */ React27.createElement(
|
2322
|
+
Tooltip,
|
2323
|
+
{
|
2324
|
+
side: "right",
|
2325
|
+
content: (_b = (_a = props.plans.find(
|
2326
|
+
(plan) => {
|
2327
|
+
var _a2;
|
2328
|
+
return (_a2 = plan.features.find(
|
2329
|
+
(feature) => feature.text === featureText
|
2330
|
+
)) == null ? void 0 : _a2.hint;
|
2331
|
+
}
|
2332
|
+
)) == null ? void 0 : _a.features.find(
|
2333
|
+
(feature) => feature.text === featureText
|
2334
|
+
)) == null ? void 0 : _b.hint
|
2335
|
+
},
|
2336
|
+
/* @__PURE__ */ React27.createElement(
|
2337
|
+
"svg",
|
2338
|
+
{
|
2339
|
+
stroke: "currentColor",
|
2340
|
+
fill: "currentColor",
|
2341
|
+
strokeWidth: "0",
|
2342
|
+
viewBox: "0 0 16 16",
|
2343
|
+
height: "1em",
|
2344
|
+
width: "1em"
|
2345
|
+
},
|
2346
|
+
/* @__PURE__ */ React27.createElement("path", { d: "M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM8 4a.905.905 0 0 0-.9.995l.35 3.507a.552.552 0 0 0 1.1 0l.35-3.507A.905.905 0 0 0 8 4zm.002 6a1 1 0 1 0 0 2 1 1 0 0 0 0-2z" })
|
2347
|
+
)
|
2348
|
+
), props.plans.some(
|
2349
|
+
(plan) => plan.features.some(
|
2350
|
+
(feature) => feature.text === featureText && feature.soon
|
2351
|
+
)
|
2352
|
+
) && /* @__PURE__ */ React27.createElement(
|
2353
|
+
Chip,
|
2354
|
+
{
|
2355
|
+
label: ((_d = (_c = props.plans.find(
|
2356
|
+
(plan) => plan.features.some(
|
2357
|
+
(feature) => feature.text === featureText && feature.soon
|
2358
|
+
)
|
2359
|
+
)) == null ? void 0 : _c.texts) == null ? void 0 : _d.soon) || "Soon"
|
2360
|
+
}
|
2361
|
+
)),
|
2362
|
+
props.plans.map((plan, planIndex) => {
|
2363
|
+
const feature = plan.features.find(
|
2364
|
+
(f) => f.text === featureText
|
2365
|
+
);
|
2366
|
+
return /* @__PURE__ */ React27.createElement(
|
2367
|
+
"div",
|
2368
|
+
{
|
2369
|
+
key: planIndex,
|
2370
|
+
className: "hawa-flex hawa-flex-col hawa-items-center hawa-text-center"
|
2371
|
+
},
|
2372
|
+
(feature == null ? void 0 : feature.included) ? /* @__PURE__ */ React27.createElement(CheckMark, { className: "hawa-text-foreground" }) : /* @__PURE__ */ React27.createElement(UncheckMark, { className: "hawa-text-foreground" })
|
2373
|
+
);
|
2374
|
+
})
|
2375
|
+
);
|
2376
|
+
})
|
2377
|
+
), props.showButtons && /* @__PURE__ */ React27.createElement("div", { className: "hawa-grid hawa-grid-cols-[1fr_repeat(3,_minmax(0,_1fr))] hawa-gap-x-16 hawa-px-4 hawa-py-5" }, /* @__PURE__ */ React27.createElement("div", { className: "hawa-flex hawa-items-center" }), props.plans.map((plan, i) => {
|
2378
|
+
var _a;
|
2379
|
+
return /* @__PURE__ */ React27.createElement(
|
2380
|
+
"div",
|
2381
|
+
{
|
2382
|
+
key: i,
|
2383
|
+
className: "hawa-flex hawa-items-center hawa-justify-center"
|
2384
|
+
},
|
2385
|
+
/* @__PURE__ */ React27.createElement(
|
2386
|
+
Button,
|
2387
|
+
{
|
2388
|
+
className: "hawa-w-full hawa-max-w-xs",
|
2389
|
+
onClick: () => {
|
2390
|
+
var _a2, _b;
|
2391
|
+
if (props.onPlanClicked) {
|
2392
|
+
let clickedData = {
|
2393
|
+
// plan: plan.id,
|
2394
|
+
currency: (_a2 = props.currentCurrency) == null ? void 0 : _a2.value,
|
2395
|
+
cycle: (_b = props.currentCycle) == null ? void 0 : _b.value,
|
2396
|
+
...plan
|
2397
|
+
};
|
2398
|
+
props.onPlanClicked(clickedData);
|
2399
|
+
}
|
2400
|
+
}
|
2401
|
+
},
|
2402
|
+
((_a = plan.texts) == null ? void 0 : _a.buttonText) || "Get Started"
|
2403
|
+
)
|
2404
|
+
);
|
2405
|
+
})));
|
2406
|
+
};
|
2407
|
+
|
2408
|
+
// blocks/pricing/HorizontalPricing.tsx
|
2409
|
+
import React28, { useState as useState11 } from "react";
|
2410
|
+
var HorizontalPricing = (props) => {
|
2411
|
+
const [selectedCard, setSelectedCard] = useState11("");
|
2412
|
+
let data = [
|
2413
|
+
{ title: "basic", price: "$49", cycle: "/mo" },
|
2414
|
+
{ title: "business", price: "$99", cycle: "/mo" },
|
2415
|
+
{ title: "enterprise", price: "$149", cycle: "/mo" }
|
2416
|
+
];
|
2417
|
+
return /* @__PURE__ */ React28.createElement("div", { className: "hawa-z-10 hawa-w-full hawa-max-w-screen-sm" }, /* @__PURE__ */ React28.createElement("div", { className: "hawa-max-w-2xl " }, /* @__PURE__ */ React28.createElement("div", { className: "hawa-flex hawa-flex-row hawa-justify-between" }, /* @__PURE__ */ React28.createElement(
|
2418
|
+
Radio,
|
2419
|
+
{
|
2420
|
+
design: "tabs",
|
2421
|
+
options: props.currencies,
|
2422
|
+
defaultValue: props.currentCurrency
|
2423
|
+
}
|
2424
|
+
), /* @__PURE__ */ React28.createElement(
|
2425
|
+
Radio,
|
2426
|
+
{
|
2427
|
+
design: "tabs",
|
2428
|
+
options: props.billingCycles,
|
2429
|
+
defaultValue: props.currentCycle
|
2430
|
+
}
|
2431
|
+
)), data.map((d, i) => /* @__PURE__ */ React28.createElement(
|
2432
|
+
"label",
|
2433
|
+
{
|
2434
|
+
key: i,
|
2435
|
+
htmlFor: d.title,
|
2436
|
+
className: "",
|
2437
|
+
onClick: () => setSelectedCard(d.title)
|
2438
|
+
},
|
2439
|
+
/* @__PURE__ */ React28.createElement(
|
2440
|
+
"input",
|
2441
|
+
{
|
2442
|
+
type: "radio",
|
2443
|
+
name: "radio",
|
2444
|
+
id: d.title,
|
2445
|
+
className: "hawa-peer hawa-appearance-none"
|
2446
|
+
}
|
2447
|
+
),
|
2448
|
+
/* @__PURE__ */ React28.createElement(
|
2449
|
+
"div",
|
2450
|
+
{
|
2451
|
+
className: cn(
|
2452
|
+
selectedCard === d.title ? "peer-checked:hawa-border-primary peer-checked:hawa-ring-4 peer-checked:hawa-ring-primary/20 " : "",
|
2453
|
+
"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"
|
2454
|
+
)
|
2455
|
+
},
|
2456
|
+
/* @__PURE__ */ React28.createElement("div", { className: "hawa-peer hawa-flex hawa-items-center hawa-gap-4" }, /* @__PURE__ */ React28.createElement(CheckIcons, null), /* @__PURE__ */ React28.createElement(
|
2457
|
+
CardText,
|
2458
|
+
{
|
2459
|
+
title: "Enterprise",
|
2460
|
+
subtitle: "For startups and new businesses"
|
2461
|
+
}
|
2462
|
+
)),
|
2463
|
+
/* @__PURE__ */ React28.createElement(CardPrice, { amount: d.price, cycle: d.cycle })
|
2464
|
+
)
|
2465
|
+
))));
|
2466
|
+
};
|
2467
|
+
var CheckIcons = () => /* @__PURE__ */ React28.createElement(React28.Fragment, null, /* @__PURE__ */ React28.createElement(
|
2468
|
+
"svg",
|
2469
|
+
{
|
2470
|
+
fill: "none",
|
2471
|
+
viewBox: "0 0 24 24",
|
2472
|
+
strokeWidth: "1.5",
|
2473
|
+
stroke: "currentColor",
|
2474
|
+
className: "hawa-default hawa-h-8 hawa-w-8 hawa-text-neutral-500"
|
2475
|
+
},
|
2476
|
+
/* @__PURE__ */ React28.createElement(
|
2477
|
+
"path",
|
2478
|
+
{
|
2479
|
+
strokeLinecap: "round",
|
2480
|
+
strokeLinejoin: "round",
|
2481
|
+
d: "M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
|
2482
|
+
}
|
2483
|
+
)
|
2484
|
+
), /* @__PURE__ */ React28.createElement(
|
2485
|
+
"svg",
|
2486
|
+
{
|
2487
|
+
viewBox: "0 0 24 24",
|
2488
|
+
fill: "currentColor",
|
2489
|
+
className: "hawa-active hawa-hidden hawa-h-8 hawa-w-8 hawa-text-blue-500"
|
2490
|
+
},
|
2491
|
+
/* @__PURE__ */ React28.createElement(
|
2492
|
+
"path",
|
2493
|
+
{
|
2494
|
+
fillRule: "evenodd",
|
2495
|
+
clipRule: "evenodd",
|
2496
|
+
d: "M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12zm13.36-1.814a.75.75 0 10-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 00-1.06 1.06l2.25 2.25a.75.75 0 001.14-.094l3.75-5.25z"
|
2497
|
+
}
|
2498
|
+
)
|
2499
|
+
));
|
2500
|
+
var CardText = (props) => /* @__PURE__ */ React28.createElement("div", { className: "hawa-peer hawa-flex hawa-flex-col hawa-items-start " }, /* @__PURE__ */ React28.createElement("h2", { className: "hawa-font-medium hawa-text-primary/90 sm:hawa-text-xl" }, props.title), /* @__PURE__ */ React28.createElement("p", { className: "hawa-text-sm hawa-text-primary/60" }, props.subtitle, " "));
|
2501
|
+
var CardPrice = (props) => /* @__PURE__ */ React28.createElement("h2", { className: "hawa-peer hawa-text-xl hawa-font-semibold hawa-text-primary sm:hawa-text-2xl" }, props.amount, /* @__PURE__ */ React28.createElement("span", { className: "hawa-text-base hawa-font-medium hawa-text-neutral-400" }, props.cycle));
|
2502
|
+
|
2503
|
+
// blocks/Usage.tsx
|
2504
|
+
import React29 from "react";
|
2505
|
+
var Usage = (props) => {
|
2506
|
+
var _a;
|
2507
|
+
return /* @__PURE__ */ React29.createElement("div", { className: "hawa-flex hawa-w-full hawa-flex-col hawa-gap-1 hawa-rounded hawa-border hawa-bg-card hawa-p-4" }, /* @__PURE__ */ React29.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-gap-2" }, /* @__PURE__ */ React29.createElement("span", { className: "hawa-bg-white-200" }, props.title), props.tooltip && /* @__PURE__ */ React29.createElement(Tooltip, { content: props.tooltip }, /* @__PURE__ */ React29.createElement(
|
2508
|
+
"svg",
|
2509
|
+
{
|
2510
|
+
stroke: "currentColor",
|
2511
|
+
"aria-label": "Exclamation Circle",
|
2512
|
+
fill: "currentColor",
|
2513
|
+
strokeWidth: "0",
|
2514
|
+
viewBox: "0 0 16 16",
|
2515
|
+
height: "1em",
|
2516
|
+
width: "1em"
|
2517
|
+
},
|
2518
|
+
/* @__PURE__ */ React29.createElement("path", { d: "M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM8 4a.905.905 0 0 0-.9.995l.35 3.507a.552.552 0 0 0 1.1 0l.35-3.507A.905.905 0 0 0 8 4zm.002 6a1 1 0 1 0 0 2 1 1 0 0 0 0-2z" })
|
2519
|
+
))), /* @__PURE__ */ React29.createElement("div", { className: "hawa-bg-white-100 hawa-flex hawa-flex-row" }, /* @__PURE__ */ React29.createElement("div", null, props.currentUsage), /* @__PURE__ */ React29.createElement("div", null, " (", props.percent, "%)")), /* @__PURE__ */ React29.createElement(Progress, { value: (_a = props.percent) != null ? _a : 0 }));
|
2520
|
+
};
|
2521
|
+
export {
|
2522
|
+
ActionCard,
|
2523
|
+
AdCard,
|
2524
|
+
Announcement,
|
2525
|
+
AppLanding,
|
2526
|
+
CheckEmail,
|
2527
|
+
CodeConfirmation,
|
2528
|
+
ComparingPlans,
|
2529
|
+
ContactForm,
|
2530
|
+
EmptyState,
|
2531
|
+
FeedbackEmoji,
|
2532
|
+
FeedbackForm,
|
2533
|
+
FeedbackRating,
|
2534
|
+
HorizontalPricing,
|
2535
|
+
ItemCard,
|
2536
|
+
LandingCard,
|
2537
|
+
LeadGenerator,
|
2538
|
+
LegalTexts,
|
2539
|
+
LoginForm,
|
2540
|
+
NewPasswordForm,
|
2541
|
+
NoPermission,
|
2542
|
+
NotFound,
|
2543
|
+
PricingCard,
|
2544
|
+
PricingPlans,
|
2545
|
+
RegisterForm,
|
2546
|
+
ResetPasswordForm,
|
2547
|
+
Testimonial,
|
2548
|
+
Usage,
|
2549
|
+
UserReferralSource
|
2550
|
+
};
|