@alfadocs/ui-kit 0.1.9 → 0.2.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/README.md +30 -0
- package/dist/_chunks/accordion-DOmxGEWU.js +228 -0
- package/dist/_chunks/{agenda-card-DwLIxgi7.js → agenda-card-CalZqycc.js} +12 -3
- package/dist/_chunks/{agenda-tray-DUvengGQ.js → agenda-tray-3ffFDQZC.js} +54 -51
- package/dist/_chunks/{ai-prompt-input.agent-0NHYLTWD.js → ai-prompt-input-BBiDlEIS.js} +231 -231
- package/dist/_chunks/{alert-BlOUMkXj.js → alert-B1sj8Ss0.js} +24 -14
- package/dist/_chunks/{apexcharts-theme-BkSShpEy.js → apexcharts-theme-BJigns_V.js} +7 -2
- package/dist/_chunks/{app-frame-6d7Lu4ea.js → app-frame-CDJOgPXe.js} +7 -16
- package/dist/_chunks/{audio-recorder.agent--VKeykUp.js → audio-recorder-B4U1LuiQ.js} +161 -162
- package/dist/_chunks/{audio-visualiser-CeMPCZkd.js → audio-visualiser-ByDEFLNm.js} +25 -19
- package/dist/_chunks/autocomplete-D4oUZbsP.js +466 -0
- package/dist/_chunks/{badge-mrstWxve.js → badge-DKFbntoa.js} +16 -13
- package/dist/_chunks/{balance-cell-renderer-5CA7zpAi.js → balance-cell-renderer-B8zgIM-m.js} +63 -44
- package/dist/_chunks/{breadcrumb.agent-GM2hAKFX.js → breadcrumb-D1snXjPb.js} +165 -157
- package/dist/_chunks/{button-7mLWcMp_.js → button-DD_0Xdmr.js} +12 -2
- package/dist/_chunks/{calendar-nGEgelJs.js → calendar-zy0tUUVG.js} +13 -18
- package/dist/_chunks/{card-BEy58ZKp.js → card-CWzuTLYE.js} +40 -34
- package/dist/_chunks/{chart.agent-_pRYS17d.js → chart-BLvFl169.js} +147 -131
- package/dist/_chunks/chat-container-ClzsWXp2.js +220 -0
- package/dist/_chunks/chat-input-DOlsB1fm.js +333 -0
- package/dist/_chunks/{chat-message-ByouZpPP.js → chat-message-DoAhgUTj.js} +23 -13
- package/dist/_chunks/{collapsible.agent-DkS1jVyn.js → collapsible-CuxUBoHJ.js} +97 -99
- package/dist/_chunks/{color-picker-94qcBZqZ.js → color-picker-CTIcHlDF.js} +111 -45
- package/dist/_chunks/combobox-DCNXqbC7.js +460 -0
- package/dist/_chunks/command-palette-C_vgSgrI.js +441 -0
- package/dist/_chunks/{date-picker-BqPTn7bO.js → date-picker-B1PO1ZQP.js} +190 -181
- package/dist/_chunks/{date-range-picker-B2hGsffw.js → date-range-picker-mix2nEVC.js} +21 -8
- package/dist/_chunks/{date-time-picker-Bzt0S8yO.js → date-time-picker-Dnong_BY.js} +30 -15
- package/dist/_chunks/{description-list-DvJbp6Yg.js → description-list-BYA77Yud.js} +26 -23
- package/dist/_chunks/dialog-BPD7wlGE.js +211 -0
- package/dist/_chunks/dropdown-menu-CpiF6CPz.js +300 -0
- package/dist/_chunks/{empty-state-DQPtRp2b.js → empty-state-3CLJIXSj.js} +132 -101
- package/dist/_chunks/file-upload-C947ACDK.js +829 -0
- package/dist/_chunks/{floating-action-button-Cnw-f6AG.js → floating-action-button-C8OYj8mE.js} +9 -2
- package/dist/_chunks/{form-field-BfsPLTSc.js → form-field-Bmkeh7WY.js} +12 -11
- package/dist/_chunks/{form-field-context-94LwgYTQ.js → form-field-context-B3APVHKx.js} +4 -2
- package/dist/_chunks/{freemium-paywall.agent-_nQqLyRF.js → freemium-paywall-CnvceDav.js} +124 -117
- package/dist/_chunks/{header-BGn1mRp8.js → header-D0ULgQl3.js} +69 -68
- package/dist/_chunks/{icon-button-Wnnde5lc.js → icon-button-C4CGcYuz.js} +11 -3
- package/dist/_chunks/{kbd-8baVw3KU.js → kbd-Cglkd7CY.js} +6 -2
- package/dist/_chunks/{key-value-pair-JRFS9Xrh.js → key-value-pair-CgWvAIGb.js} +2 -2
- package/dist/_chunks/{leo-sidebar-BwINPdix.js → leo-sidebar-CfEY-xi2.js} +16 -20
- package/dist/_chunks/{link-QheANk74.js → link-8QmFjIz2.js} +2 -5
- package/dist/_chunks/list-qP6p0NTw.js +434 -0
- package/dist/_chunks/{logo-BpFoCL-s.js → logo-_Z-jLq80.js} +155 -26
- package/dist/_chunks/{matrix-rain-BEkvux64.js → matrix-rain-CRPMXcVx.js} +8 -2
- package/dist/_chunks/{message-card-qhoGv947.js → message-card-ChCX9Iv6.js} +63 -60
- package/dist/_chunks/{message-tray-xHUCra-Y.js → message-tray-n8q9ITXI.js} +71 -76
- package/dist/_chunks/{multi-select.agent-Do6CeQUT.js → multi-select-wqqrgjUQ.js} +326 -291
- package/dist/_chunks/{navigation-menu.agent-D69ND6Qq.js → navigation-menu-ClbHeawy.js} +136 -123
- package/dist/_chunks/{notification-card-CsVEYJE-.js → notification-card-hBlPN1-c.js} +3 -3
- package/dist/_chunks/{notification-tray-DTXMq42J.js → notification-tray-C5cnXbl9.js} +70 -66
- package/dist/_chunks/{number-input-fvGmnRy9.js → number-input-Q7wkHnvQ.js} +7 -3
- package/dist/_chunks/{otp-input-EglXOUue.js → otp-input-C9gUByF0.js} +6 -3
- package/dist/_chunks/{pagination.agent-BkZQl45y.js → pagination-3AC4zTsi.js} +234 -194
- package/dist/_chunks/{password-input-D6kuYXmr.js → password-input-C4LmjIH1.js} +6 -9
- package/dist/_chunks/{patient-shell-BRmrrUUW.js → patient-shell-BlsEUKWB.js} +10 -15
- package/dist/_chunks/{payment-form-BWaXas8z.js → payment-form-C3vT_npe.js} +195 -186
- package/dist/_chunks/{pdf-viewer.agent-BaGEDheA.js → pdf-viewer-CZIfY08H.js} +270 -241
- package/dist/_chunks/{phone-input-C8Op4sEc.js → phone-input-CSHJOJ13.js} +4 -9
- package/dist/_chunks/popover-DekUKNBk.js +293 -0
- package/dist/_chunks/{privacy-lock.agent-C1i1-T58.js → privacy-lock-BKsI6ReN.js} +117 -109
- package/dist/_chunks/progress-C11tqhoI.js +298 -0
- package/dist/_chunks/{recaptcha-widget.agent-BGHpU5zD.js → recaptcha-widget-NyfOfLII.js} +95 -86
- package/dist/_chunks/resizable-mpXXyIsN.js +483 -0
- package/dist/_chunks/{rich-text-editor.agent-DnE125Tz.js → rich-text-editor-C7TCIlQO.js} +298 -209
- package/dist/_chunks/{scroll-area-DLr5w9Dd.js → scroll-area-DEDU-lp-.js} +67 -54
- package/dist/_chunks/{search-bar.agent-DxFAxctc.js → search-bar-BTDfgYtg.js} +291 -268
- package/dist/_chunks/{search-input-Xw3cdWXW.js → search-input-CdJIEjFo.js} +116 -107
- package/dist/_chunks/{select-DY1Cb2Tg.js → select-y6bXV1f1.js} +84 -83
- package/dist/_chunks/{separator-B4wXDLNC.js → separator-CYU_bGFn.js} +2 -5
- package/dist/_chunks/{sheet-B9kH9pcI.js → sheet-4tgMFwj0.js} +135 -60
- package/dist/_chunks/{sidebar-CHF5xr_P.js → sidebar-Bx3wCDyy.js} +546 -457
- package/dist/_chunks/{sign-in-with-alfadocs-button-BN_FPGHT.js → sign-in-with-alfadocs-button-B9UrqOqH.js} +9 -5
- package/dist/_chunks/{signature-capture.agent-BpeDwFht.js → signature-capture-DjMlFOzS.js} +210 -212
- package/dist/_chunks/{skeleton-dtqyF09N.js → skeleton-CZbwyJAA.js} +9 -3
- package/dist/_chunks/{slider-CcsQTZTA.js → slider-BT2bZWsy.js} +138 -134
- package/dist/_chunks/{slot-grid-D_l5VsHG.js → slot-grid-CgpYgBkW.js} +105 -95
- package/dist/_chunks/{sparkline.agent-56Sj7nOP.js → sparkline-_gy8aJDG.js} +107 -100
- package/dist/_chunks/{spinner-GCcv67vh.js → spinner-DLaYfLPl.js} +66 -14
- package/dist/_chunks/{stat-DUB6g90R.js → stat-B9PHSPbN.js} +45 -27
- package/dist/_chunks/{stepper-calendar.agent-9iT3ClIB.js → stepper-calendar-BLOJUE0-.js} +189 -187
- package/dist/_chunks/stepper-progress-jFY8BSf7.js +208 -0
- package/dist/_chunks/{suggestion-chip-DhFrkRPj.js → suggestion-chip-C4Jz0LrM.js} +50 -52
- package/dist/_chunks/{switch-BYEH8I53.js → switch-C0psfIQF.js} +2 -2
- package/dist/_chunks/{tabs.agent-h7NvsTR1.js → tabs-DaFA3Muo.js} +183 -155
- package/dist/_chunks/{tag-BqidXKo3.js → tag-DuLMjRbF.js} +90 -32
- package/dist/_chunks/{task-card-CY5ztNkU.js → task-card-Dw_ZJDL8.js} +5 -2
- package/dist/_chunks/{task-tray-CCoUdorl.js → task-tray-XlIW9ueh.js} +50 -49
- package/dist/_chunks/{text-area-C_M8wliK.js → text-area-CO9Dz0qX.js} +2 -2
- package/dist/_chunks/{text-input-BX39e6T6.js → text-input-DZwt9L8H.js} +65 -62
- package/dist/_chunks/{theme-root-DDb0TJjd.js → theme-root-CSKD5ZRm.js} +9 -2
- package/dist/_chunks/{theme-toggle.agent-btmXTWdW.js → theme-toggle-B9zzCnvl.js} +179 -177
- package/dist/_chunks/{time-picker-B8AMIrX7.js → time-picker-DvPUmHH-.js} +95 -93
- package/dist/_chunks/{timeline.agent-CRPza9wc.js → timeline-BvmnQadS.js} +96 -96
- package/dist/_chunks/{toast.agent-BjEGuq1Z.js → toast.agent-BwKXA0km.js} +46 -8
- package/dist/_chunks/{tooth-scheme.agent-CWrQBjJM.js → tooth-scheme-3mITSXiZ.js} +146 -162
- package/dist/_chunks/{transcript-panel.agent-BXEYP6w-.js → transcript-panel-Bx5ANMsv.js} +110 -101
- package/dist/_chunks/{typing-indicator-CbUBf-Dx.js → typing-indicator-BZ5jXZPn.js} +27 -5
- package/dist/_chunks/{use-theme-BMUhembX.js → use-theme-B1cwAXJR.js} +2 -5
- package/dist/_chunks/{visually-hidden-Bw7vBHLm.js → visually-hidden-BHxEUGyT.js} +11 -2
- package/dist/_chunks/{warning-stack-8Pa3pekh.js → warning-stack-VygGHSqC.js} +11 -13
- package/dist/_chunks/{workflow-map-D2A7rTEG.js → workflow-map-C-nlogPC.js} +430 -452
- package/dist/agent-catalog.json +580 -15
- package/dist/components/_shared/index.d.ts +2 -2
- package/dist/components/accordion/index.d.ts +1 -1
- package/dist/components/accordion/index.js +5 -6
- package/dist/components/agenda-card/index.js +1 -1
- package/dist/components/agenda-tray/agenda-tray.d.ts +1 -1
- package/dist/components/agenda-tray/index.js +1 -1
- package/dist/components/ai-prompt-input/ai-prompt-input.d.ts +1 -1
- package/dist/components/ai-prompt-input/index.js +1 -1
- package/dist/components/alert/index.d.ts +1 -1
- package/dist/components/alert/index.js +1 -1
- package/dist/components/app-frame/index.js +1 -1
- package/dist/components/audio-recorder/index.js +1 -1
- package/dist/components/audio-visualiser/index.js +1 -1
- package/dist/components/autocomplete/index.js +1 -1
- package/dist/components/badge/index.js +1 -1
- package/dist/components/breadcrumb/breadcrumb.d.ts +1 -1
- package/dist/components/breadcrumb/index.js +1 -1
- package/dist/components/button/index.js +2 -2
- package/dist/components/calendar/index.js +1 -1
- package/dist/components/card/index.js +1 -1
- package/dist/components/chart/index.d.ts +1 -1
- package/dist/components/chart/index.js +1 -1
- package/dist/components/chat-container/chat-container.d.ts +1 -1
- package/dist/components/chat-container/index.js +2 -3
- package/dist/components/chat-input/chat-input.d.ts +1 -1
- package/dist/components/chat-input/index.js +3 -4
- package/dist/components/chat-message/index.js +1 -1
- package/dist/components/checkbox-group/index.d.ts +1 -1
- package/dist/components/collapsible/collapsible.d.ts +1 -1
- package/dist/components/collapsible/index.d.ts +1 -1
- package/dist/components/collapsible/index.js +1 -1
- package/dist/components/color-picker/index.js +1 -1
- package/dist/components/combobox/index.d.ts +1 -1
- package/dist/components/combobox/index.js +1 -1
- package/dist/components/command-palette/command-palette.d.ts +46 -13
- package/dist/components/command-palette/index.js +1 -1
- package/dist/components/data-table/data-table.d.ts +3 -1
- package/dist/components/data-table/index.js +1 -1
- package/dist/components/data-table/toolbar.d.ts +6 -5
- package/dist/components/date-picker/date-picker.d.ts +1 -1
- package/dist/components/date-picker/index.d.ts +1 -1
- package/dist/components/date-picker/index.js +1 -1
- package/dist/components/date-range-picker/index.js +1 -1
- package/dist/components/date-time-picker/index.d.ts +1 -1
- package/dist/components/date-time-picker/index.js +1 -1
- package/dist/components/description-list/description-list.d.ts +1 -2
- package/dist/components/description-list/index.js +1 -1
- package/dist/components/dialog/dialog.d.ts +2 -2
- package/dist/components/dialog/index.js +1 -1
- package/dist/components/dropdown-menu/dropdown-menu.d.ts +11 -16
- package/dist/components/dropdown-menu/index.js +3 -4
- package/dist/components/empty-state/index.js +1 -1
- package/dist/components/file-upload/index.d.ts +1 -1
- package/dist/components/file-upload/index.js +1 -1
- package/dist/components/floating-action-button/index.js +1 -1
- package/dist/components/form-field/index.js +2 -2
- package/dist/components/freemium-paywall/freemium-paywall.d.ts +1 -1
- package/dist/components/freemium-paywall/index.js +1 -1
- package/dist/components/header/index.js +1 -1
- package/dist/components/icon-button/index.js +1 -1
- package/dist/components/kbd/index.js +1 -1
- package/dist/components/key-value-pair/index.js +1 -1
- package/dist/components/link/index.js +1 -1
- package/dist/components/list/index.js +1 -1
- package/dist/components/logo/index.js +1 -1
- package/dist/components/matrix-rain/index.js +1 -1
- package/dist/components/message-card/index.d.ts +1 -1
- package/dist/components/message-card/index.js +1 -1
- package/dist/components/message-tray/index.js +1 -1
- package/dist/components/message-tray/message-tray.d.ts +1 -1
- package/dist/components/multi-select/index.js +1 -1
- package/dist/components/navigation-menu/index.js +1 -1
- package/dist/components/navigation-menu/navigation-menu.d.ts +1 -1
- package/dist/components/notification-card/index.d.ts +1 -1
- package/dist/components/notification-card/index.js +1 -1
- package/dist/components/notification-tray/index.js +1 -1
- package/dist/components/notification-tray/notification-tray.d.ts +1 -1
- package/dist/components/number-input/index.js +1 -1
- package/dist/components/otp-input/index.js +1 -1
- package/dist/components/pagination/index.js +1 -1
- package/dist/components/pagination/pagination.d.ts +4 -6
- package/dist/components/password-input/index.js +1 -1
- package/dist/components/payment-form/index.js +7 -8
- package/dist/components/payment-form/payment-form.d.ts +1 -1
- package/dist/components/pdf-viewer/index.js +1 -1
- package/dist/components/phone-input/index.d.ts +1 -1
- package/dist/components/phone-input/index.js +1 -1
- package/dist/components/popover/index.js +3 -4
- package/dist/components/privacy-lock/index.js +1 -1
- package/dist/components/privacy-lock/privacy-lock.d.ts +1 -1
- package/dist/components/progress/index.js +3 -4
- package/dist/components/recaptcha-widget/index.js +1 -1
- package/dist/components/resizable/index.d.ts +1 -1
- package/dist/components/resizable/index.js +1 -1
- package/dist/components/rich-text-editor/index.js +1 -1
- package/dist/components/scroll-area/index.js +1 -1
- package/dist/components/search-bar/index.js +1 -1
- package/dist/components/search-bar/search-bar.d.ts +1 -1
- package/dist/components/search-input/index.js +1 -1
- package/dist/components/select/index.js +1 -1
- package/dist/components/select/select.d.ts +1 -1
- package/dist/components/separator/index.js +1 -1
- package/dist/components/sheet/index.js +3 -4
- package/dist/components/sheet/sheet.d.ts +2 -2
- package/dist/components/sidebar/index.js +7 -8
- package/dist/components/sidebar/sidebar.d.ts +0 -2
- package/dist/components/sign-in-with-alfadocs-button/index.js +1 -1
- package/dist/components/signature-capture/index.js +1 -1
- package/dist/components/skeleton/index.js +1 -1
- package/dist/components/slider/index.js +1 -1
- package/dist/components/slot-grid/index.js +1 -1
- package/dist/components/sparkline/index.js +1 -1
- package/dist/components/spinner/index.js +1 -1
- package/dist/components/stat/index.js +1 -1
- package/dist/components/stepper-calendar/index.js +1 -1
- package/dist/components/stepper-calendar/stepper-calendar.d.ts +1 -1
- package/dist/components/stepper-progress/index.d.ts +1 -1
- package/dist/components/stepper-progress/index.js +1 -2
- package/dist/components/stepper-progress/stepper-progress.d.ts +1 -1
- package/dist/components/suggestion-chip/index.js +1 -1
- package/dist/components/switch/index.js +1 -1
- package/dist/components/tabs/index.d.ts +1 -1
- package/dist/components/tabs/index.js +1 -1
- package/dist/components/tag/index.js +1 -1
- package/dist/components/task-card/index.js +1 -1
- package/dist/components/task-tray/index.js +1 -1
- package/dist/components/task-tray/task-tray.d.ts +1 -1
- package/dist/components/text-area/index.js +1 -1
- package/dist/components/text-input/index.js +1 -1
- package/dist/components/theme-root/index.js +1 -1
- package/dist/components/theme-toggle/index.js +1 -1
- package/dist/components/theme-toggle/theme-toggle.d.ts +1 -1
- package/dist/components/time-picker/index.js +1 -1
- package/dist/components/time-picker/time-picker.d.ts +1 -1
- package/dist/components/timeline/index.js +1 -1
- package/dist/components/timeline/timeline.d.ts +1 -1
- package/dist/components/toast/index.js +1 -1
- package/dist/components/tooth-scheme/index.js +1 -1
- package/dist/components/tooth-scheme/tooth-scheme.d.ts +1 -1
- package/dist/components/transcript-panel/index.js +1 -1
- package/dist/components/transcript-panel/transcript-panel.d.ts +1 -1
- package/dist/components/typing-indicator/index.js +1 -1
- package/dist/components/visually-hidden/index.js +1 -1
- package/dist/components/warning-stack/index.js +1 -1
- package/dist/components/workflow/index.js +1 -1
- package/dist/components/workflow/workflow-editor.d.ts +1 -1
- package/dist/hooks/index.js +1 -1
- package/dist/index.js +392 -402
- package/dist/patterns/leo-assistant/index.js +1 -1
- package/dist/patterns/patient-shell/index.js +1 -1
- package/dist/safe-html/index.js +20 -3
- package/dist/tokens.css +2 -2
- package/package.json +12 -2
- package/dist/_chunks/accordion-BEnrZmAn.js +0 -120
- package/dist/_chunks/accordion.agent-BTjeO1Sx.js +0 -52
- package/dist/_chunks/autocomplete.agent-Dh7KioS6.js +0 -432
- package/dist/_chunks/chat-container-Dl0Kfy5a.js +0 -175
- package/dist/_chunks/chat-container.agent-CM4WModE.js +0 -27
- package/dist/_chunks/chat-input-C_tMQv92.js +0 -252
- package/dist/_chunks/chat-input.agent-Bsz3ckGa.js +0 -69
- package/dist/_chunks/combobox.agent-CAvUkkIe.js +0 -410
- package/dist/_chunks/command-palette.agent-HatEt_EM.js +0 -391
- package/dist/_chunks/dialog.agent-Daf1TTko.js +0 -179
- package/dist/_chunks/dropdown-menu-C7AZipNz.js +0 -219
- package/dist/_chunks/dropdown-menu.agent-BcxIKOjK.js +0 -43
- package/dist/_chunks/file-upload.agent-DJaH2dHg.js +0 -681
- package/dist/_chunks/list.agent-D0iWt4VI.js +0 -420
- package/dist/_chunks/payment-form.agent-kuIfodCj.js +0 -31
- package/dist/_chunks/popover-kFN8s84V.js +0 -229
- package/dist/_chunks/popover.agent-K_d1cfbj.js +0 -39
- package/dist/_chunks/progress-wNsqkw8I.js +0 -253
- package/dist/_chunks/progress.agent-C68rDOXL.js +0 -27
- package/dist/_chunks/resizable.agent-CMwZzvsi.js +0 -456
- package/dist/_chunks/sheet.agent-QAyTOxgk.js +0 -46
- package/dist/_chunks/sidebar.agent-C9TM_ZDZ.js +0 -49
- package/dist/_chunks/stepper-progress-Bmen-YXB.js +0 -149
- package/dist/_chunks/stepper-progress.agent-q9InWca4.js +0 -61
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import { jsxs as m, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as B, useRef as u, useState as C, useCallback as H, useImperativeHandle as L, useMemo as E, useEffect as M, useLayoutEffect as O } from "react";
|
|
3
|
+
import { c as k } from "./index-D2ZczOXr.js";
|
|
4
|
+
import { useTranslation as S } from "react-i18next";
|
|
5
|
+
import { u as j } from "./registry-C9nwlNyL.js";
|
|
6
|
+
import { u as A } from "./index-CJE9uQmb.js";
|
|
7
|
+
import { F as P } from "./floating-action-button-C8OYj8mE.js";
|
|
8
|
+
import { u as $ } from "./use-prefers-reduced-motion-BMwIQRjB.js";
|
|
9
|
+
import { C as D } from "./chevron-down-BX_NP2Yh.js";
|
|
10
|
+
const F = {
|
|
11
|
+
id: "chat-container",
|
|
12
|
+
capabilities: ["navigate"],
|
|
13
|
+
state: {},
|
|
14
|
+
actions: {
|
|
15
|
+
scroll_to_bottom: {
|
|
16
|
+
safety: "read",
|
|
17
|
+
argsType: "{ smooth?: boolean }",
|
|
18
|
+
description: "Scroll the conversation viewport to the latest message.",
|
|
19
|
+
invoke: (o, r) => {
|
|
20
|
+
o.scrollToBottom(r);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
domHooks: {
|
|
25
|
+
root: { attr: "data-component", value: "chat-container" },
|
|
26
|
+
instanceId: {
|
|
27
|
+
attr: "data-component-id",
|
|
28
|
+
sourceProp: "id",
|
|
29
|
+
description: "Sourced from the id prop."
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}, K = k(
|
|
33
|
+
"ds:relative ds:flex ds:w-full ds:flex-col ds:overflow-hidden ds:bg-background",
|
|
34
|
+
{
|
|
35
|
+
variants: {
|
|
36
|
+
density: {
|
|
37
|
+
default: "ds:gap-[var(--spacing-md)]",
|
|
38
|
+
compact: "ds:gap-[var(--spacing-sm)]"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
defaultVariants: { density: "default" }
|
|
42
|
+
}
|
|
43
|
+
), U = k(
|
|
44
|
+
[
|
|
45
|
+
"ds:flex-1 ds:min-h-0 ds:overflow-y-auto ds:overflow-x-hidden",
|
|
46
|
+
"ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)]",
|
|
47
|
+
"ds:pt-[var(--spacing-md)] ds:pb-[var(--spacing-md)]",
|
|
48
|
+
"ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
|
|
49
|
+
"ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
|
|
50
|
+
"ds:scroll-smooth ds:motion-reduce:scroll-auto ds:[.theme-accessible_&]:scroll-auto",
|
|
51
|
+
// Edge fade — content near the scroll boundaries fades into the
|
|
52
|
+
// container surface instead of clipping abruptly against the header
|
|
53
|
+
// or composer, so avatars / bubbles don't look "cut in half" as they
|
|
54
|
+
// pass the viewport edge. Fade width matches the viewport padding so
|
|
55
|
+
// a row can slide fully behind the mask before disappearing.
|
|
56
|
+
// Disabled under HCM (mask strips content), reduced motion (less
|
|
57
|
+
// decoration when motion is off), and the accessible theme.
|
|
58
|
+
"ds:[mask-image:linear-gradient(to_bottom,transparent_0,black_var(--spacing-md),black_calc(100%-var(--spacing-md)),transparent_100%)]",
|
|
59
|
+
"ds:motion-reduce:[mask-image:none]",
|
|
60
|
+
"ds:[.theme-accessible_&]:[mask-image:none]",
|
|
61
|
+
"ds:forced-colors:[mask-image:none]"
|
|
62
|
+
].join(" ")
|
|
63
|
+
), X = 100, Y = 48, Z = B(
|
|
64
|
+
({
|
|
65
|
+
messages: o,
|
|
66
|
+
composer: r,
|
|
67
|
+
density: w = "default",
|
|
68
|
+
className: N,
|
|
69
|
+
id: p,
|
|
70
|
+
onAutoScrollChange: i,
|
|
71
|
+
showScrollToLatest: y = !1,
|
|
72
|
+
...I
|
|
73
|
+
}, T) => {
|
|
74
|
+
const { t: f } = S(), a = u(null), v = u(null), [l, _] = C(!0), g = $(), n = H(
|
|
75
|
+
(e) => {
|
|
76
|
+
const s = a.current;
|
|
77
|
+
if (!s) return;
|
|
78
|
+
const d = ((e == null ? void 0 : e.smooth) ?? !0) && !g;
|
|
79
|
+
s.scrollTo({
|
|
80
|
+
top: s.scrollHeight,
|
|
81
|
+
behavior: d ? "smooth" : "auto"
|
|
82
|
+
});
|
|
83
|
+
},
|
|
84
|
+
[g]
|
|
85
|
+
), h = u(null);
|
|
86
|
+
L(T, () => h.current, []);
|
|
87
|
+
const R = E(
|
|
88
|
+
() => ({
|
|
89
|
+
scrollToBottom: n,
|
|
90
|
+
getScrollViewport: () => a.current
|
|
91
|
+
}),
|
|
92
|
+
[n]
|
|
93
|
+
);
|
|
94
|
+
j(F, R, p), M(() => {
|
|
95
|
+
const e = a.current, s = v.current;
|
|
96
|
+
if (!e || !s) return;
|
|
97
|
+
const d = new IntersectionObserver(
|
|
98
|
+
(V) => {
|
|
99
|
+
const x = V[0];
|
|
100
|
+
_(x.isIntersecting), i == null || i(x.isIntersecting);
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
root: e,
|
|
104
|
+
// Fire when the sentinel is within BOTTOM_SLACK_PX of being visible.
|
|
105
|
+
rootMargin: `0px 0px ${Y}px 0px`,
|
|
106
|
+
threshold: 0
|
|
107
|
+
}
|
|
108
|
+
);
|
|
109
|
+
return d.observe(s), () => d.disconnect();
|
|
110
|
+
}, [i]);
|
|
111
|
+
const z = o.length;
|
|
112
|
+
O(() => {
|
|
113
|
+
l && n({ smooth: !1 });
|
|
114
|
+
}, [z, l, n]);
|
|
115
|
+
const b = o.length > X, c = A({
|
|
116
|
+
count: b ? o.length : 0,
|
|
117
|
+
getScrollElement: () => a.current,
|
|
118
|
+
estimateSize: () => 80,
|
|
119
|
+
overscan: 6,
|
|
120
|
+
getItemKey: (e) => {
|
|
121
|
+
var s;
|
|
122
|
+
return ((s = o[e]) == null ? void 0 : s.id) ?? e;
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
return /* @__PURE__ */ m(
|
|
126
|
+
"div",
|
|
127
|
+
{
|
|
128
|
+
ref: h,
|
|
129
|
+
className: K({ density: w, className: N }),
|
|
130
|
+
"data-component": "chat-container",
|
|
131
|
+
"data-component-id": p,
|
|
132
|
+
...I,
|
|
133
|
+
children: [
|
|
134
|
+
/* @__PURE__ */ m("div", { className: "ds:relative ds:flex-1 ds:min-h-0 ds:flex ds:flex-col", children: [
|
|
135
|
+
/* @__PURE__ */ m(
|
|
136
|
+
"div",
|
|
137
|
+
{
|
|
138
|
+
ref: a,
|
|
139
|
+
role: "log",
|
|
140
|
+
"aria-live": "polite",
|
|
141
|
+
"aria-relevant": "additions",
|
|
142
|
+
"aria-label": f("ui.chat.container"),
|
|
143
|
+
tabIndex: 0,
|
|
144
|
+
className: U(),
|
|
145
|
+
children: [
|
|
146
|
+
b ? /* @__PURE__ */ t(
|
|
147
|
+
"ol",
|
|
148
|
+
{
|
|
149
|
+
className: "ds:relative ds:list-none ds:ps-0 ds:m-0",
|
|
150
|
+
style: { blockSize: `${c.getTotalSize()}px` },
|
|
151
|
+
children: c.getVirtualItems().map((e) => {
|
|
152
|
+
const s = o[e.index];
|
|
153
|
+
return s ? /* @__PURE__ */ t(
|
|
154
|
+
"li",
|
|
155
|
+
{
|
|
156
|
+
"data-index": e.index,
|
|
157
|
+
ref: c.measureElement,
|
|
158
|
+
className: "ds:absolute ds:start-0 ds:end-0 ds:top-0 ds:w-full",
|
|
159
|
+
style: { transform: `translateY(${e.start}px)` },
|
|
160
|
+
children: /* @__PURE__ */ t("div", { className: "ds:pt-[var(--spacing-xs)] ds:pb-[var(--spacing-xs)]", children: s.node })
|
|
161
|
+
},
|
|
162
|
+
s.id
|
|
163
|
+
) : null;
|
|
164
|
+
})
|
|
165
|
+
}
|
|
166
|
+
) : /* @__PURE__ */ t("ol", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:list-none ds:ps-0 ds:m-0", children: o.map((e) => /* @__PURE__ */ t("li", { children: e.node }, e.id)) }),
|
|
167
|
+
/* @__PURE__ */ t(
|
|
168
|
+
"div",
|
|
169
|
+
{
|
|
170
|
+
ref: v,
|
|
171
|
+
"aria-hidden": "true",
|
|
172
|
+
className: "ds:h-1 ds:w-full"
|
|
173
|
+
}
|
|
174
|
+
)
|
|
175
|
+
]
|
|
176
|
+
}
|
|
177
|
+
),
|
|
178
|
+
y && !l ? /* @__PURE__ */ t(
|
|
179
|
+
"div",
|
|
180
|
+
{
|
|
181
|
+
className: [
|
|
182
|
+
"ds:pointer-events-none ds:absolute ds:inset-inline-end-0",
|
|
183
|
+
// `bottom` is measured from the bottom of the scroll
|
|
184
|
+
// column (i.e. the top edge of the composer slot). A
|
|
185
|
+
// small spacing-md gap keeps the FAB clear of the
|
|
186
|
+
// divider border above the composer.
|
|
187
|
+
"ds:bottom-[var(--spacing-md)] ds:pe-[var(--spacing-md)]",
|
|
188
|
+
// Enter animation — fade + scale in from 95%. The FAB only
|
|
189
|
+
// unmounts when the user returns to bottom, so an exit
|
|
190
|
+
// animation isn't justified (abrupt disappearance reads as
|
|
191
|
+
// "task complete" when they've scrolled back).
|
|
192
|
+
"ds:motion-safe:animate-in ds:motion-safe:fade-in-0 ds:motion-safe:zoom-in-95",
|
|
193
|
+
"ds:duration-[var(--animation-duration)] ds:ease-[var(--ease-out)]"
|
|
194
|
+
].join(" "),
|
|
195
|
+
children: /* @__PURE__ */ t("div", { className: "ds:pointer-events-auto", children: /* @__PURE__ */ t(
|
|
196
|
+
P,
|
|
197
|
+
{
|
|
198
|
+
icon: /* @__PURE__ */ t(D, {}),
|
|
199
|
+
"aria-label": f("ui.chat.scrollToLatest"),
|
|
200
|
+
size: "sm",
|
|
201
|
+
variant: "secondary",
|
|
202
|
+
position: "static",
|
|
203
|
+
onClick: () => n({ smooth: !0 })
|
|
204
|
+
}
|
|
205
|
+
) })
|
|
206
|
+
}
|
|
207
|
+
) : null
|
|
208
|
+
] }),
|
|
209
|
+
r ? /* @__PURE__ */ t("div", { className: "ds:shrink-0 ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)] ds:pt-[var(--spacing-sm)] ds:pb-[var(--spacing-sm)] ds:bg-background", children: r }) : null
|
|
210
|
+
]
|
|
211
|
+
}
|
|
212
|
+
);
|
|
213
|
+
}
|
|
214
|
+
);
|
|
215
|
+
Z.displayName = "ChatContainer";
|
|
216
|
+
export {
|
|
217
|
+
Z as C,
|
|
218
|
+
F as c
|
|
219
|
+
};
|
|
220
|
+
//# sourceMappingURL=chat-container-ClzsWXp2.js.map
|
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
import { jsxs as u, jsx as a, Fragment as ve } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as ye, useId as be, useRef as b, useCallback as W, useState as xe, useLayoutEffect as Ie, useImperativeHandle as ke, useMemo as Ce } from "react";
|
|
3
|
+
import { c as we } from "./index-D2ZczOXr.js";
|
|
4
|
+
import { useTranslation as Ne } from "react-i18next";
|
|
5
|
+
import { I as U } from "./icon-button-C4CGcYuz.js";
|
|
6
|
+
import { u as ze } from "./registry-C9nwlNyL.js";
|
|
7
|
+
import { c as He } from "./createLucideIcon-CrFbzy84.js";
|
|
8
|
+
import { C as Ve } from "./circle-alert-ChA9opNA.js";
|
|
9
|
+
import { S as Ee } from "./send-CySZIRPJ.js";
|
|
10
|
+
/**
|
|
11
|
+
* @license lucide-react v1.8.0 - ISC
|
|
12
|
+
*
|
|
13
|
+
* This source code is licensed under the ISC license.
|
|
14
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
15
|
+
*/
|
|
16
|
+
const Me = [
|
|
17
|
+
[
|
|
18
|
+
"path",
|
|
19
|
+
{
|
|
20
|
+
d: "m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",
|
|
21
|
+
key: "1miecu"
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
], Te = He("paperclip", Me), Fe = {
|
|
25
|
+
id: "chat-input",
|
|
26
|
+
capabilities: ["edit_inline", "submit"],
|
|
27
|
+
state: {
|
|
28
|
+
value: {
|
|
29
|
+
type: "string",
|
|
30
|
+
descriptionKey: "ui.agent.chatInput.state.value",
|
|
31
|
+
description: "Current text in the composer.",
|
|
32
|
+
read: (t) => t.getValue()
|
|
33
|
+
},
|
|
34
|
+
isEmpty: {
|
|
35
|
+
type: "boolean",
|
|
36
|
+
descriptionKey: "ui.agent.chatInput.state.isEmpty",
|
|
37
|
+
description: "True when the composer has no text.",
|
|
38
|
+
read: (t) => t.isEmpty()
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
actions: {
|
|
42
|
+
set_value: {
|
|
43
|
+
safety: "write",
|
|
44
|
+
argsType: "{ value: string }",
|
|
45
|
+
descriptionKey: "ui.agent.chatInput.actions.setValue",
|
|
46
|
+
description: "Replace the composer text.",
|
|
47
|
+
invoke: (t, o) => {
|
|
48
|
+
t.setValue(o.value);
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
clear: {
|
|
52
|
+
safety: "destructive",
|
|
53
|
+
descriptionKey: "ui.agent.chatInput.actions.clear",
|
|
54
|
+
description: "Clear the composer. Irreversible from the same UI.",
|
|
55
|
+
invoke: (t) => {
|
|
56
|
+
t.clear();
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
submit: {
|
|
60
|
+
safety: "write",
|
|
61
|
+
descriptionKey: "ui.agent.chatInput.actions.submit",
|
|
62
|
+
description: "Submit the current composer state via onSubmit.",
|
|
63
|
+
invoke: (t) => {
|
|
64
|
+
t.submit();
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
focus: {
|
|
68
|
+
safety: "read",
|
|
69
|
+
descriptionKey: "ui.agent.chatInput.actions.focus",
|
|
70
|
+
description: "Move keyboard focus into the textarea.",
|
|
71
|
+
invoke: (t) => {
|
|
72
|
+
t.focus();
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
domHooks: {
|
|
77
|
+
root: {
|
|
78
|
+
attr: "data-component",
|
|
79
|
+
value: "chat-input",
|
|
80
|
+
description: "Marks the ChatInput wrapper."
|
|
81
|
+
},
|
|
82
|
+
instanceId: {
|
|
83
|
+
attr: "data-component-id",
|
|
84
|
+
sourceProp: "id",
|
|
85
|
+
description: "Sourced from the id prop."
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}, Ke = we(
|
|
89
|
+
[
|
|
90
|
+
"ds:flex ds:flex-col ds:gap-[var(--spacing-xs)] ds:w-full",
|
|
91
|
+
// Soft drop-shadow + transparent border replaces a flat
|
|
92
|
+
// `border-border` (grey-800 since the WCAG 1.4.11 bump). Border kept
|
|
93
|
+
// at 1px so the focus-within color override + forced-colors
|
|
94
|
+
// fallback still paint a visible edge.
|
|
95
|
+
"ds:rounded-[var(--radius-md)] ds:shadow-[var(--shadow-sm)] ds:border ds:border-transparent",
|
|
96
|
+
"ds:bg-background ds:focus-within:border-[color:var(--primary)]",
|
|
97
|
+
"ds:transition-[border-color] ds:duration-[var(--animation-duration)]",
|
|
98
|
+
"ds:motion-reduce:transition-none",
|
|
99
|
+
"ds:forced-colors:border-[CanvasText]"
|
|
100
|
+
].join(" "),
|
|
101
|
+
{
|
|
102
|
+
variants: {
|
|
103
|
+
size: {
|
|
104
|
+
sm: "ds:text-[length:var(--font-size-sm)]",
|
|
105
|
+
md: "ds:text-[length:var(--font-size-base)]",
|
|
106
|
+
lg: "ds:text-[length:var(--font-size-lg)]"
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
defaultVariants: { size: "md" }
|
|
110
|
+
}
|
|
111
|
+
);
|
|
112
|
+
function Se(t, o) {
|
|
113
|
+
if (typeof Intl < "u" && typeof Intl.Segmenter == "function")
|
|
114
|
+
try {
|
|
115
|
+
const p = new Intl.Segmenter(o, { granularity: "grapheme" });
|
|
116
|
+
let s = 0;
|
|
117
|
+
for (const M of p.segment(t)) s += 1;
|
|
118
|
+
return s;
|
|
119
|
+
} catch {
|
|
120
|
+
}
|
|
121
|
+
return Array.from(t).length;
|
|
122
|
+
}
|
|
123
|
+
const je = ye(
|
|
124
|
+
({
|
|
125
|
+
size: t = "md",
|
|
126
|
+
value: o,
|
|
127
|
+
defaultValue: p,
|
|
128
|
+
maxLength: s,
|
|
129
|
+
submitOnEnter: M = !1,
|
|
130
|
+
minRows: x = 1,
|
|
131
|
+
maxRows: T = 8,
|
|
132
|
+
onSubmit: I,
|
|
133
|
+
onAttach: m,
|
|
134
|
+
accept: Y,
|
|
135
|
+
disabled: f,
|
|
136
|
+
toolbar: q,
|
|
137
|
+
label: F,
|
|
138
|
+
placeholder: A,
|
|
139
|
+
className: G,
|
|
140
|
+
onChange: k,
|
|
141
|
+
onKeyDown: C,
|
|
142
|
+
onCompositionStart: w,
|
|
143
|
+
onCompositionEnd: N,
|
|
144
|
+
id: z,
|
|
145
|
+
...J
|
|
146
|
+
}, L) => {
|
|
147
|
+
const { t: c, i18n: O } = Ne(), Q = be(), h = b(!1), K = b(null), H = b(null), X = W((e) => {
|
|
148
|
+
H.current = e;
|
|
149
|
+
}, []), n = o !== void 0, [Z, g] = xe(
|
|
150
|
+
String(p ?? "")
|
|
151
|
+
), r = n ? String(o) : Z, V = Se(r, O.language), v = typeof s == "number" && s > 0, D = v ? Math.max(0, s - V) : 0, ee = v && V > s * 0.9, l = v && V >= s, S = W(() => {
|
|
152
|
+
const e = H.current;
|
|
153
|
+
if (!e) return;
|
|
154
|
+
const i = window.getComputedStyle(e), y = parseFloat(i.lineHeight) || 24, ue = parseFloat(i.paddingTop) || 0, pe = parseFloat(i.paddingBottom) || 0, me = parseFloat(i.borderTopWidth) || 0, fe = parseFloat(i.borderBottomWidth) || 0, _ = ue + pe + me + fe, he = y * x + _, $ = y * T + _;
|
|
155
|
+
e.style.height = "auto";
|
|
156
|
+
const ge = Math.max(he, Math.min(e.scrollHeight, $));
|
|
157
|
+
e.style.height = `${ge}px`, e.style.overflowY = e.scrollHeight > $ ? "auto" : "hidden";
|
|
158
|
+
}, [x, T]);
|
|
159
|
+
Ie(() => {
|
|
160
|
+
S();
|
|
161
|
+
}, [S, r]);
|
|
162
|
+
const te = (e) => {
|
|
163
|
+
n || g(e.target.value), !h.current && (k == null || k(e));
|
|
164
|
+
}, se = (e) => {
|
|
165
|
+
h.current = !0, w == null || w(e);
|
|
166
|
+
}, re = (e) => {
|
|
167
|
+
h.current = !1, N == null || N(e);
|
|
168
|
+
}, ae = (e) => e.nativeEvent.isComposing || e.keyCode === 229 || h.current, E = () => {
|
|
169
|
+
!r.trim() || f || l || (I == null || I(r), n || g(""));
|
|
170
|
+
}, j = b(null);
|
|
171
|
+
ke(L, () => j.current, []);
|
|
172
|
+
const ne = Ce(
|
|
173
|
+
() => ({
|
|
174
|
+
getValue: () => r,
|
|
175
|
+
isEmpty: () => !r.trim(),
|
|
176
|
+
setValue: (e) => {
|
|
177
|
+
n || g(e);
|
|
178
|
+
},
|
|
179
|
+
clear: () => {
|
|
180
|
+
n || g("");
|
|
181
|
+
},
|
|
182
|
+
submit: () => {
|
|
183
|
+
E();
|
|
184
|
+
},
|
|
185
|
+
focus: () => {
|
|
186
|
+
var e;
|
|
187
|
+
(e = H.current) == null || e.focus();
|
|
188
|
+
}
|
|
189
|
+
}),
|
|
190
|
+
// `submit` is a local closure that always sees the latest currentValue
|
|
191
|
+
// via React's render cycle — depend on currentValue + isControlled so
|
|
192
|
+
// the handle picks up new values across renders.
|
|
193
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
194
|
+
[r, n]
|
|
195
|
+
);
|
|
196
|
+
ze(Fe, ne, z);
|
|
197
|
+
const ie = (e) => {
|
|
198
|
+
if (C == null || C(e), !e.defaultPrevented && !ae(e) && e.key === "Enter") {
|
|
199
|
+
const i = e.metaKey || e.ctrlKey, y = M && !e.shiftKey;
|
|
200
|
+
(i || y) && (e.preventDefault(), E());
|
|
201
|
+
}
|
|
202
|
+
}, oe = () => {
|
|
203
|
+
var e;
|
|
204
|
+
(e = K.current) == null || e.click();
|
|
205
|
+
}, ce = (e) => {
|
|
206
|
+
e.target.files && e.target.files.length > 0 && (m == null || m(e.target.files)), e.target.value = "";
|
|
207
|
+
}, d = z ?? Q, B = `${d}-label`, R = v ? `${d}-counter` : void 0, P = `${d}-hint`, le = A ?? c("chat.input.placeholder"), de = F ?? c("chat.prompt");
|
|
208
|
+
return /* @__PURE__ */ u(
|
|
209
|
+
"div",
|
|
210
|
+
{
|
|
211
|
+
ref: j,
|
|
212
|
+
"data-component": "chat-input",
|
|
213
|
+
"data-component-id": z,
|
|
214
|
+
className: Ke({ size: t, className: G }),
|
|
215
|
+
children: [
|
|
216
|
+
/* @__PURE__ */ a(
|
|
217
|
+
"label",
|
|
218
|
+
{
|
|
219
|
+
id: B,
|
|
220
|
+
htmlFor: d,
|
|
221
|
+
className: F ? "type-label ds:ps-[var(--spacing-sm)] ds:pt-[var(--spacing-sm)]" : "ds:sr-only",
|
|
222
|
+
children: de
|
|
223
|
+
}
|
|
224
|
+
),
|
|
225
|
+
/* @__PURE__ */ a(
|
|
226
|
+
"textarea",
|
|
227
|
+
{
|
|
228
|
+
ref: X,
|
|
229
|
+
id: d,
|
|
230
|
+
value: n ? r : void 0,
|
|
231
|
+
defaultValue: n ? void 0 : p,
|
|
232
|
+
disabled: f,
|
|
233
|
+
rows: x,
|
|
234
|
+
maxLength: s,
|
|
235
|
+
placeholder: le,
|
|
236
|
+
"aria-labelledby": B,
|
|
237
|
+
"aria-describedby": [R, P].filter(Boolean).join(" ") || void 0,
|
|
238
|
+
"aria-invalid": l || void 0,
|
|
239
|
+
onChange: te,
|
|
240
|
+
onKeyDown: ie,
|
|
241
|
+
onCompositionStart: se,
|
|
242
|
+
onCompositionEnd: re,
|
|
243
|
+
className: [
|
|
244
|
+
"ds:w-full ds:resize-none ds:bg-transparent",
|
|
245
|
+
"ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)] ds:pt-[var(--spacing-sm)] ds:pb-[var(--spacing-xs)]",
|
|
246
|
+
"ds:placeholder:text-[color:var(--muted-foreground)]",
|
|
247
|
+
"ds:leading-[var(--line-height-base)]",
|
|
248
|
+
"ds:disabled:opacity-50 ds:disabled:cursor-not-allowed",
|
|
249
|
+
// Tokenised focus ring on the textarea itself — the 1px border
|
|
250
|
+
// shift on the wrapper alone fails the 3px accessible-theme
|
|
251
|
+
// requirement. See a11y-critical-fixes.mdx.
|
|
252
|
+
"ds:outline-none",
|
|
253
|
+
"ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
|
|
254
|
+
"ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
|
|
255
|
+
"ds:rounded-[var(--radius-sm)]",
|
|
256
|
+
"ds:forced-colors:focus-visible:outline-[CanvasText]"
|
|
257
|
+
].join(" "),
|
|
258
|
+
...J
|
|
259
|
+
}
|
|
260
|
+
),
|
|
261
|
+
/* @__PURE__ */ u("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: [
|
|
262
|
+
m ? /* @__PURE__ */ u(ve, { children: [
|
|
263
|
+
/* @__PURE__ */ a(
|
|
264
|
+
"input",
|
|
265
|
+
{
|
|
266
|
+
ref: K,
|
|
267
|
+
type: "file",
|
|
268
|
+
className: "ds:sr-only",
|
|
269
|
+
multiple: !0,
|
|
270
|
+
accept: Y,
|
|
271
|
+
onChange: ce
|
|
272
|
+
}
|
|
273
|
+
),
|
|
274
|
+
/* @__PURE__ */ a(
|
|
275
|
+
U,
|
|
276
|
+
{
|
|
277
|
+
icon: /* @__PURE__ */ a(Te, {}),
|
|
278
|
+
"aria-label": c("chat.input.attach"),
|
|
279
|
+
intent: "ghost",
|
|
280
|
+
size: "sm",
|
|
281
|
+
onClick: oe,
|
|
282
|
+
disabled: f
|
|
283
|
+
}
|
|
284
|
+
)
|
|
285
|
+
] }) : null,
|
|
286
|
+
q,
|
|
287
|
+
/* @__PURE__ */ u("div", { className: "ds:ms-auto ds:inline-flex ds:items-center ds:gap-[var(--spacing-sm)]", children: [
|
|
288
|
+
ee ? /* @__PURE__ */ u(
|
|
289
|
+
"span",
|
|
290
|
+
{
|
|
291
|
+
id: R,
|
|
292
|
+
"aria-live": "polite",
|
|
293
|
+
className: [
|
|
294
|
+
"ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]",
|
|
295
|
+
"type-meta ds:tabular-nums",
|
|
296
|
+
l ? "ds:text-[color:var(--destructive)]" : "ds:text-[color:var(--muted-foreground)]"
|
|
297
|
+
].join(" "),
|
|
298
|
+
children: [
|
|
299
|
+
l ? (
|
|
300
|
+
// Icon pairs with --destructive colour so the at-limit
|
|
301
|
+
// state is not conveyed by hue alone (WCAG 1.4.1).
|
|
302
|
+
/* @__PURE__ */ a(Ve, { "aria-hidden": "true", className: "ds:size-3.5" })
|
|
303
|
+
) : null,
|
|
304
|
+
c("chat.input.remaining", { count: D })
|
|
305
|
+
]
|
|
306
|
+
}
|
|
307
|
+
) : null,
|
|
308
|
+
/* @__PURE__ */ a("span", { id: P, className: "ds:sr-only", children: c("chat.input.sendHint") }),
|
|
309
|
+
/* @__PURE__ */ a(
|
|
310
|
+
U,
|
|
311
|
+
{
|
|
312
|
+
icon: /* @__PURE__ */ a(Ee, {}),
|
|
313
|
+
"aria-label": c("chat.send"),
|
|
314
|
+
intent: "primary",
|
|
315
|
+
size: "sm",
|
|
316
|
+
disabled: f || !r.trim() || l,
|
|
317
|
+
onClick: E,
|
|
318
|
+
"aria-keyshortcuts": "Meta+Enter Control+Enter"
|
|
319
|
+
}
|
|
320
|
+
)
|
|
321
|
+
] })
|
|
322
|
+
] })
|
|
323
|
+
]
|
|
324
|
+
}
|
|
325
|
+
);
|
|
326
|
+
}
|
|
327
|
+
);
|
|
328
|
+
je.displayName = "ChatInput";
|
|
329
|
+
export {
|
|
330
|
+
je as C,
|
|
331
|
+
Fe as c
|
|
332
|
+
};
|
|
333
|
+
//# sourceMappingURL=chat-input-DOlsB1fm.js.map
|
|
@@ -2,7 +2,7 @@ import { jsxs as d, jsx as a } from "react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef as C, useMemo as j, Fragment as g } from "react";
|
|
3
3
|
import { c as h } from "./index-D2ZczOXr.js";
|
|
4
4
|
import { useTranslation as T } from "react-i18next";
|
|
5
|
-
import { B as z } from "./button-
|
|
5
|
+
import { B as z } from "./button-DD_0Xdmr.js";
|
|
6
6
|
import { A as M } from "./avatar-Dcr6XuDQ.js";
|
|
7
7
|
import { T as I } from "./timestamp-BV2lC-wV.js";
|
|
8
8
|
import { s as A } from "./safe-image-src-DstKgCo7.js";
|
|
@@ -19,16 +19,19 @@ import { C as V } from "./circle-alert-ChA9opNA.js";
|
|
|
19
19
|
const _ = [
|
|
20
20
|
["path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8", key: "1357e3" }],
|
|
21
21
|
["path", { d: "M3 3v5h5", key: "1xhq8a" }]
|
|
22
|
-
], B = F("rotate-ccw", _), D = h(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
22
|
+
], B = F("rotate-ccw", _), D = h(
|
|
23
|
+
"ds:flex ds:w-full ds:items-start ds:gap-[var(--spacing-sm)]",
|
|
24
|
+
{
|
|
25
|
+
variants: {
|
|
26
|
+
role: {
|
|
27
|
+
user: "ds:flex-row-reverse",
|
|
28
|
+
assistant: "ds:flex-row",
|
|
29
|
+
system: "ds:flex-col ds:items-center ds:text-center"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
defaultVariants: { role: "assistant" }
|
|
33
|
+
}
|
|
34
|
+
), E = h(
|
|
32
35
|
[
|
|
33
36
|
// Cap at 42rem on wide surfaces; on narrow docks (Leo sidebar ≈22rem)
|
|
34
37
|
// leave room for the avatar column (size-8 = 32px = --spacing-xl) +
|
|
@@ -135,7 +138,14 @@ const H = C(
|
|
|
135
138
|
// Allow-list the src: LLM-supplied values can carry
|
|
136
139
|
// `javascript:` / `data:text/html` / `data:image/svg+xml` and so
|
|
137
140
|
// are scrubbed here before reaching <Avatar>. Fallback to initials.
|
|
138
|
-
/* @__PURE__ */ a(
|
|
141
|
+
/* @__PURE__ */ a(
|
|
142
|
+
M,
|
|
143
|
+
{
|
|
144
|
+
name: r.name,
|
|
145
|
+
src: A(r.src),
|
|
146
|
+
size: "sm"
|
|
147
|
+
}
|
|
148
|
+
)
|
|
139
149
|
) : null,
|
|
140
150
|
/* @__PURE__ */ d(
|
|
141
151
|
"div",
|
|
@@ -226,4 +236,4 @@ H.displayName = "ChatMessage";
|
|
|
226
236
|
export {
|
|
227
237
|
H as C
|
|
228
238
|
};
|
|
229
|
-
//# sourceMappingURL=chat-message-
|
|
239
|
+
//# sourceMappingURL=chat-message-DoAhgUTj.js.map
|