@licklist/design 0.78.19 → 0.78.21

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 (268) hide show
  1. package/.storybook/main.cjs +55 -6
  2. package/.storybook/preview.jsx +77 -7
  3. package/dist/Maintenance/Maintenance.scss.js +6 -0
  4. package/dist/Maintenance/MaintenancePage.d.ts +12 -0
  5. package/dist/Maintenance/MaintenancePage.d.ts.map +1 -0
  6. package/dist/Maintenance/MaintenancePage.js +98 -0
  7. package/dist/Maintenance/SkeletonSidebar.d.ts +5 -0
  8. package/dist/Maintenance/SkeletonSidebar.d.ts.map +1 -0
  9. package/dist/Maintenance/SkeletonSidebar.js +101 -0
  10. package/dist/PageNotFound/PageNotFound.d.ts +10 -0
  11. package/dist/PageNotFound/PageNotFound.d.ts.map +1 -0
  12. package/dist/PageNotFound/PageNotFound.js +42 -0
  13. package/dist/PageNotFound/index.d.ts +2 -0
  14. package/dist/PageNotFound/index.d.ts.map +1 -0
  15. package/dist/UnderMaintenance/UnderMaintenance.d.ts +4 -0
  16. package/dist/UnderMaintenance/UnderMaintenance.d.ts.map +1 -0
  17. package/dist/UnderMaintenance/UnderMaintenance.js +39 -0
  18. package/dist/UnderMaintenance/UnderMaintenance.scss.js +6 -0
  19. package/dist/UnderMaintenance/index.d.ts +2 -0
  20. package/dist/UnderMaintenance/index.d.ts.map +1 -0
  21. package/dist/auth/Authorizer.d.ts.map +1 -1
  22. package/dist/auth/Authorizer.js +4 -3
  23. package/dist/auth/Layout/UserNavDropDown.js +1 -1
  24. package/dist/auth/Login/LoginComponent.d.ts.map +1 -1
  25. package/dist/auth/Login/LoginComponent.js +8 -6
  26. package/dist/auth/Logout/Logout.js +1 -1
  27. package/dist/iframe/ProductWithModifierModal/ModifierSetModal/ProductWithModifierSetModal.js +4 -3
  28. package/dist/iframe/ProductWithModifierModal/ModifierSetModal/controll/ModifierSetControll.js +2 -1
  29. package/dist/iframe/ProductWithModifierModal/ModifierSetModal/controll/ProductControll.js +1 -1
  30. package/dist/index.d.ts +2 -0
  31. package/dist/index.d.ts.map +1 -1
  32. package/dist/index.js +2 -0
  33. package/dist/notification/components/NotificationPlaceholders.js +1 -1
  34. package/dist/product-set/form/ProductCategoriesControl.d.ts.map +1 -1
  35. package/dist/product-set/form/ProductCategoriesControl.js +13 -5
  36. package/dist/provider/provider-details-input/ProviderDetailsInput.js +1 -1
  37. package/dist/recurrence-input/RecurrenceEndInput.d.ts.map +1 -1
  38. package/dist/recurrence-input/RecurrenceEndInput.js +7 -3
  39. package/dist/sortable-tree/SortableTree.js +1 -26
  40. package/dist/styles/overrides/_functions.scss +1 -1
  41. package/dist/v2/components/Alert/Alert.d.ts +14 -0
  42. package/dist/v2/components/Alert/Alert.d.ts.map +1 -0
  43. package/dist/v2/components/Alert/index.d.ts +3 -0
  44. package/dist/v2/components/Alert/index.d.ts.map +1 -0
  45. package/dist/v2/components/Button/Button.d.ts +10 -0
  46. package/dist/v2/components/Button/Button.d.ts.map +1 -0
  47. package/dist/v2/components/Button/index.d.ts +3 -0
  48. package/dist/v2/components/Button/index.d.ts.map +1 -0
  49. package/dist/v2/components/Colors/Colors.d.ts +21 -0
  50. package/dist/v2/components/Colors/Colors.d.ts.map +1 -0
  51. package/dist/v2/components/Colors/index.d.ts +3 -0
  52. package/dist/v2/components/Colors/index.d.ts.map +1 -0
  53. package/dist/v2/components/Typography/Typography.d.ts +11 -0
  54. package/dist/v2/components/Typography/Typography.d.ts.map +1 -0
  55. package/dist/v2/components/Typography/index.d.ts +3 -0
  56. package/dist/v2/components/Typography/index.d.ts.map +1 -0
  57. package/dist/v2/hooks/useAuth.d.ts +4 -0
  58. package/dist/v2/hooks/useAuth.d.ts.map +1 -0
  59. package/dist/v2/index.d.ts +56 -0
  60. package/dist/v2/index.d.ts.map +1 -0
  61. package/dist/v2/navigation/FigmasAdminSideBar/FigmasAdminSideBar.d.ts +8 -0
  62. package/dist/v2/navigation/FigmasAdminSideBar/FigmasAdminSideBar.d.ts.map +1 -0
  63. package/dist/v2/navigation/FigmasAdminSideBar/index.d.ts +3 -0
  64. package/dist/v2/navigation/FigmasAdminSideBar/index.d.ts.map +1 -0
  65. package/dist/v2/navigation/FigmasSideBar/FigmasSideBar.d.ts +22 -0
  66. package/dist/v2/navigation/FigmasSideBar/FigmasSideBar.d.ts.map +1 -0
  67. package/dist/v2/navigation/FigmasSideBar/index.d.ts +3 -0
  68. package/dist/v2/navigation/FigmasSideBar/index.d.ts.map +1 -0
  69. package/dist/v2/navigation/FigmasTopHat/FigmasTopHat.d.ts +15 -0
  70. package/dist/v2/navigation/FigmasTopHat/FigmasTopHat.d.ts.map +1 -0
  71. package/dist/v2/navigation/FigmasTopHat/index.d.ts +3 -0
  72. package/dist/v2/navigation/FigmasTopHat/index.d.ts.map +1 -0
  73. package/dist/v2/navigation/Navigation/Navigation.d.ts +9 -0
  74. package/dist/v2/navigation/Navigation/Navigation.d.ts.map +1 -0
  75. package/dist/v2/navigation/Navigation/index.d.ts +3 -0
  76. package/dist/v2/navigation/Navigation/index.d.ts.map +1 -0
  77. package/dist/v2/navigation/NavigationItem/NavigationItem.d.ts +12 -0
  78. package/dist/v2/navigation/NavigationItem/NavigationItem.d.ts.map +1 -0
  79. package/dist/v2/navigation/NavigationItem/index.d.ts +3 -0
  80. package/dist/v2/navigation/NavigationItem/index.d.ts.map +1 -0
  81. package/dist/v2/navigation/NavigationSection/NavigationSection.d.ts +8 -0
  82. package/dist/v2/navigation/NavigationSection/NavigationSection.d.ts.map +1 -0
  83. package/dist/v2/navigation/NavigationSection/index.d.ts +3 -0
  84. package/dist/v2/navigation/NavigationSection/index.d.ts.map +1 -0
  85. package/dist/v2/navigation/SideBarToggleLarge/SideBarToggleLarge.d.ts +9 -0
  86. package/dist/v2/navigation/SideBarToggleLarge/SideBarToggleLarge.d.ts.map +1 -0
  87. package/dist/v2/navigation/SideBarToggleLarge/index.d.ts +3 -0
  88. package/dist/v2/navigation/SideBarToggleLarge/index.d.ts.map +1 -0
  89. package/dist/v2/navigation/SidebarUserElement/SidebarUserElement.d.ts +15 -0
  90. package/dist/v2/navigation/SidebarUserElement/SidebarUserElement.d.ts.map +1 -0
  91. package/dist/v2/navigation/SidebarUserElement/index.d.ts +3 -0
  92. package/dist/v2/navigation/SidebarUserElement/index.d.ts.map +1 -0
  93. package/dist/v2/navigation/SidebarWithAuth.d.ts +20 -0
  94. package/dist/v2/navigation/SidebarWithAuth.d.ts.map +1 -0
  95. package/dist/v2/navigation/TopHatControlDisc/TopHatControlDisc.d.ts +9 -0
  96. package/dist/v2/navigation/TopHatControlDisc/TopHatControlDisc.d.ts.map +1 -0
  97. package/dist/v2/navigation/TopHatControlDisc/index.d.ts +3 -0
  98. package/dist/v2/navigation/TopHatControlDisc/index.d.ts.map +1 -0
  99. package/dist/v2/navigation/config.d.ts +3 -0
  100. package/dist/v2/navigation/config.d.ts.map +1 -0
  101. package/dist/v2/navigation/icons/index.d.ts +12 -0
  102. package/dist/v2/navigation/icons/index.d.ts.map +1 -0
  103. package/dist/v2/navigation/index.d.ts +23 -0
  104. package/dist/v2/navigation/index.d.ts.map +1 -0
  105. package/dist/v2/types/navigation.d.ts +17 -0
  106. package/dist/v2/types/navigation.d.ts.map +1 -0
  107. package/package.json +4 -3
  108. package/rollup.config.js +13 -0
  109. package/src/Maintenance/Maintenance.scss +253 -0
  110. package/src/Maintenance/MaintenancePage.tsx +59 -0
  111. package/src/Maintenance/SkeletonSidebar.tsx +56 -0
  112. package/src/PageNotFound/PageNotFound.scss +8 -0
  113. package/src/PageNotFound/PageNotFound.stories.tsx +23 -0
  114. package/src/PageNotFound/PageNotFound.tsx +43 -0
  115. package/src/PageNotFound/index.ts +1 -0
  116. package/src/UnderMaintenance/UnderMaintenance.scss +6 -0
  117. package/src/UnderMaintenance/UnderMaintenance.stories.tsx +23 -0
  118. package/src/UnderMaintenance/UnderMaintenance.tsx +22 -0
  119. package/src/UnderMaintenance/index.ts +1 -0
  120. package/src/auth/Auth.stories.tsx +37 -3
  121. package/src/auth/Authorizer.tsx +3 -2
  122. package/src/auth/ChangePassword/ChangePassword.stories.tsx +1 -8
  123. package/src/auth/Layout/UserNavDropDown.tsx +1 -1
  124. package/src/auth/Login/Login.stories.tsx +1 -6
  125. package/src/auth/Login/LoginComponent.tsx +7 -5
  126. package/src/auth/Logout/Logout.stories.tsx +3 -0
  127. package/src/auth/Logout/Logout.tsx +1 -1
  128. package/src/auth/Register/Register.stories.tsx +3 -7
  129. package/src/auth/ResetPassword/ResetPassword.stories.tsx +1 -8
  130. package/src/auth/Social/Social.stories.tsx +1 -6
  131. package/src/collapsible-input-group/CollapsibleInputGroup.stories.tsx +72 -4
  132. package/src/events/edit-event-modal/component/EditEventForm/EditEventForm.stories.tsx +2 -1
  133. package/src/events/edit-recurrent-event-modal/EditRecurrentEventModal.stories.tsx +3 -2
  134. package/src/events/event-card/EventCard.stories.tsx +3 -2
  135. package/src/events/event-statistic-modal/EventStatisticModal.stories.tsx +2 -1
  136. package/src/events/event-venue-map/EventVenueMap.stories.tsx +8 -1
  137. package/src/iframe/ProductWithModifierModal/ModifierSetModal/ProductWithModifierSetModal.tsx +3 -3
  138. package/src/iframe/ProductWithModifierModal/ModifierSetModal/controll/ModifierSetControll.tsx +2 -2
  139. package/src/iframe/ProductWithModifierModal/ModifierSetModal/controll/ProductControll.tsx +1 -1
  140. package/src/iframe/custom-fields/components/CustomDateField.stories.tsx +3 -2
  141. package/src/iframe/event/event-card/IframeEventCard.stories.tsx +7 -5
  142. package/src/iframe/event/event-card/IframeEventCards.stories.tsx +7 -6
  143. package/src/iframe/event/event-description/EventDescription.stories.tsx +3 -2
  144. package/src/iframe/event/event-venue-map/IframeEventVenueMap.stories.tsx +3 -2
  145. package/src/iframe/external-modal/ExternalModal.stories.tsx +3 -0
  146. package/src/iframe/order-process/components/CalendarStepsForm/CalendarStepsForm.stories.tsx +5 -0
  147. package/src/iframe/order-process/components/NavigationSteps/NavigationSteps.stories.tsx +2 -1
  148. package/src/iframe/order-process/components/PaymentCard/PaymentCard.stories.tsx +2 -1
  149. package/src/iframe/page/Page.stories.tsx +9 -8
  150. package/src/iframe/payment/order-items-table/OrderItemsTable.stories.tsx +2 -1
  151. package/src/iframe/payment/payment-status-header/PaymentStatusHeader.stories.tsx +2 -1
  152. package/src/index.ts +2 -0
  153. package/src/logo/Logo.stories.tsx +17 -14
  154. package/src/modals/confirmation/Confirmation.stories.tsx +2 -1
  155. package/src/notification/components/NotificationPlaceholders.stories.tsx +4 -0
  156. package/src/notification/components/NotificationPlaceholders.tsx +1 -1
  157. package/src/product-set/form/ProductCategoriesControl.tsx +12 -6
  158. package/src/product-set/form/ProductSetForm.stories.tsx +13 -4
  159. package/src/provider/location-input/LocationInput.stories.tsx +47 -2
  160. package/src/provider/provider-details-input/ProviderDetailsInput.stories.tsx +10 -1
  161. package/src/provider/provider-details-input/ProviderDetailsInput.tsx +1 -1
  162. package/src/provider/provider-form/ProviderForm.stories.tsx +46 -0
  163. package/src/provider/venue-form/VenueForm.stories.tsx +49 -0
  164. package/src/recurrence-input/RecurrenceEndInput.tsx +7 -5
  165. package/src/recurrence-input/RecurrenceInput.stories.tsx +3 -0
  166. package/src/resource/form/ResourceForm.stories.tsx +2 -1
  167. package/src/sales/guest-profile/previous-bookings/PreviousBookings.stories.tsx +2 -1
  168. package/src/sales/life-time-sales/LifeTimeSalesChart.stories.tsx +2 -1
  169. package/src/sales/manual-booking/select-date-type-control/SelectDateTypeControl.stories.tsx +2 -1
  170. package/src/sales/manual-booking/select-menu/SelectMenu.stories.tsx +2 -1
  171. package/src/sales/modals/payment-modal/PaymentModal.stories.tsx +3 -2
  172. package/src/sales/modals/refund-modal/RefundModal.stories.tsx +5 -4
  173. package/src/sales/payment-form/SalePaymentForm.stories.tsx +3 -2
  174. package/src/setting/dashboard/snippet-templates/card/SnippetTemplateCard.stories.tsx +2 -1
  175. package/src/snippet/snippet-template/SnippetTemplate.stories.tsx +2 -1
  176. package/src/snippet/snippet-template/form/SnippetTemplateForm.stories.tsx +4 -2
  177. package/src/sortable-tree/SortableTree.tsx +1 -1
  178. package/src/sortable-tree/SortableTreeItem.stories.tsx +12 -14
  179. package/src/styles/overrides/_functions.scss +1 -1
  180. package/src/table/Table.stories.tsx +3 -24
  181. package/src/tiptap-editor/TipTapMenu/TipTapMenu.stories.tsx +27 -3
  182. package/src/v2/components/Alert/Alert.scss +186 -0
  183. package/src/v2/components/Alert/Alert.stories.tsx +176 -0
  184. package/src/v2/components/Alert/Alert.tsx +62 -0
  185. package/src/v2/components/Alert/assets/alert-icon.svg +3 -0
  186. package/src/v2/components/Alert/assets/error-icon.svg +3 -0
  187. package/src/v2/components/Alert/assets/info-icon.svg +3 -0
  188. package/src/v2/components/Alert/assets/success-icon.svg +3 -0
  189. package/src/v2/components/Alert/index.ts +2 -0
  190. package/src/v2/components/Button/Button.scss +19 -0
  191. package/src/v2/components/Button/Button.stories.tsx +93 -0
  192. package/src/v2/components/Button/Button.tsx +37 -0
  193. package/src/v2/components/Button/index.ts +3 -0
  194. package/src/v2/components/Colors/Colors.scss +64 -0
  195. package/src/v2/components/Colors/Colors.stories.tsx +143 -0
  196. package/src/v2/components/Colors/Colors.tsx +51 -0
  197. package/src/v2/components/Colors/ColorsAliases.stories.tsx +285 -0
  198. package/src/v2/components/Colors/Sizes.stories.tsx +141 -0
  199. package/src/v2/components/Colors/index.ts +2 -0
  200. package/src/v2/components/Typography/Typography.scss +72 -0
  201. package/src/v2/components/Typography/Typography.stories.tsx +266 -0
  202. package/src/v2/components/Typography/Typography.tsx +56 -0
  203. package/src/v2/components/Typography/index.ts +2 -0
  204. package/src/v2/hooks/useAuth.ts +40 -0
  205. package/src/v2/index.ts +105 -0
  206. package/src/v2/navigation/FigmasAdminSideBar/FigmasAdminSideBar.scss +148 -0
  207. package/src/v2/navigation/FigmasAdminSideBar/FigmasAdminSideBar.stories.tsx +132 -0
  208. package/src/v2/navigation/FigmasAdminSideBar/FigmasAdminSideBar.tsx +272 -0
  209. package/src/v2/navigation/FigmasAdminSideBar/index.ts +2 -0
  210. package/src/v2/navigation/FigmasSideBar/FigmasSideBar.scss +214 -0
  211. package/src/v2/navigation/FigmasSideBar/FigmasSideBar.stories.tsx +164 -0
  212. package/src/v2/navigation/FigmasSideBar/FigmasSideBar.tsx +310 -0
  213. package/src/v2/navigation/FigmasSideBar/index.ts +2 -0
  214. package/src/v2/navigation/FigmasTopHat/FigmasTopHat.scss +291 -0
  215. package/src/v2/navigation/FigmasTopHat/FigmasTopHat.stories.tsx +201 -0
  216. package/src/v2/navigation/FigmasTopHat/FigmasTopHat.tsx +158 -0
  217. package/src/v2/navigation/FigmasTopHat/assets/bell-icon.svg +3 -0
  218. package/src/v2/navigation/FigmasTopHat/assets/disc-icon.svg +4 -0
  219. package/src/v2/navigation/FigmasTopHat/assets/inbox-icon.svg +3 -0
  220. package/src/v2/navigation/FigmasTopHat/assets/logo-desktop-1.svg +3 -0
  221. package/src/v2/navigation/FigmasTopHat/assets/logo-desktop-2.svg +4 -0
  222. package/src/v2/navigation/FigmasTopHat/assets/user-icon.svg +4 -0
  223. package/src/v2/navigation/FigmasTopHat/index.ts +2 -0
  224. package/src/v2/navigation/Navigation/Navigation.scss +15 -0
  225. package/src/v2/navigation/Navigation/Navigation.stories.tsx +137 -0
  226. package/src/v2/navigation/Navigation/Navigation.tsx +127 -0
  227. package/src/v2/navigation/Navigation/index.ts +3 -0
  228. package/src/v2/navigation/NavigationItem/NavigationItem.scss +61 -0
  229. package/src/v2/navigation/NavigationItem/NavigationItem.stories.tsx +110 -0
  230. package/src/v2/navigation/NavigationItem/NavigationItem.tsx +38 -0
  231. package/src/v2/navigation/NavigationItem/index.ts +3 -0
  232. package/src/v2/navigation/NavigationSection/NavigationSection.scss +20 -0
  233. package/src/v2/navigation/NavigationSection/NavigationSection.tsx +19 -0
  234. package/src/v2/navigation/NavigationSection/index.ts +3 -0
  235. package/src/v2/navigation/SideBarToggleLarge/SideBarToggleLarge.scss +64 -0
  236. package/src/v2/navigation/SideBarToggleLarge/SideBarToggleLarge.stories.tsx +183 -0
  237. package/src/v2/navigation/SideBarToggleLarge/SideBarToggleLarge.tsx +30 -0
  238. package/src/v2/navigation/SideBarToggleLarge/assets/sidebar-icon.svg +5 -0
  239. package/src/v2/navigation/SideBarToggleLarge/index.ts +2 -0
  240. package/src/v2/navigation/SidebarUserElement/SidebarUserElement.scss +148 -0
  241. package/src/v2/navigation/SidebarUserElement/SidebarUserElement.stories.tsx +342 -0
  242. package/src/v2/navigation/SidebarUserElement/SidebarUserElement.tsx +113 -0
  243. package/src/v2/navigation/SidebarUserElement/index.ts +2 -0
  244. package/src/v2/navigation/SidebarWithAuth.stories.tsx +208 -0
  245. package/src/v2/navigation/SidebarWithAuth.tsx +49 -0
  246. package/src/v2/navigation/TopHatControlDisc/TopHatControlDisc.scss +57 -0
  247. package/src/v2/navigation/TopHatControlDisc/TopHatControlDisc.stories.tsx +153 -0
  248. package/src/v2/navigation/TopHatControlDisc/TopHatControlDisc.tsx +30 -0
  249. package/src/v2/navigation/TopHatControlDisc/assets/disc-icon.svg +4 -0
  250. package/src/v2/navigation/TopHatControlDisc/index.ts +2 -0
  251. package/src/v2/navigation/config.tsx +150 -0
  252. package/src/v2/navigation/icons/index.tsx +72 -0
  253. package/src/v2/navigation/index.ts +23 -0
  254. package/src/v2/styles/components/Button.scss +168 -0
  255. package/src/v2/styles/form/NewInput.scss +172 -0
  256. package/src/v2/styles/index.scss +5 -0
  257. package/src/v2/styles/navigation/Navigation.scss +17 -0
  258. package/src/v2/styles/navigation/NavigationItem.scss +86 -0
  259. package/src/v2/styles/navigation/NavigationSection.scss +26 -0
  260. package/src/v2/styles/navigation/_index.scss +9 -0
  261. package/src/v2/styles/tokens/_aliases.scss +199 -0
  262. package/src/v2/styles/tokens/_colors.scss +121 -0
  263. package/src/v2/styles/tokens/_sizes.scss +122 -0
  264. package/src/v2/styles/tokens/_status.scss +108 -0
  265. package/src/v2/styles/tokens/_typography.scss +146 -0
  266. package/src/v2/types/navigation.ts +17 -0
  267. package/src/zone/form/ZoneForm.stories.tsx +2 -1
  268. package/styles/overrides/_functions.scss +6 -0
@@ -1,5 +1,8 @@
1
- import { Meta, Story } from '@storybook/react-vite'
1
+ import React from 'react'
2
+ import { Meta, StoryFn } from '@storybook/react-vite'
2
3
  import { Accordion } from 'react-bootstrap'
4
+ import { useQueryClient } from 'react-query'
5
+ import { TimeZonePath } from '@licklist/plugins'
3
6
  import { FormProvider, useForm } from 'react-hook-form'
4
7
  import {
5
8
  CategoriesInput,
@@ -38,6 +41,7 @@ const defaultValues: CategoriesInputValues &
38
41
  state: 'Essex',
39
42
  country: 'GB',
40
43
  },
44
+ timeZoneId: '',
41
45
  workingHours: [
42
46
  { start: '08:00', end: '18:00', description: 'Description' },
43
47
  undefined,
@@ -45,12 +49,48 @@ const defaultValues: CategoriesInputValues &
45
49
  ],
46
50
  }
47
51
 
52
+ // Mock timezone data for Storybook
53
+ const mockTimezones = [
54
+ { id: 1, name: 'Europe/London' },
55
+ { id: 2, name: 'America/New_York' },
56
+ { id: 3, name: 'America/Los_Angeles' },
57
+ { id: 4, name: 'Europe/Paris' },
58
+ { id: 5, name: 'Asia/Tokyo' },
59
+ ]
60
+
61
+ // Decorator to mock timezone query data
62
+ const withMockedTimezones = (Story) => {
63
+ const QueryClientWrapper = () => {
64
+ const queryClient = useQueryClient()
65
+
66
+ // Pre-populate the query cache with mock data before render
67
+ // Try multiple possible query key formats
68
+ React.useLayoutEffect(() => {
69
+ const possibleKeys = [
70
+ ['/api/timezones', 'all'],
71
+ ['timezones', '/api/timezones', 'all'],
72
+ ['timeZone', '/api/timezones'],
73
+ ['/api/timezones'],
74
+ ]
75
+
76
+ possibleKeys.forEach((key) => {
77
+ queryClient.setQueryData(key, mockTimezones)
78
+ })
79
+ }, [queryClient])
80
+
81
+ return <Story />
82
+ }
83
+
84
+ return <QueryClientWrapper />
85
+ }
86
+
48
87
  export default {
49
88
  title: 'CollapsibleInputGroup',
50
89
  component: CollapsibleInputGroup,
90
+ decorators: [withMockedTimezones],
51
91
  } as Meta
52
92
 
53
- const Template: Story<CollapsibleInputGroupProps> = (args) => {
93
+ const Template: StoryFn<CollapsibleInputGroupProps> = (args) => {
54
94
  const form = useForm({ defaultValues })
55
95
  return (
56
96
  <FormProvider {...form}>
@@ -77,13 +117,41 @@ Categories.args = {
77
117
  label: 'Categories',
78
118
  }
79
119
 
120
+ // Location-specific decorator with better query mocking
121
+ const withLocationMock = (Story) => {
122
+ const LocationWrapper = () => {
123
+ const queryClient = useQueryClient()
124
+ const path = '/api/timezones' as TimeZonePath
125
+
126
+ // Set query data synchronously before first render
127
+ // Try all possible query key formats
128
+ const queryKeys = [
129
+ [path, 'all'],
130
+ ['timezones', path, 'all'],
131
+ ['timeZone', path],
132
+ [path],
133
+ ['useTimeZoneApi', path, 'all'],
134
+ ]
135
+
136
+ queryKeys.forEach((key) => {
137
+ queryClient.setQueryData(key, mockTimezones)
138
+ })
139
+
140
+
141
+ return <Story />
142
+ }
143
+
144
+ return <LocationWrapper />
145
+ }
146
+
80
147
  export const Location = Template.bind({})
81
148
  Location.args = {
82
149
  eventKey: 'location',
83
- children: <LocationInput />,
84
- description: <LocationInputDescription />,
150
+ children: <LocationInput path={'/api/timezones' as TimeZonePath} />,
151
+ description: <LocationInputDescription path={'/api/timezones' as TimeZonePath} />,
85
152
  label: 'Location',
86
153
  }
154
+ Location.decorators = [withLocationMock]
87
155
 
88
156
  export const WorkingHours = Template.bind({})
89
157
  WorkingHours.args = {
@@ -1063,7 +1063,8 @@ const defaultProductSets = [
1063
1063
 
1064
1064
  export const Default: Story<EditEventFormProps> = (args) => {
1065
1065
  // @todo: rewrite story to use actions instead of addon-knobs
1066
- const hasPermission = boolean('hasPermission', true)
1066
+ // TODO: Replace with Storybook controls
1067
+ const hasPermission = true
1067
1068
  const [editProductSetId, setEditProductSetId] = useState<string>()
1068
1069
  return (
1069
1070
  <div className='edit-event-dialog'>
@@ -14,7 +14,8 @@ export default {
14
14
 
15
15
  export const Default: Story<EditRecurrentEventModalProps> = (args) => {
16
16
  const [isOpen, setIsOpen] = useState(false)
17
- const isEditRecurrentEventModal = boolean('isEditRecurrentEventModal', false)
17
+ // TODO: Replace with Storybook controls
18
+ const isEditRecurrentEventModal = false
18
19
 
19
20
  return (
20
21
  <div>
@@ -31,7 +32,7 @@ export const Default: Story<EditRecurrentEventModalProps> = (args) => {
31
32
 
32
33
  Default.args = {
33
34
  isOpen: false,
34
- onHide: () => {},
35
+ onHide: () => { },
35
36
  title: 'Some title',
36
37
  onSubmit: (data) => console.log(data),
37
38
  }
@@ -10,9 +10,10 @@ export default {
10
10
  } as Meta
11
11
 
12
12
  export const Default: Story<EventCardProps> = () => {
13
- const showImage = boolean('showImage', true)
13
+ // TODO: Replace with Storybook controls
14
+ const showImage = true
14
15
  // @todo: rewrite story to use actions instead of addon-knobs
15
- const hasPermission = boolean('hasPermission', true)
16
+ const hasPermission = true
16
17
 
17
18
  return (
18
19
  <div style={{ maxWidth: '34rem' }}>
@@ -13,7 +13,8 @@ export default {
13
13
 
14
14
  export const Default: Story<EventStatisticModalProps> = (args) => {
15
15
  const [isOpen, setIsOpen] = useState(false)
16
- const isEmptyEventStatistic = boolean('isEmptyEventStatistic', false)
16
+ // TODO: Replace with Storybook controls
17
+ const isEmptyEventStatistic = false
17
18
 
18
19
  return (
19
20
  <div>
@@ -20,7 +20,8 @@ export const EventVenueMapComponent: Story<EventVenueMapProps> = (args) => {
20
20
  productUuid: 'product-1',
21
21
  },
22
22
  ])
23
- const editMode = boolean('editMode', false)
23
+ // TODO: Replace with Storybook controls
24
+ const editMode = false
24
25
 
25
26
  return (
26
27
  <div style={{ width: window.innerWidth, height: window.innerHeight }}>
@@ -66,4 +67,10 @@ EventVenueMapComponent.args = {
66
67
  yCoordinate: 250,
67
68
  },
68
69
  ],
70
+ onPointsChange: (value) => {
71
+ console.log('onPointsChange called with:', value)
72
+ },
73
+ onPointClick: (pointId) => {
74
+ console.log('onPointClick called with:', pointId)
75
+ },
69
76
  }
@@ -51,7 +51,7 @@ export const ProductWithModifierSetModal = ({
51
51
  <div
52
52
  className={clsx(
53
53
  'manual-booking-container',
54
- !product.images.length && 'tw-mt-8',
54
+ !product.images?.length && 'tw-mt-8',
55
55
  )}
56
56
  >
57
57
  <div className='manual-booking-header'>
@@ -60,10 +60,10 @@ export const ProductWithModifierSetModal = ({
60
60
  description={product.description}
61
61
  className={clsx(
62
62
  'iframe-event__product-description',
63
- !product.images.length && 'mt-6',
63
+ !product.images?.length && 'mt-6',
64
64
  )}
65
65
  classNameProductModal='d-block'
66
- images={product.images}
66
+ images={product.images || []}
67
67
  isRequired={product.isRequired}
68
68
  canExpand
69
69
  isModal
@@ -131,14 +131,14 @@ export const ModifiersSetControl = ({
131
131
 
132
132
  const radioButtonDefaultModifier = currentOrderModifiersSets
133
133
  .find((modifier) =>
134
- modifierSet.modifiers.some((rl) => rl.id === modifier.modifierId),
134
+ modifierSet.modifiers?.some((rl) => rl.id === modifier.modifierId),
135
135
  )
136
136
  ?.modifierId.toString()
137
137
 
138
138
  return (
139
139
  <>
140
140
  {modifierSet?.maxItems === 1 &&
141
- modifiers.every((modifier) => modifier.maxItems === 1) ? (
141
+ modifiers.every((modifier) => modifier.maxItems === 1) ? (
142
142
  <>
143
143
  <Controller
144
144
  name={`${productId}.modifier`}
@@ -74,7 +74,7 @@ export const ProductControl = ({
74
74
  <ModifiersSetControl
75
75
  modifierSet={modifierSet}
76
76
  productId={product.id}
77
- modifiers={modifierSet.modifiers}
77
+ modifiers={modifierSet.modifiers || []}
78
78
  isEditMode={!!editOrderModifier?.modifiers}
79
79
  orderProductModifierSets={editOrderModifier?.modifiers}
80
80
  isLoading={isLoading}
@@ -33,8 +33,9 @@ export const Default: Story<any> = () => {
33
33
  })
34
34
  const { handleSubmit, register } = formProps
35
35
 
36
- const isRequired = boolean('isRequired', false)
37
- const isLoading = boolean('isLoading', false)
36
+ // TODO: Replace with Storybook controls
37
+ const isRequired = false
38
+ const isLoading = false
38
39
 
39
40
  const currentField = useMemo(
40
41
  () => ({
@@ -9,8 +9,9 @@ export default {
9
9
  } as Meta
10
10
 
11
11
  export function Default() {
12
- const showImage = boolean('showImage', true)
13
- const isListView = boolean('isListView', false)
12
+ // TODO: Replace with Storybook controls
13
+ const showImage = true
14
+ const isListView = false
14
15
 
15
16
  return (
16
17
  <div>
@@ -19,7 +20,7 @@ export function Default() {
19
20
  imageSrc={
20
21
  showImage
21
22
  ? // eslint-disable-next-line max-len
22
- 'https://images.unsplash.com/photo-1638988319382-90e61be77c59?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=687&q=80'
23
+ 'https://images.unsplash.com/photo-1638988319382-90e61be77c59?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=687&q=80'
23
24
  : undefined
24
25
  }
25
26
  title='Glitterbomb Bucks / Baga Chipz'
@@ -54,8 +55,9 @@ export function Default() {
54
55
  }
55
56
 
56
57
  export function EventCardSkeleton() {
57
- const showImage = boolean('showImage', true)
58
- const isListView = boolean('isListView', false)
58
+ // TODO: Replace with Storybook controls
59
+ const showImage = true
60
+ const isListView = false
59
61
 
60
62
  return (
61
63
  <div>
@@ -554,11 +554,12 @@ const MOCK_IFRAMES = [
554
554
  ]
555
555
 
556
556
  export function Default() {
557
- const displayCost = boolean('displayCost', true)
558
- const displayType = boolean('displayType', true)
559
- const displayDescription = boolean('displayDescription', true)
560
- const isListView = boolean('isListView', false)
561
- const className = text('className', 'event-info')
557
+ // TODO: Replace with Storybook controls
558
+ const displayCost = true
559
+ const displayType = true
560
+ const displayDescription = true
561
+ const isListView = false
562
+ const className = 'event-info'
562
563
 
563
564
  return (
564
565
  <div
@@ -584,7 +585,7 @@ export function Default() {
584
585
  includeFromPrice: [],
585
586
  }}
586
587
  imageSrc={event.imgSrc}
587
- goToDetails={() => {}}
588
+ goToDetails={() => { }}
588
589
  description={event.description}
589
590
  isListView={isListView}
590
591
  className={className}
@@ -31,7 +31,8 @@ const LONG_DESCRIPTION = `On the other hand, we denounce with righteous indignat
31
31
  `
32
32
 
33
33
  export function Default() {
34
- const shortDescription = boolean('shortDescription', true)
34
+ // TODO: Replace with Storybook controls
35
+ const shortDescription = true
35
36
 
36
37
  const onNextStep = () => {
37
38
  console.log('onNextStep')
@@ -67,7 +68,7 @@ export function Default() {
67
68
  ]}
68
69
  providerName='Baga Chipz studio'
69
70
  onNextStep={onNextStep}
70
- onPrevStep={() => {}}
71
+ onPrevStep={() => { }}
71
72
  />
72
73
  </div>
73
74
  )
@@ -239,7 +239,8 @@ const selectOptions = [
239
239
  ]
240
240
 
241
241
  export function Default() {
242
- const usedInIframe = boolean('usedInIframe', true)
242
+ // TODO: Replace with Storybook controls
243
+ const usedInIframe = true
243
244
  return (
244
245
  <Page headerBlock={<PageHeader>Header</PageHeader>}>
245
246
  <PageBody
@@ -249,7 +250,7 @@ export function Default() {
249
250
  component={
250
251
  <CalendarSelect
251
252
  value={selectOptions[0].value}
252
- onChange={() => {}}
253
+ onChange={() => { }}
253
254
  options={selectOptions}
254
255
  />
255
256
  }
@@ -13,3 +13,6 @@ export function Default() {
13
13
  </div>
14
14
  )
15
15
  }
16
+ Default.parameters = {
17
+ excludeRouter: true,
18
+ }
@@ -35,6 +35,7 @@ const productCategories = [
35
35
  maxAmount: 2,
36
36
  price: 1,
37
37
  images: IMAGES,
38
+ modifiersSet: [],
38
39
  },
39
40
  {
40
41
  id: 8,
@@ -46,6 +47,7 @@ const productCategories = [
46
47
  maxAmount: 5,
47
48
  price: 1,
48
49
  images: IMAGES,
50
+ modifiersSet: [],
49
51
  },
50
52
  ],
51
53
  },
@@ -64,6 +66,7 @@ const productCategories = [
64
66
  maxAmount: 10,
65
67
  price: 1,
66
68
  images: IMAGES,
69
+ modifiersSet: [],
67
70
  },
68
71
  {
69
72
  id: 149,
@@ -75,6 +78,7 @@ const productCategories = [
75
78
  maxAmount: 15,
76
79
  uuid: 'beb6393c-2fdd-40f7-bb92-8800685b203a',
77
80
  images: IMAGES,
81
+ modifiersSet: [],
78
82
  },
79
83
  {
80
84
  id: 148,
@@ -85,6 +89,7 @@ const productCategories = [
85
89
  minAmount: 1,
86
90
  maxAmount: 15,
87
91
  uuid: 'beb6393c-2fdd-40f7-bb92-8800685b203f',
92
+ modifiersSet: [],
88
93
  },
89
94
  ],
90
95
  },
@@ -8,7 +8,8 @@ export default {
8
8
  } as Meta
9
9
 
10
10
  export function Default() {
11
- const isLoading = boolean('isLoading', false)
11
+ // TODO: Replace with Storybook controls
12
+ const isLoading = false
12
13
 
13
14
  return (
14
15
  <div className='payment-process'>
@@ -8,7 +8,8 @@ export default {
8
8
  } as Meta
9
9
 
10
10
  export function Default(args) {
11
- const totalWithDiscount = number('totalWithDiscount', 0)
11
+ // TODO: Replace with Storybook controls
12
+ const totalWithDiscount = 0
12
13
 
13
14
  return (
14
15
  <div className='payment-process'>
@@ -187,12 +187,13 @@ const MOCK_IFRAMES = [
187
187
  ]
188
188
 
189
189
  export function Default() {
190
- const showCloseButton = boolean('showCloseButton', true)
191
- const showBackButton = boolean('showBackButton', true)
192
- const showHeader = boolean('showHeader', true)
193
- const showRightBlock = boolean('showRightBlock', true)
194
- const showBottomBlock = boolean('showBottomBlock', true)
195
- const isAppUsingInIframe = boolean('isAppUsingInIframe', false)
190
+ // TODO: Replace with Storybook controls
191
+ const showCloseButton = true
192
+ const showBackButton = true
193
+ const showHeader = true
194
+ const showRightBlock = true
195
+ const showBottomBlock = true
196
+ const isAppUsingInIframe = false
196
197
 
197
198
  const rightCardEvent = MOCK_IFRAMES[0]
198
199
 
@@ -247,7 +248,7 @@ export function Default() {
247
248
  shortDate={String(event.startAt)}
248
249
  colour={event.colour}
249
250
  imageSrc={event.imgSrc}
250
- goToDetails={() => {}}
251
+ goToDetails={() => { }}
251
252
  description={event.description}
252
253
  />
253
254
  </div>
@@ -276,7 +277,7 @@ export function Default() {
276
277
  shortDate={String(rightCardEvent.startAt)}
277
278
  colour={rightCardEvent.colour}
278
279
  imageSrc={rightCardEvent.imgSrc}
279
- goToDetails={() => {}}
280
+ goToDetails={() => { }}
280
281
  description={rightCardEvent.description}
281
282
  />
282
283
  </div>
@@ -9,7 +9,8 @@ export default {
9
9
  } as Meta
10
10
 
11
11
  export function Default(args) {
12
- const isPaymentProcessed = boolean('isPaymentProcessed', true)
12
+ // TODO: Replace with Storybook controls
13
+ const isPaymentProcessed = true
13
14
 
14
15
  return (
15
16
  <div style={{ width: '800px' }} className='m-5'>
@@ -8,7 +8,8 @@ export default {
8
8
  } as Meta
9
9
 
10
10
  export function Default() {
11
- const success = boolean('success', true)
11
+ // TODO: Replace with Storybook controls
12
+ const success = true
12
13
  return (
13
14
  <div
14
15
  className='snippet d-flex justify-content-center align-items-center h-100'
package/src/index.ts CHANGED
@@ -44,3 +44,5 @@ export * from './number-of-people-input'
44
44
  export * from './fullscreen-loader'
45
45
  export * from './pages'
46
46
  export { default as RadioButton } from './customRadioButton/RadioButton'
47
+ export * from './PageNotFound'
48
+ export * from './UnderMaintenance'
@@ -1,4 +1,3 @@
1
- // TODO: Replace knobs with controls
2
1
  import Logo from './Logo'
3
2
  import { ReactComponent as BookeditLogoSvg } from '../assets/logo/bookedit.svg'
4
3
  import { ReactComponent as LicklistLogoSvg } from '../assets/logo/licklist.svg'
@@ -36,19 +35,23 @@ Bookedit.story = {
36
35
  },
37
36
  }
38
37
 
39
- export const ColouredLogos = () => (
40
- <>
41
- <p>
42
- <Logo
43
- logo={<LicklistLogoSvg color={color('color', 'red')} />}
44
- logoSm={<LicklistLogoSmSvg color={color('color', 'red')} />}
45
- />
46
- </p>
47
- <p>
48
- <Logo logo={<BookeditLogoSvg color={color('color', 'red')} />} />
49
- </p>
50
- </>
51
- )
38
+ export const ColouredLogos = () => {
39
+ const logoColor = 'red' // You can make this configurable with Storybook controls if needed
40
+
41
+ return (
42
+ <>
43
+ <p>
44
+ <Logo
45
+ logo={<LicklistLogoSvg color={logoColor} />}
46
+ logoSm={<LicklistLogoSmSvg color={logoColor} />}
47
+ />
48
+ </p>
49
+ <p>
50
+ <Logo logo={<BookeditLogoSvg color={logoColor} />} />
51
+ </p>
52
+ </>
53
+ )
54
+ }
52
55
 
53
56
  ColouredLogos.story = {
54
57
  name: 'Coloured logos',
@@ -9,7 +9,8 @@ export default {
9
9
 
10
10
  export const Default: Story<ConfirmModalProps> = (args) => {
11
11
  const onConfirm = () => alert('confirmed')
12
- const showButtons = boolean('showButtons', true)
12
+ // TODO: Replace with Storybook controls
13
+ const showButtons = true
13
14
 
14
15
  return (
15
16
  <ConfirmModal {...args} hideButtons={showButtons}>
@@ -17,6 +17,10 @@ export const Empty: Story<NotificationPlaceholdersProps> = (args) => (
17
17
  <NotificationPlaceholders {...args} />
18
18
  )
19
19
 
20
+ Empty.args = {
21
+ placeholders: [],
22
+ }
23
+
20
24
  Default.args = {
21
25
  placeholders: [
22
26
  { value: 'user.first_name', description: 'Customers first name' },
@@ -7,7 +7,7 @@ export interface NotificationPlaceholdersProps {
7
7
  }
8
8
 
9
9
  export const NotificationPlaceholders = ({
10
- placeholders,
10
+ placeholders = [],
11
11
  }: NotificationPlaceholdersProps) => {
12
12
  const { t } = useTranslation('Design')
13
13
 
@@ -144,7 +144,7 @@ export function ProductCategoriesControl({
144
144
  const productCategories: ProductCategory[] = useWatch({
145
145
  control,
146
146
  name: productCategoriesFieldName,
147
- })
147
+ }) || []
148
148
 
149
149
  const productCategoriesErrors = errors?.steps?.[stepIndex]?.productCategories
150
150
 
@@ -259,6 +259,12 @@ export function ProductCategoriesControl({
259
259
 
260
260
  const categoryType = CATEGORIES_TYPE[productCategory.type]
261
261
 
262
+ // Fallback for unknown category types
263
+ const categoryConfig = categoryType || {
264
+ label: productCategory.type || 'category',
265
+ icon: <FaBars color='#0e8ce2' size={10} />,
266
+ }
267
+
262
268
  return (
263
269
  <Controller
264
270
  key={`product-category-${productCategory._id}`}
@@ -305,8 +311,8 @@ export function ProductCategoriesControl({
305
311
  isNewAdded={showCategoryModal}
306
312
  itemButton={
307
313
  <div className='btn-outline-primary item-icon sm border border-primary rounded-sm'>
308
- {categoryType.icon}
309
- <span className='ml-2'>{t(categoryType.label)}</span>
314
+ {categoryConfig.icon}
315
+ <span className='ml-2'>{t(categoryConfig.label)}</span>
310
316
  </div>
311
317
  }
312
318
  body={
@@ -330,10 +336,10 @@ export function ProductCategoriesControl({
330
336
  saveValidField={saveValidField}
331
337
  // preItem={<Popover className="d-none d-sm-block" />}
332
338
  sortableItems={
333
- productCategory.products
339
+ productCategory.products && Array.isArray(productCategory.products)
334
340
  ? productCategory.products
335
- .filter((product) => product.id)
336
- .map(({ id }) => String(id))
341
+ .filter((product) => product?.id)
342
+ .map(({ id }) => String(id))
337
343
  : []
338
344
  }
339
345
  >