it-data-nexus-ui-library 2.5.1 → 2.5.2

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{jsxs as o,jsx as e,Fragment as t}from"react/jsx-runtime";import{useState as i}from"react";import{useTheme as n,useMediaQuery as r,Popover as s}from"@mui/material";import l from"@mui/icons-material/CloseFullscreen";import a from"@mui/icons-material/GridView";import m from"@mui/icons-material/History";import{AgentChatWindow as p}from"./AgentChatWindow.mjs";import{ChatHistory as c}from"./ChatHistory.mjs";import{Dialog as d}from"../_Primitives/Dialog.mjs";import{Box as h}from"../_Primitives/Box.mjs";import{Stack as C}from"../_Primitives/Stack.mjs";import{IconButton as g}from"../Buttons/IconButton.mjs";import{AiChip as u}from"../AiChip.mjs";import{H1 as f,H2 as v}from"../Typography.mjs";import"@mui/icons-material/Check";import"@mui/icons-material/ContentCopy";import"@mui/icons-material/Download";import"@mui/material/styles";import"../../theme/tokens.mjs";import"./ChatComponents/ChatAvatar.mjs";import{chatWindowMarkdownComponents as x}from"./ChatComponents/MarkdownContent.mjs";import"@mui/icons-material/ExpandMore";import"@mui/icons-material/ExpandLess";import"@mui/icons-material/CheckCircle";import"@mui/icons-material/OpenInNew";import"../Code.mjs";import"@mui/icons-material/ThumbUp";import"@mui/icons-material/ThumbDown";import w from"./ChatComponents/SuggestedPrompts.mjs";import S from"./ChatComponents/MessageList.mjs";function y({open:y,onClose:b,title:j="Ask Nexus",subtitle:A="Ready to help",placeholder:k,suggestedPrompts:I=[],showAiChip:T=!0,isTyping:z,messages:P,streamingText:D,liveTraceEvents:E,showActivity:O=!1,onSend:U,onStop:L,followUpPrompts:N,followUpLabel:B="Suggested follow-ups:",topOffset:M,conversations:_,activeConversationId:F,onSelectConversation:H,onDeleteConversation:W,onNewConversation:X,agents:$,activeAgentId:G,onSelectAgent:R}){const V=n(),q=r(V.breakpoints.down("md")),[J,K]=i(!1),[Q,Y]=i(!1),[Z,oo]=i(null),eo=P.length>0||z,to=void 0!==_,io=M?`calc(100vh - ${M}px)`:"100vh",no=o(C,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[T&&e(u,{}),to&&q&&e(g,{title:"Chat history",size:"small",onClick:()=>K(o=>!o),children:e(m,{sx:{fontSize:18}})}),e(g,{title:"Close full view",size:"small",onClick:b,children:e(l,{sx:{fontSize:16}})})]}),ro=eo?e(S,{messages:P,isTyping:z,streamingText:D,liveTraceEvents:E,showActivity:O,markdownComponents:x}):o(C,{direction:"column",sx:{gap:4,alignItems:"center"},children:[e(f,{children:j}),e(v,{sx:{color:"text.secondary"},children:A})]}),so=!eo&&I.length>0?o(t,{children:[e(g,{title:"Open prompt gallery",ariaLabel:"Open prompt gallery",size:"small",sx:{color:"text.jades"},onClick:o=>oo(o.currentTarget),children:e(a,{sx:{fontSize:18}})}),e(s,{open:Boolean(Z),anchorEl:Z,onClose:()=>oo(null),anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"bottom",horizontal:"left"},children:e(h,{sx:{p:2,maxWidth:360},children:e(w,{prompts:I,onSelect:o=>{oo(null),U(o)}})})})]}):void 0;return o(d,{open:y,fullScreen:!0,onClose:b,sx:M?{top:`${M}px`}:void 0,children:[o(h,{sx:{display:"flex",height:io,overflow:"hidden"},children:[to&&e(h,{sx:{display:{xs:"none",md:"flex"},flexShrink:0},children:e(c,{conversations:_,activeConversationId:F??null,onSelectConversation:H??(()=>{}),onDeleteConversation:W,onNewConversation:X,agents:$,activeAgentId:G,onSelectAgent:R,isCollapsed:Q,onToggleCollapse:()=>Y(o=>!o)})}),e(p,{title:j,subtitle:A,showAiChip:!1,headerActions:no,isEmpty:!eo,body:ro,followUpPrompts:N,onSelectFollowUp:U,followUpLabel:B,onSend:U,isStreaming:z,onStop:L,inputPlaceholder:k,inputActions:so})]}),to&&q&&o(t,{children:[J&&e(h,{onClick:()=>K(!1),sx:{position:"absolute",inset:0,zIndex:9,bgcolor:"rgba(0,0,0,0.45)"}}),e(h,{sx:{position:"absolute",top:0,left:0,bottom:0,width:288,zIndex:10,bgcolor:"background.paper",boxShadow:4,display:"flex",flexDirection:"column",overflow:"hidden",transform:J?"translateX(0)":"translateX(-100%)",transition:"transform 0.25s ease"},children:e(c,{conversations:_,activeConversationId:F??null,onSelectConversation:o=>{H?.(o),K(!1)},onDeleteConversation:W,onNewConversation:X?()=>{X(),K(!1)}:void 0,agents:$,activeAgentId:G,onSelectAgent:R,onClose:()=>K(!1)})})]})]})}export{y as NexusChatDialog};
1
+ import{jsxs as o,jsx as e,Fragment as t}from"react/jsx-runtime";import{useState as i}from"react";import{useTheme as n,useMediaQuery as r,Popover as s}from"@mui/material";import l from"@mui/icons-material/CloseFullscreen";import a from"@mui/icons-material/GridView";import m from"@mui/icons-material/History";import{AgentChatWindow as p}from"./AgentChatWindow.mjs";import{ChatHistory as c}from"./ChatHistory.mjs";import{Dialog as d}from"../_Primitives/Dialog.mjs";import{Box as h}from"../_Primitives/Box.mjs";import{Stack as C}from"../_Primitives/Stack.mjs";import{IconButton as g}from"../Buttons/IconButton.mjs";import{AiChip as u}from"../AiChip.mjs";import{H1 as f,H2 as v}from"../Typography.mjs";import"@mui/icons-material/Check";import"@mui/icons-material/ContentCopy";import"@mui/icons-material/Download";import"@mui/material/styles";import"../../theme/tokens.mjs";import"./ChatComponents/ChatAvatar.mjs";import{chatWindowMarkdownComponents as x}from"./ChatComponents/MarkdownContent.mjs";import"@mui/icons-material/ExpandMore";import"@mui/icons-material/ExpandLess";import"@mui/icons-material/CheckCircle";import"@mui/icons-material/OpenInNew";import"../Code.mjs";import"@mui/icons-material/ThumbUp";import"@mui/icons-material/ThumbDown";import w from"./ChatComponents/SuggestedPrompts.mjs";import S from"./ChatComponents/MessageList.mjs";function b({open:b,onClose:y,title:j="Ask Nexus",subtitle:k="Ready to help",placeholder:A,suggestedPrompts:I=[],showAiChip:T=!0,isTyping:z,messages:P,streamingText:D,liveTraceEvents:E,showActivity:O=!1,onSend:U,onStop:L,onFeedback:N,followUpPrompts:B,followUpLabel:F="Suggested follow-ups:",topOffset:M,conversations:_,activeConversationId:H,onSelectConversation:W,onDeleteConversation:X,onNewConversation:$,agents:G,activeAgentId:R,onSelectAgent:V}){const q=n(),J=r(q.breakpoints.down("md")),[K,Q]=i(!1),[Y,Z]=i(!1),[oo,eo]=i(null),to=P.length>0||z,io=void 0!==_,no=M?`calc(100vh - ${M}px)`:"100vh",ro=o(C,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[T&&e(u,{}),io&&J&&e(g,{title:"Chat history",size:"small",onClick:()=>Q(o=>!o),children:e(m,{sx:{fontSize:18}})}),e(g,{title:"Close full view",size:"small",onClick:y,children:e(l,{sx:{fontSize:16}})})]}),so=to?e(S,{messages:P,isTyping:z,streamingText:D,liveTraceEvents:E,showActivity:O,markdownComponents:x,onFeedback:N}):o(C,{direction:"column",sx:{gap:4,alignItems:"center"},children:[e(f,{children:j}),e(v,{sx:{color:"text.secondary"},children:k})]}),lo=!to&&I.length>0?o(t,{children:[e(g,{title:"Open prompt gallery",ariaLabel:"Open prompt gallery",size:"small",sx:{color:"text.jades"},onClick:o=>eo(o.currentTarget),children:e(a,{sx:{fontSize:18}})}),e(s,{open:Boolean(oo),anchorEl:oo,onClose:()=>eo(null),anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"bottom",horizontal:"left"},children:e(h,{sx:{p:2,maxWidth:360},children:e(w,{prompts:I,onSelect:o=>{eo(null),U(o)}})})})]}):void 0;return o(d,{open:b,fullScreen:!0,onClose:y,sx:M?{top:`${M}px`}:void 0,children:[o(h,{sx:{display:"flex",height:no,overflow:"hidden"},children:[io&&e(h,{sx:{display:{xs:"none",md:"flex"},flexShrink:0},children:e(c,{conversations:_,activeConversationId:H??null,onSelectConversation:W??(()=>{}),onDeleteConversation:X,onNewConversation:$,agents:G,activeAgentId:R,onSelectAgent:V,isCollapsed:Y,onToggleCollapse:()=>Z(o=>!o)})}),e(p,{title:j,subtitle:k,showAiChip:!1,headerActions:ro,isEmpty:!to,body:so,followUpPrompts:B,onSelectFollowUp:U,followUpLabel:F,onSend:U,isStreaming:z,onStop:L,inputPlaceholder:A,inputActions:lo})]}),io&&J&&o(t,{children:[K&&e(h,{onClick:()=>Q(!1),sx:{position:"absolute",inset:0,zIndex:9,bgcolor:"rgba(0,0,0,0.45)"}}),e(h,{sx:{position:"absolute",top:0,left:0,bottom:0,width:288,zIndex:10,bgcolor:"background.paper",boxShadow:4,display:"flex",flexDirection:"column",overflow:"hidden",transform:K?"translateX(0)":"translateX(-100%)",transition:"transform 0.25s ease"},children:e(c,{conversations:_,activeConversationId:H??null,onSelectConversation:o=>{W?.(o),Q(!1)},onDeleteConversation:X,onNewConversation:$?()=>{$(),Q(!1)}:void 0,agents:G,activeAgentId:R,onSelectAgent:V,onClose:()=>Q(!1)})})]})]})}export{b as NexusChatDialog};
@@ -1 +1 @@
1
- const o="2.5.1";export{o as SAGE_NEXUS_UI_VERSION};
1
+ const o="2.5.2";export{o as SAGE_NEXUS_UI_VERSION};
package/dist/index.d.ts CHANGED
@@ -216,6 +216,7 @@ interface NexusChatDialogProps {
216
216
  showActivity?: boolean;
217
217
  onSend: (message: string) => void;
218
218
  onStop?: () => void;
219
+ onFeedback?: (messageId: string, rating: "positive" | "negative", comment?: string) => void;
219
220
  /** Prompt chips shown directly above the input during an active conversation */
220
221
  followUpPrompts?: string[];
221
222
  /** Label shown above the follow-up chips. Defaults to "Suggested follow-ups:" */
@@ -233,7 +234,7 @@ interface NexusChatDialogProps {
233
234
  activeAgentId?: string | null;
234
235
  onSelectAgent?: (id: string) => void;
235
236
  }
236
- declare function NexusChatDialog({ open, onClose, title, subtitle, placeholder, suggestedPrompts, showAiChip, isTyping, messages, streamingText, liveTraceEvents, showActivity, onSend, onStop, followUpPrompts, followUpLabel, topOffset, conversations, activeConversationId, onSelectConversation, onDeleteConversation, onNewConversation, agents, activeAgentId, onSelectAgent, }: NexusChatDialogProps): react.JSX.Element;
237
+ declare function NexusChatDialog({ open, onClose, title, subtitle, placeholder, suggestedPrompts, showAiChip, isTyping, messages, streamingText, liveTraceEvents, showActivity, onSend, onStop, onFeedback, followUpPrompts, followUpLabel, topOffset, conversations, activeConversationId, onSelectConversation, onDeleteConversation, onNewConversation, agents, activeAgentId, onSelectAgent, }: NexusChatDialogProps): react.JSX.Element;
237
238
 
238
239
  interface FABButtonProps {
239
240
  onOpen: () => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "it-data-nexus-ui-library",
3
- "version": "2.5.1",
3
+ "version": "2.5.2",
4
4
  "description": "Nexus core components",
5
5
  "license": "ISC",
6
6
  "author": "emsmart-sage",