@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
@@ -5,10 +5,9 @@ import "../actions/international-phone-input";
5
5
  import type { InternationalPhoneChangeDetail } from "../actions/international-phone-input";
6
6
  import "../me-select";
7
7
  import type { MESelect } from "../me-select";
8
- import { tourSchedulerStyles } from "../Scheduler/tourSchedulerStyles";
9
- import { InputStyles } from "../actions/InputStyles";
10
- import floorPlanSelectorStyles from "../FeeCalculator/components/floor-plan-selector/floor-plan-selector-styles";
11
8
  import type { LayoutOption } from "../../fetchBuildingWebchatView";
9
+ import { schedulerV2Styles } from "./schedulerV2Styles";
10
+ import { CalendarLineIcon } from "./schedulerIcons";
12
11
  import { isValidEmail } from "../../utils";
13
12
 
14
13
  export interface ContactValues {
@@ -53,8 +52,8 @@ export const contactIsValid = (
53
52
  (!bedroomsRequired || values.layouts.length > 0);
54
53
 
55
54
  /**
56
- * The prospect's details, in today's scheduler's "Your Information" column
57
- * with its inputs. The scheduler's footer holds the submit button.
55
+ * The prospect's details: the design's "Your Information" column, each field
56
+ * labelled above. The scheduler's footer holds the submit button.
58
57
  */
59
58
  @customElement("contact-form")
60
59
  export class ContactForm extends LitElement {
@@ -96,13 +95,13 @@ export class ContactForm extends LitElement {
96
95
  );
97
96
  }
98
97
 
99
- private inputClasses(extra: Record<string, boolean> = {}) {
100
- return classMap({
101
- "webchat-input": true,
102
- "webchat-font__desktop": !this.mobile,
103
- "webchat-font__mobile": this.mobile,
104
- ...extra,
105
- });
98
+ /** A field's label, with the design's red asterisk when it is required. */
99
+ private label(text: string, forId: string, required = false) {
100
+ return html`<label class="field-label" for=${forId}
101
+ >${text}${required
102
+ ? html`<span class="required" aria-hidden="true">*</span>`
103
+ : ""}</label
104
+ >`;
106
105
  }
107
106
 
108
107
  /**
@@ -111,13 +110,15 @@ export class ContactForm extends LitElement {
111
110
  */
112
111
  private renderLayouts(): TemplateResult {
113
112
  const picked = this.values.layouts;
114
- return html`<div class="inputContainer">
115
- <span class="section-label" id="layout-label">
116
- Bedroom preferences${this.bedroomsRequired ? "" : " (optional)"}
117
- </span>
113
+ return html`<div class="field">
114
+ <span class="field-label" id="layout-label"
115
+ >Bedrooms${this.bedroomsRequired
116
+ ? html`<span class="required" aria-hidden="true">*</span>`
117
+ : html`<span class="sr-only"> (optional)</span>`}</span
118
+ >
118
119
  <div
119
120
  id="layout"
120
- class="floor-plan-selector-badges"
121
+ class="chips"
121
122
  role="group"
122
123
  aria-labelledby="layout-label"
123
124
  >
@@ -125,7 +126,7 @@ export class ContactForm extends LitElement {
125
126
  const selected = picked.includes(o.value);
126
127
  return html`<button
127
128
  type="button"
128
- class=${classMap({ "floor-plan-badge": true, selected })}
129
+ class=${classMap({ chip: true, selected })}
129
130
  aria-pressed=${String(selected)}
130
131
  @click=${() =>
131
132
  this.setValues({
@@ -143,19 +144,50 @@ export class ContactForm extends LitElement {
143
144
  </div>`;
144
145
  }
145
146
 
147
+ /**
148
+ * The browser's date input, drawn as the design's "Select a date" field:
149
+ * the whole field opens the browser's calendar.
150
+ */
151
+ private renderMoveIn(): TemplateResult {
152
+ const moveIn = this.values.moveIn;
153
+ return html`<div class="field">
154
+ ${this.label("Move-In Date", "move-in")}
155
+ <div class=${classMap({ "date-input": true, filled: !!moveIn })}>
156
+ <input
157
+ id="move-in"
158
+ class="input"
159
+ type="date"
160
+ name="moveIn"
161
+ aria-describedby="move-in-optional"
162
+ .value=${moveIn}
163
+ @change=${(e: Event) =>
164
+ this.setValues({ moveIn: (e.target as HTMLInputElement).value })}
165
+ />
166
+ <span class="date-placeholder" aria-hidden="true">Select a date</span>
167
+ ${CalendarLineIcon(14)}
168
+ </div>
169
+ <span id="move-in-optional" class="sr-only">Optional</span>
170
+ </div>`;
171
+ }
172
+
146
173
  render(): TemplateResult {
147
174
  const v = this.values;
148
175
  const emailInvalid = !!v.email && !isValidEmail(v.email.trim());
149
176
  const phoneInvalid = this.phoneHasBlurred && !v.phoneE164;
150
- return html`<div id="user-info-and-layout-menu-outer-container">
151
- <h2 class="journey-header">Your Information</h2>
177
+ return html`<div
178
+ id="user-info-and-layout-menu-outer-container"
179
+ class=${classMap({ phone: this.mobile })}
180
+ >
181
+ <h2 class="section-heading">Your Information</h2>
152
182
  <div id="yourInformationMenu">
153
- <div class="namesWrapper">
154
- <div class="nameContainer">
183
+ <div class="names">
184
+ <div class="field">
185
+ ${this.label("First Name", "first-name", true)}
155
186
  <input
156
- class=${this.inputClasses({ nameInput: true })}
187
+ id="first-name"
188
+ class="input"
157
189
  type="text"
158
- placeholder="First name"
190
+ placeholder="Jane"
159
191
  name="firstName"
160
192
  autocomplete="given-name"
161
193
  .value=${v.firstName}
@@ -165,11 +197,13 @@ export class ContactForm extends LitElement {
165
197
  })}
166
198
  />
167
199
  </div>
168
- <div class="nameContainer">
200
+ <div class="field">
201
+ ${this.label("Last Name", "last-name", true)}
169
202
  <input
170
- class=${this.inputClasses({ nameInput: true })}
203
+ id="last-name"
204
+ class="input"
171
205
  type="text"
172
- placeholder="Last name"
206
+ placeholder="Doe"
173
207
  name="lastName"
174
208
  autocomplete="family-name"
175
209
  .value=${v.lastName}
@@ -180,12 +214,14 @@ export class ContactForm extends LitElement {
180
214
  />
181
215
  </div>
182
216
  </div>
183
- <div class="inputContainer">
217
+ <div class="field">
218
+ ${this.label("Email", "email", true)}
184
219
  <input
185
- class=${this.inputClasses({ "webchat-input__error": emailInvalid })}
220
+ id="email"
221
+ class=${classMap({ input: true, invalid: emailInvalid })}
186
222
  type="email"
187
223
  inputmode="email"
188
- placeholder="Email"
224
+ placeholder="name@email.com"
189
225
  name="email"
190
226
  autocomplete="email"
191
227
  .value=${v.email}
@@ -196,8 +232,14 @@ export class ContactForm extends LitElement {
196
232
  ? html`<p class="error-message">Invalid email address</p>`
197
233
  : ""}
198
234
  </div>
199
- <div class="inputContainer">
235
+ <div class="field">
236
+ <span class="field-label" aria-hidden="true"
237
+ >Phone<span class="required">*</span></span
238
+ >
200
239
  <international-phone-input
240
+ outlined
241
+ label="Phone"
242
+ placeholder="(555) 555-5555"
201
243
  .country=${v.phoneCountry ?? this.country}
202
244
  .value=${v.phone}
203
245
  .invalid=${phoneInvalid}
@@ -214,33 +256,26 @@ export class ContactForm extends LitElement {
214
256
  : ""}
215
257
  </div>
216
258
  ${this.layoutOptions.length > 0 ? this.renderLayouts() : ""}
217
- <div class="inputContainer">
218
- <label class="section-label" for="move-in">
219
- Move-in date (optional)
220
- </label>
221
- <input
222
- id="move-in"
223
- class=${this.inputClasses()}
224
- type="date"
225
- name="moveIn"
226
- .value=${v.moveIn}
227
- @change=${(e: Event) =>
228
- this.setValues({ moveIn: (e.target as HTMLInputElement).value })}
229
- />
259
+ ${this.renderMoveIn()}
260
+ <div class="field">
261
+ ${this.label("Notes", "notes")}
262
+ <textarea
263
+ id="notes"
264
+ class="input"
265
+ rows="4"
266
+ name="notes"
267
+ placeholder="Anything we should know?"
268
+ .value=${v.notes}
269
+ @input=${(e: Event) =>
270
+ this.setValues({
271
+ notes: (e.target as HTMLTextAreaElement).value,
272
+ })}
273
+ ></textarea>
230
274
  </div>
231
- <textarea
232
- class=${this.inputClasses({ "webchat-textarea": true })}
233
- rows="3"
234
- name="notes"
235
- aria-label="Notes (optional)"
236
- placeholder="Notes (optional)"
237
- .value=${v.notes}
238
- @input=${(e: Event) =>
239
- this.setValues({ notes: (e.target as HTMLTextAreaElement).value })}
240
- ></textarea>
241
275
  ${this.showLeadSourceDropdown && this.leadSources.length > 0
242
276
  ? html`<me-select
243
277
  id="leadSource"
278
+ outlined
244
279
  value=${v.leadSource ?? this.currentLeadSource}
245
280
  placeholder="How did you hear about us?"
246
281
  .options=${this.leadSources.map((i) => ({ label: i, value: i }))}
@@ -264,31 +299,26 @@ export class ContactForm extends LitElement {
264
299
  }
265
300
 
266
301
  static styles = [
267
- tourSchedulerStyles,
268
- InputStyles,
269
- floorPlanSelectorStyles,
302
+ schedulerV2Styles,
270
303
  css`
271
304
  :host {
272
305
  display: contents;
273
306
  }
274
307
 
275
- .inputContainer {
276
- display: flex;
277
- flex-direction: column;
278
- gap: 4px;
308
+ .section-heading {
309
+ margin-bottom: 16px;
279
310
  }
280
311
 
281
- /* The filters' chips, wrapping in the column rather than scrolling. */
282
- #layout {
283
- flex-wrap: wrap;
284
- margin: 0;
285
- max-width: none;
286
- overflow: visible;
312
+ #yourInformationMenu {
313
+ display: flex;
314
+ flex-direction: column;
315
+ gap: 12px;
287
316
  }
288
317
 
289
- textarea {
290
- resize: vertical;
291
- width: 100%;
318
+ .names {
319
+ display: grid;
320
+ gap: 8px;
321
+ grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
292
322
  }
293
323
  `,
294
324
  ];