* ui: generate DESIGN.md's token sections from the CSS Add scripts/design-md.js in ui/apps/chat (npm run design:tokens, and npm run check:design in CI), which writes the colors, typography and rounded sections of DESIGN.md's front matter from llama-brand's colors.css and Llama UI's primitives, semantic tokens and font stacks. The front matter had drifted: it gave Matte's surfaces as the light base and system-ui for every text role. Twins are now written wherever a token resolves differently in dark mode (-dark) or in Matte (-matte). Describe the floating panel's rim as the CSS draws it, on the border, and say which parts of DESIGN.md are generated and which are kept by hand. Assisted-by: Claude (Opus 5.5 Medium) * ui: say the Storybooks show accessibility findings without enforcing them Both Storybooks keep a11y test 'todo': under 'error' 98 of the stories fail, most on colour contrast of the muted foreground and on nested interactive controls, which need design changes. Reword the Uses tile and record the reason next to the setting. Assisted-by: Claude (Opus 5.5 Medium) * ui: list every Llama Chat group in the Introduction's Sections figure The figure said it was in sidebar order but left out Forms, Actions, Badges, Misc, Servers and PWA. Its list moves to sections.ts, and a unit test checks it against storySort in .storybook/preview.ts, which has to stay inline there because Storybook parses it as written. Assisted-by: Claude (Opus 5.5 Medium) * ui: load the package's Llama Mono in both Storybooks The library's Storybook declared Llama Mono a second time from tests/stories/brand/fonts, a 72276-byte file that differs from the 76896-byte one the package ships, so its pages showed a Llama Mono that does not ship. Drop both Storybooks' copies: theme.css already loads the package's font. Assisted-by: Claude (Opus 5.5 Medium) * ui: take Llama Chat's shared Storybook helpers from Llama UI Llama Chat kept copies of the Editorial, Chapters, StateGallery, StateGalleryItem, svx.d.ts and docs.css that live with the library's stories. Its stories now import them as $llama-ui-stories/..., an alias its Storybook config and tsconfig.json map onto ui/lib/ui/tests/stories, the way it already compiles the library from source; docs.css and svx.d.ts are referenced by path. The library's Editorial takes Llama Chat's newer list numbering. An empty svelte.config.js next to the stories keeps Llama Chat's svelte-check from loading the library's vite.config.ts, as src/svelte.config.js does for the sources. Assisted-by: Claude (Opus 5.5 Medium) * ui: pin the library's Storybook to Llama Chat's versions ui/lib/ui used ^10.6.2 with @storybook/addon-mcp at 10.6.2, while ui/apps/chat pins 10.6.6, so one tree had two Storybooks. Pin the library's Storybook packages exactly to Llama Chat's: 10.6.6, addon-svelte-csf 5.1.6 and @chromatic-com/storybook 5.5.1. Assisted-by: Claude (Opus 5.5 Medium)
61 lines
2.8 KiB
Plaintext
61 lines
2.8 KiB
Plaintext
<!--
|
|
The Storybook's front page (Introduction): in short, what this Storybook is for, how we think, how the products fit
|
|
together and how the sections are laid out. Written for people first and readable as plain Markdown by agents too.
|
|
Set in the Editorial.
|
|
-->
|
|
|
|
<script>
|
|
import Figure from '../editorial/Figure.svelte';
|
|
import Principles from './Principles.svelte';
|
|
import Products from './Products.svelte';
|
|
import Sections from './Sections.svelte';
|
|
import Stack from './Stack.svelte';
|
|
import Uses from './Uses.svelte';
|
|
</script>
|
|
|
|
<p class="kicker">Llama · Storybook</p>
|
|
|
|
# Introduction
|
|
|
|
<p class="lead">This is where <strong>Llama UI</strong> and <strong>Llama Chat</strong> are designed, built and checked. Everything in it is the real component, font or file, so what you see here is what ships. The <strong>Llama Brand</strong> and the communications made with it have their own Storybook, in llama-brand.</p>
|
|
|
|
## In short
|
|
|
|
The component library **Llama UI**, built on the **Llama Brand** (the icon, Llama Sans and Llama Mono, the colours), and the app **Llama Chat** built from it, in one place, for the people and agents who design and build Llama products.
|
|
|
|
<Figure n={1} caption="The building blocks, from the bottom: the Llama Brand, in llama-brand, Llama UI built on it and Llama Chat built from that. The communications are made from the brand and the app, in llama-brand too.">
|
|
<Stack />
|
|
</Figure>
|
|
|
|
## What it's for
|
|
|
|
<Figure n={2} caption="Four uses.">
|
|
<Uses />
|
|
</Figure>
|
|
|
|
## How we think
|
|
|
|
<Figure n={3} caption="Five ideas, each drawn with the real system: the devices a model runs on, the first run's recommendation, the three places the character lives, a control on its grid and one token chain.">
|
|
<Principles />
|
|
</Figure>
|
|
|
|
## How it fits together
|
|
|
|
<Figure n={4} caption="The products and their repositories. llama-brand supplies the brand; llama.cpp holds the engine, Llama UI in ui/lib/ui and Llama Chat in ui/apps/chat, this Storybook's home; the native apps run llama-server and open Llama Chat. llama.app shows models the way Llama Chat does.">
|
|
<Products />
|
|
</Figure>
|
|
|
|
Inside Llama UI, the tokens go from primitives to semantic roles to components, in `ui/lib/ui/src/lib/styles/tokens/`, and the token sections of `DESIGN.md` are generated from them (`npm run design:tokens`); its rules are written by hand. Llama UI draws the interface and handles interaction; each app owns its own state.
|
|
|
|
## How it's laid out
|
|
|
|
<Figure n={5} caption="The sections, in sidebar order.">
|
|
<Sections />
|
|
</Figure>
|
|
|
|
## Working in it
|
|
|
|
- Run it with `npm run storybook` in `ui/apps/chat`.
|
|
- Pages that are mostly prose, like this one, are `.svx`: Markdown with Svelte components in it. `AGENTS.md` says how to write them.
|
|
- Where a guideline and a story disagree, the story is right: it's the real thing.
|