@thewhatmatters/wmds 0.3.0 → 0.4.1
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/CHANGELOG.md +87 -0
- package/CONSUMING.md +9 -4
- package/dist/collapse.css +9 -1
- package/dist/colors.css +7 -0
- package/dist/components/atoms/Badge/Badge.d.ts +16 -4
- package/dist/components/atoms/Badge/Badge.d.ts.map +1 -1
- package/dist/components/atoms/Badge/Badge.js +54 -42
- package/dist/components/atoms/Badge/badgeStyles.d.ts +12 -2
- package/dist/components/atoms/Badge/badgeStyles.d.ts.map +1 -1
- package/dist/components/atoms/Badge/badgeStyles.js +24 -13
- package/dist/components/atoms/Button/Button.d.ts +11 -3
- package/dist/components/atoms/Button/Button.d.ts.map +1 -1
- package/dist/components/atoms/Button/Button.js +118 -98
- package/dist/components/atoms/Button/ButtonStatusButton.d.ts +3 -1
- package/dist/components/atoms/Button/ButtonStatusButton.d.ts.map +1 -1
- package/dist/components/atoms/Button/ButtonStatusButton.js +19 -18
- package/dist/components/atoms/Button/ButtonStatusContent.d.ts +7 -1
- package/dist/components/atoms/Button/ButtonStatusContent.d.ts.map +1 -1
- package/dist/components/atoms/Button/ButtonStatusContent.js +9 -6
- package/dist/components/atoms/Button/buttonStatusStyles.d.ts +5 -0
- package/dist/components/atoms/Button/buttonStatusStyles.d.ts.map +1 -1
- package/dist/components/atoms/Button/buttonStatusStyles.js +10 -10
- package/dist/components/atoms/Button/buttonStyles.d.ts +2 -0
- package/dist/components/atoms/Button/buttonStyles.d.ts.map +1 -1
- package/dist/components/atoms/Button/buttonStyles.js +12 -12
- package/dist/components/atoms/Checkbox/Checkbox.d.ts +7 -0
- package/dist/components/atoms/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/components/atoms/Checkbox/Checkbox.js +86 -69
- package/dist/components/atoms/Checkbox/checkboxStyles.d.ts +6 -0
- package/dist/components/atoms/Checkbox/checkboxStyles.d.ts.map +1 -1
- package/dist/components/atoms/Checkbox/checkboxStyles.js +11 -11
- package/dist/components/atoms/IconButton/IconButton.d.ts +5 -0
- package/dist/components/atoms/IconButton/IconButton.d.ts.map +1 -1
- package/dist/components/atoms/IconButton/IconButton.js +73 -68
- package/dist/components/atoms/IconButton/iconButtonStyles.d.ts +5 -0
- package/dist/components/atoms/IconButton/iconButtonStyles.d.ts.map +1 -1
- package/dist/components/atoms/IconButton/iconButtonStyles.js +4 -4
- package/dist/components/atoms/Kbd/useKbdChoiceKeys.d.ts +13 -4
- package/dist/components/atoms/Kbd/useKbdChoiceKeys.d.ts.map +1 -1
- package/dist/components/atoms/Kbd/useKbdChoiceKeys.js +32 -13
- package/dist/components/atoms/Prose/Prose.d.ts +23 -0
- package/dist/components/atoms/Prose/Prose.d.ts.map +1 -0
- package/dist/components/atoms/Prose/Prose.js +15 -0
- package/dist/components/atoms/Prose/proseStyles.d.ts +17 -0
- package/dist/components/atoms/Prose/proseStyles.d.ts.map +1 -0
- package/dist/components/atoms/Prose/proseStyles.js +16 -0
- package/dist/components/atoms/SectionCaption/SectionCaption.d.ts +26 -0
- package/dist/components/atoms/SectionCaption/SectionCaption.d.ts.map +1 -0
- package/dist/components/atoms/SectionCaption/SectionCaption.js +25 -0
- package/dist/components/atoms/SectionCaption/sectionCaptionStyles.d.ts +11 -0
- package/dist/components/atoms/SectionCaption/sectionCaptionStyles.d.ts.map +1 -0
- package/dist/components/atoms/SectionCaption/sectionCaptionStyles.js +12 -0
- package/dist/components/atoms/TextLink/TextLink.d.ts +10 -2
- package/dist/components/atoms/TextLink/TextLink.d.ts.map +1 -1
- package/dist/components/atoms/TextLink/TextLink.js +15 -15
- package/dist/components/atoms/TextLink/textLinkStyles.d.ts +13 -0
- package/dist/components/atoms/TextLink/textLinkStyles.d.ts.map +1 -1
- package/dist/components/atoms/TextLink/textLinkStyles.js +7 -3
- package/dist/components/molecules/Accordion/Accordion.d.ts +6 -1
- package/dist/components/molecules/Accordion/Accordion.d.ts.map +1 -1
- package/dist/components/molecules/Accordion/Accordion.js +57 -50
- package/dist/components/molecules/Accordion/accordionStyles.d.ts +9 -0
- package/dist/components/molecules/Accordion/accordionStyles.d.ts.map +1 -1
- package/dist/components/molecules/Accordion/accordionStyles.js +2 -2
- package/dist/components/molecules/CheckboxGroup/CheckboxGroupItem.d.ts +5 -1
- package/dist/components/molecules/CheckboxGroup/CheckboxGroupItem.d.ts.map +1 -1
- package/dist/components/molecules/CheckboxGroup/CheckboxGroupItem.js +12 -10
- package/dist/components/molecules/DescriptionList/DescriptionList.d.ts +37 -0
- package/dist/components/molecules/DescriptionList/DescriptionList.d.ts.map +1 -0
- package/dist/components/molecules/DescriptionList/DescriptionList.js +50 -0
- package/dist/components/molecules/DescriptionList/descriptionListStyles.d.ts +21 -0
- package/dist/components/molecules/DescriptionList/descriptionListStyles.d.ts.map +1 -0
- package/dist/components/molecules/DescriptionList/descriptionListStyles.js +27 -0
- package/dist/components/molecules/IndexList/IndexList.d.ts +58 -0
- package/dist/components/molecules/IndexList/IndexList.d.ts.map +1 -0
- package/dist/components/molecules/IndexList/IndexList.js +96 -0
- package/dist/components/molecules/IndexList/indexListStyles.d.ts +29 -0
- package/dist/components/molecules/IndexList/indexListStyles.d.ts.map +1 -0
- package/dist/components/molecules/IndexList/indexListStyles.js +24 -0
- package/dist/components/molecules/PromptBar/PromptBar.d.ts +11 -1
- package/dist/components/molecules/PromptBar/PromptBar.d.ts.map +1 -1
- package/dist/components/molecules/PromptBar/PromptBar.js +54 -43
- package/dist/components/molecules/PromptBar/promptBarStyles.d.ts +16 -0
- package/dist/components/molecules/PromptBar/promptBarStyles.d.ts.map +1 -1
- package/dist/components/molecules/PromptBar/promptBarStyles.js +5 -2
- package/dist/components/organisms/ChatDock/ChatDock.d.ts +203 -0
- package/dist/components/organisms/ChatDock/ChatDock.d.ts.map +1 -0
- package/dist/components/organisms/ChatDock/ChatDock.js +697 -0
- package/dist/components/organisms/ChatDock/ChatDockGate.d.ts +52 -0
- package/dist/components/organisms/ChatDock/ChatDockGate.d.ts.map +1 -0
- package/dist/components/organisms/ChatDock/ChatDockGate.js +161 -0
- package/dist/components/organisms/ChatDock/chatDockGateStyles.d.ts +16 -0
- package/dist/components/organisms/ChatDock/chatDockGateStyles.d.ts.map +1 -0
- package/dist/components/organisms/ChatDock/chatDockGateStyles.js +8 -0
- package/dist/components/organisms/ChatDock/chatDockStyles.d.ts +98 -0
- package/dist/components/organisms/ChatDock/chatDockStyles.d.ts.map +1 -0
- package/dist/components/organisms/ChatDock/chatDockStyles.js +21 -0
- package/dist/components/organisms/ChatDock/chatDockViewport.d.ts +21 -0
- package/dist/components/organisms/ChatDock/chatDockViewport.d.ts.map +1 -0
- package/dist/components/organisms/ChatDock/chatDockViewport.js +46 -0
- package/dist/components/organisms/Dialog/AlertDialog.js +11 -11
- package/dist/components/organisms/Dialog/Dialog.js +44 -44
- package/dist/components/organisms/Sheet/Sheet.js +38 -38
- package/dist/components/organisms/Toast/Toast.js +5 -5
- package/dist/index.d.ts +7 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +122 -110
- package/dist/lib/compositionAudit.d.ts.map +1 -1
- package/dist/lib/typography.d.ts +2 -2
- package/dist/lib/typography.d.ts.map +1 -1
- package/dist/lib/typography.js +27 -1
- package/dist/styles.css +1 -1
- package/dist/theme.css +1 -0
- package/dist/typography.css +34 -0
- package/docs/README.md +1 -1
- package/docs/component-contracts.md +16 -1
- package/docs/components.md +16 -11
- package/docs/exports.json +81 -4
- package/docs/patterns/components-accordion--flush.tsx +29 -0
- package/docs/patterns/components-avatar--dropdown-row.tsx +1 -1
- package/docs/patterns/components-badge--outline-tags.tsx +25 -0
- package/docs/patterns/components-badge--with-avatar.tsx +1 -1
- package/docs/patterns/components-button-button--copy-button.tsx +39 -0
- package/docs/patterns/components-button-button--destructive-action.tsx +1 -1
- package/docs/patterns/components-button-button--external-link.tsx +30 -0
- package/docs/patterns/components-button-button--ghost-action.tsx +1 -1
- package/docs/patterns/components-button-button--inverse-action.tsx +1 -1
- package/docs/patterns/components-button-button--link-render.tsx +1 -1
- package/docs/patterns/components-button-button--multi-state-badge.tsx +1 -1
- package/docs/patterns/components-button-button--outline-mono.tsx +1 -1
- package/docs/patterns/components-button-button--primary-action.tsx +1 -1
- package/docs/patterns/components-button-button--row-hug.tsx +1 -1
- package/docs/patterns/components-button-button--row-layout.tsx +1 -1
- package/docs/patterns/components-button-button--secondary-action.tsx +1 -1
- package/docs/patterns/components-button-button--suggestion-pills.tsx +1 -1
- package/docs/patterns/components-button-button--with-count.tsx +1 -1
- package/docs/patterns/components-button-button--with-icon.tsx +1 -1
- package/docs/patterns/components-button-floatingactionbutton--vertical-actions.tsx +1 -1
- package/docs/patterns/components-calembed--pattern-skip-in-footer.tsx +1 -1
- package/docs/patterns/components-card-card--body-slot-occupancy-history.tsx +1 -1
- package/docs/patterns/components-card-card--headerless-media.tsx +1 -1
- package/docs/patterns/components-card-card--outlined-layout.tsx +1 -1
- package/docs/patterns/components-card-card--pinned-height.tsx +1 -1
- package/docs/patterns/components-card-selectablecard--selectable-cards-pattern.tsx +1 -1
- package/docs/patterns/components-chart--audience-activity-heatmap.tsx +1 -1
- package/docs/patterns/components-chart--cartesian-no-data-gaps.tsx +1 -1
- package/docs/patterns/components-chart--occupancy-history-in-card.tsx +1 -1
- package/docs/patterns/components-chart--occupancy-in-card.tsx +1 -1
- package/docs/patterns/components-chart--post-reach-distribution.tsx +1 -1
- package/docs/patterns/components-chart--ranked-audience-breakdown.tsx +1 -1
- package/docs/patterns/components-chart--unit-grid-composition.tsx +1 -1
- package/docs/patterns/components-chatdock--pattern-chat-dock.tsx +158 -0
- package/docs/patterns/components-chatdock--pattern-start-project-gate.tsx +180 -0
- package/docs/patterns/components-chatqa--pattern-qa-with-reply.tsx +1 -1
- package/docs/patterns/components-checkbox-checkbox--default.tsx +1 -1
- package/docs/patterns/components-checkbox-checkbox--with-count.tsx +19 -0
- package/docs/patterns/components-checkbox-checkbox--with-description.tsx +1 -1
- package/docs/patterns/components-checkbox-checkboxgroup--default.tsx +1 -1
- package/docs/patterns/components-checkbox-checkboxgroup--option-counts.tsx +17 -0
- package/docs/patterns/components-descriptionlist--details.tsx +21 -0
- package/docs/patterns/components-descriptionlist--post-metadata.tsx +52 -0
- package/docs/patterns/components-dialog--alert-dialog-destructive.tsx +1 -1
- package/docs/patterns/components-dialog--default-dialog.tsx +1 -1
- package/docs/patterns/components-dialog--form-dialog.tsx +1 -1
- package/docs/patterns/components-displaycontrols--page-utilities.tsx +1 -1
- package/docs/patterns/components-field--horizontal-input.tsx +1 -1
- package/docs/patterns/components-field--horizontal-text-area.tsx +1 -1
- package/docs/patterns/components-field--multi-control.tsx +1 -1
- package/docs/patterns/components-footerreveal--marketing-hero-pattern.tsx +1 -1
- package/docs/patterns/components-footerreveal--marketing-hero-ruled-pattern.tsx +1 -1
- package/docs/patterns/components-footerreveal--marketing-hero-with-gallery-intro.tsx +1 -1
- package/docs/patterns/components-footerreveal--marketing-page-pattern.tsx +1 -1
- package/docs/patterns/components-footerreveal--ruled-grid-footer-pattern.tsx +1 -1
- package/docs/patterns/components-footerreveal--sequenced-marketing-hero.tsx +1 -1
- package/docs/patterns/components-herointro--two-line-intro.tsx +1 -1
- package/docs/patterns/components-herotilestack--marketing-hero-pattern.tsx +1 -1
- package/docs/patterns/components-herotilestack--marketing-hero-text-sequence.tsx +1 -1
- package/docs/patterns/components-herotilestack--marketing-hero-with-gallery-intro.tsx +1 -1
- package/docs/patterns/components-indexlist--post-index.tsx +36 -0
- package/docs/patterns/components-intakeconfirmation--booked-pattern.tsx +1 -1
- package/docs/patterns/components-intakeconfirmation--emailed-pattern.tsx +1 -1
- package/docs/patterns/components-intakeform--about-you-pattern.tsx +1 -1
- package/docs/patterns/components-intakemodal--intake-modal-pattern.tsx +1 -1
- package/docs/patterns/components-kbd--command-row.tsx +1 -1
- package/docs/patterns/components-kbd--numbered-choices.tsx +1 -1
- package/docs/patterns/components-kbd--shortcut.tsx +1 -1
- package/docs/patterns/components-moremenu--action-menu.tsx +1 -1
- package/docs/patterns/components-moremenu--in-card-header.tsx +1 -1
- package/docs/patterns/components-navlist--side-nav-settings.tsx +1 -1
- package/docs/patterns/components-pageheader--app-header-pattern.tsx +1 -1
- package/docs/patterns/components-pageheader--page-section-header.tsx +1 -1
- package/docs/patterns/components-pageheader--toolbar-header.tsx +1 -1
- package/docs/patterns/components-panel--end-detail-rail.tsx +1 -1
- package/docs/patterns/components-pillgroup--pill-group-pattern.tsx +1 -1
- package/docs/patterns/components-promptbar--pattern-prompt-bar.tsx +1 -1
- package/docs/patterns/components-prose--article-body.tsx +11 -0
- package/docs/patterns/components-radio-radiogroup--default.tsx +1 -1
- package/docs/patterns/components-scrollhorizontal--project-gallery-pattern.tsx +1 -1
- package/docs/patterns/components-scrollhorizontal--with-intro.tsx +1 -1
- package/docs/patterns/components-sectioncaption--column-caption.tsx +16 -0
- package/docs/patterns/components-sectioncaption--with-action.tsx +19 -0
- package/docs/patterns/components-sheet--bottom-sheet.tsx +1 -1
- package/docs/patterns/components-sheet--end-sheet.tsx +1 -1
- package/docs/patterns/components-sitenav--brand-and-cta.tsx +1 -1
- package/docs/patterns/components-sitenav--centered-links.tsx +1 -1
- package/docs/patterns/components-sitenav--compact.tsx +1 -1
- package/docs/patterns/components-sitenav--marketing-header.tsx +1 -1
- package/docs/patterns/components-sitenav--mega-menu.tsx +1 -1
- package/docs/patterns/components-stat--insights-row.tsx +1 -1
- package/docs/patterns/components-stepprogress--step-progress-pattern.tsx +1 -1
- package/docs/patterns/components-switch--default.tsx +1 -1
- package/docs/patterns/components-switch--settings-row.tsx +1 -1
- package/docs/patterns/components-tab--settings-pages.tsx +1 -1
- package/docs/patterns/components-taskrows--action-details.tsx +1 -1
- package/docs/patterns/components-taskrows--capsules.tsx +1 -1
- package/docs/patterns/components-taskrows--card-with-status-rows.tsx +1 -1
- package/docs/patterns/components-taskrows--controlled-expand.tsx +1 -1
- package/docs/patterns/components-taskrows--custom-slots.tsx +1 -1
- package/docs/patterns/components-taskrows--status-list.tsx +1 -1
- package/docs/patterns/components-taskrows--tag-chips.tsx +1 -1
- package/docs/patterns/components-textlink--external-destination.tsx +1 -1
- package/docs/patterns/components-textlink--inline-prose.tsx +1 -1
- package/docs/patterns/components-textlink--quiet-title.tsx +15 -0
- package/docs/patterns/components-textlink--supporting-copy.tsx +1 -1
- package/docs/patterns/components-textsequence--default.tsx +1 -1
- package/docs/patterns/components-textsequence--reduced-motion.tsx +1 -1
- package/docs/patterns/components-textsequence--shapes.tsx +1 -1
- package/docs/patterns/components-toast--stacked-notifications.tsx +1 -1
- package/docs/patterns/components-tooltip--controlled.tsx +1 -1
- package/docs/patterns/components-tooltip--disabled-control.tsx +1 -1
- package/docs/patterns/components-tooltip--icon-action.tsx +1 -1
- package/docs/patterns/components-tooltip--keyboard-shortcut.tsx +1 -1
- package/docs/patterns/components-tooltip--placement.tsx +1 -1
- package/docs/patterns/foundations-scroll-fade--horizontal-rail.tsx +1 -1
- package/docs/patterns/foundations-scroll-fade--overflowing-list.tsx +1 -1
- package/docs/patterns/guides-chart-explorations--comparison-gallery.tsx +1 -1
- package/docs/patterns/guides-filter-panel--filtered-index.tsx +174 -0
- package/docs/patterns/guides-overlay-flows--notification-preferences.tsx +1 -1
- package/docs/patterns/guides-post-page--post-page.tsx +143 -0
- package/docs/patterns/guides-profile-typography--editorial-profile.tsx +1 -1
- package/docs/patterns/index.json +137 -9
- package/package.json +1 -1
- package/docs/patterns/components-promptbar--pattern-marketing-composer.tsx +0 -37
|
@@ -0,0 +1,697 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../../../lib/cn.js";
|
|
3
|
+
import { motionBeatSeconds as t, motionStaggerSeconds as n, motionTransitionProp as r, readMotionDurationSeconds as i } from "../../../lib/motion.js";
|
|
4
|
+
import { ButtonIcon as a } from "../../atoms/Button/ButtonIcon.js";
|
|
5
|
+
import { Button as o } from "../../atoms/Button/Button.js";
|
|
6
|
+
import { IconButton as s } from "../../atoms/IconButton/IconButton.js";
|
|
7
|
+
import { Status as ee } from "../../atoms/Status/Status.js";
|
|
8
|
+
import { PromptBar as te } from "../../molecules/PromptBar/PromptBar.js";
|
|
9
|
+
import { OverlayPanelHeader as ne } from "../Dialog/OverlayPanelHeader.js";
|
|
10
|
+
import { subscribeChatDockViewport as re, useChatDockVisibleArea as ie, useChatDockWide as ae } from "./chatDockViewport.js";
|
|
11
|
+
import { ChatDockGate as c, chatDockGateDefaultLabels as l } from "./ChatDockGate.js";
|
|
12
|
+
import { chatDockAssistantMessageClasses as u, chatDockComposerAreaClasses as oe, chatDockComposerClasses as se, chatDockComposerFootSpacerClasses as ce, chatDockComposerLayerClasses as le, chatDockDisclaimerClasses as ue, chatDockDockClasses as de, chatDockDockHoverClasses as fe, chatDockFollowUpRowClasses as pe, chatDockFollowUpsComposerClasses as me, chatDockFollowUpsInlineClasses as he, chatDockGridClasses as ge, chatDockMarkClasses as _e, chatDockPillClasses as ve, chatDockPillsClasses as ye, chatDockPlacements as d, chatDockReplyActionsClasses as be, chatDockReplyActionsPendingClasses as xe, chatDockReplyButtonsClasses as Se, chatDockReplyClasses as Ce, chatDockReplyMetaClasses as we, chatDockRootClasses as Te, chatDockRootRaisedClasses as Ee, chatDockSuggestionLabelClasses as De, chatDockSuggestionListClasses as Oe, chatDockSuggestionRowContentClasses as ke, chatDockThinkingClasses as Ae, chatDockThreadClasses as je, chatDockUserMessageClasses as Me, chatDockWindowClasses as Ne, chatDockWindowContentClasses as Pe } from "./chatDockStyles.js";
|
|
13
|
+
import { useContext as Fe, useEffect as f, useId as Ie, useLayoutEffect as p, useRef as m, useState as h, useSyncExternalStore as Le } from "react";
|
|
14
|
+
import { Check as Re, Copy as ze, CornerDownRight as Be, ThumbsDown as Ve, ThumbsUp as He } from "lucide-react";
|
|
15
|
+
import { Fragment as Ue, jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
16
|
+
import { AnimatePresence as v, MotionConfigContext as We, motion as y, useReducedMotion as Ge } from "motion/react";
|
|
17
|
+
//#region src/components/organisms/ChatDock/ChatDock.tsx
|
|
18
|
+
var Ke = {
|
|
19
|
+
close: "Close chat",
|
|
20
|
+
thinking: "Thinking…",
|
|
21
|
+
conversation: "Conversation",
|
|
22
|
+
suggestions: "Suggested questions",
|
|
23
|
+
followUps: "Suggested follow-ups",
|
|
24
|
+
field: "Ask anything",
|
|
25
|
+
send: "Send",
|
|
26
|
+
copy: "Copy reply",
|
|
27
|
+
copied: "Copied",
|
|
28
|
+
helpful: "Mark this reply helpful",
|
|
29
|
+
notHelpful: "Mark this reply not helpful"
|
|
30
|
+
}, b = ["inline", "composer"];
|
|
31
|
+
function qe(e) {
|
|
32
|
+
return e.filter((e) => e.prompt != null && e.prompt.trim() !== "");
|
|
33
|
+
}
|
|
34
|
+
function Je(e, t) {
|
|
35
|
+
return e.length > 0 && t.length === 0;
|
|
36
|
+
}
|
|
37
|
+
function Ye({ followUps: e, messages: t, thinking: n, sentAfterId: r }) {
|
|
38
|
+
let i = t[t.length - 1];
|
|
39
|
+
return e.length > 0 && !n && i?.role === "assistant" && i.id !== r;
|
|
40
|
+
}
|
|
41
|
+
function Xe({ message: e, isLatest: t, thinking: n, takesVotes: r }) {
|
|
42
|
+
if (e.role !== "assistant") return null;
|
|
43
|
+
let i = {
|
|
44
|
+
copy: e.copyText != null,
|
|
45
|
+
vote: r && e.feedback !== void 0,
|
|
46
|
+
meta: e.meta != null
|
|
47
|
+
};
|
|
48
|
+
return !i.copy && !i.vote && !i.meta ? null : {
|
|
49
|
+
...i,
|
|
50
|
+
ready: !(t && n)
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
var Ze = 2e3, Qe = 48;
|
|
54
|
+
function $e() {
|
|
55
|
+
return window.innerHeight;
|
|
56
|
+
}
|
|
57
|
+
function et() {
|
|
58
|
+
return Number.parseFloat(getComputedStyle(document.documentElement).fontSize) || 16;
|
|
59
|
+
}
|
|
60
|
+
function x(e, t, n) {
|
|
61
|
+
return e === "inline" ? 32 * n : Math.max(0, Math.min(40 * n, t - 7 * n));
|
|
62
|
+
}
|
|
63
|
+
var S = 7, C = 12;
|
|
64
|
+
function tt({ windowHeight: e, headerHeight: t, bottomInset: n, remPx: r }) {
|
|
65
|
+
let i = r + t + .75 * r + S * r + .75 * r + n;
|
|
66
|
+
return Math.round(Math.max(C * r, e - i));
|
|
67
|
+
}
|
|
68
|
+
function w({ title: c, subtitle: l, mark: d, greeting: b, messages: S = [], thinking: C = !1, suggestions: w = [], onSend: nt, onSuggestionSelect: rt, followUps: T = [], followUpsPlacement: it = "inline", onMessageFeedback: at, gate: ot, open: st, defaultOpen: ct = !1, onOpenChange: lt, placeholder: ut, disclaimer: E, labels: dt, placement: D = "fixed", className: ft }) {
|
|
69
|
+
let O = {
|
|
70
|
+
...Ke,
|
|
71
|
+
...dt
|
|
72
|
+
}, pt = Ie(), mt = Ie(), { reducedMotion: ht } = Fe(We), k = Ge() === !0 || ht === "always", A = ae(), gt = Le(re, $e, () => 800), j = Le(re, et, () => 16), _t = st !== void 0, [vt, yt] = h(ct), M = _t ? st : vt, [bt, xt] = h(""), [St, Ct] = h(null), [N, wt] = h(null), [Tt, Et] = h(!M);
|
|
73
|
+
M && Tt && Et(!1);
|
|
74
|
+
let P = !M && Tt, F = ot != null, I = F && M, [Dt, Ot] = h(I), [L, R] = h(!1);
|
|
75
|
+
Dt !== I && (Ot(I), R(!0));
|
|
76
|
+
let [kt, At] = h(null), [jt, Mt] = h(!I);
|
|
77
|
+
I && jt && Mt(!1);
|
|
78
|
+
let [Nt, Pt] = h(I);
|
|
79
|
+
!I && Nt && Pt(!1);
|
|
80
|
+
let z = ie(D === "fixed" && !A && !P), B = m(null), Ft = m(null), It = m(null), Lt = m(null), Rt = m(null), V = m(null), zt = m(null), Bt = m(F), H = m(I), U = m(null), Vt = m(null), Ht = m(!0), W = m(!1), Ut = m(M), Wt = m(M);
|
|
81
|
+
function G(e) {
|
|
82
|
+
e !== M && (_t || yt(e), lt?.(e));
|
|
83
|
+
}
|
|
84
|
+
function Gt(e) {
|
|
85
|
+
let t = e.trim();
|
|
86
|
+
t !== "" && (G(!0), Ht.current = !0, xt(""), Ct(S[S.length - 1]?.id ?? null), nt(t));
|
|
87
|
+
}
|
|
88
|
+
function Kt(e) {
|
|
89
|
+
rt?.(e), e.prompt != null && Gt(e.prompt);
|
|
90
|
+
}
|
|
91
|
+
function qt(e) {
|
|
92
|
+
let t = e.copyText, n = typeof navigator > "u" ? void 0 : navigator.clipboard;
|
|
93
|
+
t != null && n != null && n.writeText(t).then(() => wt({
|
|
94
|
+
id: e.id,
|
|
95
|
+
at: Date.now()
|
|
96
|
+
}), () => void 0);
|
|
97
|
+
}
|
|
98
|
+
f(() => {
|
|
99
|
+
if (N == null) return;
|
|
100
|
+
let e = window.setTimeout(() => wt(null), Ze);
|
|
101
|
+
return () => window.clearTimeout(e);
|
|
102
|
+
}, [N]);
|
|
103
|
+
function Jt(e) {
|
|
104
|
+
Kt(e), U.current?.focus();
|
|
105
|
+
}
|
|
106
|
+
function Yt(e) {
|
|
107
|
+
Kt(e), e.prompt != null && U.current?.focus();
|
|
108
|
+
}
|
|
109
|
+
f(() => {
|
|
110
|
+
Wt.current = M;
|
|
111
|
+
let e = U.current;
|
|
112
|
+
if (e != null && M && !Ut.current) document.activeElement !== e && e.focus();
|
|
113
|
+
else if (e != null && !M && Ut.current) {
|
|
114
|
+
let t = document.activeElement, n = t == null || t === document.body || B.current?.contains(t) === !0;
|
|
115
|
+
t !== e && n && (W.current = !0, e.focus(), W.current = !1);
|
|
116
|
+
}
|
|
117
|
+
Ut.current = M;
|
|
118
|
+
}, [M]), f(() => {
|
|
119
|
+
F && !Bt.current && !Wt.current && G(!0), Bt.current = F;
|
|
120
|
+
}), f(() => {
|
|
121
|
+
if (I && !H.current) {
|
|
122
|
+
let e = zt.current;
|
|
123
|
+
(e?.querySelector("[data-chat-dock-gate-focus]") ?? e)?.focus({ preventScroll: !0 });
|
|
124
|
+
} else if (!I && H.current && M) {
|
|
125
|
+
let e = U.current, t = document.activeElement, n = t == null || t === document.body || B.current?.contains(t) === !0;
|
|
126
|
+
e != null && n && (W.current = !0, e.focus({ preventScroll: !0 }), W.current = !1);
|
|
127
|
+
}
|
|
128
|
+
H.current = I;
|
|
129
|
+
}, [I, M]), f(() => {
|
|
130
|
+
if (!L) return;
|
|
131
|
+
let e = (i("fast") + i("medium")) * 1e3 + 100, t = window.setTimeout(() => R(!1), e);
|
|
132
|
+
return () => window.clearTimeout(t);
|
|
133
|
+
}, [L]), p(() => {
|
|
134
|
+
let e = Rt.current;
|
|
135
|
+
if (e == null || typeof ResizeObserver > "u") return;
|
|
136
|
+
let t = new ResizeObserver(() => At(e.offsetHeight));
|
|
137
|
+
return t.observe(e), () => {
|
|
138
|
+
t.disconnect();
|
|
139
|
+
};
|
|
140
|
+
}, []);
|
|
141
|
+
let Xt = E != null, K = D === "fixed" && !A ? "rise" : "grow";
|
|
142
|
+
p(() => {
|
|
143
|
+
let e = B.current, t = It.current, n = Lt.current;
|
|
144
|
+
if (e == null || t == null || n == null) return;
|
|
145
|
+
let r = () => {
|
|
146
|
+
let r = K === "rise" ? Math.max(0, window.innerHeight - z.bottom - e.getBoundingClientRect().bottom) : 0;
|
|
147
|
+
Ft.current?.style.setProperty("--chat-dock-composer", `${t.offsetHeight + n.offsetHeight + r}px`);
|
|
148
|
+
let i = tt({
|
|
149
|
+
windowHeight: K === "rise" ? window.innerHeight - z.top - z.bottom : x(D, window.innerHeight, j),
|
|
150
|
+
headerHeight: V.current?.offsetHeight || 4 * j,
|
|
151
|
+
bottomInset: n.offsetHeight + r,
|
|
152
|
+
remPx: j
|
|
153
|
+
});
|
|
154
|
+
e.style.setProperty("--chat-dock-gate-max", `${i}px`);
|
|
155
|
+
};
|
|
156
|
+
if (r(), typeof ResizeObserver > "u") return;
|
|
157
|
+
let i = new ResizeObserver(r);
|
|
158
|
+
return i.observe(t), i.observe(n), V.current != null && i.observe(V.current), () => {
|
|
159
|
+
i.disconnect();
|
|
160
|
+
};
|
|
161
|
+
}, [
|
|
162
|
+
Xt,
|
|
163
|
+
K,
|
|
164
|
+
gt,
|
|
165
|
+
z.top,
|
|
166
|
+
z.bottom,
|
|
167
|
+
D,
|
|
168
|
+
j,
|
|
169
|
+
I
|
|
170
|
+
]), p(() => {
|
|
171
|
+
let e = Vt.current;
|
|
172
|
+
e != null && Ht.current && (e.scrollTop = e.scrollHeight);
|
|
173
|
+
});
|
|
174
|
+
function Zt(e) {
|
|
175
|
+
!M || I || e.key !== "Escape" || e.defaultPrevented || (e.preventDefault(), G(!1));
|
|
176
|
+
}
|
|
177
|
+
let Qt = qe(w), $t = !I && Je(w, S), en = !I && Ye({
|
|
178
|
+
followUps: T,
|
|
179
|
+
messages: S,
|
|
180
|
+
thinking: C,
|
|
181
|
+
sentAfterId: St
|
|
182
|
+
}), q = M ? "open" : "closed", J = r("medium"), Y = r("fast"), tn = n(), nn = t(1), X = tn, Z = { duration: 0 }, Q = {
|
|
183
|
+
default: Z,
|
|
184
|
+
opacity: Y
|
|
185
|
+
}, rn = 3.25 * j, an = {
|
|
186
|
+
height: rn,
|
|
187
|
+
left: 0,
|
|
188
|
+
right: 0,
|
|
189
|
+
borderRadius: rn / 2
|
|
190
|
+
}, on = {
|
|
191
|
+
height: x(D, gt, j),
|
|
192
|
+
left: -j,
|
|
193
|
+
right: -j,
|
|
194
|
+
borderRadius: j
|
|
195
|
+
}, sn = k ? {
|
|
196
|
+
open: {
|
|
197
|
+
...K === "grow" ? on : { y: 0 },
|
|
198
|
+
opacity: 1,
|
|
199
|
+
transition: Q
|
|
200
|
+
},
|
|
201
|
+
closed: {
|
|
202
|
+
...K === "grow" ? on : { y: 0 },
|
|
203
|
+
opacity: 0,
|
|
204
|
+
transition: Q
|
|
205
|
+
}
|
|
206
|
+
} : K === "grow" ? {
|
|
207
|
+
open: {
|
|
208
|
+
...on,
|
|
209
|
+
opacity: 1,
|
|
210
|
+
transition: J
|
|
211
|
+
},
|
|
212
|
+
closed: {
|
|
213
|
+
...an,
|
|
214
|
+
opacity: 1,
|
|
215
|
+
transition: {
|
|
216
|
+
...J,
|
|
217
|
+
delay: X
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
} : {
|
|
221
|
+
open: {
|
|
222
|
+
y: 0,
|
|
223
|
+
opacity: 1,
|
|
224
|
+
transition: J
|
|
225
|
+
},
|
|
226
|
+
closed: {
|
|
227
|
+
y: "100%",
|
|
228
|
+
opacity: 1,
|
|
229
|
+
transition: {
|
|
230
|
+
...J,
|
|
231
|
+
delay: X
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}, cn = {
|
|
235
|
+
variants: k ? {
|
|
236
|
+
open: {},
|
|
237
|
+
closed: {}
|
|
238
|
+
} : {
|
|
239
|
+
open: (e) => ({
|
|
240
|
+
opacity: 1,
|
|
241
|
+
y: 0,
|
|
242
|
+
transition: {
|
|
243
|
+
...Y,
|
|
244
|
+
delay: nn + e * tn
|
|
245
|
+
}
|
|
246
|
+
}),
|
|
247
|
+
closed: {
|
|
248
|
+
opacity: 0,
|
|
249
|
+
y: 8,
|
|
250
|
+
transition: Y
|
|
251
|
+
}
|
|
252
|
+
},
|
|
253
|
+
initial: !1,
|
|
254
|
+
animate: q
|
|
255
|
+
}, ln = {
|
|
256
|
+
open: {
|
|
257
|
+
width: 0,
|
|
258
|
+
opacity: 0,
|
|
259
|
+
transition: k ? Q : {
|
|
260
|
+
width: J,
|
|
261
|
+
opacity: Y
|
|
262
|
+
}
|
|
263
|
+
},
|
|
264
|
+
closed: {
|
|
265
|
+
width: "auto",
|
|
266
|
+
opacity: 1,
|
|
267
|
+
transition: k ? Q : {
|
|
268
|
+
width: {
|
|
269
|
+
...J,
|
|
270
|
+
delay: X
|
|
271
|
+
},
|
|
272
|
+
opacity: {
|
|
273
|
+
...Y,
|
|
274
|
+
delay: nn
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}, un = {
|
|
279
|
+
open: {
|
|
280
|
+
height: "auto",
|
|
281
|
+
opacity: 1,
|
|
282
|
+
transition: k ? Q : {
|
|
283
|
+
height: J,
|
|
284
|
+
opacity: {
|
|
285
|
+
...Y,
|
|
286
|
+
delay: nn
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
},
|
|
290
|
+
closed: {
|
|
291
|
+
height: 0,
|
|
292
|
+
opacity: 0,
|
|
293
|
+
transition: k ? Q : {
|
|
294
|
+
height: {
|
|
295
|
+
...J,
|
|
296
|
+
delay: X
|
|
297
|
+
},
|
|
298
|
+
opacity: Y
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
}, dn = {
|
|
302
|
+
initial: !k && "hidden",
|
|
303
|
+
animate: M ? "visible" : "folded",
|
|
304
|
+
exit: {
|
|
305
|
+
opacity: 0,
|
|
306
|
+
transition: Z
|
|
307
|
+
},
|
|
308
|
+
variants: {
|
|
309
|
+
hidden: {},
|
|
310
|
+
visible: {
|
|
311
|
+
opacity: 1,
|
|
312
|
+
transition: {
|
|
313
|
+
...Y,
|
|
314
|
+
staggerChildren: tn
|
|
315
|
+
}
|
|
316
|
+
},
|
|
317
|
+
folded: {
|
|
318
|
+
opacity: 0,
|
|
319
|
+
transition: k ? Z : Y
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
}, fn = {
|
|
323
|
+
hidden: {
|
|
324
|
+
opacity: 0,
|
|
325
|
+
y: 6
|
|
326
|
+
},
|
|
327
|
+
visible: {
|
|
328
|
+
opacity: 1,
|
|
329
|
+
y: 0,
|
|
330
|
+
transition: Y
|
|
331
|
+
}
|
|
332
|
+
}, $ = (e) => e.preventDefault(), pn = A ? "sm" : "md";
|
|
333
|
+
function mn(t, n) {
|
|
334
|
+
let r = N?.id === t.id, i = t.feedback ?? null, a = (e) => at?.(t, i === e ? null : e);
|
|
335
|
+
return /* @__PURE__ */ _("div", {
|
|
336
|
+
className: e(be, n.ready ? void 0 : xe),
|
|
337
|
+
"data-reply-actions": n.ready ? "ready" : "pending",
|
|
338
|
+
children: [n.copy || n.vote ? /* @__PURE__ */ _("div", {
|
|
339
|
+
className: Se,
|
|
340
|
+
children: [n.copy ? /* @__PURE__ */ g(s, {
|
|
341
|
+
size: pn,
|
|
342
|
+
icon: g(r ? Re : ze, {}),
|
|
343
|
+
"aria-label": r ? O.copied : O.copy,
|
|
344
|
+
onClick: () => qt(t)
|
|
345
|
+
}) : null, n.vote ? /* @__PURE__ */ _(Ue, { children: [/* @__PURE__ */ g(s, {
|
|
346
|
+
size: pn,
|
|
347
|
+
icon: /* @__PURE__ */ g(He, {}),
|
|
348
|
+
"aria-label": O.helpful,
|
|
349
|
+
pressed: i === "up",
|
|
350
|
+
onClick: () => a("up")
|
|
351
|
+
}), /* @__PURE__ */ g(s, {
|
|
352
|
+
size: pn,
|
|
353
|
+
icon: /* @__PURE__ */ g(Ve, {}),
|
|
354
|
+
"aria-label": O.notHelpful,
|
|
355
|
+
pressed: i === "down",
|
|
356
|
+
onClick: () => a("down")
|
|
357
|
+
})] }) : null]
|
|
358
|
+
}) : null, t.meta == null ? null : /* @__PURE__ */ _("p", {
|
|
359
|
+
className: we,
|
|
360
|
+
children: [t.meta.label, t.meta.description == null ? null : /* @__PURE__ */ _("span", {
|
|
361
|
+
className: "sr-only",
|
|
362
|
+
children: [". ", t.meta.description]
|
|
363
|
+
})]
|
|
364
|
+
})]
|
|
365
|
+
});
|
|
366
|
+
}
|
|
367
|
+
return /* @__PURE__ */ g("div", {
|
|
368
|
+
className: e(Te[D], D === "fixed" && !P ? Ee : void 0, ft),
|
|
369
|
+
"data-open": M ? "" : void 0,
|
|
370
|
+
"data-gate": I ? "" : void 0,
|
|
371
|
+
style: z.top > 0 || z.bottom > 0 ? {
|
|
372
|
+
"--chat-dock-vv-top": `${z.top}px`,
|
|
373
|
+
"--chat-dock-vv-bottom": `${z.bottom}px`
|
|
374
|
+
} : void 0,
|
|
375
|
+
children: /* @__PURE__ */ g("div", {
|
|
376
|
+
className: ge,
|
|
377
|
+
children: /* @__PURE__ */ g("div", {
|
|
378
|
+
className: "band",
|
|
379
|
+
children: /* @__PURE__ */ _("div", {
|
|
380
|
+
ref: B,
|
|
381
|
+
className: e(de, P ? fe : void 0),
|
|
382
|
+
role: M ? "dialog" : void 0,
|
|
383
|
+
"aria-modal": M ? "false" : void 0,
|
|
384
|
+
"aria-labelledby": M ? pt : void 0,
|
|
385
|
+
"aria-describedby": M && l != null ? mt : void 0,
|
|
386
|
+
onKeyDown: Zt,
|
|
387
|
+
children: [
|
|
388
|
+
/* @__PURE__ */ g(v, {
|
|
389
|
+
initial: !1,
|
|
390
|
+
children: !M && Qt.length > 0 ? /* @__PURE__ */ g(y.div, {
|
|
391
|
+
className: ye,
|
|
392
|
+
role: "group",
|
|
393
|
+
"aria-label": O.suggestions,
|
|
394
|
+
exit: {
|
|
395
|
+
opacity: 0,
|
|
396
|
+
transition: k ? Z : Y
|
|
397
|
+
},
|
|
398
|
+
children: Qt.map((e, t) => /* @__PURE__ */ g("span", {
|
|
399
|
+
className: ve,
|
|
400
|
+
style: { "--chat-dock-pill-index": t },
|
|
401
|
+
children: /* @__PURE__ */ g(o, {
|
|
402
|
+
type: "button",
|
|
403
|
+
role: "secondary",
|
|
404
|
+
size: "md",
|
|
405
|
+
icon: e.icon,
|
|
406
|
+
onClick: () => Kt(e),
|
|
407
|
+
children: e.label
|
|
408
|
+
})
|
|
409
|
+
}, e.id))
|
|
410
|
+
}, "pills") : null
|
|
411
|
+
}),
|
|
412
|
+
/* @__PURE__ */ g(y.div, {
|
|
413
|
+
ref: Ft,
|
|
414
|
+
className: Ne[D],
|
|
415
|
+
"data-chat-dock-window": q,
|
|
416
|
+
hidden: P,
|
|
417
|
+
variants: sn,
|
|
418
|
+
initial: !1,
|
|
419
|
+
animate: q,
|
|
420
|
+
onAnimationComplete: (e) => {
|
|
421
|
+
e === "closed" && !Wt.current && Et(!0);
|
|
422
|
+
},
|
|
423
|
+
children: /* @__PURE__ */ _("div", {
|
|
424
|
+
className: Pe,
|
|
425
|
+
children: [
|
|
426
|
+
/* @__PURE__ */ g(y.div, {
|
|
427
|
+
ref: V,
|
|
428
|
+
className: "shrink-0",
|
|
429
|
+
custom: 0,
|
|
430
|
+
...cn,
|
|
431
|
+
children: /* @__PURE__ */ g(ne, {
|
|
432
|
+
titleId: pt,
|
|
433
|
+
descriptionId: mt,
|
|
434
|
+
title: c,
|
|
435
|
+
description: l,
|
|
436
|
+
headerStart: d,
|
|
437
|
+
closeLabel: O.close,
|
|
438
|
+
onClose: () => G(!1),
|
|
439
|
+
delineated: !0
|
|
440
|
+
})
|
|
441
|
+
}),
|
|
442
|
+
/* @__PURE__ */ _(y.div, {
|
|
443
|
+
ref: Vt,
|
|
444
|
+
className: je,
|
|
445
|
+
role: "log",
|
|
446
|
+
"aria-label": O.conversation,
|
|
447
|
+
tabIndex: 0,
|
|
448
|
+
custom: 1,
|
|
449
|
+
...cn,
|
|
450
|
+
onScroll: (e) => {
|
|
451
|
+
let t = e.currentTarget;
|
|
452
|
+
Ht.current = t.scrollHeight - t.scrollTop - t.clientHeight <= Qe;
|
|
453
|
+
},
|
|
454
|
+
children: [b == null ? null : /* @__PURE__ */ g("div", {
|
|
455
|
+
className: u,
|
|
456
|
+
children: b
|
|
457
|
+
}), /* @__PURE__ */ _(v, {
|
|
458
|
+
initial: !1,
|
|
459
|
+
children: [
|
|
460
|
+
S.map((e, t) => {
|
|
461
|
+
let n = Xe({
|
|
462
|
+
message: e,
|
|
463
|
+
isLatest: t === S.length - 1,
|
|
464
|
+
thinking: C,
|
|
465
|
+
takesVotes: at != null
|
|
466
|
+
});
|
|
467
|
+
return /* @__PURE__ */ g(y.div, {
|
|
468
|
+
"data-role": e.role,
|
|
469
|
+
className: e.role === "user" ? Me : n == null ? u : Ce,
|
|
470
|
+
initial: !k && {
|
|
471
|
+
opacity: 0,
|
|
472
|
+
y: 8
|
|
473
|
+
},
|
|
474
|
+
animate: {
|
|
475
|
+
opacity: 1,
|
|
476
|
+
y: 0
|
|
477
|
+
},
|
|
478
|
+
transition: Y,
|
|
479
|
+
children: n == null ? e.content : /* @__PURE__ */ _(Ue, { children: [/* @__PURE__ */ g("div", {
|
|
480
|
+
className: u,
|
|
481
|
+
children: e.content
|
|
482
|
+
}), mn(e, n)] })
|
|
483
|
+
}, e.id);
|
|
484
|
+
}),
|
|
485
|
+
en && it === "inline" ? /* @__PURE__ */ g(y.div, {
|
|
486
|
+
role: "group",
|
|
487
|
+
"aria-label": O.followUps,
|
|
488
|
+
"data-follow-ups": "inline",
|
|
489
|
+
className: he,
|
|
490
|
+
...dn,
|
|
491
|
+
animate: "visible",
|
|
492
|
+
children: T.map((e) => /* @__PURE__ */ g(y.div, {
|
|
493
|
+
className: pe,
|
|
494
|
+
variants: fn,
|
|
495
|
+
children: /* @__PURE__ */ g(o, {
|
|
496
|
+
type: "button",
|
|
497
|
+
role: "ghost",
|
|
498
|
+
layout: "row",
|
|
499
|
+
onMouseDown: $,
|
|
500
|
+
onClick: () => Jt(e),
|
|
501
|
+
children: /* @__PURE__ */ _("span", {
|
|
502
|
+
className: ke,
|
|
503
|
+
children: [/* @__PURE__ */ g(a, {
|
|
504
|
+
size: "md",
|
|
505
|
+
children: /* @__PURE__ */ g(Be, {})
|
|
506
|
+
}), /* @__PURE__ */ g("span", {
|
|
507
|
+
className: De,
|
|
508
|
+
children: e.label
|
|
509
|
+
})]
|
|
510
|
+
})
|
|
511
|
+
})
|
|
512
|
+
}, e.id))
|
|
513
|
+
}, "follow-ups") : null,
|
|
514
|
+
C ? /* @__PURE__ */ _(y.div, {
|
|
515
|
+
className: Ae,
|
|
516
|
+
initial: !k && { opacity: 0 },
|
|
517
|
+
animate: { opacity: 1 },
|
|
518
|
+
exit: {
|
|
519
|
+
opacity: 0,
|
|
520
|
+
transition: Z
|
|
521
|
+
},
|
|
522
|
+
transition: Y,
|
|
523
|
+
children: [/* @__PURE__ */ g(ee, {
|
|
524
|
+
variant: "dot",
|
|
525
|
+
tone: "neutral",
|
|
526
|
+
pulsing: !0,
|
|
527
|
+
besideLabel: !0
|
|
528
|
+
}), /* @__PURE__ */ g("span", { children: O.thinking })]
|
|
529
|
+
}, "thinking") : null
|
|
530
|
+
]
|
|
531
|
+
})]
|
|
532
|
+
}),
|
|
533
|
+
$t ? /* @__PURE__ */ g(y.div, {
|
|
534
|
+
className: Oe,
|
|
535
|
+
role: "group",
|
|
536
|
+
"aria-label": O.suggestions,
|
|
537
|
+
custom: 2,
|
|
538
|
+
...cn,
|
|
539
|
+
children: w.map((e) => /* @__PURE__ */ g(o, {
|
|
540
|
+
type: "button",
|
|
541
|
+
role: "ghost",
|
|
542
|
+
layout: "row",
|
|
543
|
+
onMouseDown: e.prompt == null ? void 0 : $,
|
|
544
|
+
onClick: () => Yt(e),
|
|
545
|
+
children: /* @__PURE__ */ _("span", {
|
|
546
|
+
className: ke,
|
|
547
|
+
children: [e.icon == null ? null : /* @__PURE__ */ g(a, {
|
|
548
|
+
size: "md",
|
|
549
|
+
children: e.icon
|
|
550
|
+
}), /* @__PURE__ */ g("span", {
|
|
551
|
+
className: De,
|
|
552
|
+
children: e.label
|
|
553
|
+
})]
|
|
554
|
+
})
|
|
555
|
+
}, e.id))
|
|
556
|
+
}) : null,
|
|
557
|
+
/* @__PURE__ */ g(v, {
|
|
558
|
+
initial: !1,
|
|
559
|
+
children: en && it === "composer" ? /* @__PURE__ */ g(y.div, {
|
|
560
|
+
role: "group",
|
|
561
|
+
"aria-label": O.followUps,
|
|
562
|
+
"data-follow-ups": "composer",
|
|
563
|
+
className: me,
|
|
564
|
+
...dn,
|
|
565
|
+
children: T.map((e) => /* @__PURE__ */ g(y.span, {
|
|
566
|
+
className: "inline-flex",
|
|
567
|
+
variants: fn,
|
|
568
|
+
children: /* @__PURE__ */ g(o, {
|
|
569
|
+
type: "button",
|
|
570
|
+
role: "secondary",
|
|
571
|
+
size: "md",
|
|
572
|
+
onMouseDown: $,
|
|
573
|
+
onClick: () => Jt(e),
|
|
574
|
+
children: e.label
|
|
575
|
+
})
|
|
576
|
+
}, e.id))
|
|
577
|
+
}, "follow-ups") : null
|
|
578
|
+
})
|
|
579
|
+
]
|
|
580
|
+
})
|
|
581
|
+
}, K),
|
|
582
|
+
/* @__PURE__ */ g("span", {
|
|
583
|
+
className: "sr-only",
|
|
584
|
+
role: "status",
|
|
585
|
+
children: N == null ? "" : O.copied
|
|
586
|
+
}),
|
|
587
|
+
/* @__PURE__ */ _("div", {
|
|
588
|
+
className: se,
|
|
589
|
+
children: [/* @__PURE__ */ g(y.div, {
|
|
590
|
+
ref: It,
|
|
591
|
+
initial: !1,
|
|
592
|
+
animate: { height: kt ?? "auto" },
|
|
593
|
+
transition: L && !k ? J : Z,
|
|
594
|
+
style: L ? { overflow: "hidden" } : void 0,
|
|
595
|
+
onAnimationComplete: () => R(!1),
|
|
596
|
+
children: /* @__PURE__ */ _("div", {
|
|
597
|
+
ref: Rt,
|
|
598
|
+
className: oe,
|
|
599
|
+
children: [/* @__PURE__ */ g(v, {
|
|
600
|
+
initial: !1,
|
|
601
|
+
children: F ? /* @__PURE__ */ g(y.div, {
|
|
602
|
+
ref: zt,
|
|
603
|
+
className: e(le, I ? void 0 : "pointer-events-none"),
|
|
604
|
+
"data-chat-dock-gate": "",
|
|
605
|
+
hidden: jt,
|
|
606
|
+
initial: {
|
|
607
|
+
opacity: 0,
|
|
608
|
+
y: 12
|
|
609
|
+
},
|
|
610
|
+
animate: I ? {
|
|
611
|
+
opacity: 1,
|
|
612
|
+
y: 0,
|
|
613
|
+
transition: {
|
|
614
|
+
...Y,
|
|
615
|
+
delay: k ? 0 : Y.duration
|
|
616
|
+
}
|
|
617
|
+
} : {
|
|
618
|
+
opacity: 0,
|
|
619
|
+
y: 12,
|
|
620
|
+
transition: Y
|
|
621
|
+
},
|
|
622
|
+
exit: {
|
|
623
|
+
opacity: 0,
|
|
624
|
+
y: 12,
|
|
625
|
+
transition: Y
|
|
626
|
+
},
|
|
627
|
+
onAnimationComplete: () => {
|
|
628
|
+
I || Mt(!0);
|
|
629
|
+
},
|
|
630
|
+
children: ot
|
|
631
|
+
}, "gate") : null
|
|
632
|
+
}), /* @__PURE__ */ g(y.div, {
|
|
633
|
+
className: e(le, I ? "pointer-events-none" : void 0),
|
|
634
|
+
hidden: Nt,
|
|
635
|
+
initial: !1,
|
|
636
|
+
animate: I ? {
|
|
637
|
+
opacity: 0,
|
|
638
|
+
transition: Y
|
|
639
|
+
} : {
|
|
640
|
+
opacity: 1,
|
|
641
|
+
transition: {
|
|
642
|
+
...Y,
|
|
643
|
+
delay: L && !k ? Y.duration : 0
|
|
644
|
+
}
|
|
645
|
+
},
|
|
646
|
+
onAnimationComplete: () => {
|
|
647
|
+
I && Pt(!0);
|
|
648
|
+
},
|
|
649
|
+
children: /* @__PURE__ */ g(te, {
|
|
650
|
+
ref: U,
|
|
651
|
+
value: bt,
|
|
652
|
+
onValueChange: (e) => {
|
|
653
|
+
xt(e), G(!0);
|
|
654
|
+
},
|
|
655
|
+
onSend: Gt,
|
|
656
|
+
onFocus: () => {
|
|
657
|
+
W.current || G(!0);
|
|
658
|
+
},
|
|
659
|
+
onClick: () => G(!0),
|
|
660
|
+
start: d == null ? void 0 : /* @__PURE__ */ g(y.span, {
|
|
661
|
+
className: _e,
|
|
662
|
+
"aria-hidden": M ? !0 : void 0,
|
|
663
|
+
variants: ln,
|
|
664
|
+
initial: !1,
|
|
665
|
+
animate: q,
|
|
666
|
+
children: d
|
|
667
|
+
}),
|
|
668
|
+
placeholder: ut,
|
|
669
|
+
"aria-label": O.field,
|
|
670
|
+
sendLabel: O.send
|
|
671
|
+
})
|
|
672
|
+
})]
|
|
673
|
+
})
|
|
674
|
+
}), /* @__PURE__ */ g(y.div, {
|
|
675
|
+
className: "overflow-hidden",
|
|
676
|
+
"aria-hidden": !M || void 0,
|
|
677
|
+
variants: un,
|
|
678
|
+
initial: !1,
|
|
679
|
+
animate: q,
|
|
680
|
+
children: /* @__PURE__ */ g("div", {
|
|
681
|
+
ref: Lt,
|
|
682
|
+
children: E != null && !I ? /* @__PURE__ */ g("p", {
|
|
683
|
+
className: ue[D],
|
|
684
|
+
children: E
|
|
685
|
+
}) : /* @__PURE__ */ g("div", { className: ce[D] })
|
|
686
|
+
})
|
|
687
|
+
})]
|
|
688
|
+
})
|
|
689
|
+
]
|
|
690
|
+
})
|
|
691
|
+
})
|
|
692
|
+
})
|
|
693
|
+
});
|
|
694
|
+
}
|
|
695
|
+
var nt = Object.assign(w, { Gate: c });
|
|
696
|
+
//#endregion
|
|
697
|
+
export { nt as ChatDock, c as ChatDockGate, Ke as chatDockDefaultLabels, b as chatDockFollowUpsPlacements, l as chatDockGateDefaultLabels, tt as chatDockGateMaxHeight, x as chatDockOpenHeight, qe as chatDockPillSuggestions, d as chatDockPlacements, Xe as chatDockReplyRow, Ye as chatDockShowsFollowUps, Je as chatDockShowsSuggestionRows };
|