@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,213 +0,0 @@
|
|
|
1
|
-
import React, { useState, useEffect } from 'react';
|
|
2
|
-
import { useNavigate, useLocation, useParams } from 'react-router-dom';
|
|
3
|
-
import {
|
|
4
|
-
DndContext,
|
|
5
|
-
closestCenter,
|
|
6
|
-
KeyboardSensor,
|
|
7
|
-
PointerSensor,
|
|
8
|
-
useSensor,
|
|
9
|
-
useSensors,
|
|
10
|
-
DragEndEvent,
|
|
11
|
-
} from '@dnd-kit/core';
|
|
12
|
-
import {
|
|
13
|
-
arrayMove,
|
|
14
|
-
SortableContext,
|
|
15
|
-
sortableKeyboardCoordinates,
|
|
16
|
-
verticalListSortingStrategy,
|
|
17
|
-
useSortable,
|
|
18
|
-
} from '@dnd-kit/sortable';
|
|
19
|
-
import { CSS } from '@dnd-kit/utilities';
|
|
20
|
-
import { supabase } from '@/integrations/supabase/client';
|
|
21
|
-
import { useProvider } from '@/contexts/ProviderContext';
|
|
22
|
-
import { useNotify } from '../../hooks/useNotify';
|
|
23
|
-
import { Button } from '../ui/button';
|
|
24
|
-
import { IconPlus, IconGripVertical } from '../../../icons';
|
|
25
|
-
import PricingPeriodCard, { type PricingPeriod, type PricingPeriodRule } from './PricingPeriodCard';
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
// Sortable wrapper for PricingPeriodCard
|
|
29
|
-
const SortablePeriodCard: React.FC<{
|
|
30
|
-
period: PricingPeriod;
|
|
31
|
-
onEdit: (period: PricingPeriod) => void;
|
|
32
|
-
onDelete: (period: PricingPeriod) => void;
|
|
33
|
-
onToggleActive: (period: PricingPeriod) => void;
|
|
34
|
-
}> = ({ period, onEdit, onDelete, onToggleActive }) => {
|
|
35
|
-
const {
|
|
36
|
-
attributes,
|
|
37
|
-
listeners,
|
|
38
|
-
setNodeRef,
|
|
39
|
-
transform,
|
|
40
|
-
transition,
|
|
41
|
-
isDragging,
|
|
42
|
-
} = useSortable({ id: period.id });
|
|
43
|
-
|
|
44
|
-
const style = {
|
|
45
|
-
transform: CSS.Transform.toString(transform),
|
|
46
|
-
transition,
|
|
47
|
-
opacity: isDragging ? 0.5 : 1,
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
return (
|
|
51
|
-
<div ref={setNodeRef} style={style} className="flex items-center gap-0">
|
|
52
|
-
<div
|
|
53
|
-
{...attributes}
|
|
54
|
-
{...listeners}
|
|
55
|
-
className="p-1.5 rounded-md cursor-grab active:cursor-grabbing fill-fill-secondary hover:fill-fill-primary hover:bg-surface-secondary transition-colors flex-shrink-0"
|
|
56
|
-
>
|
|
57
|
-
<IconGripVertical size={20} />
|
|
58
|
-
</div>
|
|
59
|
-
<div className="flex-1 min-w-0">
|
|
60
|
-
<PricingPeriodCard
|
|
61
|
-
period={period}
|
|
62
|
-
onEdit={onEdit}
|
|
63
|
-
onDelete={onDelete}
|
|
64
|
-
onToggleActive={onToggleActive}
|
|
65
|
-
/>
|
|
66
|
-
</div>
|
|
67
|
-
</div>
|
|
68
|
-
);
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
const PricingPeriodsList: React.FC = () => {
|
|
72
|
-
const { provider } = useProvider();
|
|
73
|
-
const navigate = useNavigate();
|
|
74
|
-
const location = useLocation();
|
|
75
|
-
const { companyId } = useParams();
|
|
76
|
-
const { showSuccess, showError } = useNotify();
|
|
77
|
-
const [periods, setPeriods] = useState<PricingPeriod[]>([]);
|
|
78
|
-
const [isLoading, setIsLoading] = useState(true);
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
const sensors = useSensors(
|
|
82
|
-
useSensor(PointerSensor, { activationConstraint: { distance: 5 } }),
|
|
83
|
-
useSensor(KeyboardSensor, { coordinateGetter: sortableKeyboardCoordinates })
|
|
84
|
-
);
|
|
85
|
-
|
|
86
|
-
const fetchPeriods = async () => {
|
|
87
|
-
if (!provider?.id) return;
|
|
88
|
-
setIsLoading(true);
|
|
89
|
-
const { data, error } = await supabase
|
|
90
|
-
.from('pricing_periods')
|
|
91
|
-
.select('*')
|
|
92
|
-
.eq('provider_id', provider.id)
|
|
93
|
-
.eq('status', 'active')
|
|
94
|
-
.order('priority', { ascending: true });
|
|
95
|
-
|
|
96
|
-
if (!error && data) {
|
|
97
|
-
setPeriods(data.map(d => ({
|
|
98
|
-
...d,
|
|
99
|
-
rules: (Array.isArray(d.rules) ? d.rules : []) as unknown as PricingPeriodRule[],
|
|
100
|
-
})));
|
|
101
|
-
}
|
|
102
|
-
setIsLoading(false);
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
useEffect(() => {
|
|
106
|
-
fetchPeriods();
|
|
107
|
-
}, [provider?.id]);
|
|
108
|
-
|
|
109
|
-
const getBasePath = () => {
|
|
110
|
-
const pathParts = location.pathname.split('/');
|
|
111
|
-
const providerType = pathParts.find(p => p === 'venue' || p === 'promoter');
|
|
112
|
-
const providerId = provider?.venue_id;
|
|
113
|
-
if (companyId) {
|
|
114
|
-
return `/company/${companyId}/${providerType}/${providerId}`;
|
|
115
|
-
}
|
|
116
|
-
return `/${providerType}/${providerId}`;
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
const handleCreate = () => {
|
|
120
|
-
navigate(`${getBasePath()}/settings/pricing/add`);
|
|
121
|
-
};
|
|
122
|
-
|
|
123
|
-
const handleEdit = (period: PricingPeriod) => {
|
|
124
|
-
navigate(`${getBasePath()}/settings/pricing/edit/${period.id}`);
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
const handleToggleActive = async (period: PricingPeriod) => {
|
|
128
|
-
try {
|
|
129
|
-
const newState = !period.is_active;
|
|
130
|
-
const { error } = await supabase
|
|
131
|
-
.from('pricing_periods')
|
|
132
|
-
.update({ is_active: newState })
|
|
133
|
-
.eq('id', period.id);
|
|
134
|
-
if (error) throw error;
|
|
135
|
-
showSuccess(
|
|
136
|
-
newState ? 'Period Activated' : 'Period Deactivated',
|
|
137
|
-
`${period.name} has been ${newState ? 'activated' : 'deactivated'}.`
|
|
138
|
-
);
|
|
139
|
-
await fetchPeriods();
|
|
140
|
-
} catch (error) {
|
|
141
|
-
showError('Error', 'Failed to update pricing period status.');
|
|
142
|
-
}
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
const handleDragEnd = async (event: DragEndEvent) => {
|
|
146
|
-
const { active, over } = event;
|
|
147
|
-
if (!over || active.id === over.id) return;
|
|
148
|
-
|
|
149
|
-
const oldIndex = periods.findIndex(p => p.id === active.id);
|
|
150
|
-
const newIndex = periods.findIndex(p => p.id === over.id);
|
|
151
|
-
if (oldIndex === -1 || newIndex === -1) return;
|
|
152
|
-
|
|
153
|
-
const reordered = arrayMove(periods, oldIndex, newIndex);
|
|
154
|
-
// Optimistically update with new priorities
|
|
155
|
-
const updated = reordered.map((p, i) => ({ ...p, priority: i + 1 }));
|
|
156
|
-
setPeriods(updated);
|
|
157
|
-
|
|
158
|
-
// Persist all priority changes
|
|
159
|
-
try {
|
|
160
|
-
const updates = updated.map(p =>
|
|
161
|
-
supabase.from('pricing_periods').update({ priority: p.priority }).eq('id', p.id)
|
|
162
|
-
);
|
|
163
|
-
const results = await Promise.all(updates);
|
|
164
|
-
const failed = results.find(r => r.error);
|
|
165
|
-
if (failed?.error) throw failed.error;
|
|
166
|
-
} catch (error) {
|
|
167
|
-
showError('Error', 'Failed to update priority order.');
|
|
168
|
-
await fetchPeriods(); // revert
|
|
169
|
-
}
|
|
170
|
-
};
|
|
171
|
-
|
|
172
|
-
const handleDelete = (period: PricingPeriod) => {
|
|
173
|
-
navigate(`${getBasePath()}/settings/pricing/delete/${period.id}`);
|
|
174
|
-
};
|
|
175
|
-
|
|
176
|
-
return (
|
|
177
|
-
<div className="flex flex-col gap-4 w-full">
|
|
178
|
-
<div className="flex items-center justify-between">
|
|
179
|
-
<h2 className="text-label-primary text-xl font-semibold">Pricing Periods Settings</h2>
|
|
180
|
-
<Button variant="ghost" size="sm" onClick={handleCreate} withIcon>
|
|
181
|
-
<IconPlus className="w-4 h-4" />
|
|
182
|
-
New Period
|
|
183
|
-
</Button>
|
|
184
|
-
</div>
|
|
185
|
-
|
|
186
|
-
{isLoading ? (
|
|
187
|
-
<p className="text-label-secondary text-sm py-8 text-center">Loading...</p>
|
|
188
|
-
) : periods.length === 0 ? (
|
|
189
|
-
<p className="text-label-tertiary text-sm py-8 text-left">
|
|
190
|
-
No pricing periods configured. Create your first period to define variable pricing.
|
|
191
|
-
</p>
|
|
192
|
-
) : (
|
|
193
|
-
<DndContext sensors={sensors} collisionDetection={closestCenter} onDragEnd={handleDragEnd}>
|
|
194
|
-
<SortableContext items={periods.map(p => p.id)} strategy={verticalListSortingStrategy}>
|
|
195
|
-
<div className="flex flex-col gap-3">
|
|
196
|
-
{periods.map(period => (
|
|
197
|
-
<SortablePeriodCard
|
|
198
|
-
key={period.id}
|
|
199
|
-
period={period}
|
|
200
|
-
onEdit={handleEdit}
|
|
201
|
-
onDelete={handleDelete}
|
|
202
|
-
onToggleActive={handleToggleActive}
|
|
203
|
-
/>
|
|
204
|
-
))}
|
|
205
|
-
</div>
|
|
206
|
-
</SortableContext>
|
|
207
|
-
</DndContext>
|
|
208
|
-
)}
|
|
209
|
-
</div>
|
|
210
|
-
);
|
|
211
|
-
};
|
|
212
|
-
|
|
213
|
-
export default PricingPeriodsList;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import type { DynamicPricingRule } from '../pricing/DynamicPricingRulesEditor';
|
|
2
|
-
|
|
3
|
-
const getRuleSummary = (rule: DynamicPricingRule): string => {
|
|
4
|
-
switch (rule.type) {
|
|
5
|
-
case 'resource_availability':
|
|
6
|
-
return `Availability ${rule.availability_condition === 'exceeds' ? 'exceeds' : 'under'} ${rule.threshold_percentage ?? '?'}%`;
|
|
7
|
-
case 'latency': {
|
|
8
|
-
const mode = rule.latency_mode || 'till_booking';
|
|
9
|
-
if (mode === 'date_range') {
|
|
10
|
-
const startVal = rule.latency_range_start ?? '?';
|
|
11
|
-
const startUnit = rule.latency_range_start_unit || 'days';
|
|
12
|
-
const endVal = rule.latency_range_end ?? '?';
|
|
13
|
-
const endUnit = rule.latency_range_end_unit || 'days';
|
|
14
|
-
return `${startVal} ${startUnit} – ${endVal} ${endUnit} before`;
|
|
15
|
-
}
|
|
16
|
-
const value = rule.latency_value ?? rule.hours_before ?? '?';
|
|
17
|
-
const unit = rule.latency_unit || 'hours';
|
|
18
|
-
const unitLabel = unit === 'minutes' ? 'min' : unit === 'hours' ? 'h' : 'd';
|
|
19
|
-
return `Within ${value}${unitLabel} of slot`;
|
|
20
|
-
}
|
|
21
|
-
case 'group_size':
|
|
22
|
-
return `Group size ≥ ${rule.min_group_size ?? '?'}`;
|
|
23
|
-
case 'cancellation_rate':
|
|
24
|
-
return `Cancellations > ${rule.cancellation_threshold ?? '?'}% in ${rule.cancellation_window_hours ?? '?'}h`;
|
|
25
|
-
case 'traffic':
|
|
26
|
-
return `Views > ${rule.views_threshold ?? '?'} in ${rule.traffic_window_hours ?? '?'}h`;
|
|
27
|
-
case 'weather': {
|
|
28
|
-
const parts: string[] = [];
|
|
29
|
-
if (rule.weather_conditions?.length) parts.push(rule.weather_conditions.join(', '));
|
|
30
|
-
if (rule.temperature_above != null) parts.push(`above ${rule.temperature_above}°`);
|
|
31
|
-
if (rule.temperature_below != null) parts.push(`below ${rule.temperature_below}°`);
|
|
32
|
-
return parts.length ? `Weather: ${parts.join('; ')}` : 'Weather conditions';
|
|
33
|
-
}
|
|
34
|
-
default:
|
|
35
|
-
return rule.type;
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export default getRuleSummary;
|
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Button } from '../ui/button';
|
|
3
|
-
import { Input } from '../ui/input';
|
|
4
|
-
import { Label } from '../ui/label';
|
|
5
|
-
import { Checkbox } from '../ui/checkbox';
|
|
6
|
-
import { Switch } from '../ui/switch';
|
|
7
|
-
import { IconPlus, IconDelete, IconTime } from '../../../icons';
|
|
8
|
-
|
|
9
|
-
export interface AvailabilityRule {
|
|
10
|
-
days: string[];
|
|
11
|
-
is_24_hours: boolean;
|
|
12
|
-
start_time?: string;
|
|
13
|
-
end_time?: string;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export interface AvailabilityData {
|
|
17
|
-
always_available: boolean;
|
|
18
|
-
rules: AvailabilityRule[];
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const DAY_OPTIONS = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'];
|
|
22
|
-
|
|
23
|
-
interface AvailabilityRulesSectionProps {
|
|
24
|
-
alwaysAvailable: boolean;
|
|
25
|
-
onAlwaysAvailableChange: (value: boolean) => void;
|
|
26
|
-
rules: AvailabilityRule[];
|
|
27
|
-
onChange: (rules: AvailabilityRule[]) => void;
|
|
28
|
-
/** Controls the toggle label and description text based on context */
|
|
29
|
-
variant?: 'category' | 'item';
|
|
30
|
-
/** Provider type label used in the category toggle text (e.g. 'venue' or 'promoter') */
|
|
31
|
-
providerType?: string;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
const AvailabilityRulesSection: React.FC<AvailabilityRulesSectionProps> = ({ alwaysAvailable, onAlwaysAvailableChange, rules, onChange, variant = 'item', providerType = 'venue' }) => {
|
|
35
|
-
const providerLabel = providerType === 'promoter' ? 'promoter' : 'venue';
|
|
36
|
-
const toggleLabel = variant === 'category'
|
|
37
|
-
? `Available within ${providerLabel} opening hours`
|
|
38
|
-
: 'Align with category availability';
|
|
39
|
-
const description = variant === 'category'
|
|
40
|
-
? 'Define which days and times this product category is available.'
|
|
41
|
-
: 'Define which days and times this product is available.';
|
|
42
|
-
|
|
43
|
-
const addRule = () => {
|
|
44
|
-
onChange([...rules, { days: [], is_24_hours: true }]);
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
const updateRule = (index: number, updates: Partial<AvailabilityRule>) => {
|
|
48
|
-
onChange(rules.map((r, i) => i === index ? { ...r, ...updates } : r));
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
const removeRule = (index: number) => {
|
|
52
|
-
onChange(rules.filter((_, i) => i !== index));
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
const toggleDay = (ruleIndex: number, day: string) => {
|
|
56
|
-
const rule = rules[ruleIndex];
|
|
57
|
-
const days = rule.days || [];
|
|
58
|
-
const updated = days.includes(day) ? days.filter(d => d !== day) : [...days, day];
|
|
59
|
-
updateRule(ruleIndex, { days: updated });
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
const toggle24Hours = (index: number, checked: boolean) => {
|
|
63
|
-
if (checked) {
|
|
64
|
-
updateRule(index, { is_24_hours: true, start_time: undefined, end_time: undefined });
|
|
65
|
-
} else {
|
|
66
|
-
updateRule(index, { is_24_hours: false, start_time: '09:00', end_time: '17:00' });
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
return (
|
|
71
|
-
<div className="flex flex-col gap-4">
|
|
72
|
-
<div className="flex flex-col gap-1">
|
|
73
|
-
<h2 className="text-label-primary text-lg font-semibold">Availability</h2>
|
|
74
|
-
<p className="text-label-secondary text-xs">{description}</p>
|
|
75
|
-
</div>
|
|
76
|
-
|
|
77
|
-
<div className="flex items-center gap-2">
|
|
78
|
-
<Switch
|
|
79
|
-
checked={alwaysAvailable}
|
|
80
|
-
onCheckedChange={onAlwaysAvailableChange}
|
|
81
|
-
/>
|
|
82
|
-
<Label className="cursor-pointer">{toggleLabel}</Label>
|
|
83
|
-
</div>
|
|
84
|
-
|
|
85
|
-
{!alwaysAvailable && (
|
|
86
|
-
<>
|
|
87
|
-
<div className="flex items-center justify-between">
|
|
88
|
-
<Label className="text-sm font-semibold">Set specific days and times this product is available.</Label>
|
|
89
|
-
<Button variant="outline" onClick={addRule} withIcon className="flex-shrink-0">
|
|
90
|
-
<IconPlus className="w-4 h-4 fill-fill-secondary" />
|
|
91
|
-
Add Days
|
|
92
|
-
</Button>
|
|
93
|
-
</div>
|
|
94
|
-
|
|
95
|
-
{rules.length === 0 && (
|
|
96
|
-
<p className="text-label-secondary text-sm">
|
|
97
|
-
No availability rules defined.
|
|
98
|
-
</p>
|
|
99
|
-
)}
|
|
100
|
-
|
|
101
|
-
{rules.map((rule, index) => (
|
|
102
|
-
<div key={index} className="flex flex-col gap-4 p-4 rounded-lg bg-surface-secondary">
|
|
103
|
-
<div className="flex items-center justify-between">
|
|
104
|
-
<div className="flex items-center gap-2">
|
|
105
|
-
<IconTime className="w-5 h-5 fill-fill-secondary" />
|
|
106
|
-
<span className="text-label-secondary text-xs border border-border-primary rounded-full px-2.5 py-0.5">
|
|
107
|
-
Day / Time Rule
|
|
108
|
-
</span>
|
|
109
|
-
</div>
|
|
110
|
-
<Button variant="ghost" size="icon" onClick={() => removeRule(index)} className="h-8 w-8 bg-surface-danger-soft border-transparent hover:!bg-surface-danger-soft-hover [&_path]:fill-fill-danger">
|
|
111
|
-
<IconDelete className="w-4 h-4" />
|
|
112
|
-
</Button>
|
|
113
|
-
</div>
|
|
114
|
-
|
|
115
|
-
{/* Day selection */}
|
|
116
|
-
<div className="flex flex-col gap-2">
|
|
117
|
-
<Label className="text-sm font-semibold">Days</Label>
|
|
118
|
-
<div className="grid grid-cols-2 gap-2">
|
|
119
|
-
<div className="flex flex-col gap-2">
|
|
120
|
-
{DAY_OPTIONS.slice(0, 4).map(day => (
|
|
121
|
-
<label key={day} className="flex items-center gap-1.5">
|
|
122
|
-
<Checkbox
|
|
123
|
-
checked={rule.days?.includes(day) || false}
|
|
124
|
-
onCheckedChange={() => toggleDay(index, day)}
|
|
125
|
-
/>
|
|
126
|
-
<span className="text-label-primary text-sm">{day}</span>
|
|
127
|
-
</label>
|
|
128
|
-
))}
|
|
129
|
-
</div>
|
|
130
|
-
<div className="flex flex-col gap-2">
|
|
131
|
-
{DAY_OPTIONS.slice(4).map(day => (
|
|
132
|
-
<label key={day} className="flex items-center gap-1.5">
|
|
133
|
-
<Checkbox
|
|
134
|
-
checked={rule.days?.includes(day) || false}
|
|
135
|
-
onCheckedChange={() => toggleDay(index, day)}
|
|
136
|
-
/>
|
|
137
|
-
<span className="text-label-primary text-sm">{day}</span>
|
|
138
|
-
</label>
|
|
139
|
-
))}
|
|
140
|
-
</div>
|
|
141
|
-
</div>
|
|
142
|
-
</div>
|
|
143
|
-
|
|
144
|
-
{/* Time section */}
|
|
145
|
-
<div className="flex flex-col gap-3">
|
|
146
|
-
<Label className="text-sm font-semibold">Time</Label>
|
|
147
|
-
<div className="flex items-center gap-2">
|
|
148
|
-
<Switch
|
|
149
|
-
checked={rule.is_24_hours ?? true}
|
|
150
|
-
onCheckedChange={(checked) => toggle24Hours(index, checked)}
|
|
151
|
-
/>
|
|
152
|
-
<Label className="cursor-pointer">Align with Opening Hours</Label>
|
|
153
|
-
</div>
|
|
154
|
-
|
|
155
|
-
{!rule.is_24_hours && (
|
|
156
|
-
<div className="grid grid-cols-2 gap-4">
|
|
157
|
-
<div className="flex flex-col gap-2">
|
|
158
|
-
<Label>Start Time</Label>
|
|
159
|
-
<Input
|
|
160
|
-
type="time"
|
|
161
|
-
value={rule.start_time || '09:00'}
|
|
162
|
-
onChange={(e) => updateRule(index, { start_time: e.target.value })}
|
|
163
|
-
/>
|
|
164
|
-
</div>
|
|
165
|
-
<div className="flex flex-col gap-2">
|
|
166
|
-
<Label>End Time</Label>
|
|
167
|
-
<Input
|
|
168
|
-
type="time"
|
|
169
|
-
value={rule.end_time || '17:00'}
|
|
170
|
-
onChange={(e) => updateRule(index, { end_time: e.target.value })}
|
|
171
|
-
/>
|
|
172
|
-
</div>
|
|
173
|
-
</div>
|
|
174
|
-
)}
|
|
175
|
-
</div>
|
|
176
|
-
</div>
|
|
177
|
-
))}
|
|
178
|
-
</>
|
|
179
|
-
)}
|
|
180
|
-
</div>
|
|
181
|
-
);
|
|
182
|
-
};
|
|
183
|
-
|
|
184
|
-
export default AvailabilityRulesSection;
|