sage-nexus-ui 1.13.2 → 1.13.4

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.
Files changed (41) hide show
  1. package/dist/components/NexusChat/AgentChatWindow.mjs +1 -0
  2. package/dist/components/NexusChat/AgentChatWindowHeader.mjs +1 -0
  3. package/dist/components/NexusChat/ChatHistory.mjs +1 -0
  4. package/dist/components/NexusChat/ChatHistoryButtonBase.mjs +1 -0
  5. package/dist/components/NexusChat/ChatHistoryHeader.mjs +1 -0
  6. package/dist/components/NexusChat/ChatInput.mjs +1 -0
  7. package/dist/components/NexusChat/NexusChatDialog.mjs +1 -0
  8. package/dist/components/NexusChat/WidgetParts/WidgetInput.mjs +1 -0
  9. package/dist/generated/version.mjs +1 -1
  10. package/dist/index.d.ts +259 -178
  11. package/dist/index.mjs +1 -1
  12. package/package.json +1 -1
  13. package/dist/components/AgentChatWindow.mjs +0 -1
  14. package/dist/components/AgentChatWindowHeader.mjs +0 -1
  15. package/dist/components/ChatHistory.mjs +0 -1
  16. package/dist/components/ChatHistoryButtonBase.mjs +0 -1
  17. package/dist/components/ChatHistoryHeader.mjs +0 -1
  18. package/dist/components/ChatInput.mjs +0 -1
  19. package/dist/components/NexusChatWidget/WidgetParts/WidgetInput.mjs +0 -1
  20. /package/dist/components/{NexusChatWidget → NexusChat}/AgentActivity/ActivityCard.mjs +0 -0
  21. /package/dist/components/{NexusChatWidget → NexusChat}/AgentActivity/ActivityCards.mjs +0 -0
  22. /package/dist/components/{NexusChatWidget → NexusChat}/AgentActivity/AgentActivity.mjs +0 -0
  23. /package/dist/components/{NexusChatWidget → NexusChat}/AgentActivity/AgentActivityHeader.mjs +0 -0
  24. /package/dist/components/{NexusChatWidget → NexusChat}/AgentActivity/SourceLink.mjs +0 -0
  25. /package/dist/components/{NexusChatWidget → NexusChat}/AgentActivity/TokenSummary.mjs +0 -0
  26. /package/dist/components/{NexusChatWidget → NexusChat}/AgentActivity/activityModel.mjs +0 -0
  27. /package/dist/components/{NexusChatWidget → NexusChat}/ChatComponents/ChatAvatar.mjs +0 -0
  28. /package/dist/components/{NexusChatWidget → NexusChat}/ChatComponents/EmptyState.mjs +0 -0
  29. /package/dist/components/{NexusChatWidget → NexusChat}/ChatComponents/MarkdownContent.mjs +0 -0
  30. /package/dist/components/{NexusChatWidget → NexusChat}/ChatComponents/MessageBubble.mjs +0 -0
  31. /package/dist/components/{NexusChatWidget → NexusChat}/ChatComponents/MessageList.mjs +0 -0
  32. /package/dist/components/{NexusChatWidget → NexusChat}/ChatComponents/SourceCitations.mjs +0 -0
  33. /package/dist/components/{NexusChatWidget → NexusChat}/ChatComponents/StreamingBubble.mjs +0 -0
  34. /package/dist/components/{NexusChatWidget → NexusChat}/ChatComponents/SuggestedPrompts.mjs +0 -0
  35. /package/dist/components/{NexusChatWidget → NexusChat}/ChatComponents/TypingIndicator.mjs +0 -0
  36. /package/dist/components/{NexusChatWidget → NexusChat}/ChatComponents/latestTraceLabel.mjs +0 -0
  37. /package/dist/components/{ChatHistorySearch.mjs → NexusChat/ChatHistorySearch.mjs} +0 -0
  38. /package/dist/components/{NexusChatWidget → NexusChat}/FABButton.mjs +0 -0
  39. /package/dist/components/{NexusChatWidget → NexusChat}/NexusChatWidget.mjs +0 -0
  40. /package/dist/components/{NexusChatWidget → NexusChat}/WidgetParts/WidgetBody.mjs +0 -0
  41. /package/dist/components/{NexusChatWidget → NexusChat}/WidgetParts/WidgetHeader.mjs +0 -0
@@ -0,0 +1 @@
1
+ import{jsxs as e,jsx as i}from"react/jsx-runtime";import{Box as o}from"../Box.mjs";import{Stack as t}from"../Stack.mjs";import{Caption as r}from"../Typography.mjs";import{GlassPaper as m}from"../GlassPaper.mjs";import{Paper as s}from"../Paper.mjs";import{ChatInput as n}from"./ChatInput.mjs";import"./ChatComponents/ChatAvatar.mjs";import"react";import"../Code.mjs";import"@mui/material";import"../../theme/tokens.mjs";import"@mui/icons-material/CheckCircle";import"@mui/icons-material/ExpandMore";import"@mui/icons-material/ExpandLess";import"@mui/icons-material/OpenInNew";import"@mui/material/styles";import"@mui/icons-material/StopCircle";import l from"./ChatComponents/SuggestedPrompts.mjs";import{AgentChatWindowHeader as p}from"./AgentChatWindowHeader.mjs";const a=({title:a="Spike AI Chat",subtitle:c="Your intelligent marketing assistant",showAiChip:d=!0,headerActions:h,body:u,followUpLabel:x="Suggested follow-ups:",followUpPrompts:f,onSelectFollowUp:C,onSend:g,inputDisabled:j=!1,inputPlaceholder:b="Ask Spike anything...",sx:y})=>{const S=Boolean(f&&f.length>0&&C);return e(o,{sx:[{display:"flex",flex:1,flexDirection:"column",minWidth:0,minHeight:0,height:"100%"},...Array.isArray(y)?y:y?[y]:[]],children:[i(p,{title:a,subtitle:c,showAiChip:d,actions:h}),i(m,{sx:{borderRadius:0,border:"none",flex:1,display:"flex",flexDirection:"column",overflowY:"scroll"},children:u}),S&&e(t,{direction:{xs:"column",md:"row"},spacing:1,sx:{px:2,py:1,justifyContent:{xs:"center",sm:"flex-end"},alignItems:"center"},children:[i(r,{sx:{display:"block",mb:1},children:x}),i(l,{prompts:f??[],onSelect:C})]}),i(s,{sx:{borderRadius:0,border:"none"},children:i(o,{sx:{p:2,flexShrink:0},children:i(n,{onSend:g,disabled:j,placeholder:b})})})]})};export{a as AgentChatWindow};
@@ -0,0 +1 @@
1
+ import{jsx as i,jsxs as r}from"react/jsx-runtime";import{Box as t}from"../Box.mjs";import{Stack as e}from"../Stack.mjs";import{AiChip as n}from"../AiChip.mjs";import{H2 as s,Caption as o}from"../Typography.mjs";const m=({title:m="Spike AI Chat",subtitle:c="Your intelligent marketing assistant",showAiChip:a=!0,actions:p,sx:l})=>{const h=i(e,{direction:"row",spacing:1,sx:{alignItems:"center"},children:a&&i(n,{})});return r(e,{direction:{xs:"column",sm:"row"},spacing:2,sx:[{alignItems:"center",justifyContent:"space-between",p:1,flexShrink:0},...Array.isArray(l)?l:l?[l]:[]],children:[r(t,{children:[i(s,{children:m}),i(o,{children:c})]}),p??h]})};export{m as AgentChatWindowHeader};
@@ -0,0 +1 @@
1
+ import{jsxs as e,jsx as o}from"react/jsx-runtime";import{useState as t,useCallback as r}from"react";import{Caption as n}from"../Typography.mjs";import{Box as i}from"../Box.mjs";import{Stack as a}from"../Stack.mjs";import{ChatHistoryHeader as s}from"./ChatHistoryHeader.mjs";import{ChatHistoryButtonBase as c}from"./ChatHistoryButtonBase.mjs";const h=({conversations:h,activeConversationId:l,onSelectConversation:m,onDeleteConversation:d,onNewConversation:C,onSearchChange:v,title:p="Chat history",emptyText:y="No conversations yet",newChatTitle:f="New chat",deleteConversationTitle:g="Delete conversation",searchPlaceholder:u="Search chat histories",searchDebounceMs:x=300,width:w=288,sx:b,formatMessageCount:j=e=>`${e} messages`})=>{const[S,T]=t(""),D=r(e=>{T(e),v?.(e)},[v]);return e(a,{direction:"column",sx:[{width:w,borderRight:1,borderColor:"divider",minWidth:0},...Array.isArray(b)?b:b?[b]:[]],children:[o(s,{title:p,newChatTitle:f,onNewConversation:C,onSearchChange:D,searchPlaceholder:u,searchDebounceMs:x}),o(i,{component:"nav","aria-label":p,sx:{flex:1,overflowY:"auto",p:1},children:0===h.length?o(n,{sx:{display:"block",textAlign:"center",py:4},children:y}):h.map(e=>{const t=e.id===l;return o(c,{conversation:e,isActive:t,highlightQuery:S,onSelectConversation:m,onDeleteConversation:d,deleteConversationTitle:g,formatMessageCount:j},e.id)})})]})};export{h as ChatHistory};
@@ -0,0 +1 @@
1
+ import{jsxs as e,jsx as o}from"react/jsx-runtime";import r from"@mui/icons-material/ChatBubbleOutlined";import t from"@mui/icons-material/DeleteForeverOutlined";import{Body1 as n,Caption as i}from"../Typography.mjs";import{Box as a}from"../Box.mjs";import{IconButton as l}from"../IconButton.mjs";import{colours as s}from"../../theme/tokens.mjs";const m=(e,r)=>{const t=r?.trim();if(!t)return e;const n=new RegExp(`(${(e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"))(t)})`,"ig");return e.split(n).map((e,r)=>{if(!e)return null;return e.toLowerCase()===t.toLowerCase()?o(a,{component:"mark",sx:{backgroundColor:e=>"dark"===e.palette.mode?"rgba(255, 214, 10, 0.35)":"rgba(255, 214, 10, 0.45)",color:"inherit",borderRadius:.5,px:.25,py:0},children:e},`${e}-${r}`):e})},p=({conversation:p,isActive:d,highlightQuery:c,onSelectConversation:u,onDeleteConversation:b,deleteConversationTitle:g,formatMessageCount:x})=>{const h=(e=>"number"==typeof e.messageCount?e.messageCount:Array.isArray(e.messages)?e.messages.length:0)(p);return e(a,{component:"div",role:"button",tabIndex:0,onClick:()=>u(p.id),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),u(p.id))},sx:{width:"100%",display:"flex",alignItems:"center",gap:1.25,borderRadius:1,px:1.5,py:1.25,textAlign:"left",backgroundColor:d?e=>"dark"===e.palette.mode?s.black:s.white:"transparent",backgroundImage:"none",opacity:1,position:"relative",zIndex:1,border:"1px solid",borderColor:d?s.primaryGreenActive:"transparent",cursor:"pointer",outline:"none","&:hover":{backgroundColor:d?e=>"dark"===e.palette.mode?s.black:s.white:"action.hover",backgroundImage:"none"},"&:focus-visible":{boxShadow:e=>`0 0 0 2px ${e.palette.primary.main}`},mb:.25},children:[o(r,{sx:{fontSize:14,color:d?s.primaryGreenActive:"text.disabled"}}),e(a,{sx:{flex:1,minWidth:0},children:[o(n,{component:"span",sx:{display:"block",fontWeight:500,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:d?"text.primary":"text.secondary"},children:m(p.title,c)}),o(i,{noWrap:!0,sx:{display:"block"},children:x(h)})]}),o(l,{title:g,ariaLabel:g,onClick:e=>{e.stopPropagation(),b&&Promise.resolve(b(p.id))},disabled:!b,children:o(t,{sx:{fontSize:14,color:d?"error.main":"text.disabled"}})})]})};export{p as ChatHistoryButtonBase};
@@ -0,0 +1 @@
1
+ import{jsxs as e,jsx as r}from"react/jsx-runtime";import t from"@mui/icons-material/Add";import i from"@mui/icons-material/Clear";import o from"@mui/icons-material/Search";import{InputAdornment as a}from"@mui/material";import{useState as n,useEffect as l}from"react";import{Box as s}from"../Box.mjs";import{H3 as m}from"../Typography.mjs";import{IconButton as c}from"../IconButton.mjs";import{Stack as d}from"../Stack.mjs";import{TextField as h}from"../TextField.mjs";const p=({title:p,newChatTitle:u,onNewConversation:f,onSearchChange:x,searchPlaceholder:b="Search chat histories",searchDebounceMs:C=300})=>{const[g,w]=n("");return l(()=>{if(!x)return;const e=window.setTimeout(()=>{x(g)},C);return()=>window.clearTimeout(e)},[x,C,g]),e(d,{direction:"column",spacing:1,sx:{px:2,py:2,borderBottom:1,borderColor:"divider"},children:[e(d,{direction:"row",spacing:2,sx:{alignItems:"center",justifyContent:"space-between"},children:[r(m,{children:p}),r(c,{onClick:f,title:u,ariaLabel:u,disabled:!f,children:r(t,{sx:{fontSize:16}})})]}),e(s,{sx:{display:"flex",alignItems:"center",gap:.75},children:[r(h,{fullWidth:!0,size:"small",value:g,onChange:e=>w(e.target.value),placeholder:b,slotProps:{htmlInput:{"aria-label":"Search chat histories"},input:{startAdornment:r(a,{position:"start",children:r(o,{sx:{fontSize:16,color:"text.disabled"}})})}}}),r(c,{title:"Clear search",ariaLabel:"clear-search",onClick:()=>w(""),disabled:!g,children:r(i,{sx:{fontSize:14}})})]})]})};export{p as ChatHistoryHeader};
@@ -0,0 +1 @@
1
+ import{jsx as e,jsxs as t}from"react/jsx-runtime";import{useState as o}from"react";import r from"@mui/icons-material/Send";import{Box as i}from"../Box.mjs";import{IconButton as l}from"../IconButton.mjs";import{Paper as a}from"../Paper.mjs";import{TextField as n}from"../TextField.mjs";import{colours as m}from"../../theme/tokens.mjs";const s=({onSend:s,disabled:d=!1,placeholder:p="Ask about campaigns, competitors, performance…",maxRows:c=5,sendButtonTitle:f="Send message"})=>{const[u,x]=o(""),h=m.jadeLight,b=m.black,g=()=>{const e=u.trim();e&&!d&&(s(e),x(""))};return e(i,{component:"form",onSubmit:e=>{e.preventDefault(),g()},sx:{display:"flex",alignItems:"flex-end",gap:1},children:t(a,{variant:"outlined",sx:{display:"flex",flex:1,alignItems:"flex-end",gap:1,px:1.5,py:.75,borderRadius:2},children:[e(n,{variant:"standard",fullWidth:!0,multiline:!0,maxRows:c,value:u,onChange:e=>x(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),g())},placeholder:p,disabled:d,slotProps:{htmlInput:{"aria-label":p},input:{disableUnderline:!0}},sx:{"& .MuiInputBase-input":{p:0,fontSize:"0.875rem",color:"text.primary",resize:"none","&::placeholder":{color:"text.disabled",opacity:1}}}}),e(l,{type:"submit",title:f,disabled:!u.trim()||d,variant:"filled",size:"small",sx:{flexShrink:0,bgcolor:h,color:b,"&:hover":{bgcolor:m.jade}},children:e(r,{sx:{fontSize:13}})})]})})};export{s as ChatInput};
@@ -0,0 +1 @@
1
+ import{jsx as e,jsxs as o}from"react/jsx-runtime";import t from"@mui/icons-material/CloseFullscreen";import{Dialog as i}from"../Dialog.mjs";import{Box as r}from"../Box.mjs";import{Stack as s}from"../Stack.mjs";import{IconButton as n}from"../IconButton.mjs";import{AiChip as m}from"../AiChip.mjs";import{Caption as l}from"../Typography.mjs";import{AgentChatWindowHeader as a}from"./AgentChatWindowHeader.mjs";import"./ChatComponents/ChatAvatar.mjs";import"react";import"@mui/material";import"../Code.mjs";import"../../theme/tokens.mjs";import"@mui/icons-material/CheckCircle";import"@mui/icons-material/ExpandMore";import"@mui/icons-material/ExpandLess";import"@mui/icons-material/OpenInNew";import"@mui/material/styles";import"@mui/icons-material/StopCircle";import p from"./ChatComponents/SuggestedPrompts.mjs";import c from"./ChatComponents/MessageList.mjs";import d from"./ChatComponents/EmptyState.mjs";import h from"./WidgetParts/WidgetInput.mjs";function u({open:u,onClose:f,title:g="Ask Nexus",subtitle:x="Ready to help",avatarIcon:C,placeholder:b,emptyTitle:v="Ask Nexus",emptyDescription:y="Ask me anything about your data and I'll help you find answers.",dataSources:w,suggestedPrompts:j=[],showAiChip:k=!0,isTyping:S,messages:A,streamingText:I,liveTraceEvents:T,showActivity:E=!1,onSend:z,onAbort:D,background:P,followUpPrompts:W,followUpLabel:B="Suggested follow-ups:"}){const F=A.length>0||S,H=F&&W&&W.length>0;return e(i,{open:u,fullScreen:!0,onClose:f,children:o(r,{sx:{display:"flex",flexDirection:"column",height:"100vh",overflow:"hidden"},children:[e(a,{title:g,subtitle:x,showAiChip:!1,actions:o(s,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[k&&e(m,{}),e(n,{title:"Close full view",size:"small",onClick:f,children:e(t,{sx:{fontSize:16}})})]})}),o(r,{sx:{flex:1,minHeight:0,position:"relative",display:"flex",flexDirection:"column",overflow:"hidden"},children:[P&&e(r,{sx:{position:"absolute",inset:0,zIndex:0,overflow:"hidden",pointerEvents:"none"},children:P}),e(r,{sx:{position:"relative",zIndex:1,flex:1,minHeight:0,overflowY:"auto",background:"rgba(211, 211, 211, 0.2)",backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)"},children:F?e(c,{messages:A,isTyping:S,streamingText:I,liveTraceEvents:T,onAbort:D,avatarIcon:C,showActivity:E}):e(d,{title:v,description:y,dataSources:w,prompts:j.slice(0,4),avatarIcon:C,onSelect:z})})]}),H&&o(r,{sx:{bgcolor:"background.paper",borderTop:"1px solid",borderColor:"divider",px:2,pt:1,pb:.5,flexShrink:0},children:[e(l,{sx:{display:"block",mb:.75},children:B}),e(p,{prompts:W,onSelect:z})]}),e(h,{placeholder:b,isTyping:S,onSend:z})]})})}export{u as NexusChatDialog};
@@ -0,0 +1 @@
1
+ import{jsx as o}from"react/jsx-runtime";import{Box as r}from"../../Box.mjs";import{ChatInput as e}from"../ChatInput.mjs";const d=({placeholder:d,isTyping:p,onSend:i})=>o(r,{sx:{backgroundColor:"background.paper",borderTop:"1px solid",borderColor:"divider",p:1.5,flexShrink:0},children:o(e,{onSend:i,disabled:p,placeholder:d})});export{d as default};
@@ -1 +1 @@
1
- const o="1.13.2";export{o as SAGE_NEXUS_UI_VERSION};
1
+ const o="1.13.4";export{o as SAGE_NEXUS_UI_VERSION};
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { AlertProps, TypographyProps, ContainerProps, GridProps, LinkProps as LinkProps$1, SelectProps as SelectProps$1, SxProps as SxProps$1, SwitchProps, Theme as Theme$1, AccordionSummaryProps, ButtonProps, ChipProps, CardProps as CardProps$1, PaperProps, BoxProps, CollapseProps, ButtonBaseProps, DialogProps, DialogActionsProps, DialogContentProps, DialogContentTextProps, DialogTitleProps, DividerProps, IconButtonProps as IconButtonProps$1, SkeletonProps as SkeletonProps$1, StackProps, TabProps, TabsProps, TextFieldProps, TooltipProps as TooltipProps$1 } from '@mui/material';
2
+ import { AlertProps, BoxProps, TypographyProps, ContainerProps, GridProps, LinkProps as LinkProps$1, SelectProps as SelectProps$1, SxProps as SxProps$1, SwitchProps, Theme as Theme$1, AccordionSummaryProps, ButtonProps, ChipProps, CardProps as CardProps$1, PaperProps, CollapseProps, ButtonBaseProps, DialogProps, DialogActionsProps, DialogContentProps, DialogContentTextProps, DialogTitleProps, DividerProps, IconButtonProps as IconButtonProps$1, SkeletonProps as SkeletonProps$1, StackProps, TabProps, TabsProps, TextFieldProps, TooltipProps as TooltipProps$1 } from '@mui/material';
3
3
  export { AlertProps, AlertTitle, BoxProps, ButtonBaseProps, ChipProps, CollapseProps, ContainerProps, DialogActionsProps, DialogContentProps, DialogContentTextProps, DialogProps, DialogTitleProps, DividerProps, GridProps, MenuItem, PaperProps, StackProps, SwitchProps, TabProps, TabsProps, TextFieldProps, Theme, alpha, useMediaQuery, useTheme } from '@mui/material';
4
4
  import { SxProps, Theme } from '@mui/material/styles';
5
5
  import * as react from 'react';
@@ -59,6 +59,129 @@ declare const DateRangePicker: ({ value, onChange, presets, minDate, maxDate, cl
59
59
  */
60
60
  declare const Alert: (props: AlertProps) => react_jsx_runtime.JSX.Element;
61
61
 
62
+ interface ActivitySummary {
63
+ thinkingSteps: number;
64
+ kbSearches: number;
65
+ toolCalls: number;
66
+ inputTokens: number;
67
+ outputTokens: number;
68
+ }
69
+ interface LatencyMetrics {
70
+ totalMs: number;
71
+ ttftMs: number | null;
72
+ totalSeconds: string;
73
+ ttftSeconds: string | null;
74
+ }
75
+ interface ChatMessage {
76
+ id: string;
77
+ role: "user" | "assistant";
78
+ content: string;
79
+ timestamp: Date;
80
+ sources?: string[];
81
+ isThinking?: boolean;
82
+ /** Trace events attached to a completed assistant message */
83
+ traceEvents?: TraceEvent[];
84
+ /** Activity summary produced after stream completion */
85
+ activitySummary?: ActivitySummary;
86
+ /** Latency metrics attached after stream completion */
87
+ latency?: LatencyMetrics;
88
+ }
89
+ interface ParsedActivity {
90
+ type: "thinking" | "kb" | "tool" | "model";
91
+ title: string;
92
+ text?: string;
93
+ status?: string;
94
+ sources?: {
95
+ source: string;
96
+ relevance: number;
97
+ }[];
98
+ toolName?: string;
99
+ inputTokens?: number;
100
+ outputTokens?: number;
101
+ }
102
+ interface TraceEvent {
103
+ type: "thinking" | "kb" | "tool" | "model";
104
+ step?: number;
105
+ text?: string;
106
+ status?: string;
107
+ query?: string;
108
+ resultsCount?: number;
109
+ sources?: {
110
+ source: string;
111
+ relevance: number;
112
+ }[];
113
+ toolName?: string;
114
+ input?: Record<string, unknown>;
115
+ output?: string;
116
+ inputTokens?: number;
117
+ outputTokens?: number;
118
+ timestamp?: string;
119
+ }
120
+
121
+ interface NexusChatWidgetProps {
122
+ title?: string;
123
+ subtitle?: string;
124
+ fabLabel?: string;
125
+ avatarIcon?: React.ReactNode;
126
+ placeholder?: string;
127
+ emptyTitle?: string;
128
+ emptyDescription?: string;
129
+ dataSources?: string[];
130
+ suggestedPrompts?: string[];
131
+ isOpen: boolean;
132
+ isTyping: boolean;
133
+ messages: ChatMessage[];
134
+ streamingText?: string;
135
+ liveTraceEvents?: TraceEvent[];
136
+ showActivity?: boolean;
137
+ onOpen: () => void;
138
+ onClose: () => void;
139
+ onSend: (message: string) => void;
140
+ onAbort?: () => void;
141
+ onExpandToFullPage?: () => void;
142
+ /** hideFab - Pass true to hide the FAB (e.g. when on the full-page chat route).
143
+ * Consumer computes this: hideFab={pathname === ROUTES.AGENT} */
144
+ hideFab?: boolean;
145
+ /** Anchor corner for the floating widget and FAB. Defaults to 'bottom-right'. */
146
+ placement?: "bottom-right" | "bottom-left";
147
+ }
148
+ declare function NexusChatWidget({ title, subtitle, fabLabel, avatarIcon, placeholder, emptyTitle, emptyDescription, dataSources, suggestedPrompts, isOpen, isTyping, messages, streamingText, liveTraceEvents, showActivity, onOpen, onClose, onSend, onAbort, onExpandToFullPage, hideFab, placement, }: NexusChatWidgetProps): react_jsx_runtime.JSX.Element | null;
149
+
150
+ interface NexusChatDialogProps {
151
+ open: boolean;
152
+ onClose: () => void;
153
+ title?: string;
154
+ subtitle?: string;
155
+ avatarIcon?: React.ReactNode;
156
+ placeholder?: string;
157
+ emptyTitle?: string;
158
+ emptyDescription?: string;
159
+ dataSources?: string[];
160
+ suggestedPrompts?: string[];
161
+ showAiChip?: boolean;
162
+ isTyping: boolean;
163
+ messages: ChatMessage[];
164
+ streamingText?: string;
165
+ liveTraceEvents?: TraceEvent[];
166
+ showActivity?: boolean;
167
+ onSend: (message: string) => void;
168
+ onAbort?: () => void;
169
+ /** Rendered as an absolute-fill layer behind the glass body, e.g. <GreenWaveBackground /> */
170
+ background?: React.ReactNode;
171
+ /** Prompt chips shown in a paper strip directly above the input during an active conversation */
172
+ followUpPrompts?: string[];
173
+ /** Label shown above the follow-up chips. Defaults to "Suggested follow-ups:" */
174
+ followUpLabel?: string;
175
+ }
176
+ declare function NexusChatDialog({ open, onClose, title, subtitle, avatarIcon, placeholder, emptyTitle, emptyDescription, dataSources, suggestedPrompts, showAiChip, isTyping, messages, streamingText, liveTraceEvents, showActivity, onSend, onAbort, background, followUpPrompts, followUpLabel, }: NexusChatDialogProps): react_jsx_runtime.JSX.Element;
177
+
178
+ interface FABButtonProps {
179
+ onOpen: () => void;
180
+ fabLabel: string;
181
+ placement?: "bottom-right" | "bottom-left";
182
+ }
183
+ declare const FABButton: ({ onOpen, fabLabel, placement }: FABButtonProps) => react_jsx_runtime.JSX.Element;
184
+
62
185
  interface AgentChatWindowProps {
63
186
  title?: string;
64
187
  subtitle?: string;
@@ -84,6 +207,139 @@ interface AgentChatWindowHeaderProps {
84
207
  }
85
208
  declare const AgentChatWindowHeader: ({ title, subtitle, showAiChip, actions, sx, }: AgentChatWindowHeaderProps) => react_jsx_runtime.JSX.Element;
86
209
 
210
+ interface ChatInputProps {
211
+ onSend: (message: string) => void;
212
+ disabled?: boolean;
213
+ placeholder?: string;
214
+ maxRows?: number;
215
+ sendButtonTitle?: string;
216
+ }
217
+ declare const ChatInput: ({ onSend, disabled, placeholder, maxRows, sendButtonTitle, }: ChatInputProps) => react_jsx_runtime.JSX.Element;
218
+
219
+ declare const Box: ({ children, ...rest }: BoxProps) => react_jsx_runtime.JSX.Element;
220
+
221
+ interface ChatHistoryConversation {
222
+ id: string;
223
+ title: string;
224
+ messages?: unknown[];
225
+ messageCount?: number;
226
+ }
227
+ interface ChatHistoryProps {
228
+ conversations: ChatHistoryConversation[];
229
+ activeConversationId: string | null;
230
+ onSelectConversation: (id: string) => void;
231
+ onDeleteConversation?: (id: string) => void | Promise<boolean>;
232
+ onNewConversation?: () => void;
233
+ onSearchChange?: (query: string) => void;
234
+ title?: string;
235
+ emptyText?: string;
236
+ newChatTitle?: string;
237
+ deleteConversationTitle?: string;
238
+ searchPlaceholder?: string;
239
+ searchDebounceMs?: number;
240
+ width?: number | string;
241
+ sx?: BoxProps["sx"];
242
+ formatMessageCount?: (count: number) => string;
243
+ }
244
+
245
+ declare const ChatHistory: ({ conversations, activeConversationId, onSelectConversation, onDeleteConversation, onNewConversation, onSearchChange, title, emptyText, newChatTitle, deleteConversationTitle, searchPlaceholder, searchDebounceMs, width, sx, formatMessageCount, }: ChatHistoryProps) => react_jsx_runtime.JSX.Element;
246
+
247
+ interface ChatHistoryHeaderProps {
248
+ title: string;
249
+ newChatTitle: string;
250
+ onNewConversation?: () => void;
251
+ onSearchChange?: (query: string) => void;
252
+ searchPlaceholder?: string;
253
+ searchDebounceMs?: number;
254
+ }
255
+ declare const ChatHistoryHeader: ({ title, newChatTitle, onNewConversation, onSearchChange, searchPlaceholder, searchDebounceMs, }: ChatHistoryHeaderProps) => react_jsx_runtime.JSX.Element;
256
+
257
+ interface ChatHistoryButtonBaseProps {
258
+ conversation: ChatHistoryConversation;
259
+ isActive: boolean;
260
+ highlightQuery?: string;
261
+ onSelectConversation: (id: string) => void;
262
+ onDeleteConversation?: (id: string) => void | Promise<boolean>;
263
+ deleteConversationTitle: string;
264
+ formatMessageCount: (count: number) => string;
265
+ }
266
+ declare const ChatHistoryButtonBase: ({ conversation, isActive, highlightQuery, onSelectConversation, onDeleteConversation, deleteConversationTitle, formatMessageCount, }: ChatHistoryButtonBaseProps) => react_jsx_runtime.JSX.Element;
267
+
268
+ declare const chatHistoryMatchesQuery: (conversation: ChatHistoryConversation, query: string) => boolean;
269
+ declare const filterChatHistoryConversations: <TConversation extends ChatHistoryConversation>(conversations: TConversation[], query: string) => TConversation[];
270
+
271
+ interface ChatAvatarProps {
272
+ size?: "sm" | "md" | "lg";
273
+ icon?: React.ReactNode;
274
+ sx?: object | object[];
275
+ }
276
+ declare const ChatAvatar: ({ size, icon, sx }: ChatAvatarProps) => react_jsx_runtime.JSX.Element;
277
+
278
+ interface MarkdownContentProps {
279
+ content: string;
280
+ highlightQuery?: string;
281
+ }
282
+ declare const MarkdownContent: ({ content, highlightQuery }: MarkdownContentProps) => react_jsx_runtime.JSX.Element;
283
+
284
+ interface MessageBubbleProps {
285
+ message: ChatMessage;
286
+ highlightQuery?: string;
287
+ avatarIcon?: React.ReactNode;
288
+ showActivity?: boolean;
289
+ }
290
+ declare const MessageBubble: ({ message, highlightQuery, avatarIcon, showActivity, }: MessageBubbleProps) => react_jsx_runtime.JSX.Element;
291
+
292
+ interface StreamingBubbleProps {
293
+ text: string;
294
+ traceEvents: TraceEvent[];
295
+ highlightQuery?: string;
296
+ avatarIcon?: React.ReactNode;
297
+ onAbort?: () => void;
298
+ showActivity?: boolean;
299
+ }
300
+ declare const StreamingBubble: ({ text, traceEvents, highlightQuery, avatarIcon, onAbort, showActivity, }: StreamingBubbleProps) => react_jsx_runtime.JSX.Element;
301
+
302
+ interface TypingIndicatorProps {
303
+ traceLabel?: string;
304
+ avatarIcon?: React.ReactNode;
305
+ }
306
+ declare const TypingIndicator: ({ traceLabel, avatarIcon }: TypingIndicatorProps) => react_jsx_runtime.JSX.Element;
307
+
308
+ interface SuggestedPromptsProps {
309
+ prompts: string[];
310
+ onSelect: (prompt: string) => void;
311
+ }
312
+ declare const SuggestedPrompts: ({ prompts, onSelect }: SuggestedPromptsProps) => react_jsx_runtime.JSX.Element;
313
+
314
+ interface MessageListProps {
315
+ messages: ChatMessage[];
316
+ isTyping: boolean;
317
+ streamingText?: string;
318
+ liveTraceEvents?: TraceEvent[];
319
+ highlightQuery?: string;
320
+ onAbort?: () => void;
321
+ avatarIcon?: React.ReactNode;
322
+ showActivity?: boolean;
323
+ }
324
+ declare const MessageList: ({ messages, isTyping, streamingText, liveTraceEvents, highlightQuery, onAbort, avatarIcon, showActivity, }: MessageListProps) => react_jsx_runtime.JSX.Element;
325
+
326
+ interface EmptyStateProps {
327
+ title: string;
328
+ description: string;
329
+ dataSources?: string[];
330
+ prompts: string[];
331
+ avatarIcon?: React.ReactNode;
332
+ onSelect: (prompt: string) => void;
333
+ }
334
+ declare const EmptyState: ({ title, description, dataSources, prompts, avatarIcon, onSelect, }: EmptyStateProps) => react_jsx_runtime.JSX.Element;
335
+
336
+ interface SourceCitationsProps {
337
+ sources: string[];
338
+ }
339
+ declare const SourceCitations: ({ sources }: SourceCitationsProps) => react_jsx_runtime.JSX.Element | null;
340
+
341
+ declare const latestTraceLabel: (events: TraceEvent[]) => string;
342
+
87
343
  type Props$1 = Omit<TypographyProps, "variant" | "component">;
88
344
  /**
89
345
  * Monospace inline code / path snippet.
@@ -275,8 +531,6 @@ declare const GlassPaper: ({ sx, children, ...rest }: GlassPaperProps) => react_
275
531
  type AiGlassPaperProps = GlassPaperProps;
276
532
  declare const AiGlassPaper: ({ sx, children, ...rest }: AiGlassPaperProps) => react_jsx_runtime.JSX.Element;
277
533
 
278
- declare const Box: ({ children, ...rest }: BoxProps) => react_jsx_runtime.JSX.Element;
279
-
280
534
  declare const Collapse: ({ children, ...rest }: CollapseProps) => react_jsx_runtime.JSX.Element;
281
535
 
282
536
  declare const NexusDataGrid: ({ sx, ...rest }: DataGridProps) => react_jsx_runtime.JSX.Element;
@@ -294,65 +548,6 @@ interface CheckboxGroupProps {
294
548
  }
295
549
  declare const CheckboxGroup: React.FC<CheckboxGroupProps>;
296
550
 
297
- interface ChatInputProps {
298
- onSend: (message: string) => void;
299
- disabled?: boolean;
300
- placeholder?: string;
301
- maxRows?: number;
302
- sendButtonTitle?: string;
303
- }
304
- declare const ChatInput: ({ onSend, disabled, placeholder, maxRows, sendButtonTitle, }: ChatInputProps) => react_jsx_runtime.JSX.Element;
305
-
306
- interface ChatHistoryConversation {
307
- id: string;
308
- title: string;
309
- messages?: unknown[];
310
- messageCount?: number;
311
- }
312
- interface ChatHistoryProps {
313
- conversations: ChatHistoryConversation[];
314
- activeConversationId: string | null;
315
- onSelectConversation: (id: string) => void;
316
- onDeleteConversation?: (id: string) => void | Promise<boolean>;
317
- onNewConversation?: () => void;
318
- onSearchChange?: (query: string) => void;
319
- title?: string;
320
- emptyText?: string;
321
- newChatTitle?: string;
322
- deleteConversationTitle?: string;
323
- searchPlaceholder?: string;
324
- searchDebounceMs?: number;
325
- width?: number | string;
326
- sx?: BoxProps["sx"];
327
- formatMessageCount?: (count: number) => string;
328
- }
329
-
330
- declare const ChatHistory: ({ conversations, activeConversationId, onSelectConversation, onDeleteConversation, onNewConversation, onSearchChange, title, emptyText, newChatTitle, deleteConversationTitle, searchPlaceholder, searchDebounceMs, width, sx, formatMessageCount, }: ChatHistoryProps) => react_jsx_runtime.JSX.Element;
331
-
332
- interface ChatHistoryHeaderProps {
333
- title: string;
334
- newChatTitle: string;
335
- onNewConversation?: () => void;
336
- onSearchChange?: (query: string) => void;
337
- searchPlaceholder?: string;
338
- searchDebounceMs?: number;
339
- }
340
- declare const ChatHistoryHeader: ({ title, newChatTitle, onNewConversation, onSearchChange, searchPlaceholder, searchDebounceMs, }: ChatHistoryHeaderProps) => react_jsx_runtime.JSX.Element;
341
-
342
- interface ChatHistoryButtonBaseProps {
343
- conversation: ChatHistoryConversation;
344
- isActive: boolean;
345
- highlightQuery?: string;
346
- onSelectConversation: (id: string) => void;
347
- onDeleteConversation?: (id: string) => void | Promise<boolean>;
348
- deleteConversationTitle: string;
349
- formatMessageCount: (count: number) => string;
350
- }
351
- declare const ChatHistoryButtonBase: ({ conversation, isActive, highlightQuery, onSelectConversation, onDeleteConversation, deleteConversationTitle, formatMessageCount, }: ChatHistoryButtonBaseProps) => react_jsx_runtime.JSX.Element;
352
-
353
- declare const chatHistoryMatchesQuery: (conversation: ChatHistoryConversation, query: string) => boolean;
354
- declare const filterChatHistoryConversations: <TConversation extends ChatHistoryConversation>(conversations: TConversation[], query: string) => TConversation[];
355
-
356
551
  declare const Chip: (props: ChipProps) => react_jsx_runtime.JSX.Element;
357
552
 
358
553
  declare const Dialog: (props: DialogProps) => react_jsx_runtime.JSX.Element;
@@ -681,120 +876,6 @@ declare function NexusLineChart({ sx, xAxis, grid, series, slots, slotProps, chi
681
876
  type NexusBarChartProps = Omit<BarChartProps, "colors">;
682
877
  declare function NexusBarChart({ slotProps, ...props }: NexusBarChartProps): react_jsx_runtime.JSX.Element;
683
878
 
684
- interface ActivitySummary {
685
- thinkingSteps: number;
686
- kbSearches: number;
687
- toolCalls: number;
688
- inputTokens: number;
689
- outputTokens: number;
690
- }
691
- interface LatencyMetrics {
692
- totalMs: number;
693
- ttftMs: number | null;
694
- totalSeconds: string;
695
- ttftSeconds: string | null;
696
- }
697
- interface ChatMessage {
698
- id: string;
699
- role: "user" | "assistant";
700
- content: string;
701
- timestamp: Date;
702
- sources?: string[];
703
- isThinking?: boolean;
704
- /** Trace events attached to a completed assistant message */
705
- traceEvents?: TraceEvent[];
706
- /** Activity summary produced after stream completion */
707
- activitySummary?: ActivitySummary;
708
- /** Latency metrics attached after stream completion */
709
- latency?: LatencyMetrics;
710
- }
711
- interface TraceEvent {
712
- type: "thinking" | "kb" | "tool" | "model";
713
- step?: number;
714
- text?: string;
715
- status?: string;
716
- query?: string;
717
- resultsCount?: number;
718
- sources?: {
719
- source: string;
720
- relevance: number;
721
- }[];
722
- toolName?: string;
723
- input?: Record<string, unknown>;
724
- output?: string;
725
- inputTokens?: number;
726
- outputTokens?: number;
727
- timestamp?: string;
728
- }
729
-
730
- interface NexusChatWidgetProps {
731
- title?: string;
732
- subtitle?: string;
733
- fabLabel?: string;
734
- avatarIcon?: React.ReactNode;
735
- placeholder?: string;
736
- emptyTitle?: string;
737
- emptyDescription?: string;
738
- dataSources?: string[];
739
- suggestedPrompts?: string[];
740
- isOpen: boolean;
741
- isTyping: boolean;
742
- messages: ChatMessage[];
743
- streamingText?: string;
744
- liveTraceEvents?: TraceEvent[];
745
- showActivity?: boolean;
746
- onOpen: () => void;
747
- onClose: () => void;
748
- onSend: (message: string) => void;
749
- onAbort?: () => void;
750
- onExpandToFullPage?: () => void;
751
- /** hideFab - Pass true to hide the FAB (e.g. when on the full-page chat route).
752
- * Consumer computes this: hideFab={pathname === ROUTES.AGENT} */
753
- hideFab?: boolean;
754
- /** Anchor corner for the floating widget and FAB. Defaults to 'bottom-right'. */
755
- placement?: "bottom-right" | "bottom-left";
756
- }
757
- declare function NexusChatWidget({ title, subtitle, fabLabel, avatarIcon, placeholder, emptyTitle, emptyDescription, dataSources, suggestedPrompts, isOpen, isTyping, messages, streamingText, liveTraceEvents, showActivity, onOpen, onClose, onSend, onAbort, onExpandToFullPage, hideFab, placement, }: NexusChatWidgetProps): react_jsx_runtime.JSX.Element | null;
758
-
759
- interface MarkdownContentProps {
760
- content: string;
761
- highlightQuery?: string;
762
- }
763
- declare const MarkdownContent: ({ content, highlightQuery }: MarkdownContentProps) => react_jsx_runtime.JSX.Element;
764
-
765
- interface SuggestedPromptsProps {
766
- prompts: string[];
767
- onSelect: (prompt: string) => void;
768
- }
769
- declare const SuggestedPrompts: ({ prompts, onSelect }: SuggestedPromptsProps) => react_jsx_runtime.JSX.Element;
770
-
771
- interface MessageListProps {
772
- messages: ChatMessage[];
773
- isTyping: boolean;
774
- streamingText?: string;
775
- liveTraceEvents?: TraceEvent[];
776
- highlightQuery?: string;
777
- onAbort?: () => void;
778
- avatarIcon?: React.ReactNode;
779
- showActivity?: boolean;
780
- }
781
- declare const MessageList: ({ messages, isTyping, streamingText, liveTraceEvents, highlightQuery, onAbort, avatarIcon, showActivity, }: MessageListProps) => react_jsx_runtime.JSX.Element;
782
-
783
- interface EmptyStateProps {
784
- title: string;
785
- description: string;
786
- dataSources?: string[];
787
- prompts: string[];
788
- avatarIcon?: React.ReactNode;
789
- onSelect: (prompt: string) => void;
790
- }
791
- declare const EmptyState: ({ title, description, dataSources, prompts, avatarIcon, onSelect, }: EmptyStateProps) => react_jsx_runtime.JSX.Element;
792
-
793
- interface SourceCitationsProps {
794
- sources: string[];
795
- }
796
- declare const SourceCitations: ({ sources }: SourceCitationsProps) => react_jsx_runtime.JSX.Element | null;
797
-
798
879
  declare const getFaviconUrls: (versioned?: boolean) => {
799
880
  svg: string;
800
881
  ico: string;
@@ -923,5 +1004,5 @@ declare const getGradientBorderStyles: (theme: Theme, options?: GradientBorderOp
923
1004
  declare const leftPipe: SxProps<Theme>;
924
1005
  declare const expandableText: (isExpanded: boolean) => SxProps<Theme>;
925
1006
 
926
- export { AccordionGroup, AccordionGroupItem, AccordionSingle, ActionBar, ActionBarTitle, AgentChatWindow, AgentChatWindowHeader, AiButton, AiCard, AiChip, AiGlassCard, AiGlassPaper, AiPaper, Alert, Avatar, Body1, Body2, Box, ButtonBase, Caption, Card, ChatHistory, ChatHistoryButtonBase, ChatHistoryHeader, ChatInput, CheckboxGroup, Chip, Code, Collapse, Container, DateRangeFilter, DateRangePicker, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle, Divider, EmptyState, FaviconLinks, GlassCard, GlassPaper, GlassPaperAsync, GreenWaveBackground, Grid, H1, H2, H3, H4, IconButton, Link, LoadingSpinnerNexus, LocationMultiSelect, LogoOptions, MarkdownContent, MessageList, MuiAppThemeProvider, NexusBarChart, NexusChatWidget, NexusDataGrid, NexusHome, NexusLineChart, NexusLogo, Paper, PaperAsync, PrimaryButton, PrimaryButtonLink, RagChip, RagDot, SearchInput, SecondaryButton, SecondaryButtonLink, Select, SideBlade, SideBladeNavList, SideBladeNavListItem, Skeleton, SkillChip, SkipLink, SourceCitations, Stack, StatusBadge, StatusChip, SuggestedPrompts, Switch, Tab, Tabs, TextField, ThemeModeContext, ThemeModeProvider, ThemeToggle, Tooltip, chatHistoryMatchesQuery, colours, createSageTheme, expandableText, filterChatHistoryConversations, fontSageHeadline, fontSageText, fontSageUI, formatDate, getFaviconUrls, getFiscalPeriod, getGradientBorderStyles, getModeTokens, gradients, leftPipe, useThemeMode, useTokens };
927
- export type { AccordionGroupItemProps, AccordionGroupProps, AccordionSingleProps, AgentChatWindowHeaderProps, AgentChatWindowProps, AiButtonProps, AiCardProps, AiChipProps, AiGlassCardProps, AiGlassPaperProps, AiPaperProps, AvatarProps, AvatarSize, AvatarVariant, CardProps, CardTrend, ChatHistoryButtonBaseProps, ChatHistoryConversation, ChatHistoryHeaderProps, ChatHistoryProps, ChatInputProps, ChatMessage, DateRangeFilterProps, DateRangePickerProps, DateRangePreset, DateRangeValue, GlassCardProps, GlassPaperAsyncProps, GlassPaperProps, GradientBorderOptions, GreenWaveBackgroundProps, IconButtonProps, IconButtonVariant, LinkProps, LoadingSpinnerNexusProps, ModeTokens, NexusBarChartProps, NexusChatWidgetProps, NexusLineChartProps, PaperAsyncProps, PrimaryButtonLinkProps, PrimaryButtonProps, SecondaryButtonLinkProps, SecondaryButtonProps, SelectOption, SelectProps, SideBladeNavItem, SideBladeNavListItemProps, SideBladeNavListProps, SideBladeProps, SkeletonProps, SkipLinkProps, StatusBadgeProps, StatusBadgeVariant, ThemeMode, TooltipProps, TraceEvent };
1007
+ export { AccordionGroup, AccordionGroupItem, AccordionSingle, ActionBar, ActionBarTitle, AgentChatWindow, AgentChatWindowHeader, AiButton, AiCard, AiChip, AiGlassCard, AiGlassPaper, AiPaper, Alert, Avatar, Body1, Body2, Box, ButtonBase, Caption, Card, ChatAvatar, ChatHistory, ChatHistoryButtonBase, ChatHistoryHeader, ChatInput, CheckboxGroup, Chip, Code, Collapse, Container, DateRangeFilter, DateRangePicker, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle, Divider, EmptyState, FABButton, FaviconLinks, GlassCard, GlassPaper, GlassPaperAsync, GreenWaveBackground, Grid, H1, H2, H3, H4, IconButton, Link, LoadingSpinnerNexus, LocationMultiSelect, LogoOptions, MarkdownContent, MessageBubble, MessageList, MuiAppThemeProvider, NexusBarChart, NexusChatDialog, NexusChatWidget, NexusDataGrid, NexusHome, NexusLineChart, NexusLogo, Paper, PaperAsync, PrimaryButton, PrimaryButtonLink, RagChip, RagDot, SearchInput, SecondaryButton, SecondaryButtonLink, Select, SideBlade, SideBladeNavList, SideBladeNavListItem, Skeleton, SkillChip, SkipLink, SourceCitations, Stack, StatusBadge, StatusChip, StreamingBubble, SuggestedPrompts, Switch, Tab, Tabs, TextField, ThemeModeContext, ThemeModeProvider, ThemeToggle, Tooltip, TypingIndicator, chatHistoryMatchesQuery, colours, createSageTheme, expandableText, filterChatHistoryConversations, fontSageHeadline, fontSageText, fontSageUI, formatDate, getFaviconUrls, getFiscalPeriod, getGradientBorderStyles, getModeTokens, gradients, latestTraceLabel, leftPipe, useThemeMode, useTokens };
1008
+ export type { AccordionGroupItemProps, AccordionGroupProps, AccordionSingleProps, ActivitySummary, AgentChatWindowHeaderProps, AgentChatWindowProps, AiButtonProps, AiCardProps, AiChipProps, AiGlassCardProps, AiGlassPaperProps, AiPaperProps, AvatarProps, AvatarSize, AvatarVariant, CardProps, CardTrend, ChatAvatarProps, ChatHistoryButtonBaseProps, ChatHistoryConversation, ChatHistoryHeaderProps, ChatHistoryProps, ChatInputProps, ChatMessage, DateRangeFilterProps, DateRangePickerProps, DateRangePreset, DateRangeValue, EmptyStateProps, FABButtonProps, GlassCardProps, GlassPaperAsyncProps, GlassPaperProps, GradientBorderOptions, GreenWaveBackgroundProps, IconButtonProps, IconButtonVariant, LatencyMetrics, LinkProps, LoadingSpinnerNexusProps, MarkdownContentProps, MessageBubbleProps, MessageListProps, ModeTokens, NexusBarChartProps, NexusChatDialogProps, NexusChatWidgetProps, NexusLineChartProps, PaperAsyncProps, ParsedActivity, PrimaryButtonLinkProps, PrimaryButtonProps, SecondaryButtonLinkProps, SecondaryButtonProps, SelectOption, SelectProps, SideBladeNavItem, SideBladeNavListItemProps, SideBladeNavListProps, SideBladeProps, SkeletonProps, SkipLinkProps, SourceCitationsProps, StatusBadgeProps, StatusBadgeVariant, StreamingBubbleProps, SuggestedPromptsProps, ThemeMode, TooltipProps, TraceEvent, TypingIndicatorProps };
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- export{formatDate,getFiscalPeriod}from"./components/DateFormats.mjs";export{DateRangeFilter}from"./components/DateRangeFilter.mjs";export{DateRangePicker}from"./components/DateRangePicker.mjs";export{Alert}from"./components/Alert.mjs";export{AgentChatWindow}from"./components/AgentChatWindow.mjs";export{AgentChatWindowHeader}from"./components/AgentChatWindowHeader.mjs";export{Code}from"./components/Code.mjs";export{Container}from"./components/Container.mjs";export{Grid}from"./components/Grid.mjs";export{Link}from"./components/Link.mjs";export{Select}from"./components/Select.mjs";export{SkipLink}from"./components/SkipLink.mjs";export{StatusBadge}from"./components/StatusBadge.mjs";export{Switch}from"./components/Switch.mjs";export{ActionBarTitle,Body1,Body2,Caption,H1,H2,H3,H4}from"./components/Typography.mjs";export{ActionBar}from"./components/ActionBar.mjs";export{AccordionGroup,AccordionGroupItem}from"./components/AccordionGroup.mjs";export{AccordionSingle}from"./components/AccordionSingle.mjs";export{AiButton}from"./components/AiButton.mjs";export{AiChip}from"./components/AiChip.mjs";export{AiCard}from"./components/AiCard.mjs";export{AiGlassCard}from"./components/AiGlassCard.mjs";export{AiPaper}from"./components/AiPaper.mjs";export{AiGlassPaper}from"./components/AiGlassPaper.mjs";export{Box}from"./components/Box.mjs";export{Collapse}from"./components/Collapse.mjs";export{NexusDataGrid}from"./components/NexusDataGrid.mjs";export{ButtonBase}from"./components/ButtonBase.mjs";export{Card}from"./components/Card.mjs";export{CheckboxGroup}from"./components/CheckboxGroup.mjs";export{ChatInput}from"./components/ChatInput.mjs";export{ChatHistory}from"./components/ChatHistory.mjs";export{ChatHistoryHeader}from"./components/ChatHistoryHeader.mjs";export{ChatHistoryButtonBase}from"./components/ChatHistoryButtonBase.mjs";export{chatHistoryMatchesQuery,filterChatHistoryConversations}from"./components/ChatHistorySearch.mjs";export{Chip}from"./components/Chip.mjs";export{Dialog,DialogActions,DialogContent,DialogContentText,DialogTitle}from"./components/Dialog.mjs";export{Divider}from"./components/Divider.mjs";export{GlassCard}from"./components/GlassCard.mjs";export{GlassPaper}from"./components/GlassPaper.mjs";export{GlassPaperAsync}from"./components/GlassPaperAsync.mjs";export{PaperAsync}from"./components/PaperAsync.mjs";export{GreenWaveBackground}from"./components/GreenWaveBackground.mjs";export{IconButton}from"./components/IconButton.mjs";export{Avatar}from"./components/Avatar.mjs";export{LoadingSpinnerNexus}from"./components/LoadingSpinnerNexus.mjs";export{LocationMultiSelect}from"./components/LocationMultiSelect.mjs";export{LogoOptions}from"./components/LogoOptions/index.mjs";export{NexusHome}from"./components/NexusHome.mjs";export{default as NexusLogo}from"./components/NexusLogo.mjs";export{Paper}from"./components/Paper.mjs";export{PrimaryButton}from"./components/PrimaryButton.mjs";export{PrimaryButtonLink}from"./components/PrimaryButtonLink.mjs";export{SecondaryButton}from"./components/SecondaryButton.mjs";export{RagDot}from"./components/RagDot.mjs";export{RagChip}from"./components/RagChip.mjs";export{SecondaryButtonLink}from"./components/SecondaryButtonLink.mjs";export{SearchInput}from"./components/SearchInput.mjs";export{SideBlade}from"./components/SideBlade.mjs";export{SideBladeNavList}from"./components/SideBladeNavList.mjs";export{SideBladeNavListItem}from"./components/SideBladeNavListItem.mjs";export{Skeleton}from"./components/Skeleton.mjs";export{SkillChip}from"./components/SkillChip.mjs";export{Stack}from"./components/Stack.mjs";export{StatusChip}from"./components/StatusChip.mjs";export{Tab}from"./components/Tab.mjs";export{Tabs}from"./components/Tabs.mjs";export{TextField}from"./components/TextField.mjs";export{ThemeToggle}from"./components/ThemeToggle.mjs";export{Tooltip}from"./components/Tooltip.mjs";export{NexusLineChart}from"./components/NexusLineChart.mjs";export{NexusBarChart}from"./components/NexusBarChart.mjs";export{NexusChatWidget}from"./components/NexusChatWidget/NexusChatWidget.mjs";import"react/jsx-runtime";import"./components/NexusChatWidget/ChatComponents/ChatAvatar.mjs";export{default as MarkdownContent}from"./components/NexusChatWidget/ChatComponents/MarkdownContent.mjs";import"react";export{colours,fontSageHeadline,fontSageText,fontSageUI,getModeTokens,gradients}from"./theme/tokens.mjs";import"@mui/icons-material/CheckCircle";import"@mui/icons-material/ExpandMore";import"@mui/icons-material/ExpandLess";import"@mui/icons-material/OpenInNew";import"@mui/icons-material/StopCircle";import"@mui/material/styles";export{default as SuggestedPrompts}from"./components/NexusChatWidget/ChatComponents/SuggestedPrompts.mjs";export{default as MessageList}from"./components/NexusChatWidget/ChatComponents/MessageList.mjs";export{default as EmptyState}from"./components/NexusChatWidget/ChatComponents/EmptyState.mjs";export{default as SourceCitations}from"./components/NexusChatWidget/ChatComponents/SourceCitations.mjs";export{default as nexusLogoNode}from"./assets/images/nexus-logo-node.svg.mjs";export{default as nexusLogoFavicon}from"./assets/images/nexus-logo-favicon.svg.mjs";export{default as nexusLogoIco}from"./assets/images/favicon.ico.mjs";export{getFaviconUrls}from"./assets/images/urls.mjs";export{FaviconLinks}from"./components/FaviconLinks.mjs";export{createSageTheme}from"./theme/sageTheme.mjs";export{useTokens}from"./theme/useTokens.mjs";export{default as MuiAppThemeProvider}from"./theme/MuiAppThemeProvider.mjs";export{ThemeModeContext,ThemeModeProvider,useThemeMode}from"./theme/ThemeContext.mjs";export{AlertTitle,MenuItem,alpha,useMediaQuery,useTheme}from"@mui/material";export{expandableText,getGradientBorderStyles,leftPipe}from"./theme/sxHelpers.mjs";
1
+ export{formatDate,getFiscalPeriod}from"./components/DateFormats.mjs";export{DateRangeFilter}from"./components/DateRangeFilter.mjs";export{DateRangePicker}from"./components/DateRangePicker.mjs";export{Alert}from"./components/Alert.mjs";export{NexusChatWidget}from"./components/NexusChat/NexusChatWidget.mjs";export{NexusChatDialog}from"./components/NexusChat/NexusChatDialog.mjs";export{FABButton}from"./components/NexusChat/FABButton.mjs";export{AgentChatWindow}from"./components/NexusChat/AgentChatWindow.mjs";export{AgentChatWindowHeader}from"./components/NexusChat/AgentChatWindowHeader.mjs";export{ChatInput}from"./components/NexusChat/ChatInput.mjs";export{ChatHistory}from"./components/NexusChat/ChatHistory.mjs";export{ChatHistoryHeader}from"./components/NexusChat/ChatHistoryHeader.mjs";export{ChatHistoryButtonBase}from"./components/NexusChat/ChatHistoryButtonBase.mjs";export{chatHistoryMatchesQuery,filterChatHistoryConversations}from"./components/NexusChat/ChatHistorySearch.mjs";export{default as ChatAvatar}from"./components/NexusChat/ChatComponents/ChatAvatar.mjs";export{default as MarkdownContent}from"./components/NexusChat/ChatComponents/MarkdownContent.mjs";export{default as MessageBubble}from"./components/NexusChat/ChatComponents/MessageBubble.mjs";export{default as StreamingBubble}from"./components/NexusChat/ChatComponents/StreamingBubble.mjs";export{default as TypingIndicator}from"./components/NexusChat/ChatComponents/TypingIndicator.mjs";export{default as SuggestedPrompts}from"./components/NexusChat/ChatComponents/SuggestedPrompts.mjs";export{default as MessageList}from"./components/NexusChat/ChatComponents/MessageList.mjs";export{default as EmptyState}from"./components/NexusChat/ChatComponents/EmptyState.mjs";export{default as SourceCitations}from"./components/NexusChat/ChatComponents/SourceCitations.mjs";export{latestTraceLabel}from"./components/NexusChat/ChatComponents/latestTraceLabel.mjs";export{Code}from"./components/Code.mjs";export{Container}from"./components/Container.mjs";export{Grid}from"./components/Grid.mjs";export{Link}from"./components/Link.mjs";export{Select}from"./components/Select.mjs";export{SkipLink}from"./components/SkipLink.mjs";export{StatusBadge}from"./components/StatusBadge.mjs";export{Switch}from"./components/Switch.mjs";export{ActionBarTitle,Body1,Body2,Caption,H1,H2,H3,H4}from"./components/Typography.mjs";export{ActionBar}from"./components/ActionBar.mjs";export{AccordionGroup,AccordionGroupItem}from"./components/AccordionGroup.mjs";export{AccordionSingle}from"./components/AccordionSingle.mjs";export{AiButton}from"./components/AiButton.mjs";export{AiChip}from"./components/AiChip.mjs";export{AiCard}from"./components/AiCard.mjs";export{AiGlassCard}from"./components/AiGlassCard.mjs";export{AiPaper}from"./components/AiPaper.mjs";export{AiGlassPaper}from"./components/AiGlassPaper.mjs";export{Box}from"./components/Box.mjs";export{Collapse}from"./components/Collapse.mjs";export{NexusDataGrid}from"./components/NexusDataGrid.mjs";export{ButtonBase}from"./components/ButtonBase.mjs";export{Card}from"./components/Card.mjs";export{CheckboxGroup}from"./components/CheckboxGroup.mjs";export{Chip}from"./components/Chip.mjs";export{Dialog,DialogActions,DialogContent,DialogContentText,DialogTitle}from"./components/Dialog.mjs";export{Divider}from"./components/Divider.mjs";export{GlassCard}from"./components/GlassCard.mjs";export{GlassPaper}from"./components/GlassPaper.mjs";export{GlassPaperAsync}from"./components/GlassPaperAsync.mjs";export{PaperAsync}from"./components/PaperAsync.mjs";export{GreenWaveBackground}from"./components/GreenWaveBackground.mjs";export{IconButton}from"./components/IconButton.mjs";export{Avatar}from"./components/Avatar.mjs";export{LoadingSpinnerNexus}from"./components/LoadingSpinnerNexus.mjs";export{LocationMultiSelect}from"./components/LocationMultiSelect.mjs";export{LogoOptions}from"./components/LogoOptions/index.mjs";export{NexusHome}from"./components/NexusHome.mjs";export{default as NexusLogo}from"./components/NexusLogo.mjs";export{Paper}from"./components/Paper.mjs";export{PrimaryButton}from"./components/PrimaryButton.mjs";export{PrimaryButtonLink}from"./components/PrimaryButtonLink.mjs";export{SecondaryButton}from"./components/SecondaryButton.mjs";export{RagDot}from"./components/RagDot.mjs";export{RagChip}from"./components/RagChip.mjs";export{SecondaryButtonLink}from"./components/SecondaryButtonLink.mjs";export{SearchInput}from"./components/SearchInput.mjs";export{SideBlade}from"./components/SideBlade.mjs";export{SideBladeNavList}from"./components/SideBladeNavList.mjs";export{SideBladeNavListItem}from"./components/SideBladeNavListItem.mjs";export{Skeleton}from"./components/Skeleton.mjs";export{SkillChip}from"./components/SkillChip.mjs";export{Stack}from"./components/Stack.mjs";export{StatusChip}from"./components/StatusChip.mjs";export{Tab}from"./components/Tab.mjs";export{Tabs}from"./components/Tabs.mjs";export{TextField}from"./components/TextField.mjs";export{ThemeToggle}from"./components/ThemeToggle.mjs";export{Tooltip}from"./components/Tooltip.mjs";export{NexusLineChart}from"./components/NexusLineChart.mjs";export{NexusBarChart}from"./components/NexusBarChart.mjs";export{default as nexusLogoNode}from"./assets/images/nexus-logo-node.svg.mjs";export{default as nexusLogoFavicon}from"./assets/images/nexus-logo-favicon.svg.mjs";export{default as nexusLogoIco}from"./assets/images/favicon.ico.mjs";export{getFaviconUrls}from"./assets/images/urls.mjs";export{FaviconLinks}from"./components/FaviconLinks.mjs";export{createSageTheme}from"./theme/sageTheme.mjs";export{colours,fontSageHeadline,fontSageText,fontSageUI,getModeTokens,gradients}from"./theme/tokens.mjs";export{useTokens}from"./theme/useTokens.mjs";export{default as MuiAppThemeProvider}from"./theme/MuiAppThemeProvider.mjs";export{ThemeModeContext,ThemeModeProvider,useThemeMode}from"./theme/ThemeContext.mjs";export{AlertTitle,MenuItem,alpha,useMediaQuery,useTheme}from"@mui/material";export{expandableText,getGradientBorderStyles,leftPipe}from"./theme/sxHelpers.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sage-nexus-ui",
3
- "version": "1.13.2",
3
+ "version": "1.13.4",
4
4
  "description": "Nexus core components",
5
5
  "license": "ISC",
6
6
  "author": "emsmart-sage",
@@ -1 +0,0 @@
1
- import{jsxs as i,jsx as e}from"react/jsx-runtime";import{Box as o}from"./Box.mjs";import{Stack as t}from"./Stack.mjs";import{Caption as r}from"./Typography.mjs";import{GlassPaper as m}from"./GlassPaper.mjs";import{Paper as n}from"./Paper.mjs";import{ChatInput as s}from"./ChatInput.mjs";import"./AiButton.mjs";import"./NexusChatWidget/ChatComponents/ChatAvatar.mjs";import"react";import"./Code.mjs";import"@mui/material";import"../theme/tokens.mjs";import"@mui/icons-material/CheckCircle";import"@mui/icons-material/ExpandMore";import"@mui/icons-material/ExpandLess";import"@mui/icons-material/OpenInNew";import"@mui/material/styles";import"@mui/icons-material/StopCircle";import l from"./NexusChatWidget/ChatComponents/SuggestedPrompts.mjs";import"@mui/icons-material/ArrowDropDown";import"@mui/icons-material/OpenInFull";import{AgentChatWindowHeader as a}from"./AgentChatWindowHeader.mjs";const p=({title:p="Spike AI Chat",subtitle:c="Your intelligent marketing assistant",showAiChip:d=!0,headerActions:h,body:u,followUpLabel:x="Suggested follow-ups:",followUpPrompts:f,onSelectFollowUp:C,onSend:g,inputDisabled:j=!1,inputPlaceholder:b="Ask Spike anything...",sx:w})=>{const y=Boolean(f&&f.length>0&&C);return i(o,{sx:[{display:"flex",flex:1,flexDirection:"column",minWidth:0,minHeight:0,height:"100%"},...Array.isArray(w)?w:w?[w]:[]],children:[e(a,{title:p,subtitle:c,showAiChip:d,actions:h}),e(m,{sx:{borderRadius:0,border:"none",flex:1,display:"flex",flexDirection:"column",overflowY:"scroll"},children:u}),y&&i(t,{direction:{xs:"column",md:"row"},spacing:1,sx:{px:2,py:1,justifyContent:{xs:"center",sm:"flex-end"},alignItems:"center"},children:[e(r,{sx:{display:"block",mb:1},children:x}),e(l,{prompts:f??[],onSelect:C})]}),e(n,{sx:{borderRadius:0,border:"none"},children:e(o,{sx:{p:2,flexShrink:0},children:e(s,{onSend:g,disabled:j,placeholder:b})})})]})};export{p as AgentChatWindow};
@@ -1 +0,0 @@
1
- import{jsx as i,jsxs as r}from"react/jsx-runtime";import{Box as t}from"./Box.mjs";import{Stack as e}from"./Stack.mjs";import{AiChip as n}from"./AiChip.mjs";import{H2 as s,Caption as o}from"./Typography.mjs";const m=({title:m="Spike AI Chat",subtitle:c="Your intelligent marketing assistant",showAiChip:a=!0,actions:p,sx:l})=>{const h=i(e,{direction:"row",spacing:1,sx:{alignItems:"center"},children:a&&i(n,{})});return r(e,{direction:{xs:"column",sm:"row"},spacing:2,sx:[{alignItems:"center",justifyContent:"space-between",p:1,flexShrink:0},...Array.isArray(l)?l:l?[l]:[]],children:[r(t,{children:[i(s,{children:m}),i(o,{children:c})]}),p??h]})};export{m as AgentChatWindowHeader};
@@ -1 +0,0 @@
1
- import{jsxs as e,jsx as o}from"react/jsx-runtime";import{useState as t,useCallback as r}from"react";import{Caption as n}from"./Typography.mjs";import{Box as i}from"./Box.mjs";import{Stack as a}from"./Stack.mjs";import{ChatHistoryHeader as s}from"./ChatHistoryHeader.mjs";import{ChatHistoryButtonBase as c}from"./ChatHistoryButtonBase.mjs";const h=({conversations:h,activeConversationId:l,onSelectConversation:m,onDeleteConversation:d,onNewConversation:C,onSearchChange:v,title:p="Chat history",emptyText:y="No conversations yet",newChatTitle:f="New chat",deleteConversationTitle:g="Delete conversation",searchPlaceholder:u="Search chat histories",searchDebounceMs:x=300,width:w=288,sx:b,formatMessageCount:j=e=>`${e} messages`})=>{const[S,T]=t(""),D=r(e=>{T(e),v?.(e)},[v]);return e(a,{direction:"column",sx:[{width:w,borderRight:1,borderColor:"divider",minWidth:0},...Array.isArray(b)?b:b?[b]:[]],children:[o(s,{title:p,newChatTitle:f,onNewConversation:C,onSearchChange:D,searchPlaceholder:u,searchDebounceMs:x}),o(i,{component:"nav","aria-label":p,sx:{flex:1,overflowY:"auto",p:1},children:0===h.length?o(n,{sx:{display:"block",textAlign:"center",py:4},children:y}):h.map(e=>{const t=e.id===l;return o(c,{conversation:e,isActive:t,highlightQuery:S,onSelectConversation:m,onDeleteConversation:d,deleteConversationTitle:g,formatMessageCount:j},e.id)})})]})};export{h as ChatHistory};
@@ -1 +0,0 @@
1
- import{jsxs as e,jsx as o}from"react/jsx-runtime";import r from"@mui/icons-material/ChatBubbleOutlined";import t from"@mui/icons-material/DeleteForeverOutlined";import{Body1 as n,Caption as i}from"./Typography.mjs";import{Box as a}from"./Box.mjs";import{IconButton as l}from"./IconButton.mjs";import{colours as s}from"../theme/tokens.mjs";const m=(e,r)=>{const t=r?.trim();if(!t)return e;const n=new RegExp(`(${(e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"))(t)})`,"ig");return e.split(n).map((e,r)=>{if(!e)return null;return e.toLowerCase()===t.toLowerCase()?o(a,{component:"mark",sx:{backgroundColor:e=>"dark"===e.palette.mode?"rgba(255, 214, 10, 0.35)":"rgba(255, 214, 10, 0.45)",color:"inherit",borderRadius:.5,px:.25,py:0},children:e},`${e}-${r}`):e})},p=({conversation:p,isActive:d,highlightQuery:c,onSelectConversation:u,onDeleteConversation:b,deleteConversationTitle:g,formatMessageCount:x})=>{const h=(e=>"number"==typeof e.messageCount?e.messageCount:Array.isArray(e.messages)?e.messages.length:0)(p);return e(a,{component:"div",role:"button",tabIndex:0,onClick:()=>u(p.id),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),u(p.id))},sx:{width:"100%",display:"flex",alignItems:"center",gap:1.25,borderRadius:1,px:1.5,py:1.25,textAlign:"left",backgroundColor:d?e=>"dark"===e.palette.mode?s.black:s.white:"transparent",backgroundImage:"none",opacity:1,position:"relative",zIndex:1,border:"1px solid",borderColor:d?s.primaryGreenActive:"transparent",cursor:"pointer",outline:"none","&:hover":{backgroundColor:d?e=>"dark"===e.palette.mode?s.black:s.white:"action.hover",backgroundImage:"none"},"&:focus-visible":{boxShadow:e=>`0 0 0 2px ${e.palette.primary.main}`},mb:.25},children:[o(r,{sx:{fontSize:14,color:d?s.primaryGreenActive:"text.disabled"}}),e(a,{sx:{flex:1,minWidth:0},children:[o(n,{component:"span",sx:{display:"block",fontWeight:500,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:d?"text.primary":"text.secondary"},children:m(p.title,c)}),o(i,{noWrap:!0,sx:{display:"block"},children:x(h)})]}),o(l,{title:g,ariaLabel:g,onClick:e=>{e.stopPropagation(),b&&Promise.resolve(b(p.id))},disabled:!b,children:o(t,{sx:{fontSize:14,color:d?"error.main":"text.disabled"}})})]})};export{p as ChatHistoryButtonBase};
@@ -1 +0,0 @@
1
- import{jsxs as e,jsx as r}from"react/jsx-runtime";import t from"@mui/icons-material/Add";import i from"@mui/icons-material/Clear";import o from"@mui/icons-material/Search";import{InputAdornment as a}from"@mui/material";import{useState as n,useEffect as l}from"react";import{Box as s}from"./Box.mjs";import{H3 as m}from"./Typography.mjs";import{IconButton as c}from"./IconButton.mjs";import{Stack as d}from"./Stack.mjs";import{TextField as h}from"./TextField.mjs";const p=({title:p,newChatTitle:u,onNewConversation:f,onSearchChange:x,searchPlaceholder:b="Search chat histories",searchDebounceMs:C=300})=>{const[g,w]=n("");return l(()=>{if(!x)return;const e=window.setTimeout(()=>{x(g)},C);return()=>window.clearTimeout(e)},[x,C,g]),e(d,{direction:"column",spacing:1,sx:{px:2,py:2,borderBottom:1,borderColor:"divider"},children:[e(d,{direction:"row",spacing:2,sx:{alignItems:"center",justifyContent:"space-between"},children:[r(m,{children:p}),r(c,{onClick:f,title:u,ariaLabel:u,disabled:!f,children:r(t,{sx:{fontSize:16}})})]}),e(s,{sx:{display:"flex",alignItems:"center",gap:.75},children:[r(h,{fullWidth:!0,size:"small",value:g,onChange:e=>w(e.target.value),placeholder:b,slotProps:{htmlInput:{"aria-label":"Search chat histories"},input:{startAdornment:r(a,{position:"start",children:r(o,{sx:{fontSize:16,color:"text.disabled"}})})}}}),r(c,{title:"Clear search",ariaLabel:"clear-search",onClick:()=>w(""),disabled:!g,children:r(i,{sx:{fontSize:14}})})]})]})};export{p as ChatHistoryHeader};
@@ -1 +0,0 @@
1
- import{jsx as e,jsxs as t}from"react/jsx-runtime";import{useState as o}from"react";import r from"@mui/icons-material/Send";import{Box as i}from"./Box.mjs";import{IconButton as l}from"./IconButton.mjs";import{Paper as a}from"./Paper.mjs";import{TextField as n}from"./TextField.mjs";import{colours as m}from"../theme/tokens.mjs";const s=({onSend:s,disabled:d=!1,placeholder:p="Ask about campaigns, competitors, performance…",maxRows:c=5,sendButtonTitle:f="Send message"})=>{const[u,x]=o(""),h=m.jadeLight,b=m.black,g=()=>{const e=u.trim();e&&!d&&(s(e),x(""))};return e(i,{component:"form",onSubmit:e=>{e.preventDefault(),g()},sx:{display:"flex",alignItems:"flex-end",gap:1},children:t(a,{variant:"outlined",sx:{display:"flex",flex:1,alignItems:"flex-end",gap:1,px:1.5,py:.75,borderRadius:2},children:[e(n,{variant:"standard",fullWidth:!0,multiline:!0,maxRows:c,value:u,onChange:e=>x(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),g())},placeholder:p,disabled:d,slotProps:{htmlInput:{"aria-label":p},input:{disableUnderline:!0}},sx:{"& .MuiInputBase-input":{p:0,fontSize:"0.875rem",color:"text.primary",resize:"none","&::placeholder":{color:"text.disabled",opacity:1}}}}),e(l,{type:"submit",title:f,disabled:!u.trim()||d,variant:"filled",size:"small",sx:{flexShrink:0,bgcolor:h,color:b,"&:hover":{bgcolor:m.jade}},children:e(r,{sx:{fontSize:13}})})]})})};export{s as ChatInput};
@@ -1 +0,0 @@
1
- import{jsx as o}from"react/jsx-runtime";import{Box as r}from"../../Box.mjs";import{ChatInput as e}from"../../ChatInput.mjs";const d=({placeholder:d,isTyping:p,onSend:i})=>o(r,{sx:{backgroundColor:"background.paper",borderTop:"1px solid",borderColor:"divider",p:1.5,flexShrink:0},children:o(e,{onSend:i,disabled:p,placeholder:d})});export{d as default};