@forgebuild/hotal-ui 0.23.20 → 0.23.48

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.
Files changed (3) hide show
  1. package/dist/hotal-ui.js +16327 -8210
  2. package/dist/index.d.ts +87 -0
  3. package/package.json +47 -45
package/dist/index.d.ts CHANGED
@@ -1058,6 +1058,8 @@ export interface BookingSummaryElement extends HTMLElement {
1058
1058
  export interface SearchableSelectOption {
1059
1059
  value: string;
1060
1060
  label: string;
1061
+ /** Right-aligned secondary text on the row (a price, a code) -- shown in the trigger too once selected. */
1062
+ detail?: string;
1061
1063
  /** Passed through untouched on the `change` event -- e.g. an ISO2 code alongside a country name. */
1062
1064
  meta?: unknown;
1063
1065
  }
@@ -1074,6 +1076,8 @@ export interface SearchableSelectElement extends HTMLElement {
1074
1076
  placeholder?: string;
1075
1077
  variant?: 'phone' | 'country' | '';
1076
1078
  searchPlaceholder?: string;
1079
+ /** Hide the search box -- for short lists where filtering is noise. */
1080
+ noSearch?: boolean;
1077
1081
  }
1078
1082
 
1079
1083
  export interface BookingConfirmedElement extends HTMLElement {
@@ -1130,8 +1134,91 @@ export interface RestaurantOrderFormElement extends HTMLElement {
1130
1134
  placeOrder?: (params: RestaurantOrderPlaceParams) => Promise<RestaurantOrderPlaceResult>;
1131
1135
  }
1132
1136
 
1137
+ export interface ServiceBookingBarStrings {
1138
+ placeholder: string;
1139
+ bookLabel: string;
1140
+ loadingLabel: string;
1141
+ errorLabel: string;
1142
+ }
1143
+
1144
+ /** <service-booking-bar>: one joined control -- a service select with an
1145
+ * attached Book button. Picking a service dispatches `book`
1146
+ * ({ id, name, price }); the always-present button re-dispatches it, or
1147
+ * dispatches `book` with a null detail when nothing is chosen ("take me to
1148
+ * booking" -- the host's flow does the choosing). Both applyOnSelect and
1149
+ * showBookButton default true; explicit false is honoured verbatim. */
1150
+ export interface ServiceBookingBarElement extends HTMLElement {
1151
+ applyOnSelect?: boolean;
1152
+ showBookButton?: boolean;
1153
+ strings?: Partial<ServiceBookingBarStrings>;
1154
+ fetchTreatments?: () => Promise<SpaTreatment[]>;
1155
+ }
1156
+
1157
+ export interface GoogleReviewItem {
1158
+ author: string;
1159
+ author_photo?: string | null;
1160
+ rating: number;
1161
+ text: string;
1162
+ relative_time?: string;
1163
+ published_at?: string | null;
1164
+ }
1165
+
1166
+ /** The payload <google-reviews> renders -- the shape served by the OTA's
1167
+ * GET /api/property/google-reviews (a cached Google Places fetch). */
1168
+ export interface GoogleReviewsPayload {
1169
+ rating: number | null;
1170
+ count: number;
1171
+ maps_url?: string | null;
1172
+ write_review_url?: string | null;
1173
+ reviews: GoogleReviewItem[];
1174
+ fetched_at?: string;
1175
+ }
1176
+
1177
+ export interface GoogleReviewsStrings {
1178
+ reviewsLabel: string;
1179
+ ctaLabel: string;
1180
+ seeAllLabel: string;
1181
+ loadingLabel: string;
1182
+ errorLabel: string;
1183
+ }
1184
+
1185
+ /** <google-reviews>: live Google rating, count, "Review us on Google" CTA
1186
+ * and the latest review cards. The host injects fetchReviews (typically a
1187
+ * site proxy in front of the OTA google-reviews endpoint); dispatches
1188
+ * `loaded` ({ rating, count }) when the payload arrives. Theme via --gr-*. */
1189
+ export interface GoogleReviewsElement extends HTMLElement {
1190
+ /** 'grid' (default) or 'slider' (scroll-snap track with prev/next arrows). */
1191
+ variant?: 'grid' | 'slider';
1192
+ /** Slider only: seconds between automatic advances; 0/unset = off. */
1193
+ autoAdvance?: number;
1194
+ maxReviews?: number;
1195
+ strings?: Partial<GoogleReviewsStrings>;
1196
+ fetchReviews?: () => Promise<GoogleReviewsPayload>;
1197
+ }
1198
+
1199
+ /** <ai-chat-widget>: a floating chat launcher + panel that talks to a
1200
+ * host-provided chat API endpoint (any AI SDK v5+ UI-message-stream route).
1201
+ * Knows nothing about the model, tools, or business data behind `api` --
1202
+ * purely a chat UI. Dispatches `open-booking` ({ service: string | null })
1203
+ * when the model calls a client-side `openBooking` tool, and
1204
+ * `lead-captured` ({ name: string }) once a server-side `captureLead` tool
1205
+ * call completes. Theme via --acw-*. */
1206
+ export interface AiChatWidgetElement extends HTMLElement {
1207
+ /** The chat API endpoint (e.g. "/api/chat"). Required. */
1208
+ api: string;
1209
+ heading?: string;
1210
+ placeholder?: string;
1211
+ /** Shown as the first message in an empty conversation. Omit for none. */
1212
+ greeting?: string;
1213
+ /** Shown in the error message so a visitor can call instead. Omit to leave it out. */
1214
+ phone?: string;
1215
+ }
1216
+
1133
1217
  declare global {
1134
1218
  interface HTMLElementTagNameMap {
1219
+ 'ai-chat-widget': AiChatWidgetElement;
1220
+ 'google-reviews': GoogleReviewsElement;
1221
+ 'service-booking-bar': ServiceBookingBarElement;
1135
1222
  'reservation-bar': ReservationBarElement;
1136
1223
  'booking-flow': BookingFlowElement;
1137
1224
  'menu-section': MenuSectionElement;
package/package.json CHANGED
@@ -1,45 +1,47 @@
1
- {
2
- "name": "@forgebuild/hotal-ui",
3
- "version": "0.23.20",
4
- "description": "Reusable Svelte UI components for booking and reservation experiences.",
5
- "type": "module",
6
- "license": "MIT",
7
- "files": [
8
- "dist"
9
- ],
10
- "main": "./dist/hotal-ui.js",
11
- "module": "./dist/hotal-ui.js",
12
- "types": "./dist/index.d.ts",
13
- "exports": {
14
- ".": {
15
- "types": "./dist/index.d.ts",
16
- "import": "./dist/hotal-ui.js"
17
- }
18
- },
19
- "publishConfig": {
20
- "access": "public"
21
- },
22
- "dependencies": {
23
- "@floating-ui/dom": "^1.8.0",
24
- "@stripe/stripe-js": "^9.13.0",
25
- "ably": "^2.27.0",
26
- "gsap": "^3.15.0",
27
- "libphonenumber-js": "^1.12.41",
28
- "svelte": "^5.56.8"
29
- },
30
- "devDependencies": {
31
- "@sveltejs/vite-plugin-svelte": "^7.2.0",
32
- "@tsconfig/svelte": "^5.0.8",
33
- "@types/node": "^24.13.3",
34
- "svelte-check": "^4.7.3",
35
- "typescript": "~6.0.2",
36
- "vite": "^8.2.0"
37
- },
38
- "scripts": {
39
- "dev": "vite",
40
- "build": "vite build && node scripts/copy-types.mjs",
41
- "prepublishOnly": "npm run build",
42
- "preview": "vite preview",
43
- "check": "svelte-check --tsconfig ./tsconfig.app.json && tsc -p tsconfig.node.json"
44
- }
45
- }
1
+ {
2
+ "name": "@forgebuild/hotal-ui",
3
+ "version": "0.23.48",
4
+ "description": "Reusable Svelte UI components for booking and reservation experiences.",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "files": [
8
+ "dist"
9
+ ],
10
+ "main": "./dist/hotal-ui.js",
11
+ "module": "./dist/hotal-ui.js",
12
+ "types": "./dist/index.d.ts",
13
+ "exports": {
14
+ ".": {
15
+ "types": "./dist/index.d.ts",
16
+ "import": "./dist/hotal-ui.js"
17
+ }
18
+ },
19
+ "publishConfig": {
20
+ "access": "public"
21
+ },
22
+ "dependencies": {
23
+ "@ai-sdk/svelte": "^5.0.91",
24
+ "@floating-ui/dom": "^1.8.0",
25
+ "@stripe/stripe-js": "^9.13.0",
26
+ "ably": "^2.27.0",
27
+ "ai": "^7.0.91",
28
+ "gsap": "^3.15.0",
29
+ "libphonenumber-js": "^1.12.41",
30
+ "svelte": "^5.56.8"
31
+ },
32
+ "devDependencies": {
33
+ "@sveltejs/vite-plugin-svelte": "^7.2.0",
34
+ "@tsconfig/svelte": "^5.0.8",
35
+ "@types/node": "^24.13.3",
36
+ "svelte-check": "^4.7.3",
37
+ "typescript": "~6.0.2",
38
+ "vite": "^8.2.0"
39
+ },
40
+ "scripts": {
41
+ "dev": "vite",
42
+ "build": "vite build && node scripts/copy-types.mjs",
43
+ "prepublishOnly": "npm run build",
44
+ "preview": "vite preview",
45
+ "check": "svelte-check --tsconfig ./tsconfig.app.json && tsc -p tsconfig.node.json"
46
+ }
47
+ }