@licklist/design 0.78.21 → 0.78.26

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 (186) hide show
  1. package/dist/assets/Trend-Down.svg +3 -0
  2. package/dist/assets/Trend-Up.svg +3 -0
  3. package/dist/auth/Authorizer.d.ts.map +1 -1
  4. package/dist/auth/Authorizer.js +47 -12
  5. package/dist/index.d.ts +1 -0
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +5 -0
  8. package/dist/v2/components/EntityHeader/EntityHeader.d.ts +13 -0
  9. package/dist/v2/components/EntityHeader/EntityHeader.d.ts.map +1 -0
  10. package/dist/v2/components/EntityHeader/EntityHeader.js +85 -0
  11. package/dist/v2/components/EntityHeader/EntityHeader.scss.js +6 -0
  12. package/dist/v2/components/EntityHeader/index.d.ts +2 -0
  13. package/dist/v2/components/EntityHeader/index.d.ts.map +1 -0
  14. package/dist/v2/components/NPSScore/NPSScore.d.ts +18 -0
  15. package/dist/v2/components/NPSScore/NPSScore.d.ts.map +1 -0
  16. package/dist/v2/components/NPSScore/index.d.ts +3 -0
  17. package/dist/v2/components/NPSScore/index.d.ts.map +1 -0
  18. package/dist/v2/components/Select/Select.d.ts +10 -0
  19. package/dist/v2/components/Select/Select.d.ts.map +1 -0
  20. package/dist/v2/components/Select/index.d.ts +3 -0
  21. package/dist/v2/components/Select/index.d.ts.map +1 -0
  22. package/dist/v2/components/Tooltip/Tooltip.d.ts +21 -0
  23. package/dist/v2/components/Tooltip/Tooltip.d.ts.map +1 -0
  24. package/dist/v2/components/Tooltip/Tooltip.js +103 -0
  25. package/dist/v2/components/Tooltip/Tooltip.scss.js +6 -0
  26. package/dist/v2/components/Tooltip/index.d.ts +2 -0
  27. package/dist/v2/components/Tooltip/index.d.ts.map +1 -0
  28. package/dist/v2/components/UserAvatar/UserAvatar.d.ts +12 -0
  29. package/dist/v2/components/UserAvatar/UserAvatar.d.ts.map +1 -0
  30. package/dist/v2/components/UserAvatar/UserAvatar.js +77 -0
  31. package/dist/v2/components/UserAvatar/UserAvatar.scss.js +6 -0
  32. package/dist/v2/components/UserAvatar/index.d.ts +2 -0
  33. package/dist/v2/components/UserAvatar/index.d.ts.map +1 -0
  34. package/dist/v2/components/UserPanel/UserPanel.d.ts +17 -0
  35. package/dist/v2/components/UserPanel/UserPanel.d.ts.map +1 -0
  36. package/dist/v2/components/UserPanel/UserPanel.js +144 -0
  37. package/dist/v2/components/UserPanel/UserPanel.scss.js +6 -0
  38. package/dist/v2/components/UserPanel/index.d.ts +3 -0
  39. package/dist/v2/components/UserPanel/index.d.ts.map +1 -0
  40. package/dist/v2/dashboard-analytics/blog-posts/Blog.d.ts +15 -0
  41. package/dist/v2/dashboard-analytics/blog-posts/Blog.d.ts.map +1 -0
  42. package/dist/v2/dashboard-analytics/blog-posts/index.d.ts +3 -0
  43. package/dist/v2/dashboard-analytics/blog-posts/index.d.ts.map +1 -0
  44. package/dist/v2/dashboard-analytics/chart/Chart.d.ts +21 -0
  45. package/dist/v2/dashboard-analytics/chart/Chart.d.ts.map +1 -0
  46. package/dist/v2/dashboard-analytics/chart/index.d.ts +3 -0
  47. package/dist/v2/dashboard-analytics/chart/index.d.ts.map +1 -0
  48. package/dist/v2/dashboard-analytics/dashboard/Dashboard.d.ts +57 -0
  49. package/dist/v2/dashboard-analytics/dashboard/Dashboard.d.ts.map +1 -0
  50. package/dist/v2/dashboard-analytics/dashboard/index.d.ts +3 -0
  51. package/dist/v2/dashboard-analytics/dashboard/index.d.ts.map +1 -0
  52. package/dist/v2/dashboard-analytics/index.d.ts +13 -0
  53. package/dist/v2/dashboard-analytics/index.d.ts.map +1 -0
  54. package/dist/v2/dashboard-analytics/metric-card/MetricCard.d.ts +17 -0
  55. package/dist/v2/dashboard-analytics/metric-card/MetricCard.d.ts.map +1 -0
  56. package/dist/v2/dashboard-analytics/metric-card/index.d.ts +3 -0
  57. package/dist/v2/dashboard-analytics/metric-card/index.d.ts.map +1 -0
  58. package/dist/v2/dashboard-analytics/venue-card/VenueCard.d.ts +12 -0
  59. package/dist/v2/dashboard-analytics/venue-card/VenueCard.d.ts.map +1 -0
  60. package/dist/v2/dashboard-analytics/venue-card/index.d.ts +3 -0
  61. package/dist/v2/dashboard-analytics/venue-card/index.d.ts.map +1 -0
  62. package/dist/v2/dashboard-analytics/venue-closed-card/VenueClosedCard.d.ts +25 -0
  63. package/dist/v2/dashboard-analytics/venue-closed-card/VenueClosedCard.d.ts.map +1 -0
  64. package/dist/v2/dashboard-analytics/venue-closed-card/index.d.ts +3 -0
  65. package/dist/v2/dashboard-analytics/venue-closed-card/index.d.ts.map +1 -0
  66. package/dist/v2/index.d.ts +11 -5
  67. package/dist/v2/index.d.ts.map +1 -1
  68. package/dist/v2/navigation/DashboardLayout/AdminSidebar.d.ts +10 -0
  69. package/dist/v2/navigation/DashboardLayout/AdminSidebar.d.ts.map +1 -0
  70. package/dist/v2/navigation/DashboardLayout/AdminSidebar.js +296 -0
  71. package/dist/v2/navigation/DashboardLayout/AdminSidebar.scss.js +6 -0
  72. package/dist/v2/navigation/DashboardLayout/DashboardFooter.d.ts +7 -0
  73. package/dist/v2/navigation/DashboardLayout/DashboardFooter.d.ts.map +1 -0
  74. package/dist/v2/navigation/DashboardLayout/DashboardFooter.js +34 -0
  75. package/dist/v2/navigation/DashboardLayout/DashboardFooter.scss.js +6 -0
  76. package/dist/v2/navigation/DashboardLayout/DashboardLayout.d.ts +42 -0
  77. package/dist/v2/navigation/DashboardLayout/DashboardLayout.d.ts.map +1 -0
  78. package/dist/v2/navigation/DashboardLayout/DashboardLayout.js +176 -0
  79. package/dist/v2/navigation/DashboardLayout/DashboardLayout.scss.js +6 -0
  80. package/dist/v2/navigation/DashboardLayout/ProviderSidebar.d.ts +35 -0
  81. package/dist/v2/navigation/DashboardLayout/ProviderSidebar.d.ts.map +1 -0
  82. package/dist/v2/navigation/DashboardLayout/ProviderSidebar.js +366 -0
  83. package/dist/v2/navigation/DashboardLayout/ProviderSidebar.scss.js +6 -0
  84. package/dist/v2/navigation/DashboardLayout/TopNavigation.d.ts +26 -0
  85. package/dist/v2/navigation/DashboardLayout/TopNavigation.d.ts.map +1 -0
  86. package/dist/v2/navigation/DashboardLayout/TopNavigation.js +360 -0
  87. package/dist/v2/navigation/DashboardLayout/TopNavigation.scss.js +6 -0
  88. package/dist/v2/navigation/DashboardLayout/assets/AdminLogo.png.js +3 -0
  89. package/dist/v2/navigation/DashboardLayout/assets/BookedLogo_Mark.png.js +3 -0
  90. package/dist/v2/navigation/DashboardLayout/index.d.ts +7 -0
  91. package/dist/v2/navigation/DashboardLayout/index.d.ts.map +1 -0
  92. package/package.json +5 -3
  93. package/src/assets/Trend-Down.svg +3 -0
  94. package/src/assets/Trend-Up.svg +3 -0
  95. package/src/auth/Authorizer.tsx +49 -20
  96. package/src/index.ts +2 -1
  97. package/src/v2/components/EntityHeader/EntityHeader.scss +133 -0
  98. package/src/v2/components/EntityHeader/EntityHeader.stories.tsx +103 -0
  99. package/src/v2/components/EntityHeader/EntityHeader.tsx +76 -0
  100. package/src/v2/components/EntityHeader/index.ts +1 -0
  101. package/src/v2/components/NPSScore/NPSScore.scss +330 -0
  102. package/src/v2/components/NPSScore/NPSScore.stories.tsx +29 -0
  103. package/src/v2/components/NPSScore/NPSScore.tsx +209 -0
  104. package/src/v2/components/NPSScore/index.ts +2 -0
  105. package/src/v2/components/Select/Select.scss +188 -0
  106. package/src/v2/components/Select/Select.stories.tsx +164 -0
  107. package/src/v2/components/Select/Select.tsx +56 -0
  108. package/src/v2/components/Select/index.ts +2 -0
  109. package/src/v2/components/Tooltip/Tooltip.scss +92 -0
  110. package/src/v2/components/Tooltip/Tooltip.stories.tsx +164 -0
  111. package/src/v2/components/Tooltip/Tooltip.tsx +64 -0
  112. package/src/v2/components/Tooltip/index.ts +8 -0
  113. package/src/v2/components/UserAvatar/UserAvatar.scss +62 -0
  114. package/src/v2/components/UserAvatar/UserAvatar.stories.tsx +94 -0
  115. package/src/v2/components/UserAvatar/UserAvatar.tsx +96 -0
  116. package/src/v2/components/UserAvatar/index.ts +1 -0
  117. package/src/v2/components/UserPanel/UserPanel.scss +195 -0
  118. package/src/v2/components/UserPanel/UserPanel.stories.tsx +66 -0
  119. package/src/v2/components/UserPanel/UserPanel.tsx +126 -0
  120. package/src/v2/components/UserPanel/index.ts +2 -0
  121. package/src/v2/dashboard-analytics/blog-posts/Blog.scss +92 -0
  122. package/src/v2/dashboard-analytics/blog-posts/Blog.stories.tsx +57 -0
  123. package/src/v2/dashboard-analytics/blog-posts/Blog.tsx +91 -0
  124. package/src/v2/dashboard-analytics/blog-posts/index.ts +2 -0
  125. package/src/v2/dashboard-analytics/chart/Chart.scss +424 -0
  126. package/src/v2/dashboard-analytics/chart/Chart.stories.tsx +157 -0
  127. package/src/v2/dashboard-analytics/chart/Chart.tsx +623 -0
  128. package/src/v2/dashboard-analytics/chart/index.ts +2 -0
  129. package/src/v2/dashboard-analytics/dashboard/Dashboard.scss +254 -0
  130. package/src/v2/dashboard-analytics/dashboard/Dashboard.stories.tsx +298 -0
  131. package/src/v2/dashboard-analytics/dashboard/Dashboard.tsx +248 -0
  132. package/src/v2/dashboard-analytics/dashboard/index.ts +2 -0
  133. package/src/v2/dashboard-analytics/index.ts +12 -0
  134. package/src/v2/dashboard-analytics/metric-card/MetricCard.scss +125 -0
  135. package/src/v2/dashboard-analytics/metric-card/MetricCard.stories.tsx +106 -0
  136. package/src/v2/dashboard-analytics/metric-card/MetricCard.tsx +72 -0
  137. package/src/v2/dashboard-analytics/metric-card/index.ts +2 -0
  138. package/src/v2/dashboard-analytics/venue-card/VenueCard.scss +112 -0
  139. package/src/v2/dashboard-analytics/venue-card/VenueCard.stories.tsx +40 -0
  140. package/src/v2/dashboard-analytics/venue-card/VenueCard.tsx +62 -0
  141. package/src/v2/dashboard-analytics/venue-card/index.ts +2 -0
  142. package/src/v2/dashboard-analytics/venue-closed-card/VenueClosedCard.scss +129 -0
  143. package/src/v2/dashboard-analytics/venue-closed-card/VenueClosedCard.stories.tsx +31 -0
  144. package/src/v2/dashboard-analytics/venue-closed-card/VenueClosedCard.tsx +61 -0
  145. package/src/v2/dashboard-analytics/venue-closed-card/index.ts +2 -0
  146. package/src/v2/design-system/colors/ColorSystem.scss +439 -0
  147. package/src/v2/design-system/colors/ColorSystem.stories.tsx +730 -0
  148. package/src/v2/design-system/typography/Typography.scss +295 -0
  149. package/src/v2/design-system/typography/Typography.stories.tsx +109 -0
  150. package/src/v2/index.ts +43 -7
  151. package/src/v2/navigation/DashboardLayout/AdminSidebar.scss +207 -0
  152. package/src/v2/navigation/DashboardLayout/AdminSidebar.tsx +171 -0
  153. package/src/v2/navigation/DashboardLayout/DashboardFooter.scss +30 -0
  154. package/src/v2/navigation/DashboardLayout/DashboardFooter.tsx +25 -0
  155. package/src/v2/navigation/DashboardLayout/DashboardLayout.scss +91 -0
  156. package/src/v2/navigation/DashboardLayout/DashboardLayout.stories.tsx +370 -0
  157. package/src/v2/navigation/DashboardLayout/DashboardLayout.tsx +233 -0
  158. package/src/v2/navigation/DashboardLayout/ProviderSidebar.scss +271 -0
  159. package/src/v2/navigation/DashboardLayout/ProviderSidebar.tsx +266 -0
  160. package/src/v2/navigation/DashboardLayout/Sidebar.stories.tsx +220 -0
  161. package/src/v2/navigation/DashboardLayout/TopNavigation.scss +206 -0
  162. package/src/v2/navigation/DashboardLayout/TopNavigation.tsx +279 -0
  163. package/src/v2/navigation/DashboardLayout/assets/AdminLogo.png +0 -0
  164. package/src/v2/navigation/DashboardLayout/assets/BookedLogo_Mark.png +0 -0
  165. package/src/v2/navigation/DashboardLayout/index.ts +20 -0
  166. package/src/v2/styles/index.scss +0 -1
  167. package/src/v2/styles/tokens/_colors.scss +531 -98
  168. package/dist/v2/components/Colors/Colors.d.ts +0 -21
  169. package/dist/v2/components/Colors/Colors.d.ts.map +0 -1
  170. package/dist/v2/components/Colors/index.d.ts +0 -3
  171. package/dist/v2/components/Colors/index.d.ts.map +0 -1
  172. package/dist/v2/components/Typography/Typography.d.ts +0 -11
  173. package/dist/v2/components/Typography/Typography.d.ts.map +0 -1
  174. package/dist/v2/components/Typography/index.d.ts +0 -3
  175. package/dist/v2/components/Typography/index.d.ts.map +0 -1
  176. package/src/v2/components/Colors/Colors.scss +0 -64
  177. package/src/v2/components/Colors/Colors.stories.tsx +0 -143
  178. package/src/v2/components/Colors/Colors.tsx +0 -51
  179. package/src/v2/components/Colors/ColorsAliases.stories.tsx +0 -285
  180. package/src/v2/components/Colors/Sizes.stories.tsx +0 -141
  181. package/src/v2/components/Colors/index.ts +0 -2
  182. package/src/v2/components/Typography/Typography.scss +0 -72
  183. package/src/v2/components/Typography/Typography.stories.tsx +0 -266
  184. package/src/v2/components/Typography/Typography.tsx +0 -56
  185. package/src/v2/components/Typography/index.ts +0 -2
  186. package/src/v2/styles/tokens/_aliases.scss +0 -199
@@ -0,0 +1,254 @@
1
+
2
+ .dashboard {
3
+ display: flex;
4
+ flex-direction: column;
5
+ gap: 1rem;
6
+ width: 100%;
7
+ max-width: 100%;
8
+ padding-bottom: 24px;
9
+ background-color: var(--surface-primary);
10
+ overflow: hidden;
11
+ box-sizing: border-box;
12
+ transition: all 0.3s ease-in-out;
13
+
14
+
15
+
16
+ &__metrics-grid {
17
+ display: grid;
18
+ grid-template-columns: 1fr;
19
+ gap: 1rem;
20
+ padding: 0 1rem;
21
+
22
+ @media (min-width: 768px) {
23
+ grid-template-columns: repeat(4, 1fr);
24
+ padding: 0 1rem;
25
+ }
26
+ }
27
+
28
+ &__filter {
29
+ display: flex;
30
+ align-items: center;
31
+ gap: 1rem;
32
+ font-size: 13px;
33
+ color: var(--surface-primary);
34
+ font-weight: 500;
35
+ text-align: right;
36
+ line-height: 1;
37
+ max-width: 100%;
38
+ padding: 1rem 1rem 0 1rem;
39
+ transition: all 0.3s ease-in-out;
40
+ @media (min-width: 768px) {
41
+ max-width: 100%;
42
+ }
43
+
44
+ .select--transitioning {
45
+ opacity: 0.8;
46
+ transition: all 0.2s ease-in-out;
47
+ }
48
+ }
49
+
50
+ &__charts {
51
+ display: flex;
52
+ flex-direction: column;
53
+ gap: 1rem;
54
+ padding: 0 1rem;
55
+
56
+ @media (min-width: 480px) {
57
+ gap: 1rem;
58
+ }
59
+
60
+ @media (min-width: 768px) {
61
+ gap: 1.5rem;
62
+ padding: 0 1rem;
63
+ }
64
+ }
65
+
66
+ &__metric-performance-text {
67
+ display: flex;
68
+ flex-direction: column;
69
+ gap: 0.25rem;
70
+ font-size: 11px;
71
+ font-weight: 500;
72
+ color: var(--label-secondary);
73
+
74
+ &--mobile {
75
+ display: block;
76
+
77
+ @media (min-width: 768px) {
78
+ display: none;
79
+ }
80
+ }
81
+
82
+ &--desktop {
83
+ display: none;
84
+
85
+ @media (min-width: 768px) {
86
+ display: flex;
87
+ flex-direction: column;
88
+ gap: 0.25rem;
89
+ }
90
+ }
91
+ }
92
+
93
+ &__content {
94
+ display: flex;
95
+ gap: 0.75rem;
96
+ align-items: flex-start;
97
+ padding: 0 1rem;
98
+ width: 100%;
99
+ overflow: hidden;
100
+
101
+ @media (min-width: 480px) {
102
+ gap: 1rem;
103
+ }
104
+
105
+ @media (min-width: 768px) {
106
+ padding: 0 1rem;
107
+ }
108
+
109
+ @media (max-width: 1024px) {
110
+ flex-direction: column;
111
+ }
112
+
113
+ @media (min-width: 1200px) {
114
+ gap: 1.5rem;
115
+ }
116
+
117
+ // When only charts section (no sidebar), ensure full width usage
118
+ &:has(.dashboard__charts-section:only-child) {
119
+ padding-right: 1rem;
120
+
121
+ @media (min-width: 768px) {
122
+ padding-right: 1rem;
123
+ }
124
+ }
125
+ }
126
+
127
+ // Charts take up remaining space
128
+ &__charts-section {
129
+ flex: 1;
130
+ min-width: 0;
131
+ width: 100%;
132
+ display: flex;
133
+ flex-direction: column;
134
+ gap: 0.75rem;
135
+ overflow: hidden;
136
+ transition: all 0.3s ease-in-out;
137
+ @media (min-width: 480px) {
138
+ gap: 1rem;
139
+ }
140
+
141
+ @media (min-width: 768px) {
142
+ gap: 1rem;
143
+ }
144
+
145
+ @media (min-width: 1200px) {
146
+ gap: 1rem;
147
+ }
148
+
149
+ &:only-child {
150
+ padding-right: 0;
151
+ margin-right: 0;
152
+ }
153
+
154
+ &--transitioning {
155
+ opacity: 0.8;
156
+ transform: translateY(2px);
157
+
158
+ .chart {
159
+ transition: all 0.3s ease-in-out;
160
+ filter: blur(1px);
161
+ }
162
+ }
163
+
164
+ // Chart transition states
165
+ .chart--transitioning {
166
+ opacity: 0.7;
167
+ transform: scale(0.98);
168
+ transition: all 0.3s ease-in-out;
169
+ }
170
+ }
171
+
172
+ &__sidebar {
173
+ display: flex;
174
+ flex-direction: column;
175
+ gap: 1rem;
176
+ flex-shrink: 0;
177
+ width: auto;
178
+ min-width: 280px;
179
+ @media (min-width: 480px) {
180
+ gap: 1.25rem;
181
+ }
182
+
183
+ @media (min-width: 768px) {
184
+ gap: 1.5rem;
185
+ }
186
+
187
+ @media (max-width: 1024px) {
188
+ width: 100%;
189
+ min-width: 0;
190
+ }
191
+
192
+ @media (min-width: 1440px) {
193
+ min-width: 320px;
194
+ }
195
+ }
196
+
197
+ &__venue-section {
198
+ display: flex;
199
+ flex-direction: row;
200
+ gap: 0.75rem;
201
+ flex-shrink: 0;
202
+ width: auto;
203
+
204
+ @media (min-width: 480px) {
205
+ gap: 1rem;
206
+ }
207
+
208
+ @media (max-width: 1024px) {
209
+ width: 100%;
210
+ }
211
+
212
+ @media (min-width: 1200px) {
213
+ gap: 1.25rem;
214
+ }
215
+ }
216
+
217
+ &--charts-focus {
218
+ .dashboard__content {
219
+ padding: 0 1rem;
220
+
221
+ @media (min-width: 768px) {
222
+ padding: 0 1rem;
223
+ }
224
+ }
225
+
226
+ .dashboard__charts-section {
227
+ padding: 0;
228
+ .chart {
229
+ padding: 1rem 1rem 1rem 1rem;
230
+
231
+ &[data-full-width="true"] {
232
+ .chart__container {
233
+ margin-left: -1rem;
234
+ margin-right: -1rem;
235
+ padding-left: 1rem;
236
+ width: calc(100% + 2rem);
237
+
238
+ @media (max-width: 480px) {
239
+ padding-left: 0.75rem;
240
+ }
241
+ }
242
+ }
243
+
244
+ @media (max-width: 480px) {
245
+ padding: 0.75rem 0.75rem 0.75rem 0.75rem;
246
+ }
247
+
248
+ @media (min-width: 768px) {
249
+ padding: 1.375rem 1rem 1rem 1rem;
250
+ }
251
+ }
252
+ }
253
+ }
254
+ }
@@ -0,0 +1,298 @@
1
+ import React, { useState } from 'react';
2
+ import type { Meta, StoryObj } from '@storybook/react';
3
+ import { Dashboard } from './Dashboard';
4
+ import { NPSScore } from '../../components/NPSScore';
5
+
6
+ type TimeFilter = 'Today' | 'Yesterday' | 'This Week';
7
+ type DatasetType = 'Bookings For' | 'Bookings Made';
8
+
9
+ const meta = {
10
+ title: 'v2/Dashboard Analytics/Dashboard',
11
+ component: Dashboard,
12
+ parameters: {
13
+ layout: 'fullscreen',
14
+ },
15
+ tags: [],
16
+ decorators: [
17
+ (Story) => (
18
+ <div style={{ minHeight: '100vh', backgroundColor: '#fff' }}>
19
+ <Story />
20
+ </div>
21
+ ),
22
+ ],
23
+ } satisfies Meta<typeof Dashboard>;
24
+
25
+ export default meta;
26
+
27
+ const mockMetrics = {
28
+ totalBookings: {
29
+ value: '24',
30
+ change: '+8 vs yesterday',
31
+ is_positive: true,
32
+ },
33
+ revenue: {
34
+ value: '£1,240.50',
35
+ change: '+£450 vs yesterday',
36
+ is_positive: true,
37
+ },
38
+ numberOfPeople: {
39
+ value: '89',
40
+ change: '+12 vs yesterday',
41
+ is_positive: true,
42
+ },
43
+ busiestTime: {
44
+ value: '14:00 - 15:00',
45
+ peopleText: '18 people',
46
+ bookingText: '6 bookings',
47
+ },
48
+ workHours: {
49
+ company_name: 'Sharksys Soft Play',
50
+ is_open: true,
51
+ status: 'Open',
52
+ message: 'Open until 18:00',
53
+ opens_at: '09:00'
54
+ },
55
+ peopleInVenue: {
56
+ value: '30',
57
+ formatted_value: '30',
58
+ description: 'people currently in venue'
59
+ }
60
+ };
61
+
62
+ const mockBookingsData = [
63
+ { time: '00:00', value: 2, participants: 4 },
64
+ { time: '01:00', value: 1, participants: 2 },
65
+ { time: '02:00', value: 0, participants: 0 },
66
+ { time: '03:00', value: 1, participants: 2 },
67
+ { time: '04:00', value: 2, participants: 4 },
68
+ { time: '05:00', value: 3, participants: 6 },
69
+ { time: '06:00', value: 4, participants: 8 },
70
+ { time: '07:00', value: 5, participants: 10 },
71
+ { time: '08:00', value: 6, participants: 12 },
72
+ { time: '09:00', value: 8, participants: 16 },
73
+ { time: '10:00', value: 6, participants: 12 },
74
+ { time: '11:00', value: 7, participants: 14 },
75
+ { time: '12:00', value: 8, participants: 16 },
76
+ { time: '13:00', value: 9, participants: 18 },
77
+ { time: '14:00', value: 6, participants: 12 },
78
+ { time: '15:00', value: 5, participants: 10 },
79
+ ];
80
+
81
+ const mockRevenueData = [
82
+ { time: '00:00', value: 25.50 },
83
+ { time: '01:00', value: 15.75 },
84
+ { time: '02:00', value: 0 },
85
+ { time: '03:00', value: 18.25 },
86
+ { time: '04:00', value: 35.00 },
87
+ { time: '05:00', value: 42.50 },
88
+ { time: '06:00', value: 58.75 },
89
+ { time: '07:00', value: 75.25 },
90
+ { time: '08:00', value: 92.50 },
91
+ { time: '09:00', value: 125.75 },
92
+ { time: '10:00', value: 95.50 },
93
+ { time: '11:00', value: 110.25 },
94
+ { time: '12:00', value: 128.00 },
95
+ { time: '13:00', value: 145.75 },
96
+ { time: '14:00', value: 98.50 },
97
+ { time: '15:00', value: 85.25 },
98
+ ];
99
+
100
+ export const Interactive = () => {
101
+ const [timeFilter, setTimeFilter] = useState<TimeFilter>('Today');
102
+ const [dataset, setDataset] = useState<DatasetType>('Bookings For');
103
+
104
+ const getDataForFilter = (filter: TimeFilter) => {
105
+ switch (filter) {
106
+ case 'Today':
107
+ return {
108
+ metrics: mockMetrics,
109
+ bookingsChart: {
110
+ title: 'Bookings',
111
+ subtitle: 'Today',
112
+ data: mockBookingsData,
113
+ isRevenue: false,
114
+ },
115
+ revenueChart: {
116
+ title: 'Revenue',
117
+ subtitle: 'Today',
118
+ data: mockRevenueData,
119
+ isRevenue: true,
120
+ },
121
+ };
122
+ case 'Yesterday':
123
+ return {
124
+ metrics: {
125
+ totalBookings: { value: '18', change: '-6 vs day before', is_positive: false },
126
+ revenue: { value: '£980.25', change: '-£260 vs day before', is_positive: false },
127
+ numberOfPeople: { value: '72', change: '-17 vs day before', is_positive: false },
128
+ busiestTime: { value: '13:00 - 14:00', peopleText: '15 people', bookingText: '5 bookings' },
129
+ peopleInVenue: { value: '25', formatted_value: '25', description: 'people currently in venue' },
130
+ workHours: { company_name: 'Sharksys Soft Play', is_open: true, status: 'Open', message: 'Open until 18:00', opens_at: '09:00' }
131
+ },
132
+ bookingsChart: {
133
+ title: 'Bookings',
134
+ subtitle: 'Yesterday',
135
+ data: mockBookingsData.map(d => ({ ...d, value: d.value - 1 })),
136
+ isRevenue: false,
137
+ },
138
+ revenueChart: {
139
+ title: 'Revenue',
140
+ subtitle: 'Yesterday',
141
+ data: mockRevenueData.map(d => ({ ...d, value: d.value * 0.8 })),
142
+ isRevenue: true,
143
+ },
144
+ };
145
+ case 'This Week':
146
+ return {
147
+ metrics: {
148
+ totalBookings: { value: '156', change: '+42 vs last week', is_positive: true },
149
+ revenue: { value: '£8,540.25', change: '+£2,100 vs last week', is_positive: true },
150
+ numberOfPeople: { value: '612', change: '+89 vs last week', is_positive: true },
151
+ busiestTime: { value: 'Saturday', peopleText: '125 people', bookingText: '32 bookings' },
152
+ peopleInVenue: { value: '45', formatted_value: '45', description: 'people currently in venue' },
153
+ workHours: { company_name: 'Sharksys Soft Play', is_open: true, status: 'Open', message: 'Open until 18:00', opens_at: '09:00' }
154
+ },
155
+ bookingsChart: {
156
+ title: 'Bookings',
157
+ subtitle: 'Mon 1st - Sun 7th Nov',
158
+ data: [
159
+ { time: 'Mon', value: 18, participants: 36 },
160
+ { time: 'Tue', value: 22, participants: 44 },
161
+ { time: 'Wed', value: 20, participants: 40 },
162
+ { time: 'Thu', value: 25, participants: 50 },
163
+ { time: 'Fri', value: 28, participants: 56 },
164
+ { time: 'Sat', value: 32, participants: 64 },
165
+ { time: 'Sun', value: 11, participants: 22 },
166
+ ],
167
+ isRevenue: false,
168
+ },
169
+ revenueChart: {
170
+ title: 'Revenue',
171
+ subtitle: 'Mon 1st - Sun 7th Nov',
172
+ data: [
173
+ { time: 'Mon', value: 1200 },
174
+ { time: 'Tue', value: 1450 },
175
+ { time: 'Wed', value: 1320 },
176
+ { time: 'Thu', value: 1650 },
177
+ { time: 'Fri', value: 1850 },
178
+ { time: 'Sat', value: 2100 },
179
+ { time: 'Sun', value: 750 },
180
+ ],
181
+ isRevenue: true,
182
+ },
183
+ };
184
+ default:
185
+ return getDataForFilter('Today');
186
+ }
187
+ };
188
+
189
+ const currentData = getDataForFilter(timeFilter);
190
+
191
+ return (
192
+ <Dashboard
193
+ timeFilter={timeFilter}
194
+ metrics={currentData.metrics}
195
+ bookingsChart={currentData.bookingsChart}
196
+ revenueChart={currentData.revenueChart}
197
+ onFilterChange={setTimeFilter}
198
+ />
199
+ );
200
+ };
201
+
202
+ export const Today = () => {
203
+ return (
204
+ <Dashboard
205
+ timeFilter="Today"
206
+ metrics={mockMetrics}
207
+ bookingsChart={{
208
+ title: 'Bookings',
209
+ subtitle: 'Today',
210
+ data: mockBookingsData,
211
+ isRevenue: false,
212
+ }}
213
+ revenueChart={{
214
+ title: 'Revenue',
215
+ subtitle: 'Today',
216
+ data: mockRevenueData,
217
+ isRevenue: true,
218
+ }}
219
+ />
220
+ );
221
+ };
222
+
223
+ export const ThisWeek = () => {
224
+ return (
225
+ <Dashboard
226
+ timeFilter="This Week"
227
+ metrics={{
228
+ totalBookings: { value: '156', change: '+42 vs last week', is_positive: true },
229
+ revenue: { value: '£8,540.25', change: '+£2,100 vs last week', is_positive: true },
230
+ numberOfPeople: { value: '612', change: '+89 vs last week', is_positive: true },
231
+ busiestTime: { value: 'Saturday', peopleText: '125 people', bookingText: '32 bookings' },
232
+ peopleInVenue: { value: '45', formatted_value: '45', description: 'people currently in venue' },
233
+ workHours: { company_name: 'Sharksys Soft Play', is_open: true, status: 'Open', message: 'Open until 18:00', opens_at: '09:00' }
234
+ }}
235
+ bookingsChart={{
236
+ title: 'Bookings',
237
+ subtitle: 'Mon 1st - Sun 7th Nov',
238
+ data: [
239
+ { time: 'Mon', value: 18, participants: 36 },
240
+ { time: 'Tue', value: 22, participants: 44 },
241
+ { time: 'Wed', value: 20, participants: 40 },
242
+ { time: 'Thu', value: 25, participants: 50 },
243
+ { time: 'Fri', value: 28, participants: 56 },
244
+ { time: 'Sat', value: 32, participants: 64 },
245
+ { time: 'Sun', value: 11, participants: 22 },
246
+ ],
247
+ isRevenue: false,
248
+ }}
249
+ revenueChart={{
250
+ title: 'Revenue',
251
+ subtitle: 'Mon 1st - Sun 7th Nov',
252
+ data: [
253
+ { time: 'Mon', value: 1200 },
254
+ { time: 'Tue', value: 1450 },
255
+ { time: 'Wed', value: 1320 },
256
+ { time: 'Thu', value: 1650 },
257
+ { time: 'Fri', value: 1850 },
258
+ { time: 'Sat', value: 2100 },
259
+ { time: 'Sun', value: 750 },
260
+ ],
261
+ isRevenue: true,
262
+ }}
263
+ />
264
+ );
265
+ };
266
+
267
+ export const WithNPSScore = () => {
268
+ const [timeFilter, setTimeFilter] = useState<TimeFilter>('Today');
269
+
270
+ return (
271
+ <div style={{ padding: '24px' }}>
272
+ <NPSScore
273
+ firstName="Godwin"
274
+ onSubmit={(data) => {
275
+ console.log('NPS Submitted:', data);
276
+ return Promise.resolve();
277
+ }}
278
+ />
279
+ <Dashboard
280
+ timeFilter={timeFilter}
281
+ metrics={mockMetrics}
282
+ bookingsChart={{
283
+ title: 'Bookings',
284
+ subtitle: 'Today',
285
+ data: mockBookingsData,
286
+ isRevenue: false,
287
+ }}
288
+ revenueChart={{
289
+ title: 'Revenue',
290
+ subtitle: 'Today',
291
+ data: mockRevenueData,
292
+ isRevenue: true,
293
+ }}
294
+ onFilterChange={setTimeFilter}
295
+ />
296
+ </div>
297
+ );
298
+ };