aboutsummaryrefslogtreecommitdiff
path: root/lume/src/_components
diff options
context:
space:
mode:
authorXe Iaso <me@xeiaso.net>2024-02-16 19:44:03 -0800
committerXe Iaso <me@xeiaso.net>2024-02-16 19:44:03 -0800
commit49e1b35ffe12dc5d95a92e1bdb3502d9acd0c487 (patch)
treedcdea2a5f1b98a6235d13a848e6647498f6cc6cf /lume/src/_components
parentf9b0280a4e2545237b3242c8b913483420640741 (diff)
downloadxesite-49e1b35ffe12dc5d95a92e1bdb3502d9acd0c487.tar.xz
xesite-49e1b35ffe12dc5d95a92e1bdb3502d9acd0c487.zip
lume: promote Chat components
Signed-off-by: Xe Iaso <me@xeiaso.net>
Diffstat (limited to 'lume/src/_components')
-rw-r--r--lume/src/_components/ChatBubble.jsx21
-rw-r--r--lume/src/_components/ChatFrame.jsx7
-rw-r--r--lume/src/_components/LoadingSpinner.jsx12
3 files changed, 40 insertions, 0 deletions
diff --git a/lume/src/_components/ChatBubble.jsx b/lume/src/_components/ChatBubble.jsx
new file mode 100644
index 0000000..c10fefb
--- /dev/null
+++ b/lume/src/_components/ChatBubble.jsx
@@ -0,0 +1,21 @@
+export default function ChatBubble({
+ reply = false,
+ bg = "blue-dark",
+ fg = "slate-50",
+ children,
+}) {
+ return (
+ <div className={`mx-auto 3xl:max-w-2xl ${reply ? "" : "space-y-4"}`}>
+ <div className={`flex ${reply ? "justify-start" : "justify-end"}`}>
+ <div className={`flex w-11/12 ${reply ? "" : "flex-row-reverse"}`}>
+ <div
+ className={`relative max-w-xl rounded-xl ${reply ? "rounded-tl-none" : "rounded-tr-none"
+ } bg-${bg} px-4 py-2`}
+ >
+ <span className={`font-medium text-${fg} font-['Inter']`}>{children}</span>
+ </div>
+ </div>
+ </div>
+ </div>
+ );
+} \ No newline at end of file
diff --git a/lume/src/_components/ChatFrame.jsx b/lume/src/_components/ChatFrame.jsx
new file mode 100644
index 0000000..1761bb4
--- /dev/null
+++ b/lume/src/_components/ChatFrame.jsx
@@ -0,0 +1,7 @@
+export default function ChatFrame({ children }) {
+ return (
+ <>
+ <div className="not-prose w-full space-y-4 p-4">{children}</div>
+ </>
+ );
+} \ No newline at end of file
diff --git a/lume/src/_components/LoadingSpinner.jsx b/lume/src/_components/LoadingSpinner.jsx
new file mode 100644
index 0000000..826af16
--- /dev/null
+++ b/lume/src/_components/LoadingSpinner.jsx
@@ -0,0 +1,12 @@
+export default function LoadingSpinner() {
+ return (
+ <div
+ class="inline-block mt-2 h-8 w-8 animate-spin rounded-full border-4 border-solid border-current border-r-transparent align-[-0.125em] motion-reduce:animate-[spin_1.5s_linear_infinite]"
+ role="status"
+ >
+ <span class="!absolute !-m-px !h-px !w-px !overflow-hidden !whitespace-nowrap !border-0 !p-0 ![clip:rect(0,0,0,0)]">
+ Loading...
+ </span>
+ </div>
+ );
+} \ No newline at end of file