@alfadocs/ui-kit 1.134.0 → 1.136.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.
- package/dist/_chunks/{ai-prompt-input-JIPbrTF3.js → ai-prompt-input-CVNeusoW.js} +2 -2
- package/dist/_chunks/ai-summary-panel-BhCo2vZF.js +1045 -0
- package/dist/_chunks/{alia-sidebar-CK1zw_Bc.js → alia-sidebar-CVBlKur9.js} +4 -4
- package/dist/_chunks/{anamnesis-summary-rows-CCNmkq55.js → anamnesis-summary-rows-Dr2V1Rtf.js} +3 -3
- package/dist/_chunks/{appointment-card-DG3m9yN-.js → appointment-card-BT1cMZIX.js} +2 -2
- package/dist/_chunks/{appointment-peek-BK0tDs4C.js → appointment-peek-BP_ACFz5.js} +2 -2
- package/dist/_chunks/{appointment-timeline-BiI2riRZ.js → appointment-timeline-Dy4YQJ17.js} +2 -2
- package/dist/_chunks/{appointment-tray-ClJCtYQj.js → appointment-tray-B3gSHL1j.js} +2 -2
- package/dist/_chunks/{audio-recorder-CsnM_WDy.js → audio-recorder-BOF5YYoC.js} +2 -2
- package/dist/_chunks/{balance-badge-cell-DTiMdnCZ.js → balance-badge-cell-BSB02Bwo.js} +4 -4
- package/dist/_chunks/{bill-line-table-DHKb_O7c.js → bill-line-table-By-YL2ms.js} +2 -2
- package/dist/_chunks/{bishop-score-CKztphVz.js → bishop-score-DWGESRP9.js} +2 -2
- package/dist/_chunks/{calendar-appointment-editor-dialog-BSkIYGlW.js → calendar-appointment-editor-dialog-CB4cQOtc.js} +10 -10
- package/dist/_chunks/call-status-chip-pajxN5eZ.js +180 -0
- package/dist/_chunks/calls-panel-BIfatK90.js +1094 -0
- package/dist/_chunks/{chat-container-B83b4hut.js → chat-container-CoOT7dzB.js} +37 -36
- package/dist/_chunks/{chat-input-DwQ4_WXK.js → chat-input-BmvnuZqj.js} +112 -106
- package/dist/_chunks/{chat-message-CfIyXrxA.js → chat-message-B4TMeZ2m.js} +35 -30
- package/dist/_chunks/circle-x-W8Enq3i4.js +16 -0
- package/dist/_chunks/communications-panel-SQ-55e3V.js +1079 -0
- package/dist/_chunks/{data-grid-B2oaI7Lt.js → data-grid-CxKz8flO.js} +2 -2
- package/dist/_chunks/{data-table-FTV3uRjX.js → data-table-_tgj0C_T.js} +2 -2
- package/dist/_chunks/{default-tabs-DbebYO04.js → default-tabs-oDWQzbN7.js} +3 -3
- package/dist/_chunks/{document-preview-DLVIrOYV.js → document-preview-DWlejd8A.js} +2 -2
- package/dist/_chunks/entity-summary-CPUHzyil.js +297 -0
- package/dist/_chunks/{file-manager-Bzr5NK1t.js → file-manager-CEi4z2i0.js} +2 -2
- package/dist/_chunks/{gestational-age-calculator-mB6brTlp.js → gestational-age-calculator-CHbpC4vL.js} +2 -2
- package/dist/_chunks/get-error-message-DbFUzuja.js +7 -0
- package/dist/_chunks/handled-rejection-C-6Dq0As.js +9 -0
- package/dist/_chunks/{heatmap-C5gJin_F.js → heatmap-_546qI2V.js} +2 -2
- package/dist/_chunks/{invoice-upload-list-B5aMffTy.js → invoice-upload-list-CQI9MUl6.js} +3 -3
- package/dist/_chunks/{kit-extensions-DUaIYyMD.js → kit-extensions-BNBf4m8O.js} +3 -3
- package/dist/_chunks/{link-cell-renderer-D3JLPURZ.js → link-cell-renderer-Xx5T8u5Q.js} +3 -3
- package/dist/_chunks/megaphone-CzeTT9B3.js +22 -0
- package/dist/_chunks/{muscle-scheme-BGJD62op.js → muscle-scheme-D_rSyGDj.js} +2 -2
- package/dist/_chunks/{notes-panel-BAyPOr8N.js → notes-panel-BvjAo4RQ.js} +5 -4
- package/dist/_chunks/{optical-prescription-Da_r8pMr.js → optical-prescription-DaSbsh4p.js} +2 -2
- package/dist/_chunks/{patient-account-settings-BkAtIxJW.js → patient-account-settings-Bmfeclpd.js} +3 -3
- package/dist/_chunks/{patient-card-DTh3QTyS.js → patient-card-Cpr8iD19.js} +4 -4
- package/dist/_chunks/{patient-check-in-resume-xhqjC6gf.js → patient-check-in-resume-CYZ-SvsF.js} +41 -41
- package/dist/_chunks/{patient-details-DBtEITfE.js → patient-details-9eh9cNy7.js} +2 -2
- package/dist/_chunks/{patient-field-row-a5d4QijH.js → patient-field-row-B782eT0C.js} +2 -2
- package/dist/_chunks/{patient-sign-in-pin-CDBqV254.js → patient-sign-in-pin-DmMBwWet.js} +2 -2
- package/dist/_chunks/{patient-sign-in-steps-C2JSqlok.js → patient-sign-in-steps-BKcxNkdY.js} +37 -59
- package/dist/_chunks/{patient-summary-card-Bl2NknPe.js → patient-summary-card-K9zaMl1O.js} +2 -2
- package/dist/_chunks/phone-off-DQSTLz4l.js +28 -0
- package/dist/_chunks/{portal-details-CTEsm705.js → portal-details-DCIiGkHA.js} +2 -2
- package/dist/_chunks/{portal-documents-D8skew0h.js → portal-documents-DVKj6Sco.js} +4 -4
- package/dist/_chunks/{portal-parts-BdR29P7z.js → portal-parts-Br8wuala.js} +2 -2
- package/dist/_chunks/{pregnancy-dating-BNI32qNw.js → pregnancy-dating-lJbzai73.js} +2 -2
- package/dist/_chunks/{registration-form-DS3RuKHu.js → registration-form-CuLiTA52.js} +2 -2
- package/dist/_chunks/{reserved.agent-DOzOBUW7.js → reserved.agent-CabZHFJC.js} +2 -2
- package/dist/_chunks/{select-uESzXTX6.js → select-CIXKyUMw.js} +172 -149
- package/dist/_chunks/{session-countdown-DOx1IBUB.js → session-countdown-StcyUU5O.js} +56 -66
- package/dist/_chunks/{signature-request-CHsM_iWi.js → signature-request-vJDSHZld.js} +2 -2
- package/dist/_chunks/signing-end-screen-BdhbkPKO.js +1355 -0
- package/dist/_chunks/{tabs-CRIDBLP7.js → tabs-Czkmw5ou.js} +2 -2
- package/dist/_chunks/{task-editor-g1AGfxhr.js → task-editor-BfXSn6U1.js} +4 -3
- package/dist/_chunks/{tasks-panel-BE3zaayj.js → tasks-panel-DbtJS4QI.js} +156 -172
- package/dist/_chunks/{toolbar-CfdoJzMV.js → toolbar-DjG-cpD_.js} +2 -2
- package/dist/_chunks/{unit-converter-YKlHyUC2.js → unit-converter-CUAUTu2B.js} +2 -2
- package/dist/_chunks/{use-appointment-details-read-Dzc6fEzG.js → use-appointment-details-read-7J0j1FP7.js} +111 -110
- package/dist/_chunks/{voice-control-panel-Be_c0CQ0.js → voice-control-panel-Cp4vs1iy.js} +2 -2
- package/dist/_chunks/{workflow-status-D1WgGVTP.js → workflow-status-CO0mxXs2.js} +3 -2
- package/dist/agent-catalog.json +528 -2
- package/dist/agent-i18n/en.json +51 -1
- package/dist/browser-support.js +1 -1
- package/dist/components/_shared/sms-segments.d.ts +43 -0
- package/dist/components/ai-prompt-input/index.js +1 -1
- package/dist/components/ai-summary-panel/ai-summary-panel.agent.d.ts +4 -0
- package/dist/components/ai-summary-panel/ai-summary-panel.d.ts +134 -0
- package/dist/components/ai-summary-panel/index.d.ts +4 -0
- package/dist/components/ai-summary-panel/index.js +6 -0
- package/dist/components/ai-summary-panel/summary-markdown.d.ts +15 -0
- package/dist/components/appointment-card/index.js +2 -2
- package/dist/components/appointment-details-panel/index.js +1 -1
- package/dist/components/appointment-peek/index.js +1 -1
- package/dist/components/appointment-timeline/index.js +1 -1
- package/dist/components/audio-recorder/index.js +1 -1
- package/dist/components/bill-line-table/index.js +1 -1
- package/dist/components/bill-table/index.js +1 -1
- package/dist/components/bishop-score/index.js +1 -1
- package/dist/components/booking/index.js +1 -1
- package/dist/components/call-status-chip/call-status-chip.d.ts +30 -0
- package/dist/components/call-status-chip/index.d.ts +3 -0
- package/dist/components/call-status-chip/index.js +5 -0
- package/dist/components/calls-panel/calls-panel.agent.d.ts +4 -0
- package/dist/components/calls-panel/calls-panel.d.ts +153 -0
- package/dist/components/calls-panel/index.d.ts +4 -0
- package/dist/components/calls-panel/index.js +6 -0
- package/dist/components/chat-container/chat-container.d.ts +7 -0
- package/dist/components/chat-container/index.js +1 -1
- package/dist/components/chat-input/chat-input.d.ts +20 -0
- package/dist/components/chat-input/index.js +1 -1
- package/dist/components/chat-message/index.js +1 -1
- package/dist/components/communications-panel/communications-panel.agent.d.ts +4 -0
- package/dist/components/communications-panel/communications-panel.d.ts +148 -0
- package/dist/components/communications-panel/index.d.ts +6 -0
- package/dist/components/communications-panel/index.js +7 -0
- package/dist/components/data-grid/index.js +2 -2
- package/dist/components/data-table/index.js +2 -2
- package/dist/components/document-preview/index.js +1 -1
- package/dist/components/entity-summary/entity-summary.d.ts +37 -1
- package/dist/components/entity-summary/index.js +1 -1
- package/dist/components/file-manager/index.js +1 -1
- package/dist/components/gestational-age-calculator/index.js +1 -1
- package/dist/components/heatmap/index.js +1 -1
- package/dist/components/index.d.ts +4 -0
- package/dist/components/invoice-upload-list/index.js +1 -1
- package/dist/components/muscle-scheme/index.js +1 -1
- package/dist/components/notes-panel/index.js +1 -1
- package/dist/components/optical-prescription/index.js +1 -1
- package/dist/components/patient-details/index.js +1 -1
- package/dist/components/patient-summary-card/index.js +1 -1
- package/dist/components/patient-table/index.js +1 -1
- package/dist/components/pregnancy-dating/index.js +1 -1
- package/dist/components/rich-text-editor/index.js +1 -1
- package/dist/components/select/index.js +1 -1
- package/dist/components/select/select.d.ts +8 -0
- package/dist/components/session-countdown/index.js +1 -1
- package/dist/components/skeleton-scheme/index.js +1 -1
- package/dist/components/tabs/index.js +1 -1
- package/dist/components/task-editor/index.js +1 -1
- package/dist/components/tasks-panel/index.js +1 -1
- package/dist/components/unit-converter/index.js +1 -1
- package/dist/components/voice-control-panel/index.js +1 -1
- package/dist/components/workflow-status/index.js +1 -1
- package/dist/core.css +1 -1
- package/dist/host-compat.css +13 -4
- package/dist/i18n/locales/ar.d.ts +162 -0
- package/dist/i18n/locales/ar.js +163 -0
- package/dist/i18n/locales/de.d.ts +162 -0
- package/dist/i18n/locales/de.js +163 -0
- package/dist/i18n/locales/el.d.ts +162 -0
- package/dist/i18n/locales/el.js +163 -0
- package/dist/i18n/locales/en.d.ts +162 -0
- package/dist/i18n/locales/en.js +163 -0
- package/dist/i18n/locales/es.d.ts +162 -0
- package/dist/i18n/locales/es.js +163 -0
- package/dist/i18n/locales/fr.d.ts +162 -0
- package/dist/i18n/locales/fr.js +163 -0
- package/dist/i18n/locales/hi.d.ts +162 -0
- package/dist/i18n/locales/hi.js +163 -0
- package/dist/i18n/locales/it.d.ts +162 -0
- package/dist/i18n/locales/it.js +163 -0
- package/dist/i18n/locales/ja.d.ts +162 -0
- package/dist/i18n/locales/ja.js +163 -0
- package/dist/i18n/locales/nl.d.ts +162 -0
- package/dist/i18n/locales/nl.js +163 -0
- package/dist/i18n/locales/pl.d.ts +162 -0
- package/dist/i18n/locales/pl.js +163 -0
- package/dist/i18n/locales/pt.d.ts +162 -0
- package/dist/i18n/locales/pt.js +163 -0
- package/dist/i18n/locales/ro.d.ts +162 -0
- package/dist/i18n/locales/ro.js +163 -0
- package/dist/i18n/locales/ru.d.ts +162 -0
- package/dist/i18n/locales/ru.js +163 -0
- package/dist/i18n/locales/sq.d.ts +162 -0
- package/dist/i18n/locales/sq.js +163 -0
- package/dist/i18n/locales/sv.d.ts +162 -0
- package/dist/i18n/locales/sv.js +163 -0
- package/dist/i18n/locales/tr.d.ts +162 -0
- package/dist/i18n/locales/tr.js +163 -0
- package/dist/i18n/locales/zh.d.ts +162 -0
- package/dist/i18n/locales/zh.js +163 -0
- package/dist/index.js +905 -893
- package/dist/locales/ar.json +162 -0
- package/dist/locales/de.json +162 -0
- package/dist/locales/el.json +162 -0
- package/dist/locales/en.json +162 -0
- package/dist/locales/es.json +162 -0
- package/dist/locales/fr.json +162 -0
- package/dist/locales/hi.json +162 -0
- package/dist/locales/it.json +162 -0
- package/dist/locales/ja.json +162 -0
- package/dist/locales/nl.json +162 -0
- package/dist/locales/pl.json +162 -0
- package/dist/locales/pt.json +162 -0
- package/dist/locales/ro.json +162 -0
- package/dist/locales/ru.json +162 -0
- package/dist/locales/sq.json +162 -0
- package/dist/locales/sv.json +162 -0
- package/dist/locales/tr.json +162 -0
- package/dist/locales/zh.json +162 -0
- package/dist/patterns/alia-assistant/index.js +1 -1
- package/dist/patterns/anamnesis/index.js +1 -1
- package/dist/patterns/calendar/calendar.journey.d.ts +7 -0
- package/dist/patterns/calendar/index.js +1 -1
- package/dist/patterns/patient-account-settings/index.js +1 -1
- package/dist/patterns/patient-check-in/index.js +1 -1
- package/dist/patterns/patient-portal/index.js +2 -2
- package/dist/patterns/patient-sign-in/index.js +2 -2
- package/dist/patterns/registration-form/index.js +1 -1
- package/dist/patterns/signature-request/index.js +1 -1
- package/dist/patterns/signing/index.d.ts +1 -0
- package/dist/patterns/signing/index.js +1 -1
- package/dist/patterns/signing/multi-field-signer.d.ts +22 -1
- package/dist/patterns/signing/signing-checkbox-pill.d.ts +66 -0
- package/dist/patterns/signing/signing-checkbox-sheet.d.ts +16 -0
- package/dist/patterns/signing/signing-document-screen.d.ts +18 -1
- package/dist/tokens.css +1 -1
- package/package.json +17 -1
- package/dist/_chunks/entity-summary-KHM0PnSI.js +0 -265
- package/dist/_chunks/handled-rejection-6gqCf5vt.js +0 -13
- package/dist/_chunks/signing-end-screen-an9P8DOT.js +0 -1041
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsxs as u, jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as
|
|
2
|
+
import { forwardRef as M, useRef as i, useState as H, useCallback as L, useImperativeHandle as S, useMemo as j, useEffect as E } from "react";
|
|
3
3
|
import { c as C } from "./index-D2ZczOXr.js";
|
|
4
|
-
import { useTranslation as
|
|
5
|
-
import { u as
|
|
6
|
-
import { u as
|
|
7
|
-
import { F } from "./floating-action-button-BesoUmO_.js";
|
|
8
|
-
import { u as
|
|
9
|
-
import { u as
|
|
10
|
-
import { C as
|
|
11
|
-
const
|
|
4
|
+
import { useTranslation as K } from "react-i18next";
|
|
5
|
+
import { u as O } from "./registry-DvAUVLHh.js";
|
|
6
|
+
import { u as F } from "./index-Bze5jCG_.js";
|
|
7
|
+
import { F as P } from "./floating-action-button-BesoUmO_.js";
|
|
8
|
+
import { u as $ } from "./use-prefers-reduced-motion-BMwIQRjB.js";
|
|
9
|
+
import { u as D } from "./use-isomorphic-layout-effect-BGfaCOP1.js";
|
|
10
|
+
import { C as U } from "./chevron-down-DWE7GSq9.js";
|
|
11
|
+
const X = {
|
|
12
12
|
id: "chat-container",
|
|
13
13
|
// Scrolling the log viewport is pure ephemeral view state — `scroll`,
|
|
14
14
|
// not `navigate` (nothing routes; the conversation stays in place).
|
|
@@ -61,7 +61,7 @@ const U = {
|
|
|
61
61
|
description: "Sourced from the id prop."
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
-
},
|
|
64
|
+
}, Y = C(
|
|
65
65
|
"ds:relative ds:flex ds:w-full ds:flex-col ds:overflow-hidden ds:bg-background",
|
|
66
66
|
{
|
|
67
67
|
variants: {
|
|
@@ -72,7 +72,7 @@ const U = {
|
|
|
72
72
|
},
|
|
73
73
|
defaultVariants: { density: "default" }
|
|
74
74
|
}
|
|
75
|
-
),
|
|
75
|
+
), Z = C(
|
|
76
76
|
[
|
|
77
77
|
"ds:flex-1 ds:min-h-0 ds:overflow-y-auto ds:overflow-x-hidden",
|
|
78
78
|
"ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)]",
|
|
@@ -91,7 +91,7 @@ const U = {
|
|
|
91
91
|
"ds:motion-reduce:[mask-image:none]",
|
|
92
92
|
"ds:forced-colors:[mask-image:none]"
|
|
93
93
|
].join(" ")
|
|
94
|
-
),
|
|
94
|
+
), q = 100, G = 48, J = M(
|
|
95
95
|
({
|
|
96
96
|
messages: t,
|
|
97
97
|
composer: d,
|
|
@@ -100,9 +100,10 @@ const U = {
|
|
|
100
100
|
id: p,
|
|
101
101
|
onAutoScrollChange: c,
|
|
102
102
|
showScrollToLatest: N = !1,
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
103
|
+
logLabel: B,
|
|
104
|
+
...I
|
|
105
|
+
}, R) => {
|
|
106
|
+
const { t: f } = K("ui"), n = i(null), h = i(null), [a, _] = H(!0), v = $(), r = L(
|
|
106
107
|
(e) => {
|
|
107
108
|
const s = n.current;
|
|
108
109
|
if (!s) return;
|
|
@@ -114,12 +115,12 @@ const U = {
|
|
|
114
115
|
},
|
|
115
116
|
[v]
|
|
116
117
|
), g = i(null);
|
|
117
|
-
|
|
118
|
+
S(R, () => g.current, []);
|
|
118
119
|
const b = i(a);
|
|
119
120
|
b.current = a;
|
|
120
121
|
const x = i(t.length);
|
|
121
122
|
x.current = t.length;
|
|
122
|
-
const
|
|
123
|
+
const A = j(
|
|
123
124
|
() => ({
|
|
124
125
|
scrollToBottom: r,
|
|
125
126
|
getScrollViewport: () => n.current,
|
|
@@ -128,28 +129,28 @@ const U = {
|
|
|
128
129
|
}),
|
|
129
130
|
[r]
|
|
130
131
|
);
|
|
131
|
-
|
|
132
|
+
O(X, A, p), E(() => {
|
|
132
133
|
const e = n.current, s = h.current;
|
|
133
134
|
if (!e || !s) return;
|
|
134
135
|
const l = new IntersectionObserver(
|
|
135
|
-
(
|
|
136
|
-
const w =
|
|
137
|
-
|
|
136
|
+
(V) => {
|
|
137
|
+
const w = V[0];
|
|
138
|
+
_(w.isIntersecting), c == null || c(w.isIntersecting);
|
|
138
139
|
},
|
|
139
140
|
{
|
|
140
141
|
root: e,
|
|
141
142
|
// Fire when the sentinel is within BOTTOM_SLACK_PX of being visible.
|
|
142
|
-
rootMargin: `0px 0px ${
|
|
143
|
+
rootMargin: `0px 0px ${G}px 0px`,
|
|
143
144
|
threshold: 0
|
|
144
145
|
}
|
|
145
146
|
);
|
|
146
147
|
return l.observe(s), () => l.disconnect();
|
|
147
148
|
}, [c]);
|
|
148
|
-
const
|
|
149
|
-
|
|
149
|
+
const z = t.length;
|
|
150
|
+
D(() => {
|
|
150
151
|
a && r({ smooth: !1 });
|
|
151
|
-
}, [
|
|
152
|
-
const y = t.length >
|
|
152
|
+
}, [z, a, r]);
|
|
153
|
+
const y = t.length > q, m = F({
|
|
153
154
|
count: y ? t.length : 0,
|
|
154
155
|
getScrollElement: () => n.current,
|
|
155
156
|
estimateSize: () => 80,
|
|
@@ -163,10 +164,10 @@ const U = {
|
|
|
163
164
|
"div",
|
|
164
165
|
{
|
|
165
166
|
ref: g,
|
|
166
|
-
className:
|
|
167
|
+
className: Y({ density: T, className: k }),
|
|
167
168
|
"data-component": "chat-container",
|
|
168
169
|
"data-component-id": p,
|
|
169
|
-
...
|
|
170
|
+
...I,
|
|
170
171
|
children: [
|
|
171
172
|
/* @__PURE__ */ u("div", { className: "ds:relative ds:flex-1 ds:min-h-0 ds:flex ds:flex-col", children: [
|
|
172
173
|
/* @__PURE__ */ u(
|
|
@@ -176,9 +177,9 @@ const U = {
|
|
|
176
177
|
role: "log",
|
|
177
178
|
"aria-live": "polite",
|
|
178
179
|
"aria-relevant": "additions",
|
|
179
|
-
"aria-label": f("chat.container"),
|
|
180
|
+
"aria-label": B ?? f("chat.container"),
|
|
180
181
|
tabIndex: 0,
|
|
181
|
-
className:
|
|
182
|
+
className: Z(),
|
|
182
183
|
children: [
|
|
183
184
|
y ? /* @__PURE__ */ o(
|
|
184
185
|
"ol",
|
|
@@ -232,9 +233,9 @@ const U = {
|
|
|
232
233
|
"ds:duration-[var(--animation-duration)] ds:ease-[var(--ease-out)]"
|
|
233
234
|
].join(" "),
|
|
234
235
|
children: /* @__PURE__ */ o("div", { className: "ds:pointer-events-auto", children: /* @__PURE__ */ o(
|
|
235
|
-
|
|
236
|
+
P,
|
|
236
237
|
{
|
|
237
|
-
icon: /* @__PURE__ */ o(
|
|
238
|
+
icon: /* @__PURE__ */ o(U, {}),
|
|
238
239
|
"aria-label": f("chat.scrollToLatest"),
|
|
239
240
|
size: "sm",
|
|
240
241
|
variant: "secondary",
|
|
@@ -251,9 +252,9 @@ const U = {
|
|
|
251
252
|
);
|
|
252
253
|
}
|
|
253
254
|
);
|
|
254
|
-
|
|
255
|
+
J.displayName = "ChatContainer";
|
|
255
256
|
export {
|
|
256
|
-
|
|
257
|
-
|
|
257
|
+
J as C,
|
|
258
|
+
X as c
|
|
258
259
|
};
|
|
259
|
-
//# sourceMappingURL=chat-container-
|
|
260
|
+
//# sourceMappingURL=chat-container-CoOT7dzB.js.map
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { jsxs as v, jsx as o, Fragment as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { c as
|
|
4
|
-
import { useTranslation as
|
|
5
|
-
import { I as
|
|
6
|
-
import { u as
|
|
7
|
-
import { u as
|
|
8
|
-
import { u as
|
|
9
|
-
import { c as
|
|
10
|
-
import { C as
|
|
11
|
-
import { S as
|
|
1
|
+
import { jsxs as v, jsx as o, Fragment as we } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as ke, useId as Ce, useRef as C, useCallback as G, useImperativeHandle as Ne, useMemo as Ve } from "react";
|
|
3
|
+
import { c as je } from "./index-D2ZczOXr.js";
|
|
4
|
+
import { useTranslation as ze } from "react-i18next";
|
|
5
|
+
import { I as U } from "./icon-button-S8_weU3g.js";
|
|
6
|
+
import { u as He } from "./use-controllable-state-BiY4xTzM.js";
|
|
7
|
+
import { u as Te } from "./use-isomorphic-layout-effect-BGfaCOP1.js";
|
|
8
|
+
import { u as Ee } from "./registry-DvAUVLHh.js";
|
|
9
|
+
import { c as Me } from "./createLucideIcon-DhHxpK9K.js";
|
|
10
|
+
import { C as Fe } from "./circle-alert-rGDZ73Wh.js";
|
|
11
|
+
import { S as Ke } from "./send-C5kDJ-Mz.js";
|
|
12
12
|
/**
|
|
13
13
|
* @license lucide-react v1.22.0 - ISC
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the ISC license.
|
|
16
16
|
* See the LICENSE file in the root directory of this source tree.
|
|
17
17
|
*/
|
|
18
|
-
const
|
|
18
|
+
const Re = [
|
|
19
19
|
[
|
|
20
20
|
"path",
|
|
21
21
|
{
|
|
@@ -23,7 +23,7 @@ const He = [
|
|
|
23
23
|
key: "1miecu"
|
|
24
24
|
}
|
|
25
25
|
]
|
|
26
|
-
], Se =
|
|
26
|
+
], Se = Me("paperclip", Re), Be = {
|
|
27
27
|
id: "chat-input",
|
|
28
28
|
capabilities: ["edit_inline", "submit"],
|
|
29
29
|
state: {
|
|
@@ -77,7 +77,7 @@ const He = [
|
|
|
77
77
|
// the message to a backend / model — an external side effect.
|
|
78
78
|
openWorld: !0,
|
|
79
79
|
descriptionKey: "ui.agent.chatInput.actions.submit",
|
|
80
|
-
description: "Submit the current composer state via onSubmit.",
|
|
80
|
+
description: "Submit the current composer state via onSubmit. An empty composer is submitted only when allowEmptySubmit is set; otherwise nothing is sent.",
|
|
81
81
|
invoke: (t) => {
|
|
82
82
|
t.submit();
|
|
83
83
|
}
|
|
@@ -103,15 +103,15 @@ const He = [
|
|
|
103
103
|
description: "Sourced from the id prop."
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
|
-
},
|
|
106
|
+
}, Pe = je(
|
|
107
107
|
[
|
|
108
108
|
"ds:flex ds:flex-col ds:gap-[var(--spacing-xs)] ds:w-full",
|
|
109
|
-
//
|
|
110
|
-
//
|
|
109
|
+
// A raised composer: the card surface and `--shadow-card`, the same
|
|
110
|
+
// elevation as the ChatMessage bubbles above it. The 1px edge is `--control-border`
|
|
111
111
|
// (3:1 in every theme), so the field reads by its edge alone and the
|
|
112
112
|
// focus-within override and forced-colors fallback still paint over it.
|
|
113
113
|
"ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--control-border)]",
|
|
114
|
-
"ds:bg-
|
|
114
|
+
"ds:bg-[var(--card)] ds:shadow-[var(--shadow-card)]",
|
|
115
115
|
"ds:focus-within:border-[color:var(--primary)]",
|
|
116
116
|
// The focus ring goes round the whole box, as PhoneInput's does: on the
|
|
117
117
|
// textarea it drew a second outline across the box's own edge. The 1px
|
|
@@ -134,7 +134,7 @@ const He = [
|
|
|
134
134
|
defaultVariants: { size: "md" }
|
|
135
135
|
}
|
|
136
136
|
);
|
|
137
|
-
function
|
|
137
|
+
function _e(t, a) {
|
|
138
138
|
if (typeof Intl < "u" && typeof Intl.Segmenter == "function")
|
|
139
139
|
try {
|
|
140
140
|
const l = new Intl.Segmenter(a, { granularity: "grapheme" });
|
|
@@ -145,7 +145,7 @@ function Me(t, a) {
|
|
|
145
145
|
}
|
|
146
146
|
return Array.from(t).length;
|
|
147
147
|
}
|
|
148
|
-
function
|
|
148
|
+
function $e(t, a, l) {
|
|
149
149
|
if (typeof Intl < "u" && typeof Intl.Segmenter == "function")
|
|
150
150
|
try {
|
|
151
151
|
const y = new Intl.Segmenter(l, { granularity: "grapheme" }), i = [];
|
|
@@ -158,7 +158,7 @@ function Fe(t, a, l) {
|
|
|
158
158
|
const r = Array.from(t);
|
|
159
159
|
return r.length <= a ? t : r.slice(0, a).join("");
|
|
160
160
|
}
|
|
161
|
-
const
|
|
161
|
+
const We = ke(
|
|
162
162
|
({
|
|
163
163
|
size: t = "md",
|
|
164
164
|
value: a,
|
|
@@ -169,116 +169,122 @@ const Ke = ve(
|
|
|
169
169
|
maxRows: d = 8,
|
|
170
170
|
onSubmit: u,
|
|
171
171
|
onAttach: b,
|
|
172
|
-
accept:
|
|
172
|
+
accept: Y,
|
|
173
173
|
disabled: x,
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
174
|
+
submitDisabled: M = !1,
|
|
175
|
+
toolbar: J,
|
|
176
|
+
label: F,
|
|
177
|
+
hideLabel: L = !1,
|
|
178
|
+
sendLabel: O,
|
|
179
|
+
sendIcon: Q,
|
|
180
|
+
allowEmptySubmit: K = !1,
|
|
181
|
+
submitShortcut: I = !0,
|
|
182
|
+
placeholder: X,
|
|
183
|
+
className: Z,
|
|
184
|
+
onChange: N,
|
|
185
|
+
onKeyDown: V,
|
|
186
|
+
onCompositionStart: j,
|
|
187
|
+
onCompositionEnd: z,
|
|
188
|
+
id: H,
|
|
189
|
+
...D
|
|
190
|
+
}, ee) => {
|
|
191
|
+
const { t: c, i18n: R } = ze("ui"), te = Ce(), p = C(!1), S = C(null), w = C(null), se = G((e) => {
|
|
192
|
+
w.current = e;
|
|
193
|
+
}, []), [re, f] = He({
|
|
188
194
|
value: a === void 0 ? void 0 : String(a),
|
|
189
195
|
defaultValue: String(l ?? "")
|
|
190
|
-
}), n =
|
|
191
|
-
const e =
|
|
196
|
+
}), n = re ?? "", T = _e(n, R.language), m = typeof r == "number" && r > 0, ae = m ? Math.max(0, r - T) : 0, ne = m && T > r * 0.9, h = m && T >= r, B = G(() => {
|
|
197
|
+
const e = w.current;
|
|
192
198
|
if (!e) return;
|
|
193
|
-
const s = window.getComputedStyle(e), k = parseFloat(s.lineHeight) || 24,
|
|
199
|
+
const s = window.getComputedStyle(e), k = parseFloat(s.lineHeight) || 24, ge = parseFloat(s.paddingTop) || 0, ve = parseFloat(s.paddingBottom) || 0, ye = parseFloat(s.borderTopWidth) || 0, be = parseFloat(s.borderBottomWidth) || 0, A = ge + ve + ye + be, xe = k * i + A, q = k * d + A;
|
|
194
200
|
e.style.height = "auto";
|
|
195
|
-
const
|
|
196
|
-
e.style.height = `${
|
|
201
|
+
const Ie = Math.max(xe, Math.min(e.scrollHeight, q));
|
|
202
|
+
e.style.height = `${Ie}px`, e.style.overflowY = e.scrollHeight > q ? "auto" : "hidden";
|
|
197
203
|
}, [i, d]);
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
}, [
|
|
201
|
-
const
|
|
204
|
+
Te(() => {
|
|
205
|
+
B();
|
|
206
|
+
}, [B, n]);
|
|
207
|
+
const oe = (e) => {
|
|
202
208
|
let s = e.target.value;
|
|
203
|
-
|
|
204
|
-
},
|
|
205
|
-
p.current = !0,
|
|
206
|
-
},
|
|
207
|
-
p.current = !1,
|
|
208
|
-
},
|
|
209
|
+
m && !p.current && (s = $e(s, r, R.language)), f(s), !p.current && (N == null || N(e));
|
|
210
|
+
}, ie = (e) => {
|
|
211
|
+
p.current = !0, j == null || j(e);
|
|
212
|
+
}, ce = (e) => {
|
|
213
|
+
p.current = !1, z == null || z(e);
|
|
214
|
+
}, le = (e) => e.nativeEvent.isComposing || e.keyCode === 229 || p.current, E = () => {
|
|
209
215
|
var s;
|
|
210
|
-
!n.trim() || x || h || (u == null || u(n),
|
|
211
|
-
},
|
|
212
|
-
|
|
213
|
-
const
|
|
216
|
+
!n.trim() && !K || x || M || h || (u == null || u(n), f(""), (s = w.current) == null || s.focus());
|
|
217
|
+
}, P = C(null);
|
|
218
|
+
Ne(ee, () => P.current, []);
|
|
219
|
+
const de = Ve(
|
|
214
220
|
() => ({
|
|
215
221
|
getValue: () => n,
|
|
216
222
|
isEmpty: () => !n.trim(),
|
|
217
223
|
setValue: (e) => {
|
|
218
|
-
|
|
224
|
+
f(e);
|
|
219
225
|
},
|
|
220
226
|
clear: () => {
|
|
221
|
-
|
|
227
|
+
f("");
|
|
222
228
|
},
|
|
223
229
|
submit: () => {
|
|
224
|
-
|
|
230
|
+
E();
|
|
225
231
|
},
|
|
226
232
|
focus: () => {
|
|
227
233
|
var e;
|
|
228
|
-
(e =
|
|
234
|
+
(e = w.current) == null || e.focus();
|
|
229
235
|
}
|
|
230
236
|
}),
|
|
231
237
|
// `submit` is a local closure that always sees the latest currentValue
|
|
232
238
|
// via React's render cycle — depend on currentValue so the handle
|
|
233
239
|
// picks up new values across renders.
|
|
234
240
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
235
|
-
[n,
|
|
241
|
+
[n, f]
|
|
236
242
|
);
|
|
237
|
-
|
|
238
|
-
const
|
|
239
|
-
if (
|
|
240
|
-
const s = e.metaKey || e.ctrlKey, k = y && !e.shiftKey;
|
|
241
|
-
(s || k) && (e.preventDefault(),
|
|
243
|
+
Ee(Be, de, H);
|
|
244
|
+
const ue = (e) => {
|
|
245
|
+
if (V == null || V(e), !e.defaultPrevented && !le(e) && e.key === "Enter") {
|
|
246
|
+
const s = I && (e.metaKey || e.ctrlKey), k = y && !e.shiftKey;
|
|
247
|
+
(s || k) && (e.preventDefault(), E());
|
|
242
248
|
}
|
|
243
|
-
},
|
|
249
|
+
}, pe = () => {
|
|
244
250
|
var e;
|
|
245
|
-
(e =
|
|
246
|
-
},
|
|
251
|
+
(e = S.current) == null || e.click();
|
|
252
|
+
}, fe = (e) => {
|
|
247
253
|
e.target.files && e.target.files.length > 0 && (b == null || b(e.target.files)), e.target.value = "";
|
|
248
|
-
}, g =
|
|
254
|
+
}, g = H ?? te, _ = `${g}-label`, $ = m ? `${g}-counter` : void 0, W = `${g}-hint`, me = X ?? c("chat.input.placeholder"), he = F ?? c("chat.prompt");
|
|
249
255
|
return /* @__PURE__ */ v(
|
|
250
256
|
"div",
|
|
251
257
|
{
|
|
252
|
-
ref:
|
|
258
|
+
ref: P,
|
|
253
259
|
"data-component": "chat-input",
|
|
254
|
-
"data-component-id":
|
|
255
|
-
className:
|
|
260
|
+
"data-component-id": H,
|
|
261
|
+
className: Pe({ size: t, className: Z }),
|
|
256
262
|
children: [
|
|
257
263
|
/* @__PURE__ */ o(
|
|
258
264
|
"label",
|
|
259
265
|
{
|
|
260
|
-
id:
|
|
266
|
+
id: _,
|
|
261
267
|
htmlFor: g,
|
|
262
|
-
className:
|
|
263
|
-
children:
|
|
268
|
+
className: F && !L ? "type-label ds:ps-[var(--spacing-sm)] ds:pt-[var(--spacing-sm)]" : "ds:sr-only",
|
|
269
|
+
children: he
|
|
264
270
|
}
|
|
265
271
|
),
|
|
266
272
|
/* @__PURE__ */ o(
|
|
267
273
|
"textarea",
|
|
268
274
|
{
|
|
269
|
-
ref:
|
|
275
|
+
ref: se,
|
|
270
276
|
id: g,
|
|
271
277
|
value: n,
|
|
272
278
|
disabled: x,
|
|
273
279
|
rows: i,
|
|
274
|
-
placeholder:
|
|
275
|
-
"aria-labelledby":
|
|
276
|
-
"aria-describedby": [
|
|
280
|
+
placeholder: me,
|
|
281
|
+
"aria-labelledby": _,
|
|
282
|
+
"aria-describedby": [$, I ? W : void 0].filter(Boolean).join(" ") || void 0,
|
|
277
283
|
"aria-invalid": h || void 0,
|
|
278
|
-
onChange:
|
|
279
|
-
onKeyDown:
|
|
280
|
-
onCompositionStart:
|
|
281
|
-
onCompositionEnd:
|
|
284
|
+
onChange: oe,
|
|
285
|
+
onKeyDown: ue,
|
|
286
|
+
onCompositionStart: ie,
|
|
287
|
+
onCompositionEnd: ce,
|
|
282
288
|
className: [
|
|
283
289
|
"ds:w-full ds:resize-none ds:bg-transparent",
|
|
284
290
|
"ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)] ds:pt-[var(--spacing-sm)] ds:pb-[var(--spacing-xs)]",
|
|
@@ -288,42 +294,42 @@ const Ke = ve(
|
|
|
288
294
|
// The box draws the focus ring (see rootVariants).
|
|
289
295
|
"ds:outline-none"
|
|
290
296
|
].join(" "),
|
|
291
|
-
...
|
|
297
|
+
...D
|
|
292
298
|
}
|
|
293
299
|
),
|
|
294
300
|
/* @__PURE__ */ v("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-xs)] ds:ps-[var(--spacing-xs)] ds:pe-[var(--spacing-xs)] ds:pb-[var(--spacing-xs)]", children: [
|
|
295
|
-
b ? /* @__PURE__ */ v(
|
|
301
|
+
b ? /* @__PURE__ */ v(we, { children: [
|
|
296
302
|
/* @__PURE__ */ o(
|
|
297
303
|
"input",
|
|
298
304
|
{
|
|
299
|
-
ref:
|
|
305
|
+
ref: S,
|
|
300
306
|
type: "file",
|
|
301
307
|
className: "ds:sr-only",
|
|
302
308
|
multiple: !0,
|
|
303
|
-
accept:
|
|
304
|
-
onChange:
|
|
309
|
+
accept: Y,
|
|
310
|
+
onChange: fe,
|
|
305
311
|
"aria-label": c("chat.input.attach"),
|
|
306
312
|
tabIndex: -1
|
|
307
313
|
}
|
|
308
314
|
),
|
|
309
315
|
/* @__PURE__ */ o(
|
|
310
|
-
|
|
316
|
+
U,
|
|
311
317
|
{
|
|
312
318
|
icon: /* @__PURE__ */ o(Se, {}),
|
|
313
319
|
"aria-label": c("chat.input.attach"),
|
|
314
320
|
intent: "ghost",
|
|
315
321
|
size: "sm",
|
|
316
|
-
onClick:
|
|
322
|
+
onClick: pe,
|
|
317
323
|
disabled: x
|
|
318
324
|
}
|
|
319
325
|
)
|
|
320
326
|
] }) : null,
|
|
321
|
-
|
|
327
|
+
J,
|
|
322
328
|
/* @__PURE__ */ v("div", { className: "ds:ms-auto ds:inline-flex ds:items-center ds:gap-[var(--spacing-sm)]", children: [
|
|
323
|
-
|
|
329
|
+
ne ? /* @__PURE__ */ v(
|
|
324
330
|
"span",
|
|
325
331
|
{
|
|
326
|
-
id:
|
|
332
|
+
id: $,
|
|
327
333
|
"aria-live": "polite",
|
|
328
334
|
className: [
|
|
329
335
|
"ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]",
|
|
@@ -334,23 +340,23 @@ const Ke = ve(
|
|
|
334
340
|
h ? (
|
|
335
341
|
// Icon pairs with --destructive colour so the at-limit
|
|
336
342
|
// state is not conveyed by hue alone (WCAG 1.4.1).
|
|
337
|
-
/* @__PURE__ */ o(
|
|
343
|
+
/* @__PURE__ */ o(Fe, { "aria-hidden": "true", className: "ds:size-3.5" })
|
|
338
344
|
) : null,
|
|
339
|
-
c("chat.input.remaining", { count:
|
|
345
|
+
c("chat.input.remaining", { count: ae })
|
|
340
346
|
]
|
|
341
347
|
}
|
|
342
348
|
) : null,
|
|
343
|
-
/* @__PURE__ */ o("span", { id:
|
|
349
|
+
I ? /* @__PURE__ */ o("span", { id: W, className: "ds:sr-only", children: c("chat.input.sendHint") }) : null,
|
|
344
350
|
/* @__PURE__ */ o(
|
|
345
|
-
|
|
351
|
+
U,
|
|
346
352
|
{
|
|
347
|
-
icon: /* @__PURE__ */ o(
|
|
348
|
-
"aria-label": c("chat.send"),
|
|
353
|
+
icon: Q ?? /* @__PURE__ */ o(Ke, {}),
|
|
354
|
+
"aria-label": O ?? c("chat.send"),
|
|
349
355
|
intent: "primary",
|
|
350
356
|
size: "sm",
|
|
351
|
-
disabled: x || !n.trim() || h,
|
|
352
|
-
onClick:
|
|
353
|
-
"aria-keyshortcuts": "Meta+Enter Control+Enter"
|
|
357
|
+
disabled: x || M || !n.trim() && !K || h,
|
|
358
|
+
onClick: E,
|
|
359
|
+
"aria-keyshortcuts": I ? "Meta+Enter Control+Enter" : void 0
|
|
354
360
|
}
|
|
355
361
|
)
|
|
356
362
|
] })
|
|
@@ -360,10 +366,10 @@ const Ke = ve(
|
|
|
360
366
|
);
|
|
361
367
|
}
|
|
362
368
|
);
|
|
363
|
-
|
|
369
|
+
We.displayName = "ChatInput";
|
|
364
370
|
export {
|
|
365
|
-
|
|
371
|
+
We as C,
|
|
366
372
|
Se as P,
|
|
367
|
-
|
|
373
|
+
Be as c
|
|
368
374
|
};
|
|
369
|
-
//# sourceMappingURL=chat-input-
|
|
375
|
+
//# sourceMappingURL=chat-input-BmvnuZqj.js.map
|