@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,152 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { IconCalendar, IconTime } from '../../../icons';
|
|
3
|
-
import StatusBadge from '../StatusBadge';
|
|
4
|
-
import TableActionMenu from '../TableActionMenu';
|
|
5
|
-
|
|
6
|
-
export interface PricingPeriodRule {
|
|
7
|
-
type: 'range' | 'date_time';
|
|
8
|
-
// Range fields
|
|
9
|
-
start_date?: string;
|
|
10
|
-
end_date?: string;
|
|
11
|
-
// Date/Time fields
|
|
12
|
-
days?: string[];
|
|
13
|
-
// Shared time fields
|
|
14
|
-
is_24_hours?: boolean;
|
|
15
|
-
start_time?: string;
|
|
16
|
-
end_time?: string;
|
|
17
|
-
// Opening hours override fields
|
|
18
|
-
is_open?: boolean;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export interface PricingPeriod {
|
|
22
|
-
id: string;
|
|
23
|
-
provider_id: string;
|
|
24
|
-
name: string;
|
|
25
|
-
description: string | null;
|
|
26
|
-
colour: string;
|
|
27
|
-
priority: number;
|
|
28
|
-
is_active: boolean;
|
|
29
|
-
rules: PricingPeriodRule[];
|
|
30
|
-
display_order: number;
|
|
31
|
-
status: string;
|
|
32
|
-
dynamic_pricing_excluded: boolean;
|
|
33
|
-
created_at: string;
|
|
34
|
-
updated_at: string;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
interface PricingPeriodCardProps {
|
|
38
|
-
period: PricingPeriod;
|
|
39
|
-
onEdit: (period: PricingPeriod) => void;
|
|
40
|
-
onDelete: (period: PricingPeriod) => void;
|
|
41
|
-
onToggleActive: (period: PricingPeriod) => void;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
const isRangeExpired = (rule: PricingPeriodRule): boolean => {
|
|
45
|
-
if (rule.type !== 'range' || !rule.end_date) return false;
|
|
46
|
-
const today = new Date().toISOString().split('T')[0];
|
|
47
|
-
return rule.end_date < today;
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
const isPeriodExpired = (period: PricingPeriod): boolean => {
|
|
51
|
-
const rangeRules = period.rules.filter(r => r.type === 'range');
|
|
52
|
-
if (rangeRules.length === 0) return false;
|
|
53
|
-
return rangeRules.every(r => isRangeExpired(r));
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
const formatDateLocale = (dateStr: string): string => {
|
|
57
|
-
if (!dateStr) return '—';
|
|
58
|
-
const date = new Date(dateStr + 'T00:00:00');
|
|
59
|
-
return date.toLocaleDateString(undefined, { day: 'numeric', month: 'short', year: 'numeric' });
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
const DAY_ORDER = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'];
|
|
63
|
-
|
|
64
|
-
const sortDays = (days: string[]): string[] => {
|
|
65
|
-
return [...days].sort((a, b) => DAY_ORDER.indexOf(a) - DAY_ORDER.indexOf(b));
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
const getRuleParts = (rule: PricingPeriodRule): { primary: string; time?: string } => {
|
|
69
|
-
if (rule.type === 'range') {
|
|
70
|
-
const primary = `${formatDateLocale(rule.start_date || '')} to ${formatDateLocale(rule.end_date || '')}`;
|
|
71
|
-
const time = !rule.is_24_hours && rule.start_time && rule.end_time ? `${rule.start_time}–${rule.end_time}` : undefined;
|
|
72
|
-
return { primary, time };
|
|
73
|
-
}
|
|
74
|
-
if (rule.type === 'date_time') {
|
|
75
|
-
const primary = sortDays(rule.days || []).join(', ');
|
|
76
|
-
const time = !rule.is_24_hours && rule.start_time && rule.end_time ? `${rule.start_time}–${rule.end_time}` : undefined;
|
|
77
|
-
return { primary, time };
|
|
78
|
-
}
|
|
79
|
-
return { primary: '' };
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
const PricingPeriodCard: React.FC<PricingPeriodCardProps> = ({ period, onEdit, onDelete, onToggleActive }) => {
|
|
83
|
-
const expired = isPeriodExpired(period);
|
|
84
|
-
return (
|
|
85
|
-
<div className="flex flex-col gap-3 p-4 border border-border-primary rounded-lg bg-surface-primary">
|
|
86
|
-
<div className="flex items-start justify-between gap-4">
|
|
87
|
-
<div className="flex items-start gap-3 flex-1 min-w-0">
|
|
88
|
-
<span
|
|
89
|
-
className="w-3 h-3 rounded-full flex-shrink-0 mt-1.5"
|
|
90
|
-
style={{ backgroundColor: period.colour }}
|
|
91
|
-
/>
|
|
92
|
-
<div className="flex flex-col gap-0.5 min-w-0">
|
|
93
|
-
<p className="text-label-primary font-semibold text-base">{period.name}</p>
|
|
94
|
-
{period.description && (
|
|
95
|
-
<p className="text-label-secondary text-sm">{period.description}</p>
|
|
96
|
-
)}
|
|
97
|
-
</div>
|
|
98
|
-
</div>
|
|
99
|
-
<div className="flex items-center gap-2 flex-shrink-0">
|
|
100
|
-
<span className="text-label-secondary text-xs border border-border-primary rounded-full px-2.5 py-0.5">
|
|
101
|
-
Priority {period.priority}
|
|
102
|
-
</span>
|
|
103
|
-
<StatusBadge status={expired ? 'expired' : period.is_active ? 'active' : 'disabled'} />
|
|
104
|
-
<TableActionMenu
|
|
105
|
-
items={[
|
|
106
|
-
{ label: 'Edit', onClick: () => onEdit(period) },
|
|
107
|
-
{ label: period.is_active ? 'Deactivate' : 'Activate', onClick: () => onToggleActive(period) },
|
|
108
|
-
{ label: 'Delete', onClick: () => onDelete(period), variant: 'danger' },
|
|
109
|
-
]}
|
|
110
|
-
/>
|
|
111
|
-
</div>
|
|
112
|
-
</div>
|
|
113
|
-
{period.rules.length > 0 && (
|
|
114
|
-
<div className={`flex flex-col ml-6 ${period.rules.length > 1 ? 'divide-y divide-border-primary' : ''}`}>
|
|
115
|
-
{[...period.rules]
|
|
116
|
-
.sort((a, b) => {
|
|
117
|
-
const dateA = a.start_date || '';
|
|
118
|
-
const dateB = b.start_date || '';
|
|
119
|
-
if (a.type === 'range' && b.type === 'range') return dateA.localeCompare(dateB);
|
|
120
|
-
if (a.type === 'range') return -1;
|
|
121
|
-
if (b.type === 'range') return 1;
|
|
122
|
-
return 0;
|
|
123
|
-
})
|
|
124
|
-
.map((rule, idx) => {
|
|
125
|
-
const parts = getRuleParts(rule);
|
|
126
|
-
const ruleExpired = isRangeExpired(rule);
|
|
127
|
-
return (
|
|
128
|
-
<div key={idx} className="flex items-center gap-2.5 text-sm py-2 first:pt-0 last:pb-0">
|
|
129
|
-
{rule.type === 'range' ? (
|
|
130
|
-
<IconCalendar className="w-5 h-5 fill-fill-secondary flex-shrink-0" />
|
|
131
|
-
) : (
|
|
132
|
-
<IconTime className="w-5 h-5 fill-fill-secondary flex-shrink-0" />
|
|
133
|
-
)}
|
|
134
|
-
<div className="flex flex-col flex-1 min-w-0">
|
|
135
|
-
<span className={ruleExpired ? "text-label-secondary" : "text-label-primary"}>{parts.primary}</span>
|
|
136
|
-
{parts.time && <span className="text-label-secondary">{parts.time}</span>}
|
|
137
|
-
</div>
|
|
138
|
-
{ruleExpired && (
|
|
139
|
-
<div className="flex-shrink-0">
|
|
140
|
-
<StatusBadge status="expired" />
|
|
141
|
-
</div>
|
|
142
|
-
)}
|
|
143
|
-
</div>
|
|
144
|
-
);
|
|
145
|
-
})}
|
|
146
|
-
</div>
|
|
147
|
-
)}
|
|
148
|
-
</div>
|
|
149
|
-
);
|
|
150
|
-
};
|
|
151
|
-
|
|
152
|
-
export default PricingPeriodCard;
|
|
@@ -1,377 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
2
|
-
import { useNotify } from '../../hooks/useNotify';
|
|
3
|
-
import { Button } from '../ui/button';
|
|
4
|
-
import { Input } from '../ui/input';
|
|
5
|
-
import { Label } from '../ui/label';
|
|
6
|
-
import { Textarea } from '../ui/textarea';
|
|
7
|
-
import { Checkbox } from '../ui/checkbox';
|
|
8
|
-
import { Switch } from '../ui/switch';
|
|
9
|
-
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../ui/select';
|
|
10
|
-
import { IconPlus, IconDelete, IconTime, IconCalendar } from '../../../icons';
|
|
11
|
-
import type { PricingPeriod, PricingPeriodRule } from './PricingPeriodCard';
|
|
12
|
-
|
|
13
|
-
const COLOUR_OPTIONS = [
|
|
14
|
-
{ value: '#3B82F6', label: 'Blue' },
|
|
15
|
-
{ value: '#EF4444', label: 'Red' },
|
|
16
|
-
{ value: '#22C55E', label: 'Green' },
|
|
17
|
-
{ value: '#EAB308', label: 'Yellow' },
|
|
18
|
-
{ value: '#8B5CF6', label: 'Purple' },
|
|
19
|
-
{ value: '#F97316', label: 'Orange' },
|
|
20
|
-
{ value: '#EC4899', label: 'Pink' },
|
|
21
|
-
{ value: '#14B8A6', label: 'Teal' },
|
|
22
|
-
];
|
|
23
|
-
|
|
24
|
-
const DAY_OPTIONS = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'];
|
|
25
|
-
|
|
26
|
-
interface PricingPeriodFormProps {
|
|
27
|
-
period?: PricingPeriod | null;
|
|
28
|
-
onSave: (data: {
|
|
29
|
-
name: string;
|
|
30
|
-
description: string;
|
|
31
|
-
colour: string;
|
|
32
|
-
is_active: boolean;
|
|
33
|
-
dynamic_pricing_excluded: boolean;
|
|
34
|
-
rules: PricingPeriodRule[];
|
|
35
|
-
}) => void;
|
|
36
|
-
onBack: () => void;
|
|
37
|
-
isSaving?: boolean;
|
|
38
|
-
showHeader?: boolean;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
const PricingPeriodForm: React.FC<PricingPeriodFormProps> = ({ period, onSave, onBack, isSaving, showHeader = true }) => {
|
|
42
|
-
const { showError } = useNotify();
|
|
43
|
-
const isEditing = !!period;
|
|
44
|
-
const [name, setName] = useState(period?.name || '');
|
|
45
|
-
const [description, setDescription] = useState(period?.description || '');
|
|
46
|
-
const [colour, setColour] = useState(period?.colour || '#3B82F6');
|
|
47
|
-
|
|
48
|
-
const [isActive, setIsActive] = useState(period?.is_active ?? true);
|
|
49
|
-
const [dynamicPricingExcluded, setDynamicPricingExcluded] = useState(period?.dynamic_pricing_excluded ?? false);
|
|
50
|
-
const [ruleErrors, setRuleErrors] = useState<Record<number, string>>({});
|
|
51
|
-
const [rules, setRules] = useState<PricingPeriodRule[]>(() => {
|
|
52
|
-
// Migrate legacy rule types on load
|
|
53
|
-
if (!period?.rules) return [];
|
|
54
|
-
const migrated = period.rules.map(r => {
|
|
55
|
-
if (r.type === 'time' as string) {
|
|
56
|
-
return { ...r, type: 'date_time' as const, is_24_hours: false };
|
|
57
|
-
}
|
|
58
|
-
if (r.type === 'date_range' as string) {
|
|
59
|
-
return { ...r, type: 'range' as const, is_24_hours: true };
|
|
60
|
-
}
|
|
61
|
-
return r;
|
|
62
|
-
});
|
|
63
|
-
// Sort chronologically to match the listing display
|
|
64
|
-
return migrated.sort((a, b) => {
|
|
65
|
-
const dateA = a.start_date || '';
|
|
66
|
-
const dateB = b.start_date || '';
|
|
67
|
-
if (a.type === 'range' && b.type === 'range') return dateA.localeCompare(dateB);
|
|
68
|
-
if (a.type === 'range') return -1;
|
|
69
|
-
if (b.type === 'range') return 1;
|
|
70
|
-
return 0;
|
|
71
|
-
});
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
const addRule = (type: 'range' | 'date_time') => {
|
|
75
|
-
if (type === 'range') {
|
|
76
|
-
setRules([...rules, { type: 'range', start_date: '', end_date: '', is_24_hours: true }]);
|
|
77
|
-
} else {
|
|
78
|
-
setRules([...rules, { type: 'date_time', days: [], is_24_hours: true }]);
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
const updateRule = (index: number, updates: Partial<PricingPeriodRule>) => {
|
|
83
|
-
setRules(prev => prev.map((r, i) => i === index ? { ...r, ...updates } : r));
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
const removeRule = (index: number) => {
|
|
87
|
-
setRules(prev => prev.filter((_, i) => i !== index));
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
const toggleDay = (ruleIndex: number, day: string) => {
|
|
91
|
-
const rule = rules[ruleIndex];
|
|
92
|
-
const days = rule.days || [];
|
|
93
|
-
const updated = days.includes(day) ? days.filter(d => d !== day) : [...days, day];
|
|
94
|
-
updateRule(ruleIndex, { days: updated });
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
const toggle24Hours = (index: number, checked: boolean) => {
|
|
98
|
-
if (checked) {
|
|
99
|
-
updateRule(index, { is_24_hours: true, start_time: undefined, end_time: undefined });
|
|
100
|
-
} else {
|
|
101
|
-
updateRule(index, { is_24_hours: false, start_time: '09:00', end_time: '17:00' });
|
|
102
|
-
}
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
const validateRules = (): boolean => {
|
|
106
|
-
const today = new Date().toISOString().split('T')[0];
|
|
107
|
-
const errors: Record<number, string> = {};
|
|
108
|
-
|
|
109
|
-
rules.forEach((rule, index) => {
|
|
110
|
-
if (rule.type === 'range' && rule.start_date && rule.start_date < today) {
|
|
111
|
-
errors[index] = 'Start date cannot be in the past';
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
|
|
115
|
-
setRuleErrors(errors);
|
|
116
|
-
return Object.keys(errors).length === 0;
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
const handleSubmit = () => {
|
|
120
|
-
if (!name.trim()) {
|
|
121
|
-
showError('Name Required', 'Please enter a name for the pricing period.');
|
|
122
|
-
return;
|
|
123
|
-
}
|
|
124
|
-
if (rules.length === 0) {
|
|
125
|
-
showError('Rule Required', 'Please add at least one rule to define when this pricing period applies.');
|
|
126
|
-
return;
|
|
127
|
-
}
|
|
128
|
-
if (!validateRules()) return;
|
|
129
|
-
const sortedRules = [...rules].sort((a, b) => {
|
|
130
|
-
const dateA = a.start_date || '';
|
|
131
|
-
const dateB = b.start_date || '';
|
|
132
|
-
if (a.type === 'range' && b.type === 'range') return dateA.localeCompare(dateB);
|
|
133
|
-
if (a.type === 'range') return -1;
|
|
134
|
-
if (b.type === 'range') return 1;
|
|
135
|
-
return 0;
|
|
136
|
-
});
|
|
137
|
-
onSave({
|
|
138
|
-
name: name.trim(),
|
|
139
|
-
description: description.trim(),
|
|
140
|
-
colour,
|
|
141
|
-
is_active: isActive,
|
|
142
|
-
dynamic_pricing_excluded: dynamicPricingExcluded,
|
|
143
|
-
rules: sortedRules,
|
|
144
|
-
});
|
|
145
|
-
};
|
|
146
|
-
|
|
147
|
-
const selectedColour = COLOUR_OPTIONS.find(c => c.value === colour);
|
|
148
|
-
|
|
149
|
-
return (
|
|
150
|
-
<div className="flex flex-col gap-6 w-full">
|
|
151
|
-
{showHeader && (
|
|
152
|
-
<h2 className="text-label-primary text-xl font-semibold">
|
|
153
|
-
{isEditing ? 'Edit Pricing Period' : 'Create Pricing Period'}
|
|
154
|
-
</h2>
|
|
155
|
-
)}
|
|
156
|
-
|
|
157
|
-
{/* Name */}
|
|
158
|
-
<div className="flex flex-col gap-2">
|
|
159
|
-
<Label>Name</Label>
|
|
160
|
-
<Input value={name} onChange={(e) => setName(e.target.value)} />
|
|
161
|
-
</div>
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
{/* Description */}
|
|
165
|
-
<div className="flex flex-col gap-2">
|
|
166
|
-
<div className="flex items-center justify-between">
|
|
167
|
-
<Label>Description</Label>
|
|
168
|
-
<span className="text-label-secondary text-xs">(optional)</span>
|
|
169
|
-
</div>
|
|
170
|
-
<Textarea value={description} onChange={(e) => setDescription(e.target.value)} rows={3} />
|
|
171
|
-
</div>
|
|
172
|
-
|
|
173
|
-
{/* Colour */}
|
|
174
|
-
<div className="flex flex-col gap-1.5">
|
|
175
|
-
<Label>Colour</Label>
|
|
176
|
-
<Select value={colour} onValueChange={setColour}>
|
|
177
|
-
<SelectTrigger>
|
|
178
|
-
<SelectValue>
|
|
179
|
-
{selectedColour ? (
|
|
180
|
-
<span className="flex items-center gap-2">
|
|
181
|
-
<span className="w-3 h-3 rounded-full inline-block" style={{ backgroundColor: selectedColour.value }} />
|
|
182
|
-
{selectedColour.label}
|
|
183
|
-
</span>
|
|
184
|
-
) : null}
|
|
185
|
-
</SelectValue>
|
|
186
|
-
</SelectTrigger>
|
|
187
|
-
<SelectContent>
|
|
188
|
-
{COLOUR_OPTIONS.map(c => (
|
|
189
|
-
<SelectItem key={c.value} value={c.value}>
|
|
190
|
-
<span className="flex items-center gap-2">
|
|
191
|
-
<span className="w-3 h-3 rounded-full inline-block" style={{ backgroundColor: c.value }} />
|
|
192
|
-
{c.label}
|
|
193
|
-
</span>
|
|
194
|
-
</SelectItem>
|
|
195
|
-
))}
|
|
196
|
-
</SelectContent>
|
|
197
|
-
</Select>
|
|
198
|
-
<span className="text-label-secondary text-xs">This helps to identify the pricing periods</span>
|
|
199
|
-
</div>
|
|
200
|
-
|
|
201
|
-
{/* Active checkbox */}
|
|
202
|
-
<div className="flex items-center gap-2">
|
|
203
|
-
<Checkbox
|
|
204
|
-
checked={isActive}
|
|
205
|
-
onCheckedChange={(checked) => setIsActive(checked === true)}
|
|
206
|
-
/>
|
|
207
|
-
<Label className="cursor-pointer">Active</Label>
|
|
208
|
-
</div>
|
|
209
|
-
|
|
210
|
-
{/* Dynamic Pricing Exclusion */}
|
|
211
|
-
<div className="flex items-center gap-2">
|
|
212
|
-
<Checkbox
|
|
213
|
-
checked={dynamicPricingExcluded}
|
|
214
|
-
onCheckedChange={(checked) => setDynamicPricingExcluded(checked === true)}
|
|
215
|
-
/>
|
|
216
|
-
<div className="flex flex-col">
|
|
217
|
-
<Label className="cursor-pointer">Exclude from Dynamic Pricing</Label>
|
|
218
|
-
<span className="text-label-secondary text-xs">When checked, dynamic pricing tiers will not apply adjustments during this period</span>
|
|
219
|
-
</div>
|
|
220
|
-
</div>
|
|
221
|
-
|
|
222
|
-
{/* Separator */}
|
|
223
|
-
<div className="border-t border-border-primary" />
|
|
224
|
-
|
|
225
|
-
{/* Rules */}
|
|
226
|
-
<div className="flex flex-col gap-4">
|
|
227
|
-
<div className="flex items-center justify-between">
|
|
228
|
-
<h3 className="text-label-primary text-lg font-semibold">Rules</h3>
|
|
229
|
-
<div className="flex items-center gap-2">
|
|
230
|
-
<Button variant="outline" onClick={() => addRule('range')} withIcon>
|
|
231
|
-
<IconPlus className="w-4 h-4 fill-fill-secondary" />
|
|
232
|
-
Add Dates
|
|
233
|
-
</Button>
|
|
234
|
-
<Button variant="outline" onClick={() => addRule('date_time')} withIcon>
|
|
235
|
-
<IconPlus className="w-4 h-4 fill-fill-secondary" />
|
|
236
|
-
Add Day / Time
|
|
237
|
-
</Button>
|
|
238
|
-
</div>
|
|
239
|
-
</div>
|
|
240
|
-
|
|
241
|
-
{rules.length === 0 && (
|
|
242
|
-
<p className="text-label-tertiary text-sm text-left py-6">
|
|
243
|
-
No rules defined. Add rules to specify when this pricing period applies.
|
|
244
|
-
</p>
|
|
245
|
-
)}
|
|
246
|
-
|
|
247
|
-
{rules.map((rule, index) => (
|
|
248
|
-
<div key={index} className="flex flex-col gap-4 p-4 rounded-lg bg-surface-secondary">
|
|
249
|
-
<div className="flex items-center justify-between">
|
|
250
|
-
<div className="flex items-center gap-2">
|
|
251
|
-
{rule.type === 'range' ? (
|
|
252
|
-
<IconCalendar className="w-5 h-5 fill-fill-secondary" />
|
|
253
|
-
) : (
|
|
254
|
-
<IconTime className="w-5 h-5 fill-fill-secondary" />
|
|
255
|
-
)}
|
|
256
|
-
<span className="text-label-secondary text-xs border border-border-primary rounded-full px-2.5 py-0.5">
|
|
257
|
-
{rule.type === 'range' ? 'Dates Rule' : 'Day / Time Rule'}
|
|
258
|
-
</span>
|
|
259
|
-
</div>
|
|
260
|
-
<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">
|
|
261
|
-
<IconDelete className="w-4 h-4" />
|
|
262
|
-
</Button>
|
|
263
|
-
</div>
|
|
264
|
-
|
|
265
|
-
{/* Range rule: date pickers */}
|
|
266
|
-
{rule.type === 'range' && (
|
|
267
|
-
<div className="grid grid-cols-2 gap-4">
|
|
268
|
-
<div className="flex flex-col gap-2">
|
|
269
|
-
<Label>Start Date</Label>
|
|
270
|
-
<Input
|
|
271
|
-
type="date"
|
|
272
|
-
value={rule.start_date || ''}
|
|
273
|
-
onChange={(e) => {
|
|
274
|
-
const newStart = e.target.value;
|
|
275
|
-
setRuleErrors(prev => { const next = { ...prev }; delete next[index]; return next; });
|
|
276
|
-
// If end date is empty or before new start, update both together
|
|
277
|
-
if (newStart && (!rule.end_date || rule.end_date < newStart)) {
|
|
278
|
-
updateRule(index, { start_date: newStart, end_date: newStart });
|
|
279
|
-
} else {
|
|
280
|
-
updateRule(index, { start_date: newStart });
|
|
281
|
-
}
|
|
282
|
-
}}
|
|
283
|
-
/>
|
|
284
|
-
{ruleErrors[index] && (
|
|
285
|
-
<p className="text-label-danger text-sm">{ruleErrors[index]}</p>
|
|
286
|
-
)}
|
|
287
|
-
</div>
|
|
288
|
-
<div className="flex flex-col gap-2">
|
|
289
|
-
<Label>End Date</Label>
|
|
290
|
-
<Input
|
|
291
|
-
type="date"
|
|
292
|
-
value={rule.end_date || ''}
|
|
293
|
-
min={rule.start_date || undefined}
|
|
294
|
-
onChange={(e) => updateRule(index, { end_date: e.target.value })}
|
|
295
|
-
/>
|
|
296
|
-
</div>
|
|
297
|
-
</div>
|
|
298
|
-
)}
|
|
299
|
-
|
|
300
|
-
{/* Date/Time rule: day selection */}
|
|
301
|
-
{rule.type === 'date_time' && (
|
|
302
|
-
<div className="flex flex-col gap-2">
|
|
303
|
-
<Label className="text-sm font-semibold">Days</Label>
|
|
304
|
-
<div className="grid grid-cols-2 gap-2">
|
|
305
|
-
<div className="flex flex-col gap-2">
|
|
306
|
-
{DAY_OPTIONS.slice(0, 4).map(day => (
|
|
307
|
-
<label key={day} className="flex items-center gap-1.5">
|
|
308
|
-
<Checkbox
|
|
309
|
-
checked={rule.days?.includes(day) || false}
|
|
310
|
-
onCheckedChange={() => toggleDay(index, day)}
|
|
311
|
-
/>
|
|
312
|
-
<span className="text-label-primary text-sm">{day}</span>
|
|
313
|
-
</label>
|
|
314
|
-
))}
|
|
315
|
-
</div>
|
|
316
|
-
<div className="flex flex-col gap-2">
|
|
317
|
-
{DAY_OPTIONS.slice(4).map(day => (
|
|
318
|
-
<label key={day} className="flex items-center gap-1.5">
|
|
319
|
-
<Checkbox
|
|
320
|
-
checked={rule.days?.includes(day) || false}
|
|
321
|
-
onCheckedChange={() => toggleDay(index, day)}
|
|
322
|
-
/>
|
|
323
|
-
<span className="text-label-primary text-sm">{day}</span>
|
|
324
|
-
</label>
|
|
325
|
-
))}
|
|
326
|
-
</div>
|
|
327
|
-
</div>
|
|
328
|
-
</div>
|
|
329
|
-
)}
|
|
330
|
-
|
|
331
|
-
{/* Time section */}
|
|
332
|
-
<div className="flex flex-col gap-3">
|
|
333
|
-
<Label className="text-sm font-semibold">Time</Label>
|
|
334
|
-
<div className="flex items-center gap-2">
|
|
335
|
-
<Switch
|
|
336
|
-
checked={rule.is_24_hours ?? true}
|
|
337
|
-
onCheckedChange={(checked) => toggle24Hours(index, checked)}
|
|
338
|
-
/>
|
|
339
|
-
<Label className="cursor-pointer">Align with Opening Hours</Label>
|
|
340
|
-
</div>
|
|
341
|
-
|
|
342
|
-
{!rule.is_24_hours && (
|
|
343
|
-
<div className="grid grid-cols-2 gap-4">
|
|
344
|
-
<div className="flex flex-col gap-2">
|
|
345
|
-
<Label>Start Time</Label>
|
|
346
|
-
<Input
|
|
347
|
-
type="time"
|
|
348
|
-
value={rule.start_time || '09:00'}
|
|
349
|
-
onChange={(e) => updateRule(index, { start_time: e.target.value })}
|
|
350
|
-
/>
|
|
351
|
-
</div>
|
|
352
|
-
<div className="flex flex-col gap-2">
|
|
353
|
-
<Label>End Time</Label>
|
|
354
|
-
<Input
|
|
355
|
-
type="time"
|
|
356
|
-
value={rule.end_time || '17:00'}
|
|
357
|
-
onChange={(e) => updateRule(index, { end_time: e.target.value })}
|
|
358
|
-
/>
|
|
359
|
-
</div>
|
|
360
|
-
</div>
|
|
361
|
-
)}
|
|
362
|
-
</div>
|
|
363
|
-
</div>
|
|
364
|
-
))}
|
|
365
|
-
</div>
|
|
366
|
-
|
|
367
|
-
{/* Actions */}
|
|
368
|
-
<div className="flex items-center gap-3 pt-6">
|
|
369
|
-
<Button onClick={handleSubmit} disabled={isSaving}>
|
|
370
|
-
{isSaving ? 'Saving...' : isEditing ? 'Save Changes' : 'Create Period'}
|
|
371
|
-
</Button>
|
|
372
|
-
</div>
|
|
373
|
-
</div>
|
|
374
|
-
);
|
|
375
|
-
};
|
|
376
|
-
|
|
377
|
-
export default PricingPeriodForm;
|