Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,5 @@ __screenshots__/
# NS8 Robot Framework test output (output.xml, log.html, report.html, screenshots)
packaging/ns8/tests/outputs/
__pycache__/
calnode.key
FUTURE_FEATURES.md
46 changes: 36 additions & 10 deletions frontend/src/app.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@import "tailwindcss";
@import "tw-animate-css";

@custom-variant dark (&:is(.dark *));
@custom-variant dark (&:where(.dark, .dark *));

/*
* Tailwind v4 has built-in data-* variants: `data-foo:` targets `[data-foo]`.
Expand Down Expand Up @@ -57,17 +57,17 @@
:root {
--radius: 0.5rem;

--background: oklch(1 0 0);
--foreground: oklch(0.141 0.005 285.823);
--card: oklch(1 0 0);
--card-foreground: oklch(0.141 0.005 285.823);
--popover: oklch(1 0 0);
--popover-foreground: oklch(0.141 0.005 285.823);
--background: #F7F8FA;
--foreground: #111827;
--card: #FFFFFF;
--card-foreground: #111827;
--popover: #FFFFFF;
--popover-foreground: #111827;
--primary: oklch(0.21 0.006 285.885);
--primary-foreground: oklch(0.985 0 0);
--secondary: oklch(0.967 0.001 286.375);
--secondary-foreground: oklch(0.21 0.006 285.885);
--muted: oklch(0.967 0.001 286.375);
--secondary: #F1F3F5;
--secondary-foreground: #111827;
--muted: #F1F3F5;
--muted-foreground: oklch(0.552 0.016 285.938);
--accent: oklch(0.967 0.001 286.375);
--accent-foreground: oklch(0.21 0.006 285.885);
Expand Down Expand Up @@ -139,4 +139,30 @@ body {
line-height: 1.5;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
transition: background-color 180ms cubic-bezier(0.2, 0.8, 0.2, 1), color 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

button,
a,
input,
select,
textarea {
transition-duration: 160ms;
transition-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
}

:focus-visible {
outline: 2px solid var(--ring);
outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
*,
*::before,
*::after {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
scroll-behavior: auto !important;
}
}
10 changes: 10 additions & 0 deletions frontend/src/app.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@
<meta name="robots" content="noindex" />
<link rel="icon" href="%sveltekit.assets%/favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<script>
(function () {
try {
var m = localStorage.getItem('fp-theme') || 'system';
var dark = m === 'dark' || (m !== 'light' && window.matchMedia('(prefers-color-scheme: dark)').matches);
document.documentElement.classList.toggle('dark', dark);
document.documentElement.style.colorScheme = dark ? 'dark' : 'light';
} catch (e) {}
})();
</script>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin="anonymous" />
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@700&display=swap" rel="stylesheet" />
Expand Down
18 changes: 18 additions & 0 deletions frontend/src/lib/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ export type EventType = {
min_notice_minutes: number;
max_future_days: number;
max_active_bookings: number;
max_per_day?: number | null;
max_per_week?: number | null;
price_cents: number; // 0 = free
currency: string; // ISO 4217, lowercase (e.g. "usd")
created_at: string;
Expand Down Expand Up @@ -93,6 +95,22 @@ export type EventTypeHost = {
archived: boolean;
};

export type SingleUseLink = {
id: string;
token: string;
url: string;
event_type_id: string;
created_by_user_id: string;
expires_at: string | null;
used_at: string | null;
booking_id: string | null;
created_at: string;
};

export type CreateSingleUseLinkPayload = {
expires_in_hours?: number;
};

export type Question = {
id: string;
event_type_id: string;
Expand Down
153 changes: 153 additions & 0 deletions frontend/src/lib/components/event-types/BookingPreviewCard.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
<script lang="ts">
import type { Question } from '$lib/api';

let {
name = 'New Meeting',
description = '',
duration = 30,
locationType = 'link',
locationValue = '',
hostName = 'Host',
hostAvatar = '',
mode = 'calendar',
allowPhoneCall = false,
questions = []
}: {
name?: string;
description?: string;
duration?: number;
locationType?: string;
locationValue?: string;
hostName?: string;
hostAvatar?: string;
mode?: 'calendar' | 'form';
allowPhoneCall?: boolean;
questions?: Question[];
} = $props();

let selectedDay = $state(18);
const days = Array.from({ length: 30 }, (_, i) => i + 1);
const weekdays = ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'];

const locationLabel = $derived.by(() => {
switch (locationType) {
case 'google_meet': return 'Google Meet';
case 'teams': return 'Microsoft Teams';
case 'zoom': return 'Zoom';
case 'livekit': return 'Calnode Video';
case 'phone': return locationValue || 'Phone call';
case 'in_person': return locationValue || 'In person';
default: return locationValue || 'Web conferencing';
}
});
</script>

<div class="sticky top-20 rounded-xl border bg-card p-4 shadow-sm">
<div class="mb-3 flex items-center justify-between border-b pb-2.5">
<span class="text-[11px] font-semibold uppercase tracking-wider text-muted-foreground">Live Preview</span>
<span class="rounded-full bg-muted px-2 py-0.5 text-[10px] font-medium text-muted-foreground">Interactive</span>
</div>

<div class="space-y-4">
<div>
<div class="mb-2 flex items-center gap-2">
{#if hostAvatar}
<img src={hostAvatar} alt={hostName} class="h-7 w-7 rounded-full object-cover" />
{:else}
<div class="flex h-7 w-7 items-center justify-center rounded-full bg-primary text-xs font-semibold text-primary-foreground">
{(hostName || 'H').slice(0, 1).toUpperCase()}
</div>
{/if}
<span class="truncate text-xs font-medium text-muted-foreground">{hostName}</span>
</div>
<h3 class="truncate text-base font-semibold tracking-tight">{name || 'Untitled Event'}</h3>
{#if description}
<p class="mt-1 line-clamp-2 text-xs text-muted-foreground">{description}</p>
{/if}
<div class="mt-2.5 flex flex-wrap gap-1.5 text-[11px] text-muted-foreground">
<span class="inline-flex items-center gap-1 rounded-md bg-muted px-2 py-0.5 font-medium text-foreground">
{duration || 30}m
</span>
<span class="inline-flex items-center gap-1 rounded-md bg-muted px-2 py-0.5">
{locationLabel}
</span>
</div>
</div>

{#if mode === 'form'}
<div class="rounded-lg border bg-background/60 p-3 space-y-2.5">
<div class="flex items-center justify-between border-b pb-2 text-[11px]">
<span class="font-medium text-foreground">Fri, Nov {selectedDay} · 10:00 AM</span>
<span class="text-muted-foreground">UTC</span>
</div>
<div class="space-y-2 text-[11px]">
<div>
<div class="mb-1 font-medium text-foreground">Your name <span class="text-destructive">*</span></div>
<div class="rounded border bg-background px-2 py-1.5 text-muted-foreground">Jane Doe</div>
</div>
<div>
<div class="mb-1 font-medium text-foreground">Email address <span class="text-destructive">*</span></div>
<div class="rounded border bg-background px-2 py-1.5 text-muted-foreground">jane@example.com</div>
</div>
{#if allowPhoneCall}
<div>
<div class="mb-1 font-medium text-foreground">Phone number <span class="text-muted-foreground font-normal">(optional)</span></div>
<div class="rounded border bg-background px-2 py-1.5 text-muted-foreground">+1 (555) 000-0000</div>
</div>
{/if}
{#each questions as q (q.id)}
<div>
{#if q.type === 'checkbox'}
<div class="flex items-center gap-1.5 py-0.5">
<div class="h-3.5 w-3.5 rounded border bg-background shrink-0"></div>
<span class="font-medium text-foreground">{q.label}{#if q.required} <span class="text-destructive">*</span>{/if}</span>
</div>
{:else if q.type === 'select'}
<div class="mb-1 font-medium text-foreground">{q.label}{#if q.required} <span class="text-destructive">*</span>{/if}</div>
<div class="flex items-center justify-between rounded border bg-background px-2 py-1.5 text-muted-foreground">
<span>{q.options?.[0] ?? 'Choose an option'}</span>
<span>▾</span>
</div>
{:else}
<div class="mb-1 font-medium text-foreground">{q.label}{#if q.required} <span class="text-destructive">*</span>{/if}</div>
<div class="rounded border bg-background px-2 py-2 text-muted-foreground">Answer...</div>
{/if}
</div>
{/each}
<div class="pt-1">
<div class="w-full rounded-md bg-primary py-1.5 text-center font-medium text-primary-foreground">
Confirm booking
</div>
</div>
</div>
</div>
{:else}
<div class="rounded-lg border bg-background/60 p-3">
<div class="mb-2 flex items-center justify-between text-xs font-medium">
<span>November 2026</span>
<span class="text-[11px] text-muted-foreground">UTC</span>
</div>
<div class="grid grid-cols-7 gap-1 text-center text-[10px] text-muted-foreground">
{#each weekdays as wd}
<div class="py-0.5 font-medium">{wd}</div>
{/each}
{#each days as d}
{@const isWeekend = d % 7 === 0 || d % 7 === 6}
<button
type="button"
disabled={isWeekend}
onclick={() => (selectedDay = d)}
class="h-6 rounded text-[11px] font-medium transition-colors {selectedDay === d
? 'bg-primary text-primary-foreground'
: isWeekend
? 'text-muted-foreground/35 cursor-default'
: 'bg-muted/60 text-foreground hover:bg-muted'}"
>
{d}
</button>
{/each}
</div>
</div>
{/if}
</div>
</div>
Loading
Loading