@licklist/design 0.78.5-dev.107 → 0.78.5-dev.108
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/bitbucket-pipelines.yml +4 -13
- package/dist/Maintenance/Maintenance.scss.js +1 -1
- package/dist/index.js +2 -0
- package/dist/product-set/form/ProductsControl.d.ts +1 -2
- package/dist/product-set/form/ProductsControl.d.ts.map +1 -1
- package/dist/product-set/form/ProductsControl.js +24 -0
- 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 +2 -86
- 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 +11 -13
- 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/PeriodCard/PeriodCard.d.ts +66 -0
- package/dist/v2/components/PeriodCard/PeriodCard.d.ts.map +1 -0
- package/dist/v2/components/PeriodCard/PeriodCard.js +351 -0
- package/dist/v2/components/PeriodCard/PeriodCard.scss.js +6 -0
- package/dist/v2/components/PeriodCard/index.d.ts +3 -0
- package/dist/v2/components/PeriodCard/index.d.ts.map +1 -0
- package/dist/v2/components/ReorderRow/ReorderRow.d.ts +24 -0
- package/dist/v2/components/ReorderRow/ReorderRow.d.ts.map +1 -0
- package/dist/v2/components/ReorderRow/ReorderRow.js +109 -0
- package/dist/v2/components/ReorderRow/ReorderRow.scss.js +6 -0
- package/dist/v2/components/ReorderRow/index.d.ts +3 -0
- package/dist/v2/components/ReorderRow/index.d.ts.map +1 -0
- 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 +5 -8
- 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/components/index.d.ts +4 -0
- package/dist/v2/components/index.d.ts.map +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 +16 -1
- package/dist/v2/index.d.ts +8 -0
- 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 +5 -0
- package/dist/v2/pages/Settings/components/SidebarCustomisation.scss.js +1 -1
- package/dist/v2/pages/Settings/components/SidebarNavItem.js +5 -0
- package/dist/v2/pages/auth/AuthLayout/AuthLayout.scss.js +1 -1
- package/dist/v2/shadcn/components/ui/accordion.d.ts +8 -0
- package/dist/v2/shadcn/components/ui/accordion.d.ts.map +1 -0
- package/dist/v2/shadcn/components/ui/alert-dialog.d.ts +21 -0
- package/dist/v2/shadcn/components/ui/alert-dialog.d.ts.map +1 -0
- package/dist/v2/shadcn/components/ui/alert.d.ts +9 -0
- package/dist/v2/shadcn/components/ui/alert.d.ts.map +1 -0
- package/dist/v2/shadcn/components/ui/aspect-ratio.d.ts +4 -0
- package/dist/v2/shadcn/components/ui/aspect-ratio.d.ts.map +1 -0
- package/dist/v2/shadcn/components/ui/avatar.d.ts +7 -0
- package/dist/v2/shadcn/components/ui/avatar.d.ts.map +1 -0
- package/dist/v2/shadcn/components/ui/badge.d.ts +10 -0
- package/dist/v2/shadcn/components/ui/badge.d.ts.map +1 -0
- package/dist/v2/shadcn/components/ui/breadcrumb.d.ts +20 -0
- package/dist/v2/shadcn/components/ui/breadcrumb.d.ts.map +1 -0
- package/dist/v2/shadcn/components/ui/button.d.ts +14 -0
- package/dist/v2/shadcn/components/ui/button.d.ts.map +1 -0
- package/dist/v2/shadcn/components/ui/calendar.d.ts +9 -0
- package/dist/v2/shadcn/components/ui/calendar.d.ts.map +1 -0
- package/dist/v2/shadcn/components/ui/card.d.ts +9 -0
- package/dist/v2/shadcn/components/ui/card.d.ts.map +1 -0
- package/dist/v2/shadcn/components/ui/carousel.d.ts +19 -0
- package/dist/v2/shadcn/components/ui/carousel.d.ts.map +1 -0
- package/dist/v2/shadcn/components/ui/checkbox.d.ts +6 -0
- package/dist/v2/shadcn/components/ui/checkbox.d.ts.map +1 -0
- package/dist/v2/shadcn/components/ui/checkbox.js +115 -0
- package/dist/v2/shadcn/components/ui/checkbox.scss.js +6 -0
- package/dist/v2/shadcn/components/ui/collapsible.d.ts +6 -0
- package/dist/v2/shadcn/components/ui/collapsible.d.ts.map +1 -0
- package/dist/v2/shadcn/components/ui/command.d.ts +83 -0
- package/dist/v2/shadcn/components/ui/command.d.ts.map +1 -0
- package/dist/v2/shadcn/components/ui/context-menu.d.ts +28 -0
- package/dist/v2/shadcn/components/ui/context-menu.d.ts.map +1 -0
- package/dist/v2/shadcn/components/ui/dialog.d.ts +20 -0
- package/dist/v2/shadcn/components/ui/dialog.d.ts.map +1 -0
- package/dist/v2/shadcn/components/ui/dialog.js +169 -0
- package/dist/v2/shadcn/components/ui/drawer.d.ts +23 -0
- package/dist/v2/shadcn/components/ui/drawer.d.ts.map +1 -0
- package/dist/v2/shadcn/components/ui/dropdown-menu.d.ts +28 -0
- package/dist/v2/shadcn/components/ui/dropdown-menu.d.ts.map +1 -0
- package/dist/v2/shadcn/components/ui/form.d.ts +24 -0
- package/dist/v2/shadcn/components/ui/form.d.ts.map +1 -0
- package/dist/v2/shadcn/components/ui/hover-card.d.ts +7 -0
- package/dist/v2/shadcn/components/ui/hover-card.d.ts.map +1 -0
- package/dist/v2/shadcn/components/ui/input-otp.d.ts +35 -0
- package/dist/v2/shadcn/components/ui/input-otp.d.ts.map +1 -0
- package/dist/v2/shadcn/components/ui/input.d.ts +6 -0
- package/dist/v2/shadcn/components/ui/input.d.ts.map +1 -0
- package/dist/v2/shadcn/components/ui/label.d.ts +6 -0
- package/dist/v2/shadcn/components/ui/label.d.ts.map +1 -0
- package/dist/v2/shadcn/components/ui/menubar.d.ts +34 -0
- package/dist/v2/shadcn/components/ui/menubar.d.ts.map +1 -0
- package/dist/v2/shadcn/components/ui/navigation-menu.d.ts +13 -0
- package/dist/v2/shadcn/components/ui/navigation-menu.d.ts.map +1 -0
- package/dist/v2/shadcn/components/ui/pagination.d.ts +29 -0
- package/dist/v2/shadcn/components/ui/pagination.d.ts.map +1 -0
- package/dist/v2/shadcn/components/ui/popover.d.ts +7 -0
- package/dist/v2/shadcn/components/ui/popover.d.ts.map +1 -0
- package/dist/v2/shadcn/components/ui/progress.d.ts +5 -0
- package/dist/v2/shadcn/components/ui/progress.d.ts.map +1 -0
- package/dist/v2/shadcn/components/ui/radio-card.d.ts +12 -0
- package/dist/v2/shadcn/components/ui/radio-card.d.ts.map +1 -0
- package/dist/v2/shadcn/components/ui/radio-group.d.ts +6 -0
- package/dist/v2/shadcn/components/ui/radio-group.d.ts.map +1 -0
- package/dist/v2/shadcn/components/ui/scroll-area.d.ts +6 -0
- package/dist/v2/shadcn/components/ui/scroll-area.d.ts.map +1 -0
- package/dist/v2/shadcn/components/ui/select.d.ts +14 -0
- package/dist/v2/shadcn/components/ui/select.d.ts.map +1 -0
- package/dist/v2/shadcn/components/ui/separator.d.ts +5 -0
- package/dist/v2/shadcn/components/ui/separator.d.ts.map +1 -0
- package/dist/v2/shadcn/components/ui/sheet.d.ts +26 -0
- package/dist/v2/shadcn/components/ui/sheet.d.ts.map +1 -0
- package/dist/v2/shadcn/components/ui/sidebar.d.ts +67 -0
- package/dist/v2/shadcn/components/ui/sidebar.d.ts.map +1 -0
- package/dist/v2/shadcn/components/ui/skeleton.d.ts +3 -0
- package/dist/v2/shadcn/components/ui/skeleton.d.ts.map +1 -0
- package/dist/v2/shadcn/components/ui/slider.d.ts +5 -0
- package/dist/v2/shadcn/components/ui/slider.d.ts.map +1 -0
- package/dist/v2/shadcn/components/ui/switch.d.ts +6 -0
- package/dist/v2/shadcn/components/ui/switch.d.ts.map +1 -0
- package/dist/v2/shadcn/components/ui/switch.js +115 -0
- package/dist/v2/shadcn/components/ui/switch.scss.js +6 -0
- package/dist/v2/shadcn/components/ui/table-pagination.d.ts +11 -0
- package/dist/v2/shadcn/components/ui/table-pagination.d.ts.map +1 -0
- package/dist/v2/shadcn/components/ui/table.d.ts +11 -0
- package/dist/v2/shadcn/components/ui/table.d.ts.map +1 -0
- package/dist/v2/shadcn/components/ui/tabs.d.ts +8 -0
- package/dist/v2/shadcn/components/ui/tabs.d.ts.map +1 -0
- package/dist/v2/shadcn/components/ui/textarea.d.ts +6 -0
- package/dist/v2/shadcn/components/ui/textarea.d.ts.map +1 -0
- package/dist/v2/shadcn/components/ui/toast.d.ts +16 -0
- package/dist/v2/shadcn/components/ui/toast.d.ts.map +1 -0
- package/dist/v2/shadcn/components/ui/toaster.d.ts +2 -0
- package/dist/v2/shadcn/components/ui/toaster.d.ts.map +1 -0
- package/dist/v2/shadcn/components/ui/toggle-group.d.ts +13 -0
- package/dist/v2/shadcn/components/ui/toggle-group.d.ts.map +1 -0
- package/dist/v2/shadcn/components/ui/toggle.d.ts +13 -0
- package/dist/v2/shadcn/components/ui/toggle.d.ts.map +1 -0
- package/dist/v2/shadcn/components/ui/tooltip.d.ts +8 -0
- package/dist/v2/shadcn/components/ui/tooltip.d.ts.map +1 -0
- package/dist/v2/shadcn/components/ui/use-toast.d.ts +3 -0
- package/dist/v2/shadcn/components/ui/use-toast.d.ts.map +1 -0
- package/dist/v2/shadcn/hooks/use-mobile.d.ts +2 -0
- package/dist/v2/shadcn/hooks/use-mobile.d.ts.map +1 -0
- package/dist/v2/shadcn/hooks/use-toast.d.ts +45 -0
- package/dist/v2/shadcn/hooks/use-toast.d.ts.map +1 -0
- package/dist/v2/shadcn/index.d.ts +20 -0
- package/dist/v2/shadcn/index.d.ts.map +1 -0
- package/dist/v2/shadcn/lib/utils.d.ts +3 -0
- package/dist/v2/shadcn/lib/utils.d.ts.map +1 -0
- package/dist/v2/shadcn/lib/utils.js +11 -0
- package/dist/v2/shadcn/styles/globals.css +112 -0
- package/dist/v2/styles/form/NewInput.scss.js +1 -1
- package/package.json +6 -6
- package/rollup.config.js +2 -16
- package/src/iframe/payment/payment-status-page/PaymentStatusPage.tsx +1 -1
- package/src/product-set/form/ProductsControl.tsx +1 -2
- package/src/v2/components/DataTable/DataTable.tsx +1 -23
- package/src/v2/components/Modal/DeleteModal.tsx +20 -12
- package/src/v2/components/PeriodCard/PeriodCard.scss +157 -0
- package/src/v2/components/PeriodCard/PeriodCard.stories.tsx +245 -0
- package/src/v2/components/PeriodCard/PeriodCard.tsx +350 -0
- package/src/v2/components/PeriodCard/index.ts +8 -0
- package/src/v2/components/ReorderRow/ReorderRow.scss +68 -0
- package/src/v2/components/ReorderRow/ReorderRow.stories.tsx +124 -0
- package/src/v2/components/ReorderRow/ReorderRow.tsx +88 -0
- package/src/v2/components/ReorderRow/index.ts +2 -0
- package/src/v2/components/Toggle/Toggle.tsx +5 -6
- package/src/v2/components/index.ts +6 -0
- package/src/v2/index.ts +82 -0
- package/src/v2/shadcn/_reference/AccountManagerCard.tsx +45 -0
- package/src/v2/shadcn/_reference/AffiliatesTable.tsx +178 -0
- package/src/v2/shadcn/_reference/AuditArchive.tsx +165 -0
- package/src/v2/shadcn/_reference/AuditContent.tsx +270 -0
- package/src/v2/shadcn/_reference/AutomationsGeneralSettings.tsx +251 -0
- package/src/v2/shadcn/_reference/AvatarUpload.tsx +150 -0
- package/src/v2/shadcn/_reference/BookingsSummaryCard.tsx +268 -0
- package/src/v2/shadcn/_reference/CodeCleanUpAudit.tsx +274 -0
- package/src/v2/shadcn/_reference/CompaniesTable.tsx +387 -0
- package/src/v2/shadcn/_reference/ComponentAudit.tsx +239 -0
- package/src/v2/shadcn/_reference/ConfigureSettingsCard.tsx +95 -0
- package/src/v2/shadcn/_reference/CustomerCard.tsx +155 -0
- package/src/v2/shadcn/_reference/DashboardCards.tsx +50 -0
- package/src/v2/shadcn/_reference/DashboardFooter.tsx +18 -0
- package/src/v2/shadcn/_reference/DiarySettings.tsx +187 -0
- package/src/v2/shadcn/_reference/DiaryView.tsx +998 -0
- package/src/v2/shadcn/_reference/EmptyState.tsx +76 -0
- package/src/v2/shadcn/_reference/EntityInfoCard.tsx +48 -0
- package/src/v2/shadcn/_reference/ExistingUserAssignments.tsx +131 -0
- package/src/v2/shadcn/_reference/FeatureToggle.tsx +72 -0
- package/src/v2/shadcn/_reference/FlowCard.tsx +170 -0
- package/src/v2/shadcn/_reference/FlowsContent.tsx +688 -0
- package/src/v2/shadcn/_reference/FlowsGeneralSettings.tsx +27 -0
- package/src/v2/shadcn/_reference/GeneralSettings.tsx +33 -0
- package/src/v2/shadcn/_reference/InventoryGeneralSettings.tsx +82 -0
- package/src/v2/shadcn/_reference/LanguageSelector.tsx +97 -0
- package/src/v2/shadcn/_reference/LoadingScreen.tsx +25 -0
- package/src/v2/shadcn/_reference/LoadingSpinner.tsx +41 -0
- package/src/v2/shadcn/_reference/ManagedClientsList.tsx +121 -0
- package/src/v2/shadcn/_reference/NPSScore.tsx +379 -0
- package/src/v2/shadcn/_reference/NPSSummaryCard.tsx +181 -0
- package/src/v2/shadcn/_reference/NotificationBanner.tsx +129 -0
- package/src/v2/shadcn/_reference/NotificationPanel.tsx +208 -0
- package/src/v2/shadcn/_reference/OnlineUsersCard.tsx +73 -0
- package/src/v2/shadcn/_reference/ProtectedRoute.tsx +39 -0
- package/src/v2/shadcn/_reference/ProvidersTable.tsx +353 -0
- package/src/v2/shadcn/_reference/QuickAddPanel.tsx +1057 -0
- package/src/v2/shadcn/_reference/QuickFilters.tsx +112 -0
- package/src/v2/shadcn/_reference/ScheduleView.tsx +410 -0
- package/src/v2/shadcn/_reference/ScrollToTop.tsx +14 -0
- package/src/v2/shadcn/_reference/SecondaryNav.tsx +50 -0
- package/src/v2/shadcn/_reference/SecuritySettings.tsx +258 -0
- package/src/v2/shadcn/_reference/SessionDetailView.tsx +294 -0
- package/src/v2/shadcn/_reference/Sidebar.tsx +14 -0
- package/src/v2/shadcn/_reference/SidebarAwareLayout.tsx +30 -0
- package/src/v2/shadcn/_reference/SidebarLabelCustomization.tsx +285 -0
- package/src/v2/shadcn/_reference/SimulationBanner.tsx +57 -0
- package/src/v2/shadcn/_reference/SortControls.tsx +65 -0
- package/src/v2/shadcn/_reference/StatusBadge.tsx +49 -0
- package/src/v2/shadcn/_reference/StyleGuideContent.tsx +331 -0
- package/src/v2/shadcn/_reference/TableActionMenu.tsx +126 -0
- package/src/v2/shadcn/_reference/ThemeProvider.tsx +119 -0
- package/src/v2/shadcn/_reference/ThemeSettings.tsx +73 -0
- package/src/v2/shadcn/_reference/TopNavigation.tsx +332 -0
- package/src/v2/shadcn/_reference/UserActivityHistory.tsx +209 -0
- package/src/v2/shadcn/_reference/UserLanguageSettings.tsx +94 -0
- package/src/v2/shadcn/_reference/UserPanel.tsx +472 -0
- package/src/v2/shadcn/_reference/UsersTable.tsx +1023 -0
- package/src/v2/shadcn/_reference/WaiverForm.tsx +301 -0
- package/src/v2/shadcn/_reference/WaiversGeneralSettings.tsx +46 -0
- package/src/v2/shadcn/_reference/WaiversTable.tsx +290 -0
- package/src/v2/shadcn/_reference/WaiversTemplatesSettings.tsx +416 -0
- package/src/v2/shadcn/_reference/ai/AIChatPanel.tsx +313 -0
- package/src/v2/shadcn/_reference/ai/AIChatSearchBar.tsx +36 -0
- package/src/v2/shadcn/_reference/ai/ChatInteractiveBlock.tsx +298 -0
- package/src/v2/shadcn/_reference/ai/ChatMessageContent.tsx +40 -0
- package/src/v2/shadcn/_reference/ai/parseInteractiveBlocks.ts +142 -0
- package/src/v2/shadcn/_reference/auth/AuthLayout.tsx +55 -0
- package/src/v2/shadcn/_reference/auth/CreatePasswordForm.tsx +285 -0
- package/src/v2/shadcn/_reference/auth/CreatePasswordPanel.tsx +20 -0
- package/src/v2/shadcn/_reference/auth/LoginFooter.tsx +14 -0
- package/src/v2/shadcn/_reference/auth/LoginForm.tsx +205 -0
- package/src/v2/shadcn/_reference/auth/LoginPanel.tsx +41 -0
- package/src/v2/shadcn/_reference/auth/ResetPasswordForm.tsx +102 -0
- package/src/v2/shadcn/_reference/auth/ResetPasswordPanel.tsx +20 -0
- package/src/v2/shadcn/_reference/auth/VerifyEmailForm.tsx +95 -0
- package/src/v2/shadcn/_reference/auth/VerifyEmailPanel.tsx +20 -0
- package/src/v2/shadcn/_reference/email/EmailAttachment.tsx +119 -0
- package/src/v2/shadcn/_reference/email/EmailAutomation.tsx +92 -0
- package/src/v2/shadcn/_reference/email/EmailPlaceholders.tsx +64 -0
- package/src/v2/shadcn/_reference/email/UnlayerEmailEditor.tsx +41 -0
- package/src/v2/shadcn/_reference/email/emailTemplateData.ts +53 -0
- package/src/v2/shadcn/_reference/emptyStateIcons.tsx +103 -0
- package/src/v2/shadcn/_reference/games/MazeGame.tsx +394 -0
- package/src/v2/shadcn/_reference/games/RunnerGame.tsx +497 -0
- package/src/v2/shadcn/_reference/logos/BookedLogoFull.tsx +36 -0
- package/src/v2/shadcn/_reference/logos/BookedLogoMark.tsx +31 -0
- package/src/v2/shadcn/_reference/logos/BookedLogoNew.tsx +36 -0
- package/src/v2/shadcn/_reference/pricing/DynamicPricingRulesEditor.tsx +401 -0
- package/src/v2/shadcn/_reference/pricing/DynamicPricingTierCard.tsx +77 -0
- package/src/v2/shadcn/_reference/pricing/DynamicPricingTiersList.tsx +218 -0
- package/src/v2/shadcn/_reference/pricing/PricingCalendar.tsx +810 -0
- package/src/v2/shadcn/_reference/pricing/PricingPeriodCard.tsx +152 -0
- package/src/v2/shadcn/_reference/pricing/PricingPeriodForm.tsx +377 -0
- package/src/v2/shadcn/_reference/pricing/PricingPeriodsList.tsx +213 -0
- package/src/v2/shadcn/_reference/pricing/getRuleSummary.ts +39 -0
- package/src/v2/shadcn/_reference/products/AvailabilityRulesSection.tsx +184 -0
- package/src/v2/shadcn/_reference/products/AvailabilitySection.tsx +677 -0
- package/src/v2/shadcn/_reference/products/BookingTypeConfigOptions.tsx +40 -0
- package/src/v2/shadcn/_reference/products/CapacityPeriodsSection.tsx +238 -0
- package/src/v2/shadcn/_reference/products/DynamicPricingTiersSection.tsx +131 -0
- package/src/v2/shadcn/_reference/products/GiftCardOrdersTab.tsx +192 -0
- package/src/v2/shadcn/_reference/products/GiftCardSettings.tsx +342 -0
- package/src/v2/shadcn/_reference/products/PackageProductsSection.tsx +322 -0
- package/src/v2/shadcn/_reference/products/PricingSection.tsx +173 -0
- package/src/v2/shadcn/_reference/products/ProductTypeFields.tsx +353 -0
- package/src/v2/shadcn/_reference/products/ProductTypeIcon.tsx +95 -0
- package/src/v2/shadcn/_reference/products/VariablePricingSection.tsx +140 -0
- package/src/v2/shadcn/_reference/products/productTypeConfig.ts +182 -0
- package/src/v2/shadcn/_reference/shared/BackButton.tsx +50 -0
- package/src/v2/shadcn/_reference/shared/CancelConfirmationDialog.tsx +18 -0
- package/src/v2/shadcn/_reference/shared/ConfirmationDialog.tsx +136 -0
- package/src/v2/shadcn/_reference/shared/DeleteConfirmationDialog.tsx +18 -0
- package/src/v2/shadcn/_reference/shared/DeleteEntityPage.tsx +221 -0
- package/src/v2/shadcn/_reference/shared/SidebarIcons.tsx +108 -0
- package/src/v2/shadcn/_reference/shared/UnifiedSidebar.tsx +722 -0
- package/src/v2/shadcn/_reference/tables/BulkActionsBar.tsx +68 -0
- package/src/v2/shadcn/_reference/tables/DataTable.tsx +221 -0
- package/src/v2/shadcn/_reference/tables/TableControls.tsx +94 -0
- package/src/v2/shadcn/_reference/tables/index.ts +3 -0
- package/src/v2/shadcn/_reference/tables/types.ts +79 -0
- package/src/v2/shadcn/_reference/zones/LegacyZoneSettings.tsx +299 -0
- package/src/v2/shadcn/components/ui/accordion.stories.tsx +63 -0
- package/src/v2/shadcn/components/ui/accordion.tsx +52 -0
- package/src/v2/shadcn/components/ui/alert-dialog.stories.tsx +44 -0
- package/src/v2/shadcn/components/ui/alert-dialog.tsx +104 -0
- package/src/v2/shadcn/components/ui/alert.stories.tsx +44 -0
- package/src/v2/shadcn/components/ui/alert.tsx +43 -0
- package/src/v2/shadcn/components/ui/aspect-ratio.stories.tsx +46 -0
- package/src/v2/shadcn/components/ui/aspect-ratio.tsx +5 -0
- package/src/v2/shadcn/components/ui/avatar.stories.tsx +39 -0
- package/src/v2/shadcn/components/ui/avatar.tsx +38 -0
- package/src/v2/shadcn/components/ui/badge.stories.tsx +17 -0
- package/src/v2/shadcn/components/ui/badge.tsx +30 -0
- package/src/v2/shadcn/components/ui/breadcrumb.stories.tsx +91 -0
- package/src/v2/shadcn/components/ui/breadcrumb.tsx +90 -0
- package/src/v2/shadcn/components/ui/button.stories.tsx +20 -0
- package/src/v2/shadcn/components/ui/button.tsx +60 -0
- package/src/v2/shadcn/components/ui/calendar.stories.tsx +61 -0
- package/src/v2/shadcn/components/ui/calendar.tsx +54 -0
- package/src/v2/shadcn/components/ui/card.stories.tsx +37 -0
- package/src/v2/shadcn/components/ui/card.tsx +43 -0
- package/src/v2/shadcn/components/ui/carousel.stories.tsx +92 -0
- package/src/v2/shadcn/components/ui/carousel.tsx +224 -0
- package/src/v2/shadcn/components/ui/checkbox.scss +38 -0
- package/src/v2/shadcn/components/ui/checkbox.stories.tsx +23 -0
- package/src/v2/shadcn/components/ui/checkbox.tsx +24 -0
- package/src/v2/shadcn/components/ui/collapsible.stories.tsx +59 -0
- package/src/v2/shadcn/components/ui/collapsible.tsx +9 -0
- package/src/v2/shadcn/components/ui/command.stories.tsx +70 -0
- package/src/v2/shadcn/components/ui/command.tsx +132 -0
- package/src/v2/shadcn/components/ui/context-menu.stories.tsx +72 -0
- package/src/v2/shadcn/components/ui/context-menu.tsx +178 -0
- package/src/v2/shadcn/components/ui/dialog.stories.tsx +67 -0
- package/src/v2/shadcn/components/ui/dialog.tsx +95 -0
- package/src/v2/shadcn/components/ui/drawer.stories.tsx +50 -0
- package/src/v2/shadcn/components/ui/drawer.tsx +87 -0
- package/src/v2/shadcn/components/ui/dropdown-menu.stories.tsx +73 -0
- package/src/v2/shadcn/components/ui/dropdown-menu.tsx +179 -0
- package/src/v2/shadcn/components/ui/form.stories.tsx +105 -0
- package/src/v2/shadcn/components/ui/form.tsx +129 -0
- package/src/v2/shadcn/components/ui/hover-card.stories.tsx +35 -0
- package/src/v2/shadcn/components/ui/hover-card.tsx +27 -0
- package/src/v2/shadcn/components/ui/input-otp.stories.tsx +72 -0
- package/src/v2/shadcn/components/ui/input-otp.tsx +61 -0
- package/src/v2/shadcn/components/ui/input.stories.tsx +16 -0
- package/src/v2/shadcn/components/ui/input.tsx +25 -0
- package/src/v2/shadcn/components/ui/label.stories.tsx +13 -0
- package/src/v2/shadcn/components/ui/label.tsx +17 -0
- package/src/v2/shadcn/components/ui/menubar.stories.tsx +86 -0
- package/src/v2/shadcn/components/ui/menubar.tsx +207 -0
- package/src/v2/shadcn/components/ui/navigation-menu.stories.tsx +68 -0
- package/src/v2/shadcn/components/ui/navigation-menu.tsx +120 -0
- package/src/v2/shadcn/components/ui/pagination.stories.tsx +78 -0
- package/src/v2/shadcn/components/ui/pagination.tsx +81 -0
- package/src/v2/shadcn/components/ui/popover.stories.tsx +44 -0
- package/src/v2/shadcn/components/ui/popover.tsx +29 -0
- package/src/v2/shadcn/components/ui/progress.stories.tsx +17 -0
- package/src/v2/shadcn/components/ui/progress.tsx +23 -0
- package/src/v2/shadcn/components/ui/radio-card.stories.tsx +68 -0
- package/src/v2/shadcn/components/ui/radio-card.tsx +52 -0
- package/src/v2/shadcn/components/ui/radio-group.stories.tsx +77 -0
- package/src/v2/shadcn/components/ui/radio-group.tsx +35 -0
- package/src/v2/shadcn/components/ui/scroll-area.stories.tsx +56 -0
- package/src/v2/shadcn/components/ui/scroll-area.tsx +38 -0
- package/src/v2/shadcn/components/ui/select.stories.tsx +60 -0
- package/src/v2/shadcn/components/ui/select.tsx +148 -0
- package/src/v2/shadcn/components/ui/separator.stories.tsx +30 -0
- package/src/v2/shadcn/components/ui/separator.tsx +20 -0
- package/src/v2/shadcn/components/ui/sheet.stories.tsx +115 -0
- package/src/v2/shadcn/components/ui/sheet.tsx +107 -0
- package/src/v2/shadcn/components/ui/sidebar.stories.tsx +167 -0
- package/src/v2/shadcn/components/ui/sidebar.tsx +637 -0
- package/src/v2/shadcn/components/ui/skeleton.stories.tsx +36 -0
- package/src/v2/shadcn/components/ui/skeleton.tsx +7 -0
- package/src/v2/shadcn/components/ui/slider.stories.tsx +16 -0
- package/src/v2/shadcn/components/ui/slider.tsx +23 -0
- package/src/v2/shadcn/components/ui/switch.scss +63 -0
- package/src/v2/shadcn/components/ui/switch.stories.tsx +23 -0
- package/src/v2/shadcn/components/ui/switch.tsx +24 -0
- package/src/v2/shadcn/components/ui/table-pagination.stories.tsx +81 -0
- package/src/v2/shadcn/components/ui/table-pagination.tsx +61 -0
- package/src/v2/shadcn/components/ui/table.stories.tsx +40 -0
- package/src/v2/shadcn/components/ui/table.tsx +72 -0
- package/src/v2/shadcn/components/ui/tabs.stories.tsx +85 -0
- package/src/v2/shadcn/components/ui/tabs.tsx +53 -0
- package/src/v2/shadcn/components/ui/textarea.stories.tsx +15 -0
- package/src/v2/shadcn/components/ui/textarea.tsx +21 -0
- package/src/v2/shadcn/components/ui/toast.stories.tsx +77 -0
- package/src/v2/shadcn/components/ui/toast.tsx +111 -0
- package/src/v2/shadcn/components/ui/toaster.stories.tsx +46 -0
- package/src/v2/shadcn/components/ui/toaster.tsx +24 -0
- package/src/v2/shadcn/components/ui/toggle-group.stories.tsx +95 -0
- package/src/v2/shadcn/components/ui/toggle-group.tsx +49 -0
- package/src/v2/shadcn/components/ui/toggle.stories.tsx +18 -0
- package/src/v2/shadcn/components/ui/toggle.tsx +37 -0
- package/src/v2/shadcn/components/ui/tooltip.stories.tsx +57 -0
- package/src/v2/shadcn/components/ui/tooltip.tsx +28 -0
- package/src/v2/shadcn/components/ui/use-toast.ts +3 -0
- package/src/v2/shadcn/hooks/use-mobile.tsx +19 -0
- package/src/v2/shadcn/hooks/use-toast.ts +184 -0
- package/src/v2/shadcn/index.ts +76 -0
- package/src/v2/shadcn/lib/utils.ts +6 -0
- package/src/v2/shadcn/styles/globals.css +112 -0
- package/.vscode/settings.json +0 -3
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
import React, { useState } from 'react'
|
|
2
|
+
import { Meta, StoryObj } from '@storybook/react'
|
|
3
|
+
import { PeriodCard, PeriodCardSection, PeriodCardTimeRange } from './PeriodCard'
|
|
4
|
+
import { NewInput } from '../NewInput'
|
|
5
|
+
import { IconButton } from '../IconButton'
|
|
6
|
+
import type { PeriodCardValue } from './PeriodCard'
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
title: 'v2/Components/PeriodCard',
|
|
10
|
+
component: PeriodCard,
|
|
11
|
+
parameters: {
|
|
12
|
+
layout: 'padded',
|
|
13
|
+
},
|
|
14
|
+
} as Meta<typeof PeriodCard>
|
|
15
|
+
|
|
16
|
+
type Story = StoryObj<typeof PeriodCard>
|
|
17
|
+
|
|
18
|
+
const defaultValue: PeriodCardValue = {
|
|
19
|
+
days: [],
|
|
20
|
+
is24Hours: true,
|
|
21
|
+
maxCapacity: 1,
|
|
22
|
+
minCapacity: null,
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export const Default: Story = {
|
|
26
|
+
args: {
|
|
27
|
+
value: defaultValue,
|
|
28
|
+
onChange: () => {},
|
|
29
|
+
onDelete: () => alert('Delete period'),
|
|
30
|
+
},
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export const WithDaysSelected: Story = {
|
|
34
|
+
args: {
|
|
35
|
+
value: {
|
|
36
|
+
days: ['Monday', 'Wednesday', 'Friday'],
|
|
37
|
+
is24Hours: true,
|
|
38
|
+
maxCapacity: 5,
|
|
39
|
+
minCapacity: 2,
|
|
40
|
+
},
|
|
41
|
+
onChange: () => {},
|
|
42
|
+
onDelete: () => alert('Delete period'),
|
|
43
|
+
},
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export const WithCustomTime: Story = {
|
|
47
|
+
args: {
|
|
48
|
+
value: {
|
|
49
|
+
days: ['Saturday', 'Sunday'],
|
|
50
|
+
is24Hours: false,
|
|
51
|
+
startTime: '10:00',
|
|
52
|
+
endTime: '18:00',
|
|
53
|
+
maxCapacity: 10,
|
|
54
|
+
minCapacity: null,
|
|
55
|
+
},
|
|
56
|
+
onChange: () => {},
|
|
57
|
+
onDelete: () => alert('Delete period'),
|
|
58
|
+
},
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export const WithoutDelete: Story = {
|
|
62
|
+
args: {
|
|
63
|
+
value: defaultValue,
|
|
64
|
+
onChange: () => {},
|
|
65
|
+
},
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export const DaysAndTimeOnly: Story = {
|
|
69
|
+
args: {
|
|
70
|
+
value: {
|
|
71
|
+
days: ['Monday', 'Tuesday'],
|
|
72
|
+
is24Hours: false,
|
|
73
|
+
startTime: '08:00',
|
|
74
|
+
endTime: '16:00',
|
|
75
|
+
maxCapacity: 1,
|
|
76
|
+
minCapacity: null,
|
|
77
|
+
},
|
|
78
|
+
onChange: () => {},
|
|
79
|
+
onDelete: () => alert('Delete'),
|
|
80
|
+
hideCapacity: true,
|
|
81
|
+
labels: {
|
|
82
|
+
badge: 'Availability',
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export const CapacityOnly: Story = {
|
|
88
|
+
args: {
|
|
89
|
+
value: {
|
|
90
|
+
days: [],
|
|
91
|
+
is24Hours: true,
|
|
92
|
+
maxCapacity: 20,
|
|
93
|
+
minCapacity: 5,
|
|
94
|
+
},
|
|
95
|
+
onChange: () => {},
|
|
96
|
+
onDelete: () => alert('Delete'),
|
|
97
|
+
hideDays: true,
|
|
98
|
+
hideTime: true,
|
|
99
|
+
labels: {
|
|
100
|
+
badge: 'Capacity Limit',
|
|
101
|
+
sectionTitle: 'Capacity Range',
|
|
102
|
+
minValue: 'Min Capacity',
|
|
103
|
+
maxValue: 'Max Capacity',
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export const CustomLabels: Story = {
|
|
109
|
+
args: {
|
|
110
|
+
value: {
|
|
111
|
+
days: ['Monday', 'Tuesday'],
|
|
112
|
+
is24Hours: true,
|
|
113
|
+
maxCapacity: 3,
|
|
114
|
+
minCapacity: 1,
|
|
115
|
+
},
|
|
116
|
+
onChange: () => {},
|
|
117
|
+
onDelete: () => alert('Delete'),
|
|
118
|
+
labels: {
|
|
119
|
+
badge: 'Capacity Period',
|
|
120
|
+
sectionTitle: 'Capacity Override',
|
|
121
|
+
minValue: 'Min Capacity',
|
|
122
|
+
maxValue: 'Max Capacity',
|
|
123
|
+
days: 'Available Days',
|
|
124
|
+
time: 'Time Settings',
|
|
125
|
+
alignToggle: 'Use venue opening hours',
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
const InteractiveTemplate = () => {
|
|
131
|
+
const [periods, setPeriods] = useState<PeriodCardValue[]>([
|
|
132
|
+
{ days: [], is24Hours: true, maxCapacity: 1, minCapacity: null },
|
|
133
|
+
])
|
|
134
|
+
|
|
135
|
+
const addPeriod = () => {
|
|
136
|
+
setPeriods([
|
|
137
|
+
...periods,
|
|
138
|
+
{ days: [], is24Hours: true, maxCapacity: 1, minCapacity: null },
|
|
139
|
+
])
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
const removePeriod = (index: number) => {
|
|
143
|
+
setPeriods(periods.filter((_, i) => i !== index))
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
const updatePeriod = (index: number, updated: PeriodCardValue) => {
|
|
147
|
+
setPeriods(periods.map((p, i) => (i === index ? updated : p)))
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
return (
|
|
151
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '12px', maxWidth: 600 }}>
|
|
152
|
+
{periods.map((period, index) => (
|
|
153
|
+
<PeriodCard
|
|
154
|
+
key={index}
|
|
155
|
+
value={period}
|
|
156
|
+
onChange={(updated) => updatePeriod(index, updated)}
|
|
157
|
+
onDelete={() => removePeriod(index)}
|
|
158
|
+
labels={{
|
|
159
|
+
badge: 'Capacity Period',
|
|
160
|
+
sectionTitle: 'Capacity Override',
|
|
161
|
+
minValue: 'Min Capacity',
|
|
162
|
+
maxValue: 'Max Capacity',
|
|
163
|
+
}}
|
|
164
|
+
/>
|
|
165
|
+
))}
|
|
166
|
+
<button
|
|
167
|
+
type="button"
|
|
168
|
+
onClick={addPeriod}
|
|
169
|
+
style={{
|
|
170
|
+
padding: '8px 16px',
|
|
171
|
+
border: '1px dashed #ccc',
|
|
172
|
+
borderRadius: 8,
|
|
173
|
+
background: 'none',
|
|
174
|
+
cursor: 'pointer',
|
|
175
|
+
}}
|
|
176
|
+
>
|
|
177
|
+
+ Add Period
|
|
178
|
+
</button>
|
|
179
|
+
</div>
|
|
180
|
+
)
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
export const Interactive: Story = {
|
|
184
|
+
render: () => <InteractiveTemplate />,
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
// ── Session Period (children mode) ──
|
|
188
|
+
|
|
189
|
+
const SessionPeriodTemplate = () => {
|
|
190
|
+
const [periods, setPeriods] = useState([
|
|
191
|
+
{ interval: 15, startTime: '09:00', endTime: '17:00' },
|
|
192
|
+
])
|
|
193
|
+
|
|
194
|
+
const addPeriod = () => {
|
|
195
|
+
setPeriods([...periods, { interval: 15, startTime: '09:00', endTime: '17:00' }])
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
const removePeriod = (index: number) => {
|
|
199
|
+
setPeriods(periods.filter((_, i) => i !== index))
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
const updatePeriod = (index: number, updates: Partial<typeof periods[0]>) => {
|
|
203
|
+
setPeriods(periods.map((p, i) => (i === index ? { ...p, ...updates } : p)))
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
return (
|
|
207
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '12px', maxWidth: 600 }}>
|
|
208
|
+
{periods.map((period, index) => (
|
|
209
|
+
<PeriodCard
|
|
210
|
+
key={index}
|
|
211
|
+
title={`Period ${index + 1}`}
|
|
212
|
+
onDelete={periods.length > 1 ? () => removePeriod(index) : undefined}
|
|
213
|
+
>
|
|
214
|
+
<PeriodCardSection label="Sessions every">
|
|
215
|
+
<div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>
|
|
216
|
+
<NewInput
|
|
217
|
+
type="number"
|
|
218
|
+
min={1}
|
|
219
|
+
value={period.interval}
|
|
220
|
+
onChange={(e) =>
|
|
221
|
+
updatePeriod(index, {
|
|
222
|
+
interval: parseInt((e.target as HTMLInputElement).value) || 0,
|
|
223
|
+
})
|
|
224
|
+
}
|
|
225
|
+
style={{ width: 80 }}
|
|
226
|
+
/>
|
|
227
|
+
<span style={{ fontSize: 14, color: '#6b7a99' }}>minutes</span>
|
|
228
|
+
</div>
|
|
229
|
+
</PeriodCardSection>
|
|
230
|
+
<PeriodCardTimeRange
|
|
231
|
+
startTime={period.startTime}
|
|
232
|
+
endTime={period.endTime}
|
|
233
|
+
onStartTimeChange={(v) => updatePeriod(index, { startTime: v })}
|
|
234
|
+
onEndTimeChange={(v) => updatePeriod(index, { endTime: v })}
|
|
235
|
+
/>
|
|
236
|
+
</PeriodCard>
|
|
237
|
+
))}
|
|
238
|
+
<IconButton label="Add Time Period" icon="add" onClick={addPeriod} />
|
|
239
|
+
</div>
|
|
240
|
+
)
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
export const SessionPeriod: Story = {
|
|
244
|
+
render: () => <SessionPeriodTemplate />,
|
|
245
|
+
}
|
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { NewInput } from '../NewInput'
|
|
3
|
+
import { Checkbox } from '../Checkbox'
|
|
4
|
+
import { IconButton } from '../IconButton'
|
|
5
|
+
import { ClockIcon } from '../../icons'
|
|
6
|
+
import './PeriodCard.scss'
|
|
7
|
+
|
|
8
|
+
export interface PeriodCardValue {
|
|
9
|
+
days: string[]
|
|
10
|
+
is24Hours: boolean
|
|
11
|
+
startTime?: string
|
|
12
|
+
endTime?: string
|
|
13
|
+
maxCapacity: number
|
|
14
|
+
minCapacity: number | null
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface PeriodCardLabels {
|
|
18
|
+
badge?: string
|
|
19
|
+
sectionTitle?: string
|
|
20
|
+
minValue?: string
|
|
21
|
+
maxValue?: string
|
|
22
|
+
days?: string
|
|
23
|
+
time?: string
|
|
24
|
+
alignToggle?: string
|
|
25
|
+
startTime?: string
|
|
26
|
+
endTime?: string
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const DEFAULT_LABELS: Required<PeriodCardLabels> = {
|
|
30
|
+
badge: 'Period',
|
|
31
|
+
sectionTitle: 'Override',
|
|
32
|
+
minValue: 'Min',
|
|
33
|
+
maxValue: 'Max',
|
|
34
|
+
days: 'Days',
|
|
35
|
+
time: 'Time',
|
|
36
|
+
alignToggle: 'Align with Opening Hours',
|
|
37
|
+
startTime: 'Start Time',
|
|
38
|
+
endTime: 'End Time',
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const DAY_OPTIONS = [
|
|
42
|
+
'Monday',
|
|
43
|
+
'Tuesday',
|
|
44
|
+
'Wednesday',
|
|
45
|
+
'Thursday',
|
|
46
|
+
'Friday',
|
|
47
|
+
'Saturday',
|
|
48
|
+
'Sunday',
|
|
49
|
+
]
|
|
50
|
+
|
|
51
|
+
export interface PeriodCardProps {
|
|
52
|
+
/** Controlled value for built-in sections. Not needed when using children. */
|
|
53
|
+
value?: PeriodCardValue
|
|
54
|
+
/** Called when built-in sections change. Not needed when using children. */
|
|
55
|
+
onChange?: (value: PeriodCardValue) => void
|
|
56
|
+
onDelete?: () => void
|
|
57
|
+
labels?: PeriodCardLabels
|
|
58
|
+
dayLabels?: string[]
|
|
59
|
+
/** Plain text title rendered at the top (e.g. "Period 1"). Mutually exclusive with badge header. */
|
|
60
|
+
title?: string
|
|
61
|
+
/** Hide the badge + delete header row (useful with title) */
|
|
62
|
+
hideHeader?: boolean
|
|
63
|
+
/** Hide the min/max capacity section */
|
|
64
|
+
hideCapacity?: boolean
|
|
65
|
+
/** Hide the days selection section */
|
|
66
|
+
hideDays?: boolean
|
|
67
|
+
/** Hide the time section */
|
|
68
|
+
hideTime?: boolean
|
|
69
|
+
/** Make the min value field optional (shows "(optional)" label) */
|
|
70
|
+
minOptional?: boolean
|
|
71
|
+
/** Custom icon for the badge. Defaults to ClockIcon */
|
|
72
|
+
badgeIcon?: React.ReactNode
|
|
73
|
+
/** Custom content. When provided, built-in sections (capacity, days, time) are not rendered. */
|
|
74
|
+
children?: React.ReactNode
|
|
75
|
+
className?: string
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export const PeriodCard: React.FC<PeriodCardProps> = ({
|
|
79
|
+
value,
|
|
80
|
+
onChange,
|
|
81
|
+
onDelete,
|
|
82
|
+
labels: labelsProp,
|
|
83
|
+
dayLabels,
|
|
84
|
+
title,
|
|
85
|
+
hideHeader = false,
|
|
86
|
+
hideCapacity = false,
|
|
87
|
+
hideDays = false,
|
|
88
|
+
hideTime = false,
|
|
89
|
+
minOptional = true,
|
|
90
|
+
badgeIcon,
|
|
91
|
+
children,
|
|
92
|
+
className = '',
|
|
93
|
+
}) => {
|
|
94
|
+
const labels = { ...DEFAULT_LABELS, ...labelsProp }
|
|
95
|
+
const days = dayLabels || DAY_OPTIONS
|
|
96
|
+
const hasChildren = !!children
|
|
97
|
+
|
|
98
|
+
const updateField = (updates: Partial<PeriodCardValue>) => {
|
|
99
|
+
if (value && onChange) {
|
|
100
|
+
onChange({ ...value, ...updates })
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
const toggleDay = (day: string) => {
|
|
105
|
+
if (!value) return
|
|
106
|
+
const current = value.days || []
|
|
107
|
+
const updated = current.includes(day)
|
|
108
|
+
? current.filter((d) => d !== day)
|
|
109
|
+
: [...current, day]
|
|
110
|
+
updateField({ days: updated })
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
const toggleAlignHours = (checked: boolean) => {
|
|
114
|
+
if (checked) {
|
|
115
|
+
updateField({ is24Hours: true, startTime: undefined, endTime: undefined })
|
|
116
|
+
} else {
|
|
117
|
+
updateField({ is24Hours: false, startTime: '09:00', endTime: '17:00' })
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
const leftDays = days.slice(0, 4)
|
|
122
|
+
const rightDays = days.slice(4)
|
|
123
|
+
|
|
124
|
+
return (
|
|
125
|
+
<div className={`period-card ${className}`}>
|
|
126
|
+
{/* Title (plain text heading) */}
|
|
127
|
+
{title && (
|
|
128
|
+
<div className="period-card__title-row">
|
|
129
|
+
<span className="period-card__title">{title}</span>
|
|
130
|
+
{onDelete && <IconButton icon="delete" onClick={onDelete} />}
|
|
131
|
+
</div>
|
|
132
|
+
)}
|
|
133
|
+
|
|
134
|
+
{/* Badge header */}
|
|
135
|
+
{!hideHeader && !title && (
|
|
136
|
+
<div className="period-card__header">
|
|
137
|
+
<div className="period-card__badge-group">
|
|
138
|
+
{badgeIcon || <ClockIcon width={20} height={20} />}
|
|
139
|
+
<span className="period-card__badge">{labels.badge}</span>
|
|
140
|
+
</div>
|
|
141
|
+
{onDelete && (
|
|
142
|
+
<IconButton icon="delete" onClick={onDelete} />
|
|
143
|
+
)}
|
|
144
|
+
</div>
|
|
145
|
+
)}
|
|
146
|
+
|
|
147
|
+
{/* Custom children mode */}
|
|
148
|
+
{hasChildren ? (
|
|
149
|
+
children
|
|
150
|
+
) : (
|
|
151
|
+
<>
|
|
152
|
+
{/* Capacity / Value Override */}
|
|
153
|
+
{!hideCapacity && value && (
|
|
154
|
+
<div className="period-card__section">
|
|
155
|
+
<label className="period-card__section-label">
|
|
156
|
+
{labels.sectionTitle}
|
|
157
|
+
</label>
|
|
158
|
+
<div className="period-card__row">
|
|
159
|
+
<NewInput
|
|
160
|
+
label={labels.minValue}
|
|
161
|
+
optional={minOptional}
|
|
162
|
+
type="number"
|
|
163
|
+
min={0}
|
|
164
|
+
value={
|
|
165
|
+
value.minCapacity === null || value.minCapacity === 0
|
|
166
|
+
? ''
|
|
167
|
+
: value.minCapacity
|
|
168
|
+
}
|
|
169
|
+
onChange={(e) =>
|
|
170
|
+
updateField({
|
|
171
|
+
minCapacity:
|
|
172
|
+
(e.target as HTMLInputElement).value === ''
|
|
173
|
+
? null
|
|
174
|
+
: parseInt((e.target as HTMLInputElement).value, 10) || 0,
|
|
175
|
+
})
|
|
176
|
+
}
|
|
177
|
+
/>
|
|
178
|
+
<NewInput
|
|
179
|
+
label={labels.maxValue}
|
|
180
|
+
type="number"
|
|
181
|
+
min={1}
|
|
182
|
+
value={value.maxCapacity === 0 ? '' : value.maxCapacity}
|
|
183
|
+
onChange={(e) =>
|
|
184
|
+
updateField({
|
|
185
|
+
maxCapacity:
|
|
186
|
+
(e.target as HTMLInputElement).value === ''
|
|
187
|
+
? 0
|
|
188
|
+
: parseInt((e.target as HTMLInputElement).value, 10) || 0,
|
|
189
|
+
})
|
|
190
|
+
}
|
|
191
|
+
/>
|
|
192
|
+
</div>
|
|
193
|
+
</div>
|
|
194
|
+
)}
|
|
195
|
+
|
|
196
|
+
{/* Days */}
|
|
197
|
+
{!hideDays && value && (
|
|
198
|
+
<div className="period-card__section">
|
|
199
|
+
<label className="period-card__section-label">
|
|
200
|
+
{labels.days}
|
|
201
|
+
</label>
|
|
202
|
+
<div className="period-card__days-grid">
|
|
203
|
+
<div className="period-card__days-col">
|
|
204
|
+
{leftDays.map((day) => (
|
|
205
|
+
<DayCheckbox
|
|
206
|
+
key={day}
|
|
207
|
+
label={day}
|
|
208
|
+
checked={value.days?.includes(day) || false}
|
|
209
|
+
onChange={() => toggleDay(day)}
|
|
210
|
+
/>
|
|
211
|
+
))}
|
|
212
|
+
</div>
|
|
213
|
+
<div className="period-card__days-col">
|
|
214
|
+
{rightDays.map((day) => (
|
|
215
|
+
<DayCheckbox
|
|
216
|
+
key={day}
|
|
217
|
+
label={day}
|
|
218
|
+
checked={value.days?.includes(day) || false}
|
|
219
|
+
onChange={() => toggleDay(day)}
|
|
220
|
+
/>
|
|
221
|
+
))}
|
|
222
|
+
</div>
|
|
223
|
+
</div>
|
|
224
|
+
</div>
|
|
225
|
+
)}
|
|
226
|
+
|
|
227
|
+
{/* Time */}
|
|
228
|
+
{!hideTime && value && (
|
|
229
|
+
<div className="period-card__section">
|
|
230
|
+
<label className="period-card__section-label">
|
|
231
|
+
{labels.time}
|
|
232
|
+
</label>
|
|
233
|
+
<Checkbox
|
|
234
|
+
label={labels.alignToggle}
|
|
235
|
+
checked={value.is24Hours ?? true}
|
|
236
|
+
onChange={(e) => toggleAlignHours(e.target.checked)}
|
|
237
|
+
/>
|
|
238
|
+
{!value.is24Hours && (
|
|
239
|
+
<div className="period-card__row period-card__row--time">
|
|
240
|
+
<NewInput
|
|
241
|
+
label={labels.startTime}
|
|
242
|
+
type="time"
|
|
243
|
+
value={value.startTime || '09:00'}
|
|
244
|
+
onChange={(e) =>
|
|
245
|
+
updateField({ startTime: (e.target as HTMLInputElement).value })
|
|
246
|
+
}
|
|
247
|
+
/>
|
|
248
|
+
<NewInput
|
|
249
|
+
label={labels.endTime}
|
|
250
|
+
type="time"
|
|
251
|
+
value={value.endTime || '17:00'}
|
|
252
|
+
onChange={(e) =>
|
|
253
|
+
updateField({ endTime: (e.target as HTMLInputElement).value })
|
|
254
|
+
}
|
|
255
|
+
/>
|
|
256
|
+
</div>
|
|
257
|
+
)}
|
|
258
|
+
</div>
|
|
259
|
+
)}
|
|
260
|
+
</>
|
|
261
|
+
)}
|
|
262
|
+
</div>
|
|
263
|
+
)
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
// ── Sub-components for composition ──
|
|
267
|
+
|
|
268
|
+
export interface PeriodCardSectionProps {
|
|
269
|
+
label?: string
|
|
270
|
+
children: React.ReactNode
|
|
271
|
+
className?: string
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
export const PeriodCardSection: React.FC<PeriodCardSectionProps> = ({
|
|
275
|
+
label,
|
|
276
|
+
children,
|
|
277
|
+
className = '',
|
|
278
|
+
}) => (
|
|
279
|
+
<div className={`period-card__section ${className}`}>
|
|
280
|
+
{label && (
|
|
281
|
+
<label className="period-card__section-label">{label}</label>
|
|
282
|
+
)}
|
|
283
|
+
{children}
|
|
284
|
+
</div>
|
|
285
|
+
)
|
|
286
|
+
|
|
287
|
+
PeriodCardSection.displayName = 'PeriodCardSection'
|
|
288
|
+
|
|
289
|
+
export interface PeriodCardTimeRangeProps {
|
|
290
|
+
startTime: string
|
|
291
|
+
endTime: string
|
|
292
|
+
onStartTimeChange: (value: string) => void
|
|
293
|
+
onEndTimeChange: (value: string) => void
|
|
294
|
+
startLabel?: string
|
|
295
|
+
endLabel?: string
|
|
296
|
+
separator?: string
|
|
297
|
+
className?: string
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
export const PeriodCardTimeRange: React.FC<PeriodCardTimeRangeProps> = ({
|
|
301
|
+
startTime,
|
|
302
|
+
endTime,
|
|
303
|
+
onStartTimeChange,
|
|
304
|
+
onEndTimeChange,
|
|
305
|
+
startLabel,
|
|
306
|
+
endLabel,
|
|
307
|
+
separator = 'to',
|
|
308
|
+
className = '',
|
|
309
|
+
}) => (
|
|
310
|
+
<div className={`period-card__time-range ${className}`}>
|
|
311
|
+
<NewInput
|
|
312
|
+
label={startLabel}
|
|
313
|
+
type="time"
|
|
314
|
+
value={startTime}
|
|
315
|
+
onChange={(e) => onStartTimeChange((e.target as HTMLInputElement).value)}
|
|
316
|
+
/>
|
|
317
|
+
<span className="period-card__time-separator">{separator}</span>
|
|
318
|
+
<NewInput
|
|
319
|
+
label={endLabel}
|
|
320
|
+
type="time"
|
|
321
|
+
value={endTime}
|
|
322
|
+
onChange={(e) => onEndTimeChange((e.target as HTMLInputElement).value)}
|
|
323
|
+
/>
|
|
324
|
+
</div>
|
|
325
|
+
)
|
|
326
|
+
|
|
327
|
+
PeriodCardTimeRange.displayName = 'PeriodCardTimeRange'
|
|
328
|
+
|
|
329
|
+
// ── Day checkbox (also exported for standalone use) ──
|
|
330
|
+
|
|
331
|
+
interface DayCheckboxProps {
|
|
332
|
+
label: string
|
|
333
|
+
checked: boolean
|
|
334
|
+
onChange: () => void
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
const DayCheckbox: React.FC<DayCheckboxProps> = ({ label, checked, onChange }) => (
|
|
338
|
+
<label className="day-checkbox">
|
|
339
|
+
<input
|
|
340
|
+
type="checkbox"
|
|
341
|
+
className="day-checkbox__input"
|
|
342
|
+
checked={checked}
|
|
343
|
+
onChange={onChange}
|
|
344
|
+
/>
|
|
345
|
+
<span className="day-checkbox__box" />
|
|
346
|
+
<span className="day-checkbox__label">{label}</span>
|
|
347
|
+
</label>
|
|
348
|
+
)
|
|
349
|
+
|
|
350
|
+
PeriodCard.displayName = 'PeriodCard'
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
.reorder-row {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
gap: 12px;
|
|
5
|
+
padding: 12px 16px;
|
|
6
|
+
background: var(--surface-secondary, #f5f6fa);
|
|
7
|
+
border-radius: 8px;
|
|
8
|
+
|
|
9
|
+
&--clickable {
|
|
10
|
+
cursor: pointer;
|
|
11
|
+
|
|
12
|
+
&:hover {
|
|
13
|
+
background: var(--surface-secondary-hover, #edeef3);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
&__drag-handle {
|
|
18
|
+
display: flex;
|
|
19
|
+
align-items: center;
|
|
20
|
+
cursor: grab;
|
|
21
|
+
color: var(--label-secondary, #6b7a99);
|
|
22
|
+
flex-shrink: 0;
|
|
23
|
+
|
|
24
|
+
&:active {
|
|
25
|
+
cursor: grabbing;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&__left {
|
|
30
|
+
flex-shrink: 0;
|
|
31
|
+
display: flex;
|
|
32
|
+
align-items: center;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
&__content {
|
|
36
|
+
flex: 1;
|
|
37
|
+
min-width: 0;
|
|
38
|
+
display: flex;
|
|
39
|
+
flex-direction: column;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
&__label {
|
|
43
|
+
font-family: var(--font-family-sans, 'Geist', system-ui, sans-serif);
|
|
44
|
+
font-size: 14px;
|
|
45
|
+
font-weight: 600;
|
|
46
|
+
line-height: 20px;
|
|
47
|
+
color: var(--label-primary, #121e52);
|
|
48
|
+
white-space: nowrap;
|
|
49
|
+
overflow: hidden;
|
|
50
|
+
text-overflow: ellipsis;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
&__subtitle {
|
|
54
|
+
font-family: var(--font-family-sans, 'Geist', system-ui, sans-serif);
|
|
55
|
+
font-size: 13px;
|
|
56
|
+
font-weight: 400;
|
|
57
|
+
line-height: 16px;
|
|
58
|
+
color: var(--label-secondary, #6b7a99);
|
|
59
|
+
margin-top: 2px;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
&__right {
|
|
63
|
+
flex-shrink: 0;
|
|
64
|
+
display: flex;
|
|
65
|
+
align-items: center;
|
|
66
|
+
gap: 8px;
|
|
67
|
+
}
|
|
68
|
+
}
|