@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.
Files changed (414) hide show
  1. package/bitbucket-pipelines.yml +4 -13
  2. package/dist/Maintenance/Maintenance.scss.js +1 -1
  3. package/dist/index.js +2 -0
  4. package/dist/product-set/form/ProductsControl.d.ts +1 -2
  5. package/dist/product-set/form/ProductsControl.d.ts.map +1 -1
  6. package/dist/product-set/form/ProductsControl.js +24 -0
  7. package/dist/v2/components/ActionMenu/ActionMenu.scss.js +1 -1
  8. package/dist/v2/components/Badge/Badge.scss.js +1 -1
  9. package/dist/v2/components/Button/Button.scss.js +1 -1
  10. package/dist/v2/components/Button/GhostButton.scss.js +1 -1
  11. package/dist/v2/components/Checkbox/Checkbox.scss.js +1 -1
  12. package/dist/v2/components/DataTable/DataTable.d.ts.map +1 -1
  13. package/dist/v2/components/DataTable/DataTable.js +2 -86
  14. package/dist/v2/components/IconButton/IconButton.scss.js +1 -1
  15. package/dist/v2/components/Modal/DeleteModal.d.ts.map +1 -1
  16. package/dist/v2/components/Modal/DeleteModal.js +11 -13
  17. package/dist/v2/components/Modal/DeleteModal.scss.js +1 -1
  18. package/dist/v2/components/NPSScore/NPSScore.scss.js +1 -1
  19. package/dist/v2/components/NewTabs/NewTabs.scss.js +1 -1
  20. package/dist/v2/components/PeriodCard/PeriodCard.d.ts +66 -0
  21. package/dist/v2/components/PeriodCard/PeriodCard.d.ts.map +1 -0
  22. package/dist/v2/components/PeriodCard/PeriodCard.js +351 -0
  23. package/dist/v2/components/PeriodCard/PeriodCard.scss.js +6 -0
  24. package/dist/v2/components/PeriodCard/index.d.ts +3 -0
  25. package/dist/v2/components/PeriodCard/index.d.ts.map +1 -0
  26. package/dist/v2/components/ReorderRow/ReorderRow.d.ts +24 -0
  27. package/dist/v2/components/ReorderRow/ReorderRow.d.ts.map +1 -0
  28. package/dist/v2/components/ReorderRow/ReorderRow.js +109 -0
  29. package/dist/v2/components/ReorderRow/ReorderRow.scss.js +6 -0
  30. package/dist/v2/components/ReorderRow/index.d.ts +3 -0
  31. package/dist/v2/components/ReorderRow/index.d.ts.map +1 -0
  32. package/dist/v2/components/Select/Select.scss.js +1 -1
  33. package/dist/v2/components/StatusBadge/StatusBadge.scss.js +1 -1
  34. package/dist/v2/components/StepIndicator/StepIndicator.scss.js +1 -1
  35. package/dist/v2/components/Tabs/Tabs.scss.js +1 -1
  36. package/dist/v2/components/Toggle/Toggle.d.ts.map +1 -1
  37. package/dist/v2/components/Toggle/Toggle.js +5 -8
  38. package/dist/v2/components/Tooltip/Tooltip.scss.js +1 -1
  39. package/dist/v2/components/UserAvatar/UserAvatar.scss.js +1 -1
  40. package/dist/v2/components/UserPanel/UserPanel.scss.js +1 -1
  41. package/dist/v2/components/WYSIWYGEditor/WYSIWYGEditor.scss.js +1 -1
  42. package/dist/v2/components/ZoneCard/ZoneCard.scss.js +1 -1
  43. package/dist/v2/components/index.d.ts +4 -0
  44. package/dist/v2/components/index.d.ts.map +1 -1
  45. package/dist/v2/dashboard-analytics/chart/Chart.scss.js +1 -1
  46. package/dist/v2/dashboard-analytics/metric-card/MetricCard.scss.js +1 -1
  47. package/dist/v2/dashboard-analytics/venue-card/VenueCard.scss.js +1 -1
  48. package/dist/v2/dashboard-analytics/venue-closed-card/VenueClosedCard.scss.js +1 -1
  49. package/dist/v2/icons/index.js +16 -1
  50. package/dist/v2/index.d.ts +8 -0
  51. package/dist/v2/index.d.ts.map +1 -1
  52. package/dist/v2/navigation/DashboardLayout/AdminSidebar.scss.js +1 -1
  53. package/dist/v2/navigation/DashboardLayout/DashboardLayout.scss.js +1 -1
  54. package/dist/v2/navigation/DashboardLayout/ProviderSidebar.scss.js +1 -1
  55. package/dist/v2/navigation/DashboardLayout/TopNavigation.scss.js +1 -1
  56. package/dist/v2/pages/Settings/SettingsTabs.scss.js +1 -1
  57. package/dist/v2/pages/Settings/components/SidebarCustomisation.js +5 -0
  58. package/dist/v2/pages/Settings/components/SidebarCustomisation.scss.js +1 -1
  59. package/dist/v2/pages/Settings/components/SidebarNavItem.js +5 -0
  60. package/dist/v2/pages/auth/AuthLayout/AuthLayout.scss.js +1 -1
  61. package/dist/v2/shadcn/components/ui/accordion.d.ts +8 -0
  62. package/dist/v2/shadcn/components/ui/accordion.d.ts.map +1 -0
  63. package/dist/v2/shadcn/components/ui/alert-dialog.d.ts +21 -0
  64. package/dist/v2/shadcn/components/ui/alert-dialog.d.ts.map +1 -0
  65. package/dist/v2/shadcn/components/ui/alert.d.ts +9 -0
  66. package/dist/v2/shadcn/components/ui/alert.d.ts.map +1 -0
  67. package/dist/v2/shadcn/components/ui/aspect-ratio.d.ts +4 -0
  68. package/dist/v2/shadcn/components/ui/aspect-ratio.d.ts.map +1 -0
  69. package/dist/v2/shadcn/components/ui/avatar.d.ts +7 -0
  70. package/dist/v2/shadcn/components/ui/avatar.d.ts.map +1 -0
  71. package/dist/v2/shadcn/components/ui/badge.d.ts +10 -0
  72. package/dist/v2/shadcn/components/ui/badge.d.ts.map +1 -0
  73. package/dist/v2/shadcn/components/ui/breadcrumb.d.ts +20 -0
  74. package/dist/v2/shadcn/components/ui/breadcrumb.d.ts.map +1 -0
  75. package/dist/v2/shadcn/components/ui/button.d.ts +14 -0
  76. package/dist/v2/shadcn/components/ui/button.d.ts.map +1 -0
  77. package/dist/v2/shadcn/components/ui/calendar.d.ts +9 -0
  78. package/dist/v2/shadcn/components/ui/calendar.d.ts.map +1 -0
  79. package/dist/v2/shadcn/components/ui/card.d.ts +9 -0
  80. package/dist/v2/shadcn/components/ui/card.d.ts.map +1 -0
  81. package/dist/v2/shadcn/components/ui/carousel.d.ts +19 -0
  82. package/dist/v2/shadcn/components/ui/carousel.d.ts.map +1 -0
  83. package/dist/v2/shadcn/components/ui/checkbox.d.ts +6 -0
  84. package/dist/v2/shadcn/components/ui/checkbox.d.ts.map +1 -0
  85. package/dist/v2/shadcn/components/ui/checkbox.js +115 -0
  86. package/dist/v2/shadcn/components/ui/checkbox.scss.js +6 -0
  87. package/dist/v2/shadcn/components/ui/collapsible.d.ts +6 -0
  88. package/dist/v2/shadcn/components/ui/collapsible.d.ts.map +1 -0
  89. package/dist/v2/shadcn/components/ui/command.d.ts +83 -0
  90. package/dist/v2/shadcn/components/ui/command.d.ts.map +1 -0
  91. package/dist/v2/shadcn/components/ui/context-menu.d.ts +28 -0
  92. package/dist/v2/shadcn/components/ui/context-menu.d.ts.map +1 -0
  93. package/dist/v2/shadcn/components/ui/dialog.d.ts +20 -0
  94. package/dist/v2/shadcn/components/ui/dialog.d.ts.map +1 -0
  95. package/dist/v2/shadcn/components/ui/dialog.js +169 -0
  96. package/dist/v2/shadcn/components/ui/drawer.d.ts +23 -0
  97. package/dist/v2/shadcn/components/ui/drawer.d.ts.map +1 -0
  98. package/dist/v2/shadcn/components/ui/dropdown-menu.d.ts +28 -0
  99. package/dist/v2/shadcn/components/ui/dropdown-menu.d.ts.map +1 -0
  100. package/dist/v2/shadcn/components/ui/form.d.ts +24 -0
  101. package/dist/v2/shadcn/components/ui/form.d.ts.map +1 -0
  102. package/dist/v2/shadcn/components/ui/hover-card.d.ts +7 -0
  103. package/dist/v2/shadcn/components/ui/hover-card.d.ts.map +1 -0
  104. package/dist/v2/shadcn/components/ui/input-otp.d.ts +35 -0
  105. package/dist/v2/shadcn/components/ui/input-otp.d.ts.map +1 -0
  106. package/dist/v2/shadcn/components/ui/input.d.ts +6 -0
  107. package/dist/v2/shadcn/components/ui/input.d.ts.map +1 -0
  108. package/dist/v2/shadcn/components/ui/label.d.ts +6 -0
  109. package/dist/v2/shadcn/components/ui/label.d.ts.map +1 -0
  110. package/dist/v2/shadcn/components/ui/menubar.d.ts +34 -0
  111. package/dist/v2/shadcn/components/ui/menubar.d.ts.map +1 -0
  112. package/dist/v2/shadcn/components/ui/navigation-menu.d.ts +13 -0
  113. package/dist/v2/shadcn/components/ui/navigation-menu.d.ts.map +1 -0
  114. package/dist/v2/shadcn/components/ui/pagination.d.ts +29 -0
  115. package/dist/v2/shadcn/components/ui/pagination.d.ts.map +1 -0
  116. package/dist/v2/shadcn/components/ui/popover.d.ts +7 -0
  117. package/dist/v2/shadcn/components/ui/popover.d.ts.map +1 -0
  118. package/dist/v2/shadcn/components/ui/progress.d.ts +5 -0
  119. package/dist/v2/shadcn/components/ui/progress.d.ts.map +1 -0
  120. package/dist/v2/shadcn/components/ui/radio-card.d.ts +12 -0
  121. package/dist/v2/shadcn/components/ui/radio-card.d.ts.map +1 -0
  122. package/dist/v2/shadcn/components/ui/radio-group.d.ts +6 -0
  123. package/dist/v2/shadcn/components/ui/radio-group.d.ts.map +1 -0
  124. package/dist/v2/shadcn/components/ui/scroll-area.d.ts +6 -0
  125. package/dist/v2/shadcn/components/ui/scroll-area.d.ts.map +1 -0
  126. package/dist/v2/shadcn/components/ui/select.d.ts +14 -0
  127. package/dist/v2/shadcn/components/ui/select.d.ts.map +1 -0
  128. package/dist/v2/shadcn/components/ui/separator.d.ts +5 -0
  129. package/dist/v2/shadcn/components/ui/separator.d.ts.map +1 -0
  130. package/dist/v2/shadcn/components/ui/sheet.d.ts +26 -0
  131. package/dist/v2/shadcn/components/ui/sheet.d.ts.map +1 -0
  132. package/dist/v2/shadcn/components/ui/sidebar.d.ts +67 -0
  133. package/dist/v2/shadcn/components/ui/sidebar.d.ts.map +1 -0
  134. package/dist/v2/shadcn/components/ui/skeleton.d.ts +3 -0
  135. package/dist/v2/shadcn/components/ui/skeleton.d.ts.map +1 -0
  136. package/dist/v2/shadcn/components/ui/slider.d.ts +5 -0
  137. package/dist/v2/shadcn/components/ui/slider.d.ts.map +1 -0
  138. package/dist/v2/shadcn/components/ui/switch.d.ts +6 -0
  139. package/dist/v2/shadcn/components/ui/switch.d.ts.map +1 -0
  140. package/dist/v2/shadcn/components/ui/switch.js +115 -0
  141. package/dist/v2/shadcn/components/ui/switch.scss.js +6 -0
  142. package/dist/v2/shadcn/components/ui/table-pagination.d.ts +11 -0
  143. package/dist/v2/shadcn/components/ui/table-pagination.d.ts.map +1 -0
  144. package/dist/v2/shadcn/components/ui/table.d.ts +11 -0
  145. package/dist/v2/shadcn/components/ui/table.d.ts.map +1 -0
  146. package/dist/v2/shadcn/components/ui/tabs.d.ts +8 -0
  147. package/dist/v2/shadcn/components/ui/tabs.d.ts.map +1 -0
  148. package/dist/v2/shadcn/components/ui/textarea.d.ts +6 -0
  149. package/dist/v2/shadcn/components/ui/textarea.d.ts.map +1 -0
  150. package/dist/v2/shadcn/components/ui/toast.d.ts +16 -0
  151. package/dist/v2/shadcn/components/ui/toast.d.ts.map +1 -0
  152. package/dist/v2/shadcn/components/ui/toaster.d.ts +2 -0
  153. package/dist/v2/shadcn/components/ui/toaster.d.ts.map +1 -0
  154. package/dist/v2/shadcn/components/ui/toggle-group.d.ts +13 -0
  155. package/dist/v2/shadcn/components/ui/toggle-group.d.ts.map +1 -0
  156. package/dist/v2/shadcn/components/ui/toggle.d.ts +13 -0
  157. package/dist/v2/shadcn/components/ui/toggle.d.ts.map +1 -0
  158. package/dist/v2/shadcn/components/ui/tooltip.d.ts +8 -0
  159. package/dist/v2/shadcn/components/ui/tooltip.d.ts.map +1 -0
  160. package/dist/v2/shadcn/components/ui/use-toast.d.ts +3 -0
  161. package/dist/v2/shadcn/components/ui/use-toast.d.ts.map +1 -0
  162. package/dist/v2/shadcn/hooks/use-mobile.d.ts +2 -0
  163. package/dist/v2/shadcn/hooks/use-mobile.d.ts.map +1 -0
  164. package/dist/v2/shadcn/hooks/use-toast.d.ts +45 -0
  165. package/dist/v2/shadcn/hooks/use-toast.d.ts.map +1 -0
  166. package/dist/v2/shadcn/index.d.ts +20 -0
  167. package/dist/v2/shadcn/index.d.ts.map +1 -0
  168. package/dist/v2/shadcn/lib/utils.d.ts +3 -0
  169. package/dist/v2/shadcn/lib/utils.d.ts.map +1 -0
  170. package/dist/v2/shadcn/lib/utils.js +11 -0
  171. package/dist/v2/shadcn/styles/globals.css +112 -0
  172. package/dist/v2/styles/form/NewInput.scss.js +1 -1
  173. package/package.json +6 -6
  174. package/rollup.config.js +2 -16
  175. package/src/iframe/payment/payment-status-page/PaymentStatusPage.tsx +1 -1
  176. package/src/product-set/form/ProductsControl.tsx +1 -2
  177. package/src/v2/components/DataTable/DataTable.tsx +1 -23
  178. package/src/v2/components/Modal/DeleteModal.tsx +20 -12
  179. package/src/v2/components/PeriodCard/PeriodCard.scss +157 -0
  180. package/src/v2/components/PeriodCard/PeriodCard.stories.tsx +245 -0
  181. package/src/v2/components/PeriodCard/PeriodCard.tsx +350 -0
  182. package/src/v2/components/PeriodCard/index.ts +8 -0
  183. package/src/v2/components/ReorderRow/ReorderRow.scss +68 -0
  184. package/src/v2/components/ReorderRow/ReorderRow.stories.tsx +124 -0
  185. package/src/v2/components/ReorderRow/ReorderRow.tsx +88 -0
  186. package/src/v2/components/ReorderRow/index.ts +2 -0
  187. package/src/v2/components/Toggle/Toggle.tsx +5 -6
  188. package/src/v2/components/index.ts +6 -0
  189. package/src/v2/index.ts +82 -0
  190. package/src/v2/shadcn/_reference/AccountManagerCard.tsx +45 -0
  191. package/src/v2/shadcn/_reference/AffiliatesTable.tsx +178 -0
  192. package/src/v2/shadcn/_reference/AuditArchive.tsx +165 -0
  193. package/src/v2/shadcn/_reference/AuditContent.tsx +270 -0
  194. package/src/v2/shadcn/_reference/AutomationsGeneralSettings.tsx +251 -0
  195. package/src/v2/shadcn/_reference/AvatarUpload.tsx +150 -0
  196. package/src/v2/shadcn/_reference/BookingsSummaryCard.tsx +268 -0
  197. package/src/v2/shadcn/_reference/CodeCleanUpAudit.tsx +274 -0
  198. package/src/v2/shadcn/_reference/CompaniesTable.tsx +387 -0
  199. package/src/v2/shadcn/_reference/ComponentAudit.tsx +239 -0
  200. package/src/v2/shadcn/_reference/ConfigureSettingsCard.tsx +95 -0
  201. package/src/v2/shadcn/_reference/CustomerCard.tsx +155 -0
  202. package/src/v2/shadcn/_reference/DashboardCards.tsx +50 -0
  203. package/src/v2/shadcn/_reference/DashboardFooter.tsx +18 -0
  204. package/src/v2/shadcn/_reference/DiarySettings.tsx +187 -0
  205. package/src/v2/shadcn/_reference/DiaryView.tsx +998 -0
  206. package/src/v2/shadcn/_reference/EmptyState.tsx +76 -0
  207. package/src/v2/shadcn/_reference/EntityInfoCard.tsx +48 -0
  208. package/src/v2/shadcn/_reference/ExistingUserAssignments.tsx +131 -0
  209. package/src/v2/shadcn/_reference/FeatureToggle.tsx +72 -0
  210. package/src/v2/shadcn/_reference/FlowCard.tsx +170 -0
  211. package/src/v2/shadcn/_reference/FlowsContent.tsx +688 -0
  212. package/src/v2/shadcn/_reference/FlowsGeneralSettings.tsx +27 -0
  213. package/src/v2/shadcn/_reference/GeneralSettings.tsx +33 -0
  214. package/src/v2/shadcn/_reference/InventoryGeneralSettings.tsx +82 -0
  215. package/src/v2/shadcn/_reference/LanguageSelector.tsx +97 -0
  216. package/src/v2/shadcn/_reference/LoadingScreen.tsx +25 -0
  217. package/src/v2/shadcn/_reference/LoadingSpinner.tsx +41 -0
  218. package/src/v2/shadcn/_reference/ManagedClientsList.tsx +121 -0
  219. package/src/v2/shadcn/_reference/NPSScore.tsx +379 -0
  220. package/src/v2/shadcn/_reference/NPSSummaryCard.tsx +181 -0
  221. package/src/v2/shadcn/_reference/NotificationBanner.tsx +129 -0
  222. package/src/v2/shadcn/_reference/NotificationPanel.tsx +208 -0
  223. package/src/v2/shadcn/_reference/OnlineUsersCard.tsx +73 -0
  224. package/src/v2/shadcn/_reference/ProtectedRoute.tsx +39 -0
  225. package/src/v2/shadcn/_reference/ProvidersTable.tsx +353 -0
  226. package/src/v2/shadcn/_reference/QuickAddPanel.tsx +1057 -0
  227. package/src/v2/shadcn/_reference/QuickFilters.tsx +112 -0
  228. package/src/v2/shadcn/_reference/ScheduleView.tsx +410 -0
  229. package/src/v2/shadcn/_reference/ScrollToTop.tsx +14 -0
  230. package/src/v2/shadcn/_reference/SecondaryNav.tsx +50 -0
  231. package/src/v2/shadcn/_reference/SecuritySettings.tsx +258 -0
  232. package/src/v2/shadcn/_reference/SessionDetailView.tsx +294 -0
  233. package/src/v2/shadcn/_reference/Sidebar.tsx +14 -0
  234. package/src/v2/shadcn/_reference/SidebarAwareLayout.tsx +30 -0
  235. package/src/v2/shadcn/_reference/SidebarLabelCustomization.tsx +285 -0
  236. package/src/v2/shadcn/_reference/SimulationBanner.tsx +57 -0
  237. package/src/v2/shadcn/_reference/SortControls.tsx +65 -0
  238. package/src/v2/shadcn/_reference/StatusBadge.tsx +49 -0
  239. package/src/v2/shadcn/_reference/StyleGuideContent.tsx +331 -0
  240. package/src/v2/shadcn/_reference/TableActionMenu.tsx +126 -0
  241. package/src/v2/shadcn/_reference/ThemeProvider.tsx +119 -0
  242. package/src/v2/shadcn/_reference/ThemeSettings.tsx +73 -0
  243. package/src/v2/shadcn/_reference/TopNavigation.tsx +332 -0
  244. package/src/v2/shadcn/_reference/UserActivityHistory.tsx +209 -0
  245. package/src/v2/shadcn/_reference/UserLanguageSettings.tsx +94 -0
  246. package/src/v2/shadcn/_reference/UserPanel.tsx +472 -0
  247. package/src/v2/shadcn/_reference/UsersTable.tsx +1023 -0
  248. package/src/v2/shadcn/_reference/WaiverForm.tsx +301 -0
  249. package/src/v2/shadcn/_reference/WaiversGeneralSettings.tsx +46 -0
  250. package/src/v2/shadcn/_reference/WaiversTable.tsx +290 -0
  251. package/src/v2/shadcn/_reference/WaiversTemplatesSettings.tsx +416 -0
  252. package/src/v2/shadcn/_reference/ai/AIChatPanel.tsx +313 -0
  253. package/src/v2/shadcn/_reference/ai/AIChatSearchBar.tsx +36 -0
  254. package/src/v2/shadcn/_reference/ai/ChatInteractiveBlock.tsx +298 -0
  255. package/src/v2/shadcn/_reference/ai/ChatMessageContent.tsx +40 -0
  256. package/src/v2/shadcn/_reference/ai/parseInteractiveBlocks.ts +142 -0
  257. package/src/v2/shadcn/_reference/auth/AuthLayout.tsx +55 -0
  258. package/src/v2/shadcn/_reference/auth/CreatePasswordForm.tsx +285 -0
  259. package/src/v2/shadcn/_reference/auth/CreatePasswordPanel.tsx +20 -0
  260. package/src/v2/shadcn/_reference/auth/LoginFooter.tsx +14 -0
  261. package/src/v2/shadcn/_reference/auth/LoginForm.tsx +205 -0
  262. package/src/v2/shadcn/_reference/auth/LoginPanel.tsx +41 -0
  263. package/src/v2/shadcn/_reference/auth/ResetPasswordForm.tsx +102 -0
  264. package/src/v2/shadcn/_reference/auth/ResetPasswordPanel.tsx +20 -0
  265. package/src/v2/shadcn/_reference/auth/VerifyEmailForm.tsx +95 -0
  266. package/src/v2/shadcn/_reference/auth/VerifyEmailPanel.tsx +20 -0
  267. package/src/v2/shadcn/_reference/email/EmailAttachment.tsx +119 -0
  268. package/src/v2/shadcn/_reference/email/EmailAutomation.tsx +92 -0
  269. package/src/v2/shadcn/_reference/email/EmailPlaceholders.tsx +64 -0
  270. package/src/v2/shadcn/_reference/email/UnlayerEmailEditor.tsx +41 -0
  271. package/src/v2/shadcn/_reference/email/emailTemplateData.ts +53 -0
  272. package/src/v2/shadcn/_reference/emptyStateIcons.tsx +103 -0
  273. package/src/v2/shadcn/_reference/games/MazeGame.tsx +394 -0
  274. package/src/v2/shadcn/_reference/games/RunnerGame.tsx +497 -0
  275. package/src/v2/shadcn/_reference/logos/BookedLogoFull.tsx +36 -0
  276. package/src/v2/shadcn/_reference/logos/BookedLogoMark.tsx +31 -0
  277. package/src/v2/shadcn/_reference/logos/BookedLogoNew.tsx +36 -0
  278. package/src/v2/shadcn/_reference/pricing/DynamicPricingRulesEditor.tsx +401 -0
  279. package/src/v2/shadcn/_reference/pricing/DynamicPricingTierCard.tsx +77 -0
  280. package/src/v2/shadcn/_reference/pricing/DynamicPricingTiersList.tsx +218 -0
  281. package/src/v2/shadcn/_reference/pricing/PricingCalendar.tsx +810 -0
  282. package/src/v2/shadcn/_reference/pricing/PricingPeriodCard.tsx +152 -0
  283. package/src/v2/shadcn/_reference/pricing/PricingPeriodForm.tsx +377 -0
  284. package/src/v2/shadcn/_reference/pricing/PricingPeriodsList.tsx +213 -0
  285. package/src/v2/shadcn/_reference/pricing/getRuleSummary.ts +39 -0
  286. package/src/v2/shadcn/_reference/products/AvailabilityRulesSection.tsx +184 -0
  287. package/src/v2/shadcn/_reference/products/AvailabilitySection.tsx +677 -0
  288. package/src/v2/shadcn/_reference/products/BookingTypeConfigOptions.tsx +40 -0
  289. package/src/v2/shadcn/_reference/products/CapacityPeriodsSection.tsx +238 -0
  290. package/src/v2/shadcn/_reference/products/DynamicPricingTiersSection.tsx +131 -0
  291. package/src/v2/shadcn/_reference/products/GiftCardOrdersTab.tsx +192 -0
  292. package/src/v2/shadcn/_reference/products/GiftCardSettings.tsx +342 -0
  293. package/src/v2/shadcn/_reference/products/PackageProductsSection.tsx +322 -0
  294. package/src/v2/shadcn/_reference/products/PricingSection.tsx +173 -0
  295. package/src/v2/shadcn/_reference/products/ProductTypeFields.tsx +353 -0
  296. package/src/v2/shadcn/_reference/products/ProductTypeIcon.tsx +95 -0
  297. package/src/v2/shadcn/_reference/products/VariablePricingSection.tsx +140 -0
  298. package/src/v2/shadcn/_reference/products/productTypeConfig.ts +182 -0
  299. package/src/v2/shadcn/_reference/shared/BackButton.tsx +50 -0
  300. package/src/v2/shadcn/_reference/shared/CancelConfirmationDialog.tsx +18 -0
  301. package/src/v2/shadcn/_reference/shared/ConfirmationDialog.tsx +136 -0
  302. package/src/v2/shadcn/_reference/shared/DeleteConfirmationDialog.tsx +18 -0
  303. package/src/v2/shadcn/_reference/shared/DeleteEntityPage.tsx +221 -0
  304. package/src/v2/shadcn/_reference/shared/SidebarIcons.tsx +108 -0
  305. package/src/v2/shadcn/_reference/shared/UnifiedSidebar.tsx +722 -0
  306. package/src/v2/shadcn/_reference/tables/BulkActionsBar.tsx +68 -0
  307. package/src/v2/shadcn/_reference/tables/DataTable.tsx +221 -0
  308. package/src/v2/shadcn/_reference/tables/TableControls.tsx +94 -0
  309. package/src/v2/shadcn/_reference/tables/index.ts +3 -0
  310. package/src/v2/shadcn/_reference/tables/types.ts +79 -0
  311. package/src/v2/shadcn/_reference/zones/LegacyZoneSettings.tsx +299 -0
  312. package/src/v2/shadcn/components/ui/accordion.stories.tsx +63 -0
  313. package/src/v2/shadcn/components/ui/accordion.tsx +52 -0
  314. package/src/v2/shadcn/components/ui/alert-dialog.stories.tsx +44 -0
  315. package/src/v2/shadcn/components/ui/alert-dialog.tsx +104 -0
  316. package/src/v2/shadcn/components/ui/alert.stories.tsx +44 -0
  317. package/src/v2/shadcn/components/ui/alert.tsx +43 -0
  318. package/src/v2/shadcn/components/ui/aspect-ratio.stories.tsx +46 -0
  319. package/src/v2/shadcn/components/ui/aspect-ratio.tsx +5 -0
  320. package/src/v2/shadcn/components/ui/avatar.stories.tsx +39 -0
  321. package/src/v2/shadcn/components/ui/avatar.tsx +38 -0
  322. package/src/v2/shadcn/components/ui/badge.stories.tsx +17 -0
  323. package/src/v2/shadcn/components/ui/badge.tsx +30 -0
  324. package/src/v2/shadcn/components/ui/breadcrumb.stories.tsx +91 -0
  325. package/src/v2/shadcn/components/ui/breadcrumb.tsx +90 -0
  326. package/src/v2/shadcn/components/ui/button.stories.tsx +20 -0
  327. package/src/v2/shadcn/components/ui/button.tsx +60 -0
  328. package/src/v2/shadcn/components/ui/calendar.stories.tsx +61 -0
  329. package/src/v2/shadcn/components/ui/calendar.tsx +54 -0
  330. package/src/v2/shadcn/components/ui/card.stories.tsx +37 -0
  331. package/src/v2/shadcn/components/ui/card.tsx +43 -0
  332. package/src/v2/shadcn/components/ui/carousel.stories.tsx +92 -0
  333. package/src/v2/shadcn/components/ui/carousel.tsx +224 -0
  334. package/src/v2/shadcn/components/ui/checkbox.scss +38 -0
  335. package/src/v2/shadcn/components/ui/checkbox.stories.tsx +23 -0
  336. package/src/v2/shadcn/components/ui/checkbox.tsx +24 -0
  337. package/src/v2/shadcn/components/ui/collapsible.stories.tsx +59 -0
  338. package/src/v2/shadcn/components/ui/collapsible.tsx +9 -0
  339. package/src/v2/shadcn/components/ui/command.stories.tsx +70 -0
  340. package/src/v2/shadcn/components/ui/command.tsx +132 -0
  341. package/src/v2/shadcn/components/ui/context-menu.stories.tsx +72 -0
  342. package/src/v2/shadcn/components/ui/context-menu.tsx +178 -0
  343. package/src/v2/shadcn/components/ui/dialog.stories.tsx +67 -0
  344. package/src/v2/shadcn/components/ui/dialog.tsx +95 -0
  345. package/src/v2/shadcn/components/ui/drawer.stories.tsx +50 -0
  346. package/src/v2/shadcn/components/ui/drawer.tsx +87 -0
  347. package/src/v2/shadcn/components/ui/dropdown-menu.stories.tsx +73 -0
  348. package/src/v2/shadcn/components/ui/dropdown-menu.tsx +179 -0
  349. package/src/v2/shadcn/components/ui/form.stories.tsx +105 -0
  350. package/src/v2/shadcn/components/ui/form.tsx +129 -0
  351. package/src/v2/shadcn/components/ui/hover-card.stories.tsx +35 -0
  352. package/src/v2/shadcn/components/ui/hover-card.tsx +27 -0
  353. package/src/v2/shadcn/components/ui/input-otp.stories.tsx +72 -0
  354. package/src/v2/shadcn/components/ui/input-otp.tsx +61 -0
  355. package/src/v2/shadcn/components/ui/input.stories.tsx +16 -0
  356. package/src/v2/shadcn/components/ui/input.tsx +25 -0
  357. package/src/v2/shadcn/components/ui/label.stories.tsx +13 -0
  358. package/src/v2/shadcn/components/ui/label.tsx +17 -0
  359. package/src/v2/shadcn/components/ui/menubar.stories.tsx +86 -0
  360. package/src/v2/shadcn/components/ui/menubar.tsx +207 -0
  361. package/src/v2/shadcn/components/ui/navigation-menu.stories.tsx +68 -0
  362. package/src/v2/shadcn/components/ui/navigation-menu.tsx +120 -0
  363. package/src/v2/shadcn/components/ui/pagination.stories.tsx +78 -0
  364. package/src/v2/shadcn/components/ui/pagination.tsx +81 -0
  365. package/src/v2/shadcn/components/ui/popover.stories.tsx +44 -0
  366. package/src/v2/shadcn/components/ui/popover.tsx +29 -0
  367. package/src/v2/shadcn/components/ui/progress.stories.tsx +17 -0
  368. package/src/v2/shadcn/components/ui/progress.tsx +23 -0
  369. package/src/v2/shadcn/components/ui/radio-card.stories.tsx +68 -0
  370. package/src/v2/shadcn/components/ui/radio-card.tsx +52 -0
  371. package/src/v2/shadcn/components/ui/radio-group.stories.tsx +77 -0
  372. package/src/v2/shadcn/components/ui/radio-group.tsx +35 -0
  373. package/src/v2/shadcn/components/ui/scroll-area.stories.tsx +56 -0
  374. package/src/v2/shadcn/components/ui/scroll-area.tsx +38 -0
  375. package/src/v2/shadcn/components/ui/select.stories.tsx +60 -0
  376. package/src/v2/shadcn/components/ui/select.tsx +148 -0
  377. package/src/v2/shadcn/components/ui/separator.stories.tsx +30 -0
  378. package/src/v2/shadcn/components/ui/separator.tsx +20 -0
  379. package/src/v2/shadcn/components/ui/sheet.stories.tsx +115 -0
  380. package/src/v2/shadcn/components/ui/sheet.tsx +107 -0
  381. package/src/v2/shadcn/components/ui/sidebar.stories.tsx +167 -0
  382. package/src/v2/shadcn/components/ui/sidebar.tsx +637 -0
  383. package/src/v2/shadcn/components/ui/skeleton.stories.tsx +36 -0
  384. package/src/v2/shadcn/components/ui/skeleton.tsx +7 -0
  385. package/src/v2/shadcn/components/ui/slider.stories.tsx +16 -0
  386. package/src/v2/shadcn/components/ui/slider.tsx +23 -0
  387. package/src/v2/shadcn/components/ui/switch.scss +63 -0
  388. package/src/v2/shadcn/components/ui/switch.stories.tsx +23 -0
  389. package/src/v2/shadcn/components/ui/switch.tsx +24 -0
  390. package/src/v2/shadcn/components/ui/table-pagination.stories.tsx +81 -0
  391. package/src/v2/shadcn/components/ui/table-pagination.tsx +61 -0
  392. package/src/v2/shadcn/components/ui/table.stories.tsx +40 -0
  393. package/src/v2/shadcn/components/ui/table.tsx +72 -0
  394. package/src/v2/shadcn/components/ui/tabs.stories.tsx +85 -0
  395. package/src/v2/shadcn/components/ui/tabs.tsx +53 -0
  396. package/src/v2/shadcn/components/ui/textarea.stories.tsx +15 -0
  397. package/src/v2/shadcn/components/ui/textarea.tsx +21 -0
  398. package/src/v2/shadcn/components/ui/toast.stories.tsx +77 -0
  399. package/src/v2/shadcn/components/ui/toast.tsx +111 -0
  400. package/src/v2/shadcn/components/ui/toaster.stories.tsx +46 -0
  401. package/src/v2/shadcn/components/ui/toaster.tsx +24 -0
  402. package/src/v2/shadcn/components/ui/toggle-group.stories.tsx +95 -0
  403. package/src/v2/shadcn/components/ui/toggle-group.tsx +49 -0
  404. package/src/v2/shadcn/components/ui/toggle.stories.tsx +18 -0
  405. package/src/v2/shadcn/components/ui/toggle.tsx +37 -0
  406. package/src/v2/shadcn/components/ui/tooltip.stories.tsx +57 -0
  407. package/src/v2/shadcn/components/ui/tooltip.tsx +28 -0
  408. package/src/v2/shadcn/components/ui/use-toast.ts +3 -0
  409. package/src/v2/shadcn/hooks/use-mobile.tsx +19 -0
  410. package/src/v2/shadcn/hooks/use-toast.ts +184 -0
  411. package/src/v2/shadcn/index.ts +76 -0
  412. package/src/v2/shadcn/lib/utils.ts +6 -0
  413. package/src/v2/shadcn/styles/globals.css +112 -0
  414. package/.vscode/settings.json +0 -3
@@ -0,0 +1,152 @@
1
+ import React from 'react';
2
+ import { IconCalendar, IconTime } from '../../../icons';
3
+ import StatusBadge from '../StatusBadge';
4
+ import TableActionMenu from '../TableActionMenu';
5
+
6
+ export interface PricingPeriodRule {
7
+ type: 'range' | 'date_time';
8
+ // Range fields
9
+ start_date?: string;
10
+ end_date?: string;
11
+ // Date/Time fields
12
+ days?: string[];
13
+ // Shared time fields
14
+ is_24_hours?: boolean;
15
+ start_time?: string;
16
+ end_time?: string;
17
+ // Opening hours override fields
18
+ is_open?: boolean;
19
+ }
20
+
21
+ export interface PricingPeriod {
22
+ id: string;
23
+ provider_id: string;
24
+ name: string;
25
+ description: string | null;
26
+ colour: string;
27
+ priority: number;
28
+ is_active: boolean;
29
+ rules: PricingPeriodRule[];
30
+ display_order: number;
31
+ status: string;
32
+ dynamic_pricing_excluded: boolean;
33
+ created_at: string;
34
+ updated_at: string;
35
+ }
36
+
37
+ interface PricingPeriodCardProps {
38
+ period: PricingPeriod;
39
+ onEdit: (period: PricingPeriod) => void;
40
+ onDelete: (period: PricingPeriod) => void;
41
+ onToggleActive: (period: PricingPeriod) => void;
42
+ }
43
+
44
+ const isRangeExpired = (rule: PricingPeriodRule): boolean => {
45
+ if (rule.type !== 'range' || !rule.end_date) return false;
46
+ const today = new Date().toISOString().split('T')[0];
47
+ return rule.end_date < today;
48
+ };
49
+
50
+ const isPeriodExpired = (period: PricingPeriod): boolean => {
51
+ const rangeRules = period.rules.filter(r => r.type === 'range');
52
+ if (rangeRules.length === 0) return false;
53
+ return rangeRules.every(r => isRangeExpired(r));
54
+ };
55
+
56
+ const formatDateLocale = (dateStr: string): string => {
57
+ if (!dateStr) return '—';
58
+ const date = new Date(dateStr + 'T00:00:00');
59
+ return date.toLocaleDateString(undefined, { day: 'numeric', month: 'short', year: 'numeric' });
60
+ };
61
+
62
+ const DAY_ORDER = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'];
63
+
64
+ const sortDays = (days: string[]): string[] => {
65
+ return [...days].sort((a, b) => DAY_ORDER.indexOf(a) - DAY_ORDER.indexOf(b));
66
+ };
67
+
68
+ const getRuleParts = (rule: PricingPeriodRule): { primary: string; time?: string } => {
69
+ if (rule.type === 'range') {
70
+ const primary = `${formatDateLocale(rule.start_date || '')} to ${formatDateLocale(rule.end_date || '')}`;
71
+ const time = !rule.is_24_hours && rule.start_time && rule.end_time ? `${rule.start_time}–${rule.end_time}` : undefined;
72
+ return { primary, time };
73
+ }
74
+ if (rule.type === 'date_time') {
75
+ const primary = sortDays(rule.days || []).join(', ');
76
+ const time = !rule.is_24_hours && rule.start_time && rule.end_time ? `${rule.start_time}–${rule.end_time}` : undefined;
77
+ return { primary, time };
78
+ }
79
+ return { primary: '' };
80
+ };
81
+
82
+ const PricingPeriodCard: React.FC<PricingPeriodCardProps> = ({ period, onEdit, onDelete, onToggleActive }) => {
83
+ const expired = isPeriodExpired(period);
84
+ return (
85
+ <div className="flex flex-col gap-3 p-4 border border-border-primary rounded-lg bg-surface-primary">
86
+ <div className="flex items-start justify-between gap-4">
87
+ <div className="flex items-start gap-3 flex-1 min-w-0">
88
+ <span
89
+ className="w-3 h-3 rounded-full flex-shrink-0 mt-1.5"
90
+ style={{ backgroundColor: period.colour }}
91
+ />
92
+ <div className="flex flex-col gap-0.5 min-w-0">
93
+ <p className="text-label-primary font-semibold text-base">{period.name}</p>
94
+ {period.description && (
95
+ <p className="text-label-secondary text-sm">{period.description}</p>
96
+ )}
97
+ </div>
98
+ </div>
99
+ <div className="flex items-center gap-2 flex-shrink-0">
100
+ <span className="text-label-secondary text-xs border border-border-primary rounded-full px-2.5 py-0.5">
101
+ Priority {period.priority}
102
+ </span>
103
+ <StatusBadge status={expired ? 'expired' : period.is_active ? 'active' : 'disabled'} />
104
+ <TableActionMenu
105
+ items={[
106
+ { label: 'Edit', onClick: () => onEdit(period) },
107
+ { label: period.is_active ? 'Deactivate' : 'Activate', onClick: () => onToggleActive(period) },
108
+ { label: 'Delete', onClick: () => onDelete(period), variant: 'danger' },
109
+ ]}
110
+ />
111
+ </div>
112
+ </div>
113
+ {period.rules.length > 0 && (
114
+ <div className={`flex flex-col ml-6 ${period.rules.length > 1 ? 'divide-y divide-border-primary' : ''}`}>
115
+ {[...period.rules]
116
+ .sort((a, b) => {
117
+ const dateA = a.start_date || '';
118
+ const dateB = b.start_date || '';
119
+ if (a.type === 'range' && b.type === 'range') return dateA.localeCompare(dateB);
120
+ if (a.type === 'range') return -1;
121
+ if (b.type === 'range') return 1;
122
+ return 0;
123
+ })
124
+ .map((rule, idx) => {
125
+ const parts = getRuleParts(rule);
126
+ const ruleExpired = isRangeExpired(rule);
127
+ return (
128
+ <div key={idx} className="flex items-center gap-2.5 text-sm py-2 first:pt-0 last:pb-0">
129
+ {rule.type === 'range' ? (
130
+ <IconCalendar className="w-5 h-5 fill-fill-secondary flex-shrink-0" />
131
+ ) : (
132
+ <IconTime className="w-5 h-5 fill-fill-secondary flex-shrink-0" />
133
+ )}
134
+ <div className="flex flex-col flex-1 min-w-0">
135
+ <span className={ruleExpired ? "text-label-secondary" : "text-label-primary"}>{parts.primary}</span>
136
+ {parts.time && <span className="text-label-secondary">{parts.time}</span>}
137
+ </div>
138
+ {ruleExpired && (
139
+ <div className="flex-shrink-0">
140
+ <StatusBadge status="expired" />
141
+ </div>
142
+ )}
143
+ </div>
144
+ );
145
+ })}
146
+ </div>
147
+ )}
148
+ </div>
149
+ );
150
+ };
151
+
152
+ export default PricingPeriodCard;
@@ -0,0 +1,377 @@
1
+ import React, { useState } from 'react';
2
+ import { useNotify } from '../../hooks/useNotify';
3
+ import { Button } from '../ui/button';
4
+ import { Input } from '../ui/input';
5
+ import { Label } from '../ui/label';
6
+ import { Textarea } from '../ui/textarea';
7
+ import { Checkbox } from '../ui/checkbox';
8
+ import { Switch } from '../ui/switch';
9
+ import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../ui/select';
10
+ import { IconPlus, IconDelete, IconTime, IconCalendar } from '../../../icons';
11
+ import type { PricingPeriod, PricingPeriodRule } from './PricingPeriodCard';
12
+
13
+ const COLOUR_OPTIONS = [
14
+ { value: '#3B82F6', label: 'Blue' },
15
+ { value: '#EF4444', label: 'Red' },
16
+ { value: '#22C55E', label: 'Green' },
17
+ { value: '#EAB308', label: 'Yellow' },
18
+ { value: '#8B5CF6', label: 'Purple' },
19
+ { value: '#F97316', label: 'Orange' },
20
+ { value: '#EC4899', label: 'Pink' },
21
+ { value: '#14B8A6', label: 'Teal' },
22
+ ];
23
+
24
+ const DAY_OPTIONS = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'];
25
+
26
+ interface PricingPeriodFormProps {
27
+ period?: PricingPeriod | null;
28
+ onSave: (data: {
29
+ name: string;
30
+ description: string;
31
+ colour: string;
32
+ is_active: boolean;
33
+ dynamic_pricing_excluded: boolean;
34
+ rules: PricingPeriodRule[];
35
+ }) => void;
36
+ onBack: () => void;
37
+ isSaving?: boolean;
38
+ showHeader?: boolean;
39
+ }
40
+
41
+ const PricingPeriodForm: React.FC<PricingPeriodFormProps> = ({ period, onSave, onBack, isSaving, showHeader = true }) => {
42
+ const { showError } = useNotify();
43
+ const isEditing = !!period;
44
+ const [name, setName] = useState(period?.name || '');
45
+ const [description, setDescription] = useState(period?.description || '');
46
+ const [colour, setColour] = useState(period?.colour || '#3B82F6');
47
+
48
+ const [isActive, setIsActive] = useState(period?.is_active ?? true);
49
+ const [dynamicPricingExcluded, setDynamicPricingExcluded] = useState(period?.dynamic_pricing_excluded ?? false);
50
+ const [ruleErrors, setRuleErrors] = useState<Record<number, string>>({});
51
+ const [rules, setRules] = useState<PricingPeriodRule[]>(() => {
52
+ // Migrate legacy rule types on load
53
+ if (!period?.rules) return [];
54
+ const migrated = period.rules.map(r => {
55
+ if (r.type === 'time' as string) {
56
+ return { ...r, type: 'date_time' as const, is_24_hours: false };
57
+ }
58
+ if (r.type === 'date_range' as string) {
59
+ return { ...r, type: 'range' as const, is_24_hours: true };
60
+ }
61
+ return r;
62
+ });
63
+ // Sort chronologically to match the listing display
64
+ return migrated.sort((a, b) => {
65
+ const dateA = a.start_date || '';
66
+ const dateB = b.start_date || '';
67
+ if (a.type === 'range' && b.type === 'range') return dateA.localeCompare(dateB);
68
+ if (a.type === 'range') return -1;
69
+ if (b.type === 'range') return 1;
70
+ return 0;
71
+ });
72
+ });
73
+
74
+ const addRule = (type: 'range' | 'date_time') => {
75
+ if (type === 'range') {
76
+ setRules([...rules, { type: 'range', start_date: '', end_date: '', is_24_hours: true }]);
77
+ } else {
78
+ setRules([...rules, { type: 'date_time', days: [], is_24_hours: true }]);
79
+ }
80
+ };
81
+
82
+ const updateRule = (index: number, updates: Partial<PricingPeriodRule>) => {
83
+ setRules(prev => prev.map((r, i) => i === index ? { ...r, ...updates } : r));
84
+ };
85
+
86
+ const removeRule = (index: number) => {
87
+ setRules(prev => prev.filter((_, i) => i !== index));
88
+ };
89
+
90
+ const toggleDay = (ruleIndex: number, day: string) => {
91
+ const rule = rules[ruleIndex];
92
+ const days = rule.days || [];
93
+ const updated = days.includes(day) ? days.filter(d => d !== day) : [...days, day];
94
+ updateRule(ruleIndex, { days: updated });
95
+ };
96
+
97
+ const toggle24Hours = (index: number, checked: boolean) => {
98
+ if (checked) {
99
+ updateRule(index, { is_24_hours: true, start_time: undefined, end_time: undefined });
100
+ } else {
101
+ updateRule(index, { is_24_hours: false, start_time: '09:00', end_time: '17:00' });
102
+ }
103
+ };
104
+
105
+ const validateRules = (): boolean => {
106
+ const today = new Date().toISOString().split('T')[0];
107
+ const errors: Record<number, string> = {};
108
+
109
+ rules.forEach((rule, index) => {
110
+ if (rule.type === 'range' && rule.start_date && rule.start_date < today) {
111
+ errors[index] = 'Start date cannot be in the past';
112
+ }
113
+ });
114
+
115
+ setRuleErrors(errors);
116
+ return Object.keys(errors).length === 0;
117
+ };
118
+
119
+ const handleSubmit = () => {
120
+ if (!name.trim()) {
121
+ showError('Name Required', 'Please enter a name for the pricing period.');
122
+ return;
123
+ }
124
+ if (rules.length === 0) {
125
+ showError('Rule Required', 'Please add at least one rule to define when this pricing period applies.');
126
+ return;
127
+ }
128
+ if (!validateRules()) return;
129
+ const sortedRules = [...rules].sort((a, b) => {
130
+ const dateA = a.start_date || '';
131
+ const dateB = b.start_date || '';
132
+ if (a.type === 'range' && b.type === 'range') return dateA.localeCompare(dateB);
133
+ if (a.type === 'range') return -1;
134
+ if (b.type === 'range') return 1;
135
+ return 0;
136
+ });
137
+ onSave({
138
+ name: name.trim(),
139
+ description: description.trim(),
140
+ colour,
141
+ is_active: isActive,
142
+ dynamic_pricing_excluded: dynamicPricingExcluded,
143
+ rules: sortedRules,
144
+ });
145
+ };
146
+
147
+ const selectedColour = COLOUR_OPTIONS.find(c => c.value === colour);
148
+
149
+ return (
150
+ <div className="flex flex-col gap-6 w-full">
151
+ {showHeader && (
152
+ <h2 className="text-label-primary text-xl font-semibold">
153
+ {isEditing ? 'Edit Pricing Period' : 'Create Pricing Period'}
154
+ </h2>
155
+ )}
156
+
157
+ {/* Name */}
158
+ <div className="flex flex-col gap-2">
159
+ <Label>Name</Label>
160
+ <Input value={name} onChange={(e) => setName(e.target.value)} />
161
+ </div>
162
+
163
+
164
+ {/* Description */}
165
+ <div className="flex flex-col gap-2">
166
+ <div className="flex items-center justify-between">
167
+ <Label>Description</Label>
168
+ <span className="text-label-secondary text-xs">(optional)</span>
169
+ </div>
170
+ <Textarea value={description} onChange={(e) => setDescription(e.target.value)} rows={3} />
171
+ </div>
172
+
173
+ {/* Colour */}
174
+ <div className="flex flex-col gap-1.5">
175
+ <Label>Colour</Label>
176
+ <Select value={colour} onValueChange={setColour}>
177
+ <SelectTrigger>
178
+ <SelectValue>
179
+ {selectedColour ? (
180
+ <span className="flex items-center gap-2">
181
+ <span className="w-3 h-3 rounded-full inline-block" style={{ backgroundColor: selectedColour.value }} />
182
+ {selectedColour.label}
183
+ </span>
184
+ ) : null}
185
+ </SelectValue>
186
+ </SelectTrigger>
187
+ <SelectContent>
188
+ {COLOUR_OPTIONS.map(c => (
189
+ <SelectItem key={c.value} value={c.value}>
190
+ <span className="flex items-center gap-2">
191
+ <span className="w-3 h-3 rounded-full inline-block" style={{ backgroundColor: c.value }} />
192
+ {c.label}
193
+ </span>
194
+ </SelectItem>
195
+ ))}
196
+ </SelectContent>
197
+ </Select>
198
+ <span className="text-label-secondary text-xs">This helps to identify the pricing periods</span>
199
+ </div>
200
+
201
+ {/* Active checkbox */}
202
+ <div className="flex items-center gap-2">
203
+ <Checkbox
204
+ checked={isActive}
205
+ onCheckedChange={(checked) => setIsActive(checked === true)}
206
+ />
207
+ <Label className="cursor-pointer">Active</Label>
208
+ </div>
209
+
210
+ {/* Dynamic Pricing Exclusion */}
211
+ <div className="flex items-center gap-2">
212
+ <Checkbox
213
+ checked={dynamicPricingExcluded}
214
+ onCheckedChange={(checked) => setDynamicPricingExcluded(checked === true)}
215
+ />
216
+ <div className="flex flex-col">
217
+ <Label className="cursor-pointer">Exclude from Dynamic Pricing</Label>
218
+ <span className="text-label-secondary text-xs">When checked, dynamic pricing tiers will not apply adjustments during this period</span>
219
+ </div>
220
+ </div>
221
+
222
+ {/* Separator */}
223
+ <div className="border-t border-border-primary" />
224
+
225
+ {/* Rules */}
226
+ <div className="flex flex-col gap-4">
227
+ <div className="flex items-center justify-between">
228
+ <h3 className="text-label-primary text-lg font-semibold">Rules</h3>
229
+ <div className="flex items-center gap-2">
230
+ <Button variant="outline" onClick={() => addRule('range')} withIcon>
231
+ <IconPlus className="w-4 h-4 fill-fill-secondary" />
232
+ Add Dates
233
+ </Button>
234
+ <Button variant="outline" onClick={() => addRule('date_time')} withIcon>
235
+ <IconPlus className="w-4 h-4 fill-fill-secondary" />
236
+ Add Day / Time
237
+ </Button>
238
+ </div>
239
+ </div>
240
+
241
+ {rules.length === 0 && (
242
+ <p className="text-label-tertiary text-sm text-left py-6">
243
+ No rules defined. Add rules to specify when this pricing period applies.
244
+ </p>
245
+ )}
246
+
247
+ {rules.map((rule, index) => (
248
+ <div key={index} className="flex flex-col gap-4 p-4 rounded-lg bg-surface-secondary">
249
+ <div className="flex items-center justify-between">
250
+ <div className="flex items-center gap-2">
251
+ {rule.type === 'range' ? (
252
+ <IconCalendar className="w-5 h-5 fill-fill-secondary" />
253
+ ) : (
254
+ <IconTime className="w-5 h-5 fill-fill-secondary" />
255
+ )}
256
+ <span className="text-label-secondary text-xs border border-border-primary rounded-full px-2.5 py-0.5">
257
+ {rule.type === 'range' ? 'Dates Rule' : 'Day / Time Rule'}
258
+ </span>
259
+ </div>
260
+ <Button variant="ghost" size="icon" onClick={() => removeRule(index)} className="h-8 w-8 bg-surface-danger-soft border-transparent hover:!bg-surface-danger-soft-hover [&_path]:fill-fill-danger">
261
+ <IconDelete className="w-4 h-4" />
262
+ </Button>
263
+ </div>
264
+
265
+ {/* Range rule: date pickers */}
266
+ {rule.type === 'range' && (
267
+ <div className="grid grid-cols-2 gap-4">
268
+ <div className="flex flex-col gap-2">
269
+ <Label>Start Date</Label>
270
+ <Input
271
+ type="date"
272
+ value={rule.start_date || ''}
273
+ onChange={(e) => {
274
+ const newStart = e.target.value;
275
+ setRuleErrors(prev => { const next = { ...prev }; delete next[index]; return next; });
276
+ // If end date is empty or before new start, update both together
277
+ if (newStart && (!rule.end_date || rule.end_date < newStart)) {
278
+ updateRule(index, { start_date: newStart, end_date: newStart });
279
+ } else {
280
+ updateRule(index, { start_date: newStart });
281
+ }
282
+ }}
283
+ />
284
+ {ruleErrors[index] && (
285
+ <p className="text-label-danger text-sm">{ruleErrors[index]}</p>
286
+ )}
287
+ </div>
288
+ <div className="flex flex-col gap-2">
289
+ <Label>End Date</Label>
290
+ <Input
291
+ type="date"
292
+ value={rule.end_date || ''}
293
+ min={rule.start_date || undefined}
294
+ onChange={(e) => updateRule(index, { end_date: e.target.value })}
295
+ />
296
+ </div>
297
+ </div>
298
+ )}
299
+
300
+ {/* Date/Time rule: day selection */}
301
+ {rule.type === 'date_time' && (
302
+ <div className="flex flex-col gap-2">
303
+ <Label className="text-sm font-semibold">Days</Label>
304
+ <div className="grid grid-cols-2 gap-2">
305
+ <div className="flex flex-col gap-2">
306
+ {DAY_OPTIONS.slice(0, 4).map(day => (
307
+ <label key={day} className="flex items-center gap-1.5">
308
+ <Checkbox
309
+ checked={rule.days?.includes(day) || false}
310
+ onCheckedChange={() => toggleDay(index, day)}
311
+ />
312
+ <span className="text-label-primary text-sm">{day}</span>
313
+ </label>
314
+ ))}
315
+ </div>
316
+ <div className="flex flex-col gap-2">
317
+ {DAY_OPTIONS.slice(4).map(day => (
318
+ <label key={day} className="flex items-center gap-1.5">
319
+ <Checkbox
320
+ checked={rule.days?.includes(day) || false}
321
+ onCheckedChange={() => toggleDay(index, day)}
322
+ />
323
+ <span className="text-label-primary text-sm">{day}</span>
324
+ </label>
325
+ ))}
326
+ </div>
327
+ </div>
328
+ </div>
329
+ )}
330
+
331
+ {/* Time section */}
332
+ <div className="flex flex-col gap-3">
333
+ <Label className="text-sm font-semibold">Time</Label>
334
+ <div className="flex items-center gap-2">
335
+ <Switch
336
+ checked={rule.is_24_hours ?? true}
337
+ onCheckedChange={(checked) => toggle24Hours(index, checked)}
338
+ />
339
+ <Label className="cursor-pointer">Align with Opening Hours</Label>
340
+ </div>
341
+
342
+ {!rule.is_24_hours && (
343
+ <div className="grid grid-cols-2 gap-4">
344
+ <div className="flex flex-col gap-2">
345
+ <Label>Start Time</Label>
346
+ <Input
347
+ type="time"
348
+ value={rule.start_time || '09:00'}
349
+ onChange={(e) => updateRule(index, { start_time: e.target.value })}
350
+ />
351
+ </div>
352
+ <div className="flex flex-col gap-2">
353
+ <Label>End Time</Label>
354
+ <Input
355
+ type="time"
356
+ value={rule.end_time || '17:00'}
357
+ onChange={(e) => updateRule(index, { end_time: e.target.value })}
358
+ />
359
+ </div>
360
+ </div>
361
+ )}
362
+ </div>
363
+ </div>
364
+ ))}
365
+ </div>
366
+
367
+ {/* Actions */}
368
+ <div className="flex items-center gap-3 pt-6">
369
+ <Button onClick={handleSubmit} disabled={isSaving}>
370
+ {isSaving ? 'Saving...' : isEditing ? 'Save Changes' : 'Create Period'}
371
+ </Button>
372
+ </div>
373
+ </div>
374
+ );
375
+ };
376
+
377
+ export default PricingPeriodForm;