@licklist/design 0.78.5-dev.35 → 0.78.5-dev.36
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/index.js +1 -1
- 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/UserPanel/UserPanel.js +168 -0
- package/dist/v2/components/UserPanel/UserPanel.scss.js +6 -0
- package/dist/v2/index.d.ts +4 -0
- package/dist/v2/index.d.ts.map +1 -1
- package/dist/v2/navigation/DashboardLayout/DashboardFooter.js +1 -1
- package/dist/v2/navigation/DashboardLayout/DashboardLayout.d.ts +8 -0
- package/dist/v2/navigation/DashboardLayout/DashboardLayout.d.ts.map +1 -1
- package/dist/v2/navigation/DashboardLayout/DashboardLayout.js +8 -2
- package/dist/v2/navigation/DashboardLayout/ProviderSidebar.d.ts +20 -0
- package/dist/v2/navigation/DashboardLayout/ProviderSidebar.d.ts.map +1 -1
- package/dist/v2/navigation/DashboardLayout/ProviderSidebar.js +66 -65
- package/dist/v2/navigation/DashboardLayout/TopNavigation.d.ts +5 -0
- package/dist/v2/navigation/DashboardLayout/TopNavigation.d.ts.map +1 -1
- package/dist/v2/navigation/DashboardLayout/TopNavigation.js +16 -1
- package/dist/v2/navigation/DashboardLayout/index.d.ts +1 -1
- package/dist/v2/navigation/DashboardLayout/index.d.ts.map +1 -1
- package/package.json +1 -1
- 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/dashboard-analytics/dashboard/Dashboard.stories.tsx +34 -0
- package/src/v2/index.ts +32 -0
- package/src/v2/navigation/DashboardLayout/DashboardFooter.tsx +1 -1
- package/src/v2/navigation/DashboardLayout/DashboardLayout.tsx +37 -12
- package/src/v2/navigation/DashboardLayout/ProviderSidebar.tsx +41 -23
- package/src/v2/navigation/DashboardLayout/TopNavigation.tsx +27 -1
- package/src/v2/navigation/DashboardLayout/index.ts +15 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useState } from 'react'
|
|
2
2
|
import { TopNavigation } from './TopNavigation'
|
|
3
|
-
import { ProviderSidebar } from './ProviderSidebar'
|
|
3
|
+
import { ProviderSidebar, NavItem } from './ProviderSidebar'
|
|
4
4
|
import { AdminSidebar } from './AdminSidebar'
|
|
5
5
|
import { DashboardFooter } from './DashboardFooter'
|
|
6
6
|
import './DashboardLayout.scss'
|
|
@@ -32,6 +32,12 @@ export interface DashboardLayoutProps {
|
|
|
32
32
|
userInitials?: string
|
|
33
33
|
|
|
34
34
|
userName?: string
|
|
35
|
+
|
|
36
|
+
userEmail?: string
|
|
37
|
+
|
|
38
|
+
userId?: number
|
|
39
|
+
|
|
40
|
+
userRole?: string
|
|
35
41
|
|
|
36
42
|
inboxCount?: number
|
|
37
43
|
|
|
@@ -48,6 +54,10 @@ export interface DashboardLayoutProps {
|
|
|
48
54
|
onBellClick?: () => void
|
|
49
55
|
|
|
50
56
|
onHelpClick?: () => void
|
|
57
|
+
|
|
58
|
+
onProfileClick?: () => void
|
|
59
|
+
|
|
60
|
+
onLogoutClick?: () => void
|
|
51
61
|
|
|
52
62
|
hasAdminAccess?: boolean
|
|
53
63
|
|
|
@@ -60,35 +70,44 @@ export interface DashboardLayoutProps {
|
|
|
60
70
|
showFooter?: boolean
|
|
61
71
|
|
|
62
72
|
userPanelOpen?: boolean
|
|
73
|
+
|
|
74
|
+
/** Custom navigation items for provider sidebar */
|
|
75
|
+
navItems?: NavItem[]
|
|
63
76
|
}
|
|
64
77
|
|
|
65
78
|
export const DashboardLayout: React.FC<DashboardLayoutProps> = ({
|
|
66
|
-
destination
|
|
67
|
-
sidebarExpanded
|
|
79
|
+
destination,
|
|
80
|
+
sidebarExpanded,
|
|
68
81
|
onSidebarToggle,
|
|
69
|
-
providerName
|
|
70
|
-
providerId
|
|
82
|
+
providerName,
|
|
83
|
+
providerId,
|
|
71
84
|
providerImage,
|
|
72
85
|
providerType = 'venue',
|
|
73
|
-
companyName
|
|
74
|
-
companyId
|
|
86
|
+
companyName,
|
|
87
|
+
companyId,
|
|
75
88
|
companyImage,
|
|
76
|
-
userInitials
|
|
77
|
-
userName
|
|
78
|
-
|
|
79
|
-
|
|
89
|
+
userInitials,
|
|
90
|
+
userName,
|
|
91
|
+
userEmail,
|
|
92
|
+
userId,
|
|
93
|
+
userRole,
|
|
94
|
+
inboxCount = 0,
|
|
95
|
+
bellCount = 0,
|
|
80
96
|
activePath = '/home',
|
|
81
97
|
onNavigation,
|
|
82
98
|
onUserClick,
|
|
83
99
|
onInboxClick,
|
|
84
100
|
onBellClick,
|
|
85
101
|
onHelpClick,
|
|
102
|
+
onProfileClick,
|
|
103
|
+
onLogoutClick,
|
|
86
104
|
hasAdminAccess = false,
|
|
87
105
|
children,
|
|
88
106
|
isMobile = false,
|
|
89
|
-
version
|
|
107
|
+
version,
|
|
90
108
|
showFooter = true,
|
|
91
109
|
userPanelOpen = false,
|
|
110
|
+
navItems,
|
|
92
111
|
}) => {
|
|
93
112
|
const [mobileMenuOpen, setMobileMenuOpen] = useState(false)
|
|
94
113
|
|
|
@@ -122,6 +141,7 @@ export const DashboardLayout: React.FC<DashboardLayoutProps> = ({
|
|
|
122
141
|
onNavigation={onNavigation}
|
|
123
142
|
showBackToAdmin={hasAdminAccess && destination !== 'admin'}
|
|
124
143
|
onBackToAdmin={() => onNavigation?.('/admin')}
|
|
144
|
+
navItems={navItems}
|
|
125
145
|
/>
|
|
126
146
|
)
|
|
127
147
|
}
|
|
@@ -137,12 +157,17 @@ export const DashboardLayout: React.FC<DashboardLayoutProps> = ({
|
|
|
137
157
|
onSidebarToggle={handleSidebarToggle}
|
|
138
158
|
userInitials={userInitials}
|
|
139
159
|
userName={userName}
|
|
160
|
+
userEmail={userEmail}
|
|
161
|
+
userId={userId}
|
|
162
|
+
userRole={userRole}
|
|
140
163
|
inboxCount={inboxCount}
|
|
141
164
|
notificationCount={bellCount}
|
|
142
165
|
onUserClick={onUserClick}
|
|
143
166
|
onInboxClick={onInboxClick}
|
|
144
167
|
onNotificationClick={onBellClick}
|
|
145
168
|
onHelpClick={onHelpClick}
|
|
169
|
+
onProfileClick={onProfileClick}
|
|
170
|
+
onLogoutClick={onLogoutClick}
|
|
146
171
|
mobileMenuOpen={mobileMenuOpen}
|
|
147
172
|
onMobileMenuToggle={() => setMobileMenuOpen(!mobileMenuOpen)}
|
|
148
173
|
userPanelOpen={userPanelOpen}
|
|
@@ -3,6 +3,14 @@ import './ProviderSidebar.scss'
|
|
|
3
3
|
import { EntityHeader } from '../../components/EntityHeader'
|
|
4
4
|
import { Tooltip } from '../../components/Tooltip'
|
|
5
5
|
|
|
6
|
+
export interface NavItem {
|
|
7
|
+
id: string
|
|
8
|
+
label: string
|
|
9
|
+
path: string
|
|
10
|
+
icon: React.ReactNode
|
|
11
|
+
end?: boolean
|
|
12
|
+
}
|
|
13
|
+
|
|
6
14
|
export interface ProviderSidebarProps {
|
|
7
15
|
expanded?: boolean
|
|
8
16
|
providerName?: string
|
|
@@ -13,14 +21,8 @@ export interface ProviderSidebarProps {
|
|
|
13
21
|
activePath?: string
|
|
14
22
|
showBackToAdmin?: boolean
|
|
15
23
|
onBackToAdmin?: () => void
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
interface NavItem {
|
|
19
|
-
id: string
|
|
20
|
-
label: string
|
|
21
|
-
path: string
|
|
22
|
-
icon: React.ReactNode
|
|
23
|
-
end?: boolean
|
|
24
|
+
/** Custom navigation items - if not provided, uses default items */
|
|
25
|
+
navItems?: NavItem[]
|
|
24
26
|
}
|
|
25
27
|
|
|
26
28
|
|
|
@@ -96,30 +98,46 @@ const BackArrowIcon = () => (
|
|
|
96
98
|
</svg>
|
|
97
99
|
)
|
|
98
100
|
|
|
101
|
+
// Export icons for reuse
|
|
102
|
+
export {
|
|
103
|
+
HomeIcon,
|
|
104
|
+
FlowsIcon,
|
|
105
|
+
InventoryIcon,
|
|
106
|
+
LoyaltyIcon,
|
|
107
|
+
CustomersIcon,
|
|
108
|
+
ReportsIcon,
|
|
109
|
+
AnalyticsIcon,
|
|
110
|
+
MarketingIcon,
|
|
111
|
+
WaiversIcon,
|
|
112
|
+
SettingsIcon,
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// Default navigation items
|
|
116
|
+
const defaultNavItems: NavItem[] = [
|
|
117
|
+
{ id: 'home', label: 'Home', path: '/home', icon: <HomeIcon />, end: true },
|
|
118
|
+
{ id: 'flows', label: 'Flows', path: '/flows', icon: <FlowsIcon /> },
|
|
119
|
+
{ id: 'inventory', label: 'Inventory', path: '/inventory', icon: <InventoryIcon /> },
|
|
120
|
+
{ id: 'loyalty', label: 'Loyalty', path: '/loyalty', icon: <LoyaltyIcon /> },
|
|
121
|
+
{ id: 'customers', label: 'Customers', path: '/customers', icon: <CustomersIcon /> },
|
|
122
|
+
{ id: 'reports', label: 'Reports', path: '/reports', icon: <ReportsIcon /> },
|
|
123
|
+
{ id: 'analytics', label: 'Analytics', path: '/analytics', icon: <AnalyticsIcon /> },
|
|
124
|
+
{ id: 'marketing', label: 'Marketing', path: '/marketing', icon: <MarketingIcon /> },
|
|
125
|
+
{ id: 'waivers', label: 'Waivers', path: '/waivers', icon: <WaiversIcon /> },
|
|
126
|
+
{ id: 'settings', label: 'Settings', path: '/settings', icon: <SettingsIcon /> },
|
|
127
|
+
]
|
|
128
|
+
|
|
99
129
|
export const ProviderSidebar: React.FC<ProviderSidebarProps> = ({
|
|
100
130
|
expanded = true,
|
|
101
|
-
providerName
|
|
102
|
-
providerId
|
|
131
|
+
providerName,
|
|
132
|
+
providerId,
|
|
103
133
|
providerImage,
|
|
104
134
|
providerType = 'venue',
|
|
105
135
|
onNavigation,
|
|
106
136
|
activePath = '/home',
|
|
107
137
|
showBackToAdmin = false,
|
|
108
138
|
onBackToAdmin,
|
|
139
|
+
navItems = defaultNavItems,
|
|
109
140
|
}) => {
|
|
110
|
-
|
|
111
|
-
const navItems: NavItem[] = [
|
|
112
|
-
{ id: 'home', label: 'Home', path: '/home', icon: <HomeIcon />, end: true },
|
|
113
|
-
{ id: 'flows', label: 'Flows', path: '/flows', icon: <FlowsIcon /> },
|
|
114
|
-
{ id: 'inventory', label: 'Inventory', path: '/inventory', icon: <InventoryIcon /> },
|
|
115
|
-
{ id: 'loyalty', label: 'Loyalty', path: '/loyalty', icon: <LoyaltyIcon /> },
|
|
116
|
-
{ id: 'customers', label: 'Customers', path: '/customers', icon: <CustomersIcon /> },
|
|
117
|
-
{ id: 'reports', label: 'Reports', path: '/reports', icon: <ReportsIcon /> },
|
|
118
|
-
{ id: 'analytics', label: 'Analytics', path: '/analytics', icon: <AnalyticsIcon /> },
|
|
119
|
-
{ id: 'marketing', label: 'Marketing', path: '/marketing', icon: <MarketingIcon /> },
|
|
120
|
-
{ id: 'waivers', label: 'Waivers', path: '/waivers', icon: <WaiversIcon /> },
|
|
121
|
-
{ id: 'settings', label: 'Settings', path: '/settings', icon: <SettingsIcon /> },
|
|
122
|
-
]
|
|
123
141
|
|
|
124
142
|
const isActive = (item: NavItem) => {
|
|
125
143
|
if (item.end) {
|
|
@@ -3,18 +3,25 @@ import './TopNavigation.scss'
|
|
|
3
3
|
import BookedLogoMark from './assets/BookedLogo_Mark.png'
|
|
4
4
|
import { UserAvatar } from '../../components/UserAvatar'
|
|
5
5
|
import { Tooltip } from '../../components/Tooltip'
|
|
6
|
+
import { UserPanel } from '../../components/UserPanel'
|
|
7
|
+
|
|
6
8
|
export interface TopNavigationProps {
|
|
7
9
|
sidebarCollapsed?: boolean
|
|
8
10
|
onSidebarToggle?: () => void
|
|
9
11
|
userInitials?: string
|
|
10
12
|
userName?: string
|
|
13
|
+
userEmail?: string
|
|
11
14
|
userAvatarUrl?: string
|
|
15
|
+
userId?: number
|
|
16
|
+
userRole?: string
|
|
12
17
|
inboxCount?: number
|
|
13
18
|
notificationCount?: number
|
|
14
19
|
onUserClick?: () => void
|
|
15
20
|
onInboxClick?: () => void
|
|
16
21
|
onNotificationClick?: () => void
|
|
17
22
|
onHelpClick?: () => void
|
|
23
|
+
onProfileClick?: () => void
|
|
24
|
+
onLogoutClick?: () => void
|
|
18
25
|
mobileMenuOpen?: boolean
|
|
19
26
|
onMobileMenuToggle?: () => void
|
|
20
27
|
sidebarToggleDisabled?: boolean
|
|
@@ -124,17 +131,22 @@ export const TopNavigation: React.FC<TopNavigationProps> = ({
|
|
|
124
131
|
onSidebarToggle,
|
|
125
132
|
userInitials = 'U',
|
|
126
133
|
userName = 'User',
|
|
134
|
+
userEmail,
|
|
127
135
|
userAvatarUrl,
|
|
136
|
+
userId,
|
|
137
|
+
userRole,
|
|
128
138
|
inboxCount = 0,
|
|
129
139
|
notificationCount = 0,
|
|
130
140
|
onUserClick,
|
|
131
141
|
onInboxClick,
|
|
132
142
|
onNotificationClick,
|
|
133
143
|
onHelpClick,
|
|
144
|
+
onProfileClick,
|
|
145
|
+
onLogoutClick,
|
|
134
146
|
mobileMenuOpen = false,
|
|
135
147
|
onMobileMenuToggle,
|
|
136
148
|
sidebarToggleDisabled = false,
|
|
137
|
-
userPanelOpen,
|
|
149
|
+
userPanelOpen = false,
|
|
138
150
|
}) => {
|
|
139
151
|
const [hoveredItem, setHoveredItem] = useState<string | null>(null)
|
|
140
152
|
const [isNotificationActive, setIsNotificationActive] = useState(false)
|
|
@@ -239,6 +251,20 @@ export const TopNavigation: React.FC<TopNavigationProps> = ({
|
|
|
239
251
|
</button>
|
|
240
252
|
</Tooltip>
|
|
241
253
|
</div>
|
|
254
|
+
|
|
255
|
+
{/* User Panel */}
|
|
256
|
+
<UserPanel
|
|
257
|
+
isOpen={userPanelOpen}
|
|
258
|
+
onClose={() => onUserClick?.()}
|
|
259
|
+
userName={userName}
|
|
260
|
+
email={userEmail}
|
|
261
|
+
initials={userInitials}
|
|
262
|
+
avatarUrl={userAvatarUrl}
|
|
263
|
+
userNumber={userId}
|
|
264
|
+
userRole={userRole}
|
|
265
|
+
onProfileClick={onProfileClick}
|
|
266
|
+
onLogoutClick={onLogoutClick}
|
|
267
|
+
/>
|
|
242
268
|
</header>
|
|
243
269
|
)
|
|
244
270
|
}
|
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
export { DashboardLayout, type DashboardLayoutProps, type DestinationType } from './DashboardLayout'
|
|
2
|
-
export {
|
|
2
|
+
export {
|
|
3
|
+
ProviderSidebar,
|
|
4
|
+
type ProviderSidebarProps,
|
|
5
|
+
type NavItem,
|
|
6
|
+
HomeIcon,
|
|
7
|
+
FlowsIcon,
|
|
8
|
+
InventoryIcon,
|
|
9
|
+
LoyaltyIcon,
|
|
10
|
+
CustomersIcon,
|
|
11
|
+
ReportsIcon,
|
|
12
|
+
AnalyticsIcon,
|
|
13
|
+
MarketingIcon,
|
|
14
|
+
WaiversIcon,
|
|
15
|
+
SettingsIcon,
|
|
16
|
+
} from './ProviderSidebar'
|
|
3
17
|
export { AdminSidebar, type AdminSidebarProps } from './AdminSidebar'
|
|
4
18
|
export { TopNavigation, type TopNavigationProps } from './TopNavigation'
|
|
5
19
|
export { DashboardFooter, type DashboardFooterProps } from './DashboardFooter'
|