@sikka/hawa 0.26.29 → 0.26.31
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 +5 -5
@@ -0,0 +1,3418 @@
|
|
1
|
+
import {
|
2
|
+
useClipboard,
|
3
|
+
useToast
|
4
|
+
} from "../chunk-JNUGOUYJ.mjs";
|
5
|
+
import {
|
6
|
+
Alert,
|
7
|
+
CheckMark,
|
8
|
+
Checkbox,
|
9
|
+
EyeIcon,
|
10
|
+
HiddenEyeIcon,
|
11
|
+
Input,
|
12
|
+
Label,
|
13
|
+
PhoneInput,
|
14
|
+
PinInput,
|
15
|
+
Popover,
|
16
|
+
PopoverContent,
|
17
|
+
PopoverTrigger,
|
18
|
+
Progress,
|
19
|
+
Radio,
|
20
|
+
ScrollArea,
|
21
|
+
ScrollBar,
|
22
|
+
Select,
|
23
|
+
Separator,
|
24
|
+
StopPropagationWrapper,
|
25
|
+
Tabs,
|
26
|
+
TabsContent,
|
27
|
+
TabsList,
|
28
|
+
TabsTrigger,
|
29
|
+
Textarea,
|
30
|
+
UncheckMark
|
31
|
+
} from "../chunk-F3DQJHTG.mjs";
|
32
|
+
import {
|
33
|
+
Sheet,
|
34
|
+
SheetClose,
|
35
|
+
SheetContent,
|
36
|
+
SheetDescription,
|
37
|
+
SheetFooter,
|
38
|
+
SheetHeader,
|
39
|
+
SheetOverlay,
|
40
|
+
SheetPortal,
|
41
|
+
SheetTitle,
|
42
|
+
SheetTrigger
|
43
|
+
} from "../chunk-FQ6WVEHW.mjs";
|
44
|
+
import {
|
45
|
+
Button,
|
46
|
+
Card,
|
47
|
+
CardContent,
|
48
|
+
CardDescription,
|
49
|
+
CardFooter,
|
50
|
+
CardHeader,
|
51
|
+
CardTitle,
|
52
|
+
Chip,
|
53
|
+
DropdownMenu,
|
54
|
+
DropdownMenuCheckboxItem,
|
55
|
+
DropdownMenuContent,
|
56
|
+
DropdownMenuGroup,
|
57
|
+
DropdownMenuItem,
|
58
|
+
DropdownMenuLabel,
|
59
|
+
DropdownMenuPortal,
|
60
|
+
DropdownMenuRadio,
|
61
|
+
DropdownMenuRadioGroup,
|
62
|
+
DropdownMenuRadioItem,
|
63
|
+
DropdownMenuRoot,
|
64
|
+
DropdownMenuSeparator,
|
65
|
+
DropdownMenuShortcut,
|
66
|
+
DropdownMenuSub,
|
67
|
+
DropdownMenuSubContent,
|
68
|
+
DropdownMenuSubTrigger,
|
69
|
+
DropdownMenuTrigger,
|
70
|
+
Loading,
|
71
|
+
Logos,
|
72
|
+
Skeleton,
|
73
|
+
Tooltip,
|
74
|
+
buttonVariants,
|
75
|
+
calculateLuminance,
|
76
|
+
cn
|
77
|
+
} from "../chunk-MQUAGP7K.mjs";
|
78
|
+
import {
|
79
|
+
__require
|
80
|
+
} from "../chunk-ZFXKCRJC.mjs";
|
81
|
+
|
82
|
+
// elements/accordion/Accordion.tsx
|
83
|
+
import * as React3 from "react";
|
84
|
+
import * as AccordionPrimitive3 from "@radix-ui/react-accordion";
|
85
|
+
|
86
|
+
// elements/accordion/AccordionContent.tsx
|
87
|
+
import * as React from "react";
|
88
|
+
import * as AccordionPrimitive from "@radix-ui/react-accordion";
|
89
|
+
var AccordionContent = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ React.createElement(
|
90
|
+
AccordionPrimitive.Content,
|
91
|
+
{
|
92
|
+
ref,
|
93
|
+
className: !props.unstyled ? cn(
|
94
|
+
"hawa-overflow-hidden hawa-text-sm hawa-transition-all data-[state=closed]:hawa-animate-accordion-up data-[state=open]:hawa-animate-accordion-down",
|
95
|
+
className
|
96
|
+
) : className,
|
97
|
+
...props
|
98
|
+
},
|
99
|
+
/* @__PURE__ */ React.createElement("div", { className: "hawa-bg-background hawa-p-4" }, children)
|
100
|
+
));
|
101
|
+
AccordionContent.displayName = AccordionPrimitive.Content.displayName;
|
102
|
+
|
103
|
+
// elements/accordion/AccordionTrigger.tsx
|
104
|
+
import * as React2 from "react";
|
105
|
+
import * as AccordionPrimitive2 from "@radix-ui/react-accordion";
|
106
|
+
var AccordionTrigger = React2.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ React2.createElement(AccordionPrimitive2.Header, { className: "hawa-flex" }, /* @__PURE__ */ React2.createElement(
|
107
|
+
AccordionPrimitive2.Trigger,
|
108
|
+
{
|
109
|
+
ref,
|
110
|
+
className: !props.unstyled ? cn(
|
111
|
+
"hawa-flex hawa-flex-1 hawa-items-center hawa-justify-between hawa-bg-muted/50 hawa-p-4 hawa-font-medium hawa-transition-all [&[data-state=open]>svg]:hawa-rotate-180",
|
112
|
+
props.disabled ? "hawa-bg-muted/30 hawa-text-muted-foreground/50" : "hover:hawa-bg-muted",
|
113
|
+
className
|
114
|
+
) : className,
|
115
|
+
...props
|
116
|
+
},
|
117
|
+
children,
|
118
|
+
!props.hideArrow && /* @__PURE__ */ React2.createElement(
|
119
|
+
"svg",
|
120
|
+
{
|
121
|
+
xmlns: "http://www.w3.org/2000/svg",
|
122
|
+
width: "24",
|
123
|
+
height: "24",
|
124
|
+
viewBox: "0 0 24 24",
|
125
|
+
fill: "none",
|
126
|
+
stroke: "currentColor",
|
127
|
+
strokeWidth: "2",
|
128
|
+
strokeLinecap: "round",
|
129
|
+
strokeLinejoin: "round",
|
130
|
+
className: "hawa-icon hawa-shrink-0 hawa-transition-transform hawa-duration-200"
|
131
|
+
},
|
132
|
+
/* @__PURE__ */ React2.createElement("path", { d: "m6 9 6 6 6-6" })
|
133
|
+
)
|
134
|
+
)));
|
135
|
+
AccordionTrigger.displayName = AccordionPrimitive2.Trigger.displayName;
|
136
|
+
|
137
|
+
// elements/accordion/Accordion.tsx
|
138
|
+
var Accordion = React3.forwardRef(
|
139
|
+
({
|
140
|
+
items,
|
141
|
+
design = "default",
|
142
|
+
itemClassNames,
|
143
|
+
triggerclassNames,
|
144
|
+
contentclassNames,
|
145
|
+
className,
|
146
|
+
...props
|
147
|
+
}, ref) => /* @__PURE__ */ React3.createElement(AccordionPrimitive3.Root, { type: props.type, collapsible: true }, /* @__PURE__ */ React3.createElement(
|
148
|
+
"div",
|
149
|
+
{
|
150
|
+
className: cn("hawa-flex hawa-flex-col", {
|
151
|
+
"hawa-gap-4": design === "separated",
|
152
|
+
"hawa-gap-0": design === "default"
|
153
|
+
})
|
154
|
+
},
|
155
|
+
items.map((item, index) => /* @__PURE__ */ React3.createElement(
|
156
|
+
AccordionPrimitive3.Item,
|
157
|
+
{
|
158
|
+
disabled: item.disabled || false,
|
159
|
+
className: cn(itemClassNames, "hawa-rounded"),
|
160
|
+
key: index,
|
161
|
+
value: `item-${index}`
|
162
|
+
},
|
163
|
+
/* @__PURE__ */ React3.createElement(
|
164
|
+
AccordionTrigger,
|
165
|
+
{
|
166
|
+
disabled: item.disabled || false,
|
167
|
+
className: cn(
|
168
|
+
"hawa-transition-all",
|
169
|
+
design === "separated" ? "hawa-rounded data-[state=open]:hawa-rounded-b-none" : {
|
170
|
+
"hawa-rounded-t": index === 0,
|
171
|
+
"data-[state=closed]:hawa-rounded-b": index === items.length - 1
|
172
|
+
},
|
173
|
+
triggerclassNames
|
174
|
+
)
|
175
|
+
},
|
176
|
+
/* @__PURE__ */ React3.createElement(
|
177
|
+
"span",
|
178
|
+
{
|
179
|
+
className: cn(
|
180
|
+
"hawa-flex hawa-flex-row",
|
181
|
+
item.chip && "hawa-gap-2"
|
182
|
+
)
|
183
|
+
},
|
184
|
+
item.trigger,
|
185
|
+
" ",
|
186
|
+
item.chip && /* @__PURE__ */ React3.createElement(Chip, { ...item.chip })
|
187
|
+
)
|
188
|
+
),
|
189
|
+
/* @__PURE__ */ React3.createElement(
|
190
|
+
AccordionContent,
|
191
|
+
{
|
192
|
+
"aria-disabled": item.disabled || false,
|
193
|
+
className: cn(
|
194
|
+
"hawa-border hawa-transition-all",
|
195
|
+
design === "separated" ? "hawa-rounded data-[state=open]:hawa-rounded-t-none" : {
|
196
|
+
"data-[state=open]:hawa-rounded-b": index === items.length - 1
|
197
|
+
},
|
198
|
+
contentclassNames
|
199
|
+
)
|
200
|
+
},
|
201
|
+
item.content
|
202
|
+
)
|
203
|
+
))
|
204
|
+
))
|
205
|
+
);
|
206
|
+
Accordion.displayName = "Accordion";
|
207
|
+
|
208
|
+
// elements/accordion/AccordionItem.tsx
|
209
|
+
import * as React4 from "react";
|
210
|
+
import * as AccordionPrimitive4 from "@radix-ui/react-accordion";
|
211
|
+
var AccordionItem = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React4.createElement(AccordionPrimitive4.Item, { ref, className: cn(className), ...props }));
|
212
|
+
AccordionItem.displayName = "AccordionItem";
|
213
|
+
|
214
|
+
// elements/accordion/AccordionRoot.tsx
|
215
|
+
import * as AccordionPrimitive5 from "@radix-ui/react-accordion";
|
216
|
+
var AccordionRoot = AccordionPrimitive5.Root;
|
217
|
+
|
218
|
+
// elements/navigationMenu/NavigationMenu.tsx
|
219
|
+
import * as React5 from "react";
|
220
|
+
import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu";
|
221
|
+
import { cva } from "class-variance-authority";
|
222
|
+
var navigationMenuTriggerStyle = cva(
|
223
|
+
"hawa-group hawa-inline-flex hawa-h-10 hawa-w-max hawa-items-center hawa-gap-1 hawa-justify-center hawa-rounded-md hawa-bg-background hawa-px-4 hawa-py-2 hawa-text-sm hawa-font-medium hawa-transition-colors hover:hawa-bg-accent hover:hawa-text-accent-foreground focus:hawa-bg-accent focus:hawa-text-accent-foreground focus:hawa-outline-none disabled:hawa-pointer-events-none disabled:hawa-opacity-50 data-[active]:hawa-bg-accent/50 "
|
224
|
+
);
|
225
|
+
var NavigationMenuRoot = React5.forwardRef(({ className, children, viewportClassNames, ...props }, ref) => /* @__PURE__ */ React5.createElement(
|
226
|
+
NavigationMenuPrimitive.Root,
|
227
|
+
{
|
228
|
+
ref,
|
229
|
+
className: cn(
|
230
|
+
"hawa-relative hawa-z-10 hawa-flex hawa-flex-1 hawa-items-center hawa-justify-center",
|
231
|
+
// "hawa-max-w-max",
|
232
|
+
className
|
233
|
+
),
|
234
|
+
...props
|
235
|
+
},
|
236
|
+
children,
|
237
|
+
/* @__PURE__ */ React5.createElement(NavigationMenuViewport, { className: viewportClassNames })
|
238
|
+
));
|
239
|
+
var NavigationMenuList = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React5.createElement(
|
240
|
+
NavigationMenuPrimitive.List,
|
241
|
+
{
|
242
|
+
ref,
|
243
|
+
className: cn(
|
244
|
+
"hawa-group hawa-flex hawa-flex-1 hawa-list-none hawa-items-center hawa-justify-center hawa-gap-1",
|
245
|
+
className
|
246
|
+
),
|
247
|
+
...props
|
248
|
+
}
|
249
|
+
));
|
250
|
+
var NavigationMenuTrigger = React5.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ React5.createElement(
|
251
|
+
NavigationMenuPrimitive.Trigger,
|
252
|
+
{
|
253
|
+
ref,
|
254
|
+
className: cn(navigationMenuTriggerStyle(), "hawa-group", className),
|
255
|
+
...props
|
256
|
+
},
|
257
|
+
children,
|
258
|
+
/* @__PURE__ */ React5.createElement(
|
259
|
+
"svg",
|
260
|
+
{
|
261
|
+
"aria-label": "Chevron Icon",
|
262
|
+
xmlns: "http://www.w3.org/2000/svg",
|
263
|
+
width: "24",
|
264
|
+
height: "24",
|
265
|
+
viewBox: "0 0 24 24",
|
266
|
+
fill: "none",
|
267
|
+
stroke: "currentColor",
|
268
|
+
strokeWidth: "2",
|
269
|
+
strokeLinecap: "round",
|
270
|
+
strokeLinejoin: "round",
|
271
|
+
"aria-hidden": "true",
|
272
|
+
className: "hawa-icon hawa-relative hawa-top-[1px] hawa-transition hawa-duration-200 group-data-[state=open]:hawa-rotate-180"
|
273
|
+
},
|
274
|
+
/* @__PURE__ */ React5.createElement("path", { d: "m6 9 6 6 6-6" })
|
275
|
+
)
|
276
|
+
));
|
277
|
+
var NavigationMenuContent = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React5.createElement(
|
278
|
+
NavigationMenuPrimitive.Content,
|
279
|
+
{
|
280
|
+
ref,
|
281
|
+
className: cn(
|
282
|
+
"hawa-absolute hawa-left-0 hawa-top-0 hawa-w-full hawa-rounded ",
|
283
|
+
// "md:hawa-absolute md:hawa-w-auto hawa-left-0 hawa-top-0 ",
|
284
|
+
// animation
|
285
|
+
"data-[motion^=from-]:hawa-animate-in data-[motion^=to-]:hawa-animate-out data-[motion^=from-]:hawa-fade-in data-[motion^=to-]:hawa-fade-out data-[motion=from-end]:hawa-slide-in-from-right-52 data-[motion=from-start]:hawa-slide-in-from-left-52 data-[motion=to-end]:hawa-slide-out-to-right-52 data-[motion=to-start]:hawa-slide-out-to-left-52",
|
286
|
+
className
|
287
|
+
),
|
288
|
+
...props
|
289
|
+
}
|
290
|
+
));
|
291
|
+
var StandardNavigationMenuItem = ({ icon, title, subtitle, ...linkProps }) => /* @__PURE__ */ React5.createElement(NavigationMenuLink, { ...linkProps }, /* @__PURE__ */ React5.createElement("div", { className: "hawa-flex hawa-max-w-md hawa-cursor-pointer hawa-flex-row hawa-items-center hawa-gap-4 hawa-rounded-inner hawa-p-4 hawa-py-2 hawa-transition-all hover:hawa-bg-muted" }, icon && icon, /* @__PURE__ */ React5.createElement("div", { className: "hawa-flex hawa-flex-col" }, /* @__PURE__ */ React5.createElement("h1", { className: "hawa-text-xl hawa-font-bold" }, title), /* @__PURE__ */ React5.createElement("p", { className: "hawa-text-sm" }, subtitle))));
|
292
|
+
var NavigationMenuViewport = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React5.createElement(
|
293
|
+
"div",
|
294
|
+
{
|
295
|
+
className: cn(
|
296
|
+
"hawa-absolute hawa-top-full hawa-flex hawa-w-full hawa-justify-center"
|
297
|
+
)
|
298
|
+
},
|
299
|
+
/* @__PURE__ */ React5.createElement(
|
300
|
+
NavigationMenuPrimitive.Viewport,
|
301
|
+
{
|
302
|
+
className: cn(
|
303
|
+
"hawa-origin-top-center hawa-relative hawa-mt-1.5 hawa-w-full hawa-overflow-hidden hawa-rounded-md hawa-border hawa-bg-popover hawa-text-popover-foreground hawa-shadow-lg data-[state=open]:hawa-animate-in data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-zoom-out-95 data-[state=open]:hawa-zoom-in-90 ",
|
304
|
+
// hawa-h-[var(--radix-navigation-menu-viewport-height)]
|
305
|
+
// "md:hawa-w-[var(--radix-navigation-menu-viewport-width)]",
|
306
|
+
className
|
307
|
+
),
|
308
|
+
style: {
|
309
|
+
height: "calc(var(--radix-navigation-menu-viewport-height) + 1px)"
|
310
|
+
},
|
311
|
+
ref,
|
312
|
+
...props
|
313
|
+
}
|
314
|
+
)
|
315
|
+
));
|
316
|
+
var NavigationMenuIndicator = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React5.createElement(
|
317
|
+
NavigationMenuPrimitive.Indicator,
|
318
|
+
{
|
319
|
+
ref,
|
320
|
+
className: cn(
|
321
|
+
"hawa-top-full hawa-z-[1] hawa-flex hawa-h-1.5 hawa-items-end hawa-justify-center hawa-overflow-hidden data-[state=visible]:hawa-animate-in data-[state=hidden]:hawa-animate-out data-[state=hidden]:hawa-fade-out data-[state=visible]:hawa-fade-in",
|
322
|
+
className
|
323
|
+
),
|
324
|
+
...props
|
325
|
+
},
|
326
|
+
/* @__PURE__ */ React5.createElement("div", { className: "hawa-relative hawa-top-[60%] hawa-h-2 hawa-w-2 hawa-rotate-45 hawa-rounded-tl-sm hawa-bg-border hawa-shadow-md" })
|
327
|
+
));
|
328
|
+
var NavigationMenu = ({
|
329
|
+
viewportClassNames,
|
330
|
+
rootClassNames,
|
331
|
+
triggerClassNames,
|
332
|
+
actionFirst,
|
333
|
+
...props
|
334
|
+
}) => {
|
335
|
+
return /* @__PURE__ */ React5.createElement(
|
336
|
+
NavigationMenuRoot,
|
337
|
+
{
|
338
|
+
dir: props.direction,
|
339
|
+
delayDuration: 0,
|
340
|
+
className: rootClassNames,
|
341
|
+
viewportClassNames
|
342
|
+
},
|
343
|
+
/* @__PURE__ */ React5.createElement(NavigationMenuList, null, props.items.map((item, i) => /* @__PURE__ */ React5.createElement(NavigationMenuItem, { key: i }, item.content ? /* @__PURE__ */ React5.createElement(React5.Fragment, null, /* @__PURE__ */ React5.createElement(NavigationMenuTrigger, { className: cn(triggerClassNames) }, item.trigger), /* @__PURE__ */ React5.createElement(NavigationMenuContent, null, item.content)) : /* @__PURE__ */ React5.createElement(
|
344
|
+
NavigationMenuLink,
|
345
|
+
{
|
346
|
+
href: actionFirst ? void 0 : item.path,
|
347
|
+
onClick: () => {
|
348
|
+
if (item.action) {
|
349
|
+
item.action();
|
350
|
+
}
|
351
|
+
},
|
352
|
+
className: cn(
|
353
|
+
navigationMenuTriggerStyle(),
|
354
|
+
"hawa-cursor-pointer hawa-select-none",
|
355
|
+
triggerClassNames
|
356
|
+
)
|
357
|
+
},
|
358
|
+
item.trigger
|
359
|
+
))))
|
360
|
+
);
|
361
|
+
};
|
362
|
+
var NavigationMenuItem = NavigationMenuPrimitive.Item;
|
363
|
+
var NavigationMenuLink = NavigationMenuPrimitive.Link;
|
364
|
+
NavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName;
|
365
|
+
NavigationMenuTrigger.displayName = NavigationMenuPrimitive.Trigger.displayName;
|
366
|
+
NavigationMenuList.displayName = NavigationMenuPrimitive.List.displayName;
|
367
|
+
NavigationMenuRoot.displayName = NavigationMenuPrimitive.Root.displayName;
|
368
|
+
NavigationMenuIndicator.displayName = NavigationMenuPrimitive.Indicator.displayName;
|
369
|
+
NavigationMenuViewport.displayName = NavigationMenuPrimitive.Viewport.displayName;
|
370
|
+
|
371
|
+
// elements/dialog/Dialog.tsx
|
372
|
+
import * as React6 from "react";
|
373
|
+
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
374
|
+
var Dialog = DialogPrimitive.Root;
|
375
|
+
var DialogTrigger = DialogPrimitive.Trigger;
|
376
|
+
var DialogPortal = ({ ...props }) => /* @__PURE__ */ React6.createElement(DialogPrimitive.Portal, { ...props });
|
377
|
+
var DialogOverlay = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React6.createElement(
|
378
|
+
DialogPrimitive.Overlay,
|
379
|
+
{
|
380
|
+
ref,
|
381
|
+
className: cn(
|
382
|
+
"hawa-fixed hawa-inset-0 hawa-z-50 hawa-bg-background/80 hawa-backdrop-blur-sm data-[state=open]:hawa-animate-in data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=open]:hawa-fade-in-0",
|
383
|
+
className
|
384
|
+
),
|
385
|
+
...props
|
386
|
+
}
|
387
|
+
));
|
388
|
+
var DialogContent = React6.forwardRef(({ className, children, persist, hideCloseButton, ...props }, ref) => /* @__PURE__ */ React6.createElement(DialogPortal, null, /* @__PURE__ */ React6.createElement(DialogOverlay, null), /* @__PURE__ */ React6.createElement(
|
389
|
+
DialogPrimitive.Content,
|
390
|
+
{
|
391
|
+
onPointerDownOutside: (e) => {
|
392
|
+
if (persist) {
|
393
|
+
e.preventDefault();
|
394
|
+
}
|
395
|
+
},
|
396
|
+
ref,
|
397
|
+
className: cn(
|
398
|
+
"hawa-fixed hawa-left-[50%] hawa-top-[50%] hawa-z-50 hawa-grid hawa-w-full hawa-max-w-lg hawa-translate-x-[-50%] hawa-translate-y-[-50%] hawa-gap-4 hawa-border hawa-bg-background hawa-p-6 hawa-shadow-lg hawa-transition-all hawa-duration-200 data-[state=open]:hawa-animate-in data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=open]:hawa-fade-in-0 data-[state=closed]:hawa-zoom-out-95 data-[state=open]:hawa-zoom-in-95 data-[state=closed]:hawa-slide-out-to-left-1/2 data-[state=closed]:hawa-slide-out-to-top-[48%] data-[state=open]:hawa-slide-in-from-left-1/2 data-[state=open]:hawa-slide-in-from-top-[48%] sm:hawa-rounded md:hawa-w-full",
|
399
|
+
className
|
400
|
+
),
|
401
|
+
...props
|
402
|
+
},
|
403
|
+
children,
|
404
|
+
!hideCloseButton && /* @__PURE__ */ React6.createElement(
|
405
|
+
DialogPrimitive.Close,
|
406
|
+
{
|
407
|
+
className: cn(
|
408
|
+
"hawa-absolute hawa-top-4 hawa-rounded hawa-opacity-70 hawa-ring-offset-background hawa-transition-opacity hover:hawa-opacity-100 focus:hawa-outline-none focus:hawa-ring-2 focus:hawa-ring-ring focus:hawa-ring-offset-2 disabled:hawa-pointer-events-none data-[state=open]:hawa-bg-accent data-[state=open]:hawa-text-muted-foreground",
|
409
|
+
props.dir === "rtl" ? " hawa-left-4" : " hawa-right-4"
|
410
|
+
)
|
411
|
+
},
|
412
|
+
/* @__PURE__ */ React6.createElement(
|
413
|
+
"svg",
|
414
|
+
{
|
415
|
+
"aria-label": "Close Icon",
|
416
|
+
"aria-hidden": "true",
|
417
|
+
className: "hawa-h-5 hawa-w-5",
|
418
|
+
fill: "currentColor",
|
419
|
+
viewBox: "0 0 20 20"
|
420
|
+
},
|
421
|
+
/* @__PURE__ */ React6.createElement(
|
422
|
+
"path",
|
423
|
+
{
|
424
|
+
fillRule: "evenodd",
|
425
|
+
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",
|
426
|
+
clipRule: "evenodd"
|
427
|
+
}
|
428
|
+
)
|
429
|
+
),
|
430
|
+
/* @__PURE__ */ React6.createElement("span", { className: "hawa-sr-only" }, "Close")
|
431
|
+
)
|
432
|
+
)));
|
433
|
+
var DialogCarouselContent = React6.forwardRef(
|
434
|
+
({
|
435
|
+
className,
|
436
|
+
children,
|
437
|
+
onPrev,
|
438
|
+
persist,
|
439
|
+
hideCloseButton,
|
440
|
+
hidePrevButton,
|
441
|
+
...props
|
442
|
+
}, ref) => /* @__PURE__ */ React6.createElement(DialogPortal, null, /* @__PURE__ */ React6.createElement(DialogOverlay, null), /* @__PURE__ */ React6.createElement(
|
443
|
+
DialogPrimitive.Content,
|
444
|
+
{
|
445
|
+
onPointerDownOutside: (e) => {
|
446
|
+
if (persist) {
|
447
|
+
e.preventDefault();
|
448
|
+
}
|
449
|
+
},
|
450
|
+
ref,
|
451
|
+
className: cn(
|
452
|
+
"hawa-fixed hawa-left-[50%] hawa-top-[50%] hawa-z-50 hawa-grid hawa-w-full hawa-max-w-lg hawa-translate-x-[-50%] hawa-translate-y-[-50%] hawa-gap-4 hawa-border hawa-bg-background hawa-p-6 hawa-pt-14 hawa-shadow-lg hawa-transition-all hawa-duration-200 data-[state=open]:hawa-animate-in data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=open]:hawa-fade-in-0 data-[state=closed]:hawa-zoom-out-95 data-[state=open]:hawa-zoom-in-95 data-[state=closed]:hawa-slide-out-to-left-1/2 data-[state=closed]:hawa-slide-out-to-top-[48%] data-[state=open]:hawa-slide-in-from-left-1/2 data-[state=open]:hawa-slide-in-from-top-[48%] sm:hawa-rounded md:hawa-w-full",
|
453
|
+
className
|
454
|
+
),
|
455
|
+
...props
|
456
|
+
},
|
457
|
+
children,
|
458
|
+
/* @__PURE__ */ React6.createElement(
|
459
|
+
"div",
|
460
|
+
{
|
461
|
+
className: cn(
|
462
|
+
"hawa-absolute hawa-top-0 hawa-flex hawa-w-full hawa-flex-row hawa-p-4",
|
463
|
+
onPrev ? "hawa-justify-between" : "hawa-justify-end"
|
464
|
+
)
|
465
|
+
},
|
466
|
+
hidePrevButton ? /* @__PURE__ */ React6.createElement("div", null) : /* @__PURE__ */ React6.createElement(
|
467
|
+
"div",
|
468
|
+
{
|
469
|
+
onClick: onPrev,
|
470
|
+
className: cn(
|
471
|
+
"hawa-end-0 hawa-cursor-pointer hawa-rounded hawa-opacity-70 hawa-ring-offset-background hawa-transition-opacity hover:hawa-opacity-100 focus:hawa-outline-none focus:hawa-ring-2 focus:hawa-ring-ring focus:hawa-ring-offset-2 disabled:hawa-pointer-events-none data-[state=open]:hawa-bg-accent data-[state=open]:hawa-text-muted-foreground",
|
472
|
+
props.dir === "rtl" && "hawa-rotate-180"
|
473
|
+
)
|
474
|
+
},
|
475
|
+
/* @__PURE__ */ React6.createElement(
|
476
|
+
"svg",
|
477
|
+
{
|
478
|
+
xmlns: "http://www.w3.org/2000/svg",
|
479
|
+
width: "24",
|
480
|
+
height: "24",
|
481
|
+
viewBox: "0 0 24 24",
|
482
|
+
fill: "none",
|
483
|
+
className: "hawa-h-6 hawa-w-6",
|
484
|
+
stroke: "currentColor",
|
485
|
+
strokeWidth: "2",
|
486
|
+
strokeLinecap: "round",
|
487
|
+
strokeLinejoin: "round"
|
488
|
+
},
|
489
|
+
/* @__PURE__ */ React6.createElement("path", { d: "m15 18-6-6 6-6" })
|
490
|
+
)
|
491
|
+
),
|
492
|
+
!hideCloseButton && /* @__PURE__ */ React6.createElement(
|
493
|
+
DialogPrimitive.Close,
|
494
|
+
{
|
495
|
+
className: cn(
|
496
|
+
"hawa-end-0 hawa-rounded hawa-opacity-70 hawa-ring-offset-background hawa-transition-opacity hover:hawa-opacity-100 focus:hawa-outline-none focus:hawa-ring-2 focus:hawa-ring-ring focus:hawa-ring-offset-2 disabled:hawa-pointer-events-none data-[state=open]:hawa-bg-accent data-[state=open]:hawa-text-muted-foreground ",
|
497
|
+
props.dir === "rtl" ? " hawa-left-4" : " hawa-right-4"
|
498
|
+
)
|
499
|
+
},
|
500
|
+
/* @__PURE__ */ React6.createElement(
|
501
|
+
"svg",
|
502
|
+
{
|
503
|
+
"aria-label": "Close Icon",
|
504
|
+
"aria-hidden": "true",
|
505
|
+
className: "hawa-h-6 hawa-w-6",
|
506
|
+
fill: "currentColor",
|
507
|
+
viewBox: "0 0 20 20"
|
508
|
+
},
|
509
|
+
/* @__PURE__ */ React6.createElement(
|
510
|
+
"path",
|
511
|
+
{
|
512
|
+
fillRule: "evenodd",
|
513
|
+
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",
|
514
|
+
clipRule: "evenodd"
|
515
|
+
}
|
516
|
+
)
|
517
|
+
),
|
518
|
+
/* @__PURE__ */ React6.createElement("span", { className: "hawa-sr-only" }, "Close")
|
519
|
+
)
|
520
|
+
)
|
521
|
+
))
|
522
|
+
);
|
523
|
+
var DialogHeader = ({
|
524
|
+
className,
|
525
|
+
...props
|
526
|
+
}) => /* @__PURE__ */ React6.createElement(
|
527
|
+
"div",
|
528
|
+
{
|
529
|
+
className: cn(
|
530
|
+
"hawa-flex hawa-flex-col hawa-space-y-1.5 hawa-text-center sm:hawa-text-left",
|
531
|
+
className
|
532
|
+
),
|
533
|
+
...props
|
534
|
+
}
|
535
|
+
);
|
536
|
+
var DialogTitle = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React6.createElement(
|
537
|
+
DialogPrimitive.Title,
|
538
|
+
{
|
539
|
+
ref,
|
540
|
+
className: cn(
|
541
|
+
"hawa-text-start hawa-text-lg hawa-font-semibold hawa-leading-none hawa-tracking-tight",
|
542
|
+
className
|
543
|
+
),
|
544
|
+
...props
|
545
|
+
}
|
546
|
+
));
|
547
|
+
var DialogDescription = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React6.createElement(
|
548
|
+
DialogPrimitive.Description,
|
549
|
+
{
|
550
|
+
ref,
|
551
|
+
className: cn(
|
552
|
+
"hawa-text-start hawa-text-sm hawa-text-muted-foreground",
|
553
|
+
className
|
554
|
+
),
|
555
|
+
...props
|
556
|
+
}
|
557
|
+
));
|
558
|
+
var DialogFooter = ({
|
559
|
+
className,
|
560
|
+
...props
|
561
|
+
}) => /* @__PURE__ */ React6.createElement(
|
562
|
+
"div",
|
563
|
+
{
|
564
|
+
className: cn(
|
565
|
+
"hawa-flex hawa-flex-col-reverse sm:hawa-flex-row sm:hawa-justify-end sm:hawa-gap-2",
|
566
|
+
className
|
567
|
+
),
|
568
|
+
...props
|
569
|
+
}
|
570
|
+
);
|
571
|
+
var DialogCarousel = ({
|
572
|
+
stepsApi,
|
573
|
+
stepsRef,
|
574
|
+
children,
|
575
|
+
direction
|
576
|
+
}) => {
|
577
|
+
React6.useEffect(() => {
|
578
|
+
if (stepsApi) {
|
579
|
+
stepsApi.reInit();
|
580
|
+
}
|
581
|
+
}, [stepsApi, children]);
|
582
|
+
return /* @__PURE__ */ React6.createElement("div", { className: "hawa-overflow-hidden" }, /* @__PURE__ */ React6.createElement("div", { ref: stepsRef, dir: direction }, /* @__PURE__ */ React6.createElement(
|
583
|
+
"div",
|
584
|
+
{
|
585
|
+
className: "hawa-flex",
|
586
|
+
style: {
|
587
|
+
transition: "height 0.2s"
|
588
|
+
}
|
589
|
+
},
|
590
|
+
React6.Children.map(children, (child, index) => /* @__PURE__ */ React6.createElement(
|
591
|
+
"div",
|
592
|
+
{
|
593
|
+
className: cn(
|
594
|
+
"hawa-flex hawa-h-fit hawa-flex-[0_0_100%] hawa-items-center hawa-justify-center"
|
595
|
+
),
|
596
|
+
key: index
|
597
|
+
},
|
598
|
+
child
|
599
|
+
))
|
600
|
+
)));
|
601
|
+
};
|
602
|
+
var DialogSteps = ({
|
603
|
+
currentStep,
|
604
|
+
visibleStepRef,
|
605
|
+
children
|
606
|
+
}) => {
|
607
|
+
const [dialogHeight, setDialogHeight] = React6.useState(null);
|
608
|
+
React6.useEffect(() => {
|
609
|
+
if (visibleStepRef.current) {
|
610
|
+
setDialogHeight(visibleStepRef.current.offsetHeight);
|
611
|
+
console.log("height is ", visibleStepRef.current.offsetHeight);
|
612
|
+
}
|
613
|
+
}, [currentStep, visibleStepRef]);
|
614
|
+
return /* @__PURE__ */ React6.createElement(
|
615
|
+
"div",
|
616
|
+
{
|
617
|
+
className: "hawa-relative hawa-overflow-clip",
|
618
|
+
style: {
|
619
|
+
height: dialogHeight || "fit-content",
|
620
|
+
transition: "height 0.2s"
|
621
|
+
}
|
622
|
+
},
|
623
|
+
React6.Children.map(children, (child, index) => /* @__PURE__ */ React6.createElement(
|
624
|
+
"div",
|
625
|
+
{
|
626
|
+
ref: currentStep === `step-${index + 1}` ? visibleStepRef : null,
|
627
|
+
className: cn(
|
628
|
+
currentStep === `step-${index + 1}` ? "hawa-visible hawa-block" : "hawa-invisible hawa-hidden"
|
629
|
+
)
|
630
|
+
},
|
631
|
+
child
|
632
|
+
))
|
633
|
+
);
|
634
|
+
};
|
635
|
+
var DialogStep = ({
|
636
|
+
id,
|
637
|
+
children,
|
638
|
+
className,
|
639
|
+
stepRef
|
640
|
+
}) => {
|
641
|
+
return /* @__PURE__ */ React6.createElement(
|
642
|
+
"div",
|
643
|
+
{
|
644
|
+
id,
|
645
|
+
ref: stepRef,
|
646
|
+
className: cn("hawa-w-full hawa-px-1", className)
|
647
|
+
},
|
648
|
+
children
|
649
|
+
);
|
650
|
+
};
|
651
|
+
var DialogBody = ({ children, className }) => {
|
652
|
+
return /* @__PURE__ */ React6.createElement("div", { className: cn("hawa-py-6", className) }, children);
|
653
|
+
};
|
654
|
+
DialogBody.displayName = "DialogBody";
|
655
|
+
DialogStep.displayName = "DialogStep";
|
656
|
+
DialogSteps.displayName = "DialogSteps";
|
657
|
+
DialogCarousel.displayName = "DialogCarousel";
|
658
|
+
DialogCarouselContent.displayName = "DialogCarouselContent";
|
659
|
+
DialogHeader.displayName = "DialogHeader";
|
660
|
+
DialogFooter.displayName = "DialogFooter";
|
661
|
+
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
662
|
+
DialogPortal.displayName = DialogPrimitive.Portal.displayName;
|
663
|
+
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
664
|
+
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
665
|
+
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
666
|
+
|
667
|
+
// elements/avatar/Avatar.tsx
|
668
|
+
import React8 from "react";
|
669
|
+
|
670
|
+
// elements/fileUploader/FileUploader.tsx
|
671
|
+
import React7, { useRef } from "react";
|
672
|
+
var FileUploader = ({ handleFile, className }) => {
|
673
|
+
const hiddenFileInput = useRef(null);
|
674
|
+
const handleClick = () => {
|
675
|
+
var _a;
|
676
|
+
(_a = hiddenFileInput.current) == null ? void 0 : _a.click();
|
677
|
+
};
|
678
|
+
const handleChange = (event) => {
|
679
|
+
const fileUploaded = event.target.files[0];
|
680
|
+
handleFile(fileUploaded);
|
681
|
+
};
|
682
|
+
return /* @__PURE__ */ React7.createElement("div", { className }, /* @__PURE__ */ React7.createElement("div", { className: "hawa-h-full hawa-w-full", onClick: handleClick }), /* @__PURE__ */ React7.createElement(
|
683
|
+
"input",
|
684
|
+
{
|
685
|
+
type: "file",
|
686
|
+
onChange: handleChange,
|
687
|
+
ref: hiddenFileInput,
|
688
|
+
style: { display: "none" }
|
689
|
+
}
|
690
|
+
));
|
691
|
+
};
|
692
|
+
|
693
|
+
// elements/avatar/Avatar.tsx
|
694
|
+
var Avatar = ({
|
695
|
+
isUploadable,
|
696
|
+
src,
|
697
|
+
alt,
|
698
|
+
size = "default",
|
699
|
+
radius = "inherit",
|
700
|
+
icon,
|
701
|
+
className,
|
702
|
+
...props
|
703
|
+
}) => {
|
704
|
+
let sizeStyles2 = {
|
705
|
+
"2xs": "hawa-h-4 hawa-w-4",
|
706
|
+
xs: "hawa-h-6 hawa-w-6",
|
707
|
+
sm: "hawa-h-8 hawa-w-8",
|
708
|
+
default: "hawa-h-10 hawa-w-10",
|
709
|
+
lg: "hawa-h-12 hawa-w-12",
|
710
|
+
xl: "hawa-h-14 hawa-w-14",
|
711
|
+
"2xl": "hawa-h-16 hawa-w-16",
|
712
|
+
"3xl": "hawa-h-[72px] hawa-w-[72px]",
|
713
|
+
"4xl": "hawa-h-20 hawa-w-20",
|
714
|
+
"5xl": "hawa-h-[88px] hawa-w-[88px]",
|
715
|
+
"6xl": "hawa-h-24 hawa-w-24"
|
716
|
+
};
|
717
|
+
let radiusStyles = {
|
718
|
+
full: "hawa-rounded-full",
|
719
|
+
inherit: "hawa-rounded",
|
720
|
+
none: "hawa-rounded-none"
|
721
|
+
};
|
722
|
+
return /* @__PURE__ */ React8.createElement(
|
723
|
+
"div",
|
724
|
+
{
|
725
|
+
className: cn(
|
726
|
+
"hawa-relative hawa-bg-card hawa-p-0",
|
727
|
+
sizeStyles2[size],
|
728
|
+
radiusStyles[radius],
|
729
|
+
className
|
730
|
+
)
|
731
|
+
},
|
732
|
+
/* @__PURE__ */ React8.createElement(
|
733
|
+
FileUploader,
|
734
|
+
{
|
735
|
+
className: cn(
|
736
|
+
"hawa-absolute hawa-left-0 hawa-top-0 hawa-w-full hawa-cursor-pointer hawa-bg-red-400 hawa-opacity-0",
|
737
|
+
sizeStyles2[size],
|
738
|
+
radiusStyles[radius],
|
739
|
+
(!isUploadable || !!src) && "hawa-hidden"
|
740
|
+
)
|
741
|
+
}
|
742
|
+
),
|
743
|
+
/* @__PURE__ */ React8.createElement(
|
744
|
+
"img",
|
745
|
+
{
|
746
|
+
className: cn(
|
747
|
+
"hawa-blue-400 hawa-object-cover",
|
748
|
+
sizeStyles2[size],
|
749
|
+
radiusStyles[radius],
|
750
|
+
!src && "hawa-hidden"
|
751
|
+
),
|
752
|
+
src,
|
753
|
+
alt
|
754
|
+
}
|
755
|
+
),
|
756
|
+
!src && !isUploadable && /* @__PURE__ */ React8.createElement(
|
757
|
+
"div",
|
758
|
+
{
|
759
|
+
className: cn(
|
760
|
+
sizeStyles2[size],
|
761
|
+
"hawa-flex hawa-flex-col hawa-items-center hawa-justify-center"
|
762
|
+
)
|
763
|
+
},
|
764
|
+
icon ? icon : /* @__PURE__ */ React8.createElement(
|
765
|
+
"svg",
|
766
|
+
{
|
767
|
+
xmlns: "http://www.w3.org/2000/svg",
|
768
|
+
style: { width: "50%", opacity: 0.35 },
|
769
|
+
viewBox: "0 0 24 24",
|
770
|
+
fill: "none",
|
771
|
+
stroke: "currentColor",
|
772
|
+
strokeWidth: "2",
|
773
|
+
strokeLinecap: "round",
|
774
|
+
strokeLinejoin: "round"
|
775
|
+
},
|
776
|
+
/* @__PURE__ */ React8.createElement("circle", { cx: "12", cy: "8", r: "5" }),
|
777
|
+
/* @__PURE__ */ React8.createElement("path", { d: "M20 21a8 8 0 1 0-16 0" })
|
778
|
+
)
|
779
|
+
)
|
780
|
+
);
|
781
|
+
};
|
782
|
+
|
783
|
+
// elements/dataTable/DataTable.tsx
|
784
|
+
import * as React10 from "react";
|
785
|
+
import {
|
786
|
+
flexRender,
|
787
|
+
getCoreRowModel,
|
788
|
+
getFilteredRowModel,
|
789
|
+
getPaginationRowModel,
|
790
|
+
getExpandedRowModel,
|
791
|
+
getSortedRowModel,
|
792
|
+
useReactTable
|
793
|
+
} from "@tanstack/react-table";
|
794
|
+
|
795
|
+
// elements/table/Table.tsx
|
796
|
+
import * as React9 from "react";
|
797
|
+
var Table = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React9.createElement("div", { className: "hawa-relative hawa-w-full hawa-overflow-auto hawa-rounded hawa-border" }, /* @__PURE__ */ React9.createElement(
|
798
|
+
"table",
|
799
|
+
{
|
800
|
+
ref,
|
801
|
+
className: cn("hawa-w-full hawa-caption-bottom hawa-text-sm", className),
|
802
|
+
...props
|
803
|
+
}
|
804
|
+
)));
|
805
|
+
Table.displayName = "Table";
|
806
|
+
var TableHeader = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React9.createElement(
|
807
|
+
"thead",
|
808
|
+
{
|
809
|
+
ref,
|
810
|
+
className: cn("[&_tr]:hawa-border-b", "hawa-bg-muted/50", className),
|
811
|
+
...props
|
812
|
+
}
|
813
|
+
));
|
814
|
+
TableHeader.displayName = "TableHeader";
|
815
|
+
var TableHead = React9.forwardRef(
|
816
|
+
({ className, condensed, clickable, dir, ...props }, ref) => /* @__PURE__ */ React9.createElement(
|
817
|
+
"th",
|
818
|
+
{
|
819
|
+
ref,
|
820
|
+
className: cn(
|
821
|
+
"hawa-bg-muted/60 hawa-text-start hawa-align-middle hawa-font-medium hawa-text-muted-foreground dark:hawa-bg-muted/40 [&:has([role=checkbox])]:hawa-pr-0 [&:not(:last-child)&:not(:first-child)]:hawa-border-x",
|
822
|
+
dir === "rtl" ? "[&:not(:last-child)]:hawa-border-l" : "[&:not(:last-child)]:hawa-border-r",
|
823
|
+
condensed ? "hawa-h-8" : "hawa-h-12",
|
824
|
+
clickable ? "hawa-px-1" : "hawa-px-4",
|
825
|
+
//First and last columns
|
826
|
+
clickable ? " [&:not(:last-child)&:not(:first-child)]:hawa-p-1" : "hawa-px-4",
|
827
|
+
//Columns in between
|
828
|
+
className
|
829
|
+
),
|
830
|
+
...props
|
831
|
+
}
|
832
|
+
)
|
833
|
+
);
|
834
|
+
TableHead.displayName = "TableHead";
|
835
|
+
var TableBody = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React9.createElement("tbody", { ref, className: cn("hawa-border-none", className), ...props }));
|
836
|
+
TableBody.displayName = "TableBody";
|
837
|
+
var TableFooter = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React9.createElement(
|
838
|
+
"tfoot",
|
839
|
+
{
|
840
|
+
ref,
|
841
|
+
className: cn(
|
842
|
+
"hawa-bg-primary hawa-font-medium hawa-text-primary-foreground",
|
843
|
+
className
|
844
|
+
),
|
845
|
+
...props
|
846
|
+
}
|
847
|
+
));
|
848
|
+
TableFooter.displayName = "TableFooter";
|
849
|
+
var TableRow = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React9.createElement(
|
850
|
+
"tr",
|
851
|
+
{
|
852
|
+
ref,
|
853
|
+
className: cn(
|
854
|
+
"hawa-bg-background hawa-transition-colors data-[state=selected]:hawa-bg-muted",
|
855
|
+
"[&:not(:last-child)&:not(:first-child)]:hawa-border-y",
|
856
|
+
"[&:not(:last-child)]:hawa-border-b",
|
857
|
+
className
|
858
|
+
),
|
859
|
+
...props
|
860
|
+
}
|
861
|
+
));
|
862
|
+
TableRow.displayName = "TableRow";
|
863
|
+
var TableCell = React9.forwardRef(
|
864
|
+
({ className, enablePadding = true, padding = "default", ...props }, ref) => {
|
865
|
+
let paddingStyles = {
|
866
|
+
condensed: "hawa-p-0 hawa-px-4",
|
867
|
+
default: "hawa-p-4",
|
868
|
+
noPadding: "hawa-p-0"
|
869
|
+
};
|
870
|
+
return /* @__PURE__ */ React9.createElement(
|
871
|
+
"td",
|
872
|
+
{
|
873
|
+
ref,
|
874
|
+
className: cn(
|
875
|
+
paddingStyles[padding],
|
876
|
+
// "border-x",
|
877
|
+
// enablePadding ? "hawa-p-4" : "hawa-p-0",
|
878
|
+
// props.disablePadding ? "hawa-p-0" : "hawa-p-4",
|
879
|
+
// props.condensed ? "hawa-p-0 hawa-px-4" : "hawa-p-4",
|
880
|
+
"hawa-align-middle [&:has([role=checkbox])]:hawa-pr-0 ",
|
881
|
+
"[&:not(:last-child)&:not(:first-child)]:hawa-border-x",
|
882
|
+
// "[&:not(:last-child)]:hawa-border-r",
|
883
|
+
props.dir === "rtl" ? "[&:not(:last-child)]:hawa-border-l" : "[&:not(:last-child)]:hawa-border-r",
|
884
|
+
className
|
885
|
+
),
|
886
|
+
...props
|
887
|
+
}
|
888
|
+
);
|
889
|
+
}
|
890
|
+
);
|
891
|
+
TableCell.displayName = "TableCell";
|
892
|
+
var TableCaption = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React9.createElement(
|
893
|
+
"caption",
|
894
|
+
{
|
895
|
+
ref,
|
896
|
+
className: cn(
|
897
|
+
"hawa-mt-4 hawa-text-sm hawa-text-muted-foreground",
|
898
|
+
className
|
899
|
+
),
|
900
|
+
...props
|
901
|
+
}
|
902
|
+
));
|
903
|
+
TableCaption.displayName = "TableCaption";
|
904
|
+
|
905
|
+
// elements/dataTable/DataTable.tsx
|
906
|
+
var DataTable = ({
|
907
|
+
columns,
|
908
|
+
data,
|
909
|
+
paginationPosition = "bottom",
|
910
|
+
translateFn,
|
911
|
+
enableHideColumns,
|
912
|
+
enableSearch,
|
913
|
+
enableGoTo,
|
914
|
+
...props
|
915
|
+
}) => {
|
916
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
917
|
+
const [sorting, setSorting] = React10.useState(
|
918
|
+
props.defaultSort ? [{ id: props.defaultSort, desc: false }] : []
|
919
|
+
);
|
920
|
+
const [columnFilters, setColumnFilters] = React10.useState(
|
921
|
+
[]
|
922
|
+
);
|
923
|
+
const [globalFilter, setGlobalFilter] = React10.useState("");
|
924
|
+
const [expanded, setExpanded] = React10.useState({});
|
925
|
+
const [columnVisibility, setColumnVisibility] = React10.useState({});
|
926
|
+
const [rowSelection, setRowSelection] = React10.useState({});
|
927
|
+
const visibleColumns = columns.filter(
|
928
|
+
(column) => {
|
929
|
+
var _a2;
|
930
|
+
return ((_a2 = column.meta) == null ? void 0 : _a2.hidden) !== true;
|
931
|
+
}
|
932
|
+
);
|
933
|
+
const table = useReactTable({
|
934
|
+
data,
|
935
|
+
columns: visibleColumns,
|
936
|
+
onExpandedChange: setExpanded,
|
937
|
+
getExpandedRowModel: getExpandedRowModel(),
|
938
|
+
onGlobalFilterChange: setGlobalFilter,
|
939
|
+
onSortingChange: setSorting,
|
940
|
+
onColumnFiltersChange: setColumnFilters,
|
941
|
+
getCoreRowModel: getCoreRowModel(),
|
942
|
+
getPaginationRowModel: getPaginationRowModel(),
|
943
|
+
getSortedRowModel: getSortedRowModel(),
|
944
|
+
getFilteredRowModel: getFilteredRowModel(),
|
945
|
+
onColumnVisibilityChange: setColumnVisibility,
|
946
|
+
onRowSelectionChange: setRowSelection,
|
947
|
+
state: {
|
948
|
+
sorting,
|
949
|
+
columnFilters,
|
950
|
+
columnVisibility,
|
951
|
+
globalFilter,
|
952
|
+
rowSelection,
|
953
|
+
expanded
|
954
|
+
}
|
955
|
+
});
|
956
|
+
const pageText = ((_a = props.texts) == null ? void 0 : _a.page) || "page";
|
957
|
+
const itemsPerPageOptions = (_b = props.itemsPerPage) == null ? void 0 : _b.map((item) => ({
|
958
|
+
label: `${item} / ${pageText}`,
|
959
|
+
value: item
|
960
|
+
}));
|
961
|
+
return /* @__PURE__ */ React10.createElement("div", { className: "hawa-flex hawa-w-full hawa-flex-col hawa-gap-4" }, (enableSearch || enableHideColumns) && /* @__PURE__ */ React10.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-gap-4" }, enableSearch && /* @__PURE__ */ React10.createElement(
|
962
|
+
Input,
|
963
|
+
{
|
964
|
+
forceHideHelperText: true,
|
965
|
+
placeholder: (_c = props.texts) == null ? void 0 : _c.searchPlaceholder,
|
966
|
+
value: globalFilter != null ? globalFilter : "",
|
967
|
+
onChange: (event) => setGlobalFilter(event.target.value),
|
968
|
+
margin: "none",
|
969
|
+
className: "hawa-w-full md:hawa-max-w-sm"
|
970
|
+
}
|
971
|
+
), enableHideColumns && /* @__PURE__ */ React10.createElement(DropdownMenuRoot, null, /* @__PURE__ */ React10.createElement(DropdownMenuTrigger, { asChild: true }, /* @__PURE__ */ React10.createElement(
|
972
|
+
Button,
|
973
|
+
{
|
974
|
+
variant: "outline",
|
975
|
+
className: "hawa-flex hawa-flex-row hawa-gap-2"
|
976
|
+
},
|
977
|
+
((_d = props.texts) == null ? void 0 : _d.columns) || "Columns",
|
978
|
+
/* @__PURE__ */ React10.createElement(
|
979
|
+
"svg",
|
980
|
+
{
|
981
|
+
"aria-label": "Chevron Down Icon",
|
982
|
+
xmlns: "http://www.w3.org/2000/svg",
|
983
|
+
width: "24",
|
984
|
+
height: "24",
|
985
|
+
viewBox: "0 0 24 24",
|
986
|
+
fill: "none",
|
987
|
+
stroke: "currentColor",
|
988
|
+
strokeWidth: "2",
|
989
|
+
strokeLinecap: "round",
|
990
|
+
strokeLinejoin: "round",
|
991
|
+
className: "hawa-icon hawa-rotate-90"
|
992
|
+
},
|
993
|
+
/* @__PURE__ */ React10.createElement("path", { d: "m9 18 6-6-6-6" })
|
994
|
+
)
|
995
|
+
)), /* @__PURE__ */ React10.createElement(
|
996
|
+
DropdownMenuContent,
|
997
|
+
{
|
998
|
+
align: props.direction === "rtl" ? "start" : "end"
|
999
|
+
},
|
1000
|
+
table.getAllColumns().filter((column) => column.getCanHide()).map((column) => {
|
1001
|
+
return /* @__PURE__ */ React10.createElement(
|
1002
|
+
DropdownMenuCheckboxItem,
|
1003
|
+
{
|
1004
|
+
key: column.id,
|
1005
|
+
checked: column.getIsVisible(),
|
1006
|
+
onCheckedChange: (value) => column.toggleVisibility(!!value)
|
1007
|
+
},
|
1008
|
+
translateFn ? translateFn(column.id) : column.id
|
1009
|
+
);
|
1010
|
+
})
|
1011
|
+
))), props.isLoading ? /* @__PURE__ */ React10.createElement(Skeleton, { className: "hawa-h-[130px] hawa-w-full" }) : /* @__PURE__ */ React10.createElement(
|
1012
|
+
"div",
|
1013
|
+
{
|
1014
|
+
className: cn(
|
1015
|
+
"hawa-flex hawa-w-full hawa-gap-4",
|
1016
|
+
paginationPosition === "top" ? "hawa-flex-col-reverse" : "hawa-flex-col"
|
1017
|
+
)
|
1018
|
+
},
|
1019
|
+
/* @__PURE__ */ React10.createElement("div", { className: "hawa-rounded-md" }, /* @__PURE__ */ React10.createElement(Table, null, table.getAllColumns().length > 0 && /* @__PURE__ */ React10.createElement(TableHeader, null, table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ React10.createElement(TableRow, { key: headerGroup.id }, headerGroup.headers.map((header) => {
|
1020
|
+
var _a2;
|
1021
|
+
let isSortable = (_a2 = header.column.columnDef.meta) == null ? void 0 : _a2.sortable;
|
1022
|
+
return /* @__PURE__ */ React10.createElement(
|
1023
|
+
TableHead,
|
1024
|
+
{
|
1025
|
+
dir: props.direction,
|
1026
|
+
condensed: props.condensed,
|
1027
|
+
clickable: Boolean(isSortable),
|
1028
|
+
key: header.id
|
1029
|
+
},
|
1030
|
+
header.isPlaceholder ? null : flexRender(
|
1031
|
+
header.column.columnDef.header,
|
1032
|
+
header.getContext()
|
1033
|
+
)
|
1034
|
+
);
|
1035
|
+
})))), /* @__PURE__ */ React10.createElement(TableBody, null, ((_e = table.getRowModel().rows) == null ? void 0 : _e.length) ? table.getRowModel().rows.map((row) => /* @__PURE__ */ React10.createElement(
|
1036
|
+
TableRow,
|
1037
|
+
{
|
1038
|
+
key: row.id,
|
1039
|
+
"data-state": row.getIsSelected() && "selected"
|
1040
|
+
},
|
1041
|
+
row.getVisibleCells().map((cell) => {
|
1042
|
+
var _a2;
|
1043
|
+
return /* @__PURE__ */ React10.createElement(
|
1044
|
+
TableCell,
|
1045
|
+
{
|
1046
|
+
dir: props.direction,
|
1047
|
+
padding: props.condensed ? "condensed" : (_a2 = cell.column.columnDef.meta) == null ? void 0 : _a2.padding,
|
1048
|
+
key: cell.id
|
1049
|
+
},
|
1050
|
+
flexRender(
|
1051
|
+
cell.column.columnDef.cell,
|
1052
|
+
cell.getContext()
|
1053
|
+
)
|
1054
|
+
);
|
1055
|
+
})
|
1056
|
+
)) : /* @__PURE__ */ React10.createElement(TableRow, null, /* @__PURE__ */ React10.createElement(
|
1057
|
+
TableCell,
|
1058
|
+
{
|
1059
|
+
colSpan: columns.length,
|
1060
|
+
className: "hawa-h-24 hawa-text-center"
|
1061
|
+
},
|
1062
|
+
(_f = props.texts) == null ? void 0 : _f.noData
|
1063
|
+
))))),
|
1064
|
+
/* @__PURE__ */ React10.createElement("div", { className: "hawa-flex hawa-items-center hawa-justify-between" }, !props.showCount && /* @__PURE__ */ React10.createElement("div", { className: "hawa-flex hawa-w-fit hawa-flex-row hawa-items-center hawa-gap-2 hawa-text-sm hawa-text-muted-foreground" }), props.showCount && /* @__PURE__ */ React10.createElement(
|
1065
|
+
"div",
|
1066
|
+
{
|
1067
|
+
className: "text-muted-foreground text-sm",
|
1068
|
+
dir: props.direction
|
1069
|
+
},
|
1070
|
+
/* @__PURE__ */ React10.createElement("span", null, (_g = props.texts) == null ? void 0 : _g.total),
|
1071
|
+
" ",
|
1072
|
+
/* @__PURE__ */ React10.createElement("span", null, table.getFilteredRowModel().rows.length.toLocaleString())
|
1073
|
+
), /* @__PURE__ */ React10.createElement("div", { className: "hawa-flex hawa-w-fit hawa-flex-row hawa-items-center hawa-gap-2 " }, enableGoTo && /* @__PURE__ */ React10.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-justify-center hawa-gap-2" }, /* @__PURE__ */ React10.createElement("span", { className: "hawa-text-sm" }, (_h = props.texts) == null ? void 0 : _h.goTo), /* @__PURE__ */ React10.createElement(
|
1074
|
+
"input",
|
1075
|
+
{
|
1076
|
+
max: table.getPageCount(),
|
1077
|
+
min: 0,
|
1078
|
+
type: "number",
|
1079
|
+
defaultValue: table.getState().pagination.pageIndex + 1,
|
1080
|
+
onChange: (e) => {
|
1081
|
+
let page = Number(e.target.value) - 1;
|
1082
|
+
const max = table.getPageCount();
|
1083
|
+
if (!isNaN(page) && Number(page) > max) {
|
1084
|
+
page = max - 1;
|
1085
|
+
}
|
1086
|
+
table.setPageIndex(page);
|
1087
|
+
},
|
1088
|
+
className: "hawa-w-16 hawa-rounded hawa-border hawa-p-1 hawa-px-2 hawa-text-sm"
|
1089
|
+
}
|
1090
|
+
)), /* @__PURE__ */ React10.createElement(
|
1091
|
+
DropdownMenu,
|
1092
|
+
{
|
1093
|
+
size: "sm",
|
1094
|
+
width: "sm",
|
1095
|
+
direction: props.direction,
|
1096
|
+
items: itemsPerPageOptions || [
|
1097
|
+
{ label: `10 / ${pageText}`, value: 10 },
|
1098
|
+
{ label: `20 / ${pageText}`, value: 20 },
|
1099
|
+
{ label: `30 / ${pageText}`, value: 30 },
|
1100
|
+
{ label: `40 / ${pageText}`, value: 40 },
|
1101
|
+
{ label: `50 / ${pageText}`, value: 50 }
|
1102
|
+
],
|
1103
|
+
trigger: /* @__PURE__ */ React10.createElement(
|
1104
|
+
Button,
|
1105
|
+
{
|
1106
|
+
variant: "outline",
|
1107
|
+
size: "icon",
|
1108
|
+
className: "hawa-h-fit hawa-w-fit hawa-p-0 hawa-px-2 hawa-py-1 "
|
1109
|
+
},
|
1110
|
+
`${table.getState().pagination.pageSize} / ${(_i = props.texts) == null ? void 0 : _i.page}`
|
1111
|
+
),
|
1112
|
+
onItemSelect: (e) => table.setPageSize(Number(e))
|
1113
|
+
}
|
1114
|
+
), table.getPageCount() > 1 && /* @__PURE__ */ React10.createElement(React10.Fragment, null, /* @__PURE__ */ React10.createElement("div", { className: "hawa-flex hawa-w-fit hawa-flex-row hawa-items-center hawa-gap-2 hawa-text-sm " }, /* @__PURE__ */ React10.createElement("span", { className: "hawa-flex hawa-items-center hawa-gap-1" }, /* @__PURE__ */ React10.createElement("div", null, (_j = props.texts) == null ? void 0 : _j.page), /* @__PURE__ */ React10.createElement("div", { className: "hawa-flex hawa-flex-row hawa-gap-1" }, /* @__PURE__ */ React10.createElement("span", { className: "hawa-font-bold" }, table.getState().pagination.pageIndex + 1), /* @__PURE__ */ React10.createElement("span", null, (_k = props.texts) == null ? void 0 : _k.of), /* @__PURE__ */ React10.createElement("span", { className: "hawa-font-bold" }, table.getPageCount())))), /* @__PURE__ */ React10.createElement(
|
1115
|
+
Button,
|
1116
|
+
{
|
1117
|
+
"aria-label": "Next Table Page",
|
1118
|
+
variant: "outline",
|
1119
|
+
size: "smallIcon",
|
1120
|
+
onClick: () => table.setPageIndex(0),
|
1121
|
+
disabled: !table.getCanPreviousPage(),
|
1122
|
+
className: cn(
|
1123
|
+
props.direction === "rtl" && "hawa-rotate-180"
|
1124
|
+
)
|
1125
|
+
},
|
1126
|
+
/* @__PURE__ */ React10.createElement(
|
1127
|
+
"svg",
|
1128
|
+
{
|
1129
|
+
xmlns: "http://www.w3.org/2000/svg",
|
1130
|
+
width: "20",
|
1131
|
+
height: "20",
|
1132
|
+
viewBox: "0 0 24 24",
|
1133
|
+
fill: "none",
|
1134
|
+
stroke: "currentColor",
|
1135
|
+
strokeWidth: "2",
|
1136
|
+
strokeLinecap: "round",
|
1137
|
+
strokeLinejoin: "round"
|
1138
|
+
},
|
1139
|
+
/* @__PURE__ */ React10.createElement("path", { d: "m11 17-5-5 5-5" }),
|
1140
|
+
/* @__PURE__ */ React10.createElement("path", { d: "m18 17-5-5 5-5" })
|
1141
|
+
)
|
1142
|
+
), /* @__PURE__ */ React10.createElement(
|
1143
|
+
Button,
|
1144
|
+
{
|
1145
|
+
"aria-label": "Previous Table Page",
|
1146
|
+
variant: "outline",
|
1147
|
+
size: "smallIcon",
|
1148
|
+
onClick: () => table.previousPage(),
|
1149
|
+
disabled: !table.getCanPreviousPage(),
|
1150
|
+
className: cn(
|
1151
|
+
props.direction === "rtl" && "hawa-rotate-180"
|
1152
|
+
)
|
1153
|
+
},
|
1154
|
+
/* @__PURE__ */ React10.createElement(
|
1155
|
+
"svg",
|
1156
|
+
{
|
1157
|
+
xmlns: "http://www.w3.org/2000/svg",
|
1158
|
+
width: "20",
|
1159
|
+
height: "20",
|
1160
|
+
"aria-label": "Single Chevron Icon",
|
1161
|
+
viewBox: "0 0 24 24",
|
1162
|
+
fill: "none",
|
1163
|
+
stroke: "currentColor",
|
1164
|
+
strokeWidth: "2",
|
1165
|
+
strokeLinecap: "round",
|
1166
|
+
strokeLinejoin: "round"
|
1167
|
+
},
|
1168
|
+
/* @__PURE__ */ React10.createElement("path", { d: "m15 18-6-6 6-6" })
|
1169
|
+
)
|
1170
|
+
), /* @__PURE__ */ React10.createElement(
|
1171
|
+
Button,
|
1172
|
+
{
|
1173
|
+
"aria-label": "Next Table Page",
|
1174
|
+
variant: "outline",
|
1175
|
+
size: "smallIcon",
|
1176
|
+
onClick: () => table.nextPage(),
|
1177
|
+
disabled: !table.getCanNextPage(),
|
1178
|
+
className: cn(
|
1179
|
+
props.direction === "ltr" && "hawa-rotate-180"
|
1180
|
+
)
|
1181
|
+
},
|
1182
|
+
/* @__PURE__ */ React10.createElement(
|
1183
|
+
"svg",
|
1184
|
+
{
|
1185
|
+
xmlns: "http://www.w3.org/2000/svg",
|
1186
|
+
width: "20",
|
1187
|
+
height: "20",
|
1188
|
+
"aria-label": "Single Chevron Icon",
|
1189
|
+
viewBox: "0 0 24 24",
|
1190
|
+
fill: "none",
|
1191
|
+
stroke: "currentColor",
|
1192
|
+
strokeWidth: "2",
|
1193
|
+
strokeLinecap: "round",
|
1194
|
+
strokeLinejoin: "round"
|
1195
|
+
},
|
1196
|
+
/* @__PURE__ */ React10.createElement("path", { d: "m15 18-6-6 6-6" })
|
1197
|
+
)
|
1198
|
+
), /* @__PURE__ */ React10.createElement(
|
1199
|
+
Button,
|
1200
|
+
{
|
1201
|
+
"aria-label": "Next Table Page",
|
1202
|
+
variant: "outline",
|
1203
|
+
size: "smallIcon",
|
1204
|
+
onClick: () => table.setPageIndex(table.getPageCount() - 1),
|
1205
|
+
disabled: !table.getCanNextPage(),
|
1206
|
+
className: cn(
|
1207
|
+
props.direction === "ltr" && "hawa-rotate-180"
|
1208
|
+
)
|
1209
|
+
},
|
1210
|
+
/* @__PURE__ */ React10.createElement(
|
1211
|
+
"svg",
|
1212
|
+
{
|
1213
|
+
xmlns: "http://www.w3.org/2000/svg",
|
1214
|
+
width: "20",
|
1215
|
+
height: "20",
|
1216
|
+
viewBox: "0 0 24 24",
|
1217
|
+
fill: "none",
|
1218
|
+
stroke: "currentColor",
|
1219
|
+
strokeWidth: "2",
|
1220
|
+
strokeLinecap: "round",
|
1221
|
+
strokeLinejoin: "round"
|
1222
|
+
},
|
1223
|
+
/* @__PURE__ */ React10.createElement("path", { d: "m11 17-5-5 5-5" }),
|
1224
|
+
/* @__PURE__ */ React10.createElement("path", { d: "m18 17-5-5 5-5" })
|
1225
|
+
)
|
1226
|
+
))))
|
1227
|
+
));
|
1228
|
+
};
|
1229
|
+
|
1230
|
+
// elements/backToTop/BackToTop.tsx
|
1231
|
+
import React11, { useState as useState3, useEffect as useEffect2, useRef as useRef2 } from "react";
|
1232
|
+
var BackToTop = ({ ...props }) => {
|
1233
|
+
const [visible, setVisible] = useState3(false);
|
1234
|
+
const [rect, _setRect] = useState3(null);
|
1235
|
+
const self = useRef2(null);
|
1236
|
+
const _rect = useRef2(rect);
|
1237
|
+
const setRect = (data) => {
|
1238
|
+
_rect.current = data;
|
1239
|
+
_setRect(data);
|
1240
|
+
};
|
1241
|
+
const getCoords = () => {
|
1242
|
+
let anchor = props.anchor.current;
|
1243
|
+
if (anchor) {
|
1244
|
+
return [anchor.scrollTop, anchor.scrollLeft];
|
1245
|
+
}
|
1246
|
+
return [0, 0];
|
1247
|
+
};
|
1248
|
+
const onScroll = () => {
|
1249
|
+
var _a;
|
1250
|
+
let [scrollTop, scrollLeft] = getCoords();
|
1251
|
+
let rect2 = (_a = props.anchor.current) == null ? void 0 : _a.getBoundingClientRect();
|
1252
|
+
if (rect2) {
|
1253
|
+
setVisible(scrollTop >= rect2.height + (props.paddingThreshold || 100));
|
1254
|
+
}
|
1255
|
+
};
|
1256
|
+
const backToTop = () => {
|
1257
|
+
if (props.anchor.current) {
|
1258
|
+
props.anchor.current.scrollTo({ top: 0, behavior: "smooth" });
|
1259
|
+
}
|
1260
|
+
};
|
1261
|
+
useEffect2(() => {
|
1262
|
+
if (!props.anchor.current)
|
1263
|
+
return;
|
1264
|
+
props.anchor.current.addEventListener("scroll", onScroll);
|
1265
|
+
let interval = setInterval(() => {
|
1266
|
+
if (!props.anchor.current)
|
1267
|
+
return;
|
1268
|
+
let newRect = props.anchor.current.getBoundingClientRect();
|
1269
|
+
if (_rect.current == null)
|
1270
|
+
return setRect(newRect);
|
1271
|
+
if (!(_rect.current.top == newRect.top && _rect.current.left == newRect.left && _rect.current.width == newRect.width && _rect.current.height == newRect.height)) {
|
1272
|
+
setRect(newRect);
|
1273
|
+
}
|
1274
|
+
}, 1);
|
1275
|
+
return () => {
|
1276
|
+
var _a;
|
1277
|
+
(_a = props.anchor.current) == null ? void 0 : _a.removeEventListener("scroll", onScroll);
|
1278
|
+
clearInterval(interval);
|
1279
|
+
};
|
1280
|
+
}, [onScroll, props.anchor]);
|
1281
|
+
const getStyles = () => {
|
1282
|
+
var _a;
|
1283
|
+
if (!props.anchor.current || !self.current)
|
1284
|
+
return {};
|
1285
|
+
let corner = props.corner || "bottom-right";
|
1286
|
+
let [vertical, horizontal] = corner.split("-");
|
1287
|
+
let anchorRect = props.anchor.current.getBoundingClientRect();
|
1288
|
+
let selfRect = (_a = self.current) == null ? void 0 : _a.getBoundingClientRect();
|
1289
|
+
let width = horizontal == "right" ? anchorRect.width - selfRect.width : 0;
|
1290
|
+
let height = vertical == "bottom" ? anchorRect.height - selfRect.height : 0;
|
1291
|
+
let style = {
|
1292
|
+
top: anchorRect.y + height + (vertical == "bottom" ? -1 : 1) * (props.paddingX || 10),
|
1293
|
+
left: anchorRect.x + width + (horizontal == "right" ? -1 : 1) * (props.paddingX || 25)
|
1294
|
+
};
|
1295
|
+
return style;
|
1296
|
+
};
|
1297
|
+
return /* @__PURE__ */ React11.createElement(
|
1298
|
+
Button,
|
1299
|
+
{
|
1300
|
+
className: cn(
|
1301
|
+
"hawa-fixed hawa-cursor-pointer hawa-rounded hawa-transition-all",
|
1302
|
+
visible ? "hawa-pointer-events-all hawa-opacity-100" : "hawa-pointer-events-none hawa-opacity-0"
|
1303
|
+
),
|
1304
|
+
onClick: backToTop,
|
1305
|
+
style: {
|
1306
|
+
...getStyles(),
|
1307
|
+
transitionProperty: "opacity, background-color"
|
1308
|
+
},
|
1309
|
+
ref: self,
|
1310
|
+
size: "icon"
|
1311
|
+
},
|
1312
|
+
/* @__PURE__ */ React11.createElement(
|
1313
|
+
"svg",
|
1314
|
+
{
|
1315
|
+
className: cn(
|
1316
|
+
"hawa-h-6 hawa-w-6 hawa-shrink-0 hawa-rotate-180 hawa-transition-all disabled:hawa-bg-gray-200"
|
1317
|
+
),
|
1318
|
+
"aria-label": "Arrow Icon",
|
1319
|
+
viewBox: "0 0 20 20",
|
1320
|
+
fill: "currentColor"
|
1321
|
+
},
|
1322
|
+
/* @__PURE__ */ React11.createElement("path", { d: "M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" })
|
1323
|
+
)
|
1324
|
+
);
|
1325
|
+
};
|
1326
|
+
|
1327
|
+
// elements/combobox/Combobox.tsx
|
1328
|
+
import * as React13 from "react";
|
1329
|
+
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
1330
|
+
|
1331
|
+
// elements/command/Command.tsx
|
1332
|
+
import * as React12 from "react";
|
1333
|
+
import { Command as CommandPrimitive } from "cmdk";
|
1334
|
+
var Command = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React12.createElement(
|
1335
|
+
CommandPrimitive,
|
1336
|
+
{
|
1337
|
+
ref,
|
1338
|
+
className: cn(
|
1339
|
+
"hawa-flex hawa-h-full hawa-w-full hawa-flex-col hawa-overflow-hidden hawa-rounded-md hawa-bg-popover hawa-text-popover-foreground",
|
1340
|
+
className
|
1341
|
+
),
|
1342
|
+
...props
|
1343
|
+
}
|
1344
|
+
));
|
1345
|
+
Command.displayName = CommandPrimitive.displayName;
|
1346
|
+
var CommandDialog = ({ children, ...props }) => {
|
1347
|
+
return /* @__PURE__ */ React12.createElement(Dialog, { ...props }, /* @__PURE__ */ React12.createElement(DialogContent, { className: "hawa-overflow-hidden hawa-p-0 hawa-shadow-lg" }, /* @__PURE__ */ React12.createElement(Command, { className: "[&_[cmdk-group-heading]]:hawa-px-2 [&_[cmdk-group-heading]]:hawa-font-medium [&_[cmdk-group-heading]]:hawa-text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:hawa-pt-0 [&_[cmdk-group]]:hawa-px-2 [&_[cmdk-input-wrapper]_svg]:hawa-h-5 [&_[cmdk-input-wrapper]_svg]:hawa-w-5 [&_[cmdk-input]]:hawa-h-12 [&_[cmdk-item]]:hawa-px-2 [&_[cmdk-item]]:hawa-py-3 [&_[cmdk-item]_svg]:hawa-h-5 [&_[cmdk-item]_svg]:hawa-w-5" }, children)));
|
1348
|
+
};
|
1349
|
+
var CommandInput = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React12.createElement(
|
1350
|
+
"div",
|
1351
|
+
{
|
1352
|
+
className: "hawa-flex hawa-items-center hawa-border-b hawa-px-3",
|
1353
|
+
"cmdk-input-wrapper": ""
|
1354
|
+
},
|
1355
|
+
/* @__PURE__ */ React12.createElement(
|
1356
|
+
"svg",
|
1357
|
+
{
|
1358
|
+
"aria-label": "Search Icon",
|
1359
|
+
xmlns: "http://www.w3.org/2000/svg",
|
1360
|
+
width: "24",
|
1361
|
+
height: "24",
|
1362
|
+
viewBox: "0 0 24 24",
|
1363
|
+
fill: "none",
|
1364
|
+
stroke: "currentColor",
|
1365
|
+
strokeWidth: "2",
|
1366
|
+
strokeLinecap: "round",
|
1367
|
+
strokeLinejoin: "round",
|
1368
|
+
className: "hawa-icon hawa-me-2 hawa-shrink-0 hawa-opacity-50"
|
1369
|
+
},
|
1370
|
+
/* @__PURE__ */ React12.createElement("circle", { cx: "11", cy: "11", r: "8" }),
|
1371
|
+
/* @__PURE__ */ React12.createElement("path", { d: "m21 21-4.3-4.3" })
|
1372
|
+
),
|
1373
|
+
/* @__PURE__ */ React12.createElement(
|
1374
|
+
CommandPrimitive.Input,
|
1375
|
+
{
|
1376
|
+
ref,
|
1377
|
+
className: cn(
|
1378
|
+
"hawa-flex hawa-h-11 hawa-w-full hawa-rounded-md hawa-bg-transparent hawa-py-3 hawa-text-sm hawa-outline-none placeholder:hawa-text-muted-foreground disabled:hawa-cursor-not-allowed disabled:hawa-opacity-50",
|
1379
|
+
className
|
1380
|
+
),
|
1381
|
+
...props
|
1382
|
+
}
|
1383
|
+
)
|
1384
|
+
));
|
1385
|
+
CommandInput.displayName = CommandPrimitive.Input.displayName;
|
1386
|
+
var CommandList = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React12.createElement(
|
1387
|
+
CommandPrimitive.List,
|
1388
|
+
{
|
1389
|
+
ref,
|
1390
|
+
className: cn(
|
1391
|
+
"hawa-max-h-[300px] hawa-overflow-y-auto hawa-overflow-x-hidden",
|
1392
|
+
className
|
1393
|
+
),
|
1394
|
+
...props
|
1395
|
+
}
|
1396
|
+
));
|
1397
|
+
CommandList.displayName = CommandPrimitive.List.displayName;
|
1398
|
+
var CommandEmpty = React12.forwardRef((props, ref) => /* @__PURE__ */ React12.createElement(
|
1399
|
+
CommandPrimitive.Empty,
|
1400
|
+
{
|
1401
|
+
ref,
|
1402
|
+
className: "hawa-py-6 hawa-text-center hawa-text-sm",
|
1403
|
+
...props
|
1404
|
+
}
|
1405
|
+
));
|
1406
|
+
CommandEmpty.displayName = CommandPrimitive.Empty.displayName;
|
1407
|
+
var CommandGroup = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React12.createElement(
|
1408
|
+
CommandPrimitive.Group,
|
1409
|
+
{
|
1410
|
+
ref,
|
1411
|
+
className: cn(
|
1412
|
+
"hawa-overflow-hidden hawa-p-1 hawa-text-foreground [&_[cmdk-group-heading]]:hawa-px-2 [&_[cmdk-group-heading]]:hawa-py-1.5 [&_[cmdk-group-heading]]:hawa-text-xs [&_[cmdk-group-heading]]:hawa-font-medium [&_[cmdk-group-heading]]:hawa-text-muted-foreground",
|
1413
|
+
className
|
1414
|
+
),
|
1415
|
+
...props
|
1416
|
+
}
|
1417
|
+
));
|
1418
|
+
CommandGroup.displayName = CommandPrimitive.Group.displayName;
|
1419
|
+
var CommandSeparator = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React12.createElement(
|
1420
|
+
CommandPrimitive.Separator,
|
1421
|
+
{
|
1422
|
+
ref,
|
1423
|
+
className: cn("hawa--mx-1 hawa-h-px hawa-bg-border", className),
|
1424
|
+
...props
|
1425
|
+
}
|
1426
|
+
));
|
1427
|
+
CommandSeparator.displayName = CommandPrimitive.Separator.displayName;
|
1428
|
+
var CommandItem = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React12.createElement(
|
1429
|
+
CommandPrimitive.Item,
|
1430
|
+
{
|
1431
|
+
ref,
|
1432
|
+
className: cn(
|
1433
|
+
"hawa-relative hawa-flex hawa-cursor-default hawa-select-none hawa-items-center hawa-rounded-sm hawa-px-2 hawa-py-1.5 hawa-text-sm hawa-outline-none aria-selected:hawa-bg-accent aria-selected:hawa-text-accent-foreground data-[disabled]:hawa-pointer-events-none data-[disabled]:hawa-opacity-50",
|
1434
|
+
className
|
1435
|
+
),
|
1436
|
+
...props
|
1437
|
+
}
|
1438
|
+
));
|
1439
|
+
CommandItem.displayName = CommandPrimitive.Item.displayName;
|
1440
|
+
var CommandShortcut = ({
|
1441
|
+
className,
|
1442
|
+
...props
|
1443
|
+
}) => {
|
1444
|
+
return /* @__PURE__ */ React12.createElement(
|
1445
|
+
"span",
|
1446
|
+
{
|
1447
|
+
className: cn(
|
1448
|
+
"hawa-ml-auto hawa-text-xs hawa-tracking-widest hawa-text-muted-foreground",
|
1449
|
+
className
|
1450
|
+
),
|
1451
|
+
...props
|
1452
|
+
}
|
1453
|
+
);
|
1454
|
+
};
|
1455
|
+
CommandShortcut.displayName = "CommandShortcut";
|
1456
|
+
|
1457
|
+
// elements/combobox/Combobox.tsx
|
1458
|
+
var Combobox = React13.forwardRef(
|
1459
|
+
({
|
1460
|
+
labelKey = "label",
|
1461
|
+
valueKey = "value",
|
1462
|
+
defaultValue = "",
|
1463
|
+
popoverClassName,
|
1464
|
+
direction,
|
1465
|
+
labelProps,
|
1466
|
+
data,
|
1467
|
+
...props
|
1468
|
+
}, ref) => {
|
1469
|
+
var _a, _b, _c;
|
1470
|
+
const [open, setOpen] = React13.useState(false);
|
1471
|
+
const [value, setValue] = React13.useState(defaultValue);
|
1472
|
+
function getProperty(obj, key) {
|
1473
|
+
return obj[key];
|
1474
|
+
}
|
1475
|
+
const handleOpenChange = (open2) => {
|
1476
|
+
if (!(props.isLoading || props.preview)) {
|
1477
|
+
setOpen(open2);
|
1478
|
+
}
|
1479
|
+
};
|
1480
|
+
return /* @__PURE__ */ React13.createElement(
|
1481
|
+
"div",
|
1482
|
+
{
|
1483
|
+
className: cn(
|
1484
|
+
"hawa-relative hawa-flex hawa-h-fit hawa-flex-col hawa-gap-2",
|
1485
|
+
props.width === "fit" ? "hawa-w-fit" : "hawa-w-full"
|
1486
|
+
)
|
1487
|
+
},
|
1488
|
+
props.label && /* @__PURE__ */ React13.createElement(Label, { ...labelProps }, props.label),
|
1489
|
+
/* @__PURE__ */ React13.createElement(PopoverPrimitive.Root, { open, onOpenChange: handleOpenChange }, /* @__PURE__ */ React13.createElement(PopoverTrigger, { asChild: true }, props.isLoading ? /* @__PURE__ */ React13.createElement("div", { className: "hawa-pb-2" }, /* @__PURE__ */ React13.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" })) : /* @__PURE__ */ React13.createElement("div", { className: "hawa-flex hawa-flex-col hawa-items-start hawa-gap-2 " }, /* @__PURE__ */ React13.createElement(
|
1490
|
+
"div",
|
1491
|
+
{
|
1492
|
+
className: cn(
|
1493
|
+
"hawa-absolute hawa-top-[22px] hawa-h-[0.8px] hawa-w-full hawa-bg-gray-200 hawa-transition-all dark:hawa-bg-gray-800",
|
1494
|
+
props.preview ? "hawa-opacity-100" : "hawa-opacity-0"
|
1495
|
+
)
|
1496
|
+
}
|
1497
|
+
), /* @__PURE__ */ React13.createElement(
|
1498
|
+
"button",
|
1499
|
+
{
|
1500
|
+
role: "combobox",
|
1501
|
+
type: "button",
|
1502
|
+
"aria-expanded": open,
|
1503
|
+
className: cn(
|
1504
|
+
"hawa-inline-flex hawa-h-10 hawa-w-full hawa-select-none hawa-items-center hawa-justify-between hawa-rounded-md hawa-border hawa-py-2 hawa-text-sm hawa-font-normal hawa-ring-offset-background hawa-transition-all focus-visible:hawa-outline-none focus-visible:hawa-ring-2 focus-visible:hawa-ring-ring focus-visible:hawa-ring-offset-2 disabled:hawa-pointer-events-none disabled:hawa-opacity-50",
|
1505
|
+
props.preview ? "hawa-cursor-default hawa-rounded-none hawa-border-transparent hawa-px-0" : "hawa-bg-background hawa-px-3 "
|
1506
|
+
)
|
1507
|
+
},
|
1508
|
+
value ? getProperty(
|
1509
|
+
data.find((item) => item[valueKey] === value) || {},
|
1510
|
+
labelKey
|
1511
|
+
) : ((_a = props.texts) == null ? void 0 : _a.placeholder) || ". . .",
|
1512
|
+
/* @__PURE__ */ React13.createElement(
|
1513
|
+
"svg",
|
1514
|
+
{
|
1515
|
+
xmlns: "http://www.w3.org/2000/svg",
|
1516
|
+
className: cn(
|
1517
|
+
"hawa-icon hawa-transition-all",
|
1518
|
+
!props.preview ? "hawa-visible hawa-opacity-100" : "hawa-invisible hawa-opacity-0"
|
1519
|
+
),
|
1520
|
+
"aria-label": "Chevron down icon",
|
1521
|
+
viewBox: "0 0 24 24",
|
1522
|
+
fill: "none",
|
1523
|
+
stroke: "currentColor",
|
1524
|
+
strokeWidth: "2",
|
1525
|
+
strokeLinecap: "round",
|
1526
|
+
strokeLinejoin: "round"
|
1527
|
+
},
|
1528
|
+
/* @__PURE__ */ React13.createElement("path", { d: "m6 9 6 6 6-6" })
|
1529
|
+
)
|
1530
|
+
), /* @__PURE__ */ React13.createElement(
|
1531
|
+
"p",
|
1532
|
+
{
|
1533
|
+
className: cn(
|
1534
|
+
"hawa-my-0 hawa-text-start hawa-text-xs hawa-text-helper-color hawa-transition-all",
|
1535
|
+
props.helperText ? "hawa-h-4 hawa-opacity-100" : "hawa-h-0 hawa-opacity-0"
|
1536
|
+
)
|
1537
|
+
},
|
1538
|
+
props.helperText
|
1539
|
+
))), /* @__PURE__ */ React13.createElement(
|
1540
|
+
PopoverContent,
|
1541
|
+
{
|
1542
|
+
sideOffset: 0,
|
1543
|
+
className: cn("popover-w-parent", props.helperText && "-hawa-mt-4"),
|
1544
|
+
dir: direction
|
1545
|
+
},
|
1546
|
+
/* @__PURE__ */ React13.createElement(Command, null, !props.hideInput && /* @__PURE__ */ React13.createElement(
|
1547
|
+
CommandInput,
|
1548
|
+
{
|
1549
|
+
dir: direction,
|
1550
|
+
placeholder: ((_b = props.texts) == null ? void 0 : _b.searchPlaceholder) || "Search"
|
1551
|
+
}
|
1552
|
+
), /* @__PURE__ */ React13.createElement(CommandEmpty, null, ((_c = props.texts) == null ? void 0 : _c.noItems) || "No items found."), /* @__PURE__ */ React13.createElement(CommandGroup, { className: "hawa-max-h-[200px] hawa-overflow-y-auto" }, data.map((item, i) => /* @__PURE__ */ React13.createElement(
|
1553
|
+
CommandItem,
|
1554
|
+
{
|
1555
|
+
key: i,
|
1556
|
+
onSelect: () => {
|
1557
|
+
const newValue = getProperty(item, valueKey);
|
1558
|
+
setValue(newValue === value ? "" : newValue);
|
1559
|
+
if (props.onChange) {
|
1560
|
+
props.onChange(
|
1561
|
+
newValue === value ? "" : newValue
|
1562
|
+
);
|
1563
|
+
}
|
1564
|
+
setOpen(false);
|
1565
|
+
}
|
1566
|
+
},
|
1567
|
+
/* @__PURE__ */ React13.createElement(
|
1568
|
+
"svg",
|
1569
|
+
{
|
1570
|
+
"aria-label": "Check Icon",
|
1571
|
+
xmlns: "http://www.w3.org/2000/svg",
|
1572
|
+
width: "24",
|
1573
|
+
height: "24",
|
1574
|
+
viewBox: "0 0 24 24",
|
1575
|
+
fill: "none",
|
1576
|
+
stroke: "currentColor",
|
1577
|
+
strokeWidth: "2",
|
1578
|
+
strokeLinecap: "round",
|
1579
|
+
strokeLinejoin: "round",
|
1580
|
+
className: cn(
|
1581
|
+
"hawa-icon",
|
1582
|
+
value === getProperty(item, valueKey) ? "hawa-opacity-100" : "hawa-opacity-0"
|
1583
|
+
),
|
1584
|
+
style: { marginInlineEnd: "0.5rem" }
|
1585
|
+
},
|
1586
|
+
/* @__PURE__ */ React13.createElement("polyline", { points: "20 6 9 17 4 12" })
|
1587
|
+
),
|
1588
|
+
getProperty(item, labelKey)
|
1589
|
+
))))
|
1590
|
+
))
|
1591
|
+
);
|
1592
|
+
}
|
1593
|
+
);
|
1594
|
+
|
1595
|
+
// elements/fileDropzone/FileDropzone.tsx
|
1596
|
+
import React14, { useEffect as useEffect3, useState as useState5 } from "react";
|
1597
|
+
import { useDropzone } from "react-dropzone";
|
1598
|
+
import clsx from "clsx";
|
1599
|
+
var FileDropzone = ({
|
1600
|
+
texts,
|
1601
|
+
files,
|
1602
|
+
setFiles,
|
1603
|
+
setDeletedFiles,
|
1604
|
+
onAcceptedFiles,
|
1605
|
+
errorMessages,
|
1606
|
+
maxFiles,
|
1607
|
+
accept,
|
1608
|
+
showPreview,
|
1609
|
+
onDeleteFile,
|
1610
|
+
onClearFiles,
|
1611
|
+
disclaimer,
|
1612
|
+
maxSize,
|
1613
|
+
label,
|
1614
|
+
termsLink,
|
1615
|
+
privacyLink
|
1616
|
+
}) => {
|
1617
|
+
var _a, _b, _c, _d, _e, _f;
|
1618
|
+
const [cmp, setCmp] = useState5(0);
|
1619
|
+
const [max, setMax] = useState5(0);
|
1620
|
+
const {
|
1621
|
+
getRootProps,
|
1622
|
+
getInputProps,
|
1623
|
+
fileRejections,
|
1624
|
+
acceptedFiles,
|
1625
|
+
isDragActive
|
1626
|
+
} = useDropzone({
|
1627
|
+
multiple: true,
|
1628
|
+
accept,
|
1629
|
+
maxSize,
|
1630
|
+
maxFiles,
|
1631
|
+
onDrop: (acceptedFiles2) => {
|
1632
|
+
setFiles(
|
1633
|
+
acceptedFiles2.map(
|
1634
|
+
(file, index) => Object.assign(file, {
|
1635
|
+
preview: URL.createObjectURL(file)
|
1636
|
+
})
|
1637
|
+
)
|
1638
|
+
);
|
1639
|
+
}
|
1640
|
+
});
|
1641
|
+
useEffect3(
|
1642
|
+
() => () => {
|
1643
|
+
files == null ? void 0 : files.forEach((file) => {
|
1644
|
+
URL.revokeObjectURL(file.preview);
|
1645
|
+
});
|
1646
|
+
},
|
1647
|
+
[files]
|
1648
|
+
);
|
1649
|
+
useEffect3(() => {
|
1650
|
+
setFiles(acceptedFiles);
|
1651
|
+
}, [acceptedFiles, cmp, setFiles]);
|
1652
|
+
onClearFiles = () => {
|
1653
|
+
acceptedFiles.length = 0;
|
1654
|
+
acceptedFiles.splice(0, acceptedFiles.length);
|
1655
|
+
setFiles([]);
|
1656
|
+
};
|
1657
|
+
const clearAllFiles = () => {
|
1658
|
+
acceptedFiles.length = 0;
|
1659
|
+
setFiles([]);
|
1660
|
+
};
|
1661
|
+
useEffect3(() => {
|
1662
|
+
if (maxSize > 0) {
|
1663
|
+
const k = 1024;
|
1664
|
+
const sizes = ["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
|
1665
|
+
const i = Math.floor(Math.log(maxSize) / Math.log(1024));
|
1666
|
+
setMax(
|
1667
|
+
parseFloat((maxSize / Math.pow(1024, i)).toFixed(2)) + " " + sizes[i]
|
1668
|
+
);
|
1669
|
+
}
|
1670
|
+
}, [maxSize]);
|
1671
|
+
const errs = fileRejections.map((rej, i) => {
|
1672
|
+
switch (rej.errors[0].code) {
|
1673
|
+
case "file-too-large":
|
1674
|
+
return /* @__PURE__ */ React14.createElement(
|
1675
|
+
Alert,
|
1676
|
+
{
|
1677
|
+
key: i,
|
1678
|
+
text: rej.file.name,
|
1679
|
+
title: texts.fileTooLarge,
|
1680
|
+
severity: "error"
|
1681
|
+
}
|
1682
|
+
);
|
1683
|
+
case "too-many-files":
|
1684
|
+
return /* @__PURE__ */ React14.createElement(
|
1685
|
+
Alert,
|
1686
|
+
{
|
1687
|
+
key: i,
|
1688
|
+
text: rej.file.name,
|
1689
|
+
title: texts.tooManyFiles,
|
1690
|
+
severity: "error"
|
1691
|
+
}
|
1692
|
+
);
|
1693
|
+
case "file-invalid-type":
|
1694
|
+
return /* @__PURE__ */ React14.createElement(
|
1695
|
+
Alert,
|
1696
|
+
{
|
1697
|
+
key: i,
|
1698
|
+
text: rej.file.name,
|
1699
|
+
title: texts.invalidFileType,
|
1700
|
+
severity: "error"
|
1701
|
+
}
|
1702
|
+
);
|
1703
|
+
default:
|
1704
|
+
return /* @__PURE__ */ React14.createElement(
|
1705
|
+
Alert,
|
1706
|
+
{
|
1707
|
+
key: i,
|
1708
|
+
text: rej.file.name,
|
1709
|
+
title: rej.errors[0].code,
|
1710
|
+
severity: "error"
|
1711
|
+
}
|
1712
|
+
);
|
1713
|
+
}
|
1714
|
+
});
|
1715
|
+
const thumbs = files == null ? void 0 : files.map((file, index) => /* @__PURE__ */ React14.createElement("div", { className: "hawa-relative hawa-rounded", key: index }, /* @__PURE__ */ React14.createElement(
|
1716
|
+
"button",
|
1717
|
+
{
|
1718
|
+
onClick: (e) => {
|
1719
|
+
e.stopPropagation();
|
1720
|
+
acceptedFiles.splice(acceptedFiles.indexOf(file), 1);
|
1721
|
+
setCmp(Math.random);
|
1722
|
+
onDeleteFile(file);
|
1723
|
+
},
|
1724
|
+
type: "button",
|
1725
|
+
className: "hawa-absolute hawa-left-0 hawa-ml-auto hawa-inline-flex hawa-items-center hawa-rounded-inner hawa-rounded-bl-none hawa-rounded-tr-none hawa-bg-gray-900 hawa-p-1.5 hawa-text-sm hawa-text-gray-400 hawa-transition-all hover:hawa-bg-gray-200 hover:hawa-text-gray-900 dark:hover:hawa-bg-gray-600 dark:hover:hawa-text-white",
|
1726
|
+
"data-modal-toggle": "defaultModal"
|
1727
|
+
},
|
1728
|
+
/* @__PURE__ */ React14.createElement(
|
1729
|
+
"svg",
|
1730
|
+
{
|
1731
|
+
"aria-hidden": "true",
|
1732
|
+
className: "hawa-h-5 hawa-w-5",
|
1733
|
+
fill: "currentColor",
|
1734
|
+
viewBox: "0 0 20 20"
|
1735
|
+
},
|
1736
|
+
/* @__PURE__ */ React14.createElement(
|
1737
|
+
"path",
|
1738
|
+
{
|
1739
|
+
fillRule: "evenodd",
|
1740
|
+
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",
|
1741
|
+
clipRule: "evenodd"
|
1742
|
+
}
|
1743
|
+
)
|
1744
|
+
),
|
1745
|
+
/* @__PURE__ */ React14.createElement("span", { className: "hawa-sr-only" }, "Close modal")
|
1746
|
+
), /* @__PURE__ */ React14.createElement(
|
1747
|
+
"div",
|
1748
|
+
{
|
1749
|
+
style: {
|
1750
|
+
display: "flex",
|
1751
|
+
justifyContent: "center",
|
1752
|
+
alignItems: "center",
|
1753
|
+
overflow: "hidden",
|
1754
|
+
height: 100,
|
1755
|
+
width: 100,
|
1756
|
+
backgroundImage: `url(${file.preview})`,
|
1757
|
+
backgroundSize: "cover",
|
1758
|
+
backgroundPosition: "center",
|
1759
|
+
border: "1px solid black"
|
1760
|
+
},
|
1761
|
+
className: "hawa-rounded",
|
1762
|
+
key: file.name
|
1763
|
+
}
|
1764
|
+
)));
|
1765
|
+
return /* @__PURE__ */ React14.createElement("div", null, label && /* @__PURE__ */ React14.createElement("div", { className: "hawa-mb-2 hawa-block hawa-text-sm hawa-font-medium hawa-text-gray-900 dark:hawa-text-gray-300" }, label), /* @__PURE__ */ React14.createElement(
|
1766
|
+
"div",
|
1767
|
+
{
|
1768
|
+
className: clsx(
|
1769
|
+
"hawa-flex hawa-flex-col hawa-justify-center hawa-rounded hawa-border hawa-border-dashed hawa-p-6 hawa-transition-all ",
|
1770
|
+
isDragActive ? "hawa-bg-muted" : "hawa-bg-muted/20 hover:hawa-bg-muted/50 "
|
1771
|
+
)
|
1772
|
+
},
|
1773
|
+
/* @__PURE__ */ React14.createElement("div", { ...getRootProps({}) }, /* @__PURE__ */ React14.createElement("p", { ...getInputProps() }), /* @__PURE__ */ React14.createElement("div", { className: "hawa-flex hawa-flex-col hawa-items-center hawa-justify-center hawa-gap-2 hawa-pt-4 hawa-text-center" }, /* @__PURE__ */ React14.createElement(
|
1774
|
+
"svg",
|
1775
|
+
{
|
1776
|
+
stroke: "currentColor",
|
1777
|
+
fill: "none",
|
1778
|
+
strokeWidth: "2",
|
1779
|
+
viewBox: "0 0 24 24",
|
1780
|
+
strokeLinecap: "round",
|
1781
|
+
strokeLinejoin: "round",
|
1782
|
+
height: "1.5em",
|
1783
|
+
width: "1.5em"
|
1784
|
+
},
|
1785
|
+
/* @__PURE__ */ React14.createElement("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }),
|
1786
|
+
/* @__PURE__ */ React14.createElement("path", { d: "M19 11v-2a2 2 0 0 0 -2 -2h-8a2 2 0 0 0 -2 2v8a2 2 0 0 0 2 2h2" }),
|
1787
|
+
/* @__PURE__ */ React14.createElement("path", { d: "M13 13l9 3l-4 2l-2 4l-3 -9" }),
|
1788
|
+
/* @__PURE__ */ React14.createElement("path", { d: "M3 3l0 .01" }),
|
1789
|
+
/* @__PURE__ */ React14.createElement("path", { d: "M7 3l0 .01" }),
|
1790
|
+
/* @__PURE__ */ React14.createElement("path", { d: "M11 3l0 .01" }),
|
1791
|
+
/* @__PURE__ */ React14.createElement("path", { d: "M15 3l0 .01" }),
|
1792
|
+
/* @__PURE__ */ React14.createElement("path", { d: "M3 7l0 .01" }),
|
1793
|
+
/* @__PURE__ */ React14.createElement("path", { d: "M3 11l0 .01" }),
|
1794
|
+
/* @__PURE__ */ React14.createElement("path", { d: "M3 15l0 .01" })
|
1795
|
+
), typeof texts.clickHereToUpload === "function" ? texts.clickHereToUpload() : texts.clickHereToUpload), /* @__PURE__ */ React14.createElement("div", { className: "hawa-select-none hawa-pt-2 hawa-text-center hawa-text-xs" }, texts.acceptedFileTypes, " ", accept.split(",")), /* @__PURE__ */ React14.createElement("div", { className: "hawa-select-none hawa-pb-2 hawa-pt-1 hawa-text-center hawa-text-xs" }, texts.maxFileSize, " ", max)),
|
1796
|
+
acceptedFiles.length > 0 && /* @__PURE__ */ React14.createElement("div", { className: "hawa-flex hawa-justify-center hawa-rounded-lg hawa-p-2 " }, /* @__PURE__ */ React14.createElement(Button, { onClick: clearAllFiles }, "Clear All")),
|
1797
|
+
acceptedFiles.length > 0 && thumbs && showPreview ? /* @__PURE__ */ React14.createElement("aside", { className: "hawa-flex hawa-flex-row hawa-flex-wrap hawa-justify-center hawa-gap-2 hawa-rounded-lg hawa-p-2" }, thumbs) : null,
|
1798
|
+
/* @__PURE__ */ React14.createElement("div", { className: "px-4" }, ((_b = (_a = fileRejections[0]) == null ? void 0 : _a.errors[0]) == null ? void 0 : _b.code) && errs)
|
1799
|
+
), disclaimer && /* @__PURE__ */ React14.createElement("div", { className: "hawa-mt-2 hawa-text-sm hawa-text-muted-foreground/50" }, (_c = texts.disclaimer) != null ? _c : "By uploading a file you agree to our", " ", /* @__PURE__ */ React14.createElement(
|
1800
|
+
"a",
|
1801
|
+
{
|
1802
|
+
href: termsLink,
|
1803
|
+
className: "clickable-link hawa-text-muted-foreground/50"
|
1804
|
+
},
|
1805
|
+
(_d = texts.terms) != null ? _d : "Terms"
|
1806
|
+
), " ", (_e = texts.and) != null ? _e : "and", " ", /* @__PURE__ */ React14.createElement(
|
1807
|
+
"a",
|
1808
|
+
{
|
1809
|
+
href: privacyLink,
|
1810
|
+
className: "clickable-link hawa-text-muted-foreground/50"
|
1811
|
+
},
|
1812
|
+
(_f = texts.privacyPolicy) != null ? _f : "Privacy Policy"
|
1813
|
+
)));
|
1814
|
+
};
|
1815
|
+
|
1816
|
+
// elements/sortButton/SortButton.tsx
|
1817
|
+
import React15 from "react";
|
1818
|
+
var SortButton = (props) => {
|
1819
|
+
return /* @__PURE__ */ React15.createElement(
|
1820
|
+
Button,
|
1821
|
+
{
|
1822
|
+
variant: "ghost",
|
1823
|
+
centered: false,
|
1824
|
+
className: cn(
|
1825
|
+
"hawa-flex hawa-w-full hawa-flex-row hawa-items-start hawa-justify-start hawa-gap-2 hawa-text-start",
|
1826
|
+
props.condensed && "hawa-h-6"
|
1827
|
+
),
|
1828
|
+
onClick: props.onSort
|
1829
|
+
},
|
1830
|
+
props.label,
|
1831
|
+
/* @__PURE__ */ React15.createElement(
|
1832
|
+
"svg",
|
1833
|
+
{
|
1834
|
+
xmlns: "http://www.w3.org/2000/svg",
|
1835
|
+
viewBox: "0 0 24 24",
|
1836
|
+
fill: "none",
|
1837
|
+
stroke: "currentColor",
|
1838
|
+
strokeWidth: "2",
|
1839
|
+
strokeLinecap: "round",
|
1840
|
+
strokeLinejoin: "round",
|
1841
|
+
className: props.condensed ? "hawa-h-3 hawa-w-3" : "hawa-icon"
|
1842
|
+
},
|
1843
|
+
/* @__PURE__ */ React15.createElement("path", { d: "m21 16-4 4-4-4" }),
|
1844
|
+
/* @__PURE__ */ React15.createElement("path", { d: "M17 20V4" }),
|
1845
|
+
/* @__PURE__ */ React15.createElement("path", { d: "m3 8 4-4 4 4" }),
|
1846
|
+
/* @__PURE__ */ React15.createElement("path", { d: "M7 4v16" })
|
1847
|
+
)
|
1848
|
+
);
|
1849
|
+
};
|
1850
|
+
|
1851
|
+
// elements/switch/Switch.tsx
|
1852
|
+
import * as React16 from "react";
|
1853
|
+
import * as SwitchPrimitives from "@radix-ui/react-switch";
|
1854
|
+
var Switch = React16.forwardRef(
|
1855
|
+
({ className, size = "default", roundedness = "inherit", label, ...props }, ref) => {
|
1856
|
+
const [parentDirection, setParentDirection] = React16.useState(
|
1857
|
+
null
|
1858
|
+
);
|
1859
|
+
const parentRef = React16.useRef(null);
|
1860
|
+
React16.useEffect(() => {
|
1861
|
+
var _a;
|
1862
|
+
const parentNode = (_a = parentRef.current) == null ? void 0 : _a.parentNode;
|
1863
|
+
if (parentNode) {
|
1864
|
+
const dir = window.getComputedStyle(parentNode).direction;
|
1865
|
+
setParentDirection(dir);
|
1866
|
+
}
|
1867
|
+
});
|
1868
|
+
const rootSize = {
|
1869
|
+
default: "hawa-h-[25px] hawa-w-[42px]",
|
1870
|
+
sm: "hawa-h-[20px] hawa-w-[37px]",
|
1871
|
+
lg: "hawa-h-[30px] hawa-w-[47px]"
|
1872
|
+
};
|
1873
|
+
const thumbSize = {
|
1874
|
+
default: "hawa-h-[21px] hawa-w-[21px]",
|
1875
|
+
sm: "hawa-h-[16px] hawa-w-[16px]",
|
1876
|
+
lg: "hawa-h-[26px] hawa-w-[26px]"
|
1877
|
+
};
|
1878
|
+
const rootRoundednessStyles = {
|
1879
|
+
none: "hawa-rounded-none",
|
1880
|
+
full: "hawa-rounded-full",
|
1881
|
+
inherit: "hawa-rounded"
|
1882
|
+
};
|
1883
|
+
const thumbRoundednessStyles = {
|
1884
|
+
none: "hawa-rounded-none",
|
1885
|
+
full: "hawa-rounded-full",
|
1886
|
+
inherit: "hawa-rounded-inner"
|
1887
|
+
};
|
1888
|
+
return /* @__PURE__ */ React16.createElement(
|
1889
|
+
"div",
|
1890
|
+
{
|
1891
|
+
className: "hawa-flex hawa-flex-row hawa-items-center",
|
1892
|
+
ref: parentRef
|
1893
|
+
},
|
1894
|
+
/* @__PURE__ */ React16.createElement(
|
1895
|
+
SwitchPrimitives.Root,
|
1896
|
+
{
|
1897
|
+
className: cn(
|
1898
|
+
"data-[state=unchecked]:hawa-bg-primary/20",
|
1899
|
+
"data-[state=checked]:hawa-bg-primary",
|
1900
|
+
"hawa-relative hawa-cursor-pointer hawa-rounded hawa-outline-none",
|
1901
|
+
rootRoundednessStyles[roundedness],
|
1902
|
+
className,
|
1903
|
+
rootSize[size]
|
1904
|
+
),
|
1905
|
+
...props,
|
1906
|
+
ref
|
1907
|
+
},
|
1908
|
+
/* @__PURE__ */ React16.createElement(
|
1909
|
+
SwitchPrimitives.Thumb,
|
1910
|
+
{
|
1911
|
+
className: cn(
|
1912
|
+
thumbSize[size],
|
1913
|
+
"hawa-block hawa-rounded hawa-transition-transform hawa-duration-100 hawa-will-change-transform",
|
1914
|
+
"data-[state=checked]:hawa-bg-primary-foreground",
|
1915
|
+
"hawa-bg-white dark:hawa-bg-background",
|
1916
|
+
thumbRoundednessStyles[roundedness],
|
1917
|
+
parentDirection === "rtl" ? "hawa--translate-x-0.5 data-[state=checked]:hawa--translate-x-[19px]" : "hawa-translate-x-0.5 data-[state=checked]:hawa-translate-x-[19px]"
|
1918
|
+
)
|
1919
|
+
}
|
1920
|
+
)
|
1921
|
+
),
|
1922
|
+
label && /* @__PURE__ */ React16.createElement("span", { className: "hawa-mx-2 hawa-text-sm hawa-font-medium hawa-text-gray-900 dark:hawa-text-gray-300" }, label)
|
1923
|
+
);
|
1924
|
+
}
|
1925
|
+
);
|
1926
|
+
Switch.displayName = SwitchPrimitives.Root.displayName;
|
1927
|
+
|
1928
|
+
// elements/breadcrumb/Breadcrumb.tsx
|
1929
|
+
import React17 from "react";
|
1930
|
+
var Breadcrumb = ({
|
1931
|
+
breadcrumbLinks,
|
1932
|
+
separator = ">"
|
1933
|
+
}) => {
|
1934
|
+
return /* @__PURE__ */ React17.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-gap-2 hawa-text-sm" }, breadcrumbLinks.map((singleBreadcrumbLink, index) => /* @__PURE__ */ React17.createElement(
|
1935
|
+
"div",
|
1936
|
+
{
|
1937
|
+
key: index,
|
1938
|
+
className: "hawa-flex hawa-flex-row hawa-items-center hawa-justify-center hawa-gap-2"
|
1939
|
+
},
|
1940
|
+
/* @__PURE__ */ React17.createElement(
|
1941
|
+
"a",
|
1942
|
+
{
|
1943
|
+
href: singleBreadcrumbLink.href,
|
1944
|
+
className: index + 1 === breadcrumbLinks.length ? "hawa-pointer-events-none" : "hawa-underline-offset-4 hawa-transition-all hover:hawa-text-primary hover:hawa-underline hover:hawa-decoration-2"
|
1945
|
+
},
|
1946
|
+
singleBreadcrumbLink.label
|
1947
|
+
),
|
1948
|
+
index != breadcrumbLinks.length - 1 ? typeof separator == "string" ? /* @__PURE__ */ React17.createElement("div", null, separator) : /* @__PURE__ */ React17.createElement("div", null, separator) : null
|
1949
|
+
)));
|
1950
|
+
};
|
1951
|
+
|
1952
|
+
// elements/appStores/AppStores.tsx
|
1953
|
+
import React18 from "react";
|
1954
|
+
var AppStores = (props) => {
|
1955
|
+
return /* @__PURE__ */ React18.createElement("div", { className: "hawa-flex hawa-justify-center" }, /* @__PURE__ */ React18.createElement("div", null, props.store === "apple" ? /* @__PURE__ */ React18.createElement("div", { className: "hawa-mt-3 hawa-flex hawa-h-14 hawa-w-48 hawa-items-center hawa-justify-center hawa-rounded-lg hawa-bg-black hawa-text-white dark:hawa-bg-white dark:hawa-text-black" }, /* @__PURE__ */ React18.createElement("div", { className: "hawa-mr-3" }, /* @__PURE__ */ React18.createElement("svg", { viewBox: "0 0 384 512", width: "30" }, /* @__PURE__ */ React18.createElement(
|
1956
|
+
"path",
|
1957
|
+
{
|
1958
|
+
fill: "currentColor",
|
1959
|
+
d: "M318.7 268.7c-.2-36.7 16.4-64.4 50-84.8-18.8-26.9-47.2-41.7-84.7-44.6-35.5-2.8-74.3 20.7-88.5 20.7-15 0-49.4-19.7-76.4-19.7C63.3 141.2 4 184.8 4 273.5q0 39.3 14.4 81.2c12.8 36.7 59 126.7 107.2 125.2 25.2-.6 43-17.9 75.8-17.9 31.8 0 48.3 17.9 76.4 17.9 48.6-.7 90.4-82.5 102.6-119.3-65.2-30.7-61.7-90-61.7-91.9zm-56.6-164.2c27.3-32.4 24.8-61.9 24-72.5-24.1 1.4-52 16.4-67.9 34.9-17.5 19.8-27.8 44.3-25.6 71.9 26.1 2 49.9-11.4 69.5-34.3z"
|
1960
|
+
}
|
1961
|
+
))), /* @__PURE__ */ React18.createElement("div", null, /* @__PURE__ */ React18.createElement("div", { className: "hawa-text-xs" }, "Download on the"), /* @__PURE__ */ React18.createElement("div", { className: "hawa--mt-1 hawa-font-sans hawa-text-2xl hawa-font-semibold" }, "App Store"))) : /* @__PURE__ */ React18.createElement("div", { className: "hawa-mt-3 hawa-flex hawa-h-14 hawa-w-48 hawa-items-center hawa-justify-center hawa-rounded-lg hawa-border hawa-border-black hawa-bg-black hawa-text-white dark:hawa-bg-white dark:hawa-text-black" }, /* @__PURE__ */ React18.createElement("div", { className: "hawa-mr-3" }, /* @__PURE__ */ React18.createElement("svg", { viewBox: "30 336.7 120.9 129.2", width: "30" }, /* @__PURE__ */ React18.createElement(
|
1962
|
+
"path",
|
1963
|
+
{
|
1964
|
+
fill: "#FFD400",
|
1965
|
+
d: "M119.2,421.2c15.3-8.4,27-14.8,28-15.3c3.2-1.7,6.5-6.2,0-9.7 c-2.1-1.1-13.4-7.3-28-15.3l-20.1,20.2L119.2,421.2z"
|
1966
|
+
}
|
1967
|
+
), /* @__PURE__ */ React18.createElement(
|
1968
|
+
"path",
|
1969
|
+
{
|
1970
|
+
fill: "#FF3333",
|
1971
|
+
d: "M99.1,401.1l-64.2,64.7c1.5,0.2,3.2-0.2,5.2-1.3 c4.2-2.3,48.8-26.7,79.1-43.3L99.1,401.1L99.1,401.1z"
|
1972
|
+
}
|
1973
|
+
), /* @__PURE__ */ React18.createElement(
|
1974
|
+
"path",
|
1975
|
+
{
|
1976
|
+
fill: "#48FF48",
|
1977
|
+
d: "M99.1,401.1l20.1-20.2c0,0-74.6-40.7-79.1-43.1 c-1.7-1-3.6-1.3-5.3-1L99.1,401.1z"
|
1978
|
+
}
|
1979
|
+
), /* @__PURE__ */ React18.createElement(
|
1980
|
+
"path",
|
1981
|
+
{
|
1982
|
+
fill: "#3BCCFF",
|
1983
|
+
d: "M99.1,401.1l-64.3-64.3c-2.6,0.6-4.8,2.9-4.8,7.6 c0,7.5,0,107.5,0,113.8c0,4.3,1.7,7.4,4.9,7.7L99.1,401.1z"
|
1984
|
+
}
|
1985
|
+
))), /* @__PURE__ */ React18.createElement("div", null, /* @__PURE__ */ React18.createElement("div", { className: "hawa-text-xs" }, "GET IT ON"), /* @__PURE__ */ React18.createElement("div", { className: "hawa--mt-1 hawa-font-sans hawa-text-xl hawa-font-semibold" }, "Google Play")))));
|
1986
|
+
};
|
1987
|
+
|
1988
|
+
// elements/badge/Badge.tsx
|
1989
|
+
import React19, { useEffect as useEffect5, useState as useState7, useRef as useRef4 } from "react";
|
1990
|
+
var Badge = ({
|
1991
|
+
anchor,
|
1992
|
+
position = "right",
|
1993
|
+
size = "default",
|
1994
|
+
text,
|
1995
|
+
className
|
1996
|
+
}) => {
|
1997
|
+
const [badgePosition, setBadgePosition] = useState7(null);
|
1998
|
+
const indicatorRef = useRef4(null);
|
1999
|
+
const sizeStyles2 = {
|
2000
|
+
small: { top: 4, left: 6, right: 7, classes: "hawa-w-3 hawa-h-3" },
|
2001
|
+
default: { top: 4, left: 7, right: 5, classes: "hawa-w-3 hawa-h-3" },
|
2002
|
+
large: { top: 6, left: 12, right: 7, classes: "hawa-w-6 hawa-h-6" }
|
2003
|
+
};
|
2004
|
+
useEffect5(() => {
|
2005
|
+
const handlePositioning = () => {
|
2006
|
+
var _a;
|
2007
|
+
if (anchor.current && indicatorRef.current) {
|
2008
|
+
const rect = anchor.current.getBoundingClientRect();
|
2009
|
+
const parentRect = (_a = indicatorRef.current.parentElement) == null ? void 0 : _a.getBoundingClientRect();
|
2010
|
+
const style = window.getComputedStyle(anchor.current);
|
2011
|
+
const marginTop = parseFloat(style.marginTop.replace("px", ""));
|
2012
|
+
const marginRight = parseFloat(style.marginRight.replace("px", ""));
|
2013
|
+
if (parentRect) {
|
2014
|
+
setBadgePosition({
|
2015
|
+
top: rect.top - parentRect.top - marginTop - sizeStyles2[size].top,
|
2016
|
+
left: position === "right" ? parentRect.right - parentRect.left - sizeStyles2[size].left : rect.right - parentRect.left - parentRect.width - marginRight - sizeStyles2[size].right
|
2017
|
+
});
|
2018
|
+
}
|
2019
|
+
}
|
2020
|
+
};
|
2021
|
+
handlePositioning();
|
2022
|
+
window.addEventListener("resize", handlePositioning);
|
2023
|
+
return () => {
|
2024
|
+
window.removeEventListener("resize", handlePositioning);
|
2025
|
+
};
|
2026
|
+
}, [anchor]);
|
2027
|
+
return /* @__PURE__ */ React19.createElement("div", { ref: indicatorRef, className: cn("hawa-relative", className) }, badgePosition && /* @__PURE__ */ React19.createElement(
|
2028
|
+
"div",
|
2029
|
+
{
|
2030
|
+
style: {
|
2031
|
+
position: "absolute",
|
2032
|
+
top: badgePosition == null ? void 0 : badgePosition.top,
|
2033
|
+
left: badgePosition == null ? void 0 : badgePosition.left
|
2034
|
+
},
|
2035
|
+
className: cn(
|
2036
|
+
"hawa-origin-center hawa-rounded-full hawa-bg-red-500 ",
|
2037
|
+
sizeStyles2[size].classes,
|
2038
|
+
"hawa-flex hawa-flex-row hawa-items-center hawa-justify-center hawa-text-[9px] hawa-text-white"
|
2039
|
+
)
|
2040
|
+
},
|
2041
|
+
size === "large" && text && text
|
2042
|
+
));
|
2043
|
+
};
|
2044
|
+
var BadgedComponent = ({
|
2045
|
+
children,
|
2046
|
+
className,
|
2047
|
+
hideBadge,
|
2048
|
+
position,
|
2049
|
+
size,
|
2050
|
+
text
|
2051
|
+
}) => {
|
2052
|
+
const ref = useRef4(null);
|
2053
|
+
return /* @__PURE__ */ React19.createElement("div", { className: cn("hawa-relative hawa-w-fit", className), ref }, !hideBadge && /* @__PURE__ */ React19.createElement(
|
2054
|
+
Badge,
|
2055
|
+
{
|
2056
|
+
size,
|
2057
|
+
text,
|
2058
|
+
position,
|
2059
|
+
anchor: ref,
|
2060
|
+
className: "hawa-z-10"
|
2061
|
+
}
|
2062
|
+
), children);
|
2063
|
+
};
|
2064
|
+
|
2065
|
+
// elements/colorPicker/ColorPicker.tsx
|
2066
|
+
import React20, {
|
2067
|
+
useState as useState8,
|
2068
|
+
useEffect as useEffect6
|
2069
|
+
} from "react";
|
2070
|
+
var ColorPicker = ({
|
2071
|
+
containerProps,
|
2072
|
+
colorPickerProps,
|
2073
|
+
textInputProps,
|
2074
|
+
labelProps,
|
2075
|
+
forceHideHelperText,
|
2076
|
+
isLoading,
|
2077
|
+
preview = false,
|
2078
|
+
...props
|
2079
|
+
}) => {
|
2080
|
+
const [selectedColor, setSelectedColor] = useState8(props.color);
|
2081
|
+
useEffect6(() => {
|
2082
|
+
if (selectedColor && selectedColor[0] !== "#") {
|
2083
|
+
setSelectedColor(`#${selectedColor}`);
|
2084
|
+
}
|
2085
|
+
}, [selectedColor]);
|
2086
|
+
const handleTextInputChange = (e) => {
|
2087
|
+
const inputElement = e.target;
|
2088
|
+
let inputColor = inputElement.value;
|
2089
|
+
if (inputColor[0] !== "#") {
|
2090
|
+
inputColor = `#${inputColor}`;
|
2091
|
+
}
|
2092
|
+
const sanitizedInput = inputColor.replace(/[^a-fA-F0-9#]/g, "");
|
2093
|
+
setSelectedColor(sanitizedInput);
|
2094
|
+
if (props.handleChange) {
|
2095
|
+
props.handleChange(e);
|
2096
|
+
}
|
2097
|
+
};
|
2098
|
+
return /* @__PURE__ */ React20.createElement("div", { className: "hawa-flex hawa-w-fit hawa-flex-col hawa-gap-2" }, props.label && /* @__PURE__ */ React20.createElement(Label, { ...labelProps }, props.label), isLoading ? /* @__PURE__ */ React20.createElement(Skeleton, { style: { height: 40, width: 148 } }) : /* @__PURE__ */ React20.createElement("div", { dir: "ltr", className: "hawa-flex hawa-w-full hawa-flex-row" }, /* @__PURE__ */ React20.createElement(
|
2099
|
+
"div",
|
2100
|
+
{
|
2101
|
+
style: { height: 40, backgroundColor: selectedColor },
|
2102
|
+
className: "hawa-rounded-bl-lg hawa-rounded-tl-lg hawa-border"
|
2103
|
+
},
|
2104
|
+
/* @__PURE__ */ React20.createElement(
|
2105
|
+
"input",
|
2106
|
+
{
|
2107
|
+
disabled: preview,
|
2108
|
+
type: "color",
|
2109
|
+
value: selectedColor,
|
2110
|
+
onChange: (e) => {
|
2111
|
+
setSelectedColor(e.target.value);
|
2112
|
+
if (props.handleChange) {
|
2113
|
+
props.handleChange(e);
|
2114
|
+
}
|
2115
|
+
},
|
2116
|
+
className: cn(
|
2117
|
+
"hawa-mt-0 hawa-h-[38px] hawa-opacity-0",
|
2118
|
+
props.colorPickerClassNames
|
2119
|
+
),
|
2120
|
+
...colorPickerProps
|
2121
|
+
}
|
2122
|
+
)
|
2123
|
+
), /* @__PURE__ */ React20.createElement("div", { className: "hawa-relative hawa-flex hawa-max-h-fit hawa-w-full hawa-flex-col hawa-justify-center hawa-gap-0" }, /* @__PURE__ */ React20.createElement(
|
2124
|
+
"input",
|
2125
|
+
{
|
2126
|
+
disabled: preview,
|
2127
|
+
maxLength: 7,
|
2128
|
+
type: "text",
|
2129
|
+
onInput: handleTextInputChange,
|
2130
|
+
value: selectedColor,
|
2131
|
+
className: cn(
|
2132
|
+
"hawa-block hawa-h-[40px] hawa-w-24 hawa-rounded hawa-rounded-l-none hawa-bg-background hawa-p-2 hawa-text-sm hawa-transition-all",
|
2133
|
+
"hawa-border hawa-border-l-0 hawa-border-l-transparent"
|
2134
|
+
// "hawa-border hawa-border-x-0 hawa-border-x-transparent hawa-border-b-0 hawa-rounded-tr-none"
|
2135
|
+
),
|
2136
|
+
style: {
|
2137
|
+
backgroundColor: preview ? selectedColor : "hsl(var(--background))",
|
2138
|
+
color: preview ? calculateLuminance(selectedColor) > 0.5 ? "black" : "white" : ""
|
2139
|
+
},
|
2140
|
+
...textInputProps
|
2141
|
+
}
|
2142
|
+
))), !forceHideHelperText && /* @__PURE__ */ React20.createElement(
|
2143
|
+
"p",
|
2144
|
+
{
|
2145
|
+
className: cn(
|
2146
|
+
"hawa-my-0 hawa-text-start hawa-text-xs hawa-text-helper-color hawa-transition-all",
|
2147
|
+
props.helperText ? "hawa-h-4 hawa-opacity-100" : "hawa-h-0 hawa-opacity-0"
|
2148
|
+
)
|
2149
|
+
},
|
2150
|
+
props.helperText
|
2151
|
+
));
|
2152
|
+
};
|
2153
|
+
|
2154
|
+
// elements/progressCircle/ProgressCircle.tsx
|
2155
|
+
import React21 from "react";
|
2156
|
+
var size2config = {
|
2157
|
+
xs: {
|
2158
|
+
radius: 15,
|
2159
|
+
strokeWidth: 3
|
2160
|
+
},
|
2161
|
+
sm: {
|
2162
|
+
radius: 19,
|
2163
|
+
strokeWidth: 4
|
2164
|
+
},
|
2165
|
+
md: {
|
2166
|
+
radius: 32,
|
2167
|
+
strokeWidth: 6
|
2168
|
+
},
|
2169
|
+
lg: {
|
2170
|
+
radius: 52,
|
2171
|
+
strokeWidth: 8
|
2172
|
+
},
|
2173
|
+
xl: {
|
2174
|
+
radius: 80,
|
2175
|
+
strokeWidth: 10
|
2176
|
+
}
|
2177
|
+
};
|
2178
|
+
function getLimitedValue(input) {
|
2179
|
+
if (input === void 0) {
|
2180
|
+
return 0;
|
2181
|
+
} else if (input > 100) {
|
2182
|
+
return 100;
|
2183
|
+
} else {
|
2184
|
+
return input;
|
2185
|
+
}
|
2186
|
+
}
|
2187
|
+
var ProgressCircle = React21.forwardRef((props, ref) => {
|
2188
|
+
const {
|
2189
|
+
value: inputValue,
|
2190
|
+
size = "md",
|
2191
|
+
className,
|
2192
|
+
showAnimation = true,
|
2193
|
+
color,
|
2194
|
+
tooltip,
|
2195
|
+
radius: inputRadius,
|
2196
|
+
strokeWidth: inputStrokeWidth,
|
2197
|
+
children,
|
2198
|
+
...other
|
2199
|
+
} = props;
|
2200
|
+
const value = getLimitedValue(inputValue);
|
2201
|
+
const radius = inputRadius != null ? inputRadius : size2config[size].radius;
|
2202
|
+
const strokeWidth = inputStrokeWidth != null ? inputStrokeWidth : size2config[size].strokeWidth;
|
2203
|
+
const normalizedRadius = radius - strokeWidth / 2;
|
2204
|
+
const circumference = normalizedRadius * 2 * Math.PI;
|
2205
|
+
const strokeDashoffset = value / 100 * circumference;
|
2206
|
+
const offset = circumference - strokeDashoffset;
|
2207
|
+
return /* @__PURE__ */ React21.createElement(React21.Fragment, null, /* @__PURE__ */ React21.createElement(
|
2208
|
+
"div",
|
2209
|
+
{
|
2210
|
+
ref,
|
2211
|
+
className: cn(
|
2212
|
+
"hawa-flex hawa-flex-col hawa-items-center hawa-justify-center",
|
2213
|
+
className
|
2214
|
+
)
|
2215
|
+
},
|
2216
|
+
/* @__PURE__ */ React21.createElement(
|
2217
|
+
"svg",
|
2218
|
+
{
|
2219
|
+
width: radius * 2,
|
2220
|
+
height: radius * 2,
|
2221
|
+
viewBox: `0 0 ${radius * 2} ${radius * 2}`,
|
2222
|
+
className: "hawa-rotate-180 hawa-transform"
|
2223
|
+
},
|
2224
|
+
/* @__PURE__ */ React21.createElement(
|
2225
|
+
"circle",
|
2226
|
+
{
|
2227
|
+
r: normalizedRadius,
|
2228
|
+
cx: radius,
|
2229
|
+
cy: radius,
|
2230
|
+
strokeWidth,
|
2231
|
+
fill: "transparent",
|
2232
|
+
stroke: "",
|
2233
|
+
strokeLinecap: "round",
|
2234
|
+
className: cn(
|
2235
|
+
"hawa-transition-colors hawa-ease-linear",
|
2236
|
+
" hawa-stroke-primary/20"
|
2237
|
+
)
|
2238
|
+
}
|
2239
|
+
),
|
2240
|
+
value > 0 ? /* @__PURE__ */ React21.createElement(
|
2241
|
+
"circle",
|
2242
|
+
{
|
2243
|
+
r: normalizedRadius,
|
2244
|
+
cx: radius,
|
2245
|
+
cy: radius,
|
2246
|
+
strokeWidth,
|
2247
|
+
strokeDasharray: circumference + " " + circumference,
|
2248
|
+
strokeDashoffset: offset,
|
2249
|
+
fill: "transparent",
|
2250
|
+
stroke: "",
|
2251
|
+
strokeLinecap: "round",
|
2252
|
+
className: cn(
|
2253
|
+
"hawa-transition-colors hawa-ease-linear",
|
2254
|
+
"hawa-stroke-primary",
|
2255
|
+
showAnimation ? "hawa-transition-all hawa-duration-300 hawa-ease-in-out" : ""
|
2256
|
+
)
|
2257
|
+
}
|
2258
|
+
) : null
|
2259
|
+
),
|
2260
|
+
/* @__PURE__ */ React21.createElement("div", { className: cn("hawa-absolute hawa-flex") }, children)
|
2261
|
+
));
|
2262
|
+
});
|
2263
|
+
ProgressCircle.displayName = "ProgressCircle";
|
2264
|
+
|
2265
|
+
// elements/pagination/Pagination.tsx
|
2266
|
+
import React22 from "react";
|
2267
|
+
import { Pagination as PaginationPrimitive } from "react-headless-pagination";
|
2268
|
+
var Pagination = ({
|
2269
|
+
direction,
|
2270
|
+
totalPages,
|
2271
|
+
currentPage
|
2272
|
+
}) => {
|
2273
|
+
const [page, setPage] = React22.useState(currentPage || 0);
|
2274
|
+
const handlePageChange = (page2) => {
|
2275
|
+
setPage(page2);
|
2276
|
+
};
|
2277
|
+
return /* @__PURE__ */ React22.createElement(
|
2278
|
+
PaginationPrimitive,
|
2279
|
+
{
|
2280
|
+
totalPages,
|
2281
|
+
edgePageCount: 2,
|
2282
|
+
middlePagesSiblingCount: 1,
|
2283
|
+
currentPage: page,
|
2284
|
+
setCurrentPage: handlePageChange,
|
2285
|
+
className: "hawa-flex hawa-h-9 hawa-w-full hawa-select-none hawa-items-center hawa-text-sm hawa-transition-all",
|
2286
|
+
truncableText: "...",
|
2287
|
+
truncableClassName: "hawa-w-10 hawa-px-0.5 hawa-text-center"
|
2288
|
+
},
|
2289
|
+
/* @__PURE__ */ React22.createElement(
|
2290
|
+
PaginationPrimitive.PrevButton,
|
2291
|
+
{
|
2292
|
+
as: /* @__PURE__ */ React22.createElement(
|
2293
|
+
"button",
|
2294
|
+
{
|
2295
|
+
"aria-label": "Previous Table Page",
|
2296
|
+
className: cn(
|
2297
|
+
"hawa-min-w-9 hawa-flex hawa-h-9 hawa-w-9 hawa-items-center hawa-justify-center hawa-rounded hawa-border hawa-bg-card",
|
2298
|
+
direction === "rtl" && "hawa-rotate-180"
|
2299
|
+
),
|
2300
|
+
style: { minWidth: 36 }
|
2301
|
+
},
|
2302
|
+
/* @__PURE__ */ React22.createElement(
|
2303
|
+
"svg",
|
2304
|
+
{
|
2305
|
+
xmlns: "http://www.w3.org/2000/svg",
|
2306
|
+
width: "24",
|
2307
|
+
height: "24",
|
2308
|
+
viewBox: "0 0 24 24",
|
2309
|
+
fill: "none",
|
2310
|
+
stroke: "currentColor",
|
2311
|
+
strokeWidth: "2",
|
2312
|
+
strokeLinecap: "round",
|
2313
|
+
strokeLinejoin: "round"
|
2314
|
+
},
|
2315
|
+
/* @__PURE__ */ React22.createElement("path", { d: "m15 18-6-6 6-6" })
|
2316
|
+
)
|
2317
|
+
),
|
2318
|
+
className: cn(
|
2319
|
+
"hawa-mr-2 hawa-flex hawa-items-center hawa-text-gray-500 hover:hawa-text-gray-600 dark:hover:hawa-text-gray-200",
|
2320
|
+
{
|
2321
|
+
"hawa-cursor-pointer": page !== 0,
|
2322
|
+
"hawa-opacity-50": page === 0
|
2323
|
+
}
|
2324
|
+
)
|
2325
|
+
},
|
2326
|
+
"Previous"
|
2327
|
+
),
|
2328
|
+
/* @__PURE__ */ React22.createElement("nav", { className: "hawa-flex hawa-flex-grow hawa-justify-center" }, /* @__PURE__ */ React22.createElement("ul", { className: "hawa-flex hawa-items-center hawa-gap-1" }, /* @__PURE__ */ React22.createElement(
|
2329
|
+
PaginationPrimitive.PageButton,
|
2330
|
+
{
|
2331
|
+
className: "hawa-tap-highlight-transparent hawa-text-default-foreground data-[focus-visible=true]:hawa-outline-focus data-[disabled=true]:hawa-text-default-300 hawa-min-w-9 hawa-text-small hawa-box-border hawa-flex hawa-h-9 hawa-w-9 hawa-cursor-pointer hawa-touch-none hawa-select-none hawa-flex-wrap hawa-items-center hawa-justify-center hawa-truncate hawa-rounded hawa-border hawa-bg-card hawa-outline-none hawa-transition-all hover:hawa-scale-[1.1] data-[disabled=true]:hawa-pointer-events-none data-[focus-visible=true]:hawa-z-10 data-[pressed=true]:hawa-scale-[0.97] data-[focus-visible=true]:hawa-outline-2 data-[focus-visible=true]:hawa-outline-offset-2",
|
2332
|
+
activeClassName: "hawa-bg-primary hawa-text-primary-foreground hawa-transition-all"
|
2333
|
+
}
|
2334
|
+
))),
|
2335
|
+
/* @__PURE__ */ React22.createElement(
|
2336
|
+
PaginationPrimitive.NextButton,
|
2337
|
+
{
|
2338
|
+
as: /* @__PURE__ */ React22.createElement(
|
2339
|
+
"button",
|
2340
|
+
{
|
2341
|
+
"aria-label": "Previous Table Page",
|
2342
|
+
className: cn(
|
2343
|
+
"hawa-min-w-9 hawa-flex hawa-h-9 hawa-w-9 hawa-items-center hawa-justify-center hawa-rounded hawa-border hawa-bg-card",
|
2344
|
+
direction === "ltr" && "hawa-rotate-180"
|
2345
|
+
),
|
2346
|
+
style: { minWidth: 36 }
|
2347
|
+
},
|
2348
|
+
/* @__PURE__ */ React22.createElement(
|
2349
|
+
"svg",
|
2350
|
+
{
|
2351
|
+
xmlns: "http://www.w3.org/2000/svg",
|
2352
|
+
width: "24",
|
2353
|
+
height: "24",
|
2354
|
+
viewBox: "0 0 24 24",
|
2355
|
+
fill: "none",
|
2356
|
+
stroke: "currentColor",
|
2357
|
+
strokeWidth: "2",
|
2358
|
+
strokeLinecap: "round",
|
2359
|
+
strokeLinejoin: "round"
|
2360
|
+
},
|
2361
|
+
/* @__PURE__ */ React22.createElement("path", { d: "m15 18-6-6 6-6" })
|
2362
|
+
)
|
2363
|
+
),
|
2364
|
+
className: cn(
|
2365
|
+
"hawa-mr-2 hawa-flex hawa-items-center hawa-text-gray-500 hover:hawa-text-gray-600 dark:hover:hawa-text-gray-200",
|
2366
|
+
{
|
2367
|
+
"hawa-cursor-pointer": page !== totalPages - 1,
|
2368
|
+
"hawa-opacity-50": page === totalPages - 1
|
2369
|
+
}
|
2370
|
+
)
|
2371
|
+
},
|
2372
|
+
"Next"
|
2373
|
+
)
|
2374
|
+
);
|
2375
|
+
};
|
2376
|
+
|
2377
|
+
// elements/passwordInput/PasswordInput.tsx
|
2378
|
+
import React23, { useEffect as useEffect7, useState as useState9 } from "react";
|
2379
|
+
var PasswordStrengthIndicator = ({ strength }) => {
|
2380
|
+
const strengthLevels = [
|
2381
|
+
"none",
|
2382
|
+
"very-weak",
|
2383
|
+
"weak",
|
2384
|
+
"medium",
|
2385
|
+
"strong",
|
2386
|
+
"very-strong"
|
2387
|
+
];
|
2388
|
+
const strengthColors = {
|
2389
|
+
none: "hawa-bg-red-700",
|
2390
|
+
"very-weak": "hawa-bg-red-600",
|
2391
|
+
weak: "hawa-bg-red-500",
|
2392
|
+
medium: "hawa-bg-yellow-500",
|
2393
|
+
strong: "hawa-bg-green-400",
|
2394
|
+
"very-strong": "hawa-bg-green-600"
|
2395
|
+
};
|
2396
|
+
const currentStrengthLevel = strengthLevels[strength];
|
2397
|
+
const width = {
|
2398
|
+
none: "0%",
|
2399
|
+
"very-weak": "20%",
|
2400
|
+
weak: "40%",
|
2401
|
+
medium: "60%",
|
2402
|
+
strong: "80%",
|
2403
|
+
"very-strong": "100%"
|
2404
|
+
}[currentStrengthLevel];
|
2405
|
+
return /* @__PURE__ */ React23.createElement("div", { className: "hawa-mt-0.5 hawa-h-2 hawa-w-full hawa-rounded hawa-bg-gray-200" }, /* @__PURE__ */ React23.createElement(
|
2406
|
+
"div",
|
2407
|
+
{
|
2408
|
+
className: `${strengthColors[currentStrengthLevel]} hawa-h-full hawa-rounded hawa-transition-all hawa-duration-300`,
|
2409
|
+
style: { width }
|
2410
|
+
}
|
2411
|
+
));
|
2412
|
+
};
|
2413
|
+
var PasswordInput = ({
|
2414
|
+
hidePopover,
|
2415
|
+
...props
|
2416
|
+
}) => {
|
2417
|
+
const [inputValue, setInputValue] = useState9("");
|
2418
|
+
const [isInputFocused, setIsInputFocused] = useState9(false);
|
2419
|
+
const [currentStr, setCurrentStr] = useState9(0);
|
2420
|
+
const [passwordVisible, setPasswordVisible] = useState9(false);
|
2421
|
+
const [lengthCriteriaMet, setLengthCriteriaMet] = useState9(false);
|
2422
|
+
const [numberCriteriaMet, setNumberCriteriaMet] = useState9(false);
|
2423
|
+
const [specialCharCriteriaMet, setSpecialCharCriteriaMet] = useState9(false);
|
2424
|
+
const [lowercaseCriteriaMet, setLowercaseCriteriaMet] = useState9(false);
|
2425
|
+
const [uppercaseCriteriaMet, setUppercaseCriteriaMet] = useState9(false);
|
2426
|
+
useEffect7(() => {
|
2427
|
+
const calculateStrength = () => {
|
2428
|
+
let strengthScore = 0;
|
2429
|
+
if (lengthCriteriaMet)
|
2430
|
+
strengthScore += 1;
|
2431
|
+
if (numberCriteriaMet)
|
2432
|
+
strengthScore += 1;
|
2433
|
+
if (specialCharCriteriaMet)
|
2434
|
+
strengthScore += 1;
|
2435
|
+
if (lowercaseCriteriaMet)
|
2436
|
+
strengthScore += 1;
|
2437
|
+
if (uppercaseCriteriaMet)
|
2438
|
+
strengthScore += 1;
|
2439
|
+
return strengthScore;
|
2440
|
+
};
|
2441
|
+
const currentStrengthScore = calculateStrength();
|
2442
|
+
setCurrentStr(currentStrengthScore);
|
2443
|
+
}, [inputValue]);
|
2444
|
+
const handleInputChange = (event) => {
|
2445
|
+
const newPassword = event.target.value;
|
2446
|
+
if (props.onChange) {
|
2447
|
+
props.onChange(event);
|
2448
|
+
}
|
2449
|
+
setInputValue(newPassword);
|
2450
|
+
setLengthCriteriaMet(newPassword.length >= 8);
|
2451
|
+
setNumberCriteriaMet(/\d/.test(newPassword));
|
2452
|
+
setSpecialCharCriteriaMet(/[!@#$%^&*(),.?":{}|<>]/.test(newPassword));
|
2453
|
+
setLowercaseCriteriaMet(/[a-z]/.test(newPassword));
|
2454
|
+
setUppercaseCriteriaMet(/[A-Z]/.test(newPassword));
|
2455
|
+
};
|
2456
|
+
const handleInputFocus = () => {
|
2457
|
+
if (!hidePopover) {
|
2458
|
+
setIsInputFocused(true);
|
2459
|
+
}
|
2460
|
+
};
|
2461
|
+
const handleInputBlur = () => {
|
2462
|
+
setIsInputFocused(false);
|
2463
|
+
};
|
2464
|
+
const getCriteriaClass = (isMet) => isMet ? "hawa-flex hawa-flex-row hawa-gap-2 hawa-text-sm hawa-items-center hawa-text-green-500" : "hawa-flex hawa-flex-row hawa-gap-2 hawa-text-sm hawa-items-center hawa-text-red-600";
|
2465
|
+
return /* @__PURE__ */ React23.createElement("div", null, /* @__PURE__ */ React23.createElement(
|
2466
|
+
Popover,
|
2467
|
+
{
|
2468
|
+
width: "trigger",
|
2469
|
+
sideOffset: 20,
|
2470
|
+
open: isInputFocused,
|
2471
|
+
onOpenChange: setIsInputFocused,
|
2472
|
+
triggerProps: { asChild: true },
|
2473
|
+
contentProps: { onOpenAutoFocus: (e) => e.preventDefault() },
|
2474
|
+
trigger: /* @__PURE__ */ React23.createElement(
|
2475
|
+
"div",
|
2476
|
+
{
|
2477
|
+
onClick: (e) => {
|
2478
|
+
e.preventDefault();
|
2479
|
+
if (!hidePopover) {
|
2480
|
+
setIsInputFocused(true);
|
2481
|
+
}
|
2482
|
+
}
|
2483
|
+
},
|
2484
|
+
/* @__PURE__ */ React23.createElement(
|
2485
|
+
Input,
|
2486
|
+
{
|
2487
|
+
width: "full",
|
2488
|
+
className: "hawa-w-full",
|
2489
|
+
label: "test",
|
2490
|
+
onChange: handleInputChange,
|
2491
|
+
onFocus: handleInputFocus,
|
2492
|
+
onBlur: handleInputBlur,
|
2493
|
+
type: passwordVisible ? "text" : "password",
|
2494
|
+
endIcon: /* @__PURE__ */ React23.createElement(
|
2495
|
+
"div",
|
2496
|
+
{
|
2497
|
+
className: "hawa-cursor-pointer",
|
2498
|
+
onClick: () => setPasswordVisible(!passwordVisible)
|
2499
|
+
},
|
2500
|
+
passwordVisible ? /* @__PURE__ */ React23.createElement(EyeIcon, { className: "hawa-text-gray-500" }) : /* @__PURE__ */ React23.createElement(HiddenEyeIcon, { className: "hawa-text-gray-500" }),
|
2501
|
+
" "
|
2502
|
+
)
|
2503
|
+
}
|
2504
|
+
)
|
2505
|
+
)
|
2506
|
+
},
|
2507
|
+
/* @__PURE__ */ React23.createElement("div", { className: "hawa-rounded hawa-p-2" }, /* @__PURE__ */ React23.createElement("ul", { className: "hawa-rounded hawa-p-2" }, /* @__PURE__ */ React23.createElement("li", { className: getCriteriaClass(lengthCriteriaMet) }, lengthCriteriaMet ? /* @__PURE__ */ React23.createElement(CheckMark, { size: "sm" }) : /* @__PURE__ */ React23.createElement(UncheckMark, { size: "sm" }), "At least 8 characters long"), /* @__PURE__ */ React23.createElement("li", { className: getCriteriaClass(numberCriteriaMet) }, numberCriteriaMet ? /* @__PURE__ */ React23.createElement(CheckMark, { size: "sm" }) : /* @__PURE__ */ React23.createElement(UncheckMark, { size: "sm" }), "At least 1 number"), /* @__PURE__ */ React23.createElement("li", { className: getCriteriaClass(specialCharCriteriaMet) }, specialCharCriteriaMet ? /* @__PURE__ */ React23.createElement(CheckMark, { size: "sm" }) : /* @__PURE__ */ React23.createElement(UncheckMark, { size: "sm" }), "At least 1 special character"), /* @__PURE__ */ React23.createElement("li", { className: getCriteriaClass(lowercaseCriteriaMet) }, lowercaseCriteriaMet ? /* @__PURE__ */ React23.createElement(CheckMark, { size: "sm" }) : /* @__PURE__ */ React23.createElement(UncheckMark, { size: "sm" }), "At least 1 lowercase letter"), /* @__PURE__ */ React23.createElement("li", { className: getCriteriaClass(uppercaseCriteriaMet) }, uppercaseCriteriaMet ? /* @__PURE__ */ React23.createElement(CheckMark, { size: "sm" }) : /* @__PURE__ */ React23.createElement(UncheckMark, { size: "sm" }), "At least 1 uppercase letter")))
|
2508
|
+
), /* @__PURE__ */ React23.createElement(PasswordStrengthIndicator, { strength: currentStr }));
|
2509
|
+
};
|
2510
|
+
|
2511
|
+
// elements/slider/Slider.tsx
|
2512
|
+
import * as React24 from "react";
|
2513
|
+
import * as SliderPrimitive from "@radix-ui/react-slider";
|
2514
|
+
var Slider = React24.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React24.createElement(
|
2515
|
+
SliderPrimitive.Root,
|
2516
|
+
{
|
2517
|
+
ref,
|
2518
|
+
className: cn(
|
2519
|
+
"hawa-relative hawa-flex hawa-w-full hawa-touch-none hawa-select-none hawa-items-center",
|
2520
|
+
className
|
2521
|
+
),
|
2522
|
+
...props
|
2523
|
+
},
|
2524
|
+
/* @__PURE__ */ React24.createElement(SliderPrimitive.Track, { className: "hawa-relative hawa-h-2 hawa-w-full hawa-grow hawa-overflow-hidden hawa-rounded-full hawa-border hawa-bg-background" }, /* @__PURE__ */ React24.createElement(SliderPrimitive.Range, { className: "hawa-absolute hawa-h-full hawa-bg-primary" })),
|
2525
|
+
/* @__PURE__ */ React24.createElement(SliderPrimitive.Thumb, { className: "hawa-block hawa-h-5 hawa-w-5 hawa-rounded-full hawa-border-2 hawa-border-primary hawa-bg-background hawa-ring-offset-background hawa-transition-colors focus-visible:hawa-outline-none focus-visible:hawa-ring-2 focus-visible:hawa-ring-ring focus-visible:hawa-ring-offset-2 disabled:hawa-pointer-events-none disabled:hawa-opacity-50" })
|
2526
|
+
));
|
2527
|
+
Slider.displayName = SliderPrimitive.Root.displayName;
|
2528
|
+
|
2529
|
+
// elements/simpleTable/SimpleTable.tsx
|
2530
|
+
import * as React25 from "react";
|
2531
|
+
import {
|
2532
|
+
flexRender as flexRender2,
|
2533
|
+
getCoreRowModel as getCoreRowModel2,
|
2534
|
+
useReactTable as useReactTable2
|
2535
|
+
} from "@tanstack/react-table";
|
2536
|
+
var SimpleTable = ({
|
2537
|
+
columns,
|
2538
|
+
data,
|
2539
|
+
classNames,
|
2540
|
+
...props
|
2541
|
+
}) => {
|
2542
|
+
var _a, _b;
|
2543
|
+
const table = useReactTable2({
|
2544
|
+
data,
|
2545
|
+
columns,
|
2546
|
+
getCoreRowModel: getCoreRowModel2()
|
2547
|
+
});
|
2548
|
+
return /* @__PURE__ */ React25.createElement(
|
2549
|
+
"div",
|
2550
|
+
{
|
2551
|
+
className: cn(
|
2552
|
+
"hawa-flex hawa-w-full hawa-flex-col hawa-gap-4",
|
2553
|
+
classNames
|
2554
|
+
)
|
2555
|
+
},
|
2556
|
+
props.isLoading ? /* @__PURE__ */ React25.createElement(Skeleton, { className: "h-[130px] w-full" }) : /* @__PURE__ */ React25.createElement("div", { className: "hawa-rounded" }, /* @__PURE__ */ React25.createElement(Table, null, table.getAllColumns().length > 0 && /* @__PURE__ */ React25.createElement(TableHeader, null, table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ React25.createElement(TableRow, { key: headerGroup.id }, headerGroup.headers.map((header) => {
|
2557
|
+
return /* @__PURE__ */ React25.createElement(
|
2558
|
+
TableHead,
|
2559
|
+
{
|
2560
|
+
condensed: props.condensed,
|
2561
|
+
dir: props.direction,
|
2562
|
+
key: header.id
|
2563
|
+
},
|
2564
|
+
header.isPlaceholder ? null : flexRender2(
|
2565
|
+
header.column.columnDef.header,
|
2566
|
+
header.getContext()
|
2567
|
+
)
|
2568
|
+
);
|
2569
|
+
})))), /* @__PURE__ */ React25.createElement(TableBody, null, ((_a = table.getRowModel().rows) == null ? void 0 : _a.length) ? table.getRowModel().rows.map((row) => /* @__PURE__ */ React25.createElement(
|
2570
|
+
TableRow,
|
2571
|
+
{
|
2572
|
+
key: row.id,
|
2573
|
+
"data-state": row.getIsSelected() && "selected"
|
2574
|
+
},
|
2575
|
+
row.getVisibleCells().map((cell) => {
|
2576
|
+
var _a2;
|
2577
|
+
return /* @__PURE__ */ React25.createElement(
|
2578
|
+
TableCell,
|
2579
|
+
{
|
2580
|
+
dir: props.direction,
|
2581
|
+
padding: props.condensed ? "condensed" : (_a2 = cell.column.columnDef.meta) == null ? void 0 : _a2.padding,
|
2582
|
+
key: cell.id
|
2583
|
+
},
|
2584
|
+
flexRender2(
|
2585
|
+
cell.column.columnDef.cell,
|
2586
|
+
cell.getContext()
|
2587
|
+
)
|
2588
|
+
);
|
2589
|
+
})
|
2590
|
+
)) : /* @__PURE__ */ React25.createElement(TableRow, null, /* @__PURE__ */ React25.createElement(
|
2591
|
+
TableCell,
|
2592
|
+
{
|
2593
|
+
colSpan: columns.length,
|
2594
|
+
className: "hawa-h-24 hawa-text-center"
|
2595
|
+
},
|
2596
|
+
(_b = props.texts) == null ? void 0 : _b.noData
|
2597
|
+
)))))
|
2598
|
+
);
|
2599
|
+
};
|
2600
|
+
|
2601
|
+
// elements/scrollIndicator/ScrollIndicator.tsx
|
2602
|
+
import React26, { useState as useState10, useEffect as useEffect8 } from "react";
|
2603
|
+
var ScrollIndicator = ({
|
2604
|
+
anchor,
|
2605
|
+
inContainer = false
|
2606
|
+
}) => {
|
2607
|
+
const [scrollPercentage, setScrollPercentage] = useState10(0);
|
2608
|
+
const onScroll = () => {
|
2609
|
+
const scrollElement = anchor.current;
|
2610
|
+
if (scrollElement) {
|
2611
|
+
const { scrollTop, scrollHeight, clientHeight } = scrollElement;
|
2612
|
+
const totalScroll = scrollHeight - clientHeight;
|
2613
|
+
const scrollPosition = scrollTop;
|
2614
|
+
const percentageScrolled = scrollPosition / totalScroll * 100;
|
2615
|
+
setScrollPercentage(percentageScrolled);
|
2616
|
+
}
|
2617
|
+
};
|
2618
|
+
useEffect8(() => {
|
2619
|
+
if (!anchor.current)
|
2620
|
+
return;
|
2621
|
+
anchor.current.addEventListener("scroll", onScroll);
|
2622
|
+
return () => {
|
2623
|
+
var _a;
|
2624
|
+
(_a = anchor.current) == null ? void 0 : _a.removeEventListener("scroll", onScroll);
|
2625
|
+
};
|
2626
|
+
}, [anchor]);
|
2627
|
+
return /* @__PURE__ */ React26.createElement(
|
2628
|
+
"div",
|
2629
|
+
{
|
2630
|
+
style: {
|
2631
|
+
position: inContainer ? "absolute" : "fixed",
|
2632
|
+
top: 0,
|
2633
|
+
left: 0,
|
2634
|
+
height: "5px",
|
2635
|
+
width: `${scrollPercentage}%`,
|
2636
|
+
backgroundColor: "hsl(var(--primary))"
|
2637
|
+
}
|
2638
|
+
}
|
2639
|
+
);
|
2640
|
+
};
|
2641
|
+
|
2642
|
+
// elements/codeBlock/CodeBlock.tsx
|
2643
|
+
import React27, { useState as useState11 } from "react";
|
2644
|
+
import {
|
2645
|
+
Highlight,
|
2646
|
+
themes,
|
2647
|
+
Prism
|
2648
|
+
} from "prism-react-renderer";
|
2649
|
+
(typeof global !== "undefined" ? global : window).Prism = Prism;
|
2650
|
+
__require("prismjs/components/prism-bash");
|
2651
|
+
var CodeBlock = ({
|
2652
|
+
tabs,
|
2653
|
+
code,
|
2654
|
+
fileName,
|
2655
|
+
className,
|
2656
|
+
language = "javascript",
|
2657
|
+
// default to JavaScript if no language is provided
|
2658
|
+
width = "full",
|
2659
|
+
...props
|
2660
|
+
}) => {
|
2661
|
+
const clipboard = useClipboard();
|
2662
|
+
const [selectedTab, setSelectedTab] = useState11(0);
|
2663
|
+
const theme = themes.oceanicNext;
|
2664
|
+
let widthStyles = {
|
2665
|
+
full: "hawa-w-full",
|
2666
|
+
md: "hawa-w-full hawa-max-w-md",
|
2667
|
+
sm: "hawa-w-full hawa-max-w-sm",
|
2668
|
+
xs: "hawa-w-full hawa-max-w-xs"
|
2669
|
+
};
|
2670
|
+
return /* @__PURE__ */ React27.createElement(
|
2671
|
+
"div",
|
2672
|
+
{
|
2673
|
+
className: cn(
|
2674
|
+
widthStyles[width],
|
2675
|
+
"hawa-w-full hawa-flex-col hawa-items-center hawa-rounded hawa-bg-background hawa-text-left hawa-text-white sm:hawa-text-base",
|
2676
|
+
className
|
2677
|
+
)
|
2678
|
+
},
|
2679
|
+
fileName && /* @__PURE__ */ React27.createElement(
|
2680
|
+
"div",
|
2681
|
+
{
|
2682
|
+
className: cn(
|
2683
|
+
"hawa-flex hawa-flex-row hawa-gap-2 hawa-rounded-t hawa-p-2 hawa-py-0.5 hawa-pb-0 hawa-font-mono hawa-text-foreground",
|
2684
|
+
fileName && tabs ? "hawa-bg-primary/10" : "hawa-bg-primary/15"
|
2685
|
+
)
|
2686
|
+
},
|
2687
|
+
/* @__PURE__ */ React27.createElement(
|
2688
|
+
"div",
|
2689
|
+
{
|
2690
|
+
className: cn(
|
2691
|
+
"hawa-font-mono hawa-w-full hawa-max-w-[52px] hawa-rounded-inner hawa-p-1 hawa-py-0.5 hawa-text-center hawa-text-[0.75rem]"
|
2692
|
+
)
|
2693
|
+
},
|
2694
|
+
fileName
|
2695
|
+
)
|
2696
|
+
),
|
2697
|
+
tabs && /* @__PURE__ */ React27.createElement(
|
2698
|
+
"div",
|
2699
|
+
{
|
2700
|
+
className: cn(
|
2701
|
+
// hawa-bg-gray-300 dark:hawa-bg-red-600
|
2702
|
+
"hawa-flex hawa-flex-row hawa-gap-2 hawa-rounded-t hawa-p-1 hawa-bg-primary/15 hawa-pb-0 hawa-font-mono hawa-text-foreground",
|
2703
|
+
tabs && fileName && "hawa-rounded-t-none"
|
2704
|
+
)
|
2705
|
+
},
|
2706
|
+
tabs.map((tab, i) => /* @__PURE__ */ React27.createElement(
|
2707
|
+
"div",
|
2708
|
+
{
|
2709
|
+
key: i,
|
2710
|
+
className: cn(
|
2711
|
+
selectedTab === i ? " hawa-border-b-2 hawa-border-primary" : "hawa-bg-transparent"
|
2712
|
+
)
|
2713
|
+
},
|
2714
|
+
/* @__PURE__ */ React27.createElement(
|
2715
|
+
"div",
|
2716
|
+
{
|
2717
|
+
onClick: () => setSelectedTab(i),
|
2718
|
+
className: cn(
|
2719
|
+
"hawa-mb-0.5 hawa-w-full hawa-max-w-[52px] hawa-cursor-pointer hawa-rounded-inner hawa-p-2 hawa-py-0.5 hawa-text-center hawa-text-[0.7rem] hawa-transition-all hover:hawa-bg-muted-foreground/20"
|
2720
|
+
)
|
2721
|
+
},
|
2722
|
+
tab.title
|
2723
|
+
)
|
2724
|
+
))
|
2725
|
+
),
|
2726
|
+
/* @__PURE__ */ React27.createElement(
|
2727
|
+
"div",
|
2728
|
+
{
|
2729
|
+
className: cn(
|
2730
|
+
"hawa-flex hawa-w-full hawa-flex-row hawa-items-start hawa-justify-between hawa-border hawa-bg-gray-700 hawa-p-0 hawa-text-left hawa-text-sm sm:hawa-text-base ",
|
2731
|
+
tabs || fileName ? "hawa-rounded-b hawa-rounded-t-none" : "hawa-rounded"
|
2732
|
+
)
|
2733
|
+
},
|
2734
|
+
/* @__PURE__ */ React27.createElement(
|
2735
|
+
Highlight,
|
2736
|
+
{
|
2737
|
+
theme,
|
2738
|
+
code: tabs ? tabs[selectedTab].code : code || "",
|
2739
|
+
language
|
2740
|
+
},
|
2741
|
+
({ className: className2, style, tokens, getLineProps, getTokenProps }) => /* @__PURE__ */ React27.createElement("pre", { className: "hawa-min-h-[37.75px] hawa-w-full hawa-overflow-auto hawa-p-4 hawa-font-mono hawa-text-foreground" }, tokens.map((line, i) => /* @__PURE__ */ React27.createElement("div", { key: i, ...getLineProps({ line }) }, props.lineNumbers && /* @__PURE__ */ React27.createElement("span", { className: "hawa-mr-4" }, i + 1), line.map((token, key) => /* @__PURE__ */ React27.createElement("span", { key, ...getTokenProps({ token }) })))))
|
2742
|
+
),
|
2743
|
+
/* @__PURE__ */ React27.createElement("div", { className: "hawa-flex hawa-w-fit hawa-flex-row hawa-items-center hawa-gap-2 hawa-p-2" }, /* @__PURE__ */ React27.createElement(
|
2744
|
+
Tooltip,
|
2745
|
+
{
|
2746
|
+
open: clipboard.copied,
|
2747
|
+
side: "left",
|
2748
|
+
content: /* @__PURE__ */ React27.createElement("div", null, "Copied!"),
|
2749
|
+
triggerProps: {
|
2750
|
+
asChild: true
|
2751
|
+
}
|
2752
|
+
},
|
2753
|
+
/* @__PURE__ */ React27.createElement(
|
2754
|
+
Button,
|
2755
|
+
{
|
2756
|
+
size: "icon",
|
2757
|
+
onClick: () => clipboard.copy(tabs ? tabs[selectedTab].code : code),
|
2758
|
+
variant: "outline",
|
2759
|
+
className: "hawa-text-gray-200 hawa-opacity-50 "
|
2760
|
+
},
|
2761
|
+
/* @__PURE__ */ React27.createElement(
|
2762
|
+
"svg",
|
2763
|
+
{
|
2764
|
+
"aria-label": "Copy",
|
2765
|
+
stroke: "currentColor",
|
2766
|
+
fill: "none",
|
2767
|
+
strokeWidth: "2",
|
2768
|
+
viewBox: "0 0 24 24",
|
2769
|
+
strokeLinecap: "round",
|
2770
|
+
strokeLinejoin: "round",
|
2771
|
+
height: "1em",
|
2772
|
+
width: "1em"
|
2773
|
+
},
|
2774
|
+
/* @__PURE__ */ React27.createElement("rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2" }),
|
2775
|
+
/* @__PURE__ */ React27.createElement("path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" })
|
2776
|
+
)
|
2777
|
+
)
|
2778
|
+
))
|
2779
|
+
)
|
2780
|
+
);
|
2781
|
+
};
|
2782
|
+
|
2783
|
+
// elements/carousel/Carousel.tsx
|
2784
|
+
import React28, { useEffect as useEffect10, useState as useState12 } from "react";
|
2785
|
+
import useEmblaCarousel from "embla-carousel-react";
|
2786
|
+
var Carousel = ({
|
2787
|
+
items,
|
2788
|
+
showArrows,
|
2789
|
+
options,
|
2790
|
+
autoplay,
|
2791
|
+
direction = "ltr",
|
2792
|
+
autoplayInterval = 3e3,
|
2793
|
+
...props
|
2794
|
+
}) => {
|
2795
|
+
const [emblaRef, emblaApi] = useEmblaCarousel({
|
2796
|
+
...options,
|
2797
|
+
direction,
|
2798
|
+
loop: autoplay ? true : (options == null ? void 0 : options.loop) || false
|
2799
|
+
});
|
2800
|
+
const [selectedIndex, setSelectedIndex] = useState12(0);
|
2801
|
+
useEffect10(() => {
|
2802
|
+
function selectHandler() {
|
2803
|
+
const index = emblaApi == null ? void 0 : emblaApi.selectedScrollSnap();
|
2804
|
+
setSelectedIndex(index || 0);
|
2805
|
+
}
|
2806
|
+
emblaApi == null ? void 0 : emblaApi.on("select", selectHandler);
|
2807
|
+
return () => {
|
2808
|
+
emblaApi == null ? void 0 : emblaApi.off("select", selectHandler);
|
2809
|
+
};
|
2810
|
+
}, [emblaApi]);
|
2811
|
+
useEffect10(() => {
|
2812
|
+
let autoplayTimer;
|
2813
|
+
if (autoplay && emblaApi) {
|
2814
|
+
autoplayTimer = setInterval(() => {
|
2815
|
+
emblaApi.scrollNext();
|
2816
|
+
}, autoplayInterval);
|
2817
|
+
}
|
2818
|
+
return () => {
|
2819
|
+
if (autoplayTimer)
|
2820
|
+
clearInterval(autoplayTimer);
|
2821
|
+
};
|
2822
|
+
}, [emblaApi, autoplay, autoplayInterval]);
|
2823
|
+
const length = React28.Children.count(items);
|
2824
|
+
const canScrollNext = !!(emblaApi == null ? void 0 : emblaApi.canScrollNext());
|
2825
|
+
const canScrollPrev = !!(emblaApi == null ? void 0 : emblaApi.canScrollPrev());
|
2826
|
+
return /* @__PURE__ */ React28.createElement("div", { className: " hawa-relative hawa-h-full" }, /* @__PURE__ */ React28.createElement("div", { className: "hawa-h-full hawa-overflow-hidden" }, /* @__PURE__ */ React28.createElement("div", { className: "hawa-h-full", ref: emblaRef }, /* @__PURE__ */ React28.createElement("div", { className: "hawa-flex hawa-h-full" }, items == null ? void 0 : items.map((item, i) => /* @__PURE__ */ React28.createElement(
|
2827
|
+
"div",
|
2828
|
+
{
|
2829
|
+
key: i,
|
2830
|
+
className: "hawa-flex hawa-h-full hawa-min-w-0 hawa-flex-[0_0_100%] hawa-items-center hawa-justify-center"
|
2831
|
+
},
|
2832
|
+
item
|
2833
|
+
))))), /* @__PURE__ */ React28.createElement(
|
2834
|
+
Dots,
|
2835
|
+
{
|
2836
|
+
direction,
|
2837
|
+
itemsLength: length,
|
2838
|
+
selectedIndex,
|
2839
|
+
onDotClick: (index) => emblaApi == null ? void 0 : emblaApi.scrollTo(index)
|
2840
|
+
}
|
2841
|
+
), showArrows && /* @__PURE__ */ React28.createElement(
|
2842
|
+
CarouselControls,
|
2843
|
+
{
|
2844
|
+
canScrollNext,
|
2845
|
+
canScrollPrev,
|
2846
|
+
onNext: () => emblaApi == null ? void 0 : emblaApi.scrollNext(),
|
2847
|
+
onPrev: () => emblaApi == null ? void 0 : emblaApi.scrollPrev()
|
2848
|
+
}
|
2849
|
+
));
|
2850
|
+
};
|
2851
|
+
var Dots = ({
|
2852
|
+
onDotClick,
|
2853
|
+
itemsLength,
|
2854
|
+
selectedIndex,
|
2855
|
+
direction
|
2856
|
+
}) => {
|
2857
|
+
const arr = new Array(itemsLength).fill(0);
|
2858
|
+
return /* @__PURE__ */ React28.createElement(
|
2859
|
+
"div",
|
2860
|
+
{
|
2861
|
+
dir: direction,
|
2862
|
+
className: "hawa-z-50 hawa-my-2 hawa-flex hawa-justify-center hawa-gap-1"
|
2863
|
+
},
|
2864
|
+
arr.map((_, index) => {
|
2865
|
+
const selected = index === selectedIndex;
|
2866
|
+
return /* @__PURE__ */ React28.createElement(
|
2867
|
+
"div",
|
2868
|
+
{
|
2869
|
+
key: index,
|
2870
|
+
onClick: () => onDotClick(index),
|
2871
|
+
className: cn(
|
2872
|
+
"hawa-h-2 hawa-rounded-full hawa-bg-primary hawa-transition-all hawa-duration-300 hover:hawa-cursor-pointer",
|
2873
|
+
!selected ? "hawa-w-2 hawa-opacity-50" : "hawa-w-6 hawa-opacity-100"
|
2874
|
+
)
|
2875
|
+
}
|
2876
|
+
);
|
2877
|
+
})
|
2878
|
+
);
|
2879
|
+
};
|
2880
|
+
var CarouselControls = (props) => {
|
2881
|
+
return /* @__PURE__ */ React28.createElement("div", { className: "hawa-flex hawa-justify-end hawa-gap-2 " }, /* @__PURE__ */ React28.createElement(
|
2882
|
+
"button",
|
2883
|
+
{
|
2884
|
+
onClick: () => props.canScrollPrev && props.onPrev(),
|
2885
|
+
disabled: !props.canScrollPrev,
|
2886
|
+
className: cn(
|
2887
|
+
"hawa-absolute hawa-start-0 hawa-top-1/2 -hawa-translate-y-2 hawa-rounded-full hawa-p-2 hawa-text-white ",
|
2888
|
+
!props.canScrollPrev && "hawa-bg-primary/50",
|
2889
|
+
props.canScrollPrev && "hawa-bg-primary"
|
2890
|
+
)
|
2891
|
+
},
|
2892
|
+
/* @__PURE__ */ React28.createElement(
|
2893
|
+
"svg",
|
2894
|
+
{
|
2895
|
+
"aria-label": "Chevron Right Icon",
|
2896
|
+
stroke: "currentColor",
|
2897
|
+
fill: "currentColor",
|
2898
|
+
viewBox: "0 0 16 16",
|
2899
|
+
className: "hawa-h-2 hawa-w-2 hawa-shrink-0 hawa-rotate-180 hawa-transition-transform hawa-duration-200 "
|
2900
|
+
},
|
2901
|
+
/* @__PURE__ */ React28.createElement("path", { d: "M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z" })
|
2902
|
+
)
|
2903
|
+
), /* @__PURE__ */ React28.createElement(
|
2904
|
+
"button",
|
2905
|
+
{
|
2906
|
+
onClick: () => props.canScrollNext && props.onNext(),
|
2907
|
+
disabled: !props.canScrollNext,
|
2908
|
+
className: cn(
|
2909
|
+
"hawa-absolute hawa-end-0 hawa-top-1/2 -hawa-translate-y-2 hawa-rounded-full hawa-p-2 hawa-text-white ",
|
2910
|
+
!props.canScrollNext && "hawa-bg-primary/50",
|
2911
|
+
props.canScrollNext && "hawa-bg-primary"
|
2912
|
+
)
|
2913
|
+
},
|
2914
|
+
/* @__PURE__ */ React28.createElement(
|
2915
|
+
"svg",
|
2916
|
+
{
|
2917
|
+
"aria-label": "Chevron Right Icon",
|
2918
|
+
stroke: "currentColor",
|
2919
|
+
fill: "currentColor",
|
2920
|
+
viewBox: "0 0 16 16",
|
2921
|
+
className: "hawa-h-2 hawa-w-2 hawa-shrink-0 hawa-transition-transform hawa-duration-200 "
|
2922
|
+
},
|
2923
|
+
/* @__PURE__ */ React28.createElement("path", { d: "M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z" })
|
2924
|
+
)
|
2925
|
+
));
|
2926
|
+
};
|
2927
|
+
|
2928
|
+
// elements/count/Count.tsx
|
2929
|
+
import React29 from "react";
|
2930
|
+
var Count = (props) => {
|
2931
|
+
return /* @__PURE__ */ React29.createElement("div", { className: "hawa-flex hawa-h-fit hawa-flex-row hawa-items-center hawa-gap-2 hawa-px-2" }, /* @__PURE__ */ React29.createElement("div", null, props.icon), /* @__PURE__ */ React29.createElement("div", { className: "hawa-text-sm" }, props.count));
|
2932
|
+
};
|
2933
|
+
|
2934
|
+
// elements/toast/Toast.tsx
|
2935
|
+
import * as React30 from "react";
|
2936
|
+
import * as ToastPrimitives from "@radix-ui/react-toast";
|
2937
|
+
import { cva as cva2 } from "class-variance-authority";
|
2938
|
+
var toastVariants = cva2(
|
2939
|
+
"hawa-group hawa-z-[900] hawa-pointer-events-auto hawa-relative hawa-flex hawa-w-full hawa-items-center hawa-justify-between hawa-overflow-hidden hawa-rounded-md hawa-border hawa-shadow-lg hawa-transition-all data-[swipe=cancel]:hawa-translate-x-0 data-[swipe=end]:hawa-translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:hawa-translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:hawa-transition-none data-[state=open]:hawa-animate-in data-[state=closed]:hawa-animate-out data-[swipe=end]:hawa-animate-out data-[state=closed]:hawa-fade-out-80 data-[state=open]:hawa-slide-in-from-top-full data-[state=open]:sm:hawa-slide-in-from-bottom-full",
|
2940
|
+
{
|
2941
|
+
variants: {
|
2942
|
+
variant: {
|
2943
|
+
default: "hawa-border hawa-bg-background hawa-text-foreground",
|
2944
|
+
destructive: "hawa-destructive hawa-group hawa-border-destructive hawa-bg-destructive hawa-text-destructive-foreground"
|
2945
|
+
},
|
2946
|
+
severity: {
|
2947
|
+
info: "hawa-info hawa-group hawa-text-info-foreground hawa-bg-info",
|
2948
|
+
warning: "hawa-warning hawa-group hawa-text-warning-foreground hawa-bg-warning",
|
2949
|
+
error: "hawa-error hawa-group hawa-border-error hawa-bg-error hawa-text-white",
|
2950
|
+
success: "hawa-success hawa-group hawa-text-success-foreground hawa-bg-success",
|
2951
|
+
none: ""
|
2952
|
+
}
|
2953
|
+
},
|
2954
|
+
defaultVariants: { variant: "default" }
|
2955
|
+
}
|
2956
|
+
);
|
2957
|
+
var sizeStyles = {
|
2958
|
+
default: "hawa-text-sm",
|
2959
|
+
// Update this based on the desired padding for rtl
|
2960
|
+
sm: "hawa-text-xs"
|
2961
|
+
};
|
2962
|
+
var ToastProvider = ToastPrimitives.Provider;
|
2963
|
+
var ToastViewport = React30.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React30.createElement("div", null, /* @__PURE__ */ React30.createElement(
|
2964
|
+
ToastPrimitives.Viewport,
|
2965
|
+
{
|
2966
|
+
ref,
|
2967
|
+
className: cn(
|
2968
|
+
"hawa-fixed hawa-top-0 hawa-z-[100] hawa-flex hawa-max-h-screen hawa-w-full hawa-flex-col-reverse hawa-p-4 sm:hawa-bottom-0 sm:hawa-right-0 sm:hawa-top-auto sm:hawa-flex-col md:hawa-max-w-[420px]",
|
2969
|
+
className
|
2970
|
+
),
|
2971
|
+
...props
|
2972
|
+
}
|
2973
|
+
), /* @__PURE__ */ React30.createElement("div", null, "inside ToastViewport")));
|
2974
|
+
ToastViewport.displayName = ToastPrimitives.Viewport.displayName;
|
2975
|
+
var Toast = React30.forwardRef(({ className, variant, severity = "none", direction, ...props }, ref) => {
|
2976
|
+
return /* @__PURE__ */ React30.createElement(
|
2977
|
+
ToastPrimitives.Root,
|
2978
|
+
{
|
2979
|
+
ref,
|
2980
|
+
className: cn(
|
2981
|
+
toastVariants({ variant, severity }),
|
2982
|
+
className,
|
2983
|
+
direction === "rtl" ? "data-[state=closed]:hawa-slide-out-to-left-full" : "data-[state=closed]:hawa-slide-out-to-right-full"
|
2984
|
+
),
|
2985
|
+
dir: direction,
|
2986
|
+
...props
|
2987
|
+
}
|
2988
|
+
);
|
2989
|
+
});
|
2990
|
+
Toast.displayName = ToastPrimitives.Root.displayName;
|
2991
|
+
var ToastAction = React30.forwardRef(({ className, ...props }, ref) => {
|
2992
|
+
return /* @__PURE__ */ React30.createElement(
|
2993
|
+
ToastPrimitives.Action,
|
2994
|
+
{
|
2995
|
+
ref,
|
2996
|
+
className: cn(
|
2997
|
+
"hawa-inline-flex hawa-h-8 hawa-shrink-0 hawa-items-center hawa-justify-center hawa-rounded-md hawa-border hawa-bg-transparent hawa-px-3 hawa-text-sm hawa-font-medium hawa-ring-offset-background hawa-transition-colors hover:hawa-bg-secondary hover:hawa-text-secondary-foreground focus:hawa-outline-none focus:hawa-ring-2 focus:hawa-ring-ring focus:hawa-ring-offset-2 disabled:hawa-pointer-events-none disabled:hawa-opacity-50",
|
2998
|
+
"group-[.info]:hawa-border-muted/40 group-[.info]:hover:hawa-border-info/30 group-[.info]:hover:hawa-bg-info group-[.info]:hover:hawa-text-info-foreground group-[.info]:focus:hawa-ring-info",
|
2999
|
+
"group-[.error]:hawa-border-muted/40 group-[.error]:hover:hawa-border-error/30 group-[.error]:hover:hawa-bg-error group-[.error]:hover:hawa-text-error-foreground group-[.error]:focus:hawa-ring-error",
|
3000
|
+
"group-[.success]:hawa-border-muted/40 group-[.success]:hover:hawa-border-success/30 group-[.success]:hover:hawa-bg-success group-[.success]:hover:hawa-text-success-foreground group-[.success]:focus:hawa-ring-success",
|
3001
|
+
"group-[.warning]:hawa-border-muted/40 group-[.warning]:hover:hawa-border-warning/30 group-[.warning]:hover:hawa-bg-warning group-[.warning]:hover:hawa-text-warning-foreground group-[.warning]:focus:hawa-ring-warning",
|
3002
|
+
"hawa-whitespace-nowrap",
|
3003
|
+
className
|
3004
|
+
),
|
3005
|
+
...props
|
3006
|
+
}
|
3007
|
+
);
|
3008
|
+
});
|
3009
|
+
ToastAction.displayName = ToastPrimitives.Action.displayName;
|
3010
|
+
var ToastClose = React30.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React30.createElement(
|
3011
|
+
ToastPrimitives.Close,
|
3012
|
+
{
|
3013
|
+
ref,
|
3014
|
+
className: cn(
|
3015
|
+
// "hawa-absolute hawa-start-2 hawa-top-2",
|
3016
|
+
// "group-hover:hawa-opacity-100",
|
3017
|
+
"hawa-opacity-100",
|
3018
|
+
"hawa-rounded-md hawa-p-1 hawa-text-foreground/50 hawa-transition-opacity hover:hawa-text-foreground focus:hawa-opacity-100 focus:hawa-outline-none focus:hawa-ring-2 group-[.destructive]:hawa-text-red-300 group-[.destructive]:hover:hawa-text-red-50 group-[.destructive]:focus:hawa-ring-red-400 group-[.destructive]:focus:hawa-ring-offset-red-600",
|
3019
|
+
className
|
3020
|
+
),
|
3021
|
+
"toast-close": "",
|
3022
|
+
...props
|
3023
|
+
},
|
3024
|
+
/* @__PURE__ */ React30.createElement(
|
3025
|
+
"svg",
|
3026
|
+
{
|
3027
|
+
"aria-label": "Close Icon",
|
3028
|
+
"aria-hidden": "true",
|
3029
|
+
className: "hawa-icon",
|
3030
|
+
fill: "currentColor",
|
3031
|
+
viewBox: "0 0 20 20"
|
3032
|
+
},
|
3033
|
+
/* @__PURE__ */ React30.createElement(
|
3034
|
+
"path",
|
3035
|
+
{
|
3036
|
+
fillRule: "evenodd",
|
3037
|
+
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",
|
3038
|
+
clipRule: "evenodd"
|
3039
|
+
}
|
3040
|
+
)
|
3041
|
+
)
|
3042
|
+
));
|
3043
|
+
ToastClose.displayName = ToastPrimitives.Close.displayName;
|
3044
|
+
var ToastTitle = React30.forwardRef(({ className, size = "default", ...props }, ref) => /* @__PURE__ */ React30.createElement(
|
3045
|
+
ToastPrimitives.Title,
|
3046
|
+
{
|
3047
|
+
ref,
|
3048
|
+
className: cn(
|
3049
|
+
"hawa-select-text hawa-text-sm hawa-font-semibold",
|
3050
|
+
sizeStyles[size],
|
3051
|
+
className
|
3052
|
+
),
|
3053
|
+
...props
|
3054
|
+
}
|
3055
|
+
));
|
3056
|
+
ToastTitle.displayName = ToastPrimitives.Title.displayName;
|
3057
|
+
var ToastDescription = React30.forwardRef(({ className, size = "default", ...props }, ref) => /* @__PURE__ */ React30.createElement(
|
3058
|
+
ToastPrimitives.Description,
|
3059
|
+
{
|
3060
|
+
ref,
|
3061
|
+
className: cn(
|
3062
|
+
"hawa-select-text hawa-opacity-90",
|
3063
|
+
sizeStyles[size],
|
3064
|
+
className
|
3065
|
+
),
|
3066
|
+
...props
|
3067
|
+
}
|
3068
|
+
));
|
3069
|
+
ToastDescription.displayName = ToastPrimitives.Description.displayName;
|
3070
|
+
|
3071
|
+
// elements/toaster/Toaster.tsx
|
3072
|
+
import React31 from "react";
|
3073
|
+
function Toaster(props) {
|
3074
|
+
const { toasts } = useToast();
|
3075
|
+
let isRTL = props.direction === "rtl";
|
3076
|
+
return /* @__PURE__ */ React31.createElement("div", null, /* @__PURE__ */ React31.createElement("div", null, "I AM INSIDE MAIN TOASTER"), /* @__PURE__ */ React31.createElement(ToastProvider, { swipeDirection: isRTL ? "left" : "right" }, /* @__PURE__ */ React31.createElement("div", null, "I AM INSIDE TOASTPROVIDER"), toasts.map(function({
|
3077
|
+
id,
|
3078
|
+
title,
|
3079
|
+
description,
|
3080
|
+
size = "default",
|
3081
|
+
action,
|
3082
|
+
...toastProps
|
3083
|
+
}) {
|
3084
|
+
return /* @__PURE__ */ React31.createElement(Toast, { direction: props.direction, key: id, ...toastProps }, /* @__PURE__ */ React31.createElement("div", null, "I AM INSIDE TOAST"), /* @__PURE__ */ React31.createElement(
|
3085
|
+
"div",
|
3086
|
+
{
|
3087
|
+
className: cn(
|
3088
|
+
"hawa-flex hawa-w-full hawa-flex-row hawa-gap-2",
|
3089
|
+
action && "hawa-justify-between"
|
3090
|
+
)
|
3091
|
+
},
|
3092
|
+
/* @__PURE__ */ React31.createElement("div", { className: "hawa-flex hawa-h-full hawa-flex-col hawa-p-2 hawa-pe-0" }, /* @__PURE__ */ React31.createElement(ToastClose, null)),
|
3093
|
+
/* @__PURE__ */ React31.createElement("div", { className: "hawa-mx-0 hawa-h-auto hawa-max-h-full hawa-w-px hawa-bg-primary-foreground/10" }),
|
3094
|
+
/* @__PURE__ */ React31.createElement(
|
3095
|
+
"div",
|
3096
|
+
{
|
3097
|
+
className: cn(
|
3098
|
+
"hawa-flex hawa-w-full hawa-flex-row hawa-justify-between hawa-gap-2",
|
3099
|
+
{
|
3100
|
+
"hawa-p-4": size === "default",
|
3101
|
+
"hawa-p-2": size === "sm"
|
3102
|
+
}
|
3103
|
+
)
|
3104
|
+
},
|
3105
|
+
/* @__PURE__ */ React31.createElement("div", { className: "hawa-grid hawa-gap-1 hawa-text-start" }, title && /* @__PURE__ */ React31.createElement(ToastTitle, { size }, title), description && /* @__PURE__ */ React31.createElement(ToastDescription, { size }, description)),
|
3106
|
+
action && /* @__PURE__ */ React31.createElement("div", { className: "hawa-flex hawa-flex-col hawa-justify-center" }, action)
|
3107
|
+
)
|
3108
|
+
));
|
3109
|
+
}), /* @__PURE__ */ React31.createElement(
|
3110
|
+
ToastViewport,
|
3111
|
+
{
|
3112
|
+
className: cn("hawa-gap-2", isRTL && "hawa-fixed hawa-left-0")
|
3113
|
+
}
|
3114
|
+
)));
|
3115
|
+
}
|
3116
|
+
|
3117
|
+
// elements/destroyableCard/DestroyableCard.tsx
|
3118
|
+
import React32, { useRef as useRef5, useState as useState13 } from "react";
|
3119
|
+
var DestroyableCard = ({
|
3120
|
+
position = "bottom-right",
|
3121
|
+
fixed,
|
3122
|
+
direction,
|
3123
|
+
...props
|
3124
|
+
}) => {
|
3125
|
+
const [closed, setClosed] = useState13(false);
|
3126
|
+
const popUpRef = useRef5(null);
|
3127
|
+
const boxPosition = {
|
3128
|
+
"bottom-right": "hawa-right-4 hawa-bottom-4",
|
3129
|
+
"bottom-left": "hawa-left-4 hawa-bottom-4"
|
3130
|
+
};
|
3131
|
+
return /* @__PURE__ */ React32.createElement(
|
3132
|
+
"div",
|
3133
|
+
{
|
3134
|
+
className: cn(
|
3135
|
+
"hawa-transition-all",
|
3136
|
+
closed ? "hawa-opacity-0" : "hawa-opacity-100"
|
3137
|
+
),
|
3138
|
+
ref: popUpRef
|
3139
|
+
},
|
3140
|
+
/* @__PURE__ */ React32.createElement(
|
3141
|
+
Card,
|
3142
|
+
{
|
3143
|
+
className: cn(
|
3144
|
+
fixed ? "hawa-fixed" : "hawa-relative",
|
3145
|
+
fixed && position && boxPosition[position]
|
3146
|
+
),
|
3147
|
+
dir: direction
|
3148
|
+
},
|
3149
|
+
/* @__PURE__ */ React32.createElement(
|
3150
|
+
"button",
|
3151
|
+
{
|
3152
|
+
type: "button",
|
3153
|
+
className: cn(
|
3154
|
+
direction === "rtl" ? "hawa-left-2" : "hawa-right-2",
|
3155
|
+
"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"
|
3156
|
+
),
|
3157
|
+
"data-dismiss-target": "#destroyable-card",
|
3158
|
+
"aria-label": "Close",
|
3159
|
+
onClick: () => {
|
3160
|
+
setClosed(true);
|
3161
|
+
setTimeout(() => {
|
3162
|
+
if (popUpRef == null ? void 0 : popUpRef.current) {
|
3163
|
+
popUpRef == null ? void 0 : popUpRef.current.removeChild(popUpRef == null ? void 0 : popUpRef.current.children[0]);
|
3164
|
+
}
|
3165
|
+
}, 200);
|
3166
|
+
}
|
3167
|
+
},
|
3168
|
+
/* @__PURE__ */ React32.createElement(
|
3169
|
+
"svg",
|
3170
|
+
{
|
3171
|
+
"aria-hidden": "true",
|
3172
|
+
className: "hawa-h-5 hawa-w-5",
|
3173
|
+
fill: "currentColor",
|
3174
|
+
viewBox: "0 0 20 20"
|
3175
|
+
},
|
3176
|
+
/* @__PURE__ */ React32.createElement(
|
3177
|
+
"path",
|
3178
|
+
{
|
3179
|
+
fillRule: "evenodd",
|
3180
|
+
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",
|
3181
|
+
clipRule: "evenodd"
|
3182
|
+
}
|
3183
|
+
)
|
3184
|
+
)
|
3185
|
+
),
|
3186
|
+
/* @__PURE__ */ React32.createElement(CardContent, { headless: true }, props.children)
|
3187
|
+
)
|
3188
|
+
);
|
3189
|
+
};
|
3190
|
+
|
3191
|
+
// elements/interfaceSettings/InterfaceSettings.tsx
|
3192
|
+
import React33, { useState as useState14 } from "react";
|
3193
|
+
var InterfaceSettings = ({
|
3194
|
+
orientation = "horizontal",
|
3195
|
+
width = "default",
|
3196
|
+
handleColorMode,
|
3197
|
+
handleLanguage,
|
3198
|
+
...props
|
3199
|
+
}) => {
|
3200
|
+
const [color, setColor] = useState14(props.currentColorMode);
|
3201
|
+
const [language, setLanguage] = useState14(props.currentLanguage);
|
3202
|
+
let orientationStyle = {
|
3203
|
+
horizontal: "hawa-flex hawa-flex-row hawa-justify-between",
|
3204
|
+
vertical: "hawa-flex hawa-flex-col hawa-items-center hawa-gap-2"
|
3205
|
+
};
|
3206
|
+
return /* @__PURE__ */ React33.createElement("div", { className: cn(orientationStyle[orientation]) }, /* @__PURE__ */ React33.createElement(
|
3207
|
+
Radio,
|
3208
|
+
{
|
3209
|
+
width,
|
3210
|
+
defaultValue: language,
|
3211
|
+
onChange: (e) => {
|
3212
|
+
if (handleLanguage) {
|
3213
|
+
handleLanguage(e.value);
|
3214
|
+
}
|
3215
|
+
setLanguage(e);
|
3216
|
+
},
|
3217
|
+
design: "tabs",
|
3218
|
+
options: [
|
3219
|
+
{ value: "ar", label: "\u0639\u0631\u0628\u064A" },
|
3220
|
+
{ value: "en", label: "English" }
|
3221
|
+
]
|
3222
|
+
}
|
3223
|
+
), /* @__PURE__ */ React33.createElement(
|
3224
|
+
Radio,
|
3225
|
+
{
|
3226
|
+
width,
|
3227
|
+
defaultValue: color,
|
3228
|
+
onChange: (e) => {
|
3229
|
+
if (handleColorMode) {
|
3230
|
+
handleColorMode(e.value);
|
3231
|
+
}
|
3232
|
+
setColor(e);
|
3233
|
+
},
|
3234
|
+
design: "tabs",
|
3235
|
+
options: [
|
3236
|
+
{
|
3237
|
+
value: "light",
|
3238
|
+
label: /* @__PURE__ */ React33.createElement(
|
3239
|
+
"svg",
|
3240
|
+
{
|
3241
|
+
width: "15",
|
3242
|
+
height: "15",
|
3243
|
+
viewBox: "0 0 15 15",
|
3244
|
+
fill: "none",
|
3245
|
+
xmlns: "http://www.w3.org/2000/svg",
|
3246
|
+
className: "hawa-h-[1.2rem] hawa-w-[1.2rem] hawa-rotate-0 hawa-scale-100 hawa-transition-all dark:hawa--rotate-90"
|
3247
|
+
},
|
3248
|
+
/* @__PURE__ */ React33.createElement(
|
3249
|
+
"path",
|
3250
|
+
{
|
3251
|
+
d: "M7.5 0C7.77614 0 8 0.223858 8 0.5V2.5C8 2.77614 7.77614 3 7.5 3C7.22386 3 7 2.77614 7 2.5V0.5C7 0.223858 7.22386 0 7.5 0ZM2.1967 2.1967C2.39196 2.00144 2.70854 2.00144 2.90381 2.1967L4.31802 3.61091C4.51328 3.80617 4.51328 4.12276 4.31802 4.31802C4.12276 4.51328 3.80617 4.51328 3.61091 4.31802L2.1967 2.90381C2.00144 2.70854 2.00144 2.39196 2.1967 2.1967ZM0.5 7C0.223858 7 0 7.22386 0 7.5C0 7.77614 0.223858 8 0.5 8H2.5C2.77614 8 3 7.77614 3 7.5C3 7.22386 2.77614 7 2.5 7H0.5ZM2.1967 12.8033C2.00144 12.608 2.00144 12.2915 2.1967 12.0962L3.61091 10.682C3.80617 10.4867 4.12276 10.4867 4.31802 10.682C4.51328 10.8772 4.51328 11.1938 4.31802 11.3891L2.90381 12.8033C2.70854 12.9986 2.39196 12.9986 2.1967 12.8033ZM12.5 7C12.2239 7 12 7.22386 12 7.5C12 7.77614 12.2239 8 12.5 8H14.5C14.7761 8 15 7.77614 15 7.5C15 7.22386 14.7761 7 14.5 7H12.5ZM10.682 4.31802C10.4867 4.12276 10.4867 3.80617 10.682 3.61091L12.0962 2.1967C12.2915 2.00144 12.608 2.00144 12.8033 2.1967C12.9986 2.39196 12.9986 2.70854 12.8033 2.90381L11.3891 4.31802C11.1938 4.51328 10.8772 4.51328 10.682 4.31802ZM8 12.5C8 12.2239 7.77614 12 7.5 12C7.22386 12 7 12.2239 7 12.5V14.5C7 14.7761 7.22386 15 7.5 15C7.77614 15 8 14.7761 8 14.5V12.5ZM10.682 10.682C10.8772 10.4867 11.1938 10.4867 11.3891 10.682L12.8033 12.0962C12.9986 12.2915 12.9986 12.608 12.8033 12.8033C12.608 12.9986 12.2915 12.9986 12.0962 12.8033L10.682 11.3891C10.4867 11.1938 10.4867 10.8772 10.682 10.682ZM5.5 7.5C5.5 6.39543 6.39543 5.5 7.5 5.5C8.60457 5.5 9.5 6.39543 9.5 7.5C9.5 8.60457 8.60457 9.5 7.5 9.5C6.39543 9.5 5.5 8.60457 5.5 7.5ZM7.5 4.5C5.84315 4.5 4.5 5.84315 4.5 7.5C4.5 9.15685 5.84315 10.5 7.5 10.5C9.15685 10.5 10.5 9.15685 10.5 7.5C10.5 5.84315 9.15685 4.5 7.5 4.5Z",
|
3252
|
+
fill: "currentColor"
|
3253
|
+
}
|
3254
|
+
)
|
3255
|
+
)
|
3256
|
+
},
|
3257
|
+
{
|
3258
|
+
value: "dark",
|
3259
|
+
label: /* @__PURE__ */ React33.createElement(
|
3260
|
+
"svg",
|
3261
|
+
{
|
3262
|
+
xmlns: "http://www.w3.org/2000/svg",
|
3263
|
+
width: "24",
|
3264
|
+
height: "24",
|
3265
|
+
viewBox: "0 0 24 24",
|
3266
|
+
fill: "none",
|
3267
|
+
stroke: "currentColor",
|
3268
|
+
className: "hawa-h-[1.2rem] hawa-w-[1.2rem] hawa-transition-all dark:hawa-rotate-0 dark:hawa-scale-100"
|
3269
|
+
},
|
3270
|
+
/* @__PURE__ */ React33.createElement("path", { d: "M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z" })
|
3271
|
+
)
|
3272
|
+
}
|
3273
|
+
]
|
3274
|
+
}
|
3275
|
+
));
|
3276
|
+
};
|
3277
|
+
export {
|
3278
|
+
Accordion,
|
3279
|
+
AccordionContent,
|
3280
|
+
AccordionItem,
|
3281
|
+
AccordionRoot,
|
3282
|
+
AccordionTrigger,
|
3283
|
+
Alert,
|
3284
|
+
AppStores,
|
3285
|
+
Avatar,
|
3286
|
+
BackToTop,
|
3287
|
+
Badge,
|
3288
|
+
BadgedComponent,
|
3289
|
+
Breadcrumb,
|
3290
|
+
Button,
|
3291
|
+
Card,
|
3292
|
+
CardContent,
|
3293
|
+
CardDescription,
|
3294
|
+
CardFooter,
|
3295
|
+
CardHeader,
|
3296
|
+
CardTitle,
|
3297
|
+
Carousel,
|
3298
|
+
Checkbox,
|
3299
|
+
Chip,
|
3300
|
+
CodeBlock,
|
3301
|
+
ColorPicker,
|
3302
|
+
Combobox,
|
3303
|
+
Command,
|
3304
|
+
CommandDialog,
|
3305
|
+
CommandEmpty,
|
3306
|
+
CommandGroup,
|
3307
|
+
CommandInput,
|
3308
|
+
CommandItem,
|
3309
|
+
CommandList,
|
3310
|
+
CommandSeparator,
|
3311
|
+
CommandShortcut,
|
3312
|
+
Count,
|
3313
|
+
DataTable,
|
3314
|
+
DestroyableCard,
|
3315
|
+
Dialog,
|
3316
|
+
DialogBody,
|
3317
|
+
DialogCarousel,
|
3318
|
+
DialogCarouselContent,
|
3319
|
+
DialogContent,
|
3320
|
+
DialogDescription,
|
3321
|
+
DialogFooter,
|
3322
|
+
DialogHeader,
|
3323
|
+
DialogPortal,
|
3324
|
+
DialogStep,
|
3325
|
+
DialogSteps,
|
3326
|
+
DialogTitle,
|
3327
|
+
DialogTrigger,
|
3328
|
+
DropdownMenu,
|
3329
|
+
DropdownMenuCheckboxItem,
|
3330
|
+
DropdownMenuContent,
|
3331
|
+
DropdownMenuGroup,
|
3332
|
+
DropdownMenuItem,
|
3333
|
+
DropdownMenuLabel,
|
3334
|
+
DropdownMenuPortal,
|
3335
|
+
DropdownMenuRadio,
|
3336
|
+
DropdownMenuRadioGroup,
|
3337
|
+
DropdownMenuRadioItem,
|
3338
|
+
DropdownMenuRoot,
|
3339
|
+
DropdownMenuSeparator,
|
3340
|
+
DropdownMenuShortcut,
|
3341
|
+
DropdownMenuSub,
|
3342
|
+
DropdownMenuSubContent,
|
3343
|
+
DropdownMenuSubTrigger,
|
3344
|
+
DropdownMenuTrigger,
|
3345
|
+
FileDropzone,
|
3346
|
+
FileUploader,
|
3347
|
+
Input,
|
3348
|
+
InterfaceSettings,
|
3349
|
+
Label,
|
3350
|
+
Loading,
|
3351
|
+
Logos,
|
3352
|
+
NavigationMenu,
|
3353
|
+
NavigationMenuContent,
|
3354
|
+
NavigationMenuIndicator,
|
3355
|
+
NavigationMenuItem,
|
3356
|
+
NavigationMenuLink,
|
3357
|
+
NavigationMenuList,
|
3358
|
+
NavigationMenuRoot,
|
3359
|
+
NavigationMenuTrigger,
|
3360
|
+
NavigationMenuViewport,
|
3361
|
+
Pagination,
|
3362
|
+
PasswordInput,
|
3363
|
+
PasswordStrengthIndicator,
|
3364
|
+
PhoneInput,
|
3365
|
+
PinInput,
|
3366
|
+
Popover,
|
3367
|
+
PopoverContent,
|
3368
|
+
PopoverTrigger,
|
3369
|
+
Progress,
|
3370
|
+
ProgressCircle,
|
3371
|
+
Radio,
|
3372
|
+
ScrollArea,
|
3373
|
+
ScrollBar,
|
3374
|
+
ScrollIndicator,
|
3375
|
+
Select,
|
3376
|
+
Separator,
|
3377
|
+
Sheet,
|
3378
|
+
SheetClose,
|
3379
|
+
SheetContent,
|
3380
|
+
SheetDescription,
|
3381
|
+
SheetFooter,
|
3382
|
+
SheetHeader,
|
3383
|
+
SheetOverlay,
|
3384
|
+
SheetPortal,
|
3385
|
+
SheetTitle,
|
3386
|
+
SheetTrigger,
|
3387
|
+
SimpleTable,
|
3388
|
+
Skeleton,
|
3389
|
+
Slider,
|
3390
|
+
SortButton,
|
3391
|
+
StandardNavigationMenuItem,
|
3392
|
+
StopPropagationWrapper,
|
3393
|
+
Switch,
|
3394
|
+
Table,
|
3395
|
+
TableBody,
|
3396
|
+
TableCaption,
|
3397
|
+
TableCell,
|
3398
|
+
TableFooter,
|
3399
|
+
TableHead,
|
3400
|
+
TableHeader,
|
3401
|
+
TableRow,
|
3402
|
+
Tabs,
|
3403
|
+
TabsContent,
|
3404
|
+
TabsList,
|
3405
|
+
TabsTrigger,
|
3406
|
+
Textarea,
|
3407
|
+
Toast,
|
3408
|
+
ToastAction,
|
3409
|
+
ToastClose,
|
3410
|
+
ToastDescription,
|
3411
|
+
ToastProvider,
|
3412
|
+
ToastTitle,
|
3413
|
+
ToastViewport,
|
3414
|
+
Toaster,
|
3415
|
+
Tooltip,
|
3416
|
+
buttonVariants,
|
3417
|
+
navigationMenuTriggerStyle
|
3418
|
+
};
|