@veevarts/design-system 2.0.0-alpha.58 → 2.0.0-alpha.59

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.
package/README.md CHANGED
@@ -288,6 +288,21 @@ module.exports = {
288
288
  | `colors` | Color tokens (brand, semantic, neutral, palettes) |
289
289
  | `typography` | Typography tokens (fontFamily, fontSize, fontWeight, lineHeight) |
290
290
  | `spacing` | Spacing tokens |
291
+ | `assistantSurfaceTokens` | The assistant (`ai-*`) palette as hex, `{ light, dark }` |
292
+ | `assistantSurfacePlugin` | Writes the `--ai-*` custom properties. Already inside `veevartPreset`; add it yourself only if you extend `tokens.tailwindTheme` without the preset |
293
+ | `assistantSurfaceTailwindColors` | The `ai` colour map the preset uses: each colour reads its `--ai-*` property, with the light value as fallback |
294
+
295
+ #### Assistant color (`ai-*`), light and dark
296
+
297
+ The preset adds an `ai` colour family for assistant surfaces: `ai-accent`, `ai-fill`, `ai-border`, `ai-user-bubble`, `ai-assistant-bubble` and `ai-focus` (`text-ai-accent`, `bg-ai-fill/50`, `ring-ai-focus`, …).
298
+
299
+ - Each color reads a custom property (`--ai-accent`, …) that the preset's plugin writes. **The `.dark` class is the switch:** dark values under `.dark`, light values on `:root`, `.light` and `[data-theme="light"]`, the selectors every HeroUI 2.x in the peer range writes its own variables under, so the palette flips together with HeroUI's semantic colors (a test compiles both and compares). `.dark` on a subtree darkens that subtree only.
300
+ - `data-theme="dark"` is **not** a switch. On HeroUI 2.8 (what the DS builds and tests with) neither palette turns dark under it, because 2.8 writes its dark variables under `.dark` only. On 2.7, the floor of the peer range, HeroUI turns dark there and `ai-*` doesn't. Use `.dark` either way.
301
+ - As with HeroUI's own `.dark` theme, Tailwind emits the dark values only when your content uses the `dark` class, which any app that toggles it does.
302
+ - The properties hold channels (`29 78 216`), and only `assistantSurfacePlugin` (inside the preset) writes them, into the Tailwind build's base layer. In plain CSS outside that build, or loaded before it, give the light value as the fallback: `rgb(var(--ai-accent, 29 78 216))`. Without one, the colour resolves to nothing.
303
+ - Without the plugin, the `ai-*` utilities fall back to their light values (the fallback is inside each utility's `var()`); a plain-CSS `var()` with no fallback does not.
304
+ - **The hue is a placeholder** (the info blue scale for accent, fill, border and focus) until Design picks the assistant color. The two turns are HeroUI neutrals (`content1` for the assistant, `content2` for the person), so only the assistant wears the hue. Values and contrast tests live in `src/tokens/assistant-surface.ts`; see Storybook → Foundations → Assistant color.
305
+ - Storybook has a **Theme** toolbar (light / dark); dark wraps the story in `.dark`, the way apps scope it.
291
306
 
292
307
  ---
293
308