@zenpatient-org/healthspan-marketing-ui 1.0.21 → 1.0.23
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),n=require("react"),d=require("../../components/ChatMessage/chatMessage.module.css"),F=require("../Typography/Typography.cjs.js"),le="(prefers-reduced-motion: reduce)",ie=[900,1150],ve=180,xe=130,ye=140,be=36,Ne=220,Te=new Set("th he in er an re on at en nd ou ea ha to it is or ti as te ng of al ar st se le ve me yo wh ch ll".split(" ")),Me=u=>{const l=window.matchMedia(le);return l.addEventListener("change",u),()=>l.removeEventListener("change",u)},Re=()=>window.matchMedia(le).matches,Ee=u=>{let l=Array.from(u).reduce((e,s)=>Math.imul(e^s.charCodeAt(0),16777619),2166136261);return()=>{l=l+1831565813|0;let e=Math.imul(l^l>>>15,1|l);return e=e+Math.imul(e^e>>>7,61|e)^e,((e^e>>>14)>>>0)/4294967296}},je=(u,l)=>{const e=Ee(l),s=(c,f)=>c+e()*(f-c);let T=0,h=0;return u.split("").map((c,f)=>{var t;const m=(t=u[f-1])!=null?t:"";let i;return f===0?i=0:/[.?!…]/.test(m)?i=s(180,260):/[,;:—]/.test(m)?i=s(120,180):c===" "?i=s(20,35):h>0?(h--,i=s(22,32)):Te.has((m+c).toLowerCase())?i=s(24,36):e()<.15?(h=2+Math.floor(e()*3),i=s(22,32)):i=s(35,60),m===" "&&e()<.08&&(i+=s(60,110)),T+=i})},we=u=>{const l=u.querySelector("p"),e=l.firstChild,s=e.textContent,T=l.getBoundingClientRect().left,h=getComputedStyle(u),c=parseFloat(h.paddingLeft)+parseFloat(h.paddingRight),f=document.createRange(),m=[0],i=[];let t,b=0;for(let S=0;S<s.length;S++){if(!/\s/.test(s[S])){f.setStart(e,S),f.setEnd(e,S+1);const M=f.getBoundingClientRect();t!==void 0&&M.top>t+1&&m.push(S),t=M.top,b=Math.max(b,M.right-T)}i.push(b)}return i[i.length-1]=u.getBoundingClientRect().width-c,{lineStarts:m,widths:i,lineHeight:parseFloat(getComputedStyle(l).lineHeight),padX:c,padY:parseFloat(h.paddingTop)+parseFloat(h.paddingBottom)}},re=(u,l)=>u.filter((e,s)=>s===0||e<l),Ce=({sender:u,avatar:l,children:e,typing:s=!1,attachment:T,thinking:h,typeOut:c=!1,seed:f,onTyped:m})=>{var k,ee;const i=n.useSyncExternalStore(Me,Re,()=>!1),t=typeof e=="string"?e:"",b=s||!!e,[S,M]=n.useState(t),[p,I]=n.useState(),[x,$]=n.useState(!1),[R,oe]=n.useState(0),[q,ce]=n.useState(!1),[E,D]=n.useState(!c),[de,H]=n.useState(!c),[C,K]=n.useState(!1),[j,ue]=n.useState(!1),[g,U]=n.useState(),[W,z]=n.useState(0),[he,fe]=n.useState(!1),P=n.useRef(null),O=n.useRef(null),_=n.useRef(void 0);h!=null&&h.length?(h!==p&&I(h),x&&$(!1),b&&!C&&K(!0)):p&&!x?i?I(void 0):($(!0),ce(!0)):!p&&C&&K(!1),c&&t&&t!==S&&(M(t),S&&(ue(!0),D(!1),H(!1),z(0),U(void 0)));const J=b&&(!p||x||C),X=c&&!de&&!s&&!!t&&J,N=X&&!i,Y=(k=p==null?void 0:p.length)!=null?k:0;n.useEffect(()=>{if(x||R>=Y-1)return;const r=ie[Math.min(R,ie.length-1)],o=setTimeout(()=>oe(R+1),r);return()=>clearTimeout(o)},[x,R,Y]);const G=n.useEffectEvent(()=>{D(!0),m==null||m()});n.useEffect(()=>{c&&!t&&!p&&!E&&G()},[c,t,p,E]),n.useLayoutEffect(()=>{if(!N)return;const r=we(O.current),o=P.current;j?!o.style.width&&_.current&&(o.style.width=`${_.current.width}px`,o.style.height=`${_.current.height}px`):(o.style.width=`${r.padX}px`,o.style.height=`${r.padY+r.lineHeight}px`),U(r)},[N,t,j]),n.useEffect(()=>{if(!X)return;if(i){G(),H(!0);return}if(!g)return;const r=P.current,o=je(t,f!=null?f:t),A=performance.now()+(q?ve:0)+xe;let L=j?r.getBoundingClientRect().width:g.padX;const me=L;let B,w,V=0;const te=y=>{var ne;const v=o.filter(Se=>Se<=y-A).length,se=o[v]-((ne=o[v-1])!=null?ne:0),ae=g.padX+(v?g.widths[v-1]:0),pe=v===o.length?ae:Math.max(me,ae),ge=se<be?30:45;if(L+=(pe-L)*(1-Math.exp(-(y-(B!=null?B:y))/ge)),B=y,r.style.width=`${L}px`,r.style.height=`${g.padY+g.lineHeight*re(g.lineStarts,v).length}px`,z(v),fe(v>0&&se>=ye),v===o.length&&(w!=null||(w=y),w===y&&G(),y-w>=Ne)){r.style.width="",r.style.height="",_.current=r.getBoundingClientRect(),H(!0);return}V=requestAnimationFrame(te)};return V=requestAnimationFrame(te),()=>cancelAnimationFrame(V)},[X,i,g,t,f,q,j]);const Q=(ee=g==null?void 0:g.lineStarts)!=null?ee:[0],Z=re(Q,W);return a.jsxs("div",{className:d.root,children:[a.jsx("span",{className:d.avatar,children:a.jsx("img",{src:l,alt:"",className:d.avatarImage})}),a.jsxs("div",{className:d.content,children:[a.jsxs("div",{className:d.message,children:[a.jsx(F.Typography,{as:"p",defaultVariant:"bodySm",weight:"medium",className:d.sender,children:u}),a.jsxs("div",{className:d.slot,"data-stacked":C||void 0,children:[p&&a.jsx("div",{className:d.status,"data-leaving":x||void 0,onAnimationEnd:()=>{x&&($(!1),I(void 0))},children:p.map((r,o)=>a.jsx("span",{className:d.statusLine,"data-active":o===Math.min(R,Y-1)||void 0,children:a.jsx(F.Typography,{defaultVariant:"headingXxs",children:r})},r))}),J&&a.jsx("div",{ref:P,className:d.bubble,"aria-live":s?"polite":void 0,"aria-hidden":c&&!s||void 0,"data-enter":N&&!j?q?"after-thinking":"direct":void 0,"data-typing":N||void 0,children:a.jsx(F.Typography,{as:"p",defaultVariant:"bodySm",className:d.text,children:s?a.jsxs("span",{role:"img","aria-label":`${u} is typing`,className:d.typing,children:[a.jsx("span",{children:"."}),a.jsx("span",{children:"."}),a.jsx("span",{children:"."})]}):N?Z.map((r,o)=>{var A;return a.jsxs("span",{className:d.line,children:[t.slice(r,Math.min((A=Q[o+1])!=null?A:t.length,W)).trimEnd(),o===Z.length-1&&a.jsx("span",{className:d.caret,"data-paused":he&&!E||void 0,"data-ending":E||void 0})]},r)}):e})})]}),N&&a.jsx("div",{ref:O,className:`${d.bubble} ${d.measure}`,"aria-hidden":!0,children:a.jsx(F.Typography,{as:"p",defaultVariant:"bodySm",children:t})}),c&&a.jsx("span",{className:d.srOnly,"aria-live":"polite",children:E?t:""})]}),T]})]})};exports.ChatMessage=Ce;
|
|
@@ -8,9 +8,9 @@ export type ChatMessageProps = {
|
|
|
8
8
|
typing?: boolean;
|
|
9
9
|
/** Rendered under the bubble, e.g. a cancellation widget or a follow-up CTA. */
|
|
10
10
|
attachment?: ReactNode;
|
|
11
|
-
/** Status lines
|
|
11
|
+
/** Status lines, above the bubble when there is text and in its place when there isn't. Each crossfades in place; the last holds until this is cleared. */
|
|
12
12
|
thinking?: string[];
|
|
13
|
-
/** Types out `children`, which must be a string. */
|
|
13
|
+
/** Types out `children`, which must be a string. New text types out again in the same bubble. */
|
|
14
14
|
typeOut?: boolean;
|
|
15
15
|
/** Seeds the typing rhythm, e.g. the message id, so a replay types the same way. Defaults to the text. */
|
|
16
16
|
seed?: string;
|
|
@@ -1,157 +1,161 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { useSyncExternalStore as
|
|
4
|
-
import
|
|
5
|
-
import { Typography as
|
|
6
|
-
const
|
|
2
|
+
import { jsxs as E, jsx as d } from "react/jsx-runtime";
|
|
3
|
+
import { useSyncExternalStore as ye, useState as f, useRef as K, useEffect as U, useEffectEvent as Me, useLayoutEffect as Ee } from "react";
|
|
4
|
+
import o from "../../components/ChatMessage/chatMessage.module.css";
|
|
5
|
+
import { Typography as $ } from "../Typography/Typography.es.js";
|
|
6
|
+
const de = "(prefers-reduced-motion: reduce)", oe = [900, 1150], xe = 180, Re = 130, Te = 140, we = 36, Ce = 220, Ae = new Set(
|
|
7
7
|
"th he in er an re on at en nd ou ea ha to it is or ti as te ng of al ar st se le ve me yo wh ch ll".split(" ")
|
|
8
|
-
),
|
|
9
|
-
const
|
|
10
|
-
return
|
|
11
|
-
},
|
|
12
|
-
let
|
|
8
|
+
), Le = (c) => {
|
|
9
|
+
const i = window.matchMedia(de);
|
|
10
|
+
return i.addEventListener("change", c), () => i.removeEventListener("change", c);
|
|
11
|
+
}, _e = () => window.matchMedia(de).matches, Be = (c) => {
|
|
12
|
+
let i = Array.from(c).reduce((e, s) => Math.imul(e ^ s.charCodeAt(0), 16777619), 2166136261);
|
|
13
13
|
return () => {
|
|
14
|
-
|
|
15
|
-
let e = Math.imul(
|
|
14
|
+
i = i + 1831565813 | 0;
|
|
15
|
+
let e = Math.imul(i ^ i >>> 15, 1 | i);
|
|
16
16
|
return e = e + Math.imul(e ^ e >>> 7, 61 | e) ^ e, ((e ^ e >>> 14) >>> 0) / 4294967296;
|
|
17
17
|
};
|
|
18
|
-
},
|
|
19
|
-
const e =
|
|
20
|
-
let
|
|
21
|
-
return
|
|
22
|
-
var
|
|
23
|
-
const m = (
|
|
24
|
-
let
|
|
25
|
-
return
|
|
18
|
+
}, Fe = (c, i) => {
|
|
19
|
+
const e = Be(i), s = (l, u) => l + e() * (u - l);
|
|
20
|
+
let x = 0, h = 0;
|
|
21
|
+
return c.split("").map((l, u) => {
|
|
22
|
+
var t;
|
|
23
|
+
const m = (t = c[u - 1]) != null ? t : "";
|
|
24
|
+
let n;
|
|
25
|
+
return u === 0 ? n = 0 : /[.?!…]/.test(m) ? n = s(180, 260) : /[,;:—]/.test(m) ? n = s(120, 180) : l === " " ? n = s(20, 35) : h > 0 ? (h--, n = s(22, 32)) : Ae.has((m + l).toLowerCase()) ? n = s(24, 36) : e() < 0.15 ? (h = 2 + Math.floor(e() * 3), n = s(22, 32)) : n = s(35, 60), m === " " && e() < 0.08 && (n += s(60, 110)), x += n;
|
|
26
26
|
});
|
|
27
|
-
},
|
|
28
|
-
const
|
|
29
|
-
let
|
|
30
|
-
for (let
|
|
31
|
-
if (!/\s/.test(
|
|
32
|
-
|
|
33
|
-
const
|
|
34
|
-
|
|
27
|
+
}, Ie = (c) => {
|
|
28
|
+
const i = c.querySelector("p"), e = i.firstChild, s = e.textContent, x = i.getBoundingClientRect().left, h = getComputedStyle(c), l = parseFloat(h.paddingLeft) + parseFloat(h.paddingRight), u = document.createRange(), m = [0], n = [];
|
|
29
|
+
let t, y = 0;
|
|
30
|
+
for (let v = 0; v < s.length; v++) {
|
|
31
|
+
if (!/\s/.test(s[v])) {
|
|
32
|
+
u.setStart(e, v), u.setEnd(e, v + 1);
|
|
33
|
+
const R = u.getBoundingClientRect();
|
|
34
|
+
t !== void 0 && R.top > t + 1 && m.push(v), t = R.top, y = Math.max(y, R.right - x);
|
|
35
35
|
}
|
|
36
|
-
|
|
36
|
+
n.push(y);
|
|
37
37
|
}
|
|
38
|
-
return
|
|
38
|
+
return n[n.length - 1] = c.getBoundingClientRect().width - l, {
|
|
39
39
|
lineStarts: m,
|
|
40
|
-
widths:
|
|
41
|
-
lineHeight: parseFloat(getComputedStyle(
|
|
42
|
-
padX:
|
|
43
|
-
padY: parseFloat(
|
|
40
|
+
widths: n,
|
|
41
|
+
lineHeight: parseFloat(getComputedStyle(i).lineHeight),
|
|
42
|
+
padX: l,
|
|
43
|
+
padY: parseFloat(h.paddingTop) + parseFloat(h.paddingBottom)
|
|
44
44
|
};
|
|
45
|
-
},
|
|
46
|
-
sender:
|
|
47
|
-
avatar:
|
|
45
|
+
}, ce = (c, i) => c.filter((e, s) => s === 0 || e < i), Ye = ({
|
|
46
|
+
sender: c,
|
|
47
|
+
avatar: i,
|
|
48
48
|
children: e,
|
|
49
|
-
typing:
|
|
50
|
-
attachment:
|
|
51
|
-
thinking:
|
|
52
|
-
typeOut:
|
|
53
|
-
seed:
|
|
49
|
+
typing: s = !1,
|
|
50
|
+
attachment: x,
|
|
51
|
+
thinking: h,
|
|
52
|
+
typeOut: l = !1,
|
|
53
|
+
seed: u,
|
|
54
54
|
onTyped: m
|
|
55
55
|
}) => {
|
|
56
|
-
var
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
if (
|
|
62
|
-
const
|
|
63
|
-
return () => clearTimeout(
|
|
64
|
-
}, [
|
|
65
|
-
const
|
|
66
|
-
|
|
56
|
+
var se, ne;
|
|
57
|
+
const n = ye(Le, _e, () => !1), t = typeof e == "string" ? e : "", y = s || !!e, [v, R] = f(t), [p, H] = f(), [b, P] = f(!1), [T, he] = f(0), [X, ue] = f(!1), [w, W] = f(!l), [fe, Y] = f(!l), [L, z] = f(!1), [C, me] = f(!1), [g, J] = f(), [O, Q] = f(0), [pe, ge] = f(!1), q = K(null), Z = K(null), _ = K(void 0);
|
|
58
|
+
h != null && h.length ? (h !== p && H(h), b && P(!1), y && !L && z(!0)) : p && !b ? n ? H(void 0) : (P(!0), ue(!0)) : !p && L && z(!1), l && t && t !== v && (R(t), v && (me(!0), W(!1), Y(!1), Q(0), J(void 0)));
|
|
59
|
+
const k = y && (!p || b || L), G = l && !fe && !s && !!t && k, M = G && !n, V = (se = p == null ? void 0 : p.length) != null ? se : 0;
|
|
60
|
+
U(() => {
|
|
61
|
+
if (b || T >= V - 1) return;
|
|
62
|
+
const a = oe[Math.min(T, oe.length - 1)], r = setTimeout(() => he(T + 1), a);
|
|
63
|
+
return () => clearTimeout(r);
|
|
64
|
+
}, [b, T, V]);
|
|
65
|
+
const D = Me(() => {
|
|
66
|
+
W(!0), m == null || m();
|
|
67
67
|
});
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
68
|
+
U(() => {
|
|
69
|
+
l && !t && !p && !w && D();
|
|
70
|
+
}, [l, t, p, w]), Ee(() => {
|
|
71
|
+
if (!M) return;
|
|
72
|
+
const a = Ie(Z.current), r = q.current;
|
|
73
|
+
C ? !r.style.width && _.current && (r.style.width = `${_.current.width}px`, r.style.height = `${_.current.height}px`) : (r.style.width = `${a.padX}px`, r.style.height = `${a.padY + a.lineHeight}px`), J(a);
|
|
74
|
+
}, [M, t, C]), U(() => {
|
|
75
|
+
if (!G) return;
|
|
76
|
+
if (n) {
|
|
77
|
+
D(), Y(!0);
|
|
76
78
|
return;
|
|
77
79
|
}
|
|
78
|
-
if (!
|
|
79
|
-
const
|
|
80
|
-
let
|
|
81
|
-
const
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
80
|
+
if (!g) return;
|
|
81
|
+
const a = q.current, r = Fe(t, u != null ? u : t), B = performance.now() + (X ? xe : 0) + Re;
|
|
82
|
+
let F = C ? a.getBoundingClientRect().width : g.padX;
|
|
83
|
+
const ve = F;
|
|
84
|
+
let I, A, j = 0;
|
|
85
|
+
const ae = (N) => {
|
|
86
|
+
var le;
|
|
87
|
+
const S = r.filter((Ne) => Ne <= N - B).length, ie = r[S] - ((le = r[S - 1]) != null ? le : 0), re = g.padX + (S ? g.widths[S - 1] : 0), Se = S === r.length ? re : Math.max(ve, re), be = ie < we ? 30 : 45;
|
|
88
|
+
if (F += (Se - F) * (1 - Math.exp(-(N - (I != null ? I : N)) / be)), I = N, a.style.width = `${F}px`, a.style.height = `${g.padY + g.lineHeight * ce(g.lineStarts, S).length}px`, Q(S), ge(S > 0 && ie >= Te), S === r.length && (A != null || (A = N), A === N && D(), N - A >= Ce)) {
|
|
89
|
+
a.style.width = "", a.style.height = "", _.current = a.getBoundingClientRect(), Y(!0);
|
|
86
90
|
return;
|
|
87
91
|
}
|
|
88
|
-
|
|
92
|
+
j = requestAnimationFrame(ae);
|
|
89
93
|
};
|
|
90
|
-
return
|
|
91
|
-
}, [
|
|
92
|
-
const
|
|
93
|
-
return /* @__PURE__ */
|
|
94
|
-
/* @__PURE__ */
|
|
95
|
-
/* @__PURE__ */
|
|
96
|
-
/* @__PURE__ */
|
|
97
|
-
/* @__PURE__ */
|
|
98
|
-
/* @__PURE__ */
|
|
99
|
-
|
|
94
|
+
return j = requestAnimationFrame(ae), () => cancelAnimationFrame(j);
|
|
95
|
+
}, [G, n, g, t, u, X, C]);
|
|
96
|
+
const ee = (ne = g == null ? void 0 : g.lineStarts) != null ? ne : [0], te = ce(ee, O);
|
|
97
|
+
return /* @__PURE__ */ E("div", { className: o.root, children: [
|
|
98
|
+
/* @__PURE__ */ d("span", { className: o.avatar, children: /* @__PURE__ */ d("img", { src: i, alt: "", className: o.avatarImage }) }),
|
|
99
|
+
/* @__PURE__ */ E("div", { className: o.content, children: [
|
|
100
|
+
/* @__PURE__ */ E("div", { className: o.message, children: [
|
|
101
|
+
/* @__PURE__ */ d($, { as: "p", defaultVariant: "bodySm", weight: "medium", className: o.sender, children: c }),
|
|
102
|
+
/* @__PURE__ */ E("div", { className: o.slot, "data-stacked": L || void 0, children: [
|
|
103
|
+
p && /* @__PURE__ */ d(
|
|
100
104
|
"div",
|
|
101
105
|
{
|
|
102
|
-
className:
|
|
103
|
-
"data-leaving":
|
|
106
|
+
className: o.status,
|
|
107
|
+
"data-leaving": b || void 0,
|
|
104
108
|
onAnimationEnd: () => {
|
|
105
|
-
|
|
109
|
+
b && (P(!1), H(void 0));
|
|
106
110
|
},
|
|
107
|
-
children:
|
|
111
|
+
children: p.map((a, r) => /* @__PURE__ */ d(
|
|
108
112
|
"span",
|
|
109
113
|
{
|
|
110
|
-
className:
|
|
111
|
-
"data-active":
|
|
112
|
-
children: /* @__PURE__ */
|
|
114
|
+
className: o.statusLine,
|
|
115
|
+
"data-active": r === Math.min(T, V - 1) || void 0,
|
|
116
|
+
children: /* @__PURE__ */ d($, { defaultVariant: "headingXxs", children: a })
|
|
113
117
|
},
|
|
114
|
-
|
|
118
|
+
a
|
|
115
119
|
))
|
|
116
120
|
}
|
|
117
121
|
),
|
|
118
|
-
|
|
122
|
+
k && /* @__PURE__ */ d(
|
|
119
123
|
"div",
|
|
120
124
|
{
|
|
121
|
-
ref:
|
|
122
|
-
className:
|
|
123
|
-
"aria-live":
|
|
124
|
-
"aria-hidden":
|
|
125
|
-
"data-enter":
|
|
126
|
-
"data-typing":
|
|
127
|
-
children: /* @__PURE__ */
|
|
128
|
-
/* @__PURE__ */
|
|
129
|
-
/* @__PURE__ */
|
|
130
|
-
/* @__PURE__ */
|
|
131
|
-
] }) :
|
|
132
|
-
var
|
|
133
|
-
return /* @__PURE__ */
|
|
134
|
-
|
|
135
|
-
|
|
125
|
+
ref: q,
|
|
126
|
+
className: o.bubble,
|
|
127
|
+
"aria-live": s ? "polite" : void 0,
|
|
128
|
+
"aria-hidden": l && !s || void 0,
|
|
129
|
+
"data-enter": M && !C ? X ? "after-thinking" : "direct" : void 0,
|
|
130
|
+
"data-typing": M || void 0,
|
|
131
|
+
children: /* @__PURE__ */ d($, { as: "p", defaultVariant: "bodySm", className: o.text, children: s ? /* @__PURE__ */ E("span", { role: "img", "aria-label": `${c} is typing`, className: o.typing, children: [
|
|
132
|
+
/* @__PURE__ */ d("span", { children: "." }),
|
|
133
|
+
/* @__PURE__ */ d("span", { children: "." }),
|
|
134
|
+
/* @__PURE__ */ d("span", { children: "." })
|
|
135
|
+
] }) : M ? te.map((a, r) => {
|
|
136
|
+
var B;
|
|
137
|
+
return /* @__PURE__ */ E("span", { className: o.line, children: [
|
|
138
|
+
t.slice(a, Math.min((B = ee[r + 1]) != null ? B : t.length, O)).trimEnd(),
|
|
139
|
+
r === te.length - 1 && /* @__PURE__ */ d(
|
|
136
140
|
"span",
|
|
137
141
|
{
|
|
138
|
-
className:
|
|
139
|
-
"data-paused":
|
|
140
|
-
"data-ending":
|
|
142
|
+
className: o.caret,
|
|
143
|
+
"data-paused": pe && !w || void 0,
|
|
144
|
+
"data-ending": w || void 0
|
|
141
145
|
}
|
|
142
146
|
)
|
|
143
|
-
] },
|
|
147
|
+
] }, a);
|
|
144
148
|
}) : e })
|
|
145
149
|
}
|
|
146
150
|
)
|
|
147
151
|
] }),
|
|
148
|
-
|
|
149
|
-
|
|
152
|
+
M && /* @__PURE__ */ d("div", { ref: Z, className: `${o.bubble} ${o.measure}`, "aria-hidden": !0, children: /* @__PURE__ */ d($, { as: "p", defaultVariant: "bodySm", children: t }) }),
|
|
153
|
+
l && /* @__PURE__ */ d("span", { className: o.srOnly, "aria-live": "polite", children: w ? t : "" })
|
|
150
154
|
] }),
|
|
151
|
-
|
|
155
|
+
x
|
|
152
156
|
] })
|
|
153
157
|
] });
|
|
154
158
|
};
|
|
155
159
|
export {
|
|
156
|
-
|
|
160
|
+
Ye as ChatMessage
|
|
157
161
|
};
|
|
@@ -95,6 +95,30 @@
|
|
|
95
95
|
grid-area: 1 / 1;
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
+
.slot[data-stacked] {
|
|
99
|
+
display: flex;
|
|
100
|
+
flex-direction: column;
|
|
101
|
+
align-items: flex-start;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.slot[data-stacked] .status {
|
|
105
|
+
grid-template-rows: 1fr;
|
|
106
|
+
margin-bottom: 9px;
|
|
107
|
+
overflow: hidden;
|
|
108
|
+
transition:
|
|
109
|
+
grid-template-rows 200ms ease-in-out,
|
|
110
|
+
margin-bottom 200ms ease-in-out;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.slot[data-stacked] .status[data-leaving] {
|
|
114
|
+
grid-template-rows: 0fr;
|
|
115
|
+
margin-bottom: 0;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.slot[data-stacked] .statusLine {
|
|
119
|
+
min-height: 0;
|
|
120
|
+
}
|
|
121
|
+
|
|
98
122
|
.status {
|
|
99
123
|
display: grid;
|
|
100
124
|
animation: status-in 220ms ease-out;
|