it-data-nexus-ui-library 2.1.0 → 2.1.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as
|
|
1
|
+
import{jsxs as e,jsx as r}from"react/jsx-runtime";import o from"@mui/icons-material/ChatBubbleOutlined";import t from"@mui/icons-material/DeleteForeverOutlined";import{Body1 as i,Caption as n}from"../Typography.mjs";import{GhostButton as a}from"../Buttons/GhostButton.mjs";import{Box as s}from"../_Primitives/Box.mjs";import{IconButton as l}from"../Buttons/IconButton.mjs";import{colours as m}from"../../theme/tokens.mjs";const d=(e,o)=>{const t=o?.trim();if(!t)return e;const i=new RegExp(`(${(e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"))(t)})`,"ig");return e.split(i).map((e,o)=>{if(!e)return null;return e.toLowerCase()===t.toLowerCase()?r(s,{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}-${o}`):e})},p=({conversation:p,isActive:c,highlightQuery:u,onSelectConversation:b,onDeleteConversation:h,deleteConversationTitle:g,formatMessageCount:x,showMessageCount:f=!1,sx:y})=>{const v=(e=>"number"==typeof e.messageCount?e.messageCount:Array.isArray(e.messages)?e.messages.length:0)(p);return e(s,{sx:[{position:"relative",mb:.25,"&:hover .delete-button":{visibility:"visible"}},...Array.isArray(y)?y:y?[y]:[]],children:[e(a,{onClick:()=>b(p.id),sx:{width:"100%",display:"flex",alignItems:"center",gap:1.25,borderRadius:1,px:1.5,py:1.25,pr:4.5,backgroundColor:c?e=>"dark"===e.palette.mode?m.black:m.white:"transparent",backgroundImage:"none",opacity:1,border:"1px solid",borderColor:c?m.primaryGreenActive:"transparent","&:hover":{backgroundColor:c?e=>"dark"===e.palette.mode?m.black:m.white:"action.hover",backgroundImage:"none"},"&:focus-visible":{boxShadow:e=>`0 0 0 2px ${e.palette.primary.main}`}},children:[r(o,{sx:{fontSize:14,color:c?m.primaryGreenActive:"text.disabled"}}),e(s,{sx:{flex:1,minWidth:0},children:[r(i,{component:"span",sx:{display:"block",fontWeight:500,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:c?"text.primary":"text.secondary"},children:d(p.title,u)}),f&&r(n,{noWrap:!0,sx:{display:"block"},children:x(v)})]})]}),r(s,{sx:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)"},children:r(l,{className:"delete-button",title:g,ariaLabel:g,onClick:e=>{e.stopPropagation(),h&&Promise.resolve(h(p.id))},disabled:!h,sx:{visibility:"hidden"},children:r(t,{sx:{fontSize:14,color:c?"error.main":"text.disabled"}})})})]})};export{p as ChatHistoryButtonBase};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const o="2.1.
|
|
1
|
+
const o="2.1.1";export{o as SAGE_NEXUS_UI_VERSION};
|