@licklist/design 0.78.5-dev.33 → 0.78.5-dev.34
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-Down.svg.js +16 -0
- package/dist/assets/Trend-Up.svg +3 -0
- package/dist/assets/Trend-Up.svg.js +16 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -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/Select/Select.d.ts +10 -0
- package/dist/v2/components/Select/Select.d.ts.map +1 -0
- package/dist/v2/components/Select/Select.js +128 -0
- package/dist/v2/components/Select/Select.scss.js +6 -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 +20 -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/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/Blog.js +103 -0
- package/dist/v2/dashboard-analytics/blog-posts/Blog.scss.js +6 -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/Chart.js +733 -0
- package/dist/v2/dashboard-analytics/chart/Chart.scss.js +6 -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/Dashboard.js +270 -0
- package/dist/v2/dashboard-analytics/dashboard/Dashboard.scss.js +6 -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/MetricCard.js +65 -0
- package/dist/v2/dashboard-analytics/metric-card/MetricCard.scss.js +6 -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/VenueCard.js +50 -0
- package/dist/v2/dashboard-analytics/venue-card/VenueCard.scss.js +6 -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/VenueClosedCard.js +48 -0
- package/dist/v2/dashboard-analytics/venue-closed-card/VenueClosedCard.scss.js +6 -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 +7 -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 +34 -0
- package/dist/v2/navigation/DashboardLayout/DashboardLayout.d.ts.map +1 -0
- package/dist/v2/navigation/DashboardLayout/DashboardLayout.js +148 -0
- package/dist/v2/navigation/DashboardLayout/DashboardLayout.scss.js +6 -0
- package/dist/v2/navigation/DashboardLayout/ProviderSidebar.d.ts +15 -0
- package/dist/v2/navigation/DashboardLayout/ProviderSidebar.d.ts.map +1 -0
- package/dist/v2/navigation/DashboardLayout/ProviderSidebar.js +343 -0
- package/dist/v2/navigation/DashboardLayout/ProviderSidebar.scss.js +6 -0
- package/dist/v2/navigation/DashboardLayout/TopNavigation.d.ts +21 -0
- package/dist/v2/navigation/DashboardLayout/TopNavigation.d.ts.map +1 -0
- package/dist/v2/navigation/DashboardLayout/TopNavigation.js +453 -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 +4 -3
- package/src/assets/Trend-Down.svg +3 -0
- package/src/assets/Trend-Up.svg +3 -0
- package/src/index.ts +3 -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/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 +264 -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 +11 -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 +190 -0
- package/src/v2/navigation/DashboardLayout/ProviderSidebar.scss +266 -0
- package/src/v2/navigation/DashboardLayout/ProviderSidebar.tsx +234 -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 +244 -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 +6 -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,94 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react'
|
|
2
|
+
import { UserAvatar } from './UserAvatar'
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'v2/Components/UserAvatar',
|
|
6
|
+
component: UserAvatar,
|
|
7
|
+
argTypes: {
|
|
8
|
+
initials: { control: 'text' },
|
|
9
|
+
avatarUrl: { control: 'text' },
|
|
10
|
+
size: { control: 'select', options: ['sm', 'md', 'lg'] },
|
|
11
|
+
isActive: { control: 'boolean' },
|
|
12
|
+
onClick: { action: 'clicked' },
|
|
13
|
+
},
|
|
14
|
+
parameters: {
|
|
15
|
+
layout: 'centered',
|
|
16
|
+
},
|
|
17
|
+
} as Meta<typeof UserAvatar>
|
|
18
|
+
|
|
19
|
+
type Story = StoryObj<typeof UserAvatar>
|
|
20
|
+
|
|
21
|
+
export const Default: Story = {
|
|
22
|
+
args: {
|
|
23
|
+
initials: 'GA',
|
|
24
|
+
size: 'md',
|
|
25
|
+
isActive: false,
|
|
26
|
+
},
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export const Small: Story = {
|
|
30
|
+
args: {
|
|
31
|
+
initials: 'GA',
|
|
32
|
+
size: 'sm',
|
|
33
|
+
isActive: false,
|
|
34
|
+
},
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export const Medium: Story = {
|
|
38
|
+
args: {
|
|
39
|
+
initials: 'GA',
|
|
40
|
+
size: 'md',
|
|
41
|
+
isActive: false,
|
|
42
|
+
},
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export const Large: Story = {
|
|
46
|
+
args: {
|
|
47
|
+
initials: 'GA',
|
|
48
|
+
size: 'lg',
|
|
49
|
+
isActive: false,
|
|
50
|
+
},
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export const Active: Story = {
|
|
54
|
+
args: {
|
|
55
|
+
initials: 'GA',
|
|
56
|
+
size: 'md',
|
|
57
|
+
isActive: true,
|
|
58
|
+
},
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export const WithImage: Story = {
|
|
62
|
+
args: {
|
|
63
|
+
avatarUrl: 'https://i.pravatar.cc/150?img=68',
|
|
64
|
+
size: 'md',
|
|
65
|
+
},
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export const AllSizes: Story = {
|
|
69
|
+
render: () => (
|
|
70
|
+
<div style={{ display: 'flex', alignItems: 'center', gap: '16px' }}>
|
|
71
|
+
<UserAvatar initials="GA" size="sm" />
|
|
72
|
+
<UserAvatar initials="GA" size="md" />
|
|
73
|
+
<UserAvatar initials="GA" size="lg" />
|
|
74
|
+
</div>
|
|
75
|
+
),
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export const AllStates: Story = {
|
|
79
|
+
render: () => (
|
|
80
|
+
<div style={{ display: 'flex', alignItems: 'center', gap: '16px' }}>
|
|
81
|
+
<UserAvatar initials="GA" size="md" isActive={false} />
|
|
82
|
+
<UserAvatar initials="GA" size="md" isActive={true} />
|
|
83
|
+
<UserAvatar avatarUrl="https://i.pravatar.cc/150?img=68" size="md" />
|
|
84
|
+
</div>
|
|
85
|
+
),
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export const Clickable: Story = {
|
|
89
|
+
args: {
|
|
90
|
+
initials: 'GA',
|
|
91
|
+
size: 'md',
|
|
92
|
+
onClick: () => alert('Avatar clicked!'),
|
|
93
|
+
},
|
|
94
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import './UserAvatar.scss'
|
|
3
|
+
|
|
4
|
+
export interface UserAvatarProps {
|
|
5
|
+
initials?: string
|
|
6
|
+
avatarUrl?: string
|
|
7
|
+
size?: 'sm' | 'md' | 'lg'
|
|
8
|
+
isActive?: boolean
|
|
9
|
+
onClick?: () => void
|
|
10
|
+
className?: string
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const UserAvatar: React.FC<UserAvatarProps> = ({
|
|
14
|
+
initials = 'U',
|
|
15
|
+
avatarUrl,
|
|
16
|
+
size = 'md',
|
|
17
|
+
isActive = false,
|
|
18
|
+
onClick,
|
|
19
|
+
className = '',
|
|
20
|
+
}) => {
|
|
21
|
+
const sizeMap = {
|
|
22
|
+
sm: 24,
|
|
23
|
+
md: 32,
|
|
24
|
+
lg: 47,
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const fontSizeMap = {
|
|
28
|
+
sm: 8,
|
|
29
|
+
md: 10,
|
|
30
|
+
lg: 14,
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const dimension = sizeMap[size]
|
|
34
|
+
const fontSize = fontSizeMap[size]
|
|
35
|
+
const radius = dimension / 2 - 1
|
|
36
|
+
|
|
37
|
+
const fillColor = isActive
|
|
38
|
+
? 'var(--fills-main-fill-primary, #14215A)'
|
|
39
|
+
: 'var(--fills-main-fill-secondary, #626A90)'
|
|
40
|
+
|
|
41
|
+
const handleClick = () => {
|
|
42
|
+
onClick?.()
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const content = avatarUrl ? (
|
|
46
|
+
<img src={avatarUrl} alt="Profile" className="user-avatar__image" />
|
|
47
|
+
) : (
|
|
48
|
+
<>
|
|
49
|
+
<svg
|
|
50
|
+
width={dimension}
|
|
51
|
+
height={dimension}
|
|
52
|
+
viewBox={`0 0 ${dimension} ${dimension}`}
|
|
53
|
+
fill="none"
|
|
54
|
+
className="user-avatar__bg"
|
|
55
|
+
>
|
|
56
|
+
<circle
|
|
57
|
+
cx={dimension / 2}
|
|
58
|
+
cy={dimension / 2}
|
|
59
|
+
r={radius}
|
|
60
|
+
fill={fillColor}
|
|
61
|
+
fillOpacity="0.2"
|
|
62
|
+
stroke={fillColor}
|
|
63
|
+
strokeWidth="2"
|
|
64
|
+
/>
|
|
65
|
+
</svg>
|
|
66
|
+
<span
|
|
67
|
+
className={`user-avatar__initials ${isActive ? 'user-avatar__initials--active' : ''}`}
|
|
68
|
+
style={{ fontSize: `${fontSize}px` }}
|
|
69
|
+
>
|
|
70
|
+
{initials}
|
|
71
|
+
</span>
|
|
72
|
+
</>
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
if (onClick) {
|
|
76
|
+
return (
|
|
77
|
+
<button
|
|
78
|
+
className={`user-avatar user-avatar--${size} user-avatar--clickable ${isActive ? 'user-avatar--active' : ''} ${className}`.trim()}
|
|
79
|
+
onClick={handleClick}
|
|
80
|
+
type="button"
|
|
81
|
+
style={{ width: dimension, height: dimension }}
|
|
82
|
+
>
|
|
83
|
+
{content}
|
|
84
|
+
</button>
|
|
85
|
+
)
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
return (
|
|
89
|
+
<div
|
|
90
|
+
className={`user-avatar user-avatar--${size} ${isActive ? 'user-avatar--active' : ''} ${className}`.trim()}
|
|
91
|
+
style={{ width: dimension, height: dimension }}
|
|
92
|
+
>
|
|
93
|
+
{content}
|
|
94
|
+
</div>
|
|
95
|
+
)
|
|
96
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { UserAvatar, type UserAvatarProps } from './UserAvatar'
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
.user-panel__overlay {
|
|
2
|
+
position: fixed;
|
|
3
|
+
inset: 0;
|
|
4
|
+
background: rgba(0, 0, 0, 0.2);
|
|
5
|
+
z-index: 40;
|
|
6
|
+
animation: fadeIn 0.2s ease;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.user-panel {
|
|
10
|
+
position: fixed;
|
|
11
|
+
right: 0;
|
|
12
|
+
top: 0;
|
|
13
|
+
height: 100vh;
|
|
14
|
+
width: 100%;
|
|
15
|
+
max-width: 320px;
|
|
16
|
+
background: var(--surfaces-main-surface-primary, #FFFFFF);
|
|
17
|
+
box-shadow: -4px 0 24px rgba(0, 0, 0, 0.1);
|
|
18
|
+
z-index: 50;
|
|
19
|
+
display: flex;
|
|
20
|
+
flex-direction: column;
|
|
21
|
+
animation: slideInRight 0.3s ease;
|
|
22
|
+
|
|
23
|
+
@media (max-width: 640px) {
|
|
24
|
+
max-width: 100%;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@keyframes fadeIn {
|
|
29
|
+
from { opacity: 0; }
|
|
30
|
+
to { opacity: 1; }
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@keyframes slideInRight {
|
|
34
|
+
from { transform: translateX(100%); }
|
|
35
|
+
to { transform: translateX(0); }
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.user-panel__header {
|
|
39
|
+
display: flex;
|
|
40
|
+
align-items: center;
|
|
41
|
+
justify-content: space-between;
|
|
42
|
+
padding: 16px;
|
|
43
|
+
border-bottom: 1px solid var(--borders-main-border-primary, #E8E9EF);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.user-panel__user-info {
|
|
47
|
+
display: flex;
|
|
48
|
+
align-items: center;
|
|
49
|
+
gap: 8px;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.user-panel__avatar {
|
|
53
|
+
width: 32px;
|
|
54
|
+
height: 32px;
|
|
55
|
+
position: relative;
|
|
56
|
+
display: flex;
|
|
57
|
+
align-items: center;
|
|
58
|
+
justify-content: center;
|
|
59
|
+
flex-shrink: 0;
|
|
60
|
+
overflow: hidden;
|
|
61
|
+
border-radius: 50%;
|
|
62
|
+
|
|
63
|
+
img {
|
|
64
|
+
width: 100%;
|
|
65
|
+
height: 100%;
|
|
66
|
+
object-fit: cover;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.user-panel__avatar-bg {
|
|
71
|
+
position: absolute;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.user-panel__avatar-initials {
|
|
75
|
+
font-family: var(--font-family-sans);
|
|
76
|
+
font-size: 10px;
|
|
77
|
+
font-weight: 800;
|
|
78
|
+
line-height: 8px;
|
|
79
|
+
color: var(--labels-main-label-secondary, #626A90);
|
|
80
|
+
position: relative;
|
|
81
|
+
margin-top: 2px;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.user-panel__user-details {
|
|
85
|
+
display: flex;
|
|
86
|
+
flex-direction: column;
|
|
87
|
+
gap: 2px;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.user-panel__greeting {
|
|
91
|
+
font-family: var(--font-family-sans);
|
|
92
|
+
font-size: 14px;
|
|
93
|
+
font-weight: 600;
|
|
94
|
+
line-height: 18px;
|
|
95
|
+
color: var(--labels-main-label-primary, #121E52);
|
|
96
|
+
margin: 0;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.user-panel__email {
|
|
100
|
+
font-family: var(--font-family-sans);
|
|
101
|
+
font-size: 12px;
|
|
102
|
+
line-height: 14px;
|
|
103
|
+
color: var(--labels-main-label-secondary, #626A90);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.user-panel__close-btn {
|
|
107
|
+
padding: 8px;
|
|
108
|
+
border-radius: 8px;
|
|
109
|
+
border: none;
|
|
110
|
+
background: transparent;
|
|
111
|
+
cursor: pointer;
|
|
112
|
+
display: flex;
|
|
113
|
+
align-items: center;
|
|
114
|
+
justify-content: center;
|
|
115
|
+
flex-shrink: 0;
|
|
116
|
+
color: var(--fills-main-fill-primary, #14215A);
|
|
117
|
+
transition: background 0.2s ease;
|
|
118
|
+
|
|
119
|
+
&:hover {
|
|
120
|
+
background: var(--surfaces-main-surface-primary-hover, #F8F8FA);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.user-panel__menu {
|
|
125
|
+
display: flex;
|
|
126
|
+
flex-direction: column;
|
|
127
|
+
flex: 1;
|
|
128
|
+
padding: 8px;
|
|
129
|
+
gap: 4px;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.user-panel__menu-item {
|
|
133
|
+
display: flex;
|
|
134
|
+
align-items: center;
|
|
135
|
+
gap: 8px;
|
|
136
|
+
width: 100%;
|
|
137
|
+
padding: 8px;
|
|
138
|
+
border-radius: 8px;
|
|
139
|
+
border: none;
|
|
140
|
+
background: transparent;
|
|
141
|
+
cursor: pointer;
|
|
142
|
+
text-align: left;
|
|
143
|
+
color: var(--labels-main-label-primary, #121E52);
|
|
144
|
+
transition: background 0.2s ease;
|
|
145
|
+
outline: none;
|
|
146
|
+
|
|
147
|
+
&:hover {
|
|
148
|
+
background: var(--surfaces-main-surface-primary-hover, #F8F8FA);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
&:active {
|
|
152
|
+
background: var(--surfaces-main-surface-primary-pressed, #F0F0F4);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
span {
|
|
156
|
+
font-family: var(--font-family-sans);
|
|
157
|
+
font-size: 13px;
|
|
158
|
+
font-weight: 500;
|
|
159
|
+
line-height: 16px;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
svg {
|
|
163
|
+
flex-shrink: 0;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.user-panel__logout-section {
|
|
168
|
+
padding: 8px;
|
|
169
|
+
padding-top: 4px;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.user-panel__footer {
|
|
173
|
+
padding: 16px;
|
|
174
|
+
border-top: 1px solid var(--borders-main-border-primary, #E8E9EF);
|
|
175
|
+
margin-top: auto;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.user-panel__user-badge {
|
|
179
|
+
display: inline-flex;
|
|
180
|
+
align-items: center;
|
|
181
|
+
justify-content: center;
|
|
182
|
+
padding: 4px 8px;
|
|
183
|
+
background: var(--surfaces-main-surface-tertiary, #E8E9EF);
|
|
184
|
+
border-radius: 8px;
|
|
185
|
+
width: fit-content;
|
|
186
|
+
|
|
187
|
+
span {
|
|
188
|
+
font-family: var(--font-family-mono);
|
|
189
|
+
font-size: 10px;
|
|
190
|
+
font-weight: 600;
|
|
191
|
+
line-height: 12px;
|
|
192
|
+
color: var(--labels-main-label-secondary, #626A90);
|
|
193
|
+
white-space: nowrap;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import React, { useState } from 'react'
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react'
|
|
3
|
+
import { UserPanel } from './UserPanel'
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof UserPanel> = {
|
|
6
|
+
title: 'v2/Components/UserPanel',
|
|
7
|
+
component: UserPanel,
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: 'fullscreen',
|
|
10
|
+
},
|
|
11
|
+
argTypes: {
|
|
12
|
+
isOpen: { control: 'boolean' },
|
|
13
|
+
userName: { control: 'text' },
|
|
14
|
+
firstName: { control: 'text' },
|
|
15
|
+
email: { control: 'text' },
|
|
16
|
+
initials: { control: 'text' },
|
|
17
|
+
avatarUrl: { control: 'text' },
|
|
18
|
+
userNumber: { control: 'number' },
|
|
19
|
+
userRole: { control: 'text' },
|
|
20
|
+
},
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export default meta
|
|
24
|
+
type Story = StoryObj<typeof UserPanel>
|
|
25
|
+
|
|
26
|
+
const Template = (args: any) => {
|
|
27
|
+
const [isOpen, setIsOpen] = useState(args.isOpen)
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<div style={{ minHeight: '100vh', background: 'var(--surfaces-main-background-secondary)', padding: '20px' }}>
|
|
31
|
+
<button
|
|
32
|
+
onClick={() => setIsOpen(true)}
|
|
33
|
+
style={{
|
|
34
|
+
padding: '8px 16px',
|
|
35
|
+
borderRadius: '8px',
|
|
36
|
+
border: '1px solid var(--borders-main-border-primary)',
|
|
37
|
+
background: 'var(--surfaces-main-surface-primary)',
|
|
38
|
+
cursor: 'pointer',
|
|
39
|
+
fontFamily: 'var(--font-family-sans)',
|
|
40
|
+
}}
|
|
41
|
+
>
|
|
42
|
+
Open User Panel
|
|
43
|
+
</button>
|
|
44
|
+
<UserPanel
|
|
45
|
+
{...args}
|
|
46
|
+
isOpen={isOpen}
|
|
47
|
+
onClose={() => setIsOpen(false)}
|
|
48
|
+
/>
|
|
49
|
+
</div>
|
|
50
|
+
)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export const Default: Story = {
|
|
54
|
+
render: Template,
|
|
55
|
+
args: {
|
|
56
|
+
isOpen: true,
|
|
57
|
+
userName: 'Godwin Adebimpe',
|
|
58
|
+
firstName: 'Godwin',
|
|
59
|
+
email: 'godwin.adebimpe@booked.it',
|
|
60
|
+
initials: 'GA',
|
|
61
|
+
userNumber: 15,
|
|
62
|
+
userRole: 'Super Admin',
|
|
63
|
+
onProfileClick: () => console.log('Profile clicked'),
|
|
64
|
+
onLogoutClick: () => console.log('Logout clicked'),
|
|
65
|
+
},
|
|
66
|
+
}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import './UserPanel.scss'
|
|
3
|
+
|
|
4
|
+
export interface UserPanelProps {
|
|
5
|
+
isOpen: boolean
|
|
6
|
+
onClose: () => void
|
|
7
|
+
userName: string
|
|
8
|
+
firstName?: string
|
|
9
|
+
email?: string
|
|
10
|
+
initials?: string
|
|
11
|
+
avatarUrl?: string | null
|
|
12
|
+
userNumber?: number | null
|
|
13
|
+
userRole?: string
|
|
14
|
+
onProfileClick?: () => void
|
|
15
|
+
onLogoutClick?: () => void
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// Icons as inline SVGs
|
|
19
|
+
const CloseIcon = () => (
|
|
20
|
+
<svg width="20" height="20" viewBox="0 0 24 24" fill="none">
|
|
21
|
+
<path d="M12 10.586L16.95 5.636L18.364 7.05L13.414 12L18.364 16.95L16.95 18.364L12 13.414L7.05 18.364L5.636 16.95L10.586 12L5.636 7.05L7.05 5.636L12 10.586Z" fill="currentColor"/>
|
|
22
|
+
</svg>
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
const UserIcon = () => (
|
|
26
|
+
<svg width="20" height="20" viewBox="0 0 24 24" fill="none">
|
|
27
|
+
<path d="M4.5 19.5C4.5 16.1863 7.18629 13.5 10.5 13.5C13.8137 13.5 16.5 16.1863 16.5 19.5H15C15 17.0147 12.9853 15 10.5 15C8.01472 15 6 17.0147 6 19.5H4.5ZM10.5 12.75C8.01375 12.75 6 10.7362 6 8.25C6 5.76375 8.01375 3.75 10.5 3.75C12.9862 3.75 15 5.76375 15 8.25C15 10.7362 12.9862 12.75 10.5 12.75ZM10.5 11.25C12.1575 11.25 13.5 9.9075 13.5 8.25C13.5 6.5925 12.1575 5.25 10.5 5.25C8.8425 5.25 7.5 6.5925 7.5 8.25C7.5 9.9075 8.8425 11.25 10.5 11.25Z" fill="currentColor"/>
|
|
28
|
+
</svg>
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
const LogoutIcon = () => (
|
|
32
|
+
<svg width="20" height="20" viewBox="0 0 24 24" fill="none">
|
|
33
|
+
<path d="M5 22C4.44772 22 4 21.5523 4 21V3C4 2.44772 4.44772 2 5 2H19C19.5523 2 20 2.44772 20 3V6H18V4H6V20H18V18H20V21C20 21.5523 19.5523 22 19 22H5ZM18 16V13H11V11H18V8L23 12L18 16Z" fill="currentColor"/>
|
|
34
|
+
</svg>
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
export const UserPanel: React.FC<UserPanelProps> = ({
|
|
38
|
+
isOpen,
|
|
39
|
+
onClose,
|
|
40
|
+
userName,
|
|
41
|
+
firstName,
|
|
42
|
+
email,
|
|
43
|
+
initials,
|
|
44
|
+
avatarUrl,
|
|
45
|
+
userNumber,
|
|
46
|
+
userRole,
|
|
47
|
+
onProfileClick,
|
|
48
|
+
onLogoutClick,
|
|
49
|
+
}) => {
|
|
50
|
+
const displayFirstName = firstName || userName?.split(' ')[0] || 'User'
|
|
51
|
+
const displayInitials = initials || userName?.split(' ').map(n => n[0]).join('').toUpperCase().slice(0, 2) || 'U'
|
|
52
|
+
|
|
53
|
+
if (!isOpen) return null
|
|
54
|
+
|
|
55
|
+
return (
|
|
56
|
+
<>
|
|
57
|
+
{/* Overlay */}
|
|
58
|
+
<div
|
|
59
|
+
className="user-panel__overlay"
|
|
60
|
+
onClick={onClose}
|
|
61
|
+
/>
|
|
62
|
+
|
|
63
|
+
{/* Panel */}
|
|
64
|
+
<div
|
|
65
|
+
className="user-panel"
|
|
66
|
+
onClick={(e) => e.stopPropagation()}
|
|
67
|
+
>
|
|
68
|
+
{/* Header */}
|
|
69
|
+
<div className="user-panel__header">
|
|
70
|
+
<div className="user-panel__user-info">
|
|
71
|
+
<div className="user-panel__avatar">
|
|
72
|
+
{avatarUrl ? (
|
|
73
|
+
<img src={avatarUrl} alt="Profile" />
|
|
74
|
+
) : (
|
|
75
|
+
<>
|
|
76
|
+
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" className="user-panel__avatar-bg">
|
|
77
|
+
<circle cx="16" cy="16" r="15" fill="var(--fills-main-fill-secondary, #626A90)" fillOpacity="0.2" stroke="var(--fills-main-fill-secondary, #626A90)" strokeWidth="2" />
|
|
78
|
+
</svg>
|
|
79
|
+
<span className="user-panel__avatar-initials">{displayInitials}</span>
|
|
80
|
+
</>
|
|
81
|
+
)}
|
|
82
|
+
</div>
|
|
83
|
+
<div className="user-panel__user-details">
|
|
84
|
+
<h2 className="user-panel__greeting">Hey {displayFirstName}</h2>
|
|
85
|
+
{email && (
|
|
86
|
+
<span className="user-panel__email">{email}</span>
|
|
87
|
+
)}
|
|
88
|
+
</div>
|
|
89
|
+
</div>
|
|
90
|
+
<button
|
|
91
|
+
onClick={onClose}
|
|
92
|
+
className="user-panel__close-btn"
|
|
93
|
+
aria-label="Close user menu"
|
|
94
|
+
>
|
|
95
|
+
<CloseIcon />
|
|
96
|
+
</button>
|
|
97
|
+
</div>
|
|
98
|
+
|
|
99
|
+
{/* Menu Items */}
|
|
100
|
+
<div className="user-panel__menu">
|
|
101
|
+
<button
|
|
102
|
+
onClick={onProfileClick}
|
|
103
|
+
className="user-panel__menu-item"
|
|
104
|
+
>
|
|
105
|
+
<UserIcon />
|
|
106
|
+
<span>Profile</span>
|
|
107
|
+
</button>
|
|
108
|
+
</div>
|
|
109
|
+
|
|
110
|
+
{/* Logout */}
|
|
111
|
+
<div className="user-panel__logout-section">
|
|
112
|
+
<button
|
|
113
|
+
onClick={onLogoutClick}
|
|
114
|
+
className="user-panel__menu-item"
|
|
115
|
+
>
|
|
116
|
+
<LogoutIcon />
|
|
117
|
+
<span>Log out</span>
|
|
118
|
+
</button>
|
|
119
|
+
</div>
|
|
120
|
+
|
|
121
|
+
{/* Footer with User ID and Role */}
|
|
122
|
+
<div className="user-panel__footer">
|
|
123
|
+
<div className="user-panel__user-badge">
|
|
124
|
+
<span>
|
|
125
|
+
User: {userNumber ? String(userNumber).padStart(2, '0') : 'N/A'}{userRole ? ` - ${userRole}` : ''}
|
|
126
|
+
</span>
|
|
127
|
+
</div>
|
|
128
|
+
</div>
|
|
129
|
+
</div>
|
|
130
|
+
</>
|
|
131
|
+
)
|
|
132
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
@import '../../design-system/typography/Typography.scss';
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
.blog {
|
|
5
|
+
width: 328px;
|
|
6
|
+
margin-top: 0;
|
|
7
|
+
|
|
8
|
+
@media (max-width: 1024px) {
|
|
9
|
+
width: 100%;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
@media (max-width: 767px) {
|
|
13
|
+
padding-left: 8px;
|
|
14
|
+
padding-right: 8px;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
&__header {
|
|
18
|
+
display: flex;
|
|
19
|
+
align-items: center;
|
|
20
|
+
justify-content: space-between;
|
|
21
|
+
margin-bottom: 1rem;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&__title {
|
|
25
|
+
@include typography('heading.h3');
|
|
26
|
+
line-height: 1.75rem;
|
|
27
|
+
color: var(--label-primary);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&__logo {
|
|
31
|
+
height: 22px;
|
|
32
|
+
width: auto;
|
|
33
|
+
object-fit: contain;
|
|
34
|
+
filter: brightness(0) saturate(100%) invert(60%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(90%) contrast(100%);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&__posts {
|
|
38
|
+
display: flex;
|
|
39
|
+
flex-direction: column;
|
|
40
|
+
gap: 0;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&__post {
|
|
44
|
+
display: flex;
|
|
45
|
+
flex-direction: column;
|
|
46
|
+
padding: 1rem 0;
|
|
47
|
+
|
|
48
|
+
&:first-child {
|
|
49
|
+
padding-top: 0;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
&:not(:last-child) {
|
|
53
|
+
border-bottom: 1px solid var(--border-selected);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
&__post-title {
|
|
58
|
+
@include typography('heading.h4');
|
|
59
|
+
line-height: 1.5rem;
|
|
60
|
+
color: var(--label-primary);
|
|
61
|
+
margin-bottom: 0.5rem;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
&__post-excerpt {
|
|
65
|
+
@include typography('text.regular');
|
|
66
|
+
line-height: 1.25rem;
|
|
67
|
+
color: var(--label-secondary);
|
|
68
|
+
margin-bottom: 0.5rem;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
&__post-link {
|
|
72
|
+
@include typography('heading.h5');
|
|
73
|
+
display: inline-flex;
|
|
74
|
+
align-items: center;
|
|
75
|
+
gap: 0.25rem;
|
|
76
|
+
color: var(--label-action);
|
|
77
|
+
text-decoration: none;
|
|
78
|
+
transition: opacity 0.2s ease-in-out;
|
|
79
|
+
|
|
80
|
+
&:hover {
|
|
81
|
+
opacity: 0.8;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
&__post-link-icon {
|
|
86
|
+
display: inline-flex;
|
|
87
|
+
align-items: center;
|
|
88
|
+
width: 12px;
|
|
89
|
+
height: 12px;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
}
|