@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,194 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __create = Object.create;
|
3
|
+
var __defProp = Object.defineProperty;
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
8
|
+
var __export = (target, all) => {
|
9
|
+
for (var name in all)
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
11
|
+
};
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
14
|
+
for (let key of __getOwnPropNames(from))
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
17
|
+
}
|
18
|
+
return to;
|
19
|
+
};
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
26
|
+
mod
|
27
|
+
));
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
29
|
+
|
30
|
+
// elements/carousel/index.ts
|
31
|
+
var carousel_exports = {};
|
32
|
+
__export(carousel_exports, {
|
33
|
+
Carousel: () => Carousel
|
34
|
+
});
|
35
|
+
module.exports = __toCommonJS(carousel_exports);
|
36
|
+
|
37
|
+
// elements/carousel/Carousel.tsx
|
38
|
+
var import_react = __toESM(require("react"));
|
39
|
+
|
40
|
+
// util/index.ts
|
41
|
+
var import_clsx = require("clsx");
|
42
|
+
var import_tailwind_merge = require("tailwind-merge");
|
43
|
+
function cn(...inputs) {
|
44
|
+
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
|
45
|
+
}
|
46
|
+
|
47
|
+
// elements/carousel/Carousel.tsx
|
48
|
+
var import_embla_carousel_react = __toESM(require("embla-carousel-react"));
|
49
|
+
var Carousel = ({
|
50
|
+
items,
|
51
|
+
showArrows,
|
52
|
+
options,
|
53
|
+
autoplay,
|
54
|
+
direction = "ltr",
|
55
|
+
autoplayInterval = 3e3,
|
56
|
+
...props
|
57
|
+
}) => {
|
58
|
+
const [emblaRef, emblaApi] = (0, import_embla_carousel_react.default)({
|
59
|
+
...options,
|
60
|
+
direction,
|
61
|
+
loop: autoplay ? true : options?.loop || false
|
62
|
+
});
|
63
|
+
const [selectedIndex, setSelectedIndex] = (0, import_react.useState)(0);
|
64
|
+
(0, import_react.useEffect)(() => {
|
65
|
+
function selectHandler() {
|
66
|
+
const index = emblaApi?.selectedScrollSnap();
|
67
|
+
setSelectedIndex(index || 0);
|
68
|
+
}
|
69
|
+
emblaApi?.on("select", selectHandler);
|
70
|
+
return () => {
|
71
|
+
emblaApi?.off("select", selectHandler);
|
72
|
+
};
|
73
|
+
}, [emblaApi]);
|
74
|
+
(0, import_react.useEffect)(() => {
|
75
|
+
let autoplayTimer;
|
76
|
+
if (autoplay && emblaApi) {
|
77
|
+
autoplayTimer = setInterval(() => {
|
78
|
+
emblaApi.scrollNext();
|
79
|
+
}, autoplayInterval);
|
80
|
+
}
|
81
|
+
return () => {
|
82
|
+
if (autoplayTimer)
|
83
|
+
clearInterval(autoplayTimer);
|
84
|
+
};
|
85
|
+
}, [emblaApi, autoplay, autoplayInterval]);
|
86
|
+
const length = import_react.default.Children.count(items);
|
87
|
+
const canScrollNext = !!emblaApi?.canScrollNext();
|
88
|
+
const canScrollPrev = !!emblaApi?.canScrollPrev();
|
89
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: " hawa-relative hawa-h-full" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "hawa-h-full hawa-overflow-hidden" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "hawa-h-full", ref: emblaRef }, /* @__PURE__ */ import_react.default.createElement("div", { className: "hawa-flex hawa-h-full" }, items?.map((item, i) => /* @__PURE__ */ import_react.default.createElement(
|
90
|
+
"div",
|
91
|
+
{
|
92
|
+
key: i,
|
93
|
+
className: "hawa-flex hawa-h-full hawa-min-w-0 hawa-flex-[0_0_100%] hawa-items-center hawa-justify-center"
|
94
|
+
},
|
95
|
+
item
|
96
|
+
))))), /* @__PURE__ */ import_react.default.createElement(
|
97
|
+
Dots,
|
98
|
+
{
|
99
|
+
direction,
|
100
|
+
itemsLength: length,
|
101
|
+
selectedIndex,
|
102
|
+
onDotClick: (index) => emblaApi?.scrollTo(index)
|
103
|
+
}
|
104
|
+
), showArrows && /* @__PURE__ */ import_react.default.createElement(
|
105
|
+
CarouselControls,
|
106
|
+
{
|
107
|
+
canScrollNext,
|
108
|
+
canScrollPrev,
|
109
|
+
onNext: () => emblaApi?.scrollNext(),
|
110
|
+
onPrev: () => emblaApi?.scrollPrev()
|
111
|
+
}
|
112
|
+
));
|
113
|
+
};
|
114
|
+
var Dots = ({
|
115
|
+
onDotClick,
|
116
|
+
itemsLength,
|
117
|
+
selectedIndex,
|
118
|
+
direction
|
119
|
+
}) => {
|
120
|
+
const arr = new Array(itemsLength).fill(0);
|
121
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
122
|
+
"div",
|
123
|
+
{
|
124
|
+
dir: direction,
|
125
|
+
className: "hawa-z-50 hawa-my-2 hawa-flex hawa-justify-center hawa-gap-1"
|
126
|
+
},
|
127
|
+
arr.map((_, index) => {
|
128
|
+
const selected = index === selectedIndex;
|
129
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
130
|
+
"div",
|
131
|
+
{
|
132
|
+
key: index,
|
133
|
+
onClick: () => onDotClick(index),
|
134
|
+
className: cn(
|
135
|
+
"hawa-h-2 hawa-rounded-full hawa-bg-primary hawa-transition-all hawa-duration-300 hover:hawa-cursor-pointer",
|
136
|
+
!selected ? "hawa-w-2 hawa-opacity-50" : "hawa-w-6 hawa-opacity-100"
|
137
|
+
)
|
138
|
+
}
|
139
|
+
);
|
140
|
+
})
|
141
|
+
);
|
142
|
+
};
|
143
|
+
var CarouselControls = (props) => {
|
144
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: "hawa-flex hawa-justify-end hawa-gap-2 " }, /* @__PURE__ */ import_react.default.createElement(
|
145
|
+
"button",
|
146
|
+
{
|
147
|
+
onClick: () => props.canScrollPrev && props.onPrev(),
|
148
|
+
disabled: !props.canScrollPrev,
|
149
|
+
className: cn(
|
150
|
+
"hawa-absolute hawa-start-0 hawa-top-1/2 -hawa-translate-y-2 hawa-rounded-full hawa-p-2 hawa-text-white ",
|
151
|
+
!props.canScrollPrev && "hawa-bg-primary/50",
|
152
|
+
props.canScrollPrev && "hawa-bg-primary"
|
153
|
+
)
|
154
|
+
},
|
155
|
+
/* @__PURE__ */ import_react.default.createElement(
|
156
|
+
"svg",
|
157
|
+
{
|
158
|
+
"aria-label": "Chevron Right Icon",
|
159
|
+
stroke: "currentColor",
|
160
|
+
fill: "currentColor",
|
161
|
+
viewBox: "0 0 16 16",
|
162
|
+
className: "hawa-h-2 hawa-w-2 hawa-shrink-0 hawa-rotate-180 hawa-transition-transform hawa-duration-200 "
|
163
|
+
},
|
164
|
+
/* @__PURE__ */ import_react.default.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" })
|
165
|
+
)
|
166
|
+
), /* @__PURE__ */ import_react.default.createElement(
|
167
|
+
"button",
|
168
|
+
{
|
169
|
+
onClick: () => props.canScrollNext && props.onNext(),
|
170
|
+
disabled: !props.canScrollNext,
|
171
|
+
className: cn(
|
172
|
+
"hawa-absolute hawa-end-0 hawa-top-1/2 -hawa-translate-y-2 hawa-rounded-full hawa-p-2 hawa-text-white ",
|
173
|
+
!props.canScrollNext && "hawa-bg-primary/50",
|
174
|
+
props.canScrollNext && "hawa-bg-primary"
|
175
|
+
)
|
176
|
+
},
|
177
|
+
/* @__PURE__ */ import_react.default.createElement(
|
178
|
+
"svg",
|
179
|
+
{
|
180
|
+
"aria-label": "Chevron Right Icon",
|
181
|
+
stroke: "currentColor",
|
182
|
+
fill: "currentColor",
|
183
|
+
viewBox: "0 0 16 16",
|
184
|
+
className: "hawa-h-2 hawa-w-2 hawa-shrink-0 hawa-transition-transform hawa-duration-200 "
|
185
|
+
},
|
186
|
+
/* @__PURE__ */ import_react.default.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" })
|
187
|
+
)
|
188
|
+
));
|
189
|
+
};
|
190
|
+
// Annotate the CommonJS export names for ESM import in node:
|
191
|
+
0 && (module.exports = {
|
192
|
+
Carousel
|
193
|
+
});
|
194
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../elements/carousel/index.ts","../../elements/carousel/Carousel.tsx","../../util/index.ts"],"sourcesContent":["export * from \"./Carousel\";\n","import React, { useEffect, useState } from \"react\";\n\nimport { DirectionType } from \"@_types/commonTypes\";\n// import useEmblaCarousel, { EmblaOptionsType } from \"embla-carousel-react\";\nimport { cn } from \"@util/index\";\nimport { EmblaOptionsType } from \"embla-carousel\";\nimport useEmblaCarousel from \"embla-carousel-react\";\n\ntype CarouselProps = {\n items: React.ReactNode[];\n showArrows?: boolean;\n autoplay?: boolean;\n autoplayInterval?: number;\n options?: EmblaOptionsType;\n direction?: DirectionType;\n};\ntype DotsProps = {\n itemsLength: number;\n selectedIndex: number;\n direction: DirectionType;\n onDotClick: (index: number) => void;\n};\ntype ControlsProps = {\n canScrollPrev: boolean;\n canScrollNext: boolean;\n onPrev(): void;\n onNext(): void;\n};\n\nexport const Carousel: React.FC<CarouselProps> = ({\n items,\n showArrows,\n options,\n autoplay,\n direction = \"ltr\",\n autoplayInterval = 3000,\n ...props\n}) => {\n const [emblaRef, emblaApi] = useEmblaCarousel({\n ...options,\n direction,\n loop: autoplay ? true : options?.loop || false\n });\n const [selectedIndex, setSelectedIndex] = useState(0);\n\n useEffect(() => {\n function selectHandler() {\n const index = emblaApi?.selectedScrollSnap();\n setSelectedIndex(index || 0);\n }\n\n emblaApi?.on(\"select\", selectHandler);\n return () => {\n emblaApi?.off(\"select\", selectHandler);\n };\n }, [emblaApi]);\n\n useEffect(() => {\n let autoplayTimer: ReturnType<typeof setTimeout>;\n if (autoplay && emblaApi) {\n autoplayTimer = setInterval(() => {\n emblaApi.scrollNext();\n }, autoplayInterval);\n }\n\n return () => {\n if (autoplayTimer) clearInterval(autoplayTimer);\n };\n }, [emblaApi, autoplay, autoplayInterval]);\n\n const length = React.Children.count(items);\n const canScrollNext = !!emblaApi?.canScrollNext();\n const canScrollPrev = !!emblaApi?.canScrollPrev();\n return (\n <div className=\" hawa-relative hawa-h-full\">\n <div className=\"hawa-h-full hawa-overflow-hidden\">\n <div className=\"hawa-h-full\" ref={emblaRef}>\n <div className=\"hawa-flex hawa-h-full\">\n {items?.map((item: any, i: any) => (\n <div\n key={i}\n className=\"hawa-flex hawa-h-full hawa-min-w-0 hawa-flex-[0_0_100%] hawa-items-center hawa-justify-center\"\n >\n {item}\n </div>\n ))}\n </div>\n </div>\n </div>\n\n <Dots\n direction={direction}\n itemsLength={length}\n selectedIndex={selectedIndex}\n onDotClick={(index) => emblaApi?.scrollTo(index)}\n />\n\n {showArrows && (\n <CarouselControls\n canScrollNext={canScrollNext}\n canScrollPrev={canScrollPrev}\n onNext={() => emblaApi?.scrollNext()}\n onPrev={() => emblaApi?.scrollPrev()}\n />\n )}\n </div>\n );\n};\n\nconst Dots = ({\n onDotClick,\n itemsLength,\n selectedIndex,\n direction\n}: DotsProps) => {\n const arr = new Array(itemsLength).fill(0);\n return (\n <div\n dir={direction}\n className=\"hawa-z-50 hawa-my-2 hawa-flex hawa-justify-center hawa-gap-1\"\n >\n {arr.map((_, index) => {\n const selected = index === selectedIndex;\n return (\n <div\n key={index}\n onClick={() => onDotClick(index)}\n className={cn(\n \"hawa-h-2 hawa-rounded-full hawa-bg-primary hawa-transition-all hawa-duration-300 hover:hawa-cursor-pointer\",\n !selected\n ? \"hawa-w-2 hawa-opacity-50\"\n : \"hawa-w-6 hawa-opacity-100\"\n )}\n ></div>\n );\n })}\n </div>\n );\n};\n\nconst CarouselControls = (props: ControlsProps) => {\n return (\n <div className=\"hawa-flex hawa-justify-end hawa-gap-2 \">\n <button\n onClick={() => props.canScrollPrev && props.onPrev()}\n disabled={!props.canScrollPrev}\n className={cn(\n \"hawa-absolute hawa-start-0 hawa-top-1/2 -hawa-translate-y-2 hawa-rounded-full hawa-p-2 hawa-text-white \",\n !props.canScrollPrev && \"hawa-bg-primary/50\",\n props.canScrollPrev && \"hawa-bg-primary\"\n )}\n >\n <svg\n aria-label=\"Chevron Right Icon\"\n stroke=\"currentColor\"\n fill=\"currentColor\"\n viewBox=\"0 0 16 16\"\n className=\"hawa-h-2 hawa-w-2 hawa-shrink-0 hawa-rotate-180 hawa-transition-transform hawa-duration-200 \"\n >\n <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\"></path>\n </svg>\n </button>\n <button\n onClick={() => props.canScrollNext && props.onNext()}\n disabled={!props.canScrollNext}\n className={cn(\n \"hawa-absolute hawa-end-0 hawa-top-1/2 -hawa-translate-y-2 hawa-rounded-full hawa-p-2 hawa-text-white \",\n !props.canScrollNext && \"hawa-bg-primary/50\",\n props.canScrollNext && \"hawa-bg-primary\"\n )}\n >\n <svg\n aria-label=\"Chevron Right Icon\"\n stroke=\"currentColor\"\n fill=\"currentColor\"\n viewBox=\"0 0 16 16\"\n className=\"hawa-h-2 hawa-w-2 hawa-shrink-0 hawa-transition-transform hawa-duration-200 \"\n >\n <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\"></path>\n </svg>\n </button>\n </div>\n );\n};\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\ntype Palette = {\n name: string;\n colors: {\n [key: number]: string;\n };\n};\ntype Rgb = {\n r: number;\n g: number;\n b: number;\n};\nfunction hexToRgb(hex: string): Rgb | null {\n const sanitizedHex = hex.replaceAll(\"##\", \"#\");\n const colorParts = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(\n sanitizedHex\n );\n\n if (!colorParts) {\n return null;\n }\n\n const [, r, g, b] = colorParts;\n\n return {\n r: parseInt(r, 16),\n g: parseInt(g, 16),\n b: parseInt(b, 16)\n } as Rgb;\n}\n\nfunction rgbToHex(r: number, g: number, b: number): string {\n const toHex = (c: number) => `0${c.toString(16)}`.slice(-2);\n return `#${toHex(r)}${toHex(g)}${toHex(b)}`;\n}\n\nexport function getTextColor(color: string): \"#FFF\" | \"#333\" {\n const rgbColor = hexToRgb(color);\n\n if (!rgbColor) {\n return \"#333\";\n }\n\n const { r, g, b } = rgbColor;\n const luma = 0.2126 * r + 0.7152 * g + 0.0722 * b;\n\n return luma < 120 ? \"#FFF\" : \"#333\";\n}\n\nfunction lighten(hex: string, intensity: number): string {\n const color = hexToRgb(`#${hex}`);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r + (255 - color.r) * intensity);\n const g = Math.round(color.g + (255 - color.g) * intensity);\n const b = Math.round(color.b + (255 - color.b) * intensity);\n\n return rgbToHex(r, g, b);\n}\n\nfunction darken(hex: string, intensity: number): string {\n const color = hexToRgb(hex);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r * intensity);\n const g = Math.round(color.g * intensity);\n const b = Math.round(color.b * intensity);\n\n return rgbToHex(r, g, b);\n}\nconst parseColor = (color: any) => {\n if (color.startsWith(\"#\")) {\n // Convert hex to RGB\n let r = parseInt(color.slice(1, 3), 16);\n let g = parseInt(color.slice(3, 5), 16);\n let b = parseInt(color.slice(5, 7), 16);\n return [r, g, b];\n } else if (color.startsWith(\"rgb\")) {\n // Extract RGB values from rgb() format\n return color.match(/\\d+/g).map(Number);\n }\n // Default to white if format is unrecognized\n return [255, 255, 255];\n};\nexport const calculateLuminance = (color: any) => {\n const [r, g, b] = parseColor(color)?.map((c: any) => {\n c /= 255;\n return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;\n });\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n};\n\nfunction getPallette(baseColor: string): Palette {\n const name = baseColor;\n\n const response: Palette = {\n name,\n colors: {\n 500: `#${baseColor}`.replace(\"##\", \"#\")\n }\n };\n\n const intensityMap: {\n [key: number]: number;\n } = {\n 50: 0.95,\n 100: 0.9,\n 200: 0.75,\n 300: 0.6,\n 400: 0.3,\n 600: 0.9,\n 700: 0.75,\n 800: 0.6,\n 900: 0.49\n };\n\n [50, 100, 200, 300, 400].forEach((level) => {\n response.colors[level] = lighten(baseColor, intensityMap[level]);\n });\n [600, 700, 800, 900].forEach((level) => {\n response.colors[level] = darken(baseColor, intensityMap[level]);\n });\n\n return response as Palette;\n}\n\nexport { getPallette };\n\n// const hexToRgb = (hex) => {\n// let d = hex?.split(\"#\")[1];\n// var aRgbHex = d?.match(/.{1,2}/g);\n// var aRgb = [\n// parseInt(aRgbHex[0], 16),\n// parseInt(aRgbHex[1], 16),\n// parseInt(aRgbHex[2], 16)\n// ];\n// return aRgb;\n// };\n// const getTextColor = (backColor) => {\n// let rgbArray = hexToRgb(backColor);\n// if (rgbArray[0] * 0.299 + rgbArray[1] * 0.587 + rgbArray[2] * 0.114 > 186) {\n// return \"#000000\";\n// } else {\n// return \"#ffffff\";\n// }\n// };\n// const replaceAt = function (string, index, replacement) {\n// // if (replacement == \"\" || replacement == \" \") {\n// // return (\n// // string.substring(0, index) +\n// // string.substring(index + replacement.length )\n// // );\n// // }\n// const replaced = string.substring(0, index) + replacement + string.substring(index + 1)\n// return replaced\n// };\n\n// export { hexToRgb, getTextColor, replaceAt };\n"],"mappings":"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","names":["useEmblaCarousel","React"]}
|
@@ -0,0 +1,152 @@
|
|
1
|
+
import {
|
2
|
+
cn
|
3
|
+
} from "../chunk-CBRGWUZG.mjs";
|
4
|
+
|
5
|
+
// elements/carousel/Carousel.tsx
|
6
|
+
import React, { useEffect, useState } from "react";
|
7
|
+
import useEmblaCarousel from "embla-carousel-react";
|
8
|
+
var Carousel = ({
|
9
|
+
items,
|
10
|
+
showArrows,
|
11
|
+
options,
|
12
|
+
autoplay,
|
13
|
+
direction = "ltr",
|
14
|
+
autoplayInterval = 3e3,
|
15
|
+
...props
|
16
|
+
}) => {
|
17
|
+
const [emblaRef, emblaApi] = useEmblaCarousel({
|
18
|
+
...options,
|
19
|
+
direction,
|
20
|
+
loop: autoplay ? true : options?.loop || false
|
21
|
+
});
|
22
|
+
const [selectedIndex, setSelectedIndex] = useState(0);
|
23
|
+
useEffect(() => {
|
24
|
+
function selectHandler() {
|
25
|
+
const index = emblaApi?.selectedScrollSnap();
|
26
|
+
setSelectedIndex(index || 0);
|
27
|
+
}
|
28
|
+
emblaApi?.on("select", selectHandler);
|
29
|
+
return () => {
|
30
|
+
emblaApi?.off("select", selectHandler);
|
31
|
+
};
|
32
|
+
}, [emblaApi]);
|
33
|
+
useEffect(() => {
|
34
|
+
let autoplayTimer;
|
35
|
+
if (autoplay && emblaApi) {
|
36
|
+
autoplayTimer = setInterval(() => {
|
37
|
+
emblaApi.scrollNext();
|
38
|
+
}, autoplayInterval);
|
39
|
+
}
|
40
|
+
return () => {
|
41
|
+
if (autoplayTimer)
|
42
|
+
clearInterval(autoplayTimer);
|
43
|
+
};
|
44
|
+
}, [emblaApi, autoplay, autoplayInterval]);
|
45
|
+
const length = React.Children.count(items);
|
46
|
+
const canScrollNext = !!emblaApi?.canScrollNext();
|
47
|
+
const canScrollPrev = !!emblaApi?.canScrollPrev();
|
48
|
+
return /* @__PURE__ */ React.createElement("div", { className: " hawa-relative hawa-h-full" }, /* @__PURE__ */ React.createElement("div", { className: "hawa-h-full hawa-overflow-hidden" }, /* @__PURE__ */ React.createElement("div", { className: "hawa-h-full", ref: emblaRef }, /* @__PURE__ */ React.createElement("div", { className: "hawa-flex hawa-h-full" }, items?.map((item, i) => /* @__PURE__ */ React.createElement(
|
49
|
+
"div",
|
50
|
+
{
|
51
|
+
key: i,
|
52
|
+
className: "hawa-flex hawa-h-full hawa-min-w-0 hawa-flex-[0_0_100%] hawa-items-center hawa-justify-center"
|
53
|
+
},
|
54
|
+
item
|
55
|
+
))))), /* @__PURE__ */ React.createElement(
|
56
|
+
Dots,
|
57
|
+
{
|
58
|
+
direction,
|
59
|
+
itemsLength: length,
|
60
|
+
selectedIndex,
|
61
|
+
onDotClick: (index) => emblaApi?.scrollTo(index)
|
62
|
+
}
|
63
|
+
), showArrows && /* @__PURE__ */ React.createElement(
|
64
|
+
CarouselControls,
|
65
|
+
{
|
66
|
+
canScrollNext,
|
67
|
+
canScrollPrev,
|
68
|
+
onNext: () => emblaApi?.scrollNext(),
|
69
|
+
onPrev: () => emblaApi?.scrollPrev()
|
70
|
+
}
|
71
|
+
));
|
72
|
+
};
|
73
|
+
var Dots = ({
|
74
|
+
onDotClick,
|
75
|
+
itemsLength,
|
76
|
+
selectedIndex,
|
77
|
+
direction
|
78
|
+
}) => {
|
79
|
+
const arr = new Array(itemsLength).fill(0);
|
80
|
+
return /* @__PURE__ */ React.createElement(
|
81
|
+
"div",
|
82
|
+
{
|
83
|
+
dir: direction,
|
84
|
+
className: "hawa-z-50 hawa-my-2 hawa-flex hawa-justify-center hawa-gap-1"
|
85
|
+
},
|
86
|
+
arr.map((_, index) => {
|
87
|
+
const selected = index === selectedIndex;
|
88
|
+
return /* @__PURE__ */ React.createElement(
|
89
|
+
"div",
|
90
|
+
{
|
91
|
+
key: index,
|
92
|
+
onClick: () => onDotClick(index),
|
93
|
+
className: cn(
|
94
|
+
"hawa-h-2 hawa-rounded-full hawa-bg-primary hawa-transition-all hawa-duration-300 hover:hawa-cursor-pointer",
|
95
|
+
!selected ? "hawa-w-2 hawa-opacity-50" : "hawa-w-6 hawa-opacity-100"
|
96
|
+
)
|
97
|
+
}
|
98
|
+
);
|
99
|
+
})
|
100
|
+
);
|
101
|
+
};
|
102
|
+
var CarouselControls = (props) => {
|
103
|
+
return /* @__PURE__ */ React.createElement("div", { className: "hawa-flex hawa-justify-end hawa-gap-2 " }, /* @__PURE__ */ React.createElement(
|
104
|
+
"button",
|
105
|
+
{
|
106
|
+
onClick: () => props.canScrollPrev && props.onPrev(),
|
107
|
+
disabled: !props.canScrollPrev,
|
108
|
+
className: cn(
|
109
|
+
"hawa-absolute hawa-start-0 hawa-top-1/2 -hawa-translate-y-2 hawa-rounded-full hawa-p-2 hawa-text-white ",
|
110
|
+
!props.canScrollPrev && "hawa-bg-primary/50",
|
111
|
+
props.canScrollPrev && "hawa-bg-primary"
|
112
|
+
)
|
113
|
+
},
|
114
|
+
/* @__PURE__ */ React.createElement(
|
115
|
+
"svg",
|
116
|
+
{
|
117
|
+
"aria-label": "Chevron Right Icon",
|
118
|
+
stroke: "currentColor",
|
119
|
+
fill: "currentColor",
|
120
|
+
viewBox: "0 0 16 16",
|
121
|
+
className: "hawa-h-2 hawa-w-2 hawa-shrink-0 hawa-rotate-180 hawa-transition-transform hawa-duration-200 "
|
122
|
+
},
|
123
|
+
/* @__PURE__ */ React.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" })
|
124
|
+
)
|
125
|
+
), /* @__PURE__ */ React.createElement(
|
126
|
+
"button",
|
127
|
+
{
|
128
|
+
onClick: () => props.canScrollNext && props.onNext(),
|
129
|
+
disabled: !props.canScrollNext,
|
130
|
+
className: cn(
|
131
|
+
"hawa-absolute hawa-end-0 hawa-top-1/2 -hawa-translate-y-2 hawa-rounded-full hawa-p-2 hawa-text-white ",
|
132
|
+
!props.canScrollNext && "hawa-bg-primary/50",
|
133
|
+
props.canScrollNext && "hawa-bg-primary"
|
134
|
+
)
|
135
|
+
},
|
136
|
+
/* @__PURE__ */ React.createElement(
|
137
|
+
"svg",
|
138
|
+
{
|
139
|
+
"aria-label": "Chevron Right Icon",
|
140
|
+
stroke: "currentColor",
|
141
|
+
fill: "currentColor",
|
142
|
+
viewBox: "0 0 16 16",
|
143
|
+
className: "hawa-h-2 hawa-w-2 hawa-shrink-0 hawa-transition-transform hawa-duration-200 "
|
144
|
+
},
|
145
|
+
/* @__PURE__ */ React.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" })
|
146
|
+
)
|
147
|
+
));
|
148
|
+
};
|
149
|
+
export {
|
150
|
+
Carousel
|
151
|
+
};
|
152
|
+
//# sourceMappingURL=index.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../elements/carousel/Carousel.tsx"],"sourcesContent":["import React, { useEffect, useState } from \"react\";\n\nimport { DirectionType } from \"@_types/commonTypes\";\n// import useEmblaCarousel, { EmblaOptionsType } from \"embla-carousel-react\";\nimport { cn } from \"@util/index\";\nimport { EmblaOptionsType } from \"embla-carousel\";\nimport useEmblaCarousel from \"embla-carousel-react\";\n\ntype CarouselProps = {\n items: React.ReactNode[];\n showArrows?: boolean;\n autoplay?: boolean;\n autoplayInterval?: number;\n options?: EmblaOptionsType;\n direction?: DirectionType;\n};\ntype DotsProps = {\n itemsLength: number;\n selectedIndex: number;\n direction: DirectionType;\n onDotClick: (index: number) => void;\n};\ntype ControlsProps = {\n canScrollPrev: boolean;\n canScrollNext: boolean;\n onPrev(): void;\n onNext(): void;\n};\n\nexport const Carousel: React.FC<CarouselProps> = ({\n items,\n showArrows,\n options,\n autoplay,\n direction = \"ltr\",\n autoplayInterval = 3000,\n ...props\n}) => {\n const [emblaRef, emblaApi] = useEmblaCarousel({\n ...options,\n direction,\n loop: autoplay ? true : options?.loop || false\n });\n const [selectedIndex, setSelectedIndex] = useState(0);\n\n useEffect(() => {\n function selectHandler() {\n const index = emblaApi?.selectedScrollSnap();\n setSelectedIndex(index || 0);\n }\n\n emblaApi?.on(\"select\", selectHandler);\n return () => {\n emblaApi?.off(\"select\", selectHandler);\n };\n }, [emblaApi]);\n\n useEffect(() => {\n let autoplayTimer: ReturnType<typeof setTimeout>;\n if (autoplay && emblaApi) {\n autoplayTimer = setInterval(() => {\n emblaApi.scrollNext();\n }, autoplayInterval);\n }\n\n return () => {\n if (autoplayTimer) clearInterval(autoplayTimer);\n };\n }, [emblaApi, autoplay, autoplayInterval]);\n\n const length = React.Children.count(items);\n const canScrollNext = !!emblaApi?.canScrollNext();\n const canScrollPrev = !!emblaApi?.canScrollPrev();\n return (\n <div className=\" hawa-relative hawa-h-full\">\n <div className=\"hawa-h-full hawa-overflow-hidden\">\n <div className=\"hawa-h-full\" ref={emblaRef}>\n <div className=\"hawa-flex hawa-h-full\">\n {items?.map((item: any, i: any) => (\n <div\n key={i}\n className=\"hawa-flex hawa-h-full hawa-min-w-0 hawa-flex-[0_0_100%] hawa-items-center hawa-justify-center\"\n >\n {item}\n </div>\n ))}\n </div>\n </div>\n </div>\n\n <Dots\n direction={direction}\n itemsLength={length}\n selectedIndex={selectedIndex}\n onDotClick={(index) => emblaApi?.scrollTo(index)}\n />\n\n {showArrows && (\n <CarouselControls\n canScrollNext={canScrollNext}\n canScrollPrev={canScrollPrev}\n onNext={() => emblaApi?.scrollNext()}\n onPrev={() => emblaApi?.scrollPrev()}\n />\n )}\n </div>\n );\n};\n\nconst Dots = ({\n onDotClick,\n itemsLength,\n selectedIndex,\n direction\n}: DotsProps) => {\n const arr = new Array(itemsLength).fill(0);\n return (\n <div\n dir={direction}\n className=\"hawa-z-50 hawa-my-2 hawa-flex hawa-justify-center hawa-gap-1\"\n >\n {arr.map((_, index) => {\n const selected = index === selectedIndex;\n return (\n <div\n key={index}\n onClick={() => onDotClick(index)}\n className={cn(\n \"hawa-h-2 hawa-rounded-full hawa-bg-primary hawa-transition-all hawa-duration-300 hover:hawa-cursor-pointer\",\n !selected\n ? \"hawa-w-2 hawa-opacity-50\"\n : \"hawa-w-6 hawa-opacity-100\"\n )}\n ></div>\n );\n })}\n </div>\n );\n};\n\nconst CarouselControls = (props: ControlsProps) => {\n return (\n <div className=\"hawa-flex hawa-justify-end hawa-gap-2 \">\n <button\n onClick={() => props.canScrollPrev && props.onPrev()}\n disabled={!props.canScrollPrev}\n className={cn(\n \"hawa-absolute hawa-start-0 hawa-top-1/2 -hawa-translate-y-2 hawa-rounded-full hawa-p-2 hawa-text-white \",\n !props.canScrollPrev && \"hawa-bg-primary/50\",\n props.canScrollPrev && \"hawa-bg-primary\"\n )}\n >\n <svg\n aria-label=\"Chevron Right Icon\"\n stroke=\"currentColor\"\n fill=\"currentColor\"\n viewBox=\"0 0 16 16\"\n className=\"hawa-h-2 hawa-w-2 hawa-shrink-0 hawa-rotate-180 hawa-transition-transform hawa-duration-200 \"\n >\n <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\"></path>\n </svg>\n </button>\n <button\n onClick={() => props.canScrollNext && props.onNext()}\n disabled={!props.canScrollNext}\n className={cn(\n \"hawa-absolute hawa-end-0 hawa-top-1/2 -hawa-translate-y-2 hawa-rounded-full hawa-p-2 hawa-text-white \",\n !props.canScrollNext && \"hawa-bg-primary/50\",\n props.canScrollNext && \"hawa-bg-primary\"\n )}\n >\n <svg\n aria-label=\"Chevron Right Icon\"\n stroke=\"currentColor\"\n fill=\"currentColor\"\n viewBox=\"0 0 16 16\"\n className=\"hawa-h-2 hawa-w-2 hawa-shrink-0 hawa-transition-transform hawa-duration-200 \"\n >\n <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\"></path>\n </svg>\n </button>\n </div>\n );\n};\n"],"mappings":"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","names":[]}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
3
|
+
import { R as RadiusType } from '../commonTypes-2k6FnHw5.mjs';
|
4
|
+
|
5
|
+
type CheckBoxTypes = {
|
6
|
+
id: string;
|
7
|
+
label?: React.ReactNode;
|
8
|
+
sublabel?: React.ReactNode;
|
9
|
+
helperText?: string;
|
10
|
+
size?: "xs" | "sm" | "default" | "md" | "lg" | "xl";
|
11
|
+
radius?: RadiusType;
|
12
|
+
};
|
13
|
+
type CheckboxProps = CheckBoxTypes & React.ComponentProps<typeof CheckboxElement>;
|
14
|
+
declare const Checkbox: React.FC<CheckboxProps>;
|
15
|
+
declare const CheckboxElement: React.ForwardRefExoticComponent<Omit<CheckboxPrimitive.CheckboxProps & React.RefAttributes<HTMLButtonElement>, "ref"> & {
|
16
|
+
size?: "xs" | "sm" | "default" | "md" | "lg" | "xl" | undefined;
|
17
|
+
radius?: RadiusType | undefined;
|
18
|
+
} & React.RefAttributes<HTMLButtonElement>>;
|
19
|
+
|
20
|
+
export { Checkbox };
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
3
|
+
import { R as RadiusType } from '../commonTypes-2k6FnHw5.js';
|
4
|
+
|
5
|
+
type CheckBoxTypes = {
|
6
|
+
id: string;
|
7
|
+
label?: React.ReactNode;
|
8
|
+
sublabel?: React.ReactNode;
|
9
|
+
helperText?: string;
|
10
|
+
size?: "xs" | "sm" | "default" | "md" | "lg" | "xl";
|
11
|
+
radius?: RadiusType;
|
12
|
+
};
|
13
|
+
type CheckboxProps = CheckBoxTypes & React.ComponentProps<typeof CheckboxElement>;
|
14
|
+
declare const Checkbox: React.FC<CheckboxProps>;
|
15
|
+
declare const CheckboxElement: React.ForwardRefExoticComponent<Omit<CheckboxPrimitive.CheckboxProps & React.RefAttributes<HTMLButtonElement>, "ref"> & {
|
16
|
+
size?: "xs" | "sm" | "default" | "md" | "lg" | "xl" | undefined;
|
17
|
+
radius?: RadiusType | undefined;
|
18
|
+
} & React.RefAttributes<HTMLButtonElement>>;
|
19
|
+
|
20
|
+
export { Checkbox };
|
@@ -0,0 +1,185 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __create = Object.create;
|
3
|
+
var __defProp = Object.defineProperty;
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
8
|
+
var __export = (target, all) => {
|
9
|
+
for (var name in all)
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
11
|
+
};
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
14
|
+
for (let key of __getOwnPropNames(from))
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
17
|
+
}
|
18
|
+
return to;
|
19
|
+
};
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
26
|
+
mod
|
27
|
+
));
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
29
|
+
|
30
|
+
// elements/checkbox/index.ts
|
31
|
+
var checkbox_exports = {};
|
32
|
+
__export(checkbox_exports, {
|
33
|
+
Checkbox: () => Checkbox
|
34
|
+
});
|
35
|
+
module.exports = __toCommonJS(checkbox_exports);
|
36
|
+
|
37
|
+
// elements/checkbox/Checkbox.tsx
|
38
|
+
var React = __toESM(require("react"));
|
39
|
+
var CheckboxPrimitive = __toESM(require("@radix-ui/react-checkbox"));
|
40
|
+
|
41
|
+
// util/index.ts
|
42
|
+
var import_clsx = require("clsx");
|
43
|
+
var import_tailwind_merge = require("tailwind-merge");
|
44
|
+
function cn(...inputs) {
|
45
|
+
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
|
46
|
+
}
|
47
|
+
|
48
|
+
// elements/checkbox/Checkbox.tsx
|
49
|
+
var Checkbox = ({
|
50
|
+
id,
|
51
|
+
label,
|
52
|
+
sublabel,
|
53
|
+
helperText,
|
54
|
+
disabled,
|
55
|
+
size = "default",
|
56
|
+
radius = "inherit",
|
57
|
+
...props
|
58
|
+
}) => {
|
59
|
+
let labelLineHeightStyles = {
|
60
|
+
xs: sublabel || helperText ? 0.5 : 0.1,
|
61
|
+
sm: 0.6,
|
62
|
+
default: 1,
|
63
|
+
md: 0.8,
|
64
|
+
lg: 0.9,
|
65
|
+
xl: 1
|
66
|
+
};
|
67
|
+
return /* @__PURE__ */ React.createElement(
|
68
|
+
"div",
|
69
|
+
{
|
70
|
+
className: cn(
|
71
|
+
"hawa-flex hawa-gap-2",
|
72
|
+
size === "default" ? "hawa-items-top" : "hawa-items-center"
|
73
|
+
)
|
74
|
+
},
|
75
|
+
/* @__PURE__ */ React.createElement(
|
76
|
+
CheckboxElement,
|
77
|
+
{
|
78
|
+
...props,
|
79
|
+
size,
|
80
|
+
radius,
|
81
|
+
disabled,
|
82
|
+
id
|
83
|
+
}
|
84
|
+
),
|
85
|
+
(label || helperText) && /* @__PURE__ */ React.createElement("div", { className: "hawa-grid hawa-gap-1.5" }, label && /* @__PURE__ */ React.createElement(
|
86
|
+
"label",
|
87
|
+
{
|
88
|
+
htmlFor: id,
|
89
|
+
className: cn(
|
90
|
+
"hawa-w-fit hawa-select-none hawa-pt-0.5 hawa-text-sm hawa-font-medium",
|
91
|
+
disabled ? "hawa-cursor-not-allowed hawa-text-muted-foreground hawa-opacity-70 " : "hawa-cursor-pointer"
|
92
|
+
),
|
93
|
+
style: {
|
94
|
+
// lineHeight: labelLineHeightStyles[size]
|
95
|
+
lineHeight: 1
|
96
|
+
}
|
97
|
+
},
|
98
|
+
label
|
99
|
+
), sublabel && /* @__PURE__ */ React.createElement(
|
100
|
+
"label",
|
101
|
+
{
|
102
|
+
htmlFor: id,
|
103
|
+
className: cn(
|
104
|
+
"hawa-w-fit hawa-select-none hawa-text-sm hawa-text-muted-foreground",
|
105
|
+
disabled ? "hawa-cursor-not-allowed hawa-text-muted-foreground hawa-opacity-70" : "hawa-cursor-pointer"
|
106
|
+
)
|
107
|
+
},
|
108
|
+
sublabel
|
109
|
+
), helperText && !disabled && /* @__PURE__ */ React.createElement(
|
110
|
+
"label",
|
111
|
+
{
|
112
|
+
htmlFor: id,
|
113
|
+
className: cn(
|
114
|
+
"hawa-w-fit hawa-select-none hawa-text-xs hawa-text-helper-color",
|
115
|
+
disabled && "hawa-cursor-not-allowed hawa-opacity-70"
|
116
|
+
)
|
117
|
+
},
|
118
|
+
helperText
|
119
|
+
))
|
120
|
+
);
|
121
|
+
};
|
122
|
+
var CheckboxElement = React.forwardRef(({ radius = "inherit", size = "default", className, ...props }, ref) => {
|
123
|
+
let checkboxRadius = {
|
124
|
+
none: "hawa-rounded-none",
|
125
|
+
inherit: "hawa-rounded-sm",
|
126
|
+
full: "hawa-rounded-full"
|
127
|
+
};
|
128
|
+
let checkboxSizes = {
|
129
|
+
xs: "hawa-w-3 hawa-h-3",
|
130
|
+
sm: "hawa-w-6 hawa-h-6",
|
131
|
+
default: "hawa-icon",
|
132
|
+
md: "hawa-w-8 hawa-h-8",
|
133
|
+
lg: "hawa-w-10 hawa-h-10",
|
134
|
+
xl: "hawa-w-12 hawa-h-12"
|
135
|
+
};
|
136
|
+
let checkboxIndicatorSizes = {
|
137
|
+
xs: "0.5em",
|
138
|
+
default: "0.60em",
|
139
|
+
sm: "0.75em",
|
140
|
+
md: "0.875em",
|
141
|
+
lg: "1em",
|
142
|
+
xl: "1.25em"
|
143
|
+
};
|
144
|
+
return /* @__PURE__ */ React.createElement(
|
145
|
+
CheckboxPrimitive.Root,
|
146
|
+
{
|
147
|
+
ref,
|
148
|
+
className: cn(
|
149
|
+
"hawa-peer hawa-shrink-0 hawa-border hawa-border-primary hawa-ring-offset-background focus-visible:hawa-outline-none focus-visible:hawa-ring-2 focus-visible:hawa-ring-ring focus-visible:hawa-ring-offset-2 disabled:hawa-cursor-not-allowed disabled:hawa-opacity-50 data-[state=checked]:hawa-bg-primary data-[state=checked]:hawa-text-primary-foreground",
|
150
|
+
checkboxSizes[size],
|
151
|
+
checkboxRadius[radius],
|
152
|
+
className
|
153
|
+
),
|
154
|
+
...props
|
155
|
+
},
|
156
|
+
/* @__PURE__ */ React.createElement(
|
157
|
+
CheckboxPrimitive.Indicator,
|
158
|
+
{
|
159
|
+
className: cn(
|
160
|
+
"hawa-flex hawa-items-center hawa-justify-center hawa-text-current"
|
161
|
+
)
|
162
|
+
},
|
163
|
+
/* @__PURE__ */ React.createElement(
|
164
|
+
"svg",
|
165
|
+
{
|
166
|
+
"aria-label": "Check Mark",
|
167
|
+
stroke: "currentColor",
|
168
|
+
fill: "currentColor",
|
169
|
+
strokeWidth: "0",
|
170
|
+
viewBox: "0 0 512 512",
|
171
|
+
height: checkboxIndicatorSizes[size],
|
172
|
+
width: checkboxIndicatorSizes[size]
|
173
|
+
},
|
174
|
+
/* @__PURE__ */ React.createElement("path", { d: "M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z" })
|
175
|
+
),
|
176
|
+
" "
|
177
|
+
)
|
178
|
+
);
|
179
|
+
});
|
180
|
+
CheckboxElement.displayName = CheckboxPrimitive.Root.displayName;
|
181
|
+
// Annotate the CommonJS export names for ESM import in node:
|
182
|
+
0 && (module.exports = {
|
183
|
+
Checkbox
|
184
|
+
});
|
185
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../elements/checkbox/index.ts","../../elements/checkbox/Checkbox.tsx","../../util/index.ts"],"sourcesContent":["export * from \"./Checkbox\";\n","import * as React from \"react\";\n\nimport * as CheckboxPrimitive from \"@radix-ui/react-checkbox\";\n\nimport { RadiusType } from \"@_types/commonTypes\";\n\nimport { cn } from \"@util/index\";\n\ntype CheckBoxTypes = {\n id: string;\n label?: React.ReactNode;\n sublabel?: React.ReactNode;\n helperText?: string;\n size?: \"xs\" | \"sm\" | \"default\" | \"md\" | \"lg\" | \"xl\";\n radius?: RadiusType;\n};\n\ntype CheckboxProps = CheckBoxTypes &\n React.ComponentProps<typeof CheckboxElement>;\n\nexport const Checkbox: React.FC<CheckboxProps> = ({\n id,\n label,\n sublabel,\n helperText,\n disabled,\n size = \"default\",\n radius = \"inherit\",\n ...props\n}) => {\n let labelLineHeightStyles = {\n xs: sublabel || helperText ? 0.5 : 0.1,\n sm: 0.6,\n default: 1,\n md: 0.8,\n lg: 0.9,\n xl: 1\n };\n return (\n <div\n className={cn(\n \"hawa-flex hawa-gap-2\",\n size === \"default\" ? \"hawa-items-top\" : \"hawa-items-center\"\n )}\n >\n <CheckboxElement\n {...props}\n size={size}\n radius={radius}\n disabled={disabled}\n id={id}\n />\n {(label || helperText) && (\n <div className={\"hawa-grid hawa-gap-1.5\"}>\n {label && (\n <label\n htmlFor={id}\n className={cn(\n \"hawa-w-fit hawa-select-none hawa-pt-0.5 hawa-text-sm hawa-font-medium\",\n disabled\n ? \"hawa-cursor-not-allowed hawa-text-muted-foreground hawa-opacity-70 \"\n : \"hawa-cursor-pointer\"\n )}\n style={{\n // lineHeight: labelLineHeightStyles[size]\n\n lineHeight: 1\n }}\n >\n {label}\n </label>\n )}\n {sublabel && (\n <label\n htmlFor={id}\n className={cn(\n \"hawa-w-fit hawa-select-none hawa-text-sm hawa-text-muted-foreground\",\n disabled\n ? \"hawa-cursor-not-allowed hawa-text-muted-foreground hawa-opacity-70\"\n : \"hawa-cursor-pointer\"\n )}\n >\n {sublabel}\n </label>\n )}\n {helperText && !disabled && (\n <label\n htmlFor={id}\n className={cn(\n \"hawa-w-fit hawa-select-none hawa-text-xs hawa-text-helper-color\",\n disabled && \"hawa-cursor-not-allowed hawa-opacity-70\"\n )}\n >\n {helperText}\n </label>\n )}\n </div>\n )}\n </div>\n );\n};\n\nconst CheckboxElement = React.forwardRef<\n React.ElementRef<typeof CheckboxPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root> & {\n size?: \"xs\" | \"sm\" | \"default\" | \"md\" | \"lg\" | \"xl\";\n radius?: RadiusType;\n }\n>(({ radius = \"inherit\", size = \"default\", className, ...props }, ref) => {\n let checkboxRadius = {\n none: \"hawa-rounded-none\",\n inherit: \"hawa-rounded-sm\",\n full: \"hawa-rounded-full\"\n };\n let checkboxSizes = {\n xs: \"hawa-w-3 hawa-h-3\",\n sm: \"hawa-w-6 hawa-h-6\",\n default: \"hawa-icon\",\n md: \"hawa-w-8 hawa-h-8\",\n lg: \"hawa-w-10 hawa-h-10\",\n xl: \"hawa-w-12 hawa-h-12\"\n };\n let checkboxIndicatorSizes = {\n xs: \"0.5em\",\n default: \"0.60em\",\n sm: \"0.75em\",\n md: \"0.875em\",\n lg: \"1em\",\n xl: \"1.25em\"\n };\n return (\n <CheckboxPrimitive.Root\n ref={ref}\n className={cn(\n \"hawa-peer hawa-shrink-0 hawa-border hawa-border-primary hawa-ring-offset-background focus-visible:hawa-outline-none focus-visible:hawa-ring-2 focus-visible:hawa-ring-ring focus-visible:hawa-ring-offset-2 disabled:hawa-cursor-not-allowed disabled:hawa-opacity-50 data-[state=checked]:hawa-bg-primary data-[state=checked]:hawa-text-primary-foreground\",\n checkboxSizes[size],\n checkboxRadius[radius],\n className\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n className={cn(\n \"hawa-flex hawa-items-center hawa-justify-center hawa-text-current\"\n )}\n >\n <svg\n aria-label=\"Check Mark\"\n stroke=\"currentColor\"\n fill=\"currentColor\"\n strokeWidth=\"0\"\n viewBox=\"0 0 512 512\"\n height={checkboxIndicatorSizes[size]}\n width={checkboxIndicatorSizes[size]}\n // height=\"0.60em\"\n // width=\"0.60em\"\n >\n <path d=\"M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z\"></path>\n </svg>{\" \"}\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n );\n});\nCheckboxElement.displayName = CheckboxPrimitive.Root.displayName;\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\ntype Palette = {\n name: string;\n colors: {\n [key: number]: string;\n };\n};\ntype Rgb = {\n r: number;\n g: number;\n b: number;\n};\nfunction hexToRgb(hex: string): Rgb | null {\n const sanitizedHex = hex.replaceAll(\"##\", \"#\");\n const colorParts = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(\n sanitizedHex\n );\n\n if (!colorParts) {\n return null;\n }\n\n const [, r, g, b] = colorParts;\n\n return {\n r: parseInt(r, 16),\n g: parseInt(g, 16),\n b: parseInt(b, 16)\n } as Rgb;\n}\n\nfunction rgbToHex(r: number, g: number, b: number): string {\n const toHex = (c: number) => `0${c.toString(16)}`.slice(-2);\n return `#${toHex(r)}${toHex(g)}${toHex(b)}`;\n}\n\nexport function getTextColor(color: string): \"#FFF\" | \"#333\" {\n const rgbColor = hexToRgb(color);\n\n if (!rgbColor) {\n return \"#333\";\n }\n\n const { r, g, b } = rgbColor;\n const luma = 0.2126 * r + 0.7152 * g + 0.0722 * b;\n\n return luma < 120 ? \"#FFF\" : \"#333\";\n}\n\nfunction lighten(hex: string, intensity: number): string {\n const color = hexToRgb(`#${hex}`);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r + (255 - color.r) * intensity);\n const g = Math.round(color.g + (255 - color.g) * intensity);\n const b = Math.round(color.b + (255 - color.b) * intensity);\n\n return rgbToHex(r, g, b);\n}\n\nfunction darken(hex: string, intensity: number): string {\n const color = hexToRgb(hex);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r * intensity);\n const g = Math.round(color.g * intensity);\n const b = Math.round(color.b * intensity);\n\n return rgbToHex(r, g, b);\n}\nconst parseColor = (color: any) => {\n if (color.startsWith(\"#\")) {\n // Convert hex to RGB\n let r = parseInt(color.slice(1, 3), 16);\n let g = parseInt(color.slice(3, 5), 16);\n let b = parseInt(color.slice(5, 7), 16);\n return [r, g, b];\n } else if (color.startsWith(\"rgb\")) {\n // Extract RGB values from rgb() format\n return color.match(/\\d+/g).map(Number);\n }\n // Default to white if format is unrecognized\n return [255, 255, 255];\n};\nexport const calculateLuminance = (color: any) => {\n const [r, g, b] = parseColor(color)?.map((c: any) => {\n c /= 255;\n return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;\n });\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n};\n\nfunction getPallette(baseColor: string): Palette {\n const name = baseColor;\n\n const response: Palette = {\n name,\n colors: {\n 500: `#${baseColor}`.replace(\"##\", \"#\")\n }\n };\n\n const intensityMap: {\n [key: number]: number;\n } = {\n 50: 0.95,\n 100: 0.9,\n 200: 0.75,\n 300: 0.6,\n 400: 0.3,\n 600: 0.9,\n 700: 0.75,\n 800: 0.6,\n 900: 0.49\n };\n\n [50, 100, 200, 300, 400].forEach((level) => {\n response.colors[level] = lighten(baseColor, intensityMap[level]);\n });\n [600, 700, 800, 900].forEach((level) => {\n response.colors[level] = darken(baseColor, intensityMap[level]);\n });\n\n return response as Palette;\n}\n\nexport { getPallette };\n\n// const hexToRgb = (hex) => {\n// let d = hex?.split(\"#\")[1];\n// var aRgbHex = d?.match(/.{1,2}/g);\n// var aRgb = [\n// parseInt(aRgbHex[0], 16),\n// parseInt(aRgbHex[1], 16),\n// parseInt(aRgbHex[2], 16)\n// ];\n// return aRgb;\n// };\n// const getTextColor = (backColor) => {\n// let rgbArray = hexToRgb(backColor);\n// if (rgbArray[0] * 0.299 + rgbArray[1] * 0.587 + rgbArray[2] * 0.114 > 186) {\n// return \"#000000\";\n// } else {\n// return \"#ffffff\";\n// }\n// };\n// const replaceAt = function (string, index, replacement) {\n// // if (replacement == \"\" || replacement == \" \") {\n// // return (\n// // string.substring(0, index) +\n// // string.substring(index + replacement.length )\n// // );\n// // }\n// const replaced = string.substring(0, index) + replacement + string.substring(index + 1)\n// return replaced\n// };\n\n// export { hexToRgb, getTextColor, replaceAt };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AAEvB,wBAAmC;;;ACFnC,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ADeO,IAAM,WAAoC,CAAC;AAAA,EAChD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP,SAAS;AAAA,EACT,GAAG;AACL,MAAM;AACJ,MAAI,wBAAwB;AAAA,IAC1B,IAAI,YAAY,aAAa,MAAM;AAAA,IACnC,IAAI;AAAA,IACJ,SAAS;AAAA,IACT,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,EACN;AACA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA,SAAS,YAAY,mBAAmB;AAAA,MAC1C;AAAA;AAAA,IAEA;AAAA,MAAC;AAAA;AAAA,QACE,GAAG;AAAA,QACJ;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACF;AAAA,KACE,SAAS,eACT,oCAAC,SAAI,WAAW,4BACb,SACC;AAAA,MAAC;AAAA;AAAA,QACC,SAAS;AAAA,QACT,WAAW;AAAA,UACT;AAAA,UACA,WACI,yEACA;AAAA,QACN;AAAA,QACA,OAAO;AAAA;AAAA,UAGL,YAAY;AAAA,QACd;AAAA;AAAA,MAEC;AAAA,IACH,GAED,YACC;AAAA,MAAC;AAAA;AAAA,QACC,SAAS;AAAA,QACT,WAAW;AAAA,UACT;AAAA,UACA,WACI,uEACA;AAAA,QACN;AAAA;AAAA,MAEC;AAAA,IACH,GAED,cAAc,CAAC,YACd;AAAA,MAAC;AAAA;AAAA,QACC,SAAS;AAAA,QACT,WAAW;AAAA,UACT;AAAA,UACA,YAAY;AAAA,QACd;AAAA;AAAA,MAEC;AAAA,IACH,CAEJ;AAAA,EAEJ;AAEJ;AAEA,IAAM,kBAAwB,iBAM5B,CAAC,EAAE,SAAS,WAAW,OAAO,WAAW,WAAW,GAAG,MAAM,GAAG,QAAQ;AACxE,MAAI,iBAAiB;AAAA,IACnB,MAAM;AAAA,IACN,SAAS;AAAA,IACT,MAAM;AAAA,EACR;AACA,MAAI,gBAAgB;AAAA,IAClB,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,SAAS;AAAA,IACT,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,EACN;AACA,MAAI,yBAAyB;AAAA,IAC3B,IAAI;AAAA,IACJ,SAAS;AAAA,IACT,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,EACN;AACA,SACE;AAAA,IAAmB;AAAA,IAAlB;AAAA,MACC;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA,cAAc,IAAI;AAAA,QAClB,eAAe,MAAM;AAAA,QACrB;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,IAEJ;AAAA,MAAmB;AAAA,MAAlB;AAAA,QACC,WAAW;AAAA,UACT;AAAA,QACF;AAAA;AAAA,MAEA;AAAA,QAAC;AAAA;AAAA,UACC,cAAW;AAAA,UACX,QAAO;AAAA,UACP,MAAK;AAAA,UACL,aAAY;AAAA,UACZ,SAAQ;AAAA,UACR,QAAQ,uBAAuB,IAAI;AAAA,UACnC,OAAO,uBAAuB,IAAI;AAAA;AAAA,QAIlC,oCAAC,UAAK,GAAE,sRAAqR;AAAA,MAC/R;AAAA,MAAO;AAAA,IACT;AAAA,EACF;AAEJ,CAAC;AACD,gBAAgB,cAAgC,uBAAK;","names":[]}
|