@foxscheduling/shared 0.1.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 +56 -0
- package/dist/cjs/constants/emailUnsubscribeReasons.cjs +13 -0
- package/dist/cjs/constants/emailUnsubscribeReasons.d.ts +4 -0
- package/dist/cjs/constants/emailUnsubscribeReasons.d.ts.map +1 -0
- package/dist/cjs/index.cjs +24 -0
- package/dist/cjs/index.d.ts +9 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/cjs/types/db.availability.cjs +12 -0
- package/dist/cjs/types/db.availability.d.ts +33 -0
- package/dist/cjs/types/db.availability.d.ts.map +1 -0
- package/dist/cjs/types/db.booking.cjs +2 -0
- package/dist/cjs/types/db.booking.d.ts +101 -0
- package/dist/cjs/types/db.booking.d.ts.map +1 -0
- package/dist/cjs/types/db.cjs +2 -0
- package/dist/cjs/types/db.customers.cjs +2 -0
- package/dist/cjs/types/db.customers.d.ts +14 -0
- package/dist/cjs/types/db.customers.d.ts.map +1 -0
- package/dist/cjs/types/db.d.ts +11 -0
- package/dist/cjs/types/db.d.ts.map +1 -0
- package/dist/cjs/types/db.directory.cjs +2 -0
- package/dist/cjs/types/db.directory.d.ts +38 -0
- package/dist/cjs/types/db.directory.d.ts.map +1 -0
- package/dist/cjs/types/db.emailFlow.cjs +2 -0
- package/dist/cjs/types/db.emailFlow.d.ts +29 -0
- package/dist/cjs/types/db.emailFlow.d.ts.map +1 -0
- package/dist/cjs/types/db.mcpUserContext.cjs +2 -0
- package/dist/cjs/types/db.mcpUserContext.d.ts +29 -0
- package/dist/cjs/types/db.mcpUserContext.d.ts.map +1 -0
- package/dist/cjs/types/db.notification.cjs +2 -0
- package/dist/cjs/types/db.notification.d.ts +27 -0
- package/dist/cjs/types/db.notification.d.ts.map +1 -0
- package/dist/cjs/types/db.oauth.cjs +2 -0
- package/dist/cjs/types/db.oauth.d.ts +55 -0
- package/dist/cjs/types/db.oauth.d.ts.map +1 -0
- package/dist/cjs/types/db.partnerApiKey.cjs +2 -0
- package/dist/cjs/types/db.partnerApiKey.d.ts +15 -0
- package/dist/cjs/types/db.partnerApiKey.d.ts.map +1 -0
- package/dist/cjs/types/db.paymentPending.cjs +2 -0
- package/dist/cjs/types/db.paymentPending.d.ts +16 -0
- package/dist/cjs/types/db.paymentPending.d.ts.map +1 -0
- package/dist/cjs/types/db.service.cjs +15 -0
- package/dist/cjs/types/db.service.d.ts +145 -0
- package/dist/cjs/types/db.service.d.ts.map +1 -0
- package/dist/cjs/types/db.tax.cjs +2 -0
- package/dist/cjs/types/db.tax.d.ts.map +1 -0
- package/dist/cjs/types/db.tenant.cjs +2 -0
- package/dist/cjs/types/db.tenant.d.ts +118 -0
- package/dist/cjs/types/db.tenant.d.ts.map +1 -0
- package/dist/cjs/types/db.tenantGroupedStat.cjs +2 -0
- package/dist/cjs/types/db.tenantGroupedStat.d.ts +13 -0
- package/dist/cjs/types/db.tenantGroupedStat.d.ts.map +1 -0
- package/dist/cjs/types/db.user.cjs +7 -0
- package/dist/cjs/types/db.user.d.ts +81 -0
- package/dist/cjs/types/db.user.d.ts.map +1 -0
- package/dist/cjs/types/db.userConfirmation.cjs +2 -0
- package/dist/cjs/types/db.userConfirmation.d.ts +17 -0
- package/dist/cjs/types/db.userConfirmation.d.ts.map +1 -0
- package/dist/cjs/types/db.userLoginSession.cjs +2 -0
- package/dist/cjs/types/db.userLoginSession.d.ts +28 -0
- package/dist/cjs/types/db.userLoginSession.d.ts.map +1 -0
- package/dist/cjs/types/db.webhook.cjs +10 -0
- package/dist/cjs/types/db.webhook.d.ts +16 -0
- package/dist/cjs/types/db.webhook.d.ts.map +1 -0
- package/dist/cjs/types/discover.cjs +2 -0
- package/dist/cjs/types/discover.d.ts +45 -0
- package/dist/cjs/types/discover.d.ts.map +1 -0
- package/dist/cjs/types/errorCodes.cjs +150 -0
- package/dist/cjs/types/errorCodes.d.ts +147 -0
- package/dist/cjs/types/errorCodes.d.ts.map +1 -0
- package/dist/cjs/types/index.cjs +44 -0
- package/dist/cjs/types/index.d.ts +84 -0
- package/dist/cjs/types/index.d.ts.map +1 -0
- package/dist/cjs/types/oauthScopes.cjs +33 -0
- package/dist/cjs/types/oauthScopes.d.ts +7 -0
- package/dist/cjs/types/oauthScopes.d.ts.map +1 -0
- package/dist/cjs/types/partnerDto.cjs +2 -0
- package/dist/cjs/types/partnerDto.d.ts +69 -0
- package/dist/cjs/types/partnerDto.d.ts.map +1 -0
- package/dist/cjs/types/pricing.cjs +2 -0
- package/dist/cjs/types/pricing.d.ts +31 -0
- package/dist/cjs/types/pricing.d.ts.map +1 -0
- package/dist/cjs/types/requestResponse.cjs +2 -0
- package/dist/cjs/types/requestResponse.d.ts +93 -0
- package/dist/cjs/types/requestResponse.d.ts.map +1 -0
- package/dist/cjs/types/subscription.cjs +2 -0
- package/dist/cjs/types/subscription.d.ts +50 -0
- package/dist/cjs/types/subscription.d.ts.map +1 -0
- package/dist/cjs/utils/bookingEmbed.cjs +178 -0
- package/dist/cjs/utils/bookingEmbed.d.ts +61 -0
- package/dist/cjs/utils/bookingEmbed.d.ts.map +1 -0
- package/dist/cjs/utils/bookingPageIcons.cjs +218 -0
- package/dist/cjs/utils/bookingPageIcons.d.ts +160 -0
- package/dist/cjs/utils/bookingPageIcons.d.ts.map +1 -0
- package/dist/cjs/utils/bookingProviders.cjs +27 -0
- package/dist/cjs/utils/bookingProviders.d.ts +25 -0
- package/dist/cjs/utils/bookingProviders.d.ts.map +1 -0
- package/dist/cjs/utils/currencies.cjs +148 -0
- package/dist/cjs/utils/currencies.d.ts +6 -0
- package/dist/cjs/utils/currencies.d.ts.map +1 -0
- package/dist/cjs/utils/dateTime.cjs +192 -0
- package/dist/cjs/utils/dateTime.d.ts +57 -0
- package/dist/cjs/utils/dateTime.d.ts.map +1 -0
- package/dist/cjs/utils/embedFrameLoader.cjs +76 -0
- package/dist/cjs/utils/embedFrameLoader.d.ts +15 -0
- package/dist/cjs/utils/embedFrameLoader.d.ts.map +1 -0
- package/dist/cjs/utils/extensionToContentType.cjs +24 -0
- package/dist/cjs/utils/extensionToContentType.d.ts +21 -0
- package/dist/cjs/utils/extensionToContentType.d.ts.map +1 -0
- package/dist/cjs/utils/generateUsername.cjs +7 -0
- package/dist/cjs/utils/generateUsername.d.ts.map +1 -0
- package/dist/cjs/utils/index.cjs +65 -0
- package/dist/cjs/utils/index.d.ts +26 -0
- package/dist/cjs/utils/index.d.ts.map +1 -0
- package/dist/cjs/utils/random.cjs +13 -0
- package/dist/cjs/utils/random.d.ts +3 -0
- package/dist/cjs/utils/random.d.ts.map +1 -0
- package/dist/cjs/utils/serviceReminderLabels.cjs +22 -0
- package/dist/cjs/utils/serviceReminderLabels.d.ts +5 -0
- package/dist/cjs/utils/serviceReminderLabels.d.ts.map +1 -0
- package/dist/cjs/utils/tenantSlug.cjs +299 -0
- package/dist/cjs/utils/tenantSlug.d.ts +7 -0
- package/dist/cjs/utils/tenantSlug.d.ts.map +1 -0
- package/dist/cjs/utils/textSlug.cjs +14 -0
- package/dist/cjs/utils/textSlug.d.ts +3 -0
- package/dist/cjs/utils/textSlug.d.ts.map +1 -0
- package/dist/cjs/utils/timezone.cjs +96 -0
- package/dist/cjs/utils/timezone.d.ts +2 -0
- package/dist/cjs/utils/timezone.d.ts.map +1 -0
- package/dist/cjs/utils/ucfirst.cjs +9 -0
- package/dist/cjs/utils/ucfirst.d.ts +2 -0
- package/dist/cjs/utils/ucfirst.d.ts.map +1 -0
- package/dist/constants/emailUnsubscribeReasons.d.ts +4 -0
- package/dist/constants/emailUnsubscribeReasons.d.ts.map +1 -0
- package/dist/constants/emailUnsubscribeReasons.js +10 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/types/db.availability.d.ts +33 -0
- package/dist/types/db.availability.d.ts.map +1 -0
- package/dist/types/db.availability.js +9 -0
- package/dist/types/db.booking.d.ts +101 -0
- package/dist/types/db.booking.d.ts.map +1 -0
- package/dist/types/db.booking.js +1 -0
- package/dist/types/db.customers.d.ts +14 -0
- package/dist/types/db.customers.d.ts.map +1 -0
- package/dist/types/db.customers.js +1 -0
- package/dist/types/db.d.ts +11 -0
- package/dist/types/db.d.ts.map +1 -0
- package/dist/types/db.directory.d.ts +38 -0
- package/dist/types/db.directory.d.ts.map +1 -0
- package/dist/types/db.directory.js +1 -0
- package/dist/types/db.emailFlow.d.ts +29 -0
- package/dist/types/db.emailFlow.d.ts.map +1 -0
- package/dist/types/db.emailFlow.js +1 -0
- package/dist/types/db.js +1 -0
- package/dist/types/db.mcpUserContext.d.ts +29 -0
- package/dist/types/db.mcpUserContext.d.ts.map +1 -0
- package/dist/types/db.mcpUserContext.js +1 -0
- package/dist/types/db.notification.d.ts +27 -0
- package/dist/types/db.notification.d.ts.map +1 -0
- package/dist/types/db.notification.js +1 -0
- package/dist/types/db.oauth.d.ts +55 -0
- package/dist/types/db.oauth.d.ts.map +1 -0
- package/dist/types/db.oauth.js +1 -0
- package/dist/types/db.partnerApiKey.d.ts +15 -0
- package/dist/types/db.partnerApiKey.d.ts.map +1 -0
- package/dist/types/db.partnerApiKey.js +1 -0
- package/dist/types/db.paymentPending.d.ts +16 -0
- package/dist/types/db.paymentPending.d.ts.map +1 -0
- package/dist/types/db.paymentPending.js +1 -0
- package/dist/types/db.service.d.ts +145 -0
- package/dist/types/db.service.d.ts.map +1 -0
- package/dist/types/db.service.js +12 -0
- package/dist/types/db.tax.d.ts.map +1 -0
- package/dist/types/db.tenant.d.ts +118 -0
- package/dist/types/db.tenant.d.ts.map +1 -0
- package/dist/types/db.tenant.js +1 -0
- package/dist/types/db.tenantGroupedStat.d.ts +13 -0
- package/dist/types/db.tenantGroupedStat.d.ts.map +1 -0
- package/dist/types/db.tenantGroupedStat.js +1 -0
- package/dist/types/db.user.d.ts +81 -0
- package/dist/types/db.user.d.ts.map +1 -0
- package/dist/types/db.user.js +4 -0
- package/dist/types/db.userConfirmation.d.ts +17 -0
- package/dist/types/db.userConfirmation.d.ts.map +1 -0
- package/dist/types/db.userConfirmation.js +1 -0
- package/dist/types/db.userLoginSession.d.ts +28 -0
- package/dist/types/db.userLoginSession.d.ts.map +1 -0
- package/dist/types/db.userLoginSession.js +1 -0
- package/dist/types/db.webhook.d.ts +16 -0
- package/dist/types/db.webhook.d.ts.map +1 -0
- package/dist/types/db.webhook.js +7 -0
- package/dist/types/discover.d.ts +45 -0
- package/dist/types/discover.d.ts.map +1 -0
- package/dist/types/discover.js +1 -0
- package/dist/types/errorCodes.d.ts +147 -0
- package/dist/types/errorCodes.d.ts.map +1 -0
- package/dist/types/errorCodes.js +147 -0
- package/dist/types/index.d.ts +84 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +28 -0
- package/dist/types/oauthScopes.d.ts +7 -0
- package/dist/types/oauthScopes.d.ts.map +1 -0
- package/dist/types/oauthScopes.js +28 -0
- package/dist/types/partnerDto.d.ts +69 -0
- package/dist/types/partnerDto.d.ts.map +1 -0
- package/dist/types/partnerDto.js +1 -0
- package/dist/types/pricing.d.ts +31 -0
- package/dist/types/pricing.d.ts.map +1 -0
- package/dist/types/pricing.js +1 -0
- package/dist/types/requestResponse.d.ts +93 -0
- package/dist/types/requestResponse.d.ts.map +1 -0
- package/dist/types/requestResponse.js +1 -0
- package/dist/types/subscription.d.ts +50 -0
- package/dist/types/subscription.d.ts.map +1 -0
- package/dist/types/subscription.js +1 -0
- package/dist/utils/bookingEmbed.d.ts +61 -0
- package/dist/utils/bookingEmbed.d.ts.map +1 -0
- package/dist/utils/bookingEmbed.js +161 -0
- package/dist/utils/bookingPageIcons.d.ts +160 -0
- package/dist/utils/bookingPageIcons.d.ts.map +1 -0
- package/dist/utils/bookingPageIcons.js +214 -0
- package/dist/utils/bookingProviders.d.ts +25 -0
- package/dist/utils/bookingProviders.d.ts.map +1 -0
- package/dist/utils/bookingProviders.js +23 -0
- package/dist/utils/currencies.d.ts +6 -0
- package/dist/utils/currencies.d.ts.map +1 -0
- package/dist/utils/currencies.js +145 -0
- package/dist/utils/dateTime.d.ts +57 -0
- package/dist/utils/dateTime.d.ts.map +1 -0
- package/dist/utils/dateTime.js +150 -0
- package/dist/utils/embedFrameLoader.d.ts +15 -0
- package/dist/utils/embedFrameLoader.d.ts.map +1 -0
- package/dist/utils/embedFrameLoader.js +70 -0
- package/dist/utils/extensionToContentType.d.ts +21 -0
- package/dist/utils/extensionToContentType.d.ts.map +1 -0
- package/dist/utils/extensionToContentType.js +20 -0
- package/dist/utils/generateUsername.d.ts.map +1 -0
- package/dist/utils/index.d.ts +26 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +45 -0
- package/dist/utils/random.d.ts +3 -0
- package/dist/utils/random.d.ts.map +1 -0
- package/dist/utils/random.js +8 -0
- package/dist/utils/serviceReminderLabels.d.ts +5 -0
- package/dist/utils/serviceReminderLabels.d.ts.map +1 -0
- package/dist/utils/serviceReminderLabels.js +18 -0
- package/dist/utils/tenantSlug.d.ts +7 -0
- package/dist/utils/tenantSlug.d.ts.map +1 -0
- package/dist/utils/tenantSlug.js +293 -0
- package/dist/utils/textSlug.d.ts +3 -0
- package/dist/utils/textSlug.d.ts.map +1 -0
- package/dist/utils/textSlug.js +10 -0
- package/dist/utils/timezone.d.ts +2 -0
- package/dist/utils/timezone.d.ts.map +1 -0
- package/dist/utils/timezone.js +93 -0
- package/dist/utils/ucfirst.d.ts +2 -0
- package/dist/utils/ucfirst.d.ts.map +1 -0
- package/dist/utils/ucfirst.js +5 -0
- package/package.json +46 -0
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { DurationUnit, Service } from "./db.service.js";
|
|
2
|
+
import { Staff } from "./db.user.js";
|
|
3
|
+
import { Directory } from "./db.directory.js";
|
|
4
|
+
import { Notification } from "./db.notification.js";
|
|
5
|
+
export type ResponseStatusMessages = "SUCCESS" | "ERROR";
|
|
6
|
+
export interface RequestResponse<T> {
|
|
7
|
+
data: T;
|
|
8
|
+
statusMessage: ResponseStatusMessages;
|
|
9
|
+
}
|
|
10
|
+
export type AuthCodeResponseType = "WAIT" | "SENT";
|
|
11
|
+
export interface AvailabilityDay {
|
|
12
|
+
label: string;
|
|
13
|
+
date: string;
|
|
14
|
+
available: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface ServiceLookupResponse {
|
|
17
|
+
service: Service;
|
|
18
|
+
availability: {
|
|
19
|
+
days: AvailabilityDay[];
|
|
20
|
+
};
|
|
21
|
+
tenant: {
|
|
22
|
+
name: string;
|
|
23
|
+
logoUrl: string;
|
|
24
|
+
timezone: string;
|
|
25
|
+
id: string;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export type DaySlotsResponse = {
|
|
29
|
+
tenantId: string;
|
|
30
|
+
serviceId: string;
|
|
31
|
+
date: string;
|
|
32
|
+
timezone: string;
|
|
33
|
+
timezones: string[];
|
|
34
|
+
schedule: {
|
|
35
|
+
isOpen: boolean;
|
|
36
|
+
openWindows: Array<{
|
|
37
|
+
start: string;
|
|
38
|
+
end: string;
|
|
39
|
+
}>;
|
|
40
|
+
};
|
|
41
|
+
slotConfig: {
|
|
42
|
+
duration: number;
|
|
43
|
+
durationUnit: DurationUnit;
|
|
44
|
+
};
|
|
45
|
+
slots: Array<{
|
|
46
|
+
id: string;
|
|
47
|
+
start: string;
|
|
48
|
+
end: string;
|
|
49
|
+
label: string;
|
|
50
|
+
/** Canonical UTC start time (stable across timezone views) */
|
|
51
|
+
canonicalStartUtc?: string;
|
|
52
|
+
available: boolean;
|
|
53
|
+
reason?: "booked" | "buffer" | "closed" | "max_per_day_reached" | "past" | "staff_unavailable" | "too_far_in_advance" | "too_soon";
|
|
54
|
+
/** When service allows staff picking, lists staffs available for this slot */
|
|
55
|
+
availableStaffs: Staff[];
|
|
56
|
+
/** For group bookings: how many participants already booked for this exact slot (and provider, when applicable). */
|
|
57
|
+
bookedCount?: number;
|
|
58
|
+
/** For group bookings: max participants allowed for this slot (capacity). */
|
|
59
|
+
maxParticipants?: number;
|
|
60
|
+
/** For group bookings: maxParticipants - bookedCount. */
|
|
61
|
+
remainingSeats?: number;
|
|
62
|
+
/** For group bookings with provider selection: remaining seats per provider for this exact slot. */
|
|
63
|
+
remainingSeatsByStaffId?: Record<string, number>;
|
|
64
|
+
/** For group bookings with provider selection: booked count per provider for this exact slot. */
|
|
65
|
+
bookedCountByStaffId?: Record<string, number>;
|
|
66
|
+
}>;
|
|
67
|
+
warnings?: Array<{
|
|
68
|
+
code: "CLOSED" | "MAX_PER_DAY_REACHED" | "NO_SLOTS" | "INVALID_DATE" | "SERVICE_NOT_BOOKABLE";
|
|
69
|
+
message: string;
|
|
70
|
+
}>;
|
|
71
|
+
};
|
|
72
|
+
export interface DirectoryListItem {
|
|
73
|
+
id?: string;
|
|
74
|
+
tenantId: string;
|
|
75
|
+
serviceId: string;
|
|
76
|
+
createdAt?: string;
|
|
77
|
+
data: Directory["data"];
|
|
78
|
+
}
|
|
79
|
+
export interface DirectoryListResponse {
|
|
80
|
+
page: number;
|
|
81
|
+
pageSize: number;
|
|
82
|
+
total: number;
|
|
83
|
+
items: DirectoryListItem[];
|
|
84
|
+
}
|
|
85
|
+
export type { DiscoverItem, DiscoverResponse, DiscoverSort, DiscoverLocationFilter } from "./discover.js";
|
|
86
|
+
export interface NotificationListResponse {
|
|
87
|
+
page: number;
|
|
88
|
+
pageSize: number;
|
|
89
|
+
total: number;
|
|
90
|
+
items: Notification[];
|
|
91
|
+
unreadCount?: number;
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=requestResponse.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"requestResponse.d.ts","sourceRoot":"","sources":["../../../src/types/requestResponse.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export type SubscriptionTypes = "free" | "starter" | "teams" | "enterprise";
|
|
2
|
+
export interface Subscription {
|
|
3
|
+
rank: number;
|
|
4
|
+
prices: {
|
|
5
|
+
monthly: number;
|
|
6
|
+
yearly: number;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Number of seats/users in the subscription per business
|
|
10
|
+
*/
|
|
11
|
+
seats: number;
|
|
12
|
+
/**
|
|
13
|
+
* Whether the subscription includes payment processing
|
|
14
|
+
*/
|
|
15
|
+
payment: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Whether the system should show Powered by FoxScheduling branding
|
|
18
|
+
*/
|
|
19
|
+
branding: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Number of services in the subscription per business
|
|
22
|
+
*/
|
|
23
|
+
services: number;
|
|
24
|
+
/**
|
|
25
|
+
* Number of calendars/availability group in the subscription per business
|
|
26
|
+
*/
|
|
27
|
+
calendars: number;
|
|
28
|
+
/**
|
|
29
|
+
* Number of businesses in the subscription
|
|
30
|
+
*/
|
|
31
|
+
businesses: number;
|
|
32
|
+
/**
|
|
33
|
+
* Number of bookings per month
|
|
34
|
+
*/
|
|
35
|
+
bookingsPerMonth: number;
|
|
36
|
+
/**
|
|
37
|
+
* Number of AI calls per day
|
|
38
|
+
*/
|
|
39
|
+
aiCallsPerDay: number;
|
|
40
|
+
/**
|
|
41
|
+
* Whether the subscription includes services to be listed in directories
|
|
42
|
+
*/
|
|
43
|
+
servicesToDirectories: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Max configurable email flow templates per business (all flow types combined)
|
|
46
|
+
*/
|
|
47
|
+
emailFlows: number;
|
|
48
|
+
type: SubscriptionTypes;
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=subscription.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscription.d.ts","sourceRoot":"","sources":["../../../src/types/subscription.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,YAAY,CAAC;AAC5E,MAAM,WAAW,YAAY;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE;QACJ,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE,MAAM,CAAC;KAClB,CAAC;IACF;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB;;OAEG;IACH,QAAQ,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,gBAAgB,EAAE,MAAM,CAAC;IACzB;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,qBAAqB,EAAE,OAAO,CAAC;IAC/B;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,iBAAiB,CAAC;CAC3B"}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Booking page embed URL and snippet builders (iframe + popup widget).
|
|
4
|
+
* Used by dashboard UI and the hosted embed.js loader.
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.EMBED_IFRAME_BORDER_RADIUS_PX = exports.EMBED_DEFAULT_SHOW_THEME_TOGGLE = exports.EMBED_DEFAULT_HIDE_PAGE_DETAILS = exports.EMBED_MODAL_MAX_WIDTH_CAP_PX = exports.EMBED_MODAL_DEFAULT_MAX_WIDTH_PX = exports.getEmbedFrameLoaderHtml = exports.getEmbedFrameLoaderCss = exports.EMBED_FRAME_WRAP_CLASS = exports.EMBED_FRAME_LOADER_LABEL = exports.EMBED_FRAME_LOADER_CLASS = exports.EMBED_FRAME_LOAD_TIMEOUT_MS = exports.EMBED_FRAME_DEFAULT_HEIGHT_PX = void 0;
|
|
8
|
+
exports.buildBookingEmbedUrl = buildBookingEmbedUrl;
|
|
9
|
+
exports.resolveBookingEmbedBaseUrl = resolveBookingEmbedBaseUrl;
|
|
10
|
+
exports.buildInlineIframeEmbedCode = buildInlineIframeEmbedCode;
|
|
11
|
+
exports.isValidWidgetTriggerId = isValidWidgetTriggerId;
|
|
12
|
+
exports.escapeHtmlAttribute = escapeHtmlAttribute;
|
|
13
|
+
exports.buildWidgetScriptSnippet = buildWidgetScriptSnippet;
|
|
14
|
+
exports.parseWidgetConfigFromScriptDataset = parseWidgetConfigFromScriptDataset;
|
|
15
|
+
const embedFrameLoader_js_1 = require("./embedFrameLoader.cjs");
|
|
16
|
+
var embedFrameLoader_js_2 = require("./embedFrameLoader.cjs");
|
|
17
|
+
Object.defineProperty(exports, "EMBED_FRAME_DEFAULT_HEIGHT_PX", { enumerable: true, get: function () { return embedFrameLoader_js_2.EMBED_FRAME_DEFAULT_HEIGHT_PX; } });
|
|
18
|
+
Object.defineProperty(exports, "EMBED_FRAME_LOAD_TIMEOUT_MS", { enumerable: true, get: function () { return embedFrameLoader_js_2.EMBED_FRAME_LOAD_TIMEOUT_MS; } });
|
|
19
|
+
Object.defineProperty(exports, "EMBED_FRAME_LOADER_CLASS", { enumerable: true, get: function () { return embedFrameLoader_js_2.EMBED_FRAME_LOADER_CLASS; } });
|
|
20
|
+
Object.defineProperty(exports, "EMBED_FRAME_LOADER_LABEL", { enumerable: true, get: function () { return embedFrameLoader_js_2.EMBED_FRAME_LOADER_LABEL; } });
|
|
21
|
+
Object.defineProperty(exports, "EMBED_FRAME_WRAP_CLASS", { enumerable: true, get: function () { return embedFrameLoader_js_2.EMBED_FRAME_WRAP_CLASS; } });
|
|
22
|
+
Object.defineProperty(exports, "getEmbedFrameLoaderCss", { enumerable: true, get: function () { return embedFrameLoader_js_2.getEmbedFrameLoaderCss; } });
|
|
23
|
+
Object.defineProperty(exports, "getEmbedFrameLoaderHtml", { enumerable: true, get: function () { return embedFrameLoader_js_2.getEmbedFrameLoaderHtml; } });
|
|
24
|
+
/** Popup widget max width on large viewports (full width on small phones). */
|
|
25
|
+
exports.EMBED_MODAL_DEFAULT_MAX_WIDTH_PX = 1150;
|
|
26
|
+
exports.EMBED_MODAL_MAX_WIDTH_CAP_PX = 1400;
|
|
27
|
+
exports.EMBED_DEFAULT_HIDE_PAGE_DETAILS = false;
|
|
28
|
+
exports.EMBED_DEFAULT_SHOW_THEME_TOGGLE = true;
|
|
29
|
+
exports.EMBED_IFRAME_BORDER_RADIUS_PX = {
|
|
30
|
+
none: "0",
|
|
31
|
+
sm: "4",
|
|
32
|
+
medium: "8",
|
|
33
|
+
lg: "12",
|
|
34
|
+
xl: "16",
|
|
35
|
+
"2xl": "24",
|
|
36
|
+
};
|
|
37
|
+
const IFRAME_SANDBOX = "allow-forms allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox allow-top-navigation-by-user-activation";
|
|
38
|
+
function buildBookingEmbedUrl(baseUrl, options = {}) {
|
|
39
|
+
const trimmed = baseUrl.trim().replace(/\/+$/, "");
|
|
40
|
+
if (!trimmed)
|
|
41
|
+
return "";
|
|
42
|
+
const params = new URLSearchParams();
|
|
43
|
+
if (options.hidePageDetails)
|
|
44
|
+
params.set("hidePageDetails", "true");
|
|
45
|
+
if (options.showBackLink === false)
|
|
46
|
+
params.set("showBackLink", "false");
|
|
47
|
+
else if (options.showBackLink)
|
|
48
|
+
params.set("showBackLink", "true");
|
|
49
|
+
if (options.showThemeToggle !== undefined) {
|
|
50
|
+
params.set("showThemeToggle", options.showThemeToggle ? "true" : "false");
|
|
51
|
+
}
|
|
52
|
+
if (options.theme && options.theme !== "auto") {
|
|
53
|
+
params.set("theme", options.theme);
|
|
54
|
+
}
|
|
55
|
+
const qs = params.toString();
|
|
56
|
+
return qs ? `${trimmed}?${qs}` : trimmed;
|
|
57
|
+
}
|
|
58
|
+
function resolveBookingEmbedBaseUrl(bookingBaseUrl, servicePath) {
|
|
59
|
+
const base = bookingBaseUrl.trim().replace(/\/+$/, "");
|
|
60
|
+
if (!servicePath?.trim())
|
|
61
|
+
return base;
|
|
62
|
+
const segment = servicePath.trim().replace(/^\/+/, "");
|
|
63
|
+
return segment ? `${base}/${segment}` : base;
|
|
64
|
+
}
|
|
65
|
+
function buildInlineIframeEmbedCode(embedUrl, borderRadiusKey, heightPx = embedFrameLoader_js_1.EMBED_FRAME_DEFAULT_HEIGHT_PX) {
|
|
66
|
+
const radiusPx = exports.EMBED_IFRAME_BORDER_RADIUS_PX[borderRadiusKey] ?? "8";
|
|
67
|
+
const safeUrl = escapeHtmlAttribute(embedUrl);
|
|
68
|
+
const height = Number.isFinite(heightPx) && heightPx > 0 ? Math.round(heightPx) : embedFrameLoader_js_1.EMBED_FRAME_DEFAULT_HEIGHT_PX;
|
|
69
|
+
const wrapperStyle = `position:relative;border-radius:${radiusPx}px;overflow:hidden;min-height:${height}px;`;
|
|
70
|
+
const loaderCss = (0, embedFrameLoader_js_1.getEmbedFrameLoaderCss)(`.${embedFrameLoader_js_1.EMBED_FRAME_WRAP_CLASS}`);
|
|
71
|
+
const loaderHtml = (0, embedFrameLoader_js_1.getEmbedFrameLoaderHtml)();
|
|
72
|
+
const initScript = (0, embedFrameLoader_js_1.buildEmbedFrameLoadInitScript)();
|
|
73
|
+
return `<style>${loaderCss}</style><div class="${embedFrameLoader_js_1.EMBED_FRAME_WRAP_CLASS}" style="${wrapperStyle}" aria-busy="true">${loaderHtml}<iframe src="${safeUrl}" width="100%" height="${height}" frameborder="0" loading="eager" referrerpolicy="no-referrer-when-downgrade" sandbox="${IFRAME_SANDBOX}" title="Book appointment"></iframe>${initScript}</div>`;
|
|
74
|
+
}
|
|
75
|
+
/** Valid HTML id for data-trigger-id (no # prefix). */
|
|
76
|
+
function isValidWidgetTriggerId(id) {
|
|
77
|
+
const trimmed = id.trim();
|
|
78
|
+
return /^[A-Za-z][\w-]*$/.test(trimmed) && trimmed.length <= 100;
|
|
79
|
+
}
|
|
80
|
+
function escapeHtmlAttribute(value) {
|
|
81
|
+
return value
|
|
82
|
+
.replace(/&/g, "&")
|
|
83
|
+
.replace(/"/g, """)
|
|
84
|
+
.replace(/</g, "<");
|
|
85
|
+
}
|
|
86
|
+
function buildWidgetScriptSnippet(config) {
|
|
87
|
+
const bookingBase = resolveBookingEmbedBaseUrl(config.bookingBaseUrl, config.servicePath);
|
|
88
|
+
const embedUrl = buildBookingEmbedUrl(bookingBase, {
|
|
89
|
+
hidePageDetails: config.hidePageDetails ?? exports.EMBED_DEFAULT_HIDE_PAGE_DETAILS,
|
|
90
|
+
showBackLink: config.showBackLink ?? true,
|
|
91
|
+
showThemeToggle: config.showThemeToggle ?? exports.EMBED_DEFAULT_SHOW_THEME_TOGGLE,
|
|
92
|
+
theme: config.theme,
|
|
93
|
+
});
|
|
94
|
+
const scriptSrc = `${config.scriptOrigin.replace(/\/+$/, "")}/embed.js`;
|
|
95
|
+
const useExistingButton = config.buttonMode === "existing" &&
|
|
96
|
+
config.triggerId?.trim() &&
|
|
97
|
+
isValidWidgetTriggerId(config.triggerId);
|
|
98
|
+
const attrs = {
|
|
99
|
+
src: scriptSrc,
|
|
100
|
+
async: "",
|
|
101
|
+
"data-booking-url": embedUrl,
|
|
102
|
+
};
|
|
103
|
+
if (useExistingButton) {
|
|
104
|
+
attrs["data-trigger-id"] = config.triggerId.trim();
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
attrs["data-button-text"] = config.button.text;
|
|
108
|
+
attrs["data-button-bg"] = config.button.backgroundColor;
|
|
109
|
+
attrs["data-button-color"] = config.button.textColor;
|
|
110
|
+
attrs["data-button-radius"] = String(config.button.borderRadiusPx);
|
|
111
|
+
if (config.button.fontSizePx != null) {
|
|
112
|
+
attrs["data-button-font-size"] = String(config.button.fontSizePx);
|
|
113
|
+
}
|
|
114
|
+
if (config.button.paddingXpx != null) {
|
|
115
|
+
attrs["data-button-padding-x"] = String(config.button.paddingXpx);
|
|
116
|
+
}
|
|
117
|
+
if (config.button.paddingYpx != null) {
|
|
118
|
+
attrs["data-button-padding-y"] = String(config.button.paddingYpx);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
if (config.openMode === "newTab") {
|
|
122
|
+
attrs["data-open-mode"] = "new-tab";
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
if (config.modalMaxWidthPx != null) {
|
|
126
|
+
attrs["data-modal-max-width"] = String(config.modalMaxWidthPx);
|
|
127
|
+
}
|
|
128
|
+
if (config.iframeBorderRadiusPx != null) {
|
|
129
|
+
attrs["data-iframe-radius"] = String(config.iframeBorderRadiusPx);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
const attrString = Object.entries(attrs)
|
|
133
|
+
.map(([key, value]) => {
|
|
134
|
+
if (value === "")
|
|
135
|
+
return key;
|
|
136
|
+
return `${key}="${escapeHtmlAttribute(value)}"`;
|
|
137
|
+
})
|
|
138
|
+
.join("\n ");
|
|
139
|
+
return `<script\n ${attrString}\n></script>`;
|
|
140
|
+
}
|
|
141
|
+
/** Parse data-* attributes from the embed script tag (hosted embed.js). */
|
|
142
|
+
function parseWidgetConfigFromScriptDataset(dataset) {
|
|
143
|
+
const bookingUrl = dataset.bookingUrl?.trim();
|
|
144
|
+
if (!bookingUrl)
|
|
145
|
+
return null;
|
|
146
|
+
const triggerRaw = dataset.triggerId?.trim();
|
|
147
|
+
const triggerId = triggerRaw && isValidWidgetTriggerId(triggerRaw) ? triggerRaw : undefined;
|
|
148
|
+
const text = dataset.buttonText?.trim() || "Book now";
|
|
149
|
+
const backgroundColor = dataset.buttonBg?.trim() || "#0ea5e9";
|
|
150
|
+
const textColor = dataset.buttonColor?.trim() || "#ffffff";
|
|
151
|
+
const borderRadiusPx = Number.parseInt(dataset.buttonRadius ?? "8", 10) || 8;
|
|
152
|
+
const fontSizePx = dataset.buttonFontSize
|
|
153
|
+
? Number.parseInt(dataset.buttonFontSize, 10)
|
|
154
|
+
: undefined;
|
|
155
|
+
const paddingXpx = dataset.buttonPaddingX
|
|
156
|
+
? Number.parseInt(dataset.buttonPaddingX, 10)
|
|
157
|
+
: undefined;
|
|
158
|
+
const paddingYpx = dataset.buttonPaddingY
|
|
159
|
+
? Number.parseInt(dataset.buttonPaddingY, 10)
|
|
160
|
+
: undefined;
|
|
161
|
+
const openInNewTab = dataset.openMode === "new-tab";
|
|
162
|
+
return {
|
|
163
|
+
bookingUrl,
|
|
164
|
+
triggerId,
|
|
165
|
+
openInNewTab,
|
|
166
|
+
button: {
|
|
167
|
+
text,
|
|
168
|
+
backgroundColor,
|
|
169
|
+
textColor,
|
|
170
|
+
borderRadiusPx,
|
|
171
|
+
fontSizePx: Number.isFinite(fontSizePx) ? fontSizePx : undefined,
|
|
172
|
+
paddingXpx: Number.isFinite(paddingXpx) ? paddingXpx : undefined,
|
|
173
|
+
paddingYpx: Number.isFinite(paddingYpx) ? paddingYpx : undefined,
|
|
174
|
+
},
|
|
175
|
+
modalMaxWidthPx: Number.parseInt(dataset.modalMaxWidth ?? String(exports.EMBED_MODAL_DEFAULT_MAX_WIDTH_PX), 10) || exports.EMBED_MODAL_DEFAULT_MAX_WIDTH_PX,
|
|
176
|
+
iframeBorderRadiusPx: Number.parseInt(dataset.iframeRadius ?? "12", 10) || 12,
|
|
177
|
+
};
|
|
178
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Booking page embed URL and snippet builders (iframe + popup widget).
|
|
3
|
+
* Used by dashboard UI and the hosted embed.js loader.
|
|
4
|
+
*/
|
|
5
|
+
export { EMBED_FRAME_DEFAULT_HEIGHT_PX, EMBED_FRAME_LOAD_TIMEOUT_MS, EMBED_FRAME_LOADER_CLASS, EMBED_FRAME_LOADER_LABEL, EMBED_FRAME_WRAP_CLASS, getEmbedFrameLoaderCss, getEmbedFrameLoaderHtml, } from "./embedFrameLoader.js";
|
|
6
|
+
export type BookingEmbedTheme = "light" | "dark" | "auto";
|
|
7
|
+
export type BookingEmbedOptions = {
|
|
8
|
+
hidePageDetails?: boolean;
|
|
9
|
+
showBackLink?: boolean;
|
|
10
|
+
showThemeToggle?: boolean;
|
|
11
|
+
theme?: BookingEmbedTheme;
|
|
12
|
+
};
|
|
13
|
+
/** Popup widget max width on large viewports (full width on small phones). */
|
|
14
|
+
export declare const EMBED_MODAL_DEFAULT_MAX_WIDTH_PX = 1150;
|
|
15
|
+
export declare const EMBED_MODAL_MAX_WIDTH_CAP_PX = 1400;
|
|
16
|
+
export declare const EMBED_DEFAULT_HIDE_PAGE_DETAILS = false;
|
|
17
|
+
export declare const EMBED_DEFAULT_SHOW_THEME_TOGGLE = true;
|
|
18
|
+
export declare const EMBED_IFRAME_BORDER_RADIUS_PX: Record<string, string>;
|
|
19
|
+
export declare function buildBookingEmbedUrl(baseUrl: string, options?: BookingEmbedOptions): string;
|
|
20
|
+
export declare function resolveBookingEmbedBaseUrl(bookingBaseUrl: string, servicePath?: string): string;
|
|
21
|
+
export declare function buildInlineIframeEmbedCode(embedUrl: string, borderRadiusKey: string, heightPx?: number): string;
|
|
22
|
+
export type WidgetButtonStyle = {
|
|
23
|
+
text: string;
|
|
24
|
+
backgroundColor: string;
|
|
25
|
+
textColor: string;
|
|
26
|
+
borderRadiusPx: number;
|
|
27
|
+
fontSizePx?: number;
|
|
28
|
+
paddingXpx?: number;
|
|
29
|
+
paddingYpx?: number;
|
|
30
|
+
};
|
|
31
|
+
export type WidgetButtonMode = "create" | "existing";
|
|
32
|
+
export type WidgetOpenMode = "popup" | "newTab";
|
|
33
|
+
export type WidgetEmbedConfig = BookingEmbedOptions & {
|
|
34
|
+
scriptOrigin: string;
|
|
35
|
+
bookingBaseUrl: string;
|
|
36
|
+
servicePath?: string;
|
|
37
|
+
/** When `existing`, use `triggerId` and omit injected button styles from the snippet. */
|
|
38
|
+
buttonMode?: WidgetButtonMode;
|
|
39
|
+
/** HTML id of an element on the host page (without #). */
|
|
40
|
+
triggerId?: string;
|
|
41
|
+
/** Popup modal on the same page, or open booking URL in a new browser tab. */
|
|
42
|
+
openMode?: WidgetOpenMode;
|
|
43
|
+
button: WidgetButtonStyle;
|
|
44
|
+
/** Max popup width in px; smaller viewports use available width minus padding. */
|
|
45
|
+
modalMaxWidthPx?: number;
|
|
46
|
+
iframeBorderRadiusPx?: number;
|
|
47
|
+
};
|
|
48
|
+
/** Valid HTML id for data-trigger-id (no # prefix). */
|
|
49
|
+
export declare function isValidWidgetTriggerId(id: string): boolean;
|
|
50
|
+
export declare function escapeHtmlAttribute(value: string): string;
|
|
51
|
+
export declare function buildWidgetScriptSnippet(config: WidgetEmbedConfig): string;
|
|
52
|
+
/** Parse data-* attributes from the embed script tag (hosted embed.js). */
|
|
53
|
+
export declare function parseWidgetConfigFromScriptDataset(dataset: Record<string, string | undefined>): {
|
|
54
|
+
bookingUrl: string;
|
|
55
|
+
triggerId?: string;
|
|
56
|
+
openInNewTab: boolean;
|
|
57
|
+
button: WidgetButtonStyle;
|
|
58
|
+
modalMaxWidthPx: number;
|
|
59
|
+
iframeBorderRadiusPx: number;
|
|
60
|
+
} | null;
|
|
61
|
+
//# sourceMappingURL=bookingEmbed.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bookingEmbed.d.ts","sourceRoot":"","sources":["../../../src/utils/bookingEmbed.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAUH,OAAO,EACL,6BAA6B,EAC7B,2BAA2B,EAC3B,wBAAwB,EACxB,wBAAwB,EACxB,sBAAsB,EACtB,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,uBAAuB,CAAC;AAE/B,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;AAE1D,MAAM,MAAM,mBAAmB,GAAG;IAChC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,KAAK,CAAC,EAAE,iBAAiB,CAAC;CAC3B,CAAC;AAEF,8EAA8E;AAC9E,eAAO,MAAM,gCAAgC,OAAO,CAAC;AACrD,eAAO,MAAM,4BAA4B,OAAO,CAAC;AAEjD,eAAO,MAAM,+BAA+B,QAAQ,CAAC;AACrD,eAAO,MAAM,+BAA+B,OAAO,CAAC;AAEpD,eAAO,MAAM,6BAA6B,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAOhE,CAAC;AAKF,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,mBAAwB,GAChC,MAAM,CAiBR;AAED,wBAAgB,0BAA0B,CACxC,cAAc,EAAE,MAAM,EACtB,WAAW,CAAC,EAAE,MAAM,GACnB,MAAM,CAKR;AAED,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,MAAM,EAChB,eAAe,EAAE,MAAM,EACvB,QAAQ,GAAE,MAAsC,GAC/C,MAAM,CASR;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,UAAU,CAAC;AAErD,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,QAAQ,CAAC;AAEhD,MAAM,MAAM,iBAAiB,GAAG,mBAAmB,GAAG;IACpD,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,yFAAyF;IACzF,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B,0DAA0D;IAC1D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,MAAM,EAAE,iBAAiB,CAAC;IAC1B,kFAAkF;IAClF,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B,CAAC;AAEF,uDAAuD;AACvD,wBAAgB,sBAAsB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAG1D;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAKzD;AAED,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,iBAAiB,GAAG,MAAM,CA6D1E;AAED,2EAA2E;AAC3E,wBAAgB,kCAAkC,CAChD,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,GAC1C;IACD,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,OAAO,CAAC;IACtB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,eAAe,EAAE,MAAM,CAAC;IACxB,oBAAoB,EAAE,MAAM,CAAC;CAC9B,GAAG,IAAI,CA6CP"}
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ACCENT_HEX = exports.ACCENT_GRADIENT_STYLES = exports.ACCENT_PRESETS = exports.PRESET_ACCENTS = exports.BOOKING_PAGE_ICONS = void 0;
|
|
4
|
+
exports.getServiceIconSvg = getServiceIconSvg;
|
|
5
|
+
/** Inline SVG strings for Lucide icons - used in generated booking page HTML */
|
|
6
|
+
const svgBase = 'xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"';
|
|
7
|
+
exports.BOOKING_PAGE_ICONS = {
|
|
8
|
+
clock: `<svg ${svgBase}><circle cx="12" cy="12" r="10"/><path d="M12 6v6l4 2"/></svg>`,
|
|
9
|
+
"dollar-sign": `<svg ${svgBase}><line x1="12" x2="12" y1="2" y2="22"/><path d="M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6"/></svg>`,
|
|
10
|
+
"arrow-right": `<svg ${svgBase}><path d="M5 12h14"/><path d="m12 5 7 7-7 7"/></svg>`,
|
|
11
|
+
tag: `<svg ${svgBase}><path d="M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z"/><circle cx="7.5" cy="7.5" r=".5" fill="currentColor"/></svg>`,
|
|
12
|
+
scissors: `<svg ${svgBase}><circle cx="6" cy="6" r="3"/><path d="M8.12 8.12 12 12"/><path d="M20 4 8.12 15.88"/><circle cx="6" cy="18" r="3"/><path d="M8.12 8.12 12 12"/><path d="M14.88 8.12 12 12"/><path d="M20 4 8.12 15.88"/><path d="M12 12 12 12"/></svg>`,
|
|
13
|
+
sparkles: `<svg ${svgBase}><path d="m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z"/><path d="M5 3v4"/><path d="M19 17v4"/><path d="M3 5h4"/><path d="M17 19h4"/></svg>`,
|
|
14
|
+
heart: `<svg ${svgBase}><path d="M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z"/></svg>`,
|
|
15
|
+
star: `<svg ${svgBase}><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"/></svg>`,
|
|
16
|
+
palette: `<svg ${svgBase}><circle cx="13.5" cy="6.5" r=".5"/><circle cx="17.5" cy="10.5" r=".5"/><circle cx="8.5" cy="7.5" r=".5"/><circle cx="6.5" cy="12.5" r=".5"/><path d="M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.648 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.555C21.965 6.012 17.461 2 12 2z"/></svg>`,
|
|
17
|
+
camera: `<svg ${svgBase}><path d="M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z"/><circle cx="12" cy="13" r="3"/></svg>`,
|
|
18
|
+
music: `<svg ${svgBase}><path d="M9 18V5l12-2v13"/><circle cx="6" cy="18" r="3"/><circle cx="18" cy="16" r="3"/></svg>`,
|
|
19
|
+
briefcase: `<svg ${svgBase}><rect width="20" height="14" x="2" y="7" rx="2" ry="2"/><path d="M16 21V5a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16"/></svg>`,
|
|
20
|
+
dumbbell: `<svg ${svgBase}><path d="M14.4 14.4 9.6 9.6"/><path d="M18.657 21.485a2 2 0 1 1-2.829-2.828l-1.767 1.768a2 2 0 1 1-2.829-2.829l6.364-6.364a2 2 0 1 1 2.829 2.829l-1.768 1.767"/><path d="m21.5 21.5-1.4-1.4"/><path d="M3.9 3.9 2.5 2.5"/><path d="m6.404 12.768 1.414-1.414"/><path d="m12.768 6.404 1.414-1.414"/><path d="m18.657 2.929 1.414-1.414"/><path d="m2.929 18.657 1.414-1.414"/></svg>`,
|
|
21
|
+
car: `<svg ${svgBase}><path d="M19 17h2c.6 0 1-.4 1-1v-3c0-.9-.7-1.7-1.5-1.9C18.7 10.6 16 10 16 10s-1.3-1.4-2.2-2.3c-.5-.4-1.1-.7-1.8-.7H5c-.6 0-1.1.4-1.4.9C2.5 10.2 2 11.5 2 13v3c0 .6.4 1 1 1h2"/><circle cx="7" cy="17" r="2"/><path d="M9 17h6"/><circle cx="17" cy="17" r="2"/></svg>`,
|
|
22
|
+
home: `<svg ${svgBase}><path d="m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/><polyline points="9 22 9 12 15 12 15 22"/></svg>`,
|
|
23
|
+
utensils: `<svg ${svgBase}><path d="M3 2v7c0 1.1.9 2 2 2h4a2 2 0 0 0 2-2V2"/><path d="M7 2v20"/><path d="M21 15V2v0a5 5 0 0 0-5 5v6c0 1.1.9 2 2 2h3Zm0 0v7"/></svg>`,
|
|
24
|
+
coffee: `<svg ${svgBase}><path d="M17 8h1a4 4 0 1 1 0 8h-1"/><path d="M3 8h14v9a4 4 0 0 1-4 4H7a4 4 0 0 1-4-4Z"/><line x1="6" x2="6" y1="2" y2="4"/><line x1="10" x2="10" y1="2" y2="4"/><line x1="14" x2="14" y1="2" y2="4"/></svg>`,
|
|
25
|
+
package: `<svg ${svgBase}><path d="m7.5 4.27 9 5.15"/><path d="M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z"/><path d="m3.3 7 8.7 5 8.7-5"/><path d="M12 22V12"/></svg>`,
|
|
26
|
+
"map-pin": `<svg ${svgBase}><path d="M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z"/><circle cx="12" cy="10" r="3"/></svg>`,
|
|
27
|
+
calendar: `<svg ${svgBase}><path d="M8 2v4"/><path d="M16 2v4"/><rect width="18" height="18" x="3" y="4" rx="2"/><path d="M3 10h18"/></svg>`,
|
|
28
|
+
phone: `<svg ${svgBase}><path d="M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384"/></svg>`,
|
|
29
|
+
mail: `<svg ${svgBase}><path d="m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7"/><rect x="2" y="4" width="20" height="16" rx="2"/></svg>`,
|
|
30
|
+
video: `<svg ${svgBase}><path d="m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5"/><rect x="2" y="6" width="14" height="12" rx="2"/></svg>`,
|
|
31
|
+
stethoscope: `<svg ${svgBase}><path d="M11 2v2"/><path d="M5 2v2"/><path d="M5 3H4a2 2 0 0 0-2 2v4a6 6 0 0 0 12 0V5a2 2 0 0 0-2-2h-1"/><path d="M8 15a6 6 0 0 0 12 0v-3"/><circle cx="20" cy="10" r="2"/></svg>`,
|
|
32
|
+
"book-open": `<svg ${svgBase}><path d="M12 7v14"/><path d="M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z"/></svg>`,
|
|
33
|
+
wrench: `<svg ${svgBase}><path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z"/></svg>`,
|
|
34
|
+
gift: `<svg ${svgBase}><path d="M12 7v14"/><path d="M20 11v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-8"/><path d="M7.5 7a1 1 0 0 1 0-5A4.8 8 0 0 1 12 7a4.8 8 0 0 1 4.5-5 1 1 0 0 1 0 5"/><rect x="3" y="7" width="18" height="4" rx="1"/></svg>`,
|
|
35
|
+
};
|
|
36
|
+
function getServiceIconSvg(iconId) {
|
|
37
|
+
const key = iconId && exports.BOOKING_PAGE_ICONS[iconId] ? iconId : "tag";
|
|
38
|
+
return exports.BOOKING_PAGE_ICONS[key];
|
|
39
|
+
}
|
|
40
|
+
exports.PRESET_ACCENTS = [
|
|
41
|
+
{
|
|
42
|
+
value: "emerald",
|
|
43
|
+
label: "Emerald",
|
|
44
|
+
class: "from-emerald-500 to-teal-600",
|
|
45
|
+
hoverBorder: "hover:border-emerald-500/50",
|
|
46
|
+
hoverText: "group-hover:text-emerald-500",
|
|
47
|
+
active: "border-emerald-500 bg-emerald-500/10 text-emerald-500",
|
|
48
|
+
proseLink: "[&_a]:text-emerald-500 [&_a:hover]:text-emerald-600",
|
|
49
|
+
link: "text-emerald-500 hover:text-emerald-600",
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
value: "violet",
|
|
53
|
+
label: "Violet",
|
|
54
|
+
class: "from-violet-500 to-purple-600",
|
|
55
|
+
hoverBorder: "hover:border-violet-500/50",
|
|
56
|
+
hoverText: "group-hover:text-violet-500",
|
|
57
|
+
active: "border-violet-500 bg-violet-500/10 text-violet-500",
|
|
58
|
+
proseLink: "[&_a]:text-violet-500 [&_a:hover]:text-violet-600",
|
|
59
|
+
link: "text-violet-500 hover:text-violet-600",
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
value: "blue",
|
|
63
|
+
label: "Blue",
|
|
64
|
+
class: "from-blue-500 to-indigo-600",
|
|
65
|
+
hoverBorder: "hover:border-blue-500/50",
|
|
66
|
+
hoverText: "group-hover:text-blue-500",
|
|
67
|
+
active: "border-blue-500 bg-blue-500/10 text-blue-500",
|
|
68
|
+
proseLink: "[&_a]:text-blue-500 [&_a:hover]:text-blue-600",
|
|
69
|
+
link: "text-blue-500 hover:text-blue-600",
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
value: "cyan",
|
|
73
|
+
label: "Cyan",
|
|
74
|
+
class: "from-cyan-500 to-teal-600",
|
|
75
|
+
hoverBorder: "hover:border-cyan-500/50",
|
|
76
|
+
hoverText: "group-hover:text-cyan-500",
|
|
77
|
+
active: "border-cyan-500 bg-cyan-500/10 text-cyan-500",
|
|
78
|
+
proseLink: "[&_a]:text-cyan-500 [&_a:hover]:text-cyan-600",
|
|
79
|
+
link: "text-cyan-500 hover:text-cyan-600",
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
value: "sky",
|
|
83
|
+
label: "Sky",
|
|
84
|
+
class: "from-sky-500 to-blue-600",
|
|
85
|
+
hoverBorder: "hover:border-sky-500/50",
|
|
86
|
+
hoverText: "group-hover:text-sky-500",
|
|
87
|
+
active: "border-sky-500 bg-sky-500/10 text-sky-500",
|
|
88
|
+
proseLink: "[&_a]:text-sky-500 [&_a:hover]:text-sky-600",
|
|
89
|
+
link: "text-sky-500 hover:text-sky-600",
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
value: "indigo",
|
|
93
|
+
label: "Indigo",
|
|
94
|
+
class: "from-indigo-500 to-violet-600",
|
|
95
|
+
hoverBorder: "hover:border-indigo-500/50",
|
|
96
|
+
hoverText: "group-hover:text-indigo-500",
|
|
97
|
+
active: "border-indigo-500 bg-indigo-500/10 text-indigo-500",
|
|
98
|
+
proseLink: "[&_a]:text-indigo-500 [&_a:hover]:text-indigo-600",
|
|
99
|
+
link: "text-indigo-500 hover:text-indigo-600",
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
value: "fuchsia",
|
|
103
|
+
label: "Fuchsia",
|
|
104
|
+
class: "from-fuchsia-500 to-pink-600",
|
|
105
|
+
hoverBorder: "hover:border-fuchsia-500/50",
|
|
106
|
+
hoverText: "group-hover:text-fuchsia-500",
|
|
107
|
+
active: "border-fuchsia-500 bg-fuchsia-500/10 text-fuchsia-500",
|
|
108
|
+
proseLink: "[&_a]:text-fuchsia-500 [&_a:hover]:text-fuchsia-600",
|
|
109
|
+
link: "text-fuchsia-500 hover:text-fuchsia-600",
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
value: "rose",
|
|
113
|
+
label: "Rose",
|
|
114
|
+
class: "from-rose-500 to-pink-600",
|
|
115
|
+
hoverBorder: "hover:border-rose-500/50",
|
|
116
|
+
hoverText: "group-hover:text-rose-500",
|
|
117
|
+
active: "border-rose-500 bg-rose-500/10 text-rose-500",
|
|
118
|
+
proseLink: "[&_a]:text-rose-500 [&_a:hover]:text-rose-600",
|
|
119
|
+
link: "text-rose-500 hover:text-rose-600",
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
value: "amber",
|
|
123
|
+
label: "Amber",
|
|
124
|
+
class: "from-amber-500 to-orange-600",
|
|
125
|
+
hoverBorder: "hover:border-amber-500/50",
|
|
126
|
+
hoverText: "group-hover:text-amber-500",
|
|
127
|
+
active: "border-amber-500 bg-amber-500/10 text-amber-500",
|
|
128
|
+
proseLink: "[&_a]:text-amber-500 [&_a:hover]:text-amber-600",
|
|
129
|
+
link: "text-amber-500 hover:text-amber-600",
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
value: "orange",
|
|
133
|
+
label: "Orange",
|
|
134
|
+
class: "from-orange-500 to-amber-600",
|
|
135
|
+
hoverBorder: "hover:border-orange-500/50",
|
|
136
|
+
hoverText: "group-hover:text-orange-500",
|
|
137
|
+
active: "border-orange-500 bg-orange-500/10 text-orange-500",
|
|
138
|
+
proseLink: "[&_a]:text-orange-500 [&_a:hover]:text-orange-600",
|
|
139
|
+
link: "text-orange-500 hover:text-orange-600",
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
value: "red",
|
|
143
|
+
label: "Red",
|
|
144
|
+
class: "from-red-500 to-rose-600",
|
|
145
|
+
hoverBorder: "hover:border-red-500/50",
|
|
146
|
+
hoverText: "group-hover:text-red-500",
|
|
147
|
+
active: "border-red-500 bg-red-500/10 text-red-500",
|
|
148
|
+
proseLink: "[&_a]:text-red-500 [&_a:hover]:text-red-600",
|
|
149
|
+
link: "text-red-500 hover:text-red-600",
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
value: "lime",
|
|
153
|
+
label: "Lime",
|
|
154
|
+
class: "from-lime-500 to-green-600",
|
|
155
|
+
hoverBorder: "hover:border-lime-500/50",
|
|
156
|
+
hoverText: "group-hover:text-lime-500",
|
|
157
|
+
active: "border-lime-500 bg-lime-500/10 text-lime-500",
|
|
158
|
+
proseLink: "[&_a]:text-lime-500 [&_a:hover]:text-lime-600",
|
|
159
|
+
link: "text-lime-500 hover:text-lime-600",
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
value: "slate",
|
|
163
|
+
label: "Slate",
|
|
164
|
+
class: "from-slate-500 to-slate-700",
|
|
165
|
+
hoverBorder: "hover:border-slate-500/50",
|
|
166
|
+
hoverText: "group-hover:text-slate-500",
|
|
167
|
+
active: "border-slate-500 bg-slate-500/10 text-slate-500",
|
|
168
|
+
proseLink: "[&_a]:text-slate-500 [&_a:hover]:text-slate-600",
|
|
169
|
+
link: "text-slate-500 hover:text-slate-600",
|
|
170
|
+
},
|
|
171
|
+
];
|
|
172
|
+
exports.ACCENT_PRESETS = {
|
|
173
|
+
emerald: { class: "bg-emerald-500 from-emerald-500 to-teal-600", link: "text-emerald-500 hover:text-emerald-600", border: "border-emerald-500 hover:border-emerald-600", hoverBg: "hover:bg-emerald-50" },
|
|
174
|
+
violet: { class: "bg-violet-500 from-violet-500 to-purple-600", link: "text-violet-500 hover:text-violet-600", border: "border-violet-500 hover:border-violet-600", hoverBg: "hover:bg-violet-50" },
|
|
175
|
+
blue: { class: "bg-blue-500 from-blue-500 to-indigo-600", link: "text-blue-500 hover:text-blue-600", border: "border-blue-500 hover:border-blue-600", hoverBg: "hover:bg-blue-50" },
|
|
176
|
+
cyan: { class: "bg-cyan-500 from-cyan-500 to-teal-600", link: "text-cyan-500 hover:text-cyan-600", border: "border-cyan-500 hover:border-cyan-600", hoverBg: "hover:bg-cyan-50" },
|
|
177
|
+
sky: { class: "bg-sky-500 from-sky-500 to-blue-600", link: "text-sky-500 hover:text-sky-600", border: "border-sky-500 hover:border-sky-600", hoverBg: "hover:bg-sky-50" },
|
|
178
|
+
indigo: { class: "bg-indigo-500 from-indigo-500 to-violet-600", link: "text-indigo-500 hover:text-indigo-600", border: "border-indigo-500 hover:border-indigo-600", hoverBg: "hover:bg-indigo-50" },
|
|
179
|
+
fuchsia: { class: "bg-fuchsia-500 from-fuchsia-500 to-pink-600", link: "text-fuchsia-500 hover:text-fuchsia-600", border: "border-fuchsia-500 hover:border-fuchsia-600", hoverBg: "hover:bg-fuchsia-50" },
|
|
180
|
+
rose: { class: "bg-rose-500 from-rose-500 to-pink-600", link: "text-rose-500 hover:text-rose-600", border: "border-rose-500 hover:border-rose-600", hoverBg: "hover:bg-rose-50" },
|
|
181
|
+
amber: { class: "bg-amber-500 from-amber-500 to-orange-600", link: "text-amber-500 hover:text-amber-600", border: "border-amber-500 hover:border-amber-600", hoverBg: "hover:bg-amber-50" },
|
|
182
|
+
orange: { class: "bg-orange-500 from-orange-500 to-amber-600", link: "text-orange-500 hover:text-orange-600", border: "border-orange-500 hover:border-orange-600", hoverBg: "hover:bg-orange-50" },
|
|
183
|
+
red: { class: "bg-red-500 from-red-500 to-rose-600", link: "text-red-500 hover:text-red-600", border: "border-red-500 hover:border-red-600", hoverBg: "hover:bg-red-50" },
|
|
184
|
+
lime: { class: "bg-lime-500 from-lime-500 to-green-600", link: "text-lime-500 hover:text-lime-600", border: "border-lime-500 hover:border-lime-600", hoverBg: "hover:bg-lime-50" },
|
|
185
|
+
slate: { class: "bg-slate-500 from-slate-500 to-slate-700", link: "text-slate-500 hover:text-slate-600", border: "border-slate-500 hover:border-slate-600", hoverBg: "hover:bg-slate-50" },
|
|
186
|
+
};
|
|
187
|
+
/** Hex gradients for accent swatches - Tailwind v4 may not include from-/to- utilities */
|
|
188
|
+
exports.ACCENT_GRADIENT_STYLES = {
|
|
189
|
+
emerald: "linear-gradient(135deg, #10b981, #0d9488)",
|
|
190
|
+
violet: "linear-gradient(135deg, #8b5cf6, #9333ea)",
|
|
191
|
+
blue: "linear-gradient(135deg, #3b82f6, #4f46e5)",
|
|
192
|
+
cyan: "linear-gradient(135deg, #06b6d4, #0d9488)",
|
|
193
|
+
sky: "linear-gradient(135deg, #0ea5e9, #2563eb)",
|
|
194
|
+
indigo: "linear-gradient(135deg, #6366f1, #8b5cf6)",
|
|
195
|
+
fuchsia: "linear-gradient(135deg, #d946ef, #db2777)",
|
|
196
|
+
rose: "linear-gradient(135deg, #f43f5e, #ec4899)",
|
|
197
|
+
amber: "linear-gradient(135deg, #f59e0b, #ea580c)",
|
|
198
|
+
orange: "linear-gradient(135deg, #f97316, #f59e0b)",
|
|
199
|
+
red: "linear-gradient(135deg, #ef4444, #f43f5e)",
|
|
200
|
+
lime: "linear-gradient(135deg, #84cc16, #16a34a)",
|
|
201
|
+
slate: "linear-gradient(135deg, #64748b, #475569)",
|
|
202
|
+
};
|
|
203
|
+
/** Primary hex for each preset - used for grid layout CSS variables */
|
|
204
|
+
exports.ACCENT_HEX = {
|
|
205
|
+
emerald: "#10b981",
|
|
206
|
+
violet: "#8b5cf6",
|
|
207
|
+
blue: "#3b82f6",
|
|
208
|
+
cyan: "#06b6d4",
|
|
209
|
+
sky: "#0ea5e9",
|
|
210
|
+
indigo: "#6366f1",
|
|
211
|
+
fuchsia: "#d946ef",
|
|
212
|
+
rose: "#f43f5e",
|
|
213
|
+
amber: "#f59e0b",
|
|
214
|
+
orange: "#f97316",
|
|
215
|
+
red: "#ef4444",
|
|
216
|
+
lime: "#84cc16",
|
|
217
|
+
slate: "#64748b",
|
|
218
|
+
};
|