@licklist/design 0.78.5-dev.105 → 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/index.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/DataTable/DataTable.d.ts.map +1 -1
- package/dist/v2/components/DataTable/DataTable.js +86 -2
- package/dist/v2/components/InputCheckbox/InputCheckbox.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/Toggle/Toggle.d.ts.map +1 -1
- package/dist/v2/components/Toggle/Toggle.js +8 -5
- package/dist/v2/components/ZoneCard/ZoneCard.scss.js +1 -1
- package/dist/v2/components/index.d.ts +1 -1
- package/dist/v2/components/index.d.ts.map +1 -1
- package/dist/v2/icons/index.d.ts +4 -0
- package/dist/v2/icons/index.d.ts.map +1 -1
- package/dist/v2/icons/index.js +47 -16
- package/dist/v2/index.d.ts +0 -4
- package/dist/v2/index.d.ts.map +1 -1
- package/dist/v2/pages/Settings/components/SidebarCustomisation.js +0 -3
- package/dist/v2/pages/Settings/components/SidebarNavItem.js +0 -3
- 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/InputCheckbox/InputCheckbox.scss +6 -6
- package/src/v2/components/Modal/DeleteModal.tsx +12 -20
- package/src/v2/components/Toggle/Toggle.tsx +6 -5
- package/src/v2/components/ZoneCard/ZoneCard.scss +78 -0
- package/src/v2/components/index.ts +1 -0
- package/src/v2/icons/index.tsx +10 -0
- package/src/v2/index.ts +0 -73
- package/src/v2/navigation/Navigation/Navigation.stories.tsx +137 -0
- 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,258 +0,0 @@
|
|
|
1
|
-
import React, { useState, useEffect } from 'react';
|
|
2
|
-
import { Button } from './ui/button';
|
|
3
|
-
import { Checkbox } from './ui/checkbox';
|
|
4
|
-
import { Input } from './ui/input';
|
|
5
|
-
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from './ui/select';
|
|
6
|
-
import { supabase } from '@/integrations/supabase/client';
|
|
7
|
-
import { useNotify } from '../hooks/useNotify';
|
|
8
|
-
import { useAuth } from '@/contexts/AuthContext';
|
|
9
|
-
import { AlertDialog, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle } from './ui/alert-dialog';
|
|
10
|
-
|
|
11
|
-
interface SecuritySettingsProps {
|
|
12
|
-
entityType: 'admin' | 'company' | 'provider';
|
|
13
|
-
entityId?: string;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const SecuritySettings: React.FC<SecuritySettingsProps> = ({ entityType, entityId }) => {
|
|
17
|
-
const { user } = useAuth();
|
|
18
|
-
const { showSuccess, showError } = useNotify();
|
|
19
|
-
const [enabled, setEnabled] = useState(false);
|
|
20
|
-
const [interval, setInterval] = useState<string>('');
|
|
21
|
-
const [unit, setUnit] = useState<string>('days');
|
|
22
|
-
const [isLoading, setIsLoading] = useState(true);
|
|
23
|
-
const [isSaving, setIsSaving] = useState(false);
|
|
24
|
-
const [showGlobalResetDialog, setShowGlobalResetDialog] = useState(false);
|
|
25
|
-
const [isGlobalResetLoading, setIsGlobalResetLoading] = useState(false);
|
|
26
|
-
const [isSuperAdmin, setIsSuperAdmin] = useState(false);
|
|
27
|
-
|
|
28
|
-
useEffect(() => {
|
|
29
|
-
checkUserRole();
|
|
30
|
-
fetchPasswordPolicy();
|
|
31
|
-
}, [entityType, entityId]);
|
|
32
|
-
|
|
33
|
-
const checkUserRole = async () => {
|
|
34
|
-
if (!user) return;
|
|
35
|
-
|
|
36
|
-
const { data: roles } = await supabase
|
|
37
|
-
.from('user_roles')
|
|
38
|
-
.select('role')
|
|
39
|
-
.eq('user_id', user.id);
|
|
40
|
-
|
|
41
|
-
const userRoles = roles?.map(r => r.role) || [];
|
|
42
|
-
setIsSuperAdmin(userRoles.includes('super_admin'));
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
const fetchPasswordPolicy = async () => {
|
|
46
|
-
try {
|
|
47
|
-
setIsLoading(true);
|
|
48
|
-
|
|
49
|
-
const { data, error } = await supabase
|
|
50
|
-
.from('password_policies')
|
|
51
|
-
.select('*')
|
|
52
|
-
.eq('entity_type', entityType)
|
|
53
|
-
.eq('entity_id', entityId || null)
|
|
54
|
-
.maybeSingle();
|
|
55
|
-
|
|
56
|
-
if (error && error.code !== 'PGRST116') {
|
|
57
|
-
console.error('Error fetching password policy:', error);
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
if (data) {
|
|
62
|
-
setEnabled(data.enabled);
|
|
63
|
-
setInterval(data.reset_interval?.toString() || '');
|
|
64
|
-
setUnit(data.reset_interval_unit || 'days');
|
|
65
|
-
}
|
|
66
|
-
} catch (error) {
|
|
67
|
-
console.error('Error fetching password policy:', error);
|
|
68
|
-
} finally {
|
|
69
|
-
setIsLoading(false);
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
const handleSave = async () => {
|
|
74
|
-
if (enabled && (!interval || parseInt(interval) <= 0)) {
|
|
75
|
-
showError('Please enter a valid interval');
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
try {
|
|
80
|
-
setIsSaving(true);
|
|
81
|
-
|
|
82
|
-
const policyData = {
|
|
83
|
-
entity_type: entityType,
|
|
84
|
-
entity_id: entityId || null,
|
|
85
|
-
enabled,
|
|
86
|
-
reset_interval: enabled ? parseInt(interval) : null,
|
|
87
|
-
reset_interval_unit: enabled ? unit as 'days' | 'weeks' | 'months' | 'years' : null,
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
// Check if policy exists
|
|
91
|
-
const { data: existingPolicy } = await supabase
|
|
92
|
-
.from('password_policies')
|
|
93
|
-
.select('id')
|
|
94
|
-
.eq('entity_type', entityType)
|
|
95
|
-
.eq('entity_id', entityId || null)
|
|
96
|
-
.maybeSingle();
|
|
97
|
-
|
|
98
|
-
let error;
|
|
99
|
-
if (existingPolicy) {
|
|
100
|
-
// Update existing policy
|
|
101
|
-
const result = await supabase
|
|
102
|
-
.from('password_policies')
|
|
103
|
-
.update(policyData)
|
|
104
|
-
.eq('id', existingPolicy.id);
|
|
105
|
-
error = result.error;
|
|
106
|
-
} else {
|
|
107
|
-
// Insert new policy
|
|
108
|
-
const result = await supabase
|
|
109
|
-
.from('password_policies')
|
|
110
|
-
.insert([policyData]);
|
|
111
|
-
error = result.error;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
if (error) throw error;
|
|
115
|
-
|
|
116
|
-
showSuccess('Password policy saved successfully');
|
|
117
|
-
} catch (error) {
|
|
118
|
-
console.error('Error saving password policy:', error);
|
|
119
|
-
showError('Failed to save password policy');
|
|
120
|
-
} finally {
|
|
121
|
-
setIsSaving(false);
|
|
122
|
-
}
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
const handleGlobalPasswordReset = async () => {
|
|
126
|
-
try {
|
|
127
|
-
setIsGlobalResetLoading(true);
|
|
128
|
-
|
|
129
|
-
const { data, error } = await supabase.functions.invoke('global-password-reset', {
|
|
130
|
-
body: {}
|
|
131
|
-
});
|
|
132
|
-
|
|
133
|
-
if (error) throw error;
|
|
134
|
-
|
|
135
|
-
showSuccess('Global password reset triggered', `${data.affectedUsers} users will be required to reset their password on next login`);
|
|
136
|
-
setShowGlobalResetDialog(false);
|
|
137
|
-
} catch (error) {
|
|
138
|
-
console.error('Error triggering global password reset:', error);
|
|
139
|
-
showError('Failed to trigger global password reset');
|
|
140
|
-
} finally {
|
|
141
|
-
setIsGlobalResetLoading(false);
|
|
142
|
-
}
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
if (isLoading) {
|
|
146
|
-
return <div className="text-label-secondary">Loading security settings...</div>;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
return (
|
|
150
|
-
<div className="flex flex-col gap-6">
|
|
151
|
-
<div className="flex flex-col gap-4">
|
|
152
|
-
<h3 className="text-label-primary text-lg font-semibold">Password Reset Policy</h3>
|
|
153
|
-
|
|
154
|
-
<div className="flex items-center gap-3">
|
|
155
|
-
<Checkbox
|
|
156
|
-
id="requirePasswordReset"
|
|
157
|
-
checked={enabled}
|
|
158
|
-
onCheckedChange={(checked) => setEnabled(checked as boolean)}
|
|
159
|
-
/>
|
|
160
|
-
<label
|
|
161
|
-
htmlFor="requirePasswordReset"
|
|
162
|
-
className="text-label-primary text-sm font-normal cursor-pointer"
|
|
163
|
-
>
|
|
164
|
-
Require periodic password reset
|
|
165
|
-
</label>
|
|
166
|
-
</div>
|
|
167
|
-
|
|
168
|
-
{enabled && (
|
|
169
|
-
<div className="flex flex-col gap-2 ml-8">
|
|
170
|
-
<label className="text-label-primary text-sm font-medium">
|
|
171
|
-
Reset password every
|
|
172
|
-
</label>
|
|
173
|
-
<div className="flex gap-3 items-center">
|
|
174
|
-
<Input
|
|
175
|
-
type="number"
|
|
176
|
-
min="1"
|
|
177
|
-
value={interval}
|
|
178
|
-
onChange={(e) => setInterval(e.target.value)}
|
|
179
|
-
className="w-24"
|
|
180
|
-
|
|
181
|
-
/>
|
|
182
|
-
<Select value={unit} onValueChange={setUnit}>
|
|
183
|
-
<SelectTrigger className="w-32">
|
|
184
|
-
<SelectValue />
|
|
185
|
-
</SelectTrigger>
|
|
186
|
-
<SelectContent>
|
|
187
|
-
<SelectItem value="days">Days</SelectItem>
|
|
188
|
-
<SelectItem value="weeks">Weeks</SelectItem>
|
|
189
|
-
<SelectItem value="months">Months</SelectItem>
|
|
190
|
-
<SelectItem value="years">Years</SelectItem>
|
|
191
|
-
</SelectContent>
|
|
192
|
-
</Select>
|
|
193
|
-
</div>
|
|
194
|
-
{entityType === 'admin' && (
|
|
195
|
-
<p className="text-label-secondary text-xs">
|
|
196
|
-
This policy applies to system admins and super admins only
|
|
197
|
-
</p>
|
|
198
|
-
)}
|
|
199
|
-
{entityType === 'provider' && (
|
|
200
|
-
<p className="text-label-secondary text-xs">
|
|
201
|
-
This overrides the company-level policy for this provider
|
|
202
|
-
</p>
|
|
203
|
-
)}
|
|
204
|
-
</div>
|
|
205
|
-
)}
|
|
206
|
-
|
|
207
|
-
<div className="flex gap-3 mt-2">
|
|
208
|
-
<Button onClick={handleSave} disabled={isSaving}>
|
|
209
|
-
{isSaving ? 'Saving...' : 'Save'}
|
|
210
|
-
</Button>
|
|
211
|
-
</div>
|
|
212
|
-
</div>
|
|
213
|
-
|
|
214
|
-
{entityType === 'admin' && isSuperAdmin && (
|
|
215
|
-
<div className="flex flex-col gap-4 pt-6 border-t border-border-primary">
|
|
216
|
-
<h3 className="text-label-primary text-lg font-semibold">Global Password Reset</h3>
|
|
217
|
-
<p className="text-label-secondary text-sm">
|
|
218
|
-
Force all users across the entire system to reset their password on next login
|
|
219
|
-
</p>
|
|
220
|
-
<div>
|
|
221
|
-
<Button
|
|
222
|
-
variant="destructive"
|
|
223
|
-
onClick={() => setShowGlobalResetDialog(true)}
|
|
224
|
-
>
|
|
225
|
-
Trigger Global Password Reset
|
|
226
|
-
</Button>
|
|
227
|
-
</div>
|
|
228
|
-
</div>
|
|
229
|
-
)}
|
|
230
|
-
|
|
231
|
-
<AlertDialog open={showGlobalResetDialog} onOpenChange={setShowGlobalResetDialog}>
|
|
232
|
-
<AlertDialogContent>
|
|
233
|
-
<AlertDialogHeader>
|
|
234
|
-
<AlertDialogTitle>Trigger Global Password Reset?</AlertDialogTitle>
|
|
235
|
-
<AlertDialogDescription>
|
|
236
|
-
This will require ALL users across the entire system to reset their password on next login.
|
|
237
|
-
This action cannot be undone. Are you sure you want to proceed?
|
|
238
|
-
</AlertDialogDescription>
|
|
239
|
-
</AlertDialogHeader>
|
|
240
|
-
<AlertDialogFooter>
|
|
241
|
-
<Button variant="ghost" onClick={() => setShowGlobalResetDialog(false)}>
|
|
242
|
-
Cancel
|
|
243
|
-
</Button>
|
|
244
|
-
<Button
|
|
245
|
-
variant="destructive"
|
|
246
|
-
onClick={handleGlobalPasswordReset}
|
|
247
|
-
disabled={isGlobalResetLoading}
|
|
248
|
-
>
|
|
249
|
-
{isGlobalResetLoading ? 'Processing...' : 'Yes, Reset All Passwords'}
|
|
250
|
-
</Button>
|
|
251
|
-
</AlertDialogFooter>
|
|
252
|
-
</AlertDialogContent>
|
|
253
|
-
</AlertDialog>
|
|
254
|
-
</div>
|
|
255
|
-
);
|
|
256
|
-
};
|
|
257
|
-
|
|
258
|
-
export default SecuritySettings;
|
|
@@ -1,294 +0,0 @@
|
|
|
1
|
-
import React, { useState, useMemo } from 'react';
|
|
2
|
-
import { Button } from './ui/button';
|
|
3
|
-
import { Badge } from './ui/badge';
|
|
4
|
-
import { Input } from './ui/input';
|
|
5
|
-
import { IconArrowLeft, IconPlusThick } from '../../icons';
|
|
6
|
-
import { cn } from '../lib/utils';
|
|
7
|
-
|
|
8
|
-
interface Flow {
|
|
9
|
-
id: string;
|
|
10
|
-
type: 'booking' | 'enquiry';
|
|
11
|
-
reference_number: string;
|
|
12
|
-
customer_name: string;
|
|
13
|
-
customer_email?: string | null;
|
|
14
|
-
activity_name: string;
|
|
15
|
-
booking_date: string;
|
|
16
|
-
booking_time_start: string;
|
|
17
|
-
booking_time_end: string | null;
|
|
18
|
-
status: string;
|
|
19
|
-
total_amount: number;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
interface SessionSlot {
|
|
23
|
-
productId: string;
|
|
24
|
-
productName: string;
|
|
25
|
-
startTime: string;
|
|
26
|
-
endTime: string;
|
|
27
|
-
capacity: number;
|
|
28
|
-
bookedCount: number;
|
|
29
|
-
bookings: Flow[];
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
interface SessionDetailViewProps {
|
|
33
|
-
session: SessionSlot;
|
|
34
|
-
date: string;
|
|
35
|
-
dateFormatted: string; // yyyy-MM-dd format for date comparison
|
|
36
|
-
onBack: () => void;
|
|
37
|
-
onAddToSession?: () => void;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
const statusColors: Record<string, string> = {
|
|
41
|
-
active: 'bg-surface-status-success text-label-status-success border-border-status-success',
|
|
42
|
-
cancelled: 'bg-surface-status-error text-label-status-error border-border-status-error',
|
|
43
|
-
declined: 'bg-surface-status-error text-label-status-error border-border-status-error',
|
|
44
|
-
initial_contact: 'bg-surface-status-info text-label-status-info border-border-status-info',
|
|
45
|
-
action_required: 'bg-surface-status-warning text-label-status-warning border-border-status-warning',
|
|
46
|
-
ready_to_convert: 'bg-surface-status-success text-label-status-success border-border-status-success',
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
type SessionStatus = 'upcoming' | 'in_progress' | 'finished';
|
|
50
|
-
|
|
51
|
-
// Parse time string to minutes from midnight
|
|
52
|
-
const parseTimeToMinutes = (timeStr: string): number => {
|
|
53
|
-
const [hour, minute] = timeStr.split(':').map(Number);
|
|
54
|
-
return hour * 60 + minute;
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
// Get session status based on current time
|
|
58
|
-
const getSessionStatus = (startTime: string, endTime: string, dateFormatted: string): SessionStatus => {
|
|
59
|
-
const now = new Date();
|
|
60
|
-
const today = new Date();
|
|
61
|
-
today.setHours(0, 0, 0, 0);
|
|
62
|
-
|
|
63
|
-
const targetDay = new Date(dateFormatted);
|
|
64
|
-
targetDay.setHours(0, 0, 0, 0);
|
|
65
|
-
|
|
66
|
-
// If target date is in the past, session is finished
|
|
67
|
-
if (targetDay < today) {
|
|
68
|
-
return 'finished';
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
// If target date is in the future, session is upcoming
|
|
72
|
-
if (targetDay > today) {
|
|
73
|
-
return 'upcoming';
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
// Target date is today - check times
|
|
77
|
-
const currentMinutes = now.getHours() * 60 + now.getMinutes();
|
|
78
|
-
const startMinutes = parseTimeToMinutes(startTime);
|
|
79
|
-
const endMinutes = parseTimeToMinutes(endTime);
|
|
80
|
-
|
|
81
|
-
if (currentMinutes >= endMinutes) {
|
|
82
|
-
return 'finished';
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
if (currentMinutes >= startMinutes) {
|
|
86
|
-
return 'in_progress';
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
return 'upcoming';
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
const formatStatus = (status: string): string => {
|
|
93
|
-
return status
|
|
94
|
-
.split('_')
|
|
95
|
-
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
|
|
96
|
-
.join(' ');
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
export const SessionDetailView: React.FC<SessionDetailViewProps> = ({
|
|
100
|
-
session,
|
|
101
|
-
date,
|
|
102
|
-
dateFormatted,
|
|
103
|
-
onBack,
|
|
104
|
-
onAddToSession,
|
|
105
|
-
}) => {
|
|
106
|
-
const [searchQuery, setSearchQuery] = useState('');
|
|
107
|
-
|
|
108
|
-
// Get session status
|
|
109
|
-
const sessionStatus = useMemo(() => {
|
|
110
|
-
return getSessionStatus(session.startTime, session.endTime, dateFormatted);
|
|
111
|
-
}, [session.startTime, session.endTime, dateFormatted]);
|
|
112
|
-
|
|
113
|
-
const getCapacityColor = (booked: number, total: number) => {
|
|
114
|
-
if (total === 0) return 'bg-surface-secondary text-label-tertiary border-border-primary';
|
|
115
|
-
const percentage = (booked / total) * 100;
|
|
116
|
-
if (percentage >= 100) return 'bg-surface-status-error text-label-status-error border-border-status-error';
|
|
117
|
-
if (percentage >= 80) return 'bg-surface-status-warning text-label-status-warning border-border-status-warning';
|
|
118
|
-
if (percentage >= 50) return 'bg-surface-status-info text-label-status-info border-border-status-info';
|
|
119
|
-
return 'bg-surface-status-success text-label-status-success border-border-status-success';
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
// Filter bookings based on search query
|
|
123
|
-
const filteredBookings = useMemo(() => {
|
|
124
|
-
if (!searchQuery) return session.bookings;
|
|
125
|
-
const search = searchQuery.toLowerCase();
|
|
126
|
-
return session.bookings.filter((booking) =>
|
|
127
|
-
booking.reference_number.toLowerCase().includes(search) ||
|
|
128
|
-
booking.customer_name.toLowerCase().includes(search) ||
|
|
129
|
-
booking.customer_email?.toLowerCase().includes(search)
|
|
130
|
-
);
|
|
131
|
-
}, [session.bookings, searchQuery]);
|
|
132
|
-
|
|
133
|
-
// Calculate available spaces - capacity minus booked count
|
|
134
|
-
const availableSpaces = session.capacity - session.bookedCount;
|
|
135
|
-
|
|
136
|
-
// Check if session is in the past
|
|
137
|
-
const isSessionInPast = useMemo(() => {
|
|
138
|
-
const now = new Date();
|
|
139
|
-
const [hours, minutes] = session.endTime.split(':').map(Number);
|
|
140
|
-
const sessionEnd = new Date(dateFormatted);
|
|
141
|
-
sessionEnd.setHours(hours, minutes, 0, 0);
|
|
142
|
-
return sessionEnd < now;
|
|
143
|
-
}, [dateFormatted, session.endTime]);
|
|
144
|
-
|
|
145
|
-
// Can add to session only if not in the past and has available spaces
|
|
146
|
-
const canAddToSession = onAddToSession && availableSpaces > 0 && !isSessionInPast;
|
|
147
|
-
|
|
148
|
-
return (
|
|
149
|
-
<div className="flex flex-col gap-4 w-full min-w-0">
|
|
150
|
-
{/* Back Button - Standard pattern */}
|
|
151
|
-
<Button
|
|
152
|
-
variant="ghost"
|
|
153
|
-
withIcon
|
|
154
|
-
onClick={onBack}
|
|
155
|
-
className="text-label-action hover:bg-surface-action-soft w-fit"
|
|
156
|
-
>
|
|
157
|
-
<IconArrowLeft className="fill-current" />
|
|
158
|
-
Back
|
|
159
|
-
</Button>
|
|
160
|
-
|
|
161
|
-
{/* Session Info */}
|
|
162
|
-
<div className="flex flex-col gap-1">
|
|
163
|
-
<div className="flex items-center gap-2">
|
|
164
|
-
<h1 className={cn(
|
|
165
|
-
"text-xl font-semibold",
|
|
166
|
-
sessionStatus === 'finished' ? "text-label-tertiary" : "text-label-primary"
|
|
167
|
-
)}>
|
|
168
|
-
{session.productName}
|
|
169
|
-
</h1>
|
|
170
|
-
{sessionStatus === 'in_progress' && (
|
|
171
|
-
<Badge className="bg-surface-status-success text-label-status-success border-border-status-success text-xs px-2 py-0.5">
|
|
172
|
-
In Progress
|
|
173
|
-
</Badge>
|
|
174
|
-
)}
|
|
175
|
-
{sessionStatus === 'finished' && (
|
|
176
|
-
<Badge className="bg-surface-secondary text-label-tertiary border-border-primary text-xs px-2 py-0.5">
|
|
177
|
-
Finished
|
|
178
|
-
</Badge>
|
|
179
|
-
)}
|
|
180
|
-
</div>
|
|
181
|
-
<span className={cn(
|
|
182
|
-
"text-sm",
|
|
183
|
-
sessionStatus === 'finished' ? "text-label-quaternary" : "text-label-tertiary"
|
|
184
|
-
)}>
|
|
185
|
-
{date} • {session.startTime} - {session.endTime}
|
|
186
|
-
</span>
|
|
187
|
-
</div>
|
|
188
|
-
|
|
189
|
-
{/* Capacity Summary */}
|
|
190
|
-
<div className="flex items-center gap-4 p-4 rounded-lg border border-border-primary bg-surface-secondary">
|
|
191
|
-
<div className="flex flex-col gap-1">
|
|
192
|
-
<span className="text-label-tertiary text-sm">Session Capacity</span>
|
|
193
|
-
<Badge
|
|
194
|
-
className={cn(
|
|
195
|
-
'text-sm font-medium px-3 py-1 w-fit',
|
|
196
|
-
getCapacityColor(session.bookedCount, session.capacity)
|
|
197
|
-
)}
|
|
198
|
-
>
|
|
199
|
-
{session.bookedCount}/{session.capacity} spaces booked
|
|
200
|
-
</Badge>
|
|
201
|
-
</div>
|
|
202
|
-
<div className="flex flex-col gap-1 ml-auto">
|
|
203
|
-
<span className="text-label-tertiary text-sm">Available</span>
|
|
204
|
-
<span className="text-label-primary text-lg font-semibold">
|
|
205
|
-
{availableSpaces} {availableSpaces === 1 ? 'space' : 'spaces'}
|
|
206
|
-
</span>
|
|
207
|
-
</div>
|
|
208
|
-
</div>
|
|
209
|
-
|
|
210
|
-
{/* Add to Session Button - hidden for past sessions */}
|
|
211
|
-
{canAddToSession && (
|
|
212
|
-
<Button onClick={onAddToSession} withIcon className="w-fit">
|
|
213
|
-
<IconPlusThick className="w-4 h-4 text-white" />
|
|
214
|
-
Add to Session
|
|
215
|
-
</Button>
|
|
216
|
-
)}
|
|
217
|
-
|
|
218
|
-
{/* Bookings List */}
|
|
219
|
-
<div className="flex flex-col gap-3">
|
|
220
|
-
<div className="flex items-center justify-between">
|
|
221
|
-
<h3 className="text-label-primary font-medium">
|
|
222
|
-
Bookings ({session.bookings.length})
|
|
223
|
-
</h3>
|
|
224
|
-
</div>
|
|
225
|
-
|
|
226
|
-
{/* Search Input */}
|
|
227
|
-
{session.bookings.length > 0 && (
|
|
228
|
-
<Input
|
|
229
|
-
placeholder="Search by name, email, or reference"
|
|
230
|
-
value={searchQuery}
|
|
231
|
-
onChange={(e) => setSearchQuery(e.target.value)}
|
|
232
|
-
className="max-w-md"
|
|
233
|
-
/>
|
|
234
|
-
)}
|
|
235
|
-
|
|
236
|
-
{session.bookings.length === 0 ? (
|
|
237
|
-
<div className="text-center py-8 text-label-tertiary border border-border-primary rounded-lg bg-surface-primary">
|
|
238
|
-
<p className="text-sm">No bookings for this session yet.</p>
|
|
239
|
-
</div>
|
|
240
|
-
) : filteredBookings.length === 0 ? (
|
|
241
|
-
<div className="text-center py-8 text-label-tertiary border border-border-primary rounded-lg bg-surface-primary">
|
|
242
|
-
<p className="text-sm">No bookings match your search.</p>
|
|
243
|
-
</div>
|
|
244
|
-
) : (
|
|
245
|
-
<div className="flex flex-col gap-2">
|
|
246
|
-
{filteredBookings.map((booking) => (
|
|
247
|
-
<div
|
|
248
|
-
key={booking.id}
|
|
249
|
-
className="flex items-center justify-between p-4 rounded-lg border border-border-primary bg-surface-primary"
|
|
250
|
-
>
|
|
251
|
-
<div className="flex flex-col gap-1">
|
|
252
|
-
<div className="flex items-center gap-2">
|
|
253
|
-
<Badge
|
|
254
|
-
variant="outline"
|
|
255
|
-
className={cn(
|
|
256
|
-
'text-[10px] font-mono font-bold px-2 py-0.5 rounded-full border w-fit',
|
|
257
|
-
booking.type === 'booking'
|
|
258
|
-
? 'bg-blue-50 dark:bg-blue-950/30 text-blue-600 dark:text-blue-400 border-blue-200 dark:border-blue-800'
|
|
259
|
-
: 'bg-orange-50 dark:bg-orange-950/30 text-orange-600 dark:text-orange-400 border-orange-200 dark:border-orange-800'
|
|
260
|
-
)}
|
|
261
|
-
>
|
|
262
|
-
{booking.type === 'booking' ? 'BKG' : 'ENQ'}
|
|
263
|
-
</Badge>
|
|
264
|
-
<span className="text-label-primary font-medium">
|
|
265
|
-
#{booking.reference_number}
|
|
266
|
-
</span>
|
|
267
|
-
</div>
|
|
268
|
-
<span className="text-label-primary text-sm">
|
|
269
|
-
{booking.customer_name}
|
|
270
|
-
</span>
|
|
271
|
-
</div>
|
|
272
|
-
<div className="flex items-center gap-4">
|
|
273
|
-
<span className="text-label-primary font-medium">
|
|
274
|
-
£{booking.total_amount.toFixed(2)}
|
|
275
|
-
</span>
|
|
276
|
-
<Badge
|
|
277
|
-
className={cn(
|
|
278
|
-
'text-xs px-2 py-1',
|
|
279
|
-
statusColors[booking.status] || statusColors.active
|
|
280
|
-
)}
|
|
281
|
-
>
|
|
282
|
-
{formatStatus(booking.status)}
|
|
283
|
-
</Badge>
|
|
284
|
-
</div>
|
|
285
|
-
</div>
|
|
286
|
-
))}
|
|
287
|
-
</div>
|
|
288
|
-
)}
|
|
289
|
-
</div>
|
|
290
|
-
</div>
|
|
291
|
-
);
|
|
292
|
-
};
|
|
293
|
-
|
|
294
|
-
export default SessionDetailView;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import UnifiedSidebar from './shared/UnifiedSidebar';
|
|
3
|
-
import { useProviderSafe } from '@/contexts/ProviderContext';
|
|
4
|
-
|
|
5
|
-
const Sidebar: React.FC = () => {
|
|
6
|
-
// Safely get provider context (returns null if not in ProviderProvider)
|
|
7
|
-
const context = useProviderSafe();
|
|
8
|
-
const provider = context?.provider || null;
|
|
9
|
-
const isLoadingProvider = context?.isLoading || false;
|
|
10
|
-
|
|
11
|
-
return <UnifiedSidebar destination="provider" provider={provider} isLoadingProvider={isLoadingProvider} />;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export default Sidebar;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { useSidebar } from '@/contexts/SidebarContext';
|
|
3
|
-
import { SimulationBanner } from './SimulationBanner';
|
|
4
|
-
import DashboardFooter from './DashboardFooter';
|
|
5
|
-
|
|
6
|
-
interface SidebarAwareLayoutProps {
|
|
7
|
-
children: React.ReactNode;
|
|
8
|
-
className?: string;
|
|
9
|
-
showFooter?: boolean;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export const SidebarAwareLayout: React.FC<SidebarAwareLayoutProps> = ({ children, className = '', showFooter = true }) => {
|
|
13
|
-
const { collapsed } = useSidebar();
|
|
14
|
-
|
|
15
|
-
return (
|
|
16
|
-
<main
|
|
17
|
-
className={`flex flex-col items-start gap-2 flex-1 w-full min-w-0 px-4 max-sm:ml-0 max-sm:mr-0 max-sm:px-4 min-h-[calc(100vh-48px)] transition-all duration-300 overflow-x-hidden justify-between ${
|
|
18
|
-
collapsed
|
|
19
|
-
? 'sm:ml-[72px] sm:rtl:ml-0 sm:rtl:mr-[72px]'
|
|
20
|
-
: 'sm:ml-[268px] sm:rtl:ml-0 sm:rtl:mr-[268px]'
|
|
21
|
-
} ${className}`}
|
|
22
|
-
>
|
|
23
|
-
<SimulationBanner />
|
|
24
|
-
<div className="w-full min-w-0 max-w-full flex-1">
|
|
25
|
-
{children}
|
|
26
|
-
</div>
|
|
27
|
-
{showFooter && <DashboardFooter />}
|
|
28
|
-
</main>
|
|
29
|
-
);
|
|
30
|
-
};
|