@meetelise/chat 1.75.0 → 1.76.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.
Files changed (30) hide show
  1. package/dist/src/WebComponent/Scheduler/time-picker.d.ts +6 -0
  2. package/dist/src/WebComponent/Scheduler/tour-type-option.d.ts +1 -1
  3. package/dist/src/WebComponent/SchedulerV2/contact-form.d.ts +9 -3
  4. package/dist/src/WebComponent/SchedulerV2/itinerary-editor.d.ts +15 -1
  5. package/dist/src/WebComponent/SchedulerV2/itineraryStopStyles.d.ts +1 -2
  6. package/dist/src/WebComponent/SchedulerV2/schedulerIcons.d.ts +18 -0
  7. package/dist/src/WebComponent/SchedulerV2/schedulerV2Styles.d.ts +9 -0
  8. package/dist/src/WebComponent/SchedulerV2/tour-scheduler-v2.d.ts +13 -1
  9. package/dist/src/WebComponent/SchedulerV2/tourTimes.d.ts +1 -1
  10. package/dist/src/WebComponent/actions/international-phone-input.d.ts +7 -0
  11. package/dist/src/WebComponent/me-select.d.ts +2 -0
  12. package/package.json +1 -1
  13. package/public/dist/index.js +2280 -1309
  14. package/src/WebComponent/Scheduler/date-picker.ts +130 -51
  15. package/src/WebComponent/Scheduler/time-picker.ts +62 -0
  16. package/src/WebComponent/Scheduler/tour-type-option.ts +31 -10
  17. package/src/WebComponent/SchedulerV2/booking-confirmation.ts +42 -38
  18. package/src/WebComponent/SchedulerV2/community-picker.ts +222 -160
  19. package/src/WebComponent/SchedulerV2/contact-form.ts +100 -70
  20. package/src/WebComponent/SchedulerV2/itinerary-editor.ts +280 -138
  21. package/src/WebComponent/SchedulerV2/itineraryStopStyles.ts +44 -21
  22. package/src/WebComponent/SchedulerV2/scheduler-popover.ts +6 -6
  23. package/src/WebComponent/SchedulerV2/schedulerIcons.ts +143 -0
  24. package/src/WebComponent/SchedulerV2/schedulerV2Styles.ts +347 -0
  25. package/src/WebComponent/SchedulerV2/tour-scheduler-v2.ts +443 -175
  26. package/src/WebComponent/SchedulerV2/tourTimes.ts +4 -3
  27. package/src/WebComponent/actions/action-confirm-button.ts +4 -3
  28. package/src/WebComponent/actions/international-phone-input.ts +84 -1
  29. package/src/WebComponent/me-select.ts +74 -0
  30. package/src/tourSchedulerV2Booking.test.ts +35 -1
@@ -38,15 +38,16 @@ export const formatHourMinute = (hourMinute: string): string => {
38
38
  export const formatTime = (iso: string): string =>
39
39
  formatHourMinute(isoHourMinute(iso));
40
40
 
41
- /** "10:00–10:30am", or "11:30am–12:00pm" across noon. */
41
+ /** "10:00–10:30 AM", or "11:30 AM–12:00 PM" across noon, as the design writes a stop's time. */
42
42
  export const formatTimeRange = (startIso: string, endIso: string): string => {
43
43
  const start = parts(isoHourMinute(startIso));
44
44
  const end = parts(isoHourMinute(endIso));
45
+ const upper = (hour: number) => meridiem(hour).toUpperCase();
45
46
  const startText =
46
47
  meridiem(start.hour) === meridiem(end.hour)
47
48
  ? clock(start.hour, start.minute)
48
- : formatHourMinute(isoHourMinute(startIso));
49
- return `${startText}–${formatHourMinute(isoHourMinute(endIso))}`;
49
+ : `${clock(start.hour, start.minute)} ${upper(start.hour)}`;
50
+ return `${startText}–${clock(end.hour, end.minute)} ${upper(end.hour)}`;
50
51
  };
51
52
 
52
53
  /** A calendar date, read as that date wherever the visitor is. */
@@ -20,9 +20,10 @@ export class ActionConfirmButton extends LitElement {
20
20
  background: var(--action-confirm-button-background, #000000);
21
21
  border: none;
22
22
 
23
- border-radius: 20px;
23
+ /* Today's pill unless a surrounding page sets these, as the v2 scheduler does. */
24
+ border-radius: var(--action-confirm-button-radius, 20px);
24
25
 
25
- font-family: "Helvetica Neue", Arial;
26
+ font-family: var(--action-confirm-button-font, "Helvetica Neue", Arial);
26
27
  font-style: normal;
27
28
  font-weight: 400;
28
29
  font-size: 12px;
@@ -34,7 +35,7 @@ export class ActionConfirmButton extends LitElement {
34
35
  }
35
36
 
36
37
  .action-confirm-button:disabled {
37
- background: #e7e7e7;
38
+ background: var(--action-confirm-button-disabled-background, #e7e7e7);
38
39
  box-shadow: none;
39
40
  cursor: initial;
40
41
  }
@@ -1,4 +1,11 @@
1
- import { css, html, LitElement, PropertyValues, TemplateResult } from "lit";
1
+ import {
2
+ css,
3
+ html,
4
+ LitElement,
5
+ nothing,
6
+ PropertyValues,
7
+ TemplateResult,
8
+ } from "lit";
2
9
  import { customElement, property, state } from "lit/decorators.js";
3
10
  import { classMap } from "lit/directives/class-map.js";
4
11
  import { InputStyles } from "./InputStyles";
@@ -126,9 +133,77 @@ export class InternationalPhoneInput extends LitElement {
126
133
  flex-basis: 92px;
127
134
  }
128
135
  }
136
+
137
+ /* Only with the outlined attribute: the v2 scheduler's white field. */
138
+ :host([outlined]) .phone-input-container {
139
+ background: #ffffff;
140
+ border: 1px solid #dee2e6;
141
+ border-radius: 4px;
142
+ min-height: 36px;
143
+ }
144
+
145
+ :host([outlined]) .phone-input-container:focus-within {
146
+ border-color: var(--primary-color, #646987);
147
+ }
148
+
149
+ :host([outlined]) .phone-input-container--invalid,
150
+ :host([outlined]) .phone-input-container--invalid:focus-within {
151
+ border-color: #dc2626;
152
+ }
153
+
154
+ :host([outlined]) .country-select-wrapper {
155
+ flex: 0 0 auto;
156
+ height: 34px;
157
+ padding: 0 12px;
158
+ }
159
+
160
+ :host([outlined]) .country-select-wrapper::after {
161
+ border-bottom: 1px solid #212529;
162
+ border-right: 1px solid #212529;
163
+ height: 6px;
164
+ margin-left: 10px;
165
+ width: 6px;
166
+ }
167
+
168
+ :host([outlined]) .country-select-label,
169
+ :host([outlined]) .phone-input-container input.webchat-input {
170
+ color: #000000;
171
+ font-family: inherit;
172
+ font-size: 12px;
173
+ line-height: 16px;
174
+ }
175
+
176
+ :host([outlined]) .phone-input-divider {
177
+ background: #dee2e6;
178
+ height: 20px;
179
+ }
180
+
181
+ :host([outlined]) .phone-input-container input.webchat-input {
182
+ padding: 0 12px;
183
+ }
184
+
185
+ :host([outlined]) input.webchat-input::placeholder {
186
+ color: #adb5bd;
187
+ font-family: inherit;
188
+ font-size: 12px;
189
+ }
190
+
191
+ /* Phones, including landscape ones (the widget's isMobile): 16px text,
192
+ so focusing the field doesn't zoom the page. */
193
+ @media screen and (max-width: 767px), screen and (max-height: 400px) {
194
+ :host([outlined]) .country-select-label,
195
+ :host([outlined]) .phone-input-container input.webchat-input,
196
+ :host([outlined]) input.webchat-input::placeholder {
197
+ font-size: 16px;
198
+ }
199
+ }
129
200
  `,
130
201
  ];
131
202
 
203
+ /** The v2 scheduler's look: a white field with a thin border, as its other inputs. */
204
+ @property({ type: Boolean, reflect: true })
205
+ outlined = false;
206
+
132
207
  @property({ attribute: false })
133
208
  country: string | null = null;
134
209
 
@@ -141,6 +216,13 @@ export class InternationalPhoneInput extends LitElement {
141
216
  @property({ type: String })
142
217
  placeholder = "Phone";
143
218
 
219
+ /**
220
+ * The number field's accessible name, for a form that labels it above
221
+ * rather than with the placeholder. Left empty, the placeholder names it.
222
+ */
223
+ @property({ type: String })
224
+ label = "";
225
+
144
226
  @state()
145
227
  private selectedCountry = "US";
146
228
 
@@ -278,6 +360,7 @@ export class InternationalPhoneInput extends LitElement {
278
360
  type="tel"
279
361
  inputmode="tel"
280
362
  placeholder=${this.placeholder}
363
+ aria-label=${this.label || nothing}
281
364
  name="phone"
282
365
  autocomplete="tel-national"
283
366
  maxlength="30"
@@ -20,6 +20,10 @@ export class MESelect extends LitElement {
20
20
  @property({ type: String })
21
21
  value?: string;
22
22
 
23
+ /** The v2 scheduler's look: a white field with a thin border. */
24
+ @property({ type: Boolean, reflect: true })
25
+ outlined = false;
26
+
23
27
  @state()
24
28
  private activeOption: MeSelectOption | null = null;
25
29
 
@@ -228,6 +232,76 @@ export class MESelect extends LitElement {
228
232
  }
229
233
  `,
230
234
  InputStyles,
235
+ css`
236
+ /* Only with the outlined attribute: the v2 scheduler's white field. */
237
+ :host([outlined]) #select {
238
+ background: #ffffff;
239
+ border: 1px solid #dee2e6;
240
+ border-radius: 4px;
241
+ box-sizing: border-box;
242
+ color: #adb5bd;
243
+ font-family: inherit;
244
+ height: 36px;
245
+ padding: 0 12px;
246
+ width: 100%;
247
+ }
248
+
249
+ :host([outlined]) #select:focus-within {
250
+ border-color: var(--primary-color, #646987);
251
+ }
252
+
253
+ :host([outlined]) #selectText {
254
+ color: #000000;
255
+ font-family: inherit;
256
+ font-size: 12px;
257
+ line-height: 16px;
258
+ height: 16px;
259
+ }
260
+
261
+ :host([outlined]) #selectText::placeholder {
262
+ color: #adb5bd;
263
+ font-family: inherit;
264
+ font-size: 12px;
265
+ }
266
+
267
+ :host([outlined]) ul {
268
+ border: 1px solid #dee2e6;
269
+ border-radius: 8px;
270
+ box-shadow: 0 2px 16px 0 rgba(0, 0, 0, 0.13);
271
+ font-family: inherit;
272
+ font-size: 12px;
273
+ line-height: 16px;
274
+ }
275
+
276
+ :host([outlined]) .option {
277
+ padding: 8px 12px;
278
+ }
279
+
280
+ :host([outlined]) .option:first-child {
281
+ border-top-left-radius: 8px;
282
+ border-top-right-radius: 8px;
283
+ }
284
+
285
+ :host([outlined]) .option:last-child {
286
+ border-bottom-left-radius: 8px;
287
+ border-bottom-right-radius: 8px;
288
+ }
289
+
290
+ /* Phones, including landscape ones (the widget's isMobile): 16px text,
291
+ so focusing the field doesn't zoom the page. */
292
+ @media screen and (max-width: 767px), screen and (max-height: 400px) {
293
+ :host([outlined]) #selectText,
294
+ :host([outlined]) #selectText::placeholder {
295
+ font-size: 16px;
296
+ }
297
+
298
+ /* A line as tall as the type would clip its descenders. */
299
+ :host([outlined]) #selectText {
300
+ height: 20px;
301
+ line-height: 20px;
302
+ }
303
+ }
304
+ `,
231
305
  ];
232
306
 
233
307
  firstUpdated = (): void => {
@@ -840,7 +840,7 @@ it("carries bedrooms, move-in and budget between the picker's filters, the form
840
840
  "#filter-bedrooms button"
841
841
  ) ?? []
842
842
  )
843
- .find((badge) => badge.textContent?.trim() === "2 bd")
843
+ .find((badge) => badge.textContent?.trim() === "2 bed")
844
844
  ?.click();
845
845
  await picker.updateComplete;
846
846
  await openFilter("moveIn");
@@ -1054,3 +1054,37 @@ it("closes the nearby list when the itinerary changes, and offers it again once
1054
1054
  picker.shadowRoot?.querySelector("button.floorplan-image-card")
1055
1055
  );
1056
1056
  });
1057
+
1058
+ it("closes the date calendar when the prospect picks the day already chosen", async () => {
1059
+ fakeBackend();
1060
+ const scheduler = mount();
1061
+ const editor = await waitFor(() =>
1062
+ inScheduler<ItineraryEditor>(scheduler, "itinerary-editor")
1063
+ );
1064
+ const inEditor = <T extends Element>(selector: string) =>
1065
+ editor.shadowRoot?.querySelector<T>(selector) ?? null;
1066
+ const calendar = await waitFor(() =>
1067
+ inEditor<HTMLElement & { now: Date; requestUpdate: () => void }>(
1068
+ "date-picker"
1069
+ )
1070
+ );
1071
+ // The fake backend's tour day may have passed; the calendar only offers days from today on.
1072
+ calendar.now = new Date(2026, 9, 1);
1073
+ calendar.requestUpdate();
1074
+ const chosen = await waitFor(() =>
1075
+ calendar.shadowRoot?.querySelector<HTMLButtonElement>(
1076
+ "button.dayNumber.selected:not(:disabled)"
1077
+ )
1078
+ );
1079
+ const popover = await waitFor(() =>
1080
+ inEditor<HTMLElement & { open: boolean }>("scheduler-popover")
1081
+ );
1082
+
1083
+ inEditor<HTMLButtonElement>("#date-trigger")?.click();
1084
+ await editor.updateComplete;
1085
+ expect(popover.open).to.equal(true);
1086
+
1087
+ chosen.click();
1088
+ await editor.updateComplete;
1089
+ expect(popover.open).to.equal(false);
1090
+ });