@licklist/design 0.78.21 → 0.78.25
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.
- package/dist/assets/Trend-Down.svg +3 -0
- package/dist/assets/Trend-Up.svg +3 -0
- package/dist/auth/Authorizer.d.ts.map +1 -1
- package/dist/auth/Authorizer.js +47 -12
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/v2/components/EntityHeader/EntityHeader.d.ts +13 -0
- package/dist/v2/components/EntityHeader/EntityHeader.d.ts.map +1 -0
- package/dist/v2/components/EntityHeader/EntityHeader.js +85 -0
- package/dist/v2/components/EntityHeader/EntityHeader.scss.js +6 -0
- package/dist/v2/components/EntityHeader/index.d.ts +2 -0
- package/dist/v2/components/EntityHeader/index.d.ts.map +1 -0
- package/dist/v2/components/NPSScore/NPSScore.d.ts +18 -0
- package/dist/v2/components/NPSScore/NPSScore.d.ts.map +1 -0
- package/dist/v2/components/NPSScore/index.d.ts +3 -0
- package/dist/v2/components/NPSScore/index.d.ts.map +1 -0
- package/dist/v2/components/Select/Select.d.ts +10 -0
- package/dist/v2/components/Select/Select.d.ts.map +1 -0
- package/dist/v2/components/Select/index.d.ts +3 -0
- package/dist/v2/components/Select/index.d.ts.map +1 -0
- package/dist/v2/components/Tooltip/Tooltip.d.ts +21 -0
- package/dist/v2/components/Tooltip/Tooltip.d.ts.map +1 -0
- package/dist/v2/components/Tooltip/Tooltip.js +103 -0
- package/dist/v2/components/Tooltip/Tooltip.scss.js +6 -0
- package/dist/v2/components/Tooltip/index.d.ts +2 -0
- package/dist/v2/components/Tooltip/index.d.ts.map +1 -0
- package/dist/v2/components/UserAvatar/UserAvatar.d.ts +12 -0
- package/dist/v2/components/UserAvatar/UserAvatar.d.ts.map +1 -0
- package/dist/v2/components/UserAvatar/UserAvatar.js +77 -0
- package/dist/v2/components/UserAvatar/UserAvatar.scss.js +6 -0
- package/dist/v2/components/UserAvatar/index.d.ts +2 -0
- package/dist/v2/components/UserAvatar/index.d.ts.map +1 -0
- package/dist/v2/components/UserPanel/UserPanel.d.ts +17 -0
- package/dist/v2/components/UserPanel/UserPanel.d.ts.map +1 -0
- package/dist/v2/components/UserPanel/UserPanel.js +168 -0
- package/dist/v2/components/UserPanel/UserPanel.scss.js +6 -0
- package/dist/v2/components/UserPanel/index.d.ts +3 -0
- package/dist/v2/components/UserPanel/index.d.ts.map +1 -0
- package/dist/v2/dashboard-analytics/blog-posts/Blog.d.ts +15 -0
- package/dist/v2/dashboard-analytics/blog-posts/Blog.d.ts.map +1 -0
- package/dist/v2/dashboard-analytics/blog-posts/index.d.ts +3 -0
- package/dist/v2/dashboard-analytics/blog-posts/index.d.ts.map +1 -0
- package/dist/v2/dashboard-analytics/chart/Chart.d.ts +21 -0
- package/dist/v2/dashboard-analytics/chart/Chart.d.ts.map +1 -0
- package/dist/v2/dashboard-analytics/chart/index.d.ts +3 -0
- package/dist/v2/dashboard-analytics/chart/index.d.ts.map +1 -0
- package/dist/v2/dashboard-analytics/dashboard/Dashboard.d.ts +57 -0
- package/dist/v2/dashboard-analytics/dashboard/Dashboard.d.ts.map +1 -0
- package/dist/v2/dashboard-analytics/dashboard/index.d.ts +3 -0
- package/dist/v2/dashboard-analytics/dashboard/index.d.ts.map +1 -0
- package/dist/v2/dashboard-analytics/index.d.ts +13 -0
- package/dist/v2/dashboard-analytics/index.d.ts.map +1 -0
- package/dist/v2/dashboard-analytics/metric-card/MetricCard.d.ts +17 -0
- package/dist/v2/dashboard-analytics/metric-card/MetricCard.d.ts.map +1 -0
- package/dist/v2/dashboard-analytics/metric-card/index.d.ts +3 -0
- package/dist/v2/dashboard-analytics/metric-card/index.d.ts.map +1 -0
- package/dist/v2/dashboard-analytics/venue-card/VenueCard.d.ts +12 -0
- package/dist/v2/dashboard-analytics/venue-card/VenueCard.d.ts.map +1 -0
- package/dist/v2/dashboard-analytics/venue-card/index.d.ts +3 -0
- package/dist/v2/dashboard-analytics/venue-card/index.d.ts.map +1 -0
- package/dist/v2/dashboard-analytics/venue-closed-card/VenueClosedCard.d.ts +25 -0
- package/dist/v2/dashboard-analytics/venue-closed-card/VenueClosedCard.d.ts.map +1 -0
- package/dist/v2/dashboard-analytics/venue-closed-card/index.d.ts +3 -0
- package/dist/v2/dashboard-analytics/venue-closed-card/index.d.ts.map +1 -0
- package/dist/v2/index.d.ts +11 -5
- package/dist/v2/index.d.ts.map +1 -1
- package/dist/v2/navigation/DashboardLayout/AdminSidebar.d.ts +10 -0
- package/dist/v2/navigation/DashboardLayout/AdminSidebar.d.ts.map +1 -0
- package/dist/v2/navigation/DashboardLayout/AdminSidebar.js +296 -0
- package/dist/v2/navigation/DashboardLayout/AdminSidebar.scss.js +6 -0
- package/dist/v2/navigation/DashboardLayout/DashboardFooter.d.ts +7 -0
- package/dist/v2/navigation/DashboardLayout/DashboardFooter.d.ts.map +1 -0
- package/dist/v2/navigation/DashboardLayout/DashboardFooter.js +34 -0
- package/dist/v2/navigation/DashboardLayout/DashboardFooter.scss.js +6 -0
- package/dist/v2/navigation/DashboardLayout/DashboardLayout.d.ts +42 -0
- package/dist/v2/navigation/DashboardLayout/DashboardLayout.d.ts.map +1 -0
- package/dist/v2/navigation/DashboardLayout/DashboardLayout.js +154 -0
- package/dist/v2/navigation/DashboardLayout/DashboardLayout.scss.js +6 -0
- package/dist/v2/navigation/DashboardLayout/ProviderSidebar.d.ts +35 -0
- package/dist/v2/navigation/DashboardLayout/ProviderSidebar.d.ts.map +1 -0
- package/dist/v2/navigation/DashboardLayout/ProviderSidebar.js +344 -0
- package/dist/v2/navigation/DashboardLayout/ProviderSidebar.scss.js +6 -0
- package/dist/v2/navigation/DashboardLayout/TopNavigation.d.ts +26 -0
- package/dist/v2/navigation/DashboardLayout/TopNavigation.d.ts.map +1 -0
- package/dist/v2/navigation/DashboardLayout/TopNavigation.js +468 -0
- package/dist/v2/navigation/DashboardLayout/TopNavigation.scss.js +6 -0
- package/dist/v2/navigation/DashboardLayout/assets/AdminLogo.png.js +3 -0
- package/dist/v2/navigation/DashboardLayout/assets/BookedLogo_Mark.png.js +3 -0
- package/dist/v2/navigation/DashboardLayout/index.d.ts +7 -0
- package/dist/v2/navigation/DashboardLayout/index.d.ts.map +1 -0
- package/package.json +5 -3
- package/src/assets/Trend-Down.svg +3 -0
- package/src/assets/Trend-Up.svg +3 -0
- package/src/auth/Authorizer.tsx +49 -20
- package/src/index.ts +2 -1
- package/src/v2/components/EntityHeader/EntityHeader.scss +133 -0
- package/src/v2/components/EntityHeader/EntityHeader.stories.tsx +103 -0
- package/src/v2/components/EntityHeader/EntityHeader.tsx +76 -0
- package/src/v2/components/EntityHeader/index.ts +1 -0
- package/src/v2/components/NPSScore/NPSScore.scss +330 -0
- package/src/v2/components/NPSScore/NPSScore.stories.tsx +29 -0
- package/src/v2/components/NPSScore/NPSScore.tsx +209 -0
- package/src/v2/components/NPSScore/index.ts +2 -0
- package/src/v2/components/Select/Select.scss +188 -0
- package/src/v2/components/Select/Select.stories.tsx +164 -0
- package/src/v2/components/Select/Select.tsx +56 -0
- package/src/v2/components/Select/index.ts +2 -0
- package/src/v2/components/Tooltip/Tooltip.scss +92 -0
- package/src/v2/components/Tooltip/Tooltip.stories.tsx +164 -0
- package/src/v2/components/Tooltip/Tooltip.tsx +64 -0
- package/src/v2/components/Tooltip/index.ts +8 -0
- package/src/v2/components/UserAvatar/UserAvatar.scss +62 -0
- package/src/v2/components/UserAvatar/UserAvatar.stories.tsx +94 -0
- package/src/v2/components/UserAvatar/UserAvatar.tsx +96 -0
- package/src/v2/components/UserAvatar/index.ts +1 -0
- package/src/v2/components/UserPanel/UserPanel.scss +195 -0
- package/src/v2/components/UserPanel/UserPanel.stories.tsx +66 -0
- package/src/v2/components/UserPanel/UserPanel.tsx +132 -0
- package/src/v2/components/UserPanel/index.ts +2 -0
- package/src/v2/dashboard-analytics/blog-posts/Blog.scss +92 -0
- package/src/v2/dashboard-analytics/blog-posts/Blog.stories.tsx +57 -0
- package/src/v2/dashboard-analytics/blog-posts/Blog.tsx +91 -0
- package/src/v2/dashboard-analytics/blog-posts/index.ts +2 -0
- package/src/v2/dashboard-analytics/chart/Chart.scss +424 -0
- package/src/v2/dashboard-analytics/chart/Chart.stories.tsx +157 -0
- package/src/v2/dashboard-analytics/chart/Chart.tsx +623 -0
- package/src/v2/dashboard-analytics/chart/index.ts +2 -0
- package/src/v2/dashboard-analytics/dashboard/Dashboard.scss +254 -0
- package/src/v2/dashboard-analytics/dashboard/Dashboard.stories.tsx +298 -0
- package/src/v2/dashboard-analytics/dashboard/Dashboard.tsx +248 -0
- package/src/v2/dashboard-analytics/dashboard/index.ts +2 -0
- package/src/v2/dashboard-analytics/index.ts +12 -0
- package/src/v2/dashboard-analytics/metric-card/MetricCard.scss +125 -0
- package/src/v2/dashboard-analytics/metric-card/MetricCard.stories.tsx +106 -0
- package/src/v2/dashboard-analytics/metric-card/MetricCard.tsx +72 -0
- package/src/v2/dashboard-analytics/metric-card/index.ts +2 -0
- package/src/v2/dashboard-analytics/venue-card/VenueCard.scss +112 -0
- package/src/v2/dashboard-analytics/venue-card/VenueCard.stories.tsx +40 -0
- package/src/v2/dashboard-analytics/venue-card/VenueCard.tsx +62 -0
- package/src/v2/dashboard-analytics/venue-card/index.ts +2 -0
- package/src/v2/dashboard-analytics/venue-closed-card/VenueClosedCard.scss +129 -0
- package/src/v2/dashboard-analytics/venue-closed-card/VenueClosedCard.stories.tsx +31 -0
- package/src/v2/dashboard-analytics/venue-closed-card/VenueClosedCard.tsx +61 -0
- package/src/v2/dashboard-analytics/venue-closed-card/index.ts +2 -0
- package/src/v2/design-system/colors/ColorSystem.scss +439 -0
- package/src/v2/design-system/colors/ColorSystem.stories.tsx +730 -0
- package/src/v2/design-system/typography/Typography.scss +295 -0
- package/src/v2/design-system/typography/Typography.stories.tsx +109 -0
- package/src/v2/index.ts +43 -7
- package/src/v2/navigation/DashboardLayout/AdminSidebar.scss +207 -0
- package/src/v2/navigation/DashboardLayout/AdminSidebar.tsx +171 -0
- package/src/v2/navigation/DashboardLayout/DashboardFooter.scss +30 -0
- package/src/v2/navigation/DashboardLayout/DashboardFooter.tsx +25 -0
- package/src/v2/navigation/DashboardLayout/DashboardLayout.scss +91 -0
- package/src/v2/navigation/DashboardLayout/DashboardLayout.stories.tsx +370 -0
- package/src/v2/navigation/DashboardLayout/DashboardLayout.tsx +215 -0
- package/src/v2/navigation/DashboardLayout/ProviderSidebar.scss +266 -0
- package/src/v2/navigation/DashboardLayout/ProviderSidebar.tsx +252 -0
- package/src/v2/navigation/DashboardLayout/Sidebar.stories.tsx +220 -0
- package/src/v2/navigation/DashboardLayout/TopNavigation.scss +206 -0
- package/src/v2/navigation/DashboardLayout/TopNavigation.tsx +270 -0
- package/src/v2/navigation/DashboardLayout/assets/AdminLogo.png +0 -0
- package/src/v2/navigation/DashboardLayout/assets/BookedLogo_Mark.png +0 -0
- package/src/v2/navigation/DashboardLayout/index.ts +20 -0
- package/src/v2/styles/index.scss +0 -1
- package/src/v2/styles/tokens/_colors.scss +531 -98
- package/dist/v2/components/Colors/Colors.d.ts +0 -21
- package/dist/v2/components/Colors/Colors.d.ts.map +0 -1
- package/dist/v2/components/Colors/index.d.ts +0 -3
- package/dist/v2/components/Colors/index.d.ts.map +0 -1
- package/dist/v2/components/Typography/Typography.d.ts +0 -11
- package/dist/v2/components/Typography/Typography.d.ts.map +0 -1
- package/dist/v2/components/Typography/index.d.ts +0 -3
- package/dist/v2/components/Typography/index.d.ts.map +0 -1
- package/src/v2/components/Colors/Colors.scss +0 -64
- package/src/v2/components/Colors/Colors.stories.tsx +0 -143
- package/src/v2/components/Colors/Colors.tsx +0 -51
- package/src/v2/components/Colors/ColorsAliases.stories.tsx +0 -285
- package/src/v2/components/Colors/Sizes.stories.tsx +0 -141
- package/src/v2/components/Colors/index.ts +0 -2
- package/src/v2/components/Typography/Typography.scss +0 -72
- package/src/v2/components/Typography/Typography.stories.tsx +0 -266
- package/src/v2/components/Typography/Typography.tsx +0 -56
- package/src/v2/components/Typography/index.ts +0 -2
- package/src/v2/styles/tokens/_aliases.scss +0 -199
|
@@ -0,0 +1,370 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react'
|
|
2
|
+
import React, { useState } from 'react'
|
|
3
|
+
import { DashboardLayout, DestinationType } from './DashboardLayout'
|
|
4
|
+
import { Dashboard } from '../../dashboard-analytics/dashboard/Dashboard'
|
|
5
|
+
import { UserPanel } from '../../components/UserPanel'
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
title: 'v2/Dashboard Layout/Combined Layout',
|
|
9
|
+
component: DashboardLayout,
|
|
10
|
+
argTypes: {
|
|
11
|
+
destination: {
|
|
12
|
+
control: 'select',
|
|
13
|
+
options: ['admin', 'provider', 'company'],
|
|
14
|
+
description: 'The type of dashboard destination',
|
|
15
|
+
},
|
|
16
|
+
sidebarExpanded: {
|
|
17
|
+
control: 'boolean',
|
|
18
|
+
description: 'Whether the sidebar is expanded',
|
|
19
|
+
},
|
|
20
|
+
providerName: {
|
|
21
|
+
control: 'text',
|
|
22
|
+
description: 'Name of the venue/provider',
|
|
23
|
+
},
|
|
24
|
+
providerId: {
|
|
25
|
+
control: 'text',
|
|
26
|
+
description: 'ID of the venue/provider',
|
|
27
|
+
},
|
|
28
|
+
userInitials: {
|
|
29
|
+
control: 'text',
|
|
30
|
+
description: 'User initials to display in top hat',
|
|
31
|
+
},
|
|
32
|
+
inboxCount: {
|
|
33
|
+
control: 'number',
|
|
34
|
+
description: 'Number of inbox notifications',
|
|
35
|
+
},
|
|
36
|
+
bellCount: {
|
|
37
|
+
control: 'number',
|
|
38
|
+
description: 'Number of bell notifications',
|
|
39
|
+
},
|
|
40
|
+
hasAdminAccess: {
|
|
41
|
+
control: 'boolean',
|
|
42
|
+
description: 'Whether user has admin access',
|
|
43
|
+
},
|
|
44
|
+
isMobile: {
|
|
45
|
+
control: 'boolean',
|
|
46
|
+
description: 'Mobile view mode',
|
|
47
|
+
},
|
|
48
|
+
onSidebarToggle: { action: 'sidebar toggled' },
|
|
49
|
+
onNavigation: { action: 'navigation clicked' },
|
|
50
|
+
onUserClick: { action: 'user clicked' },
|
|
51
|
+
onInboxClick: { action: 'inbox clicked' },
|
|
52
|
+
onBellClick: { action: 'bell clicked' },
|
|
53
|
+
},
|
|
54
|
+
parameters: {
|
|
55
|
+
layout: 'fullscreen',
|
|
56
|
+
},
|
|
57
|
+
} as Meta<typeof DashboardLayout>
|
|
58
|
+
|
|
59
|
+
type Story = StoryObj<typeof DashboardLayout>
|
|
60
|
+
|
|
61
|
+
const SampleContent: React.FC<{ title: string; description?: string }> = ({ title, description }) => (
|
|
62
|
+
<div style={{ padding: '24px' }}>
|
|
63
|
+
<h1 style={{
|
|
64
|
+
fontFamily: 'var(--font-family-sans)',
|
|
65
|
+
fontSize: '24px',
|
|
66
|
+
fontWeight: 600,
|
|
67
|
+
color: 'var(--labels-main-label-primary)',
|
|
68
|
+
marginBottom: '16px'
|
|
69
|
+
}}>
|
|
70
|
+
{title}
|
|
71
|
+
</h1>
|
|
72
|
+
{description && (
|
|
73
|
+
<p style={{
|
|
74
|
+
fontFamily: 'var(--font-family-sans)',
|
|
75
|
+
fontSize: '14px',
|
|
76
|
+
color: 'var(--labels-main-label-secondary)',
|
|
77
|
+
marginBottom: '24px'
|
|
78
|
+
}}>
|
|
79
|
+
{description}
|
|
80
|
+
</p>
|
|
81
|
+
)}
|
|
82
|
+
<div style={{
|
|
83
|
+
display: 'grid',
|
|
84
|
+
gridTemplateColumns: 'repeat(auto-fit, minmax(280px, 1fr))',
|
|
85
|
+
gap: '16px',
|
|
86
|
+
}}>
|
|
87
|
+
{[1, 2, 3, 4].map((i) => (
|
|
88
|
+
<div
|
|
89
|
+
key={i}
|
|
90
|
+
style={{
|
|
91
|
+
background: 'var(--surfaces-main-background-secondary)',
|
|
92
|
+
borderRadius: '12px',
|
|
93
|
+
padding: '20px',
|
|
94
|
+
border: '1px solid var(--borders-main-border-primary)',
|
|
95
|
+
}}
|
|
96
|
+
>
|
|
97
|
+
<div style={{
|
|
98
|
+
fontFamily: 'var(--font-family-sans)',
|
|
99
|
+
fontSize: '14px',
|
|
100
|
+
fontWeight: 500,
|
|
101
|
+
color: 'var(--labels-main-label-secondary)',
|
|
102
|
+
marginBottom: '8px'
|
|
103
|
+
}}>
|
|
104
|
+
Card {i}
|
|
105
|
+
</div>
|
|
106
|
+
<div style={{
|
|
107
|
+
fontFamily: 'var(--font-family-sans)',
|
|
108
|
+
fontSize: '28px',
|
|
109
|
+
fontWeight: 600,
|
|
110
|
+
color: 'var(--labels-main-label-primary)'
|
|
111
|
+
}}>
|
|
112
|
+
{Math.floor(Math.random() * 1000)}
|
|
113
|
+
</div>
|
|
114
|
+
</div>
|
|
115
|
+
))}
|
|
116
|
+
</div>
|
|
117
|
+
</div>
|
|
118
|
+
)
|
|
119
|
+
|
|
120
|
+
export const Default: Story = {
|
|
121
|
+
args: {
|
|
122
|
+
destination: 'provider',
|
|
123
|
+
sidebarExpanded: true,
|
|
124
|
+
providerName: "Sharky's Soft Play",
|
|
125
|
+
providerId: "123",
|
|
126
|
+
userInitials: 'GA',
|
|
127
|
+
inboxCount: 3,
|
|
128
|
+
bellCount: 12,
|
|
129
|
+
activePath: '/home',
|
|
130
|
+
hasAdminAccess: false,
|
|
131
|
+
},
|
|
132
|
+
render: (args) => (
|
|
133
|
+
<DashboardLayout {...args}>
|
|
134
|
+
<SampleContent
|
|
135
|
+
title="Provider Dashboard"
|
|
136
|
+
description="Combined layout with top navigation and sidebar working together."
|
|
137
|
+
/>
|
|
138
|
+
</DashboardLayout>
|
|
139
|
+
),
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export const Interactive: Story = {
|
|
143
|
+
render: function InteractiveStory(args) {
|
|
144
|
+
const [destination, setDestination] = useState<DestinationType>('admin')
|
|
145
|
+
const [expanded, setExpanded] = useState(false)
|
|
146
|
+
const [currentPath, setCurrentPath] = useState('/home')
|
|
147
|
+
const [inboxCount, setInboxCount] = useState(0)
|
|
148
|
+
const [bellCount, setBellCount] = useState(12)
|
|
149
|
+
const [userPanelOpen, setUserPanelOpen] = useState(false)
|
|
150
|
+
|
|
151
|
+
const destinations: { type: DestinationType; label: string }[] = [
|
|
152
|
+
{ type: 'admin', label: 'Admin' },
|
|
153
|
+
{ type: 'company', label: 'Company' },
|
|
154
|
+
{ type: 'provider', label: 'Provider' },
|
|
155
|
+
]
|
|
156
|
+
|
|
157
|
+
return (
|
|
158
|
+
<>
|
|
159
|
+
<DashboardLayout
|
|
160
|
+
{...args}
|
|
161
|
+
destination={destination}
|
|
162
|
+
sidebarExpanded={expanded}
|
|
163
|
+
onSidebarToggle={() => setExpanded(!expanded)}
|
|
164
|
+
activePath={currentPath}
|
|
165
|
+
onNavigation={(path) => {
|
|
166
|
+
setCurrentPath(path)
|
|
167
|
+
if (path === '/admin') {
|
|
168
|
+
setDestination('admin')
|
|
169
|
+
}
|
|
170
|
+
}}
|
|
171
|
+
inboxCount={inboxCount}
|
|
172
|
+
bellCount={bellCount}
|
|
173
|
+
onInboxClick={() => setInboxCount(0)}
|
|
174
|
+
onBellClick={() => setBellCount(0)}
|
|
175
|
+
onUserClick={() => setUserPanelOpen(true)}
|
|
176
|
+
userPanelOpen={userPanelOpen}
|
|
177
|
+
hasAdminAccess={true}
|
|
178
|
+
>
|
|
179
|
+
<div style={{ padding: '24px' }}>
|
|
180
|
+
<h1 style={{
|
|
181
|
+
fontFamily: 'var(--font-family-sans)',
|
|
182
|
+
fontSize: '24px',
|
|
183
|
+
fontWeight: 600,
|
|
184
|
+
color: 'var(--labels-main-label-primary)',
|
|
185
|
+
marginBottom: '16px'
|
|
186
|
+
}}>
|
|
187
|
+
Interactive Combined Layout
|
|
188
|
+
</h1>
|
|
189
|
+
|
|
190
|
+
<div style={{ display: 'flex', gap: '8px', marginBottom: '16px', flexWrap: 'wrap' }}>
|
|
191
|
+
{destinations.map(dest => (
|
|
192
|
+
<button
|
|
193
|
+
key={dest.type}
|
|
194
|
+
onClick={() => setDestination(dest.type)}
|
|
195
|
+
style={{
|
|
196
|
+
padding: '8px 16px',
|
|
197
|
+
backgroundColor: destination === dest.type ? 'var(--fills-main-fill-primary)' : 'var(--surfaces-main-background-secondary)',
|
|
198
|
+
color: destination === dest.type ? 'white' : 'var(--labels-main-label-primary)',
|
|
199
|
+
border: '1px solid var(--borders-main-border-primary)',
|
|
200
|
+
borderRadius: '6px',
|
|
201
|
+
cursor: 'pointer',
|
|
202
|
+
fontFamily: 'var(--font-family-sans)',
|
|
203
|
+
fontSize: '13px',
|
|
204
|
+
}}
|
|
205
|
+
>
|
|
206
|
+
{dest.label}
|
|
207
|
+
</button>
|
|
208
|
+
))}
|
|
209
|
+
<button
|
|
210
|
+
onClick={() => setExpanded(!expanded)}
|
|
211
|
+
style={{
|
|
212
|
+
padding: '8px 16px',
|
|
213
|
+
backgroundColor: 'var(--surfaces-main-surface-tertiary)',
|
|
214
|
+
color: 'var(--labels-main-label-primary)',
|
|
215
|
+
border: '1px solid var(--borders-main-border-primary)',
|
|
216
|
+
borderRadius: '6px',
|
|
217
|
+
cursor: 'pointer',
|
|
218
|
+
fontFamily: 'var(--font-family-sans)',
|
|
219
|
+
fontSize: '13px',
|
|
220
|
+
}}
|
|
221
|
+
>
|
|
222
|
+
{expanded ? 'Collapse' : 'Expand'} Sidebar
|
|
223
|
+
</button>
|
|
224
|
+
</div>
|
|
225
|
+
|
|
226
|
+
<p style={{ fontFamily: 'var(--font-family-sans)', fontSize: '13px', color: 'var(--labels-main-label-secondary)' }}>
|
|
227
|
+
Destination: <strong>{destination}</strong> |
|
|
228
|
+
Sidebar: <strong>{expanded ? 'Expanded' : 'Collapsed'}</strong> |
|
|
229
|
+
Inbox: <strong>{inboxCount}</strong> |
|
|
230
|
+
Notifications: <strong>{bellCount}</strong>
|
|
231
|
+
</p>
|
|
232
|
+
</div>
|
|
233
|
+
</DashboardLayout>
|
|
234
|
+
|
|
235
|
+
<UserPanel
|
|
236
|
+
isOpen={userPanelOpen}
|
|
237
|
+
onClose={() => setUserPanelOpen(false)}
|
|
238
|
+
userName="Godwin Adebimpe"
|
|
239
|
+
firstName="Godwin"
|
|
240
|
+
email="godwin.adebimpe@booked.it"
|
|
241
|
+
initials="GA"
|
|
242
|
+
userNumber={15}
|
|
243
|
+
userRole="Super Admin"
|
|
244
|
+
onProfileClick={() => {
|
|
245
|
+
console.log('Profile clicked')
|
|
246
|
+
setUserPanelOpen(false)
|
|
247
|
+
}}
|
|
248
|
+
onLogoutClick={() => {
|
|
249
|
+
console.log('Logout clicked')
|
|
250
|
+
setUserPanelOpen(false)
|
|
251
|
+
}}
|
|
252
|
+
/>
|
|
253
|
+
</>
|
|
254
|
+
)
|
|
255
|
+
},
|
|
256
|
+
args: {
|
|
257
|
+
providerName: "Sharky's Soft Play",
|
|
258
|
+
providerId: "123",
|
|
259
|
+
companyName: "Entertainment Ltd",
|
|
260
|
+
companyId: "C-789",
|
|
261
|
+
userInitials: 'GA',
|
|
262
|
+
},
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
const mockMetrics = {
|
|
266
|
+
totalBookings: { value: '24', change: '+8 vs yesterday', is_positive: true },
|
|
267
|
+
revenue: { value: '£1,240.50', change: '+£450 vs yesterday', is_positive: true },
|
|
268
|
+
numberOfPeople: { value: '89', change: '+12 vs yesterday', is_positive: true },
|
|
269
|
+
busiestTime: { value: '14:00 - 15:00', peopleText: '18 people', bookingText: '6 bookings' },
|
|
270
|
+
workHours: { company_name: "Sharky's Soft Play", is_open: true, status: 'Open', message: 'Open until 18:00', opens_at: '09:00' },
|
|
271
|
+
peopleInVenue: { value: '30', formatted_value: '30', description: 'people currently in venue' }
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
const mockBookingsData = [
|
|
275
|
+
{ time: '09:00', value: 8, participants: 16 },
|
|
276
|
+
{ time: '10:00', value: 6, participants: 12 },
|
|
277
|
+
{ time: '11:00', value: 7, participants: 14 },
|
|
278
|
+
{ time: '12:00', value: 8, participants: 16 },
|
|
279
|
+
{ time: '13:00', value: 9, participants: 18 },
|
|
280
|
+
{ time: '14:00', value: 6, participants: 12 },
|
|
281
|
+
{ time: '15:00', value: 5, participants: 10 },
|
|
282
|
+
]
|
|
283
|
+
|
|
284
|
+
const mockRevenueData = [
|
|
285
|
+
{ time: '09:00', value: 125.75 },
|
|
286
|
+
{ time: '10:00', value: 95.50 },
|
|
287
|
+
{ time: '11:00', value: 110.25 },
|
|
288
|
+
{ time: '12:00', value: 128.00 },
|
|
289
|
+
{ time: '13:00', value: 145.75 },
|
|
290
|
+
{ time: '14:00', value: 98.50 },
|
|
291
|
+
{ time: '15:00', value: 85.25 },
|
|
292
|
+
]
|
|
293
|
+
|
|
294
|
+
type TimeFilter = 'Today' | 'Yesterday' | 'This Week'
|
|
295
|
+
|
|
296
|
+
export const LayoutWithDashboard: Story = {
|
|
297
|
+
render: function LayoutWithDashboardStory() {
|
|
298
|
+
const [destination, setDestination] = useState<DestinationType>('provider')
|
|
299
|
+
const [expanded, setExpanded] = useState(true)
|
|
300
|
+
const [currentPath, setCurrentPath] = useState('/home')
|
|
301
|
+
const [timeFilter, setTimeFilter] = useState<TimeFilter>('Today')
|
|
302
|
+
const [userPanelOpen, setUserPanelOpen] = useState(false)
|
|
303
|
+
|
|
304
|
+
const handleNavigation = (path: string) => {
|
|
305
|
+
setCurrentPath(path)
|
|
306
|
+
if (path === '/admin') {
|
|
307
|
+
setDestination('admin')
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
return (
|
|
312
|
+
<>
|
|
313
|
+
<DashboardLayout
|
|
314
|
+
destination={destination}
|
|
315
|
+
sidebarExpanded={expanded}
|
|
316
|
+
onSidebarToggle={() => setExpanded(!expanded)}
|
|
317
|
+
activePath={currentPath}
|
|
318
|
+
onNavigation={handleNavigation}
|
|
319
|
+
providerName="Sharky's Soft Play"
|
|
320
|
+
providerId="123"
|
|
321
|
+
userInitials="GA"
|
|
322
|
+
userName="Godwin"
|
|
323
|
+
inboxCount={3}
|
|
324
|
+
bellCount={12}
|
|
325
|
+
hasAdminAccess={true}
|
|
326
|
+
onUserClick={() => setUserPanelOpen(true)}
|
|
327
|
+
userPanelOpen={userPanelOpen}
|
|
328
|
+
>
|
|
329
|
+
{currentPath === '/home' ? (
|
|
330
|
+
<Dashboard
|
|
331
|
+
timeFilter={timeFilter}
|
|
332
|
+
metrics={mockMetrics}
|
|
333
|
+
bookingsChart={{ title: 'Bookings', subtitle: 'Today', data: mockBookingsData, isRevenue: false }}
|
|
334
|
+
revenueChart={{ title: 'Revenue', subtitle: 'Today', data: mockRevenueData, isRevenue: true }}
|
|
335
|
+
onFilterChange={setTimeFilter}
|
|
336
|
+
/>
|
|
337
|
+
) : (
|
|
338
|
+
<div style={{ padding: '24px' }}>
|
|
339
|
+
<h1 style={{ fontFamily: 'var(--font-family-sans)', fontSize: '24px', fontWeight: 600, color: 'var(--labels-main-label-primary)', marginBottom: '16px' }}>
|
|
340
|
+
{currentPath.replace('/', '').replace(/-/g, ' ').replace(/\b\w/g, l => l.toUpperCase()) || 'Page'}
|
|
341
|
+
</h1>
|
|
342
|
+
<p style={{ fontFamily: 'var(--font-family-sans)', fontSize: '14px', color: 'var(--labels-main-label-secondary)' }}>
|
|
343
|
+
Content for {currentPath} will be displayed here.
|
|
344
|
+
</p>
|
|
345
|
+
</div>
|
|
346
|
+
)}
|
|
347
|
+
</DashboardLayout>
|
|
348
|
+
|
|
349
|
+
<UserPanel
|
|
350
|
+
isOpen={userPanelOpen}
|
|
351
|
+
onClose={() => setUserPanelOpen(false)}
|
|
352
|
+
userName="Godwin Adebimpe"
|
|
353
|
+
firstName="Godwin"
|
|
354
|
+
email="godwin.adebimpe@booked.it"
|
|
355
|
+
initials="GA"
|
|
356
|
+
userNumber={15}
|
|
357
|
+
userRole="Super Admin"
|
|
358
|
+
onProfileClick={() => {
|
|
359
|
+
console.log('Profile clicked')
|
|
360
|
+
setUserPanelOpen(false)
|
|
361
|
+
}}
|
|
362
|
+
onLogoutClick={() => {
|
|
363
|
+
console.log('Logout clicked')
|
|
364
|
+
setUserPanelOpen(false)
|
|
365
|
+
}}
|
|
366
|
+
/>
|
|
367
|
+
</>
|
|
368
|
+
)
|
|
369
|
+
},
|
|
370
|
+
}
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import React, { useState } from 'react'
|
|
2
|
+
import { TopNavigation } from './TopNavigation'
|
|
3
|
+
import { ProviderSidebar, NavItem } from './ProviderSidebar'
|
|
4
|
+
import { AdminSidebar } from './AdminSidebar'
|
|
5
|
+
import { DashboardFooter } from './DashboardFooter'
|
|
6
|
+
import './DashboardLayout.scss'
|
|
7
|
+
|
|
8
|
+
export type DestinationType = 'admin' | 'provider' | 'company'
|
|
9
|
+
|
|
10
|
+
export interface DashboardLayoutProps {
|
|
11
|
+
|
|
12
|
+
destination: DestinationType
|
|
13
|
+
|
|
14
|
+
sidebarExpanded?: boolean
|
|
15
|
+
|
|
16
|
+
onSidebarToggle?: () => void
|
|
17
|
+
|
|
18
|
+
providerName?: string
|
|
19
|
+
|
|
20
|
+
providerId?: string
|
|
21
|
+
|
|
22
|
+
providerImage?: string
|
|
23
|
+
|
|
24
|
+
providerType?: 'venue' | 'promoter'
|
|
25
|
+
|
|
26
|
+
companyName?: string
|
|
27
|
+
|
|
28
|
+
companyId?: string
|
|
29
|
+
|
|
30
|
+
companyImage?: string
|
|
31
|
+
|
|
32
|
+
userInitials?: string
|
|
33
|
+
|
|
34
|
+
userName?: string
|
|
35
|
+
|
|
36
|
+
userEmail?: string
|
|
37
|
+
|
|
38
|
+
userId?: number
|
|
39
|
+
|
|
40
|
+
userRole?: string
|
|
41
|
+
|
|
42
|
+
inboxCount?: number
|
|
43
|
+
|
|
44
|
+
bellCount?: number
|
|
45
|
+
|
|
46
|
+
activePath?: string
|
|
47
|
+
|
|
48
|
+
onNavigation?: (path: string) => void
|
|
49
|
+
|
|
50
|
+
onUserClick?: () => void
|
|
51
|
+
|
|
52
|
+
onInboxClick?: () => void
|
|
53
|
+
|
|
54
|
+
onBellClick?: () => void
|
|
55
|
+
|
|
56
|
+
onHelpClick?: () => void
|
|
57
|
+
|
|
58
|
+
onProfileClick?: () => void
|
|
59
|
+
|
|
60
|
+
onLogoutClick?: () => void
|
|
61
|
+
|
|
62
|
+
hasAdminAccess?: boolean
|
|
63
|
+
|
|
64
|
+
children?: React.ReactNode
|
|
65
|
+
|
|
66
|
+
isMobile?: boolean
|
|
67
|
+
|
|
68
|
+
version?: string
|
|
69
|
+
|
|
70
|
+
showFooter?: boolean
|
|
71
|
+
|
|
72
|
+
userPanelOpen?: boolean
|
|
73
|
+
|
|
74
|
+
/** Custom navigation items for provider sidebar */
|
|
75
|
+
navItems?: NavItem[]
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export const DashboardLayout: React.FC<DashboardLayoutProps> = ({
|
|
79
|
+
destination,
|
|
80
|
+
sidebarExpanded,
|
|
81
|
+
onSidebarToggle,
|
|
82
|
+
providerName,
|
|
83
|
+
providerId,
|
|
84
|
+
providerImage,
|
|
85
|
+
providerType = 'venue',
|
|
86
|
+
companyName,
|
|
87
|
+
companyId,
|
|
88
|
+
companyImage,
|
|
89
|
+
userInitials,
|
|
90
|
+
userName,
|
|
91
|
+
userEmail,
|
|
92
|
+
userId,
|
|
93
|
+
userRole,
|
|
94
|
+
inboxCount = 0,
|
|
95
|
+
bellCount = 0,
|
|
96
|
+
activePath = '/home',
|
|
97
|
+
onNavigation,
|
|
98
|
+
onUserClick,
|
|
99
|
+
onInboxClick,
|
|
100
|
+
onBellClick,
|
|
101
|
+
onHelpClick,
|
|
102
|
+
onProfileClick,
|
|
103
|
+
onLogoutClick,
|
|
104
|
+
hasAdminAccess = false,
|
|
105
|
+
children,
|
|
106
|
+
isMobile = false,
|
|
107
|
+
version,
|
|
108
|
+
showFooter = true,
|
|
109
|
+
userPanelOpen = false,
|
|
110
|
+
navItems,
|
|
111
|
+
}) => {
|
|
112
|
+
const [mobileMenuOpen, setMobileMenuOpen] = useState(false)
|
|
113
|
+
|
|
114
|
+
const handleSidebarToggle = () => {
|
|
115
|
+
if (isMobile) {
|
|
116
|
+
setMobileMenuOpen(!mobileMenuOpen)
|
|
117
|
+
} else {
|
|
118
|
+
onSidebarToggle?.()
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const renderSidebar = () => {
|
|
123
|
+
if (destination === 'admin') {
|
|
124
|
+
return (
|
|
125
|
+
<AdminSidebar
|
|
126
|
+
expanded={sidebarExpanded}
|
|
127
|
+
activePath={activePath}
|
|
128
|
+
onNavigation={onNavigation}
|
|
129
|
+
/>
|
|
130
|
+
)
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
return (
|
|
134
|
+
<ProviderSidebar
|
|
135
|
+
expanded={sidebarExpanded}
|
|
136
|
+
providerName={destination === 'company' ? companyName : providerName}
|
|
137
|
+
providerId={destination === 'company' ? companyId : providerId}
|
|
138
|
+
providerImage={destination === 'company' ? companyImage : providerImage}
|
|
139
|
+
providerType={providerType}
|
|
140
|
+
activePath={activePath}
|
|
141
|
+
onNavigation={onNavigation}
|
|
142
|
+
showBackToAdmin={hasAdminAccess && destination !== 'admin'}
|
|
143
|
+
onBackToAdmin={() => onNavigation?.('/admin')}
|
|
144
|
+
navItems={navItems}
|
|
145
|
+
/>
|
|
146
|
+
)
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
const sidebarWidth = sidebarExpanded ? 268 : 72
|
|
150
|
+
const topHatHeight = 48
|
|
151
|
+
|
|
152
|
+
return (
|
|
153
|
+
<div className="dashboard-layout">
|
|
154
|
+
|
|
155
|
+
<TopNavigation
|
|
156
|
+
sidebarCollapsed={!sidebarExpanded}
|
|
157
|
+
onSidebarToggle={handleSidebarToggle}
|
|
158
|
+
userInitials={userInitials}
|
|
159
|
+
userName={userName}
|
|
160
|
+
userEmail={userEmail}
|
|
161
|
+
userId={userId}
|
|
162
|
+
userRole={userRole}
|
|
163
|
+
inboxCount={inboxCount}
|
|
164
|
+
notificationCount={bellCount}
|
|
165
|
+
onUserClick={onUserClick}
|
|
166
|
+
onInboxClick={onInboxClick}
|
|
167
|
+
onNotificationClick={onBellClick}
|
|
168
|
+
onHelpClick={onHelpClick}
|
|
169
|
+
onProfileClick={onProfileClick}
|
|
170
|
+
onLogoutClick={onLogoutClick}
|
|
171
|
+
mobileMenuOpen={mobileMenuOpen}
|
|
172
|
+
onMobileMenuToggle={() => setMobileMenuOpen(!mobileMenuOpen)}
|
|
173
|
+
userPanelOpen={userPanelOpen}
|
|
174
|
+
/>
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
<div className="dashboard-layout__body">
|
|
178
|
+
|
|
179
|
+
<aside
|
|
180
|
+
className={`dashboard-layout__sidebar ${mobileMenuOpen ? 'dashboard-layout__sidebar--mobile-open' : ''}`}
|
|
181
|
+
style={{
|
|
182
|
+
width: isMobile ? (mobileMenuOpen ? '100%' : 0) : sidebarWidth,
|
|
183
|
+
top: topHatHeight
|
|
184
|
+
}}
|
|
185
|
+
>
|
|
186
|
+
{renderSidebar()}
|
|
187
|
+
</aside>
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
<main
|
|
191
|
+
className="dashboard-layout__main"
|
|
192
|
+
style={{
|
|
193
|
+
marginLeft: isMobile ? 0 : sidebarWidth,
|
|
194
|
+
marginTop: topHatHeight
|
|
195
|
+
}}
|
|
196
|
+
>
|
|
197
|
+
<div className="dashboard-layout__content">
|
|
198
|
+
{children}
|
|
199
|
+
</div>
|
|
200
|
+
{showFooter && <DashboardFooter version={version} />}
|
|
201
|
+
</main>
|
|
202
|
+
</div>
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
{isMobile && mobileMenuOpen && (
|
|
206
|
+
<div
|
|
207
|
+
className="dashboard-layout__overlay"
|
|
208
|
+
onClick={() => setMobileMenuOpen(false)}
|
|
209
|
+
/>
|
|
210
|
+
)}
|
|
211
|
+
</div>
|
|
212
|
+
)
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
export default DashboardLayout
|