sage-nexus-ui 1.14.6 → 1.14.7
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 e,jsx as
|
|
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 s}from"../IconButton.mjs";import{colours as l}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,showMessageCount:h=!1,sx:y})=>{const f=(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?l.black:l.white:"transparent",backgroundImage:"none",opacity:1,position:"relative",zIndex:1,border:"1px solid",borderColor:d?l.primaryGreenActive:"transparent",cursor:"pointer",outline:"none","&:hover":{backgroundColor:d?e=>"dark"===e.palette.mode?l.black:l.white:"action.hover",backgroundImage:"none"},"&:focus-visible":{boxShadow:e=>`0 0 0 2px ${e.palette.primary.main}`},mb:.25},...Array.isArray(y)?y:y?[y]:[]],children:[o(r,{sx:{fontSize:14,color:d?l.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)}),h&&o(i,{noWrap:!0,sx:{display:"block"},children:x(f)})]}),o(s,{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 +1 @@
|
|
|
1
|
-
const o="1.14.
|
|
1
|
+
const o="1.14.7";export{o as SAGE_NEXUS_UI_VERSION};
|
package/dist/index.d.ts
CHANGED
|
@@ -295,9 +295,10 @@ interface ChatHistoryButtonBaseProps {
|
|
|
295
295
|
onDeleteConversation?: (id: string) => void | Promise<boolean>;
|
|
296
296
|
deleteConversationTitle: string;
|
|
297
297
|
formatMessageCount: (count: number) => string;
|
|
298
|
+
showMessageCount?: boolean;
|
|
298
299
|
sx?: SxProps$1<Theme$1>;
|
|
299
300
|
}
|
|
300
|
-
declare const ChatHistoryButtonBase: ({ conversation, isActive, highlightQuery, onSelectConversation, onDeleteConversation, deleteConversationTitle, formatMessageCount, sx, }: ChatHistoryButtonBaseProps) => react_jsx_runtime.JSX.Element;
|
|
301
|
+
declare const ChatHistoryButtonBase: ({ conversation, isActive, highlightQuery, onSelectConversation, onDeleteConversation, deleteConversationTitle, formatMessageCount, showMessageCount, sx, }: ChatHistoryButtonBaseProps) => react_jsx_runtime.JSX.Element;
|
|
301
302
|
|
|
302
303
|
declare const chatHistoryMatchesQuery: (conversation: ChatHistoryConversation, query: string) => boolean;
|
|
303
304
|
declare const filterChatHistoryConversations: <TConversation extends ChatHistoryConversation>(conversations: TConversation[], query: string) => TConversation[];
|