@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,140 +0,0 @@
|
|
|
1
|
-
import React, { useEffect, useState } from 'react';
|
|
2
|
-
import { Input } from '../ui/input';
|
|
3
|
-
import { Label } from '../ui/label';
|
|
4
|
-
import { Switch } from '../ui/switch';
|
|
5
|
-
import { supabase } from '@/integrations/supabase/client';
|
|
6
|
-
|
|
7
|
-
export interface PeriodPricingEntry {
|
|
8
|
-
id: string;
|
|
9
|
-
name: string;
|
|
10
|
-
description: string | null;
|
|
11
|
-
colour: string;
|
|
12
|
-
price: number | null;
|
|
13
|
-
has_custom_time: boolean;
|
|
14
|
-
dynamic_pricing_enabled?: boolean;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
interface VariablePricingSectionProps {
|
|
18
|
-
providerId?: string;
|
|
19
|
-
standardPrice: number;
|
|
20
|
-
onStandardPriceChange: (price: number) => void;
|
|
21
|
-
periodPricing: PeriodPricingEntry[];
|
|
22
|
-
onPeriodPricingChange: (periods: PeriodPricingEntry[]) => void;
|
|
23
|
-
showDynamicPricingToggle?: boolean;
|
|
24
|
-
periodDpEnabled?: Record<string, boolean>;
|
|
25
|
-
onPeriodDpEnabledChange?: (map: Record<string, boolean>) => void;
|
|
26
|
-
standardDpEnabled?: boolean;
|
|
27
|
-
onStandardDpEnabledChange?: (enabled: boolean) => void;
|
|
28
|
-
hasDynamicTiers?: boolean;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const VariablePricingSection: React.FC<VariablePricingSectionProps> = ({
|
|
32
|
-
providerId,
|
|
33
|
-
standardPrice,
|
|
34
|
-
onStandardPriceChange,
|
|
35
|
-
periodPricing,
|
|
36
|
-
onPeriodPricingChange,
|
|
37
|
-
showDynamicPricingToggle = false,
|
|
38
|
-
periodDpEnabled = {},
|
|
39
|
-
onPeriodDpEnabledChange,
|
|
40
|
-
standardDpEnabled = true,
|
|
41
|
-
onStandardDpEnabledChange,
|
|
42
|
-
hasDynamicTiers = false,
|
|
43
|
-
}) => {
|
|
44
|
-
// Fetch pricing periods from DB on mount
|
|
45
|
-
useEffect(() => {
|
|
46
|
-
if (!providerId || periodPricing.length > 0) return;
|
|
47
|
-
|
|
48
|
-
const fetchPeriods = async () => {
|
|
49
|
-
const { data } = await supabase
|
|
50
|
-
.from('pricing_periods')
|
|
51
|
-
.select('id, name, description, colour, rules')
|
|
52
|
-
.eq('provider_id', providerId)
|
|
53
|
-
.eq('status', 'active')
|
|
54
|
-
.eq('is_active', true)
|
|
55
|
-
.order('priority', { ascending: true });
|
|
56
|
-
|
|
57
|
-
if (data && data.length > 0) {
|
|
58
|
-
const periods = data.map(p => {
|
|
59
|
-
const rules = Array.isArray(p.rules) ? p.rules : [];
|
|
60
|
-
const hasCustomTime = rules.some((r: any) => r.is_24_hours === false);
|
|
61
|
-
return {
|
|
62
|
-
id: p.id,
|
|
63
|
-
name: p.name,
|
|
64
|
-
description: p.description,
|
|
65
|
-
colour: p.colour,
|
|
66
|
-
price: null,
|
|
67
|
-
has_custom_time: hasCustomTime,
|
|
68
|
-
};
|
|
69
|
-
});
|
|
70
|
-
onPeriodPricingChange(periods);
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
fetchPeriods();
|
|
75
|
-
}, [providerId]);
|
|
76
|
-
|
|
77
|
-
const updatePeriodPrice = (index: number, price: number | null) => {
|
|
78
|
-
const updated = [...periodPricing];
|
|
79
|
-
updated[index] = { ...updated[index], price };
|
|
80
|
-
onPeriodPricingChange(updated);
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
if (periodPricing.length === 0) {
|
|
84
|
-
return null;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
return (
|
|
88
|
-
<div className="flex flex-col gap-4 pt-4 border-t border-border-primary">
|
|
89
|
-
<div className="flex flex-col gap-1">
|
|
90
|
-
<h2 className="text-label-primary text-xl font-semibold">Variable Pricing</h2>
|
|
91
|
-
<p className="text-label-secondary text-sm">Set prices for each pricing period. Leave empty to use the standard price.</p>
|
|
92
|
-
</div>
|
|
93
|
-
|
|
94
|
-
{/* Period Prices */}
|
|
95
|
-
<div className="flex flex-col gap-3">
|
|
96
|
-
{periodPricing.map((period, index) => (
|
|
97
|
-
<div key={period.id} className="flex flex-col gap-3 p-4 border border-border-primary rounded-lg">
|
|
98
|
-
<div className="flex items-center gap-4">
|
|
99
|
-
<span className="w-3 h-3 rounded-full flex-shrink-0" style={{ backgroundColor: period.colour }} />
|
|
100
|
-
<div className="flex-1 min-w-0">
|
|
101
|
-
<p className="text-label-primary text-sm font-medium">{period.name}</p>
|
|
102
|
-
{period.description && (
|
|
103
|
-
<p className="text-label-secondary text-xs">{period.description}</p>
|
|
104
|
-
)}
|
|
105
|
-
</div>
|
|
106
|
-
<div className="flex items-center gap-1 flex-shrink-0">
|
|
107
|
-
<span className="text-label-secondary text-sm">£</span>
|
|
108
|
-
<Input
|
|
109
|
-
type="text"
|
|
110
|
-
inputMode="decimal"
|
|
111
|
-
defaultValue={period.price == null ? '' : period.price.toFixed(2)}
|
|
112
|
-
key={`period-${period.id}-${period.price}`}
|
|
113
|
-
onBlur={(e) => {
|
|
114
|
-
const raw = e.target.value.trim();
|
|
115
|
-
if (raw === '') { updatePeriodPrice(index, null); return; }
|
|
116
|
-
const v = parseFloat(parseFloat(raw).toFixed(2));
|
|
117
|
-
updatePeriodPrice(index, isNaN(v) ? null : v);
|
|
118
|
-
e.target.value = isNaN(v) ? '' : v.toFixed(2);
|
|
119
|
-
}}
|
|
120
|
-
className="w-24"
|
|
121
|
-
/>
|
|
122
|
-
</div>
|
|
123
|
-
</div>
|
|
124
|
-
{showDynamicPricingToggle && hasDynamicTiers && (
|
|
125
|
-
<div className="flex items-center gap-2 pt-2 border-t border-border-primary">
|
|
126
|
-
<Switch
|
|
127
|
-
checked={periodDpEnabled[period.id] !== false}
|
|
128
|
-
onCheckedChange={(checked) => onPeriodDpEnabledChange?.({ ...periodDpEnabled, [period.id]: checked })}
|
|
129
|
-
/>
|
|
130
|
-
<Label className="text-sm">Dynamic Pricing</Label>
|
|
131
|
-
</div>
|
|
132
|
-
)}
|
|
133
|
-
</div>
|
|
134
|
-
))}
|
|
135
|
-
</div>
|
|
136
|
-
</div>
|
|
137
|
-
);
|
|
138
|
-
};
|
|
139
|
-
|
|
140
|
-
export default VariablePricingSection;
|
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
// Product type field configurations
|
|
2
|
-
|
|
3
|
-
export interface ProductFieldConfig {
|
|
4
|
-
name: string;
|
|
5
|
-
label: string;
|
|
6
|
-
type: 'text' | 'number' | 'textarea' | 'select' | 'checkbox' | 'date' | 'time' | 'zone-select' | 'resource-select' | 'duration-hours-minutes';
|
|
7
|
-
placeholder?: string;
|
|
8
|
-
options?: { value: string; label: string }[];
|
|
9
|
-
required?: boolean;
|
|
10
|
-
unit?: string;
|
|
11
|
-
conditionalOn?: { field: string; value: string };
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export interface ProductTypeConfig {
|
|
15
|
-
value: string;
|
|
16
|
-
label: string;
|
|
17
|
-
icon: 'activity' | 'sessions' | 'tickets' | 'offers' | 'memberships' | 'gift_cards' | 'food_beverage' | 'clothing' | 'item' | 'packages';
|
|
18
|
-
fields: ProductFieldConfig[];
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
// Common fields for all product types (price is now handled by PricingSection)
|
|
22
|
-
export const COMMON_FIELDS: ProductFieldConfig[] = [
|
|
23
|
-
{ name: 'description', label: 'Description', type: 'textarea', placeholder: 'Enter product description' },
|
|
24
|
-
];
|
|
25
|
-
|
|
26
|
-
// Type-specific field configurations
|
|
27
|
-
export const PRODUCT_TYPE_CONFIGS: ProductTypeConfig[] = [
|
|
28
|
-
{
|
|
29
|
-
value: 'activity',
|
|
30
|
-
label: 'Activity',
|
|
31
|
-
icon: 'activity',
|
|
32
|
-
fields: [
|
|
33
|
-
{ name: 'zone_id', label: 'Zone', type: 'zone-select' },
|
|
34
|
-
{ name: 'resource_id', label: 'Resource', type: 'resource-select' },
|
|
35
|
-
{ name: 'capacity', label: 'Max Participants', type: 'number', placeholder: '10' },
|
|
36
|
-
{
|
|
37
|
-
name: 'difficulty_level',
|
|
38
|
-
label: 'Difficulty Level',
|
|
39
|
-
type: 'select',
|
|
40
|
-
options: [
|
|
41
|
-
{ value: 'beginner', label: 'Beginner' },
|
|
42
|
-
{ value: 'intermediate', label: 'Intermediate' },
|
|
43
|
-
{ value: 'advanced', label: 'Advanced' },
|
|
44
|
-
{ value: 'all_levels', label: 'All Levels' },
|
|
45
|
-
]
|
|
46
|
-
},
|
|
47
|
-
],
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
value: 'offers',
|
|
51
|
-
label: 'Offers',
|
|
52
|
-
icon: 'offers',
|
|
53
|
-
fields: [
|
|
54
|
-
{ name: 'original_price', label: 'Original Price', type: 'number', placeholder: '0.00', unit: '£' },
|
|
55
|
-
{ name: 'validity_period', label: 'Validity Period', type: 'number', placeholder: '30', unit: 'days' },
|
|
56
|
-
{ name: 'terms_conditions', label: 'Terms & Conditions', type: 'textarea', placeholder: 'Enter terms and conditions' },
|
|
57
|
-
],
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
value: 'memberships',
|
|
61
|
-
label: 'Memberships',
|
|
62
|
-
icon: 'memberships',
|
|
63
|
-
fields: [
|
|
64
|
-
{
|
|
65
|
-
name: 'billing_period',
|
|
66
|
-
label: 'Billing Period',
|
|
67
|
-
type: 'select',
|
|
68
|
-
options: [
|
|
69
|
-
{ value: 'monthly', label: 'Monthly' },
|
|
70
|
-
{ value: 'quarterly', label: 'Quarterly' },
|
|
71
|
-
{ value: 'annually', label: 'Annually' },
|
|
72
|
-
]
|
|
73
|
-
},
|
|
74
|
-
{ name: 'benefits', label: 'Benefits', type: 'textarea', placeholder: 'List membership benefits' },
|
|
75
|
-
{ name: 'auto_renew', label: 'Auto-renew by default', type: 'checkbox' },
|
|
76
|
-
],
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
value: 'tickets',
|
|
80
|
-
label: 'Tickets',
|
|
81
|
-
icon: 'tickets',
|
|
82
|
-
fields: [
|
|
83
|
-
{ name: 'event_date', label: 'Event Date', type: 'date' },
|
|
84
|
-
{ name: 'event_time', label: 'Event Time', type: 'time' },
|
|
85
|
-
{ name: 'seat_category', label: 'Seat Category', type: 'text', placeholder: 'e.g. Standard, VIP' },
|
|
86
|
-
{ name: 'venue_location', label: 'Venue/Location', type: 'text', placeholder: 'Event location' },
|
|
87
|
-
],
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
value: 'sessions',
|
|
91
|
-
label: 'Sessions',
|
|
92
|
-
icon: 'sessions',
|
|
93
|
-
fields: [
|
|
94
|
-
{ name: 'zone_id', label: 'Zone', type: 'zone-select' },
|
|
95
|
-
{ name: 'resource_id', label: 'Resource', type: 'resource-select' },
|
|
96
|
-
{ name: 'duration', label: 'Duration', type: 'number', placeholder: '60', unit: 'minutes' },
|
|
97
|
-
{ name: 'capacity', label: 'Max Participants', type: 'number', placeholder: '10' },
|
|
98
|
-
{
|
|
99
|
-
name: 'session_type',
|
|
100
|
-
label: 'Session Type',
|
|
101
|
-
type: 'select',
|
|
102
|
-
options: [
|
|
103
|
-
{ value: 'scheduled', label: 'Scheduled (Fixed time slots)' },
|
|
104
|
-
{ value: 'rolling', label: 'Rolling (Interval start times)' },
|
|
105
|
-
{ value: 'open', label: 'Open (Venue hours)' },
|
|
106
|
-
]
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
name: 'interval_minutes',
|
|
110
|
-
label: 'Start Interval',
|
|
111
|
-
type: 'select',
|
|
112
|
-
options: [
|
|
113
|
-
{ value: '15', label: 'Every 15 minutes' },
|
|
114
|
-
{ value: '30', label: 'Every 30 minutes' },
|
|
115
|
-
{ value: '45', label: 'Every 45 minutes' },
|
|
116
|
-
{ value: '60', label: 'Every hour' },
|
|
117
|
-
],
|
|
118
|
-
conditionalOn: { field: 'session_type', value: 'rolling' }
|
|
119
|
-
},
|
|
120
|
-
],
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
value: 'food_beverage',
|
|
124
|
-
label: 'Food & Beverage',
|
|
125
|
-
icon: 'food_beverage',
|
|
126
|
-
fields: [
|
|
127
|
-
{ name: 'allergens', label: 'Allergens', type: 'text', placeholder: 'e.g. Nuts, Gluten, Dairy' },
|
|
128
|
-
{ name: 'calories', label: 'Calories', type: 'number', placeholder: '0', unit: 'kcal' },
|
|
129
|
-
{ name: 'dietary_tags', label: 'Dietary Tags', type: 'text', placeholder: 'e.g. Vegetarian, Vegan, Gluten-Free' },
|
|
130
|
-
],
|
|
131
|
-
},
|
|
132
|
-
{
|
|
133
|
-
value: 'clothing',
|
|
134
|
-
label: 'Clothing',
|
|
135
|
-
icon: 'clothing',
|
|
136
|
-
fields: [
|
|
137
|
-
{ name: 'sizes', label: 'Available Sizes', type: 'text', placeholder: 'e.g. S, M, L, XL' },
|
|
138
|
-
{ name: 'colors', label: 'Available Colors', type: 'text', placeholder: 'e.g. Black, White, Navy' },
|
|
139
|
-
{ name: 'material', label: 'Material', type: 'text', placeholder: 'e.g. 100% Cotton' },
|
|
140
|
-
],
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
value: 'gift_cards',
|
|
144
|
-
label: 'Gift Card',
|
|
145
|
-
icon: 'gift_cards',
|
|
146
|
-
fields: [
|
|
147
|
-
{ name: 'expiry_months', label: 'Expires in', type: 'number' },
|
|
148
|
-
],
|
|
149
|
-
},
|
|
150
|
-
{
|
|
151
|
-
value: 'item',
|
|
152
|
-
label: 'Item',
|
|
153
|
-
icon: 'item',
|
|
154
|
-
fields: [
|
|
155
|
-
{ name: 'stock_quantity', label: 'Stock Quantity', type: 'number', placeholder: '0' },
|
|
156
|
-
{ name: 'dimensions', label: 'Dimensions', type: 'text', placeholder: 'e.g. 10x20x5 cm' },
|
|
157
|
-
{ name: 'weight', label: 'Weight', type: 'number', placeholder: '0', unit: 'kg' },
|
|
158
|
-
],
|
|
159
|
-
},
|
|
160
|
-
{
|
|
161
|
-
value: 'packages',
|
|
162
|
-
label: 'Package',
|
|
163
|
-
icon: 'packages',
|
|
164
|
-
fields: [
|
|
165
|
-
],
|
|
166
|
-
},
|
|
167
|
-
];
|
|
168
|
-
|
|
169
|
-
export const getFieldsForType = (productType: string): ProductFieldConfig[] => {
|
|
170
|
-
const config = PRODUCT_TYPE_CONFIGS.find(c => c.value === productType);
|
|
171
|
-
return config ? [...COMMON_FIELDS, ...config.fields] : COMMON_FIELDS;
|
|
172
|
-
};
|
|
173
|
-
|
|
174
|
-
export const getTypeLabel = (productType: string): string => {
|
|
175
|
-
const config = PRODUCT_TYPE_CONFIGS.find(c => c.value === productType);
|
|
176
|
-
return config?.label || productType;
|
|
177
|
-
};
|
|
178
|
-
|
|
179
|
-
export const getTypeIcon = (productType: string): ProductTypeConfig['icon'] | undefined => {
|
|
180
|
-
const config = PRODUCT_TYPE_CONFIGS.find(c => c.value === productType);
|
|
181
|
-
return config?.icon;
|
|
182
|
-
};
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { useNavigate } from 'react-router-dom';
|
|
3
|
-
import { Button } from '../ui/button';
|
|
4
|
-
import { IconArrowLeft } from '../../../icons';
|
|
5
|
-
import { cn } from '../../lib/utils';
|
|
6
|
-
|
|
7
|
-
interface BackButtonProps {
|
|
8
|
-
/** Button label text */
|
|
9
|
-
label?: string;
|
|
10
|
-
/** If provided, navigates to this route. Otherwise navigates back in history. */
|
|
11
|
-
to?: string;
|
|
12
|
-
/** Custom click handler — overrides `to` and default behaviour */
|
|
13
|
-
onClick?: () => void;
|
|
14
|
-
className?: string;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const BackButton: React.FC<BackButtonProps> = ({
|
|
18
|
-
label = 'Back',
|
|
19
|
-
to,
|
|
20
|
-
onClick,
|
|
21
|
-
className,
|
|
22
|
-
}) => {
|
|
23
|
-
const navigate = useNavigate();
|
|
24
|
-
|
|
25
|
-
const handleBack = () => {
|
|
26
|
-
if (onClick) {
|
|
27
|
-
onClick();
|
|
28
|
-
} else if (to) {
|
|
29
|
-
navigate(to);
|
|
30
|
-
} else if (window.history.length > 1) {
|
|
31
|
-
navigate(-1);
|
|
32
|
-
} else {
|
|
33
|
-
navigate('/');
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
return (
|
|
38
|
-
<Button
|
|
39
|
-
variant="ghost"
|
|
40
|
-
withIcon
|
|
41
|
-
onClick={handleBack}
|
|
42
|
-
className={cn('text-label-action hover:bg-surface-action-soft self-start mb-4', className)}
|
|
43
|
-
>
|
|
44
|
-
<IconArrowLeft className="fill-current" />
|
|
45
|
-
{label}
|
|
46
|
-
</Button>
|
|
47
|
-
);
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
export default BackButton;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
// Backward-compatible re-exports pointing to the unified ConfirmationDialog
|
|
2
|
-
import ConfirmationDialog from './ConfirmationDialog';
|
|
3
|
-
|
|
4
|
-
export type CancelConfirmationDialogProps = {
|
|
5
|
-
open: boolean;
|
|
6
|
-
onOpenChange: (open: boolean) => void;
|
|
7
|
-
onConfirm: () => void;
|
|
8
|
-
mode?: 'create' | 'edit';
|
|
9
|
-
title?: string;
|
|
10
|
-
description?: string;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
const CancelConfirmationDialog: React.FC<CancelConfirmationDialogProps> = (props) => (
|
|
14
|
-
<ConfirmationDialog variant="cancel" {...props} />
|
|
15
|
-
);
|
|
16
|
-
|
|
17
|
-
import React from 'react';
|
|
18
|
-
export default CancelConfirmationDialog;
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
import React, { useState, useEffect } from 'react';
|
|
2
|
-
import { useTranslation } from 'react-i18next';
|
|
3
|
-
import { cn } from '../../lib/utils';
|
|
4
|
-
import { buttonVariants } from '../ui/button';
|
|
5
|
-
import {
|
|
6
|
-
AlertDialog,
|
|
7
|
-
AlertDialogAction,
|
|
8
|
-
AlertDialogCancel,
|
|
9
|
-
AlertDialogContent,
|
|
10
|
-
AlertDialogDescription,
|
|
11
|
-
AlertDialogFooter,
|
|
12
|
-
AlertDialogHeader,
|
|
13
|
-
AlertDialogTitle,
|
|
14
|
-
} from '../ui/alert-dialog';
|
|
15
|
-
import { Input } from '../ui/input';
|
|
16
|
-
import { Label } from '../ui/label';
|
|
17
|
-
|
|
18
|
-
interface ConfirmationDialogProps {
|
|
19
|
-
open: boolean;
|
|
20
|
-
onOpenChange: (open: boolean) => void;
|
|
21
|
-
onConfirm: () => void;
|
|
22
|
-
variant: 'cancel' | 'delete';
|
|
23
|
-
title?: string;
|
|
24
|
-
description?: string;
|
|
25
|
-
/** For cancel variant: 'create' or 'edit' mode */
|
|
26
|
-
mode?: 'create' | 'edit';
|
|
27
|
-
/** For delete variant: item name requiring typed confirmation */
|
|
28
|
-
itemName?: string;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const ConfirmationDialog: React.FC<ConfirmationDialogProps> = ({
|
|
32
|
-
open,
|
|
33
|
-
onOpenChange,
|
|
34
|
-
onConfirm,
|
|
35
|
-
variant,
|
|
36
|
-
title,
|
|
37
|
-
description,
|
|
38
|
-
mode = 'edit',
|
|
39
|
-
itemName,
|
|
40
|
-
}) => {
|
|
41
|
-
const { t } = useTranslation(['Design']);
|
|
42
|
-
const [confirmationInput, setConfirmationInput] = useState('');
|
|
43
|
-
|
|
44
|
-
useEffect(() => {
|
|
45
|
-
if (!open) {
|
|
46
|
-
setConfirmationInput('');
|
|
47
|
-
}
|
|
48
|
-
}, [open]);
|
|
49
|
-
|
|
50
|
-
if (variant === 'cancel') {
|
|
51
|
-
const isCreate = mode === 'create';
|
|
52
|
-
const defaultTitle = isCreate ? t('discardTitle') : t('discardChangesTitle');
|
|
53
|
-
const defaultDescription = isCreate
|
|
54
|
-
? t('discardProgressDesc')
|
|
55
|
-
: t('discardChangesDesc');
|
|
56
|
-
const actionLabel = isCreate ? t('discard') : t('discardChanges');
|
|
57
|
-
const cancelLabel = isCreate ? t('continue') : t('continueEditing');
|
|
58
|
-
|
|
59
|
-
return (
|
|
60
|
-
<AlertDialog open={open} onOpenChange={onOpenChange}>
|
|
61
|
-
<AlertDialogContent>
|
|
62
|
-
<AlertDialogHeader>
|
|
63
|
-
<AlertDialogTitle>{title || defaultTitle}</AlertDialogTitle>
|
|
64
|
-
<AlertDialogDescription>
|
|
65
|
-
{description || defaultDescription}
|
|
66
|
-
</AlertDialogDescription>
|
|
67
|
-
</AlertDialogHeader>
|
|
68
|
-
|
|
69
|
-
<AlertDialogFooter className="sm:justify-start">
|
|
70
|
-
<AlertDialogAction
|
|
71
|
-
onClick={onConfirm}
|
|
72
|
-
className={buttonVariants({ variant: "destructive" })}
|
|
73
|
-
>
|
|
74
|
-
{actionLabel}
|
|
75
|
-
</AlertDialogAction>
|
|
76
|
-
<AlertDialogCancel>{cancelLabel}</AlertDialogCancel>
|
|
77
|
-
</AlertDialogFooter>
|
|
78
|
-
</AlertDialogContent>
|
|
79
|
-
</AlertDialog>
|
|
80
|
-
);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
// Delete variant
|
|
84
|
-
const isDeleteEnabled = !itemName || confirmationInput === itemName;
|
|
85
|
-
|
|
86
|
-
const defaultDescription = itemName
|
|
87
|
-
? t('deleteNamedItemDesc', { name: itemName })
|
|
88
|
-
: t('deleteItemDesc');
|
|
89
|
-
|
|
90
|
-
const handleConfirm = () => {
|
|
91
|
-
if (isDeleteEnabled) {
|
|
92
|
-
onConfirm();
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
return (
|
|
97
|
-
<AlertDialog open={open} onOpenChange={onOpenChange}>
|
|
98
|
-
<AlertDialogContent className="z-50">
|
|
99
|
-
<AlertDialogHeader>
|
|
100
|
-
<AlertDialogTitle>{title || t('delete')}</AlertDialogTitle>
|
|
101
|
-
<AlertDialogDescription className="whitespace-pre-line">
|
|
102
|
-
{description || defaultDescription}
|
|
103
|
-
</AlertDialogDescription>
|
|
104
|
-
</AlertDialogHeader>
|
|
105
|
-
|
|
106
|
-
{itemName && (
|
|
107
|
-
<div className="space-y-2">
|
|
108
|
-
<Label htmlFor="confirm-name" className="text-label-primary text-sm">
|
|
109
|
-
{t('typeWord')} <span className="font-semibold">{itemName}</span> {t('toConfirmDeletion')}
|
|
110
|
-
</Label>
|
|
111
|
-
<Input
|
|
112
|
-
id="confirm-name"
|
|
113
|
-
value={confirmationInput}
|
|
114
|
-
onChange={(e) => setConfirmationInput(e.target.value)}
|
|
115
|
-
placeholder={itemName}
|
|
116
|
-
className="w-full"
|
|
117
|
-
/>
|
|
118
|
-
</div>
|
|
119
|
-
)}
|
|
120
|
-
|
|
121
|
-
<AlertDialogFooter className="sm:justify-start">
|
|
122
|
-
<AlertDialogAction
|
|
123
|
-
onClick={handleConfirm}
|
|
124
|
-
disabled={!isDeleteEnabled}
|
|
125
|
-
className={cn(buttonVariants({ variant: "destructive" }), "disabled:opacity-50 disabled:cursor-not-allowed")}
|
|
126
|
-
>
|
|
127
|
-
{t('delete')}
|
|
128
|
-
</AlertDialogAction>
|
|
129
|
-
<AlertDialogCancel>{t('cancel')}</AlertDialogCancel>
|
|
130
|
-
</AlertDialogFooter>
|
|
131
|
-
</AlertDialogContent>
|
|
132
|
-
</AlertDialog>
|
|
133
|
-
);
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
export default ConfirmationDialog;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
// Backward-compatible re-export pointing to the unified ConfirmationDialog
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import ConfirmationDialog from './ConfirmationDialog';
|
|
4
|
-
|
|
5
|
-
export type DeleteConfirmationDialogProps = {
|
|
6
|
-
open: boolean;
|
|
7
|
-
onOpenChange: (open: boolean) => void;
|
|
8
|
-
onConfirm: () => void;
|
|
9
|
-
title: string;
|
|
10
|
-
description?: string;
|
|
11
|
-
itemName?: string;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
const DeleteConfirmationDialog: React.FC<DeleteConfirmationDialogProps> = (props) => (
|
|
15
|
-
<ConfirmationDialog variant="delete" {...props} />
|
|
16
|
-
);
|
|
17
|
-
|
|
18
|
-
export default DeleteConfirmationDialog;
|