@alfadocs/ui-kit 1.135.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-CtwhdASP.js → alia-sidebar-CVBlKur9.js} +3 -3
- package/dist/_chunks/{anamnesis-summary-rows-CCNmkq55.js → anamnesis-summary-rows-Dr2V1Rtf.js} +3 -3
- 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-I5PfWudy.js → calendar-appointment-editor-dialog-CB4cQOtc.js} +5 -5
- package/dist/_chunks/call-status-chip-pajxN5eZ.js +180 -0
- package/dist/_chunks/calls-panel-BIfatK90.js +1094 -0
- package/dist/_chunks/{chat-input-CX4dxBq7.js → chat-input-BmvnuZqj.js} +114 -109
- 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/{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/{muscle-scheme-BGJD62op.js → muscle-scheme-D_rSyGDj.js} +2 -2
- package/dist/_chunks/{optical-prescription-Da_r8pMr.js → optical-prescription-DaSbsh4p.js} +2 -2
- package/dist/_chunks/{patient-account-settings-B2XbN_Fe.js → patient-account-settings-Bmfeclpd.js} +2 -2
- package/dist/_chunks/{patient-card-DTh3QTyS.js → patient-card-Cpr8iD19.js} +4 -4
- package/dist/_chunks/{patient-check-in-resume-B7NY-6KI.js → patient-check-in-resume-CYZ-SvsF.js} +38 -38
- 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-documents-DJOH8pZx.js → portal-documents-DVKj6Sco.js} +3 -3
- 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/{tabs-CRIDBLP7.js → tabs-Czkmw5ou.js} +2 -2
- package/dist/_chunks/{task-editor-DvwqPfFR.js → task-editor-BfXSn6U1.js} +2 -2
- package/dist/_chunks/{tasks-panel-6EzdnwT8.js → tasks-panel-DbtJS4QI.js} +2 -2
- 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-6_OmOwUs.js → use-appointment-details-read-7J0j1FP7.js} +2 -2
- package/dist/_chunks/{voice-control-panel-Be_c0CQ0.js → voice-control-panel-Cp4vs1iy.js} +2 -2
- package/dist/agent-catalog.json +282 -6
- package/dist/agent-i18n/en.json +26 -4
- package/dist/browser-support.js +1 -1
- package/dist/components/ai-prompt-input/index.js +1 -1
- package/dist/components/ai-summary-panel/ai-summary-panel.d.ts +68 -5
- package/dist/components/ai-summary-panel/index.d.ts +1 -1
- package/dist/components/ai-summary-panel/index.js +1 -1
- package/dist/components/ai-summary-panel/summary-markdown.d.ts +15 -0
- package/dist/components/appointment-details-panel/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-input/chat-input.d.ts +17 -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.d.ts +15 -3
- package/dist/components/communications-panel/index.js +1 -1
- 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 +29 -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 +2 -0
- package/dist/components/invoice-upload-list/index.js +1 -1
- package/dist/components/muscle-scheme/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/core.css +1 -1
- package/dist/host-compat.css +4 -1
- package/dist/i18n/locales/ar.d.ts +72 -3
- package/dist/i18n/locales/ar.js +74 -5
- package/dist/i18n/locales/de.d.ts +72 -3
- package/dist/i18n/locales/de.js +74 -5
- package/dist/i18n/locales/el.d.ts +72 -3
- package/dist/i18n/locales/el.js +74 -5
- package/dist/i18n/locales/en.d.ts +72 -3
- package/dist/i18n/locales/en.js +73 -4
- package/dist/i18n/locales/es.d.ts +72 -3
- package/dist/i18n/locales/es.js +74 -5
- package/dist/i18n/locales/fr.d.ts +72 -3
- package/dist/i18n/locales/fr.js +74 -5
- package/dist/i18n/locales/hi.d.ts +72 -3
- package/dist/i18n/locales/hi.js +74 -5
- package/dist/i18n/locales/it.d.ts +83 -14
- package/dist/i18n/locales/it.js +84 -15
- package/dist/i18n/locales/ja.d.ts +72 -3
- package/dist/i18n/locales/ja.js +74 -5
- package/dist/i18n/locales/nl.d.ts +72 -3
- package/dist/i18n/locales/nl.js +74 -5
- package/dist/i18n/locales/pl.d.ts +72 -3
- package/dist/i18n/locales/pl.js +74 -5
- package/dist/i18n/locales/pt.d.ts +72 -3
- package/dist/i18n/locales/pt.js +74 -5
- package/dist/i18n/locales/ro.d.ts +72 -3
- package/dist/i18n/locales/ro.js +74 -5
- package/dist/i18n/locales/ru.d.ts +72 -3
- package/dist/i18n/locales/ru.js +74 -5
- package/dist/i18n/locales/sq.d.ts +72 -3
- package/dist/i18n/locales/sq.js +74 -5
- package/dist/i18n/locales/sv.d.ts +72 -3
- package/dist/i18n/locales/sv.js +74 -5
- package/dist/i18n/locales/tr.d.ts +72 -3
- package/dist/i18n/locales/tr.js +74 -5
- package/dist/i18n/locales/zh.d.ts +72 -3
- package/dist/i18n/locales/zh.js +74 -5
- package/dist/index.js +707 -702
- package/dist/locales/ar.json +74 -5
- package/dist/locales/de.json +74 -5
- package/dist/locales/el.json +74 -5
- package/dist/locales/en.json +73 -4
- package/dist/locales/es.json +74 -5
- package/dist/locales/fr.json +74 -5
- package/dist/locales/hi.json +74 -5
- package/dist/locales/it.json +84 -15
- package/dist/locales/ja.json +74 -5
- package/dist/locales/nl.json +74 -5
- package/dist/locales/pl.json +74 -5
- package/dist/locales/pt.json +74 -5
- package/dist/locales/ro.json +74 -5
- package/dist/locales/ru.json +74 -5
- package/dist/locales/sq.json +74 -5
- package/dist/locales/sv.json +74 -5
- package/dist/locales/tr.json +74 -5
- package/dist/locales/zh.json +74 -5
- package/dist/patterns/alia-assistant/index.js +1 -1
- package/dist/patterns/anamnesis/index.js +1 -1
- 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 +1 -1
- 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/tokens.css +1 -1
- package/package.json +9 -1
- package/dist/_chunks/ai-summary-panel-B70S2lgC.js +0 -455
- package/dist/_chunks/communications-panel-BKPHCiMB.js +0 -973
- package/dist/_chunks/entity-summary-CpNk6ybN.js +0 -266
|
@@ -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 Se = [
|
|
|
23
23
|
key: "1miecu"
|
|
24
24
|
}
|
|
25
25
|
]
|
|
26
|
-
],
|
|
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 Se = [
|
|
|
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 Se = [
|
|
|
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 Se = [
|
|
|
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 Fe(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 Ke(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,117 +169,122 @@ const Re = ye(
|
|
|
169
169
|
maxRows: d = 8,
|
|
170
170
|
onSubmit: u,
|
|
171
171
|
onAttach: b,
|
|
172
|
-
accept:
|
|
172
|
+
accept: Y,
|
|
173
173
|
disabled: x,
|
|
174
|
-
submitDisabled:
|
|
175
|
-
toolbar:
|
|
176
|
-
label:
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
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({
|
|
189
194
|
value: a === void 0 ? void 0 : String(a),
|
|
190
195
|
defaultValue: String(l ?? "")
|
|
191
|
-
}), n =
|
|
192
|
-
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;
|
|
193
198
|
if (!e) return;
|
|
194
|
-
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;
|
|
195
200
|
e.style.height = "auto";
|
|
196
|
-
const
|
|
197
|
-
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";
|
|
198
203
|
}, [i, d]);
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
}, [
|
|
202
|
-
const
|
|
204
|
+
Te(() => {
|
|
205
|
+
B();
|
|
206
|
+
}, [B, n]);
|
|
207
|
+
const oe = (e) => {
|
|
203
208
|
let s = e.target.value;
|
|
204
|
-
|
|
205
|
-
},
|
|
206
|
-
p.current = !0,
|
|
207
|
-
},
|
|
208
|
-
p.current = !1,
|
|
209
|
-
},
|
|
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 = () => {
|
|
210
215
|
var s;
|
|
211
|
-
!n.trim() || x ||
|
|
212
|
-
},
|
|
213
|
-
|
|
214
|
-
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(
|
|
215
220
|
() => ({
|
|
216
221
|
getValue: () => n,
|
|
217
222
|
isEmpty: () => !n.trim(),
|
|
218
223
|
setValue: (e) => {
|
|
219
|
-
|
|
224
|
+
f(e);
|
|
220
225
|
},
|
|
221
226
|
clear: () => {
|
|
222
|
-
|
|
227
|
+
f("");
|
|
223
228
|
},
|
|
224
229
|
submit: () => {
|
|
225
|
-
|
|
230
|
+
E();
|
|
226
231
|
},
|
|
227
232
|
focus: () => {
|
|
228
233
|
var e;
|
|
229
|
-
(e =
|
|
234
|
+
(e = w.current) == null || e.focus();
|
|
230
235
|
}
|
|
231
236
|
}),
|
|
232
237
|
// `submit` is a local closure that always sees the latest currentValue
|
|
233
238
|
// via React's render cycle — depend on currentValue so the handle
|
|
234
239
|
// picks up new values across renders.
|
|
235
240
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
236
|
-
[n,
|
|
241
|
+
[n, f]
|
|
237
242
|
);
|
|
238
|
-
|
|
239
|
-
const
|
|
240
|
-
if (
|
|
241
|
-
const s = e.metaKey || e.ctrlKey, k = y && !e.shiftKey;
|
|
242
|
-
(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());
|
|
243
248
|
}
|
|
244
|
-
},
|
|
249
|
+
}, pe = () => {
|
|
245
250
|
var e;
|
|
246
|
-
(e =
|
|
247
|
-
},
|
|
251
|
+
(e = S.current) == null || e.click();
|
|
252
|
+
}, fe = (e) => {
|
|
248
253
|
e.target.files && e.target.files.length > 0 && (b == null || b(e.target.files)), e.target.value = "";
|
|
249
|
-
}, 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");
|
|
250
255
|
return /* @__PURE__ */ v(
|
|
251
256
|
"div",
|
|
252
257
|
{
|
|
253
|
-
ref:
|
|
258
|
+
ref: P,
|
|
254
259
|
"data-component": "chat-input",
|
|
255
|
-
"data-component-id":
|
|
256
|
-
className:
|
|
260
|
+
"data-component-id": H,
|
|
261
|
+
className: Pe({ size: t, className: Z }),
|
|
257
262
|
children: [
|
|
258
263
|
/* @__PURE__ */ o(
|
|
259
264
|
"label",
|
|
260
265
|
{
|
|
261
|
-
id:
|
|
266
|
+
id: _,
|
|
262
267
|
htmlFor: g,
|
|
263
|
-
className:
|
|
264
|
-
children:
|
|
268
|
+
className: F && !L ? "type-label ds:ps-[var(--spacing-sm)] ds:pt-[var(--spacing-sm)]" : "ds:sr-only",
|
|
269
|
+
children: he
|
|
265
270
|
}
|
|
266
271
|
),
|
|
267
272
|
/* @__PURE__ */ o(
|
|
268
273
|
"textarea",
|
|
269
274
|
{
|
|
270
|
-
ref:
|
|
275
|
+
ref: se,
|
|
271
276
|
id: g,
|
|
272
277
|
value: n,
|
|
273
278
|
disabled: x,
|
|
274
279
|
rows: i,
|
|
275
|
-
placeholder:
|
|
276
|
-
"aria-labelledby":
|
|
277
|
-
"aria-describedby": [
|
|
280
|
+
placeholder: me,
|
|
281
|
+
"aria-labelledby": _,
|
|
282
|
+
"aria-describedby": [$, I ? W : void 0].filter(Boolean).join(" ") || void 0,
|
|
278
283
|
"aria-invalid": h || void 0,
|
|
279
|
-
onChange:
|
|
280
|
-
onKeyDown:
|
|
281
|
-
onCompositionStart:
|
|
282
|
-
onCompositionEnd:
|
|
284
|
+
onChange: oe,
|
|
285
|
+
onKeyDown: ue,
|
|
286
|
+
onCompositionStart: ie,
|
|
287
|
+
onCompositionEnd: ce,
|
|
283
288
|
className: [
|
|
284
289
|
"ds:w-full ds:resize-none ds:bg-transparent",
|
|
285
290
|
"ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)] ds:pt-[var(--spacing-sm)] ds:pb-[var(--spacing-xs)]",
|
|
@@ -289,42 +294,42 @@ const Re = ye(
|
|
|
289
294
|
// The box draws the focus ring (see rootVariants).
|
|
290
295
|
"ds:outline-none"
|
|
291
296
|
].join(" "),
|
|
292
|
-
...
|
|
297
|
+
...D
|
|
293
298
|
}
|
|
294
299
|
),
|
|
295
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: [
|
|
296
|
-
b ? /* @__PURE__ */ v(
|
|
301
|
+
b ? /* @__PURE__ */ v(we, { children: [
|
|
297
302
|
/* @__PURE__ */ o(
|
|
298
303
|
"input",
|
|
299
304
|
{
|
|
300
|
-
ref:
|
|
305
|
+
ref: S,
|
|
301
306
|
type: "file",
|
|
302
307
|
className: "ds:sr-only",
|
|
303
308
|
multiple: !0,
|
|
304
|
-
accept:
|
|
305
|
-
onChange:
|
|
309
|
+
accept: Y,
|
|
310
|
+
onChange: fe,
|
|
306
311
|
"aria-label": c("chat.input.attach"),
|
|
307
312
|
tabIndex: -1
|
|
308
313
|
}
|
|
309
314
|
),
|
|
310
315
|
/* @__PURE__ */ o(
|
|
311
|
-
|
|
316
|
+
U,
|
|
312
317
|
{
|
|
313
|
-
icon: /* @__PURE__ */ o(
|
|
318
|
+
icon: /* @__PURE__ */ o(Se, {}),
|
|
314
319
|
"aria-label": c("chat.input.attach"),
|
|
315
320
|
intent: "ghost",
|
|
316
321
|
size: "sm",
|
|
317
|
-
onClick:
|
|
322
|
+
onClick: pe,
|
|
318
323
|
disabled: x
|
|
319
324
|
}
|
|
320
325
|
)
|
|
321
326
|
] }) : null,
|
|
322
|
-
|
|
327
|
+
J,
|
|
323
328
|
/* @__PURE__ */ v("div", { className: "ds:ms-auto ds:inline-flex ds:items-center ds:gap-[var(--spacing-sm)]", children: [
|
|
324
|
-
|
|
329
|
+
ne ? /* @__PURE__ */ v(
|
|
325
330
|
"span",
|
|
326
331
|
{
|
|
327
|
-
id:
|
|
332
|
+
id: $,
|
|
328
333
|
"aria-live": "polite",
|
|
329
334
|
className: [
|
|
330
335
|
"ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]",
|
|
@@ -335,23 +340,23 @@ const Re = ye(
|
|
|
335
340
|
h ? (
|
|
336
341
|
// Icon pairs with --destructive colour so the at-limit
|
|
337
342
|
// state is not conveyed by hue alone (WCAG 1.4.1).
|
|
338
|
-
/* @__PURE__ */ o(
|
|
343
|
+
/* @__PURE__ */ o(Fe, { "aria-hidden": "true", className: "ds:size-3.5" })
|
|
339
344
|
) : null,
|
|
340
|
-
c("chat.input.remaining", { count:
|
|
345
|
+
c("chat.input.remaining", { count: ae })
|
|
341
346
|
]
|
|
342
347
|
}
|
|
343
348
|
) : null,
|
|
344
|
-
/* @__PURE__ */ o("span", { id:
|
|
349
|
+
I ? /* @__PURE__ */ o("span", { id: W, className: "ds:sr-only", children: c("chat.input.sendHint") }) : null,
|
|
345
350
|
/* @__PURE__ */ o(
|
|
346
|
-
|
|
351
|
+
U,
|
|
347
352
|
{
|
|
348
|
-
icon: /* @__PURE__ */ o(
|
|
349
|
-
"aria-label": c("chat.send"),
|
|
353
|
+
icon: Q ?? /* @__PURE__ */ o(Ke, {}),
|
|
354
|
+
"aria-label": O ?? c("chat.send"),
|
|
350
355
|
intent: "primary",
|
|
351
356
|
size: "sm",
|
|
352
|
-
disabled: x ||
|
|
353
|
-
onClick:
|
|
354
|
-
"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
|
|
355
360
|
}
|
|
356
361
|
)
|
|
357
362
|
] })
|
|
@@ -361,10 +366,10 @@ const Re = ye(
|
|
|
361
366
|
);
|
|
362
367
|
}
|
|
363
368
|
);
|
|
364
|
-
|
|
369
|
+
We.displayName = "ChatInput";
|
|
365
370
|
export {
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
371
|
+
We as C,
|
|
372
|
+
Se as P,
|
|
373
|
+
Be as c
|
|
369
374
|
};
|
|
370
|
-
//# sourceMappingURL=chat-input-
|
|
375
|
+
//# sourceMappingURL=chat-input-BmvnuZqj.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
1
|
+
import { jsxs as i, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as j, useMemo as z, Fragment as l } from "react";
|
|
3
3
|
import { c as h } from "./index-D2ZczOXr.js";
|
|
4
4
|
import { useTranslation as B } from "react-i18next";
|
|
5
5
|
import { B as F } from "./button-DohK_Ak_.js";
|
|
@@ -38,8 +38,13 @@ const _ = h(
|
|
|
38
38
|
{
|
|
39
39
|
variants: {
|
|
40
40
|
role: {
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
// Both bubbles rest on the card elevation (`--shadow-card`). The
|
|
42
|
+
// received one is a card surface with the `--card-border` hairline,
|
|
43
|
+
// so it still reads where shadows are off (accessible themes, forced
|
|
44
|
+
// colours). The sent one stays on `--primary`; its edge is the same
|
|
45
|
+
// colour as its fill, so it adds no visible outline.
|
|
46
|
+
user: "ds:bg-[color:var(--primary)] ds:text-[color:var(--primary-foreground)] ds:rounded-[var(--radius-md)] ds:rounded-ee-[var(--radius-sm)] ds:shadow-[var(--shadow-card)] ds:forced-colors:border ds:forced-colors:border-[CanvasText]",
|
|
47
|
+
assistant: "ds:bg-[var(--card)] ds:text-[color:var(--card-foreground)] ds:border ds:border-[color:var(--card-border)] ds:shadow-[var(--shadow-card)] ds:rounded-[var(--radius-md)] ds:rounded-es-[var(--radius-sm)]",
|
|
43
48
|
system: "ds:bg-transparent ds:text-[color:var(--muted-foreground)] type-body-sm ds:italic"
|
|
44
49
|
}
|
|
45
50
|
},
|
|
@@ -84,38 +89,38 @@ function q(n) {
|
|
|
84
89
|
function G(n) {
|
|
85
90
|
return M(n).map((e, r) => e.type === "code" ? /* @__PURE__ */ a(S, { code: e.value, language: e.lang }, r) : /* @__PURE__ */ a(l, { children: q(e.value) }, r));
|
|
86
91
|
}
|
|
87
|
-
const J =
|
|
92
|
+
const J = j(
|
|
88
93
|
({
|
|
89
94
|
role: n,
|
|
90
95
|
content: e,
|
|
91
96
|
avatar: r,
|
|
92
97
|
timestamp: t,
|
|
93
98
|
status: s,
|
|
94
|
-
renderMarkdown:
|
|
95
|
-
onRetry:
|
|
96
|
-
actions:
|
|
97
|
-
body:
|
|
99
|
+
renderMarkdown: b = !1,
|
|
100
|
+
onRetry: c,
|
|
101
|
+
actions: m,
|
|
102
|
+
body: x,
|
|
98
103
|
className: y,
|
|
99
|
-
...
|
|
100
|
-
},
|
|
101
|
-
const { t:
|
|
104
|
+
...w
|
|
105
|
+
}, N) => {
|
|
106
|
+
const { t: d, i18n: u } = B("ui"), o = z(() => {
|
|
102
107
|
if (!t) return null;
|
|
103
|
-
const
|
|
104
|
-
return Number.isNaN(
|
|
108
|
+
const g = t instanceof Date ? t : new Date(t);
|
|
109
|
+
return Number.isNaN(g.getTime()) ? null : new Intl.DateTimeFormat(u.language, {
|
|
105
110
|
hour: "2-digit",
|
|
106
111
|
minute: "2-digit"
|
|
107
|
-
}).format(
|
|
108
|
-
}, [t, u.language]), f =
|
|
112
|
+
}).format(g);
|
|
113
|
+
}, [t, u.language]), f = d(`chat.message.role.${n}`), C = o ? d("chat.message.label", { role: f, time: o }) : d("chat.message.labelNoTime", { role: f }), T = x ?? (b ? G(e) : e), p = !s || s === "edited" ? null : s === "sending" ? /* @__PURE__ */ a(E, { "aria-hidden": "true", className: "ds:size-3.5" }) : s === "sent" ? /* @__PURE__ */ a(L, { "aria-hidden": "true", className: "ds:size-3.5" }) : /* @__PURE__ */ a(
|
|
109
114
|
R,
|
|
110
115
|
{
|
|
111
116
|
"aria-hidden": "true",
|
|
112
117
|
className: "ds:size-3.5 ds:text-[color:var(--destructive)]"
|
|
113
118
|
}
|
|
114
|
-
),
|
|
115
|
-
return /* @__PURE__ */
|
|
119
|
+
), v = s ? d(`chat.message.status.${s}`) : null;
|
|
120
|
+
return /* @__PURE__ */ i(
|
|
116
121
|
"article",
|
|
117
122
|
{
|
|
118
|
-
ref:
|
|
123
|
+
ref: N,
|
|
119
124
|
"aria-label": C,
|
|
120
125
|
"data-component": "chat-message",
|
|
121
126
|
"data-role": n,
|
|
@@ -128,7 +133,7 @@ const J = T(
|
|
|
128
133
|
"ds:motion-safe:animate-in ds:motion-safe:fade-in-0 ds:motion-safe:slide-in-from-bottom-2",
|
|
129
134
|
"ds:duration-[var(--animation-duration)] ds:ease-[var(--ease-out)]"
|
|
130
135
|
].join(" "),
|
|
131
|
-
...
|
|
136
|
+
...w,
|
|
132
137
|
children: [
|
|
133
138
|
n !== "system" && r ? r.slot ? (
|
|
134
139
|
// Consumer-supplied avatar node (e.g. Alia's Astroid tile).
|
|
@@ -146,7 +151,7 @@ const J = T(
|
|
|
146
151
|
}
|
|
147
152
|
)
|
|
148
153
|
) : null,
|
|
149
|
-
/* @__PURE__ */
|
|
154
|
+
/* @__PURE__ */ i(
|
|
150
155
|
"div",
|
|
151
156
|
{
|
|
152
157
|
className: [
|
|
@@ -170,10 +175,10 @@ const J = T(
|
|
|
170
175
|
// bubble wider than its parent in narrow docks like Alia.
|
|
171
176
|
"ds:[overflow-wrap:anywhere]"
|
|
172
177
|
].join(" "),
|
|
173
|
-
children:
|
|
178
|
+
children: T
|
|
174
179
|
}
|
|
175
180
|
),
|
|
176
|
-
(o ||
|
|
181
|
+
(o || v) && n !== "system" ? /* @__PURE__ */ i(
|
|
177
182
|
"div",
|
|
178
183
|
{
|
|
179
184
|
className: [
|
|
@@ -194,7 +199,7 @@ const J = T(
|
|
|
194
199
|
// `key={status}` re-mounts the span on every status change so
|
|
195
200
|
// `animate-in` re-runs — gives the sending → sent → error
|
|
196
201
|
// swap a subtle cross-fade instead of an abrupt pop.
|
|
197
|
-
/* @__PURE__ */
|
|
202
|
+
/* @__PURE__ */ i(
|
|
198
203
|
"span",
|
|
199
204
|
{
|
|
200
205
|
className: [
|
|
@@ -204,26 +209,26 @@ const J = T(
|
|
|
204
209
|
].join(" "),
|
|
205
210
|
children: [
|
|
206
211
|
p,
|
|
207
|
-
/* @__PURE__ */ a("span", { className: "ds:sr-only", children:
|
|
212
|
+
/* @__PURE__ */ a("span", { className: "ds:sr-only", children: v })
|
|
208
213
|
]
|
|
209
214
|
},
|
|
210
215
|
s
|
|
211
216
|
)
|
|
212
217
|
) : null,
|
|
213
|
-
s === "error" &&
|
|
218
|
+
s === "error" && c ? /* @__PURE__ */ a(
|
|
214
219
|
F,
|
|
215
220
|
{
|
|
216
221
|
intent: "ghost",
|
|
217
222
|
size: "sm",
|
|
218
|
-
onClick:
|
|
223
|
+
onClick: c,
|
|
219
224
|
startIcon: /* @__PURE__ */ a(D, {}),
|
|
220
|
-
children:
|
|
225
|
+
children: d("chat.message.retry")
|
|
221
226
|
}
|
|
222
227
|
) : null
|
|
223
228
|
]
|
|
224
229
|
}
|
|
225
230
|
) : null,
|
|
226
|
-
|
|
231
|
+
m ? /* @__PURE__ */ a("div", { className: "ds:mt-[var(--spacing-xs)] ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]", children: m }) : null
|
|
227
232
|
]
|
|
228
233
|
}
|
|
229
234
|
)
|
|
@@ -236,4 +241,4 @@ J.displayName = "ChatMessage";
|
|
|
236
241
|
export {
|
|
237
242
|
J as C
|
|
238
243
|
};
|
|
239
|
-
//# sourceMappingURL=chat-message-
|
|
244
|
+
//# sourceMappingURL=chat-message-B4TMeZ2m.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { c } from "./createLucideIcon-DhHxpK9K.js";
|
|
2
|
+
/**
|
|
3
|
+
* @license lucide-react v1.22.0 - ISC
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the ISC license.
|
|
6
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/
|
|
8
|
+
const e = [
|
|
9
|
+
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
10
|
+
["path", { d: "m15 9-6 6", key: "1uzhvr" }],
|
|
11
|
+
["path", { d: "m9 9 6 6", key: "z0biqf" }]
|
|
12
|
+
], o = c("circle-x", e);
|
|
13
|
+
export {
|
|
14
|
+
o as C
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=circle-x-W8Enq3i4.js.map
|