diff options
| -rw-r--r-- | lume/_config.ts | 4 | ||||
| -rw-r--r-- | lume/src/_components/ChatBubble.jsx | 21 | ||||
| -rw-r--r-- | lume/src/_components/ChatFrame.jsx | 7 | ||||
| -rw-r--r-- | lume/src/_components/LoadingSpinner.jsx | 12 |
4 files changed, 44 insertions, 0 deletions
diff --git a/lume/_config.ts b/lume/_config.ts index 4282bcb..5f3c866 100644 --- a/lume/_config.ts +++ b/lume/_config.ts @@ -17,6 +17,8 @@ import readInfo from "lume/plugins/reading_info.ts"; import tailwindOptions from "./tailwind.config.js"; import BlockQuote from "./src/_components/BlockQuote.jsx"; +import ChatFrame from "./src/_components/ChatFrame.jsx"; +import ChatBubble from "./src/_components/ChatBubble.jsx"; import Figure from "./src/_components/Figure.tsx"; import XeblogConv from "./src/_components/XeblogConv.tsx"; import XeblogHero from "./src/_components/XeblogHero.tsx"; @@ -69,6 +71,8 @@ site.use(feed({ site.use(mdx({ components: { "BlockQuote": BlockQuote, + "ChatFrame": ChatFrame, + "ChatBubble": ChatBubble, "Figure": Figure, "Image": Figure, "XeblogConv": XeblogConv, 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 |
