/** @license MIT | @cube-dev/ui-kit v0.142.7 | Cube Dev Team */
import { glaze } from "@tenphi/glaze";

//#region src/tokens/palette.ts
/**
* Glaze-generated color palette for the Cube UI Kit.
*
* Produces light, dark, and high-contrast color variants from a single
* source of truth. Every color token is emitted as a tasty state map:
*
*   '#surface': { '': 'okhsl(...)', '@dark': 'okhsl(...)', '@hc': 'okhsl(...)' }
*
* The `@dark` and `@hc` state aliases are wired up globally in
* `src/components/Root.tsx` (see `setGlobalPredefinedStates`).
*/
const PURPLE_HUE = 280.3;
const SUCCESS_HUE = 156.9;
const DANGER_HUE = 23.1;
const WARNING_HUE = 84.3;
const NOTE_HUE = 302.3;
/** Seed saturation; per-color saturation factors below are 0–1 of this seed. */
const SEED_SATURATION = 80;
glaze.configure({
	states: {
		dark: "@dark",
		highContrast: "@hc"
	},
	modes: {
		dark: true,
		highContrast: true
	}
});
const defaultTheme = glaze(PURPLE_HUE, SEED_SATURATION);
defaultTheme.colors({
	surface: {
		lightness: 100,
		saturation: .11
	},
	"surface-2": {
		base: "surface",
		lightness: "-2",
		saturation: .15,
		inherit: false
	},
	"surface-3": {
		base: "surface",
		lightness: "-4",
		saturation: .19,
		inherit: false
	},
	"surface-4": {
		base: "surface",
		lightness: "-6",
		saturation: .2,
		inherit: false
	},
	"surface-text": {
		base: "surface",
		lightness: 2,
		saturation: .475
	},
	"surface-text-soft": {
		base: "surface",
		lightness: "-1",
		saturation: .375,
		contrast: [9, 11],
		inherit: false
	},
	"surface-text-soft-2": {
		base: "surface",
		lightness: "-1",
		saturation: .24,
		contrast: [4.5, 5.5],
		inherit: false
	},
	"surface-2-text": {
		base: "surface-2",
		lightness: 2,
		saturation: .475,
		inherit: false
	},
	"surface-2-text-soft": {
		base: "surface-2",
		lightness: "-1",
		saturation: .375,
		contrast: [9, 11],
		inherit: false
	},
	"surface-3-text": {
		base: "surface-3",
		lightness: 2,
		saturation: .475,
		inherit: false
	},
	"surface-3-text-soft": {
		base: "surface-3",
		lightness: "-1",
		saturation: .375,
		contrast: [9, 11],
		inherit: false
	},
	border: {
		base: "surface",
		lightness: ["-10", "-20"],
		saturation: .175
	},
	placeholder: {
		base: "surface",
		lightness: 67,
		saturation: .175,
		inherit: false
	},
	focus: {
		base: "surface",
		lightness: 71,
		saturation: .8625,
		inherit: false
	},
	disabled: {
		lightness: 80.8,
		saturation: .4,
		inherit: false
	},
	"disabled-surface": {
		base: "surface",
		lightness: "-1",
		saturation: .2,
		contrast: [1.1, 1.2],
		inherit: false
	},
	"disabled-surface-text": {
		base: "surface",
		lightness: "-1",
		saturation: .3,
		contrast: [2, 2.5],
		inherit: false
	},
	"surface-inverse": {
		lightness: 12,
		saturation: .475,
		mode: "fixed",
		inherit: false
	},
	"accent-surface-text": {
		lightness: 100,
		mode: "fixed"
	},
	"accent-surface": {
		base: "accent-surface-text",
		lightness: "-1",
		contrast: [4.5, 7],
		mode: "fixed"
	},
	"accent-surface-2": {
		base: "accent-surface-text",
		lightness: "-1",
		contrast: [5, 8],
		mode: "fixed"
	},
	"accent-surface-3": {
		base: "accent-surface-text",
		lightness: "-1",
		contrast: [5.5, 9],
		mode: "fixed"
	},
	"accent-surface-hover": {
		base: "accent-surface-text",
		lightness: "-1",
		contrast: [6, 10],
		mode: "fixed"
	},
	"accent-surface-border": {
		base: "accent-surface",
		lightness: "+1",
		contrast: [1.4, 1.8],
		mode: "fixed"
	},
	"accent-text": {
		base: "surface",
		lightness: "-1",
		saturation: 1,
		contrast: [6.4, 10]
	},
	"accent-text-soft": {
		base: "surface",
		lightness: "-1",
		saturation: 1,
		contrast: [4.5, 7]
	},
	"accent-icon": {
		base: "surface",
		lightness: "-1",
		saturation: .9375,
		contrast: [3.2, 5]
	},
	"accent-disabled-surface": {
		base: "surface",
		lightness: "-1",
		saturation: .5,
		contrast: [1.4, 1.5]
	},
	"accent-disabled-surface-text": {
		base: "accent-disabled-surface",
		lightness: "+1",
		saturation: .4,
		contrast: 1.51,
		mode: "fixed"
	},
	"code-comment": {
		base: "surface",
		hue: 280,
		saturation: .1,
		lightness: "-1",
		contrast: [4.5, 7],
		inherit: false
	},
	"code-punctuation": {
		base: "surface",
		hue: 348,
		saturation: .4,
		lightness: "-1",
		contrast: [4.5, 7],
		inherit: false
	},
	"code-keyword": {
		base: "surface",
		hue: 348,
		saturation: 1,
		lightness: "-1",
		contrast: [5, 7.5],
		inherit: false
	},
	"code-string": {
		base: "surface",
		hue: PURPLE_HUE,
		saturation: 1,
		lightness: "-1",
		contrast: [4.5, 7],
		inherit: false
	},
	"code-number": {
		base: "surface",
		hue: 156,
		saturation: .9,
		lightness: "-1",
		contrast: [4.5, 7],
		inherit: false
	},
	"code-function": {
		base: "surface",
		hue: 348,
		saturation: 1,
		lightness: "-1",
		contrast: [5, 7.5],
		inherit: false
	},
	"code-attribute": {
		base: "surface",
		hue: 200,
		saturation: 1,
		lightness: "-1",
		contrast: [4.5, 7],
		inherit: false
	},
	"loading-face-1": {
		base: "surface",
		lightness: 98,
		saturation: .3,
		contrast: [1.04, 1.5],
		inherit: false
	},
	"loading-face-2": {
		base: "surface",
		lightness: 91,
		saturation: .62,
		contrast: [1.24, 2.5],
		inherit: false
	},
	"loading-face-3": {
		base: "surface",
		lightness: 79,
		saturation: .66,
		contrast: [1.75, 4],
		inherit: false
	},
	"shadow-sm": {
		type: "shadow",
		bg: "surface",
		fg: "surface-text",
		intensity: 5,
		inherit: false
	},
	"shadow-md": {
		type: "shadow",
		bg: "surface",
		fg: "surface-text",
		intensity: 10,
		inherit: false
	},
	"shadow-lg": {
		type: "shadow",
		bg: "surface",
		fg: "surface-text",
		intensity: 15,
		inherit: false
	},
	overlay: {
		lightness: 10,
		opacity: .5,
		inherit: false
	}
});
/**
* Per-colored-theme overrides on top of `defaultTheme`:
*   - `surface` — bumped saturation so the banner bg is visibly tinted.
*   - `border`  — bumped saturation so OUTLINE-variant borders pick up the
*     theme hue (used by `#<theme>-border` in `item-themes.ts`). Mirrors the
*     default-theme `border` shape (`base: 'surface'`, lightness window) but
*     with higher saturation. Glaze's `extend({ colors })` redefines each
*     listed color from scratch, so we restate the full definition here.
*/
const TINTED_SURFACE_OVERRIDE = {
	surface: {
		lightness: 96,
		saturation: .8
	},
	border: {
		base: "surface",
		lightness: ["-10", "-20"],
		saturation: .5
	}
};
const primaryTheme = defaultTheme.extend({ colors: TINTED_SURFACE_OVERRIDE });
const successTheme = defaultTheme.extend({
	hue: SUCCESS_HUE,
	colors: TINTED_SURFACE_OVERRIDE
});
const dangerTheme = defaultTheme.extend({
	hue: DANGER_HUE,
	colors: TINTED_SURFACE_OVERRIDE
});
const warningTheme = defaultTheme.extend({
	hue: WARNING_HUE,
	colors: TINTED_SURFACE_OVERRIDE
});
const noteTheme = defaultTheme.extend({
	hue: NOTE_HUE,
	colors: TINTED_SURFACE_OVERRIDE
});
/**
* Standalone theme for `special`-variant components (hero CTAs, banners, etc.)
* that intentionally sit on a dark surface regardless of the active scheme.
*
* Every token here is `mode: 'fixed'` so the resolved value is identical in
* light, dark, and high-contrast. The shape is purpose-built (not a full
* mirror of `defaultTheme`) — only what `SPECIAL_*_STYLES` in
* `src/data/item-themes.ts` consumes is emitted.
*
* Token rundown:
*   - `surface` — dark L≈12 backdrop (same value as `#surface-inverse`).
*   - `accent-surface` / `accent-surface-2` / `accent-surface-3` —
*     brand-purple PRIMARY fill ramp (default → hover → pressed). Mirrors
*     the `#primary-accent-surface` / `-2` / `-3` ramp on the colored
*     themes so `SPECIAL_PRIMARY_STYLES.fill` can use the same shape.
*   - `accent-surface-hover` — legacy alias kept around for the
*     `#special-hover` color shortcut in `src/tokens/colors.ts`. Item
*     themes themselves no longer reference it.
*   - `accent-surface-text` — fixed white (= built-in `#white`), exposed
*     for explicit references.
*   - `accent-text` — dark-purple foreground readable on white. Used as
*     CLEAR-variant text on the always-white pill, and as the
*     pressed/focused border on the brand-purple primary fill. Matches the
*     legacy `#fixed-primary-text` alias (= `#primary-accent-surface-hover`).
*   - `accent-disabled-surface` / `accent-disabled-surface-text` —
*     brand-tinted disabled chip + label, contrast-driven against the fixed
*     dark `surface` so the disabled state is scheme-symmetric.
*/
const specialTheme = glaze(PURPLE_HUE, SEED_SATURATION);
specialTheme.colors({
	surface: {
		lightness: 12,
		saturation: .475,
		mode: "fixed"
	},
	"accent-surface-text": {
		lightness: 100,
		mode: "fixed"
	},
	"accent-surface": {
		base: "accent-surface-text",
		lightness: "-1",
		contrast: [4.5, 7],
		mode: "fixed"
	},
	"accent-surface-2": {
		base: "accent-surface-text",
		lightness: "-1",
		contrast: [5, 8],
		mode: "fixed"
	},
	"accent-surface-3": {
		base: "accent-surface-text",
		lightness: "-1",
		contrast: [5.5, 9],
		mode: "fixed"
	},
	"accent-surface-border": {
		base: "accent-surface",
		lightness: "+1",
		contrast: [1.4, 1.8],
		mode: "fixed"
	},
	"accent-surface-hover": {
		base: "accent-surface-text",
		lightness: "-1",
		contrast: [6, 8.5],
		mode: "fixed"
	},
	"accent-text": {
		base: "accent-surface-text",
		lightness: "-1",
		contrast: [6, 8.5],
		mode: "fixed"
	},
	"accent-disabled-surface": {
		base: "surface",
		lightness: "+1",
		saturation: .5,
		contrast: [1.4, 1.5],
		mode: "fixed"
	},
	"accent-disabled-surface-text": {
		base: "accent-disabled-surface",
		lightness: "+1",
		saturation: .4,
		contrast: 1.51,
		mode: "fixed"
	}
});
/**
* Theme map for the palette.
*
* `purple` is the legacy alias for `primary` and resolves to identical tokens
* (same theme instance, different prefix → no token-value collision).
*
* `default` is emitted with an empty prefix (custom map below), so its tokens
* appear unprefixed (`#surface`, `#border`, …). All other themes are prefixed
* with `<themeName>-`.
*/
const palette = glaze.palette({
	default: defaultTheme,
	primary: primaryTheme,
	purple: primaryTheme,
	success: successTheme,
	danger: dangerTheme,
	warning: warningTheme,
	note: noteTheme,
	special: specialTheme
});
/**
* All Glaze-generated color tokens as a tasty `Styles` map.
*
* Keys use `#name` syntax; values are state maps:
*   '#surface': { '': 'okhsl(...)', '@dark': 'okhsl(...)', '@hc': 'okhsl(...)' }
*
* Spread into `useGlobalStyles('body', tokens)` (already wired through
* `src/components/GlobalStyles.tsx`).
*/
const PALETTE_TOKENS = palette.tasty({ prefix: {
	default: "",
	primary: "primary-",
	purple: "purple-",
	success: "success-",
	danger: "danger-",
	warning: "warning-",
	note: "note-",
	special: "special-"
} });

//#endregion
export { PALETTE_TOKENS };
//# sourceMappingURL=palette.js.map