@spacemade/ui 0.0.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/README.md +705 -0
- package/app.sh +806 -0
- package/cmd.sh +152 -0
- package/docs/cms-quickstart.md +206 -0
- package/docs/gallery-quickstart.md +24 -0
- package/docs/gpu-marketplace-quickstart.md +27 -0
- package/docs/metaverse-quickstart.md +25 -0
- package/docs/migration-plan.md +41 -0
- package/docs/modules.md +34 -0
- package/docs/nft-quickstart.md +26 -0
- package/docs/simple-cms-quickstart.md +22 -0
- package/middleware.ts +77 -0
- package/next-env.d.ts +6 -0
- package/next.config.ts +39 -0
- package/package.json +92 -0
- package/public/android-chrome-192x192.png +0 -0
- package/public/android-chrome-512x512.png +0 -0
- package/public/apple-touch-icon.png +0 -0
- package/public/favicon-16x16.png +0 -0
- package/public/favicon-32x32.png +0 -0
- package/public/favicon.ico +0 -0
- package/public/images/default-profile/1.png +0 -0
- package/public/images/default-profile/2.png +0 -0
- package/public/images/default-profile/3.png +0 -0
- package/public/images/default-profile/4.png +0 -0
- package/public/images/default-profile/5.png +0 -0
- package/public/images/default-profile/6.png +0 -0
- package/public/images/default-profile/7.png +0 -0
- package/public/images/defaults/Login-Person-Icon-dark.svg +13 -0
- package/public/images/defaults/Login-Person-Icon.svg +16 -0
- package/public/images/defaults/default-avatar.png +0 -0
- package/public/images/defaults/image-not-available.jpg +0 -0
- package/public/images/icons/amazon-icon.jpg +0 -0
- package/public/images/icons/azure-icon.png +0 -0
- package/public/images/icons/google-icon.jpg +0 -0
- package/public/site.webmanifest +1 -0
- package/scripts/crud-scaffold/bin/crud-scaffold.mjs +23 -0
- package/scripts/crud-scaffold/src/api/index.mjs +666 -0
- package/scripts/crud-scaffold/src/app/patches.mjs +355 -0
- package/scripts/crud-scaffold/src/core/fields.mjs +165 -0
- package/scripts/crud-scaffold/src/core/utils.mjs +161 -0
- package/scripts/crud-scaffold/src/frontend/index.mjs +1078 -0
- package/scripts/crud-scaffold/src/generator.mjs +103 -0
- package/scripts/crud-scaffold/src/templates/.gitkeep +1 -0
- package/scripts/crud-scaffold/src/utils/generator-utils.mjs +35 -0
- package/scripts/defs/cms-definition.mjs +1393 -0
- package/scripts/defs/gallery-definition.mjs +171 -0
- package/scripts/defs/gpu-definition.mjs +174 -0
- package/scripts/defs/metaverse-definition.mjs +170 -0
- package/scripts/defs/nft-definition.mjs +191 -0
- package/scripts/defs/simple-cms-definition.mjs +141 -0
- package/scripts/generate-cms-install-system.mjs +4 -0
- package/scripts/generate-gallery-system.mjs +4 -0
- package/scripts/generate-gpu-marketplace-system.mjs +4 -0
- package/scripts/generate-metaverse-system.mjs +4 -0
- package/scripts/generate-nft-system.mjs +4 -0
- package/scripts/generate-simple-cms-system.mjs +4 -0
- package/scripts/link-core.mjs +72 -0
- package/scripts/spacemade.mjs +446 -0
- package/scripts/test-generate-app.mjs +60 -0
- package/src/components/Dashboard/DashboardList.tsx +70 -0
- package/src/components/Dashboard/dashboardLayout.tsx +57 -0
- package/src/components/admin/nav/AdminLeftNav.tsx +168 -0
- package/src/components/auth/AuthBootstrap.tsx +47 -0
- package/src/components/auth/auth-card-shell.tsx +23 -0
- package/src/components/auth/forgot-password-form-template.tsx +37 -0
- package/src/components/auth/form/ForgotForm.tsx +146 -0
- package/src/components/auth/form/ResetPasswordForm.tsx +122 -0
- package/src/components/auth/form/SignInForm.tsx +139 -0
- package/src/components/auth/form/SignUpForm.tsx +166 -0
- package/src/components/auth/form/UpdateForm.tsx +165 -0
- package/src/components/auth/login-form-template.tsx +45 -0
- package/src/components/billing/CardBrandIcon.tsx +126 -0
- package/src/components/billing/block/BillingDetailsCard.tsx +120 -0
- package/src/components/billing/block/BillingHistory.tsx +143 -0
- package/src/components/billing/block/PlanDetails.tsx +138 -0
- package/src/components/billing/modal/UpdateCardDetailsModal.tsx +451 -0
- package/src/components/billing/modal/UpdatePlanModal.tsx +194 -0
- package/src/components/category/modal/UpdateCategoryModal.tsx +170 -0
- package/src/components/category/table/CategoryTable.tsx +137 -0
- package/src/components/common/Icons/BrainCircuitIcon.tsx +14 -0
- package/src/components/common/Icons/MagnifyingGlassChartIcon.tsx +14 -0
- package/src/components/common/Icons/PeopleGroupIcon.tsx +14 -0
- package/src/components/common/Icons/ScrewdriverWrenchIcon.tsx +14 -0
- package/src/components/common/Icons/SendMessageIcon.tsx +15 -0
- package/src/components/common/Icons/ShareIcon.tsx +22 -0
- package/src/components/common/Icons/XTwitterIcon.tsx +14 -0
- package/src/components/common/Image/OptimizedImage.tsx +17 -0
- package/src/components/common/SettingsPanel.tsx +119 -0
- package/src/components/common/badge/Badge.tsx +69 -0
- package/src/components/common/blocks/BackgroundImageBlock.tsx +43 -0
- package/src/components/common/blocks/Carousel.tsx +59 -0
- package/src/components/common/blocks/CodeSnippet.tsx +46 -0
- package/src/components/common/blocks/InfinityScrollWrapper.tsx +43 -0
- package/src/components/common/blocks/SplitBlock.tsx +47 -0
- package/src/components/common/blocks/TopImageBlock.tsx +39 -0
- package/src/components/common/button/Button.tsx +49 -0
- package/src/components/common/button/ButtonWithActions.tsx +71 -0
- package/src/components/common/button/DropdownButton.tsx +61 -0
- package/src/components/common/button/ScrollDownArrow.tsx +23 -0
- package/src/components/common/button/SharerActionBox.tsx +248 -0
- package/src/components/common/button/UserButton.tsx +209 -0
- package/src/components/common/contact/ContactForm.tsx +214 -0
- package/src/components/common/cta/Cta.tsx +18 -0
- package/src/components/common/dialog/ConversationFullscreenModal.tsx +95 -0
- package/src/components/common/dialog/DeleteDialog.tsx +90 -0
- package/src/components/common/dialog/MobileFiltersDrawer.tsx +60 -0
- package/src/components/common/dialog/RenameDialog.tsx +128 -0
- package/src/components/common/faq/FAQSection.tsx +119 -0
- package/src/components/common/filters/NameSearch.tsx +87 -0
- package/src/components/common/footer/SmallFooter.tsx +62 -0
- package/src/components/common/forms/AdvanceAccordion.tsx +154 -0
- package/src/components/common/forms/CheckBox.tsx +29 -0
- package/src/components/common/forms/DateTimePicker.tsx +101 -0
- package/src/components/common/forms/Dropzone.tsx +278 -0
- package/src/components/common/forms/EmailTagInput.tsx +67 -0
- package/src/components/common/forms/FieldAssistantBar.tsx +32 -0
- package/src/components/common/forms/HTMLEditor.tsx +48 -0
- package/src/components/common/forms/IconPicker.tsx +129 -0
- package/src/components/common/forms/Input.tsx +362 -0
- package/src/components/common/forms/InputColor.tsx +36 -0
- package/src/components/common/forms/RadioInputs.tsx +62 -0
- package/src/components/common/forms/Select.tsx +214 -0
- package/src/components/common/forms/SimpleTagsInput.tsx +89 -0
- package/src/components/common/forms/TagInput.tsx +111 -0
- package/src/components/common/forms/Textarea.tsx +99 -0
- package/src/components/common/forms/ToggleButton.tsx +67 -0
- package/src/components/common/forms/UserInvitePicker.tsx +600 -0
- package/src/components/common/header/AppPageTitle.tsx +34 -0
- package/src/components/common/header/SubtitleAccordion.tsx +63 -0
- package/src/components/common/home/block/GetStarted.tsx +17 -0
- package/src/components/common/home/block/Hero.tsx +33 -0
- package/src/components/common/home/block/InstallShortcut.tsx +41 -0
- package/src/components/common/home/block/MarketplaceBlock.tsx +34 -0
- package/src/components/common/home/block/OriginStoryBanner.tsx +17 -0
- package/src/components/common/home/block/OsirusCTABlock.tsx +21 -0
- package/src/components/common/home/block/PromoFeatureSlider.tsx +260 -0
- package/src/components/common/layout/DetailHero.tsx +87 -0
- package/src/components/common/layout/SideNavLayout.tsx +1016 -0
- package/src/components/common/layout/account/AccountLayout.tsx +99 -0
- package/src/components/common/layout/admin/AdminLayout.tsx +17 -0
- package/src/components/common/layout/explore/ExploreLayout.tsx +23 -0
- package/src/components/common/layout/explore/ExploreLayoutContent.tsx +20 -0
- package/src/components/common/layout/explore/ExploreLayoutFilters.tsx +28 -0
- package/src/components/common/loading/LoadingScreen.tsx +86 -0
- package/src/components/common/loading/Spinner.tsx +12 -0
- package/src/components/common/state/InvalidInviteCard.tsx +32 -0
- package/src/components/common/table/TableFilter.tsx +205 -0
- package/src/components/common/table/TableHeader.tsx +33 -0
- package/src/components/common/table/TablePaging.tsx +190 -0
- package/src/components/common/table/TablePagingButton.tsx +64 -0
- package/src/components/common/table/TablePagingInput.tsx +79 -0
- package/src/components/common/useUrlSelectedModel.ts +7 -0
- package/src/components/docs/DocsSitePreviewPage.tsx +122 -0
- package/src/components/docs/block/DocsPageDetailBlock.tsx +333 -0
- package/src/components/docs/block/DocsSidebarTopContent.tsx +8 -0
- package/src/components/docs/block/DocsSitePagesBlock.tsx +81 -0
- package/src/components/docs/block/DocsSitesBlock.tsx +35 -0
- package/src/components/docs/modal/CreateDocsSiteModal.tsx +132 -0
- package/src/components/docs/table/DocsPagesTable.tsx +163 -0
- package/src/components/docs/table/DocsSitesTable.tsx +109 -0
- package/src/components/groups/block/GroupInitialAvatar.tsx +53 -0
- package/src/components/groups/grid/OrgGroupMembersGrid.tsx +253 -0
- package/src/components/groups/modal/AddGroupModal.tsx +138 -0
- package/src/components/groups/modal/OrgGroupMembersModal.tsx +171 -0
- package/src/components/groups/modal/OrgGroupPermissionsModal.tsx +184 -0
- package/src/components/groups/table/OrgGroupsTable.tsx +470 -0
- package/src/components/head/DefaultMetadata.tsx +135 -0
- package/src/components/head/PageSeo.tsx +198 -0
- package/src/components/hoc/WithAuth.tsx +82 -0
- package/src/components/hoc/WithCustomerIO.tsx +48 -0
- package/src/components/hoc/WithGTM.tsx +31 -0
- package/src/components/hoc/WithGlobalContext.tsx +30 -0
- package/src/components/hoc/WithReCaptcha.tsx +31 -0
- package/src/components/hoc/WithStripe.tsx +68 -0
- package/src/components/layout/SidebarSizer.tsx +63 -0
- package/src/components/layout/app-left-nav.tsx +31 -0
- package/src/components/layout/app-main-layout.tsx +39 -0
- package/src/components/layout/site-footer.tsx +11 -0
- package/src/components/layout/site-header.tsx +19 -0
- package/src/components/marketplace/card/ProductCard.tsx +178 -0
- package/src/components/media/blocks/MediaAttachmentsList.tsx +79 -0
- package/src/components/media/blocks/MediaDetails.tsx +139 -0
- package/src/components/media/blocks/MediaGrid.tsx +245 -0
- package/src/components/media/form/MediaMiniForm.tsx +105 -0
- package/src/components/media/form/UpdateMediaForm.tsx +209 -0
- package/src/components/media/items/CircleMediaPicker.tsx +76 -0
- package/src/components/media/items/MediaAttachmentLinks.tsx +98 -0
- package/src/components/media/items/MediaDocumentPreview.tsx +43 -0
- package/src/components/media/items/MediaFileIcon.tsx +30 -0
- package/src/components/media/items/MediaPickerBox.tsx +94 -0
- package/src/components/media/items/MediaPickerButton.tsx +37 -0
- package/src/components/media/items/MediaSourcePreview.tsx +35 -0
- package/src/components/media/modal/AddMediaModal.tsx +237 -0
- package/src/components/media/modal/MediaAttachmentsModal.tsx +113 -0
- package/src/components/media/modal/MediaBulkDeleteWarningModal.tsx +142 -0
- package/src/components/media/modal/MediaDeleteWarningModal.tsx +98 -0
- package/src/components/media/modal/MediaPickerModal.tsx +201 -0
- package/src/components/media/table/MediaTable.tsx +340 -0
- package/src/components/media/table/MediaTableActions.tsx +130 -0
- package/src/components/media/table/MediaTableFilter.tsx +163 -0
- package/src/components/modules/module-card-grid.tsx +19 -0
- package/src/components/modules/module-page.tsx +27 -0
- package/src/components/modules/resource-page.tsx +15 -0
- package/src/components/nav/AdminMobileMenu.tsx +228 -0
- package/src/components/nav/AppTopNav.tsx +53 -0
- package/src/components/nav/MobileMenu.tsx +132 -0
- package/src/components/nav/TopNav.tsx +137 -0
- package/src/components/openapi/DeleteTokenModal.tsx +72 -0
- package/src/components/openapi/actions/ApiTokenActionsMenu.tsx +141 -0
- package/src/components/openapi/actions/ApiTokenCreateModal.tsx +107 -0
- package/src/components/openapi/actions/ApiTokenEditModal.tsx +168 -0
- package/src/components/orgs/OrgCreateModal.tsx +126 -0
- package/src/components/orgs/OrgJumpRedirect.tsx +150 -0
- package/src/components/page/SiteContentPage.tsx +129 -0
- package/src/components/post/accordion/FilterPostCategoriesAccordion.tsx +126 -0
- package/src/components/post/block/FeaturedProductCard.tsx +31 -0
- package/src/components/post/block/FeaturedProviderCard.tsx +51 -0
- package/src/components/post/block/InTheNews.tsx +77 -0
- package/src/components/post/block/PostCardsGrid.tsx +56 -0
- package/src/components/post/block/PostContent.tsx +128 -0
- package/src/components/post/block/PostDetailPage.tsx +95 -0
- package/src/components/post/block/PostList.tsx +111 -0
- package/src/components/post/block/PostNextAndPrevButtons.tsx +78 -0
- package/src/components/post/block/PostPeopleAlsoReadBlock.tsx +69 -0
- package/src/components/post/block/PostRelatedCards.tsx +43 -0
- package/src/components/post/card/FeaturedPostCard.tsx +107 -0
- package/src/components/post/card/InTheNewsCard.tsx +162 -0
- package/src/components/post/card/PostCard.tsx +125 -0
- package/src/components/post/card/RelatedPostCard.tsx +115 -0
- package/src/components/post/form/UpdatePostForm.tsx +639 -0
- package/src/components/post/modal/CreatePostModal.tsx +115 -0
- package/src/components/post/modal/PreviewPostModal.tsx +82 -0
- package/src/components/post/nav/BlogCategoriesSideNav.tsx +55 -0
- package/src/components/post/table/PostsTable.tsx +284 -0
- package/src/components/pricing/block/AddOnRow.tsx +78 -0
- package/src/components/pricing/block/CompletePurchase.tsx +546 -0
- package/src/components/pricing/block/PlanPicker.tsx +76 -0
- package/src/components/pricing/card/PricingCard.tsx +291 -0
- package/src/components/pricing/form/AddBillingInformationForm.tsx +212 -0
- package/src/components/pricing/form/AddPaymentMethodForm.tsx +252 -0
- package/src/components/pricing/form/CouponCodeForm.tsx +118 -0
- package/src/components/pricing/form/StripePaymentForm.tsx +106 -0
- package/src/components/product/block/ProductScreenshot.tsx +22 -0
- package/src/components/product/block/ProductScreenshotPreview.tsx +46 -0
- package/src/components/product/button/MediaScreenshotPicker.tsx +72 -0
- package/src/components/product/form/UpdateProductForm.tsx +718 -0
- package/src/components/product/modal/CreateProductModal.tsx +128 -0
- package/src/components/product/modal/UpdateProductCouponModal.tsx +227 -0
- package/src/components/product/modal/UpdateProductPlanModal.tsx +291 -0
- package/src/components/product/modal/UpdateProductVersionModal.tsx +236 -0
- package/src/components/product/table/ProductCouponsTable.tsx +100 -0
- package/src/components/product/table/ProductPlansTable.tsx +118 -0
- package/src/components/product/table/ProductVersionsAdminTable.tsx +103 -0
- package/src/components/product/table/ProductVersionsTable.tsx +111 -0
- package/src/components/product/table/ProductsTable.tsx +133 -0
- package/src/components/projects/ProjectFilesCard.tsx +134 -0
- package/src/components/projects/ProjectItemOptionButton.tsx +112 -0
- package/src/components/projects/ProjectPickerNav.tsx +440 -0
- package/src/components/projects/ProjectQuickCreateModal.tsx +159 -0
- package/src/components/projects/ProjectSidebarList.tsx +183 -0
- package/src/components/projects/actions/ProjectActionsMenu.tsx +77 -0
- package/src/components/projects/actions/ProjectCreateModal.tsx +577 -0
- package/src/components/projects/actions/ProjectEditModal.tsx +345 -0
- package/src/components/projects/actions/ProjectFileGrid.tsx +153 -0
- package/src/components/projects/actions/ProjectFilesModal.tsx +259 -0
- package/src/components/projects/actions/ProjectFilesPicker.tsx +31 -0
- package/src/components/projects/actions/ProjectFilesUploadModal.tsx +181 -0
- package/src/components/projects/actions/ProjectInstructions.tsx +160 -0
- package/src/components/projects/actions/RenameProjectModal.tsx +120 -0
- package/src/components/projects/actions/index.tsx +98 -0
- package/src/components/projects/block/HeaderProjectImagePicker.tsx +52 -0
- package/src/components/projects/permission/ProjectPermissionInviteModal.tsx +181 -0
- package/src/components/projects/permission/ProjectUserPermission.tsx +170 -0
- package/src/components/projects/postByCategory.tsx +118 -0
- package/src/components/projects/projectFileHistory.tsx +48 -0
- package/src/components/projects/table/ProjectTable.tsx +365 -0
- package/src/components/provider/BuildspecForm.tsx +288 -0
- package/src/components/provider/CreateProviderModal.tsx +210 -0
- package/src/components/provider/FeaturedProviders.tsx +137 -0
- package/src/components/provider/ProviderConnectModal.tsx +324 -0
- package/src/components/provider/form/UpdateProviderForm.tsx +449 -0
- package/src/components/provider/table/ProvidersTable.tsx +144 -0
- package/src/components/providers/ProviderFeaturesSideNav.tsx +52 -0
- package/src/components/settings/SettingsLayout.tsx +14 -0
- package/src/components/settings/SettingsSidebarNav.tsx +53 -0
- package/src/components/settings/settingsNav.ts +96 -0
- package/src/components/site/modal/UpdateSiteModal.tsx +134 -0
- package/src/components/site/table/SiteTable.tsx +198 -0
- package/src/components/starter/list-panel.tsx +12 -0
- package/src/components/starter/starter-overview.tsx +32 -0
- package/src/components/starter/stats-grid.tsx +20 -0
- package/src/components/storage/VectorStoreFileDeleteButton.tsx +71 -0
- package/src/components/storage/actions/VectorStoreActionsMenu.tsx +70 -0
- package/src/components/storage/actions/VectorStoreEditModal.tsx +220 -0
- package/src/components/storage/actions/VectorStoreFileActions.tsx +61 -0
- package/src/components/storage/actions/index.tsx +76 -0
- package/src/components/storage/addStorageModal.tsx +552 -0
- package/src/components/storage/table/vectorStoreTable.tsx +461 -0
- package/src/components/storage/vectorFilesModal.tsx +209 -0
- package/src/components/storage/vectorStoreFileGrid.tsx +384 -0
- package/src/components/tag/modal/UpdateTagModal.tsx +192 -0
- package/src/components/tag/table/TagTable.tsx +138 -0
- package/src/components/user/block/BadgesBlock.tsx +26 -0
- package/src/components/user/form/ChangePasswordForm.tsx +119 -0
- package/src/components/user/form/ProfileForm.tsx +168 -0
- package/src/components/user/grid/UserGrid.tsx +475 -0
- package/src/components/user/modal/AddUserModal.tsx +165 -0
- package/src/components/user/modal/UpdateUserDetailsModal.tsx +319 -0
- package/src/components/user/modal/UpgradeUserLimitModal.tsx +123 -0
- package/src/components/user/modal/UserPermissionsModal.tsx +251 -0
- package/src/components/user/table/UserTable.tsx +202 -0
- package/src/config/app.ts +16 -0
- package/src/config/modules.ts +100 -0
- package/src/config/navigation.ts +28 -0
- package/src/config/runtime.ts +3 -0
- package/src/context/CheckoutContext.tsx +123 -0
- package/src/context/ProjectContext.tsx +123 -0
- package/src/context/RouterContext.tsx +127 -0
- package/src/context/UIContext.tsx +47 -0
- package/src/context/UserAuthContext.tsx +26 -0
- package/src/context/VectorStoreContext.tsx +51 -0
- package/src/context/index.ts +2 -0
- package/src/data/bootstrap-icons.json +2080 -0
- package/src/data/bootstrap.ts +196 -0
- package/src/data/bootstrapIcons.ts +28 -0
- package/src/enum/AppEnvironments.ts +4 -0
- package/src/enum/HTTPErrorStatus.ts +10 -0
- package/src/helpers/api/index.ts +123 -0
- package/src/helpers/constants/index.ts +4 -0
- package/src/helpers/constants/messages.ts +1 -0
- package/src/helpers/constants/regex.ts +10 -0
- package/src/helpers/constants/stripe.ts +1 -0
- package/src/helpers/constants/system-agent.ts +12 -0
- package/src/helpers/data-transform/bytesToSize.ts +8 -0
- package/src/helpers/data-transform/dropzone.ts +116 -0
- package/src/helpers/data-transform/filterUtils.ts +21 -0
- package/src/helpers/data-transform/index.ts +4 -0
- package/src/helpers/data-transform/operations.ts +3 -0
- package/src/helpers/data-transform/paging.ts +24 -0
- package/src/helpers/data-transform/stringCaseTransform.ts +34 -0
- package/src/helpers/date/index.ts +149 -0
- package/src/helpers/error/formErrorHandler.tsx +38 -0
- package/src/helpers/images/assets.ts +32 -0
- package/src/helpers/images/defaultProfileImage.ts +21 -0
- package/src/helpers/images/fileType.ts +123 -0
- package/src/helpers/images/index.ts +3 -0
- package/src/helpers/navigation/routeScroll.ts +29 -0
- package/src/helpers/pageScreenshot.ts +176 -0
- package/src/helpers/permissions/index.ts +292 -0
- package/src/helpers/providers/providerFeatures.ts +29 -0
- package/src/helpers/sharer/index.ts +44 -0
- package/src/helpers/sitemap/sitemap-utils.ts +50 -0
- package/src/helpers/slugUtils/index.ts +39 -0
- package/src/helpers/sonicVoices.ts +22 -0
- package/src/helpers/string/index.ts +93 -0
- package/src/helpers/theme/colors.ts +27 -0
- package/src/helpers/types/api.ts +22 -0
- package/src/helpers/types/customer-io.ts +47 -0
- package/src/helpers/types/data-layer.ts +25 -0
- package/src/helpers/types/index.ts +4 -0
- package/src/helpers/types/nav.ts +13 -0
- package/src/helpers/types/page-props.ts +31 -0
- package/src/helpers/types/select-option.ts +4 -0
- package/src/helpers/types/utils.ts +7 -0
- package/src/helpers/url/index.ts +26 -0
- package/src/hooks/auth/useAccountStore.ts +69 -0
- package/src/hooks/auth/useAuthStore.ts +162 -0
- package/src/hooks/category/useCategoryStore.ts +71 -0
- package/src/hooks/index.ts +17 -0
- package/src/hooks/media/useMediaStore.ts +46 -0
- package/src/hooks/post/usePostStore.ts +64 -0
- package/src/hooks/post/usePostUtils.ts +27 -0
- package/src/hooks/product/useProductPlanStore.ts +73 -0
- package/src/hooks/product/useProductStore.ts +64 -0
- package/src/hooks/product/useProductVersionStore.ts +57 -0
- package/src/hooks/site/useSiteStore.ts +53 -0
- package/src/hooks/tag/useTagStore.ts +65 -0
- package/src/hooks/utils/useAutosizeTextArea.ts +20 -0
- package/src/hooks/utils/useCountries.ts +25 -0
- package/src/hooks/utils/useGA4DataLayer.ts +25 -0
- package/src/hooks/utils/useNavOptions.ts +241 -0
- package/src/hooks/utils/useSearchAndFilterCommon.ts +78 -0
- package/src/hooks/utils/useTrackingEvents.ts +65 -0
- package/src/lib/app-paths.ts +19 -0
- package/src/lib/auth.ts +42 -0
- package/src/lib/next-router.ts +164 -0
- package/src/lib/routes.ts +36 -0
- package/src/lib/security.ts +19 -0
- package/src/pages/404.tsx +104 -0
- package/src/pages/500.tsx +26 -0
- package/src/pages/_app.tsx +87 -0
- package/src/pages/_document.tsx +26 -0
- package/src/pages/account/verify.tsx +178 -0
- package/src/pages/admin/activity/[activityId].tsx +77 -0
- package/src/pages/admin/activity/bans.tsx +197 -0
- package/src/pages/admin/activity/index.tsx +207 -0
- package/src/pages/admin/activity/settings.tsx +189 -0
- package/src/pages/admin/categories/index.tsx +61 -0
- package/src/pages/admin/coupons/index.tsx +38 -0
- package/src/pages/admin/entitlements/index.tsx +646 -0
- package/src/pages/admin/index.tsx +65 -0
- package/src/pages/admin/media/[id]/index.tsx +55 -0
- package/src/pages/admin/media/index.tsx +62 -0
- package/src/pages/admin/orgs/[orgId]/[name].tsx +1 -0
- package/src/pages/admin/orgs/index.tsx +256 -0
- package/src/pages/admin/plans/index.tsx +26 -0
- package/src/pages/admin/posts/[id].tsx +80 -0
- package/src/pages/admin/posts/index.tsx +63 -0
- package/src/pages/admin/products/[id].tsx +71 -0
- package/src/pages/admin/products/index.tsx +62 -0
- package/src/pages/admin/profile/index.tsx +26 -0
- package/src/pages/admin/providers/[id].tsx +77 -0
- package/src/pages/admin/providers/index.tsx +63 -0
- package/src/pages/admin/tags/index.tsx +58 -0
- package/src/pages/admin/users/[userId]/[name].tsx +1 -0
- package/src/pages/admin/users/index.tsx +295 -0
- package/src/pages/admin/versions/[id].tsx +211 -0
- package/src/pages/admin/versions/index.tsx +25 -0
- package/src/pages/blog/[postSlug].tsx +106 -0
- package/src/pages/blog/c/[categorySlug]/index.tsx +126 -0
- package/src/pages/blog/index.tsx +37 -0
- package/src/pages/cart/[productPlanSlug].tsx +631 -0
- package/src/pages/checkout/[productPlanSlug].tsx +368 -0
- package/src/pages/docs/index.tsx +24 -0
- package/src/pages/docs/sites/[siteId]/[siteName]/index.tsx +67 -0
- package/src/pages/docs/sites/[siteId]/[siteName]/pages/[pagesId].tsx +79 -0
- package/src/pages/docs/sites/[siteId]/[siteName]/pages/index.tsx +67 -0
- package/src/pages/docs/sites/[siteId]/[siteName]/preview/[[...slug]].tsx +7 -0
- package/src/pages/forgot.tsx +46 -0
- package/src/pages/groups/[groupId]/[name].tsx +337 -0
- package/src/pages/groups/index.tsx +62 -0
- package/src/pages/healthcheck.tsx +7 -0
- package/src/pages/index.tsx +309 -0
- package/src/pages/login.tsx +75 -0
- package/src/pages/marketplace/[slug].tsx +171 -0
- package/src/pages/marketplace/index.tsx +92 -0
- package/src/pages/openapi/index.tsx +77 -0
- package/src/pages/openapi/tokens/index.tsx +128 -0
- package/src/pages/org/[name]/settings.tsx +14 -0
- package/src/pages/org/[name]/token/index.tsx +109 -0
- package/src/pages/pricing.tsx +242 -0
- package/src/pages/projects/[projectId]/[name]/files/index.tsx +121 -0
- package/src/pages/projects/[projectId]/[name]/index.tsx +305 -0
- package/src/pages/projects/[projectId]/[name]/permission/index.tsx +143 -0
- package/src/pages/projects/[projectId]/token/index.tsx +120 -0
- package/src/pages/projects/index.tsx +129 -0
- package/src/pages/providers/[name].tsx +512 -0
- package/src/pages/providers/index.tsx +472 -0
- package/src/pages/reset.tsx +69 -0
- package/src/pages/settings/billing/index.tsx +41 -0
- package/src/pages/settings/index.tsx +133 -0
- package/src/pages/settings/organizations/[orgId]/invite/index.tsx +162 -0
- package/src/pages/settings/organizations/[orgId]/settings/index.tsx +98 -0
- package/src/pages/settings/organizations/[orgId]/token/index.tsx +109 -0
- package/src/pages/settings/organizations/index.tsx +148 -0
- package/src/pages/settings/organizations/new/index.tsx +252 -0
- package/src/pages/settings/profile/change-password.tsx +26 -0
- package/src/pages/settings/profile/index.tsx +103 -0
- package/src/pages/settings/profile/org-profile.tsx +127 -0
- package/src/pages/settings/profile/profile.tsx +26 -0
- package/src/pages/settings/sites/index.tsx +85 -0
- package/src/pages/settings/subscriptions/index.tsx +76 -0
- package/src/pages/settings/tokens/index.tsx +149 -0
- package/src/pages/signup/index.tsx +83 -0
- package/src/pages/signup/verify.tsx +138 -0
- package/src/pages/sites/[siteId]/[siteName]/[[...slug]].tsx +103 -0
- package/src/pages/sites/[siteId]/[siteName]/pages/[pageId].tsx +243 -0
- package/src/pages/sites/[siteId]/[siteName]/pages/index.tsx +140 -0
- package/src/pages/sites/host/[[...slug]].tsx +75 -0
- package/src/pages/storage/[vectorStoreId]/[name].tsx +653 -0
- package/src/pages/storage/index.tsx +526 -0
- package/src/pages/update/index.tsx +109 -0
- package/src/pages/update/verify.tsx +121 -0
- package/src/pages/users/[userId]/[name].tsx +791 -0
- package/src/pages/users/index.tsx +152 -0
- package/src/sass/app.scss +59 -0
- package/src/sass/base/_animations.scss +70 -0
- package/src/sass/base/_borders.scss +78 -0
- package/src/sass/base/_custom-backgrounds.scss +107 -0
- package/src/sass/base/_interactions.scss +35 -0
- package/src/sass/base/_main.scss +239 -0
- package/src/sass/base/_positions.scss +111 -0
- package/src/sass/base/_sizes.scss +120 -0
- package/src/sass/base/_typography.scss +184 -0
- package/src/sass/components/_accordion.scss +63 -0
- package/src/sass/components/_ad.scss +44 -0
- package/src/sass/components/_avatar.scss +18 -0
- package/src/sass/components/_badge.scss +6 -0
- package/src/sass/components/_button.scss +53 -0
- package/src/sass/components/_checkbox.scss +52 -0
- package/src/sass/components/_circle-media-picker.scss +32 -0
- package/src/sass/components/_code-snipped.scss +50 -0
- package/src/sass/components/_date-time-picker.scss +796 -0
- package/src/sass/components/_dialog.scss +27 -0
- package/src/sass/components/_gradients.scss +7 -0
- package/src/sass/components/_group-detail.scss +620 -0
- package/src/sass/components/_input.scss +567 -0
- package/src/sass/components/_menu.scss +31 -0
- package/src/sass/components/_modal.scss +273 -0
- package/src/sass/components/_popover.scss +29 -0
- package/src/sass/components/_rich-content.scss +531 -0
- package/src/sass/components/_spinner.scss +71 -0
- package/src/sass/components/_swagger.scss +7 -0
- package/src/sass/components/_swiper.scss +16 -0
- package/src/sass/components/_switch.scss +46 -0
- package/src/sass/components/_table.scss +39 -0
- package/src/sass/components/_tabs.scss +38 -0
- package/src/sass/components/_tag-input.scss +28 -0
- package/src/sass/components/_toast.scss +26 -0
- package/src/sass/components/_tooltip.scss +31 -0
- package/src/sass/layout/_base.scss +937 -0
- package/src/sass/layout/_footer.scss +148 -0
- package/src/sass/layout/_hero.scss +33 -0
- package/src/sass/layout/_nav.scss +77 -0
- package/src/sass/layout/_news-card-grid.scss +507 -0
- package/src/sass/utilities/_mixins.scss +21 -0
- package/src/sass/utilities/_sizes.scss +137 -0
- package/src/sass/utilities/_utils.scss +23 -0
- package/src/sass/utilities/_variables.scss +115 -0
- package/src/store/hooks.ts +5 -0
- package/src/store/hydrate.ts +1 -0
- package/src/store/model/activity.model.ts +52 -0
- package/src/store/model/address.model.ts +9 -0
- package/src/store/model/apiToken.model.ts +26 -0
- package/src/store/model/category.model.ts +20 -0
- package/src/store/model/entityStatus.model.ts +25 -0
- package/src/store/model/index.ts +25 -0
- package/src/store/model/invoice.model.ts +37 -0
- package/src/store/model/media.model.ts +70 -0
- package/src/store/model/org-group-permission.model.ts +16 -0
- package/src/store/model/org-group.model.ts +14 -0
- package/src/store/model/org-membership.model.ts +23 -0
- package/src/store/model/org.model.ts +13 -0
- package/src/store/model/page.model.ts +33 -0
- package/src/store/model/post.model.ts +60 -0
- package/src/store/model/product-coupon.model.ts +42 -0
- package/src/store/model/product-feature-entitlement.ts +40 -0
- package/src/store/model/product-feature.ts +29 -0
- package/src/store/model/product-plan.model.ts +120 -0
- package/src/store/model/product-version.model.ts +24 -0
- package/src/store/model/product.model.ts +91 -0
- package/src/store/model/project-file.model.ts +18 -0
- package/src/store/model/project-user-permission.model.ts +41 -0
- package/src/store/model/project.model.ts +48 -0
- package/src/store/model/provider.model.ts +118 -0
- package/src/store/model/purchase.model.ts +19 -0
- package/src/store/model/site-crawl-job.model.ts +31 -0
- package/src/store/model/site-page.model.ts +37 -0
- package/src/store/model/site.model.ts +15 -0
- package/src/store/model/subscription.model.ts +60 -0
- package/src/store/model/tag.model.ts +18 -0
- package/src/store/model/user-permission.model.ts +21 -0
- package/src/store/model/user.model.ts +97 -0
- package/src/store/model/vector-store-file.model.ts +40 -0
- package/src/store/model/vector-store.model.ts +41 -0
- package/src/store/slice/api/accountApiSlice.ts +92 -0
- package/src/store/slice/api/accountSlice.ts +57 -0
- package/src/store/slice/api/activityApiSlice.ts +218 -0
- package/src/store/slice/api/apiTokenSlice.ts +153 -0
- package/src/store/slice/api/authApiSlice.ts +220 -0
- package/src/store/slice/api/base-domain-api.ts +19 -0
- package/src/store/slice/api/billingUnitTypesApiSlice.ts +45 -0
- package/src/store/slice/api/bootstrapIconApiSlice.ts +36 -0
- package/src/store/slice/api/categoriesApiSlice.ts +101 -0
- package/src/store/slice/api/fontawesomeApiSlice.ts +43 -0
- package/src/store/slice/api/invoiceApiSlice.ts +37 -0
- package/src/store/slice/api/leadApiSlice.ts +48 -0
- package/src/store/slice/api/mediaApiSlice.ts +276 -0
- package/src/store/slice/api/orgApiSlice.ts +185 -0
- package/src/store/slice/api/orgGroupApiSlice.ts +146 -0
- package/src/store/slice/api/pageApiSlice.ts +111 -0
- package/src/store/slice/api/paymentApiSlice.ts +27 -0
- package/src/store/slice/api/postApiSlice.ts +369 -0
- package/src/store/slice/api/productCouponsApiSlice.ts +101 -0
- package/src/store/slice/api/productFeaturesApiSlice.ts +93 -0
- package/src/store/slice/api/productPlansApiSlice.ts +142 -0
- package/src/store/slice/api/productSubscriptionsApiSlice.ts +156 -0
- package/src/store/slice/api/productVersionsApiSlice.ts +116 -0
- package/src/store/slice/api/productsApiSlice.ts +169 -0
- package/src/store/slice/api/projectApiSlice.ts +135 -0
- package/src/store/slice/api/projectFileApiSlice.ts +152 -0
- package/src/store/slice/api/projectUserPermissionApiSlice.ts +153 -0
- package/src/store/slice/api/providerApiSlice.ts +259 -0
- package/src/store/slice/api/providerSettingApiSlice.ts +174 -0
- package/src/store/slice/api/siteApiSlice.ts +93 -0
- package/src/store/slice/api/stripeApiSlice.ts +114 -0
- package/src/store/slice/api/tagsApiSlice.ts +96 -0
- package/src/store/slice/api/userApiSlice.ts +305 -0
- package/src/store/slice/api/vectorStoreApiSlice.ts +119 -0
- package/src/store/slice/api/vectorStoreFileApiSlice.ts +127 -0
- package/src/store/store.ts +130 -0
- package/src/types/bootstrap.ts +30 -0
- package/tsconfig.json +103 -0
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
/* eslint-disable @next/next/no-img-element */
|
|
2
|
+
import { useEffect } from 'react'
|
|
3
|
+
import {
|
|
4
|
+
Drawer,
|
|
5
|
+
DrawerBody,
|
|
6
|
+
DrawerCloseButton,
|
|
7
|
+
DrawerContent,
|
|
8
|
+
DrawerFooter,
|
|
9
|
+
DrawerHeader,
|
|
10
|
+
DrawerOverlay,
|
|
11
|
+
} from '@chakra-ui/react'
|
|
12
|
+
import { FieldValues, SubmitHandler, useForm } from 'react-hook-form'
|
|
13
|
+
import { toast } from 'react-toastify'
|
|
14
|
+
import { Category, CategoryPayload } from '@store/model'
|
|
15
|
+
import { useCategoryStore } from '@hooks'
|
|
16
|
+
import Button from '@components/common/button/Button'
|
|
17
|
+
import Input from '@components/common/forms/Input'
|
|
18
|
+
import { HTTPErrorStatus } from '@enum/HTTPErrorStatus'
|
|
19
|
+
import { DEFAULT_ERROR_MESSAGE, SLUG_REGEX } from '@helpers/constants'
|
|
20
|
+
import { transformToURLFormat } from '@helpers/string'
|
|
21
|
+
|
|
22
|
+
interface FormValues extends FieldValues {
|
|
23
|
+
slug: string
|
|
24
|
+
name: string
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export const UpdateCategoryModal = ({
|
|
28
|
+
category,
|
|
29
|
+
isOpen,
|
|
30
|
+
onClose,
|
|
31
|
+
}: {
|
|
32
|
+
category?: Category
|
|
33
|
+
isOpen: boolean
|
|
34
|
+
onClose: () => void
|
|
35
|
+
}) => {
|
|
36
|
+
const {
|
|
37
|
+
saveCategory,
|
|
38
|
+
isCategorySlugOrNameAvailable,
|
|
39
|
+
generateUniqueCategorySlug,
|
|
40
|
+
} = useCategoryStore()
|
|
41
|
+
|
|
42
|
+
const {
|
|
43
|
+
register,
|
|
44
|
+
handleSubmit,
|
|
45
|
+
setError,
|
|
46
|
+
getValues,
|
|
47
|
+
clearErrors,
|
|
48
|
+
reset,
|
|
49
|
+
formState: { errors, isSubmitting },
|
|
50
|
+
} = useForm<FormValues>({
|
|
51
|
+
defaultValues: {
|
|
52
|
+
slug: category?.slug || '',
|
|
53
|
+
name: category?.name || '',
|
|
54
|
+
},
|
|
55
|
+
})
|
|
56
|
+
|
|
57
|
+
useEffect(() => {
|
|
58
|
+
reset({
|
|
59
|
+
slug: category?.slug || '',
|
|
60
|
+
name: category?.name || '',
|
|
61
|
+
})
|
|
62
|
+
}, [category, reset])
|
|
63
|
+
|
|
64
|
+
const onSubmit: SubmitHandler<FormValues> = async (data) => {
|
|
65
|
+
try {
|
|
66
|
+
if (!category) {
|
|
67
|
+
const slugFromName = transformToURLFormat(data.name)
|
|
68
|
+
const slug = await generateUniqueCategorySlug(slugFromName)
|
|
69
|
+
data.slug = slug
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
await saveCategory(!category, { ...category, ...data } as CategoryPayload)
|
|
73
|
+
reset()
|
|
74
|
+
toast.success('Your category has been saved successfully')
|
|
75
|
+
onClose()
|
|
76
|
+
} catch (error: any) {
|
|
77
|
+
toast.error(
|
|
78
|
+
error.status !== HTTPErrorStatus.INTERNAL_SERVER_ERROR
|
|
79
|
+
? error.data.message
|
|
80
|
+
: DEFAULT_ERROR_MESSAGE
|
|
81
|
+
)
|
|
82
|
+
setError('server-error', { type: 'custom', message: 'server-error' })
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return (
|
|
87
|
+
<Drawer isOpen={isOpen} onClose={onClose} size='xl'>
|
|
88
|
+
<DrawerOverlay />
|
|
89
|
+
<DrawerContent className='drawer'>
|
|
90
|
+
<DrawerCloseButton />
|
|
91
|
+
<DrawerHeader>{!category ? 'Add' : 'Update'} Category</DrawerHeader>
|
|
92
|
+
|
|
93
|
+
<DrawerBody>
|
|
94
|
+
<form id='tag-update-form' onSubmit={handleSubmit(onSubmit)}>
|
|
95
|
+
{category && (
|
|
96
|
+
<div className='w-100 mb-4 mt-3'>
|
|
97
|
+
<Input
|
|
98
|
+
register={register('slug', {
|
|
99
|
+
required: 'This field is required',
|
|
100
|
+
pattern: {
|
|
101
|
+
value: SLUG_REGEX,
|
|
102
|
+
message:
|
|
103
|
+
'The slug must only contain lowercase letters, numbers, and hyphen',
|
|
104
|
+
},
|
|
105
|
+
minLength: {
|
|
106
|
+
value: 2,
|
|
107
|
+
message: 'Your tag slug must have at least 2 characters',
|
|
108
|
+
},
|
|
109
|
+
validate: async (value) =>
|
|
110
|
+
await isCategorySlugOrNameAvailable(
|
|
111
|
+
value,
|
|
112
|
+
'slug',
|
|
113
|
+
category
|
|
114
|
+
),
|
|
115
|
+
})}
|
|
116
|
+
customErrorMessage='This slug is already taken'
|
|
117
|
+
errors={errors}
|
|
118
|
+
placeholder='Enter your tag slug'
|
|
119
|
+
label='Slug'
|
|
120
|
+
getValues={getValues}
|
|
121
|
+
/>
|
|
122
|
+
</div>
|
|
123
|
+
)}
|
|
124
|
+
<div className={`w-100 mb-4 ${!category ? 'mt-3' : ''}`}>
|
|
125
|
+
<Input
|
|
126
|
+
register={register('name', {
|
|
127
|
+
required: 'This field is required',
|
|
128
|
+
minLength: {
|
|
129
|
+
value: 2,
|
|
130
|
+
message:
|
|
131
|
+
'Your category name must have at least 2 characters',
|
|
132
|
+
},
|
|
133
|
+
validate: async (value) =>
|
|
134
|
+
await isCategorySlugOrNameAvailable(
|
|
135
|
+
value,
|
|
136
|
+
'name',
|
|
137
|
+
category
|
|
138
|
+
),
|
|
139
|
+
})}
|
|
140
|
+
customErrorMessage='This name is already taken'
|
|
141
|
+
errors={errors}
|
|
142
|
+
placeholder='Enter your category name'
|
|
143
|
+
label='Name'
|
|
144
|
+
getValues={getValues}
|
|
145
|
+
/>
|
|
146
|
+
</div>
|
|
147
|
+
</form>
|
|
148
|
+
</DrawerBody>
|
|
149
|
+
|
|
150
|
+
<DrawerFooter>
|
|
151
|
+
<Button ariaLabel='Cancel' onClick={onClose}>
|
|
152
|
+
Cancel
|
|
153
|
+
</Button>
|
|
154
|
+
<Button
|
|
155
|
+
type='submit'
|
|
156
|
+
className='text-white'
|
|
157
|
+
ariaLabel='Save category Changes'
|
|
158
|
+
color='primary'
|
|
159
|
+
form='tag-update-form'
|
|
160
|
+
isLoading={isSubmitting}
|
|
161
|
+
disabled={isSubmitting}
|
|
162
|
+
onClick={() => clearErrors(['server-error'])}
|
|
163
|
+
>
|
|
164
|
+
Save
|
|
165
|
+
</Button>
|
|
166
|
+
</DrawerFooter>
|
|
167
|
+
</DrawerContent>
|
|
168
|
+
</Drawer>
|
|
169
|
+
)
|
|
170
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/* eslint-disable @next/next/no-img-element */
|
|
2
|
+
import { SyntheticEvent, useState } from 'react'
|
|
3
|
+
import { useRouter } from '@lib/next-router'
|
|
4
|
+
import { useDisclosure } from '@chakra-ui/react'
|
|
5
|
+
import isEmpty from 'lodash/isEmpty'
|
|
6
|
+
import { Category } from '@store/model'
|
|
7
|
+
import { useGetPostCategoriesQuery } from '@store/slice/api/categoriesApiSlice'
|
|
8
|
+
import { useCategoryStore } from '@hooks'
|
|
9
|
+
import { UpdateCategoryModal } from '@components/category/modal/UpdateCategoryModal'
|
|
10
|
+
import Button from '@components/common/button/Button'
|
|
11
|
+
import { DeleteDialog } from '@components/common/dialog/DeleteDialog'
|
|
12
|
+
import Spinner from '@components/common/loading/Spinner'
|
|
13
|
+
import TableFilter from '@components/common/table/TableFilter'
|
|
14
|
+
import { truncateString } from '@helpers/string'
|
|
15
|
+
|
|
16
|
+
export const CategoryTable = () => {
|
|
17
|
+
const {
|
|
18
|
+
query: { nameLike },
|
|
19
|
+
} = useRouter()
|
|
20
|
+
|
|
21
|
+
const {
|
|
22
|
+
isOpen: isDialogOpen,
|
|
23
|
+
onOpen: onOpenDialog,
|
|
24
|
+
onClose: onCloseDialog,
|
|
25
|
+
} = useDisclosure()
|
|
26
|
+
|
|
27
|
+
const {
|
|
28
|
+
isOpen: isOpenUpdateModal,
|
|
29
|
+
onOpen: onOpenUpdateModal,
|
|
30
|
+
onClose: onCloseUpdateModal,
|
|
31
|
+
} = useDisclosure()
|
|
32
|
+
|
|
33
|
+
const { removeCategory } = useCategoryStore()
|
|
34
|
+
|
|
35
|
+
const {
|
|
36
|
+
data: categories,
|
|
37
|
+
isFetching,
|
|
38
|
+
isLoading,
|
|
39
|
+
} = useGetPostCategoriesQuery({
|
|
40
|
+
nameLike: (nameLike?.toString() as string) || undefined,
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
const [activeCategory, setActiveCategory] = useState<Category | null>(null)
|
|
44
|
+
|
|
45
|
+
const onRowClick = (event: SyntheticEvent, category: Category) => {
|
|
46
|
+
const parent = (event.target as HTMLElement).closest('[data-type]')
|
|
47
|
+
const type = parent?.getAttribute('data-type')
|
|
48
|
+
setActiveCategory(category)
|
|
49
|
+
|
|
50
|
+
if (type === 'action') {
|
|
51
|
+
onOpenDialog()
|
|
52
|
+
return
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
onOpenUpdateModal()
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return (
|
|
59
|
+
<>
|
|
60
|
+
<TableFilter
|
|
61
|
+
type='category'
|
|
62
|
+
isStatusFilterHidden
|
|
63
|
+
isCategoryFilterHidden
|
|
64
|
+
/>
|
|
65
|
+
|
|
66
|
+
<div className='mt-4'>
|
|
67
|
+
<table className='table'>
|
|
68
|
+
<thead>
|
|
69
|
+
<tr>
|
|
70
|
+
<th scope='col' className='w-lg-90-down'>
|
|
71
|
+
Name
|
|
72
|
+
</th>
|
|
73
|
+
<th scope='col' className='opacity-0 w-xs-100p'>
|
|
74
|
+
Actions
|
|
75
|
+
</th>
|
|
76
|
+
</tr>
|
|
77
|
+
</thead>
|
|
78
|
+
<tbody>
|
|
79
|
+
{categories &&
|
|
80
|
+
!isFetching &&
|
|
81
|
+
categories.map((category, key) => (
|
|
82
|
+
<tr
|
|
83
|
+
key={key}
|
|
84
|
+
className='pointer'
|
|
85
|
+
onClick={(e) => onRowClick(e, category)}
|
|
86
|
+
>
|
|
87
|
+
<td className='align-middle'>
|
|
88
|
+
{truncateString(category.name, 80)}
|
|
89
|
+
</td>
|
|
90
|
+
<td className='text-center align-middle'>
|
|
91
|
+
<Button
|
|
92
|
+
className='no-min-size w-xs-50p h-100 bg-hover-background'
|
|
93
|
+
data-type='action'
|
|
94
|
+
>
|
|
95
|
+
<span className='bi bi-trash'></span>
|
|
96
|
+
</Button>
|
|
97
|
+
</td>
|
|
98
|
+
</tr>
|
|
99
|
+
))}
|
|
100
|
+
</tbody>
|
|
101
|
+
</table>
|
|
102
|
+
|
|
103
|
+
{isFetching && (
|
|
104
|
+
<div className='w-100 d-flex justify-content-center py-4'>
|
|
105
|
+
<Spinner color='primary' />
|
|
106
|
+
</div>
|
|
107
|
+
)}
|
|
108
|
+
|
|
109
|
+
{!isLoading && !isFetching && isEmpty(categories) && (
|
|
110
|
+
<div className='d-flex flex-column align-items-center justify-content-center'>
|
|
111
|
+
{nameLike ? (
|
|
112
|
+
<p>{`There are no categories to show that match your search`}</p>
|
|
113
|
+
) : (
|
|
114
|
+
<p>{`You don't have any categories yet`}</p>
|
|
115
|
+
)}
|
|
116
|
+
</div>
|
|
117
|
+
)}
|
|
118
|
+
</div>
|
|
119
|
+
|
|
120
|
+
{activeCategory && (
|
|
121
|
+
<>
|
|
122
|
+
<UpdateCategoryModal
|
|
123
|
+
category={activeCategory}
|
|
124
|
+
isOpen={isOpenUpdateModal}
|
|
125
|
+
onClose={onCloseUpdateModal}
|
|
126
|
+
/>
|
|
127
|
+
<DeleteDialog
|
|
128
|
+
isOpen={isDialogOpen}
|
|
129
|
+
onClose={onCloseDialog}
|
|
130
|
+
entityDescription={`${activeCategory.name}`}
|
|
131
|
+
onDelete={() => removeCategory(activeCategory)}
|
|
132
|
+
/>
|
|
133
|
+
</>
|
|
134
|
+
)}
|
|
135
|
+
</>
|
|
136
|
+
)
|
|
137
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SVGProps } from 'react'
|
|
2
|
+
|
|
3
|
+
export function BrainCircuitIcon(props: SVGProps<SVGSVGElement>) {
|
|
4
|
+
return (
|
|
5
|
+
<svg
|
|
6
|
+
xmlns='http://www.w3.org/2000/svg'
|
|
7
|
+
viewBox='0 0 512 512'
|
|
8
|
+
fill='currentColor'
|
|
9
|
+
{...props}
|
|
10
|
+
>
|
|
11
|
+
<path d='M137.9 48.3C145 20.5 170.1 0 200 0c24.1 0 45.1 13.3 56 33c10.9-19.7 31.9-33 56-33c29.9 0 55 20.5 62.1 48.3C406.6 51.3 432 78.7 432 112c0 6.7-1 13.1-2.9 19.1c29.5 9 50.9 36.4 50.9 68.9c0 12.4-3.1 24.1-8.7 34.3C495.6 248 512 274.1 512 304c0 33.3-20.4 61.9-49.4 73.9c.9 4.6 1.4 9.3 1.4 14.1c0 39.8-32.2 72-72 72c-3.7 0-7.2-.3-10.8-.8C373 491.4 346.9 512 316 512c-26 0-48.5-14.6-60-36c-11.5 21.4-34 36-60 36c-30.9 0-57-20.6-65.2-48.8c-3.5 .5-7.1 .8-10.8 .8c-39.8 0-72-32.2-72-72c0-4.8 .5-9.5 1.4-14.1C20.4 365.9 0 337.3 0 304c0-29.9 16.4-56 40.7-69.7C35.1 224.1 32 212.4 32 200c0-32.4 21.4-59.8 50.9-68.9C81 125.1 80 118.7 80 112c0-33.3 25.4-60.7 57.9-63.7zM200 16c-24.2 0-44.2 17.9-47.5 41.1c-.6 4-4 6.9-8 6.9l-.5 0c-26.5 0-48 21.5-48 48c0 7.7 1.8 14.9 5 21.3c1.1 2.3 1.1 5-.1 7.2s-3.3 3.8-5.8 4.2C68.4 149 48 172.1 48 200c0 12.3 4 23.6 10.7 32.9c1.4 2 1.9 4.5 1.2 6.9s-2.4 4.3-4.6 5.2C32.2 254.6 16 277.4 16 304c0 28.8 19 53.2 45.3 61.2c2 .6 3.7 2 4.7 3.9s1.2 4.1 .6 6.1C64.9 380.5 64 386.2 64 392c0 30.9 25.1 56 56 56c5.1 0 10-.7 14.7-1.9c2.2-.6 4.5-.2 6.4 1s3.2 3.2 3.6 5.4c4 24.7 25.5 43.5 51.3 43.5c27.6 0 50.1-21.4 51.9-48.5c0-.3 .1-.6 .1-.9V444 288H192c-13.3 0-24 10.7-24 24v9c13.8 3.6 24 16.1 24 31c0 17.7-14.3 32-32 32s-32-14.3-32-32c0-14.9 10.2-27.4 24-31v-9c0-22.1 17.9-40 40-40h56V152H207c-3.6 13.8-16.1 24-31 24c-17.7 0-32-14.3-32-32s14.3-32 32-32c14.9 0 27.4 10.2 31 24h41V64c0-26.5-21.5-48-48-48zm64 136V360h73c3.6-13.8 16.1-24 31-24c17.7 0 32 14.3 32 32s-14.3 32-32 32c-14.9 0-27.4-10.2-31-24H264v68 2.6c.1 .3 .1 .6 .1 .9c1.8 27.1 24.3 48.5 51.9 48.5c25.8 0 47.3-18.8 51.3-43.5c.4-2.2 1.7-4.2 3.6-5.4s4.2-1.6 6.4-1c4.7 1.3 9.6 1.9 14.7 1.9c30.9 0 56-25.1 56-56c0-5.8-.9-11.5-2.5-16.7c-.6-2-.4-4.2 .6-6.1s2.7-3.3 4.7-3.9c26.2-8 45.3-32.4 45.3-61.2c0-26.6-16.2-49.4-39.3-59.1c-2.3-.9-4-2.9-4.6-5.2s-.2-4.9 1.2-6.9C460 223.6 464 212.3 464 200c0-27.9-20.4-51-47-55.3c-2.5-.4-4.7-2-5.8-4.2s-1.2-4.9-.1-7.2c3.2-6.4 5-13.6 5-21.3c0-26.5-21.5-48-48-48l-.5 0c-4 0-7.4-2.9-8-6.9C356.2 33.9 336.2 16 312 16c-26.5 0-48 21.5-48 48v72h56c22.1 0 40 17.9 40 40v17c13.8 3.6 24 16.1 24 31c0 17.7-14.3 32-32 32s-32-14.3-32-32c0-14.9 10.2-27.4 24-31V176c0-13.3-10.7-24-24-24H264zm-88 8a16 16 0 1 0 0-32 16 16 0 1 0 0 32zM160 368a16 16 0 1 0 0-32 16 16 0 1 0 0 32zM368 224a16 16 0 1 0 -32 0 16 16 0 1 0 32 0zm0 160a16 16 0 1 0 0-32 16 16 0 1 0 0 32z' />
|
|
12
|
+
</svg>
|
|
13
|
+
)
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SVGProps } from 'react'
|
|
2
|
+
|
|
3
|
+
export function MagnifyingGlassChartIcon(props: SVGProps<SVGSVGElement>) {
|
|
4
|
+
return (
|
|
5
|
+
<svg
|
|
6
|
+
xmlns='http://www.w3.org/2000/svg'
|
|
7
|
+
viewBox='0 0 512 512'
|
|
8
|
+
fill='currentColor'
|
|
9
|
+
{...props}
|
|
10
|
+
>
|
|
11
|
+
<path d='M208 16a192 192 0 1 1 0 384 192 192 0 1 1 0-384zm0 400c54.6 0 104.2-21 141.3-55.4l149 149c3.1 3.1 8.2 3.1 11.3 0s3.1-8.2 0-11.3l-149-149C395 312.2 416 262.6 416 208C416 93.1 322.9 0 208 0S0 93.1 0 208S93.1 416 208 416zM112 192c-17.7 0-32 14.3-32 32l0 64c0 17.7 14.3 32 32 32s32-14.3 32-32V224c0-17.7-14.3-32-32-32zm96-96c-17.7 0-32 14.3-32 32V288c0 17.7 14.3 32 32 32s32-14.3 32-32V128c0-17.7-14.3-32-32-32zm96 64c-17.7 0-32 14.3-32 32v96c0 17.7 14.3 32 32 32s32-14.3 32-32V192c0-17.7-14.3-32-32-32zM112 208c8.8 0 16 7.2 16 16v64c0 8.8-7.2 16-16 16s-16-7.2-16-16V224c0-8.8 7.2-16 16-16zm96-96c8.8 0 16 7.2 16 16V288c0 8.8-7.2 16-16 16s-16-7.2-16-16V128c0-8.8 7.2-16 16-16zm96 64c8.8 0 16 7.2 16 16v96c0 8.8-7.2 16-16 16s-16-7.2-16-16V192c0-8.8 7.2-16 16-16z' />
|
|
12
|
+
</svg>
|
|
13
|
+
)
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SVGProps } from 'react'
|
|
2
|
+
|
|
3
|
+
export function PeopleGroupIcon(props: SVGProps<SVGSVGElement>) {
|
|
4
|
+
return (
|
|
5
|
+
<svg
|
|
6
|
+
xmlns='http://www.w3.org/2000/svg'
|
|
7
|
+
viewBox='0 0 640 512'
|
|
8
|
+
fill='currentColor'
|
|
9
|
+
{...props}
|
|
10
|
+
>
|
|
11
|
+
<path d='M88 88a40 40 0 1 1 80 0A40 40 0 1 1 88 88zm96 0A56 56 0 1 0 72 88a56 56 0 1 0 112 0zm288 0a40 40 0 1 1 80 0 40 40 0 1 1 -80 0zm96 0A56 56 0 1 0 456 88a56 56 0 1 0 112 0zM64 256c-4.4 0-8 3.6-8 8v98.2c-24.2-16.9-40-45-40-76.7c0-51.7 41.9-93.5 93.5-93.5h36.9c18.8 0 36.3 5.6 51 15.1c3.7-4 7.6-7.8 11.7-11.4c-17.8-12.4-39.4-19.7-62.7-19.7H109.5C49 176 0 225 0 285.5c0 41.1 22.6 76.8 56 95.6V432c0 17.7 14.3 32 32 32h80c17.7 0 32-14.3 32-32V403.6c-5.9-6.2-11.3-12.8-16-20V432c0 8.8-7.2 16-16 16H88c-8.8 0-16-7.2-16-16V264c0-4.4-3.6-8-8-8zM440 432c0 17.7 14.3 32 32 32h80c17.7 0 32-14.3 32-32V381.1c33.4-18.7 56-54.5 56-95.6C640 225 591 176 530.5 176H493.5c-23.3 0-44.9 7.3-62.7 19.7c4.1 3.6 8 7.4 11.7 11.4c14.7-9.6 32.2-15.1 51-15.1h36.9c51.7 0 93.5 41.9 93.5 93.5c0 31.7-15.8 59.8-40 76.7V264c0-4.4-3.6-8-8-8s-8 3.6-8 8V432c0 8.8-7.2 16-16 16H472c-8.8 0-16-7.2-16-16V383.6c-4.7 7.1-10.1 13.8-16 20V432zM272 96a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zm112 0A64 64 0 1 0 256 96a64 64 0 1 0 128 0zM256 272c-4.4 0-8 3.6-8 8v98.2c-24.2-16.9-40-45-40-76.7c0-51.7 41.9-93.5 93.5-93.5h36.9c51.7 0 93.5 41.9 93.5 93.5c0 31.7-15.8 59.8-40 76.7V280c0-4.4-3.6-8-8-8s-8 3.6-8 8V448c0 8.8-7.2 16-16 16H280c-8.8 0-16-7.2-16-16V280c0-4.4-3.6-8-8-8zm-8 125.1V448c0 17.7 14.3 32 32 32h80c17.7 0 32-14.3 32-32V397.1c33.4-18.7 56-54.5 56-95.6C448 241 399 192 338.5 192H301.5C241 192 192 241 192 301.5c0 41.1 22.6 76.8 56 95.6z' />
|
|
12
|
+
</svg>
|
|
13
|
+
)
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SVGProps } from 'react'
|
|
2
|
+
|
|
3
|
+
export function ScrewdriverWrenchIcon(props: SVGProps<SVGSVGElement>) {
|
|
4
|
+
return (
|
|
5
|
+
<svg
|
|
6
|
+
xmlns='http://www.w3.org/2000/svg'
|
|
7
|
+
viewBox='0 0 512 512'
|
|
8
|
+
fill='currentColor'
|
|
9
|
+
{...props}
|
|
10
|
+
>
|
|
11
|
+
<path d='M7 47L47 7c8.5-8.5 22-9.4 31.6-2.1l104 80c5.9 4.5 9.4 11.6 9.4 19v64 8 4.7L287.3 276c30.3-24.7 75-22.9 103.3 5.4l112 112c12.5 12.5 12.5 32.8 0 45.3l-64 64c-12.5 12.5-32.8 12.5-45.3 0l-112-112c-28.3-28.3-30-73-5.4-103.3L180.7 192H176h-8H104c-7.5 0-14.5-3.5-19-9.4L5 78.6C-2.4 69.1-1.5 55.6 7 47zM168 176h8v-8V104c0-2.5-1.2-4.8-3.1-6.3l-104-80c-3.2-2.4-7.7-2.2-10.5 .7l-40 40c-2.8 2.8-3.1 7.3-.7 10.5l80 104c1.5 2 3.9 3.1 6.3 3.1h64zM379.3 292.7c-23.9-23.9-62.7-23.9-86.6 0s-23.9 62.7 0 86.6l112 112c6.2 6.2 16.4 6.2 22.6 0l64-64c6.2-6.2 6.2-16.4 0-22.6l-112-112zM21.5 386.5L170.1 237.9l11.3 11.3L32.9 397.8C22.1 408.6 16 423.2 16 438.5C16 470.2 41.8 496 73.5 496c15.3 0 29.9-6.1 40.7-16.9L230.2 363.2c1.5 5.7 3.4 11.4 5.8 16.8L125.5 490.5C111.7 504.3 93 512 73.5 512C32.9 512 0 479.1 0 438.5c0-19.5 7.7-38.2 21.5-52zM496 160c0-17.2-3-33.6-8.5-48.9L416 182.6c-6 6-14.1 9.4-22.6 9.4H352c-17.7 0-32-14.3-32-32V118.6c0-8.5 3.4-16.6 9.4-22.6l71.5-71.5C385.6 19 369.2 16 352 16c-50.7 0-95.3 26.2-121 65.8l-12.7-9.8C246.9 28.6 296.1 0 352 0c20.1 0 39.4 3.7 57.1 10.5c10 3.8 11.8 16.5 4.3 24.1l-72.7 72.7c-3 3-4.7 7.1-4.7 11.3V160c0 8.8 7.2 16 16 16h41.4c4.2 0 8.3-1.7 11.3-4.7l72.7-72.7c7.6-7.6 20.3-5.7 24.1 4.3c6.8 17.7 10.5 37 10.5 57.1c0 53.8-26.5 101.3-67.2 130.3l-11.5-11.5C471.2 252.9 496 209.3 496 160zM80 416a16 16 0 1 1 0 32 16 16 0 1 1 0-32z' />
|
|
12
|
+
</svg>
|
|
13
|
+
)
|
|
14
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { SVGProps } from 'react'
|
|
2
|
+
|
|
3
|
+
export function SendMessageIcon(props: SVGProps<SVGSVGElement>) {
|
|
4
|
+
return (
|
|
5
|
+
<svg
|
|
6
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
7
|
+
height="1em"
|
|
8
|
+
viewBox="0 0 512 512"
|
|
9
|
+
fill='currentColor'
|
|
10
|
+
{...props}
|
|
11
|
+
>
|
|
12
|
+
<path d="M49.9 27.8C15.1 12.7-19.2 50.1-1.2 83.5L68.1 212.2c4.4 8.3 12.6 13.8 21.9 15c0 0 0 0 0 0l176 22c3.4 .4 6 3.3 6 6.7s-2.6 6.3-6 6.7l-176 22s0 0 0 0c-9.3 1.2-17.5 6.8-21.9 15L-1.2 428.5c-18 33.4 16.3 70.8 51.1 55.7L491.8 292.7c32.1-13.9 32.1-59.5 0-73.4L49.9 27.8z"/>
|
|
13
|
+
</svg>
|
|
14
|
+
)
|
|
15
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { SVGProps } from 'react'
|
|
2
|
+
|
|
3
|
+
export function ShareIcon(props: SVGProps<SVGSVGElement>) {
|
|
4
|
+
return (
|
|
5
|
+
<svg
|
|
6
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
7
|
+
viewBox="0 0 144 144"
|
|
8
|
+
fill='currentColor'
|
|
9
|
+
{...props}
|
|
10
|
+
>
|
|
11
|
+
<path d="M109.95,55.73c-5.27,0-10,2.35-13.2,6.06L51.71,30.71c1.05-2.24,1.64-4.74,1.64-7.37
|
|
12
|
+
c0-9.61-7.82-17.44-17.44-17.44s-17.44,7.82-17.44,17.44s7.82,17.44,17.44,17.44c5.53,0,10.46-2.59,13.66-6.62l44.9,30.98
|
|
13
|
+
c-1.25,2.4-1.96,5.13-1.96,8.02c0,3.04,0.79,5.9,2.16,8.4l-44.05,30.4c-3.1-4.85-8.53-8.08-14.7-8.08
|
|
14
|
+
c-9.61,0-17.44,7.82-17.44,17.44c0,9.61,7.82,17.44,17.44,17.44s17.44-7.82,17.44-17.44c0-1.98-0.34-3.89-0.95-5.66l44.62-30.79
|
|
15
|
+
c3.19,3.52,7.8,5.74,12.92,5.74c9.61,0,17.44-7.82,17.44-17.44C127.38,63.55,119.56,55.73,109.95,55.73z M35.92,36.72
|
|
16
|
+
c-7.38,0-13.39-6.01-13.39-13.39S28.53,9.95,35.92,9.95S49.3,15.95,49.3,23.34S43.3,36.72,35.92,36.72z M35.92,134.7
|
|
17
|
+
c-7.38,0-13.39-6.01-13.39-13.39c0-7.38,6.01-13.39,13.39-13.39s13.39,6.01,13.39,13.39C49.3,128.7,43.3,134.7,35.92,134.7z
|
|
18
|
+
M109.95,86.55c-7.38,0-13.39-6.01-13.39-13.39c0-7.38,6.01-13.39,13.39-13.39s13.39,6.01,13.39,13.39
|
|
19
|
+
C123.34,80.54,117.33,86.55,109.95,86.55z"/>
|
|
20
|
+
</svg>
|
|
21
|
+
)
|
|
22
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SVGProps } from 'react'
|
|
2
|
+
|
|
3
|
+
export function XTwitterIcon(props: SVGProps<SVGSVGElement>) {
|
|
4
|
+
return (
|
|
5
|
+
<svg
|
|
6
|
+
xmlns='http://www.w3.org/2000/svg'
|
|
7
|
+
viewBox='0 0 512 512'
|
|
8
|
+
fill='currentColor'
|
|
9
|
+
{...props}
|
|
10
|
+
>
|
|
11
|
+
<path d='M389.2 48h70.6L305.6 224.2 487 464H345L233.7 318.6 106.5 464H35.8L200.7 275.5 26.8 48H172.4L272.9 180.9 389.2 48zM364.4 421.8h39.1L151.1 88h-42L364.4 421.8z' />
|
|
12
|
+
</svg>
|
|
13
|
+
)
|
|
14
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import NextImage, { ImageLoaderProps, ImageProps } from 'next/image'
|
|
3
|
+
|
|
4
|
+
const imageLoader = ({ src, width, quality }: ImageLoaderProps) => {
|
|
5
|
+
return `${src}?format=auto&width=${width}${quality ? `&quality=${quality}` : ''}`
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
type OptimizedImageProps = Omit<ImageProps, 'loader'>
|
|
9
|
+
|
|
10
|
+
export function OptimizedImage(props: OptimizedImageProps) {
|
|
11
|
+
return (
|
|
12
|
+
<NextImage
|
|
13
|
+
loader={imageLoader}
|
|
14
|
+
{...props}
|
|
15
|
+
/>
|
|
16
|
+
)
|
|
17
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
type SettingsPanelProps = {
|
|
4
|
+
title?: string;
|
|
5
|
+
isOpen: boolean;
|
|
6
|
+
onOpen: () => void;
|
|
7
|
+
onClose: () => void;
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
fabTitle?: string;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const SettingsPanel = ({
|
|
13
|
+
title = 'Settings',
|
|
14
|
+
isOpen,
|
|
15
|
+
onOpen,
|
|
16
|
+
onClose,
|
|
17
|
+
children,
|
|
18
|
+
fabTitle,
|
|
19
|
+
}: SettingsPanelProps) => {
|
|
20
|
+
return (
|
|
21
|
+
<>
|
|
22
|
+
<style jsx global>{`
|
|
23
|
+
.settings-fab {
|
|
24
|
+
position: fixed;
|
|
25
|
+
right: 16px;
|
|
26
|
+
bottom: 16px;
|
|
27
|
+
z-index: 1040;
|
|
28
|
+
width: 44px;
|
|
29
|
+
height: 44px;
|
|
30
|
+
border-radius: 999px;
|
|
31
|
+
border: 1px solid rgba(0, 0, 0, 0.08);
|
|
32
|
+
background: #fff;
|
|
33
|
+
display: inline-flex;
|
|
34
|
+
align-items: center;
|
|
35
|
+
justify-content: center;
|
|
36
|
+
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
|
|
37
|
+
cursor: pointer;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.settings-panel {
|
|
41
|
+
position: fixed;
|
|
42
|
+
right: 16px;
|
|
43
|
+
bottom: 16px;
|
|
44
|
+
z-index: 2000;
|
|
45
|
+
background: #fff;
|
|
46
|
+
border: 1px solid rgba(0, 0, 0, 0.08);
|
|
47
|
+
box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
|
|
48
|
+
border-radius: 12px;
|
|
49
|
+
padding: 10px 12px;
|
|
50
|
+
min-width: 280px;
|
|
51
|
+
max-width: 360px;
|
|
52
|
+
max-height: 70vh;
|
|
53
|
+
overflow: auto;
|
|
54
|
+
pointer-events: auto;
|
|
55
|
+
}
|
|
56
|
+
.settings-panel * {
|
|
57
|
+
pointer-events: auto;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.settings-panel-header {
|
|
61
|
+
display: flex;
|
|
62
|
+
align-items: center;
|
|
63
|
+
justify-content: space-between;
|
|
64
|
+
font-weight: 600;
|
|
65
|
+
font-size: 13px;
|
|
66
|
+
margin-bottom: 8px;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.settings-close {
|
|
70
|
+
border: none;
|
|
71
|
+
background: transparent;
|
|
72
|
+
cursor: pointer;
|
|
73
|
+
padding: 2px 6px;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.settings-section-title {
|
|
77
|
+
font-size: 12px;
|
|
78
|
+
font-weight: 600;
|
|
79
|
+
color: #4a4a4a;
|
|
80
|
+
margin: 8px 0 6px;
|
|
81
|
+
}
|
|
82
|
+
.settings-help {
|
|
83
|
+
font-size: 11px;
|
|
84
|
+
color: #6c757d;
|
|
85
|
+
}
|
|
86
|
+
`}</style>
|
|
87
|
+
|
|
88
|
+
{isOpen ? (
|
|
89
|
+
<div className="settings-panel" role="complementary" aria-label="Settings panel">
|
|
90
|
+
<div className="settings-panel-header">
|
|
91
|
+
<span>{title}</span>
|
|
92
|
+
<button
|
|
93
|
+
type="button"
|
|
94
|
+
style={{ minWidth: '10px' }}
|
|
95
|
+
className="settings-close"
|
|
96
|
+
aria-label="Close settings panel"
|
|
97
|
+
onClick={onClose}
|
|
98
|
+
title="Close"
|
|
99
|
+
>
|
|
100
|
+
<i className="bi bi-x-lg" />
|
|
101
|
+
</button>
|
|
102
|
+
</div>
|
|
103
|
+
{children}
|
|
104
|
+
</div>
|
|
105
|
+
) : (
|
|
106
|
+
<button
|
|
107
|
+
type="button"
|
|
108
|
+
style={{ minWidth: '10px' }}
|
|
109
|
+
className="settings-fab"
|
|
110
|
+
aria-label="Open settings panel"
|
|
111
|
+
onClick={onOpen}
|
|
112
|
+
title={fabTitle || title}
|
|
113
|
+
>
|
|
114
|
+
<i className="bi bi-sliders" />
|
|
115
|
+
</button>
|
|
116
|
+
)}
|
|
117
|
+
</>
|
|
118
|
+
);
|
|
119
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { useMemo } from 'react'
|
|
2
|
+
import { ThemeColorsKeys } from '@helpers/theme/colors'
|
|
3
|
+
|
|
4
|
+
const BADGE_TYPES = {
|
|
5
|
+
success: {
|
|
6
|
+
textColor: 'white',
|
|
7
|
+
bgColor: 'success',
|
|
8
|
+
icon: 'bi bi-check',
|
|
9
|
+
label: 'Success',
|
|
10
|
+
},
|
|
11
|
+
error: {
|
|
12
|
+
textColor: 'dark',
|
|
13
|
+
bgColor: 'danger',
|
|
14
|
+
icon: 'bi bi-exclamation-circle',
|
|
15
|
+
label: 'Error',
|
|
16
|
+
},
|
|
17
|
+
pending: {
|
|
18
|
+
textColor: 'dark',
|
|
19
|
+
bgColor: 'warning',
|
|
20
|
+
icon: 'bi bi-clock',
|
|
21
|
+
label: 'Pending',
|
|
22
|
+
},
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const Badge = ({
|
|
26
|
+
textColor,
|
|
27
|
+
bgColor,
|
|
28
|
+
label,
|
|
29
|
+
icon,
|
|
30
|
+
className,
|
|
31
|
+
isOutline,
|
|
32
|
+
type,
|
|
33
|
+
}: {
|
|
34
|
+
textColor?: ThemeColorsKeys
|
|
35
|
+
bgColor?: ThemeColorsKeys
|
|
36
|
+
label?: string
|
|
37
|
+
icon?: string
|
|
38
|
+
className?: string
|
|
39
|
+
isOutline?: boolean
|
|
40
|
+
type?: keyof typeof BADGE_TYPES
|
|
41
|
+
}) => {
|
|
42
|
+
const options = useMemo(() => {
|
|
43
|
+
if (type) {
|
|
44
|
+
return {
|
|
45
|
+
...BADGE_TYPES[type],
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return {
|
|
50
|
+
textColor,
|
|
51
|
+
bgColor,
|
|
52
|
+
label,
|
|
53
|
+
icon,
|
|
54
|
+
}
|
|
55
|
+
}, [type, textColor, bgColor, label, icon])
|
|
56
|
+
|
|
57
|
+
return (
|
|
58
|
+
<span
|
|
59
|
+
className={`small py-1 px-2 rounded-pill text-center text-capitalize ${
|
|
60
|
+
isOutline ? 'border border' : 'bg'
|
|
61
|
+
}-${options.bgColor} text-${options.textColor} ${className}`}
|
|
62
|
+
>
|
|
63
|
+
{options.icon && <span className={options.icon + 'me-2'}></span>}
|
|
64
|
+
{options.label}
|
|
65
|
+
</span>
|
|
66
|
+
)
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export default Badge
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export const BackgroundImageBlock = ({
|
|
2
|
+
direction,
|
|
3
|
+
imgSrc,
|
|
4
|
+
imgAlt,
|
|
5
|
+
imgClass,
|
|
6
|
+
textClass,
|
|
7
|
+
header,
|
|
8
|
+
content,
|
|
9
|
+
} : {
|
|
10
|
+
direction: string,
|
|
11
|
+
imgSrc: string,
|
|
12
|
+
imgAlt: string,
|
|
13
|
+
imgClass?: string,
|
|
14
|
+
textClass?: string
|
|
15
|
+
header: string,
|
|
16
|
+
content: JSX.Element,
|
|
17
|
+
}) => {
|
|
18
|
+
return (
|
|
19
|
+
<div className={imgClass} aria-label={imgAlt} style={{ background: `url(${imgSrc}) 0 0 no-repeat`, }}>
|
|
20
|
+
<div className="container">
|
|
21
|
+
<div className="row align-items-center py-7 mt-7">
|
|
22
|
+
{ direction === 'img-left' ? (
|
|
23
|
+
<>
|
|
24
|
+
<div className={`col-md-5 ms-auto me-lg-11 ${textClass}`}>
|
|
25
|
+
<h2>{ header }</h2>
|
|
26
|
+
{ content }
|
|
27
|
+
</div>
|
|
28
|
+
</>
|
|
29
|
+
) : (
|
|
30
|
+
<>
|
|
31
|
+
<div className={`col-md-5 ${textClass}`}>
|
|
32
|
+
<h2>{ header }</h2>
|
|
33
|
+
{ content }
|
|
34
|
+
</div>
|
|
35
|
+
</>
|
|
36
|
+
)}
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export default BackgroundImageBlock
|