@solidstarters/solid-core-ui 1.1.211 → 1.1.212
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/components/Svg/DevDocs.tsx +9 -0
- package/dist/components/Svg/DocsSvg.tsx +9 -0
- package/dist/components/Svg/ExcelSvg.tsx +15 -0
- package/dist/components/Svg/FieldSvg.tsx +9 -0
- package/dist/components/Svg/FileSvg.tsx +18 -0
- package/dist/components/Svg/HomePageModuleSvg.tsx +179 -0
- package/dist/components/Svg/ModelSvg.tsx +9 -0
- package/dist/components/Svg/ModuleSvg.tsx +9 -0
- package/dist/components/Svg/PDFSvg.tsx +15 -0
- package/dist/components/Svg/RightArrowSvg.tsx +9 -0
- package/dist/components/Svg/SettingsSvg.tsx +9 -0
- package/dist/components/auth/AuthLayout.tsx +223 -0
- package/dist/components/auth/ForgotPasswordThankYou.tsx +33 -0
- package/dist/components/auth/GoogleAuthChecking.tsx +63 -0
- package/dist/components/auth/SolidChangeForcePassword.tsx +222 -0
- package/dist/components/auth/SolidForgotPassword.tsx +127 -0
- package/dist/components/auth/SolidInitialLoginOtp.tsx +271 -0
- package/dist/components/auth/SolidInitiateRegisterOtp.tsx +218 -0
- package/dist/components/auth/SolidLogin.d.ts.map +1 -1
- package/dist/components/auth/SolidLogin.js +14 -8
- package/dist/components/auth/SolidLogin.js.map +1 -1
- package/dist/components/auth/SolidLogin.tsx +428 -0
- package/dist/components/auth/SolidOTPVerify.tsx +133 -0
- package/dist/components/auth/SolidRegister.tsx +454 -0
- package/dist/components/auth/SolidResetPassword.tsx +194 -0
- package/dist/components/common/AuthBanner.tsx +41 -0
- package/dist/components/common/AutoCompleteField.tsx +79 -0
- package/dist/components/common/BackButton.tsx +72 -0
- package/dist/components/common/CancelButton.tsx +61 -0
- package/dist/components/common/CodeEditor.tsx +38 -0
- package/dist/components/common/CreateButton.tsx +17 -0
- package/dist/components/common/DownloadProgressToast.tsx +55 -0
- package/dist/components/common/DropzonePlaceholder.tsx +31 -0
- package/dist/components/common/DropzoneUpload.tsx +11 -0
- package/dist/components/common/FileReaderExt.tsx +20 -0
- package/dist/components/common/GeneralSettings.tsx +1225 -0
- package/dist/components/common/HeaderDynamicTitles.tsx +13 -0
- package/dist/components/common/MarkdownViewer.tsx +84 -0
- package/dist/components/common/MultipleSelectAutoCompleteField.tsx +64 -0
- package/dist/components/common/NotFound.tsx +22 -0
- package/dist/components/common/SingleSelectAutoCompleteField.tsx +73 -0
- package/dist/components/common/SocialMediaLogin.tsx +53 -0
- package/dist/components/common/SolidAdmin.tsx +6 -0
- package/dist/components/common/SolidBreadcrumb.tsx +129 -0
- package/dist/components/common/SolidExport.tsx +563 -0
- package/dist/components/common/SolidExportStepper.tsx +135 -0
- package/dist/components/common/SolidFieldTooltip.tsx +23 -0
- package/dist/components/common/SolidFormHeader.tsx +25 -0
- package/dist/components/common/SolidFormStepper.tsx +350 -0
- package/dist/components/common/SolidModuleHome.tsx +128 -0
- package/dist/components/common/SolidPopupContainer.tsx +37 -0
- package/dist/components/common/SolidSettings/LlmSettings/AnthropicProviderComponent.tsx +45 -0
- package/dist/components/common/SolidSettings/LlmSettings/OpenAiProviderComponent.tsx +45 -0
- package/dist/components/common/SolidSettings/SettingDropzoneActivePlaceholder.tsx +20 -0
- package/dist/components/common/SolidSettings/SettingsImageRemoveButton.tsx +15 -0
- package/dist/components/common/SolidSettings/SolidUploadedImage.tsx +16 -0
- package/dist/components/common/SolidThemeLink.tsx +6 -0
- package/dist/components/common/SolidThemeProvider.tsx +44 -0
- package/dist/components/common/StepperArrows/ActiveArrowStep.tsx +18 -0
- package/dist/components/common/StepperArrows/ActiveBeforeStepArrow.tsx +18 -0
- package/dist/components/common/StepperArrows/InactiveStepArrow.tsx +19 -0
- package/dist/components/common/error.tsx +30 -0
- package/dist/components/common/useHandleFormCustomButtonClick.ts +40 -0
- package/dist/components/common/useHandleListCustomButtonClick.ts +42 -0
- package/dist/components/core/chatter/SolidChatter.tsx +248 -0
- package/dist/components/core/chatter/SolidChatterAuditMessage.tsx +35 -0
- package/dist/components/core/chatter/SolidChatterCustomMessage.tsx +46 -0
- package/dist/components/core/chatter/SolidChatterDateDivider.tsx +16 -0
- package/dist/components/core/chatter/SolidChatterHeader.tsx +218 -0
- package/dist/components/core/chatter/SolidChatterMessageBox.tsx +163 -0
- package/dist/components/core/chatter/SolidMessageComposer.tsx +146 -0
- package/dist/components/core/common/AvatarWidget.tsx +55 -0
- package/dist/components/core/common/DateFieldViewComponent.tsx +36 -0
- package/dist/components/core/common/FilterComponent.tsx +458 -0
- package/dist/components/core/common/LoadDynamicJsxComponent.tsx +70 -0
- package/dist/components/core/common/PDFViewer.tsx +117 -0
- package/dist/components/core/common/SolidAccountSettings/SolidAccountSettings.tsx +89 -0
- package/dist/components/core/common/SolidAccountSettings/SolidChangePassword.tsx +188 -0
- package/dist/components/core/common/SolidAccountSettings/SolidNotifications.tsx +139 -0
- package/dist/components/core/common/SolidAccountSettings/SolidPersonalInfo.tsx +311 -0
- package/dist/components/core/common/SolidCreateButton.tsx +48 -0
- package/dist/components/core/common/SolidGenericImport/DocumentSvg.tsx +15 -0
- package/dist/components/core/common/SolidGenericImport/SolidGenericImport.tsx +64 -0
- package/dist/components/core/common/SolidGenericImport/SolidImportDropzone.tsx +125 -0
- package/dist/components/core/common/SolidGenericImport/SolidImportInstructions.tsx +122 -0
- package/dist/components/core/common/SolidGenericImport/SolidImportStepper.tsx +217 -0
- package/dist/components/core/common/SolidGenericImport/SolidImportTransaction.tsx +205 -0
- package/dist/components/core/common/SolidGenericImport/SolidImportTransactionStatus.tsx +158 -0
- package/dist/components/core/common/SolidGenericImport/SolidImportWrapper.tsx +29 -0
- package/dist/components/core/common/SolidGlobalSearchElement.tsx +1470 -0
- package/dist/components/core/common/SolidLayoutViews.tsx +87 -0
- package/dist/components/core/common/SolidListViewOptions.tsx +31 -0
- package/dist/components/core/common/SolidLoaders/SolidCircularLoader.tsx +7 -0
- package/dist/components/core/common/SolidPasswordHelperText.tsx +34 -0
- package/dist/components/core/common/SolidSaveCustomFilterForm.tsx +75 -0
- package/dist/components/core/common/SolidSearchBox.tsx +17 -0
- package/dist/components/core/common/SolidViewLayoutManager.ts +421 -0
- package/dist/components/core/common/SolidXAiIframe.tsx +77 -0
- package/dist/components/core/dashboard/SolidDashboard.tsx +332 -0
- package/dist/components/core/dashboard/SolidDashboardBody.tsx +117 -0
- package/dist/components/core/dashboard/SolidDashboardFilterRequired.tsx +28 -0
- package/dist/components/core/dashboard/SolidDashboardHeader.tsx +10 -0
- package/dist/components/core/dashboard/SolidDashboardLoading.tsx +55 -0
- package/dist/components/core/dashboard/SolidDashboardNotAvailable.tsx +32 -0
- package/dist/components/core/dashboard/SolidDashboardRenderError.tsx +29 -0
- package/dist/components/core/dashboard/SolidDashboardVariable.tsx +256 -0
- package/dist/components/core/dashboard/SolidQuestionRenderer.tsx +78 -0
- package/dist/components/core/dashboard/chart-renderers/ChartJsRenderer.tsx +18 -0
- package/dist/components/core/dashboard/chart-renderers/PrimeReactDatatableRenderer.tsx +54 -0
- package/dist/components/core/dashboard/chart-renderers/init-chartjs.ts +25 -0
- package/dist/components/core/dashboard/dashboard-utils.ts +39 -0
- package/dist/components/core/extension/solid-core/CustomIcon/StatusIcon.tsx +17 -0
- package/dist/components/core/extension/solid-core/dashboardQuestion/ChartFormPreviewWidget.tsx +36 -0
- package/dist/components/core/extension/solid-core/emailTemplate/emailFormTypeChangeHandler.ts +18 -0
- package/dist/components/core/extension/solid-core/emailTemplate/emailFormTypeLoad.ts +18 -0
- package/dist/components/core/extension/solid-core/modelMetadata/list/DeleteModelRowAction.tsx +114 -0
- package/dist/components/core/extension/solid-core/modelMetadata/list/GenerateModelCodeRowAction.tsx +213 -0
- package/dist/components/core/extension/solid-core/moduleMetadata/list/DeleteModuleRowAction.tsx +138 -0
- package/dist/components/core/extension/solid-core/moduleMetadata/list/GenerateModuleCodeRowAction.tsx +209 -0
- package/dist/components/core/extension/solid-core/roleMetadata/RolePermissionsManyToManyFieldWidget.tsx +131 -0
- package/dist/components/core/field/FieldListViewData.tsx +313 -0
- package/dist/components/core/filter/SolidBooleanFilterElement.tsx +30 -0
- package/dist/components/core/filter/SolidFilterFields.tsx +131 -0
- package/dist/components/core/filter/SolidManyToManyFilterElement.tsx +64 -0
- package/dist/components/core/filter/SolidManyToOneFilterElement.tsx +61 -0
- package/dist/components/core/filter/SolidSelectionDynamicFilterElement.tsx +50 -0
- package/dist/components/core/filter/SolidSelectionStaticFilterElement.tsx +32 -0
- package/dist/components/core/filter/SolidVarInputsFilterElement.tsx +209 -0
- package/dist/components/core/filter/fields/SolidBigintField.tsx +9 -0
- package/dist/components/core/filter/fields/SolidBooleanField.tsx +68 -0
- package/dist/components/core/filter/fields/SolidComputedField.tsx +23 -0
- package/dist/components/core/filter/fields/SolidDateField.tsx +63 -0
- package/dist/components/core/filter/fields/SolidDatetimeField.tsx +54 -0
- package/dist/components/core/filter/fields/SolidDecimalField.tsx +9 -0
- package/dist/components/core/filter/fields/SolidExternalIdField.tsx +52 -0
- package/dist/components/core/filter/fields/SolidFloatField.tsx +9 -0
- package/dist/components/core/filter/fields/SolidIdField.tsx +46 -0
- package/dist/components/core/filter/fields/SolidIntField.tsx +61 -0
- package/dist/components/core/filter/fields/SolidLongTextField.tsx +9 -0
- package/dist/components/core/filter/fields/SolidMediaMultipleField.tsx +60 -0
- package/dist/components/core/filter/fields/SolidMediaSingleField.tsx +62 -0
- package/dist/components/core/filter/fields/SolidRelationField.tsx +17 -0
- package/dist/components/core/filter/fields/SolidRichTextField.tsx +9 -0
- package/dist/components/core/filter/fields/SolidSelectionDynamicField.tsx +52 -0
- package/dist/components/core/filter/fields/SolidSelectionStaticField.tsx +54 -0
- package/dist/components/core/filter/fields/SolidShortTextField.tsx +60 -0
- package/dist/components/core/filter/fields/SolidTimeField.tsx +48 -0
- package/dist/components/core/filter/fields/SolidUuidField.tsx +51 -0
- package/dist/components/core/filter/fields/relations/SolidRelationManyToManyField.tsx +62 -0
- package/dist/components/core/filter/fields/relations/SolidRelationManyToOneField.tsx +84 -0
- package/dist/components/core/form/SolidFormActionHeader.tsx +497 -0
- package/dist/components/core/form/SolidFormFieldRender.tsx +53 -0
- package/dist/components/core/form/SolidFormFieldRenderExtension.tsx +26 -0
- package/dist/components/core/form/SolidFormFooter.tsx +162 -0
- package/dist/components/core/form/SolidFormLayouts.tsx +104 -0
- package/dist/components/core/form/SolidFormUserViewLayout.tsx +84 -0
- package/dist/components/core/form/SolidFormView.tsx +1856 -0
- package/dist/components/core/form/SolidFormViewContextMenuHeaderButton.tsx +52 -0
- package/dist/components/core/form/SolidFormViewNormalHeaderButton.tsx +52 -0
- package/dist/components/core/form/SolidFormViewShimmerLoading.tsx +109 -0
- package/dist/components/core/form/fields/ISolidField.tsx +71 -0
- package/dist/components/core/form/fields/SolidBooleanField.tsx +434 -0
- package/dist/components/core/form/fields/SolidDateField.tsx +247 -0
- package/dist/components/core/form/fields/SolidDateTimeField.tsx +229 -0
- package/dist/components/core/form/fields/SolidDecimalField.tsx +171 -0
- package/dist/components/core/form/fields/SolidEmailField.tsx +176 -0
- package/dist/components/core/form/fields/SolidIntegerField.tsx +282 -0
- package/dist/components/core/form/fields/SolidJsonField.tsx +185 -0
- package/dist/components/core/form/fields/SolidLongTextField.tsx +618 -0
- package/dist/components/core/form/fields/SolidMediaMultipleField.tsx +663 -0
- package/dist/components/core/form/fields/SolidMediaSingleField.tsx +547 -0
- package/dist/components/core/form/fields/SolidPasswordField.tsx +390 -0
- package/dist/components/core/form/fields/SolidRelationField.tsx +56 -0
- package/dist/components/core/form/fields/SolidRichTextField.tsx +188 -0
- package/dist/components/core/form/fields/SolidSelectionDynamicField.tsx +340 -0
- package/dist/components/core/form/fields/SolidSelectionStaticField.tsx +462 -0
- package/dist/components/core/form/fields/SolidShortTextField.tsx +399 -0
- package/dist/components/core/form/fields/SolidTimeField.tsx +245 -0
- package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.tsx +453 -0
- package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.tsx +1036 -0
- package/dist/components/core/form/fields/relations/SolidRelationOneToManyField.tsx +627 -0
- package/dist/components/core/form/fields/relations/widgets/helpers/InlineRelationEntityDialog.tsx +38 -0
- package/dist/components/core/form/fields/relations/widgets/helpers/useRelationEntityHandler.ts +64 -0
- package/dist/components/core/form/fields/widgets/SolidAiInteractionMessageFieldFormWidget.tsx +135 -0
- package/dist/components/core/form/fields/widgets/SolidAiInteractionMetadataFieldFormWidget.tsx +144 -0
- package/dist/components/core/form/fields/widgets/SolidIconEditWidget.tsx +265 -0
- package/dist/components/core/form/fields/widgets/SolidIconViewWidget.tsx +32 -0
- package/dist/components/core/form/fields/widgets/SolidRelationFieldAvatarFormWidget.tsx +50 -0
- package/dist/components/core/form/fields/widgets/SolidS3FileViewerWidget.tsx +222 -0
- package/dist/components/core/form/fields/widgets/SolidShortTextFieldAvatarWidget.tsx +70 -0
- package/dist/components/core/form/widgets/CustomHtml.tsx +20 -0
- package/dist/components/core/kanban/KanbanBoard.tsx +150 -0
- package/dist/components/core/kanban/KanbanCard.tsx +279 -0
- package/dist/components/core/kanban/KanbanColumn.tsx +139 -0
- package/dist/components/core/kanban/KanbanUserViewLayout.tsx +84 -0
- package/dist/components/core/kanban/SolidKanbanView.tsx +894 -0
- package/dist/components/core/kanban/SolidKanbanViewConfigure.tsx +154 -0
- package/dist/components/core/kanban/SolidKanbanViewFields.tsx +164 -0
- package/dist/components/core/kanban/SolidManyToOneFilterElement.tsx +59 -0
- package/dist/components/core/kanban/SolidSelectionDynamicFilterElement.tsx +50 -0
- package/dist/components/core/kanban/SolidSelectionStaticFilterElement.tsx +32 -0
- package/dist/components/core/kanban/SolidVarInputsFilterElement.tsx +184 -0
- package/dist/components/core/kanban/kanban-fields/SolidBigintKanbanField.tsx +9 -0
- package/dist/components/core/kanban/kanban-fields/SolidBooleanKanbanField.tsx +16 -0
- package/dist/components/core/kanban/kanban-fields/SolidComputedKanbanField.tsx +23 -0
- package/dist/components/core/kanban/kanban-fields/SolidDateKanbanField.tsx +14 -0
- package/dist/components/core/kanban/kanban-fields/SolidDatetimeKanbanField.tsx +13 -0
- package/dist/components/core/kanban/kanban-fields/SolidDecimalKanbanField.tsx +9 -0
- package/dist/components/core/kanban/kanban-fields/SolidExternalIdKanbanField.tsx +12 -0
- package/dist/components/core/kanban/kanban-fields/SolidFloatKanbanField.tsx +9 -0
- package/dist/components/core/kanban/kanban-fields/SolidIdKanbanField.tsx +14 -0
- package/dist/components/core/kanban/kanban-fields/SolidIntKanbanField.tsx +20 -0
- package/dist/components/core/kanban/kanban-fields/SolidLongTextKanbanField.tsx +9 -0
- package/dist/components/core/kanban/kanban-fields/SolidMediaMultipleKanbanField.tsx +140 -0
- package/dist/components/core/kanban/kanban-fields/SolidMediaSingleKanbanField.tsx +164 -0
- package/dist/components/core/kanban/kanban-fields/SolidRelationKanbanField.tsx +13 -0
- package/dist/components/core/kanban/kanban-fields/SolidRichTextKanbanField.tsx +9 -0
- package/dist/components/core/kanban/kanban-fields/SolidSelectionDynamicKanbanField.tsx +14 -0
- package/dist/components/core/kanban/kanban-fields/SolidSelectionStaticKanbanField.tsx +14 -0
- package/dist/components/core/kanban/kanban-fields/SolidShortTextKanbanField.tsx +121 -0
- package/dist/components/core/kanban/kanban-fields/SolidTimeKanbanField.tsx +12 -0
- package/dist/components/core/kanban/kanban-fields/SolidUuidKanbanField.tsx +13 -0
- package/dist/components/core/kanban/kanban-fields/relations/SolidRelationManyToOneKanbanField.tsx +16 -0
- package/dist/components/core/list/ListViewRowActionPopup.tsx +41 -0
- package/dist/components/core/list/SolidColumnSelector/SolidListColumnSelector.tsx +242 -0
- package/dist/components/core/list/SolidEmptyListViewPlaceholder.tsx +111 -0
- package/dist/components/core/list/SolidListView.tsx +2007 -0
- package/dist/components/core/list/SolidListViewColumn.tsx +165 -0
- package/dist/components/core/list/SolidListViewConfigure.tsx +339 -0
- package/dist/components/core/list/SolidListViewHeaderButton.tsx +31 -0
- package/dist/components/core/list/SolidListViewHeaderContextMenuButton.tsx +30 -0
- package/dist/components/core/list/SolidListViewRowButtonContextMenu.tsx +41 -0
- package/dist/components/core/list/SolidListViewShimmerLoading.tsx +78 -0
- package/dist/components/core/list/SolidListingHeader.tsx +42 -0
- package/dist/components/core/list/SolidManyToOneFilterElement.tsx +60 -0
- package/dist/components/core/list/SolidSelectionDynamicFilterElement.tsx +50 -0
- package/dist/components/core/list/SolidSelectionStaticFilterElement.tsx +32 -0
- package/dist/components/core/list/SolidTableRowCell.tsx +35 -0
- package/dist/components/core/list/SolidVarInputsFilterElement.tsx +184 -0
- package/dist/components/core/list/columns/SolidBigintColumn.tsx +9 -0
- package/dist/components/core/list/columns/SolidBooleanColumn.tsx +90 -0
- package/dist/components/core/list/columns/SolidComputedColumn.tsx +27 -0
- package/dist/components/core/list/columns/SolidDateColumn.tsx +90 -0
- package/dist/components/core/list/columns/SolidDatetimeColumn.tsx +79 -0
- package/dist/components/core/list/columns/SolidDecimalColumn.tsx +9 -0
- package/dist/components/core/list/columns/SolidExternalIdColumn.tsx +80 -0
- package/dist/components/core/list/columns/SolidFloatColumn.tsx +9 -0
- package/dist/components/core/list/columns/SolidIdColumn.tsx +79 -0
- package/dist/components/core/list/columns/SolidIntColumn.tsx +87 -0
- package/dist/components/core/list/columns/SolidLongTextColumn.tsx +9 -0
- package/dist/components/core/list/columns/SolidMediaMultipleColumn.tsx +301 -0
- package/dist/components/core/list/columns/SolidMediaSingleColumn.tsx +170 -0
- package/dist/components/core/list/columns/SolidRelationColumn.tsx +21 -0
- package/dist/components/core/list/columns/SolidRichTextColumn.tsx +9 -0
- package/dist/components/core/list/columns/SolidSelectionDynamicColumn.tsx +80 -0
- package/dist/components/core/list/columns/SolidSelectionStaticColumn.tsx +81 -0
- package/dist/components/core/list/columns/SolidShortTextColumn.tsx +160 -0
- package/dist/components/core/list/columns/SolidTimeColumn.tsx +78 -0
- package/dist/components/core/list/columns/SolidUuidColumn.tsx +79 -0
- package/dist/components/core/list/columns/relations/SolidRelationManyToManyColumn.tsx +106 -0
- package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.tsx +117 -0
- package/dist/components/core/list/columns/relations/SolidRelationOneToManyColumn.tsx +110 -0
- package/dist/components/core/list/widgets/SolidManyToManyRelationAvatarListWidget.tsx +30 -0
- package/dist/components/core/list/widgets/SolidManyToOneRelationAvatarListWidget.tsx +30 -0
- package/dist/components/core/list/widgets/SolidShortTextAvatarWidget.tsx +70 -0
- package/dist/components/core/list/widgets/SolidShortTextFieldImageRenderModeWidget.tsx +21 -0
- package/dist/components/core/locales/SolidChatterLocaleTabView.tsx +91 -0
- package/dist/components/core/locales/SolidLocale.tsx +127 -0
- package/dist/components/core/model/CreateModel.tsx +495 -0
- package/dist/components/core/model/FieldMetaData.tsx +263 -0
- package/dist/components/core/model/FieldMetaDataForm.tsx +3509 -0
- package/dist/components/core/model/FieldSelector.tsx +62 -0
- package/dist/components/core/model/ModelListViewData.tsx +384 -0
- package/dist/components/core/model/ModelMetaData.tsx +921 -0
- package/dist/components/core/module/CreateModule.tsx +617 -0
- package/dist/components/core/module/ModuleListViewData.tsx +431 -0
- package/dist/components/core/solid-ai/SolidAiMainWrapper.tsx +8 -0
- package/dist/components/core/solid-ai/SolidXAIIcon.tsx +37 -0
- package/dist/components/core/users/CreateUser.tsx +467 -0
- package/dist/components/core/users/CreateUserRole.tsx +212 -0
- package/dist/components/core/users/UserListView.tsx +376 -0
- package/dist/components/layout/AdminLayout.tsx +57 -0
- package/dist/components/layout/AdminSidebar.tsx +65 -0
- package/dist/components/layout/AppConfig.tsx +104 -0
- package/dist/components/layout/AppSidebar.tsx +232 -0
- package/dist/components/layout/ButtonLoader.tsx +7 -0
- package/dist/components/layout/CustomPagination.tsx +55 -0
- package/dist/components/layout/DashboardHeader.tsx +89 -0
- package/dist/components/layout/FilterMenu.tsx +122 -0
- package/dist/components/layout/Footer.tsx +13 -0
- package/dist/components/layout/GlobalSearch.tsx +37 -0
- package/dist/components/layout/Header.tsx +8 -0
- package/dist/components/layout/Layout.tsx +205 -0
- package/dist/components/layout/ListingHeader.tsx +204 -0
- package/dist/components/layout/Loader.tsx +16 -0
- package/dist/components/layout/UserSidebar.tsx +53 -0
- package/dist/components/layout/context/layoutcontext.tsx +52 -0
- package/dist/components/layout/navbar-one.tsx +258 -0
- package/dist/components/layout/navbar-two-menu.tsx +72 -0
- package/dist/components/layout/navbar-two.tsx +37 -0
- package/dist/components/layout/user-profile-menu.tsx +213 -0
- package/dist/components/layout/user-profile.tsx +7 -0
- package/dist/components/modelsComponents/filterIcon.tsx +9 -0
- package/dist/constants/error-messages.ts +238 -0
- package/dist/declarations.d.ts +22 -0
- package/dist/helpers/AppTitle.tsx +12 -0
- package/dist/helpers/ToastContainer.tsx +94 -0
- package/dist/helpers/autoCompleteVirtualScroll.ts +41 -0
- package/dist/helpers/countries.tsx +260 -0
- package/dist/helpers/downloadFileWithProgress.ts +91 -0
- package/dist/helpers/downloadMediaFile.tsx +21 -0
- package/dist/helpers/getAcceptedFileTypes.tsx +22 -0
- package/dist/helpers/getRandomColors.tsx +68 -0
- package/dist/helpers/helpers.ts +61 -0
- package/dist/helpers/hydrateRelationRules.ts +120 -0
- package/dist/helpers/permissions.ts +7 -0
- package/dist/helpers/registry.ts +337 -0
- package/dist/helpers/resendOtpHelper.tsx +5 -0
- package/dist/helpers/revalidate.ts +7 -0
- package/dist/helpers/rolesHelper.ts +17 -0
- package/dist/helpers/solidIcons.tsx +1831 -0
- package/dist/helpers/updatePasswordField.ts +41 -0
- package/dist/index.ts +421 -0
- package/dist/nextAuth/authProviders.d.ts.map +1 -1
- package/dist/nextAuth/authProviders.js +6 -5
- package/dist/nextAuth/authProviders.js.map +1 -1
- package/dist/nextAuth/authProviders.tsx +232 -0
- package/dist/nextAuth/handleLogout.tsx +39 -0
- package/dist/nextAuth/refreshAccessToken.tsx +28 -0
- package/dist/redux/api/aiInteractionApi.ts +59 -0
- package/dist/redux/api/authApi.ts +131 -0
- package/dist/redux/api/dashboardApi.ts +56 -0
- package/dist/redux/api/dashboardQuestionApi.ts +17 -0
- package/dist/redux/api/exportTemplateApi.tsx +59 -0
- package/dist/redux/api/fetchBaseQuery.tsx +118 -0
- package/dist/redux/api/fieldApi.ts +86 -0
- package/dist/redux/api/importTransactionApi.tsx +69 -0
- package/dist/redux/api/mediaApi.ts +55 -0
- package/dist/redux/api/mediaStorageProviderApi.ts +55 -0
- package/dist/redux/api/modelApi.ts +80 -0
- package/dist/redux/api/moduleApi.ts +72 -0
- package/dist/redux/api/permissionApi.ts +32 -0
- package/dist/redux/api/pincodeApi.tsx +56 -0
- package/dist/redux/api/roleApi.ts +58 -0
- package/dist/redux/api/solidActionApi.ts +66 -0
- package/dist/redux/api/solidChatterMessageApi.ts +25 -0
- package/dist/redux/api/solidEntityApi.tsx +164 -0
- package/dist/redux/api/solidMenuApi.ts +71 -0
- package/dist/redux/api/solidServiceApi.ts +31 -0
- package/dist/redux/api/solidSettingsApi.tsx +83 -0
- package/dist/redux/api/solidViewApi.ts +73 -0
- package/dist/redux/api/stateApi.tsx +56 -0
- package/dist/redux/api/testApi.ts +21 -0
- package/dist/redux/api/userApi.ts +135 -0
- package/dist/redux/features/authSlice.ts +19 -0
- package/dist/redux/features/dataViewSlice.ts +26 -0
- package/dist/redux/features/navbarSlice.ts +21 -0
- package/dist/redux/features/popupSlice.ts +37 -0
- package/dist/redux/features/settingsSlice.ts +60 -0
- package/dist/redux/features/themeSlice.ts +17 -0
- package/dist/redux/features/userSlice.ts +28 -0
- package/dist/redux/hooks/useSolidPopup.ts +20 -0
- package/dist/redux/store/defaultStoreConfig.ts +62 -0
- package/dist/styles.ts +4 -0
- package/dist/types/handlebars.d.ts +4 -0
- package/dist/types/index.d.ts +76 -0
- package/dist/types/layout.d.ts +94 -0
- package/dist/types/next-auth.d.ts +0 -0
- package/dist/types/next.d.ts +46 -0
- package/dist/types/solid-core.d.ts +320 -0
- package/package.json +1 -1
- package/src/components/auth/SolidLogin.tsx +26 -13
- package/src/nextAuth/authProviders.tsx +9 -5
|
@@ -0,0 +1,428 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { Form, Formik } from "formik";
|
|
4
|
+
import { signIn } from "next-auth/react";
|
|
5
|
+
import Link from "next/link";
|
|
6
|
+
import { useRouter } from "next/navigation";
|
|
7
|
+
import { Button } from "primereact/button";
|
|
8
|
+
import { Divider } from "primereact/divider";
|
|
9
|
+
import { InputText } from "primereact/inputtext";
|
|
10
|
+
import { Message } from "primereact/message";
|
|
11
|
+
import { Password } from "primereact/password";
|
|
12
|
+
import { TabPanel, TabView } from 'primereact/tabview';
|
|
13
|
+
import { Toast } from "primereact/toast";
|
|
14
|
+
import { useEffect, useRef, useState } from "react";
|
|
15
|
+
import * as Yup from "yup";
|
|
16
|
+
import { SocialMediaLogin } from "../common/SocialMediaLogin";
|
|
17
|
+
import { useInitateLoginMutation } from "../../redux/api/authApi";
|
|
18
|
+
import Image from "next/image";
|
|
19
|
+
import SolidLogo from '../../resources/images/SolidXLogo.svg'
|
|
20
|
+
import { formatTimeLeft } from "../../helpers/resendOtpHelper";
|
|
21
|
+
import { ERROR_MESSAGES } from "../../constants/error-messages";
|
|
22
|
+
import { RadioButton } from "primereact/radiobutton";
|
|
23
|
+
import { useLazyGetAuthSettingsQuery } from "../../redux/api/solidSettingsApi";
|
|
24
|
+
// import { Checkbox } from "primereact/checkbox";
|
|
25
|
+
interface AuthTabsProps {
|
|
26
|
+
passwordBasedAuth: boolean;
|
|
27
|
+
passwordLessAuth: boolean;
|
|
28
|
+
}
|
|
29
|
+
const SolidLogin = ({ signInValidatorLabel, signInValidatorPlaceholder }: any) => {
|
|
30
|
+
|
|
31
|
+
const [trigger, { data: solidSettingsData }] = useLazyGetAuthSettingsQuery();
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
trigger("") // Fetch settings on mount
|
|
34
|
+
}, [trigger])
|
|
35
|
+
|
|
36
|
+
const [initiateLogin] = useInitateLoginMutation();
|
|
37
|
+
const [activeIndex, setActiveIndex] = useState(0);
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
sessionStorage.removeItem("app-mounted");
|
|
40
|
+
}, [])
|
|
41
|
+
const toast = useRef<Toast>(null);
|
|
42
|
+
const router = useRouter();
|
|
43
|
+
|
|
44
|
+
const showToast = (severity: "success" | "error", summary: string, detail: string) => {
|
|
45
|
+
toast.current?.show({
|
|
46
|
+
severity,
|
|
47
|
+
summary,
|
|
48
|
+
detail,
|
|
49
|
+
...(severity === "error"
|
|
50
|
+
? { sticky: true } // stays until user closes
|
|
51
|
+
: { life: 3000 }),
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
const isFormFieldValid = (formik: any, fieldName: string) =>
|
|
56
|
+
formik.touched[fieldName] && formik.errors[fieldName];
|
|
57
|
+
const emailOrUsernameRegex = /^[a-zA-Z0-9._]{3,30}$/;
|
|
58
|
+
|
|
59
|
+
const PasswordLogin = () => {
|
|
60
|
+
return (
|
|
61
|
+
<Formik
|
|
62
|
+
initialValues={{
|
|
63
|
+
identifier: "",
|
|
64
|
+
// email: initialEmail,
|
|
65
|
+
password: "",
|
|
66
|
+
// rememberMe: rememberMe,
|
|
67
|
+
}}
|
|
68
|
+
enableReinitialize={false}
|
|
69
|
+
validationSchema={Yup.object({
|
|
70
|
+
identifier: Yup.string()
|
|
71
|
+
.required(ERROR_MESSAGES.FIELD_REUQIRED("Email or Username"))
|
|
72
|
+
.test(
|
|
73
|
+
"email-or-username",
|
|
74
|
+
ERROR_MESSAGES.FIELD_INVALID("email or username"),
|
|
75
|
+
(value) => {
|
|
76
|
+
// if (!value) return false;
|
|
77
|
+
|
|
78
|
+
const isEmail = Yup.string().email().isValidSync(value);
|
|
79
|
+
const isUsername = emailOrUsernameRegex.test(value);
|
|
80
|
+
|
|
81
|
+
return isEmail || isUsername;
|
|
82
|
+
}
|
|
83
|
+
),
|
|
84
|
+
password: Yup.string().required(ERROR_MESSAGES.FIELD_REUQIRED("Password")),
|
|
85
|
+
})}
|
|
86
|
+
onSubmit={async (values, { setSubmitting, setErrors }) => {
|
|
87
|
+
try {
|
|
88
|
+
// Handle Remember Me
|
|
89
|
+
// if (values.rememberMe) {
|
|
90
|
+
// localStorage.setItem("rememberedEmail", values.email);
|
|
91
|
+
// } else {
|
|
92
|
+
// localStorage.removeItem("rememberedEmail");
|
|
93
|
+
// }
|
|
94
|
+
const response = await signIn("credentials", {
|
|
95
|
+
redirect: false,
|
|
96
|
+
identifier: values.identifier,
|
|
97
|
+
password: values.password,
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
if (response?.error) {
|
|
101
|
+
showToast("error", ERROR_MESSAGES.LOGIN_ERROR, response.error);
|
|
102
|
+
setErrors({
|
|
103
|
+
identifier: ERROR_MESSAGES.INVALID_CREDENTIALS,
|
|
104
|
+
password: ERROR_MESSAGES.INVALID_CREDENTIALS,
|
|
105
|
+
});
|
|
106
|
+
} else {
|
|
107
|
+
showToast("success", ERROR_MESSAGES.LOGIN_SUCCESS, ERROR_MESSAGES.DASHBOARD_REDIRECTING);
|
|
108
|
+
router.push(`${process.env.NEXT_PUBLIC_LOGIN_REDIRECT_URL}`);
|
|
109
|
+
}
|
|
110
|
+
} catch (error: any) {
|
|
111
|
+
showToast("error", ERROR_MESSAGES.LOGIN_ERROR, error?.data ? error?.data?.message : ERROR_MESSAGES.SOMETHING_WRONG);
|
|
112
|
+
} finally {
|
|
113
|
+
setSubmitting(false); // Re-enable the button after submission
|
|
114
|
+
}
|
|
115
|
+
}}
|
|
116
|
+
>
|
|
117
|
+
{(formik) => (
|
|
118
|
+
<Form>
|
|
119
|
+
<div className="flex flex-column gap-2 mt-3">
|
|
120
|
+
<label htmlFor="email" className="solid-auth-input-label">{signInValidatorLabel ? signInValidatorLabel : "Username or Email"}</label>
|
|
121
|
+
<InputText
|
|
122
|
+
id="identifier"
|
|
123
|
+
name="identifier"
|
|
124
|
+
placeholder={signInValidatorPlaceholder ? signInValidatorPlaceholder : "Email or Username"}
|
|
125
|
+
onChange={formik.handleChange}
|
|
126
|
+
value={formik.values.identifier}
|
|
127
|
+
invalid={!!formik.errors.identifier}
|
|
128
|
+
onBlur={formik.handleBlur}
|
|
129
|
+
/>
|
|
130
|
+
{isFormFieldValid(formik, "identifier") && <Message
|
|
131
|
+
className="text-red-500 text-sm"
|
|
132
|
+
severity="error"
|
|
133
|
+
text={formik?.errors?.identifier?.toString()}
|
|
134
|
+
/>}
|
|
135
|
+
</div>
|
|
136
|
+
<div className="flex flex-column gap-1 mt-4" style={{}}>
|
|
137
|
+
<label htmlFor="password" className="solid-auth-input-label">Password</label>
|
|
138
|
+
<Password
|
|
139
|
+
id="password"
|
|
140
|
+
name="password"
|
|
141
|
+
value={formik.values.password}
|
|
142
|
+
onChange={formik.handleChange}
|
|
143
|
+
toggleMask
|
|
144
|
+
invalid={!!formik.errors.password}
|
|
145
|
+
inputClassName="w-full"
|
|
146
|
+
feedback={false}
|
|
147
|
+
/>
|
|
148
|
+
{isFormFieldValid(formik, "password") && <Message
|
|
149
|
+
className="text-red-500 text-sm"
|
|
150
|
+
severity="error"
|
|
151
|
+
text={formik?.errors?.password?.toString()}
|
|
152
|
+
/>}
|
|
153
|
+
</div>
|
|
154
|
+
{/* <div className="flex align-items-center mt-4">
|
|
155
|
+
<Checkbox inputId="remember" onChange={(e: any) => setChecked(e.checked)} checked={checked} />
|
|
156
|
+
<label htmlFor="remember" className="ml-2">Remember me</label>
|
|
157
|
+
</div> */}
|
|
158
|
+
<div className="mt-4 flex align-items-center justify-content-between">
|
|
159
|
+
{/* <div className="flex align-items-center gap-2">
|
|
160
|
+
<Checkbox
|
|
161
|
+
inputId="rememberMe"
|
|
162
|
+
name="rememberMe"
|
|
163
|
+
checked={formik.values.rememberMe}
|
|
164
|
+
onChange={formik.handleChange}
|
|
165
|
+
/>
|
|
166
|
+
<label htmlFor="rememberMe" className="solid-auth-input-label">Remember me</label>
|
|
167
|
+
</div> */}
|
|
168
|
+
<div></div>
|
|
169
|
+
<Link href={"/auth/initiate-forgot-password"} className="solid-auth-input-label font-bold">Forgot Password?</Link>
|
|
170
|
+
</div>
|
|
171
|
+
<div className="mt-4">
|
|
172
|
+
<Button className="w-full font-light auth-submit-button" label="Sign In" disabled={formik.isSubmitting} loading={formik.isSubmitting} />
|
|
173
|
+
</div>
|
|
174
|
+
</Form>
|
|
175
|
+
)}
|
|
176
|
+
</Formik>
|
|
177
|
+
)
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
const PasswordLessLogin = () => {
|
|
181
|
+
const validationType = solidSettingsData?.data?.passwordlessRegistrationValidateWhat || "email";
|
|
182
|
+
const [selectedAuthMethod, setSelectedAuthMethod] = useState<"email" | "mobile">("email");
|
|
183
|
+
|
|
184
|
+
const getFieldConfig = () => {
|
|
185
|
+
if (validationType === "transactional") {
|
|
186
|
+
if (selectedAuthMethod === "mobile") {
|
|
187
|
+
return {
|
|
188
|
+
label: "Mobile Number / Username",
|
|
189
|
+
placeholder: "Enter your mobile number or username",
|
|
190
|
+
type: "mobile",
|
|
191
|
+
// validationSchema: Yup.string()
|
|
192
|
+
// .matches(/^[0-9]{10}$/, ERROR_MESSAGES.FIELD_INVALID('mobile number'))
|
|
193
|
+
// .required(ERROR_MESSAGES.FIELD_REUQIRED('Mobile number'))
|
|
194
|
+
};
|
|
195
|
+
} else {
|
|
196
|
+
return {
|
|
197
|
+
label: "Email Address / Username",
|
|
198
|
+
placeholder: "Enter your email or username",
|
|
199
|
+
type: "email",
|
|
200
|
+
// validationSchema: Yup.string()
|
|
201
|
+
// .email(ERROR_MESSAGES.FIELD_INVALID('email address'))
|
|
202
|
+
// .required(ERROR_MESSAGES.FIELD_REUQIRED('Email'))
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
switch (validationType) {
|
|
207
|
+
case "mobile":
|
|
208
|
+
return {
|
|
209
|
+
label: signInValidatorLabel || "Mobile Number / Username",
|
|
210
|
+
placeholder: signInValidatorPlaceholder || "Enter your mobile number / username",
|
|
211
|
+
type: "mobile",
|
|
212
|
+
// validationSchema: Yup.string()
|
|
213
|
+
// .matches(/^[0-9]{10}$/, ERROR_MESSAGES.FIELD_INVALID('mobile number'))
|
|
214
|
+
// .required(ERROR_MESSAGES.FIELD_REUQIRED('Mobile number'))
|
|
215
|
+
};
|
|
216
|
+
case "email":
|
|
217
|
+
default:
|
|
218
|
+
return {
|
|
219
|
+
label: signInValidatorLabel || "Email / Username",
|
|
220
|
+
placeholder: signInValidatorPlaceholder || "Email ID / username",
|
|
221
|
+
type: "email",
|
|
222
|
+
// validationSchema: Yup.string()
|
|
223
|
+
// .email(ERROR_MESSAGES.FIELD_INVALID('email address'))
|
|
224
|
+
// .required(ERROR_MESSAGES.FIELD_REUQIRED('Email'))
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
const fieldConfig = getFieldConfig();
|
|
230
|
+
return (
|
|
231
|
+
<Formik
|
|
232
|
+
initialValues={{
|
|
233
|
+
identifier: "",
|
|
234
|
+
}}
|
|
235
|
+
// validationSchema={
|
|
236
|
+
// fieldConfig.validationSchema
|
|
237
|
+
// ? Yup.object({
|
|
238
|
+
// identifier: fieldConfig.validationSchema
|
|
239
|
+
// })
|
|
240
|
+
// : Yup.object({
|
|
241
|
+
// identifier: Yup.string().required("required"),
|
|
242
|
+
// })
|
|
243
|
+
// }
|
|
244
|
+
validationSchema={
|
|
245
|
+
Yup.object({ identifier: Yup.string().required("required") })
|
|
246
|
+
}
|
|
247
|
+
enableReinitialize={false}
|
|
248
|
+
onSubmit={async (values, { setSubmitting, setErrors }) => {
|
|
249
|
+
try {
|
|
250
|
+
const RESEND_OTP_KEY = `resendOtpLogin_${values.identifier}`;
|
|
251
|
+
const RESEND_OTP_TIMER_MIN = parseFloat(process.env.NEXT_PUBLIC_RESEND_OTP_TIMER || '0.5');
|
|
252
|
+
const RESEND_OTP_TIMER = Math.round(RESEND_OTP_TIMER_MIN * 60);
|
|
253
|
+
|
|
254
|
+
// Use selectedAuthMethod for transactional, otherwise use fieldConfig.type
|
|
255
|
+
const authType = validationType === "transactional" ? selectedAuthMethod : fieldConfig.type;
|
|
256
|
+
|
|
257
|
+
const payload = {
|
|
258
|
+
type: authType,
|
|
259
|
+
identifier: values.identifier,
|
|
260
|
+
};
|
|
261
|
+
|
|
262
|
+
const storedTimeStr = localStorage.getItem(RESEND_OTP_KEY);
|
|
263
|
+
const now = Date.now();
|
|
264
|
+
if (storedTimeStr) {
|
|
265
|
+
const lastSent = parseInt(storedTimeStr, 10);
|
|
266
|
+
const elapsed = Math.floor((now - lastSent) / 1000);
|
|
267
|
+
const remaining = RESEND_OTP_TIMER - elapsed;
|
|
268
|
+
|
|
269
|
+
if (remaining > 0) {
|
|
270
|
+
const formatted = formatTimeLeft(remaining);
|
|
271
|
+
showToast(
|
|
272
|
+
"error",
|
|
273
|
+
ERROR_MESSAGES.PLEASE_WAIT,
|
|
274
|
+
ERROR_MESSAGES.OPT_FORMAT(formatted)
|
|
275
|
+
);
|
|
276
|
+
setSubmitting(false);
|
|
277
|
+
return; // Prevent request
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
const response = await initiateLogin(payload).unwrap(); // Call mutation trigger
|
|
281
|
+
|
|
282
|
+
if (response?.statusCode === 200) {
|
|
283
|
+
showToast("success", ERROR_MESSAGES.OPT_RESEND, response?.data?.message);
|
|
284
|
+
const identifier = values.identifier;
|
|
285
|
+
localStorage.setItem(`resendOtpLogin_${identifier}`, Date.now().toString());
|
|
286
|
+
router.push(`/auth/initiate-login?identifier=${encodeURIComponent(identifier)}&type=${authType}`);
|
|
287
|
+
} else {
|
|
288
|
+
showToast("error", ERROR_MESSAGES.LOGIN_ERROR, response.error);
|
|
289
|
+
}
|
|
290
|
+
} catch (err: any) {
|
|
291
|
+
showToast("error", ERROR_MESSAGES.LOGIN_ERROR, err?.data ? err?.data?.message : ERROR_MESSAGES.SOMETHING_WRONG);
|
|
292
|
+
setErrors({
|
|
293
|
+
identifier: "Invalid Credentials",
|
|
294
|
+
});
|
|
295
|
+
} finally {
|
|
296
|
+
setSubmitting(false);
|
|
297
|
+
}
|
|
298
|
+
}}
|
|
299
|
+
>
|
|
300
|
+
{(formik) => (
|
|
301
|
+
<Form>
|
|
302
|
+
{/* Radio buttons for transactional type */}
|
|
303
|
+
{validationType === "transactional" && (
|
|
304
|
+
<div className="flex flex-column gap-3 mt-3">
|
|
305
|
+
<label className="solid-auth-input-label">Select Authentication Method</label>
|
|
306
|
+
<div className="flex gap-4">
|
|
307
|
+
<div className="flex align-items-center">
|
|
308
|
+
<RadioButton
|
|
309
|
+
inputId="auth-email"
|
|
310
|
+
name="authMethod"
|
|
311
|
+
value="email"
|
|
312
|
+
checked={selectedAuthMethod === "email"}
|
|
313
|
+
onChange={(e) => {
|
|
314
|
+
setSelectedAuthMethod("email");
|
|
315
|
+
formik.setFieldValue("identifier", "");
|
|
316
|
+
}}
|
|
317
|
+
className="mr-2"
|
|
318
|
+
/>
|
|
319
|
+
<label htmlFor="auth-email" className="solid-auth-input-label cursor-pointer">Email / Username</label>
|
|
320
|
+
</div>
|
|
321
|
+
<div className="flex align-items-center">
|
|
322
|
+
<RadioButton
|
|
323
|
+
inputId="auth-mobile"
|
|
324
|
+
name="authMethod"
|
|
325
|
+
value="mobile"
|
|
326
|
+
checked={selectedAuthMethod === "mobile"}
|
|
327
|
+
onChange={(e) => {
|
|
328
|
+
setSelectedAuthMethod("mobile");
|
|
329
|
+
formik.setFieldValue("identifier", "");
|
|
330
|
+
}}
|
|
331
|
+
className="mr-2"
|
|
332
|
+
/>
|
|
333
|
+
<label htmlFor="auth-mobile" className="solid-auth-input-label cursor-pointer">Mobile / Username</label>
|
|
334
|
+
</div>
|
|
335
|
+
</div>
|
|
336
|
+
</div>
|
|
337
|
+
)}
|
|
338
|
+
<div className="flex flex-column gap-2 mt-3">
|
|
339
|
+
<label htmlFor="identifier" className="solid-auth-input-label">{fieldConfig.label}</label>
|
|
340
|
+
<InputText
|
|
341
|
+
id="identifier"
|
|
342
|
+
name="identifier"
|
|
343
|
+
placeholder={fieldConfig.placeholder}
|
|
344
|
+
onChange={formik.handleChange}
|
|
345
|
+
value={formik.values.identifier}
|
|
346
|
+
invalid={!!formik.errors.identifier}
|
|
347
|
+
onBlur={formik.handleBlur}
|
|
348
|
+
/>
|
|
349
|
+
{isFormFieldValid(formik, "identifier") && <Message
|
|
350
|
+
className="text-red-500 text-sm"
|
|
351
|
+
severity="error"
|
|
352
|
+
text={formik?.errors?.identifier?.toString()}
|
|
353
|
+
/>}
|
|
354
|
+
</div>
|
|
355
|
+
<div className="mt-4">
|
|
356
|
+
<Button className="w-full font-light auth-submit-button" label="Sign In" disabled={formik.isSubmitting} loading={formik.isSubmitting} />
|
|
357
|
+
</div>
|
|
358
|
+
</Form>
|
|
359
|
+
)}
|
|
360
|
+
</Formik>
|
|
361
|
+
)
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
const AuthTabs: React.FC<AuthTabsProps> = ({ passwordBasedAuth, passwordLessAuth }) => {
|
|
365
|
+
if (passwordBasedAuth && passwordLessAuth) {
|
|
366
|
+
return (
|
|
367
|
+
<TabView className="solid-auth-tabview"
|
|
368
|
+
activeIndex={activeIndex}
|
|
369
|
+
onTabChange={(e) => setActiveIndex(e.index)}
|
|
370
|
+
>
|
|
371
|
+
<TabPanel header="With Password">
|
|
372
|
+
<PasswordLogin />
|
|
373
|
+
</TabPanel>
|
|
374
|
+
<TabPanel header="Without Password">
|
|
375
|
+
<PasswordLessLogin />
|
|
376
|
+
</TabPanel>
|
|
377
|
+
</TabView>
|
|
378
|
+
);
|
|
379
|
+
} else if (passwordBasedAuth) {
|
|
380
|
+
return <PasswordLogin />;
|
|
381
|
+
} else if (passwordLessAuth) {
|
|
382
|
+
return <PasswordLessLogin />;
|
|
383
|
+
} else {
|
|
384
|
+
return <p>No authentication method available</p>;
|
|
385
|
+
}
|
|
386
|
+
};
|
|
387
|
+
|
|
388
|
+
return (
|
|
389
|
+
<div className="">
|
|
390
|
+
<Toast ref={toast} />
|
|
391
|
+
<div className={`auth-container ${solidSettingsData?.data?.authPagesLayout === 'center' ? 'center' : 'side'}`}>
|
|
392
|
+
{solidSettingsData?.data?.authPagesLayout === 'center' &&
|
|
393
|
+
<div className="flex justify-content-center">
|
|
394
|
+
<div className={`solid-logo flex align-items-center ${solidSettingsData?.data?.appLogoPosition}`}>
|
|
395
|
+
<Image
|
|
396
|
+
alt="solid logo"
|
|
397
|
+
src={solidSettingsData?.data?.appLogo || SolidLogo}
|
|
398
|
+
className="relative"
|
|
399
|
+
fill
|
|
400
|
+
/>
|
|
401
|
+
</div>
|
|
402
|
+
</div>
|
|
403
|
+
}
|
|
404
|
+
<h2 className={`solid-auth-title ${solidSettingsData?.data?.authPagesLayout === 'center' ? 'text-center mt-2 md:mt-4' : 'text-left'}`}>Sign In To Your Account</h2>
|
|
405
|
+
{/* <p className="solid-auth-subtitle text-sm">By continuing, you agree to the <Link href={'#'}>Terms of Service</Link> and acknowledge you’ve read our <Link href={'#'}>Privacy Policy.</Link> </p> */}
|
|
406
|
+
|
|
407
|
+
<AuthTabs passwordBasedAuth={solidSettingsData?.data?.passwordBasedAuth} passwordLessAuth={solidSettingsData?.data?.passwordLessAuth} />
|
|
408
|
+
{solidSettingsData?.data?.iamGoogleOAuthEnabled &&
|
|
409
|
+
<>
|
|
410
|
+
<Divider align="center">
|
|
411
|
+
<div className="inline-flex align-items-center">
|
|
412
|
+
OR
|
|
413
|
+
</div>
|
|
414
|
+
</Divider>
|
|
415
|
+
<SocialMediaLogin />
|
|
416
|
+
</>
|
|
417
|
+
}
|
|
418
|
+
</div>
|
|
419
|
+
{solidSettingsData?.data?.allowPublicRegistration && <div className="mt-3 md:mt-5">
|
|
420
|
+
<div className="text-sm text-center text-400 secondary-dark-color">
|
|
421
|
+
Don’t have an account ? <Link className="font-bold" href="/auth/register">Sign Up</Link>
|
|
422
|
+
</div>
|
|
423
|
+
</div>}
|
|
424
|
+
</div>
|
|
425
|
+
);
|
|
426
|
+
};
|
|
427
|
+
|
|
428
|
+
export default SolidLogin;
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { Form, Formik } from "formik";
|
|
4
|
+
import { signIn } from "next-auth/react";
|
|
5
|
+
import Link from "next/link";
|
|
6
|
+
import { useRouter } from "next/navigation";
|
|
7
|
+
import { Button } from "primereact/button";
|
|
8
|
+
import { InputOtp } from "primereact/inputotp";
|
|
9
|
+
import { Message } from "primereact/message";
|
|
10
|
+
import { Toast } from "primereact/toast";
|
|
11
|
+
import { useEffect, useRef, useState } from "react";
|
|
12
|
+
import * as Yup from "yup";
|
|
13
|
+
import Image from "next/image";
|
|
14
|
+
import SolidLogo from '../../resources/images/SolidXLogo.svg'
|
|
15
|
+
import { ERROR_MESSAGES } from "../../constants/error-messages";
|
|
16
|
+
import { useLazyGetAuthSettingsQuery } from "../../redux/api/solidSettingsApi";
|
|
17
|
+
|
|
18
|
+
const SolidOTPVerify = () => {
|
|
19
|
+
|
|
20
|
+
const [trigger, { data: solidSettingsData }] = useLazyGetAuthSettingsQuery();
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
trigger("") // Fetch settings on mount
|
|
23
|
+
}, [trigger])
|
|
24
|
+
|
|
25
|
+
const [otp, setOTP] = useState<number | any>();
|
|
26
|
+
|
|
27
|
+
const toast = useRef<Toast>(null);
|
|
28
|
+
const router = useRouter();
|
|
29
|
+
|
|
30
|
+
const [password, setPassword] = useState('');
|
|
31
|
+
const [checked, setChecked] = useState<boolean>(false);
|
|
32
|
+
|
|
33
|
+
const validationSchema = Yup.object({
|
|
34
|
+
email: Yup.string()
|
|
35
|
+
.email(ERROR_MESSAGES.FIELD_INVALID(' email address'))
|
|
36
|
+
.required(ERROR_MESSAGES.FIELD_REUQIRED('Email')),
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
const showToast = (severity: "success" | "error", summary: string, detail: string) => {
|
|
40
|
+
toast.current?.show({
|
|
41
|
+
severity,
|
|
42
|
+
summary,
|
|
43
|
+
detail,
|
|
44
|
+
...(severity === "error"
|
|
45
|
+
? { sticky: true } // stays until user closes
|
|
46
|
+
: { life: 3000 }),
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const isFormFieldValid = (formik: any, fieldName: string) =>
|
|
51
|
+
formik.touched[fieldName] && formik.errors[fieldName];
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<>
|
|
55
|
+
<Toast ref={toast} />
|
|
56
|
+
<div className={`auth-container ${solidSettingsData?.data?.authPagesLayout === 'center' ? 'center' : 'side'}`} style={{ minWidth: 480 }}>
|
|
57
|
+
{solidSettingsData?.data?.authPagesLayout === 'center' &&
|
|
58
|
+
<div className="flex justify-content-center">
|
|
59
|
+
<div className={`solid-logo flex align-items-center ${solidSettingsData?.data?.appLogoPosition}`}>
|
|
60
|
+
<Image
|
|
61
|
+
alt="solid logo"
|
|
62
|
+
src={solidSettingsData?.data?.appLogo || SolidLogo}
|
|
63
|
+
className="relative"
|
|
64
|
+
fill
|
|
65
|
+
/>
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
68
|
+
}
|
|
69
|
+
<h2 className={`solid-auth-title ${solidSettingsData?.data?.authPagesLayout === 'center' ? 'text-center' : 'text-left'}`}>OTP Verification</h2>
|
|
70
|
+
<p className="solid-auth-subtitle text-sm">
|
|
71
|
+
Please enter the OTP sent to your email to complete verification
|
|
72
|
+
</p>
|
|
73
|
+
<>
|
|
74
|
+
<Formik
|
|
75
|
+
initialValues={{
|
|
76
|
+
email: "",
|
|
77
|
+
password: "",
|
|
78
|
+
}}
|
|
79
|
+
validationSchema={validationSchema}
|
|
80
|
+
onSubmit={async (values) => {
|
|
81
|
+
// Handle form submission
|
|
82
|
+
const email = values.email;
|
|
83
|
+
const password = values.password;
|
|
84
|
+
|
|
85
|
+
const response = await signIn("credentials", {
|
|
86
|
+
redirect: false,
|
|
87
|
+
email,
|
|
88
|
+
password,
|
|
89
|
+
});
|
|
90
|
+
if (response?.error) {
|
|
91
|
+
showToast("error", ERROR_MESSAGES.LOGIN_ERROR, response.error);
|
|
92
|
+
} else {
|
|
93
|
+
showToast("success", ERROR_MESSAGES.LOGIN_SUCCESS, ERROR_MESSAGES.DASHBOARD_REDIRECTING);
|
|
94
|
+
router.push(`${process.env.NEXT_PUBLIC_LOGIN_REDIRECT_URL}`);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
}}
|
|
98
|
+
>
|
|
99
|
+
{(formik) => (
|
|
100
|
+
<Form>
|
|
101
|
+
<div className="flex flex-column gap-2 px-3">
|
|
102
|
+
<label htmlFor="email" className="solid-auth-input-label">Enter OTP</label>
|
|
103
|
+
<InputOtp value={otp} onChange={(e) => setOTP(e.value)} length={6} style={{ width: '100%' }} />
|
|
104
|
+
{isFormFieldValid(formik, "email") && <Message
|
|
105
|
+
className="text-red-500 text-sm"
|
|
106
|
+
severity="error"
|
|
107
|
+
text={formik?.errors?.email?.toString()}
|
|
108
|
+
/>}
|
|
109
|
+
<div className="flex align-items-center justify-content-between">
|
|
110
|
+
<Button type="button" icon='pi pi-refresh' iconPos="left" link label="Resend Code" className="px-0 text-sm font-normal" />
|
|
111
|
+
<p className="m-0 text-sm text-color">
|
|
112
|
+
Time left: 00:28
|
|
113
|
+
</p>
|
|
114
|
+
</div>
|
|
115
|
+
</div>
|
|
116
|
+
<div className="mt-4">
|
|
117
|
+
<Button type="submit" className="w-full font-light auth-submit-button" label="Verify" disabled={formik.isSubmitting} loading={formik.isSubmitting} />
|
|
118
|
+
</div>
|
|
119
|
+
</Form>
|
|
120
|
+
)}
|
|
121
|
+
</Formik>
|
|
122
|
+
</>
|
|
123
|
+
</div>
|
|
124
|
+
<div className="text-center mt-5">
|
|
125
|
+
<div className="text-sm text-400 secondary-dark-color">
|
|
126
|
+
{'<'} Back to <Link className="font-bold" href="/auth/login">Sign In</Link>
|
|
127
|
+
</div>
|
|
128
|
+
</div>
|
|
129
|
+
</>
|
|
130
|
+
);
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
export default SolidOTPVerify;
|