sage-nexus-ui 1.13.13 → 1.13.15

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.
@@ -1 +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};
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 i from"@mui/icons-material/Stop";import{Box as n}from"../Box.mjs";import{IconButton as a}from"../IconButton.mjs";import{Paper as l}from"../Paper.mjs";import{TextField as s}from"../TextField.mjs";import{colours as m}from"../../theme/tokens.mjs";const p=({onSend:p,disabled:d=!1,placeholder:c="Ask about campaigns, competitors, performance…",maxRows:f=5,sendButtonTitle:u="Send message",isStreaming:x=!1,onStop:h,stopButtonTitle:g="Stop generating",actions:b,value:S,onChange:v})=>{const[y,j]=o(""),k=void 0!==S,z=k?S:y,B=e=>{k?v?.(e):j(e)},I=m.jadeLight,T=m.black,w=()=>{const e=z.trim();e&&!d&&(p(e),B(""))};return e(n,{component:"form",onSubmit:e=>{e.preventDefault(),x||w()},sx:{display:"flex",alignItems:"center",gap:1},children:t(l,{variant:"outlined",sx:{display:"flex",flex:1,alignItems:"center",gap:1,px:1.5,py:.75,borderRadius:2},children:[e(s,{variant:"standard",fullWidth:!0,multiline:!0,maxRows:f,value:z,onChange:e=>B(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),x||w())},placeholder:c,disabled:d,slotProps:{htmlInput:{"aria-label":c},input:{disableUnderline:!0}},sx:{"& .MuiInputBase-input":{p:0,fontSize:"0.875rem",color:"text.primary",resize:"none","&::placeholder":{color:"text.disabled",opacity:1}}}}),b,e(a,x&&h?{type:"button",title:g,onClick:h,variant:"filled",size:"small",sx:{flexShrink:0,bgcolor:"error.main",color:"error.contrastText","&:hover":{bgcolor:"error.dark"}},children:e(i,{sx:{fontSize:13}})}:{type:"submit",title:u,disabled:!z.trim()||d,variant:"filled",size:"small",sx:{flexShrink:0,bgcolor:I,color:T,"&:hover":{bgcolor:m.jade}},children:e(r,{sx:{fontSize:13}})})]})})};export{p as ChatInput};
@@ -1 +1 @@
1
- const o="1.13.13";export{o as SAGE_NEXUS_UI_VERSION};
1
+ const o="1.13.15";export{o as SAGE_NEXUS_UI_VERSION};
package/dist/index.d.ts CHANGED
@@ -252,8 +252,14 @@ interface ChatInputProps {
252
252
  placeholder?: string;
253
253
  maxRows?: number;
254
254
  sendButtonTitle?: string;
255
+ isStreaming?: boolean;
256
+ onStop?: () => void;
257
+ stopButtonTitle?: string;
258
+ actions?: React.ReactNode;
259
+ value?: string;
260
+ onChange?: (value: string) => void;
255
261
  }
256
- declare const ChatInput: ({ onSend, disabled, placeholder, maxRows, sendButtonTitle, }: ChatInputProps) => react_jsx_runtime.JSX.Element;
262
+ declare const ChatInput: ({ onSend, disabled, placeholder, maxRows, sendButtonTitle, isStreaming, onStop, stopButtonTitle, actions, value: controlledValue, onChange, }: ChatInputProps) => react_jsx_runtime.JSX.Element;
257
263
 
258
264
  declare const ChatHistory: ({ conversations, activeConversationId, onSelectConversation, onDeleteConversation, onNewConversation, onClose, onSearchChange, title, emptyText, newChatTitle, deleteConversationTitle, searchPlaceholder, searchDebounceMs, width, sx, formatMessageCount, isCollapsed, onToggleCollapse, collapsedWidth, }: ChatHistoryProps) => react_jsx_runtime.JSX.Element;
259
265
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sage-nexus-ui",
3
- "version": "1.13.13",
3
+ "version": "1.13.15",
4
4
  "description": "Nexus core components",
5
5
  "license": "ISC",
6
6
  "author": "emsmart-sage",