@morgan-and-morgan/intake-agent 1.0.0-alpha.17 → 1.0.0-alpha.19

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 CHANGED
@@ -52,10 +52,24 @@ modal is about to appear; the launcher and chat remain available. Set suppressio
52
52
  before loading the embed when using a zero-second delay, so the first display
53
53
  check sees the intended setting.
54
54
 
55
+ ## Chat launcher design
56
+
57
+ The [Figma launcher](https://www.figma.com/design/0SxWl42gdhx08KFe2ldpd8/MM-Design-System-v4.0?node-id=21250-170681)
58
+ is displayed at roughly 70% size as a 45 × 140 px tab on the right edge. It uses
59
+ live HTML text and an accessible button name, with Nunito Sans loaded through the
60
+ existing shared font registration.
61
+ The original 199 × 64 px layout, typography, and spacing stay intact. One transform
62
+ rotates and scales the content; `LAUNCHER_SCALE` also determines the rounded button
63
+ dimensions so the click target and focus outline fit the visible tab.
64
+ `launcher-chat.svg` is the original 48 × 48 vector export from node `21252:170716`,
65
+ so it stays sharp at 3× and higher pixel densities. Keep the CDN and portal copies
66
+ identical. Retain `button-text-us.png` for older deployed widget versions.
67
+
55
68
  ## Consultation prompt design
56
69
 
57
70
  The responsive prompt follows the [desktop and mobile Figma layouts](https://www.figma.com/design/0SxWl42gdhx08KFe2ldpd8/MM-Design-System-v4.0?node-id=21250-169311).
58
- Portrait, avatar, status dots, and icons are exported from those layers.
71
+ The portrait and avatar use cropped, optimized original photos; CSS applies the Figma framing.
72
+ Status dots and icons are exported from their layers.
59
73
  The fonts are the existing website's [Kuunari Bold Compressed](https://www.forthepeople.com/themes/custom/morgan/fonts/Kuunari/kuunari-bold-compressed.woff2)
60
74
  and [Nunito Sans](https://www.forthepeople.com/themes/custom/morgan/fonts/NunitoSans/NunitoSans.woff2).
61
75
  On forthepeople.com, the prompt loads these fonts from the host site to respect
@@ -63,5 +77,6 @@ its font security policy. Other hosts use the bundled copies.
63
77
  Keep prompt assets in `public/` and `apps/expo/public/intake-widget/` identical;
64
78
  the asset tests check both the CDN and portal copies.
65
79
 
66
- Retain `consultation-prompt.webp` at both asset origins for older deployed widget
67
- versions. The redesigned prompt does not request it.
80
+ Retain `consultation-prompt.webp`, `consultation-team.png`, and
81
+ `consultation-john-morgan.png` at both asset origins for older deployed widget
82
+ versions. The current prompt requests the separate WebP photos instead.
Binary file
@@ -0,0 +1,23 @@
1
+ <svg preserveAspectRatio="none" overflow="visible" style="display: block;" width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <g id="chat 1" clip-path="url(#clip0_0_4)">
3
+ <path id="Vector" d="M43.8261 40.2077C46.5258 37.3111 47.9976 33.7303 47.9976 29.9994C47.9976 25.3311 45.6915 21.1034 41.9982 18.1037C41.9138 28.7995 31.8555 37.4986 19.5005 37.4986H11.1388C14.3729 42.8325 20.9441 46.4977 28.4995 46.4977H46.4977C47.107 46.4977 47.6507 46.1321 47.8851 45.5697C48.1194 45.0072 47.9882 44.3604 47.557 43.9386L43.8261 40.2077Z" fill="url(#paint0_linear_0_4)"/>
4
+ <path id="Vector_2" d="M19.5005 1.50228C8.74842 1.50228 0.00243725 8.89841 0.00243725 18.0006C0.00243725 21.7315 1.47416 25.303 4.17389 28.2089L0.443018 31.9398C0.0118113 32.371 -0.119425 33.0178 0.114926 33.5709C0.349277 34.1333 0.892972 34.4989 1.50228 34.4989H19.5005C30.2525 34.4989 38.9985 27.1028 38.9985 18.0006C38.9985 8.89841 30.2525 1.50228 19.5005 1.50228Z" fill="url(#paint1_linear_0_4)"/>
5
+ <g id="Group">
6
+ <path id="Vector_3" d="M28.4995 13.5011H10.5014C9.67645 13.5011 9.00152 14.176 9.00152 15.0009C9.00152 15.8258 9.67645 16.5008 10.5014 16.5008H28.4995C29.3245 16.5008 29.9994 15.8258 29.9994 15.0009C29.9994 14.176 29.3245 13.5011 28.4995 13.5011Z" fill="white"/>
7
+ <path id="Vector_4" d="M22.5002 19.5005H10.5014C9.67645 19.5005 9.00152 20.1754 9.00152 21.0003C9.00152 21.8252 9.67645 22.5002 10.5014 22.5002H22.5002C23.3251 22.5002 24 21.8252 24 21.0003C24 20.1754 23.3251 19.5005 22.5002 19.5005Z" fill="white"/>
8
+ </g>
9
+ </g>
10
+ <defs>
11
+ <linearGradient id="paint0_linear_0_4" x1="29.5694" y1="18.1037" x2="29.5694" y2="46.4977" gradientUnits="userSpaceOnUse">
12
+ <stop offset="0.418269" stop-color="#FFEC00"/>
13
+ <stop offset="1" stop-color="#E2D100"/>
14
+ </linearGradient>
15
+ <linearGradient id="paint1_linear_0_4" x1="-2.52862e-06" y1="18.0006" x2="38.9985" y2="18.0006" gradientUnits="userSpaceOnUse">
16
+ <stop stop-color="#0163D2"/>
17
+ <stop offset="1" stop-color="#4C9FFD"/>
18
+ </linearGradient>
19
+ <clipPath id="clip0_0_4">
20
+ <rect width="48" height="48" fill="white"/>
21
+ </clipPath>
22
+ </defs>
23
+ </svg>
@@ -161,7 +161,7 @@
161
161
  // leaving — which the host's own visual viewport only admits ~500ms later.
162
162
  CARET_STATE: "mm:intake:caret-state",
163
163
  // Chat tells the host an inbound AI or operator message just landed. Kept in
164
- // the protocol for a future unread affordance; the TEXT US sticky has no badge
164
+ // the protocol for a future unread affordance; the chat launcher has no badge
165
165
  // today. Payload-free: only the chat knows a message arrived while only the
166
166
  // host knows whether the panel was closed at the time.
167
167
  MESSAGE_RECEIVED: "mm:intake:message-received",
@@ -236,8 +236,16 @@
236
236
  const designSystemColors = {
237
237
  // Colors/Base/black
238
238
  "base-black": "#000000",
239
+ // Colors/Base/white
240
+ "base-white": "#ffffff",
241
+ // Colors/Neutral/500
242
+ "neutral-500": "#737373",
243
+ // Colors/Neutral/900
244
+ "neutral-900": "#171717",
239
245
  // Colors/Primary/100
240
246
  "primary-100": "#f3f8ff",
247
+ // Colors/Primary/600
248
+ "primary-600": "#135ebf",
241
249
  // Colors/Primary/800
242
250
  "primary-800": "#132a4e",
243
251
  // Colors/Primary/900
@@ -245,7 +253,9 @@
245
253
  // Colors/Secondary/500
246
254
  "secondary-500": "#ffec00",
247
255
  // Colors/Secondary/700
248
- "secondary-700": "#e2d100"
256
+ "secondary-700": "#e2d100",
257
+ // Component colors/Alpha/alpha-black-20
258
+ "alpha-black-20": "#00000033"
249
259
  };
250
260
  const PROMPT_FONTS = [
251
261
  {
@@ -311,12 +321,16 @@
311
321
  return dispose;
312
322
  };
313
323
  const PROMPT_STYLES = [
324
+ // Initial dialog focus announces the popup without drawing a ring around its backdrop.
325
+ ".mm-prompt-backdrop:focus{outline:none}",
314
326
  `.mm-prompt-backdrop{--mm-prompt-blue:${designSystemColors["primary-800"]};--mm-prompt-dark:${designSystemColors["primary-900"]};--mm-prompt-yellow:${designSystemColors["secondary-500"]};--mm-prompt-yellow-end:${designSystemColors["secondary-700"]};--mm-prompt-text:${designSystemColors["primary-100"]};position:fixed;inset:0;z-index:2147483002;display:flex;flex-direction:column;align-items:center;padding:12px;overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y pinch-zoom;background:rgba(0,0,0,.5);animation:mm-prompt-backdrop-in .25s cubic-bezier(.23,1,.32,1) both;font-family:"MMIntakeNunitoSans",var(--mm-font);font-variation-settings:"YTLC" 500,"wdth" 100;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}`,
315
327
  // Auto margins center the card when it fits and keep its top reachable when it overflows.
316
328
  ".mm-prompt-card{position:relative;isolation:isolate;display:flex;flex:none;flex-direction:column;margin-block:auto;width:600px;max-width:100%;padding:16px 16px 32px;border-radius:16px;background:var(--mm-prompt-blue);color:var(--mm-white);box-shadow:0 4px 5px rgba(0,0,0,.1),0 7px 10px rgba(0,0,0,.07),0 2px 16px rgba(0,0,0,.08);animation:mm-prompt-card-in .25s cubic-bezier(.23,1,.32,1) both}",
317
329
  ".mm-prompt-status{position:relative;z-index:1;display:flex;align-items:center;gap:13px;align-self:flex-start;max-width:calc(100% - 52px);padding:8px 40px 8px 8px;border-radius:999px;background:var(--mm-prompt-dark);color:var(--mm-prompt-text)}",
318
330
  ".mm-prompt-avatar{position:relative;flex:none;width:56px;height:56px}",
319
- ".mm-prompt-team{display:block;width:100%;height:100%;border-radius:50%}",
331
+ // Crop the original at (310, 234, 454, 454), then preserve Figma's avatar framing in CSS.
332
+ ".mm-prompt-team-crop{position:absolute;inset:0;overflow:hidden;border-radius:50%;transform:scaleX(-1)}",
333
+ ".mm-prompt-team{position:absolute;display:block;left:-3.26787%;top:-0.29881%;width:103.65294%;height:103.65298%;max-width:none;transform:rotate(-1.62035deg);transform-origin:0 0}",
320
334
  // The exported indicator bounds include Figma's 2px outside stroke.
321
335
  ".mm-prompt-online{position:absolute;right:-2px;top:40.17px;display:block;line-height:0}",
322
336
  ".mm-prompt-online img{display:block}",
@@ -326,8 +340,9 @@
326
340
  '.mm-prompt-title{position:relative;z-index:1;flex:1;min-width:0;height:232px;display:flex;flex-direction:column;justify-content:flex-end;margin:0;font-family:"MMIntakeKuunari",Impact,sans-serif;font-size:72px;font-weight:700;line-height:64px;letter-spacing:-2px;text-transform:uppercase}',
327
341
  ".mm-prompt-title-line{display:block;white-space:nowrap}",
328
342
  ".mm-prompt-mobile-break{display:none}",
329
- ".mm-prompt-portrait{position:relative;flex:none;width:270px;height:304px}",
330
- ".mm-prompt-image{display:block;width:100%;height:100%;pointer-events:none}",
343
+ // Figma node 21250:169707 crops the transparent source without baking in the card background.
344
+ ".mm-prompt-portrait{position:relative;flex:none;width:270px;height:304px;overflow:hidden}",
345
+ ".mm-prompt-image{position:absolute;display:block;left:-40.22%;top:-3.95%;width:181.72%;height:107.91%;max-width:none;pointer-events:none}",
331
346
  `.mm-prompt-cta{position:relative;display:flex;align-items:center;justify-content:center;gap:16px;height:56px;margin:0 16px;border-radius:8px;background:linear-gradient(to bottom,var(--mm-prompt-yellow) 41.827%,var(--mm-prompt-yellow-end));box-shadow:0 2px 4px rgba(0,0,0,.05),0 4px 3px rgba(0,0,0,.04),0 1px 2px rgba(0,0,0,.03);color:${designSystemColors["base-black"]};font-size:20px;font-weight:700;line-height:24px}`,
332
347
  ".mm-prompt-cta-label{min-width:90px}",
333
348
  // Preserve the Figma text frames in the SVG exports so centering retains their alignment.
@@ -347,11 +362,11 @@
347
362
  const promptMarkup = (assetUrl) => [
348
363
  '<div class="mm-prompt-card">',
349
364
  '<div class="mm-prompt-status"><span class="mm-prompt-avatar" aria-hidden="true">',
350
- `<img loading="lazy" class="mm-prompt-team" src="${assetUrl("consultation-team.png")}" alt="" width="56" height="56" decoding="async" />`,
365
+ `<span class="mm-prompt-team-crop"><img loading="lazy" class="mm-prompt-team" src="${assetUrl("consultation-team.webp")}" alt="" width="360" height="360" decoding="async" /></span>`,
351
366
  `<picture class="mm-prompt-online"><source media="(max-width:623px)" srcset="${assetUrl("consultation-online-mobile.svg")}" /><img loading="lazy" src="${assetUrl("consultation-online-desktop.svg")}" alt="" /></picture>`,
352
367
  '</span><p class="mm-prompt-status-text">Our team is <br class="mm-prompt-mobile-break" />available 24/7</p></div>',
353
368
  '<div class="mm-prompt-hero"><h2 class="mm-prompt-title"><span class="mm-prompt-title-line">Click <br class="mm-prompt-mobile-break" />to start</span><span class="mm-prompt-title-line">your free</span><span class="mm-prompt-title-line">consultation</span></h2>',
354
- `<div class="mm-prompt-portrait" aria-hidden="true"><img loading="lazy" class="mm-prompt-image" src="${assetUrl("consultation-john-morgan.png")}" alt="" width="270" height="304" decoding="async" /></div></div>`,
369
+ `<div class="mm-prompt-portrait" aria-hidden="true"><img loading="lazy" class="mm-prompt-image" src="${assetUrl("consultation-john-morgan.webp")}" alt="" width="1500" height="1000" decoding="async" /></div></div>`,
355
370
  `<span class="mm-prompt-cta" aria-hidden="true"><img loading="lazy" class="mm-prompt-chat-icon" src="${assetUrl("consultation-chat.svg")}" alt="" width="24" height="29" /><span class="mm-prompt-cta-label">Chat now</span></span>`,
356
371
  '<button class="mm-prompt-open" type="button" aria-label="Chat now about a free consultation"></button>',
357
372
  `<button class="mm-prompt-close" type="button" aria-label="Dismiss consultation prompt"><img class="mm-prompt-close-icon" src="${assetUrl("consultation-close.svg")}" alt="" width="18" height="29" /><span class="mm-prompt-close-contrast" aria-hidden="true">×</span></button>`,
@@ -372,6 +387,9 @@
372
387
  const FULL_PAGE_PANEL_QUERY = "(max-width:600px),(max-height:500px)";
373
388
  const lucideIcon = (name, className, strokeWidth = 2) => `<svg class="${className}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="${String(strokeWidth)}" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false">${LUCIDE_ICON_PATHS[name]}</svg>`;
374
389
  const OPEN_CLOSE_ICON = lucideIcon("x", "mm-icon mm-icon-close");
390
+ const LAUNCHER_SCALE = 0.7;
391
+ const LAUNCHER_WIDTH = Math.ceil(64 * LAUNCHER_SCALE);
392
+ const LAUNCHER_HEIGHT = Math.ceil(199 * LAUNCHER_SCALE);
375
393
  const WIDGET_STYLES = [
376
394
  ':host{all:initial;color-scheme:light;--mm-yellow:#fdeb01;--mm-yellow-hover:#f5de00;--mm-yellow-pressed:#e6cc00;--mm-blue:#115099;--mm-blue-hover:#0b3568;--mm-ink:#111;--mm-white:#fff;--mm-surface-blue:#f3f8ff;--mm-chrome:#e8eef2;--mm-line:#e2e8f0;--mm-muted:#545454;--mm-green:#0f9d58;--mm-font:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif}',
377
395
  "*,*::before,*::after{box-sizing:border-box}",
@@ -383,26 +401,26 @@
383
401
  "@keyframes mm-prompt-backdrop-in{from{opacity:0}to{opacity:1}}",
384
402
  "@keyframes mm-prompt-card-in{from{opacity:0;transform:scale(.96)}to{opacity:1;transform:none}}",
385
403
  "@keyframes mm-dot{0%,100%{opacity:.4;transform:scale(1)}50%{opacity:1;transform:scale(1.2)}}",
386
- // Closed: LivePerson TEXT US sticky under the chat layer. Open: swap for a
387
- // blue X disc above the chat so there is always a clear close control.
388
- // Same asset as forthepeople.com (button-text-us-white-bg), already rotated
389
- // 90deg CW like GTM. Placement matches #messaging_gbm: top 42%, ~38px thick,
390
- // no translateY(-50%). right:10px keeps a small inset from the viewport edge.
391
- // Against the host page the near-max z-index is only the fallback for
392
- // browsers without the Popover API — everywhere else the mount rides the top
393
- // layer (widget.ts) and outranks any host z-index.
394
- ".mm-launcher{position:fixed;right:10px;top:42%;z-index:2147482999;display:grid;place-items:center;width:auto;height:auto;padding:0;border:0;border-radius:0;outline:none;background:transparent;color:var(--mm-ink);box-shadow:none;cursor:pointer;user-select:none;-webkit-user-select:none;-webkit-user-drag:none;transform:none;animation:mm-launcher-in .28s cubic-bezier(.23,1,.32,1) both;transition:transform .15s cubic-bezier(.23,1,.32,1),filter .15s ease,background-color .15s ease}",
404
+ // The same button becomes the close control while the chat is open.
405
+ `.mm-launcher{position:fixed;right:0;top:42%;top:max(0px,min(42%,calc(100dvh - ${String(LAUNCHER_HEIGHT + 8)}px)));z-index:2147482999;display:grid;place-items:center;width:${String(LAUNCHER_WIDTH)}px;height:${String(LAUNCHER_HEIGHT)}px;padding:0;border:0;border-radius:${String(16 * LAUNCHER_SCALE)}px 0 0 ${String(16 * LAUNCHER_SCALE)}px;outline:none;background:transparent;color:var(--mm-ink);box-shadow:none;cursor:pointer;user-select:none;-webkit-user-select:none;-webkit-user-drag:none;transform:none;animation:mm-launcher-in .28s cubic-bezier(.23,1,.32,1) both;transition:filter .15s ease,background-color .15s ease}`,
395
406
  ".mm-launcher *{user-select:none;-webkit-user-select:none;-webkit-user-drag:none}",
396
- ".mm-launcher:hover{transform:translateX(-2px);filter:drop-shadow(0 4px 10px rgba(17,17,17,.18))}",
397
- ".mm-launcher:active{transform:none;filter:none}",
398
- ".mm-launcher:focus-visible{outline:3px solid var(--mm-blue);outline-offset:3px}",
399
- ".mm-text-us{display:block;width:38px;height:auto;pointer-events:none}",
407
+ ".mm-launcher:hover{filter:brightness(.97)}",
408
+ ".mm-launcher:active{filter:none}",
409
+ ".mm-launcher:focus-visible{outline:3px solid var(--mm-blue);outline-offset:-3px}",
410
+ // Keep Figma's original horizontal layout; rotate and scale it as one unit.
411
+ `.mm-launcher-content{position:absolute;top:50%;left:50%;display:flex;align-items:center;gap:12px;width:199px;height:64px;padding:8px 12px 8px 8px;transform:translate(-50%,-50%) rotate(90deg) scale(${String(LAUNCHER_SCALE)});border-radius:0 0 16px 16px;background:${designSystemColors["base-white"]};box-shadow:0 0 0 .5px ${designSystemColors["neutral-500"]},inset 0 0 0 .5px ${designSystemColors["neutral-500"]},0 4px 12px ${designSystemColors["alpha-black-20"]};pointer-events:none}`,
412
+ ".mm-launcher-chat-icon{display:block;flex:none;width:48px;height:48px}",
413
+ `.mm-launcher-copy{display:flex;flex:none;flex-direction:column;width:119px;height:46px;text-align:left;white-space:nowrap;font-family:"MMIntakeNunitoSans",var(--mm-font);font-weight:700;font-variation-settings:"YTLC" 500,"wdth" 100;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;color:${designSystemColors["neutral-900"]}}`,
414
+ ".mm-launcher-title{font-size:20px;line-height:27px;margin-bottom:-2px}",
415
+ `.mm-launcher-subtitle{font-size:14px;line-height:21px;color:${designSystemColors["primary-600"]}}`,
416
+ "@media(forced-colors:active){.mm-launcher-content{outline:1px solid ButtonText}.mm-launcher:focus-visible{outline-color:Highlight}}",
400
417
  ".mm-icon{position:absolute;top:50%;left:50%;display:none;width:22px;height:22px;pointer-events:none;transform:translate(-50%,-50%)}",
401
418
  // Open on desktop: X sits on the chat's top-right corner (chat is bottom:24,
402
419
  // height min(640px, 100vh - 48px)).
403
420
  '.mm-launcher[aria-expanded="true"]{top:calc(100vh - 24px - min(640px,100vh - 48px) + 12px);right:36px;bottom:auto;z-index:2147483001;width:44px;height:44px;border-radius:999px;background:var(--mm-blue);color:var(--mm-white);box-shadow:0 4px 14px rgba(17,17,17,.2);transform:none;animation:mm-close-in .2s cubic-bezier(.23,1,.32,1) both;filter:none}',
404
421
  '.mm-launcher[aria-expanded="true"]:hover,.mm-launcher[aria-expanded="true"]:active{transform:none;filter:none;background:var(--mm-blue-hover)}',
405
- '.mm-launcher[aria-expanded="true"] .mm-text-us{display:none}',
422
+ '.mm-launcher[aria-expanded="true"]:focus-visible{outline-offset:3px}',
423
+ '.mm-launcher[aria-expanded="true"] .mm-launcher-content{display:none}',
406
424
  '.mm-launcher[aria-expanded="true"] .mm-icon-close{display:block}',
407
425
  ".mm-chat{position:fixed;right:24px;bottom:24px;z-index:2147483000;display:flex;flex-direction:column;width:min(400px,calc(100vw - 32px));height:min(640px,calc(100vh - 48px));overflow:hidden;border:1px solid var(--mm-line);border-radius:20px;background:linear-gradient(to bottom,var(--mm-chrome) 0 50%,var(--mm-panel-bottom,var(--mm-chrome)) 50% 100%);box-shadow:0 5px 25px rgba(0,0,0,.2);animation:mm-panel-in .18s ease-out both;font-family:var(--mm-font)}",
408
426
  '.mm-chat[data-keyboard="open"]{--mm-panel-bottom:var(--mm-surface-blue)}',
@@ -421,11 +439,11 @@
421
439
  ].join("");
422
440
  const widgetMarkup = (assetUrl) => [
423
441
  `<style>${WIDGET_STYLES}</style>`,
424
- `<button class="mm-launcher" type="button" aria-label="Open intake chat" aria-expanded="false" draggable="false"><img class="mm-text-us" src="${assetUrl("button-text-us.png")}" alt="" width="38" height="147" decoding="async" />${OPEN_CLOSE_ICON}</button>`,
442
+ `<button class="mm-launcher" type="button" aria-label="Chat now, see if you qualify" aria-expanded="false" draggable="false"><span class="mm-launcher-content" aria-hidden="true"><img class="mm-launcher-chat-icon" src="${assetUrl("launcher-chat.svg")}" alt="" width="48" height="48" decoding="async" /><span class="mm-launcher-copy"><span class="mm-launcher-title">CHAT NOW</span><span class="mm-launcher-subtitle">See if you qualify</span></span></span>${OPEN_CLOSE_ICON}</button>`,
425
443
  '<section class="mm-chat" role="dialog" aria-label="Morgan and Morgan intake chat" inert hidden>',
426
444
  '<div class="mm-frame-wrap"><div class="mm-loading" role="status" aria-label="Loading secure chat"><span class="mm-dot"></span><span class="mm-dot"></span><span class="mm-dot"></span></div><iframe class="mm-frame mm-chat-frame" title="Morgan and Morgan intake chat" referrerpolicy="strict-origin-when-cross-origin"></iframe></div>',
427
445
  "</section>",
428
- '<section class="mm-prompt-backdrop" role="dialog" aria-modal="true" aria-label="Start your free consultation" inert hidden>',
446
+ '<section class="mm-prompt-backdrop" role="dialog" aria-modal="true" aria-label="Start your free consultation" tabindex="-1" inert hidden>',
429
447
  promptMarkup(assetUrl),
430
448
  "</section>"
431
449
  ].join("");
@@ -521,7 +539,7 @@
521
539
  const syncLauncherLabel = () => {
522
540
  const isOpen = elements.chatDialog.dataset.state === "open";
523
541
  elements.launcher.setAttribute("aria-expanded", String(isOpen));
524
- elements.launcher.setAttribute("aria-label", isOpen ? "Close intake chat" : "Open intake chat");
542
+ elements.launcher.setAttribute("aria-label", isOpen ? "Close intake chat" : "Chat now, see if you qualify");
525
543
  };
526
544
  const postToChat = (message) => {
527
545
  var _a2;
@@ -599,7 +617,7 @@
599
617
  promptReturnFocus = document.activeElement instanceof HTMLElement && document.activeElement !== mount ? document.activeElement : null;
600
618
  elements.promptBackdrop.hidden = false;
601
619
  elements.promptBackdrop.removeAttribute("inert");
602
- elements.promptClose.focus();
620
+ elements.promptBackdrop.focus({ preventScroll: true });
603
621
  };
604
622
  const syncViewport = () => {
605
623
  const viewport = globalThis.visualViewport;
@@ -804,14 +822,9 @@
804
822
  };
805
823
  const handleKeydown = (event) => {
806
824
  if (event.key === "Tab" && elements.promptBackdrop.hidden === false) {
807
- const { activeElement } = shadow;
808
- if (!event.shiftKey && activeElement === elements.promptClose) {
809
- event.preventDefault();
810
- elements.promptOpen.focus();
811
- } else if (event.shiftKey && activeElement === elements.promptOpen) {
812
- event.preventDefault();
813
- elements.promptClose.focus();
814
- }
825
+ event.preventDefault();
826
+ const next = shadow.activeElement === elements.promptClose ? elements.promptOpen : elements.promptClose;
827
+ next.focus();
815
828
  return;
816
829
  }
817
830
  if (event.key !== "Escape") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@morgan-and-morgan/intake-agent",
3
- "version": "1.0.0-alpha.17",
3
+ "version": "1.0.0-alpha.19",
4
4
  "description": "Embeddable chat widget loader.",
5
5
  "license": "UNLICENSED",
6
6
  "files": [
@@ -34,6 +34,6 @@
34
34
  "@typescript/native-preview": "catalog:",
35
35
  "lucide-react-native": "^0.562.0",
36
36
  "typescript": "~5.9.3",
37
- "vite": "^7.3.6"
37
+ "vite": "^7.3.7"
38
38
  }
39
39
  }