From 6cc83b6dfac01f700a03632a0c106d2fa7011414 Mon Sep 17 00:00:00 2001 From: TudorAndrei Date: Fri, 6 Nov 2026 23:33:09 +0200 Subject: [PATCH 1/6] feat(chat): apply the docs theme and fonts --- examples/chat/assets/css/app.css | 81 +++++++++++++++++++- examples/chat/assets/fonts.mjs | 24 ++++++ examples/chat/assets/package-lock.json | 20 +++++ examples/chat/assets/package.json | 7 +- examples/chat/lib/chat_web/layouts.ex | 11 ++- examples/chat/lib/chat_web/live/chat_live.ex | 10 ++- 6 files changed, 147 insertions(+), 6 deletions(-) create mode 100644 examples/chat/assets/fonts.mjs diff --git a/examples/chat/assets/css/app.css b/examples/chat/assets/css/app.css index 46567e5..f77aedc 100644 --- a/examples/chat/assets/css/app.css +++ b/examples/chat/assets/css/app.css @@ -7,8 +7,85 @@ @source "../../deps/live_shadcn/packages/live_shadcn/priv/registry"; @source "../../deps/live_ai_elements/packages/live_ai_elements/lib"; +/* The docs theme (site/src/styles/docs.css): AudioFlow lavender and Elixir + purple, Bricolage Grotesque and IBM Plex Mono. The layout loads the fonts. */ :root { - --font-sans: ui-sans-serif, system-ui, sans-serif; + --font-sans: "Bricolage Grotesque Variable", ui-sans-serif, system-ui, sans-serif; --font-heading: var(--font-sans); - --font-mono: ui-monospace, monospace; + --font-mono: "IBM Plex Mono", ui-monospace, monospace; + + --background: #fbfaff; + --foreground: #1d1638; + --card: #f6f4fc; + --card-foreground: #1d1638; + --popover: #fbfaff; + --popover-foreground: #1d1638; + --primary: #5b2e91; + --primary-foreground: #ffffff; + --secondary: #ebe8f5; + --secondary-foreground: #2b2447; + --muted: #ebe8f5; + --muted-foreground: #6b6585; + --accent: #e7defa; + --accent-foreground: #2e1452; + --border: #d9d4ea; + --input: #d9d4ea; + --ring: #5b2e91; + --sidebar: #f6f4fc; + --sidebar-foreground: #1d1638; + --sidebar-primary: #5b2e91; + --sidebar-primary-foreground: #ffffff; + --sidebar-accent: #e7defa; + --sidebar-accent-foreground: #2e1452; + --sidebar-border: #d9d4ea; + --sidebar-ring: #5b2e91; + --surface: #f6f4fc; + --surface-foreground: #1d1638; + --code-highlight: #ebe8f5; + --code-number: #6b6585; + --selection: #5b2e91; + --selection-foreground: #ffffff; +} + +.dark { + --background: #19132b; + --foreground: #ece9f5; + --card: #261f3d; + --card-foreground: #ece9f5; + --popover: #261f3d; + --popover-foreground: #ece9f5; + --primary: #9a6fd6; + --primary-foreground: #19132b; + --secondary: #2b2447; + --secondary-foreground: #ece9f5; + --muted: #261f3d; + --muted-foreground: #9890b3; + --accent: #3b3457; + --accent-foreground: #ece9f5; + --border: #3b3457; + --input: #3b3457; + --ring: #9a6fd6; + --sidebar: #261f3d; + --sidebar-foreground: #ece9f5; + --sidebar-primary: #9a6fd6; + --sidebar-primary-foreground: #19132b; + --sidebar-accent: #3b3457; + --sidebar-accent-foreground: #ece9f5; + --sidebar-border: #3b3457; + --sidebar-ring: #9a6fd6; + --surface: #261f3d; + --surface-foreground: #c9c3dc; + --code-highlight: #3b3457; + --code-number: #9890b3; + --selection: #e3d6f7; + --selection-foreground: #2a1a46; +} + +@layer base { + h1, + h2, + h3 { + letter-spacing: -0.02em; + font-stretch: 88%; + } } diff --git a/examples/chat/assets/fonts.mjs b/examples/chat/assets/fonts.mjs new file mode 100644 index 0000000..754dda3 --- /dev/null +++ b/examples/chat/assets/fonts.mjs @@ -0,0 +1,24 @@ +// Copies the docs fonts into priv/static/assets/fonts. Tailwind does not copy +// the font files that @fontsource stylesheets reference, so the layout links +// these copies directly. Only the files each stylesheet names are copied. +import { cpSync, readFileSync } from "node:fs"; +import { createRequire } from "node:module"; +import path from "node:path"; + +const require = createRequire(import.meta.url); +const out = path.resolve(import.meta.dirname, "../priv/static/assets/fonts"); + +for (const [name, sheets] of [ + ["@fontsource-variable/bricolage-grotesque", ["standard.css"]], + ["@fontsource/ibm-plex-mono", ["400.css", "600.css"]], +]) { + const root = path.dirname(require.resolve(`${name}/package.json`)); + const dest = path.join(out, path.basename(name)); + + for (const sheet of sheets) { + const css = readFileSync(path.join(root, sheet), "utf8"); + const files = [sheet, ...css.matchAll(/url\(\.\/([^)]+)\)/g).map((m) => m[1])]; + + for (const file of files) cpSync(path.join(root, file), path.join(dest, file)); + } +} diff --git a/examples/chat/assets/package-lock.json b/examples/chat/assets/package-lock.json index 8dbad5e..288de50 100644 --- a/examples/chat/assets/package-lock.json +++ b/examples/chat/assets/package-lock.json @@ -7,6 +7,8 @@ "name": "audioflow_chat", "dependencies": { "@floating-ui/dom": "^1.8.0", + "@fontsource-variable/bricolage-grotesque": "^5.3.0", + "@fontsource/ibm-plex-mono": "^5.3.0", "@rive-app/webgl2": "2.34.1", "embla-carousel": "8.5.2", "embla-carousel-autoplay": "8.5.2", @@ -740,6 +742,24 @@ "integrity": "sha512-HpCo8tmWzLVad5s2d19EhAz5zqrrQ6s69qd6moPMQvkOuSwDT1YgRfWSVuc4ennqrgv3OHppiOGMQ7oC13yIww==", "license": "MIT" }, + "node_modules/@fontsource-variable/bricolage-grotesque": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/@fontsource-variable/bricolage-grotesque/-/bricolage-grotesque-5.3.0.tgz", + "integrity": "sha512-TLi9Q4hJjS2UvoTMRSS2nHu6c4R56lAw60NR9QYtVRCHn0XtsFpiEhNffZ8Glsoxu6wEEwLKBP8lb94J52PNBA==", + "license": "OFL-1.1", + "funding": { + "url": "https://github.com/sponsors/ayuhito" + } + }, + "node_modules/@fontsource/ibm-plex-mono": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/@fontsource/ibm-plex-mono/-/ibm-plex-mono-5.3.0.tgz", + "integrity": "sha512-eTgnZjZEGk1QtD3ZstF+Vclo2HLAni8YMy34/DxllwZvyz1lR/1RF/xTiAquOBO7MvqBx8D2Ig2WCPMVfdZu7Q==", + "license": "OFL-1.1", + "funding": { + "url": "https://github.com/sponsors/ayuhito" + } + }, "node_modules/@jridgewell/gen-mapping": { "version": "0.3.13", "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", diff --git a/examples/chat/assets/package.json b/examples/chat/assets/package.json index d2d4ce6..8bb58e9 100644 --- a/examples/chat/assets/package.json +++ b/examples/chat/assets/package.json @@ -3,12 +3,15 @@ "private": true, "type": "module", "scripts": { - "build": "npm run build:css && npm run build:js", + "build": "npm run build:css && npm run build:js && npm run build:fonts", "build:css": "tailwindcss --input=css/app.css --output=../priv/static/assets/app.css", - "build:js": "rolldown -c rolldown.config.mjs" + "build:js": "rolldown -c rolldown.config.mjs", + "build:fonts": "node fonts.mjs" }, "dependencies": { "@floating-ui/dom": "^1.8.0", + "@fontsource-variable/bricolage-grotesque": "^5.3.0", + "@fontsource/ibm-plex-mono": "^5.3.0", "@rive-app/webgl2": "2.34.1", "embla-carousel": "8.5.2", "embla-carousel-autoplay": "8.5.2", diff --git a/examples/chat/lib/chat_web/layouts.ex b/examples/chat/lib/chat_web/layouts.ex index 6c94961..e33c803 100644 --- a/examples/chat/lib/chat_web/layouts.ex +++ b/examples/chat/lib/chat_web/layouts.ex @@ -4,12 +4,21 @@ defmodule ChatWeb.Layouts do def root(assigns) do ~H""" - + AudioFlow chat + <%!-- Follow the system color scheme, as the docs do. --%> + + + + diff --git a/examples/chat/lib/chat_web/live/chat_live.ex b/examples/chat/lib/chat_web/live/chat_live.ex index 99ea642..f30324b 100644 --- a/examples/chat/lib/chat_web/live/chat_live.ex +++ b/examples/chat/lib/chat_web/live/chat_live.ex @@ -943,7 +943,15 @@ defmodule ChatWeb.ChatLive do ~H"""
-

AudioFlow

+

+ + AudioFlow +

{if @duplex, do: "Clear text", else: "New chat"} From a2c88c9b3b655ca0c6e4cca4bfb1d654a57d90db Mon Sep 17 00:00:00 2001 From: TudorAndrei Date: Fri, 6 Nov 2026 23:34:18 +0200 Subject: [PATCH 2/6] feat(avatar): apply the docs theme and fonts --- examples/avatar/index.html | 39 ++++++++++--- examples/avatar/main.ts | 3 + examples/avatar/package-lock.json | 20 +++++++ examples/avatar/package.json | 2 + examples/avatar/theme.css | 91 +++++++++++++++++++++++++++++++ 5 files changed, 146 insertions(+), 9 deletions(-) create mode 100644 examples/avatar/theme.css diff --git a/examples/avatar/index.html b/examples/avatar/index.html index bab5c27..0a514c2 100644 --- a/examples/avatar/index.html +++ b/examples/avatar/index.html @@ -1,9 +1,30 @@ -AudioFlow avatar viewer - -

LiveAvatar finite utterance viewer

-

Select raw mono PCM16LE at 24 kHz, at most 10 seconds. Each start provisions a new paid provider session. No local PCM playback. No persistent avatar continuity.

-

Live calls are disabled unless the server has AVATAR_LIVE=1 and credentials. Generation, lip-sync, acoustics, account permissions and TURN remain unverified without credentials.

- - -

Connect controls to begin. No provider call is made on connection.

- + + + + + AudioFlow avatar viewer + +
+
+ + AudioFlow +
+

LiveAvatar finite utterance viewer

+

Select raw mono PCM16LE at 24 kHz, at most 10 seconds. Each start provisions a new paid provider session. No local PCM playback. No persistent avatar continuity.

+

Live calls are disabled unless the server has AVATAR_LIVE=1 and credentials. Generation, lip-sync, acoustics, account permissions and TURN remain unverified without credentials.

+
+ +
+
+ + + + + +
+

Connect controls to begin. No provider call is made on connection.

+
+
+ + + diff --git a/examples/avatar/main.ts b/examples/avatar/main.ts index 9b57a54..bddc711 100644 --- a/examples/avatar/main.ts +++ b/examples/avatar/main.ts @@ -1,3 +1,6 @@ +import '@fontsource-variable/bricolage-grotesque/standard.css'; +import '@fontsource/ibm-plex-mono/400.css'; +import './theme.css'; import { Receiver } from './receiver'; const button = (id: string) => document.getElementById(id) as HTMLButtonElement; const file = document.getElementById('pcm') as HTMLInputElement; diff --git a/examples/avatar/package-lock.json b/examples/avatar/package-lock.json index 1dbc4de..7153a8a 100644 --- a/examples/avatar/package-lock.json +++ b/examples/avatar/package-lock.json @@ -6,6 +6,8 @@ "": { "name": "audioflow-avatar-viewer", "dependencies": { + "@fontsource-variable/bricolage-grotesque": "^5.3.0", + "@fontsource/ibm-plex-mono": "^5.3.0", "livekit-client": "2.17.2" }, "devDependencies": { @@ -463,6 +465,24 @@ "node": ">=18" } }, + "node_modules/@fontsource-variable/bricolage-grotesque": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/@fontsource-variable/bricolage-grotesque/-/bricolage-grotesque-5.3.0.tgz", + "integrity": "sha512-TLi9Q4hJjS2UvoTMRSS2nHu6c4R56lAw60NR9QYtVRCHn0XtsFpiEhNffZ8Glsoxu6wEEwLKBP8lb94J52PNBA==", + "license": "OFL-1.1", + "funding": { + "url": "https://github.com/sponsors/ayuhito" + } + }, + "node_modules/@fontsource/ibm-plex-mono": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/@fontsource/ibm-plex-mono/-/ibm-plex-mono-5.3.0.tgz", + "integrity": "sha512-eTgnZjZEGk1QtD3ZstF+Vclo2HLAni8YMy34/DxllwZvyz1lR/1RF/xTiAquOBO7MvqBx8D2Ig2WCPMVfdZu7Q==", + "license": "OFL-1.1", + "funding": { + "url": "https://github.com/sponsors/ayuhito" + } + }, "node_modules/@livekit/mutex": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/@livekit/mutex/-/mutex-1.1.1.tgz", diff --git a/examples/avatar/package.json b/examples/avatar/package.json index bdce5c9..5cfa2a6 100644 --- a/examples/avatar/package.json +++ b/examples/avatar/package.json @@ -8,6 +8,8 @@ "build": "vite build" }, "dependencies": { + "@fontsource-variable/bricolage-grotesque": "^5.3.0", + "@fontsource/ibm-plex-mono": "^5.3.0", "livekit-client": "2.17.2" }, "devDependencies": { diff --git a/examples/avatar/theme.css b/examples/avatar/theme.css new file mode 100644 index 0000000..3ee7688 --- /dev/null +++ b/examples/avatar/theme.css @@ -0,0 +1,91 @@ +/* The docs theme (site/src/styles/docs.css): AudioFlow lavender and Elixir purple. + Keep this file the same as examples/rtvi-client/theme.css. */ +:root { + --bg: #fbfaff; + --surface: #f6f4fc; + --ink: #1d1638; + --muted: #6b6585; + --rule: #d9d4ea; + --accent: #5b2e91; + --accent-hover: #4a2378; + --on-accent: #ffffff; + --console: #1d1638; + --console-ink: #ece9f5; + --sans: 'Bricolage Grotesque Variable', system-ui, sans-serif; + --mono: 'IBM Plex Mono', ui-monospace, monospace; + color-scheme: light; +} + +@media (prefers-color-scheme: dark) { + :root { + --bg: #19132b; + --surface: #261f3d; + --ink: #ece9f5; + --muted: #9890b3; + --rule: #3b3457; + --accent: #9a6fd6; + --accent-hover: #b08ce0; + --on-accent: #19132b; + --console: #261f3d; + color-scheme: dark; + } +} + +* { box-sizing: border-box; } + +body { + margin: 0; + background: var(--bg); + color: var(--ink); + font: 400 1.0625rem/1.6 var(--sans); + -webkit-font-smoothing: antialiased; +} + +:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; } + +.wrap { width: min(800px, 100% - 2rem); margin-inline: auto; padding-block: 1.5rem 4rem; } + +.brand { + display: inline-flex; align-items: center; gap: 0.6rem; margin-bottom: 2.5rem; + font-weight: 700; font-size: 1.2rem; letter-spacing: -0.02em; +} +.brand svg { width: 30px; height: 30px; } + +h1 { + margin: 0 0 1rem; font-size: clamp(2rem, 6vw, 3rem); line-height: 1; font-weight: 800; + font-stretch: 88%; letter-spacing: -0.02em; text-wrap: balance; +} + +p { max-width: 40rem; } +.lede { color: var(--muted); } + +.controls { display: flex; flex-wrap: wrap; align-items: end; gap: 0.75rem; margin-block: 1.5rem; } + +label { display: grid; gap: 0.35rem; font-weight: 600; font-size: 0.95rem; } + +input { + font: inherit; font-weight: 400; color: var(--ink); background: var(--surface); + border: 1px solid var(--rule); border-radius: 10px; padding: 0.6rem 0.8rem; min-width: 0; +} +input[type='file'] { padding: 0.45rem 0.6rem; } +input[type='file']::file-selector-button { + font: inherit; font-weight: 600; color: var(--ink); background: transparent; + border: 1.5px solid var(--ink); border-radius: 999px; padding: 0.3rem 0.9rem; margin-right: 0.75rem; cursor: pointer; +} + +button { + font: inherit; font-weight: 600; color: var(--ink); background: transparent; cursor: pointer; + padding: 0.6rem 1.15rem; border-radius: 999px; border: 1.5px solid var(--ink); +} +button:hover:not(:disabled) { background: var(--ink); color: var(--bg); } +button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); } +button.primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); } +button:disabled { opacity: 0.45; cursor: not-allowed; } + +.status { + margin: 1.5rem 0; padding: 1rem 1.25rem; min-height: 3.5rem; max-width: none; + background: var(--console); color: var(--console-ink); border-radius: 14px; + font: 0.9rem/1.7 var(--mono); white-space: pre-wrap; overflow-x: auto; +} + +video { display: block; width: 100%; max-height: 480px; border-radius: 14px; background: var(--console); } From b17fe1d9c1f3ed4504705b51d31bf5e1c750ad85 Mon Sep 17 00:00:00 2001 From: TudorAndrei Date: Fri, 6 Nov 2026 23:34:18 +0200 Subject: [PATCH 3/6] feat(rtvi-client): apply the docs theme and fonts --- examples/rtvi-client/index.html | 46 +++++++++---- examples/rtvi-client/main.ts | 3 + examples/rtvi-client/package-lock.json | 20 ++++++ examples/rtvi-client/package.json | 2 + examples/rtvi-client/theme.css | 91 ++++++++++++++++++++++++++ 5 files changed, 148 insertions(+), 14 deletions(-) create mode 100644 examples/rtvi-client/theme.css diff --git a/examples/rtvi-client/index.html b/examples/rtvi-client/index.html index affaabb..4cf4830 100644 --- a/examples/rtvi-client/index.html +++ b/examples/rtvi-client/index.html @@ -1,20 +1,38 @@ - AudioFlow Pipecat client + + + AudioFlow Pipecat client -

AudioFlow Pipecat client

- - -
- -
-

+    
+
+ + AudioFlow +
+

AudioFlow Pipecat client

+
+ + + +
+
+ + +
+

+    
diff --git a/examples/rtvi-client/main.ts b/examples/rtvi-client/main.ts index 0489cba..bad204f 100644 --- a/examples/rtvi-client/main.ts +++ b/examples/rtvi-client/main.ts @@ -1,3 +1,6 @@ +import "@fontsource-variable/bricolage-grotesque/standard.css"; +import "@fontsource/ibm-plex-mono/400.css"; +import "./theme.css"; import { PipecatClient, LogLevel } from "@pipecat-ai/client-js"; import { AudioFlowTransport } from "./transport.ts"; let client: PipecatClient | undefined; diff --git a/examples/rtvi-client/package-lock.json b/examples/rtvi-client/package-lock.json index 7e68e51..dccb558 100644 --- a/examples/rtvi-client/package-lock.json +++ b/examples/rtvi-client/package-lock.json @@ -6,6 +6,8 @@ "": { "name": "audioflow-rtvi-client", "dependencies": { + "@fontsource-variable/bricolage-grotesque": "^5.3.0", + "@fontsource/ibm-plex-mono": "^5.3.0", "@pipecat-ai/client-js": "1.16.0" }, "devDependencies": { @@ -460,6 +462,24 @@ "node": ">=18" } }, + "node_modules/@fontsource-variable/bricolage-grotesque": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/@fontsource-variable/bricolage-grotesque/-/bricolage-grotesque-5.3.0.tgz", + "integrity": "sha512-TLi9Q4hJjS2UvoTMRSS2nHu6c4R56lAw60NR9QYtVRCHn0XtsFpiEhNffZ8Glsoxu6wEEwLKBP8lb94J52PNBA==", + "license": "OFL-1.1", + "funding": { + "url": "https://github.com/sponsors/ayuhito" + } + }, + "node_modules/@fontsource/ibm-plex-mono": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/@fontsource/ibm-plex-mono/-/ibm-plex-mono-5.3.0.tgz", + "integrity": "sha512-eTgnZjZEGk1QtD3ZstF+Vclo2HLAni8YMy34/DxllwZvyz1lR/1RF/xTiAquOBO7MvqBx8D2Ig2WCPMVfdZu7Q==", + "license": "OFL-1.1", + "funding": { + "url": "https://github.com/sponsors/ayuhito" + } + }, "node_modules/@napi-rs/lzma-linux-x64-gnu": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/@napi-rs/lzma-linux-x64-gnu/-/lzma-linux-x64-gnu-1.5.1.tgz", diff --git a/examples/rtvi-client/package.json b/examples/rtvi-client/package.json index 1f1efe8..12c7c43 100644 --- a/examples/rtvi-client/package.json +++ b/examples/rtvi-client/package.json @@ -10,6 +10,8 @@ "format:check": "prettier --check \"*.{ts,json,html,md}\"" }, "dependencies": { + "@fontsource-variable/bricolage-grotesque": "^5.3.0", + "@fontsource/ibm-plex-mono": "^5.3.0", "@pipecat-ai/client-js": "1.16.0" }, "devDependencies": { diff --git a/examples/rtvi-client/theme.css b/examples/rtvi-client/theme.css new file mode 100644 index 0000000..549cd1e --- /dev/null +++ b/examples/rtvi-client/theme.css @@ -0,0 +1,91 @@ +/* The docs theme (site/src/styles/docs.css): AudioFlow lavender and Elixir purple. + Keep this file the same as examples/avatar/theme.css. */ +:root { + --bg: #fbfaff; + --surface: #f6f4fc; + --ink: #1d1638; + --muted: #6b6585; + --rule: #d9d4ea; + --accent: #5b2e91; + --accent-hover: #4a2378; + --on-accent: #ffffff; + --console: #1d1638; + --console-ink: #ece9f5; + --sans: 'Bricolage Grotesque Variable', system-ui, sans-serif; + --mono: 'IBM Plex Mono', ui-monospace, monospace; + color-scheme: light; +} + +@media (prefers-color-scheme: dark) { + :root { + --bg: #19132b; + --surface: #261f3d; + --ink: #ece9f5; + --muted: #9890b3; + --rule: #3b3457; + --accent: #9a6fd6; + --accent-hover: #b08ce0; + --on-accent: #19132b; + --console: #261f3d; + color-scheme: dark; + } +} + +* { box-sizing: border-box; } + +body { + margin: 0; + background: var(--bg); + color: var(--ink); + font: 400 1.0625rem/1.6 var(--sans); + -webkit-font-smoothing: antialiased; +} + +:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; } + +.wrap { width: min(800px, 100% - 2rem); margin-inline: auto; padding-block: 1.5rem 4rem; } + +.brand { + display: inline-flex; align-items: center; gap: 0.6rem; margin-bottom: 2.5rem; + font-weight: 700; font-size: 1.2rem; letter-spacing: -0.02em; +} +.brand svg { width: 30px; height: 30px; } + +h1 { + margin: 0 0 1rem; font-size: clamp(2rem, 6vw, 3rem); line-height: 1; font-weight: 800; + font-stretch: 88%; letter-spacing: -0.02em; text-wrap: balance; +} + +p { max-width: 40rem; } +.lede { color: var(--muted); } + +.controls { display: flex; flex-wrap: wrap; align-items: end; gap: 0.75rem; margin-block: 1.5rem; } + +label { display: grid; gap: 0.35rem; font-weight: 600; font-size: 0.95rem; } + +input { + font: inherit; font-weight: 400; color: var(--ink); background: var(--surface); + border: 1px solid var(--rule); border-radius: 10px; padding: 0.6rem 0.8rem; min-width: 0; +} +input[type='file'] { padding: 0.45rem 0.6rem; } +input[type='file']::file-selector-button { + font: inherit; font-weight: 600; color: var(--ink); background: transparent; + border: 1.5px solid var(--ink); border-radius: 999px; padding: 0.3rem 0.9rem; margin-right: 0.75rem; cursor: pointer; +} + +button { + font: inherit; font-weight: 600; color: var(--ink); background: transparent; cursor: pointer; + padding: 0.6rem 1.15rem; border-radius: 999px; border: 1.5px solid var(--ink); +} +button:hover:not(:disabled) { background: var(--ink); color: var(--bg); } +button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); } +button.primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); } +button:disabled { opacity: 0.45; cursor: not-allowed; } + +.status { + margin: 1.5rem 0; padding: 1rem 1.25rem; min-height: 3.5rem; max-width: none; + background: var(--console); color: var(--console-ink); border-radius: 14px; + font: 0.9rem/1.7 var(--mono); white-space: pre-wrap; overflow-x: auto; +} + +video { display: block; width: 100%; max-height: 480px; border-radius: 14px; background: var(--console); } From 48aa7dd6d2f4f8765d54385667654faf733efbf1 Mon Sep 17 00:00:00 2001 From: TudorAndrei Date: Fri, 6 Nov 2026 23:36:41 +0200 Subject: [PATCH 4/6] feat(chat): build the page from live_shadcn components --- examples/chat/README.md | 3 +- .../chat/lib/chat_web/components/ui/alert.ex | 132 ++++++++ .../chat/lib/chat_web/components/ui/card.ex | 158 +++++++++ .../lib/chat_web/components/ui/collapsible.ex | 196 ++++++++++++ .../chat/lib/chat_web/components/ui/empty.ex | 173 ++++++++++ .../chat/lib/chat_web/components/ui/field.ex | 299 ++++++++++++++++++ .../chat/lib/chat_web/components/ui/item.ex | 288 +++++++++++++++++ examples/chat/lib/chat_web/live/chat_live.ex | 200 +++++++----- 8 files changed, 1372 insertions(+), 77 deletions(-) create mode 100644 examples/chat/lib/chat_web/components/ui/alert.ex create mode 100644 examples/chat/lib/chat_web/components/ui/card.ex create mode 100644 examples/chat/lib/chat_web/components/ui/collapsible.ex create mode 100644 examples/chat/lib/chat_web/components/ui/empty.ex create mode 100644 examples/chat/lib/chat_web/components/ui/field.ex create mode 100644 examples/chat/lib/chat_web/components/ui/item.ex diff --git a/examples/chat/README.md b/examples/chat/README.md index fb98d5e..668f0f0 100644 --- a/examples/chat/README.md +++ b/examples/chat/README.md @@ -261,7 +261,8 @@ and stops playback. Microphone access requires `localhost` or HTTPS. `live_base`, `live_shadcn`, and `live_ai_elements` come from a pinned live_shadcn commit. Set `LIVE_SHADCN_PATH` to a local checkout to use it -instead. `button`, `badge`, `native-select`, and `spinner` were copied with `mix ui.add`; `mix ui.sync` +instead. `alert`, `badge`, `button`, `card`, `collapsible`, `empty`, `field`, `item`, +`native-select`, and `spinner` were copied with `mix ui.add`; `mix ui.sync` reports upstream changes. The shadcn style sheets in `assets/css/upstream` are pinned to the commit in live_shadcn's `registry/UPSTREAM.json`. diff --git a/examples/chat/lib/chat_web/components/ui/alert.ex b/examples/chat/lib/chat_web/components/ui/alert.ex new file mode 100644 index 0000000..ca4946f --- /dev/null +++ b/examples/chat/lib/chat_web/components/ui/alert.ex @@ -0,0 +1,132 @@ +# live_shadcn: alert @ 0.1.0 (5f2d5d144da3) +# Generated from the shadcn registry. Regenerate upstream, never here. +# `mix ui.sync` reports what changed upstream and skips files you edited. + +defmodule ChatWeb.Components.UI.Alert do + @moduledoc """ + Alert. + + Reviewed from upstream. The marked upstream fact block is synchronized. + The HEEx body is maintained as a LiveView port. + """ + + use Phoenix.Component + + # live-shadcn: upstream facts start + @upstream_facts %{ + "cva/alertVariants/base" => "cn-alert group/alert relative w-full", + "cva/alertVariants/default/variant" => "default", + "cva/alertVariants/variant/variant/default" => "cn-alert-variant-default", + "cva/alertVariants/variant/variant/destructive" => "cn-alert-variant-destructive", + "jsx/AlertAction/class/0" => "cn-alert-action", + "jsx/AlertDescription/class/0" => + "cn-alert-description [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground", + "jsx/AlertTitle/class/0" => + "cn-alert-title [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground" + } + # live-shadcn: upstream facts end + Module.get_attribute(__MODULE__, :upstream_facts) + + defp upstream_fact(key), do: Map.fetch!(@upstream_facts, key) + + @variant_classes (for {"cva/" <> path, value} <- @upstream_facts, + [table, "variant", group, choice] <- [String.split(path, "/")], + reduce: %{} do + variants -> + put_in( + variants, + [ + Access.key(table, %{}), + Access.key(group, %{}), + Access.key(choice, nil) + ], + value + ) + end) + + @doc "The `alert` part." + attr(:variant, :string, + default: @upstream_facts["cva/alertVariants/default/variant"], + values: @variant_classes |> get_in(["alertVariants", "variant"]) |> Map.keys() |> Enum.sort() + ) + + attr(:class, :any, default: nil, doc: "Appended to the class string upstream renders.") + attr(:rest, :global, include: ["data-slot"]) + slot(:inner_block) + + def alert(assigns) do + ~H""" + + """ + end + + @doc "The `alert-title` part." + + attr(:class, :any, default: nil, doc: "Appended to the class string upstream renders.") + attr(:rest, :global, include: ["data-slot"]) + slot(:inner_block) + + def alert_title(assigns) do + ~H""" +
+ {render_slot(@inner_block)} +
+ """ + end + + @doc "The `alert-description` part." + + attr(:class, :any, default: nil, doc: "Appended to the class string upstream renders.") + attr(:rest, :global, include: ["data-slot"]) + slot(:inner_block) + + def alert_description(assigns) do + ~H""" +
+ {render_slot(@inner_block)} +
+ """ + end + + @doc "The `alert-action` part." + + attr(:class, :any, default: nil, doc: "Appended to the class string upstream renders.") + attr(:rest, :global, include: ["data-slot"]) + slot(:inner_block) + + def alert_action(assigns) do + ~H""" +
+ {render_slot(@inner_block)} +
+ """ + end + + defp variant_class(table, group, value), + do: get_in(@variant_classes, [table, group, value]) +end diff --git a/examples/chat/lib/chat_web/components/ui/card.ex b/examples/chat/lib/chat_web/components/ui/card.ex new file mode 100644 index 0000000..b42628d --- /dev/null +++ b/examples/chat/lib/chat_web/components/ui/card.ex @@ -0,0 +1,158 @@ +# live_shadcn: card @ 0.1.0 (efea03012dd4) +# Generated from the shadcn registry. Regenerate upstream, never here. +# `mix ui.sync` reports what changed upstream and skips files you edited. + +defmodule ChatWeb.Components.UI.Card do + @moduledoc """ + Card. + + Reviewed from upstream. The marked upstream fact block is synchronized. + The HEEx body is maintained as a LiveView port. + """ + + use Phoenix.Component + + # live-shadcn: upstream facts start + @upstream_facts %{ + "jsx/Card/class/0" => "cn-card group/card flex flex-col", + "jsx/CardAction/class/0" => + "cn-card-action col-start-2 row-span-2 row-start-1 self-start justify-self-end", + "jsx/CardContent/class/0" => "cn-card-content", + "jsx/CardDescription/class/0" => "cn-card-description", + "jsx/CardFooter/class/0" => "cn-card-footer flex items-center", + "jsx/CardHeader/class/0" => + "cn-card-header group/card-header @container/card-header grid auto-rows-min items-start has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto]", + "jsx/CardTitle/class/0" => "cn-card-title cn-font-heading" + } + # live-shadcn: upstream facts end + Module.get_attribute(__MODULE__, :upstream_facts) + + defp upstream_fact(key), do: Map.fetch!(@upstream_facts, key) + + @doc "The `card` part." + attr(:size, :string, default: "default", values: ["default", "sm"]) + attr(:class, :any, default: nil, doc: "Appended to the class string upstream renders.") + attr(:rest, :global, include: ["data-slot"]) + slot(:inner_block) + + def card(assigns) do + ~H""" +
+ {render_slot(@inner_block)} +
+ """ + end + + @doc "The `card-header` part." + + attr(:class, :any, default: nil, doc: "Appended to the class string upstream renders.") + attr(:rest, :global, include: ["data-slot"]) + slot(:inner_block) + + def card_header(assigns) do + ~H""" +
+ {render_slot(@inner_block)} +
+ """ + end + + @doc "The `card-footer` part." + + attr(:class, :any, default: nil, doc: "Appended to the class string upstream renders.") + attr(:rest, :global, include: ["data-slot"]) + slot(:inner_block) + + def card_footer(assigns) do + ~H""" +
+ {render_slot(@inner_block)} +
+ """ + end + + @doc "The `card-title` part." + + attr(:class, :any, default: nil, doc: "Appended to the class string upstream renders.") + attr(:rest, :global, include: ["data-slot"]) + slot(:inner_block) + + def card_title(assigns) do + ~H""" +
+ {render_slot(@inner_block)} +
+ """ + end + + @doc "The `card-action` part." + + attr(:class, :any, default: nil, doc: "Appended to the class string upstream renders.") + attr(:rest, :global, include: ["data-slot"]) + slot(:inner_block) + + def card_action(assigns) do + ~H""" +
+ {render_slot(@inner_block)} +
+ """ + end + + @doc "The `card-description` part." + + attr(:class, :any, default: nil, doc: "Appended to the class string upstream renders.") + attr(:rest, :global, include: ["data-slot"]) + slot(:inner_block) + + def card_description(assigns) do + ~H""" +
+ {render_slot(@inner_block)} +
+ """ + end + + @doc "The `card-content` part." + + attr(:class, :any, default: nil, doc: "Appended to the class string upstream renders.") + attr(:rest, :global, include: ["data-slot"]) + slot(:inner_block) + + def card_content(assigns) do + ~H""" +
+ {render_slot(@inner_block)} +
+ """ + end +end diff --git a/examples/chat/lib/chat_web/components/ui/collapsible.ex b/examples/chat/lib/chat_web/components/ui/collapsible.ex new file mode 100644 index 0000000..5ba2dae --- /dev/null +++ b/examples/chat/lib/chat_web/components/ui/collapsible.ex @@ -0,0 +1,196 @@ +# live_shadcn: collapsible @ 0.1.0 (f426fb14dbc2) +# Generated from the shadcn registry. Regenerate upstream, never here. +# `mix ui.sync` reports what changed upstream and skips files you edited. + +defmodule ChatWeb.Components.UI.Collapsible do + @moduledoc """ + Collapsible. Groups all parts of the collapsible. + + Reviewed from upstream. The marked upstream fact block is synchronized. + The HEEx body is maintained as a LiveView port. + + | Upstream | Digest | + |---|---| + | `shadcn/ui/collapsible.tsx` | `ead4349ff7b0` | + """ + + use Phoenix.Component + + # live-shadcn: upstream facts start + @upstream_facts %{} + # live-shadcn: upstream facts end + Module.get_attribute(__MODULE__, :upstream_facts) + + alias LiveBase.Disclosure + alias Phoenix.LiveView.JS + + @doc """ + Groups all parts of the collapsible. + + <.collapsible id="details" title="Show details"> + The panel body. + + + The local toggle runs on the client. Set `phx-click` on the trigger to send + a server event or run a caller JS command after the toggle. `trigger_attrs` + accepts the same command on the grouped component. + """ + attr(:id, :string, required: true, doc: "Every id inside the component derives from it.") + attr(:title, :any, default: nil, doc: "The trigger content when no trigger slot is given.") + attr(:composed, :boolean, default: false, doc: "Render caller-owned trigger and content parts.") + + attr(:controlled, :boolean, default: false, doc: "Let server assigns own the disclosure state.") + attr(:open, :boolean, + default: false, + doc: + "Whether the collapsible panel is initially open. To render a controlled collapsible, use the `open` prop instead." + ) + + attr(:disabled, :boolean, + default: false, + doc: "Whether the component should ignore user interaction." + ) + + attr(:orientation, :string, default: "vertical", doc: "") + attr(:class, :any, default: nil, doc: "Appended to the class string upstream renders.") + attr(:content_class, :any, default: nil, doc: "Appended to the content class string.") + attr(:trigger_class, :any, default: nil, doc: "Appended to the trigger class string.") + attr(:trigger_attrs, :map, default: %{}, doc: "Attributes merged onto the trigger button.") + + attr(:wrapper_tag, :string, + default: nil, + doc: "An optional element around the trigger and panel." + ) + + attr(:wrapper_attrs, :map, default: %{}, doc: "Attributes for the optional wrapper.") + attr(:rest, :global) + + slot(:trigger, doc: "Rich trigger content.") + slot(:inner_block, required: true, doc: "The panel body.") + + def collapsible(assigns) do + ~H""" +
<%= if @composed do %>{render_slot(@inner_block)}<% else %> + <.dynamic_tag :if={@wrapper_tag} tag_name={@wrapper_tag} {@wrapper_attrs}> + <.collapsible_parts {assigns} /> + + <.collapsible_parts :if={is_nil(@wrapper_tag)} {assigns} /> + <% end %>
+ """ + end + + defp collapsible_parts(assigns) do + ~H""" + <.collapsible_trigger + for={@id} + open={@open} + controlled={@controlled} + disabled={@disabled} + class={@trigger_class} + {@trigger_attrs} + > + {if(@trigger == [], do: @title, else: render_slot(@trigger))} + + <.collapsible_content + for={@id} + open={@open} + controlled={@controlled} + class={@content_class} + > + {render_slot(@inner_block)} + + """ + end + + @doc "The button that opens or closes a composed collapsible." + attr(:for, :string, required: true, doc: "The id of the collapsible root.") + attr(:controlled, :boolean, default: false, doc: "Let server assigns own the disclosure state.") + attr(:open, :boolean, default: false) + attr(:disabled, :boolean, default: false) + attr(:class, :any, default: nil) + attr(:rest, :global, include: ["data-slot", "type"]) + slot(:inner_block, required: true) + + def collapsible_trigger(assigns) do + ~H""" + + """ + end + + @doc "The panel that a composed collapsible shows or hides." + attr(:for, :string, required: true, doc: "The id of the collapsible root.") + attr(:controlled, :boolean, default: false, doc: "Let server assigns own the disclosure state.") + attr(:open, :boolean, default: false) + attr(:class, :any, default: nil) + attr(:rest, :global, include: ["data-slot"]) + slot(:inner_block, required: true) + + def collapsible_content(assigns) do + ~H""" + + """ + end + + defp caller_click(command, nil), do: command + defp caller_click(command, ""), do: command + defp caller_click(command, %JS{} = caller), do: JS.concat(command, caller) + defp caller_click(command, event) when is_binary(event), do: JS.push(command, event) + + # A disabled disclosure ignores interaction. `aria-disabled` and + # `pointer-events-none` say so to a reader and to a mouse, but a keypress + # on a focused trigger reaches neither, so the command itself is withheld. + defp interactive(false, command), do: command + defp interactive(_disabled, _command), do: nil + + # An HTML attribute with no value, or no attribute at all. Base UI marks + # state by presence, so `data-open=""` and a missing `data-open` are the + # two states a shadcn class string distinguishes. + defp flag(true), do: "" + defp flag(_state), do: nil +end diff --git a/examples/chat/lib/chat_web/components/ui/empty.ex b/examples/chat/lib/chat_web/components/ui/empty.ex new file mode 100644 index 0000000..b56751b --- /dev/null +++ b/examples/chat/lib/chat_web/components/ui/empty.ex @@ -0,0 +1,173 @@ +# live_shadcn: empty @ 0.1.0 (74738014de7c) +# Generated from the shadcn registry. Regenerate upstream, never here. +# `mix ui.sync` reports what changed upstream and skips files you edited. + +defmodule ChatWeb.Components.UI.Empty do + @moduledoc """ + Empty. + + Reviewed from upstream. The marked upstream fact block is synchronized. + The HEEx body is maintained as a LiveView port. + """ + + use Phoenix.Component + + # live-shadcn: upstream facts start + @upstream_facts %{ + "cva/emptyMediaVariants/base" => + "cn-empty-media flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0", + "cva/emptyMediaVariants/default/variant" => "default", + "cva/emptyMediaVariants/variant/variant/default" => "cn-empty-media-default", + "cva/emptyMediaVariants/variant/variant/icon" => "cn-empty-media-icon", + "jsx/Empty/class/0" => + "cn-empty flex w-full min-w-0 flex-1 flex-col items-center justify-center text-center text-balance", + "jsx/EmptyContent/class/0" => + "cn-empty-content flex w-full max-w-sm min-w-0 flex-col items-center text-balance", + "jsx/EmptyDescription/class/0" => + "cn-empty-description text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary", + "jsx/EmptyHeader/class/0" => "cn-empty-header flex max-w-sm flex-col items-center", + "jsx/EmptyTitle/class/0" => "cn-empty-title cn-font-heading" + } + # live-shadcn: upstream facts end + Module.get_attribute(__MODULE__, :upstream_facts) + + defp upstream_fact(key), do: Map.fetch!(@upstream_facts, key) + + @variant_classes (for {"cva/" <> path, value} <- @upstream_facts, + [table, "variant", group, choice] <- [String.split(path, "/")], + reduce: %{} do + variants -> + put_in( + variants, + [ + Access.key(table, %{}), + Access.key(group, %{}), + Access.key(choice, nil) + ], + value + ) + end) + + @doc "The `empty` part." + + attr(:class, :any, default: nil, doc: "Appended to the class string upstream renders.") + attr(:rest, :global, include: ["data-slot"]) + slot(:inner_block) + + def empty(assigns) do + ~H""" +
+ {render_slot(@inner_block)} +
+ """ + end + + @doc "The `empty-header` part." + + attr(:class, :any, default: nil, doc: "Appended to the class string upstream renders.") + attr(:rest, :global, include: ["data-slot"]) + slot(:inner_block) + + def empty_header(assigns) do + ~H""" +
+ {render_slot(@inner_block)} +
+ """ + end + + @doc "The `empty-title` part." + + attr(:class, :any, default: nil, doc: "Appended to the class string upstream renders.") + attr(:rest, :global, include: ["data-slot"]) + slot(:inner_block) + + def empty_title(assigns) do + ~H""" +
+ {render_slot(@inner_block)} +
+ """ + end + + @doc "The `empty-description` part." + + attr(:class, :any, default: nil, doc: "Appended to the class string upstream renders.") + attr(:rest, :global, include: ["data-slot"]) + slot(:inner_block) + + def empty_description(assigns) do + ~H""" +
+ {render_slot(@inner_block)} +
+ """ + end + + @doc "The `empty-content` part." + + attr(:class, :any, default: nil, doc: "Appended to the class string upstream renders.") + attr(:rest, :global, include: ["data-slot"]) + slot(:inner_block) + + def empty_content(assigns) do + ~H""" +
+ {render_slot(@inner_block)} +
+ """ + end + + @doc "The `empty-icon` part." + attr(:variant, :string, + default: @upstream_facts["cva/emptyMediaVariants/default/variant"], + values: + @variant_classes |> get_in(["emptyMediaVariants", "variant"]) |> Map.keys() |> Enum.sort() + ) + + attr(:class, :any, default: nil, doc: "Appended to the class string upstream renders.") + attr(:rest, :global, include: ["data-slot"]) + slot(:inner_block) + + def empty_media(assigns) do + ~H""" +
+ {render_slot(@inner_block)} +
+ """ + end + + defp variant_class(table, group, value), + do: get_in(@variant_classes, [table, group, value]) +end diff --git a/examples/chat/lib/chat_web/components/ui/field.ex b/examples/chat/lib/chat_web/components/ui/field.ex new file mode 100644 index 0000000..008f8f4 --- /dev/null +++ b/examples/chat/lib/chat_web/components/ui/field.ex @@ -0,0 +1,299 @@ +# live_shadcn: field @ 0.1.0 (77e9bfdcb2f8) +# Generated from the shadcn registry. Regenerate upstream, never here. +# `mix ui.sync` reports what changed upstream and skips files you edited. + +defmodule ChatWeb.Components.UI.Field do + @moduledoc """ + Field. Groups all parts of the field. + + Reviewed from upstream. The marked upstream fact block is synchronized. + The HEEx body is maintained as a LiveView port. + """ + + use Phoenix.Component + + # live-shadcn: upstream facts start + @upstream_facts %{ + "cva/fieldVariants/base" => "cn-field group/field flex w-full", + "cva/fieldVariants/default/orientation" => "vertical", + "cva/fieldVariants/variant/orientation/horizontal" => + "cn-field-orientation-horizontal flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px", + "cva/fieldVariants/variant/orientation/responsive" => + "cn-field-orientation-responsive flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px", + "cva/fieldVariants/variant/orientation/vertical" => + "cn-field-orientation-vertical flex-col *:w-full [&>.sr-only]:w-auto", + "jsx/FieldContent/class/0" => + "cn-field-content group/field-content flex flex-1 flex-col leading-snug", + "jsx/FieldError/class/0" => "ml-4 flex list-disc flex-col gap-1", + "jsx/FieldError/class/1" => "cn-field-error font-normal", + "jsx/FieldGroup/class/0" => + "cn-field-group group/field-group @container/field-group flex w-full flex-col", + "jsx/FieldLegend/class/0" => "cn-field-legend", + "jsx/FieldSeparator/class/0" => "cn-field-separator relative", + "jsx/FieldSeparator/class/1" => "absolute inset-0 top-1/2", + "jsx/FieldSeparator/class/2" => + "cn-field-separator-content relative mx-auto block w-fit bg-background", + "jsx/FieldSet/class/0" => "cn-field-set flex flex-col", + "jsx/FieldTitle/class/0" => "cn-field-title flex w-fit items-center", + "port/class/0" => + "cn-field-description leading-normal font-normal group-has-data-horizontal/field:text-balance last:mt-0 nth-last-2:-mt-1 [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary", + "port/class/1" => + "cn-field-label group/field-label peer/field-label flex w-fit has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col" + } + # live-shadcn: upstream facts end + Module.get_attribute(__MODULE__, :upstream_facts) + + defp upstream_fact(key), do: Map.fetch!(@upstream_facts, key) + + @variant_classes (for {"cva/" <> path, value} <- @upstream_facts, + [table, "variant", group, choice] <- [String.split(path, "/")], + reduce: %{} do + variants -> + put_in( + variants, + [ + Access.key(table, %{}), + Access.key(group, %{}), + Access.key(choice, nil) + ], + value + ) + end) + + @doc "The `field` part." + attr(:orientation, :string, + default: @upstream_facts["cva/fieldVariants/default/orientation"], + values: + @variant_classes |> get_in(["fieldVariants", "orientation"]) |> Map.keys() |> Enum.sort() + ) + + attr(:class, :any, default: nil, doc: "Appended to the class string upstream renders.") + attr(:rest, :global, include: ["data-slot"]) + slot(:inner_block) + + def field(assigns) do + ~H""" +
+ {render_slot(@inner_block)} +
+ """ + end + + @doc "The `field-label` part." + + attr(:class, :any, default: nil, doc: "Appended to the class string upstream renders.") + attr(:rest, :global, include: ["data-slot", "for"]) + slot(:inner_block) + + def field_label(assigns) do + ~H""" + + {render_slot(@inner_block)} + + """ + end + + @doc "The `field-description` part." + + attr(:class, :any, default: nil, doc: "Appended to the class string upstream renders.") + attr(:rest, :global, include: ["data-slot"]) + slot(:inner_block) + + def field_description(assigns) do + ~H""" +

+ {render_slot(@inner_block)} +

+ """ + end + + @doc "The `field-error` part." + attr(:content, :string, default: nil) + attr(:errors, :list, default: []) + attr(:class, :any, default: nil, doc: "Appended to the class string upstream renders.") + attr(:rest, :global, include: ["data-slot"]) + slot(:inner_block) + + def field_error(assigns) do + messages = + assigns.errors + |> Enum.map(&error_message/1) + |> Enum.reject(&is_nil/1) + |> Enum.uniq() + + assigns = + assigns + |> assign(:messages, messages) + |> assign(:render?, assigns.inner_block != [] or assigns.content != nil or messages != []) + + ~H""" + + """ + end + + defp error_message(%{message: message}) when is_binary(message), do: message + defp error_message(%{"message" => message}) when is_binary(message), do: message + defp error_message(message) when is_binary(message), do: message + defp error_message(_error), do: nil + + @doc "The `field-group` part." + + attr(:class, :any, default: nil, doc: "Appended to the class string upstream renders.") + attr(:rest, :global, include: ["data-slot"]) + slot(:inner_block) + + def field_group(assigns) do + ~H""" +
+ {render_slot(@inner_block)} +
+ """ + end + + @doc "The `field-legend` part." + attr(:variant, :string, default: "legend", values: ["legend", "label"]) + attr(:class, :any, default: nil, doc: "Appended to the class string upstream renders.") + attr(:rest, :global, include: ["data-slot"]) + slot(:inner_block) + + def field_legend(assigns) do + ~H""" + + {render_slot(@inner_block)} + + """ + end + + @doc "The `field-separator` part." + + attr(:class, :any, default: nil, doc: "Appended to the class string upstream renders.") + attr(:rest, :global, include: ["data-slot"]) + slot(:inner_block) + + def field_separator(assigns) do + ~H""" +
+ + + {render_slot(@inner_block)} + +
+ """ + end + + @doc "The `field-set` part." + + attr(:class, :any, default: nil, doc: "Appended to the class string upstream renders.") + attr(:rest, :global, include: ["data-slot"]) + slot(:inner_block) + + def field_set(assigns) do + ~H""" +
+ {render_slot(@inner_block)} +
+ """ + end + + @doc "The `field-content` part." + + attr(:class, :any, default: nil, doc: "Appended to the class string upstream renders.") + attr(:rest, :global, include: ["data-slot"]) + slot(:inner_block) + + def field_content(assigns) do + ~H""" +
+ {render_slot(@inner_block)} +
+ """ + end + + @doc "The `field-label` part." + + attr(:class, :any, default: nil, doc: "Appended to the class string upstream renders.") + attr(:rest, :global, include: ["data-slot"]) + slot(:inner_block) + + def field_title(assigns) do + ~H""" +
+ {render_slot(@inner_block)} +
+ """ + end + + defp variant_class(table, group, value), + do: get_in(@variant_classes, [table, group, value]) +end diff --git a/examples/chat/lib/chat_web/components/ui/item.ex b/examples/chat/lib/chat_web/components/ui/item.ex new file mode 100644 index 0000000..816b7ad --- /dev/null +++ b/examples/chat/lib/chat_web/components/ui/item.ex @@ -0,0 +1,288 @@ +# live_shadcn: item @ 0.1.0 (6302cede25e4) +# Generated from the shadcn registry. Regenerate upstream, never here. +# `mix ui.sync` reports what changed upstream and skips files you edited. + +defmodule ChatWeb.Components.UI.Item do + @moduledoc """ + Item. + + Reviewed from upstream. The marked upstream fact block is synchronized. + The HEEx body is maintained as a LiveView port. + """ + + use Phoenix.Component + + # live-shadcn: upstream facts start + @upstream_facts %{ + "cva/itemMediaVariants/base" => + "cn-item-media flex shrink-0 items-center justify-center [&_svg]:pointer-events-none", + "cva/itemMediaVariants/default/variant" => "default", + "cva/itemMediaVariants/variant/variant/default" => "cn-item-media-variant-default", + "cva/itemMediaVariants/variant/variant/icon" => "cn-item-media-variant-icon", + "cva/itemMediaVariants/variant/variant/image" => "cn-item-media-variant-image", + "cva/itemVariants/base" => + "cn-item group/item flex w-full flex-wrap items-center transition-colors duration-100 outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 [a]:transition-colors", + "cva/itemVariants/default/size" => "default", + "cva/itemVariants/default/variant" => "default", + "cva/itemVariants/variant/size/default" => "cn-item-size-default", + "cva/itemVariants/variant/size/sm" => "cn-item-size-sm", + "cva/itemVariants/variant/size/xs" => "cn-item-size-xs", + "cva/itemVariants/variant/variant/default" => "cn-item-variant-default", + "cva/itemVariants/variant/variant/muted" => "cn-item-variant-muted", + "cva/itemVariants/variant/variant/outline" => "cn-item-variant-outline", + "jsx/ItemActions/class/0" => "cn-item-actions flex items-center", + "jsx/ItemContent/class/0" => + "cn-item-content flex flex-1 flex-col [&+[data-slot=item-content]]:flex-none", + "jsx/ItemDescription/class/0" => + "cn-item-description line-clamp-2 font-normal [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary", + "jsx/ItemFooter/class/0" => "cn-item-footer flex basis-full items-center justify-between", + "jsx/ItemGroup/class/0" => "cn-item-group group/item-group flex w-full flex-col", + "jsx/ItemHeader/class/0" => "cn-item-header flex basis-full items-center justify-between", + "jsx/ItemSeparator/class/0" => "cn-item-separator", + "jsx/ItemTitle/class/0" => "cn-item-title line-clamp-1 flex w-fit items-center" + } + # live-shadcn: upstream facts end + Module.get_attribute(__MODULE__, :upstream_facts) + + defp upstream_fact(key), do: Map.fetch!(@upstream_facts, key) + + @variant_classes (for {"cva/" <> path, value} <- @upstream_facts, + [table, "variant", group, choice] <- [String.split(path, "/")], + reduce: %{} do + variants -> + put_in( + variants, + [ + Access.key(table, %{}), + Access.key(group, %{}), + Access.key(choice, nil) + ], + value + ) + end) + + @doc "The `item` part." + attr(:size, :string, + default: @upstream_facts["cva/itemVariants/default/size"], + values: @variant_classes |> get_in(["itemVariants", "size"]) |> Map.keys() |> Enum.sort() + ) + + attr(:variant, :string, + default: @upstream_facts["cva/itemVariants/default/variant"], + values: @variant_classes |> get_in(["itemVariants", "variant"]) |> Map.keys() |> Enum.sort() + ) + + attr(:as, :string, default: "div", values: ["a", "div"]) + attr(:class, :any, default: nil, doc: "Appended to the class string upstream renders.") + attr(:rest, :global, include: ["data-slot", "href", "rel", "target"]) + slot(:inner_block) + + def item(assigns) do + ~H""" + <.dynamic_tag + tag_name={@as} + data-slot={@rest[:"data-slot"] || "item"} + data-size={@size} + data-variant={@variant} + class={ + LiveShadcn.Cn.merge([ + upstream_fact("cva/itemVariants/base"), + variant_class("itemVariants", "variant", @variant), + variant_class("itemVariants", "size", @size), + @class + ]) + } + {Map.drop(@rest, [:"data-slot"])} + > + {render_slot(@inner_block)} + + """ + end + + @doc "The `item-media` part." + attr(:variant, :string, + default: @upstream_facts["cva/itemMediaVariants/default/variant"], + values: + @variant_classes |> get_in(["itemMediaVariants", "variant"]) |> Map.keys() |> Enum.sort() + ) + + attr(:class, :any, default: nil, doc: "Appended to the class string upstream renders.") + attr(:rest, :global, include: ["data-slot"]) + slot(:inner_block) + + def item_media(assigns) do + ~H""" +
+ {render_slot(@inner_block)} +
+ """ + end + + @doc "The `item-content` part." + + attr(:class, :any, default: nil, doc: "Appended to the class string upstream renders.") + attr(:rest, :global, include: ["data-slot"]) + slot(:inner_block) + + def item_content(assigns) do + ~H""" +
+ {render_slot(@inner_block)} +
+ """ + end + + @doc "The `item-actions` part." + + attr(:class, :any, default: nil, doc: "Appended to the class string upstream renders.") + attr(:rest, :global, include: ["data-slot"]) + slot(:inner_block) + + def item_actions(assigns) do + ~H""" +
+ {render_slot(@inner_block)} +
+ """ + end + + @doc "The `item-group` part." + + attr(:class, :any, default: nil, doc: "Appended to the class string upstream renders.") + attr(:rest, :global, include: ["data-slot"]) + slot(:inner_block) + + def item_group(assigns) do + ~H""" +
+ {render_slot(@inner_block)} +
+ """ + end + + @doc "The `item-separator` part." + + attr(:class, :any, default: nil, doc: "Appended to the class string upstream renders.") + attr(:rest, :global, include: ["data-slot"]) + slot(:inner_block) + + def item_separator(assigns) do + ~H""" + + {render_slot(@inner_block)} + + """ + end + + @doc "The `item-title` part." + + attr(:class, :any, default: nil, doc: "Appended to the class string upstream renders.") + attr(:rest, :global, include: ["data-slot"]) + slot(:inner_block) + + def item_title(assigns) do + ~H""" +
+ {render_slot(@inner_block)} +
+ """ + end + + @doc "The `item-description` part." + + attr(:class, :any, default: nil, doc: "Appended to the class string upstream renders.") + attr(:rest, :global, include: ["data-slot"]) + slot(:inner_block) + + def item_description(assigns) do + ~H""" +

+ {render_slot(@inner_block)} +

+ """ + end + + @doc "The `item-header` part." + + attr(:class, :any, default: nil, doc: "Appended to the class string upstream renders.") + attr(:rest, :global, include: ["data-slot"]) + slot(:inner_block) + + def item_header(assigns) do + ~H""" +
+ {render_slot(@inner_block)} +
+ """ + end + + @doc "The `item-footer` part." + + attr(:class, :any, default: nil, doc: "Appended to the class string upstream renders.") + attr(:rest, :global, include: ["data-slot"]) + slot(:inner_block) + + def item_footer(assigns) do + ~H""" +
+ {render_slot(@inner_block)} +
+ """ + end + + defp variant_class(table, group, value), + do: get_in(@variant_classes, [table, group, value]) + + defp item_title_class(nil), do: upstream_fact("jsx/ItemTitle/class/0") + + defp item_title_class(class), + do: LiveShadcn.Cn.merge([upstream_fact("jsx/ItemTitle/class/0"), class]) +end diff --git a/examples/chat/lib/chat_web/live/chat_live.ex b/examples/chat/lib/chat_web/live/chat_live.ex index f30324b..8bbc445 100644 --- a/examples/chat/lib/chat_web/live/chat_live.ex +++ b/examples/chat/lib/chat_web/live/chat_live.ex @@ -26,8 +26,14 @@ defmodule ChatWeb.ChatLive do alias AudioFlow.Text alias Chat.Catalog alias Chat.Setup + alias ChatWeb.Components.UI.Alert alias ChatWeb.Components.UI.Badge alias ChatWeb.Components.UI.Button + alias ChatWeb.Components.UI.Card + alias ChatWeb.Components.UI.Collapsible + alias ChatWeb.Components.UI.Empty + alias ChatWeb.Components.UI.Field + alias ChatWeb.Components.UI.Item alias ChatWeb.Components.UI.NativeSelect alias ChatWeb.Components.UI.Spinner alias LiveAiElements.Components.AudioPlayer @@ -958,9 +964,9 @@ defmodule ChatWeb.ChatLive do
- - - - + Apply
- + + + {@setup_error} +
- <.model_field label="Speech recognition" status={@models.status[:stt]}> + <.model_field label="Speech recognition" for="model-stt" status={@models.status[:stt]}> - <.model_field label="Reply model" status={@models.status[:llm]}> + <.model_field label="Reply model" for="model-llm" status={@models.status[:llm]}> - <.model_field label="Voice (Kokoro)" status={@models.status[:tts]}> + <.model_field label="Voice (Kokoro)" for="model-voice" status={@models.status[:tts]}> -
-
-
- - Start conversation - - - Stop - -
- - {call_label(@call_status)} -
- -
- Diagnostics - -
-
-
- Settings -
+ + +
+
+ + Start conversation + + + Stop + +
+ + {call_label(@call_status)} +
+ + + {@call_error} + + <.disclosure id="duplex-diagnostics" title="Diagnostics" class="w-full"> + + +
+
+ <.disclosure :if={not @duplex} id="settings" title="Settings"> +

≈ {gb(@models.memory_gb)} GB of model weights{if @system_memory_gb, do: " · #{gb(@system_memory_gb)} GB memory"}. {fit_text(@system_memory_gb)} @@ -1097,21 +1103,35 @@ defmodule ChatWeb.ChatLive do Text only, with all words replaced by [REDACTED]. Deleted when you leave.

-
- {id} - - Download - - - Delete - -
+ + + {id} + + + + Download + + + Delete + + +
-
+ -

- No messages yet. -

+ + + + + + No messages yet. + + {if @duplex, + do: "Start the conversation and speak.", + else: "Type a message, or record one with the microphone."} + + + @@ -1140,9 +1160,8 @@ defmodule ChatWeb.ChatLive do
-
- Diagnostics -
+ <.disclosure :if={not @duplex} id="diagnostics" title="Diagnostics"> +
Pause playback @@ -1152,7 +1171,7 @@ defmodule ChatWeb.ChatLive do Confirm stop Playback acknowledged: {@played_ms} ms
-
+ - + + {@label} - + {render_slot(@inner_block)} - + {status_text(@status)} - - + + + """ + end + + attr(:id, :string, required: true) + attr(:title, :string, required: true) + attr(:class, :any, default: nil) + attr(:rest, :global) + slot(:inner_block, required: true) + + # A closed section with a chevron trigger, for settings and diagnostics. + defp disclosure(assigns) do + ~H""" + + <:trigger> + + {@title} + + {render_slot(@inner_block)} + """ end end From 8333a9c1a0c4cc4664be7aa6aa156d7bb238143f Mon Sep 17 00:00:00 2001 From: TudorAndrei Date: Fri, 6 Nov 2026 23:43:29 +0200 Subject: [PATCH 5/6] fix(chat): apply the OpenAI voice when it changes --- examples/chat/lib/chat_web/live/chat_live.ex | 15 ++++++++++++++- examples/chat/test/openai_live_test.exs | 10 ++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/examples/chat/lib/chat_web/live/chat_live.ex b/examples/chat/lib/chat_web/live/chat_live.ex index 8bbc445..318a33b 100644 --- a/examples/chat/lib/chat_web/live/chat_live.ex +++ b/examples/chat/lib/chat_web/live/chat_live.ex @@ -258,6 +258,13 @@ defmodule ChatWeb.ChatLive do def handle_event("call_failed", %{"message" => message}, socket) when is_binary(message), do: {:noreply, call_error(socket, "Microphone error: " <> String.slice(message, 0, 200))} + # The voice applies at the next call start, so it needs no new chat and no Apply. + def handle_event("select_voice", %{"voice" => voice}, socket) do + if voice in Setup.voices() and is_nil(socket.assigns.call), + do: {:noreply, assign(socket, settings: Map.put(socket.assigns.settings, "voice", voice))}, + else: {:noreply, socket} + end + def handle_event("select_model", %{"_target" => [field]} = params, socket) when field in ["stt", "llm", "voice"] do result = Chat.Engine.select(String.to_existing_atom(field), params[field]) @@ -978,7 +985,13 @@ defmodule ChatWeb.ChatLive do Voice - + element("#setting-voice") |> render_change(%{"voice" => "cedar"}) + {_generation, _peer, session} = connect(view) + assert session["audio"]["output"]["voice"] == "cedar" + assert has_element?(view, "#setting-voice[disabled]") + end + test "one connection hears several utterances while the microphone streams" do openai_peer() {:ok, view, _} = live(build_conn(), "/") @@ -289,6 +298,7 @@ defmodule Chat.OpenAILiveTest do assert eventually(fn -> state = :sys.get_state(view.pid).socket.assigns + Enum.count_until(state.call.users, 17) == 16 and Enum.count_until(state.messages, 17) == 16 end) From 100bf466bbd636ea0e915971313205114adc4754 Mon Sep 17 00:00:00 2001 From: TudorAndrei Date: Fri, 6 Nov 2026 23:47:36 +0200 Subject: [PATCH 6/6] feat(ui): apply the docs theme and fonts --- examples/chat/assets/css/app.css | 3 +- ui/assets/css/app.css | 82 ++++++++++++++++++- ui/assets/fonts.mjs | 24 ++++++ ui/assets/package-lock.json | 20 +++++ ui/assets/package.json | 7 +- ui/lib/audio_flow_ui_web/layouts.ex | 25 +++++- .../audio_flow_ui_web/live/examples_live.ex | 4 +- ui/lib/audio_flow_ui_web/live/graphs_live.ex | 4 +- 8 files changed, 161 insertions(+), 8 deletions(-) create mode 100644 ui/assets/fonts.mjs diff --git a/examples/chat/assets/css/app.css b/examples/chat/assets/css/app.css index f77aedc..e0a29d4 100644 --- a/examples/chat/assets/css/app.css +++ b/examples/chat/assets/css/app.css @@ -8,7 +8,8 @@ @source "../../deps/live_ai_elements/packages/live_ai_elements/lib"; /* The docs theme (site/src/styles/docs.css): AudioFlow lavender and Elixir - purple, Bricolage Grotesque and IBM Plex Mono. The layout loads the fonts. */ + purple, Bricolage Grotesque and IBM Plex Mono. The layout loads the fonts. + Keep the same as ui/assets/css/app.css. */ :root { --font-sans: "Bricolage Grotesque Variable", ui-sans-serif, system-ui, sans-serif; --font-heading: var(--font-sans); diff --git a/ui/assets/css/app.css b/ui/assets/css/app.css index f4aade2..38d1922 100644 --- a/ui/assets/css/app.css +++ b/ui/assets/css/app.css @@ -7,8 +7,86 @@ @source "../../deps/live_shadcn/packages/live_shadcn/priv/registry"; @source "../../deps/live_ai_elements/packages/live_ai_elements/lib"; +/* The docs theme (site/src/styles/docs.css): AudioFlow lavender and Elixir + purple, Bricolage Grotesque and IBM Plex Mono. The layout loads the fonts. + Keep the same as examples/chat/assets/css/app.css. */ :root { - --font-sans: ui-sans-serif, system-ui, sans-serif; + --font-sans: "Bricolage Grotesque Variable", ui-sans-serif, system-ui, sans-serif; --font-heading: var(--font-sans); - --font-mono: ui-monospace, monospace; + --font-mono: "IBM Plex Mono", ui-monospace, monospace; + + --background: #fbfaff; + --foreground: #1d1638; + --card: #f6f4fc; + --card-foreground: #1d1638; + --popover: #fbfaff; + --popover-foreground: #1d1638; + --primary: #5b2e91; + --primary-foreground: #ffffff; + --secondary: #ebe8f5; + --secondary-foreground: #2b2447; + --muted: #ebe8f5; + --muted-foreground: #6b6585; + --accent: #e7defa; + --accent-foreground: #2e1452; + --border: #d9d4ea; + --input: #d9d4ea; + --ring: #5b2e91; + --sidebar: #f6f4fc; + --sidebar-foreground: #1d1638; + --sidebar-primary: #5b2e91; + --sidebar-primary-foreground: #ffffff; + --sidebar-accent: #e7defa; + --sidebar-accent-foreground: #2e1452; + --sidebar-border: #d9d4ea; + --sidebar-ring: #5b2e91; + --surface: #f6f4fc; + --surface-foreground: #1d1638; + --code-highlight: #ebe8f5; + --code-number: #6b6585; + --selection: #5b2e91; + --selection-foreground: #ffffff; +} + +.dark { + --background: #19132b; + --foreground: #ece9f5; + --card: #261f3d; + --card-foreground: #ece9f5; + --popover: #261f3d; + --popover-foreground: #ece9f5; + --primary: #9a6fd6; + --primary-foreground: #19132b; + --secondary: #2b2447; + --secondary-foreground: #ece9f5; + --muted: #261f3d; + --muted-foreground: #9890b3; + --accent: #3b3457; + --accent-foreground: #ece9f5; + --border: #3b3457; + --input: #3b3457; + --ring: #9a6fd6; + --sidebar: #261f3d; + --sidebar-foreground: #ece9f5; + --sidebar-primary: #9a6fd6; + --sidebar-primary-foreground: #19132b; + --sidebar-accent: #3b3457; + --sidebar-accent-foreground: #ece9f5; + --sidebar-border: #3b3457; + --sidebar-ring: #9a6fd6; + --surface: #261f3d; + --surface-foreground: #c9c3dc; + --code-highlight: #3b3457; + --code-number: #9890b3; + --selection: #e3d6f7; + --selection-foreground: #2a1a46; +} + +@layer base { + h1, + h2, + h3 { + letter-spacing: -0.02em; + font-stretch: 88%; + } } diff --git a/ui/assets/fonts.mjs b/ui/assets/fonts.mjs new file mode 100644 index 0000000..754dda3 --- /dev/null +++ b/ui/assets/fonts.mjs @@ -0,0 +1,24 @@ +// Copies the docs fonts into priv/static/assets/fonts. Tailwind does not copy +// the font files that @fontsource stylesheets reference, so the layout links +// these copies directly. Only the files each stylesheet names are copied. +import { cpSync, readFileSync } from "node:fs"; +import { createRequire } from "node:module"; +import path from "node:path"; + +const require = createRequire(import.meta.url); +const out = path.resolve(import.meta.dirname, "../priv/static/assets/fonts"); + +for (const [name, sheets] of [ + ["@fontsource-variable/bricolage-grotesque", ["standard.css"]], + ["@fontsource/ibm-plex-mono", ["400.css", "600.css"]], +]) { + const root = path.dirname(require.resolve(`${name}/package.json`)); + const dest = path.join(out, path.basename(name)); + + for (const sheet of sheets) { + const css = readFileSync(path.join(root, sheet), "utf8"); + const files = [sheet, ...css.matchAll(/url\(\.\/([^)]+)\)/g).map((m) => m[1])]; + + for (const file of files) cpSync(path.join(root, file), path.join(dest, file)); + } +} diff --git a/ui/assets/package-lock.json b/ui/assets/package-lock.json index 07901aa..486f0cc 100644 --- a/ui/assets/package-lock.json +++ b/ui/assets/package-lock.json @@ -7,6 +7,8 @@ "name": "audioflow_ui", "dependencies": { "@floating-ui/dom": "^1.8.0", + "@fontsource-variable/bricolage-grotesque": "^5.3.0", + "@fontsource/ibm-plex-mono": "^5.3.0", "@rive-app/webgl2": "2.34.1", "embla-carousel": "8.5.2", "embla-carousel-autoplay": "8.5.2", @@ -740,6 +742,24 @@ "integrity": "sha512-HpCo8tmWzLVad5s2d19EhAz5zqrrQ6s69qd6moPMQvkOuSwDT1YgRfWSVuc4ennqrgv3OHppiOGMQ7oC13yIww==", "license": "MIT" }, + "node_modules/@fontsource-variable/bricolage-grotesque": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/@fontsource-variable/bricolage-grotesque/-/bricolage-grotesque-5.3.0.tgz", + "integrity": "sha512-TLi9Q4hJjS2UvoTMRSS2nHu6c4R56lAw60NR9QYtVRCHn0XtsFpiEhNffZ8Glsoxu6wEEwLKBP8lb94J52PNBA==", + "license": "OFL-1.1", + "funding": { + "url": "https://github.com/sponsors/ayuhito" + } + }, + "node_modules/@fontsource/ibm-plex-mono": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/@fontsource/ibm-plex-mono/-/ibm-plex-mono-5.3.0.tgz", + "integrity": "sha512-eTgnZjZEGk1QtD3ZstF+Vclo2HLAni8YMy34/DxllwZvyz1lR/1RF/xTiAquOBO7MvqBx8D2Ig2WCPMVfdZu7Q==", + "license": "OFL-1.1", + "funding": { + "url": "https://github.com/sponsors/ayuhito" + } + }, "node_modules/@jridgewell/gen-mapping": { "version": "0.3.13", "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", diff --git a/ui/assets/package.json b/ui/assets/package.json index 4af72f8..6f5cff6 100644 --- a/ui/assets/package.json +++ b/ui/assets/package.json @@ -3,12 +3,15 @@ "private": true, "type": "module", "scripts": { - "build": "npm run build:css && npm run build:js", + "build": "npm run build:css && npm run build:js && npm run build:fonts", "build:css": "tailwindcss --input=css/app.css --output=../priv/static/assets/app.css", - "build:js": "rolldown -c rolldown.config.mjs" + "build:js": "rolldown -c rolldown.config.mjs", + "build:fonts": "node fonts.mjs" }, "dependencies": { "@floating-ui/dom": "^1.8.0", + "@fontsource-variable/bricolage-grotesque": "^5.3.0", + "@fontsource/ibm-plex-mono": "^5.3.0", "@rive-app/webgl2": "2.34.1", "embla-carousel": "8.5.2", "embla-carousel-autoplay": "8.5.2", diff --git a/ui/lib/audio_flow_ui_web/layouts.ex b/ui/lib/audio_flow_ui_web/layouts.ex index 159cc98..150ac39 100644 --- a/ui/lib/audio_flow_ui_web/layouts.ex +++ b/ui/lib/audio_flow_ui_web/layouts.ex @@ -4,12 +4,21 @@ defmodule AudioFlowUIWeb.Layouts do def root(assigns) do ~H""" - + AudioFlow + <%!-- Follow the system color scheme, as the docs do. --%> + + + + @@ -20,4 +29,18 @@ defmodule AudioFlowUIWeb.Layouts do """ end + + @doc "The AudioFlow mark from the docs." + attr(:class, :any, default: "size-7") + + def logo(assigns) do + ~H""" + + """ + end end diff --git a/ui/lib/audio_flow_ui_web/live/examples_live.ex b/ui/lib/audio_flow_ui_web/live/examples_live.ex index 725f88d..b002480 100644 --- a/ui/lib/audio_flow_ui_web/live/examples_live.ex +++ b/ui/lib/audio_flow_ui_web/live/examples_live.ex @@ -59,7 +59,9 @@ defmodule AudioFlowUIWeb.ExamplesLive do ~H"""
<.link navigate="/">Graphs -

Runnable examples

+

+ Runnable examples +

Synthetic checks use real sessions with deterministic adapters. They do not verify native models, providers or devices.

diff --git a/ui/lib/audio_flow_ui_web/live/graphs_live.ex b/ui/lib/audio_flow_ui_web/live/graphs_live.ex index ba6cfb1..d1269fc 100644 --- a/ui/lib/audio_flow_ui_web/live/graphs_live.ex +++ b/ui/lib/audio_flow_ui_web/live/graphs_live.ex @@ -29,7 +29,9 @@ defmodule AudioFlowUIWeb.GraphsLive do
-

Agent graphs

+

+ Agent graphs +

<.link navigate="/examples">Runnable examples