@clubmed/trident-ui 2.1.0-beta.3 → 2.1.0-beta.4

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 (107) hide show
  1. package/README.md +1 -0
  2. package/chunks/ChatMessage.js +282 -265
  3. package/chunks/ChatMessage.js.map +1 -1
  4. package/examples/chat-body-demo.js +4 -2
  5. package/examples/chat-body-demo.js.map +1 -1
  6. package/examples/chat-button-demo.js +2 -1
  7. package/examples/chat-button-demo.js.map +1 -1
  8. package/examples/chat-button-offset-demo.js +2 -1
  9. package/examples/chat-button-offset-demo.js.map +1 -1
  10. package/examples/chat-header-demo.js +2 -1
  11. package/examples/chat-header-demo.js.map +1 -1
  12. package/examples/chat-input-demo.js +2 -1
  13. package/examples/chat-input-demo.js.map +1 -1
  14. package/examples/chat-input-streaming-demo.d.ts +1 -0
  15. package/examples/chat-input-streaming-demo.js +30 -0
  16. package/examples/chat-input-streaming-demo.js.map +1 -0
  17. package/examples/chat-input-submit-on-enter-demo.d.ts +1 -0
  18. package/examples/chat-input-submit-on-enter-demo.js +23 -0
  19. package/examples/chat-input-submit-on-enter-demo.js.map +1 -0
  20. package/examples/chat-message-actions-demo.d.ts +1 -0
  21. package/examples/chat-message-actions-demo.js +29 -0
  22. package/examples/chat-message-actions-demo.js.map +1 -0
  23. package/examples/chat-message-demo.js +1 -0
  24. package/examples/chat-message-demo.js.map +1 -1
  25. package/examples/chat-message-editor-demo.d.ts +1 -0
  26. package/examples/chat-message-editor-demo.js +30 -0
  27. package/examples/chat-message-editor-demo.js.map +1 -0
  28. package/examples/chat-message-with-actions-demo.d.ts +1 -0
  29. package/examples/chat-message-with-actions-demo.js +26 -0
  30. package/examples/chat-message-with-actions-demo.js.map +1 -0
  31. package/examples/chat-typing-indicator-demo.js +2 -1
  32. package/examples/chat-typing-indicator-demo.js.map +1 -1
  33. package/examples/chat-window-csat-demo.js +2 -1
  34. package/examples/chat-window-csat-demo.js.map +1 -1
  35. package/examples/chat-window-csat-prompt-demo.js +2 -1
  36. package/examples/chat-window-csat-prompt-demo.js.map +1 -1
  37. package/examples/chat-window-demo.js +2 -1
  38. package/examples/chat-window-demo.js.map +1 -1
  39. package/examples/chat-window-quote-demo.js +2 -1
  40. package/examples/chat-window-quote-demo.js.map +1 -1
  41. package/examples/chat-window-quotes-demo.js +2 -1
  42. package/examples/chat-window-quotes-demo.js.map +1 -1
  43. package/package.json +1 -1
  44. package/ui/ChatBody.d.ts +1 -25
  45. package/ui/ChatBody.js +2 -88
  46. package/ui/ChatButton.d.ts +1 -6
  47. package/ui/ChatButton.js +2 -33
  48. package/ui/ChatHeader.d.ts +1 -6
  49. package/ui/ChatHeader.js +2 -43
  50. package/ui/ChatInput.d.ts +1 -10
  51. package/ui/ChatInput.js +2 -148
  52. package/ui/ChatMessage.d.ts +1 -6
  53. package/ui/ChatMessage.js +1 -0
  54. package/ui/ChatTypingIndicator.d.ts +1 -2
  55. package/ui/ChatTypingIndicator.js +2 -30
  56. package/ui/ChatWindow.d.ts +1 -34
  57. package/ui/ChatWindow.js +2 -57
  58. package/ui/ChatWindowCsatPrompt.d.ts +1 -15
  59. package/ui/ChatWindowCsatPrompt.js +2 -70
  60. package/ui/ChatWindowCsatThankYou.d.ts +1 -9
  61. package/ui/ChatWindowCsatThankYou.js +2 -28
  62. package/ui/ChatWindowQuote.d.ts +1 -22
  63. package/ui/ChatWindowQuote.js +2 -140
  64. package/ui/chat/ChatBody.d.ts +31 -0
  65. package/ui/chat/ChatBody.js +92 -0
  66. package/ui/chat/ChatBody.js.map +1 -0
  67. package/ui/chat/ChatButton.d.ts +6 -0
  68. package/ui/chat/ChatButton.js +33 -0
  69. package/ui/chat/ChatButton.js.map +1 -0
  70. package/ui/chat/ChatHeader.d.ts +6 -0
  71. package/ui/chat/ChatHeader.js +43 -0
  72. package/ui/chat/ChatHeader.js.map +1 -0
  73. package/ui/chat/ChatInput.d.ts +28 -0
  74. package/ui/chat/ChatInput.js +165 -0
  75. package/ui/chat/ChatInput.js.map +1 -0
  76. package/ui/chat/ChatMessage.d.ts +17 -0
  77. package/ui/chat/ChatMessage.js +2 -0
  78. package/ui/chat/ChatMessageActions.d.ts +23 -0
  79. package/ui/chat/ChatMessageActions.js +69 -0
  80. package/ui/chat/ChatMessageActions.js.map +1 -0
  81. package/ui/chat/ChatMessageEditor.d.ts +9 -0
  82. package/ui/chat/ChatMessageEditor.js +57 -0
  83. package/ui/chat/ChatMessageEditor.js.map +1 -0
  84. package/ui/chat/ChatTypingIndicator.d.ts +2 -0
  85. package/ui/chat/ChatTypingIndicator.js +30 -0
  86. package/ui/chat/ChatTypingIndicator.js.map +1 -0
  87. package/ui/chat/ChatWindow.d.ts +37 -0
  88. package/ui/chat/ChatWindow.js +65 -0
  89. package/ui/chat/ChatWindow.js.map +1 -0
  90. package/ui/chat/ChatWindowCsatPrompt.d.ts +15 -0
  91. package/ui/chat/ChatWindowCsatPrompt.js +71 -0
  92. package/ui/chat/ChatWindowCsatPrompt.js.map +1 -0
  93. package/ui/chat/ChatWindowCsatThankYou.d.ts +9 -0
  94. package/ui/chat/ChatWindowCsatThankYou.js +29 -0
  95. package/ui/chat/ChatWindowCsatThankYou.js.map +1 -0
  96. package/ui/chat/ChatWindowQuote.d.ts +22 -0
  97. package/ui/chat/ChatWindowQuote.js +141 -0
  98. package/ui/chat/ChatWindowQuote.js.map +1 -0
  99. package/ui/ChatBody.js.map +0 -1
  100. package/ui/ChatButton.js.map +0 -1
  101. package/ui/ChatHeader.js.map +0 -1
  102. package/ui/ChatInput.js.map +0 -1
  103. package/ui/ChatTypingIndicator.js.map +0 -1
  104. package/ui/ChatWindow.js.map +0 -1
  105. package/ui/ChatWindowCsatPrompt.js.map +0 -1
  106. package/ui/ChatWindowCsatThankYou.js.map +0 -1
  107. package/ui/ChatWindowQuote.js.map +0 -1
@@ -1,6 +1,8 @@
1
1
  "use client";
2
- import { ChatBody as e } from "../ui/ChatBody.js";
3
- import { ChatInput as t } from "../ui/ChatInput.js";
2
+ import { ChatBody as e } from "../ui/chat/ChatBody.js";
3
+ import "../ui/ChatBody.js";
4
+ import { ChatInput as t } from "../ui/chat/ChatInput.js";
5
+ import "../ui/ChatInput.js";
4
6
  import { useState as n } from "react";
5
7
  import { jsx as r, jsxs as i } from "react/jsx-runtime";
6
8
  //#region lib/examples/chat-body-demo.tsx
@@ -1 +1 @@
1
- {"version":3,"file":"chat-body-demo.js","names":[],"sources":["../../lib/examples/chat-body-demo.tsx"],"sourcesContent":["'use client';\n\nimport { useState } from 'react';\nimport { ChatBody } from '@/ui/ChatBody';\nimport type { ChatMessage } from '@/ui/ChatBody';\nimport { ChatInput } from '@/ui/ChatInput';\n\nexport default function ChatBodyDemo() {\n const [messages, setMessages] = useState<ChatMessage[]>([\n {\n id: '1',\n sender: 'assistant',\n content:\n \"Hi. Ask me anything about Club Med. I'm here to help you find the right information quickly.\",\n },\n {\n id: '2',\n sender: 'user',\n content:\n 'My son is 14 years old, and I would like to find activities for him during our stay.',\n },\n ]);\n const [inputValue, setInputValue] = useState('');\n const [isTyping, setIsTyping] = useState(false);\n\n function handleSubmit() {\n if (!inputValue.trim()) return;\n const userMsg: ChatMessage = {\n id: Date.now().toString(),\n sender: 'user',\n content: inputValue,\n };\n setMessages((prev) => [...prev, userMsg]);\n setInputValue('');\n setIsTyping(true);\n setTimeout(() => {\n setIsTyping(false);\n setMessages((prev) => [\n ...prev,\n {\n id: (Date.now() + 1).toString(),\n sender: 'assistant',\n content: 'Let me look into that for you…',\n },\n ]);\n }, 2000);\n }\n\n return (\n <div className=\"chat-border bg-white flex flex-col w-380 h-660 rounded-32 overflow-hidden\">\n <ChatBody messages={messages} isTyping={isTyping} />\n <div className=\"shrink-0 px-8 pb-8 pt-12\">\n <ChatInput value={inputValue} onValueChange={setInputValue} onSubmit={handleSubmit} />\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;AAOA,SAAwB,IAAe;CACrC,IAAM,CAAC,GAAU,KAAe,EAAwB,CACtD;EACE,IAAI;EACJ,QAAQ;EACR,SACE;EACH,EACD;EACE,IAAI;EACJ,QAAQ;EACR,SACE;EACH,CACF,CAAC,EACI,CAAC,GAAY,KAAiB,EAAS,GAAG,EAC1C,CAAC,GAAU,KAAe,EAAS,GAAM;CAE/C,SAAS,IAAe;AACtB,MAAI,CAAC,EAAW,MAAM,CAAE;EACxB,IAAM,IAAuB;GAC3B,IAAI,KAAK,KAAK,CAAC,UAAU;GACzB,QAAQ;GACR,SAAS;GACV;AAID,EAHA,GAAa,MAAS,CAAC,GAAG,GAAM,EAAQ,CAAC,EACzC,EAAc,GAAG,EACjB,EAAY,GAAK,EACjB,iBAAiB;AAEf,GADA,EAAY,GAAM,EAClB,GAAa,MAAS,CACpB,GAAG,GACH;IACE,KAAK,KAAK,KAAK,GAAG,GAAG,UAAU;IAC/B,QAAQ;IACR,SAAS;IACV,CACF,CAAC;KACD,IAAK;;AAGV,QACE,kBAAC,OAAD;EAAK,WAAU;YAAf,CACE,kBAAC,GAAD;GAAoB;GAAoB;GAAY,CAAA,EACpD,kBAAC,OAAD;GAAK,WAAU;aACb,kBAAC,GAAD;IAAW,OAAO;IAAY,eAAe;IAAe,UAAU;IAAgB,CAAA;GAClF,CAAA,CAAA"}
1
+ {"version":3,"file":"chat-body-demo.js","names":[],"sources":["../../lib/examples/chat-body-demo.tsx"],"sourcesContent":["'use client';\n\nimport { useState } from 'react';\nimport { ChatBody } from '@/ui/ChatBody';\nimport type { ChatMessage } from '@/ui/ChatBody';\nimport { ChatInput } from '@/ui/ChatInput';\n\nexport default function ChatBodyDemo() {\n const [messages, setMessages] = useState<ChatMessage[]>([\n {\n id: '1',\n sender: 'assistant',\n content:\n \"Hi. Ask me anything about Club Med. I'm here to help you find the right information quickly.\",\n },\n {\n id: '2',\n sender: 'user',\n content:\n 'My son is 14 years old, and I would like to find activities for him during our stay.',\n },\n ]);\n const [inputValue, setInputValue] = useState('');\n const [isTyping, setIsTyping] = useState(false);\n\n function handleSubmit() {\n if (!inputValue.trim()) return;\n const userMsg: ChatMessage = {\n id: Date.now().toString(),\n sender: 'user',\n content: inputValue,\n };\n setMessages((prev) => [...prev, userMsg]);\n setInputValue('');\n setIsTyping(true);\n setTimeout(() => {\n setIsTyping(false);\n setMessages((prev) => [\n ...prev,\n {\n id: (Date.now() + 1).toString(),\n sender: 'assistant',\n content: 'Let me look into that for you…',\n },\n ]);\n }, 2000);\n }\n\n return (\n <div className=\"chat-border bg-white flex flex-col w-380 h-660 rounded-32 overflow-hidden\">\n <ChatBody messages={messages} isTyping={isTyping} />\n <div className=\"shrink-0 px-8 pb-8 pt-12\">\n <ChatInput value={inputValue} onValueChange={setInputValue} onSubmit={handleSubmit} />\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;AAOA,SAAwB,IAAe;CACrC,IAAM,CAAC,GAAU,KAAe,EAAwB,CACtD;EACE,IAAI;EACJ,QAAQ;EACR,SACE;EACH,EACD;EACE,IAAI;EACJ,QAAQ;EACR,SACE;EACH,CACF,CAAC,EACI,CAAC,GAAY,KAAiB,EAAS,GAAG,EAC1C,CAAC,GAAU,KAAe,EAAS,GAAM;CAE/C,SAAS,IAAe;AACtB,MAAI,CAAC,EAAW,MAAM,CAAE;EACxB,IAAM,IAAuB;GAC3B,IAAI,KAAK,KAAK,CAAC,UAAU;GACzB,QAAQ;GACR,SAAS;GACV;AAID,EAHA,GAAa,MAAS,CAAC,GAAG,GAAM,EAAQ,CAAC,EACzC,EAAc,GAAG,EACjB,EAAY,GAAK,EACjB,iBAAiB;AAEf,GADA,EAAY,GAAM,EAClB,GAAa,MAAS,CACpB,GAAG,GACH;IACE,KAAK,KAAK,KAAK,GAAG,GAAG,UAAU;IAC/B,QAAQ;IACR,SAAS;IACV,CACF,CAAC;KACD,IAAK;;AAGV,QACE,kBAAC,OAAD;EAAK,WAAU;YAAf,CACE,kBAAC,GAAD;GAAoB;GAAoB;GAAY,CAAA,EACpD,kBAAC,OAAD;GAAK,WAAU;aACb,kBAAC,GAAD;IAAW,OAAO;IAAY,eAAe;IAAe,UAAU;IAAgB,CAAA;GAClF,CAAA,CAAA"}
@@ -1,5 +1,6 @@
1
1
  "use client";
2
- import { ChatButton as e } from "../ui/ChatButton.js";
2
+ import { ChatButton as e } from "../ui/chat/ChatButton.js";
3
+ import "../ui/ChatButton.js";
3
4
  import { jsx as t } from "react/jsx-runtime";
4
5
  //#region lib/examples/chat-button-demo.tsx
5
6
  function n() {
@@ -1 +1 @@
1
- {"version":3,"file":"chat-button-demo.js","names":[],"sources":["../../lib/examples/chat-button-demo.tsx"],"sourcesContent":["'use client';\n\nimport { ChatButton } from '@/ui/ChatButton';\n\nexport default function ChatButtonDemo() {\n return (\n <div className=\"w-full h-full flex items-center justify-end\">\n <ChatButton aria-label=\"Open Club Med assistant chat\" />\n </div>\n );\n}\n"],"mappings":";;;;AAIA,SAAwB,IAAiB;AACvC,QACE,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,GAAD,EAAY,cAAW,gCAAiC,CAAA;EACpD,CAAA"}
1
+ {"version":3,"file":"chat-button-demo.js","names":[],"sources":["../../lib/examples/chat-button-demo.tsx"],"sourcesContent":["'use client';\n\nimport { ChatButton } from '@/ui/ChatButton';\n\nexport default function ChatButtonDemo() {\n return (\n <div className=\"w-full h-full flex items-center justify-end\">\n <ChatButton aria-label=\"Open Club Med assistant chat\" />\n </div>\n );\n}\n"],"mappings":";;;;;AAIA,SAAwB,IAAiB;AACvC,QACE,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,GAAD,EAAY,cAAW,gCAAiC,CAAA;EACpD,CAAA"}
@@ -1,5 +1,6 @@
1
1
  "use client";
2
- import { ChatButton as e } from "../ui/ChatButton.js";
2
+ import { ChatButton as e } from "../ui/chat/ChatButton.js";
3
+ import "../ui/ChatButton.js";
3
4
  import { jsx as t } from "react/jsx-runtime";
4
5
  //#region lib/examples/chat-button-offset-demo.tsx
5
6
  function n() {
@@ -1 +1 @@
1
- {"version":3,"file":"chat-button-offset-demo.js","names":[],"sources":["../../lib/examples/chat-button-offset-demo.tsx"],"sourcesContent":["'use client';\n\nimport { ChatButton } from '@/ui/ChatButton';\n\nexport default function ChatButtonOffsetDemo() {\n return (\n <div className=\"absolute inset-0 flex items-center justify-end overflow-clip\">\n <ChatButton offset aria-label=\"Open Club Med assistant chat\" />\n </div>\n );\n}\n"],"mappings":";;;;AAIA,SAAwB,IAAuB;AAC7C,QACE,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,GAAD;GAAY,QAAA;GAAO,cAAW;GAAiC,CAAA;EAC3D,CAAA"}
1
+ {"version":3,"file":"chat-button-offset-demo.js","names":[],"sources":["../../lib/examples/chat-button-offset-demo.tsx"],"sourcesContent":["'use client';\n\nimport { ChatButton } from '@/ui/ChatButton';\n\nexport default function ChatButtonOffsetDemo() {\n return (\n <div className=\"absolute inset-0 flex items-center justify-end overflow-clip\">\n <ChatButton offset aria-label=\"Open Club Med assistant chat\" />\n </div>\n );\n}\n"],"mappings":";;;;;AAIA,SAAwB,IAAuB;AAC7C,QACE,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,GAAD;GAAY,QAAA;GAAO,cAAW;GAAiC,CAAA;EAC3D,CAAA"}
@@ -1,5 +1,6 @@
1
1
  "use client";
2
- import { ChatHeader as e } from "../ui/ChatHeader.js";
2
+ import { ChatHeader as e } from "../ui/chat/ChatHeader.js";
3
+ import "../ui/ChatHeader.js";
3
4
  import { jsx as t } from "react/jsx-runtime";
4
5
  //#region lib/examples/chat-header-demo.tsx
5
6
  function n() {
@@ -1 +1 @@
1
- {"version":3,"file":"chat-header-demo.js","names":[],"sources":["../../lib/examples/chat-header-demo.tsx"],"sourcesContent":["'use client';\n\nimport { ChatHeader } from '@/ui/ChatHeader';\n\nexport default function ChatHeaderDemo() {\n return (\n <div className=\"w-380\">\n <ChatHeader title=\"Ask me a question\" />\n </div>\n );\n}\n"],"mappings":";;;;AAIA,SAAwB,IAAiB;AACvC,QACE,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,GAAD,EAAY,OAAM,qBAAsB,CAAA;EACpC,CAAA"}
1
+ {"version":3,"file":"chat-header-demo.js","names":[],"sources":["../../lib/examples/chat-header-demo.tsx"],"sourcesContent":["'use client';\n\nimport { ChatHeader } from '@/ui/ChatHeader';\n\nexport default function ChatHeaderDemo() {\n return (\n <div className=\"w-380\">\n <ChatHeader title=\"Ask me a question\" />\n </div>\n );\n}\n"],"mappings":";;;;;AAIA,SAAwB,IAAiB;AACvC,QACE,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,GAAD,EAAY,OAAM,qBAAsB,CAAA;EACpC,CAAA"}
@@ -1,5 +1,6 @@
1
1
  "use client";
2
- import { ChatInput as e } from "../ui/ChatInput.js";
2
+ import { ChatInput as e } from "../ui/chat/ChatInput.js";
3
+ import "../ui/ChatInput.js";
3
4
  import { useState as t } from "react";
4
5
  import { jsx as n } from "react/jsx-runtime";
5
6
  //#region lib/examples/chat-input-demo.tsx
@@ -1 +1 @@
1
- {"version":3,"file":"chat-input-demo.js","names":[],"sources":["../../lib/examples/chat-input-demo.tsx"],"sourcesContent":["'use client';\n\nimport { useState } from 'react';\nimport { ChatInput } from '@/ui/ChatInput';\n\nexport default function ChatInputDemo() {\n const [value, setValue] = useState('');\n\n return (\n <div className=\"w-[380px]\">\n <ChatInput\n aria-label=\"Chat message input\"\n value={value}\n onValueChange={setValue}\n onSubmit={() => setValue('')}\n onAudioClick={() => {}}\n />\n </div>\n );\n}\n"],"mappings":";;;;;AAKA,SAAwB,IAAgB;CACtC,IAAM,CAAC,GAAO,KAAY,EAAS,GAAG;AAEtC,QACE,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,GAAD;GACE,cAAW;GACJ;GACP,eAAe;GACf,gBAAgB,EAAS,GAAG;GAC5B,oBAAoB;GACpB,CAAA;EACE,CAAA"}
1
+ {"version":3,"file":"chat-input-demo.js","names":[],"sources":["../../lib/examples/chat-input-demo.tsx"],"sourcesContent":["'use client';\n\nimport { useState } from 'react';\nimport { ChatInput } from '@/ui/ChatInput';\n\nexport default function ChatInputDemo() {\n const [value, setValue] = useState('');\n\n return (\n <div className=\"w-[380px]\">\n <ChatInput\n aria-label=\"Chat message input\"\n value={value}\n onValueChange={setValue}\n onSubmit={() => setValue('')}\n onAudioClick={() => {}}\n />\n </div>\n );\n}\n"],"mappings":";;;;;;AAKA,SAAwB,IAAgB;CACtC,IAAM,CAAC,GAAO,KAAY,EAAS,GAAG;AAEtC,QACE,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,GAAD;GACE,cAAW;GACJ;GACP,eAAe;GACf,gBAAgB,EAAS,GAAG;GAC5B,oBAAoB;GACpB,CAAA;EACE,CAAA"}
@@ -0,0 +1 @@
1
+ export default function ChatInputStreamingDemo(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,30 @@
1
+ "use client";
2
+ import { ChatInput as e } from "../ui/chat/ChatInput.js";
3
+ import "../ui/ChatInput.js";
4
+ import { useRef as t, useState as n } from "react";
5
+ import { jsx as r } from "react/jsx-runtime";
6
+ //#region lib/examples/chat-input-streaming-demo.tsx
7
+ function i() {
8
+ let [i, a] = n(""), [o, s] = n(!1), c = t(void 0);
9
+ function l() {
10
+ a(""), s(!0), c.current = setTimeout(() => s(!1), 4e3);
11
+ }
12
+ function u() {
13
+ clearTimeout(c.current), s(!1);
14
+ }
15
+ return /* @__PURE__ */ r("div", {
16
+ className: "w-[380px]",
17
+ children: /* @__PURE__ */ r(e, {
18
+ "aria-label": "Chat message input",
19
+ value: i,
20
+ onValueChange: a,
21
+ onSubmit: l,
22
+ isStreaming: o,
23
+ onStop: u
24
+ })
25
+ });
26
+ }
27
+ //#endregion
28
+ export { i as default };
29
+
30
+ //# sourceMappingURL=chat-input-streaming-demo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chat-input-streaming-demo.js","names":[],"sources":["../../lib/examples/chat-input-streaming-demo.tsx"],"sourcesContent":["'use client';\n\nimport { useRef, useState } from 'react';\nimport { ChatInput } from '@/ui/ChatInput';\n\nexport default function ChatInputStreamingDemo() {\n const [value, setValue] = useState('');\n const [isStreaming, setIsStreaming] = useState(false);\n const timer = useRef<ReturnType<typeof setTimeout>>(undefined);\n\n function send() {\n setValue('');\n setIsStreaming(true);\n // Simulates an answer being generated for 4 seconds\n timer.current = setTimeout(() => setIsStreaming(false), 4000);\n }\n\n function stop() {\n clearTimeout(timer.current);\n setIsStreaming(false);\n }\n\n return (\n <div className=\"w-[380px]\">\n <ChatInput\n aria-label=\"Chat message input\"\n value={value}\n onValueChange={setValue}\n onSubmit={send}\n isStreaming={isStreaming}\n onStop={stop}\n />\n </div>\n );\n}\n"],"mappings":";;;;;;AAKA,SAAwB,IAAyB;CAC/C,IAAM,CAAC,GAAO,KAAY,EAAS,GAAG,EAChC,CAAC,GAAa,KAAkB,EAAS,GAAM,EAC/C,IAAQ,EAAsC,KAAA,EAAU;CAE9D,SAAS,IAAO;AAId,EAHA,EAAS,GAAG,EACZ,EAAe,GAAK,EAEpB,EAAM,UAAU,iBAAiB,EAAe,GAAM,EAAE,IAAK;;CAG/D,SAAS,IAAO;AAEd,EADA,aAAa,EAAM,QAAQ,EAC3B,EAAe,GAAM;;AAGvB,QACE,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,GAAD;GACE,cAAW;GACJ;GACP,eAAe;GACf,UAAU;GACG;GACb,QAAQ;GACR,CAAA;EACE,CAAA"}
@@ -0,0 +1 @@
1
+ export default function ChatInputSubmitOnEnterDemo(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,23 @@
1
+ "use client";
2
+ import { ChatInput as e } from "../ui/chat/ChatInput.js";
3
+ import "../ui/ChatInput.js";
4
+ import { useState as t } from "react";
5
+ import { jsx as n } from "react/jsx-runtime";
6
+ //#region lib/examples/chat-input-submit-on-enter-demo.tsx
7
+ function r() {
8
+ let [r, i] = t("");
9
+ return /* @__PURE__ */ n("div", {
10
+ className: "w-[380px]",
11
+ children: /* @__PURE__ */ n(e, {
12
+ "aria-label": "Chat message input",
13
+ value: r,
14
+ onValueChange: i,
15
+ onSubmit: () => i(""),
16
+ submitKey: "enter"
17
+ })
18
+ });
19
+ }
20
+ //#endregion
21
+ export { r as default };
22
+
23
+ //# sourceMappingURL=chat-input-submit-on-enter-demo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chat-input-submit-on-enter-demo.js","names":[],"sources":["../../lib/examples/chat-input-submit-on-enter-demo.tsx"],"sourcesContent":["'use client';\n\nimport { useState } from 'react';\nimport { ChatInput } from '@/ui/ChatInput';\n\nexport default function ChatInputSubmitOnEnterDemo() {\n const [value, setValue] = useState('');\n\n return (\n <div className=\"w-[380px]\">\n <ChatInput\n aria-label=\"Chat message input\"\n value={value}\n onValueChange={setValue}\n onSubmit={() => setValue('')}\n submitKey=\"enter\"\n />\n </div>\n );\n}\n"],"mappings":";;;;;;AAKA,SAAwB,IAA6B;CACnD,IAAM,CAAC,GAAO,KAAY,EAAS,GAAG;AAEtC,QACE,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,GAAD;GACE,cAAW;GACJ;GACP,eAAe;GACf,gBAAgB,EAAS,GAAG;GAC5B,WAAU;GACV,CAAA;EACE,CAAA"}
@@ -0,0 +1 @@
1
+ export default function ChatMessageActionsDemo(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,29 @@
1
+ "use client";
2
+ import { ChatMessageActions as e } from "../ui/chat/ChatMessageActions.js";
3
+ import { useState as t } from "react";
4
+ import { jsx as n, jsxs as r } from "react/jsx-runtime";
5
+ //#region lib/examples/chat-message-actions-demo.tsx
6
+ function i() {
7
+ let [i, a] = t("none");
8
+ return /* @__PURE__ */ r("div", {
9
+ className: "w-[380px] flex flex-col items-end gap-8",
10
+ children: [/* @__PURE__ */ r("div", {
11
+ className: "group/message flex flex-col items-end gap-4",
12
+ children: [/* @__PURE__ */ n("p", {
13
+ className: "text-b3 bg-lightSand rounded-32 px-24 py-12 text-black",
14
+ children: "Hover this message to reveal its actions."
15
+ }), /* @__PURE__ */ n(e, {
16
+ onReplay: () => a("replay"),
17
+ onEdit: () => a("edit"),
18
+ onCopy: () => a("copy")
19
+ })]
20
+ }), /* @__PURE__ */ r("p", {
21
+ className: "text-b4 text-darkGrey",
22
+ children: ["Last action: ", i]
23
+ })]
24
+ });
25
+ }
26
+ //#endregion
27
+ export { i as default };
28
+
29
+ //# sourceMappingURL=chat-message-actions-demo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chat-message-actions-demo.js","names":[],"sources":["../../lib/examples/chat-message-actions-demo.tsx"],"sourcesContent":["'use client';\n\nimport { useState } from 'react';\nimport { ChatMessageActions } from '@/ui/chat/ChatMessageActions';\n\nexport default function ChatMessageActionsDemo() {\n const [lastAction, setLastAction] = useState('none');\n\n return (\n <div className=\"w-[380px] flex flex-col items-end gap-8\">\n {/* The actions are revealed when the parent `group/message` is hovered or focused */}\n <div className=\"group/message flex flex-col items-end gap-4\">\n <p className=\"text-b3 bg-lightSand rounded-32 px-24 py-12 text-black\">\n Hover this message to reveal its actions.\n </p>\n <ChatMessageActions\n onReplay={() => setLastAction('replay')}\n onEdit={() => setLastAction('edit')}\n onCopy={() => setLastAction('copy')}\n />\n </div>\n <p className=\"text-b4 text-darkGrey\">Last action: {lastAction}</p>\n </div>\n );\n}\n"],"mappings":";;;;;AAKA,SAAwB,IAAyB;CAC/C,IAAM,CAAC,GAAY,KAAiB,EAAS,OAAO;AAEpD,QACE,kBAAC,OAAD;EAAK,WAAU;YAAf,CAEE,kBAAC,OAAD;GAAK,WAAU;aAAf,CACE,kBAAC,KAAD;IAAG,WAAU;cAAyD;IAElE,CAAA,EACJ,kBAAC,GAAD;IACE,gBAAgB,EAAc,SAAS;IACvC,cAAc,EAAc,OAAO;IACnC,cAAc,EAAc,OAAA;IAC5B,CAAA,CAAA;MAEJ,kBAAC,KAAD;GAAG,WAAU;aAAb,CAAqC,iBAAc,EAAA"}
@@ -1,5 +1,6 @@
1
1
  "use client";
2
2
  import { t as e } from "../chunks/ChatMessage.js";
3
+ import "../ui/ChatMessage.js";
3
4
  import { jsx as t, jsxs as n } from "react/jsx-runtime";
4
5
  //#region lib/examples/chat-message-demo.tsx
5
6
  function r() {
@@ -1 +1 @@
1
- {"version":3,"file":"chat-message-demo.js","names":[],"sources":["../../lib/examples/chat-message-demo.tsx"],"sourcesContent":["'use client';\n\nimport { ChatMessage } from '@/ui/ChatMessage';\n\nexport default function ChatMessageDemo() {\n return (\n <div className=\"w-[380px] flex flex-col gap-4\">\n <ChatMessage sender=\"assistant\">\n Hi. Ask me anything about Club Med. I&apos;m here to help you find the right information\n quickly.\n </ChatMessage>\n <ChatMessage sender=\"user\">\n My son is 14 years old, and I would like to find activities for him during our stay. What do\n you suggest?\n </ChatMessage>\n </div>\n );\n}\n"],"mappings":";;;;AAIA,SAAwB,IAAkB;AACxC,QACE,kBAAC,OAAD;EAAK,WAAU;YAAf,CACE,kBAAC,GAAD;GAAa,QAAO;aAAY;GAGlB,CAAA,EACd,kBAAC,GAAD;GAAa,QAAO;aAAO;GAGb,CAAA,CAAA"}
1
+ {"version":3,"file":"chat-message-demo.js","names":[],"sources":["../../lib/examples/chat-message-demo.tsx"],"sourcesContent":["'use client';\n\nimport { ChatMessage } from '@/ui/ChatMessage';\n\nexport default function ChatMessageDemo() {\n return (\n <div className=\"w-[380px] flex flex-col gap-4\">\n <ChatMessage sender=\"assistant\">\n Hi. Ask me anything about Club Med. I&apos;m here to help you find the right information\n quickly.\n </ChatMessage>\n <ChatMessage sender=\"user\">\n My son is 14 years old, and I would like to find activities for him during our stay. What do\n you suggest?\n </ChatMessage>\n </div>\n );\n}\n"],"mappings":";;;;;AAIA,SAAwB,IAAkB;AACxC,QACE,kBAAC,OAAD;EAAK,WAAU;YAAf,CACE,kBAAC,GAAD;GAAa,QAAO;aAAY;GAGlB,CAAA,EACd,kBAAC,GAAD;GAAa,QAAO;aAAO;GAGb,CAAA,CAAA"}
@@ -0,0 +1 @@
1
+ export default function ChatMessageEditorDemo(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,30 @@
1
+ "use client";
2
+ import { ChatMessageEditor as e } from "../ui/chat/ChatMessageEditor.js";
3
+ import { useState as t } from "react";
4
+ import { Fragment as n, jsx as r, jsxs as i } from "react/jsx-runtime";
5
+ //#region lib/examples/chat-message-editor-demo.tsx
6
+ function a() {
7
+ let [a, o] = t("My son is 14 years old, what activities do you suggest?"), [s, c] = t(!0);
8
+ return /* @__PURE__ */ r("div", {
9
+ className: "w-[380px] flex flex-col items-end gap-8 px-20",
10
+ children: s ? /* @__PURE__ */ r(e, {
11
+ value: a,
12
+ onCancel: () => c(!1),
13
+ onSubmit: (e) => {
14
+ o(e), c(!1);
15
+ }
16
+ }) : /* @__PURE__ */ i(n, { children: [/* @__PURE__ */ r("p", {
17
+ className: "text-b3 bg-lightSand rounded-32 px-24 py-12 text-black",
18
+ children: a
19
+ }), /* @__PURE__ */ r("button", {
20
+ type: "button",
21
+ onClick: () => c(!0),
22
+ className: "text-b4 font-semibold underline underline-offset-2",
23
+ children: "Edit again"
24
+ })] })
25
+ });
26
+ }
27
+ //#endregion
28
+ export { a as default };
29
+
30
+ //# sourceMappingURL=chat-message-editor-demo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chat-message-editor-demo.js","names":[],"sources":["../../lib/examples/chat-message-editor-demo.tsx"],"sourcesContent":["'use client';\n\nimport { useState } from 'react';\nimport { ChatMessageEditor } from '@/ui/chat/ChatMessageEditor';\n\nexport default function ChatMessageEditorDemo() {\n const [message, setMessage] = useState('My son is 14 years old, what activities do you suggest?');\n const [isEditing, setIsEditing] = useState(true);\n\n return (\n <div className=\"w-[380px] flex flex-col items-end gap-8 px-20\">\n {isEditing ? (\n <ChatMessageEditor\n value={message}\n onCancel={() => setIsEditing(false)}\n onSubmit={(content) => {\n setMessage(content);\n setIsEditing(false);\n }}\n />\n ) : (\n <>\n <p className=\"text-b3 bg-lightSand rounded-32 px-24 py-12 text-black\">{message}</p>\n <button\n type=\"button\"\n onClick={() => setIsEditing(true)}\n className=\"text-b4 font-semibold underline underline-offset-2\"\n >\n Edit again\n </button>\n </>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;AAKA,SAAwB,IAAwB;CAC9C,IAAM,CAAC,GAAS,KAAc,EAAS,0DAA0D,EAC3F,CAAC,GAAW,KAAgB,EAAS,GAAK;AAEhD,QACE,kBAAC,OAAD;EAAK,WAAU;YACZ,IACC,kBAAC,GAAD;GACE,OAAO;GACP,gBAAgB,EAAa,GAAM;GACnC,WAAW,MAAY;AAErB,IADA,EAAW,EAAQ,EACnB,EAAa,GAAM;;GAErB,CAAA,GAEF,kBAAA,GAAA,EAAA,UAAA,CACE,kBAAC,KAAD;GAAG,WAAU;aAA0D;GAAY,CAAA,EACnF,kBAAC,UAAD;GACE,MAAK;GACL,eAAe,EAAa,GAAK;GACjC,WAAU;aACX;GAEQ,CAAA,CACR,EAAA,CAAA;EAED,CAAA"}
@@ -0,0 +1 @@
1
+ export default function ChatMessageWithActionsDemo(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,26 @@
1
+ "use client";
2
+ import { t as e } from "../chunks/ChatMessage.js";
3
+ import "../ui/ChatMessage.js";
4
+ import { useState as t } from "react";
5
+ import { jsx as n, jsxs as r } from "react/jsx-runtime";
6
+ //#region lib/examples/chat-message-with-actions-demo.tsx
7
+ function i() {
8
+ let [i, a] = t("Can you suggest activities for a 14 year old?");
9
+ return /* @__PURE__ */ r("div", {
10
+ className: "w-[380px] flex flex-col gap-4",
11
+ children: [/* @__PURE__ */ n(e, {
12
+ sender: "assistant",
13
+ children: "Hi. Ask me anything about Club Med. I'm here to help you find the right information quickly."
14
+ }), /* @__PURE__ */ n(e, {
15
+ sender: "user",
16
+ onReplay: () => {},
17
+ onEdit: a,
18
+ onCopy: () => navigator.clipboard.writeText(i),
19
+ children: i
20
+ })]
21
+ });
22
+ }
23
+ //#endregion
24
+ export { i as default };
25
+
26
+ //# sourceMappingURL=chat-message-with-actions-demo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chat-message-with-actions-demo.js","names":[],"sources":["../../lib/examples/chat-message-with-actions-demo.tsx"],"sourcesContent":["'use client';\n\nimport { useState } from 'react';\nimport { ChatMessage } from '@/ui/ChatMessage';\n\nexport default function ChatMessageWithActionsDemo() {\n const [content, setContent] = useState('Can you suggest activities for a 14 year old?');\n\n return (\n <div className=\"w-[380px] flex flex-col gap-4\">\n <ChatMessage sender=\"assistant\">\n Hi. Ask me anything about Club Med. I&apos;m here to help you find the right information\n quickly.\n </ChatMessage>\n <ChatMessage\n sender=\"user\"\n onReplay={() => {}}\n onEdit={setContent}\n onCopy={() => navigator.clipboard.writeText(content)}\n >\n {content}\n </ChatMessage>\n </div>\n );\n}\n"],"mappings":";;;;;;AAKA,SAAwB,IAA6B;CACnD,IAAM,CAAC,GAAS,KAAc,EAAS,gDAAgD;AAEvF,QACE,kBAAC,OAAD;EAAK,WAAU;YAAf,CACE,kBAAC,GAAD;GAAa,QAAO;aAAY;GAGlB,CAAA,EACd,kBAAC,GAAD;GACE,QAAO;GACP,gBAAgB;GAChB,QAAQ;GACR,cAAc,UAAU,UAAU,UAAU,EAAQ;aAEnD;GACW,CAAA,CAAA"}
@@ -1,5 +1,6 @@
1
1
  "use client";
2
- import { ChatTypingIndicator as e } from "../ui/ChatTypingIndicator.js";
2
+ import { ChatTypingIndicator as e } from "../ui/chat/ChatTypingIndicator.js";
3
+ import "../ui/ChatTypingIndicator.js";
3
4
  import { jsx as t } from "react/jsx-runtime";
4
5
  //#region lib/examples/chat-typing-indicator-demo.tsx
5
6
  function n() {
@@ -1 +1 @@
1
- {"version":3,"file":"chat-typing-indicator-demo.js","names":[],"sources":["../../lib/examples/chat-typing-indicator-demo.tsx"],"sourcesContent":["'use client';\n\nimport { ChatTypingIndicator } from '@/ui/ChatTypingIndicator';\n\nexport default function ChatTypingIndicatorDemo() {\n return (\n <div className=\"flex flex-col gap-4 p-8\">\n <ChatTypingIndicator />\n </div>\n );\n}\n"],"mappings":";;;;AAIA,SAAwB,IAA0B;AAChD,QACE,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,GAAD,EAAuB,CAAA;EACnB,CAAA"}
1
+ {"version":3,"file":"chat-typing-indicator-demo.js","names":[],"sources":["../../lib/examples/chat-typing-indicator-demo.tsx"],"sourcesContent":["'use client';\n\nimport { ChatTypingIndicator } from '@/ui/ChatTypingIndicator';\n\nexport default function ChatTypingIndicatorDemo() {\n return (\n <div className=\"flex flex-col gap-4 p-8\">\n <ChatTypingIndicator />\n </div>\n );\n}\n"],"mappings":";;;;;AAIA,SAAwB,IAA0B;AAChD,QACE,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,GAAD,EAAuB,CAAA;EACnB,CAAA"}
@@ -1,5 +1,6 @@
1
1
  "use client";
2
- import { ChatWindow as e } from "../ui/ChatWindow.js";
2
+ import { ChatWindow as e } from "../ui/chat/ChatWindow.js";
3
+ import "../ui/ChatWindow.js";
3
4
  import { useRef as t } from "react";
4
5
  import { jsx as n, jsxs as r } from "react/jsx-runtime";
5
6
  //#region lib/examples/chat-window-csat-demo.tsx
@@ -1 +1 @@
1
- {"version":3,"file":"chat-window-csat-demo.js","names":[],"sources":["../../lib/examples/chat-window-csat-demo.tsx"],"sourcesContent":["'use client';\n\nimport { useRef } from 'react';\nimport { ChatWindow } from '@/ui/ChatWindow';\nimport type {\n ChatWindowCsatPromptLabels,\n ChatWindowCsatThankYouLabels,\n ChatWindowHandle,\n ChatWindowMessage,\n} from '@/ui/ChatWindow';\n\nconst messages: ChatWindowMessage[] = [\n {\n id: '1',\n sender: 'assistant',\n content:\n \"Hi. Ask me anything about Club Med. I'm here to help you find the right information quickly.\",\n },\n {\n id: '2',\n sender: 'user',\n content: 'My son is 14 years old, what activities are available for him during our stay?',\n },\n {\n id: '3',\n sender: 'assistant',\n content:\n 'Great question! For teenagers aged 13–17, Club Med offers the Passworld programme — supervised sports, creative workshops, and evening events designed specifically for that age group.',\n },\n];\n\nconst csatLabels: ChatWindowCsatPromptLabels = {\n intro: 'Your opinion matters! Tell us what you think. Your feedback helps us improve.',\n question:\n 'Following our conversation, from 1 to 5, how satisfied are you with the level of service you received,',\n questionNote: '1 star being \"Very dissatisfied\" and 5 stars \"Very satisfied\".',\n groupAriaLabel: 'Rate your experience from 1 to 5 stars',\n starLabels: ['Very dissatisfied', 'Dissatisfied', 'Neutral', 'Satisfied', 'Very satisfied'],\n};\n\nconst csatThankYouLabels: ChatWindowCsatThankYouLabels = {\n title: 'Thank you for your feedback!',\n body: 'Your opinion means a lot to us. Thanks to your responses, we keep improving our services to offer you an even more exceptional Club Med experience.',\n};\n\nfunction csatRenderRatingLabel(rating: number) {\n return `${rating} star${rating > 1 ? 's' : ''} — ${csatLabels.starLabels[rating - 1]}`;\n}\n\nexport default function ChatWindowCsatDemo() {\n const chatRef = useRef<ChatWindowHandle>(null);\n\n return (\n <div className=\"flex flex-col items-center gap-12\">\n <ChatWindow\n aria-label=\"Assistant chat\"\n ref={chatRef}\n messages={messages}\n inputValue=\"\"\n onInputChange={() => {}}\n onSubmit={() => {}}\n csatLabels={csatLabels}\n csatRenderRatingLabel={csatRenderRatingLabel}\n csatThankYouLabels={csatThankYouLabels}\n onFeedbackRate={(rating) => console.log('Feedback rating:', rating)}\n onClose={() => {}}\n className=\"w-380 h-660\"\n />\n <button\n type=\"button\"\n onClick={() => chatRef.current?.askForFeedback()}\n className=\"px-16 py-8 bg-saffron rounded-pill text-black text-b4 font-semibold hover:opacity-80 transition-opacity\"\n >\n Trigger feedback prompt\n </button>\n </div>\n );\n}\n"],"mappings":";;;;;AAWA,IAAM,IAAgC;CACpC;EACE,IAAI;EACJ,QAAQ;EACR,SACE;EACH;CACD;EACE,IAAI;EACJ,QAAQ;EACR,SAAS;EACV;CACD;EACE,IAAI;EACJ,QAAQ;EACR,SACE;;CAEL,EAEK,IAAyC;CAC7C,OAAO;CACP,UACE;CACF,cAAc;CACd,gBAAgB;CAChB,YAAY;EAAC;EAAqB;EAAgB;EAAW;EAAa;;CAC3E,EAEK,IAAmD;CACvD,OAAO;CACP,MAAM;CACP;AAED,SAAS,EAAsB,GAAgB;AAC7C,QAAO,GAAG,EAAO,OAAO,IAAS,IAAI,MAAM,GAAG,KAAK,EAAW,WAAW,IAAS;;AAGpF,SAAwB,IAAqB;CAC3C,IAAM,IAAU,EAAyB,KAAK;AAE9C,QACE,kBAAC,OAAD;EAAK,WAAU;YAAf,CACE,kBAAC,GAAD;GACE,cAAW;GACX,KAAK;GACK;GACV,YAAW;GACX,qBAAqB;GACrB,gBAAgB;GACJ;GACW;GACH;GACpB,iBAAiB,MAAW,QAAQ,IAAI,oBAAoB,EAAO;GACnE,eAAe;GACf,WAAU;GACV,CAAA,EACF,kBAAC,UAAD;GACE,MAAK;GACL,eAAe,EAAQ,SAAS,gBAAgB;GAChD,WAAU;aACX;GAEQ,CAAA,CAAA"}
1
+ {"version":3,"file":"chat-window-csat-demo.js","names":[],"sources":["../../lib/examples/chat-window-csat-demo.tsx"],"sourcesContent":["'use client';\n\nimport { useRef } from 'react';\nimport { ChatWindow } from '@/ui/ChatWindow';\nimport type {\n ChatWindowCsatPromptLabels,\n ChatWindowCsatThankYouLabels,\n ChatWindowHandle,\n ChatWindowMessage,\n} from '@/ui/ChatWindow';\n\nconst messages: ChatWindowMessage[] = [\n {\n id: '1',\n sender: 'assistant',\n content:\n \"Hi. Ask me anything about Club Med. I'm here to help you find the right information quickly.\",\n },\n {\n id: '2',\n sender: 'user',\n content: 'My son is 14 years old, what activities are available for him during our stay?',\n },\n {\n id: '3',\n sender: 'assistant',\n content:\n 'Great question! For teenagers aged 13–17, Club Med offers the Passworld programme — supervised sports, creative workshops, and evening events designed specifically for that age group.',\n },\n];\n\nconst csatLabels: ChatWindowCsatPromptLabels = {\n intro: 'Your opinion matters! Tell us what you think. Your feedback helps us improve.',\n question:\n 'Following our conversation, from 1 to 5, how satisfied are you with the level of service you received,',\n questionNote: '1 star being \"Very dissatisfied\" and 5 stars \"Very satisfied\".',\n groupAriaLabel: 'Rate your experience from 1 to 5 stars',\n starLabels: ['Very dissatisfied', 'Dissatisfied', 'Neutral', 'Satisfied', 'Very satisfied'],\n};\n\nconst csatThankYouLabels: ChatWindowCsatThankYouLabels = {\n title: 'Thank you for your feedback!',\n body: 'Your opinion means a lot to us. Thanks to your responses, we keep improving our services to offer you an even more exceptional Club Med experience.',\n};\n\nfunction csatRenderRatingLabel(rating: number) {\n return `${rating} star${rating > 1 ? 's' : ''} — ${csatLabels.starLabels[rating - 1]}`;\n}\n\nexport default function ChatWindowCsatDemo() {\n const chatRef = useRef<ChatWindowHandle>(null);\n\n return (\n <div className=\"flex flex-col items-center gap-12\">\n <ChatWindow\n aria-label=\"Assistant chat\"\n ref={chatRef}\n messages={messages}\n inputValue=\"\"\n onInputChange={() => {}}\n onSubmit={() => {}}\n csatLabels={csatLabels}\n csatRenderRatingLabel={csatRenderRatingLabel}\n csatThankYouLabels={csatThankYouLabels}\n onFeedbackRate={(rating) => console.log('Feedback rating:', rating)}\n onClose={() => {}}\n className=\"w-380 h-660\"\n />\n <button\n type=\"button\"\n onClick={() => chatRef.current?.askForFeedback()}\n className=\"px-16 py-8 bg-saffron rounded-pill text-black text-b4 font-semibold hover:opacity-80 transition-opacity\"\n >\n Trigger feedback prompt\n </button>\n </div>\n );\n}\n"],"mappings":";;;;;;AAWA,IAAM,IAAgC;CACpC;EACE,IAAI;EACJ,QAAQ;EACR,SACE;EACH;CACD;EACE,IAAI;EACJ,QAAQ;EACR,SAAS;EACV;CACD;EACE,IAAI;EACJ,QAAQ;EACR,SACE;;CAEL,EAEK,IAAyC;CAC7C,OAAO;CACP,UACE;CACF,cAAc;CACd,gBAAgB;CAChB,YAAY;EAAC;EAAqB;EAAgB;EAAW;EAAa;;CAC3E,EAEK,IAAmD;CACvD,OAAO;CACP,MAAM;CACP;AAED,SAAS,EAAsB,GAAgB;AAC7C,QAAO,GAAG,EAAO,OAAO,IAAS,IAAI,MAAM,GAAG,KAAK,EAAW,WAAW,IAAS;;AAGpF,SAAwB,IAAqB;CAC3C,IAAM,IAAU,EAAyB,KAAK;AAE9C,QACE,kBAAC,OAAD;EAAK,WAAU;YAAf,CACE,kBAAC,GAAD;GACE,cAAW;GACX,KAAK;GACK;GACV,YAAW;GACX,qBAAqB;GACrB,gBAAgB;GACJ;GACW;GACH;GACpB,iBAAiB,MAAW,QAAQ,IAAI,oBAAoB,EAAO;GACnE,eAAe;GACf,WAAU;GACV,CAAA,EACF,kBAAC,UAAD;GACE,MAAK;GACL,eAAe,EAAQ,SAAS,gBAAgB;GAChD,WAAU;aACX;GAEQ,CAAA,CAAA"}
@@ -1,5 +1,6 @@
1
1
  "use client";
2
- import { ChatWindowCsatPrompt as e } from "../ui/ChatWindowCsatPrompt.js";
2
+ import { ChatWindowCsatPrompt as e } from "../ui/chat/ChatWindowCsatPrompt.js";
3
+ import "../ui/ChatWindowCsatPrompt.js";
3
4
  import { useState as t } from "react";
4
5
  import { jsx as n, jsxs as r } from "react/jsx-runtime";
5
6
  //#region lib/examples/chat-window-csat-prompt-demo.tsx
@@ -1 +1 @@
1
- {"version":3,"file":"chat-window-csat-prompt-demo.js","names":[],"sources":["../../lib/examples/chat-window-csat-prompt-demo.tsx"],"sourcesContent":["'use client';\n\nimport { useState } from 'react';\nimport { ChatWindowCsatPrompt } from '@/ui/ChatWindowCsatPrompt';\nimport type { ChatWindowCsatPromptLabels } from '@/ui/ChatWindowCsatPrompt';\n\nconst defaultCsatLabels: ChatWindowCsatPromptLabels = {\n intro: 'Your opinion matters! Tell us what you think. Your feedback helps us improve.',\n question:\n 'Following our conversation, from 1 to 5, how satisfied are you with the level of service you received,',\n questionNote: '1 star being \"Very dissatisfied\" and 5 stars \"Very satisfied\".',\n groupAriaLabel: 'Rate your experience from 1 to 5 stars',\n starLabels: ['Very dissatisfied', 'Dissatisfied', 'Neutral', 'Satisfied', 'Very satisfied'],\n};\n\nfunction defaultRenderRatingLabel(rating: number) {\n const labels = defaultCsatLabels.starLabels;\n return `${rating} star${rating > 1 ? 's' : ''} — ${labels[rating - 1]}`;\n}\n\nexport default function ChatWindowCsatPromptDemo() {\n const [lastRating, setLastRating] = useState<number | null>(null);\n\n return (\n <div className=\"flex flex-col gap-20 w-380\">\n <ChatWindowCsatPrompt\n labels={defaultCsatLabels}\n renderRatingLabel={defaultRenderRatingLabel}\n onRate={setLastRating}\n />\n {lastRating !== null && (\n <p className=\"text-b4 text-darkGrey text-center\">\n onRate called with: <strong>{lastRating}</strong>\n </p>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;AAMA,IAAM,IAAgD;CACpD,OAAO;CACP,UACE;CACF,cAAc;CACd,gBAAgB;CAChB,YAAY;EAAC;EAAqB;EAAgB;EAAW;EAAa;;CAC3E;AAED,SAAS,EAAyB,GAAgB;CAChD,IAAM,IAAS,EAAkB;AACjC,QAAO,GAAG,EAAO,OAAO,IAAS,IAAI,MAAM,GAAG,KAAK,EAAO,IAAS;;AAGrE,SAAwB,IAA2B;CACjD,IAAM,CAAC,GAAY,KAAiB,EAAwB,KAAK;AAEjE,QACE,kBAAC,OAAD;EAAK,WAAU;YAAf,CACE,kBAAC,GAAD;GACE,QAAQ;GACR,mBAAmB;GACnB,QAAQ;GACR,CAAA,EACD,MAAe,QACd,kBAAC,KAAD;GAAG,WAAU;aAAb,CAAiD,wBAC3B,kBAAC,UAAD,EAAA,UAAS,GAAoB,CAAA,CAAA"}
1
+ {"version":3,"file":"chat-window-csat-prompt-demo.js","names":[],"sources":["../../lib/examples/chat-window-csat-prompt-demo.tsx"],"sourcesContent":["'use client';\n\nimport { useState } from 'react';\nimport { ChatWindowCsatPrompt } from '@/ui/ChatWindowCsatPrompt';\nimport type { ChatWindowCsatPromptLabels } from '@/ui/ChatWindowCsatPrompt';\n\nconst defaultCsatLabels: ChatWindowCsatPromptLabels = {\n intro: 'Your opinion matters! Tell us what you think. Your feedback helps us improve.',\n question:\n 'Following our conversation, from 1 to 5, how satisfied are you with the level of service you received,',\n questionNote: '1 star being \"Very dissatisfied\" and 5 stars \"Very satisfied\".',\n groupAriaLabel: 'Rate your experience from 1 to 5 stars',\n starLabels: ['Very dissatisfied', 'Dissatisfied', 'Neutral', 'Satisfied', 'Very satisfied'],\n};\n\nfunction defaultRenderRatingLabel(rating: number) {\n const labels = defaultCsatLabels.starLabels;\n return `${rating} star${rating > 1 ? 's' : ''} — ${labels[rating - 1]}`;\n}\n\nexport default function ChatWindowCsatPromptDemo() {\n const [lastRating, setLastRating] = useState<number | null>(null);\n\n return (\n <div className=\"flex flex-col gap-20 w-380\">\n <ChatWindowCsatPrompt\n labels={defaultCsatLabels}\n renderRatingLabel={defaultRenderRatingLabel}\n onRate={setLastRating}\n />\n {lastRating !== null && (\n <p className=\"text-b4 text-darkGrey text-center\">\n onRate called with: <strong>{lastRating}</strong>\n </p>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;AAMA,IAAM,IAAgD;CACpD,OAAO;CACP,UACE;CACF,cAAc;CACd,gBAAgB;CAChB,YAAY;EAAC;EAAqB;EAAgB;EAAW;EAAa;;CAC3E;AAED,SAAS,EAAyB,GAAgB;CAChD,IAAM,IAAS,EAAkB;AACjC,QAAO,GAAG,EAAO,OAAO,IAAS,IAAI,MAAM,GAAG,KAAK,EAAO,IAAS;;AAGrE,SAAwB,IAA2B;CACjD,IAAM,CAAC,GAAY,KAAiB,EAAwB,KAAK;AAEjE,QACE,kBAAC,OAAD;EAAK,WAAU;YAAf,CACE,kBAAC,GAAD;GACE,QAAQ;GACR,mBAAmB;GACnB,QAAQ;GACR,CAAA,EACD,MAAe,QACd,kBAAC,KAAD;GAAG,WAAU;aAAb,CAAiD,wBAC3B,kBAAC,UAAD,EAAA,UAAS,GAAoB,CAAA,CAAA"}
@@ -1,5 +1,6 @@
1
1
  "use client";
2
- import { ChatWindow as e } from "../ui/ChatWindow.js";
2
+ import { ChatWindow as e } from "../ui/chat/ChatWindow.js";
3
+ import "../ui/ChatWindow.js";
3
4
  import { useRef as t, useState as n } from "react";
4
5
  import { jsx as r } from "react/jsx-runtime";
5
6
  //#region lib/examples/chat-window-demo.tsx
@@ -1 +1 @@
1
- {"version":3,"file":"chat-window-demo.js","names":[],"sources":["../../lib/examples/chat-window-demo.tsx"],"sourcesContent":["'use client';\n\nimport { useRef, useState } from 'react';\nimport { ChatWindow } from '@/ui/ChatWindow';\nimport type {\n ChatWindowCsatPromptLabels,\n ChatWindowCsatThankYouLabels,\n ChatWindowHandle,\n ChatWindowMessage,\n} from '@/ui/ChatWindow';\n\nconst csatLabels: ChatWindowCsatPromptLabels = {\n intro: 'Your opinion matters! Tell us what you think. Your feedback helps us improve.',\n question:\n 'Following our conversation, from 1 to 5, how satisfied are you with the level of service you received,',\n questionNote: '1 star being \"Very dissatisfied\" and 5 stars \"Very satisfied\".',\n groupAriaLabel: 'Rate your experience from 1 to 5 stars',\n starLabels: ['Very dissatisfied', 'Dissatisfied', 'Neutral', 'Satisfied', 'Very satisfied'],\n};\n\nconst csatThankYouLabels: ChatWindowCsatThankYouLabels = {\n title: 'Thank you for your feedback!',\n body: 'Your opinion means a lot to us. Thanks to your responses, we keep improving our services to offer you an even more exceptional Club Med experience.',\n};\n\nfunction csatRenderRatingLabel(rating: number) {\n return `${rating} star${rating > 1 ? 's' : ''} — ${csatLabels.starLabels[rating - 1]}`;\n}\n\nexport default function ChatWindowDemo() {\n const chatRef = useRef<ChatWindowHandle>(null);\n const [messages, setMessages] = useState<ChatWindowMessage[]>([\n {\n id: '1',\n sender: 'assistant',\n content:\n \"Hi. Ask me anything about Club Med. I'm here to help you find the right information quickly.\",\n },\n {\n id: '2',\n sender: 'user',\n content:\n 'My son is 14 years old, and I would like to find activities for him during our stay.',\n },\n ]);\n const [inputValue, setInputValue] = useState('');\n const [isTyping, setIsTyping] = useState(false);\n\n function handleSubmit() {\n if (!inputValue.trim()) return;\n const userMsg: ChatWindowMessage = {\n id: Date.now().toString(),\n sender: 'user',\n content: inputValue,\n };\n setMessages((prev) => [...prev, userMsg]);\n setInputValue('');\n setIsTyping(true);\n setTimeout(() => {\n setIsTyping(false);\n setMessages((prev) => [\n ...prev,\n {\n id: (Date.now() + 1).toString(),\n sender: 'assistant',\n content: 'Let me look into that for you…',\n },\n ]);\n }, 2000);\n }\n\n return (\n <ChatWindow\n aria-label=\"Assistant chat\"\n ref={chatRef}\n messages={messages}\n inputValue={inputValue}\n isTyping={isTyping}\n onInputChange={setInputValue}\n onSubmit={handleSubmit}\n onClose={() => {}}\n onAudioClick={() => {}}\n onFeedbackRate={(rating) => console.log('Feedback rating:', rating)}\n csatLabels={csatLabels}\n csatRenderRatingLabel={csatRenderRatingLabel}\n csatThankYouLabels={csatThankYouLabels}\n className=\"w-380 h-660\"\n />\n );\n}\n"],"mappings":";;;;;AAWA,IAAM,IAAyC;CAC7C,OAAO;CACP,UACE;CACF,cAAc;CACd,gBAAgB;CAChB,YAAY;EAAC;EAAqB;EAAgB;EAAW;EAAa;;CAC3E,EAEK,IAAmD;CACvD,OAAO;CACP,MAAM;CACP;AAED,SAAS,EAAsB,GAAgB;AAC7C,QAAO,GAAG,EAAO,OAAO,IAAS,IAAI,MAAM,GAAG,KAAK,EAAW,WAAW,IAAS;;AAGpF,SAAwB,IAAiB;CACvC,IAAM,IAAU,EAAyB,KAAK,EACxC,CAAC,GAAU,KAAe,EAA8B,CAC5D;EACE,IAAI;EACJ,QAAQ;EACR,SACE;EACH,EACD;EACE,IAAI;EACJ,QAAQ;EACR,SACE;EACH,CACF,CAAC,EACI,CAAC,GAAY,KAAiB,EAAS,GAAG,EAC1C,CAAC,GAAU,KAAe,EAAS,GAAM;CAE/C,SAAS,IAAe;AACtB,MAAI,CAAC,EAAW,MAAM,CAAE;EACxB,IAAM,IAA6B;GACjC,IAAI,KAAK,KAAK,CAAC,UAAU;GACzB,QAAQ;GACR,SAAS;GACV;AAID,EAHA,GAAa,MAAS,CAAC,GAAG,GAAM,EAAQ,CAAC,EACzC,EAAc,GAAG,EACjB,EAAY,GAAK,EACjB,iBAAiB;AAEf,GADA,EAAY,GAAM,EAClB,GAAa,MAAS,CACpB,GAAG,GACH;IACE,KAAK,KAAK,KAAK,GAAG,GAAG,UAAU;IAC/B,QAAQ;IACR,SAAS;IACV,CACF,CAAC;KACD,IAAK;;AAGV,QACE,kBAAC,GAAD;EACE,cAAW;EACX,KAAK;EACK;EACE;EACF;EACV,eAAe;EACf,UAAU;EACV,eAAe;EACf,oBAAoB;EACpB,iBAAiB,MAAW,QAAQ,IAAI,oBAAoB,EAAO;EACvD;EACW;EACH;EACpB,WAAU;EACV,CAAA"}
1
+ {"version":3,"file":"chat-window-demo.js","names":[],"sources":["../../lib/examples/chat-window-demo.tsx"],"sourcesContent":["'use client';\n\nimport { useRef, useState } from 'react';\nimport { ChatWindow } from '@/ui/ChatWindow';\nimport type {\n ChatWindowCsatPromptLabels,\n ChatWindowCsatThankYouLabels,\n ChatWindowHandle,\n ChatWindowMessage,\n} from '@/ui/ChatWindow';\n\nconst csatLabels: ChatWindowCsatPromptLabels = {\n intro: 'Your opinion matters! Tell us what you think. Your feedback helps us improve.',\n question:\n 'Following our conversation, from 1 to 5, how satisfied are you with the level of service you received,',\n questionNote: '1 star being \"Very dissatisfied\" and 5 stars \"Very satisfied\".',\n groupAriaLabel: 'Rate your experience from 1 to 5 stars',\n starLabels: ['Very dissatisfied', 'Dissatisfied', 'Neutral', 'Satisfied', 'Very satisfied'],\n};\n\nconst csatThankYouLabels: ChatWindowCsatThankYouLabels = {\n title: 'Thank you for your feedback!',\n body: 'Your opinion means a lot to us. Thanks to your responses, we keep improving our services to offer you an even more exceptional Club Med experience.',\n};\n\nfunction csatRenderRatingLabel(rating: number) {\n return `${rating} star${rating > 1 ? 's' : ''} — ${csatLabels.starLabels[rating - 1]}`;\n}\n\nexport default function ChatWindowDemo() {\n const chatRef = useRef<ChatWindowHandle>(null);\n const [messages, setMessages] = useState<ChatWindowMessage[]>([\n {\n id: '1',\n sender: 'assistant',\n content:\n \"Hi. Ask me anything about Club Med. I'm here to help you find the right information quickly.\",\n },\n {\n id: '2',\n sender: 'user',\n content:\n 'My son is 14 years old, and I would like to find activities for him during our stay.',\n },\n ]);\n const [inputValue, setInputValue] = useState('');\n const [isTyping, setIsTyping] = useState(false);\n\n function handleSubmit() {\n if (!inputValue.trim()) return;\n const userMsg: ChatWindowMessage = {\n id: Date.now().toString(),\n sender: 'user',\n content: inputValue,\n };\n setMessages((prev) => [...prev, userMsg]);\n setInputValue('');\n setIsTyping(true);\n setTimeout(() => {\n setIsTyping(false);\n setMessages((prev) => [\n ...prev,\n {\n id: (Date.now() + 1).toString(),\n sender: 'assistant',\n content: 'Let me look into that for you…',\n },\n ]);\n }, 2000);\n }\n\n return (\n <ChatWindow\n aria-label=\"Assistant chat\"\n ref={chatRef}\n messages={messages}\n inputValue={inputValue}\n isTyping={isTyping}\n onInputChange={setInputValue}\n onSubmit={handleSubmit}\n onClose={() => {}}\n onAudioClick={() => {}}\n onFeedbackRate={(rating) => console.log('Feedback rating:', rating)}\n csatLabels={csatLabels}\n csatRenderRatingLabel={csatRenderRatingLabel}\n csatThankYouLabels={csatThankYouLabels}\n className=\"w-380 h-660\"\n />\n );\n}\n"],"mappings":";;;;;;AAWA,IAAM,IAAyC;CAC7C,OAAO;CACP,UACE;CACF,cAAc;CACd,gBAAgB;CAChB,YAAY;EAAC;EAAqB;EAAgB;EAAW;EAAa;;CAC3E,EAEK,IAAmD;CACvD,OAAO;CACP,MAAM;CACP;AAED,SAAS,EAAsB,GAAgB;AAC7C,QAAO,GAAG,EAAO,OAAO,IAAS,IAAI,MAAM,GAAG,KAAK,EAAW,WAAW,IAAS;;AAGpF,SAAwB,IAAiB;CACvC,IAAM,IAAU,EAAyB,KAAK,EACxC,CAAC,GAAU,KAAe,EAA8B,CAC5D;EACE,IAAI;EACJ,QAAQ;EACR,SACE;EACH,EACD;EACE,IAAI;EACJ,QAAQ;EACR,SACE;EACH,CACF,CAAC,EACI,CAAC,GAAY,KAAiB,EAAS,GAAG,EAC1C,CAAC,GAAU,KAAe,EAAS,GAAM;CAE/C,SAAS,IAAe;AACtB,MAAI,CAAC,EAAW,MAAM,CAAE;EACxB,IAAM,IAA6B;GACjC,IAAI,KAAK,KAAK,CAAC,UAAU;GACzB,QAAQ;GACR,SAAS;GACV;AAID,EAHA,GAAa,MAAS,CAAC,GAAG,GAAM,EAAQ,CAAC,EACzC,EAAc,GAAG,EACjB,EAAY,GAAK,EACjB,iBAAiB;AAEf,GADA,EAAY,GAAM,EAClB,GAAa,MAAS,CACpB,GAAG,GACH;IACE,KAAK,KAAK,KAAK,GAAG,GAAG,UAAU;IAC/B,QAAQ;IACR,SAAS;IACV,CACF,CAAC;KACD,IAAK;;AAGV,QACE,kBAAC,GAAD;EACE,cAAW;EACX,KAAK;EACK;EACE;EACF;EACV,eAAe;EACf,UAAU;EACV,eAAe;EACf,oBAAoB;EACpB,iBAAiB,MAAW,QAAQ,IAAI,oBAAoB,EAAO;EACvD;EACW;EACH;EACpB,WAAU;EACV,CAAA"}
@@ -1,5 +1,6 @@
1
1
  "use client";
2
- import { ChatWindowQuote as e } from "../ui/ChatWindowQuote.js";
2
+ import { ChatWindowQuote as e } from "../ui/chat/ChatWindowQuote.js";
3
+ import "../ui/ChatWindowQuote.js";
3
4
  import { jsx as t, jsxs as n } from "react/jsx-runtime";
4
5
  //#region lib/examples/chat-window-quote-demo.tsx
5
6
  var r = {
@@ -1 +1 @@
1
- {"version":3,"file":"chat-window-quote-demo.js","names":[],"sources":["../../lib/examples/chat-window-quote-demo.tsx"],"sourcesContent":["'use client';\n\nimport { ChatWindowQuote } from '@/ui/ChatWindowQuote';\nimport type { ChatWindowQuoteItem } from '@/ui/ChatWindowQuote';\n\nconst cancun: ChatWindowQuoteItem = {\n id: '1',\n resortName: 'Cancún',\n country: 'Mexico',\n imageUrl: 'https://picsum.photos/seed/cancun/400/300',\n dateRange: '15 June 2026 to 24 June 2026',\n pax: 'for 2 adults 2 children',\n packageIncludes: [\n 'Meals and snacks at any time',\n 'Drinks, alcoholic and non-alcoholic',\n 'Sports and activities',\n ],\n additionalInfo: 'You can customise your transport and room category directly on the website.',\n};\n\nconst puntaCana: ChatWindowQuoteItem = {\n id: '2',\n resortName: 'Punta Cana',\n country: 'Dominican Republic',\n imageUrl: 'https://picsum.photos/seed/puntacana/400/300',\n dateRange: '20 July 2026 to 29 July 2026',\n pax: 'for 2 adults 2 children',\n};\n\nexport default function ChatWindowQuoteDemo() {\n return (\n <div className=\"flex flex-col gap-32 w-340\">\n <div className=\"flex flex-col gap-8\">\n <p className=\"text-b4 font-semibold text-black\">Single quote</p>\n <ChatWindowQuote quotes={[cancun]} />\n </div>\n <div className=\"flex flex-col gap-8\">\n <p className=\"text-b4 font-semibold text-black\">Multiple quotes</p>\n <ChatWindowQuote quotes={[cancun, puntaCana]} />\n </div>\n </div>\n );\n}\n"],"mappings":";;;;AAKA,IAAM,IAA8B;CAClC,IAAI;CACJ,YAAY;CACZ,SAAS;CACT,UAAU;CACV,WAAW;CACX,KAAK;CACL,iBAAiB;EACf;EACA;EACA;EACD;CACD,gBAAgB;CACjB,EAEK,IAAiC;CACrC,IAAI;CACJ,YAAY;CACZ,SAAS;CACT,UAAU;CACV,WAAW;CACX,KAAK;CACN;AAED,SAAwB,IAAsB;AAC5C,QACE,kBAAC,OAAD;EAAK,WAAU;YAAf,CACE,kBAAC,OAAD;GAAK,WAAU;aAAf,CACE,kBAAC,KAAD;IAAG,WAAU;cAAmC;IAAgB,CAAA,EAChE,kBAAC,GAAD,EAAiB,QAAQ,CAAC,EAAO,EAAI,CAAA,CAAA;MAEvC,kBAAC,OAAD;GAAK,WAAU;aAAf,CACE,kBAAC,KAAD;IAAG,WAAU;cAAmC;IAAmB,CAAA,EACnE,kBAAC,GAAD,EAAiB,QAAQ,CAAC,GAAQ,EAAU,EAAI,CAAA,CAAA"}
1
+ {"version":3,"file":"chat-window-quote-demo.js","names":[],"sources":["../../lib/examples/chat-window-quote-demo.tsx"],"sourcesContent":["'use client';\n\nimport { ChatWindowQuote } from '@/ui/ChatWindowQuote';\nimport type { ChatWindowQuoteItem } from '@/ui/ChatWindowQuote';\n\nconst cancun: ChatWindowQuoteItem = {\n id: '1',\n resortName: 'Cancún',\n country: 'Mexico',\n imageUrl: 'https://picsum.photos/seed/cancun/400/300',\n dateRange: '15 June 2026 to 24 June 2026',\n pax: 'for 2 adults 2 children',\n packageIncludes: [\n 'Meals and snacks at any time',\n 'Drinks, alcoholic and non-alcoholic',\n 'Sports and activities',\n ],\n additionalInfo: 'You can customise your transport and room category directly on the website.',\n};\n\nconst puntaCana: ChatWindowQuoteItem = {\n id: '2',\n resortName: 'Punta Cana',\n country: 'Dominican Republic',\n imageUrl: 'https://picsum.photos/seed/puntacana/400/300',\n dateRange: '20 July 2026 to 29 July 2026',\n pax: 'for 2 adults 2 children',\n};\n\nexport default function ChatWindowQuoteDemo() {\n return (\n <div className=\"flex flex-col gap-32 w-340\">\n <div className=\"flex flex-col gap-8\">\n <p className=\"text-b4 font-semibold text-black\">Single quote</p>\n <ChatWindowQuote quotes={[cancun]} />\n </div>\n <div className=\"flex flex-col gap-8\">\n <p className=\"text-b4 font-semibold text-black\">Multiple quotes</p>\n <ChatWindowQuote quotes={[cancun, puntaCana]} />\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;AAKA,IAAM,IAA8B;CAClC,IAAI;CACJ,YAAY;CACZ,SAAS;CACT,UAAU;CACV,WAAW;CACX,KAAK;CACL,iBAAiB;EACf;EACA;EACA;EACD;CACD,gBAAgB;CACjB,EAEK,IAAiC;CACrC,IAAI;CACJ,YAAY;CACZ,SAAS;CACT,UAAU;CACV,WAAW;CACX,KAAK;CACN;AAED,SAAwB,IAAsB;AAC5C,QACE,kBAAC,OAAD;EAAK,WAAU;YAAf,CACE,kBAAC,OAAD;GAAK,WAAU;aAAf,CACE,kBAAC,KAAD;IAAG,WAAU;cAAmC;IAAgB,CAAA,EAChE,kBAAC,GAAD,EAAiB,QAAQ,CAAC,EAAO,EAAI,CAAA,CAAA;MAEvC,kBAAC,OAAD;GAAK,WAAU;aAAf,CACE,kBAAC,KAAD;IAAG,WAAU;cAAmC;IAAmB,CAAA,EACnE,kBAAC,GAAD,EAAiB,QAAQ,CAAC,GAAQ,EAAU,EAAI,CAAA,CAAA"}
@@ -1,5 +1,6 @@
1
1
  "use client";
2
- import { ChatWindow as e } from "../ui/ChatWindow.js";
2
+ import { ChatWindow as e } from "../ui/chat/ChatWindow.js";
3
+ import "../ui/ChatWindow.js";
3
4
  import { useRef as t } from "react";
4
5
  import { jsx as n, jsxs as r } from "react/jsx-runtime";
5
6
  //#region lib/examples/chat-window-quotes-demo.tsx
@@ -1 +1 @@
1
- {"version":3,"file":"chat-window-quotes-demo.js","names":[],"sources":["../../lib/examples/chat-window-quotes-demo.tsx"],"sourcesContent":["'use client';\n\nimport { useRef } from 'react';\nimport { ChatWindow } from '@/ui/ChatWindow';\nimport type { ChatWindowHandle, ChatWindowMessage, ChatWindowQuoteItem } from '@/ui/ChatWindow';\n\nconst messages: ChatWindowMessage[] = [\n {\n id: '1',\n sender: 'assistant',\n content:\n \"Hi. Ask me anything about Club Med. I'm here to help you find the right information quickly.\",\n },\n {\n id: '2',\n sender: 'user',\n content: 'Can you show me some quotes for a family trip to the Caribbean?',\n },\n {\n id: '3',\n sender: 'assistant',\n content:\n 'Of course! Here are some resorts in the Caribbean that could be perfect for your family vacation.',\n },\n];\n\nconst quotes: ChatWindowQuoteItem[] = [\n {\n id: '1',\n resortName: 'Cancún',\n country: 'Mexico',\n imageUrl: 'https://picsum.photos/seed/cancun/400/300',\n dateRange: '15 June 2026 to 24 June 2026',\n pax: 'for 2 adults 2 children',\n packageIncludes: [\n 'Meals and snacks at any time',\n 'Drinks, alcoholic and non-alcoholic',\n 'Sports and activities',\n ],\n additionalInfo: 'You can customise your transport and room category directly on the website.',\n },\n {\n id: '2',\n resortName: 'Punta Cana',\n country: 'Dominican Republic',\n imageUrl: 'https://picsum.photos/seed/puntacana/400/300',\n dateRange: '15 June 2026 to 24 June 2026',\n pax: 'for 2 adults 2 children',\n },\n];\n\nexport default function ChatWindowQuotesDemo() {\n const chatRef = useRef<ChatWindowHandle>(null);\n\n return (\n <div className=\"flex flex-col items-center gap-12\">\n <ChatWindow\n aria-label=\"Assistant chat\"\n ref={chatRef}\n messages={messages}\n inputValue=\"\"\n onInputChange={() => {}}\n onSubmit={() => {}}\n onQuoteCtaClick={(quote) => console.log('Selected quote:', quote.resortName)}\n onClose={() => {}}\n className=\"w-380 h-660\"\n />\n <button\n type=\"button\"\n onClick={() => chatRef.current?.showQuotes(quotes)}\n className=\"px-16 py-8 bg-saffron rounded-pill text-black text-b4 font-semibold hover:opacity-80 transition-opacity\"\n >\n Trigger quotes\n </button>\n </div>\n );\n}\n"],"mappings":";;;;;AAMA,IAAM,IAAgC;CACpC;EACE,IAAI;EACJ,QAAQ;EACR,SACE;EACH;CACD;EACE,IAAI;EACJ,QAAQ;EACR,SAAS;EACV;CACD;EACE,IAAI;EACJ,QAAQ;EACR,SACE;;CAEL,EAEK,IAAgC,CACpC;CACE,IAAI;CACJ,YAAY;CACZ,SAAS;CACT,UAAU;CACV,WAAW;CACX,KAAK;CACL,iBAAiB;EACf;EACA;EACA;EACD;CACD,gBAAgB;CACjB,EACD;CACE,IAAI;CACJ,YAAY;CACZ,SAAS;CACT,UAAU;CACV,WAAW;CACX,KAAK;CACN,CACF;AAED,SAAwB,IAAuB;CAC7C,IAAM,IAAU,EAAyB,KAAK;AAE9C,QACE,kBAAC,OAAD;EAAK,WAAU;YAAf,CACE,kBAAC,GAAD;GACE,cAAW;GACX,KAAK;GACK;GACV,YAAW;GACX,qBAAqB;GACrB,gBAAgB;GAChB,kBAAkB,MAAU,QAAQ,IAAI,mBAAmB,EAAM,WAAW;GAC5E,eAAe;GACf,WAAU;GACV,CAAA,EACF,kBAAC,UAAD;GACE,MAAK;GACL,eAAe,EAAQ,SAAS,WAAW,EAAO;GAClD,WAAU;aACX;GAEQ,CAAA,CAAA"}
1
+ {"version":3,"file":"chat-window-quotes-demo.js","names":[],"sources":["../../lib/examples/chat-window-quotes-demo.tsx"],"sourcesContent":["'use client';\n\nimport { useRef } from 'react';\nimport { ChatWindow } from '@/ui/ChatWindow';\nimport type { ChatWindowHandle, ChatWindowMessage, ChatWindowQuoteItem } from '@/ui/ChatWindow';\n\nconst messages: ChatWindowMessage[] = [\n {\n id: '1',\n sender: 'assistant',\n content:\n \"Hi. Ask me anything about Club Med. I'm here to help you find the right information quickly.\",\n },\n {\n id: '2',\n sender: 'user',\n content: 'Can you show me some quotes for a family trip to the Caribbean?',\n },\n {\n id: '3',\n sender: 'assistant',\n content:\n 'Of course! Here are some resorts in the Caribbean that could be perfect for your family vacation.',\n },\n];\n\nconst quotes: ChatWindowQuoteItem[] = [\n {\n id: '1',\n resortName: 'Cancún',\n country: 'Mexico',\n imageUrl: 'https://picsum.photos/seed/cancun/400/300',\n dateRange: '15 June 2026 to 24 June 2026',\n pax: 'for 2 adults 2 children',\n packageIncludes: [\n 'Meals and snacks at any time',\n 'Drinks, alcoholic and non-alcoholic',\n 'Sports and activities',\n ],\n additionalInfo: 'You can customise your transport and room category directly on the website.',\n },\n {\n id: '2',\n resortName: 'Punta Cana',\n country: 'Dominican Republic',\n imageUrl: 'https://picsum.photos/seed/puntacana/400/300',\n dateRange: '15 June 2026 to 24 June 2026',\n pax: 'for 2 adults 2 children',\n },\n];\n\nexport default function ChatWindowQuotesDemo() {\n const chatRef = useRef<ChatWindowHandle>(null);\n\n return (\n <div className=\"flex flex-col items-center gap-12\">\n <ChatWindow\n aria-label=\"Assistant chat\"\n ref={chatRef}\n messages={messages}\n inputValue=\"\"\n onInputChange={() => {}}\n onSubmit={() => {}}\n onQuoteCtaClick={(quote) => console.log('Selected quote:', quote.resortName)}\n onClose={() => {}}\n className=\"w-380 h-660\"\n />\n <button\n type=\"button\"\n onClick={() => chatRef.current?.showQuotes(quotes)}\n className=\"px-16 py-8 bg-saffron rounded-pill text-black text-b4 font-semibold hover:opacity-80 transition-opacity\"\n >\n Trigger quotes\n </button>\n </div>\n );\n}\n"],"mappings":";;;;;;AAMA,IAAM,IAAgC;CACpC;EACE,IAAI;EACJ,QAAQ;EACR,SACE;EACH;CACD;EACE,IAAI;EACJ,QAAQ;EACR,SAAS;EACV;CACD;EACE,IAAI;EACJ,QAAQ;EACR,SACE;;CAEL,EAEK,IAAgC,CACpC;CACE,IAAI;CACJ,YAAY;CACZ,SAAS;CACT,UAAU;CACV,WAAW;CACX,KAAK;CACL,iBAAiB;EACf;EACA;EACA;EACD;CACD,gBAAgB;CACjB,EACD;CACE,IAAI;CACJ,YAAY;CACZ,SAAS;CACT,UAAU;CACV,WAAW;CACX,KAAK;CACN,CACF;AAED,SAAwB,IAAuB;CAC7C,IAAM,IAAU,EAAyB,KAAK;AAE9C,QACE,kBAAC,OAAD;EAAK,WAAU;YAAf,CACE,kBAAC,GAAD;GACE,cAAW;GACX,KAAK;GACK;GACV,YAAW;GACX,qBAAqB;GACrB,gBAAgB;GAChB,kBAAkB,MAAU,QAAQ,IAAI,mBAAmB,EAAM,WAAW;GAC5E,eAAe;GACf,WAAU;GACV,CAAA,EACF,kBAAC,UAAD;GACE,MAAK;GACL,eAAe,EAAQ,SAAS,WAAW,EAAO;GAClD,WAAU;aACX;GAEQ,CAAA,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clubmed/trident-ui",
3
- "version": "2.1.0-beta.3",
3
+ "version": "2.1.0-beta.4",
4
4
  "type": "module",
5
5
  "description": "Shared ClubMed React UI components",
6
6
  "keywords": [
package/ui/ChatBody.d.ts CHANGED
@@ -1,25 +1 @@
1
- import { ChatMessageSender } from './ChatMessage';
2
- import { ChatWindowCsatPromptLabels } from './ChatWindowCsatPrompt';
3
- import { ChatWindowCsatThankYouLabels } from './ChatWindowCsatThankYou';
4
- import { ChatWindowQuoteItem } from './ChatWindowQuote';
5
- import { HTMLAttributes, ReactNode } from 'react';
6
- export interface ChatMessage {
7
- id: string;
8
- sender: ChatMessageSender;
9
- content: ReactNode;
10
- }
11
- export interface ChatBodyProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
12
- greeting?: string;
13
- messages: ChatMessage[];
14
- isTyping?: boolean;
15
- onFeedbackRate?: (rating: number) => void;
16
- csatLabels?: ChatWindowCsatPromptLabels;
17
- csatRenderRatingLabel?: (rating: number) => ReactNode;
18
- csatThankYouLabels?: ChatWindowCsatThankYouLabels;
19
- onQuoteCtaClick?: (quote: ChatWindowQuoteItem) => void;
20
- }
21
- export interface ChatHandle {
22
- askForFeedback: () => void;
23
- showQuotes: (quotes: ChatWindowQuoteItem[]) => void;
24
- }
25
- export declare const ChatBody: import('react').ForwardRefExoticComponent<ChatBodyProps & import('react').RefAttributes<ChatHandle>>;
1
+ export * from './chat/ChatBody';
package/ui/ChatBody.js CHANGED
@@ -1,88 +1,2 @@
1
- import { twMerge as e } from "./helpers/twMerge.js";
2
- import { t } from "../chunks/ChatMessage.js";
3
- import { ChatTypingIndicator as n } from "./ChatTypingIndicator.js";
4
- import { ChatWindowCsatPrompt as r } from "./ChatWindowCsatPrompt.js";
5
- import { ChatWindowCsatThankYou as i } from "./ChatWindowCsatThankYou.js";
6
- import { ChatWindowQuote as a } from "./ChatWindowQuote.js";
7
- import { forwardRef as o, useEffect as s, useImperativeHandle as c, useRef as l, useState as u } from "react";
8
- import { jsx as d, jsxs as f } from "react/jsx-runtime";
9
- //#region lib/ui/ChatBody.tsx
10
- function p({ messages: e, isTyping: t, csatRenderRatingLabel: n, onFeedbackRate: r, csatLabels: i }, a) {
11
- let o = l(null), [d, f] = u(!1), [p, m] = u(null), [h, g] = u([]);
12
- c(a, () => ({
13
- askForFeedback() {
14
- f(!0);
15
- },
16
- showQuotes(e) {
17
- g((t) => [...t, e]);
18
- }
19
- })), s(() => {
20
- let e = o.current;
21
- e && e.scrollTo({
22
- top: e.scrollHeight,
23
- behavior: "smooth"
24
- });
25
- }, [
26
- e,
27
- t,
28
- d,
29
- p,
30
- h
31
- ]);
32
- function _(e) {
33
- m(String(n ? n(e) : e)), r?.(e);
34
- }
35
- return {
36
- logRef: o,
37
- csatRatingMessage: p,
38
- quoteGroups: h,
39
- handleRate: _,
40
- csatReady: d && i && n
41
- };
42
- }
43
- var m = o(function(o, s) {
44
- let { logRef: c, csatRatingMessage: l, quoteGroups: u, handleRate: m, csatReady: h } = p(o, s), { greeting: g, messages: _, isTyping: v = !1, csatLabels: y, csatRenderRatingLabel: b, csatThankYouLabels: x, onQuoteCtaClick: S, className: C, ...w } = o;
45
- return /* @__PURE__ */ f("div", {
46
- ...w,
47
- ref: c,
48
- role: "log",
49
- "aria-label": "Chat messages",
50
- "aria-live": "polite",
51
- className: e("chat-message-log flex flex-col flex-1 gap-20 overflow-y-auto py-20", C),
52
- children: [
53
- g ? /* @__PURE__ */ d("div", {
54
- className: "px-20",
55
- children: /* @__PURE__ */ d("p", {
56
- className: "text-b3 text-black",
57
- children: g
58
- })
59
- }) : null,
60
- _.map((e) => /* @__PURE__ */ d(t, {
61
- sender: e.sender,
62
- children: e.content
63
- }, e.id)),
64
- v && /* @__PURE__ */ d("div", {
65
- className: "px-12",
66
- children: /* @__PURE__ */ d(n, {})
67
- }),
68
- h && /* @__PURE__ */ d(r, {
69
- onRate: m,
70
- labels: y,
71
- renderRatingLabel: b
72
- }),
73
- l && /* @__PURE__ */ d(t, {
74
- sender: "user",
75
- children: l
76
- }),
77
- l && x && /* @__PURE__ */ d(i, { labels: x }),
78
- u.map((e, t) => /* @__PURE__ */ d(a, {
79
- quotes: e,
80
- onCtaClick: S
81
- }, t))
82
- ]
83
- });
84
- });
85
- //#endregion
86
- export { m as ChatBody };
87
-
88
- //# sourceMappingURL=ChatBody.js.map
1
+ import { ChatBody as e } from "./chat/ChatBody.js";
2
+ export { e as ChatBody };
@@ -1,6 +1 @@
1
- import { ButtonHTMLAttributes } from 'react';
2
- export type ChatButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
3
- offset?: boolean;
4
- unfoldOn?: 'hover' | 'active';
5
- };
6
- export declare function ChatButton({ children, className, type, 'aria-label': ariaLabel, tabIndex, offset, unfoldOn, ...rest }: ChatButtonProps): import("react/jsx-runtime").JSX.Element;
1
+ export * from './chat/ChatButton';