@licklist/design 0.78.5-dev.106 → 0.78.5-dev.107
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/.vscode/settings.json +3 -0
- package/bitbucket-pipelines.yml +13 -4
- package/dist/Maintenance/Maintenance.scss.js +1 -1
- package/dist/product-set/form/ProductsControl.d.ts +2 -1
- package/dist/product-set/form/ProductsControl.d.ts.map +1 -1
- package/dist/product-set/form/ProductsControl.js +0 -24
- package/dist/v2/components/ActionMenu/ActionMenu.scss.js +1 -1
- package/dist/v2/components/Badge/Badge.scss.js +1 -1
- package/dist/v2/components/Button/Button.scss.js +1 -1
- package/dist/v2/components/Button/GhostButton.scss.js +1 -1
- package/dist/v2/components/Checkbox/Checkbox.scss.js +1 -1
- package/dist/v2/components/DataTable/DataTable.d.ts.map +1 -1
- package/dist/v2/components/DataTable/DataTable.js +86 -2
- package/dist/v2/components/IconButton/IconButton.scss.js +1 -1
- package/dist/v2/components/Modal/DeleteModal.d.ts.map +1 -1
- package/dist/v2/components/Modal/DeleteModal.js +13 -11
- package/dist/v2/components/Modal/DeleteModal.scss.js +1 -1
- package/dist/v2/components/NPSScore/NPSScore.scss.js +1 -1
- package/dist/v2/components/NewTabs/NewTabs.scss.js +1 -1
- package/dist/v2/components/Select/Select.scss.js +1 -1
- package/dist/v2/components/StatusBadge/StatusBadge.scss.js +1 -1
- package/dist/v2/components/StepIndicator/StepIndicator.scss.js +1 -1
- package/dist/v2/components/Tabs/Tabs.scss.js +1 -1
- package/dist/v2/components/Toggle/Toggle.d.ts.map +1 -1
- package/dist/v2/components/Toggle/Toggle.js +8 -5
- package/dist/v2/components/Tooltip/Tooltip.scss.js +1 -1
- package/dist/v2/components/UserAvatar/UserAvatar.scss.js +1 -1
- package/dist/v2/components/UserPanel/UserPanel.scss.js +1 -1
- package/dist/v2/components/WYSIWYGEditor/WYSIWYGEditor.scss.js +1 -1
- package/dist/v2/components/ZoneCard/ZoneCard.scss.js +1 -1
- package/dist/v2/dashboard-analytics/chart/Chart.scss.js +1 -1
- package/dist/v2/dashboard-analytics/metric-card/MetricCard.scss.js +1 -1
- package/dist/v2/dashboard-analytics/venue-card/VenueCard.scss.js +1 -1
- package/dist/v2/dashboard-analytics/venue-closed-card/VenueClosedCard.scss.js +1 -1
- package/dist/v2/icons/index.js +1 -16
- package/dist/v2/index.d.ts +0 -4
- package/dist/v2/index.d.ts.map +1 -1
- package/dist/v2/navigation/DashboardLayout/AdminSidebar.scss.js +1 -1
- package/dist/v2/navigation/DashboardLayout/DashboardLayout.scss.js +1 -1
- package/dist/v2/navigation/DashboardLayout/ProviderSidebar.scss.js +1 -1
- package/dist/v2/navigation/DashboardLayout/TopNavigation.scss.js +1 -1
- package/dist/v2/pages/Settings/SettingsTabs.scss.js +1 -1
- package/dist/v2/pages/Settings/components/SidebarCustomisation.js +0 -3
- package/dist/v2/pages/Settings/components/SidebarCustomisation.scss.js +1 -1
- package/dist/v2/pages/Settings/components/SidebarNavItem.js +0 -3
- package/dist/v2/pages/auth/AuthLayout/AuthLayout.scss.js +1 -1
- package/dist/v2/styles/form/NewInput.scss.js +1 -1
- package/package.json +6 -6
- package/rollup.config.js +16 -2
- package/src/iframe/payment/payment-status-page/PaymentStatusPage.tsx +1 -1
- package/src/product-set/form/ProductsControl.tsx +2 -1
- package/src/v2/components/DataTable/DataTable.tsx +23 -1
- package/src/v2/components/Modal/DeleteModal.tsx +12 -20
- package/src/v2/components/Toggle/Toggle.tsx +6 -5
- package/src/v2/index.ts +0 -73
- package/dist/v2/shadcn/components/ui/accordion.d.ts +0 -8
- package/dist/v2/shadcn/components/ui/accordion.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/alert-dialog.d.ts +0 -21
- package/dist/v2/shadcn/components/ui/alert-dialog.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/alert.d.ts +0 -9
- package/dist/v2/shadcn/components/ui/alert.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/aspect-ratio.d.ts +0 -4
- package/dist/v2/shadcn/components/ui/aspect-ratio.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/avatar.d.ts +0 -7
- package/dist/v2/shadcn/components/ui/avatar.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/badge.d.ts +0 -10
- package/dist/v2/shadcn/components/ui/badge.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/breadcrumb.d.ts +0 -20
- package/dist/v2/shadcn/components/ui/breadcrumb.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/button.d.ts +0 -14
- package/dist/v2/shadcn/components/ui/button.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/calendar.d.ts +0 -9
- package/dist/v2/shadcn/components/ui/calendar.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/card.d.ts +0 -9
- package/dist/v2/shadcn/components/ui/card.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/carousel.d.ts +0 -19
- package/dist/v2/shadcn/components/ui/carousel.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/checkbox.d.ts +0 -6
- package/dist/v2/shadcn/components/ui/checkbox.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/checkbox.js +0 -115
- package/dist/v2/shadcn/components/ui/checkbox.scss.js +0 -6
- package/dist/v2/shadcn/components/ui/collapsible.d.ts +0 -6
- package/dist/v2/shadcn/components/ui/collapsible.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/command.d.ts +0 -83
- package/dist/v2/shadcn/components/ui/command.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/context-menu.d.ts +0 -28
- package/dist/v2/shadcn/components/ui/context-menu.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/dialog.d.ts +0 -20
- package/dist/v2/shadcn/components/ui/dialog.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/dialog.js +0 -169
- package/dist/v2/shadcn/components/ui/drawer.d.ts +0 -23
- package/dist/v2/shadcn/components/ui/drawer.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/dropdown-menu.d.ts +0 -28
- package/dist/v2/shadcn/components/ui/dropdown-menu.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/form.d.ts +0 -24
- package/dist/v2/shadcn/components/ui/form.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/hover-card.d.ts +0 -7
- package/dist/v2/shadcn/components/ui/hover-card.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/input-otp.d.ts +0 -35
- package/dist/v2/shadcn/components/ui/input-otp.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/input.d.ts +0 -6
- package/dist/v2/shadcn/components/ui/input.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/label.d.ts +0 -6
- package/dist/v2/shadcn/components/ui/label.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/menubar.d.ts +0 -34
- package/dist/v2/shadcn/components/ui/menubar.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/navigation-menu.d.ts +0 -13
- package/dist/v2/shadcn/components/ui/navigation-menu.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/pagination.d.ts +0 -29
- package/dist/v2/shadcn/components/ui/pagination.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/popover.d.ts +0 -7
- package/dist/v2/shadcn/components/ui/popover.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/progress.d.ts +0 -5
- package/dist/v2/shadcn/components/ui/progress.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/radio-card.d.ts +0 -12
- package/dist/v2/shadcn/components/ui/radio-card.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/radio-group.d.ts +0 -6
- package/dist/v2/shadcn/components/ui/radio-group.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/scroll-area.d.ts +0 -6
- package/dist/v2/shadcn/components/ui/scroll-area.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/select.d.ts +0 -14
- package/dist/v2/shadcn/components/ui/select.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/separator.d.ts +0 -5
- package/dist/v2/shadcn/components/ui/separator.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/sheet.d.ts +0 -26
- package/dist/v2/shadcn/components/ui/sheet.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/sidebar.d.ts +0 -67
- package/dist/v2/shadcn/components/ui/sidebar.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/skeleton.d.ts +0 -3
- package/dist/v2/shadcn/components/ui/skeleton.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/slider.d.ts +0 -5
- package/dist/v2/shadcn/components/ui/slider.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/switch.d.ts +0 -6
- package/dist/v2/shadcn/components/ui/switch.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/switch.js +0 -115
- package/dist/v2/shadcn/components/ui/switch.scss.js +0 -6
- package/dist/v2/shadcn/components/ui/table-pagination.d.ts +0 -11
- package/dist/v2/shadcn/components/ui/table-pagination.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/table.d.ts +0 -11
- package/dist/v2/shadcn/components/ui/table.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/tabs.d.ts +0 -8
- package/dist/v2/shadcn/components/ui/tabs.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/textarea.d.ts +0 -6
- package/dist/v2/shadcn/components/ui/textarea.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/toast.d.ts +0 -16
- package/dist/v2/shadcn/components/ui/toast.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/toaster.d.ts +0 -2
- package/dist/v2/shadcn/components/ui/toaster.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/toggle-group.d.ts +0 -13
- package/dist/v2/shadcn/components/ui/toggle-group.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/toggle.d.ts +0 -13
- package/dist/v2/shadcn/components/ui/toggle.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/tooltip.d.ts +0 -8
- package/dist/v2/shadcn/components/ui/tooltip.d.ts.map +0 -1
- package/dist/v2/shadcn/components/ui/use-toast.d.ts +0 -3
- package/dist/v2/shadcn/components/ui/use-toast.d.ts.map +0 -1
- package/dist/v2/shadcn/hooks/use-mobile.d.ts +0 -2
- package/dist/v2/shadcn/hooks/use-mobile.d.ts.map +0 -1
- package/dist/v2/shadcn/hooks/use-toast.d.ts +0 -45
- package/dist/v2/shadcn/hooks/use-toast.d.ts.map +0 -1
- package/dist/v2/shadcn/index.d.ts +0 -20
- package/dist/v2/shadcn/index.d.ts.map +0 -1
- package/dist/v2/shadcn/lib/utils.d.ts +0 -3
- package/dist/v2/shadcn/lib/utils.d.ts.map +0 -1
- package/dist/v2/shadcn/lib/utils.js +0 -11
- package/dist/v2/shadcn/styles/globals.css +0 -112
- package/src/v2/shadcn/_reference/AccountManagerCard.tsx +0 -45
- package/src/v2/shadcn/_reference/AffiliatesTable.tsx +0 -178
- package/src/v2/shadcn/_reference/AuditArchive.tsx +0 -165
- package/src/v2/shadcn/_reference/AuditContent.tsx +0 -270
- package/src/v2/shadcn/_reference/AutomationsGeneralSettings.tsx +0 -251
- package/src/v2/shadcn/_reference/AvatarUpload.tsx +0 -150
- package/src/v2/shadcn/_reference/BookingsSummaryCard.tsx +0 -268
- package/src/v2/shadcn/_reference/CodeCleanUpAudit.tsx +0 -274
- package/src/v2/shadcn/_reference/CompaniesTable.tsx +0 -387
- package/src/v2/shadcn/_reference/ComponentAudit.tsx +0 -239
- package/src/v2/shadcn/_reference/ConfigureSettingsCard.tsx +0 -95
- package/src/v2/shadcn/_reference/CustomerCard.tsx +0 -155
- package/src/v2/shadcn/_reference/DashboardCards.tsx +0 -50
- package/src/v2/shadcn/_reference/DashboardFooter.tsx +0 -18
- package/src/v2/shadcn/_reference/DiarySettings.tsx +0 -187
- package/src/v2/shadcn/_reference/DiaryView.tsx +0 -998
- package/src/v2/shadcn/_reference/EmptyState.tsx +0 -76
- package/src/v2/shadcn/_reference/EntityInfoCard.tsx +0 -48
- package/src/v2/shadcn/_reference/ExistingUserAssignments.tsx +0 -131
- package/src/v2/shadcn/_reference/FeatureToggle.tsx +0 -72
- package/src/v2/shadcn/_reference/FlowCard.tsx +0 -170
- package/src/v2/shadcn/_reference/FlowsContent.tsx +0 -688
- package/src/v2/shadcn/_reference/FlowsGeneralSettings.tsx +0 -27
- package/src/v2/shadcn/_reference/GeneralSettings.tsx +0 -33
- package/src/v2/shadcn/_reference/InventoryGeneralSettings.tsx +0 -82
- package/src/v2/shadcn/_reference/LanguageSelector.tsx +0 -97
- package/src/v2/shadcn/_reference/LoadingScreen.tsx +0 -25
- package/src/v2/shadcn/_reference/LoadingSpinner.tsx +0 -41
- package/src/v2/shadcn/_reference/ManagedClientsList.tsx +0 -121
- package/src/v2/shadcn/_reference/NPSScore.tsx +0 -379
- package/src/v2/shadcn/_reference/NPSSummaryCard.tsx +0 -181
- package/src/v2/shadcn/_reference/NotificationBanner.tsx +0 -129
- package/src/v2/shadcn/_reference/NotificationPanel.tsx +0 -208
- package/src/v2/shadcn/_reference/OnlineUsersCard.tsx +0 -73
- package/src/v2/shadcn/_reference/ProtectedRoute.tsx +0 -39
- package/src/v2/shadcn/_reference/ProvidersTable.tsx +0 -353
- package/src/v2/shadcn/_reference/QuickAddPanel.tsx +0 -1057
- package/src/v2/shadcn/_reference/QuickFilters.tsx +0 -112
- package/src/v2/shadcn/_reference/ScheduleView.tsx +0 -410
- package/src/v2/shadcn/_reference/ScrollToTop.tsx +0 -14
- package/src/v2/shadcn/_reference/SecondaryNav.tsx +0 -50
- package/src/v2/shadcn/_reference/SecuritySettings.tsx +0 -258
- package/src/v2/shadcn/_reference/SessionDetailView.tsx +0 -294
- package/src/v2/shadcn/_reference/Sidebar.tsx +0 -14
- package/src/v2/shadcn/_reference/SidebarAwareLayout.tsx +0 -30
- package/src/v2/shadcn/_reference/SidebarLabelCustomization.tsx +0 -285
- package/src/v2/shadcn/_reference/SimulationBanner.tsx +0 -57
- package/src/v2/shadcn/_reference/SortControls.tsx +0 -65
- package/src/v2/shadcn/_reference/StatusBadge.tsx +0 -49
- package/src/v2/shadcn/_reference/StyleGuideContent.tsx +0 -331
- package/src/v2/shadcn/_reference/TableActionMenu.tsx +0 -126
- package/src/v2/shadcn/_reference/ThemeProvider.tsx +0 -119
- package/src/v2/shadcn/_reference/ThemeSettings.tsx +0 -73
- package/src/v2/shadcn/_reference/TopNavigation.tsx +0 -332
- package/src/v2/shadcn/_reference/UserActivityHistory.tsx +0 -209
- package/src/v2/shadcn/_reference/UserLanguageSettings.tsx +0 -94
- package/src/v2/shadcn/_reference/UserPanel.tsx +0 -472
- package/src/v2/shadcn/_reference/UsersTable.tsx +0 -1023
- package/src/v2/shadcn/_reference/WaiverForm.tsx +0 -301
- package/src/v2/shadcn/_reference/WaiversGeneralSettings.tsx +0 -46
- package/src/v2/shadcn/_reference/WaiversTable.tsx +0 -290
- package/src/v2/shadcn/_reference/WaiversTemplatesSettings.tsx +0 -416
- package/src/v2/shadcn/_reference/ai/AIChatPanel.tsx +0 -313
- package/src/v2/shadcn/_reference/ai/AIChatSearchBar.tsx +0 -36
- package/src/v2/shadcn/_reference/ai/ChatInteractiveBlock.tsx +0 -298
- package/src/v2/shadcn/_reference/ai/ChatMessageContent.tsx +0 -40
- package/src/v2/shadcn/_reference/ai/parseInteractiveBlocks.ts +0 -142
- package/src/v2/shadcn/_reference/auth/AuthLayout.tsx +0 -55
- package/src/v2/shadcn/_reference/auth/CreatePasswordForm.tsx +0 -285
- package/src/v2/shadcn/_reference/auth/CreatePasswordPanel.tsx +0 -20
- package/src/v2/shadcn/_reference/auth/LoginFooter.tsx +0 -14
- package/src/v2/shadcn/_reference/auth/LoginForm.tsx +0 -205
- package/src/v2/shadcn/_reference/auth/LoginPanel.tsx +0 -41
- package/src/v2/shadcn/_reference/auth/ResetPasswordForm.tsx +0 -102
- package/src/v2/shadcn/_reference/auth/ResetPasswordPanel.tsx +0 -20
- package/src/v2/shadcn/_reference/auth/VerifyEmailForm.tsx +0 -95
- package/src/v2/shadcn/_reference/auth/VerifyEmailPanel.tsx +0 -20
- package/src/v2/shadcn/_reference/email/EmailAttachment.tsx +0 -119
- package/src/v2/shadcn/_reference/email/EmailAutomation.tsx +0 -92
- package/src/v2/shadcn/_reference/email/EmailPlaceholders.tsx +0 -64
- package/src/v2/shadcn/_reference/email/UnlayerEmailEditor.tsx +0 -41
- package/src/v2/shadcn/_reference/email/emailTemplateData.ts +0 -53
- package/src/v2/shadcn/_reference/emptyStateIcons.tsx +0 -103
- package/src/v2/shadcn/_reference/games/MazeGame.tsx +0 -394
- package/src/v2/shadcn/_reference/games/RunnerGame.tsx +0 -497
- package/src/v2/shadcn/_reference/logos/BookedLogoFull.tsx +0 -36
- package/src/v2/shadcn/_reference/logos/BookedLogoMark.tsx +0 -31
- package/src/v2/shadcn/_reference/logos/BookedLogoNew.tsx +0 -36
- package/src/v2/shadcn/_reference/pricing/DynamicPricingRulesEditor.tsx +0 -401
- package/src/v2/shadcn/_reference/pricing/DynamicPricingTierCard.tsx +0 -77
- package/src/v2/shadcn/_reference/pricing/DynamicPricingTiersList.tsx +0 -218
- package/src/v2/shadcn/_reference/pricing/PricingCalendar.tsx +0 -810
- package/src/v2/shadcn/_reference/pricing/PricingPeriodCard.tsx +0 -152
- package/src/v2/shadcn/_reference/pricing/PricingPeriodForm.tsx +0 -377
- package/src/v2/shadcn/_reference/pricing/PricingPeriodsList.tsx +0 -213
- package/src/v2/shadcn/_reference/pricing/getRuleSummary.ts +0 -39
- package/src/v2/shadcn/_reference/products/AvailabilityRulesSection.tsx +0 -184
- package/src/v2/shadcn/_reference/products/AvailabilitySection.tsx +0 -677
- package/src/v2/shadcn/_reference/products/BookingTypeConfigOptions.tsx +0 -40
- package/src/v2/shadcn/_reference/products/CapacityPeriodsSection.tsx +0 -238
- package/src/v2/shadcn/_reference/products/DynamicPricingTiersSection.tsx +0 -131
- package/src/v2/shadcn/_reference/products/GiftCardOrdersTab.tsx +0 -192
- package/src/v2/shadcn/_reference/products/GiftCardSettings.tsx +0 -342
- package/src/v2/shadcn/_reference/products/PackageProductsSection.tsx +0 -322
- package/src/v2/shadcn/_reference/products/PricingSection.tsx +0 -173
- package/src/v2/shadcn/_reference/products/ProductTypeFields.tsx +0 -353
- package/src/v2/shadcn/_reference/products/ProductTypeIcon.tsx +0 -95
- package/src/v2/shadcn/_reference/products/VariablePricingSection.tsx +0 -140
- package/src/v2/shadcn/_reference/products/productTypeConfig.ts +0 -182
- package/src/v2/shadcn/_reference/shared/BackButton.tsx +0 -50
- package/src/v2/shadcn/_reference/shared/CancelConfirmationDialog.tsx +0 -18
- package/src/v2/shadcn/_reference/shared/ConfirmationDialog.tsx +0 -136
- package/src/v2/shadcn/_reference/shared/DeleteConfirmationDialog.tsx +0 -18
- package/src/v2/shadcn/_reference/shared/DeleteEntityPage.tsx +0 -221
- package/src/v2/shadcn/_reference/shared/SidebarIcons.tsx +0 -108
- package/src/v2/shadcn/_reference/shared/UnifiedSidebar.tsx +0 -722
- package/src/v2/shadcn/_reference/tables/BulkActionsBar.tsx +0 -68
- package/src/v2/shadcn/_reference/tables/DataTable.tsx +0 -221
- package/src/v2/shadcn/_reference/tables/TableControls.tsx +0 -94
- package/src/v2/shadcn/_reference/tables/index.ts +0 -3
- package/src/v2/shadcn/_reference/tables/types.ts +0 -79
- package/src/v2/shadcn/_reference/zones/LegacyZoneSettings.tsx +0 -299
- package/src/v2/shadcn/components/ui/accordion.stories.tsx +0 -63
- package/src/v2/shadcn/components/ui/accordion.tsx +0 -52
- package/src/v2/shadcn/components/ui/alert-dialog.stories.tsx +0 -44
- package/src/v2/shadcn/components/ui/alert-dialog.tsx +0 -104
- package/src/v2/shadcn/components/ui/alert.stories.tsx +0 -44
- package/src/v2/shadcn/components/ui/alert.tsx +0 -43
- package/src/v2/shadcn/components/ui/aspect-ratio.stories.tsx +0 -46
- package/src/v2/shadcn/components/ui/aspect-ratio.tsx +0 -5
- package/src/v2/shadcn/components/ui/avatar.stories.tsx +0 -39
- package/src/v2/shadcn/components/ui/avatar.tsx +0 -38
- package/src/v2/shadcn/components/ui/badge.stories.tsx +0 -17
- package/src/v2/shadcn/components/ui/badge.tsx +0 -30
- package/src/v2/shadcn/components/ui/breadcrumb.stories.tsx +0 -91
- package/src/v2/shadcn/components/ui/breadcrumb.tsx +0 -90
- package/src/v2/shadcn/components/ui/button.stories.tsx +0 -20
- package/src/v2/shadcn/components/ui/button.tsx +0 -60
- package/src/v2/shadcn/components/ui/calendar.stories.tsx +0 -61
- package/src/v2/shadcn/components/ui/calendar.tsx +0 -54
- package/src/v2/shadcn/components/ui/card.stories.tsx +0 -37
- package/src/v2/shadcn/components/ui/card.tsx +0 -43
- package/src/v2/shadcn/components/ui/carousel.stories.tsx +0 -92
- package/src/v2/shadcn/components/ui/carousel.tsx +0 -224
- package/src/v2/shadcn/components/ui/checkbox.scss +0 -38
- package/src/v2/shadcn/components/ui/checkbox.stories.tsx +0 -23
- package/src/v2/shadcn/components/ui/checkbox.tsx +0 -24
- package/src/v2/shadcn/components/ui/collapsible.stories.tsx +0 -59
- package/src/v2/shadcn/components/ui/collapsible.tsx +0 -9
- package/src/v2/shadcn/components/ui/command.stories.tsx +0 -70
- package/src/v2/shadcn/components/ui/command.tsx +0 -132
- package/src/v2/shadcn/components/ui/context-menu.stories.tsx +0 -72
- package/src/v2/shadcn/components/ui/context-menu.tsx +0 -178
- package/src/v2/shadcn/components/ui/dialog.stories.tsx +0 -67
- package/src/v2/shadcn/components/ui/dialog.tsx +0 -95
- package/src/v2/shadcn/components/ui/drawer.stories.tsx +0 -50
- package/src/v2/shadcn/components/ui/drawer.tsx +0 -87
- package/src/v2/shadcn/components/ui/dropdown-menu.stories.tsx +0 -73
- package/src/v2/shadcn/components/ui/dropdown-menu.tsx +0 -179
- package/src/v2/shadcn/components/ui/form.stories.tsx +0 -105
- package/src/v2/shadcn/components/ui/form.tsx +0 -129
- package/src/v2/shadcn/components/ui/hover-card.stories.tsx +0 -35
- package/src/v2/shadcn/components/ui/hover-card.tsx +0 -27
- package/src/v2/shadcn/components/ui/input-otp.stories.tsx +0 -72
- package/src/v2/shadcn/components/ui/input-otp.tsx +0 -61
- package/src/v2/shadcn/components/ui/input.stories.tsx +0 -16
- package/src/v2/shadcn/components/ui/input.tsx +0 -25
- package/src/v2/shadcn/components/ui/label.stories.tsx +0 -13
- package/src/v2/shadcn/components/ui/label.tsx +0 -17
- package/src/v2/shadcn/components/ui/menubar.stories.tsx +0 -86
- package/src/v2/shadcn/components/ui/menubar.tsx +0 -207
- package/src/v2/shadcn/components/ui/navigation-menu.stories.tsx +0 -68
- package/src/v2/shadcn/components/ui/navigation-menu.tsx +0 -120
- package/src/v2/shadcn/components/ui/pagination.stories.tsx +0 -78
- package/src/v2/shadcn/components/ui/pagination.tsx +0 -81
- package/src/v2/shadcn/components/ui/popover.stories.tsx +0 -44
- package/src/v2/shadcn/components/ui/popover.tsx +0 -29
- package/src/v2/shadcn/components/ui/progress.stories.tsx +0 -17
- package/src/v2/shadcn/components/ui/progress.tsx +0 -23
- package/src/v2/shadcn/components/ui/radio-card.stories.tsx +0 -68
- package/src/v2/shadcn/components/ui/radio-card.tsx +0 -52
- package/src/v2/shadcn/components/ui/radio-group.stories.tsx +0 -77
- package/src/v2/shadcn/components/ui/radio-group.tsx +0 -35
- package/src/v2/shadcn/components/ui/scroll-area.stories.tsx +0 -56
- package/src/v2/shadcn/components/ui/scroll-area.tsx +0 -38
- package/src/v2/shadcn/components/ui/select.stories.tsx +0 -60
- package/src/v2/shadcn/components/ui/select.tsx +0 -148
- package/src/v2/shadcn/components/ui/separator.stories.tsx +0 -30
- package/src/v2/shadcn/components/ui/separator.tsx +0 -20
- package/src/v2/shadcn/components/ui/sheet.stories.tsx +0 -115
- package/src/v2/shadcn/components/ui/sheet.tsx +0 -107
- package/src/v2/shadcn/components/ui/sidebar.stories.tsx +0 -167
- package/src/v2/shadcn/components/ui/sidebar.tsx +0 -637
- package/src/v2/shadcn/components/ui/skeleton.stories.tsx +0 -36
- package/src/v2/shadcn/components/ui/skeleton.tsx +0 -7
- package/src/v2/shadcn/components/ui/slider.stories.tsx +0 -16
- package/src/v2/shadcn/components/ui/slider.tsx +0 -23
- package/src/v2/shadcn/components/ui/switch.scss +0 -63
- package/src/v2/shadcn/components/ui/switch.stories.tsx +0 -23
- package/src/v2/shadcn/components/ui/switch.tsx +0 -24
- package/src/v2/shadcn/components/ui/table-pagination.stories.tsx +0 -81
- package/src/v2/shadcn/components/ui/table-pagination.tsx +0 -61
- package/src/v2/shadcn/components/ui/table.stories.tsx +0 -40
- package/src/v2/shadcn/components/ui/table.tsx +0 -72
- package/src/v2/shadcn/components/ui/tabs.stories.tsx +0 -85
- package/src/v2/shadcn/components/ui/tabs.tsx +0 -53
- package/src/v2/shadcn/components/ui/textarea.stories.tsx +0 -15
- package/src/v2/shadcn/components/ui/textarea.tsx +0 -21
- package/src/v2/shadcn/components/ui/toast.stories.tsx +0 -77
- package/src/v2/shadcn/components/ui/toast.tsx +0 -111
- package/src/v2/shadcn/components/ui/toaster.stories.tsx +0 -46
- package/src/v2/shadcn/components/ui/toaster.tsx +0 -24
- package/src/v2/shadcn/components/ui/toggle-group.stories.tsx +0 -95
- package/src/v2/shadcn/components/ui/toggle-group.tsx +0 -49
- package/src/v2/shadcn/components/ui/toggle.stories.tsx +0 -18
- package/src/v2/shadcn/components/ui/toggle.tsx +0 -37
- package/src/v2/shadcn/components/ui/tooltip.stories.tsx +0 -57
- package/src/v2/shadcn/components/ui/tooltip.tsx +0 -28
- package/src/v2/shadcn/components/ui/use-toast.ts +0 -3
- package/src/v2/shadcn/hooks/use-mobile.tsx +0 -19
- package/src/v2/shadcn/hooks/use-toast.ts +0 -184
- package/src/v2/shadcn/index.ts +0 -76
- package/src/v2/shadcn/lib/utils.ts +0 -6
- package/src/v2/shadcn/styles/globals.css +0 -112
|
@@ -1,208 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
2
|
-
import { useNavigate } from 'react-router-dom';
|
|
3
|
-
import { ScrollArea } from './ui/scroll-area';
|
|
4
|
-
import { Button } from './ui/button';
|
|
5
|
-
import { IconArrowInternalReturn, IconCross, IconPlus } from '../../icons';
|
|
6
|
-
import IconNotification from '@/assets/Icon_Notification.svg';
|
|
7
|
-
import IconTime from '@/assets/Icon_Time.svg';
|
|
8
|
-
|
|
9
|
-
interface Notification {
|
|
10
|
-
id: string;
|
|
11
|
-
title: string;
|
|
12
|
-
message: string;
|
|
13
|
-
timestamp: string;
|
|
14
|
-
isNew: boolean;
|
|
15
|
-
type?: 'notification' | 'reminder';
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
interface NotificationPanelProps {
|
|
19
|
-
isOpen: boolean;
|
|
20
|
-
onClose: () => void;
|
|
21
|
-
latestCount: number;
|
|
22
|
-
onMarkAllRead: () => void;
|
|
23
|
-
onViewAll: () => void;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// Mock data - replace with real data later
|
|
27
|
-
const mockNotifications: Notification[] = [
|
|
28
|
-
// Reminders (triggered)
|
|
29
|
-
{ id: 'r1', title: 'Reminder', message: 'Follow up with Brad Nobbs about booking confirmation', timestamp: '5 min ago', isNew: true, type: 'reminder' },
|
|
30
|
-
{ id: 'r2', title: 'Reminder', message: 'Review monthly analytics report', timestamp: '30 min ago', isNew: true, type: 'reminder' },
|
|
31
|
-
{ id: 'r3', title: 'Reminder', message: 'Prepare for team meeting at 3pm', timestamp: '1 hour ago', isNew: true, type: 'reminder' },
|
|
32
|
-
// Latest notifications (9 items to make 12 total with reminders)
|
|
33
|
-
{ id: '1', title: 'New affiliate signup', message: 'John Doe has signed up as an affiliate', timestamp: '2 min ago', isNew: true, type: 'notification' },
|
|
34
|
-
{ id: '2', title: 'Commission earned', message: 'You earned $25.00 from a sale', timestamp: '15 min ago', isNew: true, type: 'notification' },
|
|
35
|
-
{ id: '3', title: 'Payment processed', message: 'Your monthly payment of $500 has been processed', timestamp: '1 hour ago', isNew: true, type: 'notification' },
|
|
36
|
-
{ id: '4', title: 'New conversion', message: 'Affiliate link #1234 generated a conversion', timestamp: '2 hours ago', isNew: true, type: 'notification' },
|
|
37
|
-
{ id: '5', title: 'Profile updated', message: 'Your affiliate profile was successfully updated', timestamp: '3 hours ago', isNew: true, type: 'notification' },
|
|
38
|
-
{ id: '6', title: 'Milestone reached', message: 'Congratulations! You reached 100 affiliates', timestamp: '4 hours ago', isNew: true, type: 'notification' },
|
|
39
|
-
{ id: '7', title: 'New message', message: 'You have a new message from support', timestamp: '5 hours ago', isNew: true, type: 'notification' },
|
|
40
|
-
{ id: '8', title: 'Report ready', message: 'Your monthly report is ready to download', timestamp: '6 hours ago', isNew: true, type: 'notification' },
|
|
41
|
-
{ id: '9', title: 'Link clicked', message: 'Your affiliate link was clicked 50 times today', timestamp: '7 hours ago', isNew: true, type: 'notification' },
|
|
42
|
-
// Previous reminders
|
|
43
|
-
{ id: 'r4', title: 'Reminder', message: 'Check inventory levels for weekend rush', timestamp: '2 days ago', isNew: false, type: 'reminder' },
|
|
44
|
-
// Previous notifications
|
|
45
|
-
{ id: '13', title: 'Weekly summary', message: 'Your weekly performance summary is available', timestamp: '2 days ago', isNew: false, type: 'notification' },
|
|
46
|
-
{ id: '14', title: 'Affiliate approved', message: 'New affiliate Sarah Smith was approved', timestamp: '3 days ago', isNew: false, type: 'notification' },
|
|
47
|
-
{ id: '15', title: 'Payout scheduled', message: 'Your next payout is scheduled for May 1st', timestamp: '5 days ago', isNew: false, type: 'notification' },
|
|
48
|
-
{ id: '16', title: 'Campaign ended', message: 'Spring promotion campaign has ended', timestamp: '1 week ago', isNew: false, type: 'notification' },
|
|
49
|
-
{ id: '17', title: 'Terms updated', message: 'Our terms of service have been updated', timestamp: '2 weeks ago', isNew: false, type: 'notification' },
|
|
50
|
-
];
|
|
51
|
-
|
|
52
|
-
export const NotificationPanel: React.FC<NotificationPanelProps> = ({
|
|
53
|
-
isOpen,
|
|
54
|
-
onClose,
|
|
55
|
-
latestCount,
|
|
56
|
-
onMarkAllRead,
|
|
57
|
-
onViewAll
|
|
58
|
-
}) => {
|
|
59
|
-
const navigate = useNavigate();
|
|
60
|
-
const [hoveredNotification, setHoveredNotification] = useState<string | null>(null);
|
|
61
|
-
|
|
62
|
-
if (!isOpen) return null;
|
|
63
|
-
|
|
64
|
-
const latestNotifications = mockNotifications.filter(n => n.isNew).slice(0, latestCount);
|
|
65
|
-
const previousNotifications = mockNotifications.filter(n => !n.isNew);
|
|
66
|
-
|
|
67
|
-
const handleSetReminder = () => {
|
|
68
|
-
onClose();
|
|
69
|
-
navigate('/set-reminder');
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
const renderNotificationItem = (notification: Notification, isPrevious: boolean = false) => {
|
|
73
|
-
const isReminder = notification.type === 'reminder';
|
|
74
|
-
|
|
75
|
-
if (isReminder) {
|
|
76
|
-
// Render reminder as alert-style box with orange/yellow styling
|
|
77
|
-
return (
|
|
78
|
-
<div
|
|
79
|
-
key={notification.id}
|
|
80
|
-
className="cursor-pointer rounded-lg border border-border-status-alert bg-surface-status-alert p-4 transition-colors hover:opacity-90"
|
|
81
|
-
onMouseEnter={() => setHoveredNotification(notification.id)}
|
|
82
|
-
onMouseLeave={() => setHoveredNotification(null)}
|
|
83
|
-
>
|
|
84
|
-
<div className="flex items-start gap-3">
|
|
85
|
-
<div className="w-8 h-8 rounded-full bg-alert-regular flex items-center justify-center flex-shrink-0">
|
|
86
|
-
<img src={IconTime} alt="" className="w-5 h-5 [filter:brightness(0)_invert(1)]" />
|
|
87
|
-
</div>
|
|
88
|
-
<div className="flex-1 min-w-0">
|
|
89
|
-
<div className="flex items-center justify-between gap-2 mb-0.5">
|
|
90
|
-
<h4 className="text-sm font-semibold text-label-status-alert">{notification.title}</h4>
|
|
91
|
-
<span className="text-xs text-label-secondary whitespace-nowrap">{notification.timestamp}</span>
|
|
92
|
-
</div>
|
|
93
|
-
<p className="text-xs text-label-primary">{notification.message}</p>
|
|
94
|
-
</div>
|
|
95
|
-
</div>
|
|
96
|
-
</div>
|
|
97
|
-
);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
// Regular notification
|
|
101
|
-
const bgClass = isPrevious
|
|
102
|
-
? 'bg-surface-tertiary hover:bg-surface-tertiary-hover'
|
|
103
|
-
: 'bg-surface-secondary hover:bg-surface-secondary-hover';
|
|
104
|
-
|
|
105
|
-
return (
|
|
106
|
-
<div
|
|
107
|
-
key={notification.id}
|
|
108
|
-
className={`p-3 rounded-lg ${bgClass} transition-colors cursor-pointer`}
|
|
109
|
-
onMouseEnter={() => setHoveredNotification(notification.id)}
|
|
110
|
-
onMouseLeave={() => setHoveredNotification(null)}
|
|
111
|
-
>
|
|
112
|
-
<div className="flex items-start justify-between gap-2 mb-1">
|
|
113
|
-
<h4 className="text-sm font-medium text-label-primary">{notification.title}</h4>
|
|
114
|
-
<span className="text-xs text-label-secondary whitespace-nowrap">{notification.timestamp}</span>
|
|
115
|
-
</div>
|
|
116
|
-
<p className="text-sm text-label-secondary">{notification.message}</p>
|
|
117
|
-
</div>
|
|
118
|
-
);
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
return (
|
|
122
|
-
<>
|
|
123
|
-
{/* Overlay */}
|
|
124
|
-
<div
|
|
125
|
-
className="fixed inset-0 z-40 animate-fade-in"
|
|
126
|
-
style={{ backgroundColor: 'var(--overlay-curtain)' }}
|
|
127
|
-
onClick={onClose}
|
|
128
|
-
/>
|
|
129
|
-
|
|
130
|
-
{/* Panel */}
|
|
131
|
-
<div
|
|
132
|
-
className="fixed right-0 top-0 h-screen w-full sm:w-[420px] bg-surface-primary shadow-xl z-50 animate-slide-in-right"
|
|
133
|
-
onClick={(e) => e.stopPropagation()}
|
|
134
|
-
>
|
|
135
|
-
{/* Header */}
|
|
136
|
-
<div className="flex items-center justify-between p-4 border-b border-border-primary">
|
|
137
|
-
<div className="flex items-center gap-2">
|
|
138
|
-
<img src={IconNotification} alt="" className="w-8 h-8" />
|
|
139
|
-
<h2 className="text-lg font-semibold text-label-primary">Notifications</h2>
|
|
140
|
-
</div>
|
|
141
|
-
<div className="flex items-center gap-1">
|
|
142
|
-
<Button
|
|
143
|
-
variant="ghost"
|
|
144
|
-
size="sm"
|
|
145
|
-
onClick={handleSetReminder}
|
|
146
|
-
className="gap-1.5 text-label-secondary hover:text-label-primary"
|
|
147
|
-
>
|
|
148
|
-
<IconPlus className="w-4 h-4" />
|
|
149
|
-
Set Reminder
|
|
150
|
-
</Button>
|
|
151
|
-
<button
|
|
152
|
-
onClick={() => {
|
|
153
|
-
onViewAll();
|
|
154
|
-
onClose();
|
|
155
|
-
}}
|
|
156
|
-
className="p-2 rounded-lg hover:bg-surface-primary-hover transition-colors flex items-center justify-center"
|
|
157
|
-
aria-label="View all notifications"
|
|
158
|
-
>
|
|
159
|
-
<IconArrowInternalReturn className="w-5 h-5 text-label-secondary" />
|
|
160
|
-
</button>
|
|
161
|
-
<button
|
|
162
|
-
onClick={onClose}
|
|
163
|
-
className="p-2 rounded-lg hover:bg-surface-primary-hover transition-colors flex items-center justify-center"
|
|
164
|
-
aria-label="Close notifications"
|
|
165
|
-
>
|
|
166
|
-
<IconCross className="w-5 h-5 text-label-secondary" />
|
|
167
|
-
</button>
|
|
168
|
-
</div>
|
|
169
|
-
</div>
|
|
170
|
-
|
|
171
|
-
<ScrollArea className="h-[calc(100%-65px)]">
|
|
172
|
-
{/* Latest Notifications */}
|
|
173
|
-
<div className="p-4">
|
|
174
|
-
<div className="flex items-center justify-between mb-3">
|
|
175
|
-
<h3 className="text-sm font-semibold text-label-primary">
|
|
176
|
-
Latest Notifications ({latestCount})
|
|
177
|
-
</h3>
|
|
178
|
-
<button
|
|
179
|
-
onClick={() => {
|
|
180
|
-
onMarkAllRead();
|
|
181
|
-
onClose();
|
|
182
|
-
}}
|
|
183
|
-
className="text-sm font-medium text-label-action hover:text-actions-dark transition-colors"
|
|
184
|
-
>
|
|
185
|
-
Mark all as read
|
|
186
|
-
</button>
|
|
187
|
-
</div>
|
|
188
|
-
<div className="space-y-2">
|
|
189
|
-
{latestNotifications.map((notification) => renderNotificationItem(notification, false))}
|
|
190
|
-
</div>
|
|
191
|
-
</div>
|
|
192
|
-
|
|
193
|
-
{/* Previous Notifications */}
|
|
194
|
-
{previousNotifications.length > 0 && (
|
|
195
|
-
<div className="p-4 pt-0">
|
|
196
|
-
<h3 className="text-sm font-semibold text-label-primary mb-3">
|
|
197
|
-
Previous Notifications
|
|
198
|
-
</h3>
|
|
199
|
-
<div className="space-y-2">
|
|
200
|
-
{previousNotifications.map((notification) => renderNotificationItem(notification, true))}
|
|
201
|
-
</div>
|
|
202
|
-
</div>
|
|
203
|
-
)}
|
|
204
|
-
</ScrollArea>
|
|
205
|
-
</div>
|
|
206
|
-
</>
|
|
207
|
-
);
|
|
208
|
-
};
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import React, { useState, useEffect } from 'react';
|
|
2
|
-
import { supabase } from '@/integrations/supabase/client';
|
|
3
|
-
import { useAuth } from '@/contexts/AuthContext';
|
|
4
|
-
import { IconUser } from '../../icons';
|
|
5
|
-
|
|
6
|
-
interface OnlineUsersCardProps {
|
|
7
|
-
className?: string;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
const OnlineUsersCard: React.FC<OnlineUsersCardProps> = ({ className = '' }) => {
|
|
11
|
-
const { user } = useAuth();
|
|
12
|
-
const [onlineCount, setOnlineCount] = useState(0);
|
|
13
|
-
|
|
14
|
-
useEffect(() => {
|
|
15
|
-
if (!user) return;
|
|
16
|
-
|
|
17
|
-
const channel = supabase.channel('online-users', {
|
|
18
|
-
config: {
|
|
19
|
-
presence: {
|
|
20
|
-
key: user.id,
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
channel
|
|
26
|
-
.on('presence', { event: 'sync' }, () => {
|
|
27
|
-
const state = channel.presenceState();
|
|
28
|
-
const count = Object.keys(state).length;
|
|
29
|
-
setOnlineCount(count);
|
|
30
|
-
})
|
|
31
|
-
.on('presence', { event: 'join' }, () => {
|
|
32
|
-
const state = channel.presenceState();
|
|
33
|
-
const count = Object.keys(state).length;
|
|
34
|
-
setOnlineCount(count);
|
|
35
|
-
})
|
|
36
|
-
.on('presence', { event: 'leave' }, () => {
|
|
37
|
-
const state = channel.presenceState();
|
|
38
|
-
const count = Object.keys(state).length;
|
|
39
|
-
setOnlineCount(count);
|
|
40
|
-
})
|
|
41
|
-
.subscribe(async (status) => {
|
|
42
|
-
if (status === 'SUBSCRIBED') {
|
|
43
|
-
await channel.track({
|
|
44
|
-
user_id: user.id,
|
|
45
|
-
online_at: new Date().toISOString(),
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
return () => {
|
|
51
|
-
supabase.removeChannel(channel);
|
|
52
|
-
};
|
|
53
|
-
}, [user]);
|
|
54
|
-
|
|
55
|
-
return (
|
|
56
|
-
<div
|
|
57
|
-
className={`bg-surface-primary rounded-xl p-4 border-2 animate-pulse-glow ${className}`}
|
|
58
|
-
>
|
|
59
|
-
<div className="flex flex-col gap-3">
|
|
60
|
-
<div className="w-12 h-12 rounded-lg bg-surface-secondary flex items-center justify-center">
|
|
61
|
-
<IconUser size={28} className="text-fill-secondary" />
|
|
62
|
-
</div>
|
|
63
|
-
|
|
64
|
-
<div>
|
|
65
|
-
<p className="text-label-secondary text-[13px] font-medium">{onlineCount === 1 ? 'User' : 'Users'} Online</p>
|
|
66
|
-
<p className="text-label-primary text-3xl font-bold">{onlineCount}</p>
|
|
67
|
-
</div>
|
|
68
|
-
</div>
|
|
69
|
-
</div>
|
|
70
|
-
);
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
export default OnlineUsersCard;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { useState, useEffect } from 'react';
|
|
2
|
-
import { Navigate } from 'react-router-dom';
|
|
3
|
-
import { useAuth } from '@/contexts/AuthContext';
|
|
4
|
-
import LoadingScreen from './LoadingScreen';
|
|
5
|
-
|
|
6
|
-
interface ProtectedRouteProps {
|
|
7
|
-
children: React.ReactNode;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
const isLovableEditor = window.location.hostname.includes('lovableproject.com');
|
|
11
|
-
const GRACE_PERIOD_MS = 2000;
|
|
12
|
-
|
|
13
|
-
export const ProtectedRoute: React.FC<ProtectedRouteProps> = ({ children }) => {
|
|
14
|
-
const { user, isLoading } = useAuth();
|
|
15
|
-
const [graceExpired, setGraceExpired] = useState(!isLovableEditor);
|
|
16
|
-
|
|
17
|
-
useEffect(() => {
|
|
18
|
-
if (isLovableEditor && !user && !isLoading) {
|
|
19
|
-
const timer = setTimeout(() => setGraceExpired(true), GRACE_PERIOD_MS);
|
|
20
|
-
return () => clearTimeout(timer);
|
|
21
|
-
}
|
|
22
|
-
if (user) {
|
|
23
|
-
setGraceExpired(true);
|
|
24
|
-
}
|
|
25
|
-
}, [user, isLoading]);
|
|
26
|
-
|
|
27
|
-
console.log('ProtectedRoute - isLoading:', isLoading, 'user:', user, 'graceExpired:', graceExpired);
|
|
28
|
-
|
|
29
|
-
if (isLoading || (!user && !graceExpired)) {
|
|
30
|
-
return <LoadingScreen />;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
if (!user) {
|
|
34
|
-
console.log('No user found, redirecting to /auth');
|
|
35
|
-
return <Navigate to="/auth" replace />;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
return <>{children}</>;
|
|
39
|
-
};
|
|
@@ -1,353 +0,0 @@
|
|
|
1
|
-
import React, { useState, useEffect } from 'react';
|
|
2
|
-
import { useNavigate } from 'react-router-dom';
|
|
3
|
-
import { DataTable } from './tables/DataTable';
|
|
4
|
-
import { TableControls } from './tables/TableControls';
|
|
5
|
-
import { ColumnConfig, RowAction, SearchConfig, FilterConfig, HeaderAction } from './tables/types';
|
|
6
|
-
import StatusBadge from './StatusBadge';
|
|
7
|
-
import { supabase } from '@/integrations/supabase/client';
|
|
8
|
-
import { format } from 'date-fns';
|
|
9
|
-
import IconVenue from '@/assets/Icon_Venue.svg';
|
|
10
|
-
import IconPromoter from '@/assets/Icon_Promoter.svg';
|
|
11
|
-
import { IconPlusThick, IconArrowInternalReturn, IconDashboard } from '../../icons';
|
|
12
|
-
import { ActionButton } from './TableActionMenu';
|
|
13
|
-
import { useToast } from '../hooks/use-toast';
|
|
14
|
-
import { clearProviderCache } from '@/contexts/ProviderContext';
|
|
15
|
-
|
|
16
|
-
interface Provider {
|
|
17
|
-
id: string;
|
|
18
|
-
name: string;
|
|
19
|
-
type: 'venue' | 'promoter';
|
|
20
|
-
status: string;
|
|
21
|
-
created_at: string;
|
|
22
|
-
avatar_url?: string;
|
|
23
|
-
venue_id?: string;
|
|
24
|
-
company_id?: string;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
interface ProvidersTableProps {
|
|
28
|
-
companyId?: string;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const ProvidersTable: React.FC<ProvidersTableProps> = ({ companyId }) => {
|
|
32
|
-
const [providers, setProviders] = useState<Provider[]>([]);
|
|
33
|
-
const navigate = useNavigate();
|
|
34
|
-
const { toast } = useToast();
|
|
35
|
-
const [searchQuery, setSearchQuery] = useState('');
|
|
36
|
-
const [activeFilter, setActiveFilter] = useState<'all' | 'venues' | 'promoters'>('all');
|
|
37
|
-
const [isLoading, setIsLoading] = useState(true);
|
|
38
|
-
const [sortKey, setSortKey] = useState<string>('name');
|
|
39
|
-
const [sortDirection, setSortDirection] = useState<'asc' | 'desc'>('asc');
|
|
40
|
-
|
|
41
|
-
useEffect(() => {
|
|
42
|
-
fetchProviders();
|
|
43
|
-
}, [companyId]);
|
|
44
|
-
|
|
45
|
-
const fetchProviders = async () => {
|
|
46
|
-
try {
|
|
47
|
-
setIsLoading(true);
|
|
48
|
-
let query = supabase.from('providers').select('*');
|
|
49
|
-
|
|
50
|
-
if (companyId) {
|
|
51
|
-
query = query.eq('company_id', companyId);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
const { data, error } = await query;
|
|
55
|
-
|
|
56
|
-
if (error) throw error;
|
|
57
|
-
setProviders(data || []);
|
|
58
|
-
} catch (error) {
|
|
59
|
-
console.error('Error fetching providers:', error);
|
|
60
|
-
} finally {
|
|
61
|
-
setIsLoading(false);
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
const handleSort = (key: string) => {
|
|
66
|
-
if (sortKey === key) {
|
|
67
|
-
setSortDirection(sortDirection === 'asc' ? 'desc' : 'asc');
|
|
68
|
-
} else {
|
|
69
|
-
setSortKey(key);
|
|
70
|
-
setSortDirection('asc');
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
const filteredProviders = providers.filter(provider => {
|
|
75
|
-
const matchesSearch = provider.name.toLowerCase().includes(searchQuery.toLowerCase()) ||
|
|
76
|
-
provider.id.includes(searchQuery) ||
|
|
77
|
-
(provider.venue_id && provider.venue_id.includes(searchQuery));
|
|
78
|
-
const matchesFilter = activeFilter === 'all' ||
|
|
79
|
-
(activeFilter === 'venues' && provider.type === 'venue') ||
|
|
80
|
-
(activeFilter === 'promoters' && provider.type === 'promoter');
|
|
81
|
-
return matchesSearch && matchesFilter;
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
const sortedProviders = [...filteredProviders].sort((a, b) => {
|
|
85
|
-
let aValue: any;
|
|
86
|
-
let bValue: any;
|
|
87
|
-
|
|
88
|
-
switch (sortKey) {
|
|
89
|
-
case 'name':
|
|
90
|
-
aValue = a.name.toLowerCase();
|
|
91
|
-
bValue = b.name.toLowerCase();
|
|
92
|
-
break;
|
|
93
|
-
case 'created':
|
|
94
|
-
aValue = new Date(a.created_at).getTime();
|
|
95
|
-
bValue = new Date(b.created_at).getTime();
|
|
96
|
-
break;
|
|
97
|
-
default:
|
|
98
|
-
return 0;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
if (aValue < bValue) return sortDirection === 'asc' ? -1 : 1;
|
|
102
|
-
if (aValue > bValue) return sortDirection === 'asc' ? 1 : -1;
|
|
103
|
-
return 0;
|
|
104
|
-
});
|
|
105
|
-
|
|
106
|
-
const searchConfig: SearchConfig = {
|
|
107
|
-
placeholder: 'Search by provider name or ID',
|
|
108
|
-
value: searchQuery,
|
|
109
|
-
onChange: setSearchQuery,
|
|
110
|
-
label: 'Search Providers'
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
const filters: FilterConfig[] = [
|
|
114
|
-
{
|
|
115
|
-
label: 'Venues',
|
|
116
|
-
value: 'venues',
|
|
117
|
-
isActive: activeFilter === 'venues',
|
|
118
|
-
onClick: () => setActiveFilter(activeFilter === 'venues' ? 'all' : 'venues')
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
label: 'Promoters',
|
|
122
|
-
value: 'promoters',
|
|
123
|
-
isActive: activeFilter === 'promoters',
|
|
124
|
-
onClick: () => setActiveFilter(activeFilter === 'promoters' ? 'all' : 'promoters')
|
|
125
|
-
}
|
|
126
|
-
];
|
|
127
|
-
|
|
128
|
-
const actions: HeaderAction[] = [
|
|
129
|
-
{
|
|
130
|
-
label: 'Add New Provider',
|
|
131
|
-
mobileLabel: 'Add',
|
|
132
|
-
icon: <IconPlusThick className="fill-current" />,
|
|
133
|
-
variant: 'ghost',
|
|
134
|
-
withIcon: true,
|
|
135
|
-
onClick: () => {
|
|
136
|
-
if (companyId) {
|
|
137
|
-
navigate(`/company/${companyId}/providers/add`);
|
|
138
|
-
} else {
|
|
139
|
-
navigate('/admin/providers/add');
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
];
|
|
144
|
-
|
|
145
|
-
const getFirstLetter = (name: string) => {
|
|
146
|
-
return name[0]?.toUpperCase() || 'P';
|
|
147
|
-
};
|
|
148
|
-
|
|
149
|
-
const getProviderIcon = (provider: Provider) => {
|
|
150
|
-
// If provider has an avatar, show it
|
|
151
|
-
if (provider.avatar_url) {
|
|
152
|
-
return (
|
|
153
|
-
<div className="flex w-10 h-10 justify-center items-center rounded-full overflow-hidden bg-surface-tertiary flex-shrink-0">
|
|
154
|
-
<img
|
|
155
|
-
src={provider.avatar_url}
|
|
156
|
-
alt={provider.name}
|
|
157
|
-
className="w-full h-full object-cover"
|
|
158
|
-
/>
|
|
159
|
-
</div>
|
|
160
|
-
);
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
// Otherwise show the first letter
|
|
164
|
-
return (
|
|
165
|
-
<div className="flex w-10 h-10 justify-center items-center rounded-full bg-surface-tertiary flex-shrink-0">
|
|
166
|
-
<span className="text-label-secondary text-sm font-semibold">
|
|
167
|
-
{getFirstLetter(provider.name)}
|
|
168
|
-
</span>
|
|
169
|
-
</div>
|
|
170
|
-
);
|
|
171
|
-
};
|
|
172
|
-
|
|
173
|
-
const columns: ColumnConfig<Provider>[] = [
|
|
174
|
-
{
|
|
175
|
-
label: 'Provider & ID',
|
|
176
|
-
sortKey: 'name',
|
|
177
|
-
sortable: true,
|
|
178
|
-
render: (provider) => (
|
|
179
|
-
<div className="flex items-center gap-3 flex-1">
|
|
180
|
-
{getProviderIcon(provider)}
|
|
181
|
-
<div className="flex flex-col gap-0.5 flex-1 min-w-0">
|
|
182
|
-
<h3 className="text-label-primary text-sm font-semibold leading-4 truncate">
|
|
183
|
-
{provider.name}
|
|
184
|
-
</h3>
|
|
185
|
-
<p className="text-label-secondary text-xs font-normal leading-4">
|
|
186
|
-
{provider.type === 'venue' ? 'Venue' : 'Promoter'} ID: {provider.venue_id || 'N/A'}
|
|
187
|
-
</p>
|
|
188
|
-
</div>
|
|
189
|
-
</div>
|
|
190
|
-
)
|
|
191
|
-
},
|
|
192
|
-
{
|
|
193
|
-
label: 'Created',
|
|
194
|
-
sortKey: 'created',
|
|
195
|
-
sortable: true,
|
|
196
|
-
render: (provider: Provider) => (
|
|
197
|
-
<span className="text-text-secondary">{format(new Date(provider.created_at), 'dd.MM.yyyy')}</span>
|
|
198
|
-
),
|
|
199
|
-
width: 'w-[140px]'
|
|
200
|
-
},
|
|
201
|
-
{
|
|
202
|
-
label: 'Status',
|
|
203
|
-
render: (provider) => <StatusBadge status={provider.status as 'active' | 'disabled' | 'invited' | 'suspended'} />,
|
|
204
|
-
width: 'w-[100px]',
|
|
205
|
-
className: 'flex justify-end'
|
|
206
|
-
}
|
|
207
|
-
];
|
|
208
|
-
|
|
209
|
-
const handleDisableProvider = async (provider: Provider) => {
|
|
210
|
-
try {
|
|
211
|
-
const newStatus = provider.status === 'active' ? 'disabled' : 'active';
|
|
212
|
-
|
|
213
|
-
const { error } = await supabase
|
|
214
|
-
.from('providers')
|
|
215
|
-
.update({ status: newStatus })
|
|
216
|
-
.eq('id', provider.id);
|
|
217
|
-
|
|
218
|
-
if (error) throw error;
|
|
219
|
-
|
|
220
|
-
// Clear the provider cache so navigating to this provider shows fresh status
|
|
221
|
-
clearProviderCache();
|
|
222
|
-
|
|
223
|
-
// Refresh the providers list
|
|
224
|
-
fetchProviders();
|
|
225
|
-
} catch (error) {
|
|
226
|
-
console.error('Error updating provider status:', error);
|
|
227
|
-
}
|
|
228
|
-
};
|
|
229
|
-
|
|
230
|
-
const handleDuplicateProvider = (provider: Provider) => {
|
|
231
|
-
if (companyId) {
|
|
232
|
-
navigate(`/company/${companyId}/providers/${provider.id}/clone`);
|
|
233
|
-
} else {
|
|
234
|
-
navigate(`/admin/providers/${provider.id}/clone`);
|
|
235
|
-
}
|
|
236
|
-
};
|
|
237
|
-
|
|
238
|
-
const rowActions = (provider: Provider): RowAction<Provider>[] => [
|
|
239
|
-
{
|
|
240
|
-
label: 'Go to Dashboard',
|
|
241
|
-
onClick: () => {
|
|
242
|
-
if (!provider.venue_id) {
|
|
243
|
-
console.error('Provider missing venue_id:', provider);
|
|
244
|
-
return;
|
|
245
|
-
}
|
|
246
|
-
const providerType = provider.type === 'venue' ? 'venue' : 'promoter';
|
|
247
|
-
navigate(`/${providerType}/${provider.venue_id}/home`);
|
|
248
|
-
}
|
|
249
|
-
},
|
|
250
|
-
{
|
|
251
|
-
label: `${provider.type === 'venue' ? 'Venue' : 'Promoter'} Details`,
|
|
252
|
-
onClick: () => navigate(`/admin/providers/${provider.id}`)
|
|
253
|
-
},
|
|
254
|
-
{
|
|
255
|
-
label: `Edit ${provider.type === 'venue' ? 'Venue' : 'Promoter'}`,
|
|
256
|
-
onClick: () => console.log('Edit provider', provider.id)
|
|
257
|
-
},
|
|
258
|
-
{
|
|
259
|
-
label: `Duplicate ${provider.type === 'venue' ? 'Venue' : 'Promoter'}`,
|
|
260
|
-
onClick: () => handleDuplicateProvider(provider)
|
|
261
|
-
},
|
|
262
|
-
{
|
|
263
|
-
label: provider.status === 'active'
|
|
264
|
-
? `Disable ${provider.type === 'venue' ? 'Venue' : 'Promoter'}`
|
|
265
|
-
: `Enable ${provider.type === 'venue' ? 'Venue' : 'Promoter'}`,
|
|
266
|
-
onClick: () => handleDisableProvider(provider)
|
|
267
|
-
},
|
|
268
|
-
];
|
|
269
|
-
|
|
270
|
-
return (
|
|
271
|
-
<div className="flex flex-col gap-6 w-full">
|
|
272
|
-
<TableControls
|
|
273
|
-
searchConfig={searchConfig}
|
|
274
|
-
filters={filters}
|
|
275
|
-
actions={actions}
|
|
276
|
-
/>
|
|
277
|
-
|
|
278
|
-
{/* Mobile card layout */}
|
|
279
|
-
<div className="flex flex-col gap-3 sm:hidden">
|
|
280
|
-
{sortedProviders.length === 0 ? (
|
|
281
|
-
<div className="flex items-center justify-center py-12">
|
|
282
|
-
<span className="text-label-secondary text-sm">No providers found</span>
|
|
283
|
-
</div>
|
|
284
|
-
) : (
|
|
285
|
-
sortedProviders.map((provider) => (
|
|
286
|
-
<button
|
|
287
|
-
key={provider.id}
|
|
288
|
-
onClick={() => navigate(`/admin/providers/${provider.id}`)}
|
|
289
|
-
className="flex items-center gap-3 p-4 bg-surface-primary border border-border-primary rounded-lg w-full text-left"
|
|
290
|
-
>
|
|
291
|
-
{getProviderIcon(provider)}
|
|
292
|
-
<div className="flex flex-col gap-1 flex-1 min-w-0">
|
|
293
|
-
<div className="flex items-center justify-between gap-2">
|
|
294
|
-
<h3 className="text-label-primary text-sm font-semibold leading-4 truncate">
|
|
295
|
-
{provider.name}
|
|
296
|
-
</h3>
|
|
297
|
-
<StatusBadge status={provider.status as 'active' | 'disabled' | 'invited' | 'suspended'} />
|
|
298
|
-
</div>
|
|
299
|
-
<div className="flex items-center gap-2">
|
|
300
|
-
<span className="text-label-secondary text-xs">
|
|
301
|
-
{provider.type === 'venue' ? 'Venue' : 'Promoter'} ID: {provider.venue_id || 'N/A'}
|
|
302
|
-
</span>
|
|
303
|
-
<span className="text-label-tertiary text-xs">·</span>
|
|
304
|
-
<span className="text-label-tertiary text-xs">
|
|
305
|
-
{format(new Date(provider.created_at), 'dd MMM yyyy')}
|
|
306
|
-
</span>
|
|
307
|
-
</div>
|
|
308
|
-
</div>
|
|
309
|
-
</button>
|
|
310
|
-
))
|
|
311
|
-
)}
|
|
312
|
-
</div>
|
|
313
|
-
|
|
314
|
-
{/* Desktop table layout */}
|
|
315
|
-
<div className="hidden sm:block">
|
|
316
|
-
<DataTable
|
|
317
|
-
data={sortedProviders}
|
|
318
|
-
columns={columns}
|
|
319
|
-
keyExtractor={(provider) => provider.id}
|
|
320
|
-
rowActions={rowActions}
|
|
321
|
-
rowQuickActions={(provider) => (
|
|
322
|
-
<ActionButton
|
|
323
|
-
icon={
|
|
324
|
-
<div className="relative w-[18px] h-[18px]">
|
|
325
|
-
<IconDashboard size={18} className="absolute inset-0 group-hover/dashboard-action:opacity-0 transition-opacity" />
|
|
326
|
-
<IconArrowInternalReturn size={18} className="absolute inset-0 opacity-0 group-hover/dashboard-action:opacity-100 transition-opacity" />
|
|
327
|
-
</div>
|
|
328
|
-
}
|
|
329
|
-
className="group/dashboard-action"
|
|
330
|
-
onClick={() => {
|
|
331
|
-
if (!provider.venue_id) return;
|
|
332
|
-
const providerType = provider.type === 'venue' ? 'venue' : 'promoter';
|
|
333
|
-
navigate(`/${providerType}/${provider.venue_id}/home`);
|
|
334
|
-
}}
|
|
335
|
-
/>
|
|
336
|
-
)}
|
|
337
|
-
onRowClick={(provider) => {
|
|
338
|
-
navigate(`/admin/providers/${provider.id}`);
|
|
339
|
-
}}
|
|
340
|
-
sortKey={sortKey}
|
|
341
|
-
sortDirection={sortDirection}
|
|
342
|
-
onSort={handleSort}
|
|
343
|
-
pagination={{
|
|
344
|
-
entityName: 'venues'
|
|
345
|
-
}}
|
|
346
|
-
emptyState="No providers found"
|
|
347
|
-
/>
|
|
348
|
-
</div>
|
|
349
|
-
</div>
|
|
350
|
-
);
|
|
351
|
-
};
|
|
352
|
-
|
|
353
|
-
export default ProvidersTable;
|