docs: update portal for WRNexusJS 0.2.57
This commit is contained in:
+47
-4
@@ -1,4 +1,4 @@
|
||||
# WRNexusJS documentation 0.2.56
|
||||
# WRNexusJS documentation 0.2.57
|
||||
|
||||
Status: Private Developer Preview. This site documents 26 release-aligned packages.
|
||||
|
||||
@@ -281,7 +281,7 @@ wrnexus eject <component> # copy a Wire UI component's .wrn into app/compone
|
||||
|
||||
# Installed package documentation
|
||||
|
||||
The following README files and declarations come from the installed private 0.2.56 release.
|
||||
The following README files and declarations come from the installed private 0.2.57 release.
|
||||
|
||||
## @wrnexus/ai
|
||||
|
||||
@@ -6304,6 +6304,7 @@ Tokens are emitted as `--wire-<key>` custom properties, **except** the reserved
|
||||
type ThemeTokens = Record<string, string>;
|
||||
|
||||
interface ThemeConfig {
|
||||
palette?: ThemePaletteName | CustomThemePalette;
|
||||
default?: string; // theme used when no cookie is present
|
||||
themes?: Record<string, ThemeTokens>; // deep-merged over built-in light/dark
|
||||
}
|
||||
@@ -6315,7 +6316,30 @@ interface ResolvedTheme {
|
||||
}
|
||||
```
|
||||
|
||||
Built-in token keys (both `light` and `dark`): `color-scheme`, `color-bg`, `color-surface`, `color-surface-2`, `color-text`, `color-muted`, `color-border`, `color-primary`, `color-primary-hover`, `color-primary-contrast`, `color-danger`, `color-success`, `color-warning`, `radius`, `radius-sm`, `font-sans`, `shadow-1`.
|
||||
Built-in palettes are `blue`, `indigo`, `violet`, `emerald`, `cyan`, `rose`,
|
||||
`amber`, and `slate`. Each supplies primary, secondary, info, success, warning,
|
||||
danger/error, hover, and contrast colors to every light/dark theme. Built-in
|
||||
token keys also include surfaces, text, borders, radii, fonts, and shadows.
|
||||
|
||||
A custom palette is intentionally complete, so components never fall back to an
|
||||
unrelated blue status or action color:
|
||||
|
||||
```ts
|
||||
theme: {
|
||||
palette: {
|
||||
primary: "#7c3aed",
|
||||
primaryHover: "#6d28d9",
|
||||
primaryContrast: "#ffffff",
|
||||
secondary: "#db2777",
|
||||
secondaryHover: "#be185d",
|
||||
secondaryContrast: "#ffffff",
|
||||
info: "#2563eb",
|
||||
success: "#059669",
|
||||
warning: "#d97706",
|
||||
danger: "#dc2626",
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
The client runtime (`renderThemeRuntime`) exposes `window.wireTheme` with `{ get, set, toggle, bind, themes }`, wires up any `[data-wire-theme-toggle]` and `[data-wire-theme-set]` elements on load, and persists the choice to the `wire-theme` cookie (`max-age` 1 year, `samesite=lax`). `toggle()` cycles through the configured theme names in order.
|
||||
|
||||
@@ -6333,6 +6357,7 @@ export default {
|
||||
port: 3000,
|
||||
db: { driver: "sqlite", url: "app.db" },
|
||||
theme: {
|
||||
palette: "violet",
|
||||
default: "dark",
|
||||
themes: {
|
||||
light: { "color-primary": "#7c3aed" }, // override one token; rest inherited
|
||||
@@ -6443,7 +6468,24 @@ import { StorageConfig } from '@wrnexus/uploader';
|
||||
* controls and scrollbars match the theme.
|
||||
*/
|
||||
type ThemeTokens = Record<string, string>;
|
||||
declare const THEME_PALETTE_NAMES: readonly ["blue", "indigo", "violet", "emerald", "cyan", "rose", "amber", "slate"];
|
||||
type ThemePaletteName = (typeof THEME_PALETTE_NAMES)[number];
|
||||
/** Required semantic colors for a custom application palette. */
|
||||
interface CustomThemePalette {
|
||||
primary: string;
|
||||
primaryHover: string;
|
||||
primaryContrast: string;
|
||||
secondary: string;
|
||||
secondaryHover: string;
|
||||
secondaryContrast: string;
|
||||
info: string;
|
||||
success: string;
|
||||
warning: string;
|
||||
danger: string;
|
||||
}
|
||||
interface ThemeConfig {
|
||||
/** Built-in palette name, or a complete custom semantic color palette. */
|
||||
palette?: ThemePaletteName | CustomThemePalette;
|
||||
/** Name of the theme used when no `wire-theme` cookie is present. */
|
||||
default?: string;
|
||||
/** Named token maps. Deep-merged over the framework's built-in light/dark. */
|
||||
@@ -6458,6 +6500,7 @@ interface ResolvedTheme {
|
||||
declare const THEME_COOKIE = "wire-theme";
|
||||
declare const THEME_CSS_HREF = "/__wrnexus/theme.css";
|
||||
declare const THEME_JS_HREF = "/__wrnexus/theme.js";
|
||||
declare const THEME_PALETTES: Record<ThemePaletteName, CustomThemePalette>;
|
||||
/** Built-in themes so components have tokens out of the box. */
|
||||
declare const DEFAULT_THEMES: Record<string, ThemeTokens>;
|
||||
/** Merge the user's theme config over the built-in defaults. */
|
||||
@@ -6776,7 +6819,7 @@ declare function bundleCss(entryPath: string, mode: Mode): Promise<string>;
|
||||
*/
|
||||
declare function renderStyles(ctx: StyleProcessContext, styles?: StylesConfig): Promise<string>;
|
||||
|
||||
export { type AppConfig, DEFAULT_THEMES, type FontConfig, type FontDisplay, type GoogleFont, type LocalFontFace, type MobileConfig, type Mode, type PwaConfig, type ResolvedTheme, type StyleProcessContext, type StylesConfig, type Mode as StylesMode, THEME_COOKIE, THEME_CSS_HREF, THEME_JS_HREF, type ThemeConfig, type ThemeTokens, bundleCss, findStyleEntry, fontCspSources, headToString, loadAppConfig, loadEnv, loadRawConfig, renderFontHead, renderProductionFontHead, renderStyles, renderThemeCss, renderThemeRuntime, resolveProfile, resolveThemeConfig, resolveThemeName };
|
||||
export { type AppConfig, type CustomThemePalette, DEFAULT_THEMES, type FontConfig, type FontDisplay, type GoogleFont, type LocalFontFace, type MobileConfig, type Mode, type PwaConfig, type ResolvedTheme, type StyleProcessContext, type StylesConfig, type Mode as StylesMode, THEME_COOKIE, THEME_CSS_HREF, THEME_JS_HREF, THEME_PALETTES, THEME_PALETTE_NAMES, type ThemeConfig, type ThemePaletteName, type ThemeTokens, bundleCss, findStyleEntry, fontCspSources, headToString, loadAppConfig, loadEnv, loadRawConfig, renderFontHead, renderProductionFontHead, renderStyles, renderThemeCss, renderThemeRuntime, resolveProfile, resolveThemeConfig, resolveThemeName };
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
Reference in New Issue
Block a user