@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,401 +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 { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../ui/select';
|
|
6
|
-
import { Switch } from '../ui/switch';
|
|
7
|
-
import { IconPlus, IconDelete } from '../../../icons';
|
|
8
|
-
|
|
9
|
-
export type DynamicPricingRuleType =
|
|
10
|
-
| 'resource_availability'
|
|
11
|
-
| 'latency'
|
|
12
|
-
| 'group_size'
|
|
13
|
-
| 'cancellation_rate'
|
|
14
|
-
| 'traffic'
|
|
15
|
-
| 'weather';
|
|
16
|
-
|
|
17
|
-
export interface DynamicPricingRule {
|
|
18
|
-
type: DynamicPricingRuleType;
|
|
19
|
-
// resource_availability
|
|
20
|
-
threshold_percentage?: number;
|
|
21
|
-
availability_condition?: 'under' | 'exceeds';
|
|
22
|
-
// latency
|
|
23
|
-
latency_mode?: 'till_booking' | 'date_range';
|
|
24
|
-
latency_value?: number;
|
|
25
|
-
latency_unit?: 'minutes' | 'hours' | 'days';
|
|
26
|
-
hours_before?: number; // kept for backward compat
|
|
27
|
-
latency_direction?: 'increase' | 'decrease'; // deprecated
|
|
28
|
-
latency_range_start?: number;
|
|
29
|
-
latency_range_start_unit?: 'hours' | 'days' | 'weeks';
|
|
30
|
-
latency_range_end?: number;
|
|
31
|
-
latency_range_end_unit?: 'hours' | 'days' | 'weeks';
|
|
32
|
-
// group_size
|
|
33
|
-
min_group_size?: number;
|
|
34
|
-
// cancellation_rate
|
|
35
|
-
cancellation_threshold?: number;
|
|
36
|
-
cancellation_window_hours?: number;
|
|
37
|
-
// traffic
|
|
38
|
-
views_threshold?: number;
|
|
39
|
-
traffic_window_hours?: number;
|
|
40
|
-
// weather
|
|
41
|
-
weather_conditions?: string[];
|
|
42
|
-
temperature_above?: number;
|
|
43
|
-
temperature_below?: number;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
const RULE_TYPE_OPTIONS: { value: DynamicPricingRuleType; label: string; description: string; disabled?: boolean }[] = [
|
|
47
|
-
{ value: 'resource_availability', label: 'Availability', description: 'Triggers based on available capacity percentage' },
|
|
48
|
-
{ value: 'latency', label: 'Booking Window', description: 'Triggers based on time remaining until the booking slot' },
|
|
49
|
-
{ value: 'traffic', label: 'Website Traffic', description: 'Triggers when page views or searches exceed a threshold', disabled: true },
|
|
50
|
-
{ value: 'group_size', label: 'Group Size', description: 'Triggers when the booking group size exceeds a threshold', disabled: true },
|
|
51
|
-
{ value: 'cancellation_rate', label: 'Cancellation Rate', description: 'Triggers when cancellation rate exceeds a threshold', disabled: true },
|
|
52
|
-
{ value: 'weather', label: 'Weather', description: 'Triggers based on weather forecast conditions', disabled: true },
|
|
53
|
-
];
|
|
54
|
-
|
|
55
|
-
const WEATHER_CONDITIONS = ['sunny', 'clear', 'cloudy', 'rainy', 'snowy', 'windy', 'stormy'];
|
|
56
|
-
|
|
57
|
-
interface DynamicPricingRulesEditorProps {
|
|
58
|
-
rules: DynamicPricingRule[];
|
|
59
|
-
onChange: (rules: DynamicPricingRule[]) => void;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
const DynamicPricingRulesEditor: React.FC<DynamicPricingRulesEditorProps> = ({ rules, onChange }) => {
|
|
63
|
-
const addRule = () => {
|
|
64
|
-
// Find first rule type not already used
|
|
65
|
-
const usedTypes = new Set(rules.map(r => r.type));
|
|
66
|
-
const available = RULE_TYPE_OPTIONS.find(opt => !usedTypes.has(opt.value) && !opt.disabled);
|
|
67
|
-
if (!available) return;
|
|
68
|
-
onChange([...rules, { type: available.value }]);
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
const updateRule = (index: number, updates: Partial<DynamicPricingRule>) => {
|
|
72
|
-
onChange(rules.map((r, i) => i === index ? { ...r, ...updates } : r));
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
const removeRule = (index: number) => {
|
|
76
|
-
onChange(rules.filter((_, i) => i !== index));
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
const changeRuleType = (index: number, newType: DynamicPricingRuleType) => {
|
|
80
|
-
onChange(rules.map((r, i) => i === index ? { type: newType } : r));
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
const usedTypes = new Set(rules.map(r => r.type));
|
|
84
|
-
|
|
85
|
-
const toggleWeatherCondition = (index: number, condition: string) => {
|
|
86
|
-
const rule = rules[index];
|
|
87
|
-
const current = rule.weather_conditions || [];
|
|
88
|
-
const updated = current.includes(condition)
|
|
89
|
-
? current.filter(c => c !== condition)
|
|
90
|
-
: [...current, condition];
|
|
91
|
-
updateRule(index, { weather_conditions: updated });
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
// Ensure at least one rule always exists
|
|
95
|
-
React.useEffect(() => {
|
|
96
|
-
if (rules.length === 0) {
|
|
97
|
-
onChange([{ type: RULE_TYPE_OPTIONS[0].value }]);
|
|
98
|
-
}
|
|
99
|
-
}, []);
|
|
100
|
-
|
|
101
|
-
return (
|
|
102
|
-
<div className="flex flex-col gap-4">
|
|
103
|
-
<div>
|
|
104
|
-
<h3 className="text-label-primary text-lg font-semibold">Trigger Rules</h3>
|
|
105
|
-
<p className="text-label-secondary text-sm">Define when this tier should activate. All rules must be met.</p>
|
|
106
|
-
</div>
|
|
107
|
-
|
|
108
|
-
{rules.map((rule, index) => {
|
|
109
|
-
const ruleInfo = RULE_TYPE_OPTIONS.find(r => r.value === rule.type);
|
|
110
|
-
return (
|
|
111
|
-
<div key={index} className="flex flex-col gap-4 p-4 rounded-lg bg-surface-secondary">
|
|
112
|
-
<div className="flex items-center justify-between">
|
|
113
|
-
<Select value={rule.type} onValueChange={(val) => changeRuleType(index, val as DynamicPricingRuleType)}>
|
|
114
|
-
<SelectTrigger className="w-[240px]">
|
|
115
|
-
<SelectValue />
|
|
116
|
-
</SelectTrigger>
|
|
117
|
-
<SelectContent>
|
|
118
|
-
{RULE_TYPE_OPTIONS.filter(opt => !usedTypes.has(opt.value) || opt.value === rule.type).map(opt => (
|
|
119
|
-
<SelectItem key={opt.value} value={opt.value} disabled={opt.disabled}>{opt.label}</SelectItem>
|
|
120
|
-
))}
|
|
121
|
-
</SelectContent>
|
|
122
|
-
</Select>
|
|
123
|
-
{rules.length > 1 && (
|
|
124
|
-
<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">
|
|
125
|
-
<IconDelete className="w-4 h-4" />
|
|
126
|
-
</Button>
|
|
127
|
-
)}
|
|
128
|
-
</div>
|
|
129
|
-
|
|
130
|
-
{ruleInfo && (
|
|
131
|
-
<p className="text-label-secondary text-xs">{ruleInfo.description}</p>
|
|
132
|
-
)}
|
|
133
|
-
|
|
134
|
-
{/* Availability config */}
|
|
135
|
-
{rule.type === 'resource_availability' && (
|
|
136
|
-
<div className="flex flex-col gap-2">
|
|
137
|
-
<Label>Availability Threshold</Label>
|
|
138
|
-
<p className="text-label-secondary text-xs">Tier activates when available capacity meets this condition</p>
|
|
139
|
-
<div className="flex items-center gap-2">
|
|
140
|
-
<Select value={rule.availability_condition || 'under'} onValueChange={(val) => updateRule(index, { availability_condition: val as 'under' | 'exceeds' })}>
|
|
141
|
-
<SelectTrigger className="w-[130px]">
|
|
142
|
-
<SelectValue />
|
|
143
|
-
</SelectTrigger>
|
|
144
|
-
<SelectContent>
|
|
145
|
-
<SelectItem value="under">Is under</SelectItem>
|
|
146
|
-
<SelectItem value="exceeds">Exceeds</SelectItem>
|
|
147
|
-
</SelectContent>
|
|
148
|
-
</Select>
|
|
149
|
-
<div className="relative w-24">
|
|
150
|
-
<Input
|
|
151
|
-
type="number"
|
|
152
|
-
min={1}
|
|
153
|
-
max={100}
|
|
154
|
-
value={rule.threshold_percentage ?? ''}
|
|
155
|
-
onChange={(e) => updateRule(index, { threshold_percentage: e.target.value ? parseInt(e.target.value) : undefined })}
|
|
156
|
-
className="pr-8"
|
|
157
|
-
/>
|
|
158
|
-
<span className="absolute right-3 top-1/2 -translate-y-1/2 text-label-secondary text-sm pointer-events-none">%</span>
|
|
159
|
-
</div>
|
|
160
|
-
</div>
|
|
161
|
-
</div>
|
|
162
|
-
)}
|
|
163
|
-
|
|
164
|
-
{/* Latency config */}
|
|
165
|
-
{rule.type === 'latency' && (
|
|
166
|
-
<div className="flex flex-col gap-4">
|
|
167
|
-
{/* Mode toggle */}
|
|
168
|
-
<div className="flex items-center gap-3">
|
|
169
|
-
<Switch
|
|
170
|
-
checked={(rule.latency_mode || 'till_booking') === 'till_booking'}
|
|
171
|
-
onCheckedChange={(checked) => updateRule(index, {
|
|
172
|
-
latency_mode: checked ? 'till_booking' : 'date_range',
|
|
173
|
-
})}
|
|
174
|
-
/>
|
|
175
|
-
<div className="flex flex-col gap-0.5">
|
|
176
|
-
<Label>Till Booking Date / Time</Label>
|
|
177
|
-
<p className="text-label-secondary text-xs">
|
|
178
|
-
{(rule.latency_mode || 'till_booking') === 'till_booking'
|
|
179
|
-
? 'Applies from now until the specified time before the booking'
|
|
180
|
-
: 'Applies between two time periods before the booking'}
|
|
181
|
-
</p>
|
|
182
|
-
</div>
|
|
183
|
-
</div>
|
|
184
|
-
|
|
185
|
-
{(rule.latency_mode || 'till_booking') === 'till_booking' ? (
|
|
186
|
-
<div className="flex flex-col gap-2">
|
|
187
|
-
<Label>Time Before Booking</Label>
|
|
188
|
-
<div className="flex items-center gap-2">
|
|
189
|
-
<Input
|
|
190
|
-
type="number"
|
|
191
|
-
min={1}
|
|
192
|
-
value={rule.latency_value ?? rule.hours_before ?? ''}
|
|
193
|
-
onChange={(e) => updateRule(index, { latency_value: e.target.value ? parseInt(e.target.value) : undefined })}
|
|
194
|
-
className="w-24"
|
|
195
|
-
/>
|
|
196
|
-
<Select value={rule.latency_unit || 'hours'} onValueChange={(val) => updateRule(index, { latency_unit: val as 'minutes' | 'hours' | 'days' })}>
|
|
197
|
-
<SelectTrigger className="w-[130px]">
|
|
198
|
-
<SelectValue />
|
|
199
|
-
</SelectTrigger>
|
|
200
|
-
<SelectContent>
|
|
201
|
-
<SelectItem value="minutes">Minutes</SelectItem>
|
|
202
|
-
<SelectItem value="hours">Hours</SelectItem>
|
|
203
|
-
<SelectItem value="days">Days</SelectItem>
|
|
204
|
-
</SelectContent>
|
|
205
|
-
</Select>
|
|
206
|
-
</div>
|
|
207
|
-
</div>
|
|
208
|
-
) : (
|
|
209
|
-
<div className="flex flex-col gap-4">
|
|
210
|
-
<div className="flex flex-col gap-2">
|
|
211
|
-
<Label>From</Label>
|
|
212
|
-
<p className="text-label-secondary text-xs">How far before the booking this window starts</p>
|
|
213
|
-
<div className="flex items-center gap-2">
|
|
214
|
-
<Input
|
|
215
|
-
type="number"
|
|
216
|
-
min={1}
|
|
217
|
-
value={rule.latency_range_start ?? ''}
|
|
218
|
-
onChange={(e) => updateRule(index, { latency_range_start: e.target.value ? parseInt(e.target.value) : undefined })}
|
|
219
|
-
className="w-24"
|
|
220
|
-
/>
|
|
221
|
-
<Select value={rule.latency_range_start_unit || 'days'} onValueChange={(val) => updateRule(index, { latency_range_start_unit: val as 'hours' | 'days' | 'weeks' })}>
|
|
222
|
-
<SelectTrigger className="w-[130px]">
|
|
223
|
-
<SelectValue />
|
|
224
|
-
</SelectTrigger>
|
|
225
|
-
<SelectContent>
|
|
226
|
-
<SelectItem value="hours">Hours</SelectItem>
|
|
227
|
-
<SelectItem value="days">Days</SelectItem>
|
|
228
|
-
<SelectItem value="weeks">Weeks</SelectItem>
|
|
229
|
-
</SelectContent>
|
|
230
|
-
</Select>
|
|
231
|
-
<span className="text-label-secondary text-sm">before</span>
|
|
232
|
-
</div>
|
|
233
|
-
</div>
|
|
234
|
-
<div className="flex flex-col gap-2">
|
|
235
|
-
<Label>Until</Label>
|
|
236
|
-
<p className="text-label-secondary text-xs">How close to the booking this window ends</p>
|
|
237
|
-
<div className="flex items-center gap-2">
|
|
238
|
-
<Input
|
|
239
|
-
type="number"
|
|
240
|
-
min={0}
|
|
241
|
-
value={rule.latency_range_end ?? ''}
|
|
242
|
-
onChange={(e) => updateRule(index, { latency_range_end: e.target.value ? parseInt(e.target.value) : undefined })}
|
|
243
|
-
className="w-24"
|
|
244
|
-
/>
|
|
245
|
-
<Select value={rule.latency_range_end_unit || 'days'} onValueChange={(val) => updateRule(index, { latency_range_end_unit: val as 'hours' | 'days' | 'weeks' })}>
|
|
246
|
-
<SelectTrigger className="w-[130px]">
|
|
247
|
-
<SelectValue />
|
|
248
|
-
</SelectTrigger>
|
|
249
|
-
<SelectContent>
|
|
250
|
-
<SelectItem value="hours">Hours</SelectItem>
|
|
251
|
-
<SelectItem value="days">Days</SelectItem>
|
|
252
|
-
<SelectItem value="weeks">Weeks</SelectItem>
|
|
253
|
-
</SelectContent>
|
|
254
|
-
</Select>
|
|
255
|
-
<span className="text-label-secondary text-sm">before</span>
|
|
256
|
-
</div>
|
|
257
|
-
</div>
|
|
258
|
-
</div>
|
|
259
|
-
)}
|
|
260
|
-
</div>
|
|
261
|
-
)}
|
|
262
|
-
|
|
263
|
-
{/* Group Size config */}
|
|
264
|
-
{rule.type === 'group_size' && (
|
|
265
|
-
<div className="flex flex-col gap-2">
|
|
266
|
-
<Label>Minimum Group Size</Label>
|
|
267
|
-
<p className="text-label-secondary text-xs">Tier activates when the booking group size meets or exceeds this number</p>
|
|
268
|
-
<Input
|
|
269
|
-
type="number"
|
|
270
|
-
min={2}
|
|
271
|
-
value={rule.min_group_size ?? ''}
|
|
272
|
-
onChange={(e) => updateRule(index, { min_group_size: e.target.value ? parseInt(e.target.value) : undefined })}
|
|
273
|
-
className="w-32"
|
|
274
|
-
/>
|
|
275
|
-
</div>
|
|
276
|
-
)}
|
|
277
|
-
|
|
278
|
-
{/* Cancellation Rate config */}
|
|
279
|
-
{rule.type === 'cancellation_rate' && (
|
|
280
|
-
<div className="flex flex-col gap-3">
|
|
281
|
-
<div className="flex flex-col gap-2">
|
|
282
|
-
<Label>Cancellation Threshold (%)</Label>
|
|
283
|
-
<p className="text-label-secondary text-xs">Tier activates when cancellation rate exceeds this percentage</p>
|
|
284
|
-
<Input
|
|
285
|
-
type="number"
|
|
286
|
-
min={1}
|
|
287
|
-
max={100}
|
|
288
|
-
value={rule.cancellation_threshold ?? ''}
|
|
289
|
-
onChange={(e) => updateRule(index, { cancellation_threshold: e.target.value ? parseInt(e.target.value) : undefined })}
|
|
290
|
-
className="w-32"
|
|
291
|
-
/>
|
|
292
|
-
</div>
|
|
293
|
-
<div className="flex flex-col gap-2">
|
|
294
|
-
<Label>Window (hours)</Label>
|
|
295
|
-
<p className="text-label-secondary text-xs">Look back this many hours to calculate the cancellation rate</p>
|
|
296
|
-
<Input
|
|
297
|
-
type="number"
|
|
298
|
-
min={1}
|
|
299
|
-
value={rule.cancellation_window_hours ?? ''}
|
|
300
|
-
onChange={(e) => updateRule(index, { cancellation_window_hours: e.target.value ? parseInt(e.target.value) : undefined })}
|
|
301
|
-
className="w-32"
|
|
302
|
-
/>
|
|
303
|
-
</div>
|
|
304
|
-
</div>
|
|
305
|
-
)}
|
|
306
|
-
|
|
307
|
-
{/* Traffic config */}
|
|
308
|
-
{rule.type === 'traffic' && (
|
|
309
|
-
<div className="flex flex-col gap-3">
|
|
310
|
-
<div className="flex flex-col gap-2">
|
|
311
|
-
<Label>Views Threshold</Label>
|
|
312
|
-
<p className="text-label-secondary text-xs">Tier activates when page views or searches exceed this number</p>
|
|
313
|
-
<Input
|
|
314
|
-
type="number"
|
|
315
|
-
min={1}
|
|
316
|
-
value={rule.views_threshold ?? ''}
|
|
317
|
-
onChange={(e) => updateRule(index, { views_threshold: e.target.value ? parseInt(e.target.value) : undefined })}
|
|
318
|
-
className="w-32"
|
|
319
|
-
/>
|
|
320
|
-
</div>
|
|
321
|
-
<div className="flex flex-col gap-2">
|
|
322
|
-
<Label>Window (hours)</Label>
|
|
323
|
-
<p className="text-label-secondary text-xs">Look back this many hours to count views</p>
|
|
324
|
-
<Input
|
|
325
|
-
type="number"
|
|
326
|
-
min={1}
|
|
327
|
-
value={rule.traffic_window_hours ?? ''}
|
|
328
|
-
onChange={(e) => updateRule(index, { traffic_window_hours: e.target.value ? parseInt(e.target.value) : undefined })}
|
|
329
|
-
className="w-32"
|
|
330
|
-
/>
|
|
331
|
-
</div>
|
|
332
|
-
</div>
|
|
333
|
-
)}
|
|
334
|
-
|
|
335
|
-
{/* Weather config */}
|
|
336
|
-
{rule.type === 'weather' && (
|
|
337
|
-
<div className="flex flex-col gap-3">
|
|
338
|
-
<div className="flex flex-col gap-2">
|
|
339
|
-
<Label>Weather Conditions</Label>
|
|
340
|
-
<p className="text-label-secondary text-xs">Select conditions that trigger this tier</p>
|
|
341
|
-
<div className="flex flex-wrap gap-2">
|
|
342
|
-
{WEATHER_CONDITIONS.map(condition => (
|
|
343
|
-
<button
|
|
344
|
-
key={condition}
|
|
345
|
-
type="button"
|
|
346
|
-
onClick={() => toggleWeatherCondition(index, condition)}
|
|
347
|
-
className={`px-3 py-1.5 rounded-full text-sm border transition-colors ${
|
|
348
|
-
(rule.weather_conditions || []).includes(condition)
|
|
349
|
-
? 'bg-fill-primary text-white border-fill-primary'
|
|
350
|
-
: 'bg-surface-primary text-label-secondary border-border-primary hover:border-border-secondary'
|
|
351
|
-
}`}
|
|
352
|
-
>
|
|
353
|
-
{condition.charAt(0).toUpperCase() + condition.slice(1)}
|
|
354
|
-
</button>
|
|
355
|
-
))}
|
|
356
|
-
</div>
|
|
357
|
-
</div>
|
|
358
|
-
<div className="grid grid-cols-2 gap-4">
|
|
359
|
-
<div className="flex flex-col gap-2">
|
|
360
|
-
<Label>Temperature Above (°C)</Label>
|
|
361
|
-
<Input
|
|
362
|
-
type="number"
|
|
363
|
-
value={rule.temperature_above ?? ''}
|
|
364
|
-
onChange={(e) => updateRule(index, { temperature_above: e.target.value ? parseInt(e.target.value) : undefined })}
|
|
365
|
-
className="w-32"
|
|
366
|
-
/>
|
|
367
|
-
</div>
|
|
368
|
-
<div className="flex flex-col gap-2">
|
|
369
|
-
<Label>Temperature Below (°C)</Label>
|
|
370
|
-
<Input
|
|
371
|
-
type="number"
|
|
372
|
-
value={rule.temperature_below ?? ''}
|
|
373
|
-
onChange={(e) => updateRule(index, { temperature_below: e.target.value ? parseInt(e.target.value) : undefined })}
|
|
374
|
-
className="w-32"
|
|
375
|
-
/>
|
|
376
|
-
</div>
|
|
377
|
-
</div>
|
|
378
|
-
<p className="text-label-tertiary text-xs italic">
|
|
379
|
-
Note: Weather rules require a weather API integration to be configured. This will be set up separately.
|
|
380
|
-
</p>
|
|
381
|
-
</div>
|
|
382
|
-
)}
|
|
383
|
-
</div>
|
|
384
|
-
);
|
|
385
|
-
})}
|
|
386
|
-
{RULE_TYPE_OPTIONS.filter(opt => !opt.disabled).some(opt => !usedTypes.has(opt.value)) && (
|
|
387
|
-
<Button
|
|
388
|
-
variant="outline"
|
|
389
|
-
onClick={addRule}
|
|
390
|
-
withIcon
|
|
391
|
-
className="w-fit"
|
|
392
|
-
>
|
|
393
|
-
<IconPlus className="w-4 h-4 fill-fill-secondary" />
|
|
394
|
-
Add Rule
|
|
395
|
-
</Button>
|
|
396
|
-
)}
|
|
397
|
-
</div>
|
|
398
|
-
);
|
|
399
|
-
};
|
|
400
|
-
|
|
401
|
-
export default DynamicPricingRulesEditor;
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import StatusBadge from '../StatusBadge';
|
|
3
|
-
import TableActionMenu from '../TableActionMenu';
|
|
4
|
-
import type { DynamicPricingRule } from '../pricing/DynamicPricingRulesEditor';
|
|
5
|
-
import getRuleSummary from '../pricing/getRuleSummary';
|
|
6
|
-
|
|
7
|
-
export interface DynamicPricingTier {
|
|
8
|
-
id: string;
|
|
9
|
-
provider_id: string;
|
|
10
|
-
name: string;
|
|
11
|
-
description: string | null;
|
|
12
|
-
adjustment: number;
|
|
13
|
-
display_order: number;
|
|
14
|
-
is_active: boolean;
|
|
15
|
-
rules: any[];
|
|
16
|
-
match_mode: 'all' | 'any';
|
|
17
|
-
status: string;
|
|
18
|
-
created_at: string;
|
|
19
|
-
updated_at: string;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
interface DynamicPricingTierCardProps {
|
|
23
|
-
tier: DynamicPricingTier;
|
|
24
|
-
onEdit: (tier: DynamicPricingTier) => void;
|
|
25
|
-
onDelete: (tier: DynamicPricingTier) => void;
|
|
26
|
-
onToggleActive: (tier: DynamicPricingTier) => void;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
const DynamicPricingTierCard: React.FC<DynamicPricingTierCardProps> = ({ tier, onEdit, onDelete, onToggleActive }) => {
|
|
30
|
-
return (
|
|
31
|
-
<div className="flex flex-col gap-3 p-4 border border-border-primary rounded-lg bg-surface-primary">
|
|
32
|
-
<div className="flex items-start justify-between gap-4">
|
|
33
|
-
<div className="flex flex-col gap-2 flex-1 min-w-0">
|
|
34
|
-
<div className="flex flex-col gap-0.5 min-w-0">
|
|
35
|
-
<p className="text-label-primary font-semibold text-base">{tier.name}</p>
|
|
36
|
-
{tier.description && (
|
|
37
|
-
<p className="text-label-secondary text-sm">{tier.description}</p>
|
|
38
|
-
)}
|
|
39
|
-
</div>
|
|
40
|
-
{tier.rules && tier.rules.length > 0 && (
|
|
41
|
-
<div className="flex flex-wrap items-center gap-1.5">
|
|
42
|
-
{tier.rules.map((rule: DynamicPricingRule, i: number) => (
|
|
43
|
-
<React.Fragment key={i}>
|
|
44
|
-
{i > 0 && (
|
|
45
|
-
<span className="text-label-tertiary text-xs font-medium uppercase">
|
|
46
|
-
{tier.match_mode === 'any' ? 'or' : 'and'}
|
|
47
|
-
</span>
|
|
48
|
-
)}
|
|
49
|
-
<span
|
|
50
|
-
className="inline-flex items-center px-2 py-0.5 rounded-md bg-surface-secondary text-label-secondary text-xs"
|
|
51
|
-
>
|
|
52
|
-
{getRuleSummary(rule)}
|
|
53
|
-
</span>
|
|
54
|
-
</React.Fragment>
|
|
55
|
-
))}
|
|
56
|
-
</div>
|
|
57
|
-
)}
|
|
58
|
-
</div>
|
|
59
|
-
<div className="flex items-center gap-2 flex-shrink-0">
|
|
60
|
-
<span className="text-label-secondary text-xs border border-border-primary rounded-full px-2.5 py-0.5">
|
|
61
|
-
Priority {tier.display_order + 1}
|
|
62
|
-
</span>
|
|
63
|
-
<StatusBadge status={tier.is_active ? 'active' : 'disabled'} />
|
|
64
|
-
<TableActionMenu
|
|
65
|
-
items={[
|
|
66
|
-
{ label: 'Edit', onClick: () => onEdit(tier) },
|
|
67
|
-
{ label: tier.is_active ? 'Deactivate' : 'Activate', onClick: () => onToggleActive(tier) },
|
|
68
|
-
{ label: 'Delete', onClick: () => onDelete(tier), variant: 'danger' },
|
|
69
|
-
]}
|
|
70
|
-
/>
|
|
71
|
-
</div>
|
|
72
|
-
</div>
|
|
73
|
-
</div>
|
|
74
|
-
);
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
export default DynamicPricingTierCard;
|