@clubmed/usg-chat-ui 1.2.6 → 1.3.0

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 (60) hide show
  1. package/README.md +36 -0
  2. package/assets/style.css +1 -1
  3. package/chunks/react.esm.js +2012 -1997
  4. package/chunks/react.esm.js.map +1 -1
  5. package/chunks/vi.2VT5v0um.js +1 -0
  6. package/config/chatLabels.d.ts +43 -0
  7. package/config/chatLabels.js +2 -0
  8. package/config/chatLabels.js.map +1 -0
  9. package/contexts/ChatLabelsContext.d.ts +13 -0
  10. package/contexts/ChatLabelsContext.js +24 -0
  11. package/contexts/ChatLabelsContext.js.map +1 -0
  12. package/contexts/ChatLabelsContext.test.d.ts +1 -0
  13. package/contexts/ChatLabelsContext.test.js +23 -0
  14. package/contexts/ChatLabelsContext.test.js.map +1 -0
  15. package/molecules/AiElements/Branch.js +45 -44
  16. package/molecules/AiElements/Branch.js.map +1 -1
  17. package/molecules/AiElements/PromptInput.js +60 -58
  18. package/molecules/AiElements/PromptInput.js.map +1 -1
  19. package/molecules/RichText/useCollaboration.test.js +1 -1
  20. package/organisms/canvas/CanvasLayout.d.ts +2 -1
  21. package/organisms/canvas/CanvasLayout.js +1249 -1248
  22. package/organisms/canvas/CanvasLayout.js.map +1 -1
  23. package/organisms/chat/Chat.d.ts +7 -1
  24. package/organisms/chat/Chat.js +67 -67
  25. package/organisms/chat/Chat.js.map +1 -1
  26. package/organisms/chat/ChatHeader.d.ts +4 -4
  27. package/organisms/chat/ChatHeader.js +41 -39
  28. package/organisms/chat/ChatHeader.js.map +1 -1
  29. package/organisms/chat/ChatHeader.test.d.ts +1 -0
  30. package/organisms/chat/ChatHeader.test.js +18 -0
  31. package/organisms/chat/ChatHeader.test.js.map +1 -0
  32. package/organisms/chat/ChatMessageList.d.ts +1 -2
  33. package/organisms/chat/ChatMessageList.js +73 -58
  34. package/organisms/chat/ChatMessageList.js.map +1 -1
  35. package/organisms/chat/ChatMessageList.test.d.ts +1 -0
  36. package/organisms/chat/ChatMessageList.test.js +67 -0
  37. package/organisms/chat/ChatMessageList.test.js.map +1 -0
  38. package/organisms/chat/ChatSettingsButton.d.ts +2 -0
  39. package/organisms/chat/ChatSettingsButton.js +24 -0
  40. package/organisms/chat/ChatSettingsButton.js.map +1 -0
  41. package/organisms/chat/ChatSettingsButton.test.d.ts +1 -0
  42. package/organisms/chat/ChatSettingsButton.test.js +16 -0
  43. package/organisms/chat/ChatSettingsButton.test.js.map +1 -0
  44. package/organisms/chat/ConversationSidebar.js +44 -43
  45. package/organisms/chat/ConversationSidebar.js.map +1 -1
  46. package/organisms/chat/MessageActions.js +104 -103
  47. package/organisms/chat/MessageActions.js.map +1 -1
  48. package/organisms/chat/MessageRenderers.js +1 -1
  49. package/organisms/chat/SidebarToggleButton.js +9 -7
  50. package/organisms/chat/SidebarToggleButton.js.map +1 -1
  51. package/organisms/chat/hooks/useChat.d.ts +1 -1
  52. package/organisms/chat/hooks/useChat.js +83 -83
  53. package/organisms/chat/hooks/useChat.js.map +1 -1
  54. package/package.json +1 -1
  55. package/utils/interpolate.d.ts +5 -0
  56. package/utils/interpolate.js +13 -0
  57. package/utils/interpolate.js.map +1 -0
  58. package/utils/interpolate.test.d.ts +1 -0
  59. package/utils/interpolate.test.js +21 -0
  60. package/utils/interpolate.test.js.map +1 -0
@@ -1,6 +1,12 @@
1
1
  import { ReactNode } from 'react';
2
+ import { ChatHeaderProps } from './ChatHeader';
3
+ import { ChatLabelOverrides } from '../../config/chatLabels';
2
4
  export interface ChatProps {
5
+ title?: string;
3
6
  className?: string;
4
7
  headerActions?: ReactNode;
8
+ variant?: ChatHeaderProps["variant"];
9
+ labels?: ChatLabelOverrides;
5
10
  }
6
- export declare function Chat({ headerActions, className, }: ChatProps): import("react/jsx-runtime").JSX.Element;
11
+ export declare function Chat({ title, headerActions, variant, className, labels, }: ChatProps): import("react/jsx-runtime").JSX.Element;
12
+ export default Chat;
@@ -1,109 +1,109 @@
1
1
  "use client";
2
- import { jsxs as o, jsx as e } from "react/jsx-runtime";
3
- import { cn as d } from "../../utils/cn.js";
4
- import { ChatHeader as L } from "./ChatHeader.js";
5
- import { SidebarToggleButton as R } from "./SidebarToggleButton.js";
6
- import { ConversationSidebar as M } from "./ConversationSidebar.js";
7
- import { ChatMessageList as T } from "./ChatMessageList.js";
8
- import { PromptComposer as j } from "./PromptComposer.js";
9
- import { CanvasLayout as F } from "../canvas/CanvasLayout.js";
10
- import { StoryCanvas as I } from "../canvas/StoryCanvas.js";
11
- import { ApiDocsCanvas as k } from "../canvas/ApiDocsCanvas.js";
12
- import { ReleaseNoteCanvas as z } from "../canvas/ReleaseNoteCanvas.js";
13
- import { SettingsModal as W } from "../settings/SettingsModal.js";
14
- import { useChat as _ } from "./hooks/useChat.js";
15
- function V({
16
- headerActions: h,
17
- className: f
2
+ import { jsx as e, jsxs as o } from "react/jsx-runtime";
3
+ import { cn as p } from "../../utils/cn.js";
4
+ import { ChatHeader as R } from "./ChatHeader.js";
5
+ import { SidebarToggleButton as I } from "./SidebarToggleButton.js";
6
+ import { ConversationSidebar as T } from "./ConversationSidebar.js";
7
+ import { ChatMessageList as j } from "./ChatMessageList.js";
8
+ import { PromptComposer as k } from "./PromptComposer.js";
9
+ import { CanvasLayout as A } from "../canvas/CanvasLayout.js";
10
+ import { StoryCanvas as F } from "../canvas/StoryCanvas.js";
11
+ import { ApiDocsCanvas as z } from "../canvas/ApiDocsCanvas.js";
12
+ import { ReleaseNoteCanvas as B } from "../canvas/ReleaseNoteCanvas.js";
13
+ import { SettingsModal as P } from "../settings/SettingsModal.js";
14
+ import { useChat as W } from "./hooks/useChat.js";
15
+ import { ChatSettingsButton as _ } from "./ChatSettingsButton.js";
16
+ import { ChatLabelsProvider as $ } from "../../contexts/ChatLabelsContext.js";
17
+ function te({
18
+ title: h = "ClubMed USG AI Assistant",
19
+ headerActions: f,
20
+ variant: u = "full",
21
+ className: g,
22
+ labels: C
18
23
  }) {
19
24
  const {
20
- chatMessages: t,
21
- settingsOpen: g,
22
- setSettingsOpen: a,
25
+ chatMessages: n,
26
+ settingsOpen: v,
27
+ setSettingsOpen: r,
23
28
  sidebarOpen: i,
24
- setSidebarOpen: r,
25
- sidebarRefreshTrigger: u,
26
- currentConversationId: v,
27
- loadConversation: C,
28
- handleNewConversation: x,
29
+ setSidebarOpen: a,
30
+ sidebarRefreshTrigger: x,
31
+ currentConversationId: S,
32
+ loadConversation: w,
33
+ handleNewConversation: b,
29
34
  isLoadingMessage: s,
30
- canvasType: n,
35
+ canvasType: t,
31
36
  isFullscreen: l,
32
37
  canvasWidth: m,
33
38
  isResizing: c,
34
- resizeWidth: p,
35
- handleFollowupClick: S,
36
- handleSubmit: w,
37
- handleRegenerate: y,
38
- localInput: b,
39
- setLocalInput: N,
40
- emptyStateGreeting: O
41
- } = _();
42
- return /* @__PURE__ */ o("div", { className: d("usg-chat-ui", f), "data-testid": "chat", children: [
43
- /* @__PURE__ */ e(
44
- L,
45
- {
46
- conversationCount: t.length,
47
- onOpenSettings: () => a(!0),
48
- actions: h
49
- }
50
- ),
39
+ resizeWidth: d,
40
+ handleFollowupClick: y,
41
+ handleSubmit: N,
42
+ handleRegenerate: L,
43
+ localInput: O,
44
+ setLocalInput: M
45
+ } = W();
46
+ return /* @__PURE__ */ e($, { labels: C, children: /* @__PURE__ */ o("div", { className: p("usg-chat-ui", g), "data-testid": "chat", children: [
47
+ /* @__PURE__ */ o(R, { title: h, conversationCount: n.length, variant: u, children: [
48
+ f,
49
+ /* @__PURE__ */ e(_, { onClick: () => r(!0) })
50
+ ] }),
51
51
  /* @__PURE__ */ o("div", { className: "flex-1 flex overflow-hidden relative", children: [
52
- !i && /* @__PURE__ */ e(R, { onOpen: () => r(!0) }),
52
+ !i && /* @__PURE__ */ e(I, { onOpen: () => a(!0) }),
53
53
  i && /* @__PURE__ */ e(
54
- M,
54
+ T,
55
55
  {
56
- currentConversationId: v,
57
- onSelectConversation: C,
58
- onNewConversation: x,
59
- refreshTrigger: u,
60
- onClose: () => r(!1)
56
+ currentConversationId: S,
57
+ onSelectConversation: w,
58
+ onNewConversation: b,
59
+ refreshTrigger: x,
60
+ onClose: () => a(!1)
61
61
  }
62
62
  ),
63
63
  /* @__PURE__ */ e(
64
64
  "main",
65
65
  {
66
- className: d(
66
+ className: p(
67
67
  "flex-1 flex items-stretch justify-center overflow-hidden min-h-0",
68
68
  l && "lg:w-0 lg:opacity-0 lg:pointer-events-none",
69
69
  !c && "transition-all duration-300"
70
70
  ),
71
71
  style: {
72
- width: l ? "0" : c && p !== null ? `calc(100% - ${p}px)` : m !== null ? `calc(100% - ${m}px)` : "50%"
72
+ width: l ? "0" : c && d !== null ? `calc(100% - ${d}px)` : m !== null ? `calc(100% - ${m}px)` : "50%"
73
73
  },
74
74
  children: /* @__PURE__ */ o("div", { className: "w-full max-w-3xl flex flex-col h-full", children: [
75
75
  /* @__PURE__ */ e(
76
- T,
76
+ j,
77
77
  {
78
- chatMessages: t,
78
+ chatMessages: n,
79
79
  isLoadingMessage: s,
80
- onFollowupClick: S,
81
- onRegenerate: y,
82
- emptyStateGreeting: O
80
+ onFollowupClick: y,
81
+ onRegenerate: L
83
82
  }
84
83
  ),
85
84
  /* @__PURE__ */ e(
86
- j,
85
+ k,
87
86
  {
88
- value: b,
87
+ value: O,
89
88
  isLoading: s,
90
- onChange: N,
91
- onSubmit: w
89
+ onChange: M,
90
+ onSubmit: N
92
91
  }
93
92
  )
94
93
  ] })
95
94
  }
96
95
  ),
97
- /* @__PURE__ */ o(F, { children: [
98
- n === "story" && /* @__PURE__ */ e(I, {}),
99
- n === "api_docs" && /* @__PURE__ */ e(k, {}),
100
- n === "release_note" && /* @__PURE__ */ e(z, {})
96
+ /* @__PURE__ */ o(A, { children: [
97
+ t === "story" && /* @__PURE__ */ e(F, {}),
98
+ t === "api_docs" && /* @__PURE__ */ e(z, {}),
99
+ t === "release_note" && /* @__PURE__ */ e(B, {})
101
100
  ] })
102
101
  ] }),
103
- /* @__PURE__ */ e(W, { open: g, onOpenChange: a })
104
- ] });
102
+ /* @__PURE__ */ e(P, { open: v, onOpenChange: r })
103
+ ] }) });
105
104
  }
106
105
  export {
107
- V as Chat
106
+ te as Chat,
107
+ te as default
108
108
  };
109
109
  //# sourceMappingURL=Chat.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Chat.js","sources":["../../../lib/organisms/chat/Chat.tsx"],"sourcesContent":["\"use client\";\n\nimport type {ReactNode} from \"react\";\n\nimport {cn} from \"../../utils/cn\";\nimport {ChatHeader} from \"./ChatHeader\";\nimport {SidebarToggleButton} from \"./SidebarToggleButton\";\nimport {ConversationSidebar} from \"./ConversationSidebar\";\nimport {ChatMessageList} from \"./ChatMessageList\";\nimport {PromptComposer} from \"./PromptComposer\";\nimport {CanvasLayout} from \"../canvas/CanvasLayout\";\nimport {StoryCanvas} from \"../canvas/StoryCanvas\";\nimport {ApiDocsCanvas} from \"../canvas/ApiDocsCanvas\";\nimport {ReleaseNoteCanvas} from \"../canvas/ReleaseNoteCanvas\";\nimport {SettingsModal} from \"../settings/SettingsModal\";\nimport {useChat} from \"./hooks/useChat\";\n\nexport interface ChatProps {\n className?: string;\n headerActions?: ReactNode;\n}\n\nexport function Chat({\n headerActions,\n className,\n }: ChatProps) {\n const {\n chatMessages,\n settingsOpen,\n setSettingsOpen,\n sidebarOpen,\n setSidebarOpen,\n sidebarRefreshTrigger,\n currentConversationId,\n loadConversation,\n handleNewConversation,\n isLoadingMessage,\n canvasType,\n isFullscreen,\n canvasWidth,\n isResizing,\n resizeWidth,\n handleFollowupClick,\n handleSubmit,\n handleRegenerate,\n localInput,\n setLocalInput,\n emptyStateGreeting\n } = useChat();\n\n return (\n <div className={cn(\"usg-chat-ui\", className)} data-testid=\"chat\">\n <ChatHeader\n conversationCount={chatMessages.length}\n onOpenSettings={() => setSettingsOpen(true)}\n actions={headerActions}\n />\n\n <div className=\"flex-1 flex overflow-hidden relative\">\n {!sidebarOpen && <SidebarToggleButton onOpen={() => setSidebarOpen(true)}/>}\n\n {sidebarOpen && (\n <ConversationSidebar\n currentConversationId={currentConversationId}\n onSelectConversation={loadConversation}\n onNewConversation={handleNewConversation}\n refreshTrigger={sidebarRefreshTrigger}\n onClose={() => setSidebarOpen(false)}\n />\n )}\n\n <main\n className={cn(\n \"flex-1 flex items-stretch justify-center overflow-hidden min-h-0\",\n isFullscreen && \"lg:w-0 lg:opacity-0 lg:pointer-events-none\",\n !isResizing && \"transition-all duration-300\"\n )}\n style={{\n width: isFullscreen\n ? \"0\"\n : isResizing && resizeWidth !== null\n ? `calc(100% - ${resizeWidth}px)`\n : canvasWidth !== null\n ? `calc(100% - ${canvasWidth}px)`\n : \"50%\",\n }}\n >\n <div className=\"w-full max-w-3xl flex flex-col h-full\">\n <ChatMessageList\n chatMessages={chatMessages}\n isLoadingMessage={isLoadingMessage}\n onFollowupClick={handleFollowupClick}\n onRegenerate={handleRegenerate}\n emptyStateGreeting={emptyStateGreeting}\n />\n\n <PromptComposer\n value={localInput}\n isLoading={isLoadingMessage}\n onChange={setLocalInput}\n onSubmit={handleSubmit}\n />\n </div>\n </main>\n\n <CanvasLayout>\n {canvasType === \"story\" && <StoryCanvas/>}\n {canvasType === \"api_docs\" && <ApiDocsCanvas/>}\n {canvasType === \"release_note\" && <ReleaseNoteCanvas/>}\n </CanvasLayout>\n </div>\n\n <SettingsModal open={settingsOpen} onOpenChange={setSettingsOpen}/>\n </div>\n );\n}\n"],"names":["Chat","headerActions","className","chatMessages","settingsOpen","setSettingsOpen","sidebarOpen","setSidebarOpen","sidebarRefreshTrigger","currentConversationId","loadConversation","handleNewConversation","isLoadingMessage","canvasType","isFullscreen","canvasWidth","isResizing","resizeWidth","handleFollowupClick","handleSubmit","handleRegenerate","localInput","setLocalInput","emptyStateGreeting","useChat","jsxs","cn","jsx","ChatHeader","SidebarToggleButton","ConversationSidebar","ChatMessageList","PromptComposer","CanvasLayout","StoryCanvas","ApiDocsCanvas","ReleaseNoteCanvas","SettingsModal"],"mappings":";;;;;;;;;;;;;;AAsBO,SAASA,EAAK;AAAA,EACE,eAAAC;AAAA,EACA,WAAAC;AACF,GAAc;AACjC,QAAM;AAAA,IACJ,cAAAC;AAAA,IACA,cAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,aAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,uBAAAC;AAAA,IACA,uBAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,uBAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,cAAAC;AAAA,IACA,aAAAC;AAAA,IACA,YAAAC;AAAA,IACA,aAAAC;AAAA,IACA,qBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,eAAAC;AAAA,IACA,oBAAAC;AAAA,EAAA,IACEC,EAAA;AAEJ,SACE,gBAAAC,EAAC,SAAI,WAAWC,EAAG,eAAexB,CAAS,GAAG,eAAY,QACxD,UAAA;AAAA,IAAA,gBAAAyB;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,mBAAmBzB,EAAa;AAAA,QAChC,gBAAgB,MAAME,EAAgB,EAAI;AAAA,QAC1C,SAASJ;AAAA,MAAA;AAAA,IAAA;AAAA,IAGX,gBAAAwB,EAAC,OAAA,EAAI,WAAU,wCACZ,UAAA;AAAA,MAAA,CAACnB,KAAe,gBAAAqB,EAACE,GAAA,EAAoB,QAAQ,MAAMtB,EAAe,EAAI,GAAE;AAAA,MAExED,KACC,gBAAAqB;AAAA,QAACG;AAAA,QAAA;AAAA,UACC,uBAAArB;AAAA,UACA,sBAAsBC;AAAA,UACtB,mBAAmBC;AAAA,UACnB,gBAAgBH;AAAA,UAChB,SAAS,MAAMD,EAAe,EAAK;AAAA,QAAA;AAAA,MAAA;AAAA,MAIvC,gBAAAoB;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAWD;AAAA,YACT;AAAA,YACAZ,KAAgB;AAAA,YAChB,CAACE,KAAc;AAAA,UAAA;AAAA,UAEjB,OAAO;AAAA,YACL,OAAOF,IACH,MACAE,KAAcC,MAAgB,OAC5B,eAAeA,CAAW,QAC1BF,MAAgB,OACd,eAAeA,CAAW,QAC1B;AAAA,UAAA;AAAA,UAGV,UAAA,gBAAAU,EAAC,OAAA,EAAI,WAAU,yCACb,UAAA;AAAA,YAAA,gBAAAE;AAAA,cAACI;AAAA,cAAA;AAAA,gBACC,cAAA5B;AAAA,gBACA,kBAAAS;AAAA,gBACA,iBAAiBM;AAAA,gBACjB,cAAcE;AAAA,gBACd,oBAAAG;AAAA,cAAA;AAAA,YAAA;AAAA,YAGF,gBAAAI;AAAA,cAACK;AAAA,cAAA;AAAA,gBACC,OAAOX;AAAA,gBACP,WAAWT;AAAA,gBACX,UAAUU;AAAA,gBACV,UAAUH;AAAA,cAAA;AAAA,YAAA;AAAA,UACZ,EAAA,CACF;AAAA,QAAA;AAAA,MAAA;AAAA,wBAGDc,GAAA,EACE,UAAA;AAAA,QAAApB,MAAe,6BAAYqB,GAAA,CAAA,CAAW;AAAA,QACtCrB,MAAe,cAAc,gBAAAc,EAACQ,GAAA,CAAA,CAAa;AAAA,QAC3CtB,MAAe,kBAAkB,gBAAAc,EAACS,GAAA,CAAA,CAAiB;AAAA,MAAA,EAAA,CACtD;AAAA,IAAA,GACF;AAAA,IAEA,gBAAAT,EAACU,GAAA,EAAc,MAAMjC,GAAc,cAAcC,EAAA,CAAgB;AAAA,EAAA,GACnE;AAEJ;"}
1
+ {"version":3,"file":"Chat.js","sources":["../../../lib/organisms/chat/Chat.tsx"],"sourcesContent":["\"use client\";\n\nimport type {ReactNode} from \"react\";\n\nimport {cn} from \"../../utils/cn\";\nimport {ChatHeader, type ChatHeaderProps} from \"./ChatHeader\";\nimport {SidebarToggleButton} from \"./SidebarToggleButton\";\nimport {ConversationSidebar} from \"./ConversationSidebar\";\nimport {ChatMessageList} from \"./ChatMessageList\";\nimport {PromptComposer} from \"./PromptComposer\";\nimport {CanvasLayout} from \"../canvas/CanvasLayout\";\nimport {StoryCanvas} from \"../canvas/StoryCanvas\";\nimport {ApiDocsCanvas} from \"../canvas/ApiDocsCanvas\";\nimport {ReleaseNoteCanvas} from \"../canvas/ReleaseNoteCanvas\";\nimport {SettingsModal} from \"../settings/SettingsModal\";\nimport {useChat} from \"./hooks/useChat\";\nimport type {ChatLabelOverrides} from \"../../config/chatLabels\";\nimport {ChatSettingsButton} from \"@clubmed/usg-chat-ui/organisms/chat/ChatSettingsButton\";\nimport {ChatLabelsProvider} from \"../../contexts/ChatLabelsContext\";\n\nexport interface ChatProps {\n title?: string;\n className?: string;\n headerActions?: ReactNode;\n variant?: ChatHeaderProps[\"variant\"];\n labels?: ChatLabelOverrides;\n}\n\nexport function Chat({\n title = \"ClubMed USG AI Assistant\",\n headerActions,\n variant = \"full\",\n className,\n labels,\n }: ChatProps) {\n const {\n chatMessages,\n settingsOpen,\n setSettingsOpen,\n sidebarOpen,\n setSidebarOpen,\n sidebarRefreshTrigger,\n currentConversationId,\n loadConversation,\n handleNewConversation,\n isLoadingMessage,\n canvasType,\n isFullscreen,\n canvasWidth,\n isResizing,\n resizeWidth,\n handleFollowupClick,\n handleSubmit,\n handleRegenerate,\n localInput,\n setLocalInput,\n } = useChat();\n\n return (\n <ChatLabelsProvider labels={labels}>\n <div className={cn(\"usg-chat-ui\", className)} data-testid=\"chat\">\n <ChatHeader title={title} conversationCount={chatMessages.length} variant={variant}>\n {headerActions}\n <ChatSettingsButton onClick={() => setSettingsOpen(true)}/>\n </ChatHeader>\n\n <div className=\"flex-1 flex overflow-hidden relative\">\n {!sidebarOpen && <SidebarToggleButton onOpen={() => setSidebarOpen(true)}/>}\n\n {sidebarOpen && (\n <ConversationSidebar\n currentConversationId={currentConversationId}\n onSelectConversation={loadConversation}\n onNewConversation={handleNewConversation}\n refreshTrigger={sidebarRefreshTrigger}\n onClose={() => setSidebarOpen(false)}\n />\n )}\n\n <main\n className={cn(\n \"flex-1 flex items-stretch justify-center overflow-hidden min-h-0\",\n isFullscreen && \"lg:w-0 lg:opacity-0 lg:pointer-events-none\",\n !isResizing && \"transition-all duration-300\"\n )}\n style={{\n width: isFullscreen\n ? \"0\"\n : isResizing && resizeWidth !== null\n ? `calc(100% - ${resizeWidth}px)`\n : canvasWidth !== null\n ? `calc(100% - ${canvasWidth}px)`\n : \"50%\",\n }}\n >\n <div className=\"w-full max-w-3xl flex flex-col h-full\">\n <ChatMessageList\n chatMessages={chatMessages}\n isLoadingMessage={isLoadingMessage}\n onFollowupClick={handleFollowupClick}\n onRegenerate={handleRegenerate}\n />\n\n <PromptComposer\n value={localInput}\n isLoading={isLoadingMessage}\n onChange={setLocalInput}\n onSubmit={handleSubmit}\n />\n </div>\n </main>\n\n <CanvasLayout>\n {canvasType === \"story\" && <StoryCanvas/>}\n {canvasType === \"api_docs\" && <ApiDocsCanvas/>}\n {canvasType === \"release_note\" && <ReleaseNoteCanvas/>}\n </CanvasLayout>\n </div>\n\n <SettingsModal open={settingsOpen} onOpenChange={setSettingsOpen}/>\n </div>\n </ChatLabelsProvider>\n );\n}\n\nexport default Chat;\n"],"names":["Chat","title","headerActions","variant","className","labels","chatMessages","settingsOpen","setSettingsOpen","sidebarOpen","setSidebarOpen","sidebarRefreshTrigger","currentConversationId","loadConversation","handleNewConversation","isLoadingMessage","canvasType","isFullscreen","canvasWidth","isResizing","resizeWidth","handleFollowupClick","handleSubmit","handleRegenerate","localInput","setLocalInput","useChat","jsx","ChatLabelsProvider","jsxs","cn","ChatHeader","ChatSettingsButton","SidebarToggleButton","ConversationSidebar","ChatMessageList","PromptComposer","CanvasLayout","StoryCanvas","ApiDocsCanvas","ReleaseNoteCanvas","SettingsModal"],"mappings":";;;;;;;;;;;;;;;;AA4BO,SAASA,GAAK;AAAA,EACE,OAAAC,IAAQ;AAAA,EACR,eAAAC;AAAA,EACA,SAAAC,IAAU;AAAA,EACV,WAAAC;AAAA,EACA,QAAAC;AACF,GAAc;AACjC,QAAM;AAAA,IACJ,cAAAC;AAAA,IACA,cAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,aAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,uBAAAC;AAAA,IACA,uBAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,uBAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,cAAAC;AAAA,IACA,aAAAC;AAAA,IACA,YAAAC;AAAA,IACA,aAAAC;AAAA,IACA,qBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,eAAAC;AAAA,EAAA,IACEC,EAAA;AAEJ,SACE,gBAAAC,EAACC,GAAA,EAAmB,QAAAvB,GAClB,UAAA,gBAAAwB,EAAC,OAAA,EAAI,WAAWC,EAAG,eAAe1B,CAAS,GAAG,eAAY,QACxD,UAAA;AAAA,IAAA,gBAAAyB,EAACE,GAAA,EAAW,OAAA9B,GAAc,mBAAmBK,EAAa,QAAQ,SAAAH,GAC/D,UAAA;AAAA,MAAAD;AAAA,wBACA8B,GAAA,EAAmB,SAAS,MAAMxB,EAAgB,EAAI,EAAA,CAAE;AAAA,IAAA,GAC3D;AAAA,IAEA,gBAAAqB,EAAC,OAAA,EAAI,WAAU,wCACZ,UAAA;AAAA,MAAA,CAACpB,KAAe,gBAAAkB,EAACM,GAAA,EAAoB,QAAQ,MAAMvB,EAAe,EAAI,GAAE;AAAA,MAExED,KACC,gBAAAkB;AAAA,QAACO;AAAA,QAAA;AAAA,UACC,uBAAAtB;AAAA,UACA,sBAAsBC;AAAA,UACtB,mBAAmBC;AAAA,UACnB,gBAAgBH;AAAA,UAChB,SAAS,MAAMD,EAAe,EAAK;AAAA,QAAA;AAAA,MAAA;AAAA,MAIvC,gBAAAiB;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAWG;AAAA,YACT;AAAA,YACAb,KAAgB;AAAA,YAChB,CAACE,KAAc;AAAA,UAAA;AAAA,UAEjB,OAAO;AAAA,YACL,OAAOF,IACH,MACAE,KAAcC,MAAgB,OAC5B,eAAeA,CAAW,QAC1BF,MAAgB,OACd,eAAeA,CAAW,QAC1B;AAAA,UAAA;AAAA,UAGV,UAAA,gBAAAW,EAAC,OAAA,EAAI,WAAU,yCACb,UAAA;AAAA,YAAA,gBAAAF;AAAA,cAACQ;AAAA,cAAA;AAAA,gBACC,cAAA7B;AAAA,gBACA,kBAAAS;AAAA,gBACA,iBAAiBM;AAAA,gBACjB,cAAcE;AAAA,cAAA;AAAA,YAAA;AAAA,YAGhB,gBAAAI;AAAA,cAACS;AAAA,cAAA;AAAA,gBACC,OAAOZ;AAAA,gBACP,WAAWT;AAAA,gBACX,UAAUU;AAAA,gBACV,UAAUH;AAAA,cAAA;AAAA,YAAA;AAAA,UACZ,EAAA,CACF;AAAA,QAAA;AAAA,MAAA;AAAA,wBAGDe,GAAA,EACE,UAAA;AAAA,QAAArB,MAAe,6BAAYsB,GAAA,CAAA,CAAW;AAAA,QACtCtB,MAAe,cAAc,gBAAAW,EAACY,GAAA,CAAA,CAAa;AAAA,QAC3CvB,MAAe,kBAAkB,gBAAAW,EAACa,GAAA,CAAA,CAAiB;AAAA,MAAA,EAAA,CACtD;AAAA,IAAA,GACF;AAAA,IAEA,gBAAAb,EAACc,GAAA,EAAc,MAAMlC,GAAc,cAAcC,EAAA,CAAgB;AAAA,EAAA,EAAA,CACnE,EAAA,CACF;AAEJ;"}
@@ -1,7 +1,7 @@
1
- import { ReactNode } from 'react';
1
+ import { PropsWithChildren } from 'react';
2
2
  export interface ChatHeaderProps {
3
+ title: string;
3
4
  conversationCount: number;
4
- onOpenSettings: () => void;
5
- actions?: ReactNode;
5
+ variant?: string;
6
6
  }
7
- export declare function ChatHeader({ conversationCount, onOpenSettings, actions }: ChatHeaderProps): import("react/jsx-runtime").JSX.Element;
7
+ export declare function ChatHeader({ title, conversationCount, variant, children }: PropsWithChildren<ChatHeaderProps>): import("react/jsx-runtime").JSX.Element;
@@ -1,45 +1,47 @@
1
1
  "use client";
2
2
  import { jsxs as r, jsx as e } from "react/jsx-runtime";
3
- import { W as o } from "../../chunks/wand-sparkles.js";
4
- import { S as i } from "../../chunks/settings.js";
5
- function m({ conversationCount: t, onOpenSettings: s, actions: a }) {
6
- return /* @__PURE__ */ r("div", { className: "h-16 flex items-center justify-between px-4 sm:px-6 border-b border-border bg-card/95 backdrop-blur-xl transition-colors shadow-sm", children: [
7
- /* @__PURE__ */ r("div", { className: "flex items-center gap-3 sm:gap-4", children: [
8
- /* @__PURE__ */ r("div", { className: "relative group", children: [
9
- /* @__PURE__ */ e("div", { className: "absolute inset-0 bg-foreground/10 blur-xl opacity-0 group-hover:opacity-100 transition-opacity duration-500" }),
10
- /* @__PURE__ */ r(
11
- "div",
12
- {
13
- className: "relative flex h-10 w-10 sm:h-11 sm:w-11 items-center justify-center rounded-xl shadow-lg ring-1 ring-border/40 transition-transform group-hover:scale-105 duration-300 overflow-hidden",
14
- style: {
15
- background: "linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 50%, #0f0f0f 100%)",
16
- boxShadow: "inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 4px 6px rgba(0, 0, 0, 0.3)"
17
- },
18
- children: [
19
- /* @__PURE__ */ e("div", { className: "absolute inset-0 bg-gradient-to-br from-white/10 to-transparent pointer-events-none" }),
20
- /* @__PURE__ */ e(o, { className: "h-4 w-4 sm:h-5 sm:w-5 text-white relative z-10", strokeWidth: 2 })
21
- ]
22
- }
23
- )
24
- ] }),
25
- /* @__PURE__ */ e("div", { className: "flex flex-col", children: /* @__PURE__ */ e("h1", { className: "text-sm sm:text-base font-semibold text-foreground tracking-tight", children: "ClubMed USG AI Assistant" }) }),
26
- t > 0 && /* @__PURE__ */ e("div", { className: "sm:hidden ml-2 px-2 py-1 rounded-full bg-muted text-xs font-medium text-foreground", children: t })
27
- ] }),
28
- /* @__PURE__ */ r("div", { className: "flex items-center gap-2 sm:gap-3", children: [
29
- a,
30
- /* @__PURE__ */ e(
31
- "button",
32
- {
33
- onClick: s,
34
- className: "group relative flex h-9 w-9 sm:h-10 sm:w-10 items-center justify-center rounded-lg border border-border bg-card hover:bg-muted transition-all duration-200 hover:scale-105 hover:shadow-md focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:ring-offset-background",
35
- "aria-label": "Paramètres",
36
- children: /* @__PURE__ */ e(i, { className: "h-4 w-4 sm:h-5 sm:w-5 text-muted-foreground group-hover:rotate-90 transition-transform duration-500" })
37
- }
38
- )
39
- ] })
40
- ] });
3
+ import { cn as o } from "../../utils/cn.js";
4
+ import { W as d } from "../../chunks/wand-sparkles.js";
5
+ function c({ title: a, conversationCount: t, variant: s = "", children: i }) {
6
+ return /* @__PURE__ */ r(
7
+ "div",
8
+ {
9
+ className: o("h-16 flex items-center justify-between px-4 sm:px-6 border-b border-border bg-card/95 backdrop-blur-xl transition-colors", {
10
+ "shadow-sm": !(s != null && s.includes("no-shadow"))
11
+ }),
12
+ children: [
13
+ /* @__PURE__ */ r("div", { className: "flex items-center gap-3 sm:gap-4", children: [
14
+ /* @__PURE__ */ r("div", { className: "relative group", children: [
15
+ /* @__PURE__ */ e(
16
+ "div",
17
+ {
18
+ className: "absolute inset-0 bg-foreground/10 blur-xl opacity-0 group-hover:opacity-100 transition-opacity duration-500"
19
+ }
20
+ ),
21
+ /* @__PURE__ */ r(
22
+ "div",
23
+ {
24
+ className: "relative flex h-10 w-10 sm:h-11 sm:w-11 items-center justify-center rounded-xl shadow-lg ring-1 ring-border/40 transition-transform group-hover:scale-105 duration-300 overflow-hidden",
25
+ style: {
26
+ background: "linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 50%, #0f0f0f 100%)",
27
+ boxShadow: "inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 4px 6px rgba(0, 0, 0, 0.3)"
28
+ },
29
+ children: [
30
+ /* @__PURE__ */ e("div", { className: "absolute inset-0 bg-gradient-to-br from-white/10 to-transparent pointer-events-none" }),
31
+ /* @__PURE__ */ e(d, { className: "h-4 w-4 sm:h-5 sm:w-5 text-white relative z-10", strokeWidth: 2 })
32
+ ]
33
+ }
34
+ )
35
+ ] }),
36
+ /* @__PURE__ */ e("div", { className: "flex flex-col", children: /* @__PURE__ */ e("h1", { className: "text-sm sm:text-base font-semibold text-foreground tracking-tight", children: a }) }),
37
+ t > 0 && /* @__PURE__ */ e("div", { className: "sm:hidden ml-2 px-2 py-1 rounded-full bg-muted text-xs font-medium text-foreground", children: t })
38
+ ] }),
39
+ /* @__PURE__ */ e("div", { className: "flex items-center gap-2 sm:gap-3", children: i })
40
+ ]
41
+ }
42
+ );
41
43
  }
42
44
  export {
43
- m as ChatHeader
45
+ c as ChatHeader
44
46
  };
45
47
  //# sourceMappingURL=ChatHeader.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ChatHeader.js","sources":["../../../lib/organisms/chat/ChatHeader.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { Settings as SettingsIcon, Wand2 } from \"lucide-react\";\n\nexport interface ChatHeaderProps {\n conversationCount: number;\n onOpenSettings: () => void;\n actions?: ReactNode;\n}\n\nexport function ChatHeader({ conversationCount, onOpenSettings, actions }: ChatHeaderProps) {\n return (\n <div className=\"h-16 flex items-center justify-between px-4 sm:px-6 border-b border-border bg-card/95 backdrop-blur-xl transition-colors shadow-sm\">\n <div className=\"flex items-center gap-3 sm:gap-4\">\n <div className=\"relative group\">\n <div className=\"absolute inset-0 bg-foreground/10 blur-xl opacity-0 group-hover:opacity-100 transition-opacity duration-500\" />\n <div\n className=\"relative flex h-10 w-10 sm:h-11 sm:w-11 items-center justify-center rounded-xl shadow-lg ring-1 ring-border/40 transition-transform group-hover:scale-105 duration-300 overflow-hidden\"\n style={{\n background: \"linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 50%, #0f0f0f 100%)\",\n boxShadow: \"inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 4px 6px rgba(0, 0, 0, 0.3)\",\n }}\n >\n <div className=\"absolute inset-0 bg-gradient-to-br from-white/10 to-transparent pointer-events-none\" />\n <Wand2 className=\"h-4 w-4 sm:h-5 sm:w-5 text-white relative z-10\" strokeWidth={2} />\n </div>\n </div>\n\n <div className=\"flex flex-col\">\n <h1 className=\"text-sm sm:text-base font-semibold text-foreground tracking-tight\">\n ClubMed USG AI Assistant\n </h1>\n </div>\n\n {conversationCount > 0 && (\n <div className=\"sm:hidden ml-2 px-2 py-1 rounded-full bg-muted text-xs font-medium text-foreground\">\n {conversationCount}\n </div>\n )}\n </div>\n\n <div className=\"flex items-center gap-2 sm:gap-3\">\n {actions}\n <button\n onClick={onOpenSettings}\n className=\"group relative flex h-9 w-9 sm:h-10 sm:w-10 items-center justify-center rounded-lg border border-border bg-card hover:bg-muted transition-all duration-200 hover:scale-105 hover:shadow-md focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:ring-offset-background\"\n aria-label=\"Paramètres\"\n >\n <SettingsIcon className=\"h-4 w-4 sm:h-5 sm:w-5 text-muted-foreground group-hover:rotate-90 transition-transform duration-500\" />\n </button>\n </div>\n </div>\n );\n}\n"],"names":["ChatHeader","conversationCount","onOpenSettings","actions","jsxs","jsx","Wand2","SettingsIcon"],"mappings":";;;;AAWO,SAASA,EAAW,EAAE,mBAAAC,GAAmB,gBAAAC,GAAgB,SAAAC,KAA4B;AAC1F,SACE,gBAAAC,EAAC,OAAA,EAAI,WAAU,sIACb,UAAA;AAAA,IAAA,gBAAAA,EAAC,OAAA,EAAI,WAAU,oCACb,UAAA;AAAA,MAAA,gBAAAA,EAAC,OAAA,EAAI,WAAU,kBACb,UAAA;AAAA,QAAA,gBAAAC,EAAC,OAAA,EAAI,WAAU,8GAAA,CAA8G;AAAA,QAC7H,gBAAAD;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAU;AAAA,YACV,OAAO;AAAA,cACL,YAAY;AAAA,cACZ,WAAW;AAAA,YAAA;AAAA,YAGb,UAAA;AAAA,cAAA,gBAAAC,EAAC,OAAA,EAAI,WAAU,sFAAA,CAAsF;AAAA,cACrG,gBAAAA,EAACC,GAAA,EAAM,WAAU,kDAAiD,aAAa,EAAA,CAAG;AAAA,YAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MACpF,GACF;AAAA,MAEA,gBAAAD,EAAC,SAAI,WAAU,iBACb,4BAAC,MAAA,EAAG,WAAU,qEAAoE,UAAA,2BAAA,CAElF,EAAA,CACF;AAAA,MAECJ,IAAoB,KACnB,gBAAAI,EAAC,OAAA,EAAI,WAAU,sFACZ,UAAAJ,EAAA,CACH;AAAA,IAAA,GAEJ;AAAA,IAEA,gBAAAG,EAAC,OAAA,EAAI,WAAU,oCACZ,UAAA;AAAA,MAAAD;AAAA,MACD,gBAAAE;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,SAASH;AAAA,UACT,WAAU;AAAA,UACV,cAAW;AAAA,UAEX,UAAA,gBAAAG,EAACE,GAAA,EAAa,WAAU,sGAAA,CAAsG;AAAA,QAAA;AAAA,MAAA;AAAA,IAChI,EAAA,CACF;AAAA,EAAA,GACF;AAEJ;"}
1
+ {"version":3,"file":"ChatHeader.js","sources":["../../../lib/organisms/chat/ChatHeader.tsx"],"sourcesContent":["\"use client\";\n\nimport type {PropsWithChildren} from \"react\";\nimport {Wand2} from \"lucide-react\";\nimport {cn} from \"@clubmed/usg-chat-ui/utils/cn\";\n\nexport interface ChatHeaderProps {\n title: string;\n conversationCount: number;\n variant?: string;\n}\n\nexport function ChatHeader({title, conversationCount, variant = \"\", children}: PropsWithChildren<ChatHeaderProps>) {\n return (\n <div\n className={cn(\"h-16 flex items-center justify-between px-4 sm:px-6 border-b border-border bg-card/95 backdrop-blur-xl transition-colors\", {\n \"shadow-sm\": !variant?.includes(\"no-shadow\"),\n })}>\n <div className=\"flex items-center gap-3 sm:gap-4\">\n <div className=\"relative group\">\n <div\n className=\"absolute inset-0 bg-foreground/10 blur-xl opacity-0 group-hover:opacity-100 transition-opacity duration-500\"/>\n <div\n className=\"relative flex h-10 w-10 sm:h-11 sm:w-11 items-center justify-center rounded-xl shadow-lg ring-1 ring-border/40 transition-transform group-hover:scale-105 duration-300 overflow-hidden\"\n style={{\n background: \"linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 50%, #0f0f0f 100%)\",\n boxShadow: \"inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 4px 6px rgba(0, 0, 0, 0.3)\",\n }}\n >\n <div className=\"absolute inset-0 bg-gradient-to-br from-white/10 to-transparent pointer-events-none\"/>\n <Wand2 className=\"h-4 w-4 sm:h-5 sm:w-5 text-white relative z-10\" strokeWidth={2}/>\n </div>\n </div>\n\n <div className=\"flex flex-col\">\n <h1 className=\"text-sm sm:text-base font-semibold text-foreground tracking-tight\">\n {title}\n </h1>\n </div>\n\n {conversationCount > 0 && (\n <div className=\"sm:hidden ml-2 px-2 py-1 rounded-full bg-muted text-xs font-medium text-foreground\">\n {conversationCount}\n </div>\n )}\n </div>\n\n <div className=\"flex items-center gap-2 sm:gap-3\">\n {children}\n </div>\n </div>\n );\n}\n"],"names":["ChatHeader","title","conversationCount","variant","children","jsxs","cn","jsx","Wand2"],"mappings":";;;;AAYO,SAASA,EAAW,EAAC,OAAAC,GAAO,mBAAAC,GAAmB,SAAAC,IAAU,IAAI,UAAAC,KAA+C;AACjH,SACE,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC,EAAG,4HAA4H;AAAA,QACxI,aAAa,EAACH,KAAA,QAAAA,EAAS,SAAS;AAAA,MAAW,CAC5C;AAAA,MACD,UAAA;AAAA,QAAA,gBAAAE,EAAC,OAAA,EAAI,WAAU,oCACb,UAAA;AAAA,UAAA,gBAAAA,EAAC,OAAA,EAAI,WAAU,kBACb,UAAA;AAAA,YAAA,gBAAAE;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,WAAU;AAAA,cAAA;AAAA,YAAA;AAAA,YACZ,gBAAAF;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,WAAU;AAAA,gBACV,OAAO;AAAA,kBACL,YAAY;AAAA,kBACZ,WAAW;AAAA,gBAAA;AAAA,gBAGb,UAAA;AAAA,kBAAA,gBAAAE,EAAC,OAAA,EAAI,WAAU,sFAAA,CAAqF;AAAA,kBACpG,gBAAAA,EAACC,GAAA,EAAM,WAAU,kDAAiD,aAAa,EAAA,CAAE;AAAA,gBAAA;AAAA,cAAA;AAAA,YAAA;AAAA,UACnF,GACF;AAAA,UAEA,gBAAAD,EAAC,SAAI,WAAU,iBACb,4BAAC,MAAA,EAAG,WAAU,qEACX,UAAAN,EAAA,CACH,EAAA,CACF;AAAA,UAECC,IAAoB,KACnB,gBAAAK,EAAC,OAAA,EAAI,WAAU,sFACZ,UAAAL,EAAA,CACH;AAAA,QAAA,GAEJ;AAAA,QAEA,gBAAAK,EAAC,OAAA,EAAI,WAAU,oCACZ,UAAAH,EAAA,CACH;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN;"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,18 @@
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import { a as n, s as o } from "../../chunks/react.esm.js";
3
+ import { ChatHeader as a } from "./ChatHeader.js";
4
+ import { ChatLabelsProvider as r } from "../../contexts/ChatLabelsContext.js";
5
+ import { d as c, i as s, g as t } from "../../chunks/vi.2VT5v0um.js";
6
+ c("<ChatHeader />", () => {
7
+ s("renders title, actions, and conversation counter", () => {
8
+ n(
9
+ /* @__PURE__ */ e(r, { children: /* @__PURE__ */ e(a, { title: "Assistant", conversationCount: 3, children: /* @__PURE__ */ e("span", { children: "Action" }) }) })
10
+ ), t(o.getByText("Assistant")).toBeInTheDocument(), t(o.getByText("Action")).toBeInTheDocument(), t(o.getByText("3")).toBeInTheDocument();
11
+ }), s("toggles shadow based on variant and hides badge when zero conversations", () => {
12
+ const { container: i, queryByText: d } = n(
13
+ /* @__PURE__ */ e(r, { children: /* @__PURE__ */ e(a, { title: "No Shadow", conversationCount: 0, variant: "no-shadow" }) })
14
+ );
15
+ t(i.firstChild).not.toHaveClass("shadow-sm"), t(d("0")).toBeNull();
16
+ });
17
+ });
18
+ //# sourceMappingURL=ChatHeader.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChatHeader.test.js","sources":["../../../lib/organisms/chat/ChatHeader.test.tsx"],"sourcesContent":["import {render, screen} from \"@testing-library/react\";\nimport {describe, expect, it} from \"vitest\";\nimport {ChatHeader} from \"./ChatHeader\";\nimport {ChatLabelsProvider} from \"../../contexts/ChatLabelsContext\";\n\ndescribe(\"<ChatHeader />\", () => {\n it(\"renders title, actions, and conversation counter\", () => {\n render(\n <ChatLabelsProvider>\n <ChatHeader title=\"Assistant\" conversationCount={3}>\n <span>Action</span>\n </ChatHeader>\n </ChatLabelsProvider>\n );\n\n expect(screen.getByText(\"Assistant\")).toBeInTheDocument();\n expect(screen.getByText(\"Action\")).toBeInTheDocument();\n expect(screen.getByText(\"3\")).toBeInTheDocument();\n });\n\n it(\"toggles shadow based on variant and hides badge when zero conversations\", () => {\n const {container, queryByText} = render(\n <ChatLabelsProvider>\n <ChatHeader title=\"No Shadow\" conversationCount={0} variant=\"no-shadow\" />\n </ChatLabelsProvider>\n );\n\n expect(container.firstChild).not.toHaveClass(\"shadow-sm\");\n expect(queryByText(\"0\")).toBeNull();\n });\n});\n"],"names":["describe","it","render","jsx","ChatLabelsProvider","ChatHeader","expect","screen","container","queryByText"],"mappings":";;;;;AAKAA,EAAS,kBAAkB,MAAM;AAC/B,EAAAC,EAAG,oDAAoD,MAAM;AAC3D,IAAAC;AAAA,MACE,gBAAAC,EAACC,GAAA,EACC,UAAA,gBAAAD,EAACE,GAAA,EAAW,OAAM,aAAY,mBAAmB,GAC/C,UAAA,gBAAAF,EAAC,QAAA,EAAK,UAAA,SAAA,CAAM,EAAA,CACd,EAAA,CACF;AAAA,IAAA,GAGFG,EAAOC,EAAO,UAAU,WAAW,CAAC,EAAE,kBAAA,GACtCD,EAAOC,EAAO,UAAU,QAAQ,CAAC,EAAE,kBAAA,GACnCD,EAAOC,EAAO,UAAU,GAAG,CAAC,EAAE,kBAAA;AAAA,EAChC,CAAC,GAEDN,EAAG,2EAA2E,MAAM;AAClF,UAAM,EAAC,WAAAO,GAAW,aAAAC,EAAA,IAAeP;AAAA,MAC/B,gBAAAC,EAACC,GAAA,EACC,UAAA,gBAAAD,EAACE,GAAA,EAAW,OAAM,aAAY,mBAAmB,GAAG,SAAQ,YAAA,CAAY,EAAA,CAC1E;AAAA,IAAA;AAGFC,IAAAA,EAAOE,EAAU,UAAU,EAAE,IAAI,YAAY,WAAW,GACxDF,EAAOG,EAAY,GAAG,CAAC,EAAE,SAAA;AAAA,EAC3B,CAAC;AACH,CAAC;"}
@@ -4,7 +4,6 @@ interface ChatMessageListProps {
4
4
  isLoadingMessage: boolean;
5
5
  onFollowupClick: (question: string) => void;
6
6
  onRegenerate: (messageKey: string) => void;
7
- emptyStateGreeting?: string;
8
7
  }
9
- export declare function ChatMessageList({ chatMessages, isLoadingMessage, onFollowupClick, onRegenerate, emptyStateGreeting, }: ChatMessageListProps): import("react/jsx-runtime").JSX.Element;
8
+ export declare function ChatMessageList({ chatMessages, isLoadingMessage, onFollowupClick, onRegenerate, }: ChatMessageListProps): import("react/jsx-runtime").JSX.Element;
10
9
  export {};
@@ -1,73 +1,85 @@
1
1
  "use client";
2
- import { jsxs as t, jsx as e, Fragment as i } from "react/jsx-runtime";
3
- import { Branch as g, BranchMessages as x, BranchSelector as v, BranchPrevious as b, BranchPage as w, BranchNext as C } from "../../molecules/AiElements/Branch.js";
4
- import { Conversation as y, ConversationContent as B, ConversationEmptyState as S, ConversationScrollButton as N } from "../../molecules/AiElements/Conversation.js";
5
- import { Message as c, MessageContent as l } from "../../molecules/AiElements/Message.js";
6
- import { Reasoning as k, ReasoningTrigger as R, ReasoningContent as M } from "../../molecules/AiElements/Reasoning.js";
7
- import { Response as T } from "../../molecules/AiElements/Response.js";
8
- import { Sources as D, SourcesTrigger as j, SourcesContent as P, Source as Q } from "../../molecules/AiElements/Sources.js";
9
- import { MessageRenderer as W } from "./MessageRenderers.js";
10
- import { MessageActions as q } from "./MessageActions.js";
11
- import { W as z } from "../../chunks/wand-sparkles.js";
12
- function O({
2
+ import { jsxs as r, jsx as e, Fragment as d } from "react/jsx-runtime";
3
+ import { Branch as v, BranchMessages as C, BranchSelector as w, BranchPrevious as y, BranchPage as B, BranchNext as N } from "../../molecules/AiElements/Branch.js";
4
+ import { Conversation as S, ConversationContent as T, ConversationEmptyState as k, ConversationScrollButton as R } from "../../molecules/AiElements/Conversation.js";
5
+ import { Message as m, MessageContent as h } from "../../molecules/AiElements/Message.js";
6
+ import { Reasoning as D, ReasoningTrigger as M, ReasoningContent as j } from "../../molecules/AiElements/Reasoning.js";
7
+ import { Response as I } from "../../molecules/AiElements/Response.js";
8
+ import { Sources as P, SourcesTrigger as Q, SourcesContent as W, Source as q } from "../../molecules/AiElements/Sources.js";
9
+ import { MessageRenderer as z } from "./MessageRenderers.js";
10
+ import { MessageActions as A } from "./MessageActions.js";
11
+ import { useChatConfig as J } from "../../contexts/ChatContext.js";
12
+ import { useChatLabels as L } from "../../contexts/ChatLabelsContext.js";
13
+ import { W as $ } from "../../chunks/wand-sparkles.js";
14
+ function ee({
13
15
  chatMessages: a,
14
- isLoadingMessage: d,
15
- onFollowupClick: h,
16
- onRegenerate: m,
17
- emptyStateGreeting: u
16
+ isLoadingMessage: u,
17
+ onFollowupClick: f,
18
+ onRegenerate: p
18
19
  }) {
19
- const f = () => a.map(({ versions: s, ...n }, p) => /* @__PURE__ */ t(g, { defaultBranch: s.length - 1, children: [
20
- /* @__PURE__ */ e(x, { children: s.map((r) => /* @__PURE__ */ e(c, { from: n.from, children: /* @__PURE__ */ t(l, { children: [
21
- n.sources && n.sources.length > 0 && /* @__PURE__ */ t(D, { children: [
22
- /* @__PURE__ */ e(j, { count: n.sources.length }),
23
- /* @__PURE__ */ e(P, { children: n.sources.map((o) => /* @__PURE__ */ e(Q, { href: o.href, title: o.title }, o.href)) })
20
+ var l;
21
+ const { get: i, p: g } = L(), { user: s } = J(), x = () => a.map(({ versions: c, ...t }, b) => /* @__PURE__ */ r(v, { defaultBranch: c.length - 1, children: [
22
+ /* @__PURE__ */ e(C, { children: c.map((n) => /* @__PURE__ */ e(m, { from: t.from, children: /* @__PURE__ */ r(h, { children: [
23
+ t.sources && t.sources.length > 0 && /* @__PURE__ */ r(P, { children: [
24
+ /* @__PURE__ */ e(Q, { count: t.sources.length }),
25
+ /* @__PURE__ */ e(W, { children: t.sources.map((o) => /* @__PURE__ */ e(q, { href: o.href, title: o.title }, o.href)) })
24
26
  ] }),
25
- n.reasoning && /* @__PURE__ */ t(k, { duration: n.reasoning.duration, children: [
26
- /* @__PURE__ */ e(R, {}),
27
- /* @__PURE__ */ e(M, { children: n.reasoning.content })
27
+ t.reasoning && /* @__PURE__ */ r(D, { duration: t.reasoning.duration, children: [
28
+ /* @__PURE__ */ e(M, {}),
29
+ /* @__PURE__ */ e(j, { children: t.reasoning.content })
28
30
  ] }),
29
- n.from === "assistant" ? /* @__PURE__ */ t(i, { children: [
31
+ t.from === "assistant" ? /* @__PURE__ */ r(d, { children: [
30
32
  /* @__PURE__ */ e(
31
- W,
33
+ z,
32
34
  {
33
- responseType: r.responseType || "message",
34
- content: r.content,
35
- canvasData: r.canvasData,
36
- followupQuestions: r.followupQuestions,
37
- onQuestionClick: h
35
+ responseType: n.responseType || "message",
36
+ content: n.content,
37
+ canvasData: n.canvasData,
38
+ followupQuestions: n.followupQuestions,
39
+ onQuestionClick: f
38
40
  }
39
41
  ),
40
42
  /* @__PURE__ */ e(
41
- q,
43
+ A,
42
44
  {
43
- content: r.content,
44
- messageId: r.id,
45
- responseType: r.responseType,
46
- canvasData: r.canvasData,
45
+ content: n.content,
46
+ messageId: n.id,
47
+ responseType: n.responseType,
48
+ canvasData: n.canvasData,
47
49
  onRegenerate: () => {
48
- const o = a[p - 1];
49
- (o == null ? void 0 : o.from) === "user" && m(n.key);
50
+ const o = a[b - 1];
51
+ (o == null ? void 0 : o.from) === "user" && p(t.key);
50
52
  }
51
53
  }
52
54
  )
53
- ] }) : /* @__PURE__ */ e(T, { children: r.content })
54
- ] }) }, `${n.key}-${r.id}`)) }),
55
- s.length > 1 && /* @__PURE__ */ t(v, { from: n.from, children: [
56
- /* @__PURE__ */ e(b, {}),
57
- /* @__PURE__ */ e(w, {}),
58
- /* @__PURE__ */ e(C, {})
55
+ ] }) : /* @__PURE__ */ e(I, { children: n.content })
56
+ ] }) }, `${t.key}-${n.id}`)) }),
57
+ c.length > 1 && /* @__PURE__ */ r(w, { from: t.from, children: [
58
+ /* @__PURE__ */ e(y, {}),
59
+ /* @__PURE__ */ e(B, {}),
60
+ /* @__PURE__ */ e(N, {})
59
61
  ] })
60
- ] }, n.key));
61
- return /* @__PURE__ */ t(y, { className: "flex-1", children: [
62
- /* @__PURE__ */ e(B, { children: a.length === 0 ? /* @__PURE__ */ e(
63
- S,
62
+ ] }, t.key));
63
+ return /* @__PURE__ */ r(S, { className: "flex-1", children: [
64
+ /* @__PURE__ */ e(T, { children: a.length === 0 ? /* @__PURE__ */ e(
65
+ k,
64
66
  {
65
- greeting: u,
66
- title: "Bienvenue dans votre assistant de product management",
67
- description: "Je vous aide à créer des user stories Jira de qualité, générer des release notes, répondre à vos questions sur l'API ClubMed, structurer vos besoins fonctionnels. Décrivez votre besoin et commençons !",
68
- icon: /* @__PURE__ */ t("div", { className: "relative mx-auto w-fit", children: [
67
+ greeting: g(
68
+ "greetingTemplate",
69
+ "Bonjour {{firstName}} 👋",
70
+ { firstName: (l = s == null ? void 0 : s.userName) == null ? void 0 : l.split(" ")[0] }
71
+ ),
72
+ title: i(
73
+ "emptyStateTitle",
74
+ "Bienvenue dans votre assistant de product management"
75
+ ),
76
+ description: i(
77
+ "emptyStateDescription",
78
+ "Je vous aide à créer des user stories Jira de qualité, générer des release notes, répondre à vos questions sur l'API ClubMed, structurer vos besoins fonctionnels. Décrivez votre besoin et commençons !"
79
+ ),
80
+ icon: /* @__PURE__ */ r("div", { className: "relative mx-auto w-fit", children: [
69
81
  /* @__PURE__ */ e("div", { className: "absolute inset-0 bg-foreground/10 blur-3xl" }),
70
- /* @__PURE__ */ t(
82
+ /* @__PURE__ */ r(
71
83
  "div",
72
84
  {
73
85
  className: "relative flex h-16 w-16 sm:h-20 sm:w-20 items-center justify-center rounded-2xl shadow-2xl ring-1 ring-border/40 transition-transform hover:scale-110 duration-500 overflow-hidden",
@@ -77,20 +89,23 @@ function O({
77
89
  },
78
90
  children: [
79
91
  /* @__PURE__ */ e("div", { className: "absolute inset-0 bg-gradient-to-br from-white/10 to-transparent pointer-events-none" }),
80
- /* @__PURE__ */ e(z, { className: "h-8 w-8 sm:h-10 sm:w-10 text-white relative z-10", strokeWidth: 1.5 })
92
+ /* @__PURE__ */ e($, { className: "h-8 w-8 sm:h-10 sm:w-10 text-white relative z-10", strokeWidth: 1.5 })
81
93
  ]
82
94
  }
83
95
  )
84
96
  ] })
85
97
  }
86
- ) : /* @__PURE__ */ t(i, { children: [
87
- f(),
88
- d && /* @__PURE__ */ e(c, { from: "assistant", children: /* @__PURE__ */ e(l, { variant: "flat", children: /* @__PURE__ */ e("span", { className: "text-sm text-muted-foreground animate-pulse", children: "Réflexion en cours..." }) }) })
98
+ ) : /* @__PURE__ */ r(d, { children: [
99
+ x(),
100
+ u && /* @__PURE__ */ e(m, { from: "assistant", children: /* @__PURE__ */ e(h, { variant: "flat", children: /* @__PURE__ */ e("span", { className: "text-sm text-muted-foreground animate-pulse", children: i(
101
+ "assistantThinkingIndicator",
102
+ "Réflexion en cours..."
103
+ ) }) }) })
89
104
  ] }) }),
90
- /* @__PURE__ */ e(N, {})
105
+ /* @__PURE__ */ e(R, {})
91
106
  ] });
92
107
  }
93
108
  export {
94
- O as ChatMessageList
109
+ ee as ChatMessageList
95
110
  };
96
111
  //# sourceMappingURL=ChatMessageList.js.map