Compare commits
13 commits
7ede267762
...
15f4fbd40b
Author | SHA1 | Date | |
---|---|---|---|
15f4fbd40b | |||
f508f26531 | |||
b191090f90 | |||
f813f2351a | |||
7d2d5c55e8 | |||
6b46177dc0 | |||
bf4f0b61ed | |||
0c260820e2 | |||
a308158ca7 | |||
f658a95b16 | |||
13a99e9dc4 | |||
5d81288479 | |||
6a5ad338ba |
27 changed files with 2156 additions and 563 deletions
8
src/app/api/logout/route.ts
Normal file
8
src/app/api/logout/route.ts
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
import { signOut } from '@/auth';
|
||||||
|
import { NextResponse } from 'next/server';
|
||||||
|
|
||||||
|
export const GET = async () => {
|
||||||
|
await signOut();
|
||||||
|
|
||||||
|
return NextResponse.redirect('/login');
|
||||||
|
};
|
|
@ -1,11 +1,13 @@
|
||||||
import zod from 'zod/v4';
|
import zod from 'zod/v4';
|
||||||
import {
|
import {
|
||||||
|
emailSchema,
|
||||||
firstNameSchema,
|
firstNameSchema,
|
||||||
lastNameSchema,
|
lastNameSchema,
|
||||||
newUserEmailServerSchema,
|
newUserEmailServerSchema,
|
||||||
newUserNameServerSchema,
|
newUserNameServerSchema,
|
||||||
passwordSchema,
|
passwordSchema,
|
||||||
timezoneSchema,
|
timezoneSchema,
|
||||||
|
userNameSchema,
|
||||||
} from '@/app/api/user/validation';
|
} from '@/app/api/user/validation';
|
||||||
|
|
||||||
// ----------------------------------------
|
// ----------------------------------------
|
||||||
|
@ -22,6 +24,15 @@ export const updateUserServerSchema = zod.object({
|
||||||
timezone: timezoneSchema.optional(),
|
timezone: timezoneSchema.optional(),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export const updateUserClientSchema = zod.object({
|
||||||
|
name: userNameSchema.optional(),
|
||||||
|
first_name: firstNameSchema.optional(),
|
||||||
|
last_name: lastNameSchema.optional(),
|
||||||
|
email: emailSchema.optional(),
|
||||||
|
image: zod.url().optional(),
|
||||||
|
timezone: timezoneSchema.optional(),
|
||||||
|
});
|
||||||
|
|
||||||
export const updateUserPasswordServerSchema = zod
|
export const updateUserPasswordServerSchema = zod
|
||||||
.object({
|
.object({
|
||||||
current_password: zod.string().min(1, 'Current password is required'),
|
current_password: zod.string().min(1, 'Current password is required'),
|
||||||
|
|
|
@ -1,482 +1,5 @@
|
||||||
import { Button } from '@/components/ui/button';
|
import SettingsPage from '@/components/settings/settings-page';
|
||||||
import {
|
|
||||||
Card,
|
|
||||||
CardContent,
|
|
||||||
CardDescription,
|
|
||||||
CardFooter,
|
|
||||||
CardHeader,
|
|
||||||
CardTitle,
|
|
||||||
} from '@/components/ui/card';
|
|
||||||
import { Input } from '@/components/ui/input';
|
|
||||||
import { Label } from '@/components/ui/label';
|
|
||||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs';
|
|
||||||
import { ScrollableSettingsWrapper } from '@/components/wrappers/settings-scroll';
|
|
||||||
import { Switch } from '@/components/ui/switch';
|
|
||||||
import {
|
|
||||||
Select,
|
|
||||||
SelectContent,
|
|
||||||
SelectItem,
|
|
||||||
SelectTrigger,
|
|
||||||
SelectValue,
|
|
||||||
} from '@/components/ui/select';
|
|
||||||
|
|
||||||
export default function SettingsPage() {
|
export default function Page() {
|
||||||
return (
|
return <SettingsPage />;
|
||||||
<div className='fixed inset-0 flex items-center justify-center p-4 bg-background/50 backdrop-blur-sm'>
|
|
||||||
<div className='rounded-lg border bg-card text-card-foreground shadow-xl max-w-[700px] w-full h-auto max-h-[calc(100vh-2rem)] flex flex-col'>
|
|
||||||
<Tabs
|
|
||||||
defaultValue='general'
|
|
||||||
className='w-full flex flex-col flex-grow min-h-0'
|
|
||||||
>
|
|
||||||
<TabsList className='grid w-full grid-cols-3 sm:grid-cols-5'>
|
|
||||||
<TabsTrigger value='general'>Account</TabsTrigger>
|
|
||||||
<TabsTrigger value='notifications'>Notifications</TabsTrigger>
|
|
||||||
<TabsTrigger value='calendarAvailability'>Calendar</TabsTrigger>
|
|
||||||
<TabsTrigger value='sharingPrivacy'>Privacy</TabsTrigger>
|
|
||||||
<TabsTrigger value='appearance'>Appearance</TabsTrigger>
|
|
||||||
</TabsList>
|
|
||||||
|
|
||||||
<TabsContent value='general' className='flex-grow overflow-hidden'>
|
|
||||||
<Card className='h-full flex flex-col border-0 shadow-none rounded-none'>
|
|
||||||
<ScrollableSettingsWrapper>
|
|
||||||
<CardHeader>
|
|
||||||
<CardTitle>Account Settings</CardTitle>
|
|
||||||
<CardDescription>
|
|
||||||
Manage your account details and preferences.
|
|
||||||
</CardDescription>
|
|
||||||
</CardHeader>
|
|
||||||
<CardContent className='space-y-6'>
|
|
||||||
<div className='space-y-2'>
|
|
||||||
<Label htmlFor='displayName'>Display Name</Label>
|
|
||||||
<Input id='displayName' placeholder='Your Name' />
|
|
||||||
</div>
|
|
||||||
<div className='space-y-2'>
|
|
||||||
<Label htmlFor='email'>Email Address</Label>
|
|
||||||
<Input
|
|
||||||
id='email'
|
|
||||||
type='email'
|
|
||||||
placeholder='your.email@example.com'
|
|
||||||
readOnly
|
|
||||||
value='user-email@example.com'
|
|
||||||
/>
|
|
||||||
<p className='text-sm text-muted-foreground'>
|
|
||||||
Email is managed by your SSO provider.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<div className='space-y-2'>
|
|
||||||
<Label htmlFor='profilePicture'>Profile Picture</Label>
|
|
||||||
<Input id='profilePicture' type='file' />
|
|
||||||
<p className='text-sm text-muted-foreground'>
|
|
||||||
Upload a new profile picture.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<div className='space-y-2'>
|
|
||||||
<Label htmlFor='timezone'>Timezone</Label>
|
|
||||||
<Input id='displayName' placeholder='Europe/Berlin' />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className='space-y-2'>
|
|
||||||
<Label htmlFor='language'>Language</Label>
|
|
||||||
<Select>
|
|
||||||
<SelectTrigger id='language'>
|
|
||||||
<SelectValue placeholder='Select language' />
|
|
||||||
</SelectTrigger>
|
|
||||||
<SelectContent>
|
|
||||||
<SelectItem value='en'>English</SelectItem>
|
|
||||||
<SelectItem value='de'>German</SelectItem>
|
|
||||||
</SelectContent>
|
|
||||||
</Select>
|
|
||||||
</div>
|
|
||||||
<div className='pt-4'>
|
|
||||||
<Button variant='secondary'>Delete Account</Button>
|
|
||||||
<p className='text-sm text-muted-foreground pt-1'>
|
|
||||||
Permanently delete your account and all associated data.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</CardContent>
|
|
||||||
</ScrollableSettingsWrapper>
|
|
||||||
<CardFooter className='mt-auto border-t pt-4 flex justify-between'>
|
|
||||||
<Button variant='secondary'>Exit</Button>
|
|
||||||
<Button>Save Changes</Button>
|
|
||||||
</CardFooter>
|
|
||||||
</Card>
|
|
||||||
</TabsContent>
|
|
||||||
|
|
||||||
<TabsContent
|
|
||||||
value='notifications'
|
|
||||||
className='flex-grow overflow-hidden'
|
|
||||||
>
|
|
||||||
<Card className='h-full flex flex-col border-0 shadow-none rounded-none'>
|
|
||||||
<ScrollableSettingsWrapper>
|
|
||||||
<CardHeader>
|
|
||||||
<CardTitle>Notification Preferences</CardTitle>
|
|
||||||
<CardDescription>
|
|
||||||
Choose how you want to be notified.
|
|
||||||
</CardDescription>
|
|
||||||
</CardHeader>
|
|
||||||
<CardContent className='space-y-6'>
|
|
||||||
<div className='flex items-center justify-between space-x-2 p-3 rounded-md border'>
|
|
||||||
<Label
|
|
||||||
htmlFor='masterEmailNotifications'
|
|
||||||
className='font-normal'
|
|
||||||
>
|
|
||||||
Enable All Email Notifications
|
|
||||||
</Label>
|
|
||||||
<Switch id='masterEmailNotifications' />
|
|
||||||
</div>
|
|
||||||
<div className='space-y-4 pl-2 border-l-2 ml-2'>
|
|
||||||
<div className='flex items-center justify-between space-x-2'>
|
|
||||||
<Label
|
|
||||||
htmlFor='newMeetingBookings'
|
|
||||||
className='font-normal'
|
|
||||||
>
|
|
||||||
New Meeting Bookings
|
|
||||||
</Label>
|
|
||||||
<Switch id='newMeetingBookings' />
|
|
||||||
</div>
|
|
||||||
<div className='flex items-center justify-between space-x-2'>
|
|
||||||
<Label
|
|
||||||
htmlFor='meetingConfirmations'
|
|
||||||
className='font-normal'
|
|
||||||
>
|
|
||||||
Meeting Confirmations/Cancellations
|
|
||||||
</Label>
|
|
||||||
<Switch id='meetingConfirmations' />
|
|
||||||
</div>
|
|
||||||
<div className='flex items-center justify-between space-x-2'>
|
|
||||||
<Label
|
|
||||||
htmlFor='enableMeetingReminders'
|
|
||||||
className='font-normal'
|
|
||||||
>
|
|
||||||
Meeting Reminders
|
|
||||||
</Label>
|
|
||||||
<Switch id='enableMeetingReminders' />
|
|
||||||
</div>
|
|
||||||
<div className='space-y-2 pl-6'>
|
|
||||||
<Label htmlFor='remindBefore'>Remind me before</Label>
|
|
||||||
<Select>
|
|
||||||
<SelectTrigger id='remindBefore'>
|
|
||||||
<SelectValue placeholder='Select reminder time' />
|
|
||||||
</SelectTrigger>
|
|
||||||
<SelectContent>
|
|
||||||
<SelectItem value='15m'>15 minutes</SelectItem>
|
|
||||||
<SelectItem value='30m'>30 minutes</SelectItem>
|
|
||||||
<SelectItem value='1h'>1 hour</SelectItem>
|
|
||||||
<SelectItem value='1d'>1 day</SelectItem>
|
|
||||||
</SelectContent>
|
|
||||||
</Select>
|
|
||||||
</div>
|
|
||||||
<div className='flex items-center justify-between space-x-2'>
|
|
||||||
<Label htmlFor='friendRequests' className='font-normal'>
|
|
||||||
Friend Requests
|
|
||||||
</Label>
|
|
||||||
<Switch id='friendRequests' />
|
|
||||||
</div>
|
|
||||||
<div className='flex items-center justify-between space-x-2'>
|
|
||||||
<Label htmlFor='groupUpdates' className='font-normal'>
|
|
||||||
Group Invitations/Updates
|
|
||||||
</Label>
|
|
||||||
<Switch id='groupUpdates' />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</CardContent>
|
|
||||||
</ScrollableSettingsWrapper>
|
|
||||||
<CardFooter className='mt-auto border-t pt-4 flex justify-between'>
|
|
||||||
<Button variant='secondary'>Exit</Button>
|
|
||||||
<Button>Save Changes</Button>
|
|
||||||
</CardFooter>
|
|
||||||
</Card>
|
|
||||||
</TabsContent>
|
|
||||||
|
|
||||||
<TabsContent
|
|
||||||
value='calendarAvailability'
|
|
||||||
className='flex-grow overflow-hidden'
|
|
||||||
>
|
|
||||||
<Card className='h-full flex flex-col border-0 shadow-none rounded-none'>
|
|
||||||
<ScrollableSettingsWrapper>
|
|
||||||
<CardHeader>
|
|
||||||
<CardTitle>Calendar & Availability</CardTitle>
|
|
||||||
<CardDescription>
|
|
||||||
Manage your calendar display, default availability, and iCal
|
|
||||||
integrations.
|
|
||||||
</CardDescription>
|
|
||||||
</CardHeader>
|
|
||||||
<CardContent className='space-y-6'>
|
|
||||||
<fieldset className='space-y-4 p-4 border rounded-md'>
|
|
||||||
<legend className='text-sm font-medium px-1'>
|
|
||||||
Display
|
|
||||||
</legend>
|
|
||||||
<div className='space-y-2'>
|
|
||||||
<Label htmlFor='defaultCalendarView'>
|
|
||||||
Default Calendar View
|
|
||||||
</Label>
|
|
||||||
<Select>
|
|
||||||
<SelectTrigger id='defaultCalendarView'>
|
|
||||||
<SelectValue placeholder='Select view' />
|
|
||||||
</SelectTrigger>
|
|
||||||
<SelectContent>
|
|
||||||
<SelectItem value='day'>Day</SelectItem>
|
|
||||||
<SelectItem value='week'>Week</SelectItem>
|
|
||||||
<SelectItem value='month'>Month</SelectItem>
|
|
||||||
</SelectContent>
|
|
||||||
</Select>
|
|
||||||
</div>
|
|
||||||
<div className='space-y-2'>
|
|
||||||
<Label htmlFor='weekStartsOn'>Week Starts On</Label>
|
|
||||||
<Select>
|
|
||||||
<SelectTrigger id='weekStartsOn'>
|
|
||||||
<SelectValue placeholder='Select day' />
|
|
||||||
</SelectTrigger>
|
|
||||||
<SelectContent>
|
|
||||||
<SelectItem value='sunday'>Sunday</SelectItem>
|
|
||||||
<SelectItem value='monday'>Monday</SelectItem>
|
|
||||||
</SelectContent>
|
|
||||||
</Select>
|
|
||||||
</div>
|
|
||||||
<div className='flex items-center justify-between space-x-2'>
|
|
||||||
<Label htmlFor='showWeekends' className='font-normal'>
|
|
||||||
Show Weekends
|
|
||||||
</Label>
|
|
||||||
<Switch id='showWeekends' defaultChecked />
|
|
||||||
</div>
|
|
||||||
</fieldset>
|
|
||||||
|
|
||||||
<fieldset className='space-y-4 p-4 border rounded-md'>
|
|
||||||
<legend className='text-sm font-medium px-1'>
|
|
||||||
Availability
|
|
||||||
</legend>
|
|
||||||
<div className='space-y-2'>
|
|
||||||
<Label>Working Hours</Label>
|
|
||||||
<p className='text-sm text-muted-foreground'>
|
|
||||||
Define your typical available hours (e.g.,
|
|
||||||
Monday-Friday, 9 AM - 5 PM).
|
|
||||||
</p>
|
|
||||||
<Button variant='outline_muted' size='sm'>
|
|
||||||
Set Working Hours
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
<div className='space-y-2'>
|
|
||||||
<Label htmlFor='minNoticeBooking'>
|
|
||||||
Minimum Notice for Bookings
|
|
||||||
</Label>
|
|
||||||
<p className='text-sm text-muted-foreground'>
|
|
||||||
Min time before a booking can be made.
|
|
||||||
</p>
|
|
||||||
<div className='space-y-2'>
|
|
||||||
<Input
|
|
||||||
id='bookingWindow'
|
|
||||||
type='text'
|
|
||||||
placeholder='e.g., 1h'
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className='space-y-2'>
|
|
||||||
<Label htmlFor='bookingWindow'>
|
|
||||||
Booking Window (days in advance)
|
|
||||||
</Label>
|
|
||||||
<p className='text-sm text-muted-foreground'>
|
|
||||||
Max time in advance a booking can be made.
|
|
||||||
</p>
|
|
||||||
<Input
|
|
||||||
id='bookingWindow'
|
|
||||||
type='number'
|
|
||||||
placeholder='e.g., 30d'
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</fieldset>
|
|
||||||
|
|
||||||
<fieldset className='space-y-4 p-4 border rounded-md'>
|
|
||||||
<legend className='text-sm font-medium px-1'>
|
|
||||||
iCalendar Integration
|
|
||||||
</legend>
|
|
||||||
<div className='space-y-2'>
|
|
||||||
<Label htmlFor='icalImport'>Import iCal Feed URL</Label>
|
|
||||||
<Input
|
|
||||||
id='icalImport'
|
|
||||||
type='url'
|
|
||||||
placeholder='https://calendar.example.com/feed.ics'
|
|
||||||
/>
|
|
||||||
<Button size='sm' className='mt-1'>
|
|
||||||
Add Feed
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
<div className='space-y-2'>
|
|
||||||
<Label>Export Your Calendar</Label>
|
|
||||||
<Button variant='outline_muted' size='sm'>
|
|
||||||
Get iCal Export URL
|
|
||||||
</Button>
|
|
||||||
<Button
|
|
||||||
variant='outline_muted'
|
|
||||||
size='sm'
|
|
||||||
className='ml-2'
|
|
||||||
>
|
|
||||||
Download .ics File
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
</fieldset>
|
|
||||||
</CardContent>
|
|
||||||
</ScrollableSettingsWrapper>
|
|
||||||
<CardFooter className='mt-auto border-t pt-4 flex justify-between'>
|
|
||||||
<Button variant='secondary'>Exit</Button>
|
|
||||||
<Button>Save Changes</Button>
|
|
||||||
</CardFooter>
|
|
||||||
</Card>
|
|
||||||
</TabsContent>
|
|
||||||
|
|
||||||
<TabsContent
|
|
||||||
value='sharingPrivacy'
|
|
||||||
className='flex-grow overflow-hidden'
|
|
||||||
>
|
|
||||||
<Card className='h-full flex flex-col border-0 shadow-none rounded-none'>
|
|
||||||
<ScrollableSettingsWrapper>
|
|
||||||
<CardHeader>
|
|
||||||
<CardTitle>Sharing & Privacy</CardTitle>
|
|
||||||
<CardDescription>
|
|
||||||
Control who can see your calendar and book time with you.
|
|
||||||
</CardDescription>
|
|
||||||
</CardHeader>
|
|
||||||
<CardContent className='space-y-6'>
|
|
||||||
<div className='space-y-2'>
|
|
||||||
<Label htmlFor='defaultVisibility'>
|
|
||||||
Default Calendar Visibility
|
|
||||||
</Label>
|
|
||||||
<Select>
|
|
||||||
<SelectTrigger id='defaultVisibility'>
|
|
||||||
<SelectValue placeholder='Select visibility' />
|
|
||||||
</SelectTrigger>
|
|
||||||
<SelectContent>
|
|
||||||
<SelectItem value='private'>
|
|
||||||
Private (Only You)
|
|
||||||
</SelectItem>
|
|
||||||
<SelectItem value='freebusy'>
|
|
||||||
Free/Busy for Friends
|
|
||||||
</SelectItem>
|
|
||||||
<SelectItem value='fulldetails'>
|
|
||||||
Full Details for Friends
|
|
||||||
</SelectItem>
|
|
||||||
</SelectContent>
|
|
||||||
</Select>
|
|
||||||
</div>
|
|
||||||
<div className='space-y-2'>
|
|
||||||
<Label htmlFor='whoCanSeeFull'>
|
|
||||||
Who Can See Your Full Calendar Details?
|
|
||||||
</Label>
|
|
||||||
<p className='text-sm text-muted-foreground'>
|
|
||||||
(Override for Default Visibility)
|
|
||||||
<br />
|
|
||||||
<span className='text-sm text-muted-foreground'>
|
|
||||||
This setting will override the default visibility for
|
|
||||||
your calendar. You can set specific friends or groups to
|
|
||||||
see your full calendar details.
|
|
||||||
</span>
|
|
||||||
</p>
|
|
||||||
<Select>
|
|
||||||
<SelectTrigger id='whoCanSeeFull'>
|
|
||||||
<SelectValue placeholder='Select audience' />
|
|
||||||
</SelectTrigger>
|
|
||||||
<SelectContent>
|
|
||||||
<SelectItem value='me'>Only Me</SelectItem>
|
|
||||||
<SelectItem value='friends'>My Friends</SelectItem>
|
|
||||||
<SelectItem value='specific'>
|
|
||||||
Specific Friends/Groups (manage separately)
|
|
||||||
</SelectItem>
|
|
||||||
</SelectContent>
|
|
||||||
</Select>
|
|
||||||
</div>
|
|
||||||
<div className='space-y-2'>
|
|
||||||
<Label htmlFor='whoCanBook'>
|
|
||||||
Who Can Book Time With You?
|
|
||||||
</Label>
|
|
||||||
<Select>
|
|
||||||
<SelectTrigger id='whoCanBook'>
|
|
||||||
<SelectValue placeholder='Select audience' />
|
|
||||||
</SelectTrigger>
|
|
||||||
<SelectContent>
|
|
||||||
<SelectItem value='none'>No One</SelectItem>
|
|
||||||
<SelectItem value='friends'>My Friends</SelectItem>
|
|
||||||
<SelectItem value='specific'>
|
|
||||||
Specific Friends/Groups (manage separately)
|
|
||||||
</SelectItem>
|
|
||||||
</SelectContent>
|
|
||||||
</Select>
|
|
||||||
</div>
|
|
||||||
<div className='space-y-2'>
|
|
||||||
<Label>Blocked Users</Label>
|
|
||||||
<Button variant='outline_muted'>
|
|
||||||
Manage Blocked Users
|
|
||||||
</Button>
|
|
||||||
<p className='text-sm text-muted-foreground'>
|
|
||||||
Prevent specific users from seeing your calendar or
|
|
||||||
booking time.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</CardContent>
|
|
||||||
</ScrollableSettingsWrapper>
|
|
||||||
<CardFooter className='mt-auto border-t pt-4 flex justify-between'>
|
|
||||||
<Button variant='secondary'>Exit</Button>
|
|
||||||
<Button>Save Changes</Button>
|
|
||||||
</CardFooter>
|
|
||||||
</Card>
|
|
||||||
</TabsContent>
|
|
||||||
|
|
||||||
<TabsContent value='appearance' className='flex-grow overflow-hidden'>
|
|
||||||
<Card className='h-full flex flex-col border-0 shadow-none rounded-none'>
|
|
||||||
<ScrollableSettingsWrapper>
|
|
||||||
<CardHeader>
|
|
||||||
<CardTitle>Appearance</CardTitle>
|
|
||||||
<CardDescription>
|
|
||||||
Customize the look and feel of the application.
|
|
||||||
</CardDescription>
|
|
||||||
</CardHeader>
|
|
||||||
<CardContent className='space-y-6'>
|
|
||||||
<div className='space-y-2'>
|
|
||||||
<Label htmlFor='theme'>Theme</Label>
|
|
||||||
<Select>
|
|
||||||
<SelectTrigger id='theme'>
|
|
||||||
<SelectValue placeholder='Select theme' />
|
|
||||||
</SelectTrigger>
|
|
||||||
<SelectContent>
|
|
||||||
<SelectItem value='light'>Light</SelectItem>
|
|
||||||
<SelectItem value='dark'>Dark</SelectItem>
|
|
||||||
<SelectItem value='system'>System Default</SelectItem>
|
|
||||||
</SelectContent>
|
|
||||||
</Select>
|
|
||||||
</div>
|
|
||||||
<div className='space-y-2'>
|
|
||||||
<Label htmlFor='dateFormat'>Date Format</Label>
|
|
||||||
<Select>
|
|
||||||
<SelectTrigger id='dateFormat'>
|
|
||||||
<SelectValue placeholder='Select date format' />
|
|
||||||
</SelectTrigger>
|
|
||||||
<SelectContent>
|
|
||||||
<SelectItem value='ddmmyyyy'>DD/MM/YYYY</SelectItem>
|
|
||||||
<SelectItem value='mmddyyyy'>MM/DD/YYYY</SelectItem>
|
|
||||||
<SelectItem value='yyyymmdd'>YYYY-MM-DD</SelectItem>
|
|
||||||
</SelectContent>
|
|
||||||
</Select>
|
|
||||||
</div>
|
|
||||||
<div className='space-y-2'>
|
|
||||||
<Label htmlFor='timeFormat'>Time Format</Label>
|
|
||||||
<Select>
|
|
||||||
<SelectTrigger id='timeFormat'>
|
|
||||||
<SelectValue placeholder='Select time format' />
|
|
||||||
</SelectTrigger>
|
|
||||||
<SelectContent>
|
|
||||||
<SelectItem value='24h'>24-hour</SelectItem>
|
|
||||||
<SelectItem value='12h'>12-hour</SelectItem>
|
|
||||||
</SelectContent>
|
|
||||||
</Select>
|
|
||||||
</div>
|
|
||||||
</CardContent>
|
|
||||||
</ScrollableSettingsWrapper>
|
|
||||||
<CardFooter className='mt-auto border-t pt-4 flex justify-between'>
|
|
||||||
<Button variant='secondary'>Exit</Button>
|
|
||||||
<Button>Save Changes</Button>
|
|
||||||
</CardFooter>
|
|
||||||
</Card>
|
|
||||||
</TabsContent>
|
|
||||||
</Tabs>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
14
src/auth.ts
14
src/auth.ts
|
@ -88,7 +88,19 @@ const providers: Provider[] = [
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
process.env.AUTH_AUTHENTIK_ID && Authentik,
|
process.env.AUTH_AUTHENTIK_ID &&
|
||||||
|
Authentik({
|
||||||
|
profile(profile) {
|
||||||
|
return {
|
||||||
|
id: profile.sub,
|
||||||
|
name: profile.preferred_username,
|
||||||
|
first_name: profile.given_name.split(' ')[0] || '',
|
||||||
|
last_name: profile.given_name.split(' ')[1] || '',
|
||||||
|
email: profile.email,
|
||||||
|
image: profile.picture,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
}),
|
||||||
].filter(Boolean) as Provider[];
|
].filter(Boolean) as Provider[];
|
||||||
|
|
||||||
export const providerMap = providers
|
export const providerMap = providers
|
||||||
|
|
|
@ -1,19 +1,20 @@
|
||||||
import { Button } from '@/components/ui/button';
|
import { Button } from '@/components/ui/button';
|
||||||
|
import { LucideProps } from 'lucide-react';
|
||||||
import { IconProp } from '@fortawesome/fontawesome-svg-core';
|
import React, { ForwardRefExoticComponent, RefAttributes } from 'react';
|
||||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
||||||
|
|
||||||
export function IconButton({
|
export function IconButton({
|
||||||
icon,
|
icon,
|
||||||
children,
|
children,
|
||||||
...props
|
...props
|
||||||
}: {
|
}: {
|
||||||
icon: IconProp;
|
icon?: ForwardRefExoticComponent<
|
||||||
children: React.ReactNode;
|
Omit<LucideProps, 'ref'> & RefAttributes<SVGSVGElement>
|
||||||
|
>;
|
||||||
|
children?: React.ReactNode;
|
||||||
} & React.ComponentProps<typeof Button>) {
|
} & React.ComponentProps<typeof Button>) {
|
||||||
return (
|
return (
|
||||||
<Button type='button' variant='secondary' {...props}>
|
<Button type='button' variant='secondary' {...props}>
|
||||||
<FontAwesomeIcon icon={icon} className='mr-2' />
|
{icon && React.createElement(icon, { className: 'mr-2' })}
|
||||||
{children}
|
{children}
|
||||||
</Button>
|
</Button>
|
||||||
);
|
);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { signIn } from '@/auth';
|
import { signIn } from '@/auth';
|
||||||
import { IconButton } from '@/components/buttons/icon-button';
|
import { IconButton } from '@/components/buttons/icon-button';
|
||||||
import { faOpenid } from '@fortawesome/free-brands-svg-icons';
|
import { Fingerprint, ScanEye } from 'lucide-react';
|
||||||
|
|
||||||
export default function SSOLogin({
|
export default function SSOLogin({
|
||||||
provider,
|
provider,
|
||||||
|
@ -22,7 +22,7 @@ export default function SSOLogin({
|
||||||
className='w-full'
|
className='w-full'
|
||||||
type='submit'
|
type='submit'
|
||||||
variant='secondary'
|
variant='secondary'
|
||||||
icon={faOpenid}
|
icon={Fingerprint}
|
||||||
{...props}
|
{...props}
|
||||||
>
|
>
|
||||||
Login with {providerDisplayName}
|
Login with {providerDisplayName}
|
||||||
|
|
|
@ -52,7 +52,7 @@ const items = [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Events',
|
title: 'Events',
|
||||||
url: '#',
|
url: '/events',
|
||||||
icon: CalendarClock,
|
icon: CalendarClock,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
@ -62,18 +62,20 @@ export function AppSidebar() {
|
||||||
<>
|
<>
|
||||||
<Sidebar collapsible='icon' variant='sidebar'>
|
<Sidebar collapsible='icon' variant='sidebar'>
|
||||||
<SidebarHeader className='overflow-hidden'>
|
<SidebarHeader className='overflow-hidden'>
|
||||||
<Logo
|
<Link href='/home'>
|
||||||
colorType='colored'
|
<Logo
|
||||||
logoType='combo'
|
colorType='colored'
|
||||||
height={50}
|
logoType='combo'
|
||||||
className='group-data-[collapsible=icon]:hidden min-w-[203px]'
|
height={50}
|
||||||
></Logo>
|
className='group-data-[collapsible=icon]:hidden min-w-[203px]'
|
||||||
<Logo
|
></Logo>
|
||||||
colorType='colored'
|
<Logo
|
||||||
logoType='submark'
|
colorType='colored'
|
||||||
height={50}
|
logoType='submark'
|
||||||
className='group-data-[collapsible=]:hidden group-data-[mobile=true]/mobile:hidden'
|
height={50}
|
||||||
></Logo>
|
className='group-data-[collapsible=]:hidden group-data-[mobile=true]/mobile:hidden'
|
||||||
|
></Logo>
|
||||||
|
</Link>
|
||||||
</SidebarHeader>
|
</SidebarHeader>
|
||||||
<SidebarContent className='grid grid-rows-[auto_1fr_auto]'>
|
<SidebarContent className='grid grid-rows-[auto_1fr_auto]'>
|
||||||
<Collapsible defaultOpen className='group/collapsible'>
|
<Collapsible defaultOpen className='group/collapsible'>
|
||||||
|
@ -114,7 +116,7 @@ export function AppSidebar() {
|
||||||
<SidebarFooter>
|
<SidebarFooter>
|
||||||
<SidebarMenuItem className='pl-[8px]'>
|
<SidebarMenuItem className='pl-[8px]'>
|
||||||
<Link
|
<Link
|
||||||
href='/event/new'
|
href='/events/new'
|
||||||
className='flex items-center gap-2 text-xl font-label'
|
className='flex items-center gap-2 text-xl font-label'
|
||||||
>
|
>
|
||||||
<CalendarPlus className='size-8' />
|
<CalendarPlus className='size-8' />
|
||||||
|
|
|
@ -1,29 +1,54 @@
|
||||||
import { Input, Textarea } from '@/components/ui/input';
|
import { Input, Textarea } from '@/components/ui/input';
|
||||||
import { Label } from '@/components/ui/label';
|
import { Label } from '@/components/ui/label';
|
||||||
|
import React, { ForwardRefExoticComponent, RefAttributes } from 'react';
|
||||||
|
import { Button } from '../ui/button';
|
||||||
|
import { Eye, EyeOff, LucideProps } from 'lucide-react';
|
||||||
|
import { cn } from '@/lib/utils';
|
||||||
|
|
||||||
export default function LabeledInput({
|
export default function LabeledInput({
|
||||||
type,
|
type,
|
||||||
label,
|
label,
|
||||||
|
subtext,
|
||||||
placeholder,
|
placeholder,
|
||||||
value,
|
value,
|
||||||
|
defaultValue,
|
||||||
name,
|
name,
|
||||||
|
icon,
|
||||||
variantSize = 'default',
|
variantSize = 'default',
|
||||||
autocomplete,
|
autocomplete,
|
||||||
error,
|
error,
|
||||||
...rest
|
...rest
|
||||||
}: {
|
}: {
|
||||||
type: 'text' | 'email' | 'password';
|
|
||||||
label: string;
|
label: string;
|
||||||
|
subtext?: string;
|
||||||
placeholder?: string;
|
placeholder?: string;
|
||||||
value?: string;
|
value?: string;
|
||||||
name?: string;
|
name?: string;
|
||||||
|
icon?: ForwardRefExoticComponent<
|
||||||
|
Omit<LucideProps, 'ref'> & RefAttributes<SVGSVGElement>
|
||||||
|
>;
|
||||||
variantSize?: 'default' | 'big' | 'textarea';
|
variantSize?: 'default' | 'big' | 'textarea';
|
||||||
autocomplete?: string;
|
autocomplete?: string;
|
||||||
error?: string;
|
error?: string;
|
||||||
} & React.InputHTMLAttributes<HTMLInputElement>) {
|
} & React.InputHTMLAttributes<HTMLInputElement>) {
|
||||||
|
const [passwordVisible, setPasswordVisible] = React.useState(false);
|
||||||
|
const [inputValue, setInputValue] = React.useState(value || defaultValue || '');
|
||||||
|
|
||||||
|
const handleInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
|
setInputValue(e.target.value);
|
||||||
|
if (rest.onChange) {
|
||||||
|
rest.onChange(e);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='grid grid-cols-1 gap-1'>
|
<div className='grid grid-cols-1 gap-1'>
|
||||||
<Label htmlFor={name}>{label}</Label>
|
<Label htmlFor={name}>{label}</Label>
|
||||||
|
{subtext && (
|
||||||
|
<Label className='text-sm text-muted-foreground' htmlFor={name}>
|
||||||
|
{subtext}
|
||||||
|
</Label>
|
||||||
|
)}
|
||||||
{variantSize === 'textarea' ? (
|
{variantSize === 'textarea' ? (
|
||||||
<Textarea
|
<Textarea
|
||||||
placeholder={placeholder}
|
placeholder={placeholder}
|
||||||
|
@ -33,20 +58,48 @@ export default function LabeledInput({
|
||||||
rows={3}
|
rows={3}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<Input
|
<span className='relative'>
|
||||||
type={type}
|
<Input
|
||||||
placeholder={placeholder}
|
className={cn(
|
||||||
defaultValue={value}
|
type === 'password' ? 'pr-[50px]' : '',
|
||||||
id={name}
|
variantSize === 'big'
|
||||||
name={name}
|
? 'h-12 file:h-10 text-lg placeholder:text-lg sm:text-2xl sm:placeholder:text-2xl'
|
||||||
className={
|
: '',
|
||||||
variantSize === 'big'
|
icon && inputValue === '' ? 'pl-10' : '',
|
||||||
? 'h-12 file:h-10 text-lg gplaceholder:text-lg sm:text-2xl sm:placeholder:text-2xl'
|
'transition-all duration-300 ease-in-out',
|
||||||
: ''
|
)}
|
||||||
}
|
type={passwordVisible ? 'text' : type}
|
||||||
autoComplete={autocomplete}
|
placeholder={placeholder}
|
||||||
{...rest}
|
defaultValue={inputValue}
|
||||||
/>
|
id={name}
|
||||||
|
name={name}
|
||||||
|
autoComplete={autocomplete}
|
||||||
|
{...rest}
|
||||||
|
onChange={handleInputChange}
|
||||||
|
/>
|
||||||
|
{icon && (
|
||||||
|
<span
|
||||||
|
className={cn(
|
||||||
|
'absolute left-3 top-1/2 -translate-y-1/2 text-muted-input transition-all duration-300 ease-in-out',
|
||||||
|
inputValue === ''
|
||||||
|
? 'opacity-100 scale-100'
|
||||||
|
: 'opacity-0 scale-75 pointer-events-none',
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
{React.createElement(icon)}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
{type === 'password' && (
|
||||||
|
<Button
|
||||||
|
className='absolute right-0 top-0 w-[36px] h-[36px]'
|
||||||
|
type='button'
|
||||||
|
variant={'outline_muted'}
|
||||||
|
onClick={() => setPasswordVisible((visible) => !visible)}
|
||||||
|
>
|
||||||
|
{passwordVisible ? <Eye /> : <EyeOff />}
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
|
</span>
|
||||||
)}
|
)}
|
||||||
{error && <p className='text-red-500 text-sm mt-1'>{error}</p>}
|
{error && <p className='text-red-500 text-sm mt-1'>{error}</p>}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -4,11 +4,21 @@ import React, { useState, useRef } from 'react';
|
||||||
import { useRouter } from 'next/navigation';
|
import { useRouter } from 'next/navigation';
|
||||||
|
|
||||||
import LabeledInput from '@/components/custom-ui/labeled-input';
|
import LabeledInput from '@/components/custom-ui/labeled-input';
|
||||||
import { Button } from '@/components/ui/button';
|
|
||||||
import useZodForm from '@/lib/hooks/useZodForm';
|
import useZodForm from '@/lib/hooks/useZodForm';
|
||||||
import { loginSchema, registerSchema } from '@/lib/auth/validation';
|
import { loginSchema, registerSchema } from '@/lib/auth/validation';
|
||||||
import { loginAction } from '@/lib/auth/login';
|
import { loginAction } from '@/lib/auth/login';
|
||||||
import { registerAction } from '@/lib/auth/register';
|
import { registerAction } from '@/lib/auth/register';
|
||||||
|
import { IconButton } from '../buttons/icon-button';
|
||||||
|
import {
|
||||||
|
FileKey,
|
||||||
|
FileKey2,
|
||||||
|
LogIn,
|
||||||
|
MailOpen,
|
||||||
|
RotateCcwKey,
|
||||||
|
UserCheck,
|
||||||
|
UserPen,
|
||||||
|
UserPlus,
|
||||||
|
} from 'lucide-react';
|
||||||
|
|
||||||
function LoginFormElement({
|
function LoginFormElement({
|
||||||
setIsSignUp,
|
setIsSignUp,
|
||||||
|
@ -56,6 +66,7 @@ function LoginFormElement({
|
||||||
<LabeledInput
|
<LabeledInput
|
||||||
type='text'
|
type='text'
|
||||||
label='E-Mail or Username'
|
label='E-Mail or Username'
|
||||||
|
icon={UserCheck}
|
||||||
placeholder='What you are known as'
|
placeholder='What you are known as'
|
||||||
error={formState.errors.email?.message}
|
error={formState.errors.email?.message}
|
||||||
{...register('email')}
|
{...register('email')}
|
||||||
|
@ -64,16 +75,22 @@ function LoginFormElement({
|
||||||
<LabeledInput
|
<LabeledInput
|
||||||
type='password'
|
type='password'
|
||||||
label='Password'
|
label='Password'
|
||||||
|
icon={FileKey}
|
||||||
placeholder="Let's hope you remember it"
|
placeholder="Let's hope you remember it"
|
||||||
error={formState.errors.password?.message}
|
error={formState.errors.password?.message}
|
||||||
{...register('password')}
|
{...register('password')}
|
||||||
data-cy='password-input'
|
data-cy='password-input'
|
||||||
/>
|
/>
|
||||||
<div className='grid grid-rows-2 gap-2'>
|
<div className='grid grid-rows-2 gap-2'>
|
||||||
<Button type='submit' variant='primary' data-cy='login-button'>
|
<IconButton
|
||||||
|
type='submit'
|
||||||
|
variant='primary'
|
||||||
|
data-cy='login-button'
|
||||||
|
icon={LogIn}
|
||||||
|
>
|
||||||
Login
|
Login
|
||||||
</Button>
|
</IconButton>
|
||||||
<Button
|
<IconButton
|
||||||
type='button'
|
type='button'
|
||||||
variant='outline_primary'
|
variant='outline_primary'
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
@ -81,9 +98,10 @@ function LoginFormElement({
|
||||||
setIsSignUp((v) => !v);
|
setIsSignUp((v) => !v);
|
||||||
}}
|
}}
|
||||||
data-cy='register-switch'
|
data-cy='register-switch'
|
||||||
|
icon={UserPlus}
|
||||||
>
|
>
|
||||||
Sign Up
|
Sign Up
|
||||||
</Button>
|
</IconButton>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
{formState.errors.root?.message && (
|
{formState.errors.root?.message && (
|
||||||
|
@ -156,27 +174,30 @@ function RegisterFormElement({
|
||||||
{...register('lastName')}
|
{...register('lastName')}
|
||||||
data-cy='last-name-input'
|
data-cy='last-name-input'
|
||||||
/>
|
/>
|
||||||
<LabeledInput
|
|
||||||
type='email'
|
|
||||||
label='E-Mail'
|
|
||||||
placeholder='Your email address'
|
|
||||||
autocomplete='email'
|
|
||||||
error={formState.errors.email?.message}
|
|
||||||
{...register('email')}
|
|
||||||
data-cy='email-input'
|
|
||||||
/>
|
|
||||||
<LabeledInput
|
<LabeledInput
|
||||||
type='text'
|
type='text'
|
||||||
label='Username'
|
label='Username'
|
||||||
|
icon={UserPen}
|
||||||
placeholder='Your username'
|
placeholder='Your username'
|
||||||
autocomplete='username'
|
autocomplete='username'
|
||||||
error={formState.errors.username?.message}
|
error={formState.errors.username?.message}
|
||||||
{...register('username')}
|
{...register('username')}
|
||||||
data-cy='username-input'
|
data-cy='username-input'
|
||||||
/>
|
/>
|
||||||
|
<LabeledInput
|
||||||
|
type='email'
|
||||||
|
label='E-Mail'
|
||||||
|
icon={MailOpen}
|
||||||
|
placeholder='Your email address'
|
||||||
|
autocomplete='email'
|
||||||
|
error={formState.errors.email?.message}
|
||||||
|
{...register('email')}
|
||||||
|
data-cy='email-input'
|
||||||
|
/>
|
||||||
<LabeledInput
|
<LabeledInput
|
||||||
type='password'
|
type='password'
|
||||||
label='Password'
|
label='Password'
|
||||||
|
icon={FileKey2}
|
||||||
placeholder='Create a password'
|
placeholder='Create a password'
|
||||||
autocomplete='new-password'
|
autocomplete='new-password'
|
||||||
error={formState.errors.password?.message}
|
error={formState.errors.password?.message}
|
||||||
|
@ -186,6 +207,7 @@ function RegisterFormElement({
|
||||||
<LabeledInput
|
<LabeledInput
|
||||||
type='password'
|
type='password'
|
||||||
label='Confirm Password'
|
label='Confirm Password'
|
||||||
|
icon={RotateCcwKey}
|
||||||
placeholder='Repeat your password'
|
placeholder='Repeat your password'
|
||||||
autocomplete='new-password'
|
autocomplete='new-password'
|
||||||
error={formState.errors.confirmPassword?.message}
|
error={formState.errors.confirmPassword?.message}
|
||||||
|
@ -193,19 +215,25 @@ function RegisterFormElement({
|
||||||
data-cy='confirm-password-input'
|
data-cy='confirm-password-input'
|
||||||
/>
|
/>
|
||||||
<div className='grid grid-rows-2 gap-2'>
|
<div className='grid grid-rows-2 gap-2'>
|
||||||
<Button type='submit' variant='primary' data-cy='register-button'>
|
<IconButton
|
||||||
|
type='submit'
|
||||||
|
variant='primary'
|
||||||
|
data-cy='register-button'
|
||||||
|
icon={UserPlus}
|
||||||
|
>
|
||||||
Sign Up
|
Sign Up
|
||||||
</Button>
|
</IconButton>
|
||||||
<Button
|
<IconButton
|
||||||
type='button'
|
type='button'
|
||||||
variant='outline_primary'
|
variant='outline_primary'
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
formRef?.current?.reset();
|
formRef?.current?.reset();
|
||||||
setIsSignUp((v) => !v);
|
setIsSignUp((v) => !v);
|
||||||
}}
|
}}
|
||||||
|
icon={LogIn}
|
||||||
>
|
>
|
||||||
Back to Login
|
Back to Login
|
||||||
</Button>
|
</IconButton>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
{formState.errors.root?.message && (
|
{formState.errors.root?.message && (
|
||||||
|
|
35
src/components/misc/profile-picture-upload.tsx
Normal file
35
src/components/misc/profile-picture-upload.tsx
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
import Image from 'next/image';
|
||||||
|
import { Avatar } from '../ui/avatar';
|
||||||
|
import { useGetApiUserMe } from '@/generated/api/user/user';
|
||||||
|
import { User } from 'lucide-react';
|
||||||
|
|
||||||
|
import { Input } from '../ui/input';
|
||||||
|
|
||||||
|
export default function ProfilePictureUpload({
|
||||||
|
className,
|
||||||
|
}: {
|
||||||
|
className?: string;
|
||||||
|
}) {
|
||||||
|
const { data } = useGetApiUserMe();
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<div className='grid grid-cols-1 gap-1'>
|
||||||
|
<span className='relative flex space-6'>
|
||||||
|
<Input className={className} id='pic-upload' type='file' />
|
||||||
|
<Avatar className='flex justify-center items-center ml-6 shadow-md border h-[36px] w-[36px]'>
|
||||||
|
{data?.data.user.image ? (
|
||||||
|
<Image
|
||||||
|
src={data?.data.user.image}
|
||||||
|
alt='Avatar'
|
||||||
|
width='20'
|
||||||
|
height='20'
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<User />
|
||||||
|
)}
|
||||||
|
</Avatar>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
|
@ -21,7 +21,7 @@ export default function UserCard() {
|
||||||
)}
|
)}
|
||||||
</Avatar>
|
</Avatar>
|
||||||
<div className='flex justify-center'>{data?.data.user.name}</div>
|
<div className='flex justify-center'>{data?.data.user.name}</div>
|
||||||
<div className='flex justify-center text-text-muted'>
|
<div className='flex justify-center text-text-muted text-[12px]'>
|
||||||
{data?.data.user.email}
|
{data?.data.user.email}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -17,6 +17,7 @@ import UserCard from '@/components/misc/user-card';
|
||||||
|
|
||||||
export default function UserDropdown() {
|
export default function UserDropdown() {
|
||||||
const { data } = useGetApiUserMe();
|
const { data } = useGetApiUserMe();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<DropdownMenu>
|
<DropdownMenu>
|
||||||
<DropdownMenuTrigger asChild>
|
<DropdownMenuTrigger asChild>
|
||||||
|
@ -41,11 +42,13 @@ export default function UserDropdown() {
|
||||||
<UserCard />
|
<UserCard />
|
||||||
</DropdownMenuItem>
|
</DropdownMenuItem>
|
||||||
<DropdownMenuSeparator />
|
<DropdownMenuSeparator />
|
||||||
<DropdownMenuItem>Settings</DropdownMenuItem>
|
<Link href='/settings'>
|
||||||
|
<DropdownMenuItem>Settings</DropdownMenuItem>
|
||||||
|
</Link>
|
||||||
<DropdownMenuSeparator />
|
<DropdownMenuSeparator />
|
||||||
<DropdownMenuItem>
|
<Link href='/logout'>
|
||||||
<Link href='/logout'>Logout</Link>
|
<DropdownMenuItem>Logout</DropdownMenuItem>
|
||||||
</DropdownMenuItem>
|
</Link>
|
||||||
</DropdownMenuContent>
|
</DropdownMenuContent>
|
||||||
</DropdownMenu>
|
</DropdownMenu>
|
||||||
);
|
);
|
||||||
|
|
165
src/components/settings/settings-dropdown.tsx
Normal file
165
src/components/settings/settings-dropdown.tsx
Normal file
|
@ -0,0 +1,165 @@
|
||||||
|
'use client';
|
||||||
|
|
||||||
|
import type React from 'react';
|
||||||
|
|
||||||
|
import { useState } from 'react';
|
||||||
|
import { Button } from '@/components/ui/button';
|
||||||
|
import {
|
||||||
|
Command,
|
||||||
|
CommandEmpty,
|
||||||
|
CommandGroup,
|
||||||
|
CommandInput,
|
||||||
|
CommandItem,
|
||||||
|
CommandList,
|
||||||
|
} from '@/components/ui/command';
|
||||||
|
import {
|
||||||
|
Popover,
|
||||||
|
PopoverContent,
|
||||||
|
PopoverTrigger,
|
||||||
|
} from '@/components/ui/popover';
|
||||||
|
import { cn } from '@/lib/utils';
|
||||||
|
import {
|
||||||
|
Check,
|
||||||
|
ChevronDown,
|
||||||
|
User,
|
||||||
|
Bell,
|
||||||
|
Calendar,
|
||||||
|
Shield,
|
||||||
|
Palette,
|
||||||
|
Key,
|
||||||
|
} from 'lucide-react';
|
||||||
|
|
||||||
|
interface SettingsSection {
|
||||||
|
label: string;
|
||||||
|
value: string;
|
||||||
|
description: string;
|
||||||
|
icon: React.ComponentType<{ className?: string }>;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface SettingsDropdownProps {
|
||||||
|
currentSection: string;
|
||||||
|
onSectionChange: (section: string) => void;
|
||||||
|
className?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const settingsSections: SettingsSection[] = [
|
||||||
|
{
|
||||||
|
label: 'Account',
|
||||||
|
value: 'general',
|
||||||
|
description: 'Manage account details',
|
||||||
|
icon: User,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Password',
|
||||||
|
value: 'password',
|
||||||
|
description: 'Manage your password',
|
||||||
|
icon: Key,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Notifications',
|
||||||
|
value: 'notifications',
|
||||||
|
description: 'Choose notification Preferences',
|
||||||
|
icon: Bell,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Calendar',
|
||||||
|
value: 'calendarAvailability',
|
||||||
|
description: 'Manage calendar display, availability and iCal integration',
|
||||||
|
icon: Calendar,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Privacy',
|
||||||
|
value: 'sharingPrivacy',
|
||||||
|
description: 'Control who can see your calendar and book time with you',
|
||||||
|
icon: Shield,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Appearance',
|
||||||
|
value: 'appearance',
|
||||||
|
description: 'Customize the look and feel of the application',
|
||||||
|
icon: Palette,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
export function SettingsDropdown({
|
||||||
|
currentSection,
|
||||||
|
onSectionChange,
|
||||||
|
className,
|
||||||
|
}: SettingsDropdownProps) {
|
||||||
|
const [open, setOpen] = useState(false);
|
||||||
|
|
||||||
|
const currentSectionData = settingsSections.find(
|
||||||
|
(section) => section.value === currentSection,
|
||||||
|
);
|
||||||
|
const CurrentIcon = currentSectionData?.icon || User;
|
||||||
|
|
||||||
|
const handleSelect = (value: string) => {
|
||||||
|
onSectionChange(value);
|
||||||
|
setOpen(false);
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className={cn('w-full max-w-md', className)}>
|
||||||
|
<Popover open={open} onOpenChange={setOpen}>
|
||||||
|
<PopoverTrigger asChild>
|
||||||
|
<Button
|
||||||
|
variant='outline_muted'
|
||||||
|
role='combobox'
|
||||||
|
aria-expanded={open}
|
||||||
|
className='w-full justify-between bg-popover text-text h-auto py-3'
|
||||||
|
>
|
||||||
|
<div className='flex items-center gap-3'>
|
||||||
|
<CurrentIcon className='h-4 w-4 text-muted-foreground' />
|
||||||
|
<div className='flex flex-col items-start text-left'>
|
||||||
|
<span className='font-medium'>{currentSectionData?.label}</span>
|
||||||
|
<p className='text-xs text-muted-foreground text-wrap'>
|
||||||
|
{currentSectionData?.description}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<ChevronDown className='ml-2 h-4 w-4 shrink-0 opacity-50' />
|
||||||
|
</Button>
|
||||||
|
</PopoverTrigger>
|
||||||
|
<PopoverContent className='w-full p-0' align='start'>
|
||||||
|
<Command>
|
||||||
|
<CommandInput placeholder='Search settings...' />
|
||||||
|
<CommandList>
|
||||||
|
<CommandEmpty>No settings found.</CommandEmpty>
|
||||||
|
<CommandGroup>
|
||||||
|
{settingsSections.map((section) => {
|
||||||
|
const Icon = section.icon;
|
||||||
|
return (
|
||||||
|
<CommandItem
|
||||||
|
key={section.value}
|
||||||
|
value={section.value}
|
||||||
|
onSelect={() => handleSelect(section.value)}
|
||||||
|
className='flex items-center justify-between p-3'
|
||||||
|
>
|
||||||
|
<div className='flex items-center gap-3'>
|
||||||
|
<Icon className='h-4 w-4 text-muted-foreground' />
|
||||||
|
<div className='flex flex-col'>
|
||||||
|
<span className='font-medium'>{section.label}</span>
|
||||||
|
<p className='text-xs text-muted-foreground text-wrap'>
|
||||||
|
{section.description}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<Check
|
||||||
|
className={cn(
|
||||||
|
'ml-2 h-4 w-4',
|
||||||
|
currentSection === section.value
|
||||||
|
? 'opacity-100'
|
||||||
|
: 'opacity-0',
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
</CommandItem>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</CommandGroup>
|
||||||
|
</CommandList>
|
||||||
|
</Command>
|
||||||
|
</PopoverContent>
|
||||||
|
</Popover>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
59
src/components/settings/settings-page.tsx
Normal file
59
src/components/settings/settings-page.tsx
Normal file
|
@ -0,0 +1,59 @@
|
||||||
|
'use client';
|
||||||
|
|
||||||
|
import { useState } from 'react';
|
||||||
|
|
||||||
|
import { SettingsDropdown } from '@/components/settings/settings-dropdown';
|
||||||
|
|
||||||
|
import AccountTab from './tabs/account';
|
||||||
|
import NotificationsTab from './tabs/notifications';
|
||||||
|
import CalendarTab from './tabs/calendar';
|
||||||
|
import PrivacyTab from './tabs/privacy';
|
||||||
|
import AppearanceTab from './tabs/appearance';
|
||||||
|
import PasswordTab from './tabs/password';
|
||||||
|
|
||||||
|
export default function SettingsPage() {
|
||||||
|
const [currentSection, setCurrentSection] = useState('general');
|
||||||
|
|
||||||
|
const renderSettingsContent = () => {
|
||||||
|
switch (currentSection) {
|
||||||
|
case 'general':
|
||||||
|
return <AccountTab />;
|
||||||
|
|
||||||
|
case 'password':
|
||||||
|
return <PasswordTab />;
|
||||||
|
|
||||||
|
case 'notifications':
|
||||||
|
return <NotificationsTab />;
|
||||||
|
|
||||||
|
case 'calendarAvailability':
|
||||||
|
return <CalendarTab />;
|
||||||
|
|
||||||
|
case 'sharingPrivacy':
|
||||||
|
return <PrivacyTab />;
|
||||||
|
|
||||||
|
case 'appearance':
|
||||||
|
return <AppearanceTab />;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className='fixed inset-0 flex items-center justify-center p-4 bg-background/50 backdrop-blur-sm'>
|
||||||
|
<div className='rounded-lg border bg-card text-card-foreground shadow-xl max-w-[700px] w-full max-h-[calc(100vh-2rem)] flex flex-col'>
|
||||||
|
{/* TODO: Fix overflow */}
|
||||||
|
<div className='p-6 border-b'>
|
||||||
|
<div className='flex items-center justify-between mb-4'>
|
||||||
|
<h1 className='text-2xl font-semibold'>Settings</h1>
|
||||||
|
</div>
|
||||||
|
<SettingsDropdown
|
||||||
|
currentSection={currentSection}
|
||||||
|
onSectionChange={setCurrentSection}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
{renderSettingsContent()}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
263
src/components/settings/tabs/account.tsx
Normal file
263
src/components/settings/tabs/account.tsx
Normal file
|
@ -0,0 +1,263 @@
|
||||||
|
'use client';
|
||||||
|
|
||||||
|
import { Button } from '@/components/ui/button';
|
||||||
|
import {
|
||||||
|
Card,
|
||||||
|
CardContent,
|
||||||
|
CardFooter,
|
||||||
|
CardHeader,
|
||||||
|
CardTitle,
|
||||||
|
} from '@/components/ui/card';
|
||||||
|
|
||||||
|
import { Label } from '@/components/ui/label';
|
||||||
|
import { ScrollableSettingsWrapper } from '@/components/wrappers/settings-scroll';
|
||||||
|
import {
|
||||||
|
Select,
|
||||||
|
SelectContent,
|
||||||
|
SelectItem,
|
||||||
|
SelectTrigger,
|
||||||
|
SelectValue,
|
||||||
|
} from '@/components/ui/select';
|
||||||
|
import {
|
||||||
|
useDeleteApiUserMe,
|
||||||
|
useGetApiUserMe,
|
||||||
|
usePatchApiUserMe,
|
||||||
|
} from '@/generated/api/user/user';
|
||||||
|
import LabeledInput from '@/components/custom-ui/labeled-input';
|
||||||
|
import { GroupWrapper } from '@/components/wrappers/group-wrapper';
|
||||||
|
|
||||||
|
import ProfilePictureUpload from '@/components/misc/profile-picture-upload';
|
||||||
|
import { CalendarClock, MailOpen, UserPen } from 'lucide-react';
|
||||||
|
import {
|
||||||
|
Dialog,
|
||||||
|
DialogContent,
|
||||||
|
DialogDescription,
|
||||||
|
DialogHeader,
|
||||||
|
DialogTitle,
|
||||||
|
DialogTrigger,
|
||||||
|
} from '@/components/ui/dialog';
|
||||||
|
import useZodForm from '@/lib/hooks/useZodForm';
|
||||||
|
import { updateUserClientSchema } from '@/app/api/user/me/validation';
|
||||||
|
import { useRouter } from 'next/navigation';
|
||||||
|
|
||||||
|
export default function AccountTab() {
|
||||||
|
const router = useRouter();
|
||||||
|
const { data } = useGetApiUserMe();
|
||||||
|
const deleteUser = useDeleteApiUserMe();
|
||||||
|
const updateAccount = usePatchApiUserMe();
|
||||||
|
|
||||||
|
const { handleSubmit, formState, register, setError } = useZodForm(
|
||||||
|
updateUserClientSchema,
|
||||||
|
);
|
||||||
|
|
||||||
|
const onSubmit = handleSubmit(async (submitData) => {
|
||||||
|
await updateAccount.mutateAsync(
|
||||||
|
{
|
||||||
|
data: {
|
||||||
|
first_name:
|
||||||
|
submitData?.first_name !== data?.data.user.first_name
|
||||||
|
? submitData?.first_name
|
||||||
|
: undefined,
|
||||||
|
last_name:
|
||||||
|
submitData?.last_name !== data?.data.user.last_name
|
||||||
|
? submitData?.last_name
|
||||||
|
: undefined,
|
||||||
|
email:
|
||||||
|
submitData?.email !== data?.data.user.email
|
||||||
|
? submitData?.email
|
||||||
|
: undefined,
|
||||||
|
image:
|
||||||
|
submitData?.image !== data?.data.user.image
|
||||||
|
? submitData?.image
|
||||||
|
: undefined,
|
||||||
|
timezone:
|
||||||
|
submitData?.timezone !== data?.data.user.timezone
|
||||||
|
? submitData?.timezone
|
||||||
|
: undefined,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
onSuccess: () => {
|
||||||
|
router.refresh();
|
||||||
|
},
|
||||||
|
onError: (error) => {
|
||||||
|
if (error instanceof Error) {
|
||||||
|
setError('root', {
|
||||||
|
message: error.response?.data.message,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
setError('root', {
|
||||||
|
message: 'An unknown error occurred.',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!data) {
|
||||||
|
return (
|
||||||
|
<div className='fixed inset-0 flex items-center justify-center p-4 bg-background/50 backdrop-blur-sm'>
|
||||||
|
<div className='rounded-lg border bg-card text-card-foreground shadow-xl max-w-[700px] w-full h-auto max-h-[calc(100vh-2rem)] flex flex-col'>
|
||||||
|
<div className='p-6 border-b'>
|
||||||
|
<h1 className='text-2xl font-semibold'>Loading Settings...</h1>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<form onSubmit={onSubmit} className='h-full flex-grow overflow-auto'>
|
||||||
|
<Card className='pb-0 h-full flex flex-col border-0 shadow-none rounded-none'>
|
||||||
|
<ScrollableSettingsWrapper>
|
||||||
|
<CardHeader>
|
||||||
|
<CardTitle>Account Settings</CardTitle>
|
||||||
|
</CardHeader>
|
||||||
|
<CardContent className='space-y-6 my-2'>
|
||||||
|
{/*-------------------- General Settings --------------------*/}
|
||||||
|
<GroupWrapper title='General Settings'>
|
||||||
|
<div className='space-y-4'>
|
||||||
|
<div>
|
||||||
|
<LabeledInput
|
||||||
|
type='text'
|
||||||
|
label='First Name'
|
||||||
|
placeholder='First Name'
|
||||||
|
defaultValue={data.data.user.first_name ?? ''}
|
||||||
|
{...register('first_name')}
|
||||||
|
error={formState.errors.first_name?.message}
|
||||||
|
></LabeledInput>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<LabeledInput
|
||||||
|
type='text'
|
||||||
|
label='Last Name'
|
||||||
|
placeholder='Last Name'
|
||||||
|
defaultValue={data.data.user.last_name ?? ''}
|
||||||
|
{...register('last_name')}
|
||||||
|
error={formState.errors.last_name?.message}
|
||||||
|
></LabeledInput>
|
||||||
|
</div>
|
||||||
|
<div className='space-y-2'>
|
||||||
|
<LabeledInput
|
||||||
|
type='text'
|
||||||
|
label='Display Name'
|
||||||
|
icon={UserPen}
|
||||||
|
placeholder='Display Name'
|
||||||
|
defaultValue={data.data.user.name}
|
||||||
|
{...register('name')}
|
||||||
|
error={formState.errors.name?.message}
|
||||||
|
></LabeledInput>
|
||||||
|
</div>
|
||||||
|
<div className='space-y-2 space-b-2'>
|
||||||
|
<LabeledInput
|
||||||
|
type='email'
|
||||||
|
label='Email Address'
|
||||||
|
icon={MailOpen}
|
||||||
|
placeholder='Your E-Mail'
|
||||||
|
defaultValue={data.data.user.email ?? ''}
|
||||||
|
{...register('email')}
|
||||||
|
error={formState.errors.email?.message}
|
||||||
|
></LabeledInput>
|
||||||
|
|
||||||
|
<span className='text-sm text-muted-foreground'>
|
||||||
|
Email might be managed by your SSO provider.
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{formState.errors.root && (
|
||||||
|
<p className='text-red-500 text-sm mt-1'>
|
||||||
|
{formState.errors.root.message}
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
|
</GroupWrapper>
|
||||||
|
{/*-------------------- General Settings --------------------*/}
|
||||||
|
{/*-------------------- Profile Picture --------------------*/}
|
||||||
|
<GroupWrapper title='Profile Picture'>
|
||||||
|
<div className='space-y-2 grid grid-cols-[1fr_auto]'>
|
||||||
|
<ProfilePictureUpload />
|
||||||
|
</div>
|
||||||
|
</GroupWrapper>
|
||||||
|
{/*-------------------- Profile Picture --------------------*/}
|
||||||
|
{/*-------------------- Regional Settings --------------------*/}
|
||||||
|
<GroupWrapper title='Regional Settings'>
|
||||||
|
<div className='space-y-2 grid sm:grid-cols-[1fr_auto] sm:flex-row gap-4'>
|
||||||
|
<div className='grid gap-1'>
|
||||||
|
<LabeledInput
|
||||||
|
type='text'
|
||||||
|
label='Timezone'
|
||||||
|
placeholder='Europe/Berlin'
|
||||||
|
icon={CalendarClock}
|
||||||
|
defaultValue={data?.data.user.timezone ?? ''}
|
||||||
|
{...register('timezone')}
|
||||||
|
></LabeledInput>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<div className='grid gap-1'>
|
||||||
|
<Label htmlFor='language'>Language</Label>
|
||||||
|
<Select>
|
||||||
|
<SelectTrigger id='language'>
|
||||||
|
<SelectValue placeholder='Select language' />
|
||||||
|
</SelectTrigger>
|
||||||
|
<SelectContent>
|
||||||
|
<SelectItem value='en'>English</SelectItem>
|
||||||
|
<SelectItem value='de'>German</SelectItem>
|
||||||
|
</SelectContent>
|
||||||
|
</Select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</GroupWrapper>
|
||||||
|
{/*-------------------- Regional Settings --------------------*/}
|
||||||
|
{/*-------------------- DANGER ZONE --------------------*/}
|
||||||
|
<GroupWrapper title='DANGER ZONE' className='border-destructive'>
|
||||||
|
<div className='flex items-center justify-evenly sm:flex-row flex-col gap-6'>
|
||||||
|
<Dialog>
|
||||||
|
<DialogTrigger asChild>
|
||||||
|
<Button variant='destructive'>Delete Account</Button>
|
||||||
|
</DialogTrigger>
|
||||||
|
<DialogContent>
|
||||||
|
<DialogHeader>
|
||||||
|
<div className='space-y-4'>
|
||||||
|
<DialogTitle>Are you absolutely sure?</DialogTitle>
|
||||||
|
<div className='space-y-4'>
|
||||||
|
<DialogDescription>
|
||||||
|
This action cannot be undone. This will permanently
|
||||||
|
delete your account and remove your data from our
|
||||||
|
servers.
|
||||||
|
</DialogDescription>
|
||||||
|
<Button
|
||||||
|
variant='destructive'
|
||||||
|
onClick={() => {
|
||||||
|
deleteUser.mutate(undefined, {
|
||||||
|
onSuccess: () => {
|
||||||
|
router.push('/api/logout');
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Confirm Delete
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</DialogHeader>
|
||||||
|
</DialogContent>
|
||||||
|
</Dialog>
|
||||||
|
<span className='text-sm text-muted-foreground pt-1'>
|
||||||
|
Permanently delete your account and all associated data.
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</GroupWrapper>
|
||||||
|
{/*-------------------- DANGER ZONE --------------------*/}
|
||||||
|
</CardContent>
|
||||||
|
</ScrollableSettingsWrapper>
|
||||||
|
<CardFooter className='border-t h-[60px] flex content-center justify-between'>
|
||||||
|
<Button onClick={() => router.back()} variant='secondary'>
|
||||||
|
Exit
|
||||||
|
</Button>
|
||||||
|
<Button variant='primary'>Save Changes</Button>
|
||||||
|
</CardFooter>
|
||||||
|
</Card>
|
||||||
|
</form>
|
||||||
|
);
|
||||||
|
}
|
51
src/components/settings/tabs/appearance.tsx
Normal file
51
src/components/settings/tabs/appearance.tsx
Normal file
|
@ -0,0 +1,51 @@
|
||||||
|
'use client';
|
||||||
|
|
||||||
|
import { Button } from '@/components/ui/button';
|
||||||
|
import {
|
||||||
|
Card,
|
||||||
|
CardContent,
|
||||||
|
CardFooter,
|
||||||
|
CardHeader,
|
||||||
|
CardTitle,
|
||||||
|
} from '@/components/ui/card';
|
||||||
|
|
||||||
|
import { Label } from '@/components/ui/label';
|
||||||
|
import { ScrollableSettingsWrapper } from '@/components/wrappers/settings-scroll';
|
||||||
|
import { GroupWrapper } from '@/components/wrappers/group-wrapper';
|
||||||
|
import { useRouter } from 'next/navigation';
|
||||||
|
import { ThemePicker } from '@/components/misc/theme-picker';
|
||||||
|
|
||||||
|
export default function AppearanceTab() {
|
||||||
|
const router = useRouter();
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<div className='flex-grow overflow-auto'>
|
||||||
|
<Card className='h-full flex flex-col border-0 shadow-none rounded-none'>
|
||||||
|
<ScrollableSettingsWrapper>
|
||||||
|
<CardHeader>
|
||||||
|
<CardTitle>Appearance</CardTitle>
|
||||||
|
</CardHeader>
|
||||||
|
<CardContent className='space-y-6 my-2'>
|
||||||
|
{/*-------------------- Change Theme --------------------*/}
|
||||||
|
<GroupWrapper title='Change Theme'>
|
||||||
|
<div className='space-y-2'>
|
||||||
|
<Label htmlFor='theme'>Theme</Label>
|
||||||
|
<ThemePicker />
|
||||||
|
</div>
|
||||||
|
</GroupWrapper>
|
||||||
|
{/*-------------------- Change Theme --------------------*/}
|
||||||
|
</CardContent>
|
||||||
|
</ScrollableSettingsWrapper>
|
||||||
|
</Card>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<CardFooter className='border-t h-[60px] flex content-center justify-between'>
|
||||||
|
<Button onClick={() => router.back()} variant='secondary'>
|
||||||
|
Exit
|
||||||
|
</Button>
|
||||||
|
<Button variant='primary'>Save Changes</Button>
|
||||||
|
</CardFooter>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
216
src/components/settings/tabs/calendar.tsx
Normal file
216
src/components/settings/tabs/calendar.tsx
Normal file
|
@ -0,0 +1,216 @@
|
||||||
|
'use client';
|
||||||
|
|
||||||
|
import { Button } from '@/components/ui/button';
|
||||||
|
import {
|
||||||
|
Card,
|
||||||
|
CardContent,
|
||||||
|
CardFooter,
|
||||||
|
CardHeader,
|
||||||
|
CardTitle,
|
||||||
|
} from '@/components/ui/card';
|
||||||
|
|
||||||
|
import { Label } from '@/components/ui/label';
|
||||||
|
import { ScrollableSettingsWrapper } from '@/components/wrappers/settings-scroll';
|
||||||
|
import {
|
||||||
|
Select,
|
||||||
|
SelectContent,
|
||||||
|
SelectItem,
|
||||||
|
SelectTrigger,
|
||||||
|
SelectValue,
|
||||||
|
} from '@/components/ui/select';
|
||||||
|
import { GroupWrapper } from '@/components/wrappers/group-wrapper';
|
||||||
|
import { Switch } from '@/components/ui/switch';
|
||||||
|
import { useRouter } from 'next/navigation';
|
||||||
|
import LabeledInput from '@/components/custom-ui/labeled-input';
|
||||||
|
import {
|
||||||
|
CalendarArrowDown,
|
||||||
|
CalendarArrowUp,
|
||||||
|
CalendarCheck,
|
||||||
|
CalendarPlus,
|
||||||
|
ClockAlert,
|
||||||
|
ClockFading,
|
||||||
|
} from 'lucide-react';
|
||||||
|
import { IconButton } from '@/components/buttons/icon-button';
|
||||||
|
|
||||||
|
export default function CalendarTab() {
|
||||||
|
const router = useRouter();
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<div className='flex-grow overflow-auto'>
|
||||||
|
<Card className='h-full flex flex-col border-0 shadow-none rounded-none'>
|
||||||
|
<ScrollableSettingsWrapper>
|
||||||
|
<CardHeader>
|
||||||
|
<CardTitle>Calendar & Availability</CardTitle>
|
||||||
|
</CardHeader>
|
||||||
|
<CardContent className='space-y-6 my-2'>
|
||||||
|
{/*-------------------- Date & Time Format --------------------*/}
|
||||||
|
<GroupWrapper title='Date & Time Format'>
|
||||||
|
<div className='flex flex-col space-y-4'>
|
||||||
|
<div className='grid grid-cols-1 gap-1'>
|
||||||
|
<Label htmlFor='dateFormat'>Date Format</Label>
|
||||||
|
<Select>
|
||||||
|
<SelectTrigger id='dateFormat'>
|
||||||
|
<SelectValue placeholder='Select date format' />
|
||||||
|
</SelectTrigger>
|
||||||
|
<SelectContent>
|
||||||
|
<SelectItem value='ddmmyyyy'>DD/MM/YYYY</SelectItem>
|
||||||
|
<SelectItem value='mmddyyyy'>MM/DD/YYYY</SelectItem>
|
||||||
|
<SelectItem value='yyyymmdd'>YYYY-MM-DD</SelectItem>
|
||||||
|
</SelectContent>
|
||||||
|
</Select>
|
||||||
|
</div>
|
||||||
|
<div className='grid grid-cols-1 gap-1'>
|
||||||
|
<Label htmlFor='timeFormat'>Time Format</Label>
|
||||||
|
<Select>
|
||||||
|
<SelectTrigger id='timeFormat'>
|
||||||
|
<SelectValue placeholder='Select time format' />
|
||||||
|
</SelectTrigger>
|
||||||
|
<SelectContent>
|
||||||
|
<SelectItem value='24h'>24-hour</SelectItem>
|
||||||
|
<SelectItem value='12h'>12-hour</SelectItem>
|
||||||
|
</SelectContent>
|
||||||
|
</Select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</GroupWrapper>
|
||||||
|
{/*-------------------- Date & Time Format --------------------*/}
|
||||||
|
{/*-------------------- Calendar --------------------*/}
|
||||||
|
<GroupWrapper title='Calendar'>
|
||||||
|
<div className='space-y-4'>
|
||||||
|
<div className='grid grid-cols-1 gap-1'>
|
||||||
|
<Label htmlFor='defaultCalendarView'>
|
||||||
|
Default Calendar View
|
||||||
|
</Label>
|
||||||
|
<Select>
|
||||||
|
<SelectTrigger id='defaultCalendarView'>
|
||||||
|
<SelectValue placeholder='Select view' />
|
||||||
|
</SelectTrigger>
|
||||||
|
<SelectContent>
|
||||||
|
<SelectItem value='day'>Day</SelectItem>
|
||||||
|
<SelectItem value='week'>Week</SelectItem>
|
||||||
|
<SelectItem value='month'>Month</SelectItem>
|
||||||
|
</SelectContent>
|
||||||
|
</Select>
|
||||||
|
</div>
|
||||||
|
<div className='grid grid-cols-1 gap-1'>
|
||||||
|
<Label htmlFor='weekStartsOn'>Week Starts On</Label>
|
||||||
|
<Select>
|
||||||
|
<SelectTrigger id='weekStartsOn'>
|
||||||
|
<SelectValue placeholder='Select day' />
|
||||||
|
</SelectTrigger>
|
||||||
|
<SelectContent>
|
||||||
|
<SelectItem value='sunday'>Sunday</SelectItem>
|
||||||
|
<SelectItem value='monday'>Monday</SelectItem>
|
||||||
|
</SelectContent>
|
||||||
|
</Select>
|
||||||
|
</div>
|
||||||
|
<div className='flex items-center justify-between space-x-2'>
|
||||||
|
<Label htmlFor='showWeekends' className='font-normal'>
|
||||||
|
Show Weekends
|
||||||
|
</Label>
|
||||||
|
<Switch id='showWeekends' defaultChecked />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</GroupWrapper>
|
||||||
|
{/*-------------------- Calendar --------------------*/}
|
||||||
|
{/*-------------------- Availability --------------------*/}
|
||||||
|
<GroupWrapper title='Availability'>
|
||||||
|
<div className='space-y-4'>
|
||||||
|
<div className='space-y-2'>
|
||||||
|
<Label>Working Hours</Label>
|
||||||
|
<span className='text-sm text-muted-foreground'>
|
||||||
|
Define your typical available hours (e.g., Monday-Friday,
|
||||||
|
9 AM - 5 PM).
|
||||||
|
</span>
|
||||||
|
<Button variant='outline_muted' size='sm'>
|
||||||
|
Set Working Hours
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
<div className='space-y-2'>
|
||||||
|
<LabeledInput
|
||||||
|
type='text'
|
||||||
|
label='Minimum Notice for Bookings'
|
||||||
|
icon={ClockAlert}
|
||||||
|
subtext='Min time before a booking can be made.'
|
||||||
|
placeholder='e.g. 1h'
|
||||||
|
defaultValue={''}
|
||||||
|
></LabeledInput>
|
||||||
|
</div>
|
||||||
|
<div className='space-y-2'>
|
||||||
|
<LabeledInput
|
||||||
|
type='text'
|
||||||
|
label='Booking Window (days in advance)'
|
||||||
|
icon={ClockFading}
|
||||||
|
subtext='Max time in advance a booking can be made.'
|
||||||
|
placeholder='e.g. 30d'
|
||||||
|
defaultValue={''}
|
||||||
|
></LabeledInput>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</GroupWrapper>
|
||||||
|
{/*-------------------- Availability --------------------*/}
|
||||||
|
{/*-------------------- iCalendar Integration --------------------*/}
|
||||||
|
<GroupWrapper title='iCalendar Integration'>
|
||||||
|
<div className='space-y-4'>
|
||||||
|
<form
|
||||||
|
onSubmit={(e) => {
|
||||||
|
e.preventDefault();
|
||||||
|
}}
|
||||||
|
className='space-y-2'
|
||||||
|
>
|
||||||
|
<LabeledInput
|
||||||
|
type='url'
|
||||||
|
label='Import iCal Feed URL'
|
||||||
|
icon={CalendarCheck}
|
||||||
|
placeholder='https://calendar.example.com/feed.ics'
|
||||||
|
defaultValue={''}
|
||||||
|
name='icalUrl'
|
||||||
|
required
|
||||||
|
></LabeledInput>
|
||||||
|
<IconButton
|
||||||
|
type='submit'
|
||||||
|
size='sm'
|
||||||
|
className='mt-1'
|
||||||
|
variant={'secondary'}
|
||||||
|
icon={CalendarPlus}
|
||||||
|
title='Submit iCal URL'
|
||||||
|
>
|
||||||
|
Add Feed
|
||||||
|
</IconButton>
|
||||||
|
</form>
|
||||||
|
<div className='space-y-2'>
|
||||||
|
<Label>Export Your Calendar</Label>
|
||||||
|
<IconButton
|
||||||
|
variant='outline_muted'
|
||||||
|
size='sm'
|
||||||
|
icon={CalendarArrowUp}
|
||||||
|
>
|
||||||
|
Get iCal Export URL
|
||||||
|
</IconButton>
|
||||||
|
<IconButton
|
||||||
|
variant='outline_muted'
|
||||||
|
size='sm'
|
||||||
|
className='ml-2'
|
||||||
|
icon={CalendarArrowDown}
|
||||||
|
>
|
||||||
|
Download .ics File
|
||||||
|
</IconButton>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</GroupWrapper>
|
||||||
|
{/*-------------------- iCalendar Integration --------------------*/}
|
||||||
|
</CardContent>
|
||||||
|
</ScrollableSettingsWrapper>
|
||||||
|
</Card>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<CardFooter className='border-t h-[60px] flex content-center justify-between'>
|
||||||
|
<Button onClick={() => router.back()} variant='secondary'>
|
||||||
|
Exit
|
||||||
|
</Button>
|
||||||
|
<Button variant='primary'>Save Changes</Button>
|
||||||
|
</CardFooter>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
130
src/components/settings/tabs/notifications.tsx
Normal file
130
src/components/settings/tabs/notifications.tsx
Normal file
|
@ -0,0 +1,130 @@
|
||||||
|
'use client';
|
||||||
|
|
||||||
|
import { Button } from '@/components/ui/button';
|
||||||
|
import {
|
||||||
|
Card,
|
||||||
|
CardContent,
|
||||||
|
CardFooter,
|
||||||
|
CardHeader,
|
||||||
|
CardTitle,
|
||||||
|
} from '@/components/ui/card';
|
||||||
|
|
||||||
|
import { Label } from '@/components/ui/label';
|
||||||
|
import { ScrollableSettingsWrapper } from '@/components/wrappers/settings-scroll';
|
||||||
|
import {
|
||||||
|
Select,
|
||||||
|
SelectContent,
|
||||||
|
SelectItem,
|
||||||
|
SelectTrigger,
|
||||||
|
SelectValue,
|
||||||
|
} from '@/components/ui/select';
|
||||||
|
import { GroupWrapper } from '@/components/wrappers/group-wrapper';
|
||||||
|
import { Switch } from '@/components/ui/switch';
|
||||||
|
import { useRouter } from 'next/navigation';
|
||||||
|
|
||||||
|
export default function NotificationsTab() {
|
||||||
|
const router = useRouter();
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<div className='flex-grow overflow-auto'>
|
||||||
|
<Card className='h-full flex flex-col border-0 shadow-none rounded-none'>
|
||||||
|
<ScrollableSettingsWrapper>
|
||||||
|
<CardHeader>
|
||||||
|
<CardTitle>Notification Preferences</CardTitle>
|
||||||
|
</CardHeader>
|
||||||
|
<CardContent className='space-y-6 my-2'>
|
||||||
|
{/*-------------------- All --------------------*/}
|
||||||
|
<GroupWrapper title='All'>
|
||||||
|
<div className='flex items-center justify-between'>
|
||||||
|
<Label
|
||||||
|
htmlFor='masterEmailNotifications'
|
||||||
|
className='font-normal'
|
||||||
|
>
|
||||||
|
Enable All Email Notifications
|
||||||
|
</Label>
|
||||||
|
<Switch id='masterEmailNotifications' />
|
||||||
|
</div>
|
||||||
|
</GroupWrapper>
|
||||||
|
{/*-------------------- All --------------------*/}
|
||||||
|
{/*-------------------- Meetings --------------------*/}
|
||||||
|
<GroupWrapper title='Meetings'>
|
||||||
|
<div className='space-y-4'>
|
||||||
|
<div className='flex items-center justify-between space-x-2'>
|
||||||
|
<Label htmlFor='newMeetingBookings' className='font-normal'>
|
||||||
|
New Meeting Bookings
|
||||||
|
</Label>
|
||||||
|
<Switch id='newMeetingBookings' />
|
||||||
|
</div>
|
||||||
|
<div className='flex items-center justify-between space-x-2'>
|
||||||
|
<Label
|
||||||
|
htmlFor='meetingConfirmations'
|
||||||
|
className='font-normal'
|
||||||
|
>
|
||||||
|
Meeting Confirmations/Cancellations
|
||||||
|
</Label>
|
||||||
|
<Switch id='meetingConfirmations' />
|
||||||
|
</div>
|
||||||
|
<div className='flex items-center justify-between space-x-2'>
|
||||||
|
<Label
|
||||||
|
htmlFor='enableMeetingReminders'
|
||||||
|
className='font-normal'
|
||||||
|
>
|
||||||
|
Meeting Reminders
|
||||||
|
</Label>
|
||||||
|
<div>
|
||||||
|
<Switch id='enableMeetingReminders' />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className='flex items-center justify-between space-x-2'>
|
||||||
|
<Label className='font-normal' htmlFor='remindBefore'>
|
||||||
|
Remind me before
|
||||||
|
</Label>
|
||||||
|
<Select>
|
||||||
|
<SelectTrigger id='remindBefore'>
|
||||||
|
<SelectValue placeholder='Select reminder time' />
|
||||||
|
</SelectTrigger>
|
||||||
|
<SelectContent>
|
||||||
|
<SelectItem value='15m'>15 minutes</SelectItem>
|
||||||
|
<SelectItem value='30m'>30 minutes</SelectItem>
|
||||||
|
<SelectItem value='1h'>1 hour</SelectItem>
|
||||||
|
<SelectItem value='1d'>1 day</SelectItem>
|
||||||
|
</SelectContent>
|
||||||
|
</Select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</GroupWrapper>
|
||||||
|
{/*-------------------- Meetings --------------------*/}
|
||||||
|
{/*-------------------- Social --------------------*/}
|
||||||
|
<GroupWrapper title='Social'>
|
||||||
|
<div className='space-y-4'>
|
||||||
|
<div className='flex items-center justify-between space-x-2'>
|
||||||
|
<Label htmlFor='friendRequests' className='font-normal'>
|
||||||
|
Friend Requests
|
||||||
|
</Label>
|
||||||
|
<Switch id='friendRequests' />
|
||||||
|
</div>
|
||||||
|
<div className='flex items-center justify-between space-x-2'>
|
||||||
|
<Label htmlFor='groupUpdates' className='font-normal'>
|
||||||
|
Group Invitations/Updates
|
||||||
|
</Label>
|
||||||
|
<Switch id='groupUpdates' />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</GroupWrapper>
|
||||||
|
{/*-------------------- Social --------------------*/}
|
||||||
|
</CardContent>
|
||||||
|
</ScrollableSettingsWrapper>
|
||||||
|
</Card>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<CardFooter className='border-t h-[60px] flex content-center justify-between'>
|
||||||
|
<Button onClick={() => router.back()} variant='secondary'>
|
||||||
|
Exit
|
||||||
|
</Button>
|
||||||
|
<Button variant='primary'>Save Changes</Button>
|
||||||
|
</CardFooter>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
147
src/components/settings/tabs/password.tsx
Normal file
147
src/components/settings/tabs/password.tsx
Normal file
|
@ -0,0 +1,147 @@
|
||||||
|
'use client';
|
||||||
|
|
||||||
|
import { Button } from '@/components/ui/button';
|
||||||
|
import {
|
||||||
|
Card,
|
||||||
|
CardContent,
|
||||||
|
CardFooter,
|
||||||
|
CardHeader,
|
||||||
|
CardTitle,
|
||||||
|
} from '@/components/ui/card';
|
||||||
|
|
||||||
|
import { ScrollableSettingsWrapper } from '@/components/wrappers/settings-scroll';
|
||||||
|
import {
|
||||||
|
useGetApiUserMe,
|
||||||
|
usePatchApiUserMePassword,
|
||||||
|
} from '@/generated/api/user/user';
|
||||||
|
import LabeledInput from '@/components/custom-ui/labeled-input';
|
||||||
|
import { GroupWrapper } from '@/components/wrappers/group-wrapper';
|
||||||
|
|
||||||
|
import { BookKey, FileKey, FileKey2, RotateCcwKey } from 'lucide-react';
|
||||||
|
import useZodForm from '@/lib/hooks/useZodForm';
|
||||||
|
import { updateUserPasswordServerSchema } from '@/app/api/user/me/validation';
|
||||||
|
import { useRouter } from 'next/navigation';
|
||||||
|
|
||||||
|
export default function PasswordTab() {
|
||||||
|
const router = useRouter();
|
||||||
|
const { data } = useGetApiUserMe();
|
||||||
|
const updatePassword = usePatchApiUserMePassword();
|
||||||
|
|
||||||
|
const { handleSubmit, formState, register, setError } = useZodForm(
|
||||||
|
updateUserPasswordServerSchema,
|
||||||
|
);
|
||||||
|
|
||||||
|
const onSubmit = handleSubmit(async (data) => {
|
||||||
|
await updatePassword.mutateAsync(
|
||||||
|
{
|
||||||
|
data: data,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
onSuccess: () => {
|
||||||
|
router.refresh();
|
||||||
|
},
|
||||||
|
onError: (error) => {
|
||||||
|
if (error instanceof Error) {
|
||||||
|
setError('root', {
|
||||||
|
message: error.response?.data.message,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
setError('root', {
|
||||||
|
message: 'An unknown error occurred.',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!data) {
|
||||||
|
return (
|
||||||
|
<div className='fixed inset-0 flex items-center justify-center p-4 bg-background/50 backdrop-blur-sm'>
|
||||||
|
<div className='rounded-lg border bg-card text-card-foreground shadow-xl max-w-[700px] w-full h-auto max-h-[calc(100vh-2rem)] flex flex-col'>
|
||||||
|
<div className='p-6 border-b'>
|
||||||
|
<h1 className='text-2xl font-semibold'>Loading Settings...</h1>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<form onSubmit={onSubmit}>
|
||||||
|
<div className='flex-grow overflow-auto'>
|
||||||
|
<Card className='h-full flex flex-col border-0 shadow-none rounded-none'>
|
||||||
|
<ScrollableSettingsWrapper>
|
||||||
|
<CardHeader>
|
||||||
|
<CardTitle>Password Settings</CardTitle>
|
||||||
|
</CardHeader>
|
||||||
|
<CardContent className='space-y-6 my-2'>
|
||||||
|
{/*-------------------- Reset Password --------------------*/}
|
||||||
|
<GroupWrapper title='Reset Password'>
|
||||||
|
<div className='flex flex-col items-center gap-6'>
|
||||||
|
<div className='flex flex-col sm:flex-row gap-6 w-full'>
|
||||||
|
<div className='flex-1'>
|
||||||
|
<LabeledInput
|
||||||
|
type='password'
|
||||||
|
label='Current Password'
|
||||||
|
icon={FileKey}
|
||||||
|
{...register('current_password')}
|
||||||
|
error={formState.errors.current_password?.message}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div className='flex-1'>
|
||||||
|
<LabeledInput
|
||||||
|
type='password'
|
||||||
|
label='New Password'
|
||||||
|
icon={FileKey2}
|
||||||
|
{...register('new_password')}
|
||||||
|
error={formState.errors.new_password?.message}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div className='flex-1'>
|
||||||
|
<LabeledInput
|
||||||
|
type='password'
|
||||||
|
label='Repeat Password'
|
||||||
|
icon={RotateCcwKey}
|
||||||
|
{...register('confirm_new_password')}
|
||||||
|
error={formState.errors.confirm_new_password?.message}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div className='flex items-end'>
|
||||||
|
<Button
|
||||||
|
variant={
|
||||||
|
formState.isValid
|
||||||
|
? 'outline_secondary'
|
||||||
|
: 'outline_muted'
|
||||||
|
}
|
||||||
|
size='icon'
|
||||||
|
className='w-full md:size-9'
|
||||||
|
disabled={!formState.isValid || formState.isSubmitting}
|
||||||
|
>
|
||||||
|
<BookKey className='h-[1.2rem] w-[1.2rem]' />
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{formState.errors.root && (
|
||||||
|
<p className='text-red-500 text-sm mt-1'>
|
||||||
|
{formState.errors.root.message}
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</GroupWrapper>
|
||||||
|
{/*-------------------- Reset Password --------------------*/}
|
||||||
|
</CardContent>
|
||||||
|
</ScrollableSettingsWrapper>
|
||||||
|
</Card>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<CardFooter className='border-t h-[60px] flex content-center justify-between'>
|
||||||
|
<Button onClick={() => router.back()} variant='secondary'>
|
||||||
|
Exit
|
||||||
|
</Button>
|
||||||
|
<Button variant='primary'>Save Changes</Button>
|
||||||
|
</CardFooter>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
);
|
||||||
|
}
|
138
src/components/settings/tabs/privacy.tsx
Normal file
138
src/components/settings/tabs/privacy.tsx
Normal file
|
@ -0,0 +1,138 @@
|
||||||
|
'use client';
|
||||||
|
|
||||||
|
import { Button } from '@/components/ui/button';
|
||||||
|
import {
|
||||||
|
Card,
|
||||||
|
CardContent,
|
||||||
|
CardFooter,
|
||||||
|
CardHeader,
|
||||||
|
CardTitle,
|
||||||
|
} from '@/components/ui/card';
|
||||||
|
|
||||||
|
import { Label } from '@/components/ui/label';
|
||||||
|
import { ScrollableSettingsWrapper } from '@/components/wrappers/settings-scroll';
|
||||||
|
import {
|
||||||
|
Select,
|
||||||
|
SelectContent,
|
||||||
|
SelectItem,
|
||||||
|
SelectTrigger,
|
||||||
|
SelectValue,
|
||||||
|
} from '@/components/ui/select';
|
||||||
|
import { GroupWrapper } from '@/components/wrappers/group-wrapper';
|
||||||
|
import { useRouter } from 'next/navigation';
|
||||||
|
import { IconButton } from '@/components/buttons/icon-button';
|
||||||
|
import { UserLock } from 'lucide-react';
|
||||||
|
|
||||||
|
export default function PrivacyTab() {
|
||||||
|
const router = useRouter();
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<div className='flex-grow overflow-auto'>
|
||||||
|
<Card className='h-full flex flex-col border-0 shadow-none rounded-none'>
|
||||||
|
<ScrollableSettingsWrapper>
|
||||||
|
<CardHeader>
|
||||||
|
<CardTitle>Sharing & Privacy</CardTitle>
|
||||||
|
</CardHeader>
|
||||||
|
<CardContent className='space-y-6 my-2'>
|
||||||
|
{/*-------------------- Privacy Settigs --------------------*/}
|
||||||
|
<GroupWrapper title='Privacy Settings'>
|
||||||
|
<div className='flex flex-col space-y-4'>
|
||||||
|
<div className='grid grid-cols-1 gap-1'>
|
||||||
|
<Label htmlFor='defaultVisibility'>
|
||||||
|
Default Calendar Visibility
|
||||||
|
</Label>
|
||||||
|
<span className='text-sm text-muted-foreground'>
|
||||||
|
Default setting for new friends.
|
||||||
|
</span>
|
||||||
|
<Select>
|
||||||
|
<SelectTrigger id='defaultVisibility'>
|
||||||
|
<SelectValue placeholder='Select visibility' />
|
||||||
|
</SelectTrigger>
|
||||||
|
<SelectContent>
|
||||||
|
<SelectItem value='private'>
|
||||||
|
Private (Only You)
|
||||||
|
</SelectItem>
|
||||||
|
<SelectItem value='freebusy'>Free/Busy</SelectItem>
|
||||||
|
<SelectItem value='fulldetails'>
|
||||||
|
Full Details
|
||||||
|
</SelectItem>
|
||||||
|
</SelectContent>
|
||||||
|
</Select>
|
||||||
|
</div>
|
||||||
|
<div className='grid grid-cols-1 gap-1'>
|
||||||
|
<Label htmlFor='whoCanSeeFull'>
|
||||||
|
Who Can See Your Full Calendar Details?
|
||||||
|
</Label>
|
||||||
|
<span className='text-sm text-muted-foreground'>
|
||||||
|
(Override for Default Visibility)
|
||||||
|
<br />
|
||||||
|
<span className='text-sm text-muted-foreground'>
|
||||||
|
This setting will override the default visibility for
|
||||||
|
your calendar. You can set specific friends or groups to
|
||||||
|
see your full calendar details.
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
<Select>
|
||||||
|
<SelectTrigger id='whoCanSeeFull'>
|
||||||
|
<SelectValue placeholder='Select audience' />
|
||||||
|
</SelectTrigger>
|
||||||
|
<SelectContent>
|
||||||
|
<SelectItem value='me'>Only Me</SelectItem>
|
||||||
|
<SelectItem value='friends'>My Friends</SelectItem>
|
||||||
|
<SelectItem value='specific'>
|
||||||
|
Specific Friends/Groups (manage separately)
|
||||||
|
</SelectItem>
|
||||||
|
</SelectContent>
|
||||||
|
</Select>
|
||||||
|
</div>
|
||||||
|
<div className='grid grid-cols-1 gap-1'>
|
||||||
|
<Label htmlFor='whoCanBook'>
|
||||||
|
Who Can Book Time With You?
|
||||||
|
</Label>
|
||||||
|
<Select>
|
||||||
|
<SelectTrigger id='whoCanBook'>
|
||||||
|
<SelectValue placeholder='Select audience' />
|
||||||
|
</SelectTrigger>
|
||||||
|
<SelectContent>
|
||||||
|
<SelectItem value='none'>No One</SelectItem>
|
||||||
|
<SelectItem value='friends'>My Friends</SelectItem>
|
||||||
|
<SelectItem value='specific'>
|
||||||
|
Specific Friends/Groups (manage separately)
|
||||||
|
</SelectItem>
|
||||||
|
</SelectContent>
|
||||||
|
</Select>
|
||||||
|
</div>
|
||||||
|
<div className='space-y-4'>
|
||||||
|
<div className='grid grid-cols-1 gap-1'>
|
||||||
|
<Label>Blocked Users</Label>
|
||||||
|
<span className='text-sm text-muted-foreground'>
|
||||||
|
Prevent specific users from seeing your calendar or
|
||||||
|
booking time.
|
||||||
|
</span>
|
||||||
|
<IconButton
|
||||||
|
variant='outline_muted'
|
||||||
|
size='sm'
|
||||||
|
icon={UserLock}
|
||||||
|
>
|
||||||
|
Manage Blocked Users
|
||||||
|
</IconButton>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</GroupWrapper>
|
||||||
|
{/*-------------------- Privacy Settigs --------------------*/}
|
||||||
|
</CardContent>
|
||||||
|
</ScrollableSettingsWrapper>
|
||||||
|
</Card>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<CardFooter className='border-t h-[60px] flex content-center justify-between'>
|
||||||
|
<Button onClick={() => router.back()} variant='secondary'>
|
||||||
|
Exit
|
||||||
|
</Button>
|
||||||
|
<Button variant='primary'>Save Changes</Button>
|
||||||
|
</CardFooter>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
|
@ -5,7 +5,7 @@ import { cva, type VariantProps } from 'class-variance-authority';
|
||||||
import { cn } from '@/lib/utils';
|
import { cn } from '@/lib/utils';
|
||||||
|
|
||||||
const buttonVariants = cva(
|
const buttonVariants = cva(
|
||||||
"radius-lg inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-button transition-all cursor-pointer disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
"radius-lg inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-button transition-all cursor-pointer disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-nonef",
|
||||||
{
|
{
|
||||||
variants: {
|
variants: {
|
||||||
variant: {
|
variant: {
|
||||||
|
|
|
@ -126,7 +126,7 @@ function CardFooter({ className, ...props }: React.ComponentProps<'div'>) {
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
data-slot='card-footer'
|
data-slot='card-footer'
|
||||||
className={cn('flex items-center px-6 [.border-t]:pt-6', className)}
|
className={cn('flex items-center px-6', className)}
|
||||||
{...props}
|
{...props}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
|
@ -69,7 +69,7 @@ function DialogContent({
|
||||||
{showCloseButton && (
|
{showCloseButton && (
|
||||||
<DialogPrimitive.Close
|
<DialogPrimitive.Close
|
||||||
data-slot='dialog-close'
|
data-slot='dialog-close'
|
||||||
className="ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4"
|
className="ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-2 right-2 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4"
|
||||||
>
|
>
|
||||||
<XIcon />
|
<XIcon />
|
||||||
<span className='sr-only'>Close</span>
|
<span className='sr-only'>Close</span>
|
||||||
|
|
725
src/components/ui/sidebar.tsx
Normal file
725
src/components/ui/sidebar.tsx
Normal file
|
@ -0,0 +1,725 @@
|
||||||
|
'use client';
|
||||||
|
|
||||||
|
import * as React from 'react';
|
||||||
|
import { Slot } from '@radix-ui/react-slot';
|
||||||
|
import { cva, VariantProps } from 'class-variance-authority';
|
||||||
|
import { PanelLeftIcon } from 'lucide-react';
|
||||||
|
|
||||||
|
import { useIsMobile } from '@/hooks/use-mobile';
|
||||||
|
import { cn } from '@/lib/utils';
|
||||||
|
import { Button } from '@/components/ui/button';
|
||||||
|
import { Input } from '@/components/ui/input';
|
||||||
|
import { Separator } from '@/components/ui/separator';
|
||||||
|
import {
|
||||||
|
Sheet,
|
||||||
|
SheetContent,
|
||||||
|
SheetDescription,
|
||||||
|
SheetHeader,
|
||||||
|
SheetTitle,
|
||||||
|
} from '@/components/ui/sheet';
|
||||||
|
import { Skeleton } from '@/components/ui/skeleton';
|
||||||
|
import {
|
||||||
|
Tooltip,
|
||||||
|
TooltipContent,
|
||||||
|
TooltipProvider,
|
||||||
|
TooltipTrigger,
|
||||||
|
} from '@/components/ui/tooltip';
|
||||||
|
|
||||||
|
const SIDEBAR_COOKIE_NAME = 'sidebar_state';
|
||||||
|
const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
|
||||||
|
const SIDEBAR_WIDTH = '16rem';
|
||||||
|
const SIDEBAR_WIDTH_MOBILE = '18rem';
|
||||||
|
const SIDEBAR_WIDTH_ICON = '4rem';
|
||||||
|
const SIDEBAR_KEYBOARD_SHORTCUT = 'b';
|
||||||
|
|
||||||
|
type SidebarContextProps = {
|
||||||
|
state: 'expanded' | 'collapsed';
|
||||||
|
open: boolean;
|
||||||
|
setOpen: (open: boolean) => void;
|
||||||
|
openMobile: boolean;
|
||||||
|
setOpenMobile: (open: boolean) => void;
|
||||||
|
isMobile: boolean;
|
||||||
|
toggleSidebar: () => void;
|
||||||
|
};
|
||||||
|
|
||||||
|
const SidebarContext = React.createContext<SidebarContextProps | null>(null);
|
||||||
|
|
||||||
|
function useSidebar() {
|
||||||
|
const context = React.useContext(SidebarContext);
|
||||||
|
if (!context) {
|
||||||
|
throw new Error('useSidebar must be used within a SidebarProvider.');
|
||||||
|
}
|
||||||
|
|
||||||
|
return context;
|
||||||
|
}
|
||||||
|
|
||||||
|
function SidebarProvider({
|
||||||
|
defaultOpen = true,
|
||||||
|
open: openProp,
|
||||||
|
onOpenChange: setOpenProp,
|
||||||
|
className,
|
||||||
|
style,
|
||||||
|
children,
|
||||||
|
...props
|
||||||
|
}: React.ComponentProps<'div'> & {
|
||||||
|
defaultOpen?: boolean;
|
||||||
|
open?: boolean;
|
||||||
|
onOpenChange?: (open: boolean) => void;
|
||||||
|
}) {
|
||||||
|
const isMobile = useIsMobile();
|
||||||
|
const [openMobile, setOpenMobile] = React.useState(false);
|
||||||
|
|
||||||
|
// This is the internal state of the sidebar.
|
||||||
|
// We use openProp and setOpenProp for control from outside the component.
|
||||||
|
const [_open, _setOpen] = React.useState(defaultOpen);
|
||||||
|
const open = openProp ?? _open;
|
||||||
|
const setOpen = React.useCallback(
|
||||||
|
(value: boolean | ((value: boolean) => boolean)) => {
|
||||||
|
const openState = typeof value === 'function' ? value(open) : value;
|
||||||
|
if (setOpenProp) {
|
||||||
|
setOpenProp(openState);
|
||||||
|
} else {
|
||||||
|
_setOpen(openState);
|
||||||
|
}
|
||||||
|
|
||||||
|
// This sets the cookie to keep the sidebar state.
|
||||||
|
document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;
|
||||||
|
},
|
||||||
|
[setOpenProp, open],
|
||||||
|
);
|
||||||
|
|
||||||
|
// Helper to toggle the sidebar.
|
||||||
|
const toggleSidebar = React.useCallback(() => {
|
||||||
|
return isMobile ? setOpenMobile((open) => !open) : setOpen((open) => !open);
|
||||||
|
}, [isMobile, setOpen, setOpenMobile]);
|
||||||
|
|
||||||
|
// Adds a keyboard shortcut to toggle the sidebar.
|
||||||
|
React.useEffect(() => {
|
||||||
|
const handleKeyDown = (event: KeyboardEvent) => {
|
||||||
|
if (
|
||||||
|
event.key === SIDEBAR_KEYBOARD_SHORTCUT &&
|
||||||
|
(event.metaKey || event.ctrlKey)
|
||||||
|
) {
|
||||||
|
event.preventDefault();
|
||||||
|
toggleSidebar();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
window.addEventListener('keydown', handleKeyDown);
|
||||||
|
return () => window.removeEventListener('keydown', handleKeyDown);
|
||||||
|
}, [toggleSidebar]);
|
||||||
|
|
||||||
|
// We add a state so that we can do data-state="expanded" or "collapsed".
|
||||||
|
// This makes it easier to style the sidebar with Tailwind classes.
|
||||||
|
const state = open ? 'expanded' : 'collapsed';
|
||||||
|
|
||||||
|
const contextValue = React.useMemo<SidebarContextProps>(
|
||||||
|
() => ({
|
||||||
|
state,
|
||||||
|
open,
|
||||||
|
setOpen,
|
||||||
|
isMobile,
|
||||||
|
openMobile,
|
||||||
|
setOpenMobile,
|
||||||
|
toggleSidebar,
|
||||||
|
}),
|
||||||
|
[state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar],
|
||||||
|
);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<SidebarContext.Provider value={contextValue}>
|
||||||
|
<TooltipProvider delayDuration={0}>
|
||||||
|
<div
|
||||||
|
data-slot='sidebar-wrapper'
|
||||||
|
style={
|
||||||
|
{
|
||||||
|
'--sidebar-width': SIDEBAR_WIDTH,
|
||||||
|
'--sidebar-width-icon': SIDEBAR_WIDTH_ICON,
|
||||||
|
...style,
|
||||||
|
} as React.CSSProperties
|
||||||
|
}
|
||||||
|
className={cn(
|
||||||
|
'group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full',
|
||||||
|
className,
|
||||||
|
)}
|
||||||
|
{...props}
|
||||||
|
>
|
||||||
|
{children}
|
||||||
|
</div>
|
||||||
|
</TooltipProvider>
|
||||||
|
</SidebarContext.Provider>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function Sidebar({
|
||||||
|
side = 'left',
|
||||||
|
variant = 'sidebar',
|
||||||
|
collapsible = 'offcanvas',
|
||||||
|
className,
|
||||||
|
children,
|
||||||
|
...props
|
||||||
|
}: React.ComponentProps<'div'> & {
|
||||||
|
side?: 'left' | 'right';
|
||||||
|
variant?: 'sidebar' | 'floating' | 'inset';
|
||||||
|
collapsible?: 'offcanvas' | 'icon' | 'none';
|
||||||
|
}) {
|
||||||
|
const { isMobile, state, openMobile, setOpenMobile } = useSidebar();
|
||||||
|
|
||||||
|
if (collapsible === 'none') {
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
data-slot='sidebar'
|
||||||
|
className={cn(
|
||||||
|
'bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col',
|
||||||
|
className,
|
||||||
|
)}
|
||||||
|
{...props}
|
||||||
|
>
|
||||||
|
{children}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isMobile) {
|
||||||
|
return (
|
||||||
|
<Sheet open={openMobile} onOpenChange={setOpenMobile} {...props}>
|
||||||
|
<SheetContent
|
||||||
|
data-sidebar='sidebar'
|
||||||
|
data-slot='sidebar'
|
||||||
|
data-mobile='true'
|
||||||
|
className='bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden group/mobile'
|
||||||
|
style={
|
||||||
|
{
|
||||||
|
'--sidebar-width': SIDEBAR_WIDTH_MOBILE,
|
||||||
|
} as React.CSSProperties
|
||||||
|
}
|
||||||
|
side={side}
|
||||||
|
>
|
||||||
|
<SheetHeader className='sr-only'>
|
||||||
|
<SheetTitle>Sidebar</SheetTitle>
|
||||||
|
<SheetDescription>Displays the mobile sidebar.</SheetDescription>
|
||||||
|
</SheetHeader>
|
||||||
|
<div className='flex h-full w-full flex-col'>{children}</div>
|
||||||
|
</SheetContent>
|
||||||
|
</Sheet>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
className='group peer text-sidebar-foreground hidden md:block'
|
||||||
|
data-state={state}
|
||||||
|
data-collapsible={state === 'collapsed' ? collapsible : ''}
|
||||||
|
data-variant={variant}
|
||||||
|
data-side={side}
|
||||||
|
data-slot='sidebar'
|
||||||
|
>
|
||||||
|
{/* This is what handles the sidebar gap on desktop */}
|
||||||
|
<div
|
||||||
|
data-slot='sidebar-gap'
|
||||||
|
className={cn(
|
||||||
|
'relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear',
|
||||||
|
'group-data-[collapsible=offcanvas]:w-0',
|
||||||
|
'group-data-[side=right]:rotate-180',
|
||||||
|
variant === 'floating' || variant === 'inset'
|
||||||
|
? 'group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]'
|
||||||
|
: 'group-data-[collapsible=icon]:w-(--sidebar-width-icon)',
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
<div
|
||||||
|
data-slot='sidebar-container'
|
||||||
|
className={cn(
|
||||||
|
'fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex',
|
||||||
|
side === 'left'
|
||||||
|
? 'left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]'
|
||||||
|
: 'right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]',
|
||||||
|
// Adjust the padding for floating and inset variants.
|
||||||
|
variant === 'floating' || variant === 'inset'
|
||||||
|
? 'p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]'
|
||||||
|
: 'group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l',
|
||||||
|
className,
|
||||||
|
)}
|
||||||
|
{...props}
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
data-sidebar='sidebar'
|
||||||
|
data-slot='sidebar-inner'
|
||||||
|
className='bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm'
|
||||||
|
>
|
||||||
|
{children}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function SidebarTrigger({
|
||||||
|
className,
|
||||||
|
onClick,
|
||||||
|
...props
|
||||||
|
}: React.ComponentProps<typeof Button>) {
|
||||||
|
const { toggleSidebar } = useSidebar();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Button
|
||||||
|
data-sidebar='trigger'
|
||||||
|
data-slot='sidebar-trigger'
|
||||||
|
variant='muted'
|
||||||
|
size='icon'
|
||||||
|
className={cn('', className)}
|
||||||
|
onClick={(event) => {
|
||||||
|
onClick?.(event);
|
||||||
|
toggleSidebar();
|
||||||
|
}}
|
||||||
|
{...props}
|
||||||
|
>
|
||||||
|
<PanelLeftIcon />
|
||||||
|
<span className='sr-only'>Toggle Sidebar</span>
|
||||||
|
</Button>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function SidebarRail({ className, ...props }: React.ComponentProps<'button'>) {
|
||||||
|
const { toggleSidebar } = useSidebar();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<button
|
||||||
|
data-sidebar='rail'
|
||||||
|
data-slot='sidebar-rail'
|
||||||
|
aria-label='Toggle Sidebar'
|
||||||
|
tabIndex={-1}
|
||||||
|
onClick={toggleSidebar}
|
||||||
|
title='Toggle Sidebar'
|
||||||
|
className={cn(
|
||||||
|
'hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] sm:flex',
|
||||||
|
'in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize',
|
||||||
|
'[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize',
|
||||||
|
'hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full',
|
||||||
|
'[[data-side=left][data-collapsible=offcanvas]_&]:-right-2',
|
||||||
|
'[[data-side=right][data-collapsible=offcanvas]_&]:-left-2',
|
||||||
|
className,
|
||||||
|
)}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function SidebarInset({ className, ...props }: React.ComponentProps<'main'>) {
|
||||||
|
return (
|
||||||
|
<main
|
||||||
|
data-slot='sidebar-inset'
|
||||||
|
className={cn(
|
||||||
|
'bg-background relative flex w-full flex-1 flex-col',
|
||||||
|
'md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2',
|
||||||
|
className,
|
||||||
|
)}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function SidebarInput({
|
||||||
|
className,
|
||||||
|
...props
|
||||||
|
}: React.ComponentProps<typeof Input>) {
|
||||||
|
return (
|
||||||
|
<Input
|
||||||
|
data-slot='sidebar-input'
|
||||||
|
data-sidebar='input'
|
||||||
|
className={cn('bg-background h-8 w-full shadow-none', className)}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function SidebarHeader({ className, ...props }: React.ComponentProps<'div'>) {
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
data-slot='sidebar-header'
|
||||||
|
data-sidebar='header'
|
||||||
|
className={cn('flex flex-col gap-2 p-2', className)}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function SidebarFooter({ className, ...props }: React.ComponentProps<'div'>) {
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
data-slot='sidebar-footer'
|
||||||
|
data-sidebar='footer'
|
||||||
|
className={cn('flex flex-col gap-2 p-2', className)}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function SidebarSeparator({
|
||||||
|
className,
|
||||||
|
...props
|
||||||
|
}: React.ComponentProps<typeof Separator>) {
|
||||||
|
return (
|
||||||
|
<Separator
|
||||||
|
data-slot='sidebar-separator'
|
||||||
|
data-sidebar='separator'
|
||||||
|
className={cn('bg-sidebar-border mx-2 w-auto', className)}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function SidebarContent({ className, ...props }: React.ComponentProps<'div'>) {
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
data-slot='sidebar-content'
|
||||||
|
data-sidebar='content'
|
||||||
|
className={cn(
|
||||||
|
'flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden',
|
||||||
|
className,
|
||||||
|
)}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function SidebarGroup({ className, ...props }: React.ComponentProps<'div'>) {
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
data-slot='sidebar-group'
|
||||||
|
data-sidebar='group'
|
||||||
|
className={cn('relative flex w-full min-w-0 flex-col p-2', className)}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function SidebarGroupLabel({
|
||||||
|
className,
|
||||||
|
asChild = false,
|
||||||
|
...props
|
||||||
|
}: React.ComponentProps<'div'> & { asChild?: boolean }) {
|
||||||
|
const Comp = asChild ? Slot : 'div';
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Comp
|
||||||
|
data-slot='sidebar-group-label'
|
||||||
|
data-sidebar='group-label'
|
||||||
|
className={cn(
|
||||||
|
'text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0 ml-[7.5px]',
|
||||||
|
className,
|
||||||
|
)}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function SidebarGroupAction({
|
||||||
|
className,
|
||||||
|
asChild = false,
|
||||||
|
...props
|
||||||
|
}: React.ComponentProps<'button'> & { asChild?: boolean }) {
|
||||||
|
const Comp = asChild ? Slot : 'button';
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Comp
|
||||||
|
data-slot='sidebar-group-action'
|
||||||
|
data-sidebar='group-action'
|
||||||
|
className={cn(
|
||||||
|
'text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0',
|
||||||
|
// Increases the hit area of the button on mobile.
|
||||||
|
'after:absolute after:-inset-2 md:after:hidden',
|
||||||
|
'group-data-[collapsible=icon]:hidden',
|
||||||
|
className,
|
||||||
|
)}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function SidebarGroupContent({
|
||||||
|
className,
|
||||||
|
...props
|
||||||
|
}: React.ComponentProps<'div'>) {
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
data-slot='sidebar-group-content'
|
||||||
|
data-sidebar='group-content'
|
||||||
|
className={cn('w-full text-sm', className)}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function SidebarMenu({ className, ...props }: React.ComponentProps<'ul'>) {
|
||||||
|
return (
|
||||||
|
<ul
|
||||||
|
data-slot='sidebar-menu'
|
||||||
|
data-sidebar='menu'
|
||||||
|
className={cn('flex w-full min-w-0 flex-col gap-1', className)}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function SidebarMenuItem({ className, ...props }: React.ComponentProps<'li'>) {
|
||||||
|
return (
|
||||||
|
<li
|
||||||
|
data-slot='sidebar-menu-item'
|
||||||
|
data-sidebar='menu-item'
|
||||||
|
className={cn('group/menu-item relative', className)}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const sidebarMenuButtonVariants = cva(
|
||||||
|
'peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! p-0 ml-[15.5px] [&>span:last-child]:truncate [&>svg]:shrink-0',
|
||||||
|
{
|
||||||
|
variants: {
|
||||||
|
variant: {
|
||||||
|
default: 'hover:bg-sidebar-accent hover:text-sidebar-accent-foreground',
|
||||||
|
outline:
|
||||||
|
'bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]',
|
||||||
|
},
|
||||||
|
size: {
|
||||||
|
default: 'h-8 text-sm',
|
||||||
|
sm: 'h-7 text-xs',
|
||||||
|
lg: 'h-12 text-sm group-data-[collapsible=icon]:p-0!',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
defaultVariants: {
|
||||||
|
variant: 'default',
|
||||||
|
size: 'default',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
function SidebarMenuButton({
|
||||||
|
asChild = false,
|
||||||
|
isActive = false,
|
||||||
|
variant = 'default',
|
||||||
|
size = 'default',
|
||||||
|
tooltip,
|
||||||
|
className,
|
||||||
|
...props
|
||||||
|
}: React.ComponentProps<'button'> & {
|
||||||
|
asChild?: boolean;
|
||||||
|
isActive?: boolean;
|
||||||
|
tooltip?: string | React.ComponentProps<typeof TooltipContent>;
|
||||||
|
} & VariantProps<typeof sidebarMenuButtonVariants>) {
|
||||||
|
const Comp = asChild ? Slot : 'button';
|
||||||
|
const { isMobile, state } = useSidebar();
|
||||||
|
|
||||||
|
const button = (
|
||||||
|
<Comp
|
||||||
|
data-slot='sidebar-menu-button'
|
||||||
|
data-sidebar='menu-button'
|
||||||
|
data-size={size}
|
||||||
|
data-active={isActive}
|
||||||
|
className={cn(sidebarMenuButtonVariants({ variant, size }), className)}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!tooltip) {
|
||||||
|
return button;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof tooltip === 'string') {
|
||||||
|
tooltip = {
|
||||||
|
children: tooltip,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Tooltip>
|
||||||
|
<TooltipTrigger asChild>{button}</TooltipTrigger>
|
||||||
|
<TooltipContent
|
||||||
|
side='right'
|
||||||
|
align='center'
|
||||||
|
hidden={state !== 'collapsed' || isMobile}
|
||||||
|
{...tooltip}
|
||||||
|
/>
|
||||||
|
</Tooltip>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function SidebarMenuAction({
|
||||||
|
className,
|
||||||
|
asChild = false,
|
||||||
|
showOnHover = false,
|
||||||
|
...props
|
||||||
|
}: React.ComponentProps<'button'> & {
|
||||||
|
asChild?: boolean;
|
||||||
|
showOnHover?: boolean;
|
||||||
|
}) {
|
||||||
|
const Comp = asChild ? Slot : 'button';
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Comp
|
||||||
|
data-slot='sidebar-menu-action'
|
||||||
|
data-sidebar='menu-action'
|
||||||
|
className={cn(
|
||||||
|
'text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0',
|
||||||
|
// Increases the hit area of the button on mobile.
|
||||||
|
'after:absolute after:-inset-2 md:after:hidden',
|
||||||
|
'peer-data-[size=sm]/menu-button:top-1',
|
||||||
|
'peer-data-[size=default]/menu-button:top-1.5',
|
||||||
|
'peer-data-[size=lg]/menu-button:top-2.5',
|
||||||
|
'group-data-[collapsible=icon]:hidden',
|
||||||
|
showOnHover &&
|
||||||
|
'peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0',
|
||||||
|
className,
|
||||||
|
)}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function SidebarMenuBadge({
|
||||||
|
className,
|
||||||
|
...props
|
||||||
|
}: React.ComponentProps<'div'>) {
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
data-slot='sidebar-menu-badge'
|
||||||
|
data-sidebar='menu-badge'
|
||||||
|
className={cn(
|
||||||
|
'text-sidebar-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums select-none',
|
||||||
|
'peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground',
|
||||||
|
'peer-data-[size=sm]/menu-button:top-1',
|
||||||
|
'peer-data-[size=default]/menu-button:top-1.5',
|
||||||
|
'peer-data-[size=lg]/menu-button:top-2.5',
|
||||||
|
'group-data-[collapsible=icon]:hidden',
|
||||||
|
className,
|
||||||
|
)}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function SidebarMenuSkeleton({
|
||||||
|
className,
|
||||||
|
showIcon = false,
|
||||||
|
...props
|
||||||
|
}: React.ComponentProps<'div'> & {
|
||||||
|
showIcon?: boolean;
|
||||||
|
}) {
|
||||||
|
// Random width between 50 to 90%.
|
||||||
|
const width = React.useMemo(() => {
|
||||||
|
return `${Math.floor(Math.random() * 40) + 50}%`;
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
data-slot='sidebar-menu-skeleton'
|
||||||
|
data-sidebar='menu-skeleton'
|
||||||
|
className={cn('flex h-8 items-center gap-2 rounded-md px-2', className)}
|
||||||
|
{...props}
|
||||||
|
>
|
||||||
|
{showIcon && (
|
||||||
|
<Skeleton
|
||||||
|
className='size-4 rounded-md'
|
||||||
|
data-sidebar='menu-skeleton-icon'
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
<Skeleton
|
||||||
|
className='h-4 max-w-(--skeleton-width) flex-1'
|
||||||
|
data-sidebar='menu-skeleton-text'
|
||||||
|
style={
|
||||||
|
{
|
||||||
|
'--skeleton-width': width,
|
||||||
|
} as React.CSSProperties
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function SidebarMenuSub({ className, ...props }: React.ComponentProps<'ul'>) {
|
||||||
|
return (
|
||||||
|
<ul
|
||||||
|
data-slot='sidebar-menu-sub'
|
||||||
|
data-sidebar='menu-sub'
|
||||||
|
className={cn(
|
||||||
|
'border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5',
|
||||||
|
'group-data-[collapsible=icon]:hidden',
|
||||||
|
className,
|
||||||
|
)}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function SidebarMenuSubItem({
|
||||||
|
className,
|
||||||
|
...props
|
||||||
|
}: React.ComponentProps<'li'>) {
|
||||||
|
return (
|
||||||
|
<li
|
||||||
|
data-slot='sidebar-menu-sub-item'
|
||||||
|
data-sidebar='menu-sub-item'
|
||||||
|
className={cn('group/menu-sub-item relative', className)}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function SidebarMenuSubButton({
|
||||||
|
asChild = false,
|
||||||
|
size = 'md',
|
||||||
|
isActive = false,
|
||||||
|
className,
|
||||||
|
...props
|
||||||
|
}: React.ComponentProps<'a'> & {
|
||||||
|
asChild?: boolean;
|
||||||
|
size?: 'sm' | 'md';
|
||||||
|
isActive?: boolean;
|
||||||
|
}) {
|
||||||
|
const Comp = asChild ? Slot : 'a';
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Comp
|
||||||
|
data-slot='sidebar-menu-sub-button'
|
||||||
|
data-sidebar='menu-sub-button'
|
||||||
|
data-size={size}
|
||||||
|
data-active={isActive}
|
||||||
|
className={cn(
|
||||||
|
'text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0',
|
||||||
|
'data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground',
|
||||||
|
size === 'sm' && 'text-xs',
|
||||||
|
size === 'md' && 'text-sm',
|
||||||
|
'group-data-[collapsible=icon]:hidden',
|
||||||
|
className,
|
||||||
|
)}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export {
|
||||||
|
Sidebar,
|
||||||
|
SidebarContent,
|
||||||
|
SidebarFooter,
|
||||||
|
SidebarGroup,
|
||||||
|
SidebarGroupAction,
|
||||||
|
SidebarGroupContent,
|
||||||
|
SidebarGroupLabel,
|
||||||
|
SidebarHeader,
|
||||||
|
SidebarInput,
|
||||||
|
SidebarInset,
|
||||||
|
SidebarMenu,
|
||||||
|
SidebarMenuAction,
|
||||||
|
SidebarMenuBadge,
|
||||||
|
SidebarMenuButton,
|
||||||
|
SidebarMenuItem,
|
||||||
|
SidebarMenuSkeleton,
|
||||||
|
SidebarMenuSub,
|
||||||
|
SidebarMenuSubButton,
|
||||||
|
SidebarMenuSubItem,
|
||||||
|
SidebarProvider,
|
||||||
|
SidebarRail,
|
||||||
|
SidebarSeparator,
|
||||||
|
SidebarTrigger,
|
||||||
|
useSidebar,
|
||||||
|
};
|
23
src/components/wrappers/group-wrapper.tsx
Normal file
23
src/components/wrappers/group-wrapper.tsx
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
import { cn } from '@/lib/utils';
|
||||||
|
import type * as React from 'react';
|
||||||
|
|
||||||
|
interface ScrollableSettingsWrapperProps {
|
||||||
|
className?: string;
|
||||||
|
title?: string;
|
||||||
|
children: React.ReactNode;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function GroupWrapper({
|
||||||
|
className,
|
||||||
|
title,
|
||||||
|
children,
|
||||||
|
}: ScrollableSettingsWrapperProps) {
|
||||||
|
return (
|
||||||
|
<fieldset
|
||||||
|
className={cn('space-t-4 p-4 border rounded-md shadow-md', className)}
|
||||||
|
>
|
||||||
|
<legend className='text-sm font-medium px-1'>{title}</legend>
|
||||||
|
{children}
|
||||||
|
</fieldset>
|
||||||
|
);
|
||||||
|
}
|
|
@ -1,16 +1,16 @@
|
||||||
import React from 'react';
|
import { cn } from '@/lib/utils';
|
||||||
|
import type * as React from 'react';
|
||||||
|
|
||||||
interface ScrollableContentWrapperProps {
|
interface ScrollableSettingsWrapperProps {
|
||||||
children: React.ReactNode;
|
|
||||||
className?: string;
|
className?: string;
|
||||||
|
children: React.ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const ScrollableSettingsWrapper: React.FC<
|
export function ScrollableSettingsWrapper({
|
||||||
ScrollableContentWrapperProps
|
className,
|
||||||
> = ({ children, className = '' }) => {
|
children,
|
||||||
|
}: ScrollableSettingsWrapperProps) {
|
||||||
return (
|
return (
|
||||||
<div className={`h-[500px] overflow-y-auto space-y-2 ${className}`}>
|
<div className={cn('overflow-y-auto h-full', className)}>{children}</div>
|
||||||
{children}
|
|
||||||
</div>
|
|
||||||
);
|
);
|
||||||
};
|
}
|
||||||
|
|
18
yarn.lock
18
yarn.lock
|
@ -2215,9 +2215,9 @@ __metadata:
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"@rushstack/eslint-patch@npm:^1.10.3":
|
"@rushstack/eslint-patch@npm:^1.10.3":
|
||||||
version: 1.11.0
|
version: 1.12.0
|
||||||
resolution: "@rushstack/eslint-patch@npm:1.11.0"
|
resolution: "@rushstack/eslint-patch@npm:1.12.0"
|
||||||
checksum: 10c0/abea8d8cf2f4f50343f74abd6a8173c521ddd09b102021f5aa379ef373c40af5948b23db0e87eca1682e559e09d97d3f0c48ea71edad682c6bf72b840c8675b3
|
checksum: 10c0/1e567656d92632c085a446f40767bc451caffe1131e8d6a7a3e8f3e3f4167f5f29744a84c709f2440f299442d4bc68ff773784462166800b8c09c0e08042415b
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
@ -5085,9 +5085,9 @@ __metadata:
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"dotenv@npm:^16.3.0":
|
"dotenv@npm:^16.3.0":
|
||||||
version: 16.5.0
|
version: 16.6.0
|
||||||
resolution: "dotenv@npm:16.5.0"
|
resolution: "dotenv@npm:16.6.0"
|
||||||
checksum: 10c0/5bc94c919fbd955bf0ba44d33922a1e93d1078e64a1db5c30faeded1d996e7a83c55332cb8ea4fae5a9ca4d0be44cbceb95c5811e70f9f095298df09d1997dd9
|
checksum: 10c0/c1029a8656e03abc53c0522baf733131ffd4e633d8ab66c3f2d470ebdd7c5d143ffab64945afc475e60c5f803f0e734a9f9247949d17cc8ff564fba5c15978b1
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
@ -10675,8 +10675,8 @@ __metadata:
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"typedoc@npm:^0.28.0":
|
"typedoc@npm:^0.28.0":
|
||||||
version: 0.28.5
|
version: 0.28.6
|
||||||
resolution: "typedoc@npm:0.28.5"
|
resolution: "typedoc@npm:0.28.6"
|
||||||
dependencies:
|
dependencies:
|
||||||
"@gerrit0/mini-shiki": "npm:^3.2.2"
|
"@gerrit0/mini-shiki": "npm:^3.2.2"
|
||||||
lunr: "npm:^2.3.9"
|
lunr: "npm:^2.3.9"
|
||||||
|
@ -10687,7 +10687,7 @@ __metadata:
|
||||||
typescript: 5.0.x || 5.1.x || 5.2.x || 5.3.x || 5.4.x || 5.5.x || 5.6.x || 5.7.x || 5.8.x
|
typescript: 5.0.x || 5.1.x || 5.2.x || 5.3.x || 5.4.x || 5.5.x || 5.6.x || 5.7.x || 5.8.x
|
||||||
bin:
|
bin:
|
||||||
typedoc: bin/typedoc
|
typedoc: bin/typedoc
|
||||||
checksum: 10c0/fc8235dbe8f14da24fdb088467b01887b3f1375b27d5caf0276ae405f03aa1f523e94aea52fe8ce1a3d477ae9e3f4f69fdc28614275445a828a77db88784e6ce
|
checksum: 10c0/f83f4ceef6e7b55c4547798d069f64a284df2e93052f317ea09d7f1d345caf73e9247bd38b04702be5f5c79848873b1216c3dbaf284bf4657bdbf7b144ecc9bb
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue