@licklist/design 0.78.5-dev.105 → 0.78.5-dev.107

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (371) hide show
  1. package/.vscode/settings.json +3 -0
  2. package/bitbucket-pipelines.yml +13 -4
  3. package/dist/index.js +1 -1
  4. package/dist/product-set/form/ProductsControl.d.ts +2 -1
  5. package/dist/product-set/form/ProductsControl.d.ts.map +1 -1
  6. package/dist/product-set/form/ProductsControl.js +0 -24
  7. package/dist/v2/components/DataTable/DataTable.d.ts.map +1 -1
  8. package/dist/v2/components/DataTable/DataTable.js +86 -2
  9. package/dist/v2/components/InputCheckbox/InputCheckbox.scss.js +1 -1
  10. package/dist/v2/components/Modal/DeleteModal.d.ts.map +1 -1
  11. package/dist/v2/components/Modal/DeleteModal.js +13 -11
  12. package/dist/v2/components/Toggle/Toggle.d.ts.map +1 -1
  13. package/dist/v2/components/Toggle/Toggle.js +8 -5
  14. package/dist/v2/components/ZoneCard/ZoneCard.scss.js +1 -1
  15. package/dist/v2/components/index.d.ts +1 -1
  16. package/dist/v2/components/index.d.ts.map +1 -1
  17. package/dist/v2/icons/index.d.ts +4 -0
  18. package/dist/v2/icons/index.d.ts.map +1 -1
  19. package/dist/v2/icons/index.js +47 -16
  20. package/dist/v2/index.d.ts +0 -4
  21. package/dist/v2/index.d.ts.map +1 -1
  22. package/dist/v2/pages/Settings/components/SidebarCustomisation.js +0 -3
  23. package/dist/v2/pages/Settings/components/SidebarNavItem.js +0 -3
  24. package/package.json +6 -6
  25. package/rollup.config.js +16 -2
  26. package/src/iframe/payment/payment-status-page/PaymentStatusPage.tsx +1 -1
  27. package/src/product-set/form/ProductsControl.tsx +2 -1
  28. package/src/v2/components/DataTable/DataTable.tsx +23 -1
  29. package/src/v2/components/InputCheckbox/InputCheckbox.scss +6 -6
  30. package/src/v2/components/Modal/DeleteModal.tsx +12 -20
  31. package/src/v2/components/Toggle/Toggle.tsx +6 -5
  32. package/src/v2/components/ZoneCard/ZoneCard.scss +78 -0
  33. package/src/v2/components/index.ts +1 -0
  34. package/src/v2/icons/index.tsx +10 -0
  35. package/src/v2/index.ts +0 -73
  36. package/src/v2/navigation/Navigation/Navigation.stories.tsx +137 -0
  37. package/dist/v2/shadcn/components/ui/accordion.d.ts +0 -8
  38. package/dist/v2/shadcn/components/ui/accordion.d.ts.map +0 -1
  39. package/dist/v2/shadcn/components/ui/alert-dialog.d.ts +0 -21
  40. package/dist/v2/shadcn/components/ui/alert-dialog.d.ts.map +0 -1
  41. package/dist/v2/shadcn/components/ui/alert.d.ts +0 -9
  42. package/dist/v2/shadcn/components/ui/alert.d.ts.map +0 -1
  43. package/dist/v2/shadcn/components/ui/aspect-ratio.d.ts +0 -4
  44. package/dist/v2/shadcn/components/ui/aspect-ratio.d.ts.map +0 -1
  45. package/dist/v2/shadcn/components/ui/avatar.d.ts +0 -7
  46. package/dist/v2/shadcn/components/ui/avatar.d.ts.map +0 -1
  47. package/dist/v2/shadcn/components/ui/badge.d.ts +0 -10
  48. package/dist/v2/shadcn/components/ui/badge.d.ts.map +0 -1
  49. package/dist/v2/shadcn/components/ui/breadcrumb.d.ts +0 -20
  50. package/dist/v2/shadcn/components/ui/breadcrumb.d.ts.map +0 -1
  51. package/dist/v2/shadcn/components/ui/button.d.ts +0 -14
  52. package/dist/v2/shadcn/components/ui/button.d.ts.map +0 -1
  53. package/dist/v2/shadcn/components/ui/calendar.d.ts +0 -9
  54. package/dist/v2/shadcn/components/ui/calendar.d.ts.map +0 -1
  55. package/dist/v2/shadcn/components/ui/card.d.ts +0 -9
  56. package/dist/v2/shadcn/components/ui/card.d.ts.map +0 -1
  57. package/dist/v2/shadcn/components/ui/carousel.d.ts +0 -19
  58. package/dist/v2/shadcn/components/ui/carousel.d.ts.map +0 -1
  59. package/dist/v2/shadcn/components/ui/checkbox.d.ts +0 -6
  60. package/dist/v2/shadcn/components/ui/checkbox.d.ts.map +0 -1
  61. package/dist/v2/shadcn/components/ui/checkbox.js +0 -115
  62. package/dist/v2/shadcn/components/ui/checkbox.scss.js +0 -6
  63. package/dist/v2/shadcn/components/ui/collapsible.d.ts +0 -6
  64. package/dist/v2/shadcn/components/ui/collapsible.d.ts.map +0 -1
  65. package/dist/v2/shadcn/components/ui/command.d.ts +0 -83
  66. package/dist/v2/shadcn/components/ui/command.d.ts.map +0 -1
  67. package/dist/v2/shadcn/components/ui/context-menu.d.ts +0 -28
  68. package/dist/v2/shadcn/components/ui/context-menu.d.ts.map +0 -1
  69. package/dist/v2/shadcn/components/ui/dialog.d.ts +0 -20
  70. package/dist/v2/shadcn/components/ui/dialog.d.ts.map +0 -1
  71. package/dist/v2/shadcn/components/ui/dialog.js +0 -169
  72. package/dist/v2/shadcn/components/ui/drawer.d.ts +0 -23
  73. package/dist/v2/shadcn/components/ui/drawer.d.ts.map +0 -1
  74. package/dist/v2/shadcn/components/ui/dropdown-menu.d.ts +0 -28
  75. package/dist/v2/shadcn/components/ui/dropdown-menu.d.ts.map +0 -1
  76. package/dist/v2/shadcn/components/ui/form.d.ts +0 -24
  77. package/dist/v2/shadcn/components/ui/form.d.ts.map +0 -1
  78. package/dist/v2/shadcn/components/ui/hover-card.d.ts +0 -7
  79. package/dist/v2/shadcn/components/ui/hover-card.d.ts.map +0 -1
  80. package/dist/v2/shadcn/components/ui/input-otp.d.ts +0 -35
  81. package/dist/v2/shadcn/components/ui/input-otp.d.ts.map +0 -1
  82. package/dist/v2/shadcn/components/ui/input.d.ts +0 -6
  83. package/dist/v2/shadcn/components/ui/input.d.ts.map +0 -1
  84. package/dist/v2/shadcn/components/ui/label.d.ts +0 -6
  85. package/dist/v2/shadcn/components/ui/label.d.ts.map +0 -1
  86. package/dist/v2/shadcn/components/ui/menubar.d.ts +0 -34
  87. package/dist/v2/shadcn/components/ui/menubar.d.ts.map +0 -1
  88. package/dist/v2/shadcn/components/ui/navigation-menu.d.ts +0 -13
  89. package/dist/v2/shadcn/components/ui/navigation-menu.d.ts.map +0 -1
  90. package/dist/v2/shadcn/components/ui/pagination.d.ts +0 -29
  91. package/dist/v2/shadcn/components/ui/pagination.d.ts.map +0 -1
  92. package/dist/v2/shadcn/components/ui/popover.d.ts +0 -7
  93. package/dist/v2/shadcn/components/ui/popover.d.ts.map +0 -1
  94. package/dist/v2/shadcn/components/ui/progress.d.ts +0 -5
  95. package/dist/v2/shadcn/components/ui/progress.d.ts.map +0 -1
  96. package/dist/v2/shadcn/components/ui/radio-card.d.ts +0 -12
  97. package/dist/v2/shadcn/components/ui/radio-card.d.ts.map +0 -1
  98. package/dist/v2/shadcn/components/ui/radio-group.d.ts +0 -6
  99. package/dist/v2/shadcn/components/ui/radio-group.d.ts.map +0 -1
  100. package/dist/v2/shadcn/components/ui/scroll-area.d.ts +0 -6
  101. package/dist/v2/shadcn/components/ui/scroll-area.d.ts.map +0 -1
  102. package/dist/v2/shadcn/components/ui/select.d.ts +0 -14
  103. package/dist/v2/shadcn/components/ui/select.d.ts.map +0 -1
  104. package/dist/v2/shadcn/components/ui/separator.d.ts +0 -5
  105. package/dist/v2/shadcn/components/ui/separator.d.ts.map +0 -1
  106. package/dist/v2/shadcn/components/ui/sheet.d.ts +0 -26
  107. package/dist/v2/shadcn/components/ui/sheet.d.ts.map +0 -1
  108. package/dist/v2/shadcn/components/ui/sidebar.d.ts +0 -67
  109. package/dist/v2/shadcn/components/ui/sidebar.d.ts.map +0 -1
  110. package/dist/v2/shadcn/components/ui/skeleton.d.ts +0 -3
  111. package/dist/v2/shadcn/components/ui/skeleton.d.ts.map +0 -1
  112. package/dist/v2/shadcn/components/ui/slider.d.ts +0 -5
  113. package/dist/v2/shadcn/components/ui/slider.d.ts.map +0 -1
  114. package/dist/v2/shadcn/components/ui/switch.d.ts +0 -6
  115. package/dist/v2/shadcn/components/ui/switch.d.ts.map +0 -1
  116. package/dist/v2/shadcn/components/ui/switch.js +0 -115
  117. package/dist/v2/shadcn/components/ui/switch.scss.js +0 -6
  118. package/dist/v2/shadcn/components/ui/table-pagination.d.ts +0 -11
  119. package/dist/v2/shadcn/components/ui/table-pagination.d.ts.map +0 -1
  120. package/dist/v2/shadcn/components/ui/table.d.ts +0 -11
  121. package/dist/v2/shadcn/components/ui/table.d.ts.map +0 -1
  122. package/dist/v2/shadcn/components/ui/tabs.d.ts +0 -8
  123. package/dist/v2/shadcn/components/ui/tabs.d.ts.map +0 -1
  124. package/dist/v2/shadcn/components/ui/textarea.d.ts +0 -6
  125. package/dist/v2/shadcn/components/ui/textarea.d.ts.map +0 -1
  126. package/dist/v2/shadcn/components/ui/toast.d.ts +0 -16
  127. package/dist/v2/shadcn/components/ui/toast.d.ts.map +0 -1
  128. package/dist/v2/shadcn/components/ui/toaster.d.ts +0 -2
  129. package/dist/v2/shadcn/components/ui/toaster.d.ts.map +0 -1
  130. package/dist/v2/shadcn/components/ui/toggle-group.d.ts +0 -13
  131. package/dist/v2/shadcn/components/ui/toggle-group.d.ts.map +0 -1
  132. package/dist/v2/shadcn/components/ui/toggle.d.ts +0 -13
  133. package/dist/v2/shadcn/components/ui/toggle.d.ts.map +0 -1
  134. package/dist/v2/shadcn/components/ui/tooltip.d.ts +0 -8
  135. package/dist/v2/shadcn/components/ui/tooltip.d.ts.map +0 -1
  136. package/dist/v2/shadcn/components/ui/use-toast.d.ts +0 -3
  137. package/dist/v2/shadcn/components/ui/use-toast.d.ts.map +0 -1
  138. package/dist/v2/shadcn/hooks/use-mobile.d.ts +0 -2
  139. package/dist/v2/shadcn/hooks/use-mobile.d.ts.map +0 -1
  140. package/dist/v2/shadcn/hooks/use-toast.d.ts +0 -45
  141. package/dist/v2/shadcn/hooks/use-toast.d.ts.map +0 -1
  142. package/dist/v2/shadcn/index.d.ts +0 -20
  143. package/dist/v2/shadcn/index.d.ts.map +0 -1
  144. package/dist/v2/shadcn/lib/utils.d.ts +0 -3
  145. package/dist/v2/shadcn/lib/utils.d.ts.map +0 -1
  146. package/dist/v2/shadcn/lib/utils.js +0 -11
  147. package/dist/v2/shadcn/styles/globals.css +0 -112
  148. package/src/v2/shadcn/_reference/AccountManagerCard.tsx +0 -45
  149. package/src/v2/shadcn/_reference/AffiliatesTable.tsx +0 -178
  150. package/src/v2/shadcn/_reference/AuditArchive.tsx +0 -165
  151. package/src/v2/shadcn/_reference/AuditContent.tsx +0 -270
  152. package/src/v2/shadcn/_reference/AutomationsGeneralSettings.tsx +0 -251
  153. package/src/v2/shadcn/_reference/AvatarUpload.tsx +0 -150
  154. package/src/v2/shadcn/_reference/BookingsSummaryCard.tsx +0 -268
  155. package/src/v2/shadcn/_reference/CodeCleanUpAudit.tsx +0 -274
  156. package/src/v2/shadcn/_reference/CompaniesTable.tsx +0 -387
  157. package/src/v2/shadcn/_reference/ComponentAudit.tsx +0 -239
  158. package/src/v2/shadcn/_reference/ConfigureSettingsCard.tsx +0 -95
  159. package/src/v2/shadcn/_reference/CustomerCard.tsx +0 -155
  160. package/src/v2/shadcn/_reference/DashboardCards.tsx +0 -50
  161. package/src/v2/shadcn/_reference/DashboardFooter.tsx +0 -18
  162. package/src/v2/shadcn/_reference/DiarySettings.tsx +0 -187
  163. package/src/v2/shadcn/_reference/DiaryView.tsx +0 -998
  164. package/src/v2/shadcn/_reference/EmptyState.tsx +0 -76
  165. package/src/v2/shadcn/_reference/EntityInfoCard.tsx +0 -48
  166. package/src/v2/shadcn/_reference/ExistingUserAssignments.tsx +0 -131
  167. package/src/v2/shadcn/_reference/FeatureToggle.tsx +0 -72
  168. package/src/v2/shadcn/_reference/FlowCard.tsx +0 -170
  169. package/src/v2/shadcn/_reference/FlowsContent.tsx +0 -688
  170. package/src/v2/shadcn/_reference/FlowsGeneralSettings.tsx +0 -27
  171. package/src/v2/shadcn/_reference/GeneralSettings.tsx +0 -33
  172. package/src/v2/shadcn/_reference/InventoryGeneralSettings.tsx +0 -82
  173. package/src/v2/shadcn/_reference/LanguageSelector.tsx +0 -97
  174. package/src/v2/shadcn/_reference/LoadingScreen.tsx +0 -25
  175. package/src/v2/shadcn/_reference/LoadingSpinner.tsx +0 -41
  176. package/src/v2/shadcn/_reference/ManagedClientsList.tsx +0 -121
  177. package/src/v2/shadcn/_reference/NPSScore.tsx +0 -379
  178. package/src/v2/shadcn/_reference/NPSSummaryCard.tsx +0 -181
  179. package/src/v2/shadcn/_reference/NotificationBanner.tsx +0 -129
  180. package/src/v2/shadcn/_reference/NotificationPanel.tsx +0 -208
  181. package/src/v2/shadcn/_reference/OnlineUsersCard.tsx +0 -73
  182. package/src/v2/shadcn/_reference/ProtectedRoute.tsx +0 -39
  183. package/src/v2/shadcn/_reference/ProvidersTable.tsx +0 -353
  184. package/src/v2/shadcn/_reference/QuickAddPanel.tsx +0 -1057
  185. package/src/v2/shadcn/_reference/QuickFilters.tsx +0 -112
  186. package/src/v2/shadcn/_reference/ScheduleView.tsx +0 -410
  187. package/src/v2/shadcn/_reference/ScrollToTop.tsx +0 -14
  188. package/src/v2/shadcn/_reference/SecondaryNav.tsx +0 -50
  189. package/src/v2/shadcn/_reference/SecuritySettings.tsx +0 -258
  190. package/src/v2/shadcn/_reference/SessionDetailView.tsx +0 -294
  191. package/src/v2/shadcn/_reference/Sidebar.tsx +0 -14
  192. package/src/v2/shadcn/_reference/SidebarAwareLayout.tsx +0 -30
  193. package/src/v2/shadcn/_reference/SidebarLabelCustomization.tsx +0 -285
  194. package/src/v2/shadcn/_reference/SimulationBanner.tsx +0 -57
  195. package/src/v2/shadcn/_reference/SortControls.tsx +0 -65
  196. package/src/v2/shadcn/_reference/StatusBadge.tsx +0 -49
  197. package/src/v2/shadcn/_reference/StyleGuideContent.tsx +0 -331
  198. package/src/v2/shadcn/_reference/TableActionMenu.tsx +0 -126
  199. package/src/v2/shadcn/_reference/ThemeProvider.tsx +0 -119
  200. package/src/v2/shadcn/_reference/ThemeSettings.tsx +0 -73
  201. package/src/v2/shadcn/_reference/TopNavigation.tsx +0 -332
  202. package/src/v2/shadcn/_reference/UserActivityHistory.tsx +0 -209
  203. package/src/v2/shadcn/_reference/UserLanguageSettings.tsx +0 -94
  204. package/src/v2/shadcn/_reference/UserPanel.tsx +0 -472
  205. package/src/v2/shadcn/_reference/UsersTable.tsx +0 -1023
  206. package/src/v2/shadcn/_reference/WaiverForm.tsx +0 -301
  207. package/src/v2/shadcn/_reference/WaiversGeneralSettings.tsx +0 -46
  208. package/src/v2/shadcn/_reference/WaiversTable.tsx +0 -290
  209. package/src/v2/shadcn/_reference/WaiversTemplatesSettings.tsx +0 -416
  210. package/src/v2/shadcn/_reference/ai/AIChatPanel.tsx +0 -313
  211. package/src/v2/shadcn/_reference/ai/AIChatSearchBar.tsx +0 -36
  212. package/src/v2/shadcn/_reference/ai/ChatInteractiveBlock.tsx +0 -298
  213. package/src/v2/shadcn/_reference/ai/ChatMessageContent.tsx +0 -40
  214. package/src/v2/shadcn/_reference/ai/parseInteractiveBlocks.ts +0 -142
  215. package/src/v2/shadcn/_reference/auth/AuthLayout.tsx +0 -55
  216. package/src/v2/shadcn/_reference/auth/CreatePasswordForm.tsx +0 -285
  217. package/src/v2/shadcn/_reference/auth/CreatePasswordPanel.tsx +0 -20
  218. package/src/v2/shadcn/_reference/auth/LoginFooter.tsx +0 -14
  219. package/src/v2/shadcn/_reference/auth/LoginForm.tsx +0 -205
  220. package/src/v2/shadcn/_reference/auth/LoginPanel.tsx +0 -41
  221. package/src/v2/shadcn/_reference/auth/ResetPasswordForm.tsx +0 -102
  222. package/src/v2/shadcn/_reference/auth/ResetPasswordPanel.tsx +0 -20
  223. package/src/v2/shadcn/_reference/auth/VerifyEmailForm.tsx +0 -95
  224. package/src/v2/shadcn/_reference/auth/VerifyEmailPanel.tsx +0 -20
  225. package/src/v2/shadcn/_reference/email/EmailAttachment.tsx +0 -119
  226. package/src/v2/shadcn/_reference/email/EmailAutomation.tsx +0 -92
  227. package/src/v2/shadcn/_reference/email/EmailPlaceholders.tsx +0 -64
  228. package/src/v2/shadcn/_reference/email/UnlayerEmailEditor.tsx +0 -41
  229. package/src/v2/shadcn/_reference/email/emailTemplateData.ts +0 -53
  230. package/src/v2/shadcn/_reference/emptyStateIcons.tsx +0 -103
  231. package/src/v2/shadcn/_reference/games/MazeGame.tsx +0 -394
  232. package/src/v2/shadcn/_reference/games/RunnerGame.tsx +0 -497
  233. package/src/v2/shadcn/_reference/logos/BookedLogoFull.tsx +0 -36
  234. package/src/v2/shadcn/_reference/logos/BookedLogoMark.tsx +0 -31
  235. package/src/v2/shadcn/_reference/logos/BookedLogoNew.tsx +0 -36
  236. package/src/v2/shadcn/_reference/pricing/DynamicPricingRulesEditor.tsx +0 -401
  237. package/src/v2/shadcn/_reference/pricing/DynamicPricingTierCard.tsx +0 -77
  238. package/src/v2/shadcn/_reference/pricing/DynamicPricingTiersList.tsx +0 -218
  239. package/src/v2/shadcn/_reference/pricing/PricingCalendar.tsx +0 -810
  240. package/src/v2/shadcn/_reference/pricing/PricingPeriodCard.tsx +0 -152
  241. package/src/v2/shadcn/_reference/pricing/PricingPeriodForm.tsx +0 -377
  242. package/src/v2/shadcn/_reference/pricing/PricingPeriodsList.tsx +0 -213
  243. package/src/v2/shadcn/_reference/pricing/getRuleSummary.ts +0 -39
  244. package/src/v2/shadcn/_reference/products/AvailabilityRulesSection.tsx +0 -184
  245. package/src/v2/shadcn/_reference/products/AvailabilitySection.tsx +0 -677
  246. package/src/v2/shadcn/_reference/products/BookingTypeConfigOptions.tsx +0 -40
  247. package/src/v2/shadcn/_reference/products/CapacityPeriodsSection.tsx +0 -238
  248. package/src/v2/shadcn/_reference/products/DynamicPricingTiersSection.tsx +0 -131
  249. package/src/v2/shadcn/_reference/products/GiftCardOrdersTab.tsx +0 -192
  250. package/src/v2/shadcn/_reference/products/GiftCardSettings.tsx +0 -342
  251. package/src/v2/shadcn/_reference/products/PackageProductsSection.tsx +0 -322
  252. package/src/v2/shadcn/_reference/products/PricingSection.tsx +0 -173
  253. package/src/v2/shadcn/_reference/products/ProductTypeFields.tsx +0 -353
  254. package/src/v2/shadcn/_reference/products/ProductTypeIcon.tsx +0 -95
  255. package/src/v2/shadcn/_reference/products/VariablePricingSection.tsx +0 -140
  256. package/src/v2/shadcn/_reference/products/productTypeConfig.ts +0 -182
  257. package/src/v2/shadcn/_reference/shared/BackButton.tsx +0 -50
  258. package/src/v2/shadcn/_reference/shared/CancelConfirmationDialog.tsx +0 -18
  259. package/src/v2/shadcn/_reference/shared/ConfirmationDialog.tsx +0 -136
  260. package/src/v2/shadcn/_reference/shared/DeleteConfirmationDialog.tsx +0 -18
  261. package/src/v2/shadcn/_reference/shared/DeleteEntityPage.tsx +0 -221
  262. package/src/v2/shadcn/_reference/shared/SidebarIcons.tsx +0 -108
  263. package/src/v2/shadcn/_reference/shared/UnifiedSidebar.tsx +0 -722
  264. package/src/v2/shadcn/_reference/tables/BulkActionsBar.tsx +0 -68
  265. package/src/v2/shadcn/_reference/tables/DataTable.tsx +0 -221
  266. package/src/v2/shadcn/_reference/tables/TableControls.tsx +0 -94
  267. package/src/v2/shadcn/_reference/tables/index.ts +0 -3
  268. package/src/v2/shadcn/_reference/tables/types.ts +0 -79
  269. package/src/v2/shadcn/_reference/zones/LegacyZoneSettings.tsx +0 -299
  270. package/src/v2/shadcn/components/ui/accordion.stories.tsx +0 -63
  271. package/src/v2/shadcn/components/ui/accordion.tsx +0 -52
  272. package/src/v2/shadcn/components/ui/alert-dialog.stories.tsx +0 -44
  273. package/src/v2/shadcn/components/ui/alert-dialog.tsx +0 -104
  274. package/src/v2/shadcn/components/ui/alert.stories.tsx +0 -44
  275. package/src/v2/shadcn/components/ui/alert.tsx +0 -43
  276. package/src/v2/shadcn/components/ui/aspect-ratio.stories.tsx +0 -46
  277. package/src/v2/shadcn/components/ui/aspect-ratio.tsx +0 -5
  278. package/src/v2/shadcn/components/ui/avatar.stories.tsx +0 -39
  279. package/src/v2/shadcn/components/ui/avatar.tsx +0 -38
  280. package/src/v2/shadcn/components/ui/badge.stories.tsx +0 -17
  281. package/src/v2/shadcn/components/ui/badge.tsx +0 -30
  282. package/src/v2/shadcn/components/ui/breadcrumb.stories.tsx +0 -91
  283. package/src/v2/shadcn/components/ui/breadcrumb.tsx +0 -90
  284. package/src/v2/shadcn/components/ui/button.stories.tsx +0 -20
  285. package/src/v2/shadcn/components/ui/button.tsx +0 -60
  286. package/src/v2/shadcn/components/ui/calendar.stories.tsx +0 -61
  287. package/src/v2/shadcn/components/ui/calendar.tsx +0 -54
  288. package/src/v2/shadcn/components/ui/card.stories.tsx +0 -37
  289. package/src/v2/shadcn/components/ui/card.tsx +0 -43
  290. package/src/v2/shadcn/components/ui/carousel.stories.tsx +0 -92
  291. package/src/v2/shadcn/components/ui/carousel.tsx +0 -224
  292. package/src/v2/shadcn/components/ui/checkbox.scss +0 -38
  293. package/src/v2/shadcn/components/ui/checkbox.stories.tsx +0 -23
  294. package/src/v2/shadcn/components/ui/checkbox.tsx +0 -24
  295. package/src/v2/shadcn/components/ui/collapsible.stories.tsx +0 -59
  296. package/src/v2/shadcn/components/ui/collapsible.tsx +0 -9
  297. package/src/v2/shadcn/components/ui/command.stories.tsx +0 -70
  298. package/src/v2/shadcn/components/ui/command.tsx +0 -132
  299. package/src/v2/shadcn/components/ui/context-menu.stories.tsx +0 -72
  300. package/src/v2/shadcn/components/ui/context-menu.tsx +0 -178
  301. package/src/v2/shadcn/components/ui/dialog.stories.tsx +0 -67
  302. package/src/v2/shadcn/components/ui/dialog.tsx +0 -95
  303. package/src/v2/shadcn/components/ui/drawer.stories.tsx +0 -50
  304. package/src/v2/shadcn/components/ui/drawer.tsx +0 -87
  305. package/src/v2/shadcn/components/ui/dropdown-menu.stories.tsx +0 -73
  306. package/src/v2/shadcn/components/ui/dropdown-menu.tsx +0 -179
  307. package/src/v2/shadcn/components/ui/form.stories.tsx +0 -105
  308. package/src/v2/shadcn/components/ui/form.tsx +0 -129
  309. package/src/v2/shadcn/components/ui/hover-card.stories.tsx +0 -35
  310. package/src/v2/shadcn/components/ui/hover-card.tsx +0 -27
  311. package/src/v2/shadcn/components/ui/input-otp.stories.tsx +0 -72
  312. package/src/v2/shadcn/components/ui/input-otp.tsx +0 -61
  313. package/src/v2/shadcn/components/ui/input.stories.tsx +0 -16
  314. package/src/v2/shadcn/components/ui/input.tsx +0 -25
  315. package/src/v2/shadcn/components/ui/label.stories.tsx +0 -13
  316. package/src/v2/shadcn/components/ui/label.tsx +0 -17
  317. package/src/v2/shadcn/components/ui/menubar.stories.tsx +0 -86
  318. package/src/v2/shadcn/components/ui/menubar.tsx +0 -207
  319. package/src/v2/shadcn/components/ui/navigation-menu.stories.tsx +0 -68
  320. package/src/v2/shadcn/components/ui/navigation-menu.tsx +0 -120
  321. package/src/v2/shadcn/components/ui/pagination.stories.tsx +0 -78
  322. package/src/v2/shadcn/components/ui/pagination.tsx +0 -81
  323. package/src/v2/shadcn/components/ui/popover.stories.tsx +0 -44
  324. package/src/v2/shadcn/components/ui/popover.tsx +0 -29
  325. package/src/v2/shadcn/components/ui/progress.stories.tsx +0 -17
  326. package/src/v2/shadcn/components/ui/progress.tsx +0 -23
  327. package/src/v2/shadcn/components/ui/radio-card.stories.tsx +0 -68
  328. package/src/v2/shadcn/components/ui/radio-card.tsx +0 -52
  329. package/src/v2/shadcn/components/ui/radio-group.stories.tsx +0 -77
  330. package/src/v2/shadcn/components/ui/radio-group.tsx +0 -35
  331. package/src/v2/shadcn/components/ui/scroll-area.stories.tsx +0 -56
  332. package/src/v2/shadcn/components/ui/scroll-area.tsx +0 -38
  333. package/src/v2/shadcn/components/ui/select.stories.tsx +0 -60
  334. package/src/v2/shadcn/components/ui/select.tsx +0 -148
  335. package/src/v2/shadcn/components/ui/separator.stories.tsx +0 -30
  336. package/src/v2/shadcn/components/ui/separator.tsx +0 -20
  337. package/src/v2/shadcn/components/ui/sheet.stories.tsx +0 -115
  338. package/src/v2/shadcn/components/ui/sheet.tsx +0 -107
  339. package/src/v2/shadcn/components/ui/sidebar.stories.tsx +0 -167
  340. package/src/v2/shadcn/components/ui/sidebar.tsx +0 -637
  341. package/src/v2/shadcn/components/ui/skeleton.stories.tsx +0 -36
  342. package/src/v2/shadcn/components/ui/skeleton.tsx +0 -7
  343. package/src/v2/shadcn/components/ui/slider.stories.tsx +0 -16
  344. package/src/v2/shadcn/components/ui/slider.tsx +0 -23
  345. package/src/v2/shadcn/components/ui/switch.scss +0 -63
  346. package/src/v2/shadcn/components/ui/switch.stories.tsx +0 -23
  347. package/src/v2/shadcn/components/ui/switch.tsx +0 -24
  348. package/src/v2/shadcn/components/ui/table-pagination.stories.tsx +0 -81
  349. package/src/v2/shadcn/components/ui/table-pagination.tsx +0 -61
  350. package/src/v2/shadcn/components/ui/table.stories.tsx +0 -40
  351. package/src/v2/shadcn/components/ui/table.tsx +0 -72
  352. package/src/v2/shadcn/components/ui/tabs.stories.tsx +0 -85
  353. package/src/v2/shadcn/components/ui/tabs.tsx +0 -53
  354. package/src/v2/shadcn/components/ui/textarea.stories.tsx +0 -15
  355. package/src/v2/shadcn/components/ui/textarea.tsx +0 -21
  356. package/src/v2/shadcn/components/ui/toast.stories.tsx +0 -77
  357. package/src/v2/shadcn/components/ui/toast.tsx +0 -111
  358. package/src/v2/shadcn/components/ui/toaster.stories.tsx +0 -46
  359. package/src/v2/shadcn/components/ui/toaster.tsx +0 -24
  360. package/src/v2/shadcn/components/ui/toggle-group.stories.tsx +0 -95
  361. package/src/v2/shadcn/components/ui/toggle-group.tsx +0 -49
  362. package/src/v2/shadcn/components/ui/toggle.stories.tsx +0 -18
  363. package/src/v2/shadcn/components/ui/toggle.tsx +0 -37
  364. package/src/v2/shadcn/components/ui/tooltip.stories.tsx +0 -57
  365. package/src/v2/shadcn/components/ui/tooltip.tsx +0 -28
  366. package/src/v2/shadcn/components/ui/use-toast.ts +0 -3
  367. package/src/v2/shadcn/hooks/use-mobile.tsx +0 -19
  368. package/src/v2/shadcn/hooks/use-toast.ts +0 -184
  369. package/src/v2/shadcn/index.ts +0 -76
  370. package/src/v2/shadcn/lib/utils.ts +0 -6
  371. package/src/v2/shadcn/styles/globals.css +0 -112
@@ -1,688 +0,0 @@
1
- import React, { useState, useEffect } from 'react';
2
- import { useLocation, useNavigate, useParams } from 'react-router-dom';
3
- import { IconUpdate, IconListView, IconGridView, IconCalendar, IconPlusThick } from '../../icons';
4
- import { Button } from './ui/button';
5
- import { Input } from './ui/input';
6
- import { FlowCard } from './FlowCard';
7
- import { DataTable } from './tables';
8
- import { ColumnConfig, RowAction } from './tables/types';
9
- import { Badge } from './ui/badge';
10
- import { supabase } from '@/integrations/supabase/client';
11
- import LoadingSpinner from './LoadingSpinner';
12
- import { useNotify } from '../hooks/useNotify';
13
- import EmptyState from './EmptyState';
14
- import { BookingsIcon } from './emptyStateIcons';
15
- import { QuickFilters } from './QuickFilters';
16
- import { DiaryView } from './DiaryView';
17
- import { ScheduleView } from './ScheduleView';
18
- import { SessionDetailView } from './SessionDetailView';
19
- import { QuickAddPanel } from './QuickAddPanel';
20
- import { useProviderSafe } from '@/contexts/ProviderContext';
21
- import { format, addDays } from 'date-fns';
22
-
23
- interface Flow {
24
- id: string;
25
- type: 'booking' | 'enquiry';
26
- reference_number: string;
27
- created_at: string;
28
- customer_name: string;
29
- customer_email: string | null;
30
- total_amount: number;
31
- net_amount: number;
32
- activity_name: string;
33
- booking_date: string;
34
- booking_time_start: string;
35
- booking_time_end: string | null;
36
- status: string;
37
- tags: string[];
38
- }
39
-
40
- interface FlowsContentProps {
41
- providerId?: string;
42
- companyId?: string;
43
- showDiaryView?: boolean;
44
- showScheduleView?: boolean;
45
- onSessionDetailChange?: (isViewingDetail: boolean) => void;
46
- onAddFlow?: () => void;
47
- }
48
-
49
- interface Zone {
50
- id: string;
51
- name: string;
52
- }
53
-
54
- interface SessionSlot {
55
- productId: string;
56
- productName: string;
57
- startTime: string;
58
- endTime: string;
59
- capacity: number;
60
- bookedCount: number;
61
- bookings: Flow[];
62
- }
63
-
64
- type ViewMode = 'list' | 'grid' | 'diary' | 'schedule';
65
- type FilterType = 'all' | 'bookings' | 'enquiries' | 'made_today' | 'for_today';
66
- type DiaryFilterType = 'today' | 'tomorrow';
67
- type ZoneFilterType = 'all' | string;
68
-
69
- const statusColors: Record<string, string> = {
70
- active: 'bg-surface-status-success text-label-status-success border-border-status-success',
71
- cancelled: 'bg-surface-status-error text-label-status-error border-border-status-error',
72
- declined: 'bg-surface-status-error text-label-status-error border-border-status-error',
73
- initial_contact: 'bg-surface-status-info text-label-status-info border-border-status-info',
74
- action_required: 'bg-surface-status-warning text-label-status-warning border-border-status-warning',
75
- ready_to_convert: 'bg-surface-status-success text-label-status-success border-border-status-success',
76
- };
77
-
78
- const formatStatus = (status: string): string => {
79
- return status
80
- .split('_')
81
- .map(word => word.charAt(0).toUpperCase() + word.slice(1))
82
- .join(' ');
83
- };
84
-
85
- export const FlowsContent: React.FC<FlowsContentProps> = ({
86
- providerId,
87
- companyId,
88
- showDiaryView = true,
89
- showScheduleView = false,
90
- onSessionDetailChange,
91
- onAddFlow,
92
- }) => {
93
- const location = useLocation();
94
- const navigate = useNavigate();
95
- const { showSuccess, showError, showInfo } = useNotify();
96
- const { companyId: urlCompanyId, providerId: urlProviderId } = useParams<{ companyId?: string; providerId?: string }>();
97
- const providerContext = useProviderSafe();
98
- const provider = providerContext?.provider ?? null;
99
- const navigationState = location.state as { preserveDiaryView?: boolean; preserveView?: string } | null;
100
-
101
- // Initialize viewMode as null until provider loads
102
- const [viewMode, setViewMode] = useState<ViewMode | null>(null);
103
-
104
- // Session detail state for schedule view
105
- const [selectedSession, setSelectedSession] = useState<SessionSlot | null>(null);
106
- const [sessionDate, setSessionDate] = useState<string>('');
107
- const [sessionDateFormatted, setSessionDateFormatted] = useState<string>(''); // yyyy-MM-dd format for QuickAddPanel
108
-
109
- // Quick Add Panel state for schedule
110
- const [isQuickAddOpen, setIsQuickAddOpen] = useState(false);
111
-
112
- // Track if user has manually changed the view this session
113
- const sessionViewKey = `flowsViewMode-${providerId}`;
114
-
115
- // Set viewMode once provider is loaded
116
- useEffect(() => {
117
- if (provider && viewMode === null) {
118
- // First check navigation state for preserveView (returning from flow detail)
119
- if (navigationState?.preserveView && ['list', 'grid', 'diary', 'schedule'].includes(navigationState.preserveView)) {
120
- const preservedView = navigationState.preserveView as ViewMode;
121
- if (preservedView === 'diary' && !showDiaryView) {
122
- setViewMode(provider.default_flows_view || 'list');
123
- } else if (preservedView === 'schedule' && !showScheduleView) {
124
- setViewMode(provider.default_flows_view || 'list');
125
- } else {
126
- setViewMode(preservedView);
127
- }
128
- return;
129
- }
130
-
131
- // Check navigation state (for returning from AddFlow with diary)
132
- if (navigationState?.preserveDiaryView && showDiaryView) {
133
- setViewMode('diary');
134
- return;
135
- }
136
-
137
- // Check for session-stored view (user's manual selection during this session)
138
- const sessionView = sessionStorage.getItem(sessionViewKey) as ViewMode | null;
139
- if (sessionView && ['list', 'grid', 'diary', 'schedule'].includes(sessionView)) {
140
- // Validate diary is enabled if that's the stored view
141
- if (sessionView === 'diary' && !showDiaryView) {
142
- setViewMode(provider.default_flows_view || 'list');
143
- } else if (sessionView === 'schedule' && !showScheduleView) {
144
- setViewMode(provider.default_flows_view || 'list');
145
- } else {
146
- setViewMode(sessionView);
147
- }
148
- return;
149
- }
150
-
151
- // Use provider's default view setting (first load of session)
152
- const defaultView = provider.default_flows_view || 'list';
153
-
154
- // Only use diary/schedule if it's enabled for this view
155
- if (defaultView === 'diary' && !showDiaryView) {
156
- setViewMode('list');
157
- } else if (defaultView === 'schedule' && !showScheduleView) {
158
- setViewMode('list');
159
- } else {
160
- setViewMode(defaultView);
161
- }
162
- }
163
- }, [provider, viewMode, navigationState?.preserveDiaryView, navigationState?.preserveView, showDiaryView, showScheduleView, sessionViewKey]);
164
-
165
- // Persist view changes to sessionStorage (for navigation within session)
166
- useEffect(() => {
167
- if (viewMode) {
168
- sessionStorage.setItem(sessionViewKey, viewMode);
169
- }
170
- }, [viewMode, sessionViewKey]);
171
-
172
- // Clean up old localStorage preference (migrating to sessionStorage)
173
- useEffect(() => {
174
- localStorage.removeItem('flowsViewMode');
175
- }, []);
176
-
177
- const [activeFilters, setActiveFilters] = useState<string[]>(['all']);
178
- const [diaryFilter, setDiaryFilter] = useState<DiaryFilterType>('today');
179
- const [zoneFilter, setZoneFilter] = useState<ZoneFilterType>('all');
180
- const [zones, setZones] = useState<Zone[]>([]);
181
- const [searchQuery, setSearchQuery] = useState('');
182
- const [flows, setFlows] = useState<Flow[]>([]);
183
- const [isLoading, setIsLoading] = useState(true);
184
-
185
- // Clear the navigation state after using it
186
- useEffect(() => {
187
- if (navigationState?.preserveDiaryView) {
188
- window.history.replaceState({}, document.title);
189
- }
190
- }, [navigationState]);
191
-
192
- // Fetch zones for the provider
193
- useEffect(() => {
194
- if (providerId) {
195
- fetchZones();
196
- }
197
- }, [providerId]);
198
-
199
- const fetchZones = async () => {
200
- try {
201
- const { data, error } = await supabase
202
- .from('zones')
203
- .select('id, name')
204
- .eq('provider_id', providerId)
205
- .eq('status', 'active')
206
- .order('display_order');
207
-
208
- if (error) throw error;
209
- setZones(data || []);
210
- } catch (error) {
211
- console.error('Error fetching zones:', error);
212
- }
213
- };
214
-
215
- useEffect(() => {
216
- fetchFlows();
217
- }, [providerId, companyId, activeFilters]);
218
-
219
- const fetchFlows = async () => {
220
- setIsLoading(true);
221
- try {
222
- let query = supabase
223
- .from('bookings')
224
- .select('*')
225
- .order('created_at', { ascending: false });
226
-
227
- // CRITICAL: Filter by provider or company to avoid loading ALL flows
228
- if (providerId) {
229
- query = query.eq('provider_id', providerId);
230
- } else if (companyId) {
231
- // For company-level flows, get provider IDs first then filter
232
- const { data: companyProviders } = await supabase
233
- .from('providers')
234
- .select('id')
235
- .eq('company_id', companyId);
236
-
237
- if (companyProviders && companyProviders.length > 0) {
238
- const providerIds = companyProviders.map(p => p.id);
239
- query = query.in('provider_id', providerIds);
240
- } else {
241
- // No providers in company, no bookings to show
242
- setFlows([]);
243
- setIsLoading(false);
244
- return;
245
- }
246
- }
247
-
248
- const today = new Date().toISOString().split('T')[0];
249
- const isAllActive = activeFilters.length === 0 || (activeFilters.length === 1 && activeFilters[0] === 'all');
250
-
251
- if (!isAllActive) {
252
- // Type group filter
253
- if (activeFilters.includes('bookings')) {
254
- query = query.eq('type', 'booking');
255
- } else if (activeFilters.includes('enquiries')) {
256
- query = query.eq('type', 'enquiry');
257
- }
258
-
259
- // Date group filter
260
- if (activeFilters.includes('made_today')) {
261
- query = query.gte('created_at', `${today}T00:00:00`);
262
- } else if (activeFilters.includes('for_today')) {
263
- query = query.eq('booking_date', today);
264
- }
265
- }
266
-
267
- // Limit results for performance
268
- query = query.limit(500);
269
-
270
- const { data, error } = await query;
271
-
272
- if (error) throw error;
273
- setFlows(data || []);
274
- } catch (error) {
275
- console.error('Error fetching flows:', error);
276
- showError('Failed to load flows');
277
- } finally {
278
- setIsLoading(false);
279
- }
280
- };
281
-
282
- const filteredFlows = flows.filter(flow => {
283
- if (!searchQuery) return true;
284
- const search = searchQuery.toLowerCase();
285
- return (
286
- flow.reference_number.toLowerCase().includes(search) ||
287
- flow.customer_name.toLowerCase().includes(search) ||
288
- flow.customer_email?.toLowerCase().includes(search)
289
- );
290
- });
291
-
292
- const formatTime = (start: string, end: string | null) => {
293
- const startTime = start.slice(0, 5); // HH:mm
294
- const endTime = end ? end.slice(0, 5) : '';
295
- return endTime ? `${startTime} - ${endTime}` : startTime;
296
- };
297
-
298
- // Navigate to flow detail page
299
- const handleFlowClick = (flowId: string) => {
300
- const providerType = provider?.type === 'venue' ? 'venue' : 'promoter';
301
- const currentView = viewMode || 'list';
302
-
303
- // Build the URL based on context
304
- if (urlCompanyId && urlProviderId) {
305
- // Provider within company context
306
- navigate(`/company/${urlCompanyId}/${providerType}/${urlProviderId}/bookings/${flowId}`, {
307
- state: { fromView: currentView }
308
- });
309
- } else if (urlProviderId) {
310
- // Direct provider context
311
- navigate(`/${providerType}/${urlProviderId}/bookings/${flowId}`, {
312
- state: { fromView: currentView }
313
- });
314
- } else if (companyId) {
315
- // Company-level bookings
316
- navigate(`/company/${companyId}/bookings/${flowId}`, {
317
- state: { fromView: currentView }
318
- });
319
- }
320
- };
321
-
322
- const formatDate = (date: string) => {
323
- return new Date(date).toLocaleDateString('en-GB');
324
- };
325
-
326
- // Handle session click from ScheduleView
327
- const handleSessionClick = (session: SessionSlot, dateDisplay: string, dateFormatted: string) => {
328
- setSessionDate(dateDisplay);
329
- setSessionDateFormatted(dateFormatted);
330
- setSelectedSession(session);
331
- onSessionDetailChange?.(true);
332
- };
333
-
334
- const handleBackFromSession = () => {
335
- setSelectedSession(null);
336
- onSessionDetailChange?.(false);
337
- };
338
-
339
- // Handle add to session from SessionDetailView
340
- const handleAddToSession = () => {
341
- setIsQuickAddOpen(true);
342
- };
343
-
344
- const handleQuickAddSuccess = () => {
345
- // Refresh flows data
346
- fetchFlows();
347
- // Close quick add panel
348
- setIsQuickAddOpen(false);
349
- };
350
-
351
- const columns: ColumnConfig<Flow>[] = [
352
- {
353
- label: 'Reference',
354
- width: 'w-[160px] min-w-[160px]',
355
- render: (row: Flow) => (
356
- <div className="flex flex-col gap-1">
357
- <Badge
358
- variant="outline"
359
- className={`text-[10px] font-mono font-bold px-2 py-0.5 rounded-full border w-fit ${
360
- row.type === 'booking'
361
- ? 'bg-blue-50 dark:bg-blue-950/30 text-blue-600 dark:text-blue-400 border-blue-200 dark:border-blue-800'
362
- : 'bg-orange-50 dark:bg-orange-950/30 text-orange-600 dark:text-orange-400 border-orange-200 dark:border-orange-800'
363
- }`}
364
- >
365
- {row.type === 'booking' ? 'BKG' : 'ENQ'}
366
- </Badge>
367
- <span className="text-label-primary text-sm font-semibold">
368
- #{row.reference_number}
369
- </span>
370
- <span className="text-label-tertiary text-xs">
371
- {formatDate(row.created_at)}
372
- </span>
373
- </div>
374
- ),
375
- },
376
- {
377
- label: 'Customer',
378
- width: 'flex-1 min-w-0',
379
- render: (row: Flow) => (
380
- <div className="flex flex-col gap-1 min-w-0">
381
- <span className="text-label-primary text-sm font-medium truncate">
382
- {row.customer_name}
383
- </span>
384
- <span className="text-label-tertiary text-xs truncate">
385
- {row.customer_email}
386
- </span>
387
- {row.tags.length > 0 && (
388
- <div className="flex flex-wrap gap-1 mt-1">
389
- {row.tags.slice(0, 2).map((tag, index) => (
390
- <Badge key={index} variant="outline" className="text-[10px] px-1.5 py-0 rounded-full">
391
- {tag}
392
- </Badge>
393
- ))}
394
- {row.tags.length > 2 && (
395
- <Badge variant="outline" className="text-[10px] px-1.5 py-0 rounded-full">
396
- +{row.tags.length - 2}
397
- </Badge>
398
- )}
399
- </div>
400
- )}
401
- </div>
402
- ),
403
- },
404
- {
405
- label: 'Activity',
406
- width: 'flex-1 min-w-0',
407
- render: (row: Flow) => (
408
- <div className="flex flex-col gap-0.5 min-w-0">
409
- <span className="text-label-primary text-sm font-medium truncate">
410
- {row.activity_name}
411
- </span>
412
- <span className="text-label-tertiary text-xs">
413
- {formatDate(row.booking_date)} • {formatTime(row.booking_time_start, row.booking_time_end)}
414
- </span>
415
- </div>
416
- ),
417
- },
418
- {
419
- label: 'Revenue',
420
- width: 'w-[100px] min-w-[100px]',
421
- render: (row: Flow) => (
422
- <div className="flex flex-col gap-0.5">
423
- <span className="text-label-primary text-sm font-semibold">
424
- £{row.total_amount.toFixed(2)}
425
- </span>
426
- <span className="text-label-tertiary text-xs">
427
- Net: £{row.net_amount.toFixed(2)}
428
- </span>
429
- </div>
430
- ),
431
- },
432
- {
433
- label: 'Status',
434
- width: 'w-[120px] min-w-[120px]',
435
- render: (row: Flow) => (
436
- <Badge className={`${statusColors[row.status] || statusColors.active} text-xs px-2 py-1`}>
437
- {formatStatus(row.status)}
438
- </Badge>
439
- ),
440
- },
441
- ];
442
-
443
- const rowActions = (flow: Flow): RowAction<Flow>[] => [
444
- {
445
- label: 'Edit',
446
- onClick: (flow) => {
447
- console.log('Edit flow:', flow);
448
- showInfo('Edit flow functionality coming soon');
449
- },
450
- },
451
- {
452
- label: 'Delete',
453
- onClick: (flow) => {
454
- console.log('Delete flow:', flow);
455
- showInfo('Delete flow functionality coming soon');
456
- },
457
- variant: 'danger',
458
- },
459
- ];
460
-
461
- // Show loading while waiting for provider to load and set viewMode
462
- if (isLoading || viewMode === null) {
463
- return (
464
- <div className="flex items-center justify-center py-12">
465
- <LoadingSpinner size="sm" />
466
- </div>
467
- );
468
- }
469
-
470
- if (flows.length === 0 && (activeFilters.length === 0 || (activeFilters.length === 1 && activeFilters[0] === 'all')) && !searchQuery) {
471
- return (
472
- <EmptyState
473
- icon={<BookingsIcon />}
474
- title="You have no bookings"
475
- description="Bookings and enquiries will appear here."
476
- />
477
- );
478
- }
479
-
480
- // If viewing session detail from schedule
481
- if (viewMode === 'schedule' && selectedSession) {
482
- return (
483
- <>
484
- <SessionDetailView
485
- session={selectedSession}
486
- date={sessionDate}
487
- dateFormatted={sessionDateFormatted}
488
- onBack={handleBackFromSession}
489
- onAddToSession={handleAddToSession}
490
- />
491
- {/* Quick Add Panel for schedule sessions */}
492
- {providerId && (
493
- <QuickAddPanel
494
- isOpen={isQuickAddOpen}
495
- onClose={() => setIsQuickAddOpen(false)}
496
- onSuccess={handleQuickAddSuccess}
497
- providerId={providerId}
498
- providerType={provider?.type || 'venue'}
499
- prefilledDate={sessionDateFormatted}
500
- prefilledTime={selectedSession.startTime}
501
- prefilledZoneName={selectedSession.productName}
502
- />
503
- )}
504
- </>
505
- );
506
- }
507
-
508
- return (
509
- <div className="flex flex-col gap-4 w-full min-w-0">
510
- {/* View Mode Toggle */}
511
- <div className="flex items-center justify-between w-full">
512
- <div className="flex items-center gap-1 bg-surface-primary rounded-full p-1 border border-border-primary w-fit max-sm:w-full">
513
- <Button
514
- variant="ghost"
515
- size="sm"
516
- withIcon
517
- onClick={() => setViewMode('list')}
518
- className={`h-8 rounded-full border-0 max-sm:flex-1 ${viewMode === 'list' ? 'bg-fill-primary text-label-white hover:bg-fill-primary hover:text-label-white' : 'hover:bg-surface-secondary'}`}
519
- >
520
- <IconListView className="w-4 h-4" />
521
- List
522
- </Button>
523
- <Button
524
- variant="ghost"
525
- size="sm"
526
- withIcon
527
- onClick={() => setViewMode('grid')}
528
- className={`h-8 rounded-full border-0 max-sm:flex-1 ${viewMode === 'grid' ? 'bg-fill-primary text-label-white hover:bg-fill-primary hover:text-label-white' : 'hover:bg-surface-secondary'}`}
529
- >
530
- <IconGridView className="w-4 h-4" />
531
- Grid
532
- </Button>
533
- {showDiaryView && (
534
- <Button
535
- variant="ghost"
536
- size="sm"
537
- withIcon
538
- onClick={() => setViewMode('diary')}
539
- className={`h-8 rounded-full border-0 max-sm:flex-1 ${viewMode === 'diary' ? 'bg-fill-primary text-label-white hover:bg-fill-primary hover:text-label-white' : 'hover:bg-surface-secondary'}`}
540
- >
541
- <IconCalendar className="w-4 h-4" />
542
- Diary
543
- </Button>
544
- )}
545
- {showScheduleView && (
546
- <Button
547
- variant="ghost"
548
- size="sm"
549
- withIcon
550
- onClick={() => setViewMode('schedule')}
551
- className={`h-8 rounded-full border-0 max-sm:flex-1 ${viewMode === 'schedule' ? 'bg-fill-primary text-label-white hover:bg-fill-primary hover:text-label-white' : 'hover:bg-surface-secondary'}`}
552
- >
553
- <IconCalendar className="w-4 h-4" />
554
- Schedule
555
- </Button>
556
- )}
557
- </div>
558
- </div>
559
-
560
- {/* Search and Controls - Hidden in diary/schedule view */}
561
- {viewMode !== 'diary' && viewMode !== 'schedule' && (
562
- <div className="flex flex-col gap-3">
563
- {/* Search Input */}
564
- <div className="flex flex-col gap-1 min-w-0 w-full sm:max-w-[480px] max-sm:w-full">
565
- <label className="text-label-primary text-[13px] font-medium">Search</label>
566
- <Input
567
- value={searchQuery}
568
- onChange={(e) => setSearchQuery(e.target.value)}
569
- />
570
- <span className="text-label-secondary text-[11px] font-normal">
571
- Search by name, email or reference number.
572
- </span>
573
- </div>
574
-
575
- {/* Quick Filters with Refresh */}
576
- <div className="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between w-full">
577
- <QuickFilters
578
- filters={[
579
- { value: 'bookings', label: 'Bookings', group: 'type' },
580
- { value: 'enquiries', label: 'Enquiries', group: 'type' },
581
- { value: 'made_today', label: 'Made Today', group: 'date' },
582
- { value: 'for_today', label: 'For Today', group: 'date' },
583
- ]}
584
- activeFilters={activeFilters}
585
- onFilterChange={setActiveFilters}
586
- multiSelect
587
- groupDividerAfter="enquiries"
588
- />
589
- <div className="flex gap-2 flex-shrink-0 max-sm:self-start">
590
- {onAddFlow && (
591
- <Button variant="ghost" size="sm" withIcon onClick={onAddFlow}>
592
- <IconPlusThick className="w-4 h-4" />
593
- New Flow
594
- </Button>
595
- )}
596
- <Button variant="ghost" size="sm" withIcon onClick={fetchFlows}>
597
- <IconUpdate className="w-4 h-4" />
598
- Refresh
599
- </Button>
600
- </div>
601
- </div>
602
- </div>
603
- )}
604
-
605
- {/* Refresh - mobile only, for diary/schedule views */}
606
- {(viewMode === 'diary' || viewMode === 'schedule') && (
607
- <div className="flex justify-end">
608
- <Button variant="ghost" size="sm" withIcon onClick={fetchFlows}>
609
- <IconUpdate className="w-4 h-4" />
610
- Refresh
611
- </Button>
612
- </div>
613
- )}
614
-
615
- {/* Content */}
616
- {viewMode === 'diary' ? (
617
- <div className="w-full min-w-0">
618
- {providerId ? (
619
- <DiaryView
620
- providerId={providerId}
621
- selectedDate={diaryFilter}
622
- selectedZoneId={zoneFilter !== 'all' ? zoneFilter : undefined}
623
- zoneFilters={zones}
624
- onZoneFilterChange={(filter) => setZoneFilter(filter as ZoneFilterType)}
625
- onFlowClick={handleFlowClick}
626
- />
627
- ) : (
628
- <div className="text-center py-12 text-label-tertiary">
629
- Diary view is only available at the provider level.
630
- </div>
631
- )}
632
- </div>
633
- ) : viewMode === 'schedule' ? (
634
- <div className="w-full min-w-0">
635
- {providerId ? (
636
- <ScheduleView
637
- providerId={providerId}
638
- onSessionClick={handleSessionClick}
639
- />
640
- ) : (
641
- <div className="text-center py-12 text-label-tertiary">
642
- Schedule view is only available at the provider level.
643
- </div>
644
- )}
645
- </div>
646
- ) : filteredFlows.length === 0 ? (
647
- <div className="text-center py-12 text-label-tertiary">
648
- No bookings found matching your search.
649
- </div>
650
- ) : (
651
- <>
652
- {viewMode === 'grid' && (
653
- <div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4">
654
- {filteredFlows.map((flow) => (
655
- <FlowCard
656
- key={flow.id}
657
- id={flow.id}
658
- type={flow.type}
659
- referenceNumber={flow.reference_number}
660
- date={flow.created_at}
661
- customerName={flow.customer_name}
662
- customerEmail={flow.customer_email || ''}
663
- totalAmount={flow.total_amount}
664
- netAmount={flow.net_amount}
665
- activityName={flow.activity_name}
666
- bookingTime={`${formatDate(flow.booking_date)} • ${formatTime(flow.booking_time_start, flow.booking_time_end)}`}
667
- status={flow.status}
668
- tags={flow.tags}
669
- onClick={handleFlowClick}
670
- />
671
- ))}
672
- </div>
673
- )}
674
-
675
- {viewMode === 'list' && (
676
- <DataTable<Flow>
677
- data={filteredFlows}
678
- columns={columns}
679
- keyExtractor={(flow) => flow.id}
680
- rowActions={rowActions}
681
- onRowClick={(flow) => handleFlowClick(flow.id)}
682
- />
683
- )}
684
- </>
685
- )}
686
- </div>
687
- );
688
- };