@intlayer/design-system 3.5.0 → 3.5.1
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/Form-BDcoNTLV.cjs.map +1 -1
- package/dist/Form-DhsgC7kB.js.map +1 -1
- package/dist/components/Accordion/Accordion.cjs.map +1 -1
- package/dist/components/Accordion/Accordion.mjs.map +1 -1
- package/dist/components/Auth/AuthModal/index.cjs.map +1 -1
- package/dist/components/Auth/AuthModal/index.mjs.map +1 -1
- package/dist/components/Auth/AuthenticationBarrier/AuthenticationBarrierClient.cjs.map +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.mjs.map +1 -1
- package/dist/components/Auth/AuthenticationBarrier/accessValidation.cjs.map +1 -1
- package/dist/components/Auth/AuthenticationBarrier/accessValidation.mjs.map +1 -1
- package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.cjs.map +1 -1
- package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.mjs.map +1 -1
- package/dist/components/Auth/ChangePasswordForm/ChangePasswordSchema.cjs.map +1 -1
- package/dist/components/Auth/ChangePasswordForm/ChangePasswordSchema.mjs.map +1 -1
- package/dist/components/Auth/ChangePasswordForm/index.content.cjs.map +1 -1
- package/dist/components/Auth/ChangePasswordForm/index.content.d.ts +10 -10
- package/dist/components/Auth/ChangePasswordForm/index.content.mjs.map +1 -1
- package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.cjs.map +1 -1
- package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.mjs.map +1 -1
- package/dist/components/Auth/ExternalsLoginButtons/assets/GoogleLogo.cjs.map +1 -1
- package/dist/components/Auth/ExternalsLoginButtons/assets/GoogleLogo.mjs.map +1 -1
- package/dist/components/Auth/ExternalsLoginButtons/externalsLoginButtons.content.cjs.map +1 -1
- package/dist/components/Auth/ExternalsLoginButtons/externalsLoginButtons.content.d.ts +5 -5
- package/dist/components/Auth/ExternalsLoginButtons/externalsLoginButtons.content.mjs.map +1 -1
- package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.cjs.map +1 -1
- package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.mjs.map +1 -1
- package/dist/components/Auth/ResetPasswordForm/ResetPasswordSchema.cjs.map +1 -1
- package/dist/components/Auth/ResetPasswordForm/ResetPasswordSchema.mjs.map +1 -1
- package/dist/components/Auth/ResetPasswordForm/index.content.cjs.map +1 -1
- package/dist/components/Auth/ResetPasswordForm/index.content.d.ts +7 -7
- package/dist/components/Auth/ResetPasswordForm/index.content.mjs.map +1 -1
- package/dist/components/Auth/SignInForm/SignInForm.cjs.map +1 -1
- package/dist/components/Auth/SignInForm/SignInForm.mjs.map +1 -1
- package/dist/components/Auth/SignInForm/SignInSchema.cjs.map +1 -1
- package/dist/components/Auth/SignInForm/SignInSchema.mjs.map +1 -1
- package/dist/components/Auth/SignInForm/index.content.cjs.map +1 -1
- package/dist/components/Auth/SignInForm/index.content.d.ts +13 -13
- package/dist/components/Auth/SignInForm/index.content.mjs.map +1 -1
- package/dist/components/Auth/SignUpForm/SignUpForm.cjs.map +1 -1
- package/dist/components/Auth/SignUpForm/SignUpForm.mjs.map +1 -1
- package/dist/components/Auth/SignUpForm/SignUpSchema.cjs.map +1 -1
- package/dist/components/Auth/SignUpForm/SignUpSchema.mjs.map +1 -1
- package/dist/components/Auth/SignUpForm/index.content.cjs.map +1 -1
- package/dist/components/Auth/SignUpForm/index.content.d.ts +11 -11
- package/dist/components/Auth/SignUpForm/index.content.mjs.map +1 -1
- package/dist/components/Auth/useAuth/index.cjs.map +1 -1
- package/dist/components/Auth/useAuth/index.mjs.map +1 -1
- package/dist/components/Auth/useAuth/useCSRF.cjs.map +1 -1
- package/dist/components/Auth/useAuth/useCSRF.mjs.map +1 -1
- package/dist/components/Auth/useAuth/useOAuth2.cjs.map +1 -1
- package/dist/components/Auth/useAuth/useOAuth2.mjs.map +1 -1
- package/dist/components/Auth/useAuth/useSession.cjs.map +1 -1
- package/dist/components/Auth/useAuth/useSession.mjs.map +1 -1
- package/dist/components/Auth/useUser/index.cjs.map +1 -1
- package/dist/components/Auth/useUser/index.mjs.map +1 -1
- package/dist/components/Avatar/index.cjs.map +1 -1
- package/dist/components/Avatar/index.mjs.map +1 -1
- package/dist/components/Badge/index.cjs.map +1 -1
- package/dist/components/Badge/index.mjs.map +1 -1
- package/dist/components/Breadcrumb/index.cjs.map +1 -1
- package/dist/components/Breadcrumb/index.mjs.map +1 -1
- package/dist/components/Button/Button.cjs.map +1 -1
- package/dist/components/Button/Button.mjs.map +1 -1
- package/dist/components/Command/index.cjs.map +1 -1
- package/dist/components/Command/index.mjs.map +1 -1
- package/dist/components/Container/index.cjs.map +1 -1
- package/dist/components/Container/index.mjs.map +1 -1
- package/dist/components/ContentEditor/ContentEditor.cjs.map +1 -1
- package/dist/components/ContentEditor/ContentEditor.mjs.map +1 -1
- package/dist/components/ContentEditor/ContentEditorTextArea.cjs.map +1 -1
- package/dist/components/ContentEditor/ContentEditorTextArea.mjs.map +1 -1
- package/dist/components/CopyToClipboard/index.cjs.map +1 -1
- package/dist/components/CopyToClipboard/index.mjs.map +1 -1
- package/dist/components/DictionaryEditor/DictionaryEditor.cjs.map +1 -1
- package/dist/components/DictionaryEditor/DictionaryEditor.mjs.map +1 -1
- package/dist/components/DictionaryEditor/ItemLayout.cjs.map +1 -1
- package/dist/components/DictionaryEditor/ItemLayout.mjs.map +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/StringWrapper.cjs.map +1 -1
- package/dist/components/DictionaryEditor/NodeWrapper/StringWrapper.mjs.map +1 -1
- package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.cjs.map +1 -1
- package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.mjs.map +1 -1
- package/dist/components/DictionaryEditor/useEditedContentStore.cjs.map +1 -1
- package/dist/components/DictionaryEditor/useEditedContentStore.mjs.map +1 -1
- package/dist/components/DictionaryEditor/useEditionPanelStore.cjs.map +1 -1
- package/dist/components/DictionaryEditor/useEditionPanelStore.mjs.map +1 -1
- package/dist/components/DictionaryEditor/validDictionaryChangeButtons.content.cjs.map +1 -1
- package/dist/components/DictionaryEditor/validDictionaryChangeButtons.content.mjs.map +1 -1
- package/dist/components/DictionaryEditor/validDictionaryChangeButtonsSchema.cjs.map +1 -1
- package/dist/components/DictionaryEditor/validDictionaryChangeButtonsSchema.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionariesSelector/dictionariesSelector.content.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionariesSelector/dictionariesSelector.content.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryFormSchema.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryFormSchema.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsSchema.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsSchema.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/EditorView/EditorView.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/EditorView/EditorView.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/EnumKeyInput.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/EnumKeyInput.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/JSONEditor.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/JSONEditor.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/KeyPathBreadcrumb.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/KeyPathBreadcrumb.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NodeEditor.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NodeEditor.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NodeTypeSelector.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NodeTypeSelector.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveFormSchema.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveFormSchema.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/dictionaryFieldEditor.content.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/dictionaryFieldEditor.content.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/editorView.content.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/editorView.content.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/getIsEditableSection.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/getIsEditableSection.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/nodeTypeSelector.content.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/nodeTypeSelector.content.mjs.map +1 -1
- package/dist/components/DropDown/index.cjs.map +1 -1
- package/dist/components/DropDown/index.mjs.map +1 -1
- package/dist/components/EditableField/EditableFieldInput.cjs.map +1 -1
- package/dist/components/EditableField/EditableFieldInput.mjs.map +1 -1
- package/dist/components/EditableField/EditableFieldLayout.cjs.map +1 -1
- package/dist/components/EditableField/EditableFieldLayout.mjs.map +1 -1
- package/dist/components/EditableField/EditableFieldTextArea.cjs.map +1 -1
- package/dist/components/EditableField/EditableFieldTextArea.mjs.map +1 -1
- package/dist/components/Footer/index.cjs.map +1 -1
- package/dist/components/Footer/index.mjs.map +1 -1
- package/dist/components/Form/FormBase.cjs.map +1 -1
- package/dist/components/Form/FormBase.mjs.map +1 -1
- package/dist/components/Form/FormControl.cjs.map +1 -1
- package/dist/components/Form/FormControl.mjs.map +1 -1
- package/dist/components/Form/FormDescription.cjs.map +1 -1
- package/dist/components/Form/FormDescription.mjs.map +1 -1
- package/dist/components/Form/FormField.cjs.map +1 -1
- package/dist/components/Form/FormField.mjs.map +1 -1
- package/dist/components/Form/FormItem.cjs.map +1 -1
- package/dist/components/Form/FormItem.mjs.map +1 -1
- package/dist/components/Form/FormLabel.cjs.map +1 -1
- package/dist/components/Form/FormLabel.mjs.map +1 -1
- package/dist/components/Form/FormMessage.cjs.map +1 -1
- package/dist/components/Form/FormMessage.mjs.map +1 -1
- package/dist/components/Form/elements/FormElementWrapper.cjs.map +1 -1
- package/dist/components/Form/elements/FormElementWrapper.mjs.map +1 -1
- package/dist/components/Form/layout/FormLabelLayout.cjs.map +1 -1
- package/dist/components/Form/layout/FormLabelLayout.mjs.map +1 -1
- package/dist/components/Headers/SectionScroller.cjs.map +1 -1
- package/dist/components/Headers/SectionScroller.mjs.map +1 -1
- package/dist/components/Headers/index.cjs.map +1 -1
- package/dist/components/Headers/index.mjs.map +1 -1
- package/dist/components/IDE/CodeRender.cjs.map +1 -1
- package/dist/components/IDE/CodeRender.mjs.map +1 -1
- package/dist/components/IDE/FileList.cjs.map +1 -1
- package/dist/components/IDE/FileList.mjs.map +1 -1
- package/dist/components/IDE/FileTree.cjs.map +1 -1
- package/dist/components/IDE/FileTree.mjs.map +1 -1
- package/dist/components/IDE/IDE.cjs +1 -1
- package/dist/components/IDE/IDE.cjs.map +1 -1
- package/dist/components/IDE/IDE.mjs +1 -1
- package/dist/components/IDE/IDE.mjs.map +1 -1
- package/dist/components/IDE/MarkDownRender.cjs.map +1 -1
- package/dist/components/IDE/MarkDownRender.mjs.map +1 -1
- package/dist/components/IDE/createFileTree.cjs.map +1 -1
- package/dist/components/IDE/createFileTree.mjs.map +1 -1
- package/dist/components/Input/Checkbox.cjs.map +1 -1
- package/dist/components/Input/Checkbox.mjs.map +1 -1
- package/dist/components/Input/Input.cjs.map +1 -1
- package/dist/components/Input/Input.mjs.map +1 -1
- package/dist/components/Input/InputPassword.cjs.map +1 -1
- package/dist/components/Input/InputPassword.mjs.map +1 -1
- package/dist/components/Link/Link.cjs.map +1 -1
- package/dist/components/Link/Link.mjs.map +1 -1
- package/dist/components/Loader/spinner.cjs.map +1 -1
- package/dist/components/Loader/spinner.mjs.map +1 -1
- package/dist/components/LocaleSwitcherDropDown/LocaleSwitcher.cjs.map +1 -1
- package/dist/components/LocaleSwitcherDropDown/LocaleSwitcher.mjs.map +1 -1
- package/dist/components/Logo/LogoCircle.cjs.map +1 -1
- package/dist/components/Logo/LogoCircle.mjs.map +1 -1
- package/dist/components/Logo/LogoNoFrame.cjs.map +1 -1
- package/dist/components/Logo/LogoNoFrame.mjs.map +1 -1
- package/dist/components/Logo/LogoSquare.cjs.map +1 -1
- package/dist/components/Logo/LogoSquare.mjs.map +1 -1
- package/dist/components/Logo/LogoSquircle.cjs.map +1 -1
- package/dist/components/Logo/LogoSquircle.mjs.map +1 -1
- package/dist/components/Logo/LogoTextOnly.cjs.map +1 -1
- package/dist/components/Logo/LogoTextOnly.mjs.map +1 -1
- package/dist/components/Logo/LogoWithTextBelowCircle.cjs.map +1 -1
- package/dist/components/Logo/LogoWithTextBelowCircle.mjs.map +1 -1
- package/dist/components/Logo/LogoWithTextBelowNoFrame.cjs.map +1 -1
- package/dist/components/Logo/LogoWithTextBelowNoFrame.mjs.map +1 -1
- package/dist/components/Logo/LogoWithTextBelowSquircle.cjs.map +1 -1
- package/dist/components/Logo/LogoWithTextBelowSquircle.mjs.map +1 -1
- package/dist/components/Logo/LogoWithTextCircle.cjs.map +1 -1
- package/dist/components/Logo/LogoWithTextCircle.mjs.map +1 -1
- package/dist/components/Logo/LogoWithTextNoFrame.cjs.map +1 -1
- package/dist/components/Logo/LogoWithTextNoFrame.mjs.map +1 -1
- package/dist/components/Logo/LogoWithTextSquircle.cjs.map +1 -1
- package/dist/components/Logo/LogoWithTextSquircle.mjs.map +1 -1
- package/dist/components/Logo/index.cjs.map +1 -1
- package/dist/components/Logo/index.mjs.map +1 -1
- package/dist/components/MarkDownRender/index.cjs.map +1 -1
- package/dist/components/MarkDownRender/index.mjs.map +1 -1
- package/dist/components/MaxHeightSmoother/index.cjs.map +1 -1
- package/dist/components/MaxHeightSmoother/index.mjs.map +1 -1
- package/dist/components/MaxWidthSmoother/index.cjs.map +1 -1
- package/dist/components/MaxWidthSmoother/index.mjs.map +1 -1
- package/dist/components/Modal/Modal.cjs.map +1 -1
- package/dist/components/Modal/Modal.mjs.map +1 -1
- package/dist/components/Navbar/Burger.cjs.map +1 -1
- package/dist/components/Navbar/Burger.mjs.map +1 -1
- package/dist/components/Navbar/DesktopNavbar.cjs.map +1 -1
- package/dist/components/Navbar/DesktopNavbar.mjs.map +1 -1
- package/dist/components/Navbar/MobileNavbar.cjs.map +1 -1
- package/dist/components/Navbar/MobileNavbar.mjs.map +1 -1
- package/dist/components/Navbar/index.cjs.map +1 -1
- package/dist/components/Navbar/index.mjs.map +1 -1
- package/dist/components/Navbar/useNavigation.cjs.map +1 -1
- package/dist/components/Navbar/useNavigation.mjs.map +1 -1
- package/dist/components/Pattern/DotPattern.cjs.map +1 -1
- package/dist/components/Pattern/DotPattern.mjs.map +1 -1
- package/dist/components/Pattern/GridPattern.cjs.map +1 -1
- package/dist/components/Pattern/GridPattern.mjs.map +1 -1
- package/dist/components/Pattern/SpotLight.cjs.map +1 -1
- package/dist/components/Pattern/SpotLight.mjs.map +1 -1
- package/dist/components/Popover/index.cjs.map +1 -1
- package/dist/components/Popover/index.mjs.map +1 -1
- package/dist/components/PressableSpan/PressableSpan.cjs.map +1 -1
- package/dist/components/PressableSpan/PressableSpan.mjs.map +1 -1
- package/dist/components/ProfileDropDown/index.cjs.map +1 -1
- package/dist/components/ProfileDropDown/index.mjs.map +1 -1
- package/dist/components/RightDrawer/RightDrawer.cjs.map +1 -1
- package/dist/components/RightDrawer/RightDrawer.mjs.map +1 -1
- package/dist/components/RightDrawer/useRightDrawerStore.cjs.map +1 -1
- package/dist/components/RightDrawer/useRightDrawerStore.mjs.map +1 -1
- package/dist/components/Select/Multiselect.cjs.map +1 -1
- package/dist/components/Select/Multiselect.mjs.map +1 -1
- package/dist/components/Select/Select.cjs.map +1 -1
- package/dist/components/Select/Select.mjs.map +1 -1
- package/dist/components/SwitchSelector/index.cjs.map +1 -1
- package/dist/components/SwitchSelector/index.mjs.map +1 -1
- package/dist/components/TabSelector/TabSelector.cjs.map +1 -1
- package/dist/components/TabSelector/TabSelector.mjs.map +1 -1
- package/dist/components/Tag/index.cjs.map +1 -1
- package/dist/components/Tag/index.mjs.map +1 -1
- package/dist/components/TextArea/AutoSizeTextArea.cjs.map +1 -1
- package/dist/components/TextArea/AutoSizeTextArea.mjs.map +1 -1
- package/dist/components/TextArea/TextArea.cjs.map +1 -1
- package/dist/components/TextArea/TextArea.mjs.map +1 -1
- package/dist/components/ThemeSwitcherDropDown/DesktopThemeSwitcher.cjs.map +1 -1
- package/dist/components/ThemeSwitcherDropDown/DesktopThemeSwitcher.mjs.map +1 -1
- package/dist/components/ThemeSwitcherDropDown/MobileThemeSwitcher.cjs.map +1 -1
- package/dist/components/ThemeSwitcherDropDown/MobileThemeSwitcher.mjs.map +1 -1
- package/dist/components/Toaster/Toast.cjs.map +1 -1
- package/dist/components/Toaster/Toast.mjs.map +1 -1
- package/dist/components/Toaster/Toaster.cjs.map +1 -1
- package/dist/components/Toaster/Toaster.mjs.map +1 -1
- package/dist/components/Toaster/useToast.cjs.map +1 -1
- package/dist/components/Toaster/useToast.mjs.map +1 -1
- package/dist/components/WithResizer/index.cjs.map +1 -1
- package/dist/components/WithResizer/index.mjs.map +1 -1
- package/dist/hooks/intlayerAPIHooks.cjs.map +1 -1
- package/dist/hooks/intlayerAPIHooks.mjs.map +1 -1
- package/dist/hooks/useAsync/useAsync.cjs.map +1 -1
- package/dist/hooks/useAsync/useAsync.mjs.map +1 -1
- package/dist/hooks/useAsync/useAsyncStateStore.cjs.map +1 -1
- package/dist/hooks/useAsync/useAsyncStateStore.mjs.map +1 -1
- package/dist/hooks/useDevice.cjs.map +1 -1
- package/dist/hooks/useDevice.mjs.map +1 -1
- package/dist/hooks/useGetAllDictionaries.cjs.map +1 -1
- package/dist/hooks/useGetAllDictionaries.mjs.map +1 -1
- package/dist/hooks/useGetElementOrWindow.cjs.map +1 -1
- package/dist/hooks/useIntlayerAPI.cjs.map +1 -1
- package/dist/hooks/useIntlayerAPI.mjs.map +1 -1
- package/dist/hooks/useIsMounted.cjs.map +1 -1
- package/dist/hooks/useIsMounted.mjs.map +1 -1
- package/dist/hooks/useItemSelector.cjs.map +1 -1
- package/dist/hooks/useItemSelector.mjs.map +1 -1
- package/dist/hooks/usePersistedStore.cjs.map +1 -1
- package/dist/hooks/usePersistedStore.mjs.map +1 -1
- package/dist/hooks/useScrollBlockage/index.cjs.map +1 -1
- package/dist/hooks/useScrollBlockage/index.mjs.map +1 -1
- package/dist/hooks/useScrollBlockage/useScrollBlockageStore.cjs.map +1 -1
- package/dist/hooks/useScrollBlockage/useScrollBlockageStore.mjs.map +1 -1
- package/dist/hooks/useScrollDetection.cjs.map +1 -1
- package/dist/hooks/useScrollDetection.mjs.map +1 -1
- package/dist/index-BtZWYJhL.cjs.map +1 -1
- package/dist/index-D9oaKvKC.js.map +1 -1
- package/dist/jsx-runtime-DaNGiM0W.js.map +1 -1
- package/dist/jsx-runtime-XHKiWCTo.cjs.map +1 -1
- package/dist/libs/intlayer-api/auth.cjs.map +1 -1
- package/dist/libs/intlayer-api/auth.mjs.map +1 -1
- package/dist/libs/intlayer-api/dictionary.cjs.map +1 -1
- package/dist/libs/intlayer-api/dictionary.mjs.map +1 -1
- package/dist/libs/intlayer-api/fetcher.cjs.map +1 -1
- package/dist/libs/intlayer-api/fetcher.mjs.map +1 -1
- package/dist/libs/intlayer-api/organization.cjs.map +1 -1
- package/dist/libs/intlayer-api/organization.mjs.map +1 -1
- package/dist/libs/intlayer-api/project.cjs.map +1 -1
- package/dist/libs/intlayer-api/project.mjs.map +1 -1
- package/dist/libs/intlayer-api/stripe.cjs.map +1 -1
- package/dist/libs/intlayer-api/stripe.mjs.map +1 -1
- package/dist/libs/intlayer-api/user.cjs.map +1 -1
- package/dist/libs/intlayer-api/user.mjs.map +1 -1
- package/dist/shallow-lhDIFtEp.cjs.map +1 -1
- package/dist/shallow-m9BpCkKh.js.map +1 -1
- package/dist/tailwind.config.cjs.map +1 -1
- package/dist/tailwind.config.mjs.map +1 -1
- package/dist/tailwind.css +1 -1
- package/dist/utils/camelCase.cjs.map +1 -1
- package/dist/utils/camelCase.mjs.map +1 -1
- package/dist/utils/capitalize.cjs.map +1 -1
- package/dist/utils/capitalize.mjs.map +1 -1
- package/dist/utils/dictionary.cjs.map +1 -1
- package/dist/utils/dictionary.mjs.map +1 -1
- package/dist/utils/isElementAtTopAndNotCovered.cjs.map +1 -1
- package/dist/utils/isElementAtTopAndNotCovered.mjs.map +1 -1
- package/dist/utils/object.cjs.map +1 -1
- package/dist/utils/object.mjs.map +1 -1
- package/dist/zod-BV4nCGJE.js.map +1 -1
- package/dist/zod-DSrtTSD_.cjs.map +1 -1
- package/package.json +14 -14
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabSelector.cjs","sources":["../../../src/components/TabSelector/TabSelector.tsx"],"sourcesContent":["'use client';\n\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport {\n useRef,\n type HTMLAttributes,\n type ReactElement,\n cloneElement,\n} from 'react';\nimport { useItemSelector } from '../../hooks';\nimport { cn } from '../../utils/cn';\n\nconst tabSelectorVariant = cva(\n 'relative flex size-full flex-row items-center gap-2',\n {\n variants: {\n color: {\n primary:\n 'border-primary text-primary dark:border-primary-dark dark:text-primary-dark',\n secondary:\n 'border-secondary text-secondary dark:border-secondary-dark dark:text-secondary-dark',\n destructive:\n 'border-destructive bg-destructive text-destructive dark:border-destructive-dark dark:bg-destructive-dark',\n neutral:\n 'border-neutral text-neutral dark:border-neutral-dark dark:text-neutral-dark',\n light: 'border-white text-white',\n dark: 'border-neutral-800 text-neutral-800',\n text: 'border-text text-text dark:border-text-dark dark:text-text-dark',\n },\n },\n defaultVariants: {\n color: 'primary',\n },\n }\n);\n\nconst indicatorVariant = cva(\n 'absolute top-0 z-[-1] h-full w-auto rounded-lg transition-[left,width] duration-300 ease-in-out motion-reduce:transition-none',\n {\n variants: {\n color: {\n primary:\n 'bg-primary/10 aria-selected:text-text dark:bg-primary-dark/10 dark:aria-selected:text-text-dark',\n secondary:\n 'bg-secondary/10 aria-selected:text-text dark:bg-secondary-dark/10 dark:aria-selected:text-text-dark',\n destructive:\n 'bg-destructive/10 aria-selected:text-text dark:bg-destructive-dark/10 dark:aria-selected:text-text-dark',\n neutral:\n 'bg-neutral/10 aria-selected:text-white dark:bg-neutral-dark/10 dark:aria-selected:text-text',\n light: 'bg-white/10 aria-selected:text-black',\n dark: 'bg-neutral-800/10 aria-selected:text-white',\n text: 'bg-text/10 aria-selected:text-text-dark dark:bg-text-dark/10 dark:aria-selected:text-text',\n },\n },\n }\n);\n\nexport type TabProps = HTMLAttributes<HTMLElement> & {\n key: string | number;\n};\n\ntype TabSelectorProps<T extends TabProps> = {\n tabs: ReactElement<T>[];\n selectedChoice: T['key'];\n onTabClick?: (choice: T['key']) => void;\n hoverable?: boolean;\n} & HTMLAttributes<HTMLElement> &\n VariantProps<typeof tabSelectorVariant>;\n\n/**\n *\n * Component that allows the user to select one of the provided choices.\n *\n * Example:\n * ```jsx\n * <TabSelector\n * selectedChoice=\"option1\"\n * onTabClick={(choice) => console.log(choice)}\n * hoverable={true}\n * >\n * <Button key=\"option1\"/>\n * <Button key=\"option2\"/>\n * <Button key=\"option3\"/>\n * </TabSelector>\n * ```\n */\nexport const TabSelector = <T extends TabProps>({\n tabs,\n selectedChoice,\n onTabClick,\n color = 'primary',\n hoverable = false,\n className,\n}: TabSelectorProps<T>) => {\n const optionsRefs = useRef<HTMLElement[]>([]);\n const indicatorRef = useRef<HTMLDivElement | null>(null);\n const { choiceIndicatorPosition } = useItemSelector(\n optionsRefs,\n undefined,\n hoverable\n );\n\n return (\n <div\n className={cn(\n tabSelectorVariant({\n color,\n }),\n className\n )}\n aria-orientation=\"horizontal\"\n aria-multiselectable=\"false\"\n role=\"tablist\"\n >\n {tabs.map((Tab, index) => {\n const key = Tab.key!;\n\n const isSelected = selectedChoice === key;\n\n return cloneElement(Tab, {\n key: key ?? index,\n role: 'tab',\n onClick: () => onTabClick?.(key),\n 'aria-selected': isSelected,\n ref: (el: HTMLElement) => {\n optionsRefs.current[index] = el!;\n },\n } as unknown as T);\n })}\n {choiceIndicatorPosition && (\n <div\n className={indicatorVariant({\n color,\n })}\n style={choiceIndicatorPosition}\n ref={indicatorRef}\n key={`${selectedChoice}${JSON.stringify(tabs.map((tab) => tab.key))}`}\n />\n )}\n </div>\n );\n};\n"],"names":["cva","useRef","useItemSelector","jsxs","cn","cloneElement","jsx"],"mappings":";;;;;;;;;;;;;;;AAYA,MAAM,qBAAqBA,uBAAA;AAAA,EACzB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,OAAO;AAAA,QACL,SACE;AAAA,QACF,WACE;AAAA,QACF,aACE;AAAA,QACF,SACE;AAAA,QACF,OAAO;AAAA,QACP,MAAM;AAAA,QACN,MAAM;AAAA,
|
|
1
|
+
{"version":3,"file":"TabSelector.cjs","sources":["../../../src/components/TabSelector/TabSelector.tsx"],"sourcesContent":["'use client';\n\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport {\n useRef,\n type HTMLAttributes,\n type ReactElement,\n cloneElement,\n} from 'react';\nimport { useItemSelector } from '../../hooks';\nimport { cn } from '../../utils/cn';\n\nconst tabSelectorVariant = cva(\n 'relative flex size-full flex-row items-center gap-2',\n {\n variants: {\n color: {\n primary:\n 'border-primary text-primary dark:border-primary-dark dark:text-primary-dark',\n secondary:\n 'border-secondary text-secondary dark:border-secondary-dark dark:text-secondary-dark',\n destructive:\n 'border-destructive bg-destructive text-destructive dark:border-destructive-dark dark:bg-destructive-dark',\n neutral:\n 'border-neutral text-neutral dark:border-neutral-dark dark:text-neutral-dark',\n light: 'border-white text-white',\n dark: 'border-neutral-800 text-neutral-800',\n text: 'border-text text-text dark:border-text-dark dark:text-text-dark',\n },\n },\n defaultVariants: {\n color: 'primary',\n },\n }\n);\n\nconst indicatorVariant = cva(\n 'absolute top-0 z-[-1] h-full w-auto rounded-lg transition-[left,width] duration-300 ease-in-out motion-reduce:transition-none',\n {\n variants: {\n color: {\n primary:\n 'bg-primary/10 aria-selected:text-text dark:bg-primary-dark/10 dark:aria-selected:text-text-dark',\n secondary:\n 'bg-secondary/10 aria-selected:text-text dark:bg-secondary-dark/10 dark:aria-selected:text-text-dark',\n destructive:\n 'bg-destructive/10 aria-selected:text-text dark:bg-destructive-dark/10 dark:aria-selected:text-text-dark',\n neutral:\n 'bg-neutral/10 aria-selected:text-white dark:bg-neutral-dark/10 dark:aria-selected:text-text',\n light: 'bg-white/10 aria-selected:text-black',\n dark: 'bg-neutral-800/10 aria-selected:text-white',\n text: 'bg-text/10 aria-selected:text-text-dark dark:bg-text-dark/10 dark:aria-selected:text-text',\n },\n },\n }\n);\n\nexport type TabProps = HTMLAttributes<HTMLElement> & {\n key: string | number;\n};\n\ntype TabSelectorProps<T extends TabProps> = {\n tabs: ReactElement<T>[];\n selectedChoice: T['key'];\n onTabClick?: (choice: T['key']) => void;\n hoverable?: boolean;\n} & HTMLAttributes<HTMLElement> &\n VariantProps<typeof tabSelectorVariant>;\n\n/**\n *\n * Component that allows the user to select one of the provided choices.\n *\n * Example:\n * ```jsx\n * <TabSelector\n * selectedChoice=\"option1\"\n * onTabClick={(choice) => console.log(choice)}\n * hoverable={true}\n * >\n * <Button key=\"option1\"/>\n * <Button key=\"option2\"/>\n * <Button key=\"option3\"/>\n * </TabSelector>\n * ```\n */\nexport const TabSelector = <T extends TabProps>({\n tabs,\n selectedChoice,\n onTabClick,\n color = 'primary',\n hoverable = false,\n className,\n}: TabSelectorProps<T>) => {\n const optionsRefs = useRef<HTMLElement[]>([]);\n const indicatorRef = useRef<HTMLDivElement | null>(null);\n const { choiceIndicatorPosition } = useItemSelector(\n optionsRefs,\n undefined,\n hoverable\n );\n\n return (\n <div\n className={cn(\n tabSelectorVariant({\n color,\n }),\n className\n )}\n aria-orientation=\"horizontal\"\n aria-multiselectable=\"false\"\n role=\"tablist\"\n >\n {tabs.map((Tab, index) => {\n const key = Tab.key!;\n\n const isSelected = selectedChoice === key;\n\n return cloneElement(Tab, {\n key: key ?? index,\n role: 'tab',\n onClick: () => onTabClick?.(key),\n 'aria-selected': isSelected,\n ref: (el: HTMLElement) => {\n optionsRefs.current[index] = el!;\n },\n } as unknown as T);\n })}\n {choiceIndicatorPosition && (\n <div\n className={indicatorVariant({\n color,\n })}\n style={choiceIndicatorPosition}\n ref={indicatorRef}\n key={`${selectedChoice}${JSON.stringify(tabs.map((tab) => tab.key))}`}\n />\n )}\n </div>\n );\n};\n"],"names":["cva","useRef","useItemSelector","jsxs","cn","cloneElement","jsx"],"mappings":";;;;;;;;;;;;;;;AAYA,MAAM,qBAAqBA,uBAAA;AAAA,EACzB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,OAAO;AAAA,QACL,SACE;AAAA,QACF,WACE;AAAA,QACF,aACE;AAAA,QACF,SACE;AAAA,QACF,OAAO;AAAA,QACP,MAAM;AAAA,QACN,MAAM;AAAA,MAAA;AAAA,IAEV;AAAA,IACA,iBAAiB;AAAA,MACf,OAAO;AAAA,IAAA;AAAA,EACT;AAEJ;AAEA,MAAM,mBAAmBA,uBAAA;AAAA,EACvB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,OAAO;AAAA,QACL,SACE;AAAA,QACF,WACE;AAAA,QACF,aACE;AAAA,QACF,SACE;AAAA,QACF,OAAO;AAAA,QACP,MAAM;AAAA,QACN,MAAM;AAAA,MAAA;AAAA,IACR;AAAA,EACF;AAEJ;AA+BO,MAAM,cAAc,CAAqB;AAAA,EAC9C;AAAA,EACA;AAAA,EACA;AAAA,EACA,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ;AACF,MAA2B;AACnB,QAAA,cAAcC,WAAsB,OAAA,EAAE;AACtC,QAAA,eAAeA,kBAA8B,IAAI;AACjD,QAAA,EAAE,4BAA4BC,sBAAA;AAAA,IAClC;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAGE,SAAAC,2BAAA,kBAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC,SAAA;AAAA,QACT,mBAAmB;AAAA,UACjB;AAAA,QAAA,CACD;AAAA,QACD;AAAA,MACF;AAAA,MACA,oBAAiB;AAAA,MACjB,wBAAqB;AAAA,MACrB,MAAK;AAAA,MAEJ,UAAA;AAAA,QAAK,KAAA,IAAI,CAAC,KAAK,UAAU;AACxB,gBAAM,MAAM,IAAI;AAEhB,gBAAM,aAAa,mBAAmB;AAEtC,iBAAOC,WAAAA,aAAa,KAAK;AAAA,YACvB,KAAK,OAAO;AAAA,YACZ,MAAM;AAAA,YACN,SAAS,MAAM,aAAa,GAAG;AAAA,YAC/B,iBAAiB;AAAA,YACjB,KAAK,CAAC,OAAoB;AACZ,0BAAA,QAAQ,KAAK,IAAI;AAAA,YAAA;AAAA,UAC/B,CACe;AAAA,QAAA,CAClB;AAAA,QACA,2BACCC,2BAAA,kBAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAW,iBAAiB;AAAA,cAC1B;AAAA,YAAA,CACD;AAAA,YACD,OAAO;AAAA,YACP,KAAK;AAAA,UAAA;AAAA,UACA,GAAG,cAAc,GAAG,KAAK,UAAU,KAAK,IAAI,CAAC,QAAQ,IAAI,GAAG,CAAC,CAAC;AAAA,QAAA;AAAA,MACrE;AAAA,IAAA;AAAA,EAEJ;AAEJ;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabSelector.mjs","sources":["../../../src/components/TabSelector/TabSelector.tsx"],"sourcesContent":["'use client';\n\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport {\n useRef,\n type HTMLAttributes,\n type ReactElement,\n cloneElement,\n} from 'react';\nimport { useItemSelector } from '../../hooks';\nimport { cn } from '../../utils/cn';\n\nconst tabSelectorVariant = cva(\n 'relative flex size-full flex-row items-center gap-2',\n {\n variants: {\n color: {\n primary:\n 'border-primary text-primary dark:border-primary-dark dark:text-primary-dark',\n secondary:\n 'border-secondary text-secondary dark:border-secondary-dark dark:text-secondary-dark',\n destructive:\n 'border-destructive bg-destructive text-destructive dark:border-destructive-dark dark:bg-destructive-dark',\n neutral:\n 'border-neutral text-neutral dark:border-neutral-dark dark:text-neutral-dark',\n light: 'border-white text-white',\n dark: 'border-neutral-800 text-neutral-800',\n text: 'border-text text-text dark:border-text-dark dark:text-text-dark',\n },\n },\n defaultVariants: {\n color: 'primary',\n },\n }\n);\n\nconst indicatorVariant = cva(\n 'absolute top-0 z-[-1] h-full w-auto rounded-lg transition-[left,width] duration-300 ease-in-out motion-reduce:transition-none',\n {\n variants: {\n color: {\n primary:\n 'bg-primary/10 aria-selected:text-text dark:bg-primary-dark/10 dark:aria-selected:text-text-dark',\n secondary:\n 'bg-secondary/10 aria-selected:text-text dark:bg-secondary-dark/10 dark:aria-selected:text-text-dark',\n destructive:\n 'bg-destructive/10 aria-selected:text-text dark:bg-destructive-dark/10 dark:aria-selected:text-text-dark',\n neutral:\n 'bg-neutral/10 aria-selected:text-white dark:bg-neutral-dark/10 dark:aria-selected:text-text',\n light: 'bg-white/10 aria-selected:text-black',\n dark: 'bg-neutral-800/10 aria-selected:text-white',\n text: 'bg-text/10 aria-selected:text-text-dark dark:bg-text-dark/10 dark:aria-selected:text-text',\n },\n },\n }\n);\n\nexport type TabProps = HTMLAttributes<HTMLElement> & {\n key: string | number;\n};\n\ntype TabSelectorProps<T extends TabProps> = {\n tabs: ReactElement<T>[];\n selectedChoice: T['key'];\n onTabClick?: (choice: T['key']) => void;\n hoverable?: boolean;\n} & HTMLAttributes<HTMLElement> &\n VariantProps<typeof tabSelectorVariant>;\n\n/**\n *\n * Component that allows the user to select one of the provided choices.\n *\n * Example:\n * ```jsx\n * <TabSelector\n * selectedChoice=\"option1\"\n * onTabClick={(choice) => console.log(choice)}\n * hoverable={true}\n * >\n * <Button key=\"option1\"/>\n * <Button key=\"option2\"/>\n * <Button key=\"option3\"/>\n * </TabSelector>\n * ```\n */\nexport const TabSelector = <T extends TabProps>({\n tabs,\n selectedChoice,\n onTabClick,\n color = 'primary',\n hoverable = false,\n className,\n}: TabSelectorProps<T>) => {\n const optionsRefs = useRef<HTMLElement[]>([]);\n const indicatorRef = useRef<HTMLDivElement | null>(null);\n const { choiceIndicatorPosition } = useItemSelector(\n optionsRefs,\n undefined,\n hoverable\n );\n\n return (\n <div\n className={cn(\n tabSelectorVariant({\n color,\n }),\n className\n )}\n aria-orientation=\"horizontal\"\n aria-multiselectable=\"false\"\n role=\"tablist\"\n >\n {tabs.map((Tab, index) => {\n const key = Tab.key!;\n\n const isSelected = selectedChoice === key;\n\n return cloneElement(Tab, {\n key: key ?? index,\n role: 'tab',\n onClick: () => onTabClick?.(key),\n 'aria-selected': isSelected,\n ref: (el: HTMLElement) => {\n optionsRefs.current[index] = el!;\n },\n } as unknown as T);\n })}\n {choiceIndicatorPosition && (\n <div\n className={indicatorVariant({\n color,\n })}\n style={choiceIndicatorPosition}\n ref={indicatorRef}\n key={`${selectedChoice}${JSON.stringify(tabs.map((tab) => tab.key))}`}\n />\n )}\n </div>\n );\n};\n"],"names":["jsxs","jsx"],"mappings":";;;;;;;;;;;;;AAYA,MAAM,qBAAqB;AAAA,EACzB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,OAAO;AAAA,QACL,SACE;AAAA,QACF,WACE;AAAA,QACF,aACE;AAAA,QACF,SACE;AAAA,QACF,OAAO;AAAA,QACP,MAAM;AAAA,QACN,MAAM;AAAA,
|
|
1
|
+
{"version":3,"file":"TabSelector.mjs","sources":["../../../src/components/TabSelector/TabSelector.tsx"],"sourcesContent":["'use client';\n\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport {\n useRef,\n type HTMLAttributes,\n type ReactElement,\n cloneElement,\n} from 'react';\nimport { useItemSelector } from '../../hooks';\nimport { cn } from '../../utils/cn';\n\nconst tabSelectorVariant = cva(\n 'relative flex size-full flex-row items-center gap-2',\n {\n variants: {\n color: {\n primary:\n 'border-primary text-primary dark:border-primary-dark dark:text-primary-dark',\n secondary:\n 'border-secondary text-secondary dark:border-secondary-dark dark:text-secondary-dark',\n destructive:\n 'border-destructive bg-destructive text-destructive dark:border-destructive-dark dark:bg-destructive-dark',\n neutral:\n 'border-neutral text-neutral dark:border-neutral-dark dark:text-neutral-dark',\n light: 'border-white text-white',\n dark: 'border-neutral-800 text-neutral-800',\n text: 'border-text text-text dark:border-text-dark dark:text-text-dark',\n },\n },\n defaultVariants: {\n color: 'primary',\n },\n }\n);\n\nconst indicatorVariant = cva(\n 'absolute top-0 z-[-1] h-full w-auto rounded-lg transition-[left,width] duration-300 ease-in-out motion-reduce:transition-none',\n {\n variants: {\n color: {\n primary:\n 'bg-primary/10 aria-selected:text-text dark:bg-primary-dark/10 dark:aria-selected:text-text-dark',\n secondary:\n 'bg-secondary/10 aria-selected:text-text dark:bg-secondary-dark/10 dark:aria-selected:text-text-dark',\n destructive:\n 'bg-destructive/10 aria-selected:text-text dark:bg-destructive-dark/10 dark:aria-selected:text-text-dark',\n neutral:\n 'bg-neutral/10 aria-selected:text-white dark:bg-neutral-dark/10 dark:aria-selected:text-text',\n light: 'bg-white/10 aria-selected:text-black',\n dark: 'bg-neutral-800/10 aria-selected:text-white',\n text: 'bg-text/10 aria-selected:text-text-dark dark:bg-text-dark/10 dark:aria-selected:text-text',\n },\n },\n }\n);\n\nexport type TabProps = HTMLAttributes<HTMLElement> & {\n key: string | number;\n};\n\ntype TabSelectorProps<T extends TabProps> = {\n tabs: ReactElement<T>[];\n selectedChoice: T['key'];\n onTabClick?: (choice: T['key']) => void;\n hoverable?: boolean;\n} & HTMLAttributes<HTMLElement> &\n VariantProps<typeof tabSelectorVariant>;\n\n/**\n *\n * Component that allows the user to select one of the provided choices.\n *\n * Example:\n * ```jsx\n * <TabSelector\n * selectedChoice=\"option1\"\n * onTabClick={(choice) => console.log(choice)}\n * hoverable={true}\n * >\n * <Button key=\"option1\"/>\n * <Button key=\"option2\"/>\n * <Button key=\"option3\"/>\n * </TabSelector>\n * ```\n */\nexport const TabSelector = <T extends TabProps>({\n tabs,\n selectedChoice,\n onTabClick,\n color = 'primary',\n hoverable = false,\n className,\n}: TabSelectorProps<T>) => {\n const optionsRefs = useRef<HTMLElement[]>([]);\n const indicatorRef = useRef<HTMLDivElement | null>(null);\n const { choiceIndicatorPosition } = useItemSelector(\n optionsRefs,\n undefined,\n hoverable\n );\n\n return (\n <div\n className={cn(\n tabSelectorVariant({\n color,\n }),\n className\n )}\n aria-orientation=\"horizontal\"\n aria-multiselectable=\"false\"\n role=\"tablist\"\n >\n {tabs.map((Tab, index) => {\n const key = Tab.key!;\n\n const isSelected = selectedChoice === key;\n\n return cloneElement(Tab, {\n key: key ?? index,\n role: 'tab',\n onClick: () => onTabClick?.(key),\n 'aria-selected': isSelected,\n ref: (el: HTMLElement) => {\n optionsRefs.current[index] = el!;\n },\n } as unknown as T);\n })}\n {choiceIndicatorPosition && (\n <div\n className={indicatorVariant({\n color,\n })}\n style={choiceIndicatorPosition}\n ref={indicatorRef}\n key={`${selectedChoice}${JSON.stringify(tabs.map((tab) => tab.key))}`}\n />\n )}\n </div>\n );\n};\n"],"names":["jsxs","jsx"],"mappings":";;;;;;;;;;;;;AAYA,MAAM,qBAAqB;AAAA,EACzB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,OAAO;AAAA,QACL,SACE;AAAA,QACF,WACE;AAAA,QACF,aACE;AAAA,QACF,SACE;AAAA,QACF,OAAO;AAAA,QACP,MAAM;AAAA,QACN,MAAM;AAAA,MAAA;AAAA,IAEV;AAAA,IACA,iBAAiB;AAAA,MACf,OAAO;AAAA,IAAA;AAAA,EACT;AAEJ;AAEA,MAAM,mBAAmB;AAAA,EACvB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,OAAO;AAAA,QACL,SACE;AAAA,QACF,W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1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../src/components/Tag/index.tsx"],"sourcesContent":["import { cva, VariantProps } from 'class-variance-authority';\nimport { forwardRef, HTMLAttributes, PropsWithChildren } from 'react';\n\ntype TagProps = PropsWithChildren<VariantProps<typeof containerVariants>> &\n HTMLAttributes<HTMLDivElement>;\n\nconst containerVariants = cva('backdrop-blur w-fit', {\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 color: {\n success:\n 'bg-success/10 dark:bg-success-dark/10 border-success dark:border-success-dark text-success dark:text-success-dark',\n error:\n 'bg-error/10 dark:bg-error-dark/10 border-error dark:border-error-dark text-error dark:text-error-dark',\n warning:\n 'bg-warning/10 dark:bg-warning-dark/10 border-warning dark:border-warning-dark text-warning dark:text-warning-dark',\n neutral:\n 'bg-neutral/10 dark:bg-neutral-dark/10 border-neutral dark:border-neutral-dark text-neutral dark:text-neutral-dark',\n info: 'bg-info/10 dark:bg-info-dark/10 border-info dark:border-info-dark text-info dark:text-info-dark',\n text: 'bg-text/10 dark:bg-text-dark/10 border-text dark:border-text-dark text-text dark:text-text-dark',\n },\n size: {\n xs: 'py-0.5 px-2 text-xs border-[1.2px]',\n sm: 'py-0.5 px-2 text-sm border-[1.5px]',\n md: 'py-1 px-2 text-base border-2',\n lg: 'py-2 px-3 text-lg border-2',\n xl: 'py-4 px-5 text-xl border-2',\n },\n border: {\n none: 'border-none',\n with: 'border-text dark:border-text-dark border-[1.5px]',\n },\n background: {\n none: 'bg-none',\n with: '',\n },\n },\n\n defaultVariants: {\n roundedSize: 'full',\n border: 'none',\n color: 'text',\n size: 'md',\n },\n});\n\nexport const Tag = forwardRef<HTMLDivElement, TagProps>(\n (\n {\n children,\n color,\n roundedSize,\n size,\n border,\n background,\n className,\n ...props\n },\n ref\n ) => {\n return (\n <div\n ref={ref}\n className={containerVariants({\n color,\n roundedSize,\n size,\n border,\n background,\n className,\n })}\n {...props}\n >\n {children}\n </div>\n );\n }\n);\n\nTag.displayName = 'Tag';\n"],"names":["cva","forwardRef","jsx"],"mappings":";;;;;AAMA,MAAM,oBAAoBA,2BAAI,uBAAuB;AAAA,EACnD,UAAU;AAAA,IACR,aAAa;AAAA,MACX,MAAM;AAAA,MACN,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,OAAO;AAAA,MACP,OAAO;AAAA,MACP,MAAM;AAAA,IACR;AAAA,IACA,OAAO;AAAA,MACL,SACE;AAAA,MACF,OACE;AAAA,MACF,SACE;AAAA,MACF,SACE;AAAA,MACF,MAAM;AAAA,MACN,MAAM;AAAA,IACR;AAAA,IACA,MAAM;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IACN;AAAA,IACA,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,MAAM;AAAA,IACR;AAAA,IACA,YAAY;AAAA,MACV,MAAM;AAAA,MACN,MAAM;AAAA,
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../src/components/Tag/index.tsx"],"sourcesContent":["import { cva, VariantProps } from 'class-variance-authority';\nimport { forwardRef, HTMLAttributes, PropsWithChildren } from 'react';\n\ntype TagProps = PropsWithChildren<VariantProps<typeof containerVariants>> &\n HTMLAttributes<HTMLDivElement>;\n\nconst containerVariants = cva('backdrop-blur w-fit', {\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 color: {\n success:\n 'bg-success/10 dark:bg-success-dark/10 border-success dark:border-success-dark text-success dark:text-success-dark',\n error:\n 'bg-error/10 dark:bg-error-dark/10 border-error dark:border-error-dark text-error dark:text-error-dark',\n warning:\n 'bg-warning/10 dark:bg-warning-dark/10 border-warning dark:border-warning-dark text-warning dark:text-warning-dark',\n neutral:\n 'bg-neutral/10 dark:bg-neutral-dark/10 border-neutral dark:border-neutral-dark text-neutral dark:text-neutral-dark',\n info: 'bg-info/10 dark:bg-info-dark/10 border-info dark:border-info-dark text-info dark:text-info-dark',\n text: 'bg-text/10 dark:bg-text-dark/10 border-text dark:border-text-dark text-text dark:text-text-dark',\n },\n size: {\n xs: 'py-0.5 px-2 text-xs border-[1.2px]',\n sm: 'py-0.5 px-2 text-sm border-[1.5px]',\n md: 'py-1 px-2 text-base border-2',\n lg: 'py-2 px-3 text-lg border-2',\n xl: 'py-4 px-5 text-xl border-2',\n },\n border: {\n none: 'border-none',\n with: 'border-text dark:border-text-dark border-[1.5px]',\n },\n background: {\n none: 'bg-none',\n with: '',\n },\n },\n\n defaultVariants: {\n roundedSize: 'full',\n border: 'none',\n color: 'text',\n size: 'md',\n },\n});\n\nexport const Tag = forwardRef<HTMLDivElement, TagProps>(\n (\n {\n children,\n color,\n roundedSize,\n size,\n border,\n background,\n className,\n ...props\n },\n ref\n ) => {\n return (\n <div\n ref={ref}\n className={containerVariants({\n color,\n roundedSize,\n size,\n border,\n background,\n className,\n })}\n {...props}\n >\n {children}\n </div>\n );\n }\n);\n\nTag.displayName = 'Tag';\n"],"names":["cva","forwardRef","jsx"],"mappings":";;;;;AAMA,MAAM,oBAAoBA,2BAAI,uBAAuB;AAAA,EACnD,UAAU;AAAA,IACR,aAAa;AAAA,MACX,MAAM;AAAA,MACN,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,OAAO;AAAA,MACP,OAAO;AAAA,MACP,MAAM;AAAA,IACR;AAAA,IACA,OAAO;AAAA,MACL,SACE;AAAA,MACF,OACE;AAAA,MACF,SACE;AAAA,MACF,SACE;AAAA,MACF,MAAM;AAAA,MACN,MAAM;AAAA,IACR;AAAA,IACA,MAAM;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IACN;AAAA,IACA,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,MAAM;AAAA,IACR;AAAA,IACA,YAAY;AAAA,MACV,MAAM;AAAA,MACN,MAAM;AAAA,IAAA;AAAA,EAEV;AAAA,EAEA,iBAAiB;AAAA,IACf,aAAa;AAAA,IACb,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,MAAM;AAAA,EAAA;AAEV,CAAC;AAEM,MAAM,MAAMC,WAAA;AAAA,EACjB,CACE;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,KAEL,QACG;AAED,WAAAC,2BAAA,kBAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,WAAW,kBAAkB;AAAA,UAC3B;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QAAA,CACD;AAAA,QACA,GAAG;AAAA,QAEH;AAAA,MAAA;AAAA,IACH;AAAA,EAAA;AAGN;AAEA,IAAI,cAAc;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../src/components/Tag/index.tsx"],"sourcesContent":["import { cva, VariantProps } from 'class-variance-authority';\nimport { forwardRef, HTMLAttributes, PropsWithChildren } from 'react';\n\ntype TagProps = PropsWithChildren<VariantProps<typeof containerVariants>> &\n HTMLAttributes<HTMLDivElement>;\n\nconst containerVariants = cva('backdrop-blur w-fit', {\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 color: {\n success:\n 'bg-success/10 dark:bg-success-dark/10 border-success dark:border-success-dark text-success dark:text-success-dark',\n error:\n 'bg-error/10 dark:bg-error-dark/10 border-error dark:border-error-dark text-error dark:text-error-dark',\n warning:\n 'bg-warning/10 dark:bg-warning-dark/10 border-warning dark:border-warning-dark text-warning dark:text-warning-dark',\n neutral:\n 'bg-neutral/10 dark:bg-neutral-dark/10 border-neutral dark:border-neutral-dark text-neutral dark:text-neutral-dark',\n info: 'bg-info/10 dark:bg-info-dark/10 border-info dark:border-info-dark text-info dark:text-info-dark',\n text: 'bg-text/10 dark:bg-text-dark/10 border-text dark:border-text-dark text-text dark:text-text-dark',\n },\n size: {\n xs: 'py-0.5 px-2 text-xs border-[1.2px]',\n sm: 'py-0.5 px-2 text-sm border-[1.5px]',\n md: 'py-1 px-2 text-base border-2',\n lg: 'py-2 px-3 text-lg border-2',\n xl: 'py-4 px-5 text-xl border-2',\n },\n border: {\n none: 'border-none',\n with: 'border-text dark:border-text-dark border-[1.5px]',\n },\n background: {\n none: 'bg-none',\n with: '',\n },\n },\n\n defaultVariants: {\n roundedSize: 'full',\n border: 'none',\n color: 'text',\n size: 'md',\n },\n});\n\nexport const Tag = forwardRef<HTMLDivElement, TagProps>(\n (\n {\n children,\n color,\n roundedSize,\n size,\n border,\n background,\n className,\n ...props\n },\n ref\n ) => {\n return (\n <div\n ref={ref}\n className={containerVariants({\n color,\n roundedSize,\n size,\n border,\n background,\n className,\n })}\n {...props}\n >\n {children}\n </div>\n );\n }\n);\n\nTag.displayName = 'Tag';\n"],"names":["jsx"],"mappings":";;;AAMA,MAAM,oBAAoB,IAAI,uBAAuB;AAAA,EACnD,UAAU;AAAA,IACR,aAAa;AAAA,MACX,MAAM;AAAA,MACN,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,OAAO;AAAA,MACP,OAAO;AAAA,MACP,MAAM;AAAA,IACR;AAAA,IACA,OAAO;AAAA,MACL,SACE;AAAA,MACF,OACE;AAAA,MACF,SACE;AAAA,MACF,SACE;AAAA,MACF,MAAM;AAAA,MACN,MAAM;AAAA,IACR;AAAA,IACA,MAAM;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IACN;AAAA,IACA,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,MAAM;AAAA,IACR;AAAA,IACA,YAAY;AAAA,MACV,MAAM;AAAA,MACN,MAAM;AAAA,
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../src/components/Tag/index.tsx"],"sourcesContent":["import { cva, VariantProps } from 'class-variance-authority';\nimport { forwardRef, HTMLAttributes, PropsWithChildren } from 'react';\n\ntype TagProps = PropsWithChildren<VariantProps<typeof containerVariants>> &\n HTMLAttributes<HTMLDivElement>;\n\nconst containerVariants = cva('backdrop-blur w-fit', {\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 color: {\n success:\n 'bg-success/10 dark:bg-success-dark/10 border-success dark:border-success-dark text-success dark:text-success-dark',\n error:\n 'bg-error/10 dark:bg-error-dark/10 border-error dark:border-error-dark text-error dark:text-error-dark',\n warning:\n 'bg-warning/10 dark:bg-warning-dark/10 border-warning dark:border-warning-dark text-warning dark:text-warning-dark',\n neutral:\n 'bg-neutral/10 dark:bg-neutral-dark/10 border-neutral dark:border-neutral-dark text-neutral dark:text-neutral-dark',\n info: 'bg-info/10 dark:bg-info-dark/10 border-info dark:border-info-dark text-info dark:text-info-dark',\n text: 'bg-text/10 dark:bg-text-dark/10 border-text dark:border-text-dark text-text dark:text-text-dark',\n },\n size: {\n xs: 'py-0.5 px-2 text-xs border-[1.2px]',\n sm: 'py-0.5 px-2 text-sm border-[1.5px]',\n md: 'py-1 px-2 text-base border-2',\n lg: 'py-2 px-3 text-lg border-2',\n xl: 'py-4 px-5 text-xl border-2',\n },\n border: {\n none: 'border-none',\n with: 'border-text dark:border-text-dark border-[1.5px]',\n },\n background: {\n none: 'bg-none',\n with: '',\n },\n },\n\n defaultVariants: {\n roundedSize: 'full',\n border: 'none',\n color: 'text',\n size: 'md',\n },\n});\n\nexport const Tag = forwardRef<HTMLDivElement, TagProps>(\n (\n {\n children,\n color,\n roundedSize,\n size,\n border,\n background,\n className,\n ...props\n },\n ref\n ) => {\n return (\n <div\n ref={ref}\n className={containerVariants({\n color,\n roundedSize,\n size,\n border,\n background,\n className,\n })}\n {...props}\n >\n {children}\n </div>\n );\n }\n);\n\nTag.displayName = 'Tag';\n"],"names":["jsx"],"mappings":";;;AAMA,MAAM,oBAAoB,IAAI,uBAAuB;AAAA,EACnD,UAAU;AAAA,IACR,aAAa;AAAA,MACX,MAAM;AAAA,MACN,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,OAAO;AAAA,MACP,OAAO;AAAA,MACP,MAAM;AAAA,IACR;AAAA,IACA,OAAO;AAAA,MACL,SACE;AAAA,MACF,OACE;AAAA,MACF,SACE;AAAA,MACF,SACE;AAAA,MACF,MAAM;AAAA,MACN,MAAM;AAAA,IACR;AAAA,IACA,MAAM;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IACN;AAAA,IACA,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,MAAM;AAAA,IACR;AAAA,IACA,YAAY;AAAA,MACV,MAAM;AAAA,MACN,MAAM;AAAA,IAAA;AAAA,EAEV;AAAA,EAEA,iBAAiB;AAAA,IACf,aAAa;AAAA,IACb,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,MAAM;AAAA,EAAA;AAEV,CAAC;AAEM,MAAM,MAAM;AAAA,EACjB,CACE;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,KAEL,QACG;AAED,WAAAA,kCAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,WAAW,kBAAkB;AAAA,UAC3B;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QAAA,CACD;AAAA,QACA,GAAG;AAAA,QAEH;AAAA,MAAA;AAAA,IACH;AAAA,EAAA;AAGN;AAEA,IAAI,cAAc;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutoSizeTextArea.cjs","sources":["../../../src/components/TextArea/AutoSizeTextArea.tsx"],"sourcesContent":["import {\n useRef,\n useEffect,\n type ChangeEventHandler,\n forwardRef,\n useImperativeHandle,\n useCallback,\n} from 'react';\nimport { cn } from '../../utils/cn';\nimport { TextAreaProps, TextArea } from './TextArea';\n\nexport type AutoSizedTextAreaProps = TextAreaProps & {\n autoSize?: boolean;\n maxRows?: number;\n};\n\nconst LINE_HEIGHT = 24; // px\nconst LINE_PADDING = 12; // px\n\nexport const AutoSizedTextArea = forwardRef<\n HTMLTextAreaElement,\n AutoSizedTextAreaProps\n>(({ className, autoSize = true, onChange, maxRows = 999, ...props }, ref) => {\n const textAreaRef = useRef<HTMLTextAreaElement | null>(null);\n\n useImperativeHandle(ref, () => textAreaRef.current!);\n\n const adjustHeight = useCallback(() => {\n const textAreaEl = textAreaRef.current;\n\n if (!textAreaEl || !autoSize) return;\n\n const textAreaStyle = textAreaEl.style;\n\n // Reset height to get accurate scrollHeight\n textAreaStyle.height = 'auto';\n const scrollHeight = textAreaEl.scrollHeight;\n const maxHeight = LINE_HEIGHT * maxRows + LINE_PADDING;\n const minHeight = LINE_HEIGHT + LINE_PADDING;\n\n // Set the new height\n textAreaStyle.height =\n Math.max(Math.min(scrollHeight, maxHeight), minHeight) + 'px';\n }, [autoSize, maxRows]);\n\n useEffect(() => {\n adjustHeight();\n }, [props.value, props.defaultValue, adjustHeight]);\n\n const handleChange: ChangeEventHandler<HTMLTextAreaElement> = (e) => {\n onChange?.(e);\n adjustHeight();\n };\n\n const setRef = useCallback(\n (el: HTMLTextAreaElement | null) => {\n textAreaRef.current = el;\n if (el) {\n adjustHeight();\n }\n },\n [adjustHeight]\n );\n\n return (\n <TextArea\n ref={setRef}\n onChange={handleChange}\n className={cn(\n 'overflow-y-scroll',\n autoSize ? 'resize-none' : '',\n className\n )}\n {...props}\n />\n );\n});\n\nAutoSizedTextArea.displayName = 'AutoSizedTextArea';\n"],"names":["forwardRef","useRef","useImperativeHandle","useCallback","useEffect","jsx","TextArea","cn"],"mappings":";;;;;;AAgBA,MAAM,cAAc;AACpB,MAAM,eAAe;AAEd,MAAM,oBAAoBA,WAAA,WAG/B,CAAC,EAAE,WAAW,WAAW,MAAM,UAAU,UAAU,KAAK,GAAG,MAAA,GAAS,QAAQ;AACtE,QAAA,cAAcC,kBAAmC,IAAI;AAEvCC,aAAAA,oBAAA,KAAK,MAAM,YAAY,OAAQ;AAE7C,QAAA,eAAeC,WAAAA,YAAY,MAAM;AACrC,UAAM,aAAa,YAAY;AAE3B,QAAA,CAAC,cAAc,CAAC,SAAU;AAE9B,UAAM,gBAAgB,WAAW;AAGjC,kBAAc,SAAS;AACvB,UAAM,eAAe,WAAW;AAC1B,UAAA,YAAY,cAAc,UAAU;AAC1C,UAAM,YAAY,cAAc;AAGlB,kBAAA,SACZ,KAAK,IAAI,KAAK,IAAI,cAAc,SAAS,GAAG,SAAS,IAAI;AAAA,EAAA,GAC1D,CAAC,UAAU,OAAO,CAAC;AAEtBC,aAAAA,UAAU,MAAM;AACD;EAAA,GACZ,CAAC,MAAM,OAAO,MAAM,cAAc,YAAY,CAAC;AAE5C,QAAA,eAAwD,CAAC,MAAM;AACnE,eAAW,CAAC;AACC;
|
|
1
|
+
{"version":3,"file":"AutoSizeTextArea.cjs","sources":["../../../src/components/TextArea/AutoSizeTextArea.tsx"],"sourcesContent":["import {\n useRef,\n useEffect,\n type ChangeEventHandler,\n forwardRef,\n useImperativeHandle,\n useCallback,\n} from 'react';\nimport { cn } from '../../utils/cn';\nimport { TextAreaProps, TextArea } from './TextArea';\n\nexport type AutoSizedTextAreaProps = TextAreaProps & {\n autoSize?: boolean;\n maxRows?: number;\n};\n\nconst LINE_HEIGHT = 24; // px\nconst LINE_PADDING = 12; // px\n\nexport const AutoSizedTextArea = forwardRef<\n HTMLTextAreaElement,\n AutoSizedTextAreaProps\n>(({ className, autoSize = true, onChange, maxRows = 999, ...props }, ref) => {\n const textAreaRef = useRef<HTMLTextAreaElement | null>(null);\n\n useImperativeHandle(ref, () => textAreaRef.current!);\n\n const adjustHeight = useCallback(() => {\n const textAreaEl = textAreaRef.current;\n\n if (!textAreaEl || !autoSize) return;\n\n const textAreaStyle = textAreaEl.style;\n\n // Reset height to get accurate scrollHeight\n textAreaStyle.height = 'auto';\n const scrollHeight = textAreaEl.scrollHeight;\n const maxHeight = LINE_HEIGHT * maxRows + LINE_PADDING;\n const minHeight = LINE_HEIGHT + LINE_PADDING;\n\n // Set the new height\n textAreaStyle.height =\n Math.max(Math.min(scrollHeight, maxHeight), minHeight) + 'px';\n }, [autoSize, maxRows]);\n\n useEffect(() => {\n adjustHeight();\n }, [props.value, props.defaultValue, adjustHeight]);\n\n const handleChange: ChangeEventHandler<HTMLTextAreaElement> = (e) => {\n onChange?.(e);\n adjustHeight();\n };\n\n const setRef = useCallback(\n (el: HTMLTextAreaElement | null) => {\n textAreaRef.current = el;\n if (el) {\n adjustHeight();\n }\n },\n [adjustHeight]\n );\n\n return (\n <TextArea\n ref={setRef}\n onChange={handleChange}\n className={cn(\n 'overflow-y-scroll',\n autoSize ? 'resize-none' : '',\n className\n )}\n {...props}\n />\n );\n});\n\nAutoSizedTextArea.displayName = 'AutoSizedTextArea';\n"],"names":["forwardRef","useRef","useImperativeHandle","useCallback","useEffect","jsx","TextArea","cn"],"mappings":";;;;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../src/components/TextArea/AutoSizeTextArea.tsx"],"sourcesContent":["import {\n useRef,\n useEffect,\n type ChangeEventHandler,\n forwardRef,\n useImperativeHandle,\n useCallback,\n} from 'react';\nimport { cn } from '../../utils/cn';\nimport { TextAreaProps, TextArea } from './TextArea';\n\nexport type AutoSizedTextAreaProps = TextAreaProps & {\n autoSize?: boolean;\n maxRows?: number;\n};\n\nconst LINE_HEIGHT = 24; // px\nconst LINE_PADDING = 12; // px\n\nexport const AutoSizedTextArea = forwardRef<\n HTMLTextAreaElement,\n AutoSizedTextAreaProps\n>(({ className, autoSize = true, onChange, maxRows = 999, ...props }, ref) => {\n const textAreaRef = useRef<HTMLTextAreaElement | null>(null);\n\n useImperativeHandle(ref, () => textAreaRef.current!);\n\n const adjustHeight = useCallback(() => {\n const textAreaEl = textAreaRef.current;\n\n if (!textAreaEl || !autoSize) return;\n\n const textAreaStyle = textAreaEl.style;\n\n // Reset height to get accurate scrollHeight\n textAreaStyle.height = 'auto';\n const scrollHeight = textAreaEl.scrollHeight;\n const maxHeight = LINE_HEIGHT * maxRows + LINE_PADDING;\n const minHeight = LINE_HEIGHT + LINE_PADDING;\n\n // Set the new height\n textAreaStyle.height =\n Math.max(Math.min(scrollHeight, maxHeight), minHeight) + 'px';\n }, [autoSize, maxRows]);\n\n useEffect(() => {\n adjustHeight();\n }, [props.value, props.defaultValue, adjustHeight]);\n\n const handleChange: ChangeEventHandler<HTMLTextAreaElement> = (e) => {\n onChange?.(e);\n adjustHeight();\n };\n\n const setRef = useCallback(\n (el: HTMLTextAreaElement | null) => {\n textAreaRef.current = el;\n if (el) {\n adjustHeight();\n }\n },\n [adjustHeight]\n );\n\n return (\n <TextArea\n ref={setRef}\n onChange={handleChange}\n className={cn(\n 'overflow-y-scroll',\n autoSize ? 'resize-none' : '',\n className\n )}\n {...props}\n />\n );\n});\n\nAutoSizedTextArea.displayName = 'AutoSizedTextArea';\n"],"names":["jsx"],"mappings":";;;;AAgBA,MAAM,cAAc;AACpB,MAAM,eAAe;AAEd,MAAM,oBAAoB,WAG/B,CAAC,EAAE,WAAW,WAAW,MAAM,UAAU,UAAU,KAAK,GAAG,MAAA,GAAS,QAAQ;AACtE,QAAA,cAAc,OAAmC,IAAI;AAEvC,sBAAA,KAAK,MAAM,YAAY,OAAQ;AAE7C,QAAA,eAAe,YAAY,MAAM;AACrC,UAAM,aAAa,YAAY;AAE3B,QAAA,CAAC,cAAc,CAAC,SAAU;AAE9B,UAAM,gBAAgB,WAAW;AAGjC,kBAAc,SAAS;AACvB,UAAM,eAAe,WAAW;AAC1B,UAAA,YAAY,cAAc,UAAU;AAC1C,UAAM,YAAY,cAAc;AAGlB,kBAAA,SACZ,KAAK,IAAI,KAAK,IAAI,cAAc,SAAS,GAAG,SAAS,IAAI;AAAA,EAAA,GAC1D,CAAC,UAAU,OAAO,CAAC;AAEtB,YAAU,MAAM;AACD;EAAA,GACZ,CAAC,MAAM,OAAO,MAAM,cAAc,YAAY,CAAC;AAE5C,QAAA,eAAwD,CAAC,MAAM;AACnE,eAAW,CAAC;AACC;
|
|
1
|
+
{"version":3,"file":"AutoSizeTextArea.mjs","sources":["../../../src/components/TextArea/AutoSizeTextArea.tsx"],"sourcesContent":["import {\n useRef,\n useEffect,\n type ChangeEventHandler,\n forwardRef,\n useImperativeHandle,\n useCallback,\n} from 'react';\nimport { cn } from '../../utils/cn';\nimport { TextAreaProps, TextArea } from './TextArea';\n\nexport type AutoSizedTextAreaProps = TextAreaProps & {\n autoSize?: boolean;\n maxRows?: number;\n};\n\nconst LINE_HEIGHT = 24; // px\nconst LINE_PADDING = 12; // px\n\nexport const AutoSizedTextArea = forwardRef<\n HTMLTextAreaElement,\n AutoSizedTextAreaProps\n>(({ className, autoSize = true, onChange, maxRows = 999, ...props }, ref) => {\n const textAreaRef = useRef<HTMLTextAreaElement | null>(null);\n\n useImperativeHandle(ref, () => textAreaRef.current!);\n\n const adjustHeight = useCallback(() => {\n const textAreaEl = textAreaRef.current;\n\n if (!textAreaEl || !autoSize) return;\n\n const textAreaStyle = textAreaEl.style;\n\n // Reset height to get accurate scrollHeight\n textAreaStyle.height = 'auto';\n const scrollHeight = textAreaEl.scrollHeight;\n const maxHeight = LINE_HEIGHT * maxRows + LINE_PADDING;\n const minHeight = LINE_HEIGHT + LINE_PADDING;\n\n // Set the new height\n textAreaStyle.height =\n Math.max(Math.min(scrollHeight, maxHeight), minHeight) + 'px';\n }, [autoSize, maxRows]);\n\n useEffect(() => {\n adjustHeight();\n }, [props.value, props.defaultValue, adjustHeight]);\n\n const handleChange: ChangeEventHandler<HTMLTextAreaElement> = (e) => {\n onChange?.(e);\n adjustHeight();\n };\n\n const setRef = useCallback(\n (el: HTMLTextAreaElement | null) => {\n textAreaRef.current = el;\n if (el) {\n adjustHeight();\n }\n },\n [adjustHeight]\n );\n\n return (\n <TextArea\n ref={setRef}\n onChange={handleChange}\n className={cn(\n 'overflow-y-scroll',\n autoSize ? 'resize-none' : '',\n className\n )}\n {...props}\n />\n );\n});\n\nAutoSizedTextArea.displayName = 'AutoSizedTextArea';\n"],"names":["jsx"],"mappings":";;;;AAgBA,MAAM,cAAc;AACpB,MAAM,eAAe;AAEd,MAAM,oBAAoB,WAG/B,CAAC,EAAE,WAAW,WAAW,MAAM,UAAU,UAAU,KAAK,GAAG,MAAA,GAAS,QAAQ;AACtE,QAAA,cAAc,OAAmC,IAAI;AAEvC,sBAAA,KAAK,MAAM,YAAY,OAAQ;AAE7C,QAAA,eAAe,YAAY,MAAM;AACrC,UAAM,aAAa,YAAY;AAE3B,QAAA,CAAC,cAAc,CAAC,SAAU;AAE9B,UAAM,gBAAgB,WAAW;AAGjC,kBAAc,SAAS;AACvB,UAAM,eAAe,WAAW;AAC1B,UAAA,YAAY,cAAc,UAAU;AAC1C,UAAM,YAAY,cAAc;AAGlB,kBAAA,SACZ,KAAK,IAAI,KAAK,IAAI,cAAc,SAAS,GAAG,SAAS,IAAI;AAAA,EAAA,GAC1D,CAAC,UAAU,OAAO,CAAC;AAEtB,YAAU,MAAM;AACD,iBAAA;AAAA,EAAA,GACZ,CAAC,MAAM,OAAO,MAAM,cAAc,YAAY,CAAC;AAE5C,QAAA,eAAwD,CAAC,MAAM;AACnE,eAAW,CAAC;AACC,iBAAA;AAAA,EACf;AAEA,QAAM,SAAS;AAAA,IACb,CAAC,OAAmC;AAClC,kBAAY,UAAU;AACtB,UAAI,IAAI;AACO,qBAAA;AAAA,MAAA;AAAA,IAEjB;AAAA,IACA,CAAC,YAAY;AAAA,EACf;AAGE,SAAAA,kCAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAK;AAAA,MACL,UAAU;AAAA,MACV,WAAW;AAAA,QACT;AAAA,QACA,WAAW,gBAAgB;AAAA,QAC3B;AAAA,MACF;AAAA,MACC,GAAG;AAAA,IAAA;AAAA,EACN;AAEJ,CAAC;AAED,kBAAkB,cAAc;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextArea.cjs","sources":["../../../src/components/TextArea/TextArea.tsx"],"sourcesContent":["import type { VariantProps } from 'class-variance-authority';\nimport {\n forwardRef,\n type TextareaHTMLAttributes,\n type DetailedHTMLProps,\n} from 'react';\nimport { cn } from '../../utils/cn';\nimport { inputVariants } from '../Input';\n\nexport type TextAreaProps = DetailedHTMLProps<\n DetailedHTMLProps<\n TextareaHTMLAttributes<HTMLTextAreaElement>,\n HTMLTextAreaElement\n >,\n HTMLTextAreaElement\n> & {\n validationStyleEnabled?: boolean;\n} & Omit<VariantProps<typeof inputVariants>, 'validationStyleEnabled'>;\n\nexport const TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(\n ({ className, variant, validationStyleEnabled = false, ...props }, ref) => (\n <textarea\n className={cn(\n 'resize-none',\n inputVariants({\n variant,\n validationStyleEnabled: validationStyleEnabled\n ? 'enabled'\n : 'disabled',\n className,\n })\n )}\n ref={ref}\n {...props}\n />\n )\n);\n\nTextArea.displayName = 'TextArea';\n"],"names":["forwardRef","jsx","cn","inputVariants"],"mappings":";;;;;;;;AAmBO,MAAM,WAAWA,WAAA;AAAA,EACtB,CAAC,EAAE,WAAW,SAAS,yBAAyB,OAAO,GAAG,MAAM,GAAG,QACjEC,2BAAA,kBAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC,SAAA;AAAA,QACT;AAAA,QACAC,qCAAc;AAAA,UACZ;AAAA,UACA,wBAAwB,yBACpB,YACA;AAAA,UACJ;AAAA,
|
|
1
|
+
{"version":3,"file":"TextArea.cjs","sources":["../../../src/components/TextArea/TextArea.tsx"],"sourcesContent":["import type { VariantProps } from 'class-variance-authority';\nimport {\n forwardRef,\n type TextareaHTMLAttributes,\n type DetailedHTMLProps,\n} from 'react';\nimport { cn } from '../../utils/cn';\nimport { inputVariants } from '../Input';\n\nexport type TextAreaProps = DetailedHTMLProps<\n DetailedHTMLProps<\n TextareaHTMLAttributes<HTMLTextAreaElement>,\n HTMLTextAreaElement\n >,\n HTMLTextAreaElement\n> & {\n validationStyleEnabled?: boolean;\n} & Omit<VariantProps<typeof inputVariants>, 'validationStyleEnabled'>;\n\nexport const TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(\n ({ className, variant, validationStyleEnabled = false, ...props }, ref) => (\n <textarea\n className={cn(\n 'resize-none',\n inputVariants({\n variant,\n validationStyleEnabled: validationStyleEnabled\n ? 'enabled'\n : 'disabled',\n className,\n })\n )}\n ref={ref}\n {...props}\n />\n )\n);\n\nTextArea.displayName = 'TextArea';\n"],"names":["forwardRef","jsx","cn","inputVariants"],"mappings":";;;;;;;;AAmBO,MAAM,WAAWA,WAAA;AAAA,EACtB,CAAC,EAAE,WAAW,SAAS,yBAAyB,OAAO,GAAG,MAAM,GAAG,QACjEC,2BAAA,kBAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC,SAAA;AAAA,QACT;AAAA,QACAC,qCAAc;AAAA,UACZ;AAAA,UACA,wBAAwB,yBACpB,YACA;AAAA,UACJ;AAAA,QACD,CAAA;AAAA,MACH;AAAA,MACA;AAAA,MACC,GAAG;AAAA,IAAA;AAAA,EAAA;AAGV;AAEA,SAAS,cAAc;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextArea.mjs","sources":["../../../src/components/TextArea/TextArea.tsx"],"sourcesContent":["import type { VariantProps } from 'class-variance-authority';\nimport {\n forwardRef,\n type TextareaHTMLAttributes,\n type DetailedHTMLProps,\n} from 'react';\nimport { cn } from '../../utils/cn';\nimport { inputVariants } from '../Input';\n\nexport type TextAreaProps = DetailedHTMLProps<\n DetailedHTMLProps<\n TextareaHTMLAttributes<HTMLTextAreaElement>,\n HTMLTextAreaElement\n >,\n HTMLTextAreaElement\n> & {\n validationStyleEnabled?: boolean;\n} & Omit<VariantProps<typeof inputVariants>, 'validationStyleEnabled'>;\n\nexport const TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(\n ({ className, variant, validationStyleEnabled = false, ...props }, ref) => (\n <textarea\n className={cn(\n 'resize-none',\n inputVariants({\n variant,\n validationStyleEnabled: validationStyleEnabled\n ? 'enabled'\n : 'disabled',\n className,\n })\n )}\n ref={ref}\n {...props}\n />\n )\n);\n\nTextArea.displayName = 'TextArea';\n"],"names":["jsx"],"mappings":";;;;;;AAmBO,MAAM,WAAW;AAAA,EACtB,CAAC,EAAE,WAAW,SAAS,yBAAyB,OAAO,GAAG,MAAM,GAAG,QACjEA,kCAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA,cAAc;AAAA,UACZ;AAAA,UACA,wBAAwB,yBACpB,YACA;AAAA,UACJ;AAAA,
|
|
1
|
+
{"version":3,"file":"TextArea.mjs","sources":["../../../src/components/TextArea/TextArea.tsx"],"sourcesContent":["import type { VariantProps } from 'class-variance-authority';\nimport {\n forwardRef,\n type TextareaHTMLAttributes,\n type DetailedHTMLProps,\n} from 'react';\nimport { cn } from '../../utils/cn';\nimport { inputVariants } from '../Input';\n\nexport type TextAreaProps = DetailedHTMLProps<\n DetailedHTMLProps<\n TextareaHTMLAttributes<HTMLTextAreaElement>,\n HTMLTextAreaElement\n >,\n HTMLTextAreaElement\n> & {\n validationStyleEnabled?: boolean;\n} & Omit<VariantProps<typeof inputVariants>, 'validationStyleEnabled'>;\n\nexport const TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(\n ({ className, variant, validationStyleEnabled = false, ...props }, ref) => (\n <textarea\n className={cn(\n 'resize-none',\n inputVariants({\n variant,\n validationStyleEnabled: validationStyleEnabled\n ? 'enabled'\n : 'disabled',\n className,\n })\n )}\n ref={ref}\n {...props}\n />\n )\n);\n\nTextArea.displayName = 'TextArea';\n"],"names":["jsx"],"mappings":";;;;;;AAmBO,MAAM,WAAW;AAAA,EACtB,CAAC,EAAE,WAAW,SAAS,yBAAyB,OAAO,GAAG,MAAM,GAAG,QACjEA,kCAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA,cAAc;AAAA,UACZ;AAAA,UACA,wBAAwB,yBACpB,YACA;AAAA,UACJ;AAAA,QACD,CAAA;AAAA,MACH;AAAA,MACA;AAAA,MACC,GAAG;AAAA,IAAA;AAAA,EAAA;AAGV;AAEA,SAAS,cAAc;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DesktopThemeSwitcher.cjs","sources":["../../../src/components/ThemeSwitcherDropDown/DesktopThemeSwitcher.tsx"],"sourcesContent":["'use client';\n\nimport { Moon, Sun, CircleDashed } from 'lucide-react';\nimport { useState, type FC } from 'react';\nimport { type ButtonProps, Button } from '../Button';\nimport { Container } from '../Container';\nimport { DropDown } from '../DropDown';\nimport { Modes } from './types';\n\nconst ButtonItem: FC<ButtonProps> = ({ Icon, children, ...props }) => (\n <div className=\"relative w-full p-0.5\">\n <Button\n className=\"hover:bg-text/10 focus:bg-text-opposite/20 dark:hover:bg-text-opposite/10 dark:focus:bg-text-opposite/20 w-full cursor-pointer rounded-lg p-1 text-left focus:outline-none disabled:text-white/25\"\n Icon={Icon}\n data-mode=\"system\"\n role=\"option\"\n variant=\"none\"\n {...props}\n >\n {children}\n </Button>\n </div>\n);\n\ntype DesktopThemeSwitcherProps = {\n theme: Modes;\n setTheme: (theme: Modes) => void;\n systemTheme: Modes;\n};\n\nexport const DesktopThemeSwitcher: FC<DesktopThemeSwitcherProps> = ({\n theme,\n setTheme,\n systemTheme,\n}) => {\n const isThemeSystemTheme = systemTheme === theme;\n const defaultMode = isThemeSystemTheme ? Modes.system : theme;\n\n const [mode, setMode] = useState<Modes>(defaultMode);\n\n const switchMode = (mode: Modes) => {\n if (mode === Modes.system) {\n setTheme(systemTheme ?? Modes.light);\n } else {\n setTheme(mode);\n }\n setMode(mode);\n };\n\n const panelIdentifier = 'theme-switcher';\n\n return (\n <DropDown identifier={panelIdentifier}>\n <DropDown.Trigger\n className=\"p-2\"\n identifier={panelIdentifier}\n aria-label=\"Theme selector\"\n >\n {mode === Modes.system && <CircleDashed data-mode=\"system\" />}\n {mode === Modes.light && <Sun data-mode=\"light\" />}\n {mode === Modes.dark && <Moon data-mode=\"dark\" />}\n </DropDown.Trigger>\n\n <DropDown.Panel identifier={panelIdentifier} isFocusable isOverable>\n <Container className=\"min-w-[100px] items-start p-1\" separator=\"y\">\n <ButtonItem\n Icon={CircleDashed}\n onClick={() => switchMode(Modes.system)}\n isActive={mode === Modes.system}\n label=\"Restore to system mode\"\n >\n System\n </ButtonItem>\n <ButtonItem\n Icon={Sun}\n onClick={() => switchMode(Modes.light)}\n isActive={mode === Modes.light}\n label=\"Switch to light mode\"\n >\n Light\n </ButtonItem>\n <ButtonItem\n Icon={Moon}\n onClick={() => switchMode(Modes.dark)}\n isActive={mode === Modes.dark}\n label=\"Switch to dark mode\"\n >\n Dark\n </ButtonItem>\n </Container>\n </DropDown.Panel>\n </DropDown>\n );\n};\n"],"names":["jsx","Button","Modes","useState","mode","jsxs","DropDown","CircleDashed","Sun","Moon","Container"],"mappings":";;;;;;;;;;AASA,MAAM,aAA8B,CAAC,EAAE,MAAM,UAAU,GAAG,MAAA,MACxDA,2BAAA,kBAAA,IAAC,OAAI,EAAA,WAAU,yBACb,UAAAA,2BAAA,kBAAA;AAAA,EAACC,yBAAA;AAAA,EAAA;AAAA,IACC,WAAU;AAAA,IACV;AAAA,IACA,aAAU;AAAA,IACV,MAAK;AAAA,IACL,SAAQ;AAAA,IACP,GAAG;AAAA,IAEH;AAAA,EAAA;AACH,
|
|
1
|
+
{"version":3,"file":"DesktopThemeSwitcher.cjs","sources":["../../../src/components/ThemeSwitcherDropDown/DesktopThemeSwitcher.tsx"],"sourcesContent":["'use client';\n\nimport { Moon, Sun, CircleDashed } from 'lucide-react';\nimport { useState, type FC } from 'react';\nimport { type ButtonProps, Button } from '../Button';\nimport { Container } from '../Container';\nimport { DropDown } from '../DropDown';\nimport { Modes } from './types';\n\nconst ButtonItem: FC<ButtonProps> = ({ Icon, children, ...props }) => (\n <div className=\"relative w-full p-0.5\">\n <Button\n className=\"hover:bg-text/10 focus:bg-text-opposite/20 dark:hover:bg-text-opposite/10 dark:focus:bg-text-opposite/20 w-full cursor-pointer rounded-lg p-1 text-left focus:outline-none disabled:text-white/25\"\n Icon={Icon}\n data-mode=\"system\"\n role=\"option\"\n variant=\"none\"\n {...props}\n >\n {children}\n </Button>\n </div>\n);\n\ntype DesktopThemeSwitcherProps = {\n theme: Modes;\n setTheme: (theme: Modes) => void;\n systemTheme: Modes;\n};\n\nexport const DesktopThemeSwitcher: FC<DesktopThemeSwitcherProps> = ({\n theme,\n setTheme,\n systemTheme,\n}) => {\n const isThemeSystemTheme = systemTheme === theme;\n const defaultMode = isThemeSystemTheme ? Modes.system : theme;\n\n const [mode, setMode] = useState<Modes>(defaultMode);\n\n const switchMode = (mode: Modes) => {\n if (mode === Modes.system) {\n setTheme(systemTheme ?? Modes.light);\n } else {\n setTheme(mode);\n }\n setMode(mode);\n };\n\n const panelIdentifier = 'theme-switcher';\n\n return (\n <DropDown identifier={panelIdentifier}>\n <DropDown.Trigger\n className=\"p-2\"\n identifier={panelIdentifier}\n aria-label=\"Theme selector\"\n >\n {mode === Modes.system && <CircleDashed data-mode=\"system\" />}\n {mode === Modes.light && <Sun data-mode=\"light\" />}\n {mode === Modes.dark && <Moon data-mode=\"dark\" />}\n </DropDown.Trigger>\n\n <DropDown.Panel identifier={panelIdentifier} isFocusable isOverable>\n <Container className=\"min-w-[100px] items-start p-1\" separator=\"y\">\n <ButtonItem\n Icon={CircleDashed}\n onClick={() => switchMode(Modes.system)}\n isActive={mode === Modes.system}\n label=\"Restore to system mode\"\n >\n System\n </ButtonItem>\n <ButtonItem\n Icon={Sun}\n onClick={() => switchMode(Modes.light)}\n isActive={mode === Modes.light}\n label=\"Switch to light mode\"\n >\n Light\n </ButtonItem>\n <ButtonItem\n Icon={Moon}\n onClick={() => switchMode(Modes.dark)}\n isActive={mode === Modes.dark}\n label=\"Switch to dark mode\"\n >\n Dark\n </ButtonItem>\n </Container>\n </DropDown.Panel>\n </DropDown>\n );\n};\n"],"names":["jsx","Button","Modes","useState","mode","jsxs","DropDown","CircleDashed","Sun","Moon","Container"],"mappings":";;;;;;;;;;AASA,MAAM,aAA8B,CAAC,EAAE,MAAM,UAAU,GAAG,MAAA,MACxDA,2BAAA,kBAAA,IAAC,OAAI,EAAA,WAAU,yBACb,UAAAA,2BAAA,kBAAA;AAAA,EAACC,yBAAA;AAAA,EAAA;AAAA,IACC,WAAU;AAAA,IACV;AAAA,IACA,aAAU;AAAA,IACV,MAAK;AAAA,IACL,SAAQ;AAAA,IACP,GAAG;AAAA,IAEH;AAAA,EAAA;AACH,GACF;AASK,MAAM,uBAAsD,CAAC;AAAA,EAClE;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,qBAAqB,gBAAgB;AACrC,QAAA,cAAc,qBAAqBC,uCAAA,MAAM,SAAS;AAExD,QAAM,CAAC,MAAM,OAAO,IAAIC,WAAAA,SAAgB,WAAW;AAE7C,QAAA,aAAa,CAACC,UAAgB;AAC9BA,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ACrC,UAAU,SAASA,uCAAAA,MAAM;AAAA,UACzB,OAAM;AAAA,UACP,UAAA;AAAA,QAAA;AAAA,MAED;AAAA,MACAF,2BAAA,kBAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,MAAMS,YAAA;AAAA,UACN,SAAS,MAAM,WAAWP,uCAAA,MAAM,IAAI;AAAA,UACpC,UAAU,SAASA,uCAAAA,MAAM;AAAA,UACzB,OAAM;AAAA,UACP,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAED,EAAA,CACF,EACF,CAAA;AAAA,EAAA,GACF;AAEJ;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DesktopThemeSwitcher.mjs","sources":["../../../src/components/ThemeSwitcherDropDown/DesktopThemeSwitcher.tsx"],"sourcesContent":["'use client';\n\nimport { Moon, Sun, CircleDashed } from 'lucide-react';\nimport { useState, type FC } from 'react';\nimport { type ButtonProps, Button } from '../Button';\nimport { Container } from '../Container';\nimport { DropDown } from '../DropDown';\nimport { Modes } from './types';\n\nconst ButtonItem: FC<ButtonProps> = ({ Icon, children, ...props }) => (\n <div className=\"relative w-full p-0.5\">\n <Button\n className=\"hover:bg-text/10 focus:bg-text-opposite/20 dark:hover:bg-text-opposite/10 dark:focus:bg-text-opposite/20 w-full cursor-pointer rounded-lg p-1 text-left focus:outline-none disabled:text-white/25\"\n Icon={Icon}\n data-mode=\"system\"\n role=\"option\"\n variant=\"none\"\n {...props}\n >\n {children}\n </Button>\n </div>\n);\n\ntype DesktopThemeSwitcherProps = {\n theme: Modes;\n setTheme: (theme: Modes) => void;\n systemTheme: Modes;\n};\n\nexport const DesktopThemeSwitcher: FC<DesktopThemeSwitcherProps> = ({\n theme,\n setTheme,\n systemTheme,\n}) => {\n const isThemeSystemTheme = systemTheme === theme;\n const defaultMode = isThemeSystemTheme ? Modes.system : theme;\n\n const [mode, setMode] = useState<Modes>(defaultMode);\n\n const switchMode = (mode: Modes) => {\n if (mode === Modes.system) {\n setTheme(systemTheme ?? Modes.light);\n } else {\n setTheme(mode);\n }\n setMode(mode);\n };\n\n const panelIdentifier = 'theme-switcher';\n\n return (\n <DropDown identifier={panelIdentifier}>\n <DropDown.Trigger\n className=\"p-2\"\n identifier={panelIdentifier}\n aria-label=\"Theme selector\"\n >\n {mode === Modes.system && <CircleDashed data-mode=\"system\" />}\n {mode === Modes.light && <Sun data-mode=\"light\" />}\n {mode === Modes.dark && <Moon data-mode=\"dark\" />}\n </DropDown.Trigger>\n\n <DropDown.Panel identifier={panelIdentifier} isFocusable isOverable>\n <Container className=\"min-w-[100px] items-start p-1\" separator=\"y\">\n <ButtonItem\n Icon={CircleDashed}\n onClick={() => switchMode(Modes.system)}\n isActive={mode === Modes.system}\n label=\"Restore to system mode\"\n >\n System\n </ButtonItem>\n <ButtonItem\n Icon={Sun}\n onClick={() => switchMode(Modes.light)}\n isActive={mode === Modes.light}\n label=\"Switch to light mode\"\n >\n Light\n </ButtonItem>\n <ButtonItem\n Icon={Moon}\n onClick={() => switchMode(Modes.dark)}\n isActive={mode === Modes.dark}\n label=\"Switch to dark mode\"\n >\n Dark\n </ButtonItem>\n </Container>\n </DropDown.Panel>\n </DropDown>\n );\n};\n"],"names":["jsx","mode","jsxs"],"mappings":";;;;;;;;AASA,MAAM,aAA8B,CAAC,EAAE,MAAM,UAAU,GAAG,MAAA,MACxDA,kCAAA,IAAC,OAAI,EAAA,WAAU,yBACb,UAAAA,kCAAA;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAU;AAAA,IACV;AAAA,IACA,aAAU;AAAA,IACV,MAAK;AAAA,IACL,SAAQ;AAAA,IACP,GAAG;AAAA,IAEH;AAAA,EAAA;AACH,
|
|
1
|
+
{"version":3,"file":"DesktopThemeSwitcher.mjs","sources":["../../../src/components/ThemeSwitcherDropDown/DesktopThemeSwitcher.tsx"],"sourcesContent":["'use client';\n\nimport { Moon, Sun, CircleDashed } from 'lucide-react';\nimport { useState, type FC } from 'react';\nimport { type ButtonProps, Button } from '../Button';\nimport { Container } from '../Container';\nimport { DropDown } from '../DropDown';\nimport { Modes } from './types';\n\nconst ButtonItem: FC<ButtonProps> = ({ Icon, children, ...props }) => (\n <div className=\"relative w-full p-0.5\">\n <Button\n className=\"hover:bg-text/10 focus:bg-text-opposite/20 dark:hover:bg-text-opposite/10 dark:focus:bg-text-opposite/20 w-full cursor-pointer rounded-lg p-1 text-left focus:outline-none disabled:text-white/25\"\n Icon={Icon}\n data-mode=\"system\"\n role=\"option\"\n variant=\"none\"\n {...props}\n >\n {children}\n </Button>\n </div>\n);\n\ntype DesktopThemeSwitcherProps = {\n theme: Modes;\n setTheme: (theme: Modes) => void;\n systemTheme: Modes;\n};\n\nexport const DesktopThemeSwitcher: FC<DesktopThemeSwitcherProps> = ({\n theme,\n setTheme,\n systemTheme,\n}) => {\n const isThemeSystemTheme = systemTheme === theme;\n const defaultMode = isThemeSystemTheme ? Modes.system : theme;\n\n const [mode, setMode] = useState<Modes>(defaultMode);\n\n const switchMode = (mode: Modes) => {\n if (mode === Modes.system) {\n setTheme(systemTheme ?? Modes.light);\n } else {\n setTheme(mode);\n }\n setMode(mode);\n };\n\n const panelIdentifier = 'theme-switcher';\n\n return (\n <DropDown identifier={panelIdentifier}>\n <DropDown.Trigger\n className=\"p-2\"\n identifier={panelIdentifier}\n aria-label=\"Theme selector\"\n >\n {mode === Modes.system && <CircleDashed data-mode=\"system\" />}\n {mode === Modes.light && <Sun data-mode=\"light\" />}\n {mode === Modes.dark && <Moon data-mode=\"dark\" />}\n </DropDown.Trigger>\n\n <DropDown.Panel identifier={panelIdentifier} isFocusable isOverable>\n <Container className=\"min-w-[100px] items-start p-1\" separator=\"y\">\n <ButtonItem\n Icon={CircleDashed}\n onClick={() => switchMode(Modes.system)}\n isActive={mode === Modes.system}\n label=\"Restore to system mode\"\n >\n System\n </ButtonItem>\n <ButtonItem\n Icon={Sun}\n onClick={() => switchMode(Modes.light)}\n isActive={mode === Modes.light}\n label=\"Switch to light mode\"\n >\n Light\n </ButtonItem>\n <ButtonItem\n Icon={Moon}\n onClick={() => switchMode(Modes.dark)}\n isActive={mode === Modes.dark}\n label=\"Switch to dark mode\"\n >\n Dark\n </ButtonItem>\n </Container>\n </DropDown.Panel>\n </DropDown>\n );\n};\n"],"names":["jsx","mode","jsxs"],"mappings":";;;;;;;;AASA,MAAM,aAA8B,CAAC,EAAE,MAAM,UAAU,GAAG,MAAA,MACxDA,kCAAA,IAAC,OAAI,EAAA,WAAU,yBACb,UAAAA,kCAAA;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAU;AAAA,IACV;AAAA,IACA,aAAU;AAAA,IACV,MAAK;AAAA,IACL,SAAQ;AAAA,IACP,GAAG;AAAA,IAEH;AAAA,EAAA;AACH,GACF;AASK,MAAM,uBAAsD,CAAC;AAAA,EAClE;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,qBAAqB,gBAAgB;AACrC,QAAA,cAAc,qBAAqB,MAAM,SAAS;AAExD,QAAM,CAAC,MAAM,OAAO,IAAI,SAAgB,WAAW;AAE7C,QAAA,aAAa,CAACC,UAAgB;AAC9BA,QAAAA,UAAS,MAAM,QAAQ;AAChB,eAAA,eAAe,MAAM,KAAK;AAAA,IAAA,OAC9B;AACL,eAASA,KAAI;AAAA,IAAA;AAEf,YAAQA,KAAI;AAAA,EACd;AAEA,QAAM,kBAAkB;AAGtB,SAAAC,kCAAA,KAAC,UAAS,EAAA,YAAY,iBACpB,UAAA;AAAA,IAAAA,kCAAA;AAAA,MAAC,SAAS;AAAA,MAAT;AAAA,QACC,WAAU;AAAA,QACV,YAAY;AAAA,QACZ,cAAW;AAAA,QAEV,UAAA;AAAA,UAAA,SAAS,MAAM,UAAWF,kCAAAA,IAAA,cAAA,EAAa,aAAU,UAAS;AAAA,UAC1D,SAAS,MAAM,SAAUA,kCAAAA,IAAA,KAAA,EAAI,aAAU,SAAQ;AAAA,UAC/C,SAAS,MAAM,QAASA,kCAAAA,IAAA,MAAA,EAAK,aAAU,OAAO,CAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IACjD;AAAA,IAECA,kCAAA,IAAA,SAAS,OAAT,EAAe,YAAY,iBAAiB,aAAW,MAAC,YAAU,MACjE,UAACE,kCAAAA,KAAA,WAAA,EAAU,WAAU,iCAAgC,WAAU,KAC7D,UAAA;AAAA,MAAAF,kCAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,MAAM;AAAA,UACN,SAAS,MAAM,WAAW,MAAM,MAAM;AAAA,UACtC,UAAU,SAAS,MAAM;AAAA,UACzB,OAAM;AAAA,UACP,UAAA;AAAA,QAAA;AAAA,MAED;AAAA,MACAA,kCAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,MAAM;AAAA,UACN,SAAS,MAAM,WAAW,MAAM,KAAK;AAAA,UACrC,UAAU,SAAS,MAAM;AAAA,UACzB,OAAM;AAAA,UACP,UAAA;AAAA,QAAA;AAAA,MAED;AAAA,MACAA,kCAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,MAAM;AAAA,UACN,SAAS,MAAM,WAAW,MAAM,IAAI;AAAA,UACpC,UAAU,SAAS,MAAM;AAAA,UACzB,OAAM;AAAA,UACP,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAED,EAAA,CACF,EACF,CAAA;AAAA,EAAA,GACF;AAEJ;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MobileThemeSwitcher.cjs","sources":["../../../src/components/ThemeSwitcherDropDown/MobileThemeSwitcher.tsx"],"sourcesContent":["/* eslint-disable sonarjs/no-nested-conditional */\n'use client';\n\nimport { Moon, Sun, CircleDashed } from 'lucide-react';\nimport { useState, type FC } from 'react';\nimport { cn } from '../../utils/cn';\nimport { Modes } from './types';\n\ntype MobileThemeSwitcherProps = {\n theme: Modes;\n systemTheme: Modes;\n setTheme: (theme: Modes) => void;\n};\n\nconst getIconStyle = ({\n isCurrentMode,\n isNextMode,\n}: {\n isCurrentMode: boolean;\n isNextMode: boolean;\n}) =>\n cn(\n `absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2`,\n `opacity-0 transition-opacity duration-300 ease-in-out`,\n isCurrentMode && `opacity-100 group-hover:opacity-0`,\n isNextMode && `group-hover:opacity-100`\n );\n\nexport const MobileThemeSwitcher: FC<MobileThemeSwitcherProps> = ({\n theme,\n systemTheme,\n setTheme,\n}) => {\n const isThemeSystemTheme = systemTheme === theme;\n const defaultMode = isThemeSystemTheme ? Modes.system : theme;\n\n const [mode, setMode] = useState<Modes>(defaultMode);\n\n const nextMode =\n // Start loop\n // If mode is system, toggle the theme inverse of the system theme\n mode === Modes.system\n ? theme === Modes.dark\n ? Modes.light\n : Modes.dark\n : // Close loop\n // If current theme same as system theme, reset by toggle the system theme\n isThemeSystemTheme\n ? Modes.system\n : // Go to next step\n // Otherwise, toggle the remaining theme\n mode === Modes.light\n ? Modes.dark\n : Modes.light;\n\n const toggleMode = () => {\n if (nextMode === Modes.system) {\n setTheme(systemTheme ?? Modes.light);\n } else {\n setTheme(nextMode);\n }\n setMode(nextMode);\n };\n\n return (\n <button className=\"group relative size-10\" aria-label=\"Theme selector\">\n <CircleDashed\n className={getIconStyle({\n isCurrentMode: mode === Modes.system,\n isNextMode: nextMode === Modes.system,\n })}\n onClick={toggleMode}\n data-mode=\"system\"\n />\n\n <Moon\n className={getIconStyle({\n isCurrentMode: mode === Modes.light,\n isNextMode: nextMode === Modes.light,\n })}\n onClick={toggleMode}\n data-mode=\"light\"\n />\n\n <Sun\n className={getIconStyle({\n isCurrentMode: mode === Modes.dark,\n isNextMode: nextMode === Modes.dark,\n })}\n onClick={toggleMode}\n data-mode=\"dark\"\n />\n </button>\n );\n};\n"],"names":["cn","Modes","useState","jsxs","jsx","CircleDashed","Moon","Sun"],"mappings":";;;;;;;;AAcA,MAAM,eAAe,CAAC;AAAA,EACpB;AAAA,EACA;AACF,MAIEA,SAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA,iBAAiB;AAAA,EACjB,cAAc;AAChB;AAEK,MAAM,sBAAoD,CAAC;AAAA,EAChE;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,qBAAqB,gBAAgB;AACrC,QAAA,cAAc,qBAAqBC,
|
|
1
|
+
{"version":3,"file":"MobileThemeSwitcher.cjs","sources":["../../../src/components/ThemeSwitcherDropDown/MobileThemeSwitcher.tsx"],"sourcesContent":["/* eslint-disable sonarjs/no-nested-conditional */\n'use client';\n\nimport { Moon, Sun, CircleDashed } from 'lucide-react';\nimport { useState, type FC } from 'react';\nimport { cn } from '../../utils/cn';\nimport { Modes } from './types';\n\ntype MobileThemeSwitcherProps = {\n theme: Modes;\n systemTheme: Modes;\n setTheme: (theme: Modes) => void;\n};\n\nconst getIconStyle = ({\n isCurrentMode,\n isNextMode,\n}: {\n isCurrentMode: boolean;\n isNextMode: boolean;\n}) =>\n cn(\n `absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2`,\n `opacity-0 transition-opacity duration-300 ease-in-out`,\n isCurrentMode && `opacity-100 group-hover:opacity-0`,\n isNextMode && `group-hover:opacity-100`\n );\n\nexport const MobileThemeSwitcher: FC<MobileThemeSwitcherProps> = ({\n theme,\n systemTheme,\n setTheme,\n}) => {\n const isThemeSystemTheme = systemTheme === theme;\n const defaultMode = isThemeSystemTheme ? Modes.system : theme;\n\n const [mode, setMode] = useState<Modes>(defaultMode);\n\n const nextMode =\n // Start loop\n // If mode is system, toggle the theme inverse of the system theme\n mode === Modes.system\n ? theme === Modes.dark\n ? Modes.light\n : Modes.dark\n : // Close loop\n // If current theme same as system theme, reset by toggle the system theme\n isThemeSystemTheme\n ? Modes.system\n : // Go to next step\n // Otherwise, toggle the remaining theme\n mode === Modes.light\n ? Modes.dark\n : Modes.light;\n\n const toggleMode = () => {\n if (nextMode === Modes.system) {\n setTheme(systemTheme ?? Modes.light);\n } else {\n setTheme(nextMode);\n }\n setMode(nextMode);\n };\n\n return (\n <button className=\"group relative size-10\" aria-label=\"Theme selector\">\n <CircleDashed\n className={getIconStyle({\n isCurrentMode: mode === Modes.system,\n isNextMode: nextMode === Modes.system,\n })}\n onClick={toggleMode}\n data-mode=\"system\"\n />\n\n <Moon\n className={getIconStyle({\n isCurrentMode: mode === Modes.light,\n isNextMode: nextMode === Modes.light,\n })}\n onClick={toggleMode}\n data-mode=\"light\"\n />\n\n <Sun\n className={getIconStyle({\n isCurrentMode: mode === Modes.dark,\n isNextMode: nextMode === Modes.dark,\n })}\n onClick={toggleMode}\n data-mode=\"dark\"\n />\n </button>\n );\n};\n"],"names":["cn","Modes","useState","jsxs","jsx","CircleDashed","Moon","Sun"],"mappings":";;;;;;;;AAcA,MAAM,eAAe,CAAC;AAAA,EACpB;AAAA,EACA;AACF,MAIEA,SAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA,iBAAiB;AAAA,EACjB,cAAc;AAChB;AAEK,MAAM,sBAAoD,CAAC;AAAA,EAChE;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,qBAAqB,gBAAgB;AACrC,QAAA,cAAc,qBAAqBC,uCAAA,MAAM,SAAS;AAExD,QAAM,CAAC,MAAM,OAAO,IAAIC,WAAAA,SAAgB,WAAW;AAE7C,QAAA;AAAA;AAAA;AAAA,IAGJ,SAASD,uCAAAA,MAAM,SACX,UAAUA,uCAAAA,MAAM,OACdA,uCAAA,MAAM,QACNA,uCAAAA,MAAM;AAAA;AAAA;AAAA,MAGR,qBACEA,uCAAM,MAAA;AAAA;AAAA;AAAA,QAGN,SAASA,uCAAAA,MAAM,QACbA,uCAAAA,MAAM,OACNA,uCAAAA,MAAM;AAAA;AAAA;AAAA;AAEhB,QAAM,aAAa,MAAM;AACnB,QAAA,aAAaA,6CAAM,QAAQ;AACpB,eAAA,eAAeA,6CAAM,KAAK;AAAA,IAAA,OAC9B;AACL,eAAS,QAAQ;AAAA,IAAA;AAEnB,YAAQ,QAAQ;AAAA,EAClB;AAEA,SACGE,2BAAAA,kBAAAA,KAAA,UAAA,EAAO,WAAU,0BAAyB,cAAW,kBACpD,UAAA;AAAA,IAAAC,2BAAA,kBAAA;AAAA,MAACC,YAAA;AAAA,MAAA;AAAA,QACC,WAAW,aAAa;AAAA,UACtB,eAAe,SAASJ,uCAAAA,MAAM;AAAA,UAC9B,YAAY,aAAaA,6CAAM;AAAA,QAAA,CAChC;AAAA,QACD,SAAS;AAAA,QACT,aAAU;AAAA,MAAA;AAAA,IACZ;AAAA,IAEAG,2BAAA,kBAAA;AAAA,MAACE,YAAA;AAAA,MAAA;AAAA,QACC,WAAW,aAAa;AAAA,UACtB,eAAe,SAASL,uCAAAA,MAAM;AAAA,UAC9B,YAAY,aAAaA,6CAAM;AAAA,QAAA,CAChC;AAAA,QACD,SAAS;AAAA,QACT,aAAU;AAAA,MAAA;AAAA,IACZ;AAAA,IAEAG,2BAAA,kBAAA;AAAA,MAACG,YAAA;AAAA,MAAA;AAAA,QACC,WAAW,aAAa;AAAA,UACtB,eAAe,SAASN,uCAAAA,MAAM;AAAA,UAC9B,YAAY,aAAaA,6CAAM;AAAA,QAAA,CAChC;AAAA,QACD,SAAS;AAAA,QACT,aAAU;AAAA,MAAA;AAAA,IAAA;AAAA,EACZ,GACF;AAEJ;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MobileThemeSwitcher.mjs","sources":["../../../src/components/ThemeSwitcherDropDown/MobileThemeSwitcher.tsx"],"sourcesContent":["/* eslint-disable sonarjs/no-nested-conditional */\n'use client';\n\nimport { Moon, Sun, CircleDashed } from 'lucide-react';\nimport { useState, type FC } from 'react';\nimport { cn } from '../../utils/cn';\nimport { Modes } from './types';\n\ntype MobileThemeSwitcherProps = {\n theme: Modes;\n systemTheme: Modes;\n setTheme: (theme: Modes) => void;\n};\n\nconst getIconStyle = ({\n isCurrentMode,\n isNextMode,\n}: {\n isCurrentMode: boolean;\n isNextMode: boolean;\n}) =>\n cn(\n `absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2`,\n `opacity-0 transition-opacity duration-300 ease-in-out`,\n isCurrentMode && `opacity-100 group-hover:opacity-0`,\n isNextMode && `group-hover:opacity-100`\n );\n\nexport const MobileThemeSwitcher: FC<MobileThemeSwitcherProps> = ({\n theme,\n systemTheme,\n setTheme,\n}) => {\n const isThemeSystemTheme = systemTheme === theme;\n const defaultMode = isThemeSystemTheme ? Modes.system : theme;\n\n const [mode, setMode] = useState<Modes>(defaultMode);\n\n const nextMode =\n // Start loop\n // If mode is system, toggle the theme inverse of the system theme\n mode === Modes.system\n ? theme === Modes.dark\n ? Modes.light\n : Modes.dark\n : // Close loop\n // If current theme same as system theme, reset by toggle the system theme\n isThemeSystemTheme\n ? Modes.system\n : // Go to next step\n // Otherwise, toggle the remaining theme\n mode === Modes.light\n ? Modes.dark\n : Modes.light;\n\n const toggleMode = () => {\n if (nextMode === Modes.system) {\n setTheme(systemTheme ?? Modes.light);\n } else {\n setTheme(nextMode);\n }\n setMode(nextMode);\n };\n\n return (\n <button className=\"group relative size-10\" aria-label=\"Theme selector\">\n <CircleDashed\n className={getIconStyle({\n isCurrentMode: mode === Modes.system,\n isNextMode: nextMode === Modes.system,\n })}\n onClick={toggleMode}\n data-mode=\"system\"\n />\n\n <Moon\n className={getIconStyle({\n isCurrentMode: mode === Modes.light,\n isNextMode: nextMode === Modes.light,\n })}\n onClick={toggleMode}\n data-mode=\"light\"\n />\n\n <Sun\n className={getIconStyle({\n isCurrentMode: mode === Modes.dark,\n isNextMode: nextMode === Modes.dark,\n })}\n onClick={toggleMode}\n data-mode=\"dark\"\n />\n </button>\n );\n};\n"],"names":["jsxs","jsx"],"mappings":";;;;;;AAcA,MAAM,eAAe,CAAC;AAAA,EACpB;AAAA,EACA;AACF,MAIE;AAAA,EACE;AAAA,EACA;AAAA,EACA,iBAAiB;AAAA,EACjB,cAAc;AAChB;AAEK,MAAM,sBAAoD,CAAC;AAAA,EAChE;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,qBAAqB,gBAAgB;AACrC,QAAA,cAAc,qBAAqB,MAAM,SAAS;AAExD,QAAM,CAAC,MAAM,OAAO,IAAI,SAAgB,WAAW;AAE7C,QAAA;AAAA;AAAA;AAAA,IAGJ,SAAS,MAAM,SACX,UAAU,MAAM,OACd,MAAM,QACN,MAAM;AAAA;AAAA;AAAA,MAGR,qBACE,MAAM;AAAA;AAAA;AAAA,QAGN,SAAS,MAAM,QACb,MAAM,OACN,MAAM;AAAA;AAAA;AAAA;AAEhB,QAAM,aAAa,MAAM;AACnB,QAAA,aAAa,MAAM,QAAQ;AACpB,eAAA,eAAe,MAAM,KAAK;AAAA,IAAA,OAC9B;AACL,eAAS,QAAQ;AAAA,
|
|
1
|
+
{"version":3,"file":"MobileThemeSwitcher.mjs","sources":["../../../src/components/ThemeSwitcherDropDown/MobileThemeSwitcher.tsx"],"sourcesContent":["/* eslint-disable sonarjs/no-nested-conditional */\n'use client';\n\nimport { Moon, Sun, CircleDashed } from 'lucide-react';\nimport { useState, type FC } from 'react';\nimport { cn } from '../../utils/cn';\nimport { Modes } from './types';\n\ntype MobileThemeSwitcherProps = {\n theme: Modes;\n systemTheme: Modes;\n setTheme: (theme: Modes) => void;\n};\n\nconst getIconStyle = ({\n isCurrentMode,\n isNextMode,\n}: {\n isCurrentMode: boolean;\n isNextMode: boolean;\n}) =>\n cn(\n `absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2`,\n `opacity-0 transition-opacity duration-300 ease-in-out`,\n isCurrentMode && `opacity-100 group-hover:opacity-0`,\n isNextMode && `group-hover:opacity-100`\n );\n\nexport const MobileThemeSwitcher: FC<MobileThemeSwitcherProps> = ({\n theme,\n systemTheme,\n setTheme,\n}) => {\n const isThemeSystemTheme = systemTheme === theme;\n const defaultMode = isThemeSystemTheme ? Modes.system : theme;\n\n const [mode, setMode] = useState<Modes>(defaultMode);\n\n const nextMode =\n // Start loop\n // If mode is system, toggle the theme inverse of the system theme\n mode === Modes.system\n ? theme === Modes.dark\n ? Modes.light\n : Modes.dark\n : // Close loop\n // If current theme same as system theme, reset by toggle the system theme\n isThemeSystemTheme\n ? Modes.system\n : // Go to next step\n // Otherwise, toggle the remaining theme\n mode === Modes.light\n ? Modes.dark\n : Modes.light;\n\n const toggleMode = () => {\n if (nextMode === Modes.system) {\n setTheme(systemTheme ?? Modes.light);\n } else {\n setTheme(nextMode);\n }\n setMode(nextMode);\n };\n\n return (\n <button className=\"group relative size-10\" aria-label=\"Theme selector\">\n <CircleDashed\n className={getIconStyle({\n isCurrentMode: mode === Modes.system,\n isNextMode: nextMode === Modes.system,\n })}\n onClick={toggleMode}\n data-mode=\"system\"\n />\n\n <Moon\n className={getIconStyle({\n isCurrentMode: mode === Modes.light,\n isNextMode: nextMode === Modes.light,\n })}\n onClick={toggleMode}\n data-mode=\"light\"\n />\n\n <Sun\n className={getIconStyle({\n isCurrentMode: mode === Modes.dark,\n isNextMode: nextMode === Modes.dark,\n })}\n onClick={toggleMode}\n data-mode=\"dark\"\n />\n </button>\n );\n};\n"],"names":["jsxs","jsx"],"mappings":";;;;;;AAcA,MAAM,eAAe,CAAC;AAAA,EACpB;AAAA,EACA;AACF,MAIE;AAAA,EACE;AAAA,EACA;AAAA,EACA,iBAAiB;AAAA,EACjB,cAAc;AAChB;AAEK,MAAM,sBAAoD,CAAC;AAAA,EAChE;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,qBAAqB,gBAAgB;AACrC,QAAA,cAAc,qBAAqB,MAAM,SAAS;AAExD,QAAM,CAAC,MAAM,OAAO,IAAI,SAAgB,WAAW;AAE7C,QAAA;AAAA;AAAA;AAAA,IAGJ,SAAS,MAAM,SACX,UAAU,MAAM,OACd,MAAM,QACN,MAAM;AAAA;AAAA;AAAA,MAGR,qBACE,MAAM;AAAA;AAAA;AAAA,QAGN,SAAS,MAAM,QACb,MAAM,OACN,MAAM;AAAA;AAAA;AAAA;AAEhB,QAAM,aAAa,MAAM;AACnB,QAAA,aAAa,MAAM,QAAQ;AACpB,eAAA,eAAe,MAAM,KAAK;AAAA,IAAA,OAC9B;AACL,eAAS,QAAQ;AAAA,IAAA;AAEnB,YAAQ,QAAQ;AAAA,EAClB;AAEA,SACGA,kCAAAA,KAAA,UAAA,EAAO,WAAU,0BAAyB,cAAW,kBACpD,UAAA;AAAA,IAAAC,kCAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAW,aAAa;AAAA,UACtB,eAAe,SAAS,MAAM;AAAA,UAC9B,YAAY,aAAa,MAAM;AAAA,QAAA,CAChC;AAAA,QACD,SAAS;AAAA,QACT,aAAU;AAAA,MAAA;AAAA,IACZ;AAAA,IAEAA,kCAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAW,aAAa;AAAA,UACtB,eAAe,SAAS,MAAM;AAAA,UAC9B,YAAY,aAAa,MAAM;AAAA,QAAA,CAChC;AAAA,QACD,SAAS;AAAA,QACT,aAAU;AAAA,MAAA;AAAA,IACZ;AAAA,IAEAA,kCAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAW,aAAa;AAAA,UACtB,eAAe,SAAS,MAAM;AAAA,UAC9B,YAAY,aAAa,MAAM;AAAA,QAAA,CAChC;AAAA,QACD,SAAS;AAAA,QACT,aAAU;AAAA,MAAA;AAAA,IAAA;AAAA,EACZ,GACF;AAEJ;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toast.cjs","sources":["../../../src/components/Toaster/Toast.tsx"],"sourcesContent":["'use client';\n\nimport * as ToastPrimitives from '@radix-ui/react-toast';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { X } from 'lucide-react';\nimport {\n forwardRef,\n type ReactElement,\n type ComponentPropsWithoutRef,\n type ElementRef,\n} from 'react';\nimport { cn } from '../../utils/cn';\n\nconst ToastProvider = ToastPrimitives.Provider;\n\nconst ToastViewport = forwardRef<\n ElementRef<typeof ToastPrimitives.Viewport>,\n ComponentPropsWithoutRef<typeof ToastPrimitives.Viewport>\n>(({ className, ...props }, ref) => (\n <ToastPrimitives.Viewport\n ref={ref}\n className={cn(\n 'fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]',\n className\n )}\n {...props}\n />\n));\nToastViewport.displayName = ToastPrimitives.Viewport.displayName;\n\nconst toastVariants = cva(\n 'group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md p-4 pr-6 shadow-[0_0_10px_-15px_rgba(0,0,0,0.3)] backdrop-blur transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full',\n {\n variants: {\n variant: {\n error:\n 'bg-error/40 text-text dark:bg-error-dark/40 dark:text-text-dark',\n success:\n 'bg-success/30 text-text dark:bg-success-dark/30 dark:text-text-dark',\n default:\n 'bg-card/80 text-text dark:bg-card-dark/80 dark:text-text-dark',\n },\n },\n defaultVariants: {\n variant: 'default',\n },\n }\n);\n\nconst Toast = forwardRef<\n ElementRef<typeof ToastPrimitives.Root>,\n ComponentPropsWithoutRef<typeof ToastPrimitives.Root> &\n VariantProps<typeof toastVariants>\n>(({ className, variant, ...props }, ref) => {\n return (\n <ToastPrimitives.Root\n ref={ref}\n className={cn(toastVariants({ variant }), className)}\n {...props}\n />\n );\n});\nToast.displayName = ToastPrimitives.Root.displayName;\n\nconst ToastAction = forwardRef<\n ElementRef<typeof ToastPrimitives.Action>,\n ComponentPropsWithoutRef<typeof ToastPrimitives.Action>\n>(({ className, ...props }, ref) => (\n <ToastPrimitives.Action\n ref={ref}\n className={cn(\n 'hover:bg-text focus:ring-ring group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors focus:outline-none focus:ring-1 disabled:pointer-events-none disabled:opacity-50',\n className\n )}\n {...props}\n />\n));\nToastAction.displayName = ToastPrimitives.Action.displayName;\n\nconst ToastClose = forwardRef<\n ElementRef<typeof ToastPrimitives.Close>,\n ComponentPropsWithoutRef<typeof ToastPrimitives.Close>\n>(({ className, ...props }, ref) => (\n <ToastPrimitives.Close\n ref={ref}\n className={cn(\n 'text-text/50 hover:text-text/80 dark:text-text-dark/50 dark:hover:text-text-dark/80 absolute right-1 top-1 rounded-md p-1 opacity-0 transition-opacity focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600',\n className\n )}\n toast-close=\"\"\n {...props}\n >\n <X className=\"size-5\" />\n </ToastPrimitives.Close>\n));\nToastClose.displayName = ToastPrimitives.Close.displayName;\n\nconst ToastTitle = forwardRef<\n ElementRef<typeof ToastPrimitives.Title>,\n ComponentPropsWithoutRef<typeof ToastPrimitives.Title>\n>(({ className, ...props }, ref) => (\n <ToastPrimitives.Title\n ref={ref}\n className={cn('text-sm font-semibold [&+div]:text-xs', className)}\n {...props}\n />\n));\nToastTitle.displayName = ToastPrimitives.Title.displayName;\n\nconst ToastDescription = forwardRef<\n ElementRef<typeof ToastPrimitives.Description>,\n ComponentPropsWithoutRef<typeof ToastPrimitives.Description>\n>(({ className, ...props }, ref) => (\n <ToastPrimitives.Description\n ref={ref}\n className={cn('text-sm opacity-90', className)}\n {...props}\n />\n));\nToastDescription.displayName = ToastPrimitives.Description.displayName;\n\ntype ToastProps = ComponentPropsWithoutRef<typeof Toast>;\n\ntype ToastActionElement = ReactElement<typeof ToastAction>;\n\nexport {\n type ToastProps,\n type ToastActionElement,\n ToastProvider,\n ToastViewport,\n Toast,\n ToastTitle,\n ToastDescription,\n ToastClose,\n ToastAction,\n};\n"],"names":["ToastPrimitives","forwardRef","jsx","cn","cva","X"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAaA,MAAM,gBAAgBA,2BAAgB;AAEhC,MAAA,gBAAgBC,sBAGpB,CAAC,EAAE,WAAW,GAAG,MAAA,GAAS,QAC1BC,2BAAA,kBAAA;AAAA,EAACF,2BAAgB;AAAA,EAAhB;AAAA,IACC;AAAA,IACA,WAAWG,SAAA;AAAA,MACT;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG;AAAA,EAAA;AACN,CACD;AACD,cAAc,cAAcH,2BAAgB,SAAS;AAErD,MAAM,gBAAgBI,uBAAA;AAAA,EACpB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,OACE;AAAA,QACF,SACE;AAAA,QACF,SACE;AAAA,
|
|
1
|
+
{"version":3,"file":"Toast.cjs","sources":["../../../src/components/Toaster/Toast.tsx"],"sourcesContent":["'use client';\n\nimport * as ToastPrimitives from '@radix-ui/react-toast';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { X } from 'lucide-react';\nimport {\n forwardRef,\n type ReactElement,\n type ComponentPropsWithoutRef,\n type ElementRef,\n} from 'react';\nimport { cn } from '../../utils/cn';\n\nconst ToastProvider = ToastPrimitives.Provider;\n\nconst ToastViewport = forwardRef<\n ElementRef<typeof ToastPrimitives.Viewport>,\n ComponentPropsWithoutRef<typeof ToastPrimitives.Viewport>\n>(({ className, ...props }, ref) => (\n <ToastPrimitives.Viewport\n ref={ref}\n className={cn(\n 'fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]',\n className\n )}\n {...props}\n />\n));\nToastViewport.displayName = ToastPrimitives.Viewport.displayName;\n\nconst toastVariants = cva(\n 'group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md p-4 pr-6 shadow-[0_0_10px_-15px_rgba(0,0,0,0.3)] backdrop-blur transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full',\n {\n variants: {\n variant: {\n error:\n 'bg-error/40 text-text dark:bg-error-dark/40 dark:text-text-dark',\n success:\n 'bg-success/30 text-text dark:bg-success-dark/30 dark:text-text-dark',\n default:\n 'bg-card/80 text-text dark:bg-card-dark/80 dark:text-text-dark',\n },\n },\n defaultVariants: {\n variant: 'default',\n },\n }\n);\n\nconst Toast = forwardRef<\n ElementRef<typeof ToastPrimitives.Root>,\n ComponentPropsWithoutRef<typeof ToastPrimitives.Root> &\n VariantProps<typeof toastVariants>\n>(({ className, variant, ...props }, ref) => {\n return (\n <ToastPrimitives.Root\n ref={ref}\n className={cn(toastVariants({ variant }), className)}\n {...props}\n />\n );\n});\nToast.displayName = ToastPrimitives.Root.displayName;\n\nconst ToastAction = forwardRef<\n ElementRef<typeof ToastPrimitives.Action>,\n ComponentPropsWithoutRef<typeof ToastPrimitives.Action>\n>(({ className, ...props }, ref) => (\n <ToastPrimitives.Action\n ref={ref}\n className={cn(\n 'hover:bg-text focus:ring-ring group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors focus:outline-none focus:ring-1 disabled:pointer-events-none disabled:opacity-50',\n className\n )}\n {...props}\n />\n));\nToastAction.displayName = ToastPrimitives.Action.displayName;\n\nconst ToastClose = forwardRef<\n ElementRef<typeof ToastPrimitives.Close>,\n ComponentPropsWithoutRef<typeof ToastPrimitives.Close>\n>(({ className, ...props }, ref) => (\n <ToastPrimitives.Close\n ref={ref}\n className={cn(\n 'text-text/50 hover:text-text/80 dark:text-text-dark/50 dark:hover:text-text-dark/80 absolute right-1 top-1 rounded-md p-1 opacity-0 transition-opacity focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600',\n className\n )}\n toast-close=\"\"\n {...props}\n >\n <X className=\"size-5\" />\n </ToastPrimitives.Close>\n));\nToastClose.displayName = ToastPrimitives.Close.displayName;\n\nconst ToastTitle = forwardRef<\n ElementRef<typeof ToastPrimitives.Title>,\n ComponentPropsWithoutRef<typeof ToastPrimitives.Title>\n>(({ className, ...props }, ref) => (\n <ToastPrimitives.Title\n ref={ref}\n className={cn('text-sm font-semibold [&+div]:text-xs', className)}\n {...props}\n />\n));\nToastTitle.displayName = ToastPrimitives.Title.displayName;\n\nconst ToastDescription = forwardRef<\n ElementRef<typeof ToastPrimitives.Description>,\n ComponentPropsWithoutRef<typeof ToastPrimitives.Description>\n>(({ className, ...props }, ref) => (\n <ToastPrimitives.Description\n ref={ref}\n className={cn('text-sm opacity-90', className)}\n {...props}\n />\n));\nToastDescription.displayName = ToastPrimitives.Description.displayName;\n\ntype ToastProps = ComponentPropsWithoutRef<typeof Toast>;\n\ntype ToastActionElement = ReactElement<typeof ToastAction>;\n\nexport {\n type ToastProps,\n type ToastActionElement,\n ToastProvider,\n ToastViewport,\n Toast,\n ToastTitle,\n ToastDescription,\n ToastClose,\n ToastAction,\n};\n"],"names":["ToastPrimitives","forwardRef","jsx","cn","cva","X"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAaA,MAAM,gBAAgBA,2BAAgB;AAEhC,MAAA,gBAAg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Y;AAAA,IACX,GAAG;AAAA,IAEJ,UAAAD,2BAAAA,kBAAAA,IAACG,YAAAA,GAAE,EAAA,WAAU,SAAS,CAAA;AAAA,EAAA;AACxB,CACD;AACD,WAAW,cAAcL,2BAAgB,MAAM;AAEzC,MAAA,aAAaC,sBAGjB,CAAC,EAAE,WAAW,GAAG,MAAA,GAAS,QAC1BC,2BAAA,kBAAA;AAAA,EAACF,2BAAgB;AAAA,EAAhB;AAAA,IACC;AAAA,IACA,WAAWG,SAAAA,GAAG,yCAAyC,SAAS;AAAA,IAC/D,GAAG;AAAA,EAAA;AACN,CACD;AACD,WAAW,cAAcH,2BAAgB,MAAM;AAEzC,MAAA,mBAAmBC,sBAGvB,CAAC,EAAE,WAAW,GAAG,MAAA,GAAS,QAC1BC,2BAAA,kBAAA;AAAA,EAACF,2BAAgB;AAAA,EAAhB;AAAA,IACC;AAAA,IACA,WAAWG,SAAAA,GAAG,sBAAsB,SAAS;AAAA,IAC5C,GAAG;AAAA,EAAA;AACN,CACD;AACD,iBAAiB,cAAcH,2BAAgB,YAAY;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toast.mjs","sources":["../../../src/components/Toaster/Toast.tsx"],"sourcesContent":["'use client';\n\nimport * as ToastPrimitives from '@radix-ui/react-toast';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { X } from 'lucide-react';\nimport {\n forwardRef,\n type ReactElement,\n type ComponentPropsWithoutRef,\n type ElementRef,\n} from 'react';\nimport { cn } from '../../utils/cn';\n\nconst ToastProvider = ToastPrimitives.Provider;\n\nconst ToastViewport = forwardRef<\n ElementRef<typeof ToastPrimitives.Viewport>,\n ComponentPropsWithoutRef<typeof ToastPrimitives.Viewport>\n>(({ className, ...props }, ref) => (\n <ToastPrimitives.Viewport\n ref={ref}\n className={cn(\n 'fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]',\n className\n )}\n {...props}\n />\n));\nToastViewport.displayName = ToastPrimitives.Viewport.displayName;\n\nconst toastVariants = cva(\n 'group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md p-4 pr-6 shadow-[0_0_10px_-15px_rgba(0,0,0,0.3)] backdrop-blur transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full',\n {\n variants: {\n variant: {\n error:\n 'bg-error/40 text-text dark:bg-error-dark/40 dark:text-text-dark',\n success:\n 'bg-success/30 text-text dark:bg-success-dark/30 dark:text-text-dark',\n default:\n 'bg-card/80 text-text dark:bg-card-dark/80 dark:text-text-dark',\n },\n },\n defaultVariants: {\n variant: 'default',\n },\n }\n);\n\nconst Toast = forwardRef<\n ElementRef<typeof ToastPrimitives.Root>,\n ComponentPropsWithoutRef<typeof ToastPrimitives.Root> &\n VariantProps<typeof toastVariants>\n>(({ className, variant, ...props }, ref) => {\n return (\n <ToastPrimitives.Root\n ref={ref}\n className={cn(toastVariants({ variant }), className)}\n {...props}\n />\n );\n});\nToast.displayName = ToastPrimitives.Root.displayName;\n\nconst ToastAction = forwardRef<\n ElementRef<typeof ToastPrimitives.Action>,\n ComponentPropsWithoutRef<typeof ToastPrimitives.Action>\n>(({ className, ...props }, ref) => (\n <ToastPrimitives.Action\n ref={ref}\n className={cn(\n 'hover:bg-text focus:ring-ring group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors focus:outline-none focus:ring-1 disabled:pointer-events-none disabled:opacity-50',\n className\n )}\n {...props}\n />\n));\nToastAction.displayName = ToastPrimitives.Action.displayName;\n\nconst ToastClose = forwardRef<\n ElementRef<typeof ToastPrimitives.Close>,\n ComponentPropsWithoutRef<typeof ToastPrimitives.Close>\n>(({ className, ...props }, ref) => (\n <ToastPrimitives.Close\n ref={ref}\n className={cn(\n 'text-text/50 hover:text-text/80 dark:text-text-dark/50 dark:hover:text-text-dark/80 absolute right-1 top-1 rounded-md p-1 opacity-0 transition-opacity focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600',\n className\n )}\n toast-close=\"\"\n {...props}\n >\n <X className=\"size-5\" />\n </ToastPrimitives.Close>\n));\nToastClose.displayName = ToastPrimitives.Close.displayName;\n\nconst ToastTitle = forwardRef<\n ElementRef<typeof ToastPrimitives.Title>,\n ComponentPropsWithoutRef<typeof ToastPrimitives.Title>\n>(({ className, ...props }, ref) => (\n <ToastPrimitives.Title\n ref={ref}\n className={cn('text-sm font-semibold [&+div]:text-xs', className)}\n {...props}\n />\n));\nToastTitle.displayName = ToastPrimitives.Title.displayName;\n\nconst ToastDescription = forwardRef<\n ElementRef<typeof ToastPrimitives.Description>,\n ComponentPropsWithoutRef<typeof ToastPrimitives.Description>\n>(({ className, ...props }, ref) => (\n <ToastPrimitives.Description\n ref={ref}\n className={cn('text-sm opacity-90', className)}\n {...props}\n />\n));\nToastDescription.displayName = ToastPrimitives.Description.displayName;\n\ntype ToastProps = ComponentPropsWithoutRef<typeof Toast>;\n\ntype ToastActionElement = ReactElement<typeof ToastAction>;\n\nexport {\n type ToastProps,\n type ToastActionElement,\n ToastProvider,\n ToastViewport,\n Toast,\n ToastTitle,\n ToastDescription,\n ToastClose,\n ToastAction,\n};\n"],"names":["jsx"],"mappings":";;;;;;;AAaA,MAAM,gBAAgB,gBAAgB;AAEhC,MAAA,gBAAgB,WAGpB,CAAC,EAAE,WAAW,GAAG,MAAA,GAAS,QAC1BA,kCAAA;AAAA,EAAC,gBAAgB;AAAA,EAAhB;AAAA,IACC;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG;AAAA,EAAA;AACN,CACD;AACD,cAAc,cAAc,gBAAgB,SAAS;AAErD,MAAM,gBAAgB;AAAA,EACpB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,OACE;AAAA,QACF,SACE;AAAA,QACF,SACE;AAAA,
|
|
1
|
+
{"version":3,"file":"Toast.mjs","sources":["../../../src/components/Toaster/Toast.tsx"],"sourcesContent":["'use client';\n\nimport * as ToastPrimitives from '@radix-ui/react-toast';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { X } from 'lucide-react';\nimport {\n forwardRef,\n type ReactElement,\n type ComponentPropsWithoutRef,\n type ElementRef,\n} from 'react';\nimport { cn } from '../../utils/cn';\n\nconst ToastProvider = ToastPrimitives.Provider;\n\nconst ToastViewport = forwardRef<\n ElementRef<typeof ToastPrimitives.Viewport>,\n ComponentPropsWithoutRef<typeof ToastPrimitives.Viewport>\n>(({ className, ...props }, ref) => (\n <ToastPrimitives.Viewport\n ref={ref}\n className={cn(\n 'fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]',\n className\n )}\n {...props}\n />\n));\nToastViewport.displayName = ToastPrimitives.Viewport.displayName;\n\nconst toastVariants = cva(\n 'group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md p-4 pr-6 shadow-[0_0_10px_-15px_rgba(0,0,0,0.3)] backdrop-blur transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full',\n {\n variants: {\n variant: {\n error:\n 'bg-error/40 text-text dark:bg-error-dark/40 dark:text-text-dark',\n success:\n 'bg-success/30 text-text dark:bg-success-dark/30 dark:text-text-dark',\n default:\n 'bg-card/80 text-text dark:bg-card-dark/80 dark:text-text-dark',\n },\n },\n defaultVariants: {\n variant: 'default',\n },\n }\n);\n\nconst Toast = forwardRef<\n ElementRef<typeof ToastPrimitives.Root>,\n ComponentPropsWithoutRef<typeof ToastPrimitives.Root> &\n VariantProps<typeof toastVariants>\n>(({ className, variant, ...props }, ref) => {\n return (\n <ToastPrimitives.Root\n ref={ref}\n className={cn(toastVariants({ variant }), className)}\n {...props}\n />\n );\n});\nToast.displayName = ToastPrimitives.Root.displayName;\n\nconst ToastAction = forwardRef<\n ElementRef<typeof ToastPrimitives.Action>,\n ComponentPropsWithoutRef<typeof ToastPrimitives.Action>\n>(({ className, ...props }, ref) => (\n <ToastPrimitives.Action\n ref={ref}\n className={cn(\n 'hover:bg-text focus:ring-ring group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors focus:outline-none focus:ring-1 disabled:pointer-events-none disabled:opacity-50',\n className\n )}\n {...props}\n />\n));\nToastAction.displayName = ToastPrimitives.Action.displayName;\n\nconst ToastClose = forwardRef<\n ElementRef<typeof ToastPrimitives.Close>,\n ComponentPropsWithoutRef<typeof ToastPrimitives.Close>\n>(({ className, ...props }, ref) => (\n <ToastPrimitives.Close\n ref={ref}\n className={cn(\n 'text-text/50 hover:text-text/80 dark:text-text-dark/50 dark:hover:text-text-dark/80 absolute right-1 top-1 rounded-md p-1 opacity-0 transition-opacity focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600',\n className\n )}\n toast-close=\"\"\n {...props}\n >\n <X className=\"size-5\" />\n </ToastPrimitives.Close>\n));\nToastClose.displayName = ToastPrimitives.Close.displayName;\n\nconst ToastTitle = forwardRef<\n ElementRef<typeof ToastPrimitives.Title>,\n ComponentPropsWithoutRef<typeof ToastPrimitives.Title>\n>(({ className, ...props }, ref) => (\n <ToastPrimitives.Title\n ref={ref}\n className={cn('text-sm font-semibold [&+div]:text-xs', className)}\n {...props}\n />\n));\nToastTitle.displayName = ToastPrimitives.Title.displayName;\n\nconst ToastDescription = forwardRef<\n ElementRef<typeof ToastPrimitives.Description>,\n ComponentPropsWithoutRef<typeof ToastPrimitives.Description>\n>(({ className, ...props }, ref) => (\n <ToastPrimitives.Description\n ref={ref}\n className={cn('text-sm opacity-90', className)}\n {...props}\n />\n));\nToastDescription.displayName = ToastPrimitives.Description.displayName;\n\ntype ToastProps = ComponentPropsWithoutRef<typeof Toast>;\n\ntype ToastActionElement = ReactElement<typeof ToastAction>;\n\nexport {\n type ToastProps,\n type ToastActionElement,\n ToastProvider,\n ToastViewport,\n Toast,\n ToastTitle,\n ToastDescription,\n ToastClose,\n ToastAction,\n};\n"],"names":["jsx"],"mappings":";;;;;;;AAaA,MAAM,gBAAgB,gBAAgB;AAEhC,MAAA,gBAAgB,WAGpB,CAAC,EAAE,WAAW,GAAG,MAAA,GAAS,QAC1BA,kCAAA;AAAA,EAAC,gBAAgB;AAAA,EAAhB;AAAA,IACC;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG;AAAA,EAAA;AACN,CACD;AACD,cAAc,cAAc,gBAAgB,SAAS;AAErD,MAAM,gBAAgB;AAAA,EACpB;AAAA,EAC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WAAW,cAAc,gBAAgB,MAAM;AAEzC,MAAA,mBAAmB,WAGvB,CAAC,EAAE,WAAW,GAAG,MAAA,GAAS,QAC1BA,kCAAA;AAAA,EAAC,gBAAgB;AAAA,EAAhB;AAAA,IACC;AAAA,IACA,WAAW,GAAG,sBAAsB,SAAS;AAAA,IAC5C,GAAG;AAAA,EAAA;AACN,CACD;AACD,iBAAiB,cAAc,gBAAgB,YAAY;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toaster.cjs","sources":["../../../src/components/Toaster/Toaster.tsx"],"sourcesContent":["'use client';\n\nimport {\n ToastProvider,\n Toast,\n ToastTitle,\n ToastDescription,\n ToastClose,\n ToastViewport,\n} from './Toast';\nimport { useToast } from './useToast';\n\nexport const Toaster = () => {\n const { toasts } = useToast();\n\n return (\n <ToastProvider>\n {toasts.map(({ id, title, description, action, ...props }) => (\n <Toast key={id} {...props}>\n <div className=\"grid gap-1\">\n {title && <ToastTitle>{title}</ToastTitle>}\n {description && <ToastDescription>{description}</ToastDescription>}\n </div>\n {action}\n <ToastClose />\n </Toast>\n ))}\n <ToastViewport />\n </ToastProvider>\n );\n};\n"],"names":["useToast","ToastProvider","jsxs","Toast","jsx","ToastTitle","ToastDescription","ToastClose","ToastViewport"],"mappings":";;;;;;AAYO,MAAM,UAAU,MAAM;AACrB,QAAA,EAAE,
|
|
1
|
+
{"version":3,"file":"Toaster.cjs","sources":["../../../src/components/Toaster/Toaster.tsx"],"sourcesContent":["'use client';\n\nimport {\n ToastProvider,\n Toast,\n ToastTitle,\n ToastDescription,\n ToastClose,\n ToastViewport,\n} from './Toast';\nimport { useToast } from './useToast';\n\nexport const Toaster = () => {\n const { toasts } = useToast();\n\n return (\n <ToastProvider>\n {toasts.map(({ id, title, description, action, ...props }) => (\n <Toast key={id} {...props}>\n <div className=\"grid gap-1\">\n {title && <ToastTitle>{title}</ToastTitle>}\n {description && <ToastDescription>{description}</ToastDescription>}\n </div>\n {action}\n <ToastClose />\n </Toast>\n ))}\n <ToastViewport />\n </ToastProvider>\n );\n};\n"],"names":["useToast","ToastProvider","jsxs","Toast","jsx","ToastTitle","ToastDescription","ToastClose","ToastViewport"],"mappings":";;;;;;AAYO,MAAM,UAAU,MAAM;AACrB,QAAA,EAAE,OAAO,IAAIA,qCAAS;AAE5B,2DACGC,wCACE,EAAA,UAAA;AAAA,IAAA,OAAO,IAAI,CAAC,EAAE,IAAI,OAAO,aAAa,QAAQ,GAAG,MAAM,MACrDC,2BAAAA,kBAAAA,KAAAC,yBAAAA,OAAA,EAAgB,GAAG,OAClB,UAAA;AAAA,MAACD,2BAAAA,kBAAAA,KAAA,OAAA,EAAI,WAAU,cACZ,UAAA;AAAA,QAAS,SAAAE,2BAAAA,kBAAAA,IAACC,yBAAAA,cAAY,UAAM,MAAA,CAAA;AAAA,QAC5B,eAAgBD,2BAAAA,kBAAAA,IAAAE,yBAAAA,kBAAA,EAAkB,UAAY,YAAA,CAAA;AAAA,MAAA,GACjD;AAAA,MACC;AAAA,uDACAC,yBAAW,YAAA,CAAA,CAAA;AAAA,IAAA,EAAA,GANF,EAOZ,CACD;AAAA,qDACAC,yBAAc,eAAA,CAAA,CAAA;AAAA,EAAA,GACjB;AAEJ;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toaster.mjs","sources":["../../../src/components/Toaster/Toaster.tsx"],"sourcesContent":["'use client';\n\nimport {\n ToastProvider,\n Toast,\n ToastTitle,\n ToastDescription,\n ToastClose,\n ToastViewport,\n} from './Toast';\nimport { useToast } from './useToast';\n\nexport const Toaster = () => {\n const { toasts } = useToast();\n\n return (\n <ToastProvider>\n {toasts.map(({ id, title, description, action, ...props }) => (\n <Toast key={id} {...props}>\n <div className=\"grid gap-1\">\n {title && <ToastTitle>{title}</ToastTitle>}\n {description && <ToastDescription>{description}</ToastDescription>}\n </div>\n {action}\n <ToastClose />\n </Toast>\n ))}\n <ToastViewport />\n </ToastProvider>\n );\n};\n"],"names":["jsxs","jsx"],"mappings":";;;;AAYO,MAAM,UAAU,MAAM;AACrB,QAAA,EAAE,
|
|
1
|
+
{"version":3,"file":"Toaster.mjs","sources":["../../../src/components/Toaster/Toaster.tsx"],"sourcesContent":["'use client';\n\nimport {\n ToastProvider,\n Toast,\n ToastTitle,\n ToastDescription,\n ToastClose,\n ToastViewport,\n} from './Toast';\nimport { useToast } from './useToast';\n\nexport const Toaster = () => {\n const { toasts } = useToast();\n\n return (\n <ToastProvider>\n {toasts.map(({ id, title, description, action, ...props }) => (\n <Toast key={id} {...props}>\n <div className=\"grid gap-1\">\n {title && <ToastTitle>{title}</ToastTitle>}\n {description && <ToastDescription>{description}</ToastDescription>}\n </div>\n {action}\n <ToastClose />\n </Toast>\n ))}\n <ToastViewport />\n </ToastProvider>\n );\n};\n"],"names":["jsxs","jsx"],"mappings":";;;;AAYO,MAAM,UAAU,MAAM;AACrB,QAAA,EAAE,OAAO,IAAI,SAAS;AAE5B,gDACG,eACE,EAAA,UAAA;AAAA,IAAA,OAAO,IAAI,CAAC,EAAE,IAAI,OAAO,aAAa,QAAQ,GAAG,MAAM,MACrDA,kCAAAA,KAAA,OAAA,EAAgB,GAAG,OAClB,UAAA;AAAA,MAACA,kCAAAA,KAAA,OAAA,EAAI,WAAU,cACZ,UAAA;AAAA,QAAS,SAAAC,kCAAAA,IAAC,cAAY,UAAM,MAAA,CAAA;AAAA,QAC5B,eAAgBA,kCAAAA,IAAA,kBAAA,EAAkB,UAAY,YAAA,CAAA;AAAA,MAAA,GACjD;AAAA,MACC;AAAA,4CACA,YAAW,CAAA,CAAA;AAAA,IAAA,EAAA,GANF,EAOZ,CACD;AAAA,0CACA,eAAc,CAAA,CAAA;AAAA,EAAA,GACjB;AAEJ;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useToast.cjs","sources":["../../../src/components/Toaster/useToast.tsx"],"sourcesContent":["'use client';\n\nimport { type ReactNode, useState, useEffect } from 'react';\nimport type { ToastProps, ToastActionElement } from './Toast';\n\nconst TOAST_LIMIT = 1;\nconst TOAST_REMOVE_DELAY = 15 * 60 * 1000; // 15 seconds\n\ntype ToasterToast = ToastProps & {\n id: string;\n title?: ReactNode;\n description?: ReactNode;\n action?: ToastActionElement;\n};\n\nenum ActionTypes {\n ADD_TOAST = 'ADD_TOAST',\n UPDATE_TOAST = 'UPDATE_TOAST',\n DISMISS_TOAST = 'DISMISS_TOAST',\n REMOVE_TOAST = 'REMOVE_TOAST',\n}\n\nlet count = 0;\n\nconst genId = () => {\n count = (count + 1) % Number.MAX_SAFE_INTEGER;\n return count.toString();\n};\n\ntype Action =\n | {\n type: ActionTypes.ADD_TOAST;\n toast: ToasterToast;\n }\n | {\n type: ActionTypes.UPDATE_TOAST;\n toast: Partial<ToasterToast>;\n }\n | {\n type: ActionTypes.DISMISS_TOAST;\n toastId?: ToasterToast['id'];\n }\n | {\n type: ActionTypes.REMOVE_TOAST;\n toastId?: ToasterToast['id'];\n };\n\ntype State = {\n toasts: ToasterToast[];\n};\n\nconst toastTimeouts = new Map<string, ReturnType<typeof setTimeout>>();\n\nconst addToRemoveQueue = (toastId: string) => {\n if (toastTimeouts.has(toastId)) {\n return;\n }\n\n const timeout = setTimeout(() => {\n toastTimeouts.delete(toastId);\n dispatch({\n type: ActionTypes.REMOVE_TOAST,\n toastId: toastId,\n });\n }, TOAST_REMOVE_DELAY);\n\n toastTimeouts.set(toastId, timeout);\n};\n\nexport const reducer = (state: State, action: Action): State => {\n switch (action.type) {\n case ActionTypes.ADD_TOAST:\n return {\n ...state,\n toasts: [action.toast, ...state.toasts].slice(0, TOAST_LIMIT),\n };\n\n case ActionTypes.UPDATE_TOAST:\n return {\n ...state,\n toasts: state.toasts.map((t) =>\n t.id === action.toast.id ? { ...t, ...action.toast } : t\n ),\n };\n\n case ActionTypes.DISMISS_TOAST: {\n const { toastId } = action;\n\n // ! Side effects ! - This could be extracted into a dismissToast() action,\n // but I'll keep it here for simplicity\n if (toastId) {\n addToRemoveQueue(toastId);\n } else {\n state.toasts.forEach((toast) => {\n addToRemoveQueue(toast.id);\n });\n }\n\n return {\n ...state,\n toasts: state.toasts.map((t) =>\n t.id === toastId || toastId === undefined\n ? {\n ...t,\n open: false,\n }\n : t\n ),\n };\n }\n case ActionTypes.REMOVE_TOAST:\n if (action.toastId === undefined) {\n return {\n ...state,\n toasts: [],\n };\n }\n return {\n ...state,\n toasts: state.toasts.filter((t) => t.id !== action.toastId),\n };\n }\n};\n\nconst listeners: ((state: State) => void)[] = [];\n\nlet memoryState: State = { toasts: [] };\n\nconst dispatch = (action: Action) => {\n memoryState = reducer(memoryState, action);\n listeners.forEach((listener) => {\n listener(memoryState);\n });\n};\n\ntype Toast = Omit<ToasterToast, 'id'>;\n\nconst toast = ({ ...props }: Toast) => {\n const id = genId();\n\n const update = (props: ToasterToast) =>\n dispatch({\n type: ActionTypes.UPDATE_TOAST,\n toast: { ...props, id },\n });\n const dismiss = () =>\n dispatch({ type: ActionTypes.DISMISS_TOAST, toastId: id });\n\n dispatch({\n type: ActionTypes.ADD_TOAST,\n toast: {\n ...props,\n id,\n open: true,\n onOpenChange: (open) => {\n if (!open) dismiss();\n },\n },\n });\n\n return {\n id: id,\n dismiss,\n update,\n };\n};\n\nconst useToast = () => {\n const [state, setState] = useState<State>(memoryState);\n\n useEffect(() => {\n listeners.push(setState);\n return () => {\n const index = listeners.indexOf(setState);\n if (index > -1) {\n listeners.splice(index, 1);\n }\n };\n }, [state]);\n\n return {\n ...state,\n toast,\n dismiss: (toastId?: string) =>\n dispatch({ type: ActionTypes.DISMISS_TOAST, toastId }),\n };\n};\n\nexport { useToast, toast };\n"],"names":["toast","props","useState","useEffect"],"mappings":";;;;AAKA,MAAM,cAAc;AACpB,MAAM,qBAAqB,KAAK,KAAK;AAgBrC,IAAI,QAAQ;AAEZ,MAAM,QAAQ,MAAM;AACT,WAAA,QAAQ,KAAK,OAAO;AAC7B,SAAO,MAAM;
|
|
1
|
+
{"version":3,"file":"useToast.cjs","sources":["../../../src/components/Toaster/useToast.tsx"],"sourcesContent":["'use client';\n\nimport { type ReactNode, useState, useEffect } from 'react';\nimport type { ToastProps, ToastActionElement } from './Toast';\n\nconst TOAST_LIMIT = 1;\nconst TOAST_REMOVE_DELAY = 15 * 60 * 1000; // 15 seconds\n\ntype ToasterToast = ToastProps & {\n id: string;\n title?: ReactNode;\n description?: ReactNode;\n action?: ToastActionElement;\n};\n\nenum ActionTypes {\n ADD_TOAST = 'ADD_TOAST',\n UPDATE_TOAST = 'UPDATE_TOAST',\n DISMISS_TOAST = 'DISMISS_TOAST',\n REMOVE_TOAST = 'REMOVE_TOAST',\n}\n\nlet count = 0;\n\nconst genId = () => {\n count = (count + 1) % Number.MAX_SAFE_INTEGER;\n return count.toString();\n};\n\ntype Action =\n | {\n type: ActionTypes.ADD_TOAST;\n toast: ToasterToast;\n }\n | {\n type: ActionTypes.UPDATE_TOAST;\n toast: Partial<ToasterToast>;\n }\n | {\n type: ActionTypes.DISMISS_TOAST;\n toastId?: ToasterToast['id'];\n }\n | {\n type: ActionTypes.REMOVE_TOAST;\n toastId?: ToasterToast['id'];\n };\n\ntype State = {\n toasts: ToasterToast[];\n};\n\nconst toastTimeouts = new Map<string, ReturnType<typeof setTimeout>>();\n\nconst addToRemoveQueue = (toastId: string) => {\n if (toastTimeouts.has(toastId)) {\n return;\n }\n\n const timeout = setTimeout(() => {\n toastTimeouts.delete(toastId);\n dispatch({\n type: ActionTypes.REMOVE_TOAST,\n toastId: toastId,\n });\n }, TOAST_REMOVE_DELAY);\n\n toastTimeouts.set(toastId, timeout);\n};\n\nexport const reducer = (state: State, action: Action): State => {\n switch (action.type) {\n case ActionTypes.ADD_TOAST:\n return {\n ...state,\n toasts: [action.toast, ...state.toasts].slice(0, TOAST_LIMIT),\n };\n\n case ActionTypes.UPDATE_TOAST:\n return {\n ...state,\n toasts: state.toasts.map((t) =>\n t.id === action.toast.id ? { ...t, ...action.toast } : t\n ),\n };\n\n case ActionTypes.DISMISS_TOAST: {\n const { toastId } = action;\n\n // ! Side effects ! - This could be extracted into a dismissToast() action,\n // but I'll keep it here for simplicity\n if (toastId) {\n addToRemoveQueue(toastId);\n } else {\n state.toasts.forEach((toast) => {\n addToRemoveQueue(toast.id);\n });\n }\n\n return {\n ...state,\n toasts: state.toasts.map((t) =>\n t.id === toastId || toastId === undefined\n ? {\n ...t,\n open: false,\n }\n : t\n ),\n };\n }\n case ActionTypes.REMOVE_TOAST:\n if (action.toastId === undefined) {\n return {\n ...state,\n toasts: [],\n };\n }\n return {\n ...state,\n toasts: state.toasts.filter((t) => t.id !== action.toastId),\n };\n }\n};\n\nconst listeners: ((state: State) => void)[] = [];\n\nlet memoryState: State = { toasts: [] };\n\nconst dispatch = (action: Action) => {\n memoryState = reducer(memoryState, action);\n listeners.forEach((listener) => {\n listener(memoryState);\n });\n};\n\ntype Toast = Omit<ToasterToast, 'id'>;\n\nconst toast = ({ ...props }: Toast) => {\n const id = genId();\n\n const update = (props: ToasterToast) =>\n dispatch({\n type: ActionTypes.UPDATE_TOAST,\n toast: { ...props, id },\n });\n const dismiss = () =>\n dispatch({ type: ActionTypes.DISMISS_TOAST, toastId: id });\n\n dispatch({\n type: ActionTypes.ADD_TOAST,\n toast: {\n ...props,\n id,\n open: true,\n onOpenChange: (open) => {\n if (!open) dismiss();\n },\n },\n });\n\n return {\n id: id,\n dismiss,\n update,\n };\n};\n\nconst useToast = () => {\n const [state, setState] = useState<State>(memoryState);\n\n useEffect(() => {\n listeners.push(setState);\n return () => {\n const index = listeners.indexOf(setState);\n if (index > -1) {\n listeners.splice(index, 1);\n }\n };\n }, [state]);\n\n return {\n ...state,\n toast,\n dismiss: (toastId?: string) =>\n dispatch({ type: ActionTypes.DISMISS_TOAST, toastId }),\n };\n};\n\nexport { useToast, toast };\n"],"names":["toast","props","useState","useEffect"],"mappings":";;;;AAKA,MAAM,cAAc;AACpB,MAAM,qBAAqB,KAAK,KAAK;AAgBrC,IAAI,QAAQ;AAEZ,MAAM,QAAQ,MAA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,YACR,SAAS,EAAE,MAAM,iBAA2B,QAAS,CAAA;AAAA,EACzD;AACF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useToast.mjs","sources":["../../../src/components/Toaster/useToast.tsx"],"sourcesContent":["'use client';\n\nimport { type ReactNode, useState, useEffect } from 'react';\nimport type { ToastProps, ToastActionElement } from './Toast';\n\nconst TOAST_LIMIT = 1;\nconst TOAST_REMOVE_DELAY = 15 * 60 * 1000; // 15 seconds\n\ntype ToasterToast = ToastProps & {\n id: string;\n title?: ReactNode;\n description?: ReactNode;\n action?: ToastActionElement;\n};\n\nenum ActionTypes {\n ADD_TOAST = 'ADD_TOAST',\n UPDATE_TOAST = 'UPDATE_TOAST',\n DISMISS_TOAST = 'DISMISS_TOAST',\n REMOVE_TOAST = 'REMOVE_TOAST',\n}\n\nlet count = 0;\n\nconst genId = () => {\n count = (count + 1) % Number.MAX_SAFE_INTEGER;\n return count.toString();\n};\n\ntype Action =\n | {\n type: ActionTypes.ADD_TOAST;\n toast: ToasterToast;\n }\n | {\n type: ActionTypes.UPDATE_TOAST;\n toast: Partial<ToasterToast>;\n }\n | {\n type: ActionTypes.DISMISS_TOAST;\n toastId?: ToasterToast['id'];\n }\n | {\n type: ActionTypes.REMOVE_TOAST;\n toastId?: ToasterToast['id'];\n };\n\ntype State = {\n toasts: ToasterToast[];\n};\n\nconst toastTimeouts = new Map<string, ReturnType<typeof setTimeout>>();\n\nconst addToRemoveQueue = (toastId: string) => {\n if (toastTimeouts.has(toastId)) {\n return;\n }\n\n const timeout = setTimeout(() => {\n toastTimeouts.delete(toastId);\n dispatch({\n type: ActionTypes.REMOVE_TOAST,\n toastId: toastId,\n });\n }, TOAST_REMOVE_DELAY);\n\n toastTimeouts.set(toastId, timeout);\n};\n\nexport const reducer = (state: State, action: Action): State => {\n switch (action.type) {\n case ActionTypes.ADD_TOAST:\n return {\n ...state,\n toasts: [action.toast, ...state.toasts].slice(0, TOAST_LIMIT),\n };\n\n case ActionTypes.UPDATE_TOAST:\n return {\n ...state,\n toasts: state.toasts.map((t) =>\n t.id === action.toast.id ? { ...t, ...action.toast } : t\n ),\n };\n\n case ActionTypes.DISMISS_TOAST: {\n const { toastId } = action;\n\n // ! Side effects ! - This could be extracted into a dismissToast() action,\n // but I'll keep it here for simplicity\n if (toastId) {\n addToRemoveQueue(toastId);\n } else {\n state.toasts.forEach((toast) => {\n addToRemoveQueue(toast.id);\n });\n }\n\n return {\n ...state,\n toasts: state.toasts.map((t) =>\n t.id === toastId || toastId === undefined\n ? {\n ...t,\n open: false,\n }\n : t\n ),\n };\n }\n case ActionTypes.REMOVE_TOAST:\n if (action.toastId === undefined) {\n return {\n ...state,\n toasts: [],\n };\n }\n return {\n ...state,\n toasts: state.toasts.filter((t) => t.id !== action.toastId),\n };\n }\n};\n\nconst listeners: ((state: State) => void)[] = [];\n\nlet memoryState: State = { toasts: [] };\n\nconst dispatch = (action: Action) => {\n memoryState = reducer(memoryState, action);\n listeners.forEach((listener) => {\n listener(memoryState);\n });\n};\n\ntype Toast = Omit<ToasterToast, 'id'>;\n\nconst toast = ({ ...props }: Toast) => {\n const id = genId();\n\n const update = (props: ToasterToast) =>\n dispatch({\n type: ActionTypes.UPDATE_TOAST,\n toast: { ...props, id },\n });\n const dismiss = () =>\n dispatch({ type: ActionTypes.DISMISS_TOAST, toastId: id });\n\n dispatch({\n type: ActionTypes.ADD_TOAST,\n toast: {\n ...props,\n id,\n open: true,\n onOpenChange: (open) => {\n if (!open) dismiss();\n },\n },\n });\n\n return {\n id: id,\n dismiss,\n update,\n };\n};\n\nconst useToast = () => {\n const [state, setState] = useState<State>(memoryState);\n\n useEffect(() => {\n listeners.push(setState);\n return () => {\n const index = listeners.indexOf(setState);\n if (index > -1) {\n listeners.splice(index, 1);\n }\n };\n }, [state]);\n\n return {\n ...state,\n toast,\n dismiss: (toastId?: string) =>\n dispatch({ type: ActionTypes.DISMISS_TOAST, toastId }),\n };\n};\n\nexport { useToast, toast };\n"],"names":["toast","props"],"mappings":";;AAKA,MAAM,cAAc;AACpB,MAAM,qBAAqB,KAAK,KAAK;AAgBrC,IAAI,QAAQ;AAEZ,MAAM,QAAQ,MAAM;AACT,WAAA,QAAQ,KAAK,OAAO;AAC7B,SAAO,MAAM;
|
|
1
|
+
{"version":3,"file":"useToast.mjs","sources":["../../../src/components/Toaster/useToast.tsx"],"sourcesContent":["'use client';\n\nimport { type ReactNode, useState, useEffect } from 'react';\nimport type { ToastProps, ToastActionElement } from './Toast';\n\nconst TOAST_LIMIT = 1;\nconst TOAST_REMOVE_DELAY = 15 * 60 * 1000; // 15 seconds\n\ntype ToasterToast = ToastProps & {\n id: string;\n title?: ReactNode;\n description?: ReactNode;\n action?: ToastActionElement;\n};\n\nenum ActionTypes {\n ADD_TOAST = 'ADD_TOAST',\n UPDATE_TOAST = 'UPDATE_TOAST',\n DISMISS_TOAST = 'DISMISS_TOAST',\n REMOVE_TOAST = 'REMOVE_TOAST',\n}\n\nlet count = 0;\n\nconst genId = () => {\n count = (count + 1) % Number.MAX_SAFE_INTEGER;\n return count.toString();\n};\n\ntype Action =\n | {\n type: ActionTypes.ADD_TOAST;\n toast: ToasterToast;\n }\n | {\n type: ActionTypes.UPDATE_TOAST;\n toast: Partial<ToasterToast>;\n }\n | {\n type: ActionTypes.DISMISS_TOAST;\n toastId?: ToasterToast['id'];\n }\n | {\n type: ActionTypes.REMOVE_TOAST;\n toastId?: ToasterToast['id'];\n };\n\ntype State = {\n toasts: ToasterToast[];\n};\n\nconst toastTimeouts = new Map<string, ReturnType<typeof setTimeout>>();\n\nconst addToRemoveQueue = (toastId: string) => {\n if (toastTimeouts.has(toastId)) {\n return;\n }\n\n const timeout = setTimeout(() => {\n toastTimeouts.delete(toastId);\n dispatch({\n type: ActionTypes.REMOVE_TOAST,\n toastId: toastId,\n });\n }, TOAST_REMOVE_DELAY);\n\n toastTimeouts.set(toastId, timeout);\n};\n\nexport const reducer = (state: State, action: Action): State => {\n switch (action.type) {\n case ActionTypes.ADD_TOAST:\n return {\n ...state,\n toasts: [action.toast, ...state.toasts].slice(0, TOAST_LIMIT),\n };\n\n case ActionTypes.UPDATE_TOAST:\n return {\n ...state,\n toasts: state.toasts.map((t) =>\n t.id === action.toast.id ? { ...t, ...action.toast } : t\n ),\n };\n\n case ActionTypes.DISMISS_TOAST: {\n const { toastId } = action;\n\n // ! Side effects ! - This could be extracted into a dismissToast() action,\n // but I'll keep it here for simplicity\n if (toastId) {\n addToRemoveQueue(toastId);\n } else {\n state.toasts.forEach((toast) => {\n addToRemoveQueue(toast.id);\n });\n }\n\n return {\n ...state,\n toasts: state.toasts.map((t) =>\n t.id === toastId || toastId === undefined\n ? {\n ...t,\n open: false,\n }\n : t\n ),\n };\n }\n case ActionTypes.REMOVE_TOAST:\n if (action.toastId === undefined) {\n return {\n ...state,\n toasts: [],\n };\n }\n return {\n ...state,\n toasts: state.toasts.filter((t) => t.id !== action.toastId),\n };\n }\n};\n\nconst listeners: ((state: State) => void)[] = [];\n\nlet memoryState: State = { toasts: [] };\n\nconst dispatch = (action: Action) => {\n memoryState = reducer(memoryState, action);\n listeners.forEach((listener) => {\n listener(memoryState);\n });\n};\n\ntype Toast = Omit<ToasterToast, 'id'>;\n\nconst toast = ({ ...props }: Toast) => {\n const id = genId();\n\n const update = (props: ToasterToast) =>\n dispatch({\n type: ActionTypes.UPDATE_TOAST,\n toast: { ...props, id },\n });\n const dismiss = () =>\n dispatch({ type: ActionTypes.DISMISS_TOAST, toastId: id });\n\n dispatch({\n type: ActionTypes.ADD_TOAST,\n toast: {\n ...props,\n id,\n open: true,\n onOpenChange: (open) => {\n if (!open) dismiss();\n },\n },\n });\n\n return {\n id: id,\n dismiss,\n update,\n };\n};\n\nconst useToast = () => {\n const [state, setState] = useState<State>(memoryState);\n\n useEffect(() => {\n listeners.push(setState);\n return () => {\n const index = listeners.indexOf(setState);\n if (index > -1) {\n listeners.splice(index, 1);\n }\n };\n }, [state]);\n\n return {\n ...state,\n toast,\n dism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AAQ;AACxC,UAAI,QAAQ,IAAI;AACJ,kBAAA,OAAO,OAAO,CAAC;AAAA,MAAA;AAAA,IAE7B;AAAA,EAAA,GACC,CAAC,KAAK,CAAC;AAEH,SAAA;AAAA,IACL,GAAG;AAAA,IACH;AAAA,IACA,SAAS,CAAC,YACR,SAAS,EAAE,MAAM,iBAA2B,QAAS,CAAA;AAAA,EACzD;AACF;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../src/components/WithResizer/index.tsx"],"sourcesContent":["/* eslint-disable jsx-a11y/no-static-element-interactions */\n'use client';\n\nimport React, {\n useState,\n useCallback,\n type PropsWithChildren,\n useEffect,\n type FC,\n useRef,\n} from 'react';\nimport { cn } from '../../utils/cn';\n\ntype WithResizerProps = {\n initialWidth: number;\n maxWidth?: number;\n minWidth?: number;\n};\n\nexport const WithResizer: FC<PropsWithChildren<WithResizerProps>> = ({\n initialWidth,\n maxWidth,\n minWidth = 0,\n children,\n}) => {\n const containerRef = useRef<HTMLDivElement>(null);\n const [width, setWidth] = useState(initialWidth);\n const [isResizing, setIsResizing] = useState(false);\n\n // Handler to start resizing\n const startResizing = useCallback(\n (\n mouseDownEvent:\n | React.MouseEvent<HTMLDivElement>\n | React.TouchEvent<HTMLDivElement>\n ) => {\n setIsResizing(true);\n mouseDownEvent.preventDefault();\n },\n []\n );\n\n // Handler to stop resizing\n const stopResizing = useCallback(() => {\n setIsResizing(false);\n }, []);\n\n // Handler to resize the div\n const resize = useCallback(\n (mouseMoveEvent: MouseEvent | TouchEvent) => {\n const container = containerRef.current;\n if (isResizing && container && parent) {\n const { left: containerLeft } = container.getBoundingClientRect();\n\n let clientX = 0;\n if (mouseMoveEvent instanceof MouseEvent) {\n clientX = mouseMoveEvent.clientX;\n } else if (mouseMoveEvent instanceof TouchEvent) {\n clientX = mouseMoveEvent.touches[0].clientX;\n }\n\n const newWidth = clientX - containerLeft;\n const correctedWidth = Math.max(newWidth, 0);\n\n setWidth(correctedWidth);\n }\n },\n [isResizing]\n );\n\n // Add event listeners for mouse move and mouse up\n useEffect(() => {\n window.addEventListener('mousemove', resize);\n window.addEventListener('mouseup', stopResizing);\n window.addEventListener('touchmove', resize);\n window.addEventListener('touchend', stopResizing);\n\n return () => {\n window.removeEventListener('mousemove', resize);\n window.removeEventListener('mouseup', stopResizing);\n window.removeEventListener('touchmove', resize);\n window.removeEventListener('touchend', stopResizing);\n };\n }, [resize, stopResizing]);\n\n return (\n <div\n className={cn(\n minWidth && `max-w-[${maxWidth}px]`,\n maxWidth && `min-w-[${minWidth}px]`,\n 'relative h-full w-full max-w-[80%] cursor-ew-resize border-r-[2px] border-neutral-200 transition dark:border-neutral-950',\n 'after:absolute after:right-0 after:top-1/2 after:block after:h-10 after:w-2 after:-translate-y-1/2 after:translate-x-1/2 after:transform after:cursor-ew-resize after:rounded-full after:bg-neutral-200 after:transition after:content-[\"\"] after:dark:bg-neutral-950',\n 'active:border-neutral-400 after:active:bg-neutral-400 dark:active:border-neutral-600 dark:after:active:bg-neutral-600'\n )}\n style={{\n width: `${width}px`,\n }}\n ref={containerRef}\n onMouseDown={startResizing}\n onTouchStart={startResizing}\n aria-valuemin={minWidth}\n aria-valuemax={maxWidth}\n aria-valuenow={width}\n aria-label=\"Resizable component\"\n role=\"slider\"\n tabIndex={0}\n >\n <div\n className=\"absolute left-0 top-0 size-full cursor-default overflow-hidden\"\n onMouseDown={(e) => e.stopPropagation()}\n onTouchStart={(e) => e.stopPropagation()}\n >\n {children}\n </div>\n </div>\n );\n};\n"],"names":["useRef","useState","useCallback","useEffect","jsx","cn"],"mappings":";;;;;;AAmBO,MAAM,cAAuD,CAAC;AAAA,EACnE;AAAA,EACA;AAAA,EACA,WAAW;AAAA,EACX;AACF,MAAM;AACE,QAAA,eAAeA,kBAAuB,IAAI;AAChD,QAAM,CAAC,OAAO,QAAQ,IAAIC,
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../src/components/WithResizer/index.tsx"],"sourcesContent":["/* eslint-disable jsx-a11y/no-static-element-interactions */\n'use client';\n\nimport React, {\n useState,\n useCallback,\n type PropsWithChildren,\n useEffect,\n type FC,\n useRef,\n} from 'react';\nimport { cn } from '../../utils/cn';\n\ntype WithResizerProps = {\n initialWidth: number;\n maxWidth?: number;\n minWidth?: number;\n};\n\nexport const WithResizer: FC<PropsWithChildren<WithResizerProps>> = ({\n initialWidth,\n maxWidth,\n minWidth = 0,\n children,\n}) => {\n const containerRef = useRef<HTMLDivElement>(null);\n const [width, setWidth] = useState(initialWidth);\n const [isResizing, setIsResizing] = useState(false);\n\n // Handler to start resizing\n const startResizing = useCallback(\n (\n mouseDownEvent:\n | React.MouseEvent<HTMLDivElement>\n | React.TouchEvent<HTMLDivElement>\n ) => {\n setIsResizing(true);\n mouseDownEvent.preventDefault();\n },\n []\n );\n\n // Handler to stop resizing\n const stopResizing = useCallback(() => {\n setIsResizing(false);\n }, []);\n\n // Handler to resize the div\n const resize = useCallback(\n (mouseMoveEvent: MouseEvent | TouchEvent) => {\n const container = containerRef.current;\n if (isResizing && container && parent) {\n const { left: containerLeft } = container.getBoundingClientRect();\n\n let clientX = 0;\n if (mouseMoveEvent instanceof MouseEvent) {\n clientX = mouseMoveEvent.clientX;\n } else if (mouseMoveEvent instanceof TouchEvent) {\n clientX = mouseMoveEvent.touches[0].clientX;\n }\n\n const newWidth = clientX - containerLeft;\n const correctedWidth = Math.max(newWidth, 0);\n\n setWidth(correctedWidth);\n }\n },\n [isResizing]\n );\n\n // Add event listeners for mouse move and mouse up\n useEffect(() => {\n window.addEventListener('mousemove', resize);\n window.addEventListener('mouseup', stopResizing);\n window.addEventListener('touchmove', resize);\n window.addEventListener('touchend', stopResizing);\n\n return () => {\n window.removeEventListener('mousemove', resize);\n window.removeEventListener('mouseup', stopResizing);\n window.removeEventListener('touchmove', resize);\n window.removeEventListener('touchend', stopResizing);\n };\n }, [resize, stopResizing]);\n\n return (\n <div\n className={cn(\n minWidth && `max-w-[${maxWidth}px]`,\n maxWidth && `min-w-[${minWidth}px]`,\n 'relative h-full w-full max-w-[80%] cursor-ew-resize border-r-[2px] border-neutral-200 transition dark:border-neutral-950',\n 'after:absolute after:right-0 after:top-1/2 after:block after:h-10 after:w-2 after:-translate-y-1/2 after:translate-x-1/2 after:transform after:cursor-ew-resize after:rounded-full after:bg-neutral-200 after:transition after:content-[\"\"] after:dark:bg-neutral-950',\n 'active:border-neutral-400 after:active:bg-neutral-400 dark:active:border-neutral-600 dark:after:active:bg-neutral-600'\n )}\n style={{\n width: `${width}px`,\n }}\n ref={containerRef}\n onMouseDown={startResizing}\n onTouchStart={startResizing}\n aria-valuemin={minWidth}\n aria-valuemax={maxWidth}\n aria-valuenow={width}\n aria-label=\"Resizable component\"\n role=\"slider\"\n tabIndex={0}\n >\n <div\n className=\"absolute left-0 top-0 size-full cursor-default overflow-hidden\"\n onMouseDown={(e) => e.stopPropagation()}\n onTouchStart={(e) => e.stopPropagation()}\n >\n {children}\n </div>\n </div>\n );\n};\n"],"names":["useRef","useState","useCallback","useEffect","jsx","cn"],"mappings":";;;;;;AAmBO,MAAM,cAAuD,CAAC;AAAA,EACnE;AAAA,EACA;AAAA,EACA,WAAW;AAAA,EACX;AACF,MAAM;AACE,QAAA,eAAeA,kBAAuB,IAAI;AAChD,QAAM,CAAC,OAAO,QAAQ,IAAIC,WAAAA,SAAS,YAAY;AAC/C,QAAM,CAAC,YAAY,aAAa,IAAIA,WAAAA,SAAS,KAAK;AAGlD,QAAM,gBAAgBC,WAAA;AAAA,IACpB,CACE,mBAGG;AACH,oBAAc,IAAI;AAClB,qBAAe,eAAe;AAAA,IAChC;AAAA,IACA,CAAA;AAAA,EACF;AAGM,QAAA,eAAeA,WAAAA,YAAY,MAAM;AACrC,kBAAc,KAAK;AAAA,EACrB,GAAG,EAAE;AAGL,QAAM,SAASA,WAAA;AAAA,IACb,CAAC,mBAA4C;AAC3C,YAAM,YAAY,aAAa;AAC3B,UAAA,cAAc,aAAa,QAAQ;AACrC,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CAAC,MAAM,EAAE,gBAAgB;AAAA,UAEtC;AAAA,QAAA;AAAA,MAAA;AAAA,IACH;AAAA,EACF;AAEJ;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../src/components/WithResizer/index.tsx"],"sourcesContent":["/* eslint-disable jsx-a11y/no-static-element-interactions */\n'use client';\n\nimport React, {\n useState,\n useCallback,\n type PropsWithChildren,\n useEffect,\n type FC,\n useRef,\n} from 'react';\nimport { cn } from '../../utils/cn';\n\ntype WithResizerProps = {\n initialWidth: number;\n maxWidth?: number;\n minWidth?: number;\n};\n\nexport const WithResizer: FC<PropsWithChildren<WithResizerProps>> = ({\n initialWidth,\n maxWidth,\n minWidth = 0,\n children,\n}) => {\n const containerRef = useRef<HTMLDivElement>(null);\n const [width, setWidth] = useState(initialWidth);\n const [isResizing, setIsResizing] = useState(false);\n\n // Handler to start resizing\n const startResizing = useCallback(\n (\n mouseDownEvent:\n | React.MouseEvent<HTMLDivElement>\n | React.TouchEvent<HTMLDivElement>\n ) => {\n setIsResizing(true);\n mouseDownEvent.preventDefault();\n },\n []\n );\n\n // Handler to stop resizing\n const stopResizing = useCallback(() => {\n setIsResizing(false);\n }, []);\n\n // Handler to resize the div\n const resize = useCallback(\n (mouseMoveEvent: MouseEvent | TouchEvent) => {\n const container = containerRef.current;\n if (isResizing && container && parent) {\n const { left: containerLeft } = container.getBoundingClientRect();\n\n let clientX = 0;\n if (mouseMoveEvent instanceof MouseEvent) {\n clientX = mouseMoveEvent.clientX;\n } else if (mouseMoveEvent instanceof TouchEvent) {\n clientX = mouseMoveEvent.touches[0].clientX;\n }\n\n const newWidth = clientX - containerLeft;\n const correctedWidth = Math.max(newWidth, 0);\n\n setWidth(correctedWidth);\n }\n },\n [isResizing]\n );\n\n // Add event listeners for mouse move and mouse up\n useEffect(() => {\n window.addEventListener('mousemove', resize);\n window.addEventListener('mouseup', stopResizing);\n window.addEventListener('touchmove', resize);\n window.addEventListener('touchend', stopResizing);\n\n return () => {\n window.removeEventListener('mousemove', resize);\n window.removeEventListener('mouseup', stopResizing);\n window.removeEventListener('touchmove', resize);\n window.removeEventListener('touchend', stopResizing);\n };\n }, [resize, stopResizing]);\n\n return (\n <div\n className={cn(\n minWidth && `max-w-[${maxWidth}px]`,\n maxWidth && `min-w-[${minWidth}px]`,\n 'relative h-full w-full max-w-[80%] cursor-ew-resize border-r-[2px] border-neutral-200 transition dark:border-neutral-950',\n 'after:absolute after:right-0 after:top-1/2 after:block after:h-10 after:w-2 after:-translate-y-1/2 after:translate-x-1/2 after:transform after:cursor-ew-resize after:rounded-full after:bg-neutral-200 after:transition after:content-[\"\"] after:dark:bg-neutral-950',\n 'active:border-neutral-400 after:active:bg-neutral-400 dark:active:border-neutral-600 dark:after:active:bg-neutral-600'\n )}\n style={{\n width: `${width}px`,\n }}\n ref={containerRef}\n onMouseDown={startResizing}\n onTouchStart={startResizing}\n aria-valuemin={minWidth}\n aria-valuemax={maxWidth}\n aria-valuenow={width}\n aria-label=\"Resizable component\"\n role=\"slider\"\n tabIndex={0}\n >\n <div\n className=\"absolute left-0 top-0 size-full cursor-default overflow-hidden\"\n onMouseDown={(e) => e.stopPropagation()}\n onTouchStart={(e) => e.stopPropagation()}\n >\n {children}\n </div>\n </div>\n );\n};\n"],"names":["jsx"],"mappings":";;;;AAmBO,MAAM,cAAuD,CAAC;AAAA,EACnE;AAAA,EACA;AAAA,EACA,WAAW;AAAA,EACX;AACF,MAAM;AACE,QAAA,eAAe,OAAuB,IAAI;AAChD,QAAM,CAAC,OAAO,QAAQ,IAAI,SAAS,YAAY;AAC/C,QAAM,CAAC,YAAY,aAAa,IAAI,SAAS,KAAK;AAGlD,QAAM,gBAAgB;AAAA,IACpB,CACE,mBAGG;AACH,oBAAc,IAAI;AAClB,qBAAe,eAAe;AAAA,IAChC;AAAA,IACA,
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../src/components/WithResizer/index.tsx"],"sourcesContent":["/* eslint-disable jsx-a11y/no-static-element-interactions */\n'use client';\n\nimport React, {\n useState,\n useCallback,\n type PropsWithChildren,\n useEffect,\n type FC,\n useRef,\n} from 'react';\nimport { cn } from '../../utils/cn';\n\ntype WithResizerProps = {\n initialWidth: number;\n maxWidth?: number;\n minWidth?: number;\n};\n\nexport const WithResizer: FC<PropsWithChildren<WithResizerProps>> = ({\n initialWidth,\n maxWidth,\n minWidth = 0,\n children,\n}) => {\n const containerRef = useRef<HTMLDivElement>(null);\n const [width, setWidth] = useState(initialWidth);\n const [isResizing, setIsResizing] = useState(false);\n\n // Handler to start resizing\n const startResizing = useCallback(\n (\n mouseDownEvent:\n | React.MouseEvent<HTMLDivElement>\n | React.TouchEvent<HTMLDivElement>\n ) => {\n setIsResizing(true);\n mouseDownEvent.preventDefault();\n },\n []\n );\n\n // Handler to stop resizing\n const stopResizing = useCallback(() => {\n setIsResizing(false);\n }, []);\n\n // Handler to resize the div\n const resize = useCallback(\n (mouseMoveEvent: MouseEvent | TouchEvent) => {\n const container = containerRef.current;\n if (isResizing && container && parent) {\n const { left: containerLeft } = container.getBoundingClientRect();\n\n let clientX = 0;\n if (mouseMoveEvent instanceof MouseEvent) {\n clientX = mouseMoveEvent.clientX;\n } else if (mouseMoveEvent instanceof TouchEvent) {\n clientX = mouseMoveEvent.touches[0].clientX;\n }\n\n const newWidth = clientX - containerLeft;\n const correctedWidth = Math.max(newWidth, 0);\n\n setWidth(correctedWidth);\n }\n },\n [isResizing]\n );\n\n // Add event listeners for mouse move and mouse up\n useEffect(() => {\n window.addEventListener('mousemove', resize);\n window.addEventListener('mouseup', stopResizing);\n window.addEventListener('touchmove', resize);\n window.addEventListener('touchend', stopResizing);\n\n return () => {\n window.removeEventListener('mousemove', resize);\n window.removeEventListener('mouseup', stopResizing);\n window.removeEventListener('touchmove', resize);\n window.removeEventListener('touchend', stopResizing);\n };\n }, [resize, stopResizing]);\n\n return (\n <div\n className={cn(\n minWidth && `max-w-[${maxWidth}px]`,\n maxWidth && `min-w-[${minWidth}px]`,\n 'relative h-full w-full max-w-[80%] cursor-ew-resize border-r-[2px] border-neutral-200 transition dark:border-neutral-950',\n 'after:absolute after:right-0 after:top-1/2 after:block after:h-10 after:w-2 after:-translate-y-1/2 after:translate-x-1/2 after:transform after:cursor-ew-resize after:rounded-full after:bg-neutral-200 after:transition after:content-[\"\"] after:dark:bg-neutral-950',\n 'active:border-neutral-400 after:active:bg-neutral-400 dark:active:border-neutral-600 dark:after:active:bg-neutral-600'\n )}\n style={{\n width: `${width}px`,\n }}\n ref={containerRef}\n onMouseDown={startResizing}\n onTouchStart={startResizing}\n aria-valuemin={minWidth}\n aria-valuemax={maxWidth}\n aria-valuenow={width}\n aria-label=\"Resizable component\"\n role=\"slider\"\n tabIndex={0}\n >\n <div\n className=\"absolute left-0 top-0 size-full cursor-default overflow-hidden\"\n onMouseDown={(e) => e.stopPropagation()}\n onTouchStart={(e) => e.stopPropagation()}\n >\n {children}\n </div>\n </div>\n );\n};\n"],"names":["jsx"],"mappings":";;;;AAmBO,MAAM,cAAuD,CAAC;AAAA,EACnE;AAAA,EACA;AAAA,EACA,WAAW;AAAA,EACX;AACF,MAAM;AACE,QAAA,eAAe,OAAuB,IAAI;AAChD,QAAM,CAAC,OAAO,QAAQ,IAAI,SAAS,YAAY;AAC/C,QAAM,CAAC,YAAY,aAAa,IAAI,SAAS,KAAK;AAGlD,QAAM,gBAAgB;AAAA,IACpB,CACE,mBAGG;AACH,oBAAc,IAAI;AAClB,qBAAe,eAAe;AAAA,IAChC;AAAA,IACA,CAAA;AAAA,EACF;AAGM,QAAA,eAAe,YAAY,MAAM;AACrC,kBAAc,KAAK;AAAA,EACrB,GAAG,EAAE;AAGL,QAAM,SAAS;AAAA,IACb,CAAC,mBAA4C;AAC3C,YAAM,YAAY,aAAa;AAC3B,UAAA,cAAc,aAAa,QAAQ;AACrC,cAAM,EAAE,MAAM,kBAAkB,UAAU,sBAAsB;AAEhE,YAAI,UAAU;AACd,YAAI,0BAA0B,YA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