@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,301 +0,0 @@
|
|
|
1
|
-
import React, { useState, useEffect } from 'react';
|
|
2
|
-
import { useTranslation } from 'react-i18next';
|
|
3
|
-
import { useNavigate } from 'react-router-dom';
|
|
4
|
-
import { supabase } from '@/integrations/supabase/client';
|
|
5
|
-
import { useNotify } from '../hooks/useNotify';
|
|
6
|
-
import { useProvider } from '@/contexts/ProviderContext';
|
|
7
|
-
import { Button } from './ui/button';
|
|
8
|
-
import { Input } from './ui/input';
|
|
9
|
-
import { Textarea } from './ui/textarea';
|
|
10
|
-
import { Label } from './ui/label';
|
|
11
|
-
import { Switch } from './ui/switch';
|
|
12
|
-
|
|
13
|
-
interface WaiverTemplate {
|
|
14
|
-
id: string;
|
|
15
|
-
name: string;
|
|
16
|
-
content: string | null;
|
|
17
|
-
expires_in_months: number;
|
|
18
|
-
requires_guardian_consent: boolean;
|
|
19
|
-
one_adult_per_waiver: boolean;
|
|
20
|
-
is_active: boolean;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
interface WaiverFormProps {
|
|
24
|
-
templateId?: string; // If provided, we're editing
|
|
25
|
-
onCancel: () => void;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
const WaiverForm: React.FC<WaiverFormProps> = ({ templateId, onCancel }) => {
|
|
29
|
-
const { provider } = useProvider();
|
|
30
|
-
const navigate = useNavigate();
|
|
31
|
-
const { showSuccess, showError } = useNotify();
|
|
32
|
-
const { t } = useTranslation(['Design', 'Validation']);
|
|
33
|
-
const [isLoading, setIsLoading] = useState(false);
|
|
34
|
-
const [isFetching, setIsFetching] = useState(!!templateId);
|
|
35
|
-
|
|
36
|
-
// Form state
|
|
37
|
-
const [name, setName] = useState('');
|
|
38
|
-
const [content, setContent] = useState('');
|
|
39
|
-
const [expiresInMonths, setExpiresInMonths] = useState<string>('1');
|
|
40
|
-
const [requiresGuardianConsent, setRequiresGuardianConsent] = useState(false);
|
|
41
|
-
const [oneAdultPerWaiver, setOneAdultPerWaiver] = useState(true);
|
|
42
|
-
|
|
43
|
-
// Validation state
|
|
44
|
-
const [expiresError, setExpiresError] = useState<string | null>(null);
|
|
45
|
-
|
|
46
|
-
const isEditing = !!templateId;
|
|
47
|
-
|
|
48
|
-
useEffect(() => {
|
|
49
|
-
if (templateId && provider) {
|
|
50
|
-
fetchTemplate();
|
|
51
|
-
}
|
|
52
|
-
}, [templateId, provider]);
|
|
53
|
-
|
|
54
|
-
const fetchTemplate = async () => {
|
|
55
|
-
if (!templateId) return;
|
|
56
|
-
|
|
57
|
-
setIsFetching(true);
|
|
58
|
-
try {
|
|
59
|
-
const { data, error } = await supabase
|
|
60
|
-
.from('waiver_templates')
|
|
61
|
-
.select('*')
|
|
62
|
-
.eq('id', templateId)
|
|
63
|
-
.single();
|
|
64
|
-
|
|
65
|
-
if (error) throw error;
|
|
66
|
-
|
|
67
|
-
// Cast to include new fields (types will be regenerated)
|
|
68
|
-
const template = data as any;
|
|
69
|
-
setName(template.name || '');
|
|
70
|
-
setContent(template.content || '');
|
|
71
|
-
setExpiresInMonths(String(template.expires_in_months || 1));
|
|
72
|
-
setRequiresGuardianConsent(template.requires_guardian_consent || false);
|
|
73
|
-
setOneAdultPerWaiver(template.one_adult_per_waiver ?? true);
|
|
74
|
-
} catch (error) {
|
|
75
|
-
console.error('Error fetching template:', error);
|
|
76
|
-
showError('Failed to load waiver template');
|
|
77
|
-
onCancel();
|
|
78
|
-
} finally {
|
|
79
|
-
setIsFetching(false);
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
const validateForm = (): boolean => {
|
|
84
|
-
let isValid = true;
|
|
85
|
-
setExpiresError(null);
|
|
86
|
-
|
|
87
|
-
if (!name.trim()) {
|
|
88
|
-
showError(t('pleaseEnterWaiverName', { ns: 'Validation' }));
|
|
89
|
-
isValid = false;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
const monthsValue = parseInt(expiresInMonths, 10);
|
|
93
|
-
if (isNaN(monthsValue) || monthsValue < 1) {
|
|
94
|
-
setExpiresError(t('expiryMustBeAtLeastOneMonth', { ns: 'Validation' }));
|
|
95
|
-
isValid = false;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
return isValid;
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
const handleSubmit = async (asDraft: boolean = false) => {
|
|
102
|
-
if (!provider) return;
|
|
103
|
-
|
|
104
|
-
if (!validateForm()) return;
|
|
105
|
-
|
|
106
|
-
setIsLoading(true);
|
|
107
|
-
try {
|
|
108
|
-
const monthsValue = parseInt(expiresInMonths, 10) || 1;
|
|
109
|
-
|
|
110
|
-
let shouldBeActive = false;
|
|
111
|
-
let shouldBePublished = !asDraft;
|
|
112
|
-
|
|
113
|
-
// If not a draft, check if this is the first template
|
|
114
|
-
if (!asDraft && !isEditing) {
|
|
115
|
-
const { count, error: countError } = await supabase
|
|
116
|
-
.from('waiver_templates')
|
|
117
|
-
.select('*', { count: 'exact', head: true })
|
|
118
|
-
.eq('provider_id', provider.id);
|
|
119
|
-
|
|
120
|
-
if (countError) throw countError;
|
|
121
|
-
|
|
122
|
-
// Only set as active if this is the first template
|
|
123
|
-
shouldBeActive = (count || 0) === 0;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
const templateData = {
|
|
127
|
-
name: name.trim(),
|
|
128
|
-
content: content.trim() || null,
|
|
129
|
-
expires_in_months: monthsValue,
|
|
130
|
-
requires_guardian_consent: requiresGuardianConsent,
|
|
131
|
-
one_adult_per_waiver: oneAdultPerWaiver,
|
|
132
|
-
is_active: asDraft ? false : shouldBeActive,
|
|
133
|
-
is_published: shouldBePublished,
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
if (isEditing) {
|
|
137
|
-
// When editing, don't change is_active or is_published status
|
|
138
|
-
const { is_active, is_published, ...editData } = templateData;
|
|
139
|
-
const { error } = await supabase
|
|
140
|
-
.from('waiver_templates')
|
|
141
|
-
.update(editData)
|
|
142
|
-
.eq('id', templateId);
|
|
143
|
-
|
|
144
|
-
if (error) throw error;
|
|
145
|
-
showSuccess('Waiver updated');
|
|
146
|
-
} else {
|
|
147
|
-
const { error } = await supabase
|
|
148
|
-
.from('waiver_templates')
|
|
149
|
-
.insert({
|
|
150
|
-
...templateData,
|
|
151
|
-
provider_id: provider.id,
|
|
152
|
-
display_order: 0,
|
|
153
|
-
});
|
|
154
|
-
|
|
155
|
-
if (error) throw error;
|
|
156
|
-
showSuccess(asDraft ? 'Waiver saved as draft' : (shouldBeActive ? 'Waiver created and activated' : 'Waiver created as disabled'));
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
onCancel(); // Navigate back
|
|
160
|
-
} catch (error) {
|
|
161
|
-
console.error('Error saving waiver:', error);
|
|
162
|
-
showError('Failed to save waiver');
|
|
163
|
-
} finally {
|
|
164
|
-
setIsLoading(false);
|
|
165
|
-
}
|
|
166
|
-
};
|
|
167
|
-
|
|
168
|
-
const handleExpiresChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
|
169
|
-
setExpiresInMonths(e.target.value);
|
|
170
|
-
// Clear error when user types
|
|
171
|
-
if (expiresError) setExpiresError(null);
|
|
172
|
-
};
|
|
173
|
-
|
|
174
|
-
if (isFetching) {
|
|
175
|
-
return (
|
|
176
|
-
<div className="flex items-center justify-center py-12">
|
|
177
|
-
<span className="text-label-secondary">{t('loadingWaiver')}</span>
|
|
178
|
-
</div>
|
|
179
|
-
);
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
return (
|
|
183
|
-
<div className="flex flex-col gap-6 w-full max-w-2xl mx-auto pt-12 pb-0 max-sm:pt-8 max-sm:pb-0">
|
|
184
|
-
{/* Name Field */}
|
|
185
|
-
<div className="flex flex-col gap-2">
|
|
186
|
-
<Label htmlFor="name" className="text-label-primary font-medium">
|
|
187
|
-
{t('waiverNameLabel')}
|
|
188
|
-
</Label>
|
|
189
|
-
<Input
|
|
190
|
-
id="name"
|
|
191
|
-
value={name}
|
|
192
|
-
onChange={(e) => setName(e.target.value)}
|
|
193
|
-
className="bg-surface-secondary"
|
|
194
|
-
/>
|
|
195
|
-
<p className="text-label-secondary text-sm">
|
|
196
|
-
{t('waiverNameDescription')}
|
|
197
|
-
</p>
|
|
198
|
-
</div>
|
|
199
|
-
|
|
200
|
-
{/* Content Field */}
|
|
201
|
-
<div className="flex flex-col gap-2">
|
|
202
|
-
<Label htmlFor="content" className="text-label-primary font-medium">
|
|
203
|
-
{t('waiverContentLabel')}
|
|
204
|
-
</Label>
|
|
205
|
-
<Textarea
|
|
206
|
-
id="content"
|
|
207
|
-
value={content}
|
|
208
|
-
onChange={(e) => setContent(e.target.value)}
|
|
209
|
-
className="bg-surface-secondary min-h-[150px]"
|
|
210
|
-
/>
|
|
211
|
-
<p className="text-label-secondary text-sm">
|
|
212
|
-
{t('waiverContentDescription')}
|
|
213
|
-
</p>
|
|
214
|
-
</div>
|
|
215
|
-
|
|
216
|
-
{/* Expires In Field */}
|
|
217
|
-
<div className="flex flex-col gap-2">
|
|
218
|
-
<Label htmlFor="expires" className="text-label-primary font-medium">
|
|
219
|
-
{t('waiverExpiresIn')}
|
|
220
|
-
</Label>
|
|
221
|
-
<div className="flex items-center gap-3">
|
|
222
|
-
<Input
|
|
223
|
-
id="expires"
|
|
224
|
-
type="text"
|
|
225
|
-
inputMode="numeric"
|
|
226
|
-
value={expiresInMonths}
|
|
227
|
-
onChange={handleExpiresChange}
|
|
228
|
-
className={`bg-surface-secondary w-24 ${expiresError ? 'border-fill-danger' : ''}`}
|
|
229
|
-
/>
|
|
230
|
-
<span className="text-label-primary">{t('waiverMonths')}</span>
|
|
231
|
-
</div>
|
|
232
|
-
{expiresError ? (
|
|
233
|
-
<p className="text-label-danger text-sm">{expiresError}</p>
|
|
234
|
-
) : (
|
|
235
|
-
<p className="text-label-secondary text-sm">
|
|
236
|
-
{t('waiverExpiryDescription')}
|
|
237
|
-
</p>
|
|
238
|
-
)}
|
|
239
|
-
</div>
|
|
240
|
-
|
|
241
|
-
{/* Advanced Section */}
|
|
242
|
-
<div className="flex flex-col gap-6">
|
|
243
|
-
<h3 className="text-base font-semibold text-label-primary">{t('advanced')}</h3>
|
|
244
|
-
|
|
245
|
-
{/* Requires Legal Guardian Consent */}
|
|
246
|
-
<div className="flex items-start gap-3">
|
|
247
|
-
<Switch
|
|
248
|
-
checked={requiresGuardianConsent}
|
|
249
|
-
onCheckedChange={setRequiresGuardianConsent}
|
|
250
|
-
/>
|
|
251
|
-
<div className="flex flex-col gap-1">
|
|
252
|
-
<span className="text-label-primary font-medium">
|
|
253
|
-
{t('requiresLegalGuardianConsent')}
|
|
254
|
-
</span>
|
|
255
|
-
<p className="text-label-secondary text-sm">
|
|
256
|
-
{t('requiresLegalGuardianConsentDescription')}
|
|
257
|
-
</p>
|
|
258
|
-
</div>
|
|
259
|
-
</div>
|
|
260
|
-
|
|
261
|
-
{/* 1 Adult per Waiver */}
|
|
262
|
-
<div className="flex items-start gap-3">
|
|
263
|
-
<Switch
|
|
264
|
-
checked={oneAdultPerWaiver}
|
|
265
|
-
onCheckedChange={setOneAdultPerWaiver}
|
|
266
|
-
/>
|
|
267
|
-
<div className="flex flex-col gap-1">
|
|
268
|
-
<span className="text-label-primary font-medium">
|
|
269
|
-
{t('oneAdultPerWaiver')}
|
|
270
|
-
</span>
|
|
271
|
-
<p className="text-label-secondary text-sm">
|
|
272
|
-
{t('oneAdultPerWaiverDescription')}
|
|
273
|
-
</p>
|
|
274
|
-
</div>
|
|
275
|
-
</div>
|
|
276
|
-
</div>
|
|
277
|
-
|
|
278
|
-
{/* Action Buttons */}
|
|
279
|
-
<div className="flex items-center gap-3 pt-2">
|
|
280
|
-
<Button
|
|
281
|
-
className="bg-fill-action text-white hover:bg-fill-action-hover active:bg-fill-action-pressed"
|
|
282
|
-
onClick={() => handleSubmit(false)}
|
|
283
|
-
disabled={isLoading}
|
|
284
|
-
>
|
|
285
|
-
{isEditing ? t('updateWaiver') : t('createWaiver')}
|
|
286
|
-
</Button>
|
|
287
|
-
{!isEditing && (
|
|
288
|
-
<Button
|
|
289
|
-
variant="outline"
|
|
290
|
-
onClick={() => handleSubmit(true)}
|
|
291
|
-
disabled={isLoading}
|
|
292
|
-
>
|
|
293
|
-
{t('saveAsDraft')}
|
|
294
|
-
</Button>
|
|
295
|
-
)}
|
|
296
|
-
</div>
|
|
297
|
-
</div>
|
|
298
|
-
);
|
|
299
|
-
};
|
|
300
|
-
|
|
301
|
-
export default WaiverForm;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { useProvider } from '@/contexts/ProviderContext';
|
|
3
|
-
import { IconWaivers, IconExternal } from '../../icons';
|
|
4
|
-
import FeatureToggle from './FeatureToggle';
|
|
5
|
-
import { Button } from './ui/button';
|
|
6
|
-
|
|
7
|
-
const WaiversGeneralSettings: React.FC = () => {
|
|
8
|
-
const { provider } = useProvider();
|
|
9
|
-
|
|
10
|
-
const waiversEnabled = provider?.waivers_enabled === true;
|
|
11
|
-
|
|
12
|
-
const title = waiversEnabled ? 'Waivers Enabled' : 'Waivers Disabled';
|
|
13
|
-
const description = waiversEnabled
|
|
14
|
-
? 'Customers can sign waivers before participating in activities.'
|
|
15
|
-
: 'Customers cannot sign waivers before participating in activities.';
|
|
16
|
-
|
|
17
|
-
return (
|
|
18
|
-
<div className="flex flex-col gap-4 w-full">
|
|
19
|
-
<FeatureToggle
|
|
20
|
-
icon={<IconWaivers size={48} className="fill-fill-primary" />}
|
|
21
|
-
title={title}
|
|
22
|
-
description={description}
|
|
23
|
-
enabled={waiversEnabled}
|
|
24
|
-
onToggle={() => {}}
|
|
25
|
-
readOnly
|
|
26
|
-
/>
|
|
27
|
-
|
|
28
|
-
{waiversEnabled && (
|
|
29
|
-
<div className="flex">
|
|
30
|
-
<Button
|
|
31
|
-
variant="ghost"
|
|
32
|
-
size="sm"
|
|
33
|
-
withIcon
|
|
34
|
-
onClick={() => window.open('https://app.booked.it/waiver/uXMr1Q4yKcgEClPHXQwT6f7OSm0P6NLe', '_blank')}
|
|
35
|
-
className="w-fit"
|
|
36
|
-
>
|
|
37
|
-
<IconExternal className="w-4 h-4" />
|
|
38
|
-
Launch Waiver Kiosk
|
|
39
|
-
</Button>
|
|
40
|
-
</div>
|
|
41
|
-
)}
|
|
42
|
-
</div>
|
|
43
|
-
);
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
export default WaiversGeneralSettings;
|
|
@@ -1,290 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
2
|
-
import { useNavigate } from 'react-router-dom';
|
|
3
|
-
import { DataTable } from './tables/DataTable';
|
|
4
|
-
import { ColumnConfig, RowAction } from './tables/types';
|
|
5
|
-
import { cn } from '../lib/utils';
|
|
6
|
-
import { IconExclaim } from '../../icons';
|
|
7
|
-
import CustomerCard from './CustomerCard';
|
|
8
|
-
|
|
9
|
-
export interface Waiver {
|
|
10
|
-
id: string;
|
|
11
|
-
customerName: string;
|
|
12
|
-
customerEmail: string;
|
|
13
|
-
customerId?: string;
|
|
14
|
-
type: 'adult' | 'minor';
|
|
15
|
-
age: number;
|
|
16
|
-
minorCount?: number;
|
|
17
|
-
nextBookingDate?: string;
|
|
18
|
-
lastBookingDate?: string;
|
|
19
|
-
numberOfBookings?: number;
|
|
20
|
-
expiresDate?: string;
|
|
21
|
-
status: 'signed' | 'expired' | 'not_signed';
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
interface WaiversTableProps {
|
|
25
|
-
waivers: Waiver[];
|
|
26
|
-
onViewCustomer?: (waiver: Waiver) => void;
|
|
27
|
-
onEditCustomer?: (waiver: Waiver) => void;
|
|
28
|
-
onDeleteWaiver?: (waiver: Waiver) => void;
|
|
29
|
-
onSendWaiverRequest?: (waiver: Waiver) => void;
|
|
30
|
-
showWaiverColumn?: boolean;
|
|
31
|
-
basePath?: string;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
const WaiverStatusBadge: React.FC<{ status: Waiver['status'] }> = ({ status }) => {
|
|
35
|
-
const getStatusClasses = () => {
|
|
36
|
-
switch (status) {
|
|
37
|
-
case 'signed':
|
|
38
|
-
return 'bg-surface-status-success text-label-primary border-border-status-success';
|
|
39
|
-
case 'expired':
|
|
40
|
-
return 'bg-surface-status-alert text-label-primary border-border-status-alert';
|
|
41
|
-
case 'not_signed':
|
|
42
|
-
return 'bg-surface-status-error text-label-primary border-border-status-error';
|
|
43
|
-
default:
|
|
44
|
-
return 'bg-surface-status-error text-label-primary border-border-status-error';
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
const getLabel = () => {
|
|
49
|
-
switch (status) {
|
|
50
|
-
case 'signed':
|
|
51
|
-
return 'Signed';
|
|
52
|
-
case 'expired':
|
|
53
|
-
return 'Expired';
|
|
54
|
-
case 'not_signed':
|
|
55
|
-
return 'Not Signed';
|
|
56
|
-
default:
|
|
57
|
-
return status;
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
// Expired and Not Signed have icons so use asymmetric padding; Signed uses symmetric
|
|
62
|
-
const hasIcon = status === 'expired' || status === 'not_signed';
|
|
63
|
-
const paddingClass = hasIcon ? 'pl-1.5 pr-2' : 'px-2';
|
|
64
|
-
|
|
65
|
-
return (
|
|
66
|
-
<div className={cn(
|
|
67
|
-
"inline-flex justify-center items-center gap-1 border py-1 rounded-3xl",
|
|
68
|
-
paddingClass,
|
|
69
|
-
getStatusClasses()
|
|
70
|
-
)}>
|
|
71
|
-
{hasIcon && (
|
|
72
|
-
<IconExclaim size={16} className="text-label-primary" />
|
|
73
|
-
)}
|
|
74
|
-
<span className="text-[10px] font-mono font-medium leading-[13px] whitespace-nowrap">
|
|
75
|
-
{getLabel()}
|
|
76
|
-
</span>
|
|
77
|
-
</div>
|
|
78
|
-
);
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
interface CustomerCellProps {
|
|
82
|
-
waiver: Waiver;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
const CustomerCell: React.FC<CustomerCellProps> = ({ waiver }) => {
|
|
86
|
-
const [isHovered, setIsHovered] = useState(false);
|
|
87
|
-
|
|
88
|
-
return (
|
|
89
|
-
<div
|
|
90
|
-
className="flex flex-col gap-0.5"
|
|
91
|
-
onMouseEnter={() => setIsHovered(true)}
|
|
92
|
-
onMouseLeave={() => setIsHovered(false)}
|
|
93
|
-
>
|
|
94
|
-
<span className="text-label-primary text-[13px] font-semibold leading-4">
|
|
95
|
-
{waiver.customerName}
|
|
96
|
-
</span>
|
|
97
|
-
<span className="text-label-secondary text-[12px] font-normal leading-4">
|
|
98
|
-
{isHovered && waiver.customerId ? waiver.customerId : waiver.customerEmail}
|
|
99
|
-
</span>
|
|
100
|
-
</div>
|
|
101
|
-
);
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
// Mobile card list component
|
|
105
|
-
const MobileCustomerList: React.FC<{
|
|
106
|
-
waivers: Waiver[];
|
|
107
|
-
showWaiverColumn: boolean;
|
|
108
|
-
onViewCustomer: (waiver: Waiver) => void;
|
|
109
|
-
}> = ({ waivers, showWaiverColumn, onViewCustomer }) => {
|
|
110
|
-
if (waivers.length === 0) {
|
|
111
|
-
return (
|
|
112
|
-
<div className="text-center py-12">
|
|
113
|
-
<p className="text-label-secondary">No customers found</p>
|
|
114
|
-
</div>
|
|
115
|
-
);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
return (
|
|
119
|
-
<div className="flex flex-col gap-3">
|
|
120
|
-
{waivers.map((waiver) => (
|
|
121
|
-
<CustomerCard
|
|
122
|
-
key={waiver.id}
|
|
123
|
-
customerName={waiver.customerName}
|
|
124
|
-
customerEmail={waiver.customerEmail}
|
|
125
|
-
customerId={waiver.customerId}
|
|
126
|
-
age={waiver.age}
|
|
127
|
-
nextBookingDate={waiver.nextBookingDate}
|
|
128
|
-
lastBookingDate={waiver.lastBookingDate}
|
|
129
|
-
numberOfBookings={waiver.numberOfBookings}
|
|
130
|
-
status={waiver.status}
|
|
131
|
-
showWaiverStatus={showWaiverColumn}
|
|
132
|
-
onClick={() => onViewCustomer(waiver)}
|
|
133
|
-
/>
|
|
134
|
-
))}
|
|
135
|
-
</div>
|
|
136
|
-
);
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
const WaiversTable: React.FC<WaiversTableProps> = ({
|
|
140
|
-
waivers,
|
|
141
|
-
onViewCustomer,
|
|
142
|
-
onEditCustomer,
|
|
143
|
-
onDeleteWaiver,
|
|
144
|
-
onSendWaiverRequest,
|
|
145
|
-
showWaiverColumn = true,
|
|
146
|
-
basePath = '',
|
|
147
|
-
}) => {
|
|
148
|
-
const navigate = useNavigate();
|
|
149
|
-
|
|
150
|
-
// Columns when waivers is ACTIVE: Customer / Next Booking / Age / Waiver Status
|
|
151
|
-
const waiversActiveColumns: ColumnConfig<Waiver>[] = [
|
|
152
|
-
{
|
|
153
|
-
label: 'Customer',
|
|
154
|
-
width: 'flex-1 min-w-0',
|
|
155
|
-
render: (waiver) => <CustomerCell waiver={waiver} />,
|
|
156
|
-
},
|
|
157
|
-
{
|
|
158
|
-
label: 'Next Booking',
|
|
159
|
-
width: 'w-[160px]',
|
|
160
|
-
render: (waiver) => (
|
|
161
|
-
<span className="text-label-primary text-[13px] font-normal leading-4">
|
|
162
|
-
{waiver.nextBookingDate || '-'}
|
|
163
|
-
</span>
|
|
164
|
-
),
|
|
165
|
-
},
|
|
166
|
-
{
|
|
167
|
-
label: 'Age',
|
|
168
|
-
width: 'w-[140px]',
|
|
169
|
-
render: (waiver) => (
|
|
170
|
-
<span className="text-label-primary text-[13px] font-normal leading-4">
|
|
171
|
-
{waiver.age}
|
|
172
|
-
</span>
|
|
173
|
-
),
|
|
174
|
-
},
|
|
175
|
-
{
|
|
176
|
-
label: 'Waiver',
|
|
177
|
-
width: 'w-[140px]',
|
|
178
|
-
render: (waiver) => <WaiverStatusBadge status={waiver.status} />,
|
|
179
|
-
},
|
|
180
|
-
];
|
|
181
|
-
|
|
182
|
-
// Columns when waivers is DISABLED: Customer / Next Booking / Last Booking / Number of Bookings
|
|
183
|
-
const waiversDisabledColumns: ColumnConfig<Waiver>[] = [
|
|
184
|
-
{
|
|
185
|
-
label: 'Customer',
|
|
186
|
-
width: 'flex-1 min-w-0',
|
|
187
|
-
render: (waiver) => <CustomerCell waiver={waiver} />,
|
|
188
|
-
},
|
|
189
|
-
{
|
|
190
|
-
label: 'Next Booking',
|
|
191
|
-
width: 'w-[160px]',
|
|
192
|
-
render: (waiver) => (
|
|
193
|
-
<span className="text-label-primary text-[13px] font-normal leading-4">
|
|
194
|
-
{waiver.nextBookingDate || '-'}
|
|
195
|
-
</span>
|
|
196
|
-
),
|
|
197
|
-
},
|
|
198
|
-
{
|
|
199
|
-
label: 'Last Booking',
|
|
200
|
-
width: 'w-[160px]',
|
|
201
|
-
render: (waiver) => (
|
|
202
|
-
<span className="text-label-primary text-[13px] font-normal leading-4">
|
|
203
|
-
{waiver.lastBookingDate || '-'}
|
|
204
|
-
</span>
|
|
205
|
-
),
|
|
206
|
-
},
|
|
207
|
-
{
|
|
208
|
-
label: 'No. of Bookings',
|
|
209
|
-
width: 'w-[140px]',
|
|
210
|
-
render: (waiver) => (
|
|
211
|
-
<span className="text-label-primary text-[13px] font-normal leading-4">
|
|
212
|
-
{waiver.numberOfBookings ?? 0}
|
|
213
|
-
</span>
|
|
214
|
-
),
|
|
215
|
-
},
|
|
216
|
-
];
|
|
217
|
-
|
|
218
|
-
const columns = showWaiverColumn ? waiversActiveColumns : waiversDisabledColumns;
|
|
219
|
-
|
|
220
|
-
const handleViewCustomer = (waiver: Waiver) => {
|
|
221
|
-
if (onViewCustomer) {
|
|
222
|
-
onViewCustomer(waiver);
|
|
223
|
-
} else if (basePath) {
|
|
224
|
-
navigate(`${basePath}/customers/${waiver.id}`);
|
|
225
|
-
}
|
|
226
|
-
};
|
|
227
|
-
|
|
228
|
-
const rowActions = (waiver: Waiver): RowAction<Waiver>[] => {
|
|
229
|
-
const actions: RowAction<Waiver>[] = [
|
|
230
|
-
{
|
|
231
|
-
label: 'View Customer',
|
|
232
|
-
onClick: () => handleViewCustomer(waiver),
|
|
233
|
-
},
|
|
234
|
-
...(onEditCustomer ? [{
|
|
235
|
-
label: 'Edit Customer',
|
|
236
|
-
onClick: () => onEditCustomer(waiver),
|
|
237
|
-
}] : []),
|
|
238
|
-
];
|
|
239
|
-
|
|
240
|
-
// Add "Send Waiver Request" option when waivers are enabled
|
|
241
|
-
if (showWaiverColumn && onSendWaiverRequest) {
|
|
242
|
-
actions.push({
|
|
243
|
-
label: 'Send Waiver Request',
|
|
244
|
-
onClick: () => onSendWaiverRequest(waiver),
|
|
245
|
-
});
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
actions.push({
|
|
249
|
-
label: 'Delete',
|
|
250
|
-
onClick: () => onDeleteWaiver?.(waiver),
|
|
251
|
-
variant: 'danger',
|
|
252
|
-
});
|
|
253
|
-
|
|
254
|
-
return actions;
|
|
255
|
-
};
|
|
256
|
-
|
|
257
|
-
return (
|
|
258
|
-
<>
|
|
259
|
-
{/* Mobile: Card layout */}
|
|
260
|
-
<div className="sm:hidden">
|
|
261
|
-
<MobileCustomerList
|
|
262
|
-
waivers={waivers}
|
|
263
|
-
showWaiverColumn={showWaiverColumn}
|
|
264
|
-
onViewCustomer={handleViewCustomer}
|
|
265
|
-
/>
|
|
266
|
-
</div>
|
|
267
|
-
|
|
268
|
-
{/* Desktop: Table layout */}
|
|
269
|
-
<div className="hidden sm:block">
|
|
270
|
-
<DataTable
|
|
271
|
-
data={waivers}
|
|
272
|
-
columns={columns}
|
|
273
|
-
keyExtractor={(waiver) => waiver.id}
|
|
274
|
-
rowActions={rowActions}
|
|
275
|
-
onRowClick={handleViewCustomer}
|
|
276
|
-
pagination={{
|
|
277
|
-
entityName: 'customers'
|
|
278
|
-
}}
|
|
279
|
-
emptyState={
|
|
280
|
-
<div className="text-center py-12">
|
|
281
|
-
<p className="text-label-secondary">No customers found</p>
|
|
282
|
-
</div>
|
|
283
|
-
}
|
|
284
|
-
/>
|
|
285
|
-
</div>
|
|
286
|
-
</>
|
|
287
|
-
);
|
|
288
|
-
};
|
|
289
|
-
|
|
290
|
-
export default WaiversTable;
|