@forgebuild/hotal-ui 0.2.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +93 -0
- package/dist/hotal-ui.js +1644 -1120
- package/dist/index.d.ts +41 -0
- package/package.json +2 -1
package/dist/index.d.ts
CHANGED
|
@@ -11,12 +11,53 @@ export interface ReservationBarElement extends HTMLElement {
|
|
|
11
11
|
fetchAvailableDates?: (partySize: number) => Promise<string[]>;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
+
export interface BookingSlot {
|
|
15
|
+
time: string;
|
|
16
|
+
availableTables: number;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface PaymentIntentResult {
|
|
20
|
+
clientSecret: string;
|
|
21
|
+
paymentIntentId: string;
|
|
22
|
+
amountCents: number;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface BookingDetails {
|
|
26
|
+
date: string;
|
|
27
|
+
startTime: string;
|
|
28
|
+
timeDisplay: string;
|
|
29
|
+
partySize: number;
|
|
30
|
+
contactName: string;
|
|
31
|
+
contactEmail?: string;
|
|
32
|
+
contactPhone?: string;
|
|
33
|
+
notes?: string;
|
|
34
|
+
stripePaymentIntentId: string;
|
|
35
|
+
clerkUserId?: string;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export type BookResult = { ok: true } | { ok: false; status: number; message: string };
|
|
39
|
+
|
|
40
|
+
export interface BookingFlowElement extends HTMLElement {
|
|
41
|
+
date?: string;
|
|
42
|
+
guests?: number;
|
|
43
|
+
preferredTime?: string;
|
|
44
|
+
closedWeekdays?: number[];
|
|
45
|
+
fetchAvailableDates?: (partySize: number) => Promise<string[]>;
|
|
46
|
+
searchSlots?: (date: string, guests: number) => Promise<BookingSlot[]>;
|
|
47
|
+
createPaymentIntent?: (date: string, guests: number) => Promise<PaymentIntentResult>;
|
|
48
|
+
book?: (details: BookingDetails) => Promise<BookResult>;
|
|
49
|
+
stripePublishableKey?: string;
|
|
50
|
+
stripeAppearance?: Record<string, unknown>;
|
|
51
|
+
}
|
|
52
|
+
|
|
14
53
|
declare global {
|
|
15
54
|
interface HTMLElementTagNameMap {
|
|
16
55
|
'reservation-bar': ReservationBarElement;
|
|
56
|
+
'booking-flow': BookingFlowElement;
|
|
17
57
|
}
|
|
18
58
|
|
|
19
59
|
interface HTMLElementEventMap {
|
|
20
60
|
reservationchange: CustomEvent<{ date: string; guests: number; time: string }>;
|
|
61
|
+
'booking-confirmed': CustomEvent<{ date: string; time: string; guests: number }>;
|
|
21
62
|
}
|
|
22
63
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forgebuild/hotal-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Reusable Svelte UI components for booking and reservation experiences.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@floating-ui/dom": "^1.8.0",
|
|
24
|
+
"@stripe/stripe-js": "^9.13.0",
|
|
24
25
|
"svelte": "^5.56.8"
|
|
25
26
|
},
|
|
26
27
|
"devDependencies": {
|