@intlayer/design-system 3.1.0 → 3.2.0
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/.vite/manifest.json +481 -455
- package/dist/TabSelector-BmkzVPXl.js +660 -0
- package/dist/TabSelector-BmkzVPXl.js.map +1 -0
- package/dist/TabSelector-o_NRBvPQ.cjs +659 -0
- package/dist/TabSelector-o_NRBvPQ.cjs.map +1 -0
- package/dist/components/Auth/AuthModal/index.cjs +17 -62
- package/dist/components/Auth/AuthModal/index.cjs.map +1 -1
- package/dist/components/Auth/AuthModal/index.d.ts.map +1 -1
- package/dist/components/Auth/AuthModal/index.mjs +17 -62
- package/dist/components/Auth/AuthModal/index.mjs.map +1 -1
- package/dist/components/Auth/AuthProvider/index.cjs.map +1 -1
- package/dist/components/Auth/AuthProvider/index.d.ts +3 -3
- package/dist/components/Auth/AuthProvider/index.d.ts.map +1 -1
- package/dist/components/Auth/AuthProvider/index.mjs.map +1 -1
- package/dist/components/Auth/AuthProvider/useSession.cjs +7 -8
- package/dist/components/Auth/AuthProvider/useSession.cjs.map +1 -1
- package/dist/components/Auth/AuthProvider/useSession.d.ts.map +1 -1
- package/dist/components/Auth/AuthProvider/useSession.mjs +7 -8
- package/dist/components/Auth/AuthProvider/useSession.mjs.map +1 -1
- package/dist/components/Auth/AuthenticationBarrier/AuthenticationBarrierClient.cjs +2 -2
- package/dist/components/Auth/AuthenticationBarrier/AuthenticationBarrierClient.cjs.map +1 -1
- package/dist/components/Auth/AuthenticationBarrier/AuthenticationBarrierClient.mjs +1 -1
- package/dist/components/Auth/AuthenticationBarrier/AuthenticationBarrierClient.mjs.map +1 -1
- package/dist/components/Auth/AuthenticationBarrier/AuthenticationBarrierServer.cjs.map +1 -1
- package/dist/components/Auth/AuthenticationBarrier/AuthenticationBarrierServer.d.ts +2 -2
- package/dist/components/Auth/AuthenticationBarrier/AuthenticationBarrierServer.d.ts.map +1 -1
- package/dist/components/Auth/AuthenticationBarrier/AuthenticationBarrierServer.mjs.map +1 -1
- package/dist/components/Auth/AuthenticationBarrier/accessValidation.cjs.map +1 -1
- package/dist/components/Auth/AuthenticationBarrier/accessValidation.d.ts +1 -1
- package/dist/components/Auth/AuthenticationBarrier/accessValidation.d.ts.map +1 -1
- package/dist/components/Auth/AuthenticationBarrier/accessValidation.mjs.map +1 -1
- package/dist/components/Auth/AuthenticationBarrier/index.d.ts +3 -3
- package/dist/components/Auth/AuthenticationBarrier/index.d.ts.map +1 -1
- package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.cjs +1 -0
- package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.cjs.map +1 -1
- package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.d.ts +1 -1
- package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.d.ts.map +1 -1
- package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.mjs +1 -0
- package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.mjs.map +1 -1
- package/dist/components/Auth/ChangePasswordForm/index.content.d.ts +10 -10
- package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.cjs +3 -2
- package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.cjs.map +1 -1
- package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.d.ts.map +1 -1
- package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.mjs +3 -2
- package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.mjs.map +1 -1
- package/dist/components/Auth/ExternalsLoginButtons/externalsLoginButtons.content.d.ts +5 -5
- package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.cjs +1 -0
- package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.cjs.map +1 -1
- package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.d.ts +1 -1
- package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.d.ts.map +1 -1
- package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.mjs +1 -0
- package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.mjs.map +1 -1
- package/dist/components/Auth/ResetPasswordForm/index.content.d.ts +7 -7
- package/dist/components/Auth/SignInForm/SignInForm.cjs +4 -3
- package/dist/components/Auth/SignInForm/SignInForm.cjs.map +1 -1
- package/dist/components/Auth/SignInForm/SignInForm.d.ts +1 -1
- package/dist/components/Auth/SignInForm/SignInForm.d.ts.map +1 -1
- package/dist/components/Auth/SignInForm/SignInForm.mjs +4 -3
- package/dist/components/Auth/SignInForm/SignInForm.mjs.map +1 -1
- package/dist/components/Auth/SignInForm/index.content.d.ts +13 -13
- package/dist/components/Auth/SignUpForm/SignUpForm.cjs +3 -3
- package/dist/components/Auth/SignUpForm/SignUpForm.cjs.map +1 -1
- package/dist/components/Auth/SignUpForm/SignUpForm.d.ts +1 -1
- package/dist/components/Auth/SignUpForm/SignUpForm.d.ts.map +1 -1
- package/dist/components/Auth/SignUpForm/SignUpForm.mjs +3 -3
- package/dist/components/Auth/SignUpForm/SignUpForm.mjs.map +1 -1
- package/dist/components/Auth/SignUpForm/index.content.d.ts +11 -11
- package/dist/components/Auth/index.cjs +2 -4
- package/dist/components/Auth/index.cjs.map +1 -1
- package/dist/components/Auth/index.d.ts +1 -1
- package/dist/components/Auth/index.d.ts.map +1 -1
- package/dist/components/Auth/index.mjs +1 -3
- package/dist/components/Auth/useAuth/index.cjs +39 -0
- package/dist/components/Auth/useAuth/index.cjs.map +1 -0
- package/dist/components/Auth/useAuth/index.d.ts +24 -0
- package/dist/components/Auth/useAuth/index.d.ts.map +1 -0
- package/dist/components/Auth/useAuth/index.mjs +39 -0
- package/dist/components/Auth/useAuth/index.mjs.map +1 -0
- package/dist/components/Auth/useAuth/useCSRF.cjs +22 -0
- package/dist/components/Auth/useAuth/useCSRF.cjs.map +1 -0
- package/dist/components/Auth/useAuth/useCSRF.d.ts +5 -0
- package/dist/components/Auth/useAuth/useCSRF.d.ts.map +1 -0
- package/dist/components/Auth/useAuth/useCSRF.mjs +22 -0
- package/dist/components/Auth/useAuth/useCSRF.mjs.map +1 -0
- package/dist/components/Auth/useAuth/useOAuth2.cjs +26 -0
- package/dist/components/Auth/useAuth/useOAuth2.cjs.map +1 -0
- package/dist/components/Auth/useAuth/useOAuth2.d.ts +4 -0
- package/dist/components/Auth/useAuth/useOAuth2.d.ts.map +1 -0
- package/dist/components/Auth/useAuth/useOAuth2.mjs +26 -0
- package/dist/components/Auth/useAuth/useOAuth2.mjs.map +1 -0
- package/dist/components/Auth/useAuth/useSession.cjs +60 -0
- package/dist/components/Auth/useAuth/useSession.cjs.map +1 -0
- package/dist/components/Auth/useAuth/useSession.d.ts +8 -0
- package/dist/components/Auth/useAuth/useSession.d.ts.map +1 -0
- package/dist/components/Auth/useAuth/useSession.mjs +60 -0
- package/dist/components/Auth/useAuth/useSession.mjs.map +1 -0
- package/dist/components/Auth/useUser/index.cjs +3 -3
- package/dist/components/Auth/useUser/index.cjs.map +1 -1
- package/dist/components/Auth/useUser/index.d.ts.map +1 -1
- package/dist/components/Auth/useUser/index.mjs +3 -3
- package/dist/components/Auth/useUser/index.mjs.map +1 -1
- package/dist/components/Badge/index.d.ts +1 -1
- package/dist/components/Button/Button.cjs.map +1 -1
- package/dist/components/Button/Button.d.ts +1 -2
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/components/Button/Button.mjs.map +1 -1
- package/dist/components/Command/index.d.ts +2 -2
- package/dist/components/Command/index.d.ts.map +1 -1
- package/dist/components/Container/index.cjs +1 -0
- package/dist/components/Container/index.cjs.map +1 -1
- package/dist/components/Container/index.d.ts +8 -8
- package/dist/components/Container/index.d.ts.map +1 -1
- package/dist/components/Container/index.mjs +1 -0
- package/dist/components/Container/index.mjs.map +1 -1
- package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.cjs +4 -17
- package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.cjs.map +1 -1
- package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.d.ts.map +1 -1
- package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.mjs +4 -17
- package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.mjs.map +1 -1
- package/dist/components/DictionaryEditor/validDictionaryChangeButtons.content.cjs +0 -21
- package/dist/components/DictionaryEditor/validDictionaryChangeButtons.content.cjs.map +1 -1
- package/dist/components/DictionaryEditor/validDictionaryChangeButtons.content.d.ts +0 -9
- package/dist/components/DictionaryEditor/validDictionaryChangeButtons.content.d.ts.map +1 -1
- package/dist/components/DictionaryEditor/validDictionaryChangeButtons.content.mjs +0 -21
- package/dist/components/DictionaryEditor/validDictionaryChangeButtons.content.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.cjs +3 -2
- package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.mjs +3 -2
- package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.cjs +7 -24
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs +6 -23
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.cjs +0 -42
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.d.ts +0 -18
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.mjs +0 -42
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryFormSchema.d.ts +2 -2
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.cjs +4 -36
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs +3 -35
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsSchema.d.ts +4 -4
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.cjs +0 -47
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.d.ts +0 -19
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.mjs +0 -47
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.cjs +3 -2
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs +3 -2
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/EditorView/EditorView.cjs +3 -2
- package/dist/components/DictionaryFieldEditor/EditorView/EditorView.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/EditorView/EditorView.mjs +3 -2
- package/dist/components/DictionaryFieldEditor/EditorView/EditorView.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.cjs +2 -2
- package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.mjs +2 -2
- package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.cjs +2 -2
- package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs +2 -2
- package/dist/components/DictionaryFieldEditor/NodeTypeSelector.cjs +2 -2
- package/dist/components/DictionaryFieldEditor/NodeTypeSelector.mjs +2 -2
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.cjs +4 -17
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs +4 -17
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.cjs +0 -21
- package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.d.ts +0 -9
- package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.mjs +0 -21
- package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.mjs.map +1 -1
- package/dist/components/Form/FormBase.cjs +4 -1
- package/dist/components/Form/FormBase.cjs.map +1 -1
- package/dist/components/Form/FormBase.d.ts +1 -1
- package/dist/components/Form/FormBase.d.ts.map +1 -1
- package/dist/components/Form/FormBase.mjs +4 -1
- package/dist/components/Form/FormBase.mjs.map +1 -1
- package/dist/components/Input/Checkbox.d.ts +1 -1
- package/dist/components/Input/Input.cjs +8 -2
- package/dist/components/Input/Input.cjs.map +1 -1
- package/dist/components/Input/Input.d.ts +1 -0
- package/dist/components/Input/Input.d.ts.map +1 -1
- package/dist/components/Input/Input.mjs +8 -2
- package/dist/components/Input/Input.mjs.map +1 -1
- package/dist/components/Link/Link.d.ts +1 -1
- package/dist/components/Modal/Modal.cjs +3 -1
- package/dist/components/Modal/Modal.cjs.map +1 -1
- package/dist/components/Modal/Modal.mjs +3 -1
- package/dist/components/Modal/Modal.mjs.map +1 -1
- package/dist/components/Navbar/MobileNavbar.cjs +3 -1
- package/dist/components/Navbar/MobileNavbar.cjs.map +1 -1
- package/dist/components/Navbar/MobileNavbar.mjs +3 -1
- package/dist/components/Navbar/MobileNavbar.mjs.map +1 -1
- package/dist/components/Navbar/index.cjs +3 -1
- package/dist/components/Navbar/index.cjs.map +1 -1
- package/dist/components/Navbar/index.mjs +3 -1
- package/dist/components/Navbar/index.mjs.map +1 -1
- package/dist/components/Select/Multiselect.d.ts +1 -1
- package/dist/components/Select/Multiselect.d.ts.map +1 -1
- package/dist/components/SwitchSelector/index.cjs +3 -1
- package/dist/components/SwitchSelector/index.cjs.map +1 -1
- package/dist/components/SwitchSelector/index.d.ts +1 -1
- package/dist/components/SwitchSelector/index.mjs +3 -1
- package/dist/components/SwitchSelector/index.mjs.map +1 -1
- package/dist/components/TabSelector/TabSelector.cjs +13 -10
- package/dist/components/TabSelector/TabSelector.cjs.map +1 -1
- package/dist/components/TabSelector/TabSelector.d.ts +1 -1
- package/dist/components/TabSelector/TabSelector.d.ts.map +1 -1
- package/dist/components/TabSelector/TabSelector.mjs +13 -10
- package/dist/components/TabSelector/TabSelector.mjs.map +1 -1
- package/dist/components/Tag/index.cjs +79 -0
- package/dist/components/Tag/index.cjs.map +1 -0
- package/dist/components/Tag/index.d.ts +12 -0
- package/dist/components/Tag/index.d.ts.map +1 -0
- package/dist/components/Tag/index.mjs +79 -0
- package/dist/components/Tag/index.mjs.map +1 -0
- package/dist/components/Toaster/Toast.d.ts +1 -1
- package/dist/components/index.cjs +4 -4
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.mjs +3 -3
- package/dist/components/index.mjs.map +1 -1
- package/dist/hooks/index.cjs +4 -1
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.mjs +5 -2
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/hooks/intlayerAPIHooks.cjs +257 -126
- package/dist/hooks/intlayerAPIHooks.cjs.map +1 -1
- package/dist/hooks/intlayerAPIHooks.d.ts +43 -38
- package/dist/hooks/intlayerAPIHooks.d.ts.map +1 -1
- package/dist/hooks/intlayerAPIHooks.mjs +258 -127
- package/dist/hooks/intlayerAPIHooks.mjs.map +1 -1
- package/dist/hooks/useAsync/useAsync.cjs +142 -104
- package/dist/hooks/useAsync/useAsync.cjs.map +1 -1
- package/dist/hooks/useAsync/useAsync.d.ts +0 -2
- package/dist/hooks/useAsync/useAsync.d.ts.map +1 -1
- package/dist/hooks/useAsync/useAsync.mjs +143 -105
- package/dist/hooks/useAsync/useAsync.mjs.map +1 -1
- package/dist/hooks/useAsync/useAsyncStateStore.cjs +50 -112
- package/dist/hooks/useAsync/useAsyncStateStore.cjs.map +1 -1
- package/dist/hooks/useAsync/useAsyncStateStore.d.ts +3 -9
- package/dist/hooks/useAsync/useAsyncStateStore.d.ts.map +1 -1
- package/dist/hooks/useAsync/useAsyncStateStore.mjs +50 -112
- package/dist/hooks/useAsync/useAsyncStateStore.mjs.map +1 -1
- package/dist/hooks/useAsync/useProxyState.d.ts +3 -0
- package/dist/hooks/useAsync/useProxyState.d.ts.map +1 -0
- package/dist/hooks/useIntlayerAPI.cjs +6 -5
- package/dist/hooks/useIntlayerAPI.cjs.map +1 -1
- package/dist/hooks/useIntlayerAPI.d.ts +51 -45
- package/dist/hooks/useIntlayerAPI.d.ts.map +1 -1
- package/dist/hooks/useIntlayerAPI.mjs +5 -4
- package/dist/hooks/useIntlayerAPI.mjs.map +1 -1
- package/dist/hooks/useItemSelector.cjs +11 -2
- package/dist/hooks/useItemSelector.cjs.map +1 -1
- package/dist/hooks/useItemSelector.d.ts +3 -2
- package/dist/hooks/useItemSelector.d.ts.map +1 -1
- package/dist/hooks/useItemSelector.mjs +11 -2
- package/dist/hooks/useItemSelector.mjs.map +1 -1
- package/dist/hooks/usePersistedStore.cjs +22 -0
- package/dist/hooks/usePersistedStore.cjs.map +1 -0
- package/dist/hooks/usePersistedStore.d.ts +2 -0
- package/dist/hooks/usePersistedStore.d.ts.map +1 -0
- package/dist/hooks/usePersistedStore.mjs +22 -0
- package/dist/hooks/usePersistedStore.mjs.map +1 -0
- package/dist/hooks/usePersistenceStore.cjs +22 -0
- package/dist/hooks/usePersistenceStore.cjs.map +1 -0
- package/dist/hooks/usePersistenceStore.d.ts +2 -0
- package/dist/hooks/usePersistenceStore.d.ts.map +1 -0
- package/dist/hooks/usePersistenceStore.mjs +22 -0
- package/dist/hooks/usePersistenceStore.mjs.map +1 -0
- package/dist/libs/intlayer-api/auth.cjs +14 -2
- package/dist/libs/intlayer-api/auth.cjs.map +1 -1
- package/dist/libs/intlayer-api/auth.d.ts +7 -3
- package/dist/libs/intlayer-api/auth.d.ts.map +1 -1
- package/dist/libs/intlayer-api/auth.mjs +14 -2
- package/dist/libs/intlayer-api/auth.mjs.map +1 -1
- package/dist/libs/intlayer-api/fetcher.cjs +7 -1
- package/dist/libs/intlayer-api/fetcher.cjs.map +1 -1
- package/dist/libs/intlayer-api/fetcher.d.ts.map +1 -1
- package/dist/libs/intlayer-api/fetcher.mjs +7 -1
- package/dist/libs/intlayer-api/fetcher.mjs.map +1 -1
- package/dist/libs/intlayer-api/index.cjs +3 -1
- package/dist/libs/intlayer-api/index.cjs.map +1 -1
- package/dist/libs/intlayer-api/index.d.ts +12 -2
- package/dist/libs/intlayer-api/index.d.ts.map +1 -1
- package/dist/libs/intlayer-api/index.mjs +3 -1
- package/dist/libs/intlayer-api/index.mjs.map +1 -1
- package/dist/libs/intlayer-api/stripe.cjs +22 -0
- package/dist/libs/intlayer-api/stripe.cjs.map +1 -0
- package/dist/libs/intlayer-api/stripe.d.ts +6 -0
- package/dist/libs/intlayer-api/stripe.d.ts.map +1 -0
- package/dist/libs/intlayer-api/stripe.mjs +22 -0
- package/dist/libs/intlayer-api/stripe.mjs.map +1 -0
- package/dist/stripe-BsI0lJWz.js +22 -0
- package/dist/stripe-BsI0lJWz.js.map +1 -0
- package/dist/stripe-C-u5RvGh.js +22 -0
- package/dist/stripe-C-u5RvGh.js.map +1 -0
- package/dist/stripe-CF_E65Vu.js +22 -0
- package/dist/stripe-CF_E65Vu.js.map +1 -0
- package/dist/stripe-CpGvfq6T.cjs +21 -0
- package/dist/stripe-CpGvfq6T.cjs.map +1 -0
- package/dist/stripe-DEv4DjAL.cjs +21 -0
- package/dist/stripe-DEv4DjAL.cjs.map +1 -0
- package/dist/stripe-DuG0uaEn.cjs +21 -0
- package/dist/stripe-DuG0uaEn.cjs.map +1 -0
- package/dist/tailwind.css +1 -1
- package/dist/useProxyState-D5GLrY2y.js +20 -0
- package/dist/useProxyState-D5GLrY2y.js.map +1 -0
- package/dist/useProxyState-DewdF3no.cjs +19 -0
- package/dist/useProxyState-DewdF3no.cjs.map +1 -0
- package/package.json +15 -11
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
const require$$0 = require("react");
|
|
5
|
+
const hooks_useAsync_useAsync = require("../../../hooks/useAsync/useAsync.cjs");
|
|
6
|
+
const libs_intlayerApi_index = require("../../../libs/intlayer-api/index.cjs");
|
|
7
|
+
const useSession = (sessionProp) => {
|
|
8
|
+
const {
|
|
9
|
+
getSession,
|
|
10
|
+
revalidate,
|
|
11
|
+
data,
|
|
12
|
+
setData: setSession,
|
|
13
|
+
isFetched
|
|
14
|
+
} = hooks_useAsync_useAsync.useAsync(
|
|
15
|
+
"getSession",
|
|
16
|
+
async () => {
|
|
17
|
+
try {
|
|
18
|
+
const result = await libs_intlayerApi_index.getIntlayerAPI().auth.getSession();
|
|
19
|
+
if (result.data) {
|
|
20
|
+
const { user, organization, project } = result.data;
|
|
21
|
+
const formattedSession = {
|
|
22
|
+
user,
|
|
23
|
+
organization,
|
|
24
|
+
isOrganizationAdmin: (user && (organization?.adminsIds ?? []).includes(user._id)) ?? false,
|
|
25
|
+
project,
|
|
26
|
+
isProjectAdmin: (user && (project?.adminsIds ?? []).includes(user._id)) ?? false
|
|
27
|
+
};
|
|
28
|
+
return formattedSession;
|
|
29
|
+
}
|
|
30
|
+
} catch (_error) {
|
|
31
|
+
console.error(_error);
|
|
32
|
+
}
|
|
33
|
+
return null;
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
cache: true,
|
|
37
|
+
store: true,
|
|
38
|
+
autoFetch: true,
|
|
39
|
+
enable: !sessionProp,
|
|
40
|
+
invalidateQueries: [
|
|
41
|
+
"getOrganizations",
|
|
42
|
+
"getProjects",
|
|
43
|
+
"getUsers",
|
|
44
|
+
"getDictionaries"
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
const session = require$$0.useMemo(
|
|
49
|
+
() => data ?? (isFetched ? null : void 0),
|
|
50
|
+
[data, isFetched]
|
|
51
|
+
);
|
|
52
|
+
return {
|
|
53
|
+
session,
|
|
54
|
+
fetchSession: getSession,
|
|
55
|
+
revalidateSession: revalidate,
|
|
56
|
+
setSession
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
exports.useSession = useSession;
|
|
60
|
+
//# sourceMappingURL=useSession.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSession.cjs","sources":["../../../../src/components/Auth/useAuth/useSession.ts"],"sourcesContent":["'use client';\n\nimport { useMemo } from 'react';\nimport { useAsync } from '../../../hooks/useAsync';\nimport { getIntlayerAPI } from '../../../libs/intlayer-api';\nimport type { Session } from './index';\n\nexport const useSession = (sessionProp?: Session | null) => {\n const {\n getSession,\n revalidate,\n data,\n setData: setSession,\n isFetched,\n } = useAsync(\n 'getSession',\n async () => {\n try {\n const result = await getIntlayerAPI().auth.getSession();\n\n if (result.data) {\n const { user, organization, project } = result.data;\n\n const formattedSession: Session = {\n user,\n organization,\n isOrganizationAdmin:\n (user && (organization?.adminsIds ?? []).includes(user._id!)) ??\n false,\n project,\n isProjectAdmin:\n (user && (project?.adminsIds ?? []).includes(user._id!)) ?? false,\n };\n\n return formattedSession;\n }\n } catch (_error) {\n console.error(_error);\n // Failed to fetch session\n }\n\n return null;\n },\n {\n cache: true,\n store: true,\n autoFetch: true,\n enable: !sessionProp,\n invalidateQueries: [\n 'getOrganizations',\n 'getProjects',\n 'getUsers',\n 'getDictionaries',\n ],\n }\n );\n\n const session = useMemo(\n () => data ?? (isFetched ? null : undefined),\n [data, isFetched]\n );\n\n return {\n session,\n fetchSession: getSession,\n revalidateSession: revalidate,\n setSession,\n };\n};\n"],"names":["useAsync","getIntlayerAPI","useMemo"],"mappings":";;;;;;AAOa,MAAA,aAAa,CAAC,gBAAiC;AACpD,QAAA;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT;AAAA,EAAA,IACEA,wBAAA;AAAA,IACF;AAAA,IACA,YAAY;AACN,UAAA;AACF,cAAM,SAAS,MAAMC,uBAAAA,eAAe,EAAE,KAAK,WAAW;AAEtD,YAAI,OAAO,MAAM;AACf,gBAAM,EAAE,MAAM,cAAc,QAAA,IAAY,OAAO;AAE/C,gBAAM,mBAA4B;AAAA,YAChC;AAAA,YACA;AAAA,YACA,sBACG,SAAS,cAAc,aAAa,CAAI,GAAA,SAAS,KAAK,GAAI,MAC3D;AAAA,YACF;AAAA,YACA,iBACG,SAAS,SAAS,aAAa,CAAI,GAAA,SAAS,KAAK,GAAI,MAAM;AAAA,UAAA;AAGzD,iBAAA;AAAA,QACT;AAAA,eACO,QAAQ;AACf,gBAAQ,MAAM,MAAM;AAAA,MAEtB;AAEO,aAAA;AAAA,IACT;AAAA,IACA;AAAA,MACE,OAAO;AAAA,MACP,OAAO;AAAA,MACP,WAAW;AAAA,MACX,QAAQ,CAAC;AAAA,MACT,mBAAmB;AAAA,QACjB;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,IACF;AAAA,EAAA;AAGF,QAAM,UAAUC,WAAA;AAAA,IACd,MAAM,SAAS,YAAY,OAAO;AAAA,IAClC,CAAC,MAAM,SAAS;AAAA,EAAA;AAGX,SAAA;AAAA,IACL;AAAA,IACA,cAAc;AAAA,IACd,mBAAmB;AAAA,IACnB;AAAA,EAAA;AAEJ;;"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Session } from './index';
|
|
2
|
+
export declare const useSession: (sessionProp?: Session | null) => {
|
|
3
|
+
session: Session | null | undefined;
|
|
4
|
+
fetchSession: () => Promise<Session | null>;
|
|
5
|
+
revalidateSession: () => Promise<Session | null>;
|
|
6
|
+
setSession: (data: Session | null) => void;
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=useSession.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSession.d.ts","sourceRoot":"","sources":["../../../../src/components/Auth/useAuth/useSession.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAEvC,eAAO,MAAM,UAAU,iBAAkB,OAAO,GAAG,IAAI;;;;;CA6DtD,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { useAsync } from "../../../hooks/useAsync/useAsync.mjs";
|
|
4
|
+
import { getIntlayerAPI } from "../../../libs/intlayer-api/index.mjs";
|
|
5
|
+
const useSession = (sessionProp) => {
|
|
6
|
+
const {
|
|
7
|
+
getSession,
|
|
8
|
+
revalidate,
|
|
9
|
+
data,
|
|
10
|
+
setData: setSession,
|
|
11
|
+
isFetched
|
|
12
|
+
} = useAsync(
|
|
13
|
+
"getSession",
|
|
14
|
+
async () => {
|
|
15
|
+
try {
|
|
16
|
+
const result = await getIntlayerAPI().auth.getSession();
|
|
17
|
+
if (result.data) {
|
|
18
|
+
const { user, organization, project } = result.data;
|
|
19
|
+
const formattedSession = {
|
|
20
|
+
user,
|
|
21
|
+
organization,
|
|
22
|
+
isOrganizationAdmin: (user && (organization?.adminsIds ?? []).includes(user._id)) ?? false,
|
|
23
|
+
project,
|
|
24
|
+
isProjectAdmin: (user && (project?.adminsIds ?? []).includes(user._id)) ?? false
|
|
25
|
+
};
|
|
26
|
+
return formattedSession;
|
|
27
|
+
}
|
|
28
|
+
} catch (_error) {
|
|
29
|
+
console.error(_error);
|
|
30
|
+
}
|
|
31
|
+
return null;
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
cache: true,
|
|
35
|
+
store: true,
|
|
36
|
+
autoFetch: true,
|
|
37
|
+
enable: !sessionProp,
|
|
38
|
+
invalidateQueries: [
|
|
39
|
+
"getOrganizations",
|
|
40
|
+
"getProjects",
|
|
41
|
+
"getUsers",
|
|
42
|
+
"getDictionaries"
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
const session = useMemo(
|
|
47
|
+
() => data ?? (isFetched ? null : void 0),
|
|
48
|
+
[data, isFetched]
|
|
49
|
+
);
|
|
50
|
+
return {
|
|
51
|
+
session,
|
|
52
|
+
fetchSession: getSession,
|
|
53
|
+
revalidateSession: revalidate,
|
|
54
|
+
setSession
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
export {
|
|
58
|
+
useSession
|
|
59
|
+
};
|
|
60
|
+
//# sourceMappingURL=useSession.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSession.mjs","sources":["../../../../src/components/Auth/useAuth/useSession.ts"],"sourcesContent":["'use client';\n\nimport { useMemo } from 'react';\nimport { useAsync } from '../../../hooks/useAsync';\nimport { getIntlayerAPI } from '../../../libs/intlayer-api';\nimport type { Session } from './index';\n\nexport const useSession = (sessionProp?: Session | null) => {\n const {\n getSession,\n revalidate,\n data,\n setData: setSession,\n isFetched,\n } = useAsync(\n 'getSession',\n async () => {\n try {\n const result = await getIntlayerAPI().auth.getSession();\n\n if (result.data) {\n const { user, organization, project } = result.data;\n\n const formattedSession: Session = {\n user,\n organization,\n isOrganizationAdmin:\n (user && (organization?.adminsIds ?? []).includes(user._id!)) ??\n false,\n project,\n isProjectAdmin:\n (user && (project?.adminsIds ?? []).includes(user._id!)) ?? false,\n };\n\n return formattedSession;\n }\n } catch (_error) {\n console.error(_error);\n // Failed to fetch session\n }\n\n return null;\n },\n {\n cache: true,\n store: true,\n autoFetch: true,\n enable: !sessionProp,\n invalidateQueries: [\n 'getOrganizations',\n 'getProjects',\n 'getUsers',\n 'getDictionaries',\n ],\n }\n );\n\n const session = useMemo(\n () => data ?? (isFetched ? null : undefined),\n [data, isFetched]\n );\n\n return {\n session,\n fetchSession: getSession,\n revalidateSession: revalidate,\n setSession,\n };\n};\n"],"names":[],"mappings":";;;;AAOa,MAAA,aAAa,CAAC,gBAAiC;AACpD,QAAA;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT;AAAA,EAAA,IACE;AAAA,IACF;AAAA,IACA,YAAY;AACN,UAAA;AACF,cAAM,SAAS,MAAM,eAAe,EAAE,KAAK,WAAW;AAEtD,YAAI,OAAO,MAAM;AACf,gBAAM,EAAE,MAAM,cAAc,QAAA,IAAY,OAAO;AAE/C,gBAAM,mBAA4B;AAAA,YAChC;AAAA,YACA;AAAA,YACA,sBACG,SAAS,cAAc,aAAa,CAAI,GAAA,SAAS,KAAK,GAAI,MAC3D;AAAA,YACF;AAAA,YACA,iBACG,SAAS,SAAS,aAAa,CAAI,GAAA,SAAS,KAAK,GAAI,MAAM;AAAA,UAAA;AAGzD,iBAAA;AAAA,QACT;AAAA,eACO,QAAQ;AACf,gBAAQ,MAAM,MAAM;AAAA,MAEtB;AAEO,aAAA;AAAA,IACT;AAAA,IACA;AAAA,MACE,OAAO;AAAA,MACP,OAAO;AAAA,MACP,WAAW;AAAA,MACX,QAAQ,CAAC;AAAA,MACT,mBAAmB;AAAA,QACjB;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,IACF;AAAA,EAAA;AAGF,QAAM,UAAU;AAAA,IACd,MAAM,SAAS,YAAY,OAAO;AAAA,IAClC,CAAC,MAAM,SAAS;AAAA,EAAA;AAGX,SAAA;AAAA,IACL;AAAA,IACA,cAAc;AAAA,IACd,mBAAmB;AAAA,IACnB;AAAA,EAAA;AAEJ;"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use strict";
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
-
|
|
4
|
+
require("react");
|
|
5
5
|
require("../../../hooks/useScrollBlockage/useScrollBlockageStore.cjs");
|
|
6
6
|
require("../../../hooks/useAsync/useAsyncStateStore.cjs");
|
|
7
7
|
const hooks_intlayerAPIHooks = require("../../../hooks/intlayerAPIHooks.cjs");
|
|
8
8
|
require("@intlayer/dictionaries-entry");
|
|
9
9
|
require("deepmerge");
|
|
10
|
-
const
|
|
10
|
+
const components_Auth_useAuth_index = require("../useAuth/index.cjs");
|
|
11
11
|
const useUser = () => {
|
|
12
|
-
const { session, revalidateSession, setSession } =
|
|
12
|
+
const { session, revalidateSession, setSession } = components_Auth_useAuth_index.useAuth();
|
|
13
13
|
const { logout } = hooks_intlayerAPIHooks.useLogout();
|
|
14
14
|
const status = session?.user ? "authenticated" : "unauthenticated";
|
|
15
15
|
const isAuthenticated = status === "authenticated";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../../src/components/Auth/useUser/index.ts"],"sourcesContent":["'use client';\n\nimport {
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../../src/components/Auth/useUser/index.ts"],"sourcesContent":["'use client';\n\nimport { useLogout } from '../../../hooks';\nimport { useAuth } from '../useAuth';\n\nexport const useUser = () => {\n const { session, revalidateSession, setSession } = useAuth();\n const { logout } = useLogout();\n\n const status = session?.user ? 'authenticated' : 'unauthenticated';\n\n const isAuthenticated = status === 'authenticated';\n const isUnauthenticated = status === 'unauthenticated';\n\n const user = session?.user;\n\n const logoutHandle = async () => {\n setSession(null);\n await logout();\n };\n\n return {\n isAuthenticated,\n isUnauthenticated,\n user,\n revalidateSession,\n logout: logoutHandle,\n };\n};\n"],"names":["useAuth","useLogout"],"mappings":";;;;;;;;;;AAKO,MAAM,UAAU,MAAM;AAC3B,QAAM,EAAE,SAAS,mBAAmB,eAAeA,8BAAQ,QAAA;AACrD,QAAA,EAAE,WAAWC,uBAAAA;AAEb,QAAA,SAAS,SAAS,OAAO,kBAAkB;AAEjD,QAAM,kBAAkB,WAAW;AACnC,QAAM,oBAAoB,WAAW;AAErC,QAAM,OAAO,SAAS;AAEtB,QAAM,eAAe,YAAY;AAC/B,eAAW,IAAI;AACf,UAAM,OAAO;AAAA,EAAA;AAGR,SAAA;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,QAAQ;AAAA,EAAA;AAEZ;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Auth/useUser/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Auth/useUser/index.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,OAAO;;;;;;CAuBnB,CAAC"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
2
|
+
import "react";
|
|
3
3
|
import "../../../hooks/useScrollBlockage/useScrollBlockageStore.mjs";
|
|
4
4
|
import "../../../hooks/useAsync/useAsyncStateStore.mjs";
|
|
5
5
|
import { useLogout } from "../../../hooks/intlayerAPIHooks.mjs";
|
|
6
6
|
import "@intlayer/dictionaries-entry";
|
|
7
7
|
import "deepmerge";
|
|
8
|
-
import {
|
|
8
|
+
import { useAuth } from "../useAuth/index.mjs";
|
|
9
9
|
const useUser = () => {
|
|
10
|
-
const { session, revalidateSession, setSession } =
|
|
10
|
+
const { session, revalidateSession, setSession } = useAuth();
|
|
11
11
|
const { logout } = useLogout();
|
|
12
12
|
const status = session?.user ? "authenticated" : "unauthenticated";
|
|
13
13
|
const isAuthenticated = status === "authenticated";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../../src/components/Auth/useUser/index.ts"],"sourcesContent":["'use client';\n\nimport {
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../../src/components/Auth/useUser/index.ts"],"sourcesContent":["'use client';\n\nimport { useLogout } from '../../../hooks';\nimport { useAuth } from '../useAuth';\n\nexport const useUser = () => {\n const { session, revalidateSession, setSession } = useAuth();\n const { logout } = useLogout();\n\n const status = session?.user ? 'authenticated' : 'unauthenticated';\n\n const isAuthenticated = status === 'authenticated';\n const isUnauthenticated = status === 'unauthenticated';\n\n const user = session?.user;\n\n const logoutHandle = async () => {\n setSession(null);\n await logout();\n };\n\n return {\n isAuthenticated,\n isUnauthenticated,\n user,\n revalidateSession,\n logout: logoutHandle,\n };\n};\n"],"names":[],"mappings":";;;;;;;;AAKO,MAAM,UAAU,MAAM;AAC3B,QAAM,EAAE,SAAS,mBAAmB,eAAe,QAAQ;AACrD,QAAA,EAAE,WAAW;AAEb,QAAA,SAAS,SAAS,OAAO,kBAAkB;AAEjD,QAAM,kBAAkB,WAAW;AACnC,QAAM,oBAAoB,WAAW;AAErC,QAAM,OAAO,SAAS;AAEtB,QAAM,eAAe,YAAY;AAC/B,eAAW,IAAI;AACf,UAAM,OAAO;AAAA,EAAA;AAGR,SAAA;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,QAAQ;AAAA,EAAA;AAEZ;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { VariantProps } from 'class-variance-authority';
|
|
2
2
|
import { HTMLAttributes } from 'react';
|
|
3
3
|
export declare const badgeVariants: (props?: ({
|
|
4
|
-
color?: "text" | "
|
|
4
|
+
color?: "text" | "primary" | "secondary" | "destructive" | "neutral" | "light" | "dark" | "custom" | null | undefined;
|
|
5
5
|
variant?: "default" | "none" | "outline" | "hoverable" | null | undefined;
|
|
6
6
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
7
|
export type BadgeProps = HTMLAttributes<HTMLDivElement> & VariantProps<typeof badgeVariants>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.cjs","sources":["../../../src/components/Button/Button.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport type { LucideIcon } from 'lucide-react';\nimport {\n forwardRef,\n type ButtonHTMLAttributes,\n type DetailedHTMLProps,\n type FC,\n} from 'react';\nimport { cn } from '../../utils/cn';\nimport { Loader } from '../Loader';\n\nconst buttonIconVariants = cva('size-4', {\n variants: {\n size: {\n sm: 'w-4',\n md: 'w-6',\n lg: 'w-7',\n xl: 'w-9',\n 'icon-sm': 'size-6 p-1',\n 'icon-md': 'size-7 p-1',\n 'icon-lg': 'size-9 p-1',\n 'icon-xl': 'size-10 p-1',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n});\n\nconst buttonVariants = cva(\n 'flex items-center gap-3 whitespace-nowrap font-medium transition focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50',\n {\n variants: {\n size: {\n sm: 'min-h-8 px-3 text-xs',\n md: 'min-h-9 px-6 text-base',\n lg: 'min-h-10 px-8 text-lg',\n xl: 'min-h-11 px-10 text-xl',\n 'icon-sm': 'p-0',\n 'icon-md': 'p-0',\n 'icon-lg': 'p-0',\n 'icon-xl': 'p-0',\n },\n variant: {\n default: 'rounded-lg text-text-opposite dark:text-text-opposite-dark',\n none: 'border-none bg-opacity-0 text-inherit hover:bg-opacity-0 dark:bg-opacity-0 dark:text-inherit dark:hover:bg-opacity-0',\n outline:\n 'rounded-lg border-[1.5px] bg-opacity-0 hover:bg-opacity-30 dark:bg-opacity-0',\n link: 'h-auto justify-start border-inherit bg-transparent px-1 underline-offset-4 hover:bg-transparent hover:underline dark:bg-transparent hover:dark:bg-transparent',\n 'invisible-link':\n 'h-auto justify-start border-inherit bg-transparent px-1 underline-offset-4 hover:bg-transparent dark:bg-transparent hover:dark:bg-transparent',\n hoverable:\n 'rounded-lg border-none bg-opacity-0 transition hover:bg-opacity-10 aria-[current=true]:bg-opacity-5 dark:border-none dark:bg-opacity-0 dark:hover:bg-opacity-10',\n },\n color: {\n primary:\n 'border-primary bg-primary text-primary hover:bg-primary-500 dark:border-primary-dark dark:bg-primary-dark dark:text-primary-dark hover:dark:bg-primary-300',\n secondary:\n 'border-secondary bg-secondary text-secondary hover:bg-secondary-300 dark:border-secondary-dark dark:bg-secondary-dark dark:text-secondary-dark hover:dark:bg-secondary-100',\n destructive:\n 'border-destructive bg-destructive text-destructive hover:bg-destructive-500 dark:border-destructive-dark dark:bg-destructive-dark hover:dark:bg-destructive-200',\n neutral:\n 'border-neutral bg-neutral text-neutral hover:bg-neutral-600 dark:border-neutral-dark dark:bg-neutral-dark dark:text-neutral-dark hover:dark:bg-neutral-400',\n light: 'border-white bg-white text-white hover:bg-neutral-500',\n dark: 'border-neutral-800 bg-neutral-800 text-neutral-800 hover:bg-neutral-900 dark:hover:bg-neutral-700',\n text: 'border-text bg-text text-text hover:opacity-80 dark:border-text-dark dark:bg-text-dark dark:text-text-dark',\n 'text-inverse':\n 'border-text-inverse dark:border-text-inverse-dark bg-text-inverse dark:bg-text-inverse-dark text-text-inverse dark:text-text-inverse-dark hover:opacity-80',\n error:\n 'border-error bg-error text-error hover:bg-error-500 dark:border-error-dark dark:bg-error-dark dark:text-error-dark hover:dark:bg-error-300',\n success:\n 'border-success bg-success text-success hover:bg-success-500 dark:border-success-dark dark:bg-success-dark dark:text-success-dark hover:dark:bg-success-300',\n custom: '',\n },\n\n textAlign: {\n left: 'text-left',\n center: 'text-center',\n right: 'text-right',\n },\n\n isFullWidth: {\n true: 'w-full',\n false: '',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'md',\n color: 'primary',\n textAlign: 'center',\n isFullWidth: false,\n },\n }\n);\n\nexport type ButtonProps = DetailedHTMLProps<\n ButtonHTMLAttributes<HTMLButtonElement>,\n HTMLButtonElement\n> &\n VariantProps<typeof buttonVariants> & {\n /**\n * Optional icon to be displayed on the button\n */\n label: string;\n Icon?: FC | LucideIcon;\n IconRight?: FC | LucideIcon;\n iconClassName?: string;\n isLoading?: boolean;\n isActive?: boolean;\n
|
|
1
|
+
{"version":3,"file":"Button.cjs","sources":["../../../src/components/Button/Button.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport type { LucideIcon } from 'lucide-react';\nimport {\n forwardRef,\n type ButtonHTMLAttributes,\n type DetailedHTMLProps,\n type FC,\n} from 'react';\nimport { cn } from '../../utils/cn';\nimport { Loader } from '../Loader';\n\nconst buttonIconVariants = cva('size-4', {\n variants: {\n size: {\n sm: 'w-4',\n md: 'w-6',\n lg: 'w-7',\n xl: 'w-9',\n 'icon-sm': 'size-6 p-1',\n 'icon-md': 'size-7 p-1',\n 'icon-lg': 'size-9 p-1',\n 'icon-xl': 'size-10 p-1',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n});\n\nconst buttonVariants = cva(\n 'flex items-center gap-3 whitespace-nowrap font-medium transition focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50',\n {\n variants: {\n size: {\n sm: 'min-h-8 px-3 text-xs',\n md: 'min-h-9 px-6 text-base',\n lg: 'min-h-10 px-8 text-lg',\n xl: 'min-h-11 px-10 text-xl',\n 'icon-sm': 'p-0',\n 'icon-md': 'p-0',\n 'icon-lg': 'p-0',\n 'icon-xl': 'p-0',\n },\n variant: {\n default: 'rounded-lg text-text-opposite dark:text-text-opposite-dark',\n none: 'border-none bg-opacity-0 text-inherit hover:bg-opacity-0 dark:bg-opacity-0 dark:text-inherit dark:hover:bg-opacity-0',\n outline:\n 'rounded-lg border-[1.5px] bg-opacity-0 hover:bg-opacity-30 dark:bg-opacity-0',\n link: 'h-auto justify-start border-inherit bg-transparent px-1 underline-offset-4 hover:bg-transparent hover:underline dark:bg-transparent hover:dark:bg-transparent',\n 'invisible-link':\n 'h-auto justify-start border-inherit bg-transparent px-1 underline-offset-4 hover:bg-transparent dark:bg-transparent hover:dark:bg-transparent',\n hoverable:\n 'rounded-lg border-none bg-opacity-0 transition hover:bg-opacity-10 aria-[current=true]:bg-opacity-5 dark:border-none dark:bg-opacity-0 dark:hover:bg-opacity-10',\n },\n color: {\n primary:\n 'border-primary bg-primary text-primary hover:bg-primary-500 dark:border-primary-dark dark:bg-primary-dark dark:text-primary-dark hover:dark:bg-primary-300',\n secondary:\n 'border-secondary bg-secondary text-secondary hover:bg-secondary-300 dark:border-secondary-dark dark:bg-secondary-dark dark:text-secondary-dark hover:dark:bg-secondary-100',\n destructive:\n 'border-destructive bg-destructive text-destructive hover:bg-destructive-500 dark:border-destructive-dark dark:bg-destructive-dark hover:dark:bg-destructive-200',\n neutral:\n 'border-neutral bg-neutral text-neutral hover:bg-neutral-600 dark:border-neutral-dark dark:bg-neutral-dark dark:text-neutral-dark hover:dark:bg-neutral-400',\n light: 'border-white bg-white text-white hover:bg-neutral-500',\n dark: 'border-neutral-800 bg-neutral-800 text-neutral-800 hover:bg-neutral-900 dark:hover:bg-neutral-700',\n text: 'border-text bg-text text-text hover:opacity-80 dark:border-text-dark dark:bg-text-dark dark:text-text-dark',\n 'text-inverse':\n 'border-text-inverse dark:border-text-inverse-dark bg-text-inverse dark:bg-text-inverse-dark text-text-inverse dark:text-text-inverse-dark hover:opacity-80',\n error:\n 'border-error bg-error text-error hover:bg-error-500 dark:border-error-dark dark:bg-error-dark dark:text-error-dark hover:dark:bg-error-300',\n success:\n 'border-success bg-success text-success hover:bg-success-500 dark:border-success-dark dark:bg-success-dark dark:text-success-dark hover:dark:bg-success-300',\n custom: '',\n },\n\n textAlign: {\n left: 'text-left',\n center: 'text-center',\n right: 'text-right',\n },\n\n isFullWidth: {\n true: 'w-full',\n false: '',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'md',\n color: 'primary',\n textAlign: 'center',\n isFullWidth: false,\n },\n }\n);\n\nexport type ButtonProps = DetailedHTMLProps<\n ButtonHTMLAttributes<HTMLButtonElement>,\n HTMLButtonElement\n> &\n VariantProps<typeof buttonVariants> & {\n /**\n * Optional icon to be displayed on the button\n */\n label: string;\n Icon?: FC | LucideIcon;\n IconRight?: FC | LucideIcon;\n iconClassName?: string;\n isLoading?: boolean;\n isActive?: boolean;\n isFullWidth?: boolean;\n };\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n variant = 'default',\n size = 'sm',\n color = 'primary',\n children,\n Icon,\n IconRight,\n iconClassName,\n isLoading = false,\n isActive,\n isFullWidth = false,\n textAlign = IconRight ? 'left' : 'center',\n disabled,\n label,\n className,\n type = 'button',\n ...props\n },\n ref\n ) => {\n const isLink = variant === 'link' || variant === 'invisible-link';\n\n return (\n <button\n ref={ref}\n disabled={isLoading ?? disabled}\n aria-current={isActive}\n aria-selected={isActive}\n aria-label={label}\n aria-busy={isLoading}\n role={isLink ? 'link' : undefined}\n type={type}\n className={buttonVariants({\n variant,\n size,\n color,\n isFullWidth,\n textAlign,\n className,\n })}\n {...props}\n >\n {Icon && !isLoading && (\n <Icon\n className={cn(\n buttonIconVariants({ size, className: iconClassName }),\n 'float-start'\n )}\n />\n )}\n\n <Loader\n className={cn(\n buttonIconVariants({ size, className: iconClassName }),\n 'float-start'\n )}\n isLoading={isLoading}\n />\n\n {typeof children !== 'undefined' && (\n <div className=\"flex-1\">{children}</div>\n )}\n\n {IconRight && (\n <IconRight\n className={cn(\n buttonIconVariants({ size, className: iconClassName }),\n ''\n )}\n />\n )}\n </button>\n );\n }\n);\n\nButton.displayName = 'Button';\n"],"names":["cva","forwardRef","jsxs","jsx","cn","Loader"],"mappings":";;;;;;;AAWA,MAAM,qBAAqBA,2BAAI,UAAU;AAAA,EACvC,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,WAAW;AAAA,MACX,WAAW;AAAA,MACX,WAAW;AAAA,MACX,WAAW;AAAA,IACb;AAAA,EACF;AAAA,EACA,iBAAiB;AAAA,IACf,MAAM;AAAA,EACR;AACF,CAAC;AAED,MAAM,iBAAiBA,uBAAA;AAAA,EACrB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,MAAM;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,WAAW;AAAA,QACX,WAAW;AAAA,QACX,WAAW;AAAA,QACX,WAAW;AAAA,MACb;AAAA,MACA,SAAS;AAAA,QACP,SAAS;AAAA,QACT,MAAM;AAAA,QACN,SACE;AAAA,QACF,MAAM;AAAA,QACN,kBACE;AAAA,QACF,WACE;AAAA,MACJ;AAAA,MACA,OAAO;AAAA,QACL,SACE;AAAA,QACF,WACE;AAAA,QACF,aACE;AAAA,QACF,SACE;AAAA,QACF,OAAO;AAAA,QACP,MAAM;AAAA,QACN,MAAM;AAAA,QACN,gBACE;AAAA,QACF,OACE;AAAA,QACF,SACE;AAAA,QACF,QAAQ;AAAA,MACV;AAAA,MAEA,WAAW;AAAA,QACT,MAAM;AAAA,QACN,QAAQ;AAAA,QACR,OAAO;AAAA,MACT;AAAA,MAEA,aAAa;AAAA,QACX,MAAM;AAAA,QACN,OAAO;AAAA,MACT;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,MACf,SAAS;AAAA,MACT,MAAM;AAAA,MACN,OAAO;AAAA,M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SAAA;AAAA,gBACT,mBAAmB,EAAE,MAAM,WAAW,eAAe;AAAA,gBACrD;AAAA,cACF;AAAA,YAAA;AAAA,UACF;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AAEA,OAAO,cAAc;;"}
|
|
@@ -4,7 +4,7 @@ import { ButtonHTMLAttributes, DetailedHTMLProps, FC } from 'react';
|
|
|
4
4
|
declare const buttonVariants: (props?: ({
|
|
5
5
|
size?: "sm" | "md" | "lg" | "xl" | "icon-sm" | "icon-md" | "icon-lg" | "icon-xl" | null | undefined;
|
|
6
6
|
variant?: "default" | "link" | "none" | "outline" | "invisible-link" | "hoverable" | null | undefined;
|
|
7
|
-
color?: "
|
|
7
|
+
color?: "error" | "success" | "text" | "primary" | "secondary" | "destructive" | "neutral" | "light" | "dark" | "text-inverse" | "custom" | null | undefined;
|
|
8
8
|
textAlign?: "left" | "center" | "right" | null | undefined;
|
|
9
9
|
isFullWidth?: boolean | null | undefined;
|
|
10
10
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
@@ -18,7 +18,6 @@ export type ButtonProps = DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonEleme
|
|
|
18
18
|
iconClassName?: string;
|
|
19
19
|
isLoading?: boolean;
|
|
20
20
|
isActive?: boolean;
|
|
21
|
-
isDisabled?: boolean;
|
|
22
21
|
isFullWidth?: boolean;
|
|
23
22
|
};
|
|
24
23
|
export declare const Button: import('react').ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAEL,KAAK,oBAAoB,EACzB,KAAK,i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O,CAAC;CACvB,CAAC;AAEJ,eAAO,MAAM,MAAM,wHA4ElB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.mjs","sources":["../../../src/components/Button/Button.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport type { LucideIcon } from 'lucide-react';\nimport {\n forwardRef,\n type ButtonHTMLAttributes,\n type DetailedHTMLProps,\n type FC,\n} from 'react';\nimport { cn } from '../../utils/cn';\nimport { Loader } from '../Loader';\n\nconst buttonIconVariants = cva('size-4', {\n variants: {\n size: {\n sm: 'w-4',\n md: 'w-6',\n lg: 'w-7',\n xl: 'w-9',\n 'icon-sm': 'size-6 p-1',\n 'icon-md': 'size-7 p-1',\n 'icon-lg': 'size-9 p-1',\n 'icon-xl': 'size-10 p-1',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n});\n\nconst buttonVariants = cva(\n 'flex items-center gap-3 whitespace-nowrap font-medium transition focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50',\n {\n variants: {\n size: {\n sm: 'min-h-8 px-3 text-xs',\n md: 'min-h-9 px-6 text-base',\n lg: 'min-h-10 px-8 text-lg',\n xl: 'min-h-11 px-10 text-xl',\n 'icon-sm': 'p-0',\n 'icon-md': 'p-0',\n 'icon-lg': 'p-0',\n 'icon-xl': 'p-0',\n },\n variant: {\n default: 'rounded-lg text-text-opposite dark:text-text-opposite-dark',\n none: 'border-none bg-opacity-0 text-inherit hover:bg-opacity-0 dark:bg-opacity-0 dark:text-inherit dark:hover:bg-opacity-0',\n outline:\n 'rounded-lg border-[1.5px] bg-opacity-0 hover:bg-opacity-30 dark:bg-opacity-0',\n link: 'h-auto justify-start border-inherit bg-transparent px-1 underline-offset-4 hover:bg-transparent hover:underline dark:bg-transparent hover:dark:bg-transparent',\n 'invisible-link':\n 'h-auto justify-start border-inherit bg-transparent px-1 underline-offset-4 hover:bg-transparent dark:bg-transparent hover:dark:bg-transparent',\n hoverable:\n 'rounded-lg border-none bg-opacity-0 transition hover:bg-opacity-10 aria-[current=true]:bg-opacity-5 dark:border-none dark:bg-opacity-0 dark:hover:bg-opacity-10',\n },\n color: {\n primary:\n 'border-primary bg-primary text-primary hover:bg-primary-500 dark:border-primary-dark dark:bg-primary-dark dark:text-primary-dark hover:dark:bg-primary-300',\n secondary:\n 'border-secondary bg-secondary text-secondary hover:bg-secondary-300 dark:border-secondary-dark dark:bg-secondary-dark dark:text-secondary-dark hover:dark:bg-secondary-100',\n destructive:\n 'border-destructive bg-destructive text-destructive hover:bg-destructive-500 dark:border-destructive-dark dark:bg-destructive-dark hover:dark:bg-destructive-200',\n neutral:\n 'border-neutral bg-neutral text-neutral hover:bg-neutral-600 dark:border-neutral-dark dark:bg-neutral-dark dark:text-neutral-dark hover:dark:bg-neutral-400',\n light: 'border-white bg-white text-white hover:bg-neutral-500',\n dark: 'border-neutral-800 bg-neutral-800 text-neutral-800 hover:bg-neutral-900 dark:hover:bg-neutral-700',\n text: 'border-text bg-text text-text hover:opacity-80 dark:border-text-dark dark:bg-text-dark dark:text-text-dark',\n 'text-inverse':\n 'border-text-inverse dark:border-text-inverse-dark bg-text-inverse dark:bg-text-inverse-dark text-text-inverse dark:text-text-inverse-dark hover:opacity-80',\n error:\n 'border-error bg-error text-error hover:bg-error-500 dark:border-error-dark dark:bg-error-dark dark:text-error-dark hover:dark:bg-error-300',\n success:\n 'border-success bg-success text-success hover:bg-success-500 dark:border-success-dark dark:bg-success-dark dark:text-success-dark hover:dark:bg-success-300',\n custom: '',\n },\n\n textAlign: {\n left: 'text-left',\n center: 'text-center',\n right: 'text-right',\n },\n\n isFullWidth: {\n true: 'w-full',\n false: '',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'md',\n color: 'primary',\n textAlign: 'center',\n isFullWidth: false,\n },\n }\n);\n\nexport type ButtonProps = DetailedHTMLProps<\n ButtonHTMLAttributes<HTMLButtonElement>,\n HTMLButtonElement\n> &\n VariantProps<typeof buttonVariants> & {\n /**\n * Optional icon to be displayed on the button\n */\n label: string;\n Icon?: FC | LucideIcon;\n IconRight?: FC | LucideIcon;\n iconClassName?: string;\n isLoading?: boolean;\n isActive?: boolean;\n
|
|
1
|
+
{"version":3,"file":"Button.mjs","sources":["../../../src/components/Button/Button.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport type { LucideIcon } from 'lucide-react';\nimport {\n forwardRef,\n type ButtonHTMLAttributes,\n type DetailedHTMLProps,\n type FC,\n} from 'react';\nimport { cn } from '../../utils/cn';\nimport { Loader } from '../Loader';\n\nconst buttonIconVariants = cva('size-4', {\n variants: {\n size: {\n sm: 'w-4',\n md: 'w-6',\n lg: 'w-7',\n xl: 'w-9',\n 'icon-sm': 'size-6 p-1',\n 'icon-md': 'size-7 p-1',\n 'icon-lg': 'size-9 p-1',\n 'icon-xl': 'size-10 p-1',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n});\n\nconst buttonVariants = cva(\n 'flex items-center gap-3 whitespace-nowrap font-medium transition focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50',\n {\n variants: {\n size: {\n sm: 'min-h-8 px-3 text-xs',\n md: 'min-h-9 px-6 text-base',\n lg: 'min-h-10 px-8 text-lg',\n xl: 'min-h-11 px-10 text-xl',\n 'icon-sm': 'p-0',\n 'icon-md': 'p-0',\n 'icon-lg': 'p-0',\n 'icon-xl': 'p-0',\n },\n variant: {\n default: 'rounded-lg text-text-opposite dark:text-text-opposite-dark',\n none: 'border-none bg-opacity-0 text-inherit hover:bg-opacity-0 dark:bg-opacity-0 dark:text-inherit dark:hover:bg-opacity-0',\n outline:\n 'rounded-lg border-[1.5px] bg-opacity-0 hover:bg-opacity-30 dark:bg-opacity-0',\n link: 'h-auto justify-start border-inherit bg-transparent px-1 underline-offset-4 hover:bg-transparent hover:underline dark:bg-transparent hover:dark:bg-transparent',\n 'invisible-link':\n 'h-auto justify-start border-inherit bg-transparent px-1 underline-offset-4 hover:bg-transparent dark:bg-transparent hover:dark:bg-transparent',\n hoverable:\n 'rounded-lg border-none bg-opacity-0 transition hover:bg-opacity-10 aria-[current=true]:bg-opacity-5 dark:border-none dark:bg-opacity-0 dark:hover:bg-opacity-10',\n },\n color: {\n primary:\n 'border-primary bg-primary text-primary hover:bg-primary-500 dark:border-primary-dark dark:bg-primary-dark dark:text-primary-dark hover:dark:bg-primary-300',\n secondary:\n 'border-secondary bg-secondary text-secondary hover:bg-secondary-300 dark:border-secondary-dark dark:bg-secondary-dark dark:text-secondary-dark hover:dark:bg-secondary-100',\n destructive:\n 'border-destructive bg-destructive text-destructive hover:bg-destructive-500 dark:border-destructive-dark dark:bg-destructive-dark hover:dark:bg-destructive-200',\n neutral:\n 'border-neutral bg-neutral text-neutral hover:bg-neutral-600 dark:border-neutral-dark dark:bg-neutral-dark dark:text-neutral-dark hover:dark:bg-neutral-400',\n light: 'border-white bg-white text-white hover:bg-neutral-500',\n dark: 'border-neutral-800 bg-neutral-800 text-neutral-800 hover:bg-neutral-900 dark:hover:bg-neutral-700',\n text: 'border-text bg-text text-text hover:opacity-80 dark:border-text-dark dark:bg-text-dark dark:text-text-dark',\n 'text-inverse':\n 'border-text-inverse dark:border-text-inverse-dark bg-text-inverse dark:bg-text-inverse-dark text-text-inverse dark:text-text-inverse-dark hover:opacity-80',\n error:\n 'border-error bg-error text-error hover:bg-error-500 dark:border-error-dark dark:bg-error-dark dark:text-error-dark hover:dark:bg-error-300',\n success:\n 'border-success bg-success text-success hover:bg-success-500 dark:border-success-dark dark:bg-success-dark dark:text-success-dark hover:dark:bg-success-300',\n custom: '',\n },\n\n textAlign: {\n left: 'text-left',\n center: 'text-center',\n right: 'text-right',\n },\n\n isFullWidth: {\n true: 'w-full',\n false: '',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'md',\n color: 'primary',\n textAlign: 'center',\n isFullWidth: false,\n },\n }\n);\n\nexport type ButtonProps = DetailedHTMLProps<\n ButtonHTMLAttributes<HTMLButtonElement>,\n HTMLButtonElement\n> &\n VariantProps<typeof buttonVariants> & {\n /**\n * Optional icon to be displayed on the button\n */\n label: string;\n Icon?: FC | LucideIcon;\n IconRight?: FC | LucideIcon;\n iconClassName?: string;\n isLoading?: boolean;\n isActive?: boolean;\n isFullWidth?: boolean;\n };\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n variant = 'default',\n size = 'sm',\n color = 'primary',\n children,\n Icon,\n IconRight,\n iconClassName,\n isLoading = false,\n isActive,\n isFullWidth = false,\n textAlign = IconRight ? 'left' : 'center',\n disabled,\n label,\n className,\n type = 'button',\n ...props\n },\n ref\n ) => {\n const isLink = variant === 'link' || variant === 'invisible-link';\n\n return (\n <button\n ref={ref}\n disabled={isLoading ?? disabled}\n aria-current={isActive}\n aria-selected={isActive}\n aria-label={label}\n aria-busy={isLoading}\n role={isLink ? 'link' : undefined}\n type={type}\n className={buttonVariants({\n variant,\n size,\n color,\n isFullWidth,\n textAlign,\n className,\n })}\n {...props}\n >\n {Icon && !isLoading && (\n <Icon\n className={cn(\n buttonIconVariants({ size, className: iconClassName }),\n 'float-start'\n )}\n />\n )}\n\n <Loader\n className={cn(\n buttonIconVariants({ size, className: iconClassName }),\n 'float-start'\n )}\n isLoading={isLoading}\n />\n\n {typeof children !== 'undefined' && (\n <div className=\"flex-1\">{children}</div>\n )}\n\n {IconRight && (\n <IconRight\n className={cn(\n buttonIconVariants({ size, className: iconClassName }),\n ''\n )}\n />\n )}\n </button>\n );\n }\n);\n\nButton.displayName = 'Button';\n"],"names":["jsxs","jsx"],"mappings":";;;;;AAWA,MAAM,qBAAqB,IAAI,UAAU;AAAA,EACvC,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,WAAW;AAAA,MACX,WAAW;AAAA,MACX,WAAW;AAAA,MACX,WAAW;AAAA,IACb;AAAA,EACF;AAAA,EACA,iBAAiB;AAAA,IACf,MAAM;AAAA,EAC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AA,QACC;AAAA,QACA,UAAU,aAAa;AAAA,QACvB,gBAAc;AAAA,QACd,iBAAe;AAAA,QACf,cAAY;AAAA,QACZ,aAAW;AAAA,QACX,MAAM,SAAS,SAAS;AAAA,QACxB;AAAA,QACA,WAAW,eAAe;AAAA,UACxB;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QAAA,CACD;AAAA,QACA,GAAG;AAAA,QAEH,UAAA;AAAA,UAAA,QAAQ,CAAC,aACRC,kCAAA;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,WAAW;AAAA,gBACT,mBAAmB,EAAE,MAAM,WAAW,eAAe;AAAA,gBACrD;AAAA,cACF;AAAA,YAAA;AAAA,UACF;AAAA,UAGFA,kCAAA;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,WAAW;AAAA,gBACT,mBAAmB,EAAE,MAAM,WAAW,eAAe;AAAA,gBACrD;AAAA,cACF;AAAA,cACA;AAAA,YAAA;AAAA,UACF;AAAA,UAEC,OAAO,aAAa,qDAClB,OAAI,EAAA,WAAU,UAAU,UAAS;AAAA,UAGnC,aACCA,kCAAA;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,WAAW;AAAA,gBACT,mBAAmB,EAAE,MAAM,WAAW,eAAe;AAAA,gBACrD;AAAA,cACF;AAAA,YAAA;AAAA,UACF;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AAEA,OAAO,cAAc;"}
|
|
@@ -40,7 +40,7 @@ export declare const Command: {
|
|
|
40
40
|
ref?: React.Ref<HTMLInputElement>;
|
|
41
41
|
} & {
|
|
42
42
|
asChild?: boolean;
|
|
43
|
-
}, "key" | "asChild" | keyof import('react').InputHTMLAttributes<HTMLInputElement>>, "
|
|
43
|
+
}, "key" | "asChild" | keyof import('react').InputHTMLAttributes<HTMLInputElement>>, "type" | "onChange" | "value"> & {
|
|
44
44
|
value?: string;
|
|
45
45
|
onValueChange?: (search: string) => void;
|
|
46
46
|
} & import('react').RefAttributes<HTMLInputElement>, "ref"> & import('react').RefAttributes<HTMLInputElement>>;
|
|
@@ -84,7 +84,7 @@ export declare const Command: {
|
|
|
84
84
|
ref?: React.Ref<HTMLDivElement>;
|
|
85
85
|
} & {
|
|
86
86
|
asChild?: boolean;
|
|
87
|
-
}, "key" | "asChild" | keyof HTMLAttributes<HTMLDivElement>>, "
|
|
87
|
+
}, "key" | "asChild" | keyof HTMLAttributes<HTMLDivElement>>, "onSelect" | "value" | "disabled"> & {
|
|
88
88
|
disabled?: boolean;
|
|
89
89
|
onSelect?: (value: string) => void;
|
|
90
90
|
value?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Command/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,WAAW,EACjB,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EAGL,KAAK,EAAE,EAEP,KAAK,cAAc,EACpB,MAAM,OAAO,CAAC;AAGf,eAAO,MAAM,WAAW;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Command/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,WAAW,EACjB,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EAGL,KAAK,EAAE,EAEP,KAAK,cAAc,EACpB,MAAM,OAAO,CAAC;AAGf,eAAO,MAAM,WAAW;qBAVU,SAC9B;;gBA0KioM,GAAG;;;;;;qDAAwwB,CAAC;;;;;;;0GArJ/4N,CAAC;AAyHH;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,OAAO;;;oBAW8/S,GAAG;;;;;;;;yBA3Kn/S,SAC9B;;oBA0Ks3P,GAAG;;;;;;;yBA3K31P,SAC9B;;oBA0K+qb,GAAG;;;;;yBA3Kppb,SAC9B;;oBA0K6sU,GAAG;;;;wBAA0O,SAAS;;;;;oBAA4e,GAAG;;;;;;;yBA3Kp5V,SAC9B;;oBA0Kq4Q,GAAG;;;;;;;;;;;kCAzCz4Q,cAAc,CAAC,eAAe,CAAC;;;;yBAlIA,SAC9B;;oBA0KioM,GAAG;;;;;;yDAAwwB,CAAC;;;;;;;;;yBA3K/2N,SAC9B;;oBA0KioM,GAAG;;;;;;yDAAwwB,CAAC;;;;;;;;;;CADh5N,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../src/components/Container/index.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport { type PropsWithChildren, forwardRef, type HTMLAttributes } from 'react';\nimport { cn } from '../../utils/cn';\n\nconst containerVariants = cva(\n 'flex flex-col p-10 text-text backdrop-blur dark:text-text-dark',\n {\n variants: {\n roundedSize: {\n none: 'rounded-none',\n sm: 'rounded-sm',\n md: 'rounded-md',\n lg: 'rounded-lg',\n xl: 'rounded-xl',\n '2xl': 'rounded-2xl',\n '3xl': 'rounded-3xl',\n full: 'rounded-full',\n },\n transparency: {\n none: 'bg-card dark:bg-card-dark',\n sm: 'bg-card/80 dark:bg-card-dark/80',\n md: 'bg-card/60 dark:bg-card-dark/60',\n lg: 'bg-card/40 dark:bg-card-dark/40',\n xl: 'bg-card/20 dark:bg-card-dark/20',\n },\n padding: {\n none: 'p-0',\n sm: 'p-1',\n md: 'p-2',\n lg: 'p-3',\n xl: 'p-4',\n },\n separator: {\n without: '',\n x: 'divide-x divide-dashed divide-text/20 dark:divide-text-dark/20',\n y: 'divide-y divide-dashed divide-text/20 dark:divide-text-dark/20',\n both: 'divide-x divide-y divide-dashed divide-text/20 dark:divide-text-dark/20',\n },\n border: {\n none: '',\n with: 'border-text dark:border-text-dark border-[1.5px]',\n },\n background: {\n none: 'bg-none',\n with: '',\n },\n gap: {\n none: 'gap-0',\n sm: 'gap-1',\n md: 'gap-3',\n lg: 'gap-5',\n xl: 'gap-8',\n '2xl': 'gap-10',\n },\n },\n\n defaultVariants: {\n roundedSize: 'md',\n border: 'none',\n transparency: 'md',\n padding: 'none',\n separator: 'without',\n gap: 'none',\n },\n }\n);\n\nexport type ContainerProps = PropsWithChildren<\n Omit<VariantProps<typeof containerVariants>, 'border' | 'background'>\n> &\n HTMLAttributes<HTMLDivElement> & {\n border?: boolean;\n background?: boolean;\n };\n\nexport const Container = forwardRef<HTMLDivElement, ContainerProps>(\n (\n {\n children,\n roundedSize,\n padding,\n transparency,\n separator,\n className,\n border,\n background,\n ...props\n },\n ref\n ) => (\n <div\n ref={ref}\n className={cn(\n containerVariants({\n roundedSize,\n transparency,\n padding,\n separator,\n border:\n typeof border === 'boolean'\n ? border\n ? 'with'\n : 'none'\n : undefined,\n background:\n typeof background === 'boolean'\n ? background\n ? 'with'\n : 'none'\n : undefined,\n className,\n })\n )}\n {...props}\n >\n {children}\n </div>\n )\n);\n\nContainer.displayName = 'Container';\n"],"names":["cva","forwardRef","jsx","cn"],"mappings":";;;;;;AAIA,MAAM,oBAAoBA,uBAAA;AAAA,EACxB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,aAAa;AAAA,QACX,MAAM;AAAA,QACN,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,OAAO;AAAA,QACP,OAAO;AAAA,QACP,MAAM;AAAA,MACR;AAAA,MACA,cAAc;AAAA,QACZ,MAAM;AAAA,QACN,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MACN;AAAA,MACA,SAAS;AAAA,QACP,MAAM;AAAA,QACN,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MACN;AAAA,MACA,WAAW;AAAA,QACT,SAAS;AAAA,QACT,GAAG;AAAA,QACH,GAAG;AAAA,QACH,MAAM;AAAA,MACR;AAAA,MACA,QAAQ;AAAA,QACN,MAAM;AAAA,QACN,MAAM;AAAA,MACR;AAAA,MACA,YAAY;AAAA,QACV,MAAM;AAAA,QACN,MAAM;AAAA,MACR;AAAA,MACA,KAAK;AAAA,QACH,MAAM;AAAA,QACN,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,OAAO;AAAA,MACT;AAAA,IACF;AAAA,IAEA,iBAAiB;AAAA,MACf,aAAa;AAAA,MACb,QAAQ;AAAA,MACR,cAAc;AAAA,MACd,SAAS;AAAA,MACT,WAAW;AAAA,MACX,KAAK;AAAA,IACP;AAAA,EACF;AACF;AAUO,MAAM,YAAYC,WAAA;AAAA,EACvB,CACE;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,KAEL,QAEAC,2BAAA,kBAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA,WAAWC,SAAA;AAAA,QACT,kBAAkB;AAAA,UAChB;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA,QACE,OAAO,WAAW,YACd,SACE,SACA,SACF;AAAA,UACN,YACE,OAAO,eAAe,YAClB,aACE,SACA,SACF;AAAA,UACN;AAAA,QAAA,CACD;AAAA,MACH;AAAA,MACC,GAAG;AAAA,MAEH;AAAA,IAAA;AAAA,EACH;AAEJ;AAEA,UAAU,cAAc;;"}
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../src/components/Container/index.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport { type PropsWithChildren, forwardRef, type HTMLAttributes } from 'react';\nimport { cn } from '../../utils/cn';\n\nconst containerVariants = cva(\n 'flex flex-col p-10 text-text backdrop-blur dark:text-text-dark',\n {\n variants: {\n roundedSize: {\n none: 'rounded-none',\n sm: 'rounded-sm',\n md: 'rounded-md',\n lg: 'rounded-lg',\n xl: 'rounded-xl',\n '2xl': 'rounded-2xl',\n '3xl': 'rounded-3xl',\n full: 'rounded-full',\n },\n transparency: {\n none: 'bg-card dark:bg-card-dark',\n full: '',\n sm: 'bg-card/80 dark:bg-card-dark/80',\n md: 'bg-card/60 dark:bg-card-dark/60',\n lg: 'bg-card/40 dark:bg-card-dark/40',\n xl: 'bg-card/20 dark:bg-card-dark/20',\n },\n padding: {\n none: 'p-0',\n sm: 'p-1',\n md: 'p-2',\n lg: 'p-3',\n xl: 'p-4',\n },\n separator: {\n without: '',\n x: 'divide-x divide-dashed divide-text/20 dark:divide-text-dark/20',\n y: 'divide-y divide-dashed divide-text/20 dark:divide-text-dark/20',\n both: 'divide-x divide-y divide-dashed divide-text/20 dark:divide-text-dark/20',\n },\n border: {\n none: '',\n with: 'border-text dark:border-text-dark border-[1.5px]',\n },\n background: {\n none: 'bg-none',\n with: '',\n },\n gap: {\n none: 'gap-0',\n sm: 'gap-1',\n md: 'gap-3',\n lg: 'gap-5',\n xl: 'gap-8',\n '2xl': 'gap-10',\n },\n },\n\n defaultVariants: {\n roundedSize: 'md',\n border: 'none',\n transparency: 'md',\n padding: 'none',\n separator: 'without',\n gap: 'none',\n },\n }\n);\n\nexport type ContainerProps = PropsWithChildren<\n Omit<VariantProps<typeof containerVariants>, 'border' | 'background'>\n> &\n HTMLAttributes<HTMLDivElement> & {\n border?: boolean;\n background?: boolean;\n };\n\nexport const Container = forwardRef<HTMLDivElement, ContainerProps>(\n (\n {\n children,\n roundedSize,\n padding,\n transparency,\n separator,\n className,\n border,\n background,\n ...props\n },\n ref\n ) => (\n <div\n ref={ref}\n className={cn(\n containerVariants({\n roundedSize,\n transparency,\n padding,\n separator,\n border:\n typeof border === 'boolean'\n ? border\n ? 'with'\n : 'none'\n : undefined,\n background:\n typeof background === 'boolean'\n ? background\n ? 'with'\n : 'none'\n : undefined,\n className,\n })\n )}\n {...props}\n >\n {children}\n </div>\n )\n);\n\nContainer.displayName = 'Container';\n"],"names":["cva","forwardRef","jsx","cn"],"mappings":";;;;;;AAIA,MAAM,oBAAoBA,uBAAA;AAAA,EACxB;AAAA,EACA;AAAA,IACE,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UACA;AAAA,UACA,QACE,OAAO,WAAW,YACd,SACE,SACA,SACF;AAAA,UACN,YACE,OAAO,eAAe,YAClB,aACE,SACA,SACF;AAAA,UACN;AAAA,QAAA,CACD;AAAA,MACH;AAAA,MACC,GAAG;AAAA,MAEH;AAAA,IAAA;AAAA,EACH;AAEJ;AAEA,UAAU,cAAc;;"}
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import { VariantProps } from 'class-variance-authority';
|
|
2
2
|
import { PropsWithChildren, HTMLAttributes } from 'react';
|
|
3
3
|
declare const containerVariants: (props?: ({
|
|
4
|
-
roundedSize?: "sm" | "md" | "lg" | "xl" | "2xl" | "
|
|
5
|
-
transparency?: "sm" | "md" | "lg" | "xl" | "
|
|
6
|
-
padding?: "
|
|
4
|
+
roundedSize?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "full" | null | undefined;
|
|
5
|
+
transparency?: "none" | "sm" | "md" | "lg" | "xl" | "full" | null | undefined;
|
|
6
|
+
padding?: "none" | "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
7
7
|
separator?: "x" | "y" | "both" | "without" | null | undefined;
|
|
8
8
|
border?: "none" | "with" | null | undefined;
|
|
9
9
|
background?: "none" | "with" | null | undefined;
|
|
10
|
-
gap?: "sm" | "md" | "lg" | "xl" | "2xl" |
|
|
10
|
+
gap?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | null | undefined;
|
|
11
11
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
12
12
|
export type ContainerProps = PropsWithChildren<Omit<VariantProps<typeof containerVariants>, 'border' | 'background'>> & HTMLAttributes<HTMLDivElement> & {
|
|
13
13
|
border?: boolean;
|
|
14
14
|
background?: boolean;
|
|
15
15
|
};
|
|
16
16
|
export declare const Container: import('react').ForwardRefExoticComponent<Omit<VariantProps<(props?: ({
|
|
17
|
-
roundedSize?: "sm" | "md" | "lg" | "xl" | "2xl" | "
|
|
18
|
-
transparency?: "sm" | "md" | "lg" | "xl" | "
|
|
19
|
-
padding?: "
|
|
17
|
+
roundedSize?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "full" | null | undefined;
|
|
18
|
+
transparency?: "none" | "sm" | "md" | "lg" | "xl" | "full" | null | undefined;
|
|
19
|
+
padding?: "none" | "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
20
20
|
separator?: "x" | "y" | "both" | "without" | null | undefined;
|
|
21
21
|
border?: "none" | "with" | null | undefined;
|
|
22
22
|
background?: "none" | "with" | null | undefined;
|
|
23
|
-
gap?: "sm" | "md" | "lg" | "xl" | "2xl" |
|
|
23
|
+
gap?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | null | undefined;
|
|
24
24
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string>, "border" | "background"> & {
|
|
25
25
|
children?: import('react').ReactNode | undefined;
|
|
26
26
|
} & HTMLAttributes<HTMLDivElement> & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Container/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,KAAK,iBAAiB,EAAc,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAGhF,QAAA,MAAM,iBAAiB;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Container/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,KAAK,iBAAiB,EAAc,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAGhF,QAAA,MAAM,iBAAiB;;;;;;;;8EA8DtB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,iBAAiB,CAC5C,IAAI,CAAC,YAAY,CAAC,OAAO,iBAAiB,CAAC,EAAE,QAAQ,GAAG,YAAY,CAAC,CACtE,GACC,cAAc,CAAC,cAAc,CAAC,GAAG;IAC/B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEJ,eAAO,MAAM,SAAS;;;;;;;;;;;aAJT,OAAO;iBACH,OAAO;kDA8CvB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../src/components/Container/index.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport { type PropsWithChildren, forwardRef, type HTMLAttributes } from 'react';\nimport { cn } from '../../utils/cn';\n\nconst containerVariants = cva(\n 'flex flex-col p-10 text-text backdrop-blur dark:text-text-dark',\n {\n variants: {\n roundedSize: {\n none: 'rounded-none',\n sm: 'rounded-sm',\n md: 'rounded-md',\n lg: 'rounded-lg',\n xl: 'rounded-xl',\n '2xl': 'rounded-2xl',\n '3xl': 'rounded-3xl',\n full: 'rounded-full',\n },\n transparency: {\n none: 'bg-card dark:bg-card-dark',\n sm: 'bg-card/80 dark:bg-card-dark/80',\n md: 'bg-card/60 dark:bg-card-dark/60',\n lg: 'bg-card/40 dark:bg-card-dark/40',\n xl: 'bg-card/20 dark:bg-card-dark/20',\n },\n padding: {\n none: 'p-0',\n sm: 'p-1',\n md: 'p-2',\n lg: 'p-3',\n xl: 'p-4',\n },\n separator: {\n without: '',\n x: 'divide-x divide-dashed divide-text/20 dark:divide-text-dark/20',\n y: 'divide-y divide-dashed divide-text/20 dark:divide-text-dark/20',\n both: 'divide-x divide-y divide-dashed divide-text/20 dark:divide-text-dark/20',\n },\n border: {\n none: '',\n with: 'border-text dark:border-text-dark border-[1.5px]',\n },\n background: {\n none: 'bg-none',\n with: '',\n },\n gap: {\n none: 'gap-0',\n sm: 'gap-1',\n md: 'gap-3',\n lg: 'gap-5',\n xl: 'gap-8',\n '2xl': 'gap-10',\n },\n },\n\n defaultVariants: {\n roundedSize: 'md',\n border: 'none',\n transparency: 'md',\n padding: 'none',\n separator: 'without',\n gap: 'none',\n },\n }\n);\n\nexport type ContainerProps = PropsWithChildren<\n Omit<VariantProps<typeof containerVariants>, 'border' | 'background'>\n> &\n HTMLAttributes<HTMLDivElement> & {\n border?: boolean;\n background?: boolean;\n };\n\nexport const Container = forwardRef<HTMLDivElement, ContainerProps>(\n (\n {\n children,\n roundedSize,\n padding,\n transparency,\n separator,\n className,\n border,\n background,\n ...props\n },\n ref\n ) => (\n <div\n ref={ref}\n className={cn(\n containerVariants({\n roundedSize,\n transparency,\n padding,\n separator,\n border:\n typeof border === 'boolean'\n ? border\n ? 'with'\n : 'none'\n : undefined,\n background:\n typeof background === 'boolean'\n ? background\n ? 'with'\n : 'none'\n : undefined,\n className,\n })\n )}\n {...props}\n >\n {children}\n </div>\n )\n);\n\nContainer.displayName = 'Container';\n"],"names":["jsx"],"mappings":";;;;AAIA,MAAM,oBAAoB;AAAA,EACxB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,aAAa;AAAA,QACX,MAAM;AAAA,QACN,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,OAAO;AAAA,QACP,OAAO;AAAA,QACP,MAAM;AAAA,MACR;AAAA,MACA,cAAc;AAAA,QACZ,MAAM;AAAA,QACN,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MACN;AAAA,MACA,SAAS;AAAA,QACP,MAAM;AAAA,QACN,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MACN;AAAA,MACA,WAAW;AAAA,QACT,SAAS;AAAA,QACT,GAAG;AAAA,QACH,GAAG;AAAA,QACH,MAAM;AAAA,MACR;AAAA,MACA,QAAQ;AAAA,QACN,MAAM;AAAA,QACN,MAAM;AAAA,MACR;AAAA,MACA,YAAY;AAAA,QACV,MAAM;AAAA,QACN,MAAM;AAAA,MACR;AAAA,MACA,KAAK;AAAA,QACH,MAAM;AAAA,QACN,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,OAAO;AAAA,MACT;AAAA,IACF;AAAA,IAEA,iBAAiB;AAAA,MACf,aAAa;AAAA,MACb,QAAQ;AAAA,MACR,cAAc;AAAA,MACd,SAAS;AAAA,MACT,WAAW;AAAA,MACX,KAAK;AAAA,IACP;AAAA,EACF;AACF;AAUO,MAAM,YAAY;AAAA,EACvB,CACE;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,KAEL,QAEAA,kCAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA,WAAW;AAAA,QACT,kBAAkB;AAAA,UAChB;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA,QACE,OAAO,WAAW,YACd,SACE,SACA,SACF;AAAA,UACN,YACE,OAAO,eAAe,YAClB,aACE,SACA,SACF;AAAA,UACN;AAAA,QAAA,CACD;AAAA,MACH;AAAA,MACC,GAAG;AAAA,MAEH;AAAA,IAAA;AAAA,EACH;AAEJ;AAEA,UAAU,cAAc;"}
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../src/components/Container/index.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport { type PropsWithChildren, forwardRef, type HTMLAttributes } from 'react';\nimport { cn } from '../../utils/cn';\n\nconst containerVariants = cva(\n 'flex flex-col p-10 text-text backdrop-blur dark:text-text-dark',\n {\n variants: {\n roundedSize: {\n none: 'rounded-none',\n sm: 'rounded-sm',\n md: 'rounded-md',\n lg: 'rounded-lg',\n xl: 'rounded-xl',\n '2xl': 'rounded-2xl',\n '3xl': 'rounded-3xl',\n full: 'rounded-full',\n },\n transparency: {\n none: 'bg-card dark:bg-card-dark',\n full: '',\n sm: 'bg-card/80 dark:bg-card-dark/80',\n md: 'bg-card/60 dark:bg-card-dark/60',\n lg: 'bg-card/40 dark:bg-card-dark/40',\n xl: 'bg-card/20 dark:bg-card-dark/20',\n },\n padding: {\n none: 'p-0',\n sm: 'p-1',\n md: 'p-2',\n lg: 'p-3',\n xl: 'p-4',\n },\n separator: {\n without: '',\n x: 'divide-x divide-dashed divide-text/20 dark:divide-text-dark/20',\n y: 'divide-y divide-dashed divide-text/20 dark:divide-text-dark/20',\n both: 'divide-x divide-y divide-dashed divide-text/20 dark:divide-text-dark/20',\n },\n border: {\n none: '',\n with: 'border-text dark:border-text-dark border-[1.5px]',\n },\n background: {\n none: 'bg-none',\n with: '',\n },\n gap: {\n none: 'gap-0',\n sm: 'gap-1',\n md: 'gap-3',\n lg: 'gap-5',\n xl: 'gap-8',\n '2xl': 'gap-10',\n },\n },\n\n defaultVariants: {\n roundedSize: 'md',\n border: 'none',\n transparency: 'md',\n padding: 'none',\n separator: 'without',\n gap: 'none',\n },\n }\n);\n\nexport type ContainerProps = PropsWithChildren<\n Omit<VariantProps<typeof containerVariants>, 'border' | 'background'>\n> &\n HTMLAttributes<HTMLDivElement> & {\n border?: boolean;\n background?: boolean;\n };\n\nexport const Container = forwardRef<HTMLDivElement, ContainerProps>(\n (\n {\n children,\n roundedSize,\n padding,\n transparency,\n separator,\n className,\n border,\n background,\n ...props\n },\n ref\n ) => (\n <div\n ref={ref}\n className={cn(\n containerVariants({\n roundedSize,\n transparency,\n padding,\n separator,\n border:\n typeof border === 'boolean'\n ? border\n ? 'with'\n : 'none'\n : undefined,\n background:\n typeof background === 'boolean'\n ? background\n ? 'with'\n : 'none'\n : undefined,\n className,\n })\n )}\n {...props}\n >\n {children}\n </div>\n )\n);\n\nContainer.displayName = 'Container';\n"],"names":["jsx"],"mappings":";;;;AAIA,MAAM,oBAAoB;AAAA,EACxB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,aAAa;AAAA,QACX,MAAM;AAAA,QACN,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAA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AAA,QAAA,CACD;AAAA,MACH;AAAA,MACC,GAAG;AAAA,MAEH;AAAA,IAAA;AAAA,EACH;AAEJ;AAEA,UAAU,cAAc;"}
|
|
@@ -13,14 +13,14 @@ require("deepmerge");
|
|
|
13
13
|
const components_Form_FormBase = require("../Form/FormBase.cjs");
|
|
14
14
|
require("../Form/FormField.cjs");
|
|
15
15
|
const components_Form_layout_FormItemLayout = require("../../Form-DERuauvB.cjs");
|
|
16
|
-
require("../Toaster/Toast.cjs");
|
|
17
|
-
const components_Toaster_useToast = require("../Toaster/useToast.cjs");
|
|
18
16
|
const components_DictionaryEditor_useEditedContentStore = require("./useEditedContentStore.cjs");
|
|
19
17
|
const components_DictionaryEditor_validDictionaryChangeButtons_content = require("./validDictionaryChangeButtons.content.cjs");
|
|
20
18
|
const components_DictionaryEditor_validDictionaryChangeButtonsSchema = require("./validDictionaryChangeButtonsSchema.cjs");
|
|
21
19
|
const ValidDictionaryChangeButtons = ({ dictionary }) => {
|
|
22
20
|
const ValidDictionaryChangeButtonsSchemaSchema = components_DictionaryEditor_validDictionaryChangeButtonsSchema.getValidDictionaryChangeButtonsSchemaSchema();
|
|
23
|
-
const { resetButton, saveButton, publishButton
|
|
21
|
+
const { resetButton, saveButton, publishButton } = reactIntlayer.useDictionary(
|
|
22
|
+
components_DictionaryEditor_validDictionaryChangeButtons_content.validDictionaryChangeButtonsContent
|
|
23
|
+
);
|
|
24
24
|
const { pushDictionaries } = hooks_intlayerAPIHooks.usePushDictionaries();
|
|
25
25
|
const { editedContent, restoreEditedContent } = components_DictionaryEditor_useEditedContentStore.useEditedContentStore(
|
|
26
26
|
(s) => ({
|
|
@@ -31,7 +31,6 @@ const ValidDictionaryChangeButtons = ({ dictionary }) => {
|
|
|
31
31
|
const { form, isSubmitting } = components_Form_FormBase.useForm(
|
|
32
32
|
ValidDictionaryChangeButtonsSchemaSchema
|
|
33
33
|
);
|
|
34
|
-
const { toast } = components_Toaster_useToast.useToast();
|
|
35
34
|
const editedDictionary = require$$0.useMemo(
|
|
36
35
|
() => editedContent[dictionary.key],
|
|
37
36
|
[editedContent, dictionary.key]
|
|
@@ -50,19 +49,7 @@ const ValidDictionaryChangeButtons = ({ dictionary }) => {
|
|
|
50
49
|
...dictionary,
|
|
51
50
|
...editedContent[dictionary.key]
|
|
52
51
|
}
|
|
53
|
-
])
|
|
54
|
-
toast({
|
|
55
|
-
title: updateDictionaryToasts.updated.title.value,
|
|
56
|
-
description: updateDictionaryToasts.updated.description,
|
|
57
|
-
variant: "success"
|
|
58
|
-
});
|
|
59
|
-
}).catch((error) => {
|
|
60
|
-
toast({
|
|
61
|
-
title: updateDictionaryToasts.failed.title.value,
|
|
62
|
-
description: error.message,
|
|
63
|
-
variant: "error"
|
|
64
|
-
});
|
|
65
|
-
});
|
|
52
|
+
]);
|
|
66
53
|
};
|
|
67
54
|
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("div", { className: "mb-4", children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs(
|
|
68
55
|
components_Form_layout_FormItemLayout.Form,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ValidDictionaryChangeButtons.cjs","sources":["../../../src/components/DictionaryEditor/ValidDictionaryChangeButtons.tsx"],"sourcesContent":["'use client';\n\nimport { Dictionary as DistantDictionary } from '@intlayer/backend';\nimport type { Dictionary } from '@intlayer/core';\nimport { ArrowUpFromLine, RotateCcw, Save } from 'lucide-react';\nimport { useMemo, type FC } from 'react';\nimport { useDictionary } from 'react-intlayer';\nimport { usePushDictionaries } from '../../hooks';\nimport { Form, useForm } from '../Form';\nimport {
|
|
1
|
+
{"version":3,"file":"ValidDictionaryChangeButtons.cjs","sources":["../../../src/components/DictionaryEditor/ValidDictionaryChangeButtons.tsx"],"sourcesContent":["'use client';\n\nimport { Dictionary as DistantDictionary } from '@intlayer/backend';\nimport type { Dictionary } from '@intlayer/core';\nimport { ArrowUpFromLine, RotateCcw, Save } from 'lucide-react';\nimport { useMemo, type FC } from 'react';\nimport { useDictionary } from 'react-intlayer';\nimport { usePushDictionaries } from '../../hooks';\nimport { Form, useForm } from '../Form';\nimport { useEditedContentStore } from './useEditedContentStore';\nimport { validDictionaryChangeButtonsContent } from './validDictionaryChangeButtons.content';\nimport { getValidDictionaryChangeButtonsSchemaSchema } from './validDictionaryChangeButtonsSchema';\n\ntype ValidDictionaryChangeButtonsProps = {\n dictionary: Dictionary;\n};\n\nexport const ValidDictionaryChangeButtons: FC<\n ValidDictionaryChangeButtonsProps\n> = ({ dictionary }) => {\n const ValidDictionaryChangeButtonsSchemaSchema =\n getValidDictionaryChangeButtonsSchemaSchema();\n\n const { resetButton, saveButton, publishButton } = useDictionary(\n validDictionaryChangeButtonsContent\n );\n\n const { pushDictionaries } = usePushDictionaries();\n\n const { editedContent, restoreEditedContent } = useEditedContentStore(\n (s) => ({\n editedContent: s.editedContent,\n restoreEditedContent: s.restoreEditedContent,\n })\n );\n const { form, isSubmitting } = useForm(\n ValidDictionaryChangeButtonsSchemaSchema\n );\n\n const editedDictionary = useMemo(\n () => editedContent[dictionary.key],\n [editedContent, dictionary.key]\n );\n\n const isEdited = useMemo(\n () =>\n editedDictionary &&\n JSON.stringify(editedDictionary?.content) !==\n JSON.stringify(dictionary?.content),\n [editedDictionary, dictionary]\n );\n\n const isLocalDictionary = useMemo(\n () => typeof (dictionary as DistantDictionary)?._id === 'undefined',\n [dictionary]\n );\n\n const onSubmitSuccess = async () => {\n await pushDictionaries([\n {\n ...dictionary,\n ...editedContent[dictionary.key],\n },\n ]);\n };\n\n return (\n <div className=\"mb-4\">\n <Form\n className=\"flex w-full flex-row flex-wrap justify-end gap-3\"\n {...form}\n schema={ValidDictionaryChangeButtonsSchemaSchema}\n onSubmitSuccess={onSubmitSuccess}\n >\n {isEdited && (\n <Form.Button\n type=\"button\"\n label={resetButton.label.value}\n disabled={!isEdited || isSubmitting}\n className=\"ml-auto\"\n Icon={RotateCcw}\n variant=\"outline\"\n color=\"text\"\n isFullWidth\n isLoading={isSubmitting}\n onClick={() => restoreEditedContent(dictionary.key)}\n >\n {resetButton.text}\n </Form.Button>\n )}\n {isLocalDictionary ? (\n <Form.Button\n type=\"submit\"\n label={publishButton.label.value}\n disabled={!isEdited || isSubmitting}\n Icon={ArrowUpFromLine}\n color=\"text\"\n isFullWidth\n isLoading={isSubmitting}\n >\n {publishButton.text}\n </Form.Button>\n ) : (\n isEdited && (\n <Form.Button\n type=\"submit\"\n label={saveButton.label.value}\n disabled={!isEdited || isSubmitting}\n Icon={Save}\n color=\"text\"\n isFullWidth\n isLoading={isSubmitting}\n >\n {saveButton.text}\n </Form.Button>\n )\n )}\n </Form>\n </div>\n );\n};\n"],"names":["getValidDictionaryChangeButtonsSchemaSchema","useDictionary","validDictionaryChangeButtonsContent","usePushDictionaries","useEditedContentStore","useForm","useMemo","jsx","jsxs","Form","RotateCcw","ArrowUpFromLine","Save"],"mappings":";;;;;;;;;;;;;;;;;;AAiBO,MAAM,+BAET,CAAC,EAAE,iBAAiB;AACtB,QAAM,2CACJA,+DAAAA;AAEF,QAAM,EAAE,aAAa,YAAY,cAAkB,IAAAC,cAAA;AAAA,IACjDC,iEAAA;AAAA,EAAA;AAGI,QAAA,EAAE,qBAAqBC,uBAAAA;AAEvB,QAAA,EAAE,eAAe,qBAAA,IAAyBC,kDAAA;AAAA,IAC9C,CAAC,OAAO;AAAA,MACN,eAAe,EAAE;AAAA,MACjB,sBAAsB,EAAE;AAAA,IAAA;AAAA,EAC1B;AAEI,QAAA,EAAE,MAAM,aAAA,IAAiBC,yBAAA;AAAA,IAC7B;AAAA,EAAA;AAGF,QAAM,mBAAmBC,WAAA;AAAA,IACvB,MAAM,cAAc,WAAW,GAAG;AAAA,IAClC,CAAC,eAAe,WAAW,GAAG;AAAA,EAAA;AAGhC,QAAM,WAAWA,WAAA;AAAA,IACf,MACE,oBACA,KAAK,UAAU,kBAAkB,OAAO,MACtC,KAAK,UAAU,YAAY,OAAO;AAAA,IACtC,CAAC,kB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AA,YACvB,MAAMG,YAAA;AAAA,YACN,OAAM;AAAA,YACN,aAAW;AAAA,YACX,WAAW;AAAA,YAEV,UAAW,WAAA;AAAA,UAAA;AAAA,QACd;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR,EAAA,CAAA;AAEJ;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ValidDictionaryChangeButtons.d.ts","sourceRoot":"","sources":["../../../src/components/DictionaryEditor/ValidDictionaryChangeButtons.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD,OAAO,EAAW,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ValidDictionaryChangeButtons.d.ts","sourceRoot":"","sources":["../../../src/components/DictionaryEditor/ValidDictionaryChangeButtons.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD,OAAO,EAAW,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAQzC,KAAK,iCAAiC,GAAG;IACvC,UAAU,EAAE,UAAU,CAAC;CACxB,CAAC;AAEF,eAAO,MAAM,4BAA4B,EAAE,EAAE,CAC3C,iCAAiC,CAsGlC,CAAC"}
|