/**
* @fileoverview Theme-related types and constants consumed by SaasflareProvider,
* SaasflareShell, and CustomPaletteInjector.
* @module packages/ui/types/theme-props
* @package ui
*
* Palette colors live in `styles/palettes.css` (OKLCH) — the single source of
* truth. To render a swatch in a picker, wrap an element in `data-palette={id}`
* and paint it with `oklch(var(--primary-l) var(--primary-c) var(--primary-h))`.
* Do NOT add a hex `color` field here; it will drift from palettes.css.
*/
/** All available color palette ids and display names — one entry per `:root[data-palette]` preset in palettes.css. */
export declare const PALETTES: readonly [{
readonly id: "saasflare";
readonly name: "Saasflare";
}, {
readonly id: "ocean";
readonly name: "Ocean";
}, {
readonly id: "achromatic";
readonly name: "Achromatic";
}, {
readonly id: "black";
readonly name: "Black";
}, {
readonly id: "snow";
readonly name: "Snow";
}, {
readonly id: "ink";
readonly name: "Ink";
}, {
readonly id: "stone";
readonly name: "Stone";
}, {
readonly id: "aurora";
readonly name: "Aurora";
}, {
readonly id: "indigo";
readonly name: "Indigo";
}, {
readonly id: "emerald";
readonly name: "Emerald";
}, {
readonly id: "violet";
readonly name: "Violet";
}, {
readonly id: "coral";
readonly name: "Coral";
}, {
readonly id: "jade";
readonly name: "Jade";
}, {
readonly id: "cobalt";
readonly name: "Cobalt";
}, {
readonly id: "amber";
readonly name: "Amber";
}, {
readonly id: "fuchsia";
readonly name: "Fuchsia";
}, {
readonly id: "honey";
readonly name: "Honey";
}, {
readonly id: "teal";
readonly name: "Teal";
}, {
readonly id: "iris";
readonly name: "Iris";
}, {
readonly id: "ruby";
readonly name: "Ruby";
}, {
readonly id: "lavender";
readonly name: "Lavender";
}, {
readonly id: "mint";
readonly name: "Mint";
}, {
readonly id: "sage";
readonly name: "Sage";
}, {
readonly id: "sky";
readonly name: "Sky";
}, {
readonly id: "colorful";
readonly name: "Colorful";
}, {
readonly id: "craivo";
readonly name: "Craivo";
}];
/** Union of all preset color palette IDs. */
export type PaletteId = (typeof PALETTES)[number]["id"];
/**
* Visual surface style variant.
*
* The union uses `(string & {})` so app-level custom surfaces (e.g.
* "neumorphic") registered via a [data-style="…"] selector in the
* app's globals.css are accepted without a type patch, while preset
* ids keep their autocomplete.
*/
export type StyleVariant = "flat" | "glass" | "clay" | (string & {});
/** All available built-in surface style variants. */
export declare const STYLES: readonly [{
readonly id: "flat";
readonly name: "Flat";
}, {
readonly id: "glass";
readonly name: "Glass";
}, {
readonly id: "clay";
readonly name: "Clay";
}];
/**
* Radius preset — orthogonal to {@link Surface} (geometry vs. material).
*
* Maps to `[data-radius]` selectors in theme.css; each preset sets `--radius`
* (and at "pill" also overrides the entire `--radius-sm/md/lg/xl` scale so
* derived values don't drift to ~9995px).
*
* Per-component override: pass `radius` on any Saasflare component.
* Per-theme override: `CustomPalette.radius` wins via inline style.
*/
export type Radius = "sharp" | "soft" | "rounded" | "pill";
/** All available built-in radius presets. */
export declare const RADII: readonly [{
readonly id: "sharp";
readonly name: "Sharp";
}, {
readonly id: "soft";
readonly name: "Soft";
}, {
readonly id: "rounded";
readonly name: "Rounded";
}, {
readonly id: "pill";
readonly name: "Pill";
}];
/**
* Custom color theme — high-level, developer-friendly.
*
* Pass any CSS color as `primary` (hex, oklch, rgb, hsl, named color).
* Hex values are converted to OKLCH internally via {@link hexToOklch};
* other formats are passed through as the raw `--primary` value.
*
* @example
*
*
* @example Escape hatch for full control
*
*/
export interface CustomPalette {
/** Unique name — written to `data-palette` attribute. */
name: string;
/** Primary brand color in any CSS color format. Required. */
primary: string;
/**
* Optional neutral axis override — drives backgrounds, muted, borders,
* cards, popovers, sidebar (i.e. the entire grey foundation of the UI),
* not just one accent token. Accepts hex or an explicit hue angle (0-360).
* Default: tinted from `primary` with a tiny chroma for "brand warmth".
*/
neutral?: string;
/** Optional border radius override (any CSS length). */
radius?: string;
/** Escape hatch: raw CSS custom property overrides applied in light mode. */
light?: Record;
/** Escape hatch: raw CSS custom property overrides applied in dark mode. */
dark?: Record;
}
/**
* Accepted values for the `palette` prop (brand colors — distinct from `theme`,
* which controls light/dark mode and is delegated to next-themes).
*
* - omit (undefined) → defers to persisted user preference, then global.css baseline
* - PaletteId → preset palette via [data-palette] selector
* - arbitrary string → app-registered [data-palette="…"] in the app's globals.css
* - CustomPalette → runtime palette via inline CSS custom properties
*
* The `(string & {})` branch preserves autocomplete for the preset ids
* while still permitting arbitrary strings.
*/
export type Palette = PaletteId | (string & {}) | CustomPalette;
/**
* Accepted values for the `surface` prop.
*
* - omit (undefined) → defers to persisted user preference, then "flat" baseline
* - StyleVariant → "flat" | "glass" | "clay" | app-registered custom surface
*/
export type Surface = StyleVariant;
/**
* Accepted values for the `radius` prop on SaasflareProvider / Shell.
*
* - omit (undefined) → defers to persisted user preference, then "rounded" baseline
* - Radius → forces [data-radius] on
*/
export type RadiusProp = Radius;