@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,394 @@
1
+ import React, { useEffect, useRef, useCallback, useState } from 'react';
2
+ import { useIsMobile } from '../../hooks/use-mobile';
3
+
4
+ const CELL_SIZE = 16;
5
+ const PLAYER_SIZE = 12;
6
+ const CHUNK_SIZE = 12;
7
+ const VISIBLE_COLS = 20;
8
+ const VISIBLE_ROWS = 16;
9
+
10
+ interface Cell {
11
+ x: number;
12
+ y: number;
13
+ walls: { top: boolean; right: boolean; bottom: boolean; left: boolean };
14
+ visited: boolean;
15
+ }
16
+
17
+ type WallSide = 'top' | 'right' | 'bottom' | 'left';
18
+ type Direction = 'up' | 'down' | 'left' | 'right';
19
+
20
+ const generateMazeChunk = (
21
+ chunkX: number,
22
+ chunkY: number,
23
+ existingCells: Map<string, Cell>
24
+ ): Map<string, Cell> => {
25
+ const cells = new Map<string, Cell>();
26
+ const startX = chunkX * CHUNK_SIZE;
27
+ const startY = chunkY * CHUNK_SIZE;
28
+
29
+ // Create fresh cells for this chunk only
30
+ for (let y = startY; y < startY + CHUNK_SIZE; y++) {
31
+ for (let x = startX; x < startX + CHUNK_SIZE; x++) {
32
+ const key = `${x},${y}`;
33
+ if (existingCells.has(key)) {
34
+ // Already generated — skip entirely
35
+ continue;
36
+ }
37
+ cells.set(key, { x, y, walls: { top: true, right: true, bottom: true, left: true }, visited: false });
38
+ }
39
+ }
40
+
41
+ // If all cells already existed, nothing to do
42
+ if (cells.size === 0) return cells;
43
+
44
+ // Run DFS only on new (unvisited) cells
45
+ const allNewKeys = Array.from(cells.keys());
46
+ const firstKey = allNewKeys[0];
47
+ const stack: Cell[] = [];
48
+ const first = cells.get(firstKey)!;
49
+ first.visited = true;
50
+ stack.push(first);
51
+
52
+ const oppMap: Record<WallSide, WallSide> = { top: 'bottom', bottom: 'top', left: 'right', right: 'left' };
53
+
54
+ while (stack.length > 0) {
55
+ const current = stack[stack.length - 1];
56
+ const neighbors: { cell: Cell; dir: WallSide }[] = [];
57
+ const dirs: { dx: number; dy: number; dir: WallSide }[] = [
58
+ { dx: 0, dy: -1, dir: 'top' },
59
+ { dx: 1, dy: 0, dir: 'right' },
60
+ { dx: 0, dy: 1, dir: 'bottom' },
61
+ { dx: -1, dy: 0, dir: 'left' },
62
+ ];
63
+
64
+ for (const { dx, dy, dir } of dirs) {
65
+ const nx = current.x + dx;
66
+ const ny = current.y + dy;
67
+ const key = `${nx},${ny}`;
68
+ const neighbor = cells.get(key);
69
+ if (neighbor && !neighbor.visited) {
70
+ neighbors.push({ cell: neighbor, dir });
71
+ }
72
+ }
73
+
74
+ if (neighbors.length > 0) {
75
+ const { cell: next, dir } = neighbors[Math.floor(Math.random() * neighbors.length)];
76
+ current.walls[dir] = false;
77
+ next.walls[oppMap[dir]] = false;
78
+ next.visited = true;
79
+ stack.push(next);
80
+ } else {
81
+ stack.pop();
82
+ }
83
+ }
84
+
85
+ // Open passages at chunk borders and sync with existing neighbors
86
+ for (let i = 0; i < CHUNK_SIZE; i++) {
87
+ // Right border
88
+ if (Math.random() < 0.3) {
89
+ const cell = cells.get(`${startX + CHUNK_SIZE - 1},${startY + i}`);
90
+ const neighborKey = `${startX + CHUNK_SIZE},${startY + i}`;
91
+ const neighbor = existingCells.get(neighborKey);
92
+ if (cell) {
93
+ cell.walls.right = false;
94
+ if (neighbor) neighbor.walls.left = false;
95
+ }
96
+ }
97
+ // Bottom border
98
+ if (Math.random() < 0.3) {
99
+ const cell = cells.get(`${startX + i},${startY + CHUNK_SIZE - 1}`);
100
+ const neighborKey = `${startX + i},${startY + CHUNK_SIZE}`;
101
+ const neighbor = existingCells.get(neighborKey);
102
+ if (cell) {
103
+ cell.walls.bottom = false;
104
+ if (neighbor) neighbor.walls.top = false;
105
+ }
106
+ }
107
+ // Left border
108
+ if (Math.random() < 0.3) {
109
+ const cell = cells.get(`${startX},${startY + i}`);
110
+ const neighborKey = `${startX - 1},${startY + i}`;
111
+ const neighbor = existingCells.get(neighborKey);
112
+ if (cell) {
113
+ cell.walls.left = false;
114
+ if (neighbor) neighbor.walls.right = false;
115
+ }
116
+ }
117
+ // Top border
118
+ if (Math.random() < 0.3) {
119
+ const cell = cells.get(`${startX + i},${startY}`);
120
+ const neighborKey = `${startX + i},${startY - 1}`;
121
+ const neighbor = existingCells.get(neighborKey);
122
+ if (cell) {
123
+ cell.walls.top = false;
124
+ if (neighbor) neighbor.walls.bottom = false;
125
+ }
126
+ }
127
+ }
128
+
129
+ // CRITICAL: Sync walls with any pre-existing neighbor cells.
130
+ // If an existing neighbor already has a wall open toward us, we must match it.
131
+ cells.forEach((cell) => {
132
+ const syncDirs: { dx: number; dy: number; wall: WallSide; oppWall: WallSide }[] = [
133
+ { dx: 0, dy: -1, wall: 'top', oppWall: 'bottom' },
134
+ { dx: 1, dy: 0, wall: 'right', oppWall: 'left' },
135
+ { dx: 0, dy: 1, wall: 'bottom', oppWall: 'top' },
136
+ { dx: -1, dy: 0, wall: 'left', oppWall: 'right' },
137
+ ];
138
+ for (const { dx, dy, wall, oppWall } of syncDirs) {
139
+ const neighborKey = `${cell.x + dx},${cell.y + dy}`;
140
+ const neighbor = existingCells.get(neighborKey);
141
+ if (neighbor) {
142
+ // If neighbor has its wall open toward us, open our wall too
143
+ if (!neighbor.walls[oppWall]) {
144
+ cell.walls[wall] = false;
145
+ }
146
+ // If we have our wall open toward neighbor, open their wall too
147
+ if (!cell.walls[wall]) {
148
+ neighbor.walls[oppWall] = false;
149
+ }
150
+ }
151
+ }
152
+ });
153
+
154
+ return cells;
155
+ };
156
+
157
+ const DPad: React.FC<{ onDirection: (dir: Direction) => void }> = ({ onDirection }) => {
158
+ const btnClass = "w-10 h-10 flex items-center justify-center border border-border-primary rounded-lg bg-surface-secondary text-label-primary text-base font-mono active:bg-surface-tertiary select-none touch-manipulation";
159
+
160
+ return (
161
+ <div className="flex flex-col items-center gap-1">
162
+ <button
163
+ className={btnClass}
164
+ onTouchStart={(e) => { e.preventDefault(); onDirection('up'); }}
165
+ onMouseDown={() => onDirection('up')}
166
+ type="button"
167
+ >↑</button>
168
+ <div className="flex gap-1">
169
+ <button
170
+ className={btnClass}
171
+ onTouchStart={(e) => { e.preventDefault(); onDirection('left'); }}
172
+ onMouseDown={() => onDirection('left')}
173
+ type="button"
174
+ >←</button>
175
+ <button
176
+ className={btnClass}
177
+ onTouchStart={(e) => { e.preventDefault(); onDirection('down'); }}
178
+ onMouseDown={() => onDirection('down')}
179
+ type="button"
180
+ >↓</button>
181
+ <button
182
+ className={btnClass}
183
+ onTouchStart={(e) => { e.preventDefault(); onDirection('right'); }}
184
+ onMouseDown={() => onDirection('right')}
185
+ type="button"
186
+ >→</button>
187
+ </div>
188
+ </div>
189
+ );
190
+ };
191
+
192
+ const MazeGame: React.FC = () => {
193
+ const canvasRef = useRef<HTMLCanvasElement>(null);
194
+ const isMobile = useIsMobile();
195
+ const gameStateRef = useRef({
196
+ playerX: 1,
197
+ playerY: 1,
198
+ visualX: 1,
199
+ visualY: 1,
200
+ cells: new Map<string, Cell>(),
201
+ loadedChunks: new Set<string>(),
202
+ moveQueue: [] as Direction[],
203
+ isAnimating: false,
204
+ });
205
+ const animFrameRef = useRef<number>(0);
206
+ const [gameStarted, setGameStarted] = useState(false);
207
+
208
+ const ensureChunksAround = useCallback((px: number, py: number) => {
209
+ const state = gameStateRef.current;
210
+ const cx = Math.floor(px / CHUNK_SIZE);
211
+ const cy = Math.floor(py / CHUNK_SIZE);
212
+
213
+ for (let dy = -1; dy <= 1; dy++) {
214
+ for (let dx = -1; dx <= 1; dx++) {
215
+ const key = `${cx + dx},${cy + dy}`;
216
+ if (!state.loadedChunks.has(key)) {
217
+ state.loadedChunks.add(key);
218
+ const newCells = generateMazeChunk(cx + dx, cy + dy, state.cells);
219
+ newCells.forEach((cell, k) => {
220
+ state.cells.set(k, cell);
221
+ });
222
+ }
223
+ }
224
+ }
225
+ }, []);
226
+
227
+ const dirToWall: Record<Direction, WallSide> = { up: 'top', down: 'bottom', left: 'left', right: 'right' };
228
+
229
+ const canMoveDir = useCallback((x: number, y: number, dir: Direction): boolean => {
230
+ const state = gameStateRef.current;
231
+ const cell = state.cells.get(`${x},${y}`);
232
+ if (!cell) return false;
233
+ if (cell.walls[dirToWall[dir]]) return false;
234
+
235
+ // Also check the destination cell's opposing wall
236
+ const moveMap: Record<Direction, { dx: number; dy: number }> = {
237
+ up: { dx: 0, dy: -1 }, down: { dx: 0, dy: 1 },
238
+ left: { dx: -1, dy: 0 }, right: { dx: 1, dy: 0 },
239
+ };
240
+ const oppWall: Record<Direction, WallSide> = { up: 'bottom', down: 'top', left: 'right', right: 'left' };
241
+ const dest = state.cells.get(`${x + moveMap[dir].dx},${y + moveMap[dir].dy}`);
242
+ if (!dest) return false;
243
+ return !dest.walls[oppWall[dir]];
244
+ }, []);
245
+
246
+ const draw = useCallback(() => {
247
+ const canvas = canvasRef.current;
248
+ if (!canvas) return;
249
+ const ctx = canvas.getContext('2d');
250
+ if (!ctx) return;
251
+
252
+ const state = gameStateRef.current;
253
+ const { visualX, visualY } = state;
254
+
255
+ const computedStyle = getComputedStyle(document.documentElement);
256
+ const wallColor = computedStyle.getPropertyValue('--fill-secondary').trim();
257
+ const playerColor = computedStyle.getPropertyValue('--fill-primary').trim();
258
+ const bgColor = computedStyle.getPropertyValue('--surface-primary').trim();
259
+
260
+ ctx.fillStyle = bgColor;
261
+ ctx.fillRect(0, 0, canvas.width, canvas.height);
262
+
263
+ const offsetX = visualX - Math.floor(VISIBLE_COLS / 2);
264
+ const offsetY = visualY - Math.floor(VISIBLE_ROWS / 2);
265
+
266
+ const fracX = offsetX % 1;
267
+ const fracY = offsetY % 1;
268
+ const baseX = Math.floor(offsetX);
269
+ const baseY = Math.floor(offsetY);
270
+
271
+ for (let vy = -2; vy <= VISIBLE_ROWS + 2; vy++) {
272
+ for (let vx = -2; vx <= VISIBLE_COLS + 2; vx++) {
273
+ const cellX = baseX + vx;
274
+ const cellY = baseY + vy;
275
+ const cell = state.cells.get(`${cellX},${cellY}`);
276
+ if (!cell) continue;
277
+
278
+ const sx = (vx - fracX) * CELL_SIZE;
279
+ const sy = (vy - fracY) * CELL_SIZE;
280
+
281
+ ctx.strokeStyle = wallColor;
282
+ ctx.lineWidth = 2;
283
+
284
+ if (cell.walls.top) { ctx.beginPath(); ctx.moveTo(sx, sy); ctx.lineTo(sx + CELL_SIZE, sy); ctx.stroke(); }
285
+ if (cell.walls.right) { ctx.beginPath(); ctx.moveTo(sx + CELL_SIZE, sy); ctx.lineTo(sx + CELL_SIZE, sy + CELL_SIZE); ctx.stroke(); }
286
+ if (cell.walls.bottom) { ctx.beginPath(); ctx.moveTo(sx, sy + CELL_SIZE); ctx.lineTo(sx + CELL_SIZE, sy + CELL_SIZE); ctx.stroke(); }
287
+ if (cell.walls.left) { ctx.beginPath(); ctx.moveTo(sx, sy); ctx.lineTo(sx, sy + CELL_SIZE); ctx.stroke(); }
288
+ }
289
+ }
290
+
291
+ const px = Math.floor(VISIBLE_COLS / 2) * CELL_SIZE + (CELL_SIZE - PLAYER_SIZE) / 2;
292
+ const py = Math.floor(VISIBLE_ROWS / 2) * CELL_SIZE + (CELL_SIZE - PLAYER_SIZE) / 2;
293
+ ctx.fillStyle = playerColor;
294
+ ctx.fillRect(px, py, PLAYER_SIZE, PLAYER_SIZE);
295
+ ctx.fillStyle = bgColor;
296
+ ctx.fillRect(px + 2, py + 3, 3, 3);
297
+ ctx.fillRect(px + PLAYER_SIZE - 5, py + 3, 3, 3);
298
+ }, []);
299
+
300
+ const animate = useCallback(() => {
301
+ const state = gameStateRef.current;
302
+ const lerp = 0.25;
303
+ const dx = state.playerX - state.visualX;
304
+ const dy = state.playerY - state.visualY;
305
+
306
+ if (Math.abs(dx) < 0.01 && Math.abs(dy) < 0.01) {
307
+ state.visualX = state.playerX;
308
+ state.visualY = state.playerY;
309
+ state.isAnimating = false;
310
+ draw();
311
+ return;
312
+ }
313
+
314
+ state.visualX += dx * lerp;
315
+ state.visualY += dy * lerp;
316
+ draw();
317
+ animFrameRef.current = requestAnimationFrame(animate);
318
+ }, [draw]);
319
+
320
+ const startAnimation = useCallback(() => {
321
+ const state = gameStateRef.current;
322
+ if (!state.isAnimating) {
323
+ state.isAnimating = true;
324
+ animFrameRef.current = requestAnimationFrame(animate);
325
+ }
326
+ }, [animate]);
327
+
328
+ const movePlayer = useCallback((dir: Direction) => {
329
+ const state = gameStateRef.current;
330
+ const moveMap: Record<Direction, { dx: number; dy: number }> = {
331
+ up: { dx: 0, dy: -1 }, down: { dx: 0, dy: 1 },
332
+ left: { dx: -1, dy: 0 }, right: { dx: 1, dy: 0 },
333
+ };
334
+
335
+ if (!gameStarted) setGameStarted(true);
336
+
337
+ if (canMoveDir(state.playerX, state.playerY, dir)) {
338
+ state.playerX += moveMap[dir].dx;
339
+ state.playerY += moveMap[dir].dy;
340
+ ensureChunksAround(state.playerX, state.playerY);
341
+ startAnimation();
342
+ }
343
+ }, [canMoveDir, ensureChunksAround, gameStarted, startAnimation]);
344
+
345
+ useEffect(() => {
346
+ const state = gameStateRef.current;
347
+ ensureChunksAround(state.playerX, state.playerY);
348
+ draw();
349
+
350
+ const handleKeyDown = (e: KeyboardEvent) => {
351
+ const dirMap: Record<string, Direction> = {
352
+ ArrowUp: 'up', ArrowDown: 'down', ArrowLeft: 'left', ArrowRight: 'right',
353
+ w: 'up', s: 'down', a: 'left', d: 'right',
354
+ W: 'up', S: 'down', A: 'left', D: 'right',
355
+ };
356
+ const dir = dirMap[e.key];
357
+ if (!dir) return;
358
+ e.preventDefault();
359
+ movePlayer(dir);
360
+ };
361
+
362
+ window.addEventListener('keydown', handleKeyDown);
363
+ return () => {
364
+ window.removeEventListener('keydown', handleKeyDown);
365
+ cancelAnimationFrame(animFrameRef.current);
366
+ };
367
+ }, [draw, ensureChunksAround, movePlayer]);
368
+
369
+ return (
370
+ <div className="flex flex-col items-start gap-3">
371
+ <p className="text-[13px] leading-4 font-mono text-label-secondary">
372
+ {gameStarted
373
+ ? "Escape the maze and we'll grant you access."
374
+ : isMobile ? "Tap the arrows to start" : "Use arrow keys to start"
375
+ }
376
+ </p>
377
+ <div className="border-2 border-border-primary rounded-lg overflow-hidden relative">
378
+ <canvas
379
+ ref={canvasRef}
380
+ width={VISIBLE_COLS * CELL_SIZE}
381
+ height={VISIBLE_ROWS * CELL_SIZE}
382
+ className="block"
383
+ style={{ imageRendering: 'pixelated' }}
384
+ />
385
+ </div>
386
+
387
+ {isMobile && (
388
+ <DPad onDirection={movePlayer} />
389
+ )}
390
+ </div>
391
+ );
392
+ };
393
+
394
+ export default MazeGame;