Skip to content

An open source design system that's fully customizable and agent ready

TypeScript

feat(theme): add surface-specific status color roles (#7657)

rubyycheungb298b37d13cd
diff --git a/.changeset/status-color-roles.md b/.changeset/status-color-roles.md
new file mode 100644
index 0000000000..bfcc260571
--- /dev/null
+++ b/.changeset/status-color-roles.md
@@ -0,0 +1,31 @@
+---
+'@astryxdesign/core': patch
+'@astryxdesign/cli': patch
+'@astryxdesign/richtext': patch
+'@astryxdesign/theme-neutral': patch
+'@astryxdesign/theme-butter': patch
+'@astryxdesign/theme-chocolate': patch
+'@astryxdesign/theme-gothic': patch
+'@astryxdesign/theme-matcha': patch
+'@astryxdesign/theme-stone': patch
+'@astryxdesign/theme-y2k': patch
+---
+
+[feat] Status colours now have a role for each surface, and Info is a new status. For each of info, success, warning, and error: `--color-<status>` is the strong fill and `--color-on-<status>` is content on it, at 4.5:1 or more; `--color-<status>-muted` is the pale fill, with `--color-on-<status>-muted` content; and `--color-text-<status>` is readable status text on the page and cards, with `--color-icon-<status>` and `--color-border-<status>` (status icons and borders) defaulting to it. `--color-info`, `--color-on-info`, `--color-info-muted`, and the other Info roles are new and independent of the accent. Tailwind gains `bg-info`, `bg-info-muted`, `text-on-<status>`, `text-on-<status>-muted`, and `text-status-<status>` (the status text role).
+
+`--color-success`, `--color-warning`, and `--color-error` and `bg-<status>` keep their meaning as the strong fills. Tailwind now projects each status by paint property: `text-`, `decoration-`, `placeholder-`, and `caret-<status>` read the status text role, and `border-`, `divide-`, `outline-`, and `ring-<status>` read the status border role, so status text and lines are readable on the page; `bg-`, `accent-`, `fill-`, `stroke-<status>`, shadow colours, and gradients keep the strong fill. for example, Core's light `text-warning` is now `#753F07` instead of `#E9AF08`, and `text-success` is `#09441F` instead of `#0D8626`. To keep the fill colour on text, use `text-[var(--color-warning)]`.
+
+What changes on screen:
+- Core's dark Error content (`--color-on-error`) is now `#0A1317` instead of white, so text on dark-mode error fills reaches 4.5:1. Core's Info Badge uses `--color-info` (`#0064E0`) instead of the accent; in dark mode the accent was `#2694FE`.
+- Icon `color="info|success|warning|error"`, Stepper status glyphs, and Chat tool-call status icons use the icon roles, which are the readable text colours. For example, Core's success icon is now `#09441F` (light) instead of `#0D8626`.
+- Input and FileInput status borders use the border roles. Core's light warning border is now `#753F07` instead of `#E9AF08`. Butter's light success and warning input rims are now mid-ramp stops that reach 3:1.
+- Banner paints its built-in title, description, icon, and controls with the on-muted roles, and fills Info with `--color-info-muted`.
+- Status fills keep a visible boundary in forced-colors mode.
+- Chocolate and Matcha's `--color-on-success` and `--color-on-error` are now a dark ink instead of white, and Stone's `--color-on-success`, `--color-on-warning` and `--color-on-error` are white in light mode and near-black in dark mode instead of the status hue, so content on those fills reaches 4.5:1.
+- Neutral's `--color-success`, `--color-warning`, and `--color-error` are now its status fills, the colours its Badges already showed: success `#00490B` to `#198100` (dark `#A4D6A3` to `#64AF4C`), warning `#4B3900` to `#FFCE2F` (dark `#F8D36A` to `#FFCE2F`), and error `#76000C` to `#C9303A` (dark `#FFC4BE` to `#FF705D`); `--color-info` is `#0074E2` (dark `#6D9CFE`). Its Badges, StatusDots, progress fills, and Stepper badges look the same, and its `text-<status>` utilities read its status text roles.
+- Neutral drops its own status overrides and uses the standard roles: the accent variants of ProgressBar, StatusDot, and Stepper now paint Neutral's accent instead of blue, and Banner and the pale destructive Button use the standard overlays. Neutral no longer defines its proposed and undocumented local tokens; use the standard roles instead: `--astryx-theme-neutral-color-status-fill-success`, `-status-fill-warning`, and `-status-fill-error` → `--color-success`, `--color-warning`, `--color-error`; `-status-muted-accent` → `--color-info-muted`; `-on-tint-neutral` → `--color-neutral`; `-on-tint-overlay-hover`, `-on-tint-overlay-pressed`, `-destructive-overlay-hover`, and `-destructive-overlay-pressed` → `--color-overlay-hover` and `--color-overlay-pressed`. `--astryx-theme-neutral-color-status-fill-accent` keeps its value for Neutral extensions but is deprecated and no longer used by Neutral.
+- Every first-party theme sets a blue `--color-info`; Chocolate and Matcha Info Badges move from the accent to that blue (Butter keeps its own Info Badge colours).
+
+Custom themes get the content and text roles they don't set: theme generation derives `--color-on-<status>` (light or dark content, whichever contrasts more), readable status text, and on-muted content from the theme's status fills. To keep a component's previous colour, set the matching role in your theme; for example, set `--color-icon-success` to your old `--color-success` value.
+
+@rubyycheung
diff --git a/apps/example-nextjs-tailwind/src/app/page.tsx b/apps/example-nextjs-tailwind/src/app/page.tsx
index fef31305eb..05341caf32 100644
--- a/apps/example-nextjs-tailwind/src/app/page.tsx
+++ b/apps/example-nextjs-tailwind/src/app/page.tsx
@@ -139,19 +139,21 @@ export default function Home() {
{/* Status colors */}
<Text type="label">Status colors</Text>
<div className="flex gap-3">
- <div className="flex items-center gap-2 rounded-md bg-success/10 px-3 py-2">
+ <div className="flex items-center gap-2 rounded-md bg-success-muted px-3 py-2">
<div className="h-2 w-2 rounded-full bg-success" />
- <span className="text-sm font-medium text-success">
+ <span className="text-sm font-medium text-on-success-muted">
Success
</span>
</div>
- <div className="flex items-center gap-2 rounded-md bg-error/10 px-3 py-2">
+ <div className="flex items-center gap-2 rounded-md bg-error-muted px-3 py-2">
<div className="h-2 w-2 rounded-full bg-error" />
- <span className="text-sm font-medium text-error">Error</span>
+ <span className="text-sm font-medium text-on-error-muted">
+ Error
+ </span>
</div>
- <div className="flex items-center gap-2 rounded-md bg-warning/10 px-3 py-2">
+ <div className="flex items-center gap-2 rounded-md bg-warning-muted px-3 py-2">
<div className="h-2 w-2 rounded-full bg-warning" />
- <span className="text-sm font-medium text-warning">
+ <span className="text-sm font-medium text-on-warning-muted">
Warning
</span>
</div>
diff --git a/apps/sandbox/src/app/(raw)/pages/mobile-prototypes/primitives.tsx b/apps/sandbox/src/app/(raw)/pages/mobile-prototypes/primitives.tsx
index 74f60cc070..973828be3e 100644
--- a/apps/sandbox/src/app/(raw)/pages/mobile-prototypes/primitives.tsx
+++ b/apps/sandbox/src/app/(raw)/pages/mobile-prototypes/primitives.tsx
@@ -764,7 +764,7 @@ export function BottomSheetMenu({
a.variant === 'destructive' && a.icon != null ? (
<span
style={{
- color: 'var(--color-error)',
+ color: 'var(--color-text-error)',
display: 'inline-flex',
}}>
{a.icon}
@@ -779,7 +779,9 @@ export function BottomSheetMenu({
}}
label={
a.variant === 'destructive' ? (
- <span style={{color: 'var(--color-error)'}}>{a.label}</span>
+ <span style={{color: 'var(--color-text-error)'}}>
+ {a.label}
+ </span>
) : (
a.label
)
diff --git a/apps/sandbox/src/app/(sandbox)/pages/palette-generator/page.tsx b/apps/sandbox/src/app/(sandbox)/pages/palette-generator/page.tsx
index 7c198a1a1e..bf9a08c432 100644
--- a/apps/sandbox/src/app/(sandbox)/pages/palette-generator/page.tsx
+++ b/apps/sandbox/src/app/(sandbox)/pages/palette-generator/page.tsx
@@ -509,7 +509,7 @@ function CompareResultView({
style={{
padding: 10,
borderRadius: 8,
- color: 'var(--color-error)',
+ color: 'var(--color-on-error-muted)',
backgroundColor: 'var(--color-error-muted)',
}}>
<strong>{error.familyId}:</strong> {error.message}
@@ -781,7 +781,7 @@ function ResultView({result}: {result: PaletteGenerationResult}) {
style={{
padding: 10,
borderRadius: 8,
- color: 'var(--color-error)',
+ color: 'var(--color-on-error-muted)',
backgroundColor: 'var(--color-error-muted)',
}}>
<strong>{error.familyId}:</strong> {error.message}
diff --git a/apps/sandbox/src/app/(sandbox)/pages/textarea-counter/page.tsx b/apps/sandbox/src/app/(sandbox)/pages/textarea-counter/page.tsx
index 41b4bae154..1b20461099 100644
--- a/apps/sandbox/src/app/(sandbox)/pages/textarea-counter/page.tsx
+++ b/apps/sandbox/src/app/(sandbox)/pages/textarea-counter/page.tsx
@@ -40,7 +40,7 @@ const styles = stylex.create({
whiteSpace: 'nowrap',
},
counterError: {
- color: colorVars['--color-error'],
+ color: colorVars['--color-text-error'],
},
counterPinned: {
flexShrink: 0,
diff --git a/apps/storybook/stories/Icon.stories.tsx b/apps/storybook/stories/Icon.stories.tsx
index 8e8ff83c86..33f10b824e 100644
--- a/apps/storybook/stories/Icon.stories.tsx
+++ b/apps/storybook/stories/Icon.stories.tsx
@@ -273,7 +273,7 @@ export const InheritColor: Story = {
</span>
<span
style={{
- color: 'red',
+ color: 'var(--color-text-error)',
display: 'flex',
alignItems: 'center',
gap: '4px',
diff --git a/apps/storybook/stories/Stepper.stories.tsx b/apps/storybook/stories/Stepper.stories.tsx
index 0c2829e8b2..6c3660645c 100644
--- a/apps/storybook/stories/Stepper.stories.tsx
+++ b/apps/storybook/stories/Stepper.stories.tsx
@@ -239,19 +239,19 @@ export const StatusAllStates: Story = {
<Step
step={1}
label="Success"
- description="--color-success"
+ description="--color-icon-success"
status="success"
/>
<Step
step={2}
label="Warning"
- description="--color-warning"
+ description="--color-icon-warning"
status="warning"
/>
<Step
step={3}
label="Error"
- description="--color-error"
+ description="--color-icon-error"
status="error"
/>
<Step
diff --git a/docs/architecture/theme-compilation.md b/docs/architecture/theme-compilation.md
index 88798ebf18..51a793adc3 100644
--- a/docs/architecture/theme-compilation.md
+++ b/docs/architecture/theme-compilation.md
@@ -192,57 +192,47 @@ Platform-specific details stay inside that compiler.
- **INV16 — Generated compatibility roles preserve declaration locality and the
CSS cascade.** When the web compiler derives a status role from another public
token, the alias is emitted inside the theme scope where its semantic source is
- effective, including reachable adaptation and media combinations. A media
- surface's unpaired `--color-accent` collapse is presentation context, not an
- authored Info pair, so it does not rebind `--color-info-emphasized`; authoring both
- `--color-accent` and `--color-on-accent` makes that media pair eligible. A nested
+ effective, including reachable adaptation and media combinations. A nested
theme derives from its nearest provider rather than retaining its parent's alias.
Authored destination roles, source order, `!important`, `inherit`, concrete
values, and cycles retain their normal CSS meaning. Runtime and static output
use the same derivation.
- **INV17 — Theme generation establishes every status role.** For each
- `architecture:theme-tokens` INV11 status role a theme does not set, the web
- compiler derives one in the theme's generated CSS, at runtime and in the
- theme build, so a theme that sets only its base status colours still
- compiles to a complete status set. The normalized `DefinedTheme` keeps only
- the tokens the theme sets; non-CSS resolution (`architecture:theme-tokens`
- INV6) applies the same derivation. A role the theme inherits through
- `extends` counts as set; a role its parent only derived is derived again from
- the child's own sources:
+ `architecture:theme-tokens` INV11 content or text role a theme does not set,
+ the web compiler derives one in the theme's generated CSS, at runtime and in
+ the theme build, so a theme that sets only its status fills still compiles to
+ a complete status set. The normalized `DefinedTheme` keeps only the tokens
+ the theme sets; non-CSS resolution (`architecture:theme-tokens` INV6) applies
+ the same derivation. A role the theme inherits through `extends` counts as
+ set; a role its parent only derived is derived again from the child's own
+ colours:
+ - `--color-on-<status>` is the theme's light or dark content colour
+ (`--color-on-dark` or `--color-on-light`), whichever contrasts more with
+ the theme's `--color-<status>`; when neither reaches 4.5:1 on it, it is
+ pure white or black, whichever contrasts more.
+ - `--color-text-<status>` is the fill's hue at the lightness that reaches
+ 4.5:1 against the theme's default page and card surfaces in each colour
+ mode.
- `--color-icon-<status>` and `--color-border-<status>` alias
`--color-text-<status>`, so a theme's text value, set or derived, reaches
them unless the theme sets them too.
- - `--color-text-<status>` is the status hue at the lightness that reaches
- 4.5:1 against the theme's default page and card surfaces in each colour
- mode.
- - `--color-on-info` takes the theme's `--color-on-accent`. The released
- `--color-on-success`, `--color-on-warning`, and `--color-on-error` keep
- their values and are never derived.
- - `--color-<status>-emphasized` is the status hue, adjusted only as far as
- needed for the theme's `--color-on-<status>` to reach 4.5:1 on it.
- - `--color-info-muted` is the Info hue at Core's pale-fill strength, 20%
- opacity in light mode and 25% in dark mode. The released
- `--color-success-muted`, `--color-warning-muted`, and `--color-error-muted`
- keep their values and are never derived.
- - `--color-on-<status>-muted` is the status hue at the lightness that reaches
+ - `--color-on-<status>-muted` is the fill's hue at the lightness that reaches
4.5:1 on the theme's pale status fill over the default surface.
- The status hue is the theme's base status colour for success, warning, and
- error. For Info it is the theme's accent when the accent is chromatic, and the
- theme's blue hue (`--color-icon-blue`) otherwise. When that source is not
- chromatic, the status hue is Core's own hue for that status, so every derived
- fill and text colour is chromatic. When a colour these computations measure
- (the status source, the default page or card surface, the pale fill, or
- `--color-on-<status>`) is not a concrete colour, such as an unresolved
- reference, it cannot be measured, so for that status each role aliases its
- INV16 source instead: the strong fill aliases the base
- status colour (the accent for Info), `--color-info-muted` aliases
- `--color-accent-muted`, and the text and pale-fill content roles alias the
- theme's matching hue text token (`--color-text-blue`, `-green`, `-yellow`,
- or `-red`). Those aliases carry the theme's own values: they are not derived
+ Fills are never derived: a `--color-<status>` or `--color-<status>-muted` the
+ theme does not set is Core's. A role is derived again when the theme sets a
+ colour it is measured against: the fill, the pale fill, the default page or
+ card surface, or the light and dark content colours. When the fill is not
+ chromatic, the text and pale-fill content take Core's own hue for that
+ status, so derived text stays chromatic. When a colour these computations
+ measure is not a concrete colour, such as an unresolved reference, it cannot
+ be measured, so for that status the text and pale-fill content roles alias
+ the theme's matching hue text token (`--color-text-blue`, `-green`,
+ `-yellow`, or `-red`) and `--color-on-<status>` keeps the theme's or Core's
+ value. Those aliases carry the theme's own values: they are not derived
values, so INV11's floors bind them only in Core and first-party themes,
- which use concrete sources. A value the theme sets always wins over a derived
- one. A derived value is emitted in the scope where its status hue is set
+ which use concrete colours. A value the theme sets always wins over a derived
+ one. A derived value is emitted in the scope where its source is set
(INV16), and runtime and static output derive the same values.
This record does not own:
@@ -344,27 +334,30 @@ tiers.
## Verification
-| Invariant | Evidence | Failure signal |
-| ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
-| INV1, INV2, INV3 | Compiler imports and runtime/build comparison fixtures | Runtime and build use different theme-to-CSS logic or produce different web rules |
-| INV4 | `generateThemeRules.test.ts` and source/distribution cascade tests | Scope or layer order differs by output path |
-| INV5 | Existing per-property fixtures (partial; gap below) | A guaranteed property compiles but does not produce its promised observable effect |
-| INV6, INV7 | Existing registry and CLI public-variable tests (partial) | Private variables become authorable, or a reviewed public semantic variable fails build/runtime |
-| INV8 | Component target metadata and compatibility review | Successful generic emission is treated as a guaranteed public behavior |
-| INV9, INV10 | Platform compiler tests when another compiler ships | CSS details enter shared authoring, or shared theme intent silently disappears |
-| INV11 | `defineTheme.test.ts` and `build.test.mjs` local-token fixtures | Runtime/static output rewrites a local name, disagrees, or leaves partial output after failure |
-| INV12 | `themeAdaptations.test.ts` and CLI adaptation build fixtures | Rule blocks merge/reorder/drop, surfaces lose precedence, or runtime/static CSS diverges |
-| INV13, INV14 | Declaration scanner, generator, Theme mounting, CLI receipt tests, and the existing theme-family Chromium guard | One unsafe declaration corrupts neighbors, valid CSS changes, legacy token generation crashes, or reporting changes CSS |
-| Built themes | Theme and CLI build tests | Runtime recompiles a built theme, or built output omits canonical rules |
-| INV15 | CLI build fixtures with function entries, slot functions, a variant list, and an inherited entry under a replaced list, compared with runtime resolution | Built and runtime icons differ, a function is dropped silently, or tooling enumerates a variant an entry cannot receive |
-| INV16 | Root, adaptation, media, nested-theme, and CLI-built status-alias fixtures | A generated role escapes its source scope, overrides an authored role, changes cascade meaning, treats an unpaired media accent collapse as Info, cycles, or differs by output path |
-| INV17 | A minimal custom theme that sets only `--color-success`, `--color-warning`, `--color-error`, and an accent, compiled at runtime and through the CLI build, plus one theme that overrides `--color-text-<status>`, one with a grey accent, one with a grey base status colour, one whose base status colour is an unresolved reference, one whose card surface is an unresolved reference, and one that `extends` a theme setting a status role, each also read through non-CSS resolution | A status role is missing, misses an INV11 floor in light or dark mode, is grey, ignores a value the theme set, or differs between runtime, build, and non-CSS resolution; or an overridden text colour does not reach an unset icon or border role, an inherited role is derived again, or a non-concrete measured colour yields a computed value instead of the aliases |
+| Invariant | Evidence | Failure signal |
+| ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| INV1, INV2, INV3 | Compiler imports and runtime/build comparison fixtures | Runtime and build use different theme-to-CSS logic or produce different web rules |
+| INV4 | `generateThemeRules.test.ts` and source/distribution cascade tests | Scope or layer order differs by output path |
+| INV5 | Existing per-property fixtures (partial; gap below) | A guaranteed property compiles but does not produce its promised observable effect |
+| INV6, INV7 | Existing registry and CLI public-variable tests (partial) | Private variables become authorable, or a reviewed public semantic variable fails build/runtime |
+| INV8 | Component target metadata and compatibility review | Successful generic emission is treated as a guaranteed public behavior |
+| INV9, INV10 | Platform compiler tests when another compiler ships | CSS details enter shared authoring, or shared theme intent silently disappears |
+| INV11 | `defineTheme.test.ts` and `build.test.mjs` local-token fixtures | Runtime/static output rewrites a local name, disagrees, or leaves partial output after failure |
+| INV12 | `themeAdaptations.test.ts` and CLI adaptation build fixtures | Rule blocks merge/reorder/drop, surfaces lose precedence, or runtime/static CSS diverges |
+| INV13, INV14 | Declaration scanner, generator, Theme mounting, CLI receipt tests, and the existing theme-family Chromium guard | One unsafe declaration corrupts neighbors, valid CSS changes, legacy token generation crashes, or reporting changes CSS |
+| Built themes | Theme and CLI build tests | Runtime recompiles a built theme, or built output omits canonical rules |
+| INV15 | CLI build fixtures with function entries, slot functions, a variant list, and an inherited entry under a replaced list, compared with runtime resolution | Built and runtime icons differ, a function is dropped silently, or tooling enumerates a variant an entry cannot receive |
+| INV16 | Root, adaptation, media, nested-theme, and CLI-built status-alias fixtures | A generated role escapes its source scope, overrides an authored role, changes cascade meaning, cycles, or differs by output path |
+| INV17 | A minimal custom theme that sets only its four status fills, compiled at runtime and through the CLI build, plus themes that set a light fill, a grey fill, an unresolved fill, an unresolved card surface, only a surface, only a hue text token, a fill only inside an adaptation rule, and one that `extends` a theme setting a status role, each also read through non-CSS resolution | A content or text role is missing, misses an INV11 floor in light or dark mode, is grey, ignores a value the theme set, or differs between runtime, build, and non-CSS resolution; an icon or border role does not follow the text role; a fill is derived; or an inherited role is derived again |
## Known conformance and verification gaps
-Generated status roles (INV16) and derived status defaults (INV17) are
-accepted but not yet shipped. Their verification rows describe implementation
-acceptance, not existing enforcement.
+Inside an `onDark`/`onLight` media surface, which sits on content the compiler
+cannot measure, a status fill the theme sets there gets its derived content, but
+its text and pale-fill content reach their roles as INV16 aliases rather than
+derived values. Inside adaptation rules, each rule's derived
+values combine the root with that rule alone, so rules that match together and
+each set a measured colour do not yet derive from their combination.
Declaration-boundary enforcement and the warnings-array collector in INV13–INV14
are accepted but not yet shipped. Their verification obligations above describe
diff --git a/docs/architecture/theme-tokens.md b/docs/architecture/theme-tokens.md
index 71f61425e2..0bbb5cb740 100644
--- a/docs/architecture/theme-tokens.md
+++ b/docs/architecture/theme-tokens.md
@@ -133,8 +133,8 @@ then have contradictory winners.
interaction state), or `-inverted` (for an inverted surface).
4. `--color-on-<fill>`: content placed on a fill, where `<fill>` is a shape-2
or shape-3 intent name, `dark`, or `light`. `--color-on-<intent>` is
- content on the intent's strong fills, its bare and `-emphasized` forms; a
- `-muted` fill pairs with its own `--color-on-<intent>-muted`.
+ content on the intent's own colour; a `-muted` fill pairs with its own
+ `--color-on-<intent>-muted`.
5. `--color-<domain>-…` for a domain layer under INV5: `--color-data-*` and
`--color-syntax-*`.
@@ -143,35 +143,42 @@ then have contradictory winners.
`--color-track`, and `--color-tint-hover` keep their names. A new name adds
no group segment (such as `status`), no other property word (such as
`foreground`), and no property suffix (such as `-text`). Tailwind keys are a
- projection: a key may alias a token under a shorter name, and it never adds a
- CSS variable.
+ projection outside this grammar: a key may alias a token under a shorter or
+ utility-specific name, such as `text-status-<status>` for
+ `--color-text-<status>`, and it never adds a CSS variable.
- **INV11 — Semantic status roles are surface-specific.** Each status (`info`,
`success`, `warning`, `error`) has these roles on three surfaces, named under INV10:
+ - `--color-<status>` is the strong status fill. Content on it uses
+ `--color-on-<status>`, at 4.5:1 or more; that content may be light or dark.
+ - `--color-<status>-muted` is the pale status fill. Content on it uses
+ `--color-on-<status>-muted`, at 4.5:1 or more where the fill sits on the
+ default surface.
- `--color-text-<status>` is status text on the default page and card
surfaces, at 4.5:1 or more against them. `--color-icon-<status>` and
`--color-border-<status>` are status icons and status borders on those
surfaces. Each defaults to `--color-text-<status>`; an Astryx theme that
- sets its own keeps it at 3:1 or more against the same surfaces.
- - `--color-<status>-emphasized` is the strong status fill. Content on it uses
- `--color-on-<status>`, at 4.5:1 or more.
- - `--color-<status>-muted` is the pale status fill. Content on it uses
- `--color-on-<status>-muted`, at 4.5:1 or more where the fill sits on the
- default surface.
+ sets its own keeps it at 3:1 or more against the same surfaces. A strong
+ fill is not status text: on the page, components use the text role.
+
+ Info is a status like the others and is independent of the accent: no Info
+ role defaults to an accent token. `--color-info`, `--color-info-muted`, and
+ their content roles are new names; the v0.0.8 upgrade transform still
+ rewrites pre-v0.0.8 uses of `--color-info` and `--color-info-muted` to the
+ purple hue tokens that replaced them, which affects only projects upgrading
+ from before v0.0.8.
Every status fill and status text colour is chromatic: no Core default,
first-party theme, or value derived under `architecture:theme-compilation`
INV17 paints one in a neutral grey, near-black, or near-white. The contrast
floors and the chromatic rule bind Core's defaults, Astryx's first-party
themes, and derived values in light and dark mode; a value a third-party
- theme sets is that theme's own. Core's dark strong Info and Error fills are
- therefore deeper than its accent and base error colours, which fall below
- 4.5:1 under white content. Components select the role from the surface
- instead of using one colour for every job. When a theme does not set a role,
- theme generation derives it (`architecture:theme-compilation` INV17). The
- generated token
- documentation describes each status role in one line: the surface it serves
- and the token it pairs with.
+ theme sets is that theme's own. Components select the role from the surface
+ instead of using one colour for every job. When a theme does not set a
+ content or text role, theme generation derives it
+ (`architecture:theme-compilation` INV17). The generated token documentation
+ describes each status role in one line: the surface it serves and the token
+ it pairs with.
In forced-colors mode the browser's system colours replace every status role:
status text, icons, and content on a fill render in `CanvasText`, and fills
@@ -179,10 +186,15 @@ then have contradictory winners.
status keeps its non-colour cue (a label, an icon, or text), and a strong or
pale status fill keeps a visible `CanvasText` border so its shape survives.
- The released `--color-success`, `--color-warning`, and `--color-error` keep
- their values and meaning in every theme, and so do the Tailwind utilities
- that resolve to them (`bg-success`, `text-success`, `border-success`, and the
- warning and error forms); Astryx components use the surface roles instead.
+ Tailwind projects each status by paint property: text-like utilities
+ (`text-`, `decoration-`, `placeholder-`, `caret-<status>`) read the status text
+ role, line-like utilities (`border-`, `divide-`, `outline-`, `ring-<status>`)
+ read the status border role, and fill-like utilities (`bg-`, `accent-`,
+ `fill-`, `stroke-<status>`, shadow colours, and gradients) are the strong
+ fill. Tailwind also projects `bg-<status>-muted`, `text-on-<status>`,
+ `text-on-<status>-muted`, and `text-status-<status>`, kept as an alias of the
+ status text role; like every Tailwind key, these alias the tokens and add no
+ CSS variable.
This record does not own:
@@ -275,30 +287,16 @@ Rejected: keeping spacing in `px` while type is `rem` (text grows into fixed
boxes); converting author-written `px` in custom themes (a theme's own
decision).
-### DEC-2 — Info status roles reuse retired names
-
-**Decider:** `cixzhang`, `2026-10-24`
-
-The Info roles of INV11 use the grammar's names, including
-`--color-info-muted`, which shipped with a purple meaning until v0.0.8. The
-v0.0.8 upgrade transform still rewrites that name to `--color-background-purple`.
-It runs only when a project upgrades from a version before v0.0.8, whose code
-used the retired meaning, so the reuse does not change a released contract for
-any supported project. Bare `--color-info` stays unused.
-
-Rejected: an off-grammar name such as `--color-information-muted`, which INV10
-cannot name.
-
## Verification
-| Invariant | Evidence | Failure signal |
-| ---------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| INV1, INV2, INV7 | `scripts/check-theme-template.test.mjs` and token-doc generation check | A token family exists without a matching author-facing inventory or generated documentation |
-| INV5 | Domain-token exports and theme-generation tests | Domain names disappear from validation or require importing unused domain implementation |
-| INV6 | `packages/core/src/theme/tokens.test.ts` | JavaScript resolution disagrees with defaults, mode selection, references, or supported color expressions |
-| INV8 | `defineTheme.test.ts`, template checks, and token-doc generation | A local name enters portable helpers/docs or can conflict with a portable declaration |
-| INV9 | `tokens.test.ts` (core defaults), `SpacingRootFontSize.a11y.chromium.spec.ts` (real-Chromium root font size), each overriding theme's `*Theme.spacing.test.ts`, `check-cli-theme-bundle.test.mjs` (bundled copies byte-equal to the packages), `theme-concentricity.test.ts` (playground ramp read in rem) | A spacing step in `px` that no theme documents as its exception: a core default, a theme override, a bundled copy, or a generated ramp step |
-| INV10 | `tokens.test.ts` name check over Astryx's own `colorDefaults` and `domainTokenDefaults` only | A colour token Astryx defines fits none of the five shapes |
-| INV11 | Implementation acceptance, not yet shipped: `scripts/check-muted-status-contrast.test.mjs` (resolves global and Banner pale-surface role pairs), `scripts/check-badge-contrast.test.mjs` (resolves Core Badge defaults plus theme overrides), `scripts/check-status-text-contrast.test.mjs` (resolves `--color-text-<status>`, `--color-icon-<status>`, and `--color-border-<status>` against the surface and card tokens and checks that each status fill and text colour is chromatic in every first-party theme), `neutralTheme.test.ts` (pins reviewed role values and pairings), `tailwind-theme.test.ts` (pins the status utilities, including the released base ones), forced-colors assertions in the Badge, StatusDot, and Banner tests, and theme alias-generation tests | A status role is missing, mispaired, grey, routed to the wrong public utility, or falls below its contrast threshold in light or dark mode, a status fill loses its border in forced-colors mode, or a released base status token or utility changes value |
-| Released token compatibility | Type checking plus representative package/source builds | A released CSS variable or typed token name disappears without an explicit migration decision |
-| Visual defaults | Real Chromium examples in light, dark, status, and high-contrast contexts | A changed default produces unreadable or semantically inconsistent output |
+| Invariant | Evidence | Failure signal |
+| ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
+| INV1, INV2, INV7 | `scripts/check-theme-template.test.mjs` and token-doc generation check | A token family exists without a matching author-facing inventory or generated documentation |
+| INV5 | Domain-token exports and theme-generation tests | Domain names disappear from validation or require importing unused domain implementation |
+| INV6 | `packages/core/src/theme/tokens.test.ts` | JavaScript resolution disagrees with defaults, mode selection, references, or supported color expressions |
+| INV8 | `defineTheme.test.ts`, template checks, and token-doc generation | A local name enters portable helpers/docs or can conflict with a portable declaration |
+| INV9 | `tokens.test.ts` (core defaults), `SpacingRootFontSize.a11y.chromium.spec.ts` (real-Chromium root font size), each overriding theme's `*Theme.spacing.test.ts`, `check-cli-theme-bundle.test.mjs` (bundled copies byte-equal to the packages), `theme-concentricity.test.ts` (playground ramp read in rem) | A spacing step in `px` that no theme documents as its exception: a core default, a theme override, a bundled copy, or a generated ramp step |
+| INV10 | `tokens.test.ts` name check over Astryx's own `colorDefaults` and `domainTokenDefaults` only | A colour token Astryx defines fits none of the five shapes |
+| INV11 | `scripts/check-muted-status-contrast.test.mjs` (resolves global and Banner pale-surface role pairs), `scripts/check-badge-contrast.test.mjs` (resolves Core Badge defaults plus theme overrides), `scripts/check-status-text-contrast.test.mjs` (resolves `--color-on-<status>` on each strong fill, and `--color-text-<status>`, `--color-icon-<status>`, and `--color-border-<status>` against the surface and card tokens and checks that each status fill and text colour is chromatic in every first-party theme), `neutralTheme.test.ts` (pins reviewed role values and pairings), `tailwind-theme.test.ts` (pins the status utilities, including the released base ones), forced-colors assertions in the Badge, StatusDot, and Banner tests, and theme alias-generation tests | A status role is missing, mispaired, grey, routed to the wrong public utility, or falls below its contrast threshold in light or dark mode, a status fill loses its border in forced-colors mode, or a released status fill or utility changes value without a recorded reason |
+| Released token compatibility | Type checking plus representative package/source builds | A released CSS variable or typed token name disappears without an explicit migration decision |
+| Visual defaults | Real Chromium examples in light, dark, status, and high-contrast contexts | A changed default produces unreadable or semantically inconsistent output |
diff --git a/internal/vibe-tests/app/src/report/report.css b/internal/vibe-tests/app/src/report/report.css
index 0c2ad3ef2b..952e80928b 100644
--- a/internal/vibe-tests/app/src/report/report.css
+++ b/internal/vibe-tests/app/src/report/report.css
@@ -21,7 +21,7 @@
}
.report-codeModal-codeBlock {
- font-family: ui-monospace, "SF Mono", Menlo, monospace;
+ font-family: ui-monospace, 'SF Mono', Menlo, monospace;
font-size: 13px;
line-height: 1.5;
background-color: var(--color-background-body);
@@ -58,11 +58,11 @@
}
.report-color-positive {
- color: var(--color-success);
+ color: var(--color-text-success);
}
.report-color-negative {
- color: var(--color-error);
+ color: var(--color-text-error);
}
.report-color-neutral {
@@ -70,11 +70,11 @@
}
.report-color-warning {
- color: var(--color-warning);
+ color: var(--color-text-warning);
}
.report-color-info {
- color: var(--color-info, #8b5cf6);
+ color: var(--color-text-info);
}
/* === PromptDetailCard === */
diff --git a/packages/cli/api/theme/build/build.mjs b/packages/cli/api/theme/build/build.mjs
index 25692f197c..8c0f2af656 100644
--- a/packages/cli/api/theme/build/build.mjs
+++ b/packages/cli/api/theme/build/build.mjs
@@ -2870,10 +2870,15 @@ async function themeBuildInternal(
/** @type {string[]} */
const droppedDeclarations = [];
- const {component, prose} = _generateThemeRulesSplit(
- resolvedTheme,
- droppedDeclarations,
- );
+ let themeRules;
+ try {
+ themeRules = _generateThemeRulesSplit(resolvedTheme, droppedDeclarations);
+ } catch (error) {
+ const message =
+ error instanceof Error ? error.message : 'Theme normalization failed.';
+ throw new AstryxError(message, undefined, ERROR_CODES.ERR_THEME_INVALID);
+ }
+ const {component, prose} = themeRules;
const cssParts = [];
// Prose element defaults always ship — the `<Theme>` runtime
// (generateThemeCSS) always emits them, so the build must too, or the
diff --git a/packages/cli/assets/docs/tree/template-styles.doc.mjs b/packages/cli/assets/docs/tree/template-styles.doc.mjs
index 31b53532df..d3aeaef64d 100644
--- a/packages/cli/assets/docs/tree/template-styles.doc.mjs
+++ b/packages/cli/assets/docs/tree/template-styles.doc.mjs
@@ -56,7 +56,7 @@ import {colorVars} from '@astryxdesign/core/theme/tokens.stylex';
const styles = stylex.create({
trend: {
- color: colorVars['--color-success'],
+ color: colorVars['--color-text-success'],
minWidth: 0,
},
});
diff --git a/packages/cli/assets/docs/tree/tokens-color.doc.mjs b/packages/cli/assets/docs/tree/tokens-color.doc.mjs
index 1a3c9ce6ae..6838bec5f0 100644
--- a/packages/cli/assets/docs/tree/tokens-color.doc.mjs
+++ b/packages/cli/assets/docs/tree/tokens-color.doc.mjs
@@ -26,6 +26,55 @@ export const docs = {
"type": "prose",
"text": "Semantic colors for consistent theming. All colors use light-dark() for automatic mode switching."
},
+ {
+ "type": "prose",
+ "text": "Status roles: pick the token by the surface. `<status>` is info, success, warning, or error."
+ },
+ {
+ "type": "table",
+ "headers": [
+ "Status role",
+ "Use it for",
+ "Pairs with"
+ ],
+ "rows": [
+ [
+ "--color-text-<status>",
+ "Status text on the page or a card (4.5:1 or more).",
+ "—"
+ ],
+ [
+ "--color-icon-<status>",
+ "Status icons on the page or a card. Defaults to the text colour.",
+ "—"
+ ],
+ [
+ "--color-border-<status>",
+ "Status borders on the page or a card, such as an invalid field. Defaults to the text colour.",
+ "—"
+ ],
+ [
+ "--color-<status>",
+ "Strong status fill, such as a Badge or StatusDot.",
+ "--color-on-<status>"
+ ],
+ [
+ "--color-on-<status>",
+ "Text and icons on the strong fill (4.5:1 or more).",
+ "--color-<status>"
+ ],
+ [
+ "--color-<status>-muted",
+ "Pale status fill, such as a Banner.",
+ "--color-on-<status>-muted"
+ ],
+ [
+ "--color-on-<status>-muted",
+ "Text and icons on the pale fill (4.5:1 or more).",
+ "--color-<status>-muted"
+ ]
+ ]
+ },
{
"type": "table",
"headers": [
@@ -154,6 +203,21 @@ export const docs = {
"#AA071E",
"#E3193B"
],
+ [
+ "--color-info",
+ "#0064E0",
+ "#0064E0"
+ ],
+ [
+ "--color-info-muted",
+ "#0082FB33",
+ "#0082FB3F"
+ ],
+ [
+ "--color-on-info",
+ "#FFFFFF",
+ "#FFFFFF"
+ ],
[
"--color-success",
"#0D8626",
@@ -182,7 +246,7 @@ export const docs = {
[
"--color-on-error",
"#FFFFFF",
- "#FFFFFF"
+ "#0A1317"
],
[
"--color-warning",
@@ -199,6 +263,86 @@ export const docs = {
"#0A1317",
"#0A1317"
],
+ [
+ "--color-text-info",
+ "var(--color-text-blue)",
+ "var(--color-text-blue)"
+ ],
+ [
+ "--color-text-success",
+ "var(--color-text-green)",
+ "var(--color-text-green)"
+ ],
+ [
+ "--color-text-warning",
+ "var(--color-text-yellow)",
+ "var(--color-text-yellow)"
+ ],
+ [
+ "--color-text-error",
+ "var(--color-text-red)",
+ "var(--color-text-red)"
+ ],
+ [
+ "--color-icon-info",
+ "var(--color-text-info)",
+ "var(--color-text-info)"
+ ],
+ [
+ "--color-icon-success",
+ "var(--color-text-success)",
+ "var(--color-text-success)"
+ ],
+ [
+ "--color-icon-warning",
+ "var(--color-text-warning)",
+ "var(--color-text-warning)"
+ ],
+ [
+ "--color-icon-error",
+ "var(--color-text-error)",
+ "var(--color-text-error)"
+ ],
+ [
+ "--color-border-info",
+ "var(--color-text-info)",
+ "var(--color-text-info)"
+ ],
+ [
+ "--color-border-success",
+ "var(--color-text-success)",
+ "var(--color-text-success)"
+ ],
+ [
+ "--color-border-warning",
+ "var(--color-text-warning)",
+ "var(--color-text-warning)"
+ ],
+ [
+ "--color-border-error",
+ "var(--color-text-error)",
+ "var(--color-text-error)"
+ ],
+ [
+ "--color-on-info-muted",
+ "var(--color-text-blue)",
+ "var(--color-text-blue)"
+ ],
+ [
+ "--color-on-success-muted",
+ "var(--color-text-green)",
+ "var(--color-text-green)"
+ ],
+ [
+ "--color-on-warning-muted",
+ "var(--color-text-yellow)",
+ "var(--color-text-yellow)"
+ ],
+ [
+ "--color-on-error-muted",
+ "var(--color-text-red)",
+ "var(--color-text-red)"
+ ],
[
"--color-border",
"#05365919",
diff --git a/packages/cli/assets/docs/tree/tokens.doc.mjs b/packages/cli/assets/docs/tree/tokens.doc.mjs
index 97dce488cd..0349b6eb7f 100644
--- a/packages/cli/assets/docs/tree/tokens.doc.mjs
+++ b/packages/cli/assets/docs/tree/tokens.doc.mjs
@@ -2,7 +2,7 @@
// AUTO-GENERATED — do not edit manually.
// Run: node scripts/generate-token-docs.mjs
-// Total: 263 tokens across 15 categories.
+// Total: 282 tokens across 15 categories.
/** @type {import('@astryxdesign/cli/authoring').NamespaceDoc} */
export const docs = {
diff --git a/packages/cli/assets/templates/pages/dashboard-alert-rail/page.tsx b/packages/cli/assets/templates/pages/dashboard-alert-rail/page.tsx
index d8de5cbf81..85b7c82a42 100644
--- a/packages/cli/assets/templates/pages/dashboard-alert-rail/page.tsx
+++ b/packages/cli/assets/templates/pages/dashboard-alert-rail/page.tsx
@@ -94,9 +94,9 @@ interface WindowSeries {
}
const STATUS_STROKE: Record<HealthStatus, string> = {
- healthy: 'var(--color-success, #0B991F)',
- warning: 'var(--color-warning, #B25000)',
- critical: 'var(--color-error, #D6002A)',
+ healthy: 'var(--color-text-success)',
+ warning: 'var(--color-text-warning)',
+ critical: 'var(--color-text-error)',
};
const STATUS_DOT: Record<HealthStatus, StatusDotVariant> = {
diff --git a/packages/cli/assets/templates/pages/table-comparison/page.tsx b/packages/cli/assets/templates/pages/table-comparison/page.tsx
index 5adf7825ea..2dd59d468f 100644
--- a/packages/cli/assets/templates/pages/table-comparison/page.tsx
+++ b/packages/cli/assets/templates/pages/table-comparison/page.tsx
@@ -969,12 +969,21 @@ function uptimeStatus(value: number): {
status: string;
} {
if (value >= 99.95) {
- return {color: colorVars['--color-success'], status: 'Operational'};
+ return {
+ color: colorVars['--color-text-success'],
+ status: 'Operational',
+ };
}
if (value >= 99) {
- return {color: colorVars['--color-warning'], status: 'Degraded'};
+ return {
+ color: colorVars['--color-text-warning'],
+ status: 'Degraded',
+ };
}
- return {color: colorVars['--color-error'], status: 'Outage'};
+ return {
+ color: colorVars['--color-text-error'],
+ status: 'Outage',
+ };
}
interface UptimeDay {
diff --git a/packages/cli/assets/templates/themes/butter/butterPaletteRefs.generated.ts b/packages/cli/assets/templates/themes/butter/butterPaletteRefs.generated.ts
index df32f360ca..2c0a61127d 100644
--- a/packages/cli/assets/templates/themes/butter/butterPaletteRefs.generated.ts
+++ b/packages/cli/assets/templates/themes/butter/butterPaletteRefs.generated.ts
@@ -11,7 +11,7 @@ export const butterPaletteRefs = {
dark: {25: '#52237b', 80: '#ddb9f6', 90: '#f2daff'},
},
green: {
- light: {25: '#004a05', 70: '#7bbf7a', 80: '#a2d7a0', 85: '#b6e3b4', 90: '#caeec8'},
+ light: {25: '#004a05', 55: '#4a984a', 70: '#7bbf7a', 80: '#a2d7a0', 85: '#b6e3b4', 90: '#caeec8'},
dark: {15: '#013004', 20: '#063c0a', 70: '#83bc82', 80: '#a8d4a6', 90: '#cdedcc'},
},
neutral: {
@@ -31,7 +31,7 @@ export const butterPaletteRefs = {
dark: {15: '#4c0700', 25: '#6f1400', 80: '#ffb09b', 85: '#ffc5b5', 90: '#ffd9cf'},
},
yellow: {
- light: {25: '#443c00', 30: '#514700', 70: '#bfae35', 80: '#dfcf5b', 85: '#f0df72', 90: '#fdee8c', 95: '#fff7c0'},
+ light: {25: '#443c00', 30: '#514700', 55: '#958500', 70: '#bfae35', 80: '#dfcf5b', 85: '#f0df72', 90: '#fdee8c', 95: '#fff7c0'},
dark: {15: '#2c2600', 25: '#443c00', 70: '#bcae4e', 75: '#cdbe59', 85: '#eedf75', 90: '#fdee8c'},
},
teal: {
@@ -40,6 +40,7 @@ export const butterPaletteRefs = {
},
accent: {
light: {35: '#194ce8', 40: '#225bff', 55: '#4d82ff'},
+ dark: {70: '#81a9ff'},
},
cyan: {
light: {25: '#004649', 80: '#8dd2d3', 90: '#a9eff0'},
diff --git a/packages/cli/assets/templates/themes/butter/butterTheme.ts b/packages/cli/assets/templates/themes/butter/butterTheme.ts
index 6019ed7469..7a0a5fd6d8 100644
--- a/packages/cli/assets/templates/themes/butter/butterTheme.ts
+++ b/packages/cli/assets/templates/themes/butter/butterTheme.ts
@@ -107,6 +107,25 @@ const SECONDARY_COMPLEX_SELECTOR = {
SECONDARY_BUTTON[':hover'],
} as const;
+/**
+ * Butter's bright status rims and glyphs in input status scopes. Light mode
+ * uses mid-ramp stops so a rim reaches 3:1 on the field (theme-tokens INV11).
+ */
+const INPUT_STATUS_VARS = {
+ 'status:success': {
+ '--color-border-success': lightDark(green.light[55], green.light[70]),
+ '--color-icon-success': lightDark(green.light[55], green.light[70]),
+ },
+ 'status:warning': {
+ '--color-border-warning': lightDark(yellow.light[55], yellow.light[80]),
+ '--color-icon-warning': lightDark(yellow.light[55], yellow.light[80]),
+ },
+ 'status:error': {
+ '--color-border-error': red.light[60],
+ '--color-icon-error': red.light[60],
+ },
+} as const;
+
export const butterTheme = defineTheme({
name: 'butter',
@@ -187,6 +206,19 @@ export const butterTheme = defineTheme({
'--color-on-error': [red.light[95], red.dark[15]],
'--color-on-warning': [yellow.light[95], yellow.dark[15]],
+ // Info is its own blue status, independent of the accent.
+ '--color-info': [accent.light[40], accent.dark[70]],
+ '--color-info-muted': 'var(--color-background-blue)',
+
+ '--color-text-info': [accent.light[40], accent.dark[70]],
+ '--color-text-success': [green.light[25], green.dark[80]],
+ '--color-text-warning': [yellow.light[25], yellow.dark[85]],
+ '--color-text-error': [red.light[25], red.dark[80]],
+ '--color-on-info-muted': 'var(--color-text-blue)',
+ '--color-on-success-muted': [green.light[25], green.dark[80]],
+ '--color-on-warning-muted': [yellow.light[25], yellow.dark[85]],
+ '--color-on-error-muted': [red.light[25], red.dark[90]],
+
// Icon
'--color-icon-accent': [accent.light[40], yellow.dark[90]],
'--color-icon-primary': [neutral.light[15], neutral.dark[90]],
@@ -410,34 +442,23 @@ export const butterTheme = defineTheme({
},
},
- // Banner backgrounds match the semantic badge fills.
- // Banner status colors — override the muted tokens locally so the
- // header (which reads --color-*-muted via StyleX) renders vivid fills
- // matching the badge palette. Scoped to the banner root, doesn't leak.
+ // Banner status surfaces and content use the reviewed vivid pair.
banner: {
'status:info': {
- '--color-accent-muted': accent.light[55],
- '--color-text-primary': neutral.light[15],
- '--color-text-secondary': neutral.light[15],
- '--color-accent': neutral.light[15],
+ '--color-info-muted': accent.light[55],
+ '--color-on-info-muted': neutral.light[15],
},
'status:success': {
'--color-success-muted': green.light[70],
- '--color-text-primary': neutral.light[15],
- '--color-text-secondary': neutral.light[15],
- '--color-success': neutral.light[15],
+ '--color-on-success-muted': neutral.light[15],
},
'status:warning': {
'--color-warning-muted': yellow.light[80],
- '--color-text-primary': neutral.light[15],
- '--color-text-secondary': neutral.light[15],
- '--color-warning': neutral.light[15],
+ '--color-on-warning-muted': neutral.light[15],
},
'status:error': {
'--color-error-muted': red.light[60],
- '--color-text-primary': neutral.light[15],
- '--color-text-secondary': neutral.light[15],
- '--color-error': neutral.light[15],
+ '--color-on-error-muted': neutral.light[15],
},
},
@@ -561,9 +582,7 @@ export const butterTheme = defineTheme({
paddingInline: 'var(--spacing-3)',
borderColor: 'var(--color-border)',
},
- 'status:success': {'--color-success': green.light[70]},
- 'status:warning': {'--color-warning': yellow.light[80]},
- 'status:error': {'--color-error': red.light[60]},
+ ...INPUT_STATUS_VARS,
},
'text-area': {
base: {
@@ -571,9 +590,7 @@ export const butterTheme = defineTheme({
paddingInline: 'var(--spacing-3)',
borderColor: 'var(--color-border)',
},
- 'status:success': {'--color-success': green.light[70]},
- 'status:warning': {'--color-warning': yellow.light[80]},
- 'status:error': {'--color-error': red.light[60]},
+ ...INPUT_STATUS_VARS,
},
'number-input': {
base: {
@@ -581,9 +598,7 @@ export const butterTheme = defineTheme({
paddingInline: 'var(--spacing-3)',
borderColor: 'var(--color-border)',
},
- 'status:success': {'--color-success': green.light[70]},
- 'status:warning': {'--color-warning': yellow.light[80]},
- 'status:error': {'--color-error': red.light[60]},
+ ...INPUT_STATUS_VARS,
},
'date-input': {
base: {
@@ -591,9 +606,7 @@ export const butterTheme = defineTheme({
paddingInline: 'var(--spacing-3)',
borderColor: 'var(--color-border)',
},
- 'status:success': {'--color-success': green.light[70]},
- 'status:warning': {'--color-warning': yellow.light[80]},
- 'status:error': {'--color-error': red.light[60]},
+ ...INPUT_STATUS_VARS,
},
'time-input': {
base: {
@@ -601,9 +614,7 @@ export const butterTheme = defineTheme({
paddingInline: 'var(--spacing-3)',
borderColor: 'var(--color-border)',
},
- 'status:success': {'--color-success': green.light[70]},
- 'status:warning': {'--color-warning': yellow.light[80]},
- 'status:error': {'--color-error': red.light[60]},
+ ...INPUT_STATUS_VARS,
},
selector: {
base: {
@@ -611,9 +622,7 @@ export const butterTheme = defineTheme({
paddingInline: 'var(--spacing-3)',
borderColor: 'var(--color-border)',
},
- 'status:success': {'--color-success': green.light[70]},
- 'status:warning': {'--color-warning': yellow.light[80]},
- 'status:error': {'--color-error': red.light[60]},
+ ...INPUT_STATUS_VARS,
'variant:secondary': SECONDARY_SELECTOR,
},
'multi-selector': {
@@ -622,9 +631,7 @@ export const butterTheme = defineTheme({
paddingInline: 'var(--spacing-3)',
borderColor: 'var(--color-border)',
},
- 'status:success': {'--color-success': green.light[70]},
- 'status:warning': {'--color-warning': yellow.light[80]},
- 'status:error': {'--color-error': red.light[60]},
+ ...INPUT_STATUS_VARS,
'variant:secondary': SECONDARY_SELECTOR,
},
'complex-selector': {'variant:secondary': SECONDARY_COMPLEX_SELECTOR},
@@ -634,9 +641,7 @@ export const butterTheme = defineTheme({
paddingInline: 'var(--spacing-3)',
borderColor: 'var(--color-border)',
},
- 'status:success': {'--color-success': green.light[70]},
- 'status:warning': {'--color-warning': yellow.light[80]},
- 'status:error': {'--color-error': red.light[60]},
+ ...INPUT_STATUS_VARS,
},
tokenizer: {
base: {
@@ -644,9 +649,7 @@ export const butterTheme = defineTheme({
paddingInline: 'var(--spacing-3)',
borderColor: 'var(--color-border)',
},
- 'status:success': {'--color-success': green.light[70]},
- 'status:warning': {'--color-warning': yellow.light[80]},
- 'status:error': {'--color-error': red.light[60]},
+ ...INPUT_STATUS_VARS,
},
// Display sizes use Sarina — the signature buttery display
diff --git a/packages/cli/assets/templates/themes/chocolate/chocolateTheme.ts b/packages/cli/assets/templates/themes/chocolate/chocolateTheme.ts
index e7ef8fdf5e..8fd976afff 100644
--- a/packages/cli/assets/templates/themes/chocolate/chocolateTheme.ts
+++ b/packages/cli/assets/templates/themes/chocolate/chocolateTheme.ts
@@ -120,10 +120,23 @@ export const chocolateTheme = defineTheme({
'--color-on-dark': '#FFFCF7',
'--color-on-light': '#4a3520',
'--color-on-accent': ['#FFFFFF', '#4a3520'],
- '--color-on-success': ['#FFFFFF', '#4a3520'],
- '--color-on-error': ['#FFFFFF', '#4a3520'],
+ '--color-on-success': '#141010',
+ '--color-on-error': '#141010',
'--color-on-warning': ['#4a3520', '#4a3520'],
+ // Info is its own blue status, independent of the accent.
+ '--color-info': ['#3a5e8c', '#7ba8d4'],
+ '--color-info-muted': 'var(--color-background-blue)',
+
+ '--color-text-info': ['#2e4a6e', '#8dbce0'],
+ '--color-text-success': ['#526f00', '#a8d43a'],
+ '--color-text-warning': ['#7a5500', '#ffd960'],
+ '--color-text-error': ['#cc0000', '#ff7a7a'],
+ '--color-on-info-muted': ['#2e4a6e', '#8dbce0'],
+ '--color-on-success-muted': ['#4d6800', '#a8d43a'],
+ '--color-on-warning-muted': ['#7a5500', '#ffd960'],
+ '--color-on-error-muted': ['#b40000', '#ff7a7a'],
+
// Icon
'--color-icon-accent': ['#8C5927', '#d4a06a'],
'--color-icon-primary': ['#4a3520', '#EDE4D4'],
diff --git a/packages/cli/assets/templates/themes/gothic/gothicTheme.ts b/packages/cli/assets/templates/themes/gothic/gothicTheme.ts
index 96c0719972..5ae07cf979 100644
--- a/packages/cli/assets/templates/themes/gothic/gothicTheme.ts
+++ b/packages/cli/assets/templates/themes/gothic/gothicTheme.ts
@@ -135,6 +135,19 @@ export const gothicTheme = defineTheme({
'--color-on-error': neutral.dark[10],
'--color-on-warning': neutral.dark[10],
+ '--color-info': blue.dark[65],
+ '--color-info-muted': blue.dark[75],
+ '--color-on-info': neutral.dark[10],
+
+ '--color-text-info': blue.dark[75],
+ '--color-text-success': green.dark[75],
+ '--color-text-warning': yellow.dark[75],
+ '--color-text-error': red.dark[75],
+ '--color-on-info-muted': blue.dark[20],
+ '--color-on-success-muted': green.dark[20],
+ '--color-on-warning-muted': yellow.dark[15],
+ '--color-on-error-muted': red.dark[20],
+
'--color-icon-accent': neutral.dark[95],
'--color-icon-primary': neutral.dark[95],
'--color-icon-secondary': neutral.dark[75],
@@ -286,28 +299,20 @@ export const gothicTheme = defineTheme({
borderRadius: 'var(--radius-element)',
},
'status:info': {
- backgroundColor: 'var(--color-background-blue)',
- '--color-text-primary': 'var(--color-text-blue)',
- '--color-text-secondary': 'var(--color-text-blue)',
- '--color-accent': 'var(--color-text-blue)',
+ '--color-info-muted': 'var(--color-background-blue)',
+ '--color-on-info-muted': 'var(--color-text-blue)',
},
'status:success': {
- backgroundColor: 'var(--color-background-green)',
- '--color-text-primary': 'var(--color-text-green)',
- '--color-text-secondary': 'var(--color-text-green)',
- '--color-success': 'var(--color-text-green)',
+ '--color-success-muted': 'var(--color-background-green)',
+ '--color-on-success-muted': 'var(--color-text-green)',
},
'status:warning': {
- backgroundColor: 'var(--color-background-yellow)',
- '--color-text-primary': 'var(--color-text-yellow)',
- '--color-text-secondary': 'var(--color-text-yellow)',
- '--color-warning': 'var(--color-text-yellow)',
+ '--color-warning-muted': 'var(--color-background-yellow)',
+ '--color-on-warning-muted': 'var(--color-text-yellow)',
},
'status:error': {
- backgroundColor: 'var(--color-background-red)',
- '--color-text-primary': 'var(--color-text-red)',
- '--color-text-secondary': 'var(--color-text-red)',
- '--color-error': 'var(--color-text-red)',
+ '--color-error-muted': 'var(--color-background-red)',
+ '--color-on-error-muted': 'var(--color-text-red)',
},
},
diff --git a/packages/cli/assets/templates/themes/matcha/matchaPaletteRefs.generated.ts b/packages/cli/assets/templates/themes/matcha/matchaPaletteRefs.generated.ts
index 9bb4bb5e9b..6993f9d2f9 100644
--- a/packages/cli/assets/templates/themes/matcha/matchaPaletteRefs.generated.ts
+++ b/packages/cli/assets/templates/themes/matcha/matchaPaletteRefs.generated.ts
@@ -20,7 +20,7 @@ export const matchaPaletteRefs = {
},
blue: {
light: {35: '#2e4a6e', 50: '#3a5e8c'},
- dark: {50: '#3a5e8c', 70: '#7ba8d4', 75: '#8dbce0'},
+ dark: {50: '#3a5e8c', 70: '#7ba8d4', 75: '#8dbce0', 80: '#a7c9e3'},
},
purple: {
light: {35: '#553a70', 50: '#6b4a8c'},
diff --git a/packages/cli/assets/templates/themes/matcha/matchaTheme.ts b/packages/cli/assets/templates/themes/matcha/matchaTheme.ts
index c30ac32496..073a678179 100644
--- a/packages/cli/assets/templates/themes/matcha/matchaTheme.ts
+++ b/packages/cli/assets/templates/themes/matcha/matchaTheme.ts
@@ -103,10 +103,23 @@ export const matchaTheme = defineTheme({
'--color-on-dark': neutral.light[100],
'--color-on-light': neutral.light[20],
'--color-on-accent': [neutral.light[100], neutral.dark[20]],
- '--color-on-success': [neutral.light[100], neutral.dark[20]],
- '--color-on-error': [neutral.light[100], neutral.dark[20]],
+ '--color-on-success': neutral.dark[5],
+ '--color-on-error': neutral.dark[5],
'--color-on-warning': [neutral.light[20], neutral.dark[20]],
+ // Info is its own blue status, independent of the accent.
+ '--color-info': [blue.light[50], blue.dark[80]],
+ '--color-info-muted': 'var(--color-background-blue)',
+
+ '--color-text-info': [blue.light[35], blue.dark[75]],
+ '--color-text-success': [green.light[35], green.dark[75]],
+ '--color-text-warning': [yellow.light[45], yellow.dark[90]],
+ '--color-text-error': [red.light[35], red.dark[75]],
+ '--color-on-info-muted': [blue.light[35], blue.dark[75]],
+ '--color-on-success-muted': [green.light[35], green.dark[75]],
+ '--color-on-warning-muted': [yellow.light[45], yellow.dark[90]],
+ '--color-on-error-muted': [red.light[35], red.dark[75]],
+
// Icon
'--color-icon-accent': [neutral.light[20], neutral.dark[75]],
'--color-icon-primary': [neutral.light[20], neutral.dark[75]],
diff --git a/packages/cli/assets/templates/themes/neutral/neutralPaletteRefs.generated.ts b/packages/cli/assets/templates/themes/neutral/neutralPaletteRefs.generated.ts
index 5de468265b..54e673774e 100644
--- a/packages/cli/assets/templates/themes/neutral/neutralPaletteRefs.generated.ts
+++ b/packages/cli/assets/templates/themes/neutral/neutralPaletteRefs.generated.ts
@@ -23,15 +23,15 @@ export const neutralPaletteRefs = {
dark: {25: '#503424', 65: '#df843f', 80: '#ffb37e'},
},
blue: {
- light: {25: '#003978', 30: '#00458c', 50: '#0074e2', 80: '#a1caff', 85: '#b9d7ff'},
+ light: {25: '#003978', 30: '#00458c', 45: '#0067ce', 50: '#0074e2', 80: '#a1caff', 85: '#b9d7ff'},
dark: {25: '#253c5a', 65: '#5aa0f8', 75: '#88bcff', 80: '#a1caff'},
},
red: {
- light: {25: '#76000c', 30: '#8a0011', 55: '#de4745', 65: '#fa6762', 70: '#ff7f77', 80: '#ffaea7', 85: '#ffc4be'},
- dark: {25: '#5b2b28', 65: '#ee736c', 75: '#ff9890', 80: '#ffaea7', 85: '#ffc4be'},
+ light: {25: '#76000c', 30: '#8a0011', 45: '#c0262c', 55: '#de4745', 65: '#fa6762', 80: '#ffaea7', 85: '#ffc4be'},
+ dark: {25: '#5b2b28', 75: '#ff9890', 80: '#ffaea7'},
},
yellow: {
- light: {25: '#4b3900', 30: '#584400', 65: '#c29900', 75: '#e2b623', 80: '#eec448', 85: '#f8d36a'},
+ light: {25: '#4b3900', 30: '#584400', 45: '#836700', 65: '#c29900', 75: '#e2b623', 80: '#eec448', 85: '#f8d36a'},
dark: {25: '#453a1c', 80: '#e3c36c', 90: '#fae19e'},
},
teal: {
diff --git a/packages/cli/assets/templates/themes/neutral/neutralTheme.ts b/packages/cli/assets/templates/themes/neutral/neutralTheme.ts
index 57c7778bdd..ba07f2c263 100644
--- a/packages/cli/assets/templates/themes/neutral/neutralTheme.ts
+++ b/packages/cli/assets/templates/themes/neutral/neutralTheme.ts
@@ -33,40 +33,12 @@ const neutralSyntax = defineSyntaxTheme({
});
const neutralLocalTokens: Record<string, TokenValue> = {
+ // Deprecated: kept with its released name, meaning, and value for Neutral
+ // extensions (theme:neutral DEC-1); Neutral itself paints status through the
+ // portable --color-* roles and no longer reads it.
'--astryx-theme-neutral-color-status-fill-accent': ['#0074e2', '#6d9cfe'],
- '--astryx-theme-neutral-color-status-fill-success': ['#198100', '#64af4c'],
- '--astryx-theme-neutral-color-status-fill-warning': '#ffce2f',
- '--astryx-theme-neutral-color-status-fill-error': ['#c9303a', '#ff705d'],
- '--astryx-theme-neutral-color-status-muted-accent': [
- blue.light[85],
- withAlpha(blue.dark[75], '3D'),
- ],
- '--astryx-theme-neutral-color-on-tint-neutral': ['#fafafa4D', '#0a0a0a4D'],
- '--astryx-theme-neutral-color-on-tint-overlay-hover': [
- '#fafafa1A',
- '#0a0a0a1A',
- ],
- '--astryx-theme-neutral-color-on-tint-overlay-pressed': [
- '#fafafa33',
- '#0a0a0a33',
- ],
- '--astryx-theme-neutral-color-destructive-overlay-hover': [
- withAlpha(red.light[70], '0D'),
- withAlpha(red.dark[65], '0D'),
- ],
- '--astryx-theme-neutral-color-destructive-overlay-pressed': [
- withAlpha(red.light[70], '1A'),
- withAlpha(red.dark[65], '1A'),
- ],
};
-const statusFill = {
- accent: 'var(--astryx-theme-neutral-color-status-fill-accent)',
- success: 'var(--astryx-theme-neutral-color-status-fill-success)',
- warning: 'var(--astryx-theme-neutral-color-status-fill-warning)',
- error: 'var(--astryx-theme-neutral-color-status-fill-error)',
-} as const;
-
export const neutralTheme = defineTheme({
name: 'neutral',
localTokens: neutralLocalTokens,
@@ -154,15 +126,31 @@ export const neutralTheme = defineTheme({
'--color-on-error': [neutral.light[100], neutral.dark[5]],
'--color-on-warning': neutral.light[5],
+ '--color-info': ['#0074e2', '#6d9cfe'],
+ '--color-info-muted': [blue.light[85], withAlpha(blue.dark[75], '3D')],
+ '--color-on-info': [neutral.light[100], neutral.dark[5]],
+
+ '--color-text-info': [blue.light[45], blue.dark[80]],
+ '--color-text-success': [green.light[45], green.light[75]],
+ '--color-text-warning': [yellow.light[45], yellow.light[80]],
+ '--color-text-error': [red.light[45], red.dark[80]],
+
+ '--color-on-info-muted': [blue.light[25], blue.dark[80]],
+ '--color-on-success-muted': [green.light[25], green.light[75]],
+ '--color-on-warning-muted': [yellow.light[25], yellow.light[80]],
+ '--color-on-error-muted': [red.light[25], red.dark[80]],
+
// Icon
'--color-icon-accent': [neutral.light[10], neutral.dark[95]],
'--color-icon-primary': [neutral.light[0], neutral.dark[100]],
'--color-icon-secondary': [neutral.light[45], neutral.dark[65]],
'--color-icon-disabled': [neutral.light[60], neutral.dark[35]],
- '--color-success': [green.light[25], green.light[80]],
- '--color-error': [red.light[25], red.dark[85]],
- '--color-warning': [yellow.light[25], yellow.light[85]],
+ // Strong status fills (architecture:theme-tokens INV11): Neutral's
+ // reviewed status-fill colours, with --color-on-<status> above.
+ '--color-success': ['#198100', '#64af4c'],
+ '--color-warning': '#ffce2f',
+ '--color-error': ['#c9303a', '#ff705d'],
'--color-success-muted': [green.dark[85], withAlpha(green.light[75], '3D')],
'--color-error-muted': [red.light[85], withAlpha(red.dark[75], '3D')],
'--color-warning-muted': [
@@ -182,7 +170,7 @@ export const neutralTheme = defineTheme({
withAlpha(neutral.light[0], '1A'),
withAlpha(neutral.dark[0], '4D'),
],
- '--color-tint-hover': ['black', 'white'],
+ '--color-tint-hover': [neutral.light[0], neutral.dark[100]],
'--color-background-red': [red.light[85], red.dark[25]],
'--color-border-red': [red.light[80], red.light[65]],
@@ -288,35 +276,15 @@ export const neutralTheme = defineTheme({
button: {
'variant:destructive': {
backgroundColor: 'var(--color-error-muted)',
- color: 'var(--color-error)',
- '--color-overlay-hover':
- 'var(--astryx-theme-neutral-color-destructive-overlay-hover)',
- '--color-overlay-pressed':
- 'var(--astryx-theme-neutral-color-destructive-overlay-pressed)',
+ color: 'var(--color-on-error-muted)',
},
},
badge: {
- 'variant:info': {
- backgroundColor: statusFill.accent,
- color: 'var(--color-on-accent)',
- },
'variant:neutral': {
backgroundColor: 'var(--color-background-gray)',
color: 'var(--color-text-gray)',
},
- 'variant:success': {
- backgroundColor: statusFill.success,
- color: 'var(--color-on-success)',
- },
- 'variant:warning': {
- backgroundColor: statusFill.warning,
- color: 'var(--color-on-warning)',
- },
- 'variant:error': {
- backgroundColor: statusFill.error,
- color: 'var(--color-on-error)',
- },
'variant:red': {
backgroundColor: 'var(--color-background-red)',
@@ -360,18 +328,6 @@ export const neutralTheme = defineTheme({
},
},
- 'status-dot': {
- 'variant:success': {backgroundColor: statusFill.success},
- 'variant:warning': {backgroundColor: statusFill.warning},
- 'variant:error': {backgroundColor: statusFill.error},
- 'variant:accent': {backgroundColor: statusFill.accent},
- },
-
- 'avatar-status-dot': {
- 'variant:success': {backgroundColor: statusFill.success},
- 'variant:error': {backgroundColor: statusFill.error},
- },
-
// Give the Neutral segmented control a roomier inset without changing its
// outside height. The selected item stays flat against the tinted track.
'segmented-control': {
@@ -394,45 +350,6 @@ export const neutralTheme = defineTheme({
},
},
- banner: {
- base: {
- '--color-neutral': 'var(--astryx-theme-neutral-color-on-tint-neutral)',
- '--color-overlay-hover':
- 'var(--astryx-theme-neutral-color-on-tint-overlay-hover)',
- '--color-overlay-pressed':
- 'var(--astryx-theme-neutral-color-on-tint-overlay-pressed)',
- },
- 'status:info': {
- '--color-accent-muted':
- 'var(--astryx-theme-neutral-color-status-muted-accent)',
- '--color-text-primary': 'var(--color-text-blue)',
- '--color-text-secondary': 'var(--color-text-blue)',
- '--color-accent': 'var(--color-text-blue)',
- },
- 'status:success': {
- '--color-text-primary': 'var(--color-text-green)',
- '--color-text-secondary': 'var(--color-text-green)',
- '--color-success': 'var(--color-text-green)',
- },
- 'status:warning': {
- '--color-text-primary': 'var(--color-text-yellow)',
- '--color-text-secondary': 'var(--color-text-yellow)',
- '--color-warning': 'var(--color-text-yellow)',
- },
- 'status:error': {
- '--color-text-primary': 'var(--color-text-red)',
- '--color-text-secondary': 'var(--color-text-red)',
- '--color-error': 'var(--color-text-red)',
- },
- },
-
- 'step-indicator': {
- 'status:accent': {'--color-accent': statusFill.accent},
- 'status:success': {'--color-success': statusFill.success},
- 'status:warning': {'--color-warning': statusFill.warning},
- 'status:error': {'--color-error': statusFill.error},
- },
-
switch: {
base: {
'--color-background-gray': 'var(--color-border-emphasized)',
@@ -443,18 +360,6 @@ export const neutralTheme = defineTheme({
base: {
'--color-background-muted': 'var(--color-border-emphasized)',
},
- 'variant:accent': {
- '--color-accent': statusFill.accent,
- },
- 'variant:success': {
- '--color-success': statusFill.success,
- },
- 'variant:warning': {
- '--color-warning': statusFill.warning,
- },
- 'variant:error': {
- '--color-error': statusFill.error,
- },
},
card: {
diff --git a/packages/cli/assets/templates/themes/stone/stoneTheme.ts b/packages/cli/assets/templates/themes/stone/stoneTheme.ts
index 144336fe44..bde6befe59 100644
--- a/packages/cli/assets/templates/themes/stone/stoneTheme.ts
+++ b/packages/cli/assets/templates/themes/stone/stoneTheme.ts
@@ -26,13 +26,16 @@ const withAlpha = (color: string, alpha: string): string => `${color}${alpha}`;
*/
const INPUT_STATUS_VARS = {
'status:success': {
- '--color-success': lightDark(green.light[55], green.dark[70]),
+ '--color-border-success': lightDark(green.light[55], green.dark[70]),
+ '--color-icon-success': lightDark(green.light[55], green.dark[70]),
},
'status:warning': {
- '--color-warning': lightDark(yellow.light[55], yellow.dark[70]),
+ '--color-border-warning': lightDark(yellow.light[55], yellow.dark[70]),
+ '--color-icon-warning': lightDark(yellow.light[55], yellow.dark[70]),
},
'status:error': {
- '--color-error': lightDark(red.light[60], red.dark[70]),
+ '--color-border-error': lightDark(red.light[60], red.dark[70]),
+ '--color-icon-error': lightDark(red.light[60], red.dark[70]),
},
} as const;
@@ -188,9 +191,22 @@ export const stoneTheme = defineTheme({
'--color-on-dark': neutral.light[100],
'--color-on-light': [neutral.light[15], neutral.dark[15]],
'--color-on-accent': [neutral.light[100], neutral.dark[15]],
- '--color-on-success': [green.light[30], green.dark[90]],
- '--color-on-error': [red.light[30], red.dark[90]],
- '--color-on-warning': [yellow.light[30], yellow.dark[90]],
+ '--color-on-success': [neutral.light[100], neutral.dark[10]],
+ '--color-on-error': [neutral.light[100], neutral.dark[10]],
+ '--color-on-warning': [neutral.light[100], neutral.dark[10]],
+
+ '--color-info': [blue.light[40], blue.dark[70]],
+ '--color-info-muted': [blue.light[90], blue.dark[25]],
+ '--color-on-info': [neutral.light[100], neutral.dark[15]],
+
+ '--color-text-info': [blue.light[30], blue.dark[90]],
+ '--color-text-success': [green.light[30], green.dark[90]],
+ '--color-text-warning': [yellow.light[30], yellow.dark[90]],
+ '--color-text-error': [red.light[30], red.dark[90]],
+ '--color-on-info-muted': [blue.light[30], blue.dark[90]],
+ '--color-on-success-muted': [green.light[30], green.dark[25]],
+ '--color-on-warning-muted': [yellow.light[30], yellow.dark[25]],
+ '--color-on-error-muted': [red.light[30], red.dark[25]],
// Icon
'--color-icon-accent': [neutral.light[15], neutral.dark[95]],
@@ -336,32 +352,23 @@ export const stoneTheme = defineTheme({
},
},
- // Banner surface declarations live above the theme layer, so redirect the
- // semantic variables here instead of attempting a losing direct fill.
+ // Banner status surfaces and content use the matching categorical pair.
banner: {
'status:info': {
- '--color-accent-muted': 'var(--color-background-blue)',
- '--color-text-primary': 'var(--color-text-blue)',
- '--color-text-secondary': 'var(--color-text-blue)',
- '--color-accent': 'var(--color-text-blue)',
+ '--color-info-muted': 'var(--color-background-blue)',
+ '--color-on-info-muted': 'var(--color-text-blue)',
},
'status:success': {
'--color-success-muted': 'var(--color-background-green)',
- '--color-text-primary': 'var(--color-text-green)',
- '--color-text-secondary': 'var(--color-text-green)',
- '--color-success': 'var(--color-text-green)',
+ '--color-on-success-muted': 'var(--color-text-green)',
},
'status:warning': {
'--color-warning-muted': 'var(--color-background-yellow)',
- '--color-text-primary': 'var(--color-text-yellow)',
- '--color-text-secondary': 'var(--color-text-yellow)',
- '--color-warning': 'var(--color-text-yellow)',
+ '--color-on-warning-muted': 'var(--color-text-yellow)',
},
'status:error': {
'--color-error-muted': 'var(--color-background-red)',
- '--color-text-primary': 'var(--color-text-red)',
- '--color-text-secondary': 'var(--color-text-red)',
- '--color-error': 'var(--color-text-red)',
+ '--color-on-error-muted': 'var(--color-text-red)',
},
},
@@ -382,6 +389,21 @@ export const stoneTheme = defineTheme({
},
},
+ 'progress-bar-mark': {
+ 'placement:fill+variant:accent': {
+ backgroundColor: 'var(--color-on-light)',
+ },
+ 'placement:fill+variant:success': {
+ backgroundColor: 'var(--color-on-light)',
+ },
+ 'placement:fill+variant:warning': {
+ backgroundColor: 'var(--color-on-light)',
+ },
+ 'placement:fill+variant:error': {
+ backgroundColor: 'var(--color-on-light)',
+ },
+ },
+
// The default muted track is too close to Stone's body surface.
'progress-bar-track': {
base: {
@@ -400,12 +422,15 @@ export const stoneTheme = defineTheme({
'field-status': {
'type:success': {
backgroundColor: 'var(--color-background-green)',
+ color: 'var(--color-text-green)',
},
'type:warning': {
backgroundColor: 'var(--color-background-yellow)',
+ color: 'var(--color-text-yellow)',
},
'type:error': {
backgroundColor: 'var(--color-background-red)',
+ color: 'var(--color-text-red)',
},
},
diff --git a/packages/cli/assets/templates/themes/y2k/y2kTheme.ts b/packages/cli/assets/templates/themes/y2k/y2kTheme.ts
index f1b4be85e1..01c3b61899 100644
--- a/packages/cli/assets/templates/themes/y2k/y2kTheme.ts
+++ b/packages/cli/assets/templates/themes/y2k/y2kTheme.ts
@@ -192,6 +192,18 @@ export const y2kTheme = defineTheme({
'--color-on-error': [red.light[30], red.dark[20]],
'--color-on-warning': [yellow.light[30], yellow.dark[20]],
+ '--color-info': [blue.light[40], blue.dark[75]],
+ '--color-info-muted': 'var(--color-background-blue)',
+
+ '--color-text-info': [blue.light[20], blue.dark[75]],
+ '--color-text-success': [green.light[30], green.dark[75]],
+ '--color-text-warning': [yellow.light[30], yellow.dark[85]],
+ '--color-text-error': [red.light[30], red.dark[75]],
+ '--color-on-info-muted': 'var(--color-text-blue)',
+ '--color-on-success-muted': 'var(--color-text-green)',
+ '--color-on-warning-muted': 'var(--color-text-yellow)',
+ '--color-on-error-muted': 'var(--color-text-red)',
+
// Icon
'--color-icon-accent': [neutral.light[15], neutral.dark[95]],
'--color-icon-primary': [neutral.light[15], neutral.dark[95]],
@@ -393,28 +405,20 @@ export const y2kTheme = defineTheme({
borderRadius: '0px',
},
'status:info': {
- backgroundColor: 'var(--color-background-blue)',
- '--color-text-primary': 'var(--color-text-blue)',
- '--color-text-secondary': 'var(--color-text-blue)',
- '--color-accent': 'var(--color-text-blue)',
+ '--color-info-muted': 'var(--color-background-blue)',
+ '--color-on-info-muted': 'var(--color-text-blue)',
},
'status:success': {
- backgroundColor: 'var(--color-background-green)',
- '--color-text-primary': 'var(--color-text-green)',
- '--color-text-secondary': 'var(--color-text-green)',
- '--color-success': 'var(--color-text-green)',
+ '--color-success-muted': 'var(--color-background-green)',
+ '--color-on-success-muted': 'var(--color-text-green)',
},
'status:warning': {
- backgroundColor: 'var(--color-background-yellow)',
- '--color-text-primary': 'var(--color-text-yellow)',
- '--color-text-secondary': 'var(--color-text-yellow)',
- '--color-warning': 'var(--color-text-yellow)',
+ '--color-warning-muted': 'var(--color-background-yellow)',
+ '--color-on-warning-muted': 'var(--color-text-yellow)',
},
'status:error': {
- backgroundColor: 'var(--color-background-red)',
- '--color-text-primary': 'var(--color-text-red)',
- '--color-text-secondary': 'var(--color-text-red)',
- '--color-error': 'var(--color-text-red)',
+ '--color-error-muted': 'var(--color-background-red)',
+ '--color-on-error-muted': 'var(--color-text-red)',
},
},
diff --git a/packages/cli/clients/cli/commands/build-theme.adaptations.test.mjs b/packages/cli/clients/cli/commands/build-theme.adaptations.test.mjs
index 239fe326dc..039245c0ac 100644
--- a/packages/cli/clients/cli/commands/build-theme.adaptations.test.mjs
+++ b/packages/cli/clients/cli/commands/build-theme.adaptations.test.mjs
@@ -95,6 +95,116 @@ describe('theme build adaptations', () => {
);
});
+ it('emits scoped status aliases in built CSS and preserves child extension parity', async () => {
+ const {defineTheme, generateThemeCSS} =
+ await import('@astryxdesign/core/theme');
+ const project = path.join(tmpDir, 'project');
+ const themesDir = path.join(project, 'themes');
+ const input = {
+ name: 'status-aliases',
+ tokens: {
+ '--color-info': '#225bff',
+ '--color-text-blue': '#203a6c',
+ },
+ adaptations: {
+ rules: [
+ {
+ when: {contrast: 'more'},
+ value: {
+ tokens: {'--color-text-success': '#123456'},
+ },
+ },
+ {
+ when: {pointer: 'coarse'},
+ value: {tokens: {'--color-text-green': '#abcdef'}},
+ },
+ ],
+ },
+ onDark: {
+ tokens: {'--color-text-blue': '#fefefe'},
+ },
+ };
+ const themeFile = writeTheme(themesDir, input.name, JSON.stringify(input));
+
+ const result = await build(project, themeFile);
+ expect(result.code, result.stderr).toBe(0);
+
+ const css = fs.readFileSync(
+ path.join(themesDir, 'status-aliases.css'),
+ 'utf8',
+ );
+ const mediaAlias = '--color-text-info: var(--color-text-blue);';
+ const adaptationAlias = '--color-text-success: var(--color-text-green);';
+ const authoredRole = '--color-text-success: #123456;';
+ // The authored Info fill is a concrete hue, so theme generation derives
+ // its content, text, and pale-fill content (theme-compilation INV17).
+ for (const role of ['on-info', 'text-info', 'on-info-muted']) {
+ expect(css).toMatch(
+ new RegExp(
+ `--color-${role}: light-dark\\(#[0-9A-F]{6}, #[0-9A-F]{6}\\);`,
+ ),
+ );
+ }
+ // The dark media surface that sets the hue rebinds the text alias.
+ expect(css).toContain(mediaAlias);
+ expect(css).toContain(adaptationAlias);
+ expect(css.split(authoredRole).length - 1).toBeGreaterThanOrEqual(2);
+ expect(css.lastIndexOf(authoredRole)).toBeGreaterThan(
+ css.lastIndexOf(adaptationAlias),
+ );
+
+ const {statusAliasesTheme: builtTheme} = await import(
+ pathToFileURL(path.join(themesDir, 'status-aliases.js')).href
+ );
+ const source = defineTheme(input);
+ const childInput = {
+ name: 'status-alias-child',
+ tokens: {'--color-text-blue': '#345678'},
+ };
+ const fromSource = defineTheme({...childInput, extends: source});
+ const fromBuilt = defineTheme({...childInput, extends: builtTheme});
+ expect(generateThemeCSS(fromBuilt)).toEqual(generateThemeCSS(fromSource));
+ });
+
+ it('derives a complete status set for a minimal theme in built CSS (INV17)', async () => {
+ const {defineTheme, generateThemeCSS} =
+ await import('@astryxdesign/core/theme');
+ const project = path.join(tmpDir, 'project');
+ const themesDir = path.join(project, 'themes');
+ const input = {
+ name: 'status-minimal',
+ tokens: {
+ '--color-success': '#3FB950',
+ '--color-warning': '#D29922',
+ '--color-error': '#F85149',
+ '--color-info': '#6E40C9',
+ },
+ };
+ const themeFile = writeTheme(themesDir, input.name, JSON.stringify(input));
+ const result = await build(project, themeFile);
+ expect(result.code, result.stderr).toBe(0);
+
+ const css = fs.readFileSync(
+ path.join(themesDir, 'status-minimal.css'),
+ 'utf8',
+ );
+ for (const status of ['success', 'warning', 'error', 'info']) {
+ expect(css).toMatch(
+ new RegExp(
+ `--color-text-${status}: light-dark\\(#[0-9A-F]{6}, #[0-9A-F]{6}\\);`,
+ ),
+ );
+ expect(css).toContain(
+ `--color-icon-${status}: var(--color-text-${status});`,
+ );
+ }
+ // Built and runtime output derive the same values.
+ const runtime = generateThemeCSS(defineTheme(input));
+ const derived = css.match(/--color-text-warning: [^;]+;/)?.[0];
+ expect(derived).toBeDefined();
+ expect(JSON.stringify(runtime)).toContain(derived);
+ });
+
it.each([
['defined', writeTheme],
['plain', writePlainTheme],
diff --git a/packages/cli/test/__golden__/no-icon-set/docs-topics.json b/packages/cli/test/__golden__/no-icon-set/docs-topics.json
index f19b3f7b33..3c0b69ae58 100644
--- a/packages/cli/test/__golden__/no-icon-set/docs-topics.json
+++ b/packages/cli/test/__golden__/no-icon-set/docs-topics.json
@@ -126,7 +126,7 @@
"usage",
"best-practices"
],
- "skeleton": "940c5a29904f209dfe36a4c7f19ba5a11e333eabb1f8ea0e66127b7b29337a0a",
+ "skeleton": "904d7bbe31a404b5fc50f7e514f621cd49e51bb32f27e720cd40bd70b85157c2",
"mentions": []
},
"elevation": {
diff --git a/packages/core/README.md b/packages/core/README.md
index e53ca19ca1..f9517d5338 100644
--- a/packages/core/README.md
+++ b/packages/core/README.md
@@ -165,15 +165,18 @@ The `tailwind-theme.css` import maps system tokens to Tailwind utilities via `@t
Some useful mappings:
-| Tailwind class | Astryx token |
-| --------------------------------------------------------- | ------------------------------------------------- |
-| `text-primary` / `text-secondary` | `--color-text-primary` / `--color-text-secondary` |
-| `bg-surface` / `bg-card` / `bg-body` | `--color-background-surface` / `card` / `body` |
-| `border-border` / `border-strong` | `--color-border` / `--color-border-emphasized` |
-| `bg-success` / `text-error` / `text-warning` | Status tokens |
-| `bg-blue-subtle` / `border-blue-ring` / `text-blue-vivid` | Hue palette (×10 hues) |
-| `rounded-sm` / `rounded-md` / `rounded-lg` | `--radius-inner` / `element` / `container` |
-| `shadow-sm` / `shadow-md` / `shadow-lg` | `--shadow-low` / `med` / `high` |
+| Tailwind class | Astryx token |
+| ------------------------------------------------------------ | ---------------------------------------------------------------- |
+| `text-primary` / `text-secondary` | `--color-text-primary` / `--color-text-secondary` |
+| `bg-surface` / `bg-card` / `bg-body` | `--color-background-surface` / `card` / `body` |
+| `border-border` / `border-strong` | `--color-border` / `--color-border-emphasized` |
+| `bg-info` / `bg-success` / `bg-warning` / `bg-error` | Strong status fills (`--color-<status>`) |
+| `text-on-info` / `bg-info-muted` / `text-on-info-muted` | Strong-fill content, pale fill, pale-fill content |
+| `text-success` / `text-warning` / `text-error` / `text-info` | Status text on the page (`--color-text-*`; also `text-status-*`) |
+| `border-success` / `border-warning` / `border-error` | Status borders (`--color-border-*`) |
+| `bg-blue-subtle` / `border-blue-ring` / `text-blue-vivid` | Hue palette (×10 hues) |
+| `rounded-sm` / `rounded-md` / `rounded-lg` | `--radius-inner` / `element` / `container` |
+| `shadow-sm` / `shadow-md` / `shadow-lg` | `--shadow-low` / `med` / `high` |
Spacing references `var(--spacing-1)` as the base unit, so `p-4` = 16px, matching Astryx's `--spacing-4`. Arbitrary values still work as an escape hatch: `bg-[var(--color-background-surface)]`.
diff --git a/packages/core/src/Avatar/AvatarStatusDot.spec.md b/packages/core/src/Avatar/AvatarStatusDot.spec.md
index 2b2d378a98..4e202d1434 100644
--- a/packages/core/src/Avatar/AvatarStatusDot.spec.md
+++ b/packages/core/src/Avatar/AvatarStatusDot.spec.md
@@ -43,7 +43,7 @@ system_specs: [spec:AST-002, spec:AST-009, spec:AST-038]
| Behavior | The dot sizes itself from the owning Avatar in three tiers, pairs each built-in variant with a distinct shape, and reports its label to Avatar. |
| End-user impact | Screen-reader users hear the status in the avatar's name; sighted users can tell statuses apart by shape as well as color. |
| Builder impact | None; the record describes shipped behavior. |
-| Compatibility/readiness | Released behavior recorded as current; no API, default, or output changes. Two implementation gaps are listed under Current-state impact. |
+| Compatibility/readiness | Released behavior recorded as current; no API, default, or output changes. One implementation gap is listed under Current-state impact. |
| Review checks | Reject a built-in variant that differs only by color, an exposed glyph or icon, or a label that stops reaching the owning Avatar. |
| Governing rules | `architecture:component-theming-surface/INV2,INV6,INV14`; `architecture:public-component-api/INV5,INV6,INV8`; WCAG 2.2 1.4.1. |
@@ -74,9 +74,6 @@ Consumer migration instructions belong in consumer docs and release notes.
the icon, and nothing paints a theme-independent baseline.
`architecture:component-theming-surface` INV14 requires an extensible visual
axis to have a safe theme-independent baseline.
-- **Base status tokens (FR2).** `architecture:theme-tokens` INV11 has
- components choose the surface-specific status role; the `success` and `error`
- plates paint the base `--color-success` and `--color-error` tokens.
## Ownership boundary
@@ -110,7 +107,7 @@ Consumer syntax remains in `AvatarStatusDot.doc.mjs`.
| ID | Invariant | Basis |
| --- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------- |
| FR1 | Avatar sizes up to 36px resolve a 10px dot with a 1px border and no custom icon; 40–72px resolve a 20px dot, 2px border, and 12px icon; 96px and above resolve a 32px dot, 4px border, and 18px icon. The border is the surface color. Outside an Avatar in the same layer (`spec:AST-038` FR7, FR8) the dot uses the 36px tier. | Current source, tests, and stories |
-| FR2 | `success` paints a filled `--color-success` plate with no inner glyph; `neutral` paints a surface plate with a ring in secondary text color; `error` paints a `--color-error` plate with a minus bar in the surface color. Glyphs are stroked in `currentColor` at 1, 1.5, or 2px by tier; the minus spans 75% of the inner field with round caps. Status fills use the surface-specific status roles (`architecture:theme-tokens` INV11). Implementation gap: the `success` and `error` plates use the base status tokens (Current-state impact). | Current source, tests, and consumer docs |
+| FR2 | `success` paints a filled `--color-success` plate with no inner glyph; `neutral` paints a surface plate with a ring in secondary text color; `error` paints a `--color-error` plate with a minus bar in `--color-on-error`, and `success` sets `--color-on-success` as its ink. Glyphs are stroked in `currentColor` at 1, 1.5, or 2px by tier; the minus spans 75% of the inner field with round caps. The plates are the strong status fills and their ink is the matching content role (`architecture:theme-tokens` INV11). | Current source, tests, and consumer docs |
| FR3 | At medium and large tiers, renderable `icon` content replaces the built-in glyph and is centered in an assistive-technology-hidden wrapper sized to the tier's icon size. At the small tier the icon is omitted and the built-in glyph remains. Booleans and empty strings are not renderable. | Current source and tests |
| FR4 | A non-empty `label` adds `role="img"` and `aria-label` to the dot. The dot reports the same label to the owning Avatar before paint, at any wrapper depth, and withdraws it when it unmounts. | Current source and Avatar integration tests |
| FR5 | The root carries `avatar-status-dot` with `variant`; ring and minus SVGs carry `avatar-status-dot-glyph` with `shape`. Supported consumer props and ref reach the root; the dot's own role, name, and styling apply after caller props, and `xstyle`, `className`, and `style` merge in that order. | Current source, docs, and target tests |
diff --git a/packages/core/src/Avatar/AvatarStatusDot.test.tsx b/packages/core/src/Avatar/AvatarStatusDot.test.tsx
index fad8a7268d..a1b0e6c2ca 100644
--- a/packages/core/src/Avatar/AvatarStatusDot.test.tsx
+++ b/packages/core/src/Avatar/AvatarStatusDot.test.tsx
@@ -198,6 +198,28 @@ describe('AvatarStatusDot', () => {
}
});
+ it('uses each filled status plate matching on-fill ink role', () => {
+ const probe = stylex.create({
+ successInk: {color: colorVars['--color-on-success']},
+ errorInk: {color: colorVars['--color-on-error']},
+ });
+ const cases = [
+ ['success', probe.successInk],
+ ['error', probe.errorInk],
+ ] as const;
+
+ for (const [variant, ink] of cases) {
+ const inkClasses = (stylex.props(ink).className ?? '')
+ .split(' ')
+ .filter(cls => !cls.includes('__'));
+ expect(inkClasses.length).toBeGreaterThan(0);
+ const dot = renderDot({variant}, 48);
+ for (const cls of inkClasses) {
+ expect(dot.className).toContain(cls);
+ }
+ }
+ });
+
it('lets a user icon inherit the dot ink instead of hard-coding surface', () => {
// Surface ink on the surface-filled ring variant would be invisible.
const probe = stylex.create({
diff --git a/packages/core/src/Avatar/AvatarStatusDot.tsx b/packages/core/src/Avatar/AvatarStatusDot.tsx
index 855e039763..8f4177c298 100644
--- a/packages/core/src/Avatar/AvatarStatusDot.tsx
+++ b/packages/core/src/Avatar/AvatarStatusDot.tsx
@@ -137,7 +137,7 @@ const styles = stylex.create({
// `currentColor`, so the two can never drift out of contrast.
success: {
backgroundColor: colorVars['--color-success'],
- color: colorVars['--color-background-surface'],
+ color: colorVars['--color-on-success'],
},
// The ring variant inverts: a hollow shape only reads as hollow if its
// interior is not the variant colour, so the plate is surface and the
@@ -149,7 +149,7 @@ const styles = stylex.create({
},
error: {
backgroundColor: colorVars['--color-error'],
- color: colorVars['--color-background-surface'],
+ color: colorVars['--color-on-error'],
},
icon: {
display: 'flex',
diff --git a/packages/core/src/Badge/Badge.spec.md b/packages/core/src/Badge/Badge.spec.md
index 4370b310ab..5c961292e9 100644
--- a/packages/core/src/Badge/Badge.spec.md
+++ b/packages/core/src/Badge/Badge.spec.md
@@ -104,7 +104,7 @@ Consumer migration instructions belong in consumer docs and release notes.
| FR2 | When `icon` is supplied it renders directly inside the root, before the Label container, separated by `--spacing-1`; the label always renders inside its own Label container. | Current source and tests |
| FR3 | The badge is one line and never wraps. The root is capped at the inline size of its container and may shrink below its content size; a label that does not fit is clipped with a trailing ellipsis inside the Label container and does not escape the badge. | Current source and consumer docs |
| FR4 | A non-empty string label or any number label sets the root `title` to the label text, whether or not the label is clipped. A rich-node or empty-string label sets no `title`. | Current source and tests |
-| FR5 | `variant` defaults to `neutral`. `neutral` paints `--color-neutral` with primary text; `info`, `success`, `warning`, and `error` paint the solid accent, success, warning, and error colors with their matching on-color text; each color variant paints its tinted background with its matching colored text. | Current source and consumer docs |
+| FR5 | `variant` defaults to `neutral`. `neutral` paints `--color-neutral` with primary text; `info`, `success`, `warning`, and `error` paint their strong status fills (`--color-<status>`) with their matching `--color-on-<status>` text and keep a `CanvasText` outline in forced colors; each color variant paints its tinted background with its matching colored text. | Current source and consumer docs |
| FR6 | The `badge` target carries the resolved `variant` for every value, including a value a theme adds through `BadgeVariantMap`. A theme-added value receives no component fill or text color, so it renders the FR1 geometry over a transparent background in the inherited text color until a theme paints it. | Current source and extensible-axis test |
| FR7 | `ref` reaches the root `span`. Supported DOM, ARIA, data, and event props reach the root; `xstyle`, `className`, and `style` merge in that order after the component styles. | Current source and tests |
| FR8 | Badge uses no hooks, measurement, or client-only API, so it renders identically on the server and the client. | Current source and server-safety test |
diff --git a/packages/core/src/Badge/Badge.test.tsx b/packages/core/src/Badge/Badge.test.tsx
index f851a1bbd3..21f287ca82 100644
--- a/packages/core/src/Badge/Badge.test.tsx
+++ b/packages/core/src/Badge/Badge.test.tsx
@@ -3,6 +3,7 @@
import {describe, it, expect} from 'vitest';
import {render, screen} from '@testing-library/react';
import {Badge} from './Badge';
+import {getForcedColorsRules} from '../__tests__/forcedColors';
describe('Badge', () => {
it('renders with default variant', () => {
@@ -110,3 +111,15 @@ describe('Badge', () => {
expect(root).toHaveAttribute('data-variant', 'success');
});
});
+
+// jsdom cannot emulate forced colors, so this asserts the compiled rule the
+// status fill relies on (architecture:theme-tokens INV11): the fill becomes
+// Canvas, and a CanvasText boundary keeps its shape.
+describe('Badge forced colors', () => {
+ it('keeps a visible boundary on the status fill', () => {
+ render(<Badge variant="error" label="Failed" />);
+ const css = getForcedColorsRules();
+ expect(css).toContain('outline-style: solid;');
+ expect(css).toContain('outline-color: canvastext;');
+ });
+});
diff --git a/packages/core/src/Badge/Badge.tsx b/packages/core/src/Badge/Badge.tsx
index 50c9076903..c6e109aa7b 100644
--- a/packages/core/src/Badge/Badge.tsx
+++ b/packages/core/src/Badge/Badge.tsx
@@ -78,20 +78,56 @@ const variants = stylex.create({
color: colorVars['--color-text-primary'],
},
info: {
- backgroundColor: colorVars['--color-accent'],
- color: colorVars['--color-on-accent'],
+ backgroundColor: colorVars['--color-info'],
+ color: colorVars['--color-on-info'],
+ // Forced colors replace status fills with Canvas; this boundary keeps the
+ // fill's shape visible (architecture:theme-tokens INV11).
+ outlineWidth: {default: null, '@media (forced-colors: active)': '1px'},
+ outlineStyle: {default: null, '@media (forced-colors: active)': 'solid'},
+ outlineColor: {
+ default: null,
+ '@media (forced-colors: active)': 'CanvasText',
+ },
+ outlineOffset: {default: null, '@media (forced-colors: active)': '-1px'},
},
success: {
backgroundColor: colorVars['--color-success'],
color: colorVars['--color-on-success'],
+ // Forced colors replace status fills with Canvas; this boundary keeps the
+ // fill's shape visible (architecture:theme-tokens INV11).
+ outlineWidth: {default: null, '@media (forced-colors: active)': '1px'},
+ outlineStyle: {default: null, '@media (forced-colors: active)': 'solid'},
+ outlineColor: {
+ default: null,
+ '@media (forced-colors: active)': 'CanvasText',
+ },
+ outlineOffset: {default: null, '@media (forced-colors: active)': '-1px'},
},
warning: {
backgroundColor: colorVars['--color-warning'],
color: colorVars['--color-on-warning'],
+ // Forced colors replace status fills with Canvas; this boundary keeps the
+ // fill's shape visible (architecture:theme-tokens INV11).
+ outlineWidth: {default: null, '@media (forced-colors: active)': '1px'},
+ outlineStyle: {default: null, '@media (forced-colors: active)': 'solid'},
+ outlineColor: {
+ default: null,
+ '@media (forced-colors: active)': 'CanvasText',
+ },
+ outlineOffset: {default: null, '@media (forced-colors: active)': '-1px'},
},
error: {
backgroundColor: colorVars['--color-error'],
color: colorVars['--color-on-error'],
+ // Forced colors replace status fills with Canvas; this boundary keeps the
+ // fill's shape visible (architecture:theme-tokens INV11).
+ outlineWidth: {default: null, '@media (forced-colors: active)': '1px'},
+ outlineStyle: {default: null, '@media (forced-colors: active)': 'solid'},
+ outlineColor: {
+ default: null,
+ '@media (forced-colors: active)': 'CanvasText',
+ },
+ outlineOffset: {default: null, '@media (forced-colors: active)': '-1px'},
},
// Non-semantic color variants — tinted backgrounds with colored text
blue: {
diff --git a/packages/core/src/Banner/Banner.spec.md b/packages/core/src/Banner/Banner.spec.md
index 8b7a398ab3..57118b806d 100644
--- a/packages/core/src/Banner/Banner.spec.md
+++ b/packages/core/src/Banner/Banner.spec.md
@@ -40,7 +40,7 @@ separately targetable surface. The status and content targets remain unchanged.
## Compatibility and migration
- Released default preserved: `no` — Banner no longer derives a live-region role from visual status
-- Compatibility class: breaking accessibility-semantic correction for the live-region change (DEP-0007), whose visual output, DOM structure, props, theming targets, and interaction behavior are unchanged. FR9's accepted target is a visual change: the Info status surface fills with `--color-info-muted` and built-in content takes the on-muted roles; props, DOM structure, and theming targets stay the same
+- Compatibility class: breaking accessibility-semantic correction for the live-region change (DEP-0007), whose visual output, DOM structure, props, theming targets, and interaction behavior are unchanged. FR9 is a visual change: the Info status surface fills with `--color-info-muted` and built-in content takes the on-muted roles; props, DOM structure, and theming targets stay the same
- Controlled/uncontrolled behavior: unchanged
- Migration decision: announce async outcomes in their transition handler with `useAnnounce`; add an explicit `role="status"` only for a persistent semantic mirror, and reserve `role="alert"` for genuinely urgent interruption. Inside a mounted live container, `spec:AST-086` FR4 applies instead.
@@ -85,7 +85,7 @@ Consumer migration instructions belong in consumer docs and release notes.
- The Banner frame that groups both surfaces and carries the current whole-banner
elevation and elevated-card silhouette.
- The semantic foreground context for Banner-authored title, description, icon,
- collapse, and dismiss content on the status surface, as FR9's accepted target.
+ collapse, and dismiss content on the status surface.
Built-in controls receive that context on their Button element only, so their
tooltip remains an ordinary Button surface.
@@ -107,8 +107,8 @@ prop vocabulary or extensibility rule changes.
## Behavioral and layout contract
-The requirements below describe the current implementation, its additive
-frame target contract, and FR9's accepted status-colour target.
+The requirements below describe the current implementation and its additive
+frame target contract.
| ID | Invariant | Basis | Contract state |
| --- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------- | ------------------------ |
@@ -120,7 +120,7 @@ frame target contract, and FR9's accepted status-colour target.
| FR6 | The Banner frame exposes `banner-frame` and reflects `container` and `elevation`. The existing `banner` target remains on the Status surface rather than moving to the outermost DOM element. | Owner decision; current source and tests | Current behavior |
| FR7 | `banner-frame` is additive. The existing `banner`, `banner-icon`, `banner-description`, and `banner-content` targets and their current axes remain unchanged. | Current target inventory; compatibility policy | Current behavior |
| FR8 | `status` controls visual meaning only and MUST NOT derive `role`, `aria-live`, or an announcement. Standard DOM props MAY provide an explicit persistent role, except on a Banner added inside a mounted live container (`spec:AST-086` FR4). Async outcomes MUST announce from the transition handler through `useAnnounce`, except inside a mounted live container, where `spec:AST-086` FR4 applies; `role="alert"` is reserved for genuinely urgent interruptive content. | Accessibility Checklist §Announcements; owner decision | Current behavior |
-| FR9 | The status surface fills with the matching `--color-<status>-muted` role (`--color-info-muted` for Info) and paints its built-in title, description, icon, collapse, and dismiss content with the matching `--color-on-<status>-muted` role. Banner supplies that semantic foreground context to each built-in Button element without changing Button-owned geometry or interaction layers; a sibling tooltip keeps Button's ordinary theme color. Consumer-provided `endContent` remains untouched. | Status-role architecture; Banner and Button source/tests | Accepted target |
+| FR9 | The status surface fills with the matching `--color-<status>-muted` role (`--color-info-muted` for Info) and paints its built-in title, description, icon, collapse, and dismiss content with the matching `--color-on-<status>-muted` role. Banner supplies that semantic foreground context to each built-in Button element without changing Button-owned geometry or interaction layers; a sibling tooltip keeps Button's ordinary theme color. Consumer-provided `endContent` remains untouched. | Status-role architecture; Banner and Button source/tests | Current behavior |
### Allowed variation
@@ -175,12 +175,12 @@ unchanged.
## Design relationships
-| Anatomy or state | Design requirement | Representation authority | Hierarchy role | Component contract |
-| ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------- | -------------- | ------------------ |
-| Banner frame | Groups the status and optional content surfaces and carries their shared silhouette and elevation. | Current source and public docs | Supporting | FR2, FR3, FR4 |
-| Status surface | Acts as Banner's primary painted surface, carrying the status fill, message, and controls. | Current source and public docs | Prominent | FR1 |
-| Content surface | Carries optional supporting detail below the status surface. | Current source and public docs | Supporting | FR4, FR7 |
-| Action/dismiss controls | FR9's accepted target: built-in control content receives the Status surface's on-muted foreground on the Button element; interaction layers and tooltips remain Button-owned. Consumer-supplied `endContent` is unchanged. | Banner status context plus `component:Button` | Supporting | FR7, FR9 |
+| Anatomy or state | Design requirement | Representation authority | Hierarchy role | Component contract |
+| ----------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------- | -------------- | ------------------ |
+| Banner frame | Groups the status and optional content surfaces and carries their shared silhouette and elevation. | Current source and public docs | Supporting | FR2, FR3, FR4 |
+| Status surface | Acts as Banner's primary painted surface, carrying the status fill, message, and controls. | Current source and public docs | Prominent | FR1 |
+| Content surface | Carries optional supporting detail below the status surface. | Current source and public docs | Supporting | FR4, FR7 |
+| Action/dismiss controls | Built-in control content receives the Status surface's on-muted foreground on the Button element; interaction layers and tooltips remain Button-owned. Consumer-supplied `endContent` is unchanged. | Banner status context plus `component:Button` | Supporting | FR7, FR9 |
The Banner frame is stable anatomy and owns the additive `banner-frame` target.
The Status surface remains Banner's primary painted surface and keeps the
@@ -211,7 +211,7 @@ This map records runtime reachability. `banner` belongs to the primary Status
surface rather than the outermost DOM element, while `banner-frame` belongs to
the visible frame that owns whole-banner elevation and silhouette. Delegation to
Button preserves each built-in control's anatomy and interaction ownership.
-Under FR9's accepted target, Banner supplies only the status-surface foreground
+Banner supplies only the status-surface foreground
context on the Button element, and it does not restyle a consumer-provided
`endContent` child.
diff --git a/packages/core/src/Banner/Banner.test.tsx b/packages/core/src/Banner/Banner.test.tsx
index 96730e0020..3a164a215a 100644
--- a/packages/core/src/Banner/Banner.test.tsx
+++ b/packages/core/src/Banner/Banner.test.tsx
@@ -4,9 +4,10 @@
* @file Banner.test.tsx
* @input Uses vitest, @testing-library/react, Banner component
* @output Unit tests for Banner component behavior, including default and
- * explicit live-region roles, the 'banner-frame' theme target on the outer
- * elevation/radius painter, and the 'banner-icon' theme target on the status
- * icon glyph (#4166)
+ * explicit live-region roles, augmented-status color fallback, scoped status
+ * control context that does not recolor tooltips, the 'banner-frame' theme
+ * target on the outer elevation/radius painter, and the 'banner-icon' theme
+ * target on the status icon glyph (#4166)
* @position Testing; validates Banner.tsx implementation
*
* SYNC: When modified, update this header
@@ -15,10 +16,11 @@
import {describe, it, expect, vi, afterEach} from 'vitest';
import {render, screen} from '@testing-library/react';
import userEvent from '@testing-library/user-event';
-import {Banner} from './Banner';
+import {Banner, type BannerStatus} from './Banner';
import {defineTheme, generateThemeCSS} from '../theme';
import {registerIcons, resetIcons} from '../Icon';
import {InternationalizationProvider} from '../i18n';
+import {getForcedColorsRules} from '../__tests__/forcedColors';
describe('Banner', () => {
afterEach(() => {
@@ -101,6 +103,71 @@ describe('Banner', () => {
expect(screen.queryByText('This is a description')).not.toBeInTheDocument();
});
+ it('keeps base title and description colors for an augmented status', () => {
+ const augmentedStatus = 'neutral' as unknown as BannerStatus;
+ const {rerender} = render(
+ <Banner
+ status={augmentedStatus}
+ title="Neutral title"
+ description="Neutral description"
+ />,
+ );
+
+ const customTitleClass = screen.getByText('Neutral title').className;
+ const customDescriptionClass = screen.getByText(
+ 'Neutral description',
+ ).className;
+
+ rerender(
+ <Banner
+ status="info"
+ title="Info title"
+ description="Info description"
+ />,
+ );
+
+ expect(screen.getByText('Info title').className).not.toBe(customTitleClass);
+ expect(screen.getByText('Info description').className).not.toBe(
+ customDescriptionClass,
+ );
+ });
+
+ it.each([
+ ['info', 'var(--color-on-info-muted)'],
+ ['success', 'var(--color-on-success-muted)'],
+ ['warning', 'var(--color-on-warning-muted)'],
+ ['error', 'var(--color-on-error-muted)'],
+ ] as const)(
+ 'routes %s built-in controls to the matching on-muted role without recoloring tooltips',
+ (status, expectedRole) => {
+ render(
+ <Banner
+ status={status}
+ title={`${status} banner`}
+ collapsible={{defaultIsOpen: true}}
+ isDismissable>
+ <div>Details</div>
+ </Banner>,
+ );
+
+ for (const button of [
+ screen.getByRole('button', {name: 'Collapse'}),
+ screen.getByRole('button', {name: `Dismiss ${status} banner`}),
+ ]) {
+ expect(
+ getComputedStyle(button).getPropertyValue('--color-text-primary'),
+ ).toBe(expectedRole);
+ const tooltip = document.getElementById(
+ button.getAttribute('aria-describedby')!,
+ );
+ expect(tooltip).not.toBeNull();
+ expect(
+ getComputedStyle(tooltip!).getPropertyValue('--color-text-primary'),
+ ).not.toBe(expectedRole);
+ }
+ },
+ );
+
it('renders dismiss button when isDismissable', () => {
render(<Banner status="info" title="Dismissable" isDismissable />);
expect(
@@ -162,10 +229,10 @@ describe('Banner', () => {
expect(screen.queryByRole('button', {name: /^Dismiss/})).toBeNull();
});
- it('renders endContent', () => {
+ it('leaves consumer endContent outside the built-in status control context', () => {
render(
<Banner
- status="info"
+ status="success"
title="With Action"
endContent={
<button type="button" data-testid="end-btn">
@@ -174,7 +241,11 @@ describe('Banner', () => {
}
/>,
);
- expect(screen.getByTestId('end-btn')).toBeInTheDocument();
+ const action = screen.getByTestId('end-btn');
+ expect(action).toBeInTheDocument();
+ expect(action.className).not.toContain(
+ 'Banner__statusControlStyles.success',
+ );
});
it('renders card container by default', () => {
@@ -462,7 +533,7 @@ describe('Banner', () => {
const target = container.querySelector(
'.astryx-banner-icon[data-status="info"]',
);
- expect(target).toHaveAttribute('data-color', 'accent');
+ expect(target).toHaveAttribute('data-color', 'inherit');
});
it("keeps the 'banner-icon' target on the wrapper for a custom icon node", () => {
@@ -775,3 +846,15 @@ describe('Banner', () => {
});
});
});
+
+// jsdom cannot emulate forced colors, so this asserts the compiled rule the
+// status fill relies on (architecture:theme-tokens INV11): the fill becomes
+// Canvas, and a CanvasText boundary keeps its shape.
+describe('Banner forced colors', () => {
+ it('keeps a visible boundary on the status fill', () => {
+ render(<Banner status="error" title="Upload failed" />);
+ const css = getForcedColorsRules();
+ expect(css).toContain('outline-style: solid;');
+ expect(css).toContain('outline-color: canvastext;');
+ });
+});
diff --git a/packages/core/src/Banner/Banner.tsx b/packages/core/src/Banner/Banner.tsx
index 39f21b0fb8..1802decf14 100644
--- a/packages/core/src/Banner/Banner.tsx
+++ b/packages/core/src/Banner/Banner.tsx
@@ -208,10 +208,10 @@ const defaultIconNames: Partial<Record<BannerStatus, IconName>> = {
};
const statusIconColor: Partial<Record<BannerStatus, IconColor>> = {
- info: 'accent',
- warning: 'warning',
- error: 'error',
- success: 'success',
+ info: 'inherit',
+ warning: 'inherit',
+ error: 'inherit',
+ success: 'inherit',
};
// =============================================================================
@@ -295,6 +295,12 @@ const styles = stylex.create({
color: colorVars['--color-text-secondary'],
overflowWrap: 'anywhere',
},
+ // Built-in status title, description, and icon inherit the header's on-muted
+ // color. Built-in controls receive the same context on their Button element
+ // only, so the sibling tooltip bubble keeps the theme's ordinary text color.
+ statusForeground: {
+ color: 'inherit',
+ },
iconWrapper: {
display: 'flex',
alignItems: 'center',
@@ -349,16 +355,73 @@ const styles = stylex.create({
const statusStyles = stylex.create({
info: {
- backgroundColor: colorVars['--color-accent-muted'],
+ backgroundColor: colorVars['--color-info-muted'],
+ color: colorVars['--color-on-info-muted'],
+ // Forced colors replace status fills with Canvas; this boundary keeps the
+ // fill's shape visible (architecture:theme-tokens INV11).
+ outlineWidth: {default: null, '@media (forced-colors: active)': '1px'},
+ outlineStyle: {default: null, '@media (forced-colors: active)': 'solid'},
+ outlineColor: {
+ default: null,
+ '@media (forced-colors: active)': 'CanvasText',
+ },
+ outlineOffset: {default: null, '@media (forced-colors: active)': '-1px'},
},
warning: {
backgroundColor: colorVars['--color-warning-muted'],
+ color: colorVars['--color-on-warning-muted'],
+ // Forced colors replace status fills with Canvas; this boundary keeps the
+ // fill's shape visible (architecture:theme-tokens INV11).
+ outlineWidth: {default: null, '@media (forced-colors: active)': '1px'},
+ outlineStyle: {default: null, '@media (forced-colors: active)': 'solid'},
+ outlineColor: {
+ default: null,
+ '@media (forced-colors: active)': 'CanvasText',
+ },
+ outlineOffset: {default: null, '@media (forced-colors: active)': '-1px'},
},
error: {
backgroundColor: colorVars['--color-error-muted'],
+ color: colorVars['--color-on-error-muted'],
+ // Forced colors replace status fills with Canvas; this boundary keeps the
+ // fill's shape visible (architecture:theme-tokens INV11).
+ outlineWidth: {default: null, '@media (forced-colors: active)': '1px'},
+ outlineStyle: {default: null, '@media (forced-colors: active)': 'solid'},
+ outlineColor: {
+ default: null,
+ '@media (forced-colors: active)': 'CanvasText',
+ },
+ outlineOffset: {default: null, '@media (forced-colors: active)': '-1px'},
},
success: {
backgroundColor: colorVars['--color-success-muted'],
+ color: colorVars['--color-on-success-muted'],
+ // Forced colors replace status fills with Canvas; this boundary keeps the
+ // fill's shape visible (architecture:theme-tokens INV11).
+ outlineWidth: {default: null, '@media (forced-colors: active)': '1px'},
+ outlineStyle: {default: null, '@media (forced-colors: active)': 'solid'},
+ outlineColor: {
+ default: null,
+ '@media (forced-colors: active)': 'CanvasText',
+ },
+ outlineOffset: {default: null, '@media (forced-colors: active)': '-1px'},
+ },
+});
+
+// Scope status text context to each built-in Button. Its tooltip is a sibling,
+// so it does not inherit these control-only variables.
+const statusControlStyles = stylex.create({
+ info: {
+ '--color-text-primary': colorVars['--color-on-info-muted'],
+ },
+ warning: {
+ '--color-text-primary': colorVars['--color-on-warning-muted'],
+ },
+ error: {
+ '--color-text-primary': colorVars['--color-on-error-muted'],
+ },
+ success: {
+ '--color-text-primary': colorVars['--color-on-success-muted'],
},
});
@@ -628,12 +691,21 @@ export function Banner({
styles.headerContent,
isRenderable(endContent) && styles.headerContentWithEndContent,
)}>
- <div {...stylex.props(styles.title)}>{title}</div>
+ <div
+ {...stylex.props(
+ styles.title,
+ hasStatusStyle(status) && styles.statusForeground,
+ )}>
+ {title}
+ </div>
{isRenderable(description) && (
<div
{...mergeProps(
themeProps('banner-description'),
- stylex.props(styles.description),
+ stylex.props(
+ styles.description,
+ hasStatusStyle(status) && styles.statusForeground,
+ ),
)}>
{description}
</div>
@@ -672,6 +744,11 @@ export function Banner({
/>
}
onClick={handleToggleExpand}
+ className={
+ hasStatusStyle(status)
+ ? stylex.props(statusControlStyles[status]).className
+ : undefined
+ }
aria-expanded={isExpanded}
aria-controls={showContent ? contentId : undefined}
isIconOnly
@@ -685,6 +762,11 @@ export function Banner({
tooltip={dismissTooltip}
icon={<Icon icon="close" size="sm" color="inherit" />}
onClick={handleDismiss}
+ className={
+ hasStatusStyle(status)
+ ? stylex.props(statusControlStyles[status]).className
+ : undefined
+ }
isIconOnly
/>
)}
diff --git a/packages/core/src/Button/Button.tsx b/packages/core/src/Button/Button.tsx
index a97ec12d63..0d470d42b6 100644
--- a/packages/core/src/Button/Button.tsx
+++ b/packages/core/src/Button/Button.tsx
@@ -240,10 +240,22 @@ const variants = stylex.create({
destructive: {
backgroundColor: colorVars['--color-error'],
color: colorVars['--color-on-error'],
+ // Forced colors replace the fill with ButtonFace; a border keeps the
+ // destructive fill's shape visible (architecture:theme-tokens INV11). A
+ // border, not an outline, leaves the shared focus ring intact.
+ borderWidth: {default: 0, '@media (forced-colors: active)': '1px'},
+ borderStyle: {default: 'none', '@media (forced-colors: active)': 'solid'},
+ borderColor: {
+ default: null,
+ '@media (forced-colors: active)': 'CanvasText',
+ },
// The ring matches the variant it rings: an accent-colored outline on a
// red button reads as another control's focus. Only the color differs —
// width, style and offset come from the shared outline.
- outlineColor: {default: null, ':focus-visible': colorVars['--color-error']},
+ outlineColor: {
+ default: null,
+ ':focus-visible': colorVars['--color-error'],
+ },
},
});
diff --git a/packages/core/src/Chat/ChatComposer.tsx b/packages/core/src/Chat/ChatComposer.tsx
index a2e106e7ca..f89ef73ee9 100644
--- a/packages/core/src/Chat/ChatComposer.tsx
+++ b/packages/core/src/Chat/ChatComposer.tsx
@@ -257,11 +257,29 @@ const styles = stylex.create({
},
statusError: {
backgroundColor: colorVars['--color-error-muted'],
- color: colorVars['--color-text-red'],
+ color: colorVars['--color-on-error-muted'],
+ // Forced colors replace status fills with Canvas; this boundary keeps the
+ // fill's shape visible (architecture:theme-tokens INV11).
+ outlineWidth: {default: null, '@media (forced-colors: active)': '1px'},
+ outlineStyle: {default: null, '@media (forced-colors: active)': 'solid'},
+ outlineColor: {
+ default: null,
+ '@media (forced-colors: active)': 'CanvasText',
+ },
+ outlineOffset: {default: null, '@media (forced-colors: active)': '-1px'},
},
statusWarning: {
backgroundColor: colorVars['--color-warning-muted'],
- color: colorVars['--color-text-yellow'],
+ color: colorVars['--color-on-warning-muted'],
+ // Forced colors replace status fills with Canvas; this boundary keeps the
+ // fill's shape visible (architecture:theme-tokens INV11).
+ outlineWidth: {default: null, '@media (forced-colors: active)': '1px'},
+ outlineStyle: {default: null, '@media (forced-colors: active)': 'solid'},
+ outlineColor: {
+ default: null,
+ '@media (forced-colors: active)': 'CanvasText',
+ },
+ outlineOffset: {default: null, '@media (forced-colors: active)': '-1px'},
},
compact: {
// Override the padding var (not the `padding` property) so both the base
@@ -485,7 +503,9 @@ export function ChatComposer(props: ChatComposerProps) {
<Icon
icon={status.type === 'error' ? 'error' : 'warning'}
size="md"
- color={status.type === 'error' ? 'error' : 'warning'}
+ // The glyph sits on the pale status fill, so it takes the bar's
+ // on-muted content colour, as Banner and FieldStatus glyphs do.
+ color="inherit"
/>
{status.message}
</div>
diff --git a/packages/core/src/Chat/ChatMessageMetadata.tsx b/packages/core/src/Chat/ChatMessageMetadata.tsx
index 9531dd1add..86ba588d81 100644
--- a/packages/core/src/Chat/ChatMessageMetadata.tsx
+++ b/packages/core/src/Chat/ChatMessageMetadata.tsx
@@ -70,7 +70,7 @@ const styles = stylex.create({
gap: spacingVars['--spacing-1'],
},
statusError: {
- color: colorVars['--color-error'],
+ color: colorVars['--color-text-error'],
},
statusPulse: {
animationName: pulseKeyframes,
diff --git a/packages/core/src/Chat/ChatToolCalls.tsx b/packages/core/src/Chat/ChatToolCalls.tsx
index a1d0e8d0ae..b3be4fd84e 100644
--- a/packages/core/src/Chat/ChatToolCalls.tsx
+++ b/packages/core/src/Chat/ChatToolCalls.tsx
@@ -277,13 +277,13 @@ const styles = stylex.create({
flexShrink: 0,
},
statsAdditions: {
- color: colorVars['--color-success'],
+ color: colorVars['--color-text-success'],
},
statsDeletions: {
- color: colorVars['--color-error'],
+ color: colorVars['--color-text-error'],
},
errorText: {
- color: colorVars['--color-error'],
+ color: colorVars['--color-text-error'],
},
// Inline result detail
@@ -337,8 +337,8 @@ const styles = stylex.create({
// Status colors
colorPending: {color: colorVars['--color-text-disabled']},
colorRunning: {color: colorVars['--color-accent']},
- colorComplete: {color: colorVars['--color-success']},
- colorError: {color: colorVars['--color-error']},
+ colorComplete: {color: colorVars['--color-icon-success']},
+ colorError: {color: colorVars['--color-icon-error']},
});
// =============================================================================
diff --git a/packages/core/src/DropdownMenu/DropdownMenuItem.tsx b/packages/core/src/DropdownMenu/DropdownMenuItem.tsx
index 2ec172ef08..89bef86c2e 100644
--- a/packages/core/src/DropdownMenu/DropdownMenuItem.tsx
+++ b/packages/core/src/DropdownMenu/DropdownMenuItem.tsx
@@ -90,11 +90,11 @@ const menuItemStyles = stylex.create({
destructive: {
// Only recolor the text/icon; the hover / focus background stays the shared
// neutral overlay from `root` so the hover state matches every other menu
- // item. The root color covers the label/description via the Item custom
- // properties (and any bare text). Semantic error tokens keep it theme-aware.
- color: colorVars['--color-error'],
- '--_item-label-color': colorVars['--color-error'],
- '--_item-description-color': colorVars['--color-error'],
+ // item. The semantic status foreground covers the label, description, icon,
+ // and any bare text on a plain surface.
+ color: colorVars['--color-text-error'],
+ '--_item-label-color': colorVars['--color-text-error'],
+ '--_item-description-color': colorVars['--color-text-error'],
},
});
diff --git a/packages/core/src/DropdownMenu/MenuBottomSheetActionList.tsx b/packages/core/src/DropdownMenu/MenuBottomSheetActionList.tsx
index df89ccf461..86f23e4123 100644
--- a/packages/core/src/DropdownMenu/MenuBottomSheetActionList.tsx
+++ b/packages/core/src/DropdownMenu/MenuBottomSheetActionList.tsx
@@ -33,9 +33,9 @@ const styles = stylex.create({
userSelect: 'none',
},
destructiveAction: {
- '--_item-label-color': colorVars['--color-error'],
- '--_item-description-color': colorVars['--color-error'],
- color: colorVars['--color-error'],
+ '--_item-label-color': colorVars['--color-text-error'],
+ '--_item-description-color': colorVars['--color-text-error'],
+ color: colorVars['--color-text-error'],
},
structuralItem: {
listStyleType: 'none',
diff --git a/packages/core/src/Field/inputStyles.stylex.ts b/packages/core/src/Field/inputStyles.stylex.ts
index ac011dc05e..5c225e5b66 100644
--- a/packages/core/src/Field/inputStyles.stylex.ts
+++ b/packages/core/src/Field/inputStyles.stylex.ts
@@ -79,13 +79,13 @@ export const inputWrapperStyles = stylex.create({
*/
export const inputStatusBorderStyles = stylex.create({
warning: {
- borderColor: colorVars['--color-warning'],
+ borderColor: colorVars['--color-border-warning'],
},
error: {
- borderColor: colorVars['--color-error'],
+ borderColor: colorVars['--color-border-error'],
},
success: {
- borderColor: colorVars['--color-success'],
+ borderColor: colorVars['--color-border-success'],
},
});
@@ -131,20 +131,20 @@ export const inputStatusHoverShadowStyles = stylex.create({
export const inputStatusFocusWithinStyles = stylex.create({
warning: {
borderColor: {
- default: colorVars['--color-warning'],
- ':focus-within': colorVars['--color-warning'],
+ default: colorVars['--color-border-warning'],
+ ':focus-within': colorVars['--color-border-warning'],
},
},
error: {
borderColor: {
- default: colorVars['--color-error'],
- ':focus-within': colorVars['--color-error'],
+ default: colorVars['--color-border-error'],
+ ':focus-within': colorVars['--color-border-error'],
},
},
success: {
borderColor: {
- default: colorVars['--color-success'],
- ':focus-within': colorVars['--color-success'],
+ default: colorVars['--color-border-success'],
+ ':focus-within': colorVars['--color-border-success'],
},
},
});
@@ -157,20 +157,20 @@ export const inputStatusFocusWithinStyles = stylex.create({
export const inputStatusFocusStyles = stylex.create({
warning: {
borderColor: {
- default: colorVars['--color-warning'],
- ':focus': colorVars['--color-warning'],
+ default: colorVars['--color-border-warning'],
+ ':focus': colorVars['--color-border-warning'],
},
},
error: {
borderColor: {
- default: colorVars['--color-error'],
- ':focus': colorVars['--color-error'],
+ default: colorVars['--color-border-error'],
+ ':focus': colorVars['--color-border-error'],
},
},
success: {
borderColor: {
- default: colorVars['--color-success'],
- ':focus': colorVars['--color-success'],
+ default: colorVars['--color-border-success'],
+ ':focus': colorVars['--color-border-success'],
},
},
});
diff --git a/packages/core/src/FieldStatus/FieldStatus.test.tsx b/packages/core/src/FieldStatus/FieldStatus.test.tsx
index e8b3650581..409118abd5 100644
--- a/packages/core/src/FieldStatus/FieldStatus.test.tsx
+++ b/packages/core/src/FieldStatus/FieldStatus.test.tsx
@@ -14,6 +14,7 @@ import {render, screen, waitFor} from '@testing-library/react';
import * as stylex from '@stylexjs/stylex';
import {FieldStatus} from './FieldStatus';
import {__resetLiveRegionsForTest} from '../hooks/useAnnounce';
+import {getForcedColorsRules} from '../__tests__/forcedColors';
const testStyles = stylex.create({
custom: {color: 'rebeccapurple'},
@@ -468,3 +469,14 @@ describe('FieldStatus', () => {
expect(FieldStatus.displayName).toBe('FieldStatus');
});
});
+
+// jsdom cannot emulate forced colors, so this asserts the compiled rule the
+// status fill relies on (architecture:theme-tokens INV11).
+describe('FieldStatus forced colors', () => {
+ it('keeps a visible boundary on the status fill', () => {
+ render(<FieldStatus type="error" message="Required" />);
+ const css = getForcedColorsRules();
+ expect(css).toContain('outline-style: solid;');
+ expect(css).toContain('outline-color: canvastext;');
+ });
+});
diff --git a/packages/core/src/FieldStatus/FieldStatus.tsx b/packages/core/src/FieldStatus/FieldStatus.tsx
index 2eda5ec918..bb15284ca8 100644
--- a/packages/core/src/FieldStatus/FieldStatus.tsx
+++ b/packages/core/src/FieldStatus/FieldStatus.tsx
@@ -51,6 +51,15 @@ const ATTACHED_OVERLAP = `var(--_field-status-overlap, ${spacingVars['--spacing-
const styles = stylex.create({
base: {
+ // Forced colors replace status fills with Canvas; this boundary keeps the
+ // fill's shape visible (architecture:theme-tokens INV11).
+ outlineWidth: {default: null, '@media (forced-colors: active)': '1px'},
+ outlineStyle: {default: null, '@media (forced-colors: active)': 'solid'},
+ outlineColor: {
+ default: null,
+ '@media (forced-colors: active)': 'CanvasText',
+ },
+ outlineOffset: {default: null, '@media (forced-colors: active)': '-1px'},
fontFamily: typographyVars['--font-family-body'],
fontSize: typeScaleVars['--text-supporting-size'],
lineHeight: typeScaleVars['--text-supporting-leading'],
@@ -91,15 +100,15 @@ const styles = stylex.create({
const colorStyles = stylex.create({
warning: {
backgroundColor: colorVars['--color-warning-muted'],
- color: colorVars['--color-text-yellow'],
+ color: colorVars['--color-on-warning-muted'],
},
error: {
backgroundColor: colorVars['--color-error-muted'],
- color: colorVars['--color-text-red'],
+ color: colorVars['--color-on-error-muted'],
},
success: {
backgroundColor: colorVars['--color-success-muted'],
- color: colorVars['--color-text-green'],
+ color: colorVars['--color-on-success-muted'],
},
});
diff --git a/packages/core/src/FileInput/FileInput.tsx b/packages/core/src/FileInput/FileInput.tsx
index 390a559cbb..574393f331 100644
--- a/packages/core/src/FileInput/FileInput.tsx
+++ b/packages/core/src/FileInput/FileInput.tsx
@@ -295,13 +295,13 @@ const styles = stylex.create({
const statusBorderStyles = stylex.create({
warning: {
- borderColor: colorVars['--color-warning'],
+ borderColor: colorVars['--color-border-warning'],
},
error: {
- borderColor: colorVars['--color-error'],
+ borderColor: colorVars['--color-border-error'],
},
success: {
- borderColor: colorVars['--color-success'],
+ borderColor: colorVars['--color-border-success'],
},
});
diff --git a/packages/core/src/Icon/Icon.doc.mjs b/packages/core/src/Icon/Icon.doc.mjs
index fc5c703c0f..f579342caf 100644
--- a/packages/core/src/Icon/Icon.doc.mjs
+++ b/packages/core/src/Icon/Icon.doc.mjs
@@ -78,7 +78,7 @@ export const docs = {
},
{
name: 'color',
- type: "'primary' | 'secondary' | 'tertiary' | 'disabled' | 'accent' | 'success' | 'error' | 'warning' | 'inherit'",
+ type: "'primary' | 'secondary' | 'tertiary' | 'disabled' | 'accent' | 'info' | 'success' | 'error' | 'warning' | 'inherit'",
description: 'Color variant mapped to Astryx icon color tokens.',
default: "'inherit'",
},
@@ -183,7 +183,7 @@ export const docsZh = {
},
{
name: 'color',
- type: "'primary' | 'secondary' | 'tertiary' | 'disabled' | 'accent' | 'success' | 'error' | 'warning' | 'inherit'",
+ type: "'primary' | 'secondary' | 'tertiary' | 'disabled' | 'accent' | 'info' | 'success' | 'error' | 'warning' | 'inherit'",
description: '映射到 Astryx 图标颜色令牌的颜色变体。',
default: "'inherit'",
},
diff --git a/packages/core/src/Icon/Icon.test.tsx b/packages/core/src/Icon/Icon.test.tsx
index d64c15630c..d08f9e512e 100644
--- a/packages/core/src/Icon/Icon.test.tsx
+++ b/packages/core/src/Icon/Icon.test.tsx
@@ -48,6 +48,9 @@ describe('Icon', () => {
rerender(<Icon icon={TestIcon} color="accent" data-testid="icon" />);
expect(screen.getByTestId('icon')).toBeInTheDocument();
+ rerender(<Icon icon={TestIcon} color="info" data-testid="icon" />);
+ expect(screen.getByTestId('icon')).toBeInTheDocument();
+
rerender(<Icon icon={TestIcon} color="success" data-testid="icon" />);
expect(screen.getByTestId('icon')).toBeInTheDocument();
diff --git a/packages/core/src/Icon/Icon.tsx b/packages/core/src/Icon/Icon.tsx
index 415054c4fb..ef1137c97d 100644
--- a/packages/core/src/Icon/Icon.tsx
+++ b/packages/core/src/Icon/Icon.tsx
@@ -73,14 +73,17 @@ const colorStyles = stylex.create({
accent: {
color: colorVars['--color-accent'],
},
+ info: {
+ color: colorVars['--color-icon-info'],
+ },
success: {
- color: colorVars['--color-success'],
+ color: colorVars['--color-icon-success'],
},
error: {
- color: colorVars['--color-error'],
+ color: colorVars['--color-icon-error'],
},
warning: {
- color: colorVars['--color-warning'],
+ color: colorVars['--color-icon-warning'],
},
inherit: {
color: 'inherit',
diff --git a/packages/core/src/Item/ItemSwipeLayer.tsx b/packages/core/src/Item/ItemSwipeLayer.tsx
index 22a05c0652..d778c43302 100644
--- a/packages/core/src/Item/ItemSwipeLayer.tsx
+++ b/packages/core/src/Item/ItemSwipeLayer.tsx
@@ -175,6 +175,15 @@ const swipeVariantStyles = stylex.create({
destructive: {
backgroundColor: colorVars['--color-error'],
color: colorVars['--color-on-error'],
+ // Forced colors replace the fill with Canvas; a border keeps the
+ // destructive fill's shape visible (architecture:theme-tokens INV11). A
+ // border, not an outline, leaves the shared focus ring intact.
+ borderWidth: {default: 0, '@media (forced-colors: active)': '1px'},
+ borderStyle: {default: 'none', '@media (forced-colors: active)': 'solid'},
+ borderColor: {
+ default: null,
+ '@media (forced-colors: active)': 'CanvasText',
+ },
},
});
diff --git a/packages/core/src/ProgressBar/ProgressBar.test.tsx b/packages/core/src/ProgressBar/ProgressBar.test.tsx
index 232c12ae7c..47476480c8 100644
--- a/packages/core/src/ProgressBar/ProgressBar.test.tsx
+++ b/packages/core/src/ProgressBar/ProgressBar.test.tsx
@@ -10,6 +10,7 @@
import {describe, it, expect, beforeAll} from 'vitest';
import {render, screen, waitFor} from '@testing-library/react';
import {ProgressBar} from './ProgressBar';
+import {getForcedColorsRules} from '../__tests__/forcedColors';
// A labeled mark wraps the tick in a lazily-loaded Tooltip (React.lazy +
// Suspense). Preload that chunk once so the Tooltip (and its
@@ -838,3 +839,14 @@ describe('ProgressBar theme target names', () => {
expect(container.querySelector('.astryx-progressbar-mark')).toBeNull();
});
});
+
+// jsdom cannot emulate forced colors, so this asserts the compiled rule the
+// status fill relies on (architecture:theme-tokens INV11).
+describe('ProgressBar forced colors', () => {
+ it('keeps a visible boundary on the status fill', () => {
+ render(<ProgressBar value={40} variant="error" label="Upload" />);
+ const css = getForcedColorsRules();
+ expect(css).toContain('outline-style: solid;');
+ expect(css).toContain('outline-color: canvastext;');
+ });
+});
diff --git a/packages/core/src/ProgressBar/ProgressBar.tsx b/packages/core/src/ProgressBar/ProgressBar.tsx
index 7588994aa3..50937fb663 100644
--- a/packages/core/src/ProgressBar/ProgressBar.tsx
+++ b/packages/core/src/ProgressBar/ProgressBar.tsx
@@ -237,6 +237,15 @@ const styles = stylex.create({
},
fill: {
height: '100%',
+ // Forced colors replace status fills with Canvas; this boundary keeps the
+ // fill's shape visible (architecture:theme-tokens INV11).
+ outlineWidth: {default: null, '@media (forced-colors: active)': '1px'},
+ outlineStyle: {default: null, '@media (forced-colors: active)': 'solid'},
+ outlineColor: {
+ default: null,
+ '@media (forced-colors: active)': 'CanvasText',
+ },
+ outlineOffset: {default: null, '@media (forced-colors: active)': '-1px'},
borderRadius: radiusVars['--radius-full'],
transitionProperty: 'width',
transitionDuration: durationVars['--duration-medium'],
@@ -244,6 +253,15 @@ const styles = stylex.create({
},
indeterminateFill: {
height: '100%',
+ // Forced colors replace status fills with Canvas; this boundary keeps the
+ // fill's shape visible (architecture:theme-tokens INV11).
+ outlineWidth: {default: null, '@media (forced-colors: active)': '1px'},
+ outlineStyle: {default: null, '@media (forced-colors: active)': 'solid'},
+ outlineColor: {
+ default: null,
+ '@media (forced-colors: active)': 'CanvasText',
+ },
+ outlineOffset: {default: null, '@media (forced-colors: active)': '-1px'},
width: '40%',
borderRadius: radiusVars['--radius-full'],
animationName: {
diff --git a/packages/core/src/StatusDot/StatusDot.spec.md b/packages/core/src/StatusDot/StatusDot.spec.md
index ff8acfe9ea..7b2414b4e5 100644
--- a/packages/core/src/StatusDot/StatusDot.spec.md
+++ b/packages/core/src/StatusDot/StatusDot.spec.md
@@ -41,7 +41,7 @@ system_specs: [spec:AST-009]
| Behavior | The dot is an image named by `label`; a renderable `icon` paints inside it in the variant's ink and is hidden from assistive technology; a tooltip is reachable by hover, touch, and keyboard (FR5). |
| End-user impact | Screen-reader users hear the status without hover; sighted users see a color signal, optionally pulsing and optionally carrying a non-color mark. |
| Builder impact | None; the record describes shipped behavior. |
-| Compatibility/readiness | Released behavior recorded as current; no API, default, or output changes. Three implementation gaps are listed under Current-state impact. |
+| Compatibility/readiness | Released behavior recorded as current; no API, default, or output changes. Three gaps are listed under Current-state impact. |
| Review checks | Reject a dot without an accessible name, a dot without a tooltip that adds its own tab stop, an icon exposed to assistive technology, a pulse that ignores reduced motion, or a second target. |
| Governing rules | `architecture:component-theming-surface/INV2,INV6,INV14`; `architecture:public-component-api/INV5,INV6,INV8`; `architecture:theme-tokens/INV11`; WCAG 2.2 2.1.1. |
@@ -75,14 +75,10 @@ Consumer migration instructions belong in consumer docs and release notes.
Tooltip attaches no focus trigger and sighted keyboard users cannot reveal
the tooltip text, where WCAG 2.2 2.1.1 expects functionality to be keyboard
operable. The accessible name still carries the status.
-- **Status plates and forced colors (FR2).** `architecture:theme-tokens` INV11
- assigns strong status fills `--color-<status>-emphasized` and a visible
- `CanvasText` border in forced-colors mode. The `success`, `warning`, and
- `error` plates paint the base `--color-success`, `--color-warning`, and
- `--color-error` tokens and draw no border, so in forced-colors mode they lose
- their plate and disappear. The `accent` and `neutral` dots disappear the same
- way; no current record sets their treatment (OQ1). The accessible name still
- carries the status.
+- **Accent and neutral dots in forced colors (FR2).** The `accent` and
+ `neutral` dots draw no border, so in forced-colors mode they lose their plate
+ and disappear; no current record sets their treatment (OQ1). The accessible
+ name still carries the status.
## Ownership boundary
@@ -116,14 +112,14 @@ Consumer migration instructions belong in consumer docs and release notes.
## Behavioral and layout contract
-| ID | Invariant | Basis |
-| --- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------ |
-| FR1 | StatusDot always renders one inline-flex `span` dot, 8 by 8 CSS pixels, fully rounded, that does not shrink in a flex row, carrying the `status-dot` target and only that target. | Current source and tests |
-| FR2 | `success`, `warning`, and `error` are strong status fills: under `architecture:theme-tokens` INV11 each paints `--color-<status>-emphasized` with `--color-on-<status>` ink and keeps a visible `CanvasText` border in forced-colors mode. `accent` paints `--color-accent` with `--color-on-accent` ink, and `neutral` paints `--color-icon-secondary` with the surface color as ink; these two are not INV11 status roles, and no current record sets their forced-colors treatment (OQ1). The target reflects `variant` for every value, and an extensible tone has a safe theme-independent baseline (`architecture:component-theming-surface` INV14). Implementation gaps: the status plates paint the base `--color-success`, `--color-warning`, and `--color-error` tokens with their on-color ink and draw no forced-colors border, and a theme-added value the active theme does not paint receives no component plate or ink, leaving a transparent 8px box (Current-state impact). | Current source and tests |
-| FR3 | `isPulsing` animates the dot's opacity from 1 to 0.5 and back over 2 seconds, ease-in-out, indefinitely; under `prefers-reduced-motion: reduce` the animation is removed and the dot rests. | Current source and tests |
-| FR4 | A renderable `icon` renders in a wrapper centered inside the dot and filling its 8px field; it paints from `currentColor`, the variant's ink. A non-renderable value leaves the dot childless. | Current source and tests |
-| FR5 | A non-empty `tooltip` wraps the dot in Tooltip with that text; otherwise no tooltip renders. A tooltip opens from the keyboard as well as on hover and touch (WCAG 2.2 2.1.1). Implementation gap: the dot has no tab stop, so the tooltip opens on hover and touch only (Current-state impact). | Current source and tests |
-| FR6 | `ref` reaches the dot. Supported DOM, ARIA, data, and event props reach the dot after its role and name; `xstyle`, `className`, and `style` merge in that order after component styles. | Current source and tests |
+| ID | Invariant | Basis |
+| --- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------ |
+| FR1 | StatusDot always renders one inline-flex `span` dot, 8 by 8 CSS pixels, fully rounded, that does not shrink in a flex row, carrying the `status-dot` target and only that target. | Current source and tests |
+| FR2 | `success`, `warning`, and `error` are strong status fills: under `architecture:theme-tokens` INV11 each paints `--color-<status>` with `--color-on-<status>` ink and keeps a visible `CanvasText` border in forced-colors mode. `accent` paints `--color-accent` with `--color-on-accent` ink, and `neutral` paints `--color-icon-secondary` with the surface color as ink; these two are not INV11 status roles, and no current record sets their forced-colors treatment (OQ1). The target reflects `variant` for every value, and an extensible tone has a safe theme-independent baseline (`architecture:component-theming-surface` INV14). Implementation gap: a theme-added value the active theme does not paint receives no component plate or ink, leaving a transparent 8px box (Current-state impact). | Current source and tests |
+| FR3 | `isPulsing` animates the dot's opacity from 1 to 0.5 and back over 2 seconds, ease-in-out, indefinitely; under `prefers-reduced-motion: reduce` the animation is removed and the dot rests. | Current source and tests |
+| FR4 | A renderable `icon` renders in a wrapper centered inside the dot and filling its 8px field; it paints from `currentColor`, the variant's ink. A non-renderable value leaves the dot childless. | Current source and tests |
+| FR5 | A non-empty `tooltip` wraps the dot in Tooltip with that text; otherwise no tooltip renders. A tooltip opens from the keyboard as well as on hover and touch (WCAG 2.2 2.1.1). Implementation gap: the dot has no tab stop, so the tooltip opens on hover and touch only (Current-state impact). | Current source and tests |
+| FR6 | `ref` reaches the dot. Supported DOM, ARIA, data, and event props reach the dot after its role and name; `xstyle`, `className`, and `style` merge in that order after component styles. | Current source and tests |
### Allowed variation
@@ -196,20 +192,20 @@ Consumer migration instructions belong in consumer docs and release notes.
- `architecture:public-component-api` owns ref, passthrough, and styling-input
rules; FR6 applies them to the dot.
- `architecture:theme-tokens` INV11 owns the status color roles and their
- forced-colors border; FR2 records StatusDot's gap against it.
+ forced-colors border, which FR2's status plates follow.
## Verification map
-| Contract | Verification | Representative states | Mutation or failure expectation | Audit section |
-| ------------------- | --------------------------------------------------------------------- | ------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------- |
-| FR1, FR6 | `StatusDot.test.tsx` render, ref, test-id, and target suites | Every tone | Removing the dot, a lost ref or test id, or a second target fails. Gap: the 8px size test asserts presence only, and no test fails if the styling order (ORD1) changes; size is visible in `StatusDot.stories.tsx`. | `audit:StatusDot/anatomy` |
-| FR2 | `StatusDot.test.tsx` variant-ink suite; `extensibleAxes.test.ts` | Warning plate and ink; map wiring | Dropping `variant` reflection fails. The warning-ink test pins the base `--color-warning` plate with `--color-on-warning` ink, which is the recorded gap rather than the INV11 role. Gap: other tones' paint, the unthemed fallback, and forced-colors rendering have no automated check. | `audit:StatusDot/theming` |
-| FR3, AR5 | `StatusDot.stories.tsx` in a browser, with and without reduced motion | Resting and pulsing | Gap: the pulsing unit tests assert presence only; a missing pulse or reduced-motion rule is visible only in the rendered fixture. | `audit:StatusDot/motion` |
-| FR4, AR3 | `StatusDot.test.tsx` custom-icon suite | Icon, falsy values | Exposing the icon or rendering a wrapper for a falsy value fails. | `audit:StatusDot/anatomy` |
-| FR5, AR1, AR2 | `StatusDot.test.tsx` focusability and accessible-name suites | Every tone, with and without tooltip | A missing name, a tab stop on a dot without a tooltip, or a name that depends on the tooltip fails. Gap: the tooltip test asserts only that the dot renders, so dropping the Tooltip wrap passes, and no test covers a caller `role` or `aria-label` override. | `audit:StatusDot/a11y` |
-| Theming anatomy map | `scripts/check-knowledge.mjs` | Canonical anatomy and current target | Missing, extra, prefixed, stale, or alias-backed mappings fail repository validation. | `audit:StatusDot/theming` |
-| AR4, PR1 | Source review; `StatusDot.stories.tsx` | Plain dot, dot with icon | Gap: no automated check covers the non-color mark guidance or fails if StatusDot adds its own listener, observer, or timer. | `audit:StatusDot/a11y` |
-| AR1, AR3 | Accessibility-tree evidence (`spec:AST-009` FR3) | Every tone, with icon and tooltip | Gap: no accessibility-tree check proves the image role and name or the hidden icon; the unit tests query the DOM. | `audit:StatusDot/a11y` |
+| Contract | Verification | Representative states | Mutation or failure expectation | Audit section |
+| ------------------- | --------------------------------------------------------------------- | ------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------- |
+| FR1, FR6 | `StatusDot.test.tsx` render, ref, test-id, and target suites | Every tone | Removing the dot, a lost ref or test id, or a second target fails. Gap: the 8px size test asserts presence only, and no test fails if the styling order (ORD1) changes; size is visible in `StatusDot.stories.tsx`. | `audit:StatusDot/anatomy` |
+| FR2 | `StatusDot.test.tsx` variant-ink suite; `extensibleAxes.test.ts` | Warning plate and ink; map wiring | Dropping `variant` reflection fails. The warning-ink test pins the `--color-warning` plate with `--color-on-warning` ink, and the forced-colors test asserts the compiled `CanvasText` outline. Gap: other tones' paint and the unthemed fallback have no automated check. | `audit:StatusDot/theming` |
+| FR3, AR5 | `StatusDot.stories.tsx` in a browser, with and without reduced motion | Resting and pulsing | Gap: the pulsing unit tests assert presence only; a missing pulse or reduced-motion rule is visible only in the rendered fixture. | `audit:StatusDot/motion` |
+| FR4, AR3 | `StatusDot.test.tsx` custom-icon suite | Icon, falsy values | Exposing the icon or rendering a wrapper for a falsy value fails. | `audit:StatusDot/anatomy` |
+| FR5, AR1, AR2 | `StatusDot.test.tsx` focusability and accessible-name suites | Every tone, with and without tooltip | A missing name, a tab stop on a dot without a tooltip, or a name that depends on the tooltip fails. Gap: the tooltip test asserts only that the dot renders, so dropping the Tooltip wrap passes, and no test covers a caller `role` or `aria-label` override. | `audit:StatusDot/a11y` |
+| Theming anatomy map | `scripts/check-knowledge.mjs` | Canonical anatomy and current target | Missing, extra, prefixed, stale, or alias-backed mappings fail repository validation. | `audit:StatusDot/theming` |
+| AR4, PR1 | Source review; `StatusDot.stories.tsx` | Plain dot, dot with icon | Gap: no automated check covers the non-color mark guidance or fails if StatusDot adds its own listener, observer, or timer. | `audit:StatusDot/a11y` |
+| AR1, AR3 | Accessibility-tree evidence (`spec:AST-009` FR3) | Every tone, with icon and tooltip | Gap: no accessibility-tree check proves the image role and name or the hidden icon; the unit tests query the DOM. | `audit:StatusDot/a11y` |
## Decision log
diff --git a/packages/core/src/StatusDot/StatusDot.test.tsx b/packages/core/src/StatusDot/StatusDot.test.tsx
index 3a9f7767f5..4f4de56f80 100644
--- a/packages/core/src/StatusDot/StatusDot.test.tsx
+++ b/packages/core/src/StatusDot/StatusDot.test.tsx
@@ -5,6 +5,7 @@ import {render, screen} from '@testing-library/react';
import * as stylex from '@stylexjs/stylex';
import {colorVars} from '../theme/tokens.stylex';
import {StatusDot} from './StatusDot';
+import {getForcedColorsRules} from '../__tests__/forcedColors';
/** Renders a StatusDot and returns its root element. */
function renderDot(props: React.ComponentProps<typeof StatusDot>) {
@@ -198,3 +199,15 @@ describe('StatusDot theme target names', () => {
expect(dot).not.toHaveClass('astryx-statusdot');
});
});
+
+// jsdom cannot emulate forced colors, so this asserts the compiled rule the
+// status fill relies on (architecture:theme-tokens INV11): the fill becomes
+// Canvas, and a CanvasText boundary keeps its shape.
+describe('StatusDot forced colors', () => {
+ it('keeps a visible boundary on the status fill', () => {
+ render(<StatusDot variant="error" label="Offline" />);
+ const css = getForcedColorsRules();
+ expect(css).toContain('outline-style: solid;');
+ expect(css).toContain('outline-color: canvastext;');
+ });
+});
diff --git a/packages/core/src/StatusDot/StatusDot.tsx b/packages/core/src/StatusDot/StatusDot.tsx
index eae1b0af7d..9a89f3159c 100644
--- a/packages/core/src/StatusDot/StatusDot.tsx
+++ b/packages/core/src/StatusDot/StatusDot.tsx
@@ -89,14 +89,41 @@ const variants = stylex.create({
success: {
backgroundColor: colorVars['--color-success'],
color: colorVars['--color-on-success'],
+ // Forced colors replace status fills with Canvas; this boundary keeps the
+ // fill's shape visible (architecture:theme-tokens INV11).
+ outlineWidth: {default: null, '@media (forced-colors: active)': '1px'},
+ outlineStyle: {default: null, '@media (forced-colors: active)': 'solid'},
+ outlineColor: {
+ default: null,
+ '@media (forced-colors: active)': 'CanvasText',
+ },
+ outlineOffset: {default: null, '@media (forced-colors: active)': '-1px'},
},
warning: {
backgroundColor: colorVars['--color-warning'],
color: colorVars['--color-on-warning'],
+ // Forced colors replace status fills with Canvas; this boundary keeps the
+ // fill's shape visible (architecture:theme-tokens INV11).
+ outlineWidth: {default: null, '@media (forced-colors: active)': '1px'},
+ outlineStyle: {default: null, '@media (forced-colors: active)': 'solid'},
+ outlineColor: {
+ default: null,
+ '@media (forced-colors: active)': 'CanvasText',
+ },
+ outlineOffset: {default: null, '@media (forced-colors: active)': '-1px'},
},
error: {
backgroundColor: colorVars['--color-error'],
color: colorVars['--color-on-error'],
+ // Forced colors replace status fills with Canvas; this boundary keeps the
+ // fill's shape visible (architecture:theme-tokens INV11).
+ outlineWidth: {default: null, '@media (forced-colors: active)': '1px'},
+ outlineStyle: {default: null, '@media (forced-colors: active)': 'solid'},
+ outlineColor: {
+ default: null,
+ '@media (forced-colors: active)': 'CanvasText',
+ },
+ outlineOffset: {default: null, '@media (forced-colors: active)': '-1px'},
},
accent: {
backgroundColor: colorVars['--color-accent'],
diff --git a/packages/core/src/Stepper/Step.tsx b/packages/core/src/Stepper/Step.tsx
index bd353a5450..30a239d56c 100644
--- a/packages/core/src/Stepper/Step.tsx
+++ b/packages/core/src/Stepper/Step.tsx
@@ -535,18 +535,27 @@ const styles = stylex.create({
color: colorVars['--color-accent'],
},
iconSuccess: {
- color: colorVars['--color-success'],
+ color: colorVars['--color-icon-success'],
},
iconWarning: {
- color: colorVars['--color-warning'],
+ color: colorVars['--color-icon-warning'],
},
iconError: {
- color: colorVars['--color-error'],
+ color: colorVars['--color-icon-error'],
},
// Number badge — same box as every other indicator (see INDICATOR_SIZE).
numberBadge: {
display: 'grid',
+ // Forced colors replace status fills with Canvas; this boundary keeps the
+ // fill's shape visible (architecture:theme-tokens INV11).
+ outlineWidth: {default: null, '@media (forced-colors: active)': '1px'},
+ outlineStyle: {default: null, '@media (forced-colors: active)': 'solid'},
+ outlineColor: {
+ default: null,
+ '@media (forced-colors: active)': 'CanvasText',
+ },
+ outlineOffset: {default: null, '@media (forced-colors: active)': '-1px'},
placeItems: 'center',
width: INDICATOR_SIZE,
height: INDICATOR_SIZE,
diff --git a/packages/core/src/Stepper/Stepper.test.tsx b/packages/core/src/Stepper/Stepper.test.tsx
index 7261406784..b93291b9c3 100644
--- a/packages/core/src/Stepper/Stepper.test.tsx
+++ b/packages/core/src/Stepper/Stepper.test.tsx
@@ -10,6 +10,7 @@ import {useStepperContext} from './StepperContext';
import {useLayer} from '../Layer/useLayer';
import {defineTheme} from '../theme/defineTheme';
import {generateThemeCSS} from '../theme/generateThemeRules';
+import {getForcedColorsRules} from '../__tests__/forcedColors';
describe('Stepper', () => {
it('renders an ordered list of steps (not a nav landmark)', () => {
@@ -2049,3 +2050,19 @@ describe('clickable step text reading', () => {
},
);
});
+
+// jsdom cannot emulate forced colors, so this asserts the compiled rule the
+// number badge fill relies on (architecture:theme-tokens INV11).
+describe('Step number badge forced colors', () => {
+ it('keeps a visible boundary on the badge fill', () => {
+ render(
+ <Stepper activeStep={0}>
+ <Step step={0} label="First" indicator="number" />
+ <Step step={1} label="Second" indicator="number" />
+ </Stepper>,
+ );
+ const css = getForcedColorsRules();
+ expect(css).toContain('outline-style: solid;');
+ expect(css).toContain('outline-color: canvastext;');
+ });
+});
diff --git a/packages/core/src/TextArea/TextArea.tsx b/packages/core/src/TextArea/TextArea.tsx
index fa6dfda8cc..32f474b269 100644
--- a/packages/core/src/TextArea/TextArea.tsx
+++ b/packages/core/src/TextArea/TextArea.tsx
@@ -173,7 +173,7 @@ const styles = stylex.create({
color: colorVars['--color-text-secondary'],
},
counterError: {
- color: colorVars['--color-error'],
+ color: colorVars['--color-text-error'],
},
});
diff --git a/packages/core/src/tailwind-theme.css b/packages/core/src/tailwind-theme.css
index 3a55523d89..842ef3409b 100644
--- a/packages/core/src/tailwind-theme.css
+++ b/packages/core/src/tailwind-theme.css
@@ -75,6 +75,9 @@
--color-tint-hover: var(--color-tint-hover);
/* --- Status --- */
+ --color-info: var(--color-info);
+ --color-info-muted: var(--color-info-muted);
+ --color-on-info: var(--color-on-info);
--color-success: var(--color-success);
--color-success-muted: var(--color-success-muted);
--color-on-success: var(--color-on-success);
@@ -84,6 +87,52 @@
--color-warning: var(--color-warning);
--color-warning-muted: var(--color-warning-muted);
--color-on-warning: var(--color-on-warning);
+ /* Each --color-<status> is the strong status fill, with --color-on-<status>
+ * content at 4.5:1 or more (architecture:theme-tokens INV11). text-status-*
+ * reads the status text role for page text; icons and borders use the same
+ * colour by default. */
+ --text-color-status-info: var(--color-text-info);
+ --text-color-status-success: var(--color-text-success);
+ --text-color-status-warning: var(--color-text-warning);
+ --text-color-status-error: var(--color-text-error);
+ /* Each status projects by paint property: text-like utilities (text-,
+ * decoration-, placeholder-, caret-) read the status text role, line-like
+ * utilities (border-, divide-, outline-, ring-) read the status border role,
+ * and fill-like utilities (bg-, accent-, fill-, stroke-, shadows, gradients)
+ * keep the strong fill. Tailwind resolves these per-utility keys before
+ * --color-*. */
+ --text-color-info: var(--color-text-info);
+ --text-color-success: var(--color-text-success);
+ --text-color-warning: var(--color-text-warning);
+ --text-color-error: var(--color-text-error);
+ --text-decoration-color-info: var(--color-text-info);
+ --text-decoration-color-success: var(--color-text-success);
+ --text-decoration-color-warning: var(--color-text-warning);
+ --text-decoration-color-error: var(--color-text-error);
+ --placeholder-color-info: var(--color-text-info);
+ --placeholder-color-success: var(--color-text-success);
+ --placeholder-color-warning: var(--color-text-warning);
+ --placeholder-color-error: var(--color-text-error);
+ --caret-color-info: var(--color-text-info);
+ --caret-color-success: var(--color-text-success);
+ --caret-color-warning: var(--color-text-warning);
+ --caret-color-error: var(--color-text-error);
+ --border-color-info: var(--color-border-info);
+ --border-color-success: var(--color-border-success);
+ --border-color-warning: var(--color-border-warning);
+ --border-color-error: var(--color-border-error);
+ --outline-color-info: var(--color-border-info);
+ --outline-color-success: var(--color-border-success);
+ --outline-color-warning: var(--color-border-warning);
+ --outline-color-error: var(--color-border-error);
+ --ring-color-info: var(--color-border-info);
+ --ring-color-success: var(--color-border-success);
+ --ring-color-warning: var(--color-border-warning);
+ --ring-color-error: var(--color-border-error);
+ --color-on-info-muted: var(--color-on-info-muted);
+ --color-on-success-muted: var(--color-on-success-muted);
+ --color-on-warning-muted: var(--color-on-warning-muted);
+ --color-on-error-muted: var(--color-on-error-muted);
/* --- Borders --- */
--color-border: var(--color-border);
@@ -217,7 +266,8 @@
* The system has a richer duration/easing scale than Tailwind's defaults.
* We map the primary durations and expose the standard easing.
* ========================================================================= */
- --transition-property-colors: color, background-color, border-color, text-decoration-color, fill, stroke;
+ --transition-property-colors:
+ color, background-color, border-color, text-decoration-color, fill, stroke;
--transition-property-opacity: opacity;
--transition-property-shadow: box-shadow;
--transition-property-transform: transform;
diff --git a/packages/core/src/tailwind-theme.test.ts b/packages/core/src/tailwind-theme.test.ts
index 9a648d448a..817dc69ff4 100644
--- a/packages/core/src/tailwind-theme.test.ts
+++ b/packages/core/src/tailwind-theme.test.ts
@@ -27,6 +27,9 @@ const sameNameColorTokens = [
'--color-overlay-hover',
'--color-overlay-pressed',
'--color-tint-hover',
+ '--color-info',
+ '--color-info-muted',
+ '--color-on-info',
'--color-success',
'--color-success-muted',
'--color-on-success',
@@ -36,6 +39,10 @@ const sameNameColorTokens = [
'--color-warning',
'--color-warning-muted',
'--color-on-warning',
+ '--color-on-info-muted',
+ '--color-on-success-muted',
+ '--color-on-warning-muted',
+ '--color-on-error-muted',
'--color-border',
'--color-on-dark',
'--color-on-light',
@@ -68,6 +75,10 @@ async function compileBridge(): Promise<string> {
token => `rounded-${suffix(token, '--radius-')}`,
),
'bg-surface',
+ 'text-status-info',
+ 'text-status-success',
+ 'text-status-warning',
+ 'text-status-error',
]);
}
@@ -97,6 +108,46 @@ describe('Tailwind theme bridge', () => {
const css = await compileBridge();
expect(css).toContain('background-color: var(--color-background-surface);');
+ expect(css).toContain('color: var(--color-text-info);');
+ expect(css).toContain('color: var(--color-text-success);');
+ expect(css).toContain('color: var(--color-text-warning);');
+ expect(css).toContain('color: var(--color-text-error);');
expect(css).not.toContain('background-color: var(--color-surface);');
});
+
+ it('projects each status by paint property', async () => {
+ const compiler = await compile(`${bridgeCSS}\n@tailwind utilities;`);
+ for (const status of ['info', 'success', 'warning', 'error']) {
+ const text = `var(--color-text-${status})`;
+ const border = `var(--color-border-${status})`;
+ const fill = `var(--color-${status})`;
+ for (const [utility, expected] of [
+ [`text-${status}`, text],
+ [`decoration-${status}`, text],
+ [`placeholder-${status}`, text],
+ [`caret-${status}`, text],
+ [`border-${status}`, border],
+ [`divide-${status}`, border],
+ [`outline-${status}`, border],
+ [`ring-${status}`, border],
+ [`bg-${status}`, fill],
+ [`accent-${status}`, fill],
+ [`fill-${status}`, fill],
+ [`text-status-${status}`, text],
+ ]) {
+ expect([utility, compiler.build([utility])]).toEqual([
+ utility,
+ expect.stringContaining(expected),
+ ]);
+ }
+ // text-status-<status> is a text-only alias.
+ for (const utility of [
+ `bg-status-${status}`,
+ `border-status-${status}`,
+ `ring-status-${status}`,
+ ]) {
+ expect(compiler.build([utility])).not.toContain(`.${utility} {`);
+ }
+ }
+ });
});
diff --git a/packages/core/src/theme/Theme.test.tsx b/packages/core/src/theme/Theme.test.tsx
index 2cab9d19f6..dd79f1bb6e 100644
--- a/packages/core/src/theme/Theme.test.tsx
+++ b/packages/core/src/theme/Theme.test.tsx
@@ -213,6 +213,34 @@ describe('Theme', () => {
expect(nestedWrapper?.getAttribute('data-theme')).toBe('light');
});
+ it('rebinds a default status role inside a nested theme that authors its source token', () => {
+ const outer = defineTheme({
+ name: 'status-role-outer',
+ tokens: {
+ '--color-text-blue': '#0074E2',
+ '--color-text-info': '#0074E2',
+ },
+ });
+ const inner = defineTheme({
+ name: 'status-role-inner',
+ tokens: {'--color-text-blue': '#A000C8'},
+ });
+
+ render(
+ <Theme theme={outer}>
+ <Theme theme={inner}>
+ <span>nested</span>
+ </Theme>
+ </Theme>,
+ );
+
+ const innerCss = document.head.querySelector(
+ 'style[data-astryx-theme="status-role-inner"]',
+ )?.textContent;
+ expect(innerCss).toContain('--color-text-blue: #A000C8;');
+ expect(innerCss).toContain('--color-text-info: var(--color-text-blue);');
+ });
+
// =========================================================================
// Data token ownership — StyleX defaults, sparse Theme overrides
// =========================================================================
diff --git a/packages/core/src/theme/declarationBoundary.ts b/packages/core/src/theme/declarationBoundary.ts
index 30a1003b6e..10bf0defc8 100644
--- a/packages/core/src/theme/declarationBoundary.ts
+++ b/packages/core/src/theme/declarationBoundary.ts
@@ -52,7 +52,25 @@ function isNameChar(ch: string): boolean {
/** CSS Syntax §3.3 preprocessing, for scanning only; emitted bytes stay intact. */
function preprocess(input: string): string {
- return input.replace(/\r\n?|\f/g, '\n').replace(/\0/g, '\uFFFD');
+ const normalized = input.replace(/\r\n?|\f/g, '\n').replace(/\0/g, '\uFFFD');
+ let output = '';
+ for (let index = 0; index < normalized.length; index++) {
+ const code = normalized.charCodeAt(index);
+ if (code >= 0xd800 && code <= 0xdbff) {
+ const next = normalized.charCodeAt(index + 1);
+ if (next >= 0xdc00 && next <= 0xdfff) {
+ output += normalized[index] + normalized[index + 1];
+ index++;
+ } else {
+ output += '\uFFFD';
+ }
+ } else if (code >= 0xdc00 && code <= 0xdfff) {
+ output += '\uFFFD';
+ } else {
+ output += normalized[index];
+ }
+ }
+ return output;
}
/** Non-printable code points make an unquoted url() a bad-url token. */
@@ -325,6 +343,269 @@ export function checkDeclarationValue(input: string): string | null {
return null;
}
+export interface DeclarationValueAnalysis {
+ reason: string | null;
+ references: string[];
+ important: boolean;
+ singleVarReference: string | null;
+}
+
+function skipWhitespaceAndComments(input: string, start: number): number {
+ let index = start;
+ for (;;) {
+ while (index < input.length && isWhitespace(input[index])) {
+ index++;
+ }
+ if (input[index] !== '/' || input[index + 1] !== '*') {
+ return index;
+ }
+ const close = input.indexOf('*/', index + 2);
+ if (close === -1) {
+ return input.length;
+ }
+ index = close + 2;
+ }
+}
+
+function varReferenceAt(input: string, openParen: number): string | null {
+ const start = skipWhitespaceAndComments(input, openParen + 1);
+ if (!startsIdent(input, start)) {
+ return null;
+ }
+ const token = consumeIdent(input, start);
+ if (!token.name.startsWith('--')) {
+ return null;
+ }
+ const end = skipWhitespaceAndComments(input, token.end);
+ return input[end] === ',' || input[end] === ')' ? token.name : null;
+}
+
+function startsNumber(input: string, position: number): boolean {
+ const first = input[position];
+ const second = input[position + 1];
+ const third = input[position + 2];
+ if (first === '+' || first === '-') {
+ return (
+ /^[0-9]$/.test(second ?? '') ||
+ (second === '.' && /^[0-9]$/.test(third ?? ''))
+ );
+ }
+ return (
+ /^[0-9]$/.test(first ?? '') ||
+ (first === '.' && /^[0-9]$/.test(second ?? ''))
+ );
+}
+
+function consumeNumber(input: string, position: number): number {
+ let index = position;
+ if (input[index] === '+' || input[index] === '-') {
+ index++;
+ }
+ while (/^[0-9]$/.test(input[index] ?? '')) {
+ index++;
+ }
+ if (input[index] === '.' && /^[0-9]$/.test(input[index + 1] ?? '')) {
+ index += 2;
+ while (/^[0-9]$/.test(input[index] ?? '')) {
+ index++;
+ }
+ }
+ if (
+ (input[index] === 'e' || input[index] === 'E') &&
+ (/^[0-9]$/.test(input[index + 1] ?? '') ||
+ ((input[index + 1] === '+' || input[index + 1] === '-') &&
+ /^[0-9]$/.test(input[index + 2] ?? '')))
+ ) {
+ index++;
+ if (input[index] === '+' || input[index] === '-') {
+ index++;
+ }
+ while (/^[0-9]$/.test(input[index] ?? '')) {
+ index++;
+ }
+ }
+ return index;
+}
+
+const DECLARATION_ANALYSIS_CACHE = new Map<string, DeclarationValueAnalysis>();
+const MAX_DECLARATION_ANALYSIS_CACHE = 4096;
+
+/**
+ * Analyze one accepted declaration value using the same CSS tokenization rules
+ * as the declaration-boundary check.
+ */
+export function analyzeDeclarationValue(
+ input: string,
+): DeclarationValueAnalysis {
+ const cached = DECLARATION_ANALYSIS_CACHE.get(input);
+ if (cached !== undefined) {
+ return cached;
+ }
+ const reason = checkDeclarationValue(input);
+ if (reason !== null) {
+ const analysis = {
+ reason,
+ references: [],
+ important: false,
+ singleVarReference: null,
+ };
+ if (DECLARATION_ANALYSIS_CACHE.size >= MAX_DECLARATION_ANALYSIS_CACHE) {
+ DECLARATION_ANALYSIS_CACHE.clear();
+ }
+ DECLARATION_ANALYSIS_CACHE.set(input, analysis);
+ return analysis;
+ }
+
+ const value = preprocess(input);
+ const references: string[] = [];
+ const open: string[] = [];
+ type TopLevelToken = {
+ type: 'delim' | 'ident' | 'var-function' | 'other';
+ value: string;
+ reference?: string;
+ };
+ const topLevelTokens: TopLevelToken[] = [];
+ const firstTopLevelTokens: TopLevelToken[] = [];
+ let topLevelTokenCount = 0;
+ const recordTopLevel = (token: TopLevelToken): void => {
+ if (open.length === 0) {
+ topLevelTokenCount++;
+ if (firstTopLevelTokens.length === 0) {
+ firstTopLevelTokens.push(token);
+ }
+ topLevelTokens.push(token);
+ if (topLevelTokens.length > 2) {
+ topLevelTokens.shift();
+ }
+ }
+ };
+
+ let index = 0;
+ while (index < value.length) {
+ const character = value[index];
+ if (isWhitespace(character)) {
+ index++;
+ continue;
+ }
+ if (character === '/' && value[index + 1] === '*') {
+ index = value.indexOf('*/', index + 2) + 2;
+ continue;
+ }
+ if (character === '"' || character === "'") {
+ recordTopLevel({type: 'other', value: character});
+ const string = consumeString(value, index);
+ index = 'end' in string ? string.end : value.length;
+ continue;
+ }
+ if (character === '#') {
+ const nameStart = index + 1;
+ if (isNameChar(value[nameStart]) || isValidEscape(value, nameStart)) {
+ recordTopLevel({type: 'other', value: '#'});
+ index = consumeIdent(value, nameStart).end;
+ continue;
+ }
+ }
+ if (character === '@' && startsIdent(value, index + 1)) {
+ recordTopLevel({type: 'other', value: '@'});
+ index = consumeIdent(value, index + 1).end;
+ continue;
+ }
+ if (startsNumber(value, index)) {
+ recordTopLevel({type: 'other', value: character});
+ index = consumeNumber(value, index);
+ if (startsIdent(value, index)) {
+ index = consumeIdent(value, index).end;
+ } else if (value[index] === '%') {
+ index++;
+ }
+ continue;
+ }
+ if (startsIdent(value, index)) {
+ const ident = consumeIdent(value, index);
+ index = ident.end;
+ const isFunction = value[index] === '(';
+ const reference =
+ isFunction && ident.name.toLowerCase() === 'var'
+ ? varReferenceAt(value, index)
+ : null;
+ recordTopLevel(
+ reference !== null
+ ? {type: 'var-function', value: ident.name, reference}
+ : {
+ type: isFunction ? 'other' : 'ident',
+ value: ident.name,
+ },
+ );
+ if (isFunction) {
+ if (reference !== null) {
+ references.push(reference);
+ }
+ if (ident.name.toLowerCase() === 'url') {
+ let body = index + 1;
+ while (body < value.length && isWhitespace(value[body])) {
+ body++;
+ }
+ if (value[body] !== '"' && value[body] !== "'") {
+ const url = consumeUrl(value, body);
+ index = 'end' in url ? url.end : value.length;
+ continue;
+ }
+ }
+ open.push(')');
+ index++;
+ }
+ continue;
+ }
+ if (character === '(' || character === '[' || character === '{') {
+ recordTopLevel({type: 'other', value: character});
+ open.push(CLOSER[character]);
+ index++;
+ continue;
+ }
+ if (character === ')' || character === ']' || character === '}') {
+ open.pop();
+ index++;
+ continue;
+ }
+ if (character === '!') {
+ recordTopLevel({type: 'delim', value: character});
+ } else {
+ recordTopLevel({type: 'other', value: character});
+ }
+ index++;
+ }
+
+ const previousTopLevel = topLevelTokens.at(-2);
+ const lastTopLevel = topLevelTokens.at(-1);
+ const important =
+ previousTopLevel?.type === 'delim' &&
+ previousTopLevel.value === '!' &&
+ lastTopLevel?.type === 'ident' &&
+ lastTopLevel.value.toLowerCase() === 'important';
+ const firstTopLevelToken = firstTopLevelTokens[0];
+ const singleVarReference =
+ topLevelTokenCount - (important ? 2 : 0) === 1 &&
+ firstTopLevelToken?.type === 'var-function'
+ ? (firstTopLevelToken.reference ?? null)
+ : null;
+ const analysis = {reason: null, references, important, singleVarReference};
+ if (DECLARATION_ANALYSIS_CACHE.size >= MAX_DECLARATION_ANALYSIS_CACHE) {
+ DECLARATION_ANALYSIS_CACHE.clear();
+ }
+ DECLARATION_ANALYSIS_CACHE.set(input, analysis);
+ return analysis;
+}
+
+/** The browser-canonical spelling of one valid declaration name. */
+export function canonicalizeDeclarationName(input: string): string | null {
+ const name = preprocess(input);
+ if (name.length === 0 || !startsIdent(name, 0)) {
+ return null;
+ }
+ const ident = consumeIdent(name, 0);
+ return ident.end === name.length ? ident.name : null;
+}
+
/**
* Why `name` cannot be emitted as a declaration's property name, or `null`
* when it can. A property name is one CSS ident sequence: a standard
diff --git a/packages/core/src/theme/defineTheme.test.ts b/packages/core/src/theme/defineTheme.test.ts
index 9b99f1da55..1f8a9feb59 100644
--- a/packages/core/src/theme/defineTheme.test.ts
+++ b/packages/core/src/theme/defineTheme.test.ts
@@ -3,7 +3,12 @@
import {describe, it, expect, vi} from 'vitest';
import type {IconRegistry} from '../Icon/globalIconRegistry';
import type {DefinedTheme} from './defineTheme';
-import {defineTheme, generateThemeCSS, isDefinedTheme} from './defineTheme';
+import {
+ defineTheme,
+ generateThemeCSS,
+ generateThemeRules,
+ isDefinedTheme,
+} from './defineTheme';
import {resolveThemeToken} from './tokens';
function generateThemeTestCSS(theme: Parameters<typeof generateThemeCSS>[0]) {
@@ -16,19 +21,298 @@ describe('defineTheme', () => {
expect(theme.name).toBe('test');
});
- it('stores only specified token overrides', () => {
+ it('stores only authored token overrides while CSS scopes derived role defaults', () => {
const theme = defineTheme({
name: 'custom',
tokens: {
- '--color-accent': '#FF0000',
+ '--color-text-blue': '#CC0000',
},
});
- // Override should be present
- expect(theme.tokens['--color-accent']).toBe('#FF0000');
- // Defaults should NOT be in tokens
+ expect(theme.tokens['--color-text-blue']).toBe('#CC0000');
+ expect(theme.tokens['--color-text-info']).toBeUndefined();
+ expect(generateThemeTestCSS(theme)).toContain(
+ '--color-text-info: var(--color-text-blue);',
+ );
+ // Unrelated defaults remain owned by StyleX rather than copied into every
+ // theme scope.
expect(theme.tokens['--color-background-surface']).toBeUndefined();
});
+ it('keeps an explicit semantic role above its scoped default', () => {
+ const theme = defineTheme({
+ name: 'custom-info',
+ tokens: {
+ '--color-text-blue': '#FF0000',
+ '--color-text-info': '#0066CC',
+ },
+ });
+
+ expect(theme.tokens['--color-text-info']).toBe('#0066CC');
+ });
+
+ it('does not generate a status alias that would create a token cycle', () => {
+ const theme = defineTheme({
+ name: 'parent-role-reference',
+ tokens: {'--color-text-blue': 'var(--color-text-info)'},
+ });
+ const css = generateThemeRules(theme).join('\n');
+
+ expect(css).toContain('--color-text-blue: var(--color-text-info);');
+ expect(css).not.toContain('--color-text-info: var(--color-text-blue);');
+ });
+
+ it('checks the complete generated alias graph for cycles', () => {
+ const theme = defineTheme({
+ name: 'generated-role-cycle',
+ tokens: {
+ '--color-text-blue': 'var(--color-text-success)',
+ '--color-text-green': 'var(--color-text-info)',
+ },
+ });
+ const css = generateThemeRules(theme).join('\n');
+
+ // The first alias is safe; the second would close a loop through it.
+ expect(css).toContain('--color-text-info: var(--color-text-blue);');
+ expect(css).not.toContain('--color-text-success: var(--color-text-green);');
+ });
+
+ it('includes theme-local references in generated alias cycle checks', () => {
+ const css = generateThemeRules({
+ tokens: {'--color-text-blue': 'var(--local-info-loop)'},
+ localTokens: {'--local-info-loop': 'var(--color-text-info)'},
+ }).join('\n');
+
+ expect(css).not.toContain('--color-text-info: var(--color-text-blue);');
+ });
+
+ it.each([null, 16, false])(
+ 'stringifies a legacy non-string status source without throwing (%s)',
+ value => {
+ const theme = defineTheme({
+ name: `legacy-status-source-${String(value)}`,
+ tokens: {'--color-text-blue': value as never},
+ });
+
+ expect(() => generateThemeRules(theme)).not.toThrow();
+ expect(generateThemeRules(theme).join('\n')).toContain(
+ `--color-text-blue: ${String(value)};`,
+ );
+ },
+ );
+
+ it('preserves JavaScript string coercion for legacy object token values', () => {
+ const value = {toString: () => '#123456'};
+ const theme = defineTheme({
+ name: 'legacy-object-status-source',
+ tokens: {'--color-text-blue': value as never},
+ });
+
+ expect(generateThemeRules(theme).join('\n')).toContain(
+ '--color-text-blue: #123456;',
+ );
+ });
+
+ it.each([
+ ['uppercase VAR()', 'VAR(--color-text-info)', undefined],
+ ['mixed-case var()', 'vAr(--color-text-info)', undefined],
+ ['escaped identifier', 'var(--\\63 olor-text-info)', undefined],
+ ['escaped function name', 'v\\61r(--color-text-info)', undefined],
+ ['escaped leading hyphens', 'var(\\2d\\2d color-text-info)', undefined],
+ [
+ 'comment-separated identifier',
+ 'var(/*ok*/ --color-text-info)',
+ undefined,
+ ],
+ [
+ 'non-ASCII local token',
+ 'var(--品牌)',
+ {'--品牌': 'var(--color-text-info)'},
+ ],
+ ])(
+ 'recognizes %s while checking generated alias cycles',
+ (_, accent, localTokens) => {
+ const css = generateThemeRules({
+ tokens: {'--color-text-blue': accent},
+ localTokens,
+ }).join('\n');
+
+ expect(css).not.toContain('--color-text-info: var(--color-text-blue);');
+ },
+ );
+
+ it('canonicalizes escaped declaration keys while checking cycles', () => {
+ const css = generateThemeRules({
+ tokens: {'--color-text-blue': 'var(--\\62 rand)'},
+ localTokens: {'--\\62 rand': 'var(--color-text-info)'},
+ }).join('\n');
+
+ expect(css).not.toContain('--color-text-info: var(--color-text-blue);');
+ });
+
+ it('ignores var() text inside CSS comments', () => {
+ const css = generateThemeRules({
+ tokens: {'--color-text-blue': '#123456 /* var(--color-text-info) */'},
+ }).join('\n');
+
+ expect(css).toContain('--color-text-info: var(--color-text-blue);');
+ });
+
+ it.each([
+ ['escaped space', '--x\\ y'],
+ ['escaped backslash', '--x\\\\y'],
+ ])('canonicalizes an %s declaration key exactly once', (_, localToken) => {
+ const css = generateThemeRules({
+ tokens: {'--color-text-blue': `var(${localToken})`},
+ localTokens: {[localToken]: 'var(--color-text-info)'},
+ }).join('\n');
+
+ expect(css).not.toContain('--color-text-info: var(--color-text-blue);');
+ });
+
+ it.each([
+ ['CRLF-preprocessed escape', 'v\\61\r\nr(--color-text-info)', undefined],
+ ['surrogate escape', 'var(--\\d800)', {'--�': 'var(--color-text-info)'}],
+ ['NUL replacement', 'var(--\0)', {'--�': 'var(--color-text-info)'}],
+ ])('uses browser preprocessing for %s', (_, accent, localTokens) => {
+ const css = generateThemeRules({
+ tokens: {'--color-text-blue': accent},
+ localTokens,
+ }).join('\n');
+
+ expect(css).not.toContain('--color-text-info: var(--color-text-blue);');
+ });
+
+ it.each(['var (--color-text-info)', 'var/**/(--color-text-info)'])(
+ 'does not treat non-function text as a reference: %s',
+ accent => {
+ const css = generateThemeRules({
+ tokens: {'--color-text-blue': accent},
+ }).join('\n');
+ expect(css).toContain('--color-text-info: var(--color-text-blue);');
+ },
+ );
+
+ it.each([
+ 'var(--color-text-red, #var(--color-text-info))',
+ '1var(--color-text-info)',
+ '@var(--color-text-info)',
+ ])(
+ 'does not create references inside non-function CSS tokens: %s',
+ accent => {
+ const css = generateThemeRules({
+ tokens: {
+ '--color-text-blue': accent,
+ '--color-text-red': '#123456',
+ },
+ }).join('\n');
+
+ expect(css).toContain('--color-text-info: var(--color-text-blue);');
+ },
+ );
+
+ it('does not let unquoted URL contents hide a following var() reference', () => {
+ const css = generateThemeRules({
+ tokens: {
+ '--color-text-blue': 'url(/*) var(--color-text-info) /* */',
+ },
+ }).join('\n');
+
+ expect(css).not.toContain('--color-text-info: var(--color-text-blue);');
+ });
+
+ it('ignores pre-existing unrelated legacy cycles', () => {
+ const css = generateThemeRules({
+ tokens: {
+ '--color-text-blue': '#123456',
+ '--color-background-body': 'var(--color-background-surface)',
+ '--color-background-surface': 'var(--color-background-body)',
+ },
+ }).join('\n');
+
+ expect(css).toContain('--color-text-info: var(--color-text-blue);');
+ });
+
+ it('handles long runs of adjacent comments without recursion', () => {
+ const comments = '/**/'.repeat(10_000);
+ expect(() =>
+ generateThemeRules({
+ tokens: {'--color-text-blue': `#123456 ${comments}`},
+ }),
+ ).not.toThrow();
+ });
+
+ it('handles a very wide reference list without argument spreading', () => {
+ const references = 'var(--wide-target) '.repeat(200_000);
+ expect(() =>
+ generateThemeRules({
+ tokens: {'--color-text-blue': references},
+ localTokens: {'--wide-target': '#123456'},
+ }),
+ ).not.toThrow();
+ });
+
+ it('checks a reconverging token graph in linear time', () => {
+ const localTokens: Record<string, string> = {};
+ for (let layer = 0; layer < 26; layer++) {
+ const next = layer + 1;
+ const value =
+ layer === 25
+ ? '#ffffff'
+ : `var(--layer-${next}-a, var(--layer-${next}-b))`;
+ localTokens[`--layer-${layer}-a`] = value;
+ localTokens[`--layer-${layer}-b`] = value;
+ }
+ const started = performance.now();
+ generateThemeRules({
+ tokens: {'--color-text-blue': 'var(--layer-0-a)'},
+ localTokens,
+ });
+
+ expect(performance.now() - started).toBeLessThan(1000);
+ });
+
+ it('emits every source-derived status role without counting it as authored', () => {
+ const theme = defineTheme({
+ name: 'custom-status-sources',
+ tokens: {
+ '--color-text-blue': '#200001',
+ '--color-text-green': '#200002',
+ '--color-text-yellow': '#200003',
+ '--color-text-red': '#200004',
+ },
+ });
+ const css = generateThemeTestCSS(theme);
+
+ expect(theme.tokens['--color-text-info']).toBeUndefined();
+ for (const declaration of [
+ '--color-text-info: var(--color-text-blue);',
+ '--color-text-success: var(--color-text-green);',
+ '--color-text-warning: var(--color-text-yellow);',
+ '--color-text-error: var(--color-text-red);',
+ '--color-on-info-muted: var(--color-text-blue);',
+ '--color-on-success-muted: var(--color-text-green);',
+ '--color-on-warning-muted: var(--color-text-yellow);',
+ '--color-on-error-muted: var(--color-text-red);',
+ ]) {
+ expect(css).toContain(declaration);
+ }
+ for (const role of ['icon', 'border']) {
+ expect(css).toContain(`--color-${role}-info: var(--color-text-info);`);
+ }
+ });
+
+ it('derives the content on a status fill the theme sets (INV17)', () => {
+ const theme = defineTheme({
+ name: 'bright-error',
+ tokens: {'--color-error': '#FF0000'},
+ });
+ const css = generateThemeTestCSS(theme);
+ expect(css).toContain('--color-error: #FF0000;');
+ expect(css).toMatch(
+ /--color-on-error: light-dark\(#[0-9A-F]{6}, #[0-9A-F]{6}\)/,
+ );
+ });
+
it('converts [light, dark] tuples to light-dark()', () => {
const theme = defineTheme({
name: 'tuple-test',
@@ -464,10 +748,10 @@ describe('typography.scale', () => {
name: 'combo',
typography: {scale: {base: 16, ratio: 1.25}},
tokens: {
- '--color-accent': '#FF0000',
+ '--color-accent': '#CC0000',
},
});
- expect(theme.tokens['--color-accent']).toBe('#FF0000');
+ expect(theme.tokens['--color-accent']).toBe('#CC0000');
expect(theme.tokens['--text-heading-4-size']).toBe('var(--font-size-base)');
expect(theme.tokens['--font-size-base']).toBe('1rem');
});
@@ -604,10 +888,10 @@ describe('radius', () => {
typography: {scale: {base: 16, ratio: 1.25}},
radius: {base: 4, multiplier: 1},
tokens: {
- '--color-accent': '#FF0000',
+ '--color-accent': '#CC0000',
},
});
- expect(theme.tokens['--color-accent']).toBe('#FF0000');
+ expect(theme.tokens['--color-accent']).toBe('#CC0000');
expect(theme.tokens['--text-heading-4-size']).toBe('var(--font-size-base)');
expect(theme.tokens['--radius-element']).toBe('8px');
});
diff --git a/packages/core/src/theme/generateThemeRules.ts b/packages/core/src/theme/generateThemeRules.ts
index b7c2c81b16..9d5e7cb543 100644
--- a/packages/core/src/theme/generateThemeRules.ts
+++ b/packages/core/src/theme/generateThemeRules.ts
@@ -4,8 +4,9 @@
* @file Theme CSS generation utilities
*
* Shared logic for generating CSS rules from a resolved theme definition,
- * including one component-leaf lowering path for root, adaptation, and
- * media-surface values plus condition-correct Heading weight precedence guards.
+ * including source-scoped semantic role defaults and one component-leaf lowering
+ * path for root, adaptation, and media-surface values plus condition-correct
+ * Heading weight precedence guards.
* Built adaptation metadata resolves against the same root component defaults
* as defineTheme, so scale-only rules do not reset authored component styles.
* Used by both the runtime path (Theme injects <style>) and the build
@@ -29,11 +30,15 @@ import type {ComponentStyleMap, DefinedTheme} from './defineTheme';
import {
normalizeThemeAdaptations,
resolveThemeAdaptationRules,
+ type ResolvedThemeAdaptationRule,
} from './themeAdaptations';
import {parseStyleKey} from '../utils/parseStyleKey';
import {getDerivedVars} from './derivedVarRegistry';
+import {STATUS_NAMES, deriveStatusRoleTokens} from './statusRoleDerivation';
import {cssVar, classPrefix, dataAttrNamespace} from '../naming';
import {
+ analyzeDeclarationValue,
+ canonicalizeDeclarationName,
checkDeclarationName,
checkDeclarationValue,
} from './declarationBoundary';
@@ -448,7 +453,7 @@ function joinDeclarations(
for (const [rawProp, rawValue] of entries) {
// Legacy unenrolled tokens retain non-string values. Scan the same text
// interpolation has always emitted, without changing the normalized theme.
- const value = `${rawValue}`;
+ const value = stringifyTokenValue(rawValue);
const prop = mapProp(rawProp);
if (acceptDeclaration(prop, value, location, sink)) {
lines.push(` ${prop}: ${value};`);
@@ -457,14 +462,526 @@ function joinDeclarations(
return lines.join('\n');
}
+/**
+ * Public status roles whose canonical default references an existing semantic
+ * source token. StyleX owns the document defaults. A theme that authors a
+ * source repeats its omitted role at the theme root so nested Theme regions
+ * bind the alias locally without changing authored-token metadata.
+ *
+ * Conditional scopes repeat an omitted alias only when the source changes on
+ * that scope. Explicit adaptation role writes are replayed after generated
+ * aliases (and on media descendants) so authored role precedence survives
+ * overlapping conditions without disabling the alias in non-matching states.
+ */
+const SCOPED_STATUS_ROLE_DEFAULTS: ReadonlyArray<
+ readonly [role: string, source: string]
+> = [
+ ['--color-text-info', '--color-text-blue'],
+ ['--color-text-success', '--color-text-green'],
+ ['--color-text-warning', '--color-text-yellow'],
+ ['--color-text-error', '--color-text-red'],
+ ['--color-on-info-muted', '--color-text-blue'],
+ ['--color-on-success-muted', '--color-text-green'],
+ ['--color-on-warning-muted', '--color-text-yellow'],
+ ['--color-on-error-muted', '--color-text-red'],
+ // Icon and border roles follow the text role, set or derived (INV17).
+ ['--color-icon-info', '--color-text-info'],
+ ['--color-icon-success', '--color-text-success'],
+ ['--color-icon-warning', '--color-text-warning'],
+ ['--color-icon-error', '--color-text-error'],
+ ['--color-border-info', '--color-text-info'],
+ ['--color-border-success', '--color-text-success'],
+ ['--color-border-warning', '--color-text-warning'],
+ ['--color-border-error', '--color-text-error'],
+];
+
+const SCOPED_STATUS_ROLE_SOURCES = new Map(SCOPED_STATUS_ROLE_DEFAULTS);
+
+/** Colours INV17's derivation measures; a scope that sets one re-derives. */
+const STATUS_MEASURED =
+ /^--color-(?:info|success|warning|error|on-|background-surface|background-card)/;
+
+const STATUS_ROLE_ORDER = new Map(
+ SCOPED_STATUS_ROLE_DEFAULTS.map(([role], index) => [role, index]),
+);
+
+type TokenValues = Record<string, unknown>;
+
+function stringifyTokenValue(value: unknown): string {
+ if (typeof value === 'string') {
+ return value;
+ }
+ // Preserve the exact JavaScript interpolation behavior legacy themes received
+ // before declaration analysis accepted non-string token values.
+ return String(value);
+}
+
+interface TokenCascadeState {
+ values: TokenValues;
+ important: Set<string>;
+}
+
+function assignTokenCascade(
+ state: TokenCascadeState,
+ ...tokenSets: ReadonlyArray<TokenValues | undefined>
+): void {
+ for (const tokens of tokenSets) {
+ for (const [rawToken, rawValue] of Object.entries(tokens ?? {})) {
+ const token = canonicalizeDeclarationName(rawToken);
+ const value = stringifyTokenValue(rawValue);
+ const analysis = analyzeDeclarationValue(value);
+ // Match joinDeclarations: declarations that cannot be emitted never
+ // participate in the browser cascade this safety model validates.
+ if (token === null || analysis.reason !== null) {
+ continue;
+ }
+ if (state.important.has(token) && !analysis.important) {
+ continue;
+ }
+ state.values[token] = value;
+ if (analysis.important) {
+ state.important.add(token);
+ } else {
+ state.important.delete(token);
+ }
+ }
+ }
+}
+
+function createTokenCascade(
+ ...tokenSets: ReadonlyArray<TokenValues | undefined>
+): TokenCascadeState {
+ const state: TokenCascadeState = {values: {}, important: new Set()};
+ assignTokenCascade(state, ...tokenSets);
+ return state;
+}
+
+/** Check whether one candidate value closes a cycle through its own role. */
+function tokenValuesWouldHaveCycleWithValue(
+ tokens: TokenValues,
+ relevantToken: string,
+ candidateValue: string,
+): boolean {
+ const stack = [...analyzeDeclarationValue(candidateValue).references];
+ const visited = new Set<string>();
+ while (stack.length > 0) {
+ const token = stack.pop();
+ if (token === undefined) {
+ continue;
+ }
+ if (token === relevantToken) {
+ return true;
+ }
+ if (
+ visited.has(token) ||
+ !Object.prototype.hasOwnProperty.call(tokens, token)
+ ) {
+ continue;
+ }
+ visited.add(token);
+ for (const reference of analyzeDeclarationValue(
+ stringifyTokenValue(tokens[token]),
+ ).references) {
+ if (
+ reference === relevantToken ||
+ Object.prototype.hasOwnProperty.call(tokens, reference)
+ ) {
+ stack.push(reference);
+ }
+ }
+ }
+ return false;
+}
+
+const WIDTH_CELL_RANK = {
+ sm: 1,
+ md: 2,
+ lg: 3,
+ xl: 4,
+ '2xl': 5,
+} as const;
+
+function adaptationConditionMatchesCell(
+ condition: ResolvedThemeAdaptationRule['when'],
+ widthRank: number,
+ pointer: 'coarse' | 'fine' | 'none',
+ contrast: 'more' | 'less' | 'no-preference' | 'custom',
+ motion: 'reduce' | 'no-preference',
+): boolean {
+ const from = condition.width?.from;
+ if (from !== undefined && widthRank < WIDTH_CELL_RANK[from]) {
+ return false;
+ }
+ const below = condition.width?.below;
+ if (below !== undefined && widthRank >= WIDTH_CELL_RANK[below]) {
+ return false;
+ }
+ return (
+ (condition.pointer === undefined || condition.pointer === pointer) &&
+ (condition.contrast === undefined || condition.contrast === contrast) &&
+ (condition.motion === undefined || condition.motion === motion)
+ );
+}
+
+const REACHABLE_MATCH_SET_CACHE = new WeakMap<
+ ReadonlyArray<ResolvedThemeAdaptationRule>,
+ number[][]
+>();
+
+/** Every reachable ordered adaptation-rule match set, including the root. */
+function reachableAdaptationMatchSets(
+ rules: ReadonlyArray<ResolvedThemeAdaptationRule>,
+): number[][] {
+ const cached = REACHABLE_MATCH_SET_CACHE.get(rules);
+ if (cached !== undefined) {
+ return cached;
+ }
+ const matchSets = new Map<string, number[]>();
+ for (let widthRank = 0; widthRank <= 5; widthRank++) {
+ for (const pointer of ['coarse', 'fine', 'none'] as const) {
+ for (const contrast of [
+ 'more',
+ 'less',
+ 'no-preference',
+ 'custom',
+ ] as const) {
+ for (const motion of ['reduce', 'no-preference'] as const) {
+ const indexes = rules.flatMap((rule, index) =>
+ adaptationConditionMatchesCell(
+ rule.when,
+ widthRank,
+ pointer,
+ contrast,
+ motion,
+ )
+ ? [index]
+ : [],
+ );
+ matchSets.set(indexes.join(','), indexes);
+ }
+ }
+ }
+ }
+ const reachable = [...matchSets.values()];
+ REACHABLE_MATCH_SET_CACHE.set(rules, reachable);
+ return reachable;
+}
+
+function effectiveAdaptationTokenValues(
+ rootTokens: Record<string, string>,
+ rootLocalTokens: Record<string, string> | undefined,
+ rootAliases: ReadonlyArray<readonly [string, string]>,
+ rules: ReadonlyArray<ResolvedThemeAdaptationRule>,
+ matchingRuleIndexes: ReadonlyArray<number>,
+ conditionalAliases: ReadonlyArray<
+ ReadonlyArray<readonly [string, string]>
+ > = [],
+): TokenValues {
+ const effective = createTokenCascade(
+ rootTokens,
+ Object.fromEntries(rootAliases),
+ rootLocalTokens,
+ );
+ for (const index of matchingRuleIndexes) {
+ const rule = rules[index];
+ assignTokenCascade(
+ effective,
+ rule.tokens,
+ Object.fromEntries(conditionalAliases[index] ?? []),
+ rule.localTokens,
+ );
+ }
+ // Emission replays authored roles after every ordinary adaptation block so
+ // an explicit role beats aliases from any later overlapping rule.
+ for (const index of matchingRuleIndexes) {
+ assignTokenCascade(
+ effective,
+ Object.fromEntries(authoredStatusRoleEntries(rules[index].tokens)),
+ );
+ }
+ return effective.values;
+}
+
+function retainedAdaptationRules(
+ theme: ThemeRuleSource,
+): ResolvedThemeAdaptationRule[] {
+ if (!('__adaptations' in theme) && !('__adaptationRules' in theme)) {
+ return [];
+ }
+ return resolvedAdaptationRules(theme as DefinedTheme);
+}
+
+/** Root status roles a theme leaves unset: INV17-derived values and INV16 aliases. */
+export function generatedScopedStatusRoleDefaults(
+ tokens: Record<string, string>,
+ localTokens: Record<string, string> = {},
+ rules: ReadonlyArray<ResolvedThemeAdaptationRule> = [],
+): [string, string][] {
+ // INV17: roles a theme leaves unset while setting their status source are
+ // computed against the theme's own surfaces first; the aliases below then
+ // treat them as present, so icon and border roles follow a derived text role.
+ const entries: [string, string][] = deriveStatusRoleTokens(
+ tokens,
+ localTokens,
+ );
+ const authoredRoot = createTokenCascade(
+ tokens,
+ Object.fromEntries(entries),
+ localTokens,
+ ).values;
+ const states = reachableAdaptationMatchSets(rules).map(indexes => ({
+ indexes,
+ values: effectiveAdaptationTokenValues(
+ tokens,
+ localTokens,
+ entries,
+ rules,
+ indexes,
+ ),
+ }));
+
+ for (const [role, source] of SCOPED_STATUS_ROLE_DEFAULTS) {
+ const alias = `var(${source})`;
+ if (
+ authoredRoot[role] !== undefined ||
+ (authoredRoot[source] === undefined &&
+ !entries.some(([emitted]) => emitted === source))
+ ) {
+ continue;
+ }
+ const isSafe = states.every(
+ ({values}) =>
+ values[role] !== undefined ||
+ !tokenValuesWouldHaveCycleWithValue(values, role, alias),
+ );
+ if (isSafe) {
+ entries.push([role, alias]);
+ for (const {values} of states) {
+ if (values[role] === undefined) {
+ values[role] = alias;
+ }
+ }
+ }
+ }
+ // One canonical order whether a role is derived or aliased, so themes that
+ // differ only in which roles needed computing still emit comparable rules.
+ return entries.sort(
+ ([a], [b]) =>
+ (STATUS_ROLE_ORDER.get(a) ?? 0) - (STATUS_ROLE_ORDER.get(b) ?? 0),
+ );
+}
+
+function authoredStatusRoleEntries(
+ tokens: Record<string, string>,
+): [string, string][] {
+ const canonicalTokens = createTokenCascade(tokens).values;
+ return SCOPED_STATUS_ROLE_DEFAULTS.flatMap(([role]) => {
+ const value = canonicalTokens[role];
+ return value === undefined ? [] : [[role, stringifyTokenValue(value)]];
+ });
+}
+
+function tokenValueIsAliasOf(value: unknown, source: string): boolean {
+ return (
+ analyzeDeclarationValue(stringifyTokenValue(value)).singleVarReference ===
+ source
+ );
+}
+
+function mediaRoleRestorationValue(role: string, value: string): string {
+ const source = SCOPED_STATUS_ROLE_SOURCES.get(role);
+ return source !== undefined && tokenValueIsAliasOf(value, source)
+ ? value
+ : 'inherit';
+}
+
+function generatedAdaptationStatusRoleDefaults(
+ rootTokens: Record<string, string>,
+ rootLocalTokens: Record<string, string> | undefined,
+ rules: ReadonlyArray<ResolvedThemeAdaptationRule>,
+ rootAliases: ReadonlyArray<readonly [string, string]>,
+): [string, string][][] {
+ const aliases = rules.map((): [string, string][] => []);
+ const rootValues = createTokenCascade(
+ rootTokens,
+ Object.fromEntries(rootAliases),
+ rootLocalTokens,
+ ).values;
+ const states = reachableAdaptationMatchSets(rules).map(indexes => ({
+ indexes,
+ values: effectiveAdaptationTokenValues(
+ rootTokens,
+ rootLocalTokens,
+ rootAliases,
+ rules,
+ indexes,
+ aliases,
+ ),
+ }));
+
+ for (const [index, rule] of rules.entries()) {
+ const authoredRule = createTokenCascade(
+ rule.tokens,
+ rule.localTokens,
+ ).values;
+ // INV17 in an adaptation: a rule that changes a colour the derivation
+ // measures gets the roles derived from the root and that rule together.
+ if (Object.keys(authoredRule).some(token => STATUS_MEASURED.test(token))) {
+ const ruleDerived = new Map(
+ deriveStatusRoleTokens(
+ {...rootTokens, ...rule.tokens},
+ {...rootLocalTokens, ...rule.localTokens},
+ ),
+ );
+ for (const [role, value] of ruleDerived) {
+ if (authoredRule[role] === undefined && rootValues[role] !== value) {
+ aliases[index].push([role, value]);
+ }
+ }
+ }
+ // Roles this rule derived count as set: they are not overwritten by an
+ // alias, and roles that follow them (icon and border) alias them here.
+ const ruleRoles = new Map(aliases[index]);
+ const ruleSources = {...authoredRule, ...Object.fromEntries(ruleRoles)};
+ for (const [role, source] of SCOPED_STATUS_ROLE_DEFAULTS) {
+ const alias = `var(${source})`;
+ const rootRole = rootValues[role];
+ if (
+ ruleRoles.has(role) ||
+ authoredRule[role] !== undefined ||
+ (ruleSources[source] === undefined &&
+ !aliases[index].some(([emitted]) => emitted === source)) ||
+ rootRole !== undefined
+ ) {
+ continue;
+ }
+
+ const matchingStates = states.filter(({indexes}) =>
+ indexes.includes(index),
+ );
+ const isSafe = matchingStates.every(
+ ({values}) =>
+ values[role] !== undefined ||
+ !tokenValuesWouldHaveCycleWithValue(values, role, alias),
+ );
+ if (isSafe) {
+ aliases[index].push([role, alias]);
+ for (const {values} of matchingStates) {
+ if (values[role] === undefined) {
+ values[role] = alias;
+ }
+ }
+ }
+ }
+ }
+ return aliases;
+}
+
+function generatedMediaStatusRoleDefaults(
+ tokens: Record<string, string>,
+ rootTokens: Record<string, string>,
+ rootLocalTokens: Record<string, string> | undefined,
+ rules: ReadonlyArray<ResolvedThemeAdaptationRule>,
+ rootAliases: ReadonlyArray<readonly [string, string]>,
+): [string, string][] {
+ const aliases: [string, string][] = [];
+ const rootValues = createTokenCascade(
+ rootTokens,
+ Object.fromEntries(rootAliases),
+ rootLocalTokens,
+ ).values;
+ // A media surface sits on content the compiler cannot measure, so a status
+ // colour set there reaches its roles as an INV16 alias, even where the root
+ // holds an INV17-derived value.
+ const rootDerived = new Set(
+ deriveStatusRoleTokens(rootTokens, rootLocalTokens).map(([role]) => role),
+ );
+ const authoredMedia = createTokenCascade(tokens).values;
+ const authoredRolesByRule = rules.map(
+ rule => new Map(authoredStatusRoleEntries(rule.tokens)),
+ );
+ const states = reachableAdaptationMatchSets(rules).map(indexes => ({
+ indexes,
+ values: {...authoredMedia},
+ }));
+ const candidateValueFor = (
+ role: string,
+ alias: string,
+ matchingRuleIndexes: ReadonlyArray<number>,
+ ): string => {
+ const candidate = createTokenCascade({[role]: alias});
+ for (const index of matchingRuleIndexes) {
+ const authoredValue = authoredRolesByRule[index].get(role);
+ if (authoredValue !== undefined) {
+ assignTokenCascade(candidate, {
+ [role]: mediaRoleRestorationValue(role, authoredValue),
+ });
+ }
+ }
+ return stringifyTokenValue(candidate.values[role]);
+ };
+
+ for (const [role, source] of SCOPED_STATUS_ROLE_DEFAULTS) {
+ const alias = `var(${source})`;
+ const rootRole = rootValues[role];
+ if (
+ authoredMedia[role] !== undefined ||
+ (authoredMedia[source] === undefined &&
+ !aliases.some(([emitted]) => emitted === source)) ||
+ (rootRole !== undefined &&
+ !tokenValueIsAliasOf(rootRole, source) &&
+ !rootDerived.has(role))
+ ) {
+ continue;
+ }
+
+ const candidateValues = states.map(({indexes, values}) => ({
+ values,
+ candidate: candidateValueFor(role, alias, indexes),
+ }));
+ const isSafe = candidateValues.every(
+ ({values, candidate}) =>
+ values[role] === candidate ||
+ !tokenValuesWouldHaveCycleWithValue(values, role, candidate),
+ );
+ if (isSafe) {
+ aliases.push([role, alias]);
+ for (const {values, candidate} of candidateValues) {
+ values[role] = candidate;
+ }
+ }
+ }
+ // Content on a fill does not depend on the surface beneath it, so a status
+ // fill set here gets its INV17 content colour (theme-compilation INV17).
+ const mediaFills = new Set(
+ STATUS_NAMES.filter(
+ status =>
+ authoredMedia[`--color-${status}`] !== undefined &&
+ authoredMedia[`--color-on-${status}`] === undefined,
+ ).map(status => `--color-on-${status}`),
+ );
+ if (mediaFills.size > 0) {
+ for (const [role, value] of deriveStatusRoleTokens(
+ {...rootTokens, ...tokens},
+ rootLocalTokens,
+ )) {
+ if (mediaFills.has(role) && rootValues[role] !== value) {
+ aliases.push([role, value]);
+ }
+ }
+ }
+ return aliases;
+}
+
/** The `:scope` token block for portable and theme-local token values. */
function tokenBlock(
source: ThemeRuleSource,
location: string,
sink: DiagnosticSink,
+ tokenEntries: [string, string][] = Object.entries(source.tokens),
): string | null {
const declarations = [
- joinDeclarations(Object.entries(source.tokens), `${location}tokens`, sink),
+ joinDeclarations(tokenEntries, `${location}tokens`, sink),
joinDeclarations(
Object.entries(source.localTokens ?? {}),
`${location}localTokens`,
@@ -474,8 +991,7 @@ function tokenBlock(
.filter(block => block.length > 0)
.join('\n');
const hasEntries =
- Object.keys(source.tokens).length > 0 ||
- Object.keys(source.localTokens ?? {}).length > 0;
+ tokenEntries.length > 0 || Object.keys(source.localTokens ?? {}).length > 0;
return hasEntries ? ` :scope {\n${declarations}\n }` : null;
}
@@ -515,6 +1031,96 @@ export interface ThemeRuleSource {
components?: ComponentStyleMap;
}
+interface StatusRoleGenerationContext {
+ theme: DefinedTheme;
+ rules: ResolvedThemeAdaptationRule[];
+ rootAliases: [string, string][];
+ adaptationAliases?: [string, string][][];
+}
+
+interface StatusRoleGenerationCacheEntry {
+ signature: string;
+ context: StatusRoleGenerationContext;
+}
+
+const STATUS_ROLE_GENERATION_CACHE = new WeakMap<
+ DefinedTheme,
+ StatusRoleGenerationCacheEntry
+>();
+
+let activeStatusRoleGeneration: StatusRoleGenerationContext | undefined;
+
+function tokenSetSignature(
+ tokens: Record<string, unknown> | undefined,
+): (readonly [string, string, string])[] {
+ return Object.entries(tokens ?? {}).map(
+ ([name, value]): readonly [string, string, string] => [
+ name,
+ typeof value,
+ stringifyTokenValue(value),
+ ],
+ );
+}
+
+function statusRoleGenerationSignature(
+ theme: DefinedTheme,
+ rules: ReadonlyArray<ResolvedThemeAdaptationRule>,
+): string {
+ return JSON.stringify([
+ tokenSetSignature(theme.tokens),
+ tokenSetSignature(theme.localTokens),
+ rules.map(rule => [
+ rule.query,
+ rule.when,
+ tokenSetSignature(rule.tokens),
+ tokenSetSignature(rule.localTokens),
+ rule.components,
+ ]),
+ ]);
+}
+
+function createStatusRoleGenerationContext(
+ theme: DefinedTheme,
+): StatusRoleGenerationContext {
+ const rules = resolvedAdaptationRules(theme);
+ const signature = statusRoleGenerationSignature(theme, rules);
+ const cached = STATUS_ROLE_GENERATION_CACHE.get(theme);
+ if (cached?.signature === signature) {
+ return cached.context;
+ }
+ const context: StatusRoleGenerationContext = {
+ theme,
+ rules,
+ rootAliases: generatedScopedStatusRoleDefaults(
+ theme.tokens,
+ theme.localTokens,
+ rules,
+ ),
+ };
+ STATUS_ROLE_GENERATION_CACHE.set(theme, {signature, context});
+ return context;
+}
+
+function statusRoleGenerationContext(
+ theme: DefinedTheme,
+): StatusRoleGenerationContext {
+ return activeStatusRoleGeneration?.theme === theme
+ ? activeStatusRoleGeneration
+ : createStatusRoleGenerationContext(theme);
+}
+
+function adaptationStatusRoleDefaults(
+ context: StatusRoleGenerationContext,
+): [string, string][][] {
+ context.adaptationAliases ??= generatedAdaptationStatusRoleDefaults(
+ context.theme.tokens,
+ context.theme.localTokens,
+ context.rules,
+ context.rootAliases,
+ );
+ return context.adaptationAliases;
+}
+
export function generateThemeRules(
theme: ThemeRuleSource,
warnings?: string[],
@@ -527,8 +1133,20 @@ export function generateThemeRules(
// without duplicating prose selectors inside every media query.
const val = (key: string): string => `var(${key})`;
- // 1. Token block — CSS custom properties on :scope
- const tokenRules = tokenBlock(theme, '', sink);
+ // 1. Token block — CSS custom properties on :scope. Source-derived status
+ // aliases live here once; conditional rules only emit authored writes.
+ const context =
+ activeStatusRoleGeneration?.theme === theme
+ ? activeStatusRoleGeneration
+ : undefined;
+ const rules = context?.rules ?? retainedAdaptationRules(theme);
+ const rootAliases =
+ context?.rootAliases ??
+ generatedScopedStatusRoleDefaults(theme.tokens, theme.localTokens, rules);
+ const tokenRules = tokenBlock(theme, '', sink, [
+ ...Object.entries(theme.tokens),
+ ...rootAliases,
+ ]);
if (tokenRules !== null) {
parts.push(tokenRules);
}
@@ -537,8 +1155,8 @@ export function generateThemeRules(
// Components styled with `font-family: inherit` (SideNav items, Buttons)
// otherwise resolve against the browser default serif, since nothing else
// sets a page font. `font-family` inherits, so one rule on :scope covers
- // the tree. Only emitted when the theme declares a body font, so a bare
- // theme still contributes no scope rules of its own.
+ // the tree. Only emitted when the theme declares a body font; a bare theme
+ // still contributes no font rule of its own.
if (theme.tokens['--font-family-body']) {
parts.push(` :scope {\n font-family: var(--font-family-body);\n }`);
}
@@ -1001,6 +1619,34 @@ export function generateThemeRulesSplit(
return {component, prose};
}
+function resolvedAdaptationRules(
+ theme: DefinedTheme,
+): ResolvedThemeAdaptationRule[] {
+ // Retained metadata is part of the built-theme contract. Validate it even
+ // when a concrete rule cache is present so a stale or malformed breakpoint
+ // map cannot bypass the same checks live themes receive.
+ const normalized =
+ theme.__adaptations === undefined
+ ? undefined
+ : normalizeThemeAdaptations(theme.name, theme.__adaptations, undefined);
+ if (Array.isArray(theme.__adaptationRules)) {
+ return theme.__adaptationRules;
+ }
+ if (normalized === undefined) {
+ return [];
+ }
+ return (
+ resolveThemeAdaptationRules(
+ theme.name,
+ normalized,
+ theme.__axes ?? {},
+ theme.tokens,
+ theme.localTokens,
+ theme.components,
+ ) ?? []
+ );
+}
+
/**
* Generate CSS for on-media token and component overrides.
*
@@ -1016,6 +1662,12 @@ export function generateOnMediaCSS(
const parts: string[] = [];
const scopeSelector = themeScopeStart(theme.name);
const sink = diagnosticSink(warnings);
+ const context = statusRoleGenerationContext(theme);
+ const {rules, rootAliases} = context;
+ const mediaStatusRoleDefaults = new Map<
+ 'dark' | 'light',
+ [string, string][]
+ >();
for (const surface of ['dark', 'light'] as const) {
const onMedia = surface === 'dark' ? theme.__onDark : theme.__onLight;
@@ -1024,8 +1676,20 @@ export function generateOnMediaCSS(
}
const location = surface === 'dark' ? 'onDark.' : 'onLight.';
- // Token overrides
- const tokenEntries = Object.entries(onMedia.tokens);
+ // Token overrides. MediaTheme writes on a descendant surface, so a source
+ // alias must be local unless an authored root/adaptation role owns it.
+ const statusRoleDefaults = generatedMediaStatusRoleDefaults(
+ onMedia.tokens,
+ theme.tokens,
+ theme.localTokens,
+ rules,
+ rootAliases,
+ );
+ mediaStatusRoleDefaults.set(surface, statusRoleDefaults);
+ const tokenEntries = [
+ ...Object.entries(onMedia.tokens),
+ ...statusRoleDefaults,
+ ];
if (tokenEntries.length > 0) {
const declarations = joinDeclarations(
tokenEntries,
@@ -1057,12 +1721,54 @@ export function generateOnMediaCSS(
}
}
- if (parts.length === 0) {
+ const adaptationMediaRoleBlocks: string[] = [];
+ for (const [index, rule] of rules.entries()) {
+ const authoredRoles = authoredStatusRoleEntries(rule.tokens);
+ if (authoredRoles.length === 0) {
+ continue;
+ }
+ const roleParts: string[] = [];
+ for (const surface of ['dark', 'light'] as const) {
+ const onMedia = surface === 'dark' ? theme.__onDark : theme.__onLight;
+ if (!onMedia) {
+ continue;
+ }
+ const generatedRoles = new Set(
+ (mediaStatusRoleDefaults.get(surface) ?? []).map(([role]) => role),
+ );
+ const restorationEntries: [string, string][] = authoredRoles
+ .filter(([role]) => generatedRoles.has(role))
+ .map(([role, value]) => [role, mediaRoleRestorationValue(role, value)]);
+ if (restorationEntries.length === 0) {
+ continue;
+ }
+ const declarations = joinDeclarations(
+ restorationEntries,
+ `adaptations[${index}].on${surface}.statusRoles.`,
+ sink,
+ );
+ roleParts.push(` ${mediaSelector(surface)} {\n${declarations}\n }`);
+ }
+ if (roleParts.length > 0) {
+ adaptationMediaRoleBlocks.push(
+ generateAdaptationMediaBlock(rule.query, roleParts, scopeSelector),
+ );
+ }
+ }
+
+ if (parts.length === 0 && adaptationMediaRoleBlocks.length === 0) {
return '';
}
- const inner = parts.join('\n\n');
- return `@scope (${scopeSelector}) to (${THEME_SCOPE_TO}) {\n${inner}\n}`;
+ const blocks: string[] = [];
+ if (parts.length > 0) {
+ const inner = parts.join('\n\n');
+ blocks.push(
+ `@scope (${scopeSelector}) to (${THEME_SCOPE_TO}) {\n${inner}\n}`,
+ );
+ }
+ blocks.push(...adaptationMediaRoleBlocks);
+ return blocks.join('\n\n');
}
/** Generate only the declarations one adaptation rule writes. */
@@ -1070,9 +1776,13 @@ function generateAdaptationRuleRules(
rule: ThemeRuleSource,
location: string,
sink: DiagnosticSink,
+ statusRoleDefaults: [string, string][],
): string[] {
const parts: string[] = [];
- const tokens = tokenBlock(rule, location, sink);
+ const tokens = tokenBlock(rule, location, sink, [
+ ...Object.entries(rule.tokens),
+ ...statusRoleDefaults,
+ ]);
if (tokens !== null) {
parts.push(tokens);
}
@@ -1125,25 +1835,11 @@ export function generateAdaptationCSS(
): ThemeCSSOutput {
const sink = diagnosticSink(warnings);
// Built themes can reach this compiler without passing through defineTheme.
- // Validate retained metadata even when it has no rules (and therefore emits
- // no CSS): width points remain observable through AppShell and inheritance.
- const normalizedAdaptations =
- theme.__adaptations === undefined
- ? undefined
- : normalizeThemeAdaptations(theme.name, theme.__adaptations, undefined);
- const rules =
- theme.__adaptationRules ??
- (normalizedAdaptations
- ? resolveThemeAdaptationRules(
- theme.name,
- normalizedAdaptations,
- theme.__axes ?? {},
- theme.tokens,
- theme.localTokens,
- theme.components,
- )
- : undefined);
- if (!rules || rules.length === 0) {
+ // Resolve retained metadata so width points remain observable through
+ // AppShell and inheritance even when a rule emits no CSS.
+ const context = statusRoleGenerationContext(theme);
+ const {rules} = context;
+ if (rules.length === 0) {
return {prose: '', component: ''};
}
@@ -1153,6 +1849,8 @@ export function generateAdaptationCSS(
hasHeadingComponentRules(rule.components),
);
+ const statusRoleDefaults = adaptationStatusRoleDefaults(context);
+
// Emit ordinary rule writes first, without inherited Heading weight
// fallbacks. Carrying an earlier weight into a later block makes that value
// active whenever the later condition matches, even if the earlier condition
@@ -1163,6 +1861,7 @@ export function generateAdaptationCSS(
rule,
`adaptations[${index}].`,
sink,
+ statusRoleDefaults[index],
);
if (parts.length === 0) {
continue;
@@ -1170,6 +1869,28 @@ export function generateAdaptationCSS(
blocks.push(generateAdaptationMediaBlock(rule.query, parts, scopeSelector));
}
+ // Replay explicit role writes after every generated source alias. This keeps
+ // an authored role authoritative when its condition overlaps a later rule
+ // that changes only the role's source, while the alias still works when the
+ // authored-role condition is inactive.
+ for (const [index, rule] of rules.entries()) {
+ const roleEntries = authoredStatusRoleEntries(rule.tokens);
+ if (roleEntries.length === 0) {
+ continue;
+ }
+ const roleRule = tokenBlock(
+ {tokens: {}},
+ `adaptations[${index}].statusRoles.`,
+ sink,
+ roleEntries,
+ );
+ if (roleRule !== null) {
+ blocks.push(
+ generateAdaptationMediaBlock(rule.query, [roleRule], scopeSelector),
+ );
+ }
+ }
+
if (adaptsHeading) {
// Put one unconditional effective-root guard after every ordinary
// adaptation block. It restores the public weight prop above every
@@ -1231,6 +1952,22 @@ function indentRule(rule: string): string {
export function generateThemeCSS(
theme: DefinedTheme,
warnings?: string[],
+): ThemeCSSOutput {
+ if (activeStatusRoleGeneration?.theme === theme) {
+ return generateThemeCSSWithContext(theme, warnings);
+ }
+ const previous = activeStatusRoleGeneration;
+ activeStatusRoleGeneration = createStatusRoleGenerationContext(theme);
+ try {
+ return generateThemeCSSWithContext(theme, warnings);
+ } finally {
+ activeStatusRoleGeneration = previous;
+ }
+}
+
+function generateThemeCSSWithContext(
+ theme: DefinedTheme,
+ warnings?: string[],
): ThemeCSSOutput {
const {component, prose} = generateThemeRulesSplit(theme, warnings);
const scopeSelector = themeScopeStart(theme.name);
diff --git a/packages/core/src/theme/onMediaTokens.test.ts b/packages/core/src/theme/onMediaTokens.test.ts
index 9464252f6a..d2c26ff538 100644
--- a/packages/core/src/theme/onMediaTokens.test.ts
+++ b/packages/core/src/theme/onMediaTokens.test.ts
@@ -146,6 +146,7 @@ describe('generateOnMediaCSS', () => {
expect(css).toContain('[data-astryx-media="dark"]');
expect(css).toContain('color-scheme: dark');
expect(css).toContain('var(--color-on-dark)');
+ expect(css).not.toContain('--color-text-info: var(--color-text-blue);');
});
it('emits light media rules', () => {
@@ -155,6 +156,191 @@ describe('generateOnMediaCSS', () => {
expect(css).toContain('color-scheme: light');
});
+ it('keeps concrete root roles while rebinding default aliases on media surfaces', () => {
+ const concrete = defineTheme({
+ name: 'status-role-media',
+ tokens: {
+ '--color-text-blue': '#0074E2',
+ '--color-text-info': '#6D9CFE',
+ },
+ onDark: {tokens: {'--color-text-blue': '#FFFFFF'}},
+ });
+ const concreteCss = generateOnMediaCSS(concrete);
+
+ expect(concreteCss).toContain('--color-text-blue: #FFFFFF;');
+ expect(concreteCss).not.toContain(
+ '--color-text-info: var(--color-text-blue);',
+ );
+
+ const canonical = defineTheme({
+ name: 'status-role-media-alias',
+ tokens: {
+ '--color-text-blue': '#0074E2',
+ '--color-text-info': 'var(--color-text-blue)',
+ },
+ onDark: {
+ tokens: {
+ '--color-text-blue': '#FFFFFF',
+ },
+ },
+ });
+ const canonicalCss = generateOnMediaCSS(canonical);
+
+ expect(canonicalCss).toContain('--color-text-blue: #FFFFFF;');
+ expect(canonicalCss).toContain(
+ '--color-text-info: var(--color-text-blue);',
+ );
+ });
+
+ it.each([
+ 'VAR( /*x*/ --color-text-blue ) !important',
+ 'v\\61r(--color-text-blue)',
+ 'var( --color-text-blue )',
+ 'var(--color-text-blue) !important',
+ ])('rebinds a semantically equivalent authored root alias: %s', info => {
+ const theme = defineTheme({
+ name: 'status-role-media-equivalent-alias',
+ tokens: {
+ '--color-text-blue': '#0074E2',
+ '--color-text-info': info,
+ },
+ onDark: {
+ tokens: {
+ '--color-text-blue': '#FFFFFF',
+ },
+ },
+ });
+
+ expect(generateOnMediaCSS(theme)).toContain(
+ '--color-text-info: var(--color-text-blue);',
+ );
+ });
+
+ it('does not let a media alias override an adaptation-authored role', () => {
+ const theme = defineTheme({
+ name: 'status-role-media-adaptation',
+ adaptations: {
+ rules: [
+ {
+ when: {contrast: 'more'},
+ value: {tokens: {'--color-text-info': '#123456'}},
+ },
+ ],
+ },
+ onDark: {
+ tokens: {
+ '--color-text-blue': '#FFFFFF',
+ },
+ },
+ });
+ const css = generateOnMediaCSS(theme);
+
+ expect(css).toContain('--color-text-blue: #FFFFFF;');
+ expect(css).toContain('--color-text-info: var(--color-text-blue);');
+ expect(css).toContain('--color-text-info: inherit;');
+ expect(css.lastIndexOf('--color-text-info: inherit;')).toBeGreaterThan(
+ css.lastIndexOf('--color-text-info: var(--color-text-blue);'),
+ );
+ });
+
+ it('inherits non-default adaptation roles instead of re-resolving them locally', () => {
+ const theme = defineTheme({
+ name: 'status-role-media-inherit',
+ tokens: {'--color-text-purple': '#123456'},
+ adaptations: {
+ rules: [
+ {
+ when: {contrast: 'more'},
+ value: {
+ tokens: {'--color-text-info': 'var(--color-text-purple)'},
+ },
+ },
+ ],
+ },
+ onDark: {
+ tokens: {
+ '--color-text-purple': '#ffffff',
+ '--color-text-blue': '#ffffff',
+ },
+ },
+ });
+ const css = generateOnMediaCSS(theme);
+
+ expect(css).toContain('--color-text-info: inherit;');
+ expect(css).not.toContain('--color-text-info: var(--color-text-purple);');
+ });
+
+ it('avoids a descendant-local cycle while replaying an adaptation role', () => {
+ const theme = defineTheme({
+ name: 'status-role-media-replay-cycle',
+ adaptations: {
+ rules: [
+ {
+ when: {contrast: 'more'},
+ value: {
+ tokens: {'--color-text-info': 'var(--color-text-blue)'},
+ },
+ },
+ ],
+ },
+ onDark: {tokens: {'--color-text-blue': 'var(--color-text-info)'}},
+ });
+ const css = generateOnMediaCSS(theme);
+ const darkBlocks = Array.from(
+ css.matchAll(/\[data-astryx-media="dark"\] \{([\s\S]*?)\n\s*\}/g),
+ match => match[1],
+ );
+
+ expect(darkBlocks.length).toBeGreaterThan(0);
+ for (const block of darkBlocks) {
+ expect(block).not.toContain('--color-text-info: var(--color-text-blue);');
+ expect(block).not.toContain('--color-text-info: var(--color-text-blue);');
+ }
+ });
+
+ it('uses inheritance when multiple local role replays would form a cycle', () => {
+ const theme = defineTheme({
+ name: 'status-role-multi-replay-cycle',
+ adaptations: {
+ rules: [
+ {
+ when: {contrast: 'more'},
+ value: {
+ tokens: {
+ '--color-text-info': 'var(--color-on-info-muted)',
+ '--color-on-info-muted': 'var(--color-text-green)',
+ },
+ },
+ },
+ ],
+ },
+ onDark: {
+ tokens: {
+ '--color-text-blue': '#ffffff',
+ '--color-text-green': 'var(--color-text-info)',
+ },
+ },
+ });
+ const css = generateOnMediaCSS(theme);
+ const alias = '--color-on-info-muted: var(--color-text-blue);';
+ const restoration = '--color-on-info-muted: inherit;';
+ expect(css).toContain(alias);
+ expect(css).toContain(restoration);
+ expect(css.lastIndexOf(restoration)).toBeGreaterThan(
+ css.lastIndexOf(alias),
+ );
+ });
+
+ it('stringifies a legacy non-string media status source without throwing', () => {
+ const theme = defineTheme({
+ name: 'legacy-media-status-source',
+ onDark: {tokens: {'--color-text-blue': null as never}},
+ });
+
+ expect(() => generateOnMediaCSS(theme)).not.toThrow();
+ expect(generateOnMediaCSS(theme)).toContain('--color-text-blue: null;');
+ });
+
it('emits component override rules', () => {
const theme = defineTheme({
name: 'test',
diff --git a/packages/core/src/theme/statusColor.ts b/packages/core/src/theme/statusColor.ts
new file mode 100644
index 0000000000..202edf1744
--- /dev/null
+++ b/packages/core/src/theme/statusColor.ts
@@ -0,0 +1,189 @@
+// Copyright (c) Meta Platforms, Inc. and affiliates.
+
+/**
+ * @file statusColor.ts
+ * @input Concrete sRGB colours (hex or rgb()) from resolved theme tokens
+ * @output Contrast, OKLCH, chroma, and lightness-solving helpers for status roles
+ * @position Pure colour maths shared by status-role derivation
+ * (architecture:theme-compilation INV17) and the status contrast checks.
+ *
+ * Contrast follows WCAG 2.x relative luminance. Lightness adjustments move a
+ * colour along OKLCH lightness at its own hue, reducing chroma only as far as
+ * needed to stay inside sRGB, so a derived role keeps its status hue.
+ */
+
+import {formatHex, parseColor, type RGBA} from '../utils/color';
+
+export interface OKLCH {
+ l: number;
+ c: number;
+ h: number;
+}
+
+const toLinear = (v: number): number => {
+ const c = v / 255;
+ return c <= 0.04045 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;
+};
+
+const fromLinear = (v: number): number => {
+ const c = v <= 0.0031308 ? 12.92 * v : 1.055 * v ** (1 / 2.4) - 0.055;
+ return c * 255;
+};
+
+/** Composite a possibly translucent colour over an opaque backdrop. */
+export function composite(top: RGBA, under: RGBA): RGBA {
+ const a = top.a;
+ return {
+ r: top.r * a + under.r * (1 - a),
+ g: top.g * a + under.g * (1 - a),
+ b: top.b * a + under.b * (1 - a),
+ a: 1,
+ };
+}
+
+/** WCAG relative luminance of an opaque colour. */
+export function relativeLuminance({r, g, b}: RGBA): number {
+ return 0.2126 * toLinear(r) + 0.7152 * toLinear(g) + 0.0722 * toLinear(b);
+}
+
+/** WCAG contrast ratio. A translucent foreground is composited over the background first. */
+export function contrastRatio(foreground: RGBA, background: RGBA): number {
+ const bg =
+ background.a < 1
+ ? composite(background, {r: 255, g: 255, b: 255, a: 1})
+ : background;
+ const fg = foreground.a < 1 ? composite(foreground, bg) : foreground;
+ const a = relativeLuminance(fg);
+ const b = relativeLuminance(bg);
+ return (Math.max(a, b) + 0.05) / (Math.min(a, b) + 0.05);
+}
+
+/** Convert opaque sRGB to OKLCH. */
+export function toOklch({r, g, b}: RGBA): OKLCH {
+ const lr = toLinear(r);
+ const lg = toLinear(g);
+ const lb = toLinear(b);
+ const l = Math.cbrt(
+ 0.4122214708 * lr + 0.5363325363 * lg + 0.0514459929 * lb,
+ );
+ const m = Math.cbrt(
+ 0.2119034982 * lr + 0.6806995451 * lg + 0.1073969566 * lb,
+ );
+ const s = Math.cbrt(
+ 0.0883024619 * lr + 0.2817188376 * lg + 0.6299787005 * lb,
+ );
+ const L = 0.2104542553 * l + 0.793617785 * m - 0.0040720468 * s;
+ const A = 1.9779984951 * l - 2.428592205 * m + 0.4505937099 * s;
+ const B = 0.0259040371 * l + 0.7827717662 * m - 0.808675766 * s;
+ return {l: L, c: Math.hypot(A, B), h: Math.atan2(B, A)};
+}
+
+function oklchToLinear({l: L, c, h}: OKLCH): [number, number, number] {
+ const A = c * Math.cos(h);
+ const B = c * Math.sin(h);
+ const l = (L + 0.3963377774 * A + 0.2158037573 * B) ** 3;
+ const m = (L - 0.1055613458 * A - 0.0638541728 * B) ** 3;
+ const s = (L - 0.0894841775 * A - 1.291485548 * B) ** 3;
+ return [
+ 4.0767416621 * l - 3.3077115913 * m + 0.2309699292 * s,
+ -1.2684380046 * l + 2.6097574011 * m - 0.3413193965 * s,
+ -0.0041960863 * l - 0.7034186147 * m + 1.707614701 * s,
+ ];
+}
+
+/** Convert OKLCH to sRGB, reducing chroma at the same lightness and hue until it fits. */
+export function fromOklch(color: OKLCH): RGBA {
+ let c = color.c;
+ for (let i = 0; i < 40; i++) {
+ const rgb = oklchToLinear({...color, c});
+ if (rgb.every(v => v >= -1e-4 && v <= 1 + 1e-4)) {
+ const [r, g, b] = rgb.map(v => fromLinear(Math.min(1, Math.max(0, v))));
+ return {r, g, b, a: 1};
+ }
+ c *= 0.9;
+ }
+ const [r, g, b] = oklchToLinear({...color, c: 0}).map(v =>
+ fromLinear(Math.min(1, Math.max(0, v))),
+ );
+ return {r, g, b, a: 1};
+}
+
+/** Lowest chroma and lightness band a status colour may occupy and still read as a hue. */
+export const STATUS_CHROMA_FLOOR = 0.03;
+export const STATUS_LIGHTNESS_RANGE: readonly [number, number] = [0.2, 0.95];
+
+/**
+ * Whether a colour reads as a hue rather than a neutral grey, near-black, or
+ * near-white (architecture:theme-tokens INV11). Translucent colours are judged
+ * on their own channels.
+ */
+export function isChromatic(color: RGBA): boolean {
+ const {l, c} = toOklch(color);
+ return (
+ c >= STATUS_CHROMA_FLOOR &&
+ l >= STATUS_LIGHTNESS_RANGE[0] &&
+ l <= STATUS_LIGHTNESS_RANGE[1]
+ );
+}
+
+/**
+ * Move `color` along OKLCH lightness, at its own hue, until it reaches
+ * `ratio` against every backdrop. Moves away from the backdrops' luminance;
+ * returns the colour unchanged when it already passes, or null when no
+ * lightness at that hue reaches the ratio.
+ */
+export function solveLightness(
+ color: RGBA,
+ backdrops: ReadonlyArray<RGBA>,
+ ratio: number,
+): RGBA | null {
+ const passes = (candidate: RGBA): boolean =>
+ backdrops.every(backdrop => contrastRatio(candidate, backdrop) >= ratio);
+ const opaque = {...color, a: 1};
+ if (passes(opaque)) {
+ return opaque;
+ }
+ const meanLuminance =
+ backdrops.reduce((sum, b) => sum + relativeLuminance(b), 0) /
+ backdrops.length;
+ const base = toOklch(opaque);
+ // Light backdrops need a darker colour; dark backdrops a lighter one.
+ const darker = meanLuminance > 0.18;
+ let lo = darker ? 0 : base.l;
+ let hi = darker ? base.l : 1;
+ const at = (l: number): RGBA => fromOklch({...base, l});
+ const target = darker ? at(0) : at(1);
+ if (!passes(target)) {
+ return null;
+ }
+ // Binary search for the passing lightness closest to the original.
+ for (let i = 0; i < 32; i++) {
+ const mid = (lo + hi) / 2;
+ const ok = passes(at(mid));
+ if (darker) {
+ if (ok) {lo = mid;}
+ else {hi = mid;}
+ } else if (ok) {hi = mid;}
+ else {lo = mid;}
+ }
+ const solved = at(darker ? lo : hi);
+ return passes(solved) ? solved : target;
+}
+
+/** Parse a concrete colour, returning null for anything unresolved. */
+export function parseConcreteColor(value: string | undefined): RGBA | null {
+ return value === undefined ? null : parseColor(value);
+}
+
+/** `#RRGGBB` or `#RRGGBBAA` for a colour. */
+export function toHex(color: RGBA): string {
+ const hex = formatHex(color.r, color.g, color.b);
+ if (color.a >= 1) {
+ return hex;
+ }
+ const alpha = Math.round(color.a * 255)
+ .toString(16)
+ .padStart(2, '0')
+ .toUpperCase();
+ return `${hex}${alpha}`;
+}
diff --git a/packages/core/src/theme/statusRoleDerivation.ts b/packages/core/src/theme/statusRoleDerivation.ts
new file mode 100644
index 0000000000..244b83cb34
--- /dev/null
+++ b/packages/core/src/theme/statusRoleDerivation.ts
@@ -0,0 +1,289 @@
+// Copyright (c) Meta Platforms, Inc. and affiliates.
+
+/**
+ * @file statusRoleDerivation.ts
+ * @input A theme's portable and local token maps
+ * @output Concrete values for the status roles the theme does not set
+ * @position Theme generation step for architecture:theme-compilation INV17,
+ * called by generateThemeRules for runtime and static output alike.
+ *
+ * Each status (`info`, `success`, `warning`, `error`) has one strong fill,
+ * `--color-<status>`. A theme that sets a fill, its content, its pale fill, or
+ * a surface gets the roles it leaves unset, computed against its own colours:
+ * - `--color-on-<status>`: the theme's light or dark content colour
+ * (`--color-on-dark` or `--color-on-light`), whichever contrasts more with
+ * the fill, or pure white or black when neither reaches 4.5:1;
+ * - `--color-text-<status>`: the fill's hue at 4.5:1 on surface and card;
+ * - `--color-on-<status>-muted`: the fill's hue at 4.5:1 on the pale fill over
+ * the surface.
+ * Fills are never derived: a fill a theme does not set is Core's. Icon and
+ * border roles alias the text role through the scoped status-role aliases in
+ * generateThemeRules, so they are not computed here.
+ */
+
+import {colorDefaults} from './tokens.stylex';
+import {
+ composite,
+ contrastRatio,
+ isChromatic,
+ parseConcreteColor,
+ solveLightness,
+ toHex,
+} from './statusColor';
+import type {RGBA} from '../utils/color';
+
+export const STATUS_NAMES = ['info', 'success', 'warning', 'error'] as const;
+export type StatusName = (typeof STATUS_NAMES)[number];
+
+type ResolvedThemeMode = 'light' | 'dark';
+
+const TEXT_RATIO = 4.5;
+// Solve slightly above the floor so rounding to #RRGGBB never lands below it.
+const SOLVE_RATIO = TEXT_RATIO + 0.08;
+const MODES: ReadonlyArray<ResolvedThemeMode> = ['light', 'dark'];
+
+/** The strong fill of a status, the source its other roles derive from. */
+export function statusSourceToken(status: StatusName): string {
+ return `--color-${status}`;
+}
+
+function splitTopLevel(input: string): string[] {
+ const parts: string[] = [];
+ let depth = 0;
+ let current = '';
+ for (const ch of input) {
+ if (ch === '(') {
+ depth++;
+ }
+ if (ch === ')') {
+ depth--;
+ }
+ if (ch === ',' && depth === 0) {
+ parts.push(current.trim());
+ current = '';
+ continue;
+ }
+ current += ch;
+ }
+ parts.push(current.trim());
+ return parts;
+}
+
+/**
+ * Resolve one token to a concrete value for a mode, following `light-dark()`
+ * and `var()` through the theme's tokens and then Core's colour defaults.
+ * This stays local (rather than using tokens.ts) so theme generation does not
+ * import the runtime token helpers that themselves depend on defineTheme.
+ */
+function resolveToken(
+ tokens: Record<string, unknown>,
+ name: string,
+ mode: ResolvedThemeMode,
+ seen: ReadonlySet<string> = new Set(),
+): string | undefined {
+ if (seen.has(name)) {
+ return undefined;
+ }
+ const raw = tokens[name] ?? (colorDefaults as Record<string, string>)[name];
+ return resolveValue(tokens, raw, mode, new Set([...seen, name]));
+}
+
+function resolveValue(
+ tokens: Record<string, unknown>,
+ raw: unknown,
+ mode: ResolvedThemeMode,
+ seen: ReadonlySet<string>,
+): string | undefined {
+ if (Array.isArray(raw)) {
+ return resolveValue(tokens, raw[mode === 'light' ? 0 : 1], mode, seen);
+ }
+ if (typeof raw !== 'string') {
+ return undefined;
+ }
+ const value = raw.trim();
+ if (/^light-dark\(/i.test(value) && value.endsWith(')')) {
+ const [light, dark] = splitTopLevel(
+ value.slice(value.indexOf('(') + 1, -1),
+ );
+ return resolveValue(tokens, mode === 'light' ? light : dark, mode, seen);
+ }
+ const ref = /^var\(\s*(--[\w-]+)\s*(?:,(.*))?\)$/s.exec(value);
+ if (ref) {
+ const resolved = resolveToken(tokens, ref[1], mode, seen);
+ return (
+ resolved ??
+ (ref[2] ? resolveValue(tokens, ref[2], mode, seen) : undefined)
+ );
+ }
+ return value;
+}
+
+const CORE_TOKENS: Record<string, unknown> = {};
+
+function resolveModes(
+ tokens: Record<string, unknown>,
+): Record<ResolvedThemeMode, Record<string, string>> {
+ const names = new Set([
+ ...Object.keys(colorDefaults),
+ ...Object.keys(tokens),
+ ]);
+ const at = (mode: ResolvedThemeMode): Record<string, string> => {
+ const out: Record<string, string> = {};
+ for (const name of names) {
+ const value = resolveToken(tokens, name, mode);
+ if (value !== undefined) {
+ out[name] = value;
+ }
+ }
+ return out;
+ };
+ return {light: at('light'), dark: at('dark')};
+}
+
+let coreCache: Record<ResolvedThemeMode, Record<string, string>> | undefined;
+function core(): Record<ResolvedThemeMode, Record<string, string>> {
+ coreCache ??= resolveModes(CORE_TOKENS);
+ return coreCache;
+}
+
+function statusHue(
+ status: StatusName,
+ resolved: Record<string, string>,
+ mode: ResolvedThemeMode,
+): RGBA | null {
+ const color = parseConcreteColor(resolved[statusSourceToken(status)]);
+ if (color !== null && isChromatic(color)) {
+ return {...color, a: 1};
+ }
+ // A grey source falls back to Core's own status hue, so derived text stays
+ // chromatic.
+ const fallback = parseConcreteColor(core()[mode][statusSourceToken(status)]);
+ return fallback === null ? null : {...fallback, a: 1};
+}
+
+function opaqueOver(color: RGBA, under: RGBA): RGBA {
+ return color.a < 1 ? composite(color, under) : color;
+}
+
+interface ModeRoles {
+ on?: RGBA;
+ text?: RGBA;
+ onMuted?: RGBA;
+}
+
+function deriveForMode(
+ status: StatusName,
+ resolved: Record<string, string>,
+ mode: ResolvedThemeMode,
+): ModeRoles | null {
+ // Every colour the computations measure must be concrete. When one is not
+ // (an oklch() value, an unknown reference), the status keeps its scoped
+ // aliases instead of a guess (architecture:theme-compilation INV17).
+ const source = parseConcreteColor(resolved[statusSourceToken(status)]);
+ const hue = statusHue(status, resolved, mode);
+ const surface = parseConcreteColor(resolved['--color-background-surface']);
+ const cardColor = parseConcreteColor(resolved['--color-background-card']);
+ const muted = parseConcreteColor(resolved[`--color-${status}-muted`]);
+ const onDark = parseConcreteColor(resolved['--color-on-dark']);
+ const onLight = parseConcreteColor(resolved['--color-on-light']);
+ if (
+ source === null ||
+ hue === null ||
+ surface === null ||
+ cardColor === null ||
+ muted === null ||
+ onDark === null ||
+ onLight === null
+ ) {
+ return null;
+ }
+ const opaqueSurface = opaqueOver(surface, {r: 255, g: 255, b: 255, a: 1});
+ const card = opaqueOver(cardColor, opaqueSurface);
+ const fill = opaqueOver(source, opaqueSurface);
+ const roles: ModeRoles = {};
+
+ const lightInk = opaqueOver(onDark, fill);
+ const darkInk = opaqueOver(onLight, fill);
+ const themeInk =
+ contrastRatio(lightInk, fill) >= contrastRatio(darkInk, fill)
+ ? lightInk
+ : darkInk;
+ // A theme's off-white and off-black content can both miss the floor on a
+ // mid-tone fill; pure white or black always reaches it.
+ const white = {r: 255, g: 255, b: 255, a: 1};
+ const black = {r: 0, g: 0, b: 0, a: 1};
+ roles.on =
+ contrastRatio(themeInk, fill) >= TEXT_RATIO
+ ? themeInk
+ : contrastRatio(white, fill) >= contrastRatio(black, fill)
+ ? white
+ : black;
+
+ const text = solveLightness(hue, [opaqueSurface, card], SOLVE_RATIO);
+ if (text !== null) {
+ roles.text = text;
+ }
+
+ const pale = composite(muted.a < 1 ? muted : {...muted, a: 1}, opaqueSurface);
+ const onMuted = solveLightness(hue, [pale], SOLVE_RATIO);
+ if (onMuted !== null) {
+ roles.onMuted = onMuted;
+ }
+ return roles;
+}
+
+const ROLE_TOKENS: Record<keyof ModeRoles, (status: StatusName) => string> = {
+ on: s => `--color-on-${s}`,
+ text: s => `--color-text-${s}`,
+ onMuted: s => `--color-on-${s}-muted`,
+};
+
+/**
+ * Concrete `light-dark()` values for every status role a theme leaves unset
+ * while setting a colour that role is measured against. Authored roles are
+ * never overridden.
+ */
+export function deriveStatusRoleTokens(
+ tokens: Record<string, string>,
+ localTokens: Record<string, string> = {},
+): [string, string][] {
+ const authored = new Set(Object.keys(tokens));
+ const surfaceSet =
+ authored.has('--color-background-surface') ||
+ authored.has('--color-background-card');
+ const inkSet =
+ authored.has('--color-on-dark') || authored.has('--color-on-light');
+ const resolved = resolveModes({...localTokens, ...tokens});
+ const entries: [string, string][] = [];
+ for (const status of STATUS_NAMES) {
+ const fillSet = authored.has(statusSourceToken(status));
+ const mutedSet = authored.has(`--color-${status}-muted`);
+ // Which roles this theme's own colours affect.
+ const affects: Record<keyof ModeRoles, boolean> = {
+ on: fillSet || inkSet,
+ text: fillSet || surfaceSet,
+ onMuted: fillSet || mutedSet || surfaceSet,
+ };
+ if (!affects.on && !affects.text && !affects.onMuted) {
+ continue;
+ }
+ const perMode = MODES.map(mode =>
+ deriveForMode(status, resolved[mode], mode),
+ );
+ if (perMode.some(r => r === null)) {
+ continue;
+ }
+ for (const key of Object.keys(ROLE_TOKENS) as (keyof ModeRoles)[]) {
+ const token = ROLE_TOKENS[key](status);
+ if (!affects[key] || authored.has(token)) {
+ continue;
+ }
+ const [light, dark] = perMode.map(r => r?.[key]);
+ if (light === undefined || dark === undefined) {
+ continue;
+ }
+ entries.push([token, `light-dark(${toHex(light)}, ${toHex(dark)})`]);
+ }
+ }
+ return entries;
+}
diff --git a/packages/core/src/theme/themeAdaptations.test.ts b/packages/core/src/theme/themeAdaptations.test.ts
index 8c71632a20..1f9de2df3a 100644
--- a/packages/core/src/theme/themeAdaptations.test.ts
+++ b/packages/core/src/theme/themeAdaptations.test.ts
@@ -16,6 +16,7 @@ import {
defineTheme,
generateAdaptationCSS,
generateThemeCSS,
+ generateThemeRules,
type DefineThemeInput,
type DefinedTheme,
} from './index';
@@ -82,6 +83,7 @@ describe('width breakpoint metadata', () => {
},
rules: [],
},
+ __adaptationRules: [],
__axes: {},
} as unknown as DefinedTheme;
@@ -298,6 +300,379 @@ describe('rule order and writes', () => {
expect(count(generateAdaptationCSS(theme).component, '@media')).toBe(1);
});
+ it('keeps status aliases at the root so conditional authored roles win', () => {
+ const theme = defineTheme({
+ name: 'conditional-status-role-precedence',
+ tokens: {'--color-text-blue': '#0074e2'},
+ adaptations: {
+ rules: [
+ {
+ when: {contrast: 'more'},
+ value: {tokens: {'--color-text-info': '#123456'}},
+ },
+ {
+ when: {pointer: 'coarse'},
+ value: {tokens: {'--color-text-blue': '#0055aa'}},
+ },
+ ],
+ },
+ onDark: {tokens: {'--color-text-blue': '#ffffff'}},
+ });
+ const {component} = generateThemeCSS(theme);
+ const adaptationCss = generateAdaptationCSS(theme).component;
+
+ // The root alias follows source-only adaptation writes through var(); the
+ // dark media surface that sets the hue rebinds its own alias.
+ expect(count(component, '--color-text-info: var(--color-text-blue);')).toBe(
+ 2,
+ );
+ expect(component).toContain('--color-text-info: #123456;');
+ expect(adaptationCss).toContain('--color-text-blue: #0055aa;');
+ expect(adaptationCss).not.toContain(
+ '--color-text-info: var(--color-text-blue);',
+ );
+ });
+
+ it('replays authored status roles after overlapping adaptation and media aliases', () => {
+ const theme = defineTheme({
+ name: 'conditional-status-role-replay',
+ adaptations: {
+ rules: [
+ {
+ when: {contrast: 'more'},
+ value: {tokens: {'--color-text-info': '#123456'}},
+ },
+ {
+ when: {pointer: 'coarse'},
+ value: {tokens: {'--color-text-blue': '#0055aa'}},
+ },
+ ],
+ },
+ onDark: {tokens: {'--color-text-blue': '#ffffff'}},
+ });
+ const css = generateThemeCSS(theme).component;
+ const alias = '--color-text-info: var(--color-text-blue);';
+ const authored = '--color-text-info: #123456;';
+
+ // The adaptation-only source keeps its alias where that condition matches,
+ // and the media surface that sets the hue gets its own.
+ expect(count(css, alias)).toBe(2);
+ // The authored role is emitted normally and replayed after adaptation aliases.
+ expect(count(css, authored)).toBe(2);
+ // The replay follows the adaptation alias; the media alias sits in its
+ // own surface block.
+ expect(css.lastIndexOf(authored)).toBeGreaterThan(css.indexOf(alias));
+ });
+
+ it('suppresses a root alias that an adaptation would turn into a cycle', () => {
+ const theme = defineTheme({
+ name: 'adaptation-closes-root-role-cycle',
+ tokens: {'--color-text-blue': '#0074e2'},
+ adaptations: {
+ rules: [
+ {
+ when: {contrast: 'more'},
+ value: {tokens: {'--color-text-blue': 'var(--color-text-info)'}},
+ },
+ ],
+ },
+ });
+ const rootCss = generateThemeRules(theme).join('\n');
+ const fullCss = generateThemeCSS(theme).component;
+
+ expect(fullCss).toContain('--color-text-blue: var(--color-text-info);');
+ expect(rootCss).not.toContain('--color-text-info: var(--color-text-blue);');
+ });
+
+ it('checks generated aliases across overlapping adaptation rules', () => {
+ const theme = defineTheme({
+ name: 'overlapping-generated-role-cycle',
+ adaptations: {
+ rules: [
+ {
+ when: {contrast: 'more'},
+ value: {
+ tokens: {
+ '--color-text-blue': 'var(--color-text-success)',
+ },
+ },
+ },
+ {
+ when: {pointer: 'coarse'},
+ value: {
+ tokens: {'--color-text-green': 'var(--color-text-info)'},
+ },
+ },
+ ],
+ },
+ });
+ const css = generateAdaptationCSS(theme).component;
+
+ // Both rules can match together, so the second alias would close a loop
+ // through the first and is not emitted.
+ expect(css).toContain('--color-text-info: var(--color-text-blue);');
+ expect(css).not.toContain('--color-text-success: var(--color-text-green);');
+ });
+
+ it('keeps aliases across mutually exclusive adaptation conditions', () => {
+ const theme = defineTheme({
+ name: 'mutually-exclusive-status-references',
+ tokens: {'--color-text-blue': '#0066cc'},
+ adaptations: {
+ rules: [
+ {
+ when: {pointer: 'coarse'},
+ value: {
+ tokens: {'--color-text-blue': 'var(--color-text-success)'},
+ },
+ },
+ {
+ when: {pointer: 'fine'},
+ value: {
+ tokens: {'--color-text-green': 'var(--color-text-info)'},
+ },
+ },
+ ],
+ },
+ });
+
+ expect(generateThemeCSS(theme).component).toContain(
+ '--color-text-info: var(--color-text-blue);',
+ );
+ });
+
+ it('keeps an alias when a later matching rule repairs the cycle', () => {
+ const theme = defineTheme({
+ name: 'repaired-status-reference',
+ tokens: {'--color-text-blue': '#0066cc'},
+ adaptations: {
+ rules: [
+ {
+ when: {pointer: 'coarse'},
+ value: {tokens: {'--color-text-blue': 'var(--color-text-info)'}},
+ },
+ {
+ when: {pointer: 'coarse'},
+ value: {tokens: {'--color-text-blue': '#abcdef'}},
+ },
+ ],
+ },
+ });
+
+ expect(generateThemeCSS(theme).component).toContain(
+ '--color-text-info: var(--color-text-blue);',
+ );
+ });
+
+ it('checks the final authored-role replay before emitting aliases', () => {
+ const theme = defineTheme({
+ name: 'adaptation-role-replay-cycle',
+ adaptations: {
+ rules: [
+ {
+ when: {pointer: 'coarse'},
+ value: {
+ tokens: {'--color-text-info': 'var(--color-text-success)'},
+ },
+ },
+ {
+ when: {pointer: 'coarse'},
+ value: {
+ tokens: {
+ '--color-text-blue': '#123456',
+ '--color-text-green': 'var(--color-text-info)',
+ },
+ },
+ },
+ ],
+ },
+ });
+ const css = generateAdaptationCSS(theme).component;
+
+ expect(css).not.toContain('--color-text-success: var(--color-text-green);');
+ });
+
+ it('preserves important declarations while modeling later repairs', () => {
+ const theme = defineTheme({
+ name: 'important-status-reference',
+ tokens: {'--color-text-blue': '#0066cc'},
+ adaptations: {
+ rules: [
+ {
+ when: {pointer: 'coarse'},
+ value: {
+ tokens: {
+ '--color-text-blue': 'var(--color-text-info) !important',
+ },
+ },
+ },
+ {
+ when: {pointer: 'coarse'},
+ value: {tokens: {'--color-text-blue': '#123456'}},
+ },
+ ],
+ },
+ });
+ const rootCss = generateThemeRules(theme).join('\n');
+
+ expect(rootCss).not.toContain('--color-text-info: var(--color-text-blue);');
+ });
+
+ it('does not treat an escaped bang as declaration priority', () => {
+ const theme = defineTheme({
+ name: 'escaped-bang-status-reference',
+ tokens: {'--color-text-blue': '#0066cc'},
+ adaptations: {
+ rules: [
+ {
+ when: {pointer: 'coarse'},
+ value: {
+ tokens: {
+ '--color-text-blue': 'var(--color-text-info) \\!important',
+ },
+ },
+ },
+ {
+ when: {pointer: 'coarse'},
+ value: {tokens: {'--color-text-blue': '#123456'}},
+ },
+ ],
+ },
+ });
+ const rootCss = generateThemeRules(theme).join('\n');
+
+ expect(rootCss).toContain('--color-text-info: var(--color-text-blue);');
+ });
+
+ it('does not treat an important() function as declaration priority', () => {
+ const theme = defineTheme({
+ name: 'important-function-status-reference',
+ tokens: {'--color-text-blue': '#0066cc'},
+ adaptations: {
+ rules: [
+ {
+ when: {pointer: 'coarse'},
+ value: {tokens: {'--color-text-blue': 'red !important()'}},
+ },
+ {
+ when: {pointer: 'coarse'},
+ value: {tokens: {'--color-text-blue': 'var(--color-text-info)'}},
+ },
+ ],
+ },
+ });
+
+ expect(generateThemeRules(theme).join('\n')).not.toContain(
+ '--color-text-info: var(--color-text-blue);',
+ );
+ });
+
+ it('does not model a dropped declaration as a cycle repair', () => {
+ const theme = defineTheme({
+ name: 'dropped-status-repair',
+ tokens: {'--color-text-blue': '#0066cc'},
+ adaptations: {
+ rules: [
+ {
+ when: {pointer: 'coarse'},
+ value: {tokens: {'--color-text-blue': 'var(--color-text-info)'}},
+ },
+ {
+ when: {pointer: 'coarse'},
+ value: {tokens: {'--color-text-blue': '#abcdef;'}},
+ },
+ ],
+ },
+ });
+ const warnings: string[] = [];
+ const rootCss = generateThemeRules(theme, warnings).join('\n');
+
+ expect(rootCss).not.toContain('--color-text-info: var(--color-text-blue);');
+ expect(generateAdaptationCSS(theme, warnings).component).not.toContain(
+ '--color-text-blue: #abcdef;',
+ );
+ expect(warnings.some(warning => warning.includes('dropped'))).toBe(true);
+ });
+
+ it('keeps a root alias when a matching rule overwrites that alias', () => {
+ const theme = defineTheme({
+ name: 'overwritten-root-status-alias',
+ tokens: {'--color-text-blue': '#0066cc'},
+ adaptations: {
+ rules: [
+ {
+ when: {pointer: 'coarse'},
+ value: {tokens: {'--color-text-info': '#123456'}},
+ },
+ ],
+ },
+ });
+ theme.__adaptationRules![0].tokens['--color-text-info'] =
+ 'var(--color-text-info)';
+
+ expect(generateThemeRules(theme).join('\n')).toContain(
+ '--color-text-info: var(--color-text-blue);',
+ );
+ });
+
+ it('invalidates cached status aliases after legacy token mutation', () => {
+ const theme = defineTheme({
+ name: 'mutated-status-alias-cache',
+ tokens: {'--color-text-blue': '#0074e2'},
+ });
+
+ expect(generateThemeCSS(theme).component).toContain(
+ '--color-text-info: var(--color-text-blue);',
+ );
+ theme.tokens['--color-text-blue'] = 'var(--color-text-info)';
+ expect(generateThemeCSS(theme).component).not.toContain(
+ '--color-text-info: var(--color-text-blue);',
+ );
+ });
+
+ it('invalidates cached rules after legacy adaptation component mutation', () => {
+ const theme = defineTheme({
+ name: 'mutated-adaptation-component-cache',
+ adaptations: {
+ rules: [
+ {
+ when: {contrast: 'more'},
+ value: {
+ components: {button: {base: {borderWidth: '1px'}}},
+ },
+ },
+ ],
+ },
+ });
+
+ expect(generateThemeCSS(theme).component).toContain('border-width: 1px');
+ theme.__adaptationRules = theme.__adaptationRules!.map(rule => ({
+ ...rule,
+ components: {button: {base: {borderWidth: '9px'}}},
+ }));
+ const css = generateThemeCSS(theme).component;
+ expect(css).toContain('border-width: 9px');
+ expect(css).not.toContain('border-width: 1px');
+ });
+
+ it('emits a guarded alias when only an adaptation authors the source', () => {
+ const theme = defineTheme({
+ name: 'adaptation-only-status-source',
+ adaptations: {
+ rules: [
+ {
+ when: {contrast: 'more'},
+ value: {tokens: {'--color-text-blue': '#0055aa'}},
+ },
+ ],
+ },
+ });
+ const css = generateAdaptationCSS(theme).component;
+
+ expect(css).toContain('--color-text-blue: #0055aa;');
+ expect(css).toContain('--color-text-info: var(--color-text-blue);');
+ });
+
it('lets explicit values beat generated values within one rule', () => {
const theme = defineTheme({
name: 'rule-precedence',
diff --git a/packages/core/src/theme/tokens.stylex.ts b/packages/core/src/theme/tokens.stylex.ts
index 84c3481ed8..df271111d7 100644
--- a/packages/core/src/theme/tokens.stylex.ts
+++ b/packages/core/src/theme/tokens.stylex.ts
@@ -56,17 +56,46 @@ export const colorDefaults = {
'--color-background-inverted': 'light-dark(#0A1317, #FFFFFF)',
'--color-background-error-inverted': 'light-dark(#AA071E, #E3193B)',
- // Status/Sentiment
+ // Status fills (architecture:theme-tokens INV11). Each `--color-<status>` is
+ // the strong status fill, and `--color-on-<status>` is content on it at
+ // 4.5:1 or more. `-muted` is the pale fill, with `--color-on-<status>-muted`.
+ // Info is independent of the accent.
+ '--color-info': 'light-dark(#0064E0, #0064E0)',
+ '--color-info-muted': 'light-dark(#0082FB33, #0082FB3F)',
+ '--color-on-info': 'light-dark(#FFFFFF, #FFFFFF)',
'--color-success': 'light-dark(#0D8626, #0D8626)',
'--color-success-muted': 'light-dark(#0B991F33, #0B991F3F)',
'--color-on-success': 'light-dark(#FFFFFF, #FFFFFF)',
'--color-error': 'light-dark(#E3193B, #F5394F)',
'--color-error-muted': 'light-dark(#E3193B33, #F5394F3F)',
- '--color-on-error': 'light-dark(#FFFFFF, #FFFFFF)',
+ // Dark error is light enough that white misses 4.5:1, so its content is dark.
+ '--color-on-error': 'light-dark(#FFFFFF, #0A1317)',
'--color-warning': 'light-dark(#E9AF08, #F2C00B)',
'--color-warning-muted': 'light-dark(#E2A40033, #E2A4003F)',
'--color-on-warning': 'light-dark(#0A1317, #0A1317)',
+ // Status text on the default page and card surfaces, 4.5:1 or more.
+ '--color-text-info': 'var(--color-text-blue)',
+ '--color-text-success': 'var(--color-text-green)',
+ '--color-text-warning': 'var(--color-text-yellow)',
+ '--color-text-error': 'var(--color-text-red)',
+
+ // Status icons and borders on those surfaces follow the text role.
+ '--color-icon-info': 'var(--color-text-info)',
+ '--color-icon-success': 'var(--color-text-success)',
+ '--color-icon-warning': 'var(--color-text-warning)',
+ '--color-icon-error': 'var(--color-text-error)',
+ '--color-border-info': 'var(--color-text-info)',
+ '--color-border-success': 'var(--color-text-success)',
+ '--color-border-warning': 'var(--color-text-warning)',
+ '--color-border-error': 'var(--color-text-error)',
+
+ // Content on pale status fills.
+ '--color-on-info-muted': 'var(--color-text-blue)',
+ '--color-on-success-muted': 'var(--color-text-green)',
+ '--color-on-warning-muted': 'var(--color-text-yellow)',
+ '--color-on-error-muted': 'var(--color-text-red)',
+
// Border
'--color-border': 'light-dark(#05365919, #F2F4F619)',
'--color-border-emphasized': 'light-dark(#CCD3DB, #494D53)',
diff --git a/packages/core/src/theme/tokens.test.ts b/packages/core/src/theme/tokens.test.ts
index bc60c476ba..9a00bbb741 100644
--- a/packages/core/src/theme/tokens.test.ts
+++ b/packages/core/src/theme/tokens.test.ts
@@ -1,7 +1,7 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
import {describe, expect, it} from 'vitest';
-import {defineTheme} from './defineTheme';
+import {defineTheme, generateThemeRules} from './defineTheme';
import {
resolveThemeToken,
resolveThemeTokens,
@@ -332,6 +332,41 @@ describe('focus outline tokens', () => {
});
});
+describe('resolveThemeTokens and derived status roles', () => {
+ it('resolves an unset status role to the value the theme CSS derives (INV17)', () => {
+ const theme = defineTheme({
+ name: 'derived-status',
+ tokens: {'--color-success': '#3FB950'},
+ });
+ const css = generateThemeRules(theme).join('\n');
+ const emitted =
+ /--color-text-success: light-dark\((#[0-9A-F]{6}), (#[0-9A-F]{6})\)/.exec(
+ css,
+ );
+ expect(emitted).not.toBeNull();
+ expect(
+ resolveThemeToken(theme, '--color-text-success', {mode: 'light'}),
+ ).toBe(emitted![1]);
+ expect(
+ resolveThemeToken(theme, '--color-text-success', {mode: 'dark'}),
+ ).toBe(emitted![2]);
+ // Icon and border follow the derived text role.
+ expect(
+ resolveThemeToken(theme, '--color-icon-success', {mode: 'light'}),
+ ).toBe(emitted![1]);
+ });
+
+ it('keeps a status role the theme sets', () => {
+ const theme = defineTheme({
+ name: 'set-status',
+ tokens: {'--color-success': '#3FB950', '--color-text-success': '#123456'},
+ });
+ expect(
+ resolveThemeToken(theme, '--color-text-success', {mode: 'light'}),
+ ).toBe('#123456');
+ });
+});
+
// INV10 governs only the colour tokens Astryx defines. The check reads Astryx's
// own defaults, never consumer, application, or theme-author variables.
describe('colour token name grammar (architecture:theme-tokens INV10)', () => {
diff --git a/packages/core/src/theme/tokens.ts b/packages/core/src/theme/tokens.ts
index 741d42e4d9..d8ed43c1c0 100644
--- a/packages/core/src/theme/tokens.ts
+++ b/packages/core/src/theme/tokens.ts
@@ -27,6 +27,7 @@ import {
type TokenValue,
} from './defineTheme';
import {parseColor, formatColor} from '../utils/color';
+import {generatedScopedStatusRoleDefaults} from './generateThemeRules';
/** Resolved color mode used when choosing the side of light/dark token values. */
export type ResolvedThemeMode = 'light' | 'dark';
@@ -405,6 +406,23 @@ export function resolveThemeTokens(
return resolveReferences(resolved);
}
+ // A theme's local tokens resolve its references to them, then leave the
+ // result: they are theme-local names, not Astryx tokens.
+ const localKeys = new Set(Object.keys(theme.localTokens ?? {}));
+ for (const [key, value] of Object.entries(theme.localTokens ?? {})) {
+ resolved[key] = resolveXDSTokenValue(value, mode);
+ }
+
+ // Status roles the theme leaves unset resolve as its generated root CSS
+ // declares them (architecture:theme-compilation INV16 and INV17), so
+ // JavaScript and CSS agree (architecture:theme-tokens INV6).
+ for (const [key, value] of generatedScopedStatusRoleDefaults(
+ theme.tokens,
+ theme.localTokens ?? {},
+ )) {
+ resolved[key] = resolveXDSTokenValue(value, mode);
+ }
+
for (const [key, value] of Object.entries(theme.tokens)) {
resolved[key] = resolveXDSTokenValue(value, mode);
}
@@ -417,7 +435,11 @@ export function resolveThemeTokens(
}
}
- return resolveReferences(resolved);
+ return Object.fromEntries(
+ Object.entries(resolveReferences(resolved)).filter(
+ ([key]) => !localKeys.has(key),
+ ),
+ );
}
/** Resolve one Astryx token value for a theme and effective color mode. */
diff --git a/packages/lab/src/Chat/ChatUnreadDivider.tsx b/packages/lab/src/Chat/ChatUnreadDivider.tsx
index cde9ee66a2..adb51350e7 100644
--- a/packages/lab/src/Chat/ChatUnreadDivider.tsx
+++ b/packages/lab/src/Chat/ChatUnreadDivider.tsx
@@ -63,7 +63,7 @@ const styles = stylex.create({
fontFamily: typographyVars['--font-family-body'],
fontSize: typeScaleVars['--text-supporting-size'],
fontWeight: fontWeightVars['--font-weight-bold'],
- color: colorVars['--color-error'],
+ color: colorVars['--color-text-error'],
lineHeight: typeScaleVars['--text-supporting-leading'],
},
});
diff --git a/packages/lab/src/CircularProgress/CircularProgress.tsx b/packages/lab/src/CircularProgress/CircularProgress.tsx
index 6543a2bb50..b656f34358 100644
--- a/packages/lab/src/CircularProgress/CircularProgress.tsx
+++ b/packages/lab/src/CircularProgress/CircularProgress.tsx
@@ -260,13 +260,13 @@ const variantStyles = stylex.create({
stroke: colorVars['--color-accent'],
},
success: {
- stroke: colorVars['--color-success'],
+ stroke: colorVars['--color-text-success'],
},
warning: {
- stroke: colorVars['--color-warning'],
+ stroke: colorVars['--color-text-warning'],
},
error: {
- stroke: colorVars['--color-error'],
+ stroke: colorVars['--color-text-error'],
},
neutral: {
stroke: colorVars['--color-text-disabled'],
diff --git a/packages/lab/src/LogStream/LogStream.doc.mjs b/packages/lab/src/LogStream/LogStream.doc.mjs
index b2ab931a05..b19b53c561 100644
--- a/packages/lab/src/LogStream/LogStream.doc.mjs
+++ b/packages/lab/src/LogStream/LogStream.doc.mjs
@@ -11,7 +11,7 @@ export const docs = {
usage: {
description:
- 'Experimental streaming log viewer: mono grid rows (timestamp | level | source | message) with token-derived level accents, expandable per-row detail panels, follow-scroll live tailing with a "Jump to latest" affordance, and an always-dark terminal variant. Appended rows fade in via @starting-style. Live announcements follow the pinning state: the role="log" region is aria-live="polite" only while following the tail, and aria-live="off" while unfollowed, so a busy stream never floods assistive tech.',
+ 'Experimental streaming log viewer: mono grid rows (timestamp | level | source | message) with token-derived level accents, expandable per-row detail panels, follow-scroll live tailing with a "Jump to latest" affordance, and an always-dark terminal variant. In the default variant, warning and error labels use their plain-surface status foreground roles. Appended rows fade in via @starting-style. Live announcements follow the pinning state: the role="log" region is aria-live="polite" only while following the tail, and aria-live="off" while unfollowed, so a busy stream never floods assistive tech.',
},
props: [
diff --git a/packages/lab/src/LogStream/LogStream.tsx b/packages/lab/src/LogStream/LogStream.tsx
index c9e94bfd6f..18e2e65453 100644
--- a/packages/lab/src/LogStream/LogStream.tsx
+++ b/packages/lab/src/LogStream/LogStream.tsx
@@ -233,14 +233,12 @@ const styles = stylex.create({
},
levelInfo: {color: colorVars['--color-text-secondary']},
levelDebug: {color: colorVars['--color-text-disabled']},
- // Token amber/red are tuned for fills; as small text they miss 4.5:1.
- // light-dark() darkens the amber in light mode and lifts the red in dark
- // mode, both derived from the tokens.
+ // Plain-surface warning/error labels use the dedicated foreground roles.
levelWarn: {
- color: `light-dark(color-mix(in srgb, ${colorVars['--color-warning']} 58%, black), ${colorVars['--color-warning']})`,
+ color: colorVars['--color-text-warning'],
},
levelError: {
- color: `light-dark(${colorVars['--color-error']}, color-mix(in srgb, ${colorVars['--color-error']} 82%, white))`,
+ color: colorVars['--color-text-error'],
},
levelInfoTerminal: {color: TERM.text},
levelDebugTerminal: {color: TERM.textDim},
diff --git a/packages/lab/src/SVGIcon/SVGIcon.tsx b/packages/lab/src/SVGIcon/SVGIcon.tsx
index 0763b03abd..15f5039865 100644
--- a/packages/lab/src/SVGIcon/SVGIcon.tsx
+++ b/packages/lab/src/SVGIcon/SVGIcon.tsx
@@ -118,9 +118,9 @@ const colorStyles = stylex.create({
secondary: {color: colorVars['--color-icon-secondary']},
disabled: {color: colorVars['--color-icon-disabled']},
accent: {color: colorVars['--color-accent']},
- positive: {color: colorVars['--color-success']},
- negative: {color: colorVars['--color-error']},
- warning: {color: colorVars['--color-warning']},
+ positive: {color: colorVars['--color-icon-success']},
+ negative: {color: colorVars['--color-icon-error']},
+ warning: {color: colorVars['--color-icon-warning']},
inherit: {color: 'inherit'},
});
diff --git a/packages/lab/src/Stat/Stat.tsx b/packages/lab/src/Stat/Stat.tsx
index 242d60036b..839da27813 100644
--- a/packages/lab/src/Stat/Stat.tsx
+++ b/packages/lab/src/Stat/Stat.tsx
@@ -116,10 +116,10 @@ const sizeStyles = stylex.create({
*/
const sentimentStyles = stylex.create({
positive: {
- color: colorVars['--color-success'],
+ color: colorVars['--color-text-success'],
},
negative: {
- color: colorVars['--color-error'],
+ color: colorVars['--color-text-error'],
},
neutral: {
color: colorVars['--color-text-secondary'],
diff --git a/packages/native/apple/Sources/Astryx/Icon/Icon.spec.md b/packages/native/apple/Sources/Astryx/Icon/Icon.spec.md
index fd7621aba8..6adddc48dd 100644
--- a/packages/native/apple/Sources/Astryx/Icon/Icon.spec.md
+++ b/packages/native/apple/Sources/Astryx/Icon/Icon.spec.md
@@ -83,12 +83,12 @@ Consumer migration instructions belong in consumer docs and release notes.
## Public concepts
-| Concept | Closed values or states | Meaning | Availability by variant/orientation/state | Default | Owner | Stability | Invalid-value behavior |
-| ------------- | --------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ----------------------------------------- | -------------------------- | ---------------------- | ------------ | ----------------------------------------------------------------------- |
-| icon name | the built-in names; a `<library>:<name>` the theme maps | `IconName`, a string on the wire, with each built-in as a static member | always | required | `component:Icon` | experimental | an unmapped name stops a development build and draws nothing in release |
-| symbol source | theme mapping; platform default | `Theme(icons:)` replaces a built-in or registers a library name with an SF Symbol or an app asset | always | platform default | `component:swift/Icon` | experimental | a theme entry wins over the default |
-| size | `xsm`, `sm`, `md`, `lg`; unset | 12, 16, 20, 24 points at the default text size | always | owner's icon size, else md | `component:Icon` | experimental | unset takes the owner's size, then `md` |
-| color | `primary`, `secondary`, `tertiary`, `disabled`, `accent`, `success`, `error`, `warning`, `inherit`; unset | core's icon color tokens; `inherit` keeps the surrounding foreground | always | `inherit` | `component:Icon` | experimental | unset is `inherit` |
+| Concept | Closed values or states | Meaning | Availability by variant/orientation/state | Default | Owner | Stability | Invalid-value behavior |
+| ------------- | ----------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ----------------------------------------- | -------------------------- | ---------------------- | ------------ | ----------------------------------------------------------------------- |
+| icon name | the built-in names; a `<library>:<name>` the theme maps | `IconName`, a string on the wire, with each built-in as a static member | always | required | `component:Icon` | experimental | an unmapped name stops a development build and draws nothing in release |
+| symbol source | theme mapping; platform default | `Theme(icons:)` replaces a built-in or registers a library name with an SF Symbol or an app asset | always | platform default | `component:swift/Icon` | experimental | a theme entry wins over the default |
+| size | `xsm`, `sm`, `md`, `lg`; unset | 12, 16, 20, 24 points at the default text size | always | owner's icon size, else md | `component:Icon` | experimental | unset takes the owner's size, then `md` |
+| color | `primary`, `secondary`, `tertiary`, `disabled`, `accent`, `info`, `success`, `error`, `warning`, `inherit`; unset | core's icon color tokens; `inherit` keeps the surrounding foreground | always | `inherit` | `component:Icon` | experimental | unset is `inherit` |
## Behavioral and layout contract
@@ -97,7 +97,7 @@ Consumer migration instructions belong in consumer docs and release notes.
| FR1 | The view MUST draw the image the theme's `icons` maps the name to, an SF Symbol or an asset the app ships, else the platform default for a built-in name. A name neither maps, or an asset the app does not ship, MUST stop a development build with a message naming it and draw nothing in a release build, never a substitute. | `spec:AST-082` FR17; Swift slots S2 | verify |
| FR2 | The symbol MUST fit a square box whose side is core's size in points (12, 16, 20, 24 for `xsm`, `sm`, `md`, `lg`), multiplied by the Dynamic Type scale the theme environment reads. | core `Icon` sizes; `spec:AST-093` FR3; theme environment E1 | verify |
| FR3 | The view MUST use its own `size`, else the size its owning component gives icons in its documented icon slot, else `md`. | `architecture:component-size-cascade`; Swift slots S4 | verify |
-| FR4 | The view MUST draw in core's token for its `color` — primary and secondary icon tokens, the secondary icon token for `tertiary`, the disabled icon token, and the accent, success, error, and warning colors — and, for `inherit` or no color, MUST keep the surrounding foreground style. | core `Icon` color map; `spec:AST-093` FR4 | verify |
+| FR4 | The view MUST draw in core's token for its `color` — primary and secondary icon tokens, the secondary icon token for `tertiary`, the disabled icon token, the accent color, and the `info`, `success`, `error`, and `warning` status icon roles — and, for `inherit` or no color, MUST keep the surrounding foreground style. | core `Icon` color map; `spec:AST-093` FR4 | verify |
| FR5 | Both initializers MUST build the same `IconProps`; the labeled initializer takes the contract's props with the generated types and defaults, and base props (`id`, `isHidden`) come through `IconProps`. With `isHidden` the view draws nothing; `id` becomes the accessibility identifier. | Swift component API A2, A3, A7; `spec:AST-082` FR7 | verify |
### Allowed variation
@@ -152,8 +152,9 @@ FR2). Guideline pages: SF Symbols and Accessibility in the Apple Human
Interface Guidelines.
Theme values read: `color.iconPrimary`, `color.iconSecondary`,
-`color.iconDisabled`, `color.accent`, `color.success`, `color.error`,
-`color.warning`, the theme's `icons` map, and the Dynamic Type scale.
+`color.iconDisabled`, `color.accent`, `color.iconInfo`, `color.iconSuccess`,
+`color.iconError`, `color.iconWarning`, the theme's `icons` map, and the
+Dynamic Type scale.
## Family and system relationships
diff --git a/packages/native/apple/Sources/Astryx/Icon/Icon.swift b/packages/native/apple/Sources/Astryx/Icon/Icon.swift
index 463efa3a05..fc3635ab69 100644
--- a/packages/native/apple/Sources/Astryx/Icon/Icon.swift
+++ b/packages/native/apple/Sources/Astryx/Icon/Icon.swift
@@ -85,9 +85,10 @@ public struct Icon: View {
case .secondary, .tertiary: tokens.color.iconSecondary
case .disabled: tokens.color.iconDisabled
case .accent: tokens.color.accent
- case .success: tokens.color.success
- case .error: tokens.color.error
- case .warning: tokens.color.warning
+ case .info: tokens.color.iconInfo
+ case .success: tokens.color.iconSuccess
+ case .error: tokens.color.iconError
+ case .warning: tokens.color.iconWarning
case .inherit: nil
}
}
diff --git a/packages/native/apple/Sources/Astryx/Theme/Generated/ButterTheme.swift b/packages/native/apple/Sources/Astryx/Theme/Generated/ButterTheme.swift
index 0decd31138..6dd10d91b0 100644
--- a/packages/native/apple/Sources/Astryx/Theme/Generated/ButterTheme.swift
+++ b/packages/native/apple/Sources/Astryx/Theme/Generated/ButterTheme.swift
@@ -32,13 +32,17 @@ extension Theme {
borderBlue: Color(.sRGB, red: 0.7411764705882353, green: 0.7725490196078432, blue: 0.9215686274509803, opacity: 1),
borderCyan: Color(.sRGB, red: 0.5529411764705883, green: 0.8235294117647058, blue: 0.8274509803921568, opacity: 1),
borderEmphasized: Color(.sRGB, red: 0.7803921568627451, green: 0.7686274509803922, blue: 0.6980392156862745, opacity: 1),
+ borderError: Color(.sRGB, red: 0.43529411764705883, green: 0.0784313725490196, blue: 0, opacity: 1),
borderGray: Color(.sRGB, red: 0.8392156862745098, green: 0.8274509803921568, blue: 0.7215686274509804, opacity: 1),
borderGreen: Color(.sRGB, red: 0.6352941176470588, green: 0.8431372549019608, blue: 0.6274509803921569, opacity: 1),
+ borderInfo: Color(.sRGB, red: 0.13333333333333333, green: 0.3568627450980392, blue: 1, opacity: 1),
borderOrange: Color(.sRGB, red: 0.9490196078431372, green: 0.7411764705882353, blue: 0.5058823529411764, opacity: 1),
borderPink: Color(.sRGB, red: 0.9411764705882353, green: 0.7019607843137254, blue: 0.9098039215686274, opacity: 1),
borderPurple: Color(.sRGB, red: 0.8666666666666667, green: 0.7254901960784313, blue: 0.9647058823529412, opacity: 1),
borderRed: Color(.sRGB, red: 1, green: 0.6901960784313725, blue: 0.6078431372549019, opacity: 1),
+ borderSuccess: Color(.sRGB, red: 0, green: 0.2901960784313726, blue: 0.0196078431372549, opacity: 1),
borderTeal: Color(.sRGB, red: 0.5803921568627451, green: 0.8274509803921568, blue: 0.7333333333333333, opacity: 1),
+ borderWarning: Color(.sRGB, red: 0.26666666666666666, green: 0.23529411764705882, blue: 0, opacity: 1),
borderYellow: Color(.sRGB, red: 0.7490196078431373, green: 0.6823529411764706, blue: 0.20784313725490197, opacity: 1),
dataBlue1: Color(.sRGB, red: 0.8588235294117647, green: 0.9254901960784314, blue: 1, opacity: 1),
dataBlue2: Color(.sRGB, red: 0.47058823529411764, green: 0.7450980392156863, blue: 1, opacity: 1),
@@ -102,23 +106,34 @@ extension Theme {
iconBlue: Color(.sRGB, red: 0.12549019607843137, green: 0.22745098039215686, blue: 0.4235294117647059, opacity: 1),
iconCyan: Color(.sRGB, red: 0, green: 0.27450980392156865, blue: 0.28627450980392155, opacity: 1),
iconDisabled: Color(.sRGB, red: 0.6784313725490196, green: 0.6745098039215687, blue: 0.6196078431372549, opacity: 1),
+ iconError: Color(.sRGB, red: 0.43529411764705883, green: 0.0784313725490196, blue: 0, opacity: 1),
iconGray: Color(.sRGB, red: 0.2901960784313726, green: 0.2784313725490196, blue: 0.19607843137254902, opacity: 1),
iconGreen: Color(.sRGB, red: 0, green: 0.2901960784313726, blue: 0.0196078431372549, opacity: 1),
+ iconInfo: Color(.sRGB, red: 0.13333333333333333, green: 0.3568627450980392, blue: 1, opacity: 1),
iconOrange: Color(.sRGB, red: 0.3843137254901961, green: 0.1803921568627451, blue: 0, opacity: 1),
iconPink: Color(.sRGB, red: 0.4235294117647059, green: 0.0392156862745098, blue: 0.40784313725490196, opacity: 1),
iconPrimary: Color(.sRGB, red: 0.11372549019607843, green: 0.10980392156862745, blue: 0.06666666666666667, opacity: 1),
iconPurple: Color(.sRGB, red: 0.3215686274509804, green: 0.13725490196078433, blue: 0.4823529411764706, opacity: 1),
iconRed: Color(.sRGB, red: 0.43529411764705883, green: 0.0784313725490196, blue: 0, opacity: 1),
iconSecondary: Color(.sRGB, red: 0.3764705882352941, green: 0.37254901960784315, blue: 0.3215686274509804, opacity: 1),
+ iconSuccess: Color(.sRGB, red: 0, green: 0.2901960784313726, blue: 0.0196078431372549, opacity: 1),
iconTeal: Color(.sRGB, red: 0, green: 0.2823529411764706, blue: 0.17647058823529413, opacity: 1),
+ iconWarning: Color(.sRGB, red: 0.26666666666666666, green: 0.23529411764705882, blue: 0, opacity: 1),
iconYellow: Color(.sRGB, red: 0.26666666666666666, green: 0.23529411764705882, blue: 0, opacity: 1),
+ info: Color(.sRGB, red: 0.13333333333333333, green: 0.3568627450980392, blue: 1, opacity: 1),
+ infoMuted: Color(.sRGB, red: 0.8588235294117647, green: 0.8823529411764706, blue: 1, opacity: 1),
neutral: Color(.sRGB, red: 0.11372549019607843, green: 0.10980392156862745, blue: 0.06666666666666667, opacity: 0.058823529411764705),
onAccent: Color(.sRGB, red: 1, green: 1, blue: 1, opacity: 1),
onDark: Color(.sRGB, red: 1, green: 1, blue: 1, opacity: 1),
onError: Color(.sRGB, red: 1, green: 0.9254901960784314, blue: 0.9058823529411765, opacity: 1),
+ onErrorMuted: Color(.sRGB, red: 0.43529411764705883, green: 0.0784313725490196, blue: 0, opacity: 1),
+ onInfo: Color(.sRGB, red: 1, green: 1, blue: 1, opacity: 1),
+ onInfoMuted: Color(.sRGB, red: 0.12549019607843137, green: 0.22745098039215686, blue: 0.4235294117647059, opacity: 1),
onLight: Color(.sRGB, red: 0.11372549019607843, green: 0.10980392156862745, blue: 0.06666666666666667, opacity: 1),
onSuccess: Color(.sRGB, red: 0.7137254901960784, green: 0.8901960784313725, blue: 0.7058823529411765, opacity: 1),
+ onSuccessMuted: Color(.sRGB, red: 0, green: 0.2901960784313726, blue: 0.0196078431372549, opacity: 1),
onWarning: Color(.sRGB, red: 1, green: 0.9686274509803922, blue: 0.7529411764705882, opacity: 1),
+ onWarningMuted: Color(.sRGB, red: 0.26666666666666666, green: 0.23529411764705882, blue: 0, opacity: 1),
overlay: Color(.sRGB, red: 0.11372549019607843, green: 0.10980392156862745, blue: 0.06666666666666667, opacity: 0.5019607843137255),
overlayHover: Color(.sRGB, red: 0.11372549019607843, green: 0.10980392156862745, blue: 0.06666666666666667, opacity: 0.050980392156862744),
overlayPressed: Color(.sRGB, red: 0.11372549019607843, green: 0.10980392156862745, blue: 0.06666666666666667, opacity: 0.10196078431372549),
@@ -149,15 +164,19 @@ extension Theme {
textBlue: Color(.sRGB, red: 0.12549019607843137, green: 0.22745098039215686, blue: 0.4235294117647059, opacity: 1),
textCyan: Color(.sRGB, red: 0, green: 0.27450980392156865, blue: 0.28627450980392155, opacity: 1),
textDisabled: Color(.sRGB, red: 0.6784313725490196, green: 0.6745098039215687, blue: 0.6196078431372549, opacity: 1),
+ textError: Color(.sRGB, red: 0.43529411764705883, green: 0.0784313725490196, blue: 0, opacity: 1),
textGray: Color(.sRGB, red: 0.2901960784313726, green: 0.2784313725490196, blue: 0.19607843137254902, opacity: 1),
textGreen: Color(.sRGB, red: 0, green: 0.2901960784313726, blue: 0.0196078431372549, opacity: 1),
+ textInfo: Color(.sRGB, red: 0.13333333333333333, green: 0.3568627450980392, blue: 1, opacity: 1),
textOrange: Color(.sRGB, red: 0.3843137254901961, green: 0.1803921568627451, blue: 0, opacity: 1),
textPink: Color(.sRGB, red: 0.4235294117647059, green: 0.0392156862745098, blue: 0.40784313725490196, opacity: 1),
textPrimary: Color(.sRGB, red: 0.11372549019607843, green: 0.10980392156862745, blue: 0.06666666666666667, opacity: 1),
textPurple: Color(.sRGB, red: 0.3215686274509804, green: 0.13725490196078433, blue: 0.4823529411764706, opacity: 1),
textRed: Color(.sRGB, red: 0.43529411764705883, green: 0.0784313725490196, blue: 0, opacity: 1),
textSecondary: Color(.sRGB, red: 0.3764705882352941, green: 0.37254901960784315, blue: 0.3215686274509804, opacity: 1),
+ textSuccess: Color(.sRGB, red: 0, green: 0.2901960784313726, blue: 0.0196078431372549, opacity: 1),
textTeal: Color(.sRGB, red: 0, green: 0.2823529411764706, blue: 0.17647058823529413, opacity: 1),
+ textWarning: Color(.sRGB, red: 0.26666666666666666, green: 0.23529411764705882, blue: 0, opacity: 1),
textYellow: Color(.sRGB, red: 0.26666666666666666, green: 0.23529411764705882, blue: 0, opacity: 1),
tintHover: Color(.sRGB, red: 0, green: 0, blue: 0, opacity: 1),
track: Color(.sRGB, red: 0.8, green: 0.8274509803921568, blue: 0.8588235294117647, opacity: 1),
@@ -246,13 +265,17 @@ extension Theme {
borderBlue: Color(.sRGB, red: 0.7411764705882353, green: 0.7725490196078432, blue: 0.9215686274509803, opacity: 1),
borderCyan: Color(.sRGB, red: 0.5529411764705883, green: 0.8235294117647058, blue: 0.8274509803921568, opacity: 1),
borderEmphasized: Color(.sRGB, red: 0.5764705882352941, green: 0.5686274509803921, blue: 0.5176470588235295, opacity: 1),
+ borderError: Color(.sRGB, red: 1, green: 0.6901960784313725, blue: 0.6078431372549019, opacity: 1),
borderGray: Color(.sRGB, red: 0.8392156862745098, green: 0.8274509803921568, blue: 0.7215686274509804, opacity: 1),
borderGreen: Color(.sRGB, red: 0.6588235294117647, green: 0.8313725490196079, blue: 0.6509803921568628, opacity: 1),
+ borderInfo: Color(.sRGB, red: 0.5058823529411764, green: 0.6627450980392157, blue: 1, opacity: 1),
borderOrange: Color(.sRGB, red: 0.9490196078431372, green: 0.7411764705882353, blue: 0.5058823529411764, opacity: 1),
borderPink: Color(.sRGB, red: 0.9411764705882353, green: 0.7019607843137254, blue: 0.9098039215686274, opacity: 1),
borderPurple: Color(.sRGB, red: 0.8666666666666667, green: 0.7254901960784313, blue: 0.9647058823529412, opacity: 1),
borderRed: Color(.sRGB, red: 1, green: 0.6901960784313725, blue: 0.6078431372549019, opacity: 1),
+ borderSuccess: Color(.sRGB, red: 0.6588235294117647, green: 0.8313725490196079, blue: 0.6509803921568628, opacity: 1),
borderTeal: Color(.sRGB, red: 0.5803921568627451, green: 0.8274509803921568, blue: 0.7333333333333333, opacity: 1),
+ borderWarning: Color(.sRGB, red: 0.9333333333333333, green: 0.8745098039215686, blue: 0.4588235294117647, opacity: 1),
borderYellow: Color(.sRGB, red: 0.7372549019607844, green: 0.6823529411764706, blue: 0.3058823529411765, opacity: 1),
dataBlue1: Color(.sRGB, red: 0.8588235294117647, green: 0.9254901960784314, blue: 1, opacity: 1),
dataBlue2: Color(.sRGB, red: 0.47058823529411764, green: 0.7450980392156863, blue: 1, opacity: 1),
@@ -316,23 +339,34 @@ extension Theme {
iconBlue: Color(.sRGB, red: 0.12549019607843137, green: 0.22745098039215686, blue: 0.4235294117647059, opacity: 1),
iconCyan: Color(.sRGB, red: 0, green: 0.27450980392156865, blue: 0.28627450980392155, opacity: 1),
iconDisabled: Color(.sRGB, red: 0.3764705882352941, green: 0.37254901960784315, blue: 0.3215686274509804, opacity: 1),
+ iconError: Color(.sRGB, red: 1, green: 0.6901960784313725, blue: 0.6078431372549019, opacity: 1),
iconGray: Color(.sRGB, red: 0.2901960784313726, green: 0.2784313725490196, blue: 0.19607843137254902, opacity: 1),
iconGreen: Color(.sRGB, red: 0.023529411764705882, green: 0.23529411764705882, blue: 0.0392156862745098, opacity: 1),
+ iconInfo: Color(.sRGB, red: 0.5058823529411764, green: 0.6627450980392157, blue: 1, opacity: 1),
iconOrange: Color(.sRGB, red: 0.3843137254901961, green: 0.1803921568627451, blue: 0, opacity: 1),
iconPink: Color(.sRGB, red: 0.4235294117647059, green: 0.0392156862745098, blue: 0.40784313725490196, opacity: 1),
iconPrimary: Color(.sRGB, red: 0.9529411764705882, green: 0.9490196078431372, blue: 0.8862745098039215, opacity: 1),
iconPurple: Color(.sRGB, red: 0.3215686274509804, green: 0.13725490196078433, blue: 0.4823529411764706, opacity: 1),
iconRed: Color(.sRGB, red: 0.43529411764705883, green: 0.0784313725490196, blue: 0, opacity: 1),
iconSecondary: Color(.sRGB, red: 0.6784313725490196, green: 0.6745098039215687, blue: 0.6196078431372549, opacity: 1),
+ iconSuccess: Color(.sRGB, red: 0.6588235294117647, green: 0.8313725490196079, blue: 0.6509803921568628, opacity: 1),
iconTeal: Color(.sRGB, red: 0, green: 0.2823529411764706, blue: 0.17647058823529413, opacity: 1),
+ iconWarning: Color(.sRGB, red: 0.9333333333333333, green: 0.8745098039215686, blue: 0.4588235294117647, opacity: 1),
iconYellow: Color(.sRGB, red: 0.26666666666666666, green: 0.23529411764705882, blue: 0, opacity: 1),
+ info: Color(.sRGB, red: 0.5058823529411764, green: 0.6627450980392157, blue: 1, opacity: 1),
+ infoMuted: Color(.sRGB, red: 0.8588235294117647, green: 0.8823529411764706, blue: 1, opacity: 1),
neutral: Color(.sRGB, red: 0.9529411764705882, green: 0.9490196078431372, blue: 0.8862745098039215, opacity: 0.10196078431372549),
onAccent: Color(.sRGB, red: 0.11372549019607843, green: 0.10980392156862745, blue: 0.06666666666666667, opacity: 1),
onDark: Color(.sRGB, red: 1, green: 1, blue: 1, opacity: 1),
onError: Color(.sRGB, red: 0.2980392156862745, green: 0.027450980392156862, blue: 0, opacity: 1),
+ onErrorMuted: Color(.sRGB, red: 1, green: 0.8509803921568627, blue: 0.8117647058823529, opacity: 1),
+ onInfo: Color(.sRGB, red: 0.11372549019607843, green: 0.10980392156862745, blue: 0.06666666666666667, opacity: 1),
+ onInfoMuted: Color(.sRGB, red: 0.12549019607843137, green: 0.22745098039215686, blue: 0.4235294117647059, opacity: 1),
onLight: Color(.sRGB, red: 0.11372549019607843, green: 0.10980392156862745, blue: 0.06666666666666667, opacity: 1),
onSuccess: Color(.sRGB, red: 0.00392156862745098, green: 0.18823529411764706, blue: 0.01568627450980392, opacity: 1),
+ onSuccessMuted: Color(.sRGB, red: 0.6588235294117647, green: 0.8313725490196079, blue: 0.6509803921568628, opacity: 1),
onWarning: Color(.sRGB, red: 0.17254901960784313, green: 0.14901960784313725, blue: 0, opacity: 1),
+ onWarningMuted: Color(.sRGB, red: 0.9333333333333333, green: 0.8745098039215686, blue: 0.4588235294117647, opacity: 1),
overlay: Color(.sRGB, red: 0.14901960784313725, green: 0.10196078431372549, blue: 0.07450980392156863, opacity: 0.8),
overlayHover: Color(.sRGB, red: 0.9529411764705882, green: 0.9490196078431372, blue: 0.8862745098039215, opacity: 0.050980392156862744),
overlayPressed: Color(.sRGB, red: 0.9529411764705882, green: 0.9490196078431372, blue: 0.8862745098039215, opacity: 0.10196078431372549),
@@ -363,15 +397,19 @@ extension Theme {
textBlue: Color(.sRGB, red: 0.12549019607843137, green: 0.22745098039215686, blue: 0.4235294117647059, opacity: 1),
textCyan: Color(.sRGB, red: 0, green: 0.27450980392156865, blue: 0.28627450980392155, opacity: 1),
textDisabled: Color(.sRGB, red: 0.3764705882352941, green: 0.37254901960784315, blue: 0.3215686274509804, opacity: 1),
+ textError: Color(.sRGB, red: 1, green: 0.6901960784313725, blue: 0.6078431372549019, opacity: 1),
textGray: Color(.sRGB, red: 0.2901960784313726, green: 0.2784313725490196, blue: 0.19607843137254902, opacity: 1),
textGreen: Color(.sRGB, red: 0.023529411764705882, green: 0.23529411764705882, blue: 0.0392156862745098, opacity: 1),
+ textInfo: Color(.sRGB, red: 0.5058823529411764, green: 0.6627450980392157, blue: 1, opacity: 1),
textOrange: Color(.sRGB, red: 0.3843137254901961, green: 0.1803921568627451, blue: 0, opacity: 1),
textPink: Color(.sRGB, red: 0.4235294117647059, green: 0.0392156862745098, blue: 0.40784313725490196, opacity: 1),
textPrimary: Color(.sRGB, red: 0.9529411764705882, green: 0.9490196078431372, blue: 0.8862745098039215, opacity: 1),
textPurple: Color(.sRGB, red: 0.3215686274509804, green: 0.13725490196078433, blue: 0.4823529411764706, opacity: 1),
textRed: Color(.sRGB, red: 0.43529411764705883, green: 0.0784313725490196, blue: 0, opacity: 1),
textSecondary: Color(.sRGB, red: 0.6784313725490196, green: 0.6745098039215687, blue: 0.6196078431372549, opacity: 1),
+ textSuccess: Color(.sRGB, red: 0.6588235294117647, green: 0.8313725490196079, blue: 0.6509803921568628, opacity: 1),
textTeal: Color(.sRGB, red: 0, green: 0.2823529411764706, blue: 0.17647058823529413, opacity: 1),
+ textWarning: Color(.sRGB, red: 0.9333333333333333, green: 0.8745098039215686, blue: 0.4588235294117647, opacity: 1),
textYellow: Color(.sRGB, red: 0.26666666666666666, green: 0.23529411764705882, blue: 0, opacity: 1),
tintHover: Color(.sRGB, red: 1, green: 1, blue: 1, opacity: 1),
track: Color(.sRGB, red: 0.35294117647058826, green: 0.3686274509803922, blue: 0.4, opacity: 1),
diff --git a/packages/native/apple/Sources/Astryx/Theme/Generated/ChocolateTheme.swift b/packages/native/apple/Sources/Astryx/Theme/Generated/ChocolateTheme.swift
index f2b7e9fab5..ff9c2145e5 100644
--- a/packages/native/apple/Sources/Astryx/Theme/Generated/ChocolateTheme.swift
+++ b/packages/native/apple/Sources/Astryx/Theme/Generated/ChocolateTheme.swift
@@ -32,13 +32,17 @@ extension Theme {
borderBlue: Color(.sRGB, red: 0.22745098039215686, green: 0.3686274509803922, blue: 0.5490196078431373, opacity: 1),
borderCyan: Color(.sRGB, red: 0.22745098039215686, green: 0.48627450980392156, blue: 0.48627450980392156, opacity: 1),
borderEmphasized: Color(.sRGB, red: 0.7215686274509804, green: 0.5333333333333333, blue: 0.34901960784313724, opacity: 1),
+ borderError: Color(.sRGB, red: 0.8, green: 0, blue: 0, opacity: 1),
borderGray: Color(.sRGB, red: 0.7215686274509804, green: 0.5333333333333333, blue: 0.34901960784313724, opacity: 1),
borderGreen: Color(.sRGB, red: 0.4392156862745098, green: 0.6, blue: 0, opacity: 1),
+ borderInfo: Color(.sRGB, red: 0.1803921568627451, green: 0.2901960784313726, blue: 0.43137254901960786, opacity: 1),
borderOrange: Color(.sRGB, red: 0.7686274509803922, green: 0.4627450980392157, blue: 0.12549019607843137, opacity: 1),
borderPink: Color(.sRGB, red: 0.7686274509803922, green: 0.2901960784313726, blue: 0.4392156862745098, opacity: 1),
borderPurple: Color(.sRGB, red: 0.4196078431372549, green: 0.2901960784313726, blue: 0.5490196078431373, opacity: 1),
borderRed: Color(.sRGB, red: 0.9921568627450981, green: 0, blue: 0, opacity: 1),
+ borderSuccess: Color(.sRGB, red: 0.3215686274509804, green: 0.43529411764705883, blue: 0, opacity: 1),
borderTeal: Color(.sRGB, red: 0.1803921568627451, green: 0.4196078431372549, blue: 0.35294117647058826, opacity: 1),
+ borderWarning: Color(.sRGB, red: 0.47843137254901963, green: 0.3333333333333333, blue: 0, opacity: 1),
borderYellow: Color(.sRGB, red: 1, green: 0.7137254901960784, blue: 0, opacity: 1),
dataBlue1: Color(.sRGB, red: 0.8588235294117647, green: 0.9254901960784314, blue: 1, opacity: 1),
dataBlue2: Color(.sRGB, red: 0.47058823529411764, green: 0.7450980392156863, blue: 1, opacity: 1),
@@ -102,23 +106,34 @@ extension Theme {
iconBlue: Color(.sRGB, red: 0.22745098039215686, green: 0.3686274509803922, blue: 0.5490196078431373, opacity: 1),
iconCyan: Color(.sRGB, red: 0.22745098039215686, green: 0.48627450980392156, blue: 0.48627450980392156, opacity: 1),
iconDisabled: Color(.sRGB, red: 0.7686274509803922, green: 0.6745098039215687, blue: 0.5843137254901961, opacity: 1),
+ iconError: Color(.sRGB, red: 0.8, green: 0, blue: 0, opacity: 1),
iconGray: Color(.sRGB, red: 0.7215686274509804, green: 0.5333333333333333, blue: 0.34901960784313724, opacity: 1),
iconGreen: Color(.sRGB, red: 0.4392156862745098, green: 0.6, blue: 0, opacity: 1),
+ iconInfo: Color(.sRGB, red: 0.1803921568627451, green: 0.2901960784313726, blue: 0.43137254901960786, opacity: 1),
iconOrange: Color(.sRGB, red: 0.7686274509803922, green: 0.4627450980392157, blue: 0.12549019607843137, opacity: 1),
iconPink: Color(.sRGB, red: 0.7686274509803922, green: 0.2901960784313726, blue: 0.4392156862745098, opacity: 1),
iconPrimary: Color(.sRGB, red: 0.2901960784313726, green: 0.20784313725490197, blue: 0.12549019607843137, opacity: 1),
iconPurple: Color(.sRGB, red: 0.4196078431372549, green: 0.2901960784313726, blue: 0.5490196078431373, opacity: 1),
iconRed: Color(.sRGB, red: 0.9921568627450981, green: 0, blue: 0, opacity: 1),
iconSecondary: Color(.sRGB, red: 0.7215686274509804, green: 0.5333333333333333, blue: 0.34901960784313724, opacity: 1),
+ iconSuccess: Color(.sRGB, red: 0.3215686274509804, green: 0.43529411764705883, blue: 0, opacity: 1),
iconTeal: Color(.sRGB, red: 0.1803921568627451, green: 0.4196078431372549, blue: 0.35294117647058826, opacity: 1),
+ iconWarning: Color(.sRGB, red: 0.47843137254901963, green: 0.3333333333333333, blue: 0, opacity: 1),
iconYellow: Color(.sRGB, red: 1, green: 0.7137254901960784, blue: 0, opacity: 1),
+ info: Color(.sRGB, red: 0.22745098039215686, green: 0.3686274509803922, blue: 0.5490196078431373, opacity: 1),
+ infoMuted: Color(.sRGB, red: 0.22745098039215686, green: 0.3686274509803922, blue: 0.5490196078431373, opacity: 0.2),
neutral: Color(.sRGB, red: 0.5490196078431373, green: 0.34901960784313724, blue: 0.15294117647058825, opacity: 0.058823529411764705),
onAccent: Color(.sRGB, red: 1, green: 1, blue: 1, opacity: 1),
onDark: Color(.sRGB, red: 1, green: 0.9882352941176471, blue: 0.9686274509803922, opacity: 1),
- onError: Color(.sRGB, red: 1, green: 1, blue: 1, opacity: 1),
+ onError: Color(.sRGB, red: 0.0784313725490196, green: 0.06274509803921569, blue: 0.06274509803921569, opacity: 1),
+ onErrorMuted: Color(.sRGB, red: 0.7058823529411765, green: 0, blue: 0, opacity: 1),
+ onInfo: Color(.sRGB, red: 1, green: 0.9882352941176471, blue: 0.9686274509803922, opacity: 1),
+ onInfoMuted: Color(.sRGB, red: 0.1803921568627451, green: 0.2901960784313726, blue: 0.43137254901960786, opacity: 1),
onLight: Color(.sRGB, red: 0.2901960784313726, green: 0.20784313725490197, blue: 0.12549019607843137, opacity: 1),
- onSuccess: Color(.sRGB, red: 1, green: 1, blue: 1, opacity: 1),
+ onSuccess: Color(.sRGB, red: 0.0784313725490196, green: 0.06274509803921569, blue: 0.06274509803921569, opacity: 1),
+ onSuccessMuted: Color(.sRGB, red: 0.30196078431372547, green: 0.40784313725490196, blue: 0, opacity: 1),
onWarning: Color(.sRGB, red: 0.2901960784313726, green: 0.20784313725490197, blue: 0.12549019607843137, opacity: 1),
+ onWarningMuted: Color(.sRGB, red: 0.47843137254901963, green: 0.3333333333333333, blue: 0, opacity: 1),
overlay: Color(.sRGB, red: 0.2901960784313726, green: 0.20784313725490197, blue: 0.12549019607843137, opacity: 0.5019607843137255),
overlayHover: Color(.sRGB, red: 0.2901960784313726, green: 0.20784313725490197, blue: 0.12549019607843137, opacity: 0.050980392156862744),
overlayPressed: Color(.sRGB, red: 0.2901960784313726, green: 0.20784313725490197, blue: 0.12549019607843137, opacity: 0.10196078431372549),
@@ -149,15 +164,19 @@ extension Theme {
textBlue: Color(.sRGB, red: 0.1803921568627451, green: 0.2901960784313726, blue: 0.43137254901960786, opacity: 1),
textCyan: Color(.sRGB, red: 0.1803921568627451, green: 0.3764705882352941, blue: 0.3764705882352941, opacity: 1),
textDisabled: Color(.sRGB, red: 0.7686274509803922, green: 0.6745098039215687, blue: 0.5843137254901961, opacity: 1),
+ textError: Color(.sRGB, red: 0.8, green: 0, blue: 0, opacity: 1),
textGray: Color(.sRGB, red: 0.2901960784313726, green: 0.20784313725490197, blue: 0.12549019607843137, opacity: 1),
textGreen: Color(.sRGB, red: 0.35294117647058826, green: 0.47843137254901963, blue: 0, opacity: 1),
+ textInfo: Color(.sRGB, red: 0.1803921568627451, green: 0.2901960784313726, blue: 0.43137254901960786, opacity: 1),
textOrange: Color(.sRGB, red: 0.6274509803921569, green: 0.3764705882352941, blue: 0.09411764705882353, opacity: 1),
textPink: Color(.sRGB, red: 0.6274509803921569, green: 0.22745098039215686, blue: 0.35294117647058826, opacity: 1),
textPrimary: Color(.sRGB, red: 0.2901960784313726, green: 0.20784313725490197, blue: 0.12549019607843137, opacity: 1),
textPurple: Color(.sRGB, red: 0.3333333333333333, green: 0.22745098039215686, blue: 0.4392156862745098, opacity: 1),
textRed: Color(.sRGB, red: 0.8, green: 0, blue: 0, opacity: 1),
textSecondary: Color(.sRGB, red: 0.7215686274509804, green: 0.5333333333333333, blue: 0.34901960784313724, opacity: 1),
+ textSuccess: Color(.sRGB, red: 0.3215686274509804, green: 0.43529411764705883, blue: 0, opacity: 1),
textTeal: Color(.sRGB, red: 0.1411764705882353, green: 0.3333333333333333, blue: 0.27450980392156865, opacity: 1),
+ textWarning: Color(.sRGB, red: 0.47843137254901963, green: 0.3333333333333333, blue: 0, opacity: 1),
textYellow: Color(.sRGB, red: 0.8, green: 0.5725490196078431, blue: 0, opacity: 1),
tintHover: Color(.sRGB, red: 0, green: 0, blue: 0, opacity: 1),
track: Color(.sRGB, red: 0.8, green: 0.8274509803921568, blue: 0.8588235294117647, opacity: 1),
@@ -246,13 +265,17 @@ extension Theme {
borderBlue: Color(.sRGB, red: 0.4823529411764706, green: 0.6588235294117647, blue: 0.8313725490196079, opacity: 1),
borderCyan: Color(.sRGB, red: 0.4392156862745098, green: 0.7686274509803922, blue: 0.7686274509803922, opacity: 1),
borderEmphasized: Color(.sRGB, red: 0.4196078431372549, green: 0.3333333333333333, blue: 0.25098039215686274, opacity: 1),
+ borderError: Color(.sRGB, red: 1, green: 0.47843137254901963, blue: 0.47843137254901963, opacity: 1),
borderGray: Color(.sRGB, red: 0.7215686274509804, green: 0.5333333333333333, blue: 0.34901960784313724, opacity: 1),
borderGreen: Color(.sRGB, red: 0.5882352941176471, green: 0.7490196078431373, blue: 0.16470588235294117, opacity: 1),
+ borderInfo: Color(.sRGB, red: 0.5529411764705883, green: 0.7372549019607844, blue: 0.8784313725490196, opacity: 1),
borderOrange: Color(.sRGB, red: 0.8313725490196079, green: 0.5647058823529412, blue: 0.22745098039215686, opacity: 1),
borderPink: Color(.sRGB, red: 0.8784313725490196, green: 0.47843137254901963, blue: 0.6039215686274509, opacity: 1),
borderPurple: Color(.sRGB, red: 0.6901960784313725, green: 0.5568627450980392, blue: 0.8313725490196079, opacity: 1),
borderRed: Color(.sRGB, red: 1, green: 0.3607843137254902, blue: 0.3607843137254902, opacity: 1),
+ borderSuccess: Color(.sRGB, red: 0.6588235294117647, green: 0.8313725490196079, blue: 0.22745098039215686, opacity: 1),
borderTeal: Color(.sRGB, red: 0.35294117647058826, green: 0.7215686274509804, blue: 0.596078431372549, opacity: 1),
+ borderWarning: Color(.sRGB, red: 1, green: 0.8509803921568627, blue: 0.3764705882352941, opacity: 1),
borderYellow: Color(.sRGB, red: 1, green: 0.788235294117647, blue: 0.25098039215686274, opacity: 1),
dataBlue1: Color(.sRGB, red: 0.8588235294117647, green: 0.9254901960784314, blue: 1, opacity: 1),
dataBlue2: Color(.sRGB, red: 0.47058823529411764, green: 0.7450980392156863, blue: 1, opacity: 1),
@@ -316,23 +339,34 @@ extension Theme {
iconBlue: Color(.sRGB, red: 0.4823529411764706, green: 0.6588235294117647, blue: 0.8313725490196079, opacity: 1),
iconCyan: Color(.sRGB, red: 0.4392156862745098, green: 0.7686274509803922, blue: 0.7686274509803922, opacity: 1),
iconDisabled: Color(.sRGB, red: 0.4196078431372549, green: 0.3333333333333333, blue: 0.25098039215686274, opacity: 1),
+ iconError: Color(.sRGB, red: 1, green: 0.47843137254901963, blue: 0.47843137254901963, opacity: 1),
iconGray: Color(.sRGB, red: 0.7686274509803922, green: 0.6588235294117647, blue: 0.5098039215686274, opacity: 1),
iconGreen: Color(.sRGB, red: 0.5882352941176471, green: 0.7490196078431373, blue: 0.16470588235294117, opacity: 1),
+ iconInfo: Color(.sRGB, red: 0.5529411764705883, green: 0.7372549019607844, blue: 0.8784313725490196, opacity: 1),
iconOrange: Color(.sRGB, red: 0.8313725490196079, green: 0.5647058823529412, blue: 0.22745098039215686, opacity: 1),
iconPink: Color(.sRGB, red: 0.8784313725490196, green: 0.47843137254901963, blue: 0.6039215686274509, opacity: 1),
iconPrimary: Color(.sRGB, red: 0.9294117647058824, green: 0.8941176470588236, blue: 0.8313725490196079, opacity: 1),
iconPurple: Color(.sRGB, red: 0.6901960784313725, green: 0.5568627450980392, blue: 0.8313725490196079, opacity: 1),
iconRed: Color(.sRGB, red: 1, green: 0.3607843137254902, blue: 0.3607843137254902, opacity: 1),
iconSecondary: Color(.sRGB, red: 0.7686274509803922, green: 0.6588235294117647, blue: 0.5098039215686274, opacity: 1),
+ iconSuccess: Color(.sRGB, red: 0.6588235294117647, green: 0.8313725490196079, blue: 0.22745098039215686, opacity: 1),
iconTeal: Color(.sRGB, red: 0.35294117647058826, green: 0.7215686274509804, blue: 0.596078431372549, opacity: 1),
+ iconWarning: Color(.sRGB, red: 1, green: 0.8509803921568627, blue: 0.3764705882352941, opacity: 1),
iconYellow: Color(.sRGB, red: 1, green: 0.788235294117647, blue: 0.25098039215686274, opacity: 1),
+ info: Color(.sRGB, red: 0.4823529411764706, green: 0.6588235294117647, blue: 0.8313725490196079, opacity: 1),
+ infoMuted: Color(.sRGB, red: 0.22745098039215686, green: 0.3686274509803922, blue: 0.5490196078431373, opacity: 0.2),
neutral: Color(.sRGB, red: 0.9294117647058824, green: 0.8941176470588236, blue: 0.8313725490196079, opacity: 0.10196078431372549),
onAccent: Color(.sRGB, red: 0.2901960784313726, green: 0.20784313725490197, blue: 0.12549019607843137, opacity: 1),
onDark: Color(.sRGB, red: 1, green: 0.9882352941176471, blue: 0.9686274509803922, opacity: 1),
- onError: Color(.sRGB, red: 0.2901960784313726, green: 0.20784313725490197, blue: 0.12549019607843137, opacity: 1),
+ onError: Color(.sRGB, red: 0.0784313725490196, green: 0.06274509803921569, blue: 0.06274509803921569, opacity: 1),
+ onErrorMuted: Color(.sRGB, red: 1, green: 0.47843137254901963, blue: 0.47843137254901963, opacity: 1),
+ onInfo: Color(.sRGB, red: 0.2901960784313726, green: 0.20784313725490197, blue: 0.12549019607843137, opacity: 1),
+ onInfoMuted: Color(.sRGB, red: 0.5529411764705883, green: 0.7372549019607844, blue: 0.8784313725490196, opacity: 1),
onLight: Color(.sRGB, red: 0.2901960784313726, green: 0.20784313725490197, blue: 0.12549019607843137, opacity: 1),
- onSuccess: Color(.sRGB, red: 0.2901960784313726, green: 0.20784313725490197, blue: 0.12549019607843137, opacity: 1),
+ onSuccess: Color(.sRGB, red: 0.0784313725490196, green: 0.06274509803921569, blue: 0.06274509803921569, opacity: 1),
+ onSuccessMuted: Color(.sRGB, red: 0.6588235294117647, green: 0.8313725490196079, blue: 0.22745098039215686, opacity: 1),
onWarning: Color(.sRGB, red: 0.2901960784313726, green: 0.20784313725490197, blue: 0.12549019607843137, opacity: 1),
+ onWarningMuted: Color(.sRGB, red: 1, green: 0.8509803921568627, blue: 0.3764705882352941, opacity: 1),
overlay: Color(.sRGB, red: 0.0784313725490196, green: 0.054901960784313725, blue: 0.0392156862745098, opacity: 0.8),
overlayHover: Color(.sRGB, red: 0.9294117647058824, green: 0.8941176470588236, blue: 0.8313725490196079, opacity: 0.050980392156862744),
overlayPressed: Color(.sRGB, red: 0.9294117647058824, green: 0.8941176470588236, blue: 0.8313725490196079, opacity: 0.10196078431372549),
@@ -363,15 +397,19 @@ extension Theme {
textBlue: Color(.sRGB, red: 0.5529411764705883, green: 0.7372549019607844, blue: 0.8784313725490196, opacity: 1),
textCyan: Color(.sRGB, red: 0.5098039215686274, green: 0.8313725490196079, blue: 0.8313725490196079, opacity: 1),
textDisabled: Color(.sRGB, red: 0.4196078431372549, green: 0.3333333333333333, blue: 0.25098039215686274, opacity: 1),
+ textError: Color(.sRGB, red: 1, green: 0.47843137254901963, blue: 0.47843137254901963, opacity: 1),
textGray: Color(.sRGB, red: 0.9294117647058824, green: 0.8941176470588236, blue: 0.8313725490196079, opacity: 1),
textGreen: Color(.sRGB, red: 0.6588235294117647, green: 0.8313725490196079, blue: 0.22745098039215686, opacity: 1),
+ textInfo: Color(.sRGB, red: 0.5529411764705883, green: 0.7372549019607844, blue: 0.8784313725490196, opacity: 1),
textOrange: Color(.sRGB, red: 0.8784313725490196, green: 0.6274509803921569, blue: 0.2901960784313726, opacity: 1),
textPink: Color(.sRGB, red: 0.9411764705882353, green: 0.5411764705882353, blue: 0.6666666666666666, opacity: 1),
textPrimary: Color(.sRGB, red: 0.9294117647058824, green: 0.8941176470588236, blue: 0.8313725490196079, opacity: 1),
textPurple: Color(.sRGB, red: 0.7529411764705882, green: 0.6274509803921569, blue: 0.8784313725490196, opacity: 1),
textRed: Color(.sRGB, red: 1, green: 0.47843137254901963, blue: 0.47843137254901963, opacity: 1),
textSecondary: Color(.sRGB, red: 0.7686274509803922, green: 0.6588235294117647, blue: 0.5098039215686274, opacity: 1),
+ textSuccess: Color(.sRGB, red: 0.6588235294117647, green: 0.8313725490196079, blue: 0.22745098039215686, opacity: 1),
textTeal: Color(.sRGB, red: 0.4235294117647059, green: 0.792156862745098, blue: 0.6666666666666666, opacity: 1),
+ textWarning: Color(.sRGB, red: 1, green: 0.8509803921568627, blue: 0.3764705882352941, opacity: 1),
textYellow: Color(.sRGB, red: 1, green: 0.8509803921568627, blue: 0.3764705882352941, opacity: 1),
tintHover: Color(.sRGB, red: 1, green: 1, blue: 1, opacity: 1),
track: Color(.sRGB, red: 0.35294117647058826, green: 0.3686274509803922, blue: 0.4, opacity: 1),
diff --git a/packages/native/apple/Sources/Astryx/Theme/Generated/DefaultTheme.swift b/packages/native/apple/Sources/Astryx/Theme/Generated/DefaultTheme.swift
index 57983f6bce..92c709ac29 100644
--- a/packages/native/apple/Sources/Astryx/Theme/Generated/DefaultTheme.swift
+++ b/packages/native/apple/Sources/Astryx/Theme/Generated/DefaultTheme.swift
@@ -32,13 +32,17 @@ extension Theme {
borderBlue: Color(.sRGB, red: 0, green: 0.39215686274509803, blue: 0.8784313725490196, opacity: 1),
borderCyan: Color(.sRGB, red: 0.03137254901960784, green: 0.615686274509804, blue: 0.8156862745098039, opacity: 1),
borderEmphasized: Color(.sRGB, red: 0.8, green: 0.8274509803921568, blue: 0.8588235294117647, opacity: 1),
+ borderError: Color(.sRGB, red: 0.4823529411764706, green: 0.00784313725490196, blue: 0.06274509803921569, opacity: 1),
borderGray: Color(.sRGB, red: 0.39215686274509803, green: 0.4627450980392157, blue: 0.5215686274509804, opacity: 1),
borderGreen: Color(.sRGB, red: 0.050980392156862744, green: 0.5254901960784314, blue: 0.14901960784313725, opacity: 1),
+ borderInfo: Color(.sRGB, red: 0.01568627450980392, green: 0.1843137254901961, blue: 0.592156862745098, opacity: 1),
borderOrange: Color(.sRGB, red: 0.9215686274509803, green: 0.43137254901960786, blue: 0, opacity: 1),
borderPink: Color(.sRGB, red: 0.9529411764705882, green: 0.3176470588235294, blue: 0.7529411764705882, opacity: 1),
borderPurple: Color(.sRGB, red: 0.5647058823529412, green: 0.5058823529411764, blue: 1, opacity: 1),
borderRed: Color(.sRGB, red: 0.8901960784313725, green: 0.09803921568627451, blue: 0.23137254901960785, opacity: 1),
+ borderSuccess: Color(.sRGB, red: 0.03529411764705882, green: 0.26666666666666666, blue: 0.12156862745098039, opacity: 1),
borderTeal: Color(.sRGB, red: 0.03137254901960784, green: 0.6392156862745098, blue: 0.6392156862745098, opacity: 1),
+ borderWarning: Color(.sRGB, red: 0.4588235294117647, green: 0.24705882352941178, blue: 0.027450980392156862, opacity: 1),
borderYellow: Color(.sRGB, red: 0.7725490196078432, green: 0.5254901960784314, blue: 0, opacity: 1),
dataBlue1: Color(.sRGB, red: 0.8588235294117647, green: 0.9254901960784314, blue: 1, opacity: 1),
dataBlue2: Color(.sRGB, red: 0.47058823529411764, green: 0.7450980392156863, blue: 1, opacity: 1),
@@ -102,23 +106,34 @@ extension Theme {
iconBlue: Color(.sRGB, red: 0, green: 0.39215686274509803, blue: 0.8784313725490196, opacity: 1),
iconCyan: Color(.sRGB, red: 0, green: 0.6745098039215687, blue: 0.7568627450980392, opacity: 1),
iconDisabled: Color(.sRGB, red: 0.6431372549019608, green: 0.6901960784313725, blue: 0.7372549019607844, opacity: 1),
+ iconError: Color(.sRGB, red: 0.4823529411764706, green: 0.00784313725490196, blue: 0.06274509803921569, opacity: 1),
iconGray: Color(.sRGB, red: 0.3058823529411765, green: 0.3764705882352941, blue: 0.43529411764705883, opacity: 1),
iconGreen: Color(.sRGB, red: 0.050980392156862744, green: 0.5254901960784314, blue: 0.14901960784313725, opacity: 1),
+ iconInfo: Color(.sRGB, red: 0.01568627450980392, green: 0.1843137254901961, blue: 0.592156862745098, opacity: 1),
iconOrange: Color(.sRGB, red: 0.9137254901960784, green: 0.4117647058823529, blue: 0.043137254901960784, opacity: 1),
iconPink: Color(.sRGB, red: 0.7607843137254902, green: 0.09411764705882353, blue: 0.3568627450980392, opacity: 1),
iconPrimary: Color(.sRGB, red: 0.0392156862745098, green: 0.07450980392156863, blue: 0.09019607843137255, opacity: 1),
iconPurple: Color(.sRGB, red: 0.3568627450980392, green: 0.03137254901960784, blue: 0.8470588235294118, opacity: 1),
iconRed: Color(.sRGB, red: 0.8274509803921568, green: 0.06666666666666667, blue: 0.18823529411764706, opacity: 1),
iconSecondary: Color(.sRGB, red: 0.3058823529411765, green: 0.3764705882352941, blue: 0.43529411764705883, opacity: 1),
+ iconSuccess: Color(.sRGB, red: 0.03529411764705882, green: 0.26666666666666666, blue: 0.12156862745098039, opacity: 1),
iconTeal: Color(.sRGB, red: 0, green: 0.5882352941176471, blue: 0.5333333333333333, opacity: 1),
+ iconWarning: Color(.sRGB, red: 0.4588235294117647, green: 0.24705882352941178, blue: 0.027450980392156862, opacity: 1),
iconYellow: Color(.sRGB, red: 0.984313725490196, green: 0.7529411764705882, blue: 0.17647058823529413, opacity: 1),
+ info: Color(.sRGB, red: 0, green: 0.39215686274509803, blue: 0.8784313725490196, opacity: 1),
+ infoMuted: Color(.sRGB, red: 0, green: 0.5098039215686274, blue: 0.984313725490196, opacity: 0.2),
neutral: Color(.sRGB, red: 0.0196078431372549, green: 0.21176470588235294, blue: 0.34901960784313724, opacity: 0.10196078431372549),
onAccent: Color(.sRGB, red: 1, green: 1, blue: 1, opacity: 1),
onDark: Color(.sRGB, red: 1, green: 1, blue: 1, opacity: 1),
onError: Color(.sRGB, red: 1, green: 1, blue: 1, opacity: 1),
+ onErrorMuted: Color(.sRGB, red: 0.4823529411764706, green: 0.00784313725490196, blue: 0.06274509803921569, opacity: 1),
+ onInfo: Color(.sRGB, red: 1, green: 1, blue: 1, opacity: 1),
+ onInfoMuted: Color(.sRGB, red: 0.01568627450980392, green: 0.1843137254901961, blue: 0.592156862745098, opacity: 1),
onLight: Color(.sRGB, red: 0, green: 0, blue: 0, opacity: 1),
onSuccess: Color(.sRGB, red: 1, green: 1, blue: 1, opacity: 1),
+ onSuccessMuted: Color(.sRGB, red: 0.03529411764705882, green: 0.26666666666666666, blue: 0.12156862745098039, opacity: 1),
onWarning: Color(.sRGB, red: 0.0392156862745098, green: 0.07450980392156863, blue: 0.09019607843137255, opacity: 1),
+ onWarningMuted: Color(.sRGB, red: 0.4588235294117647, green: 0.24705882352941178, blue: 0.027450980392156862, opacity: 1),
overlay: Color(.sRGB, red: 0.00392156862745098, green: 0.07058823529411765, blue: 0.1568627450980392, opacity: 0.4),
overlayHover: Color(.sRGB, red: 0.0196078431372549, green: 0.21176470588235294, blue: 0.34901960784313724, opacity: 0.047058823529411764),
overlayPressed: Color(.sRGB, red: 0.0196078431372549, green: 0.21176470588235294, blue: 0.34901960784313724, opacity: 0.09803921568627451),
@@ -149,15 +164,19 @@ extension Theme {
textBlue: Color(.sRGB, red: 0.01568627450980392, green: 0.1843137254901961, blue: 0.592156862745098, opacity: 1),
textCyan: Color(.sRGB, red: 0.00392156862745098, green: 0.28627450980392155, blue: 0.4588235294117647, opacity: 1),
textDisabled: Color(.sRGB, red: 0.6431372549019608, green: 0.6901960784313725, blue: 0.7372549019607844, opacity: 1),
+ textError: Color(.sRGB, red: 0.4823529411764706, green: 0.00784313725490196, blue: 0.06274509803921569, opacity: 1),
textGray: Color(.sRGB, red: 0.0392156862745098, green: 0.07450980392156863, blue: 0.09019607843137255, opacity: 1),
textGreen: Color(.sRGB, red: 0.03529411764705882, green: 0.26666666666666666, blue: 0.12156862745098039, opacity: 1),
+ textInfo: Color(.sRGB, red: 0.01568627450980392, green: 0.1843137254901961, blue: 0.592156862745098, opacity: 1),
textOrange: Color(.sRGB, red: 0.4196078431372549, green: 0.13333333333333333, blue: 0.011764705882352941, opacity: 1),
textPink: Color(.sRGB, red: 0.396078431372549, green: 0, blue: 0.3254901960784314, opacity: 1),
textPrimary: Color(.sRGB, red: 0.0392156862745098, green: 0.07450980392156863, blue: 0.09019607843137255, opacity: 1),
textPurple: Color(.sRGB, red: 0.24313725490196078, green: 0.023529411764705882, blue: 0.592156862745098, opacity: 1),
textRed: Color(.sRGB, red: 0.4823529411764706, green: 0.00784313725490196, blue: 0.06274509803921569, opacity: 1),
textSecondary: Color(.sRGB, red: 0.3058823529411765, green: 0.3764705882352941, blue: 0.43529411764705883, opacity: 1),
+ textSuccess: Color(.sRGB, red: 0.03529411764705882, green: 0.26666666666666666, blue: 0.12156862745098039, opacity: 1),
textTeal: Color(.sRGB, red: 0.03137254901960784, green: 0.2235294117647059, blue: 0.2627450980392157, opacity: 1),
+ textWarning: Color(.sRGB, red: 0.4588235294117647, green: 0.24705882352941178, blue: 0.027450980392156862, opacity: 1),
textYellow: Color(.sRGB, red: 0.4588235294117647, green: 0.24705882352941178, blue: 0.027450980392156862, opacity: 1),
tintHover: Color(.sRGB, red: 0, green: 0, blue: 0, opacity: 1),
track: Color(.sRGB, red: 0.8, green: 0.8274509803921568, blue: 0.8588235294117647, opacity: 1),
@@ -246,13 +265,17 @@ extension Theme {
borderBlue: Color(.sRGB, red: 0.14901960784313725, green: 0.5803921568627451, blue: 0.996078431372549, opacity: 1),
borderCyan: Color(.sRGB, red: 0.00392156862745098, green: 0.44313725490196076, blue: 0.6431372549019608, opacity: 1),
borderEmphasized: Color(.sRGB, red: 0.28627450980392155, green: 0.30196078431372547, blue: 0.3254901960784314, opacity: 1),
+ borderError: Color(.sRGB, red: 1, green: 0.6980392156862745, blue: 0.7215686274509804, opacity: 1),
borderGray: Color(.sRGB, red: 0.4549019607843137, green: 0.5254901960784314, blue: 0.5843137254901961, opacity: 1),
borderGreen: Color(.sRGB, red: 0.043137254901960784, green: 0.6, blue: 0.12156862745098039, opacity: 1),
+ borderInfo: Color(.sRGB, red: 0.6862745098039216, green: 0.8431372549019608, blue: 1, opacity: 1),
borderOrange: Color(.sRGB, red: 0.7019607843137254, green: 0.2901960784313726, blue: 0.00392156862745098, opacity: 1),
borderPink: Color(.sRGB, red: 0.7529411764705882, green: 0.13333333333333333, blue: 0.5803921568627451, opacity: 1),
borderPurple: Color(.sRGB, red: 0.45098039215686275, green: 0.25098039215686274, blue: 0.996078431372549, opacity: 1),
borderRed: Color(.sRGB, red: 0.9607843137254902, green: 0.2235294117647059, blue: 0.30980392156862746, opacity: 1),
+ borderSuccess: Color(.sRGB, red: 0.6470588235294118, green: 0.9647058823529412, blue: 0.5647058823529412, opacity: 1),
borderTeal: Color(.sRGB, red: 0.03137254901960784, green: 0.4627450980392157, blue: 0.49019607843137253, opacity: 1),
+ borderWarning: Color(.sRGB, red: 0.984313725490196, green: 0.807843137254902, blue: 0.011764705882352941, opacity: 1),
borderYellow: Color(.sRGB, red: 0.7058823529411765, green: 0.4666666666666667, blue: 0, opacity: 1),
dataBlue1: Color(.sRGB, red: 0.8588235294117647, green: 0.9254901960784314, blue: 1, opacity: 1),
dataBlue2: Color(.sRGB, red: 0.47058823529411764, green: 0.7450980392156863, blue: 1, opacity: 1),
@@ -316,23 +339,34 @@ extension Theme {
iconBlue: Color(.sRGB, red: 0.14901960784313725, green: 0.5803921568627451, blue: 0.996078431372549, opacity: 1),
iconCyan: Color(.sRGB, red: 0.14901960784313725, green: 0.7764705882352941, blue: 0.8549019607843137, opacity: 1),
iconDisabled: Color(.sRGB, red: 0.43529411764705883, green: 0.4549019607843137, blue: 0.48627450980392156, opacity: 1),
+ iconError: Color(.sRGB, red: 1, green: 0.6980392156862745, blue: 0.7215686274509804, opacity: 1),
iconGray: Color(.sRGB, red: 0.6666666666666666, green: 0.6862745098039216, blue: 0.7098039215686275, opacity: 1),
iconGreen: Color(.sRGB, red: 0.14901960784313725, green: 0.6549019607843137, blue: 0.33725490196078434, opacity: 1),
+ iconInfo: Color(.sRGB, red: 0.6862745098039216, green: 0.8431372549019608, blue: 1, opacity: 1),
iconOrange: Color(.sRGB, red: 0.984313725490196, green: 0.5490196078431373, blue: 0, opacity: 1),
iconPink: Color(.sRGB, red: 0.9254901960784314, green: 0.25098039215686274, blue: 0.47843137254901963, opacity: 1),
iconPrimary: Color(.sRGB, red: 0.8745098039215686, green: 0.8862745098039215, blue: 0.8980392156862745, opacity: 1),
iconPurple: Color(.sRGB, red: 0.4745098039215686, green: 0.3215686274509804, blue: 1, opacity: 1),
iconRed: Color(.sRGB, red: 0.8901960784313725, green: 0.09803921568627451, blue: 0.23137254901960785, opacity: 1),
iconSecondary: Color(.sRGB, red: 0.6666666666666666, green: 0.6862745098039216, blue: 0.7098039215686275, opacity: 1),
+ iconSuccess: Color(.sRGB, red: 0.6470588235294118, green: 0.9647058823529412, blue: 0.5647058823529412, opacity: 1),
iconTeal: Color(.sRGB, red: 0.14901960784313725, green: 0.6509803921568628, blue: 0.6039215686274509, opacity: 1),
+ iconWarning: Color(.sRGB, red: 0.984313725490196, green: 0.807843137254902, blue: 0.011764705882352941, opacity: 1),
iconYellow: Color(.sRGB, red: 1, green: 0.9333333333333333, blue: 0.34509803921568627, opacity: 1),
+ info: Color(.sRGB, red: 0, green: 0.39215686274509803, blue: 0.8784313725490196, opacity: 1),
+ infoMuted: Color(.sRGB, red: 0, green: 0.5098039215686274, blue: 0.984313725490196, opacity: 0.24705882352941178),
neutral: Color(.sRGB, red: 0.8745098039215686, green: 0.8862745098039215, blue: 0.8980392156862745, opacity: 0.2),
onAccent: Color(.sRGB, red: 1, green: 1, blue: 1, opacity: 1),
onDark: Color(.sRGB, red: 1, green: 1, blue: 1, opacity: 1),
- onError: Color(.sRGB, red: 1, green: 1, blue: 1, opacity: 1),
+ onError: Color(.sRGB, red: 0.0392156862745098, green: 0.07450980392156863, blue: 0.09019607843137255, opacity: 1),
+ onErrorMuted: Color(.sRGB, red: 1, green: 0.6980392156862745, blue: 0.7215686274509804, opacity: 1),
+ onInfo: Color(.sRGB, red: 1, green: 1, blue: 1, opacity: 1),
+ onInfoMuted: Color(.sRGB, red: 0.6862745098039216, green: 0.8431372549019608, blue: 1, opacity: 1),
onLight: Color(.sRGB, red: 0, green: 0, blue: 0, opacity: 1),
onSuccess: Color(.sRGB, red: 1, green: 1, blue: 1, opacity: 1),
+ onSuccessMuted: Color(.sRGB, red: 0.6470588235294118, green: 0.9647058823529412, blue: 0.5647058823529412, opacity: 1),
onWarning: Color(.sRGB, red: 0.0392156862745098, green: 0.07450980392156863, blue: 0.09019607843137255, opacity: 1),
+ onWarningMuted: Color(.sRGB, red: 0.984313725490196, green: 0.807843137254902, blue: 0.011764705882352941, opacity: 1),
overlay: Color(.sRGB, red: 0.06666666666666667, green: 0.06666666666666667, blue: 0.07058823529411765, opacity: 0.6),
overlayHover: Color(.sRGB, red: 1, green: 1, blue: 1, opacity: 0.047058823529411764),
overlayPressed: Color(.sRGB, red: 1, green: 1, blue: 1, opacity: 0.09803921568627451),
@@ -363,15 +397,19 @@ extension Theme {
textBlue: Color(.sRGB, red: 0.6862745098039216, green: 0.8431372549019608, blue: 1, opacity: 1),
textCyan: Color(.sRGB, red: 0.6313725490196078, green: 0.9333333333333333, blue: 0.9764705882352941, opacity: 1),
textDisabled: Color(.sRGB, red: 0.43529411764705883, green: 0.4549019607843137, blue: 0.48627450980392156, opacity: 1),
+ textError: Color(.sRGB, red: 1, green: 0.6980392156862745, blue: 0.7215686274509804, opacity: 1),
textGray: Color(.sRGB, red: 0.9058823529411765, green: 0.9176470588235294, blue: 0.9294117647058824, opacity: 1),
textGreen: Color(.sRGB, red: 0.6470588235294118, green: 0.9647058823529412, blue: 0.5647058823529412, opacity: 1),
+ textInfo: Color(.sRGB, red: 0.6862745098039216, green: 0.8431372549019608, blue: 1, opacity: 1),
textOrange: Color(.sRGB, red: 0.9921568627450981, green: 0.7215686274509804, blue: 0.4627450980392157, opacity: 1),
textPink: Color(.sRGB, red: 0.996078431372549, green: 0.6784313725490196, blue: 0.8901960784313725, opacity: 1),
textPrimary: Color(.sRGB, red: 0.8745098039215686, green: 0.8862745098039215, blue: 0.8980392156862745, opacity: 1),
textPurple: Color(.sRGB, red: 0.7019607843137254, green: 0.6901960784313725, blue: 0.996078431372549, opacity: 1),
textRed: Color(.sRGB, red: 1, green: 0.6980392156862745, blue: 0.7215686274509804, opacity: 1),
textSecondary: Color(.sRGB, red: 0.6666666666666666, green: 0.6862745098039216, blue: 0.7098039215686275, opacity: 1),
+ textSuccess: Color(.sRGB, red: 0.6470588235294118, green: 0.9647058823529412, blue: 0.5647058823529412, opacity: 1),
textTeal: Color(.sRGB, red: 0.25098039215686274, green: 0.8627450980392157, blue: 0.803921568627451, opacity: 1),
+ textWarning: Color(.sRGB, red: 0.984313725490196, green: 0.807843137254902, blue: 0.011764705882352941, opacity: 1),
textYellow: Color(.sRGB, red: 0.984313725490196, green: 0.807843137254902, blue: 0.011764705882352941, opacity: 1),
tintHover: Color(.sRGB, red: 1, green: 1, blue: 1, opacity: 1),
track: Color(.sRGB, red: 0.35294117647058826, green: 0.3686274509803922, blue: 0.4, opacity: 1),
diff --git a/packages/native/apple/Sources/Astryx/Theme/Generated/GothicTheme.swift b/packages/native/apple/Sources/Astryx/Theme/Generated/GothicTheme.swift
index be9fed7cfb..34aa65a0a4 100644
--- a/packages/native/apple/Sources/Astryx/Theme/Generated/GothicTheme.swift
+++ b/packages/native/apple/Sources/Astryx/Theme/Generated/GothicTheme.swift
@@ -32,13 +32,17 @@ extension Theme {
borderBlue: Color(.sRGB, red: 0.5254901960784314, green: 0.5882352941176471, blue: 0.7215686274509804, opacity: 1),
borderCyan: Color(.sRGB, red: 0.5254901960784314, green: 0.6431372549019608, blue: 0.6941176470588235, opacity: 1),
borderEmphasized: Color(.sRGB, red: 0.28627450980392155, green: 0.3137254901960784, blue: 0.33725490196078434, opacity: 1),
+ borderError: Color(.sRGB, red: 0.7764705882352941, green: 0.6509803921568628, blue: 0.6352941176470588, opacity: 1),
borderGray: Color(.sRGB, red: 0.3686274509803922, green: 0.403921568627451, blue: 0.43137254901960786, opacity: 1),
borderGreen: Color(.sRGB, red: 0.5882352941176471, green: 0.6588235294117647, blue: 0.5019607843137255, opacity: 1),
+ borderInfo: Color(.sRGB, red: 0.6392156862745098, green: 0.7098039215686275, blue: 0.8392156862745098, opacity: 1),
borderOrange: Color(.sRGB, red: 0.7137254901960784, green: 0.596078431372549, blue: 0.49019607843137253, opacity: 1),
borderPink: Color(.sRGB, red: 0.6666666666666666, green: 0.49019607843137253, blue: 0.5568627450980392, opacity: 1),
borderPurple: Color(.sRGB, red: 0.5803921568627451, green: 0.49019607843137253, blue: 0.6509803921568628, opacity: 1),
borderRed: Color(.sRGB, red: 0.6431372549019608, green: 0.5215686274509804, blue: 0.5058823529411764, opacity: 1),
+ borderSuccess: Color(.sRGB, red: 0.7019607843137254, green: 0.7803921568627451, blue: 0.6039215686274509, opacity: 1),
borderTeal: Color(.sRGB, red: 0.5254901960784314, green: 0.6431372549019608, blue: 0.6, opacity: 1),
+ borderWarning: Color(.sRGB, red: 0.8274509803921568, green: 0.7686274509803922, blue: 0.5647058823529412, opacity: 1),
borderYellow: Color(.sRGB, red: 0.7137254901960784, green: 0.6549019607843137, blue: 0.4588235294117647, opacity: 1),
dataBlue1: Color(.sRGB, red: 0.8588235294117647, green: 0.9254901960784314, blue: 1, opacity: 1),
dataBlue2: Color(.sRGB, red: 0.47058823529411764, green: 0.7450980392156863, blue: 1, opacity: 1),
@@ -102,23 +106,34 @@ extension Theme {
iconBlue: Color(.sRGB, red: 0.16470588235294117, green: 0.23137254901960785, blue: 0.43137254901960786, opacity: 1),
iconCyan: Color(.sRGB, red: 0.16470588235294117, green: 0.3686274509803922, blue: 0.4588235294117647, opacity: 1),
iconDisabled: Color(.sRGB, red: 0.28627450980392155, green: 0.3137254901960784, blue: 0.33725490196078434, opacity: 1),
+ iconError: Color(.sRGB, red: 0.7764705882352941, green: 0.6509803921568628, blue: 0.6352941176470588, opacity: 1),
iconGray: Color(.sRGB, red: 0.9098039215686274, green: 0.9450980392156862, blue: 0.9647058823529412, opacity: 1),
iconGreen: Color(.sRGB, red: 0.22745098039215686, green: 0.3686274509803922, blue: 0.17254901960784313, opacity: 1),
+ iconInfo: Color(.sRGB, red: 0.6392156862745098, green: 0.7098039215686275, blue: 0.8392156862745098, opacity: 1),
iconOrange: Color(.sRGB, red: 0.5411764705882353, green: 0.2823529411764706, blue: 0.09411764705882353, opacity: 1),
iconPink: Color(.sRGB, red: 0.5529411764705883, green: 0.17647058823529413, blue: 0.2980392156862745, opacity: 1),
iconPrimary: Color(.sRGB, red: 0.9098039215686274, green: 0.9450980392156862, blue: 0.9647058823529412, opacity: 1),
iconPurple: Color(.sRGB, red: 0.35294117647058826, green: 0.13725490196078433, blue: 0.4392156862745098, opacity: 1),
iconRed: Color(.sRGB, red: 0.3686274509803922, green: 0.22745098039215686, blue: 0.20784313725490197, opacity: 1),
iconSecondary: Color(.sRGB, red: 0.5882352941176471, green: 0.6274509803921569, blue: 0.6705882352941176, opacity: 1),
+ iconSuccess: Color(.sRGB, red: 0.7019607843137254, green: 0.7803921568627451, blue: 0.6039215686274509, opacity: 1),
iconTeal: Color(.sRGB, red: 0.12156862745098039, green: 0.3686274509803922, blue: 0.3215686274509804, opacity: 1),
+ iconWarning: Color(.sRGB, red: 0.8274509803921568, green: 0.7686274509803922, blue: 0.5647058823529412, opacity: 1),
iconYellow: Color(.sRGB, red: 0.5294117647058824, green: 0.396078431372549, blue: 0.08235294117647059, opacity: 1),
+ info: Color(.sRGB, red: 0.5411764705882353, green: 0.6313725490196078, blue: 0.8470588235294118, opacity: 1),
+ infoMuted: Color(.sRGB, red: 0.6392156862745098, green: 0.7098039215686275, blue: 0.8392156862745098, opacity: 1),
neutral: Color(.sRGB, red: 0.9098039215686274, green: 0.9450980392156862, blue: 0.9647058823529412, opacity: 0.10196078431372549),
onAccent: Color(.sRGB, red: 0.06274509803921569, green: 0.07450980392156863, blue: 0.0784313725490196, opacity: 1),
onDark: Color(.sRGB, red: 0.9098039215686274, green: 0.9450980392156862, blue: 0.9647058823529412, opacity: 1),
onError: Color(.sRGB, red: 0.06274509803921569, green: 0.07450980392156863, blue: 0.0784313725490196, opacity: 1),
+ onErrorMuted: Color(.sRGB, red: 0.2901960784313726, green: 0.1450980392156863, blue: 0.12549019607843137, opacity: 1),
+ onInfo: Color(.sRGB, red: 0.06274509803921569, green: 0.07450980392156863, blue: 0.0784313725490196, opacity: 1),
+ onInfoMuted: Color(.sRGB, red: 0.12156862745098039, green: 0.17254901960784313, blue: 0.32941176470588235, opacity: 1),
onLight: Color(.sRGB, red: 0.06274509803921569, green: 0.07450980392156863, blue: 0.0784313725490196, opacity: 1),
onSuccess: Color(.sRGB, red: 0.06274509803921569, green: 0.07450980392156863, blue: 0.0784313725490196, opacity: 1),
+ onSuccessMuted: Color(.sRGB, red: 0.1411764705882353, green: 0.25098039215686274, blue: 0.13725490196078433, opacity: 1),
onWarning: Color(.sRGB, red: 0.06274509803921569, green: 0.07450980392156863, blue: 0.0784313725490196, opacity: 1),
+ onWarningMuted: Color(.sRGB, red: 0.3411764705882353, green: 0.24705882352941178, blue: 0.043137254901960784, opacity: 1),
overlay: Color(.sRGB, red: 0.06274509803921569, green: 0.07450980392156863, blue: 0.0784313725490196, opacity: 0.8),
overlayHover: Color(.sRGB, red: 0.9098039215686274, green: 0.9450980392156862, blue: 0.9647058823529412, opacity: 0.050980392156862744),
overlayPressed: Color(.sRGB, red: 0.9098039215686274, green: 0.9450980392156862, blue: 0.9647058823529412, opacity: 0.10196078431372549),
@@ -149,15 +164,19 @@ extension Theme {
textBlue: Color(.sRGB, red: 0.12156862745098039, green: 0.17254901960784313, blue: 0.32941176470588235, opacity: 1),
textCyan: Color(.sRGB, red: 0.12549019607843137, green: 0.2823529411764706, blue: 0.34509803921568627, opacity: 1),
textDisabled: Color(.sRGB, red: 0.28627450980392155, green: 0.3137254901960784, blue: 0.33725490196078434, opacity: 1),
+ textError: Color(.sRGB, red: 0.7764705882352941, green: 0.6509803921568628, blue: 0.6352941176470588, opacity: 1),
textGray: Color(.sRGB, red: 0.9098039215686274, green: 0.9450980392156862, blue: 0.9647058823529412, opacity: 1),
textGreen: Color(.sRGB, red: 0.1411764705882353, green: 0.25098039215686274, blue: 0.13725490196078433, opacity: 1),
+ textInfo: Color(.sRGB, red: 0.6392156862745098, green: 0.7098039215686275, blue: 0.8392156862745098, opacity: 1),
textOrange: Color(.sRGB, red: 0.43137254901960786, green: 0.2196078431372549, blue: 0.07058823529411765, opacity: 1),
textPink: Color(.sRGB, red: 0.3607843137254902, green: 0.09411764705882353, blue: 0.1843137254901961, opacity: 1),
textPrimary: Color(.sRGB, red: 0.9098039215686274, green: 0.9450980392156862, blue: 0.9647058823529412, opacity: 1),
textPurple: Color(.sRGB, red: 0.2823529411764706, green: 0.10588235294117647, blue: 0.34509803921568627, opacity: 1),
textRed: Color(.sRGB, red: 0.2901960784313726, green: 0.1450980392156863, blue: 0.12549019607843137, opacity: 1),
textSecondary: Color(.sRGB, red: 0.5882352941176471, green: 0.6274509803921569, blue: 0.6705882352941176, opacity: 1),
+ textSuccess: Color(.sRGB, red: 0.7019607843137254, green: 0.7803921568627451, blue: 0.6039215686274509, opacity: 1),
textTeal: Color(.sRGB, red: 0.09019607843137255, green: 0.2901960784313726, blue: 0.25098039215686274, opacity: 1),
+ textWarning: Color(.sRGB, red: 0.8274509803921568, green: 0.7686274509803922, blue: 0.5647058823529412, opacity: 1),
textYellow: Color(.sRGB, red: 0.3411764705882353, green: 0.24705882352941178, blue: 0.043137254901960784, opacity: 1),
tintHover: Color(.sRGB, red: 1, green: 1, blue: 1, opacity: 1),
track: Color(.sRGB, red: 0.8, green: 0.8274509803921568, blue: 0.8588235294117647, opacity: 1),
@@ -246,13 +265,17 @@ extension Theme {
borderBlue: Color(.sRGB, red: 0.5254901960784314, green: 0.5882352941176471, blue: 0.7215686274509804, opacity: 1),
borderCyan: Color(.sRGB, red: 0.5254901960784314, green: 0.6431372549019608, blue: 0.6941176470588235, opacity: 1),
borderEmphasized: Color(.sRGB, red: 0.28627450980392155, green: 0.3137254901960784, blue: 0.33725490196078434, opacity: 1),
+ borderError: Color(.sRGB, red: 0.7764705882352941, green: 0.6509803921568628, blue: 0.6352941176470588, opacity: 1),
borderGray: Color(.sRGB, red: 0.3686274509803922, green: 0.403921568627451, blue: 0.43137254901960786, opacity: 1),
borderGreen: Color(.sRGB, red: 0.5882352941176471, green: 0.6588235294117647, blue: 0.5019607843137255, opacity: 1),
+ borderInfo: Color(.sRGB, red: 0.6392156862745098, green: 0.7098039215686275, blue: 0.8392156862745098, opacity: 1),
borderOrange: Color(.sRGB, red: 0.7137254901960784, green: 0.596078431372549, blue: 0.49019607843137253, opacity: 1),
borderPink: Color(.sRGB, red: 0.6666666666666666, green: 0.49019607843137253, blue: 0.5568627450980392, opacity: 1),
borderPurple: Color(.sRGB, red: 0.5803921568627451, green: 0.49019607843137253, blue: 0.6509803921568628, opacity: 1),
borderRed: Color(.sRGB, red: 0.6431372549019608, green: 0.5215686274509804, blue: 0.5058823529411764, opacity: 1),
+ borderSuccess: Color(.sRGB, red: 0.7019607843137254, green: 0.7803921568627451, blue: 0.6039215686274509, opacity: 1),
borderTeal: Color(.sRGB, red: 0.5254901960784314, green: 0.6431372549019608, blue: 0.6, opacity: 1),
+ borderWarning: Color(.sRGB, red: 0.8274509803921568, green: 0.7686274509803922, blue: 0.5647058823529412, opacity: 1),
borderYellow: Color(.sRGB, red: 0.7137254901960784, green: 0.6549019607843137, blue: 0.4588235294117647, opacity: 1),
dataBlue1: Color(.sRGB, red: 0.8588235294117647, green: 0.9254901960784314, blue: 1, opacity: 1),
dataBlue2: Color(.sRGB, red: 0.47058823529411764, green: 0.7450980392156863, blue: 1, opacity: 1),
@@ -316,23 +339,34 @@ extension Theme {
iconBlue: Color(.sRGB, red: 0.16470588235294117, green: 0.23137254901960785, blue: 0.43137254901960786, opacity: 1),
iconCyan: Color(.sRGB, red: 0.16470588235294117, green: 0.3686274509803922, blue: 0.4588235294117647, opacity: 1),
iconDisabled: Color(.sRGB, red: 0.28627450980392155, green: 0.3137254901960784, blue: 0.33725490196078434, opacity: 1),
+ iconError: Color(.sRGB, red: 0.7764705882352941, green: 0.6509803921568628, blue: 0.6352941176470588, opacity: 1),
iconGray: Color(.sRGB, red: 0.9098039215686274, green: 0.9450980392156862, blue: 0.9647058823529412, opacity: 1),
iconGreen: Color(.sRGB, red: 0.22745098039215686, green: 0.3686274509803922, blue: 0.17254901960784313, opacity: 1),
+ iconInfo: Color(.sRGB, red: 0.6392156862745098, green: 0.7098039215686275, blue: 0.8392156862745098, opacity: 1),
iconOrange: Color(.sRGB, red: 0.5411764705882353, green: 0.2823529411764706, blue: 0.09411764705882353, opacity: 1),
iconPink: Color(.sRGB, red: 0.5529411764705883, green: 0.17647058823529413, blue: 0.2980392156862745, opacity: 1),
iconPrimary: Color(.sRGB, red: 0.9098039215686274, green: 0.9450980392156862, blue: 0.9647058823529412, opacity: 1),
iconPurple: Color(.sRGB, red: 0.35294117647058826, green: 0.13725490196078433, blue: 0.4392156862745098, opacity: 1),
iconRed: Color(.sRGB, red: 0.3686274509803922, green: 0.22745098039215686, blue: 0.20784313725490197, opacity: 1),
iconSecondary: Color(.sRGB, red: 0.5882352941176471, green: 0.6274509803921569, blue: 0.6705882352941176, opacity: 1),
+ iconSuccess: Color(.sRGB, red: 0.7019607843137254, green: 0.7803921568627451, blue: 0.6039215686274509, opacity: 1),
iconTeal: Color(.sRGB, red: 0.12156862745098039, green: 0.3686274509803922, blue: 0.3215686274509804, opacity: 1),
+ iconWarning: Color(.sRGB, red: 0.8274509803921568, green: 0.7686274509803922, blue: 0.5647058823529412, opacity: 1),
iconYellow: Color(.sRGB, red: 0.5294117647058824, green: 0.396078431372549, blue: 0.08235294117647059, opacity: 1),
+ info: Color(.sRGB, red: 0.5411764705882353, green: 0.6313725490196078, blue: 0.8470588235294118, opacity: 1),
+ infoMuted: Color(.sRGB, red: 0.6392156862745098, green: 0.7098039215686275, blue: 0.8392156862745098, opacity: 1),
neutral: Color(.sRGB, red: 0.9098039215686274, green: 0.9450980392156862, blue: 0.9647058823529412, opacity: 0.10196078431372549),
onAccent: Color(.sRGB, red: 0.06274509803921569, green: 0.07450980392156863, blue: 0.0784313725490196, opacity: 1),
onDark: Color(.sRGB, red: 0.9098039215686274, green: 0.9450980392156862, blue: 0.9647058823529412, opacity: 1),
onError: Color(.sRGB, red: 0.06274509803921569, green: 0.07450980392156863, blue: 0.0784313725490196, opacity: 1),
+ onErrorMuted: Color(.sRGB, red: 0.2901960784313726, green: 0.1450980392156863, blue: 0.12549019607843137, opacity: 1),
+ onInfo: Color(.sRGB, red: 0.06274509803921569, green: 0.07450980392156863, blue: 0.0784313725490196, opacity: 1),
+ onInfoMuted: Color(.sRGB, red: 0.12156862745098039, green: 0.17254901960784313, blue: 0.32941176470588235, opacity: 1),
onLight: Color(.sRGB, red: 0.06274509803921569, green: 0.07450980392156863, blue: 0.0784313725490196, opacity: 1),
onSuccess: Color(.sRGB, red: 0.06274509803921569, green: 0.07450980392156863, blue: 0.0784313725490196, opacity: 1),
+ onSuccessMuted: Color(.sRGB, red: 0.1411764705882353, green: 0.25098039215686274, blue: 0.13725490196078433, opacity: 1),
onWarning: Color(.sRGB, red: 0.06274509803921569, green: 0.07450980392156863, blue: 0.0784313725490196, opacity: 1),
+ onWarningMuted: Color(.sRGB, red: 0.3411764705882353, green: 0.24705882352941178, blue: 0.043137254901960784, opacity: 1),
overlay: Color(.sRGB, red: 0.06274509803921569, green: 0.07450980392156863, blue: 0.0784313725490196, opacity: 0.8),
overlayHover: Color(.sRGB, red: 0.9098039215686274, green: 0.9450980392156862, blue: 0.9647058823529412, opacity: 0.050980392156862744),
overlayPressed: Color(.sRGB, red: 0.9098039215686274, green: 0.9450980392156862, blue: 0.9647058823529412, opacity: 0.10196078431372549),
@@ -363,15 +397,19 @@ extension Theme {
textBlue: Color(.sRGB, red: 0.12156862745098039, green: 0.17254901960784313, blue: 0.32941176470588235, opacity: 1),
textCyan: Color(.sRGB, red: 0.12549019607843137, green: 0.2823529411764706, blue: 0.34509803921568627, opacity: 1),
textDisabled: Color(.sRGB, red: 0.28627450980392155, green: 0.3137254901960784, blue: 0.33725490196078434, opacity: 1),
+ textError: Color(.sRGB, red: 0.7764705882352941, green: 0.6509803921568628, blue: 0.6352941176470588, opacity: 1),
textGray: Color(.sRGB, red: 0.9098039215686274, green: 0.9450980392156862, blue: 0.9647058823529412, opacity: 1),
textGreen: Color(.sRGB, red: 0.1411764705882353, green: 0.25098039215686274, blue: 0.13725490196078433, opacity: 1),
+ textInfo: Color(.sRGB, red: 0.6392156862745098, green: 0.7098039215686275, blue: 0.8392156862745098, opacity: 1),
textOrange: Color(.sRGB, red: 0.43137254901960786, green: 0.2196078431372549, blue: 0.07058823529411765, opacity: 1),
textPink: Color(.sRGB, red: 0.3607843137254902, green: 0.09411764705882353, blue: 0.1843137254901961, opacity: 1),
textPrimary: Color(.sRGB, red: 0.9098039215686274, green: 0.9450980392156862, blue: 0.9647058823529412, opacity: 1),
textPurple: Color(.sRGB, red: 0.2823529411764706, green: 0.10588235294117647, blue: 0.34509803921568627, opacity: 1),
textRed: Color(.sRGB, red: 0.2901960784313726, green: 0.1450980392156863, blue: 0.12549019607843137, opacity: 1),
textSecondary: Color(.sRGB, red: 0.5882352941176471, green: 0.6274509803921569, blue: 0.6705882352941176, opacity: 1),
+ textSuccess: Color(.sRGB, red: 0.7019607843137254, green: 0.7803921568627451, blue: 0.6039215686274509, opacity: 1),
textTeal: Color(.sRGB, red: 0.09019607843137255, green: 0.2901960784313726, blue: 0.25098039215686274, opacity: 1),
+ textWarning: Color(.sRGB, red: 0.8274509803921568, green: 0.7686274509803922, blue: 0.5647058823529412, opacity: 1),
textYellow: Color(.sRGB, red: 0.3411764705882353, green: 0.24705882352941178, blue: 0.043137254901960784, opacity: 1),
tintHover: Color(.sRGB, red: 1, green: 1, blue: 1, opacity: 1),
track: Color(.sRGB, red: 0.35294117647058826, green: 0.3686274509803922, blue: 0.4, opacity: 1),
diff --git a/packages/native/apple/Sources/Astryx/Theme/Generated/MatchaTheme.swift b/packages/native/apple/Sources/Astryx/Theme/Generated/MatchaTheme.swift
index 606a77780e..a891684ae0 100644
--- a/packages/native/apple/Sources/Astryx/Theme/Generated/MatchaTheme.swift
+++ b/packages/native/apple/Sources/Astryx/Theme/Generated/MatchaTheme.swift
@@ -32,13 +32,17 @@ extension Theme {
borderBlue: Color(.sRGB, red: 0.22745098039215686, green: 0.3686274509803922, blue: 0.5490196078431373, opacity: 1),
borderCyan: Color(.sRGB, red: 0.22745098039215686, green: 0.48627450980392156, blue: 0.48627450980392156, opacity: 1),
borderEmphasized: Color(.sRGB, red: 0.7176470588235294, green: 0.7607843137254902, blue: 0.6196078431372549, opacity: 1),
+ borderError: Color(.sRGB, red: 0.8, green: 0, blue: 0, opacity: 1),
borderGray: Color(.sRGB, red: 0.4392156862745098, green: 0.49411764705882355, blue: 0.27450980392156865, opacity: 1),
borderGreen: Color(.sRGB, red: 0.30196078431372547, green: 0.6, blue: 0, opacity: 1),
+ borderInfo: Color(.sRGB, red: 0.1803921568627451, green: 0.2901960784313726, blue: 0.43137254901960786, opacity: 1),
borderOrange: Color(.sRGB, red: 0.7686274509803922, green: 0.4627450980392157, blue: 0.12549019607843137, opacity: 1),
borderPink: Color(.sRGB, red: 0.7686274509803922, green: 0.2901960784313726, blue: 0.4392156862745098, opacity: 1),
borderPurple: Color(.sRGB, red: 0.4196078431372549, green: 0.2901960784313726, blue: 0.5490196078431373, opacity: 1),
borderRed: Color(.sRGB, red: 0.9921568627450981, green: 0, blue: 0, opacity: 1),
+ borderSuccess: Color(.sRGB, red: 0.23921568627450981, green: 0.47843137254901963, blue: 0, opacity: 1),
borderTeal: Color(.sRGB, red: 0.1803921568627451, green: 0.4196078431372549, blue: 0.35294117647058826, opacity: 1),
+ borderWarning: Color(.sRGB, red: 0.5137254901960784, green: 0.403921568627451, blue: 0, opacity: 1),
borderYellow: Color(.sRGB, red: 0.9490196078431372, green: 0.7529411764705882, blue: 0, opacity: 1),
dataBlue1: Color(.sRGB, red: 0.8588235294117647, green: 0.9254901960784314, blue: 1, opacity: 1),
dataBlue2: Color(.sRGB, red: 0.47058823529411764, green: 0.7450980392156863, blue: 1, opacity: 1),
@@ -102,23 +106,34 @@ extension Theme {
iconBlue: Color(.sRGB, red: 0.22745098039215686, green: 0.3686274509803922, blue: 0.5490196078431373, opacity: 1),
iconCyan: Color(.sRGB, red: 0.22745098039215686, green: 0.48627450980392156, blue: 0.48627450980392156, opacity: 1),
iconDisabled: Color(.sRGB, red: 0.7529411764705882, green: 0.796078431372549, blue: 0.6627450980392157, opacity: 1),
+ iconError: Color(.sRGB, red: 0.8, green: 0, blue: 0, opacity: 1),
iconGray: Color(.sRGB, red: 0.4392156862745098, green: 0.49411764705882355, blue: 0.27450980392156865, opacity: 1),
iconGreen: Color(.sRGB, red: 0.30196078431372547, green: 0.6, blue: 0, opacity: 1),
+ iconInfo: Color(.sRGB, red: 0.1803921568627451, green: 0.2901960784313726, blue: 0.43137254901960786, opacity: 1),
iconOrange: Color(.sRGB, red: 0.7686274509803922, green: 0.4627450980392157, blue: 0.12549019607843137, opacity: 1),
iconPink: Color(.sRGB, red: 0.7686274509803922, green: 0.2901960784313726, blue: 0.4392156862745098, opacity: 1),
iconPrimary: Color(.sRGB, red: 0.24313725490196078, green: 0.2823529411764706, blue: 0.11372549019607843, opacity: 1),
iconPurple: Color(.sRGB, red: 0.4196078431372549, green: 0.2901960784313726, blue: 0.5490196078431373, opacity: 1),
iconRed: Color(.sRGB, red: 0.9921568627450981, green: 0, blue: 0, opacity: 1),
iconSecondary: Color(.sRGB, red: 0.4392156862745098, green: 0.49411764705882355, blue: 0.27450980392156865, opacity: 1),
+ iconSuccess: Color(.sRGB, red: 0.23921568627450981, green: 0.47843137254901963, blue: 0, opacity: 1),
iconTeal: Color(.sRGB, red: 0.1803921568627451, green: 0.4196078431372549, blue: 0.35294117647058826, opacity: 1),
+ iconWarning: Color(.sRGB, red: 0.5137254901960784, green: 0.403921568627451, blue: 0, opacity: 1),
iconYellow: Color(.sRGB, red: 0.9490196078431372, green: 0.7529411764705882, blue: 0, opacity: 1),
+ info: Color(.sRGB, red: 0.22745098039215686, green: 0.3686274509803922, blue: 0.5490196078431373, opacity: 1),
+ infoMuted: Color(.sRGB, red: 0.22745098039215686, green: 0.3686274509803922, blue: 0.5490196078431373, opacity: 0.2),
neutral: Color(.sRGB, red: 0.24313725490196078, green: 0.2823529411764706, blue: 0.11372549019607843, opacity: 0.058823529411764705),
onAccent: Color(.sRGB, red: 1, green: 1, blue: 1, opacity: 1),
onDark: Color(.sRGB, red: 1, green: 1, blue: 1, opacity: 1),
- onError: Color(.sRGB, red: 1, green: 1, blue: 1, opacity: 1),
+ onError: Color(.sRGB, red: 0.07058823529411765, green: 0.0784313725490196, blue: 0.054901960784313725, opacity: 1),
+ onErrorMuted: Color(.sRGB, red: 0.8, green: 0, blue: 0, opacity: 1),
+ onInfo: Color(.sRGB, red: 1, green: 1, blue: 1, opacity: 1),
+ onInfoMuted: Color(.sRGB, red: 0.1803921568627451, green: 0.2901960784313726, blue: 0.43137254901960786, opacity: 1),
onLight: Color(.sRGB, red: 0.24313725490196078, green: 0.2823529411764706, blue: 0.11372549019607843, opacity: 1),
- onSuccess: Color(.sRGB, red: 1, green: 1, blue: 1, opacity: 1),
+ onSuccess: Color(.sRGB, red: 0.07058823529411765, green: 0.0784313725490196, blue: 0.054901960784313725, opacity: 1),
+ onSuccessMuted: Color(.sRGB, red: 0.23921568627450981, green: 0.47843137254901963, blue: 0, opacity: 1),
onWarning: Color(.sRGB, red: 0.24313725490196078, green: 0.2823529411764706, blue: 0.11372549019607843, opacity: 1),
+ onWarningMuted: Color(.sRGB, red: 0.5137254901960784, green: 0.403921568627451, blue: 0, opacity: 1),
overlay: Color(.sRGB, red: 0.24313725490196078, green: 0.2823529411764706, blue: 0.11372549019607843, opacity: 0.5019607843137255),
overlayHover: Color(.sRGB, red: 0.24313725490196078, green: 0.2823529411764706, blue: 0.11372549019607843, opacity: 0.050980392156862744),
overlayPressed: Color(.sRGB, red: 0.24313725490196078, green: 0.2823529411764706, blue: 0.11372549019607843, opacity: 0.10196078431372549),
@@ -149,15 +164,19 @@ extension Theme {
textBlue: Color(.sRGB, red: 0.1803921568627451, green: 0.2901960784313726, blue: 0.43137254901960786, opacity: 1),
textCyan: Color(.sRGB, red: 0.1803921568627451, green: 0.3764705882352941, blue: 0.3764705882352941, opacity: 1),
textDisabled: Color(.sRGB, red: 0.7529411764705882, green: 0.796078431372549, blue: 0.6627450980392157, opacity: 1),
+ textError: Color(.sRGB, red: 0.8, green: 0, blue: 0, opacity: 1),
textGray: Color(.sRGB, red: 0.24313725490196078, green: 0.2823529411764706, blue: 0.11372549019607843, opacity: 1),
textGreen: Color(.sRGB, red: 0.23921568627450981, green: 0.47843137254901963, blue: 0, opacity: 1),
+ textInfo: Color(.sRGB, red: 0.1803921568627451, green: 0.2901960784313726, blue: 0.43137254901960786, opacity: 1),
textOrange: Color(.sRGB, red: 0.6274509803921569, green: 0.3764705882352941, blue: 0.09411764705882353, opacity: 1),
textPink: Color(.sRGB, red: 0.6274509803921569, green: 0.22745098039215686, blue: 0.35294117647058826, opacity: 1),
textPrimary: Color(.sRGB, red: 0.24313725490196078, green: 0.2823529411764706, blue: 0.11372549019607843, opacity: 1),
textPurple: Color(.sRGB, red: 0.3333333333333333, green: 0.22745098039215686, blue: 0.4392156862745098, opacity: 1),
textRed: Color(.sRGB, red: 0.8, green: 0, blue: 0, opacity: 1),
textSecondary: Color(.sRGB, red: 0.4392156862745098, green: 0.49411764705882355, blue: 0.27450980392156865, opacity: 1),
+ textSuccess: Color(.sRGB, red: 0.23921568627450981, green: 0.47843137254901963, blue: 0, opacity: 1),
textTeal: Color(.sRGB, red: 0.1411764705882353, green: 0.3333333333333333, blue: 0.27450980392156865, opacity: 1),
+ textWarning: Color(.sRGB, red: 0.5137254901960784, green: 0.403921568627451, blue: 0, opacity: 1),
textYellow: Color(.sRGB, red: 0.7568627450980392, green: 0.596078431372549, blue: 0, opacity: 1),
tintHover: Color(.sRGB, red: 0, green: 0, blue: 0, opacity: 1),
track: Color(.sRGB, red: 0.8, green: 0.8274509803921568, blue: 0.8588235294117647, opacity: 1),
@@ -246,13 +265,17 @@ extension Theme {
borderBlue: Color(.sRGB, red: 0.4823529411764706, green: 0.6588235294117647, blue: 0.8313725490196079, opacity: 1),
borderCyan: Color(.sRGB, red: 0.4392156862745098, green: 0.7686274509803922, blue: 0.7686274509803922, opacity: 1),
borderEmphasized: Color(.sRGB, red: 0.35294117647058826, green: 0.39215686274509803, blue: 0.25098039215686274, opacity: 1),
+ borderError: Color(.sRGB, red: 1, green: 0.47843137254901963, blue: 0.47843137254901963, opacity: 1),
borderGray: Color(.sRGB, red: 0.4392156862745098, green: 0.49411764705882355, blue: 0.27450980392156865, opacity: 1),
borderGreen: Color(.sRGB, red: 0.42745098039215684, green: 0.7490196078431373, blue: 0.16470588235294117, opacity: 1),
+ borderInfo: Color(.sRGB, red: 0.5529411764705883, green: 0.7372549019607844, blue: 0.8784313725490196, opacity: 1),
borderOrange: Color(.sRGB, red: 0.8313725490196079, green: 0.5647058823529412, blue: 0.22745098039215686, opacity: 1),
borderPink: Color(.sRGB, red: 0.8784313725490196, green: 0.47843137254901963, blue: 0.6039215686274509, opacity: 1),
borderPurple: Color(.sRGB, red: 0.6901960784313725, green: 0.5568627450980392, blue: 0.8313725490196079, opacity: 1),
borderRed: Color(.sRGB, red: 1, green: 0.3607843137254902, blue: 0.3607843137254902, opacity: 1),
+ borderSuccess: Color(.sRGB, red: 0.5019607843137255, green: 0.8313725490196079, blue: 0.22745098039215686, opacity: 1),
borderTeal: Color(.sRGB, red: 0.35294117647058826, green: 0.7215686274509804, blue: 0.596078431372549, opacity: 1),
+ borderWarning: Color(.sRGB, red: 1, green: 0.8784313725490196, blue: 0.5450980392156862, opacity: 1),
borderYellow: Color(.sRGB, red: 0.9647058823529412, green: 0.8156862745098039, blue: 0.4, opacity: 1),
dataBlue1: Color(.sRGB, red: 0.8588235294117647, green: 0.9254901960784314, blue: 1, opacity: 1),
dataBlue2: Color(.sRGB, red: 0.47058823529411764, green: 0.7450980392156863, blue: 1, opacity: 1),
@@ -316,23 +339,34 @@ extension Theme {
iconBlue: Color(.sRGB, red: 0.4823529411764706, green: 0.6588235294117647, blue: 0.8313725490196079, opacity: 1),
iconCyan: Color(.sRGB, red: 0.4392156862745098, green: 0.7686274509803922, blue: 0.7686274509803922, opacity: 1),
iconDisabled: Color(.sRGB, red: 0.35294117647058826, green: 0.39215686274509803, blue: 0.25098039215686274, opacity: 1),
+ iconError: Color(.sRGB, red: 1, green: 0.47843137254901963, blue: 0.47843137254901963, opacity: 1),
iconGray: Color(.sRGB, red: 0.5803921568627451, green: 0.6431372549019608, blue: 0.40784313725490196, opacity: 1),
iconGreen: Color(.sRGB, red: 0.42745098039215684, green: 0.7490196078431373, blue: 0.16470588235294117, opacity: 1),
+ iconInfo: Color(.sRGB, red: 0.5529411764705883, green: 0.7372549019607844, blue: 0.8784313725490196, opacity: 1),
iconOrange: Color(.sRGB, red: 0.8313725490196079, green: 0.5647058823529412, blue: 0.22745098039215686, opacity: 1),
iconPink: Color(.sRGB, red: 0.8784313725490196, green: 0.47843137254901963, blue: 0.6039215686274509, opacity: 1),
iconPrimary: Color(.sRGB, red: 0.7529411764705882, green: 0.796078431372549, blue: 0.6627450980392157, opacity: 1),
iconPurple: Color(.sRGB, red: 0.6901960784313725, green: 0.5568627450980392, blue: 0.8313725490196079, opacity: 1),
iconRed: Color(.sRGB, red: 1, green: 0.3607843137254902, blue: 0.3607843137254902, opacity: 1),
iconSecondary: Color(.sRGB, red: 0.5803921568627451, green: 0.6431372549019608, blue: 0.40784313725490196, opacity: 1),
+ iconSuccess: Color(.sRGB, red: 0.5019607843137255, green: 0.8313725490196079, blue: 0.22745098039215686, opacity: 1),
iconTeal: Color(.sRGB, red: 0.35294117647058826, green: 0.7215686274509804, blue: 0.596078431372549, opacity: 1),
+ iconWarning: Color(.sRGB, red: 1, green: 0.8784313725490196, blue: 0.5450980392156862, opacity: 1),
iconYellow: Color(.sRGB, red: 0.9647058823529412, green: 0.8156862745098039, blue: 0.4, opacity: 1),
+ info: Color(.sRGB, red: 0.6549019607843137, green: 0.788235294117647, blue: 0.8901960784313725, opacity: 1),
+ infoMuted: Color(.sRGB, red: 0.22745098039215686, green: 0.3686274509803922, blue: 0.5490196078431373, opacity: 0.2),
neutral: Color(.sRGB, red: 0.7529411764705882, green: 0.796078431372549, blue: 0.6627450980392157, opacity: 0.10196078431372549),
onAccent: Color(.sRGB, red: 0.24313725490196078, green: 0.2823529411764706, blue: 0.11372549019607843, opacity: 1),
onDark: Color(.sRGB, red: 1, green: 1, blue: 1, opacity: 1),
- onError: Color(.sRGB, red: 0.24313725490196078, green: 0.2823529411764706, blue: 0.11372549019607843, opacity: 1),
+ onError: Color(.sRGB, red: 0.07058823529411765, green: 0.0784313725490196, blue: 0.054901960784313725, opacity: 1),
+ onErrorMuted: Color(.sRGB, red: 1, green: 0.47843137254901963, blue: 0.47843137254901963, opacity: 1),
+ onInfo: Color(.sRGB, red: 0.24313725490196078, green: 0.2823529411764706, blue: 0.11372549019607843, opacity: 1),
+ onInfoMuted: Color(.sRGB, red: 0.5529411764705883, green: 0.7372549019607844, blue: 0.8784313725490196, opacity: 1),
onLight: Color(.sRGB, red: 0.24313725490196078, green: 0.2823529411764706, blue: 0.11372549019607843, opacity: 1),
- onSuccess: Color(.sRGB, red: 0.24313725490196078, green: 0.2823529411764706, blue: 0.11372549019607843, opacity: 1),
+ onSuccess: Color(.sRGB, red: 0.07058823529411765, green: 0.0784313725490196, blue: 0.054901960784313725, opacity: 1),
+ onSuccessMuted: Color(.sRGB, red: 0.5019607843137255, green: 0.8313725490196079, blue: 0.22745098039215686, opacity: 1),
onWarning: Color(.sRGB, red: 0.24313725490196078, green: 0.2823529411764706, blue: 0.11372549019607843, opacity: 1),
+ onWarningMuted: Color(.sRGB, red: 1, green: 0.8784313725490196, blue: 0.5450980392156862, opacity: 1),
overlay: Color(.sRGB, red: 0.24313725490196078, green: 0.2823529411764706, blue: 0.11372549019607843, opacity: 0.8),
overlayHover: Color(.sRGB, red: 0.7529411764705882, green: 0.796078431372549, blue: 0.6627450980392157, opacity: 0.050980392156862744),
overlayPressed: Color(.sRGB, red: 0.7529411764705882, green: 0.796078431372549, blue: 0.6627450980392157, opacity: 0.10196078431372549),
@@ -363,15 +397,19 @@ extension Theme {
textBlue: Color(.sRGB, red: 0.5529411764705883, green: 0.7372549019607844, blue: 0.8784313725490196, opacity: 1),
textCyan: Color(.sRGB, red: 0.5098039215686274, green: 0.8313725490196079, blue: 0.8313725490196079, opacity: 1),
textDisabled: Color(.sRGB, red: 0.35294117647058826, green: 0.39215686274509803, blue: 0.25098039215686274, opacity: 1),
+ textError: Color(.sRGB, red: 1, green: 0.47843137254901963, blue: 0.47843137254901963, opacity: 1),
textGray: Color(.sRGB, red: 0.7529411764705882, green: 0.796078431372549, blue: 0.6627450980392157, opacity: 1),
textGreen: Color(.sRGB, red: 0.5019607843137255, green: 0.8313725490196079, blue: 0.22745098039215686, opacity: 1),
+ textInfo: Color(.sRGB, red: 0.5529411764705883, green: 0.7372549019607844, blue: 0.8784313725490196, opacity: 1),
textOrange: Color(.sRGB, red: 0.8784313725490196, green: 0.6274509803921569, blue: 0.2901960784313726, opacity: 1),
textPink: Color(.sRGB, red: 0.9411764705882353, green: 0.5411764705882353, blue: 0.6666666666666666, opacity: 1),
textPrimary: Color(.sRGB, red: 0.7529411764705882, green: 0.796078431372549, blue: 0.6627450980392157, opacity: 1),
textPurple: Color(.sRGB, red: 0.7529411764705882, green: 0.6274509803921569, blue: 0.8784313725490196, opacity: 1),
textRed: Color(.sRGB, red: 1, green: 0.47843137254901963, blue: 0.47843137254901963, opacity: 1),
textSecondary: Color(.sRGB, red: 0.5803921568627451, green: 0.6431372549019608, blue: 0.40784313725490196, opacity: 1),
+ textSuccess: Color(.sRGB, red: 0.5019607843137255, green: 0.8313725490196079, blue: 0.22745098039215686, opacity: 1),
textTeal: Color(.sRGB, red: 0.4235294117647059, green: 0.792156862745098, blue: 0.6666666666666666, opacity: 1),
+ textWarning: Color(.sRGB, red: 1, green: 0.8784313725490196, blue: 0.5450980392156862, opacity: 1),
textYellow: Color(.sRGB, red: 1, green: 0.8784313725490196, blue: 0.5450980392156862, opacity: 1),
tintHover: Color(.sRGB, red: 1, green: 1, blue: 1, opacity: 1),
track: Color(.sRGB, red: 0.35294117647058826, green: 0.3686274509803922, blue: 0.4, opacity: 1),
diff --git a/packages/native/apple/Sources/Astryx/Theme/Generated/NeutralTheme.swift b/packages/native/apple/Sources/Astryx/Theme/Generated/NeutralTheme.swift
index 1899d6fab9..dd903e17b5 100644
--- a/packages/native/apple/Sources/Astryx/Theme/Generated/NeutralTheme.swift
+++ b/packages/native/apple/Sources/Astryx/Theme/Generated/NeutralTheme.swift
@@ -32,13 +32,17 @@ extension Theme {
borderBlue: Color(.sRGB, red: 0.6313725490196078, green: 0.792156862745098, blue: 1, opacity: 1),
borderCyan: Color(.sRGB, red: 0.5215686274509804, green: 0.8352941176470589, blue: 0.9137254901960784, opacity: 1),
borderEmphasized: Color(.sRGB, red: 0.8313725490196079, green: 0.8313725490196079, blue: 0.8313725490196079, opacity: 1),
+ borderError: Color(.sRGB, red: 0.7529411764705882, green: 0.14901960784313725, blue: 0.17254901960784313, opacity: 1),
borderGray: Color(.sRGB, red: 0.8313725490196079, green: 0.8313725490196079, blue: 0.8313725490196079, opacity: 1),
borderGreen: Color(.sRGB, red: 0.6666666666666666, green: 0.8313725490196079, blue: 0.6627450980392157, opacity: 1),
+ borderInfo: Color(.sRGB, red: 0, green: 0.403921568627451, blue: 0.807843137254902, opacity: 1),
borderOrange: Color(.sRGB, red: 1, green: 0.7803921568627451, blue: 0.6313725490196078, opacity: 1),
borderPink: Color(.sRGB, red: 1, green: 0.7529411764705882, blue: 0.8431372549019608, opacity: 1),
borderPurple: Color(.sRGB, red: 0.9529411764705882, green: 0.7490196078431373, blue: 1, opacity: 1),
borderRed: Color(.sRGB, red: 1, green: 0.6823529411764706, blue: 0.6549019607843137, opacity: 1),
+ borderSuccess: Color(.sRGB, red: 0.1843137254901961, green: 0.49019607843137253, blue: 0.2, opacity: 1),
borderTeal: Color(.sRGB, red: 0.5647058823529412, green: 0.8431372549019608, blue: 0.7843137254901961, opacity: 1),
+ borderWarning: Color(.sRGB, red: 0.5137254901960784, green: 0.403921568627451, blue: 0, opacity: 1),
borderYellow: Color(.sRGB, red: 0.8901960784313725, green: 0.7647058823529411, blue: 0.4235294117647059, opacity: 1),
dataBlue1: Color(.sRGB, red: 0.8588235294117647, green: 0.9254901960784314, blue: 1, opacity: 1),
dataBlue2: Color(.sRGB, red: 0.47058823529411764, green: 0.7450980392156863, blue: 1, opacity: 1),
@@ -96,35 +100,46 @@ extension Theme {
dataYellow3: Color(.sRGB, red: 0.984313725490196, green: 0.807843137254902, blue: 0.011764705882352941, opacity: 1),
dataYellow4: Color(.sRGB, red: 0.8392156862745098, green: 0.596078431372549, blue: 0.01568627450980392, opacity: 1),
dataYellow5: Color(.sRGB, red: 0.5411764705882353, green: 0.3137254901960784, blue: 0.00392156862745098, opacity: 1),
- error: Color(.sRGB, red: 0.4627450980392157, green: 0, blue: 0.047058823529411764, opacity: 1),
+ error: Color(.sRGB, red: 0.788235294117647, green: 0.18823529411764706, blue: 0.22745098039215686, opacity: 1),
errorMuted: Color(.sRGB, red: 1, green: 0.7686274509803922, blue: 0.7450980392156863, opacity: 1),
iconAccent: Color(.sRGB, red: 0.10588235294117647, green: 0.10588235294117647, blue: 0.10588235294117647, opacity: 1),
iconBlue: Color(.sRGB, red: 0, green: 0.2235294117647059, blue: 0.47058823529411764, opacity: 1),
iconCyan: Color(.sRGB, red: 0, green: 0.2627450980392157, blue: 0.3176470588235294, opacity: 1),
iconDisabled: Color(.sRGB, red: 0.5686274509803921, green: 0.5686274509803921, blue: 0.5686274509803921, opacity: 1),
+ iconError: Color(.sRGB, red: 0.7529411764705882, green: 0.14901960784313725, blue: 0.17254901960784313, opacity: 1),
iconGray: Color(.sRGB, red: 0.2784313725490196, green: 0.2784313725490196, blue: 0.2784313725490196, opacity: 1),
iconGreen: Color(.sRGB, red: 0, green: 0.28627450980392155, blue: 0.043137254901960784, opacity: 1),
+ iconInfo: Color(.sRGB, red: 0, green: 0.403921568627451, blue: 0.807843137254902, opacity: 1),
iconOrange: Color(.sRGB, red: 0.3843137254901961, green: 0.15294117647058825, blue: 0, opacity: 1),
iconPink: Color(.sRGB, red: 0.4392156862745098, green: 0, blue: 0.24705882352941178, opacity: 1),
iconPrimary: Color(.sRGB, red: 0, green: 0, blue: 0, opacity: 1),
iconPurple: Color(.sRGB, red: 0.3607843137254902, green: 0.054901960784313725, blue: 0.4235294117647059, opacity: 1),
iconRed: Color(.sRGB, red: 0.4627450980392157, green: 0, blue: 0.047058823529411764, opacity: 1),
iconSecondary: Color(.sRGB, red: 0.41568627450980394, green: 0.41568627450980394, blue: 0.41568627450980394, opacity: 1),
+ iconSuccess: Color(.sRGB, red: 0.1843137254901961, green: 0.49019607843137253, blue: 0.2, opacity: 1),
iconTeal: Color(.sRGB, red: 0, green: 0.27450980392156865, blue: 0.23921568627450981, opacity: 1),
+ iconWarning: Color(.sRGB, red: 0.5137254901960784, green: 0.403921568627451, blue: 0, opacity: 1),
iconYellow: Color(.sRGB, red: 0.29411764705882354, green: 0.2235294117647059, blue: 0, opacity: 1),
+ info: Color(.sRGB, red: 0, green: 0.4549019607843137, blue: 0.8862745098039215, opacity: 1),
+ infoMuted: Color(.sRGB, red: 0.7254901960784313, green: 0.8431372549019608, blue: 1, opacity: 1),
neutral: Color(.sRGB, red: 0, green: 0, blue: 0, opacity: 0.058823529411764705),
onAccent: Color(.sRGB, red: 1, green: 1, blue: 1, opacity: 1),
onDark: Color(.sRGB, red: 1, green: 1, blue: 1, opacity: 1),
onError: Color(.sRGB, red: 1, green: 1, blue: 1, opacity: 1),
+ onErrorMuted: Color(.sRGB, red: 0.4627450980392157, green: 0, blue: 0.047058823529411764, opacity: 1),
+ onInfo: Color(.sRGB, red: 1, green: 1, blue: 1, opacity: 1),
+ onInfoMuted: Color(.sRGB, red: 0, green: 0.2235294117647059, blue: 0.47058823529411764, opacity: 1),
onLight: Color(.sRGB, red: 0.06666666666666667, green: 0.06666666666666667, blue: 0.06666666666666667, opacity: 1),
onSuccess: Color(.sRGB, red: 1, green: 1, blue: 1, opacity: 1),
+ onSuccessMuted: Color(.sRGB, red: 0, green: 0.28627450980392155, blue: 0.043137254901960784, opacity: 1),
onWarning: Color(.sRGB, red: 0.06666666666666667, green: 0.06666666666666667, blue: 0.06666666666666667, opacity: 1),
+ onWarningMuted: Color(.sRGB, red: 0.29411764705882354, green: 0.2235294117647059, blue: 0, opacity: 1),
overlay: Color(.sRGB, red: 0, green: 0, blue: 0, opacity: 0.5019607843137255),
overlayHover: Color(.sRGB, red: 0, green: 0, blue: 0, opacity: 0.050980392156862744),
overlayPressed: Color(.sRGB, red: 0, green: 0, blue: 0, opacity: 0.10196078431372549),
shadow: Color(.sRGB, red: 0, green: 0, blue: 0, opacity: 0.10196078431372549),
skeleton: Color(.sRGB, red: 0.9450980392156862, green: 0.9450980392156862, blue: 0.9450980392156862, opacity: 1),
- success: Color(.sRGB, red: 0, green: 0.28627450980392155, blue: 0.043137254901960784, opacity: 1),
+ success: Color(.sRGB, red: 0.09803921568627451, green: 0.5058823529411764, blue: 0, opacity: 1),
successMuted: Color(.sRGB, red: 0.7372549019607844, green: 0.8784313725490196, blue: 0.7333333333333333, opacity: 1),
syntaxAdded: Color(.sRGB, red: 0.7372549019607844, green: 0.8784313725490196, blue: 0.7333333333333333, opacity: 0.25098039215686274),
syntaxAddedMarker: Color(.sRGB, red: 0.41568627450980394, green: 0.41568627450980394, blue: 0.41568627450980394, opacity: 1),
@@ -149,19 +164,23 @@ extension Theme {
textBlue: Color(.sRGB, red: 0, green: 0.2235294117647059, blue: 0.47058823529411764, opacity: 1),
textCyan: Color(.sRGB, red: 0, green: 0.2627450980392157, blue: 0.3176470588235294, opacity: 1),
textDisabled: Color(.sRGB, red: 0.5686274509803921, green: 0.5686274509803921, blue: 0.5686274509803921, opacity: 1),
+ textError: Color(.sRGB, red: 0.7529411764705882, green: 0.14901960784313725, blue: 0.17254901960784313, opacity: 1),
textGray: Color(.sRGB, red: 0.10588235294117647, green: 0.10588235294117647, blue: 0.10588235294117647, opacity: 1),
textGreen: Color(.sRGB, red: 0, green: 0.28627450980392155, blue: 0.043137254901960784, opacity: 1),
+ textInfo: Color(.sRGB, red: 0, green: 0.403921568627451, blue: 0.807843137254902, opacity: 1),
textOrange: Color(.sRGB, red: 0.3843137254901961, green: 0.15294117647058825, blue: 0, opacity: 1),
textPink: Color(.sRGB, red: 0.4392156862745098, green: 0, blue: 0.24705882352941178, opacity: 1),
textPrimary: Color(.sRGB, red: 0, green: 0, blue: 0, opacity: 1),
textPurple: Color(.sRGB, red: 0.3607843137254902, green: 0.054901960784313725, blue: 0.4235294117647059, opacity: 1),
textRed: Color(.sRGB, red: 0.4627450980392157, green: 0, blue: 0.047058823529411764, opacity: 1),
textSecondary: Color(.sRGB, red: 0.2784313725490196, green: 0.2784313725490196, blue: 0.2784313725490196, opacity: 1),
+ textSuccess: Color(.sRGB, red: 0.1843137254901961, green: 0.49019607843137253, blue: 0.2, opacity: 1),
textTeal: Color(.sRGB, red: 0, green: 0.27450980392156865, blue: 0.23921568627450981, opacity: 1),
+ textWarning: Color(.sRGB, red: 0.5137254901960784, green: 0.403921568627451, blue: 0, opacity: 1),
textYellow: Color(.sRGB, red: 0.29411764705882354, green: 0.2235294117647059, blue: 0, opacity: 1),
tintHover: Color(.sRGB, red: 0, green: 0, blue: 0, opacity: 1),
track: Color(.sRGB, red: 0.8, green: 0.8274509803921568, blue: 0.8588235294117647, opacity: 1),
- warning: Color(.sRGB, red: 0.29411764705882354, green: 0.2235294117647059, blue: 0, opacity: 1),
+ warning: Color(.sRGB, red: 1, green: 0.807843137254902, blue: 0.1843137254901961, opacity: 1),
warningMuted: Color(.sRGB, red: 0.9803921568627451, green: 0.8823529411764706, blue: 0.6196078431372549, opacity: 1)
),
space: SpaceTokens(
@@ -246,13 +265,17 @@ extension Theme {
borderBlue: Color(.sRGB, red: 0.35294117647058826, green: 0.6274509803921569, blue: 0.9725490196078431, opacity: 1),
borderCyan: Color(.sRGB, red: 0.28627450980392155, green: 0.6784313725490196, blue: 0.7686274509803922, opacity: 1),
borderEmphasized: Color(.sRGB, red: 0.3215686274509804, green: 0.3215686274509804, blue: 0.3215686274509804, opacity: 1),
+ borderError: Color(.sRGB, red: 1, green: 0.6823529411764706, blue: 0.6549019607843137, opacity: 1),
borderGray: Color(.sRGB, red: 0.14901960784313725, green: 0.14901960784313725, blue: 0.14901960784313725, opacity: 1),
borderGreen: Color(.sRGB, red: 0.41568627450980394, green: 0.6980392156862745, blue: 0.4196078431372549, opacity: 1),
+ borderInfo: Color(.sRGB, red: 0.6313725490196078, green: 0.792156862745098, blue: 1, opacity: 1),
borderOrange: Color(.sRGB, red: 0.8745098039215686, green: 0.5176470588235295, blue: 0.24705882352941178, opacity: 1),
borderPink: Color(.sRGB, red: 0.9882352941176471, green: 0.47058823529411764, blue: 0.6941176470588235, opacity: 1),
borderPurple: Color(.sRGB, red: 0.8470588235294118, green: 0.5215686274509804, blue: 0.9215686274509803, opacity: 1),
borderRed: Color(.sRGB, red: 0.9803921568627451, green: 0.403921568627451, blue: 0.3843137254901961, opacity: 1),
+ borderSuccess: Color(.sRGB, red: 0.5647058823529412, green: 0.792156862745098, blue: 0.5647058823529412, opacity: 1),
borderTeal: Color(.sRGB, red: 0.30980392156862746, green: 0.6941176470588235, blue: 0.6274509803921569, opacity: 1),
+ borderWarning: Color(.sRGB, red: 0.9333333333333333, green: 0.7686274509803922, blue: 0.2823529411764706, opacity: 1),
borderYellow: Color(.sRGB, red: 0.7607843137254902, green: 0.6, blue: 0, opacity: 1),
dataBlue1: Color(.sRGB, red: 0.8588235294117647, green: 0.9254901960784314, blue: 1, opacity: 1),
dataBlue2: Color(.sRGB, red: 0.47058823529411764, green: 0.7450980392156863, blue: 1, opacity: 1),
@@ -310,35 +333,46 @@ extension Theme {
dataYellow3: Color(.sRGB, red: 0.984313725490196, green: 0.807843137254902, blue: 0.011764705882352941, opacity: 1),
dataYellow4: Color(.sRGB, red: 0.8392156862745098, green: 0.596078431372549, blue: 0.01568627450980392, opacity: 1),
dataYellow5: Color(.sRGB, red: 0.5411764705882353, green: 0.3137254901960784, blue: 0.00392156862745098, opacity: 1),
- error: Color(.sRGB, red: 1, green: 0.7686274509803922, blue: 0.7450980392156863, opacity: 1),
+ error: Color(.sRGB, red: 1, green: 0.4392156862745098, blue: 0.36470588235294116, opacity: 1),
errorMuted: Color(.sRGB, red: 1, green: 0.596078431372549, blue: 0.5647058823529412, opacity: 0.23921568627450981),
iconAccent: Color(.sRGB, red: 0.9450980392156862, green: 0.9450980392156862, blue: 0.9450980392156862, opacity: 1),
iconBlue: Color(.sRGB, red: 0.5333333333333333, green: 0.7372549019607844, blue: 1, opacity: 1),
iconCyan: Color(.sRGB, red: 0.44313725490196076, green: 0.7803921568627451, blue: 0.8666666666666667, opacity: 1),
iconDisabled: Color(.sRGB, red: 0.3215686274509804, green: 0.3215686274509804, blue: 0.3215686274509804, opacity: 1),
+ iconError: Color(.sRGB, red: 1, green: 0.6823529411764706, blue: 0.6549019607843137, opacity: 1),
iconGray: Color(.sRGB, red: 0.6196078431372549, green: 0.6196078431372549, blue: 0.6196078431372549, opacity: 1),
iconGreen: Color(.sRGB, red: 0.5647058823529412, green: 0.792156862745098, blue: 0.5647058823529412, opacity: 1),
+ iconInfo: Color(.sRGB, red: 0.6313725490196078, green: 0.792156862745098, blue: 1, opacity: 1),
iconOrange: Color(.sRGB, red: 1, green: 0.6196078431372549, blue: 0.3333333333333333, opacity: 1),
iconPink: Color(.sRGB, red: 0.9921568627450981, green: 0.5725490196078431, blue: 0.7411764705882353, opacity: 1),
iconPrimary: Color(.sRGB, red: 1, green: 1, blue: 1, opacity: 1),
iconPurple: Color(.sRGB, red: 0.8941176470588236, green: 0.5882352941176471, blue: 0.9647058823529412, opacity: 1),
iconRed: Color(.sRGB, red: 1, green: 0.596078431372549, blue: 0.5647058823529412, opacity: 1),
iconSecondary: Color(.sRGB, red: 0.6196078431372549, green: 0.6196078431372549, blue: 0.6196078431372549, opacity: 1),
+ iconSuccess: Color(.sRGB, red: 0.5647058823529412, green: 0.792156862745098, blue: 0.5647058823529412, opacity: 1),
iconTeal: Color(.sRGB, red: 0.5058823529411764, green: 0.788235294117647, blue: 0.7333333333333333, opacity: 1),
+ iconWarning: Color(.sRGB, red: 0.9333333333333333, green: 0.7686274509803922, blue: 0.2823529411764706, opacity: 1),
iconYellow: Color(.sRGB, red: 0.8862745098039215, green: 0.7137254901960784, blue: 0.13725490196078433, opacity: 1),
+ info: Color(.sRGB, red: 0.42745098039215684, green: 0.611764705882353, blue: 0.996078431372549, opacity: 1),
+ infoMuted: Color(.sRGB, red: 0.5333333333333333, green: 0.7372549019607844, blue: 1, opacity: 0.23921568627450981),
neutral: Color(.sRGB, red: 1, green: 1, blue: 1, opacity: 0.10196078431372549),
onAccent: Color(.sRGB, red: 0.06666666666666667, green: 0.06666666666666667, blue: 0.06666666666666667, opacity: 1),
onDark: Color(.sRGB, red: 1, green: 1, blue: 1, opacity: 1),
onError: Color(.sRGB, red: 0.06666666666666667, green: 0.06666666666666667, blue: 0.06666666666666667, opacity: 1),
+ onErrorMuted: Color(.sRGB, red: 1, green: 0.6823529411764706, blue: 0.6549019607843137, opacity: 1),
+ onInfo: Color(.sRGB, red: 0.06666666666666667, green: 0.06666666666666667, blue: 0.06666666666666667, opacity: 1),
+ onInfoMuted: Color(.sRGB, red: 0.6313725490196078, green: 0.792156862745098, blue: 1, opacity: 1),
onLight: Color(.sRGB, red: 0.06666666666666667, green: 0.06666666666666667, blue: 0.06666666666666667, opacity: 1),
onSuccess: Color(.sRGB, red: 0.06666666666666667, green: 0.06666666666666667, blue: 0.06666666666666667, opacity: 1),
+ onSuccessMuted: Color(.sRGB, red: 0.5647058823529412, green: 0.792156862745098, blue: 0.5647058823529412, opacity: 1),
onWarning: Color(.sRGB, red: 0.06666666666666667, green: 0.06666666666666667, blue: 0.06666666666666667, opacity: 1),
+ onWarningMuted: Color(.sRGB, red: 0.9333333333333333, green: 0.7686274509803922, blue: 0.2823529411764706, opacity: 1),
overlay: Color(.sRGB, red: 0, green: 0, blue: 0, opacity: 0.8),
overlayHover: Color(.sRGB, red: 1, green: 1, blue: 1, opacity: 0.050980392156862744),
overlayPressed: Color(.sRGB, red: 1, green: 1, blue: 1, opacity: 0.10196078431372549),
shadow: Color(.sRGB, red: 0, green: 0, blue: 0, opacity: 0.30196078431372547),
skeleton: Color(.sRGB, red: 0.3215686274509804, green: 0.3215686274509804, blue: 0.3215686274509804, opacity: 1),
- success: Color(.sRGB, red: 0.6431372549019608, green: 0.8392156862745098, blue: 0.6392156862745098, opacity: 1),
+ success: Color(.sRGB, red: 0.39215686274509803, green: 0.6862745098039216, blue: 0.2980392156862745, opacity: 1),
successMuted: Color(.sRGB, red: 0.5647058823529412, green: 0.792156862745098, blue: 0.5647058823529412, opacity: 0.23921568627450981),
syntaxAdded: Color(.sRGB, red: 0.5647058823529412, green: 0.792156862745098, blue: 0.5647058823529412, opacity: 0.058823529411764705),
syntaxAddedMarker: Color(.sRGB, red: 0.6196078431372549, green: 0.6196078431372549, blue: 0.6196078431372549, opacity: 1),
@@ -363,19 +397,23 @@ extension Theme {
textBlue: Color(.sRGB, red: 0.6313725490196078, green: 0.792156862745098, blue: 1, opacity: 1),
textCyan: Color(.sRGB, red: 0.5215686274509804, green: 0.8352941176470589, blue: 0.9137254901960784, opacity: 1),
textDisabled: Color(.sRGB, red: 0.3215686274509804, green: 0.3215686274509804, blue: 0.3215686274509804, opacity: 1),
+ textError: Color(.sRGB, red: 1, green: 0.6823529411764706, blue: 0.6549019607843137, opacity: 1),
textGray: Color(.sRGB, red: 0.8313725490196079, green: 0.8313725490196079, blue: 0.8313725490196079, opacity: 1),
textGreen: Color(.sRGB, red: 0.5647058823529412, green: 0.792156862745098, blue: 0.5647058823529412, opacity: 1),
+ textInfo: Color(.sRGB, red: 0.6313725490196078, green: 0.792156862745098, blue: 1, opacity: 1),
textOrange: Color(.sRGB, red: 1, green: 0.7019607843137254, blue: 0.49411764705882355, opacity: 1),
textPink: Color(.sRGB, red: 1, green: 0.6627450980392157, blue: 0.792156862745098, opacity: 1),
textPrimary: Color(.sRGB, red: 1, green: 1, blue: 1, opacity: 1),
textPurple: Color(.sRGB, red: 0.9176470588235294, green: 0.6745098039215687, blue: 0.9725490196078431, opacity: 1),
textRed: Color(.sRGB, red: 1, green: 0.6823529411764706, blue: 0.6549019607843137, opacity: 1),
textSecondary: Color(.sRGB, red: 0.6196078431372549, green: 0.6196078431372549, blue: 0.6196078431372549, opacity: 1),
+ textSuccess: Color(.sRGB, red: 0.5647058823529412, green: 0.792156862745098, blue: 0.5647058823529412, opacity: 1),
textTeal: Color(.sRGB, red: 0.5647058823529412, green: 0.8431372549019608, blue: 0.7843137254901961, opacity: 1),
+ textWarning: Color(.sRGB, red: 0.9333333333333333, green: 0.7686274509803922, blue: 0.2823529411764706, opacity: 1),
textYellow: Color(.sRGB, red: 0.9333333333333333, green: 0.7686274509803922, blue: 0.2823529411764706, opacity: 1),
tintHover: Color(.sRGB, red: 1, green: 1, blue: 1, opacity: 1),
track: Color(.sRGB, red: 0.35294117647058826, green: 0.3686274509803922, blue: 0.4, opacity: 1),
- warning: Color(.sRGB, red: 0.9725490196078431, green: 0.8274509803921568, blue: 0.41568627450980394, opacity: 1),
+ warning: Color(.sRGB, red: 1, green: 0.807843137254902, blue: 0.1843137254901961, opacity: 1),
warningMuted: Color(.sRGB, red: 0.8862745098039215, green: 0.7137254901960784, blue: 0.13725490196078433, opacity: 0.23921568627450981)
),
space: SpaceTokens(
diff --git a/packages/native/apple/Sources/Astryx/Theme/Generated/StoneTheme.swift b/packages/native/apple/Sources/Astryx/Theme/Generated/StoneTheme.swift
index 2449629cfd..ea040e90c5 100644
--- a/packages/native/apple/Sources/Astryx/Theme/Generated/StoneTheme.swift
+++ b/packages/native/apple/Sources/Astryx/Theme/Generated/StoneTheme.swift
@@ -32,13 +32,17 @@ extension Theme {
borderBlue: Color(.sRGB, red: 0.7607843137254902, green: 0.8392156862745098, blue: 0.9450980392156862, opacity: 1),
borderCyan: Color(.sRGB, red: 0.7294117647058823, green: 0.8588235294117647, blue: 0.8941176470588236, opacity: 1),
borderEmphasized: Color(.sRGB, red: 0.5176470588235295, green: 0.5176470588235295, blue: 0.5372549019607843, opacity: 1),
+ borderError: Color(.sRGB, red: 0.3764705882352941, green: 0.23529411764705882, blue: 0.21568627450980393, opacity: 1),
borderGray: Color(.sRGB, red: 0.8313725490196079, green: 0.8274509803921568, blue: 0.8666666666666667, opacity: 1),
borderGreen: Color(.sRGB, red: 0.7490196078431373, green: 0.8745098039215686, blue: 0.7333333333333333, opacity: 1),
+ borderInfo: Color(.sRGB, red: 0.20392156862745098, green: 0.2823529411764706, blue: 0.3803921568627451, opacity: 1),
borderOrange: Color(.sRGB, red: 0.9490196078431372, green: 0.803921568627451, blue: 0.6666666666666666, opacity: 1),
borderPink: Color(.sRGB, red: 0.9137254901960784, green: 0.792156862745098, blue: 0.8627450980392157, opacity: 1),
borderPurple: Color(.sRGB, red: 0.8509803921568627, green: 0.8117647058823529, blue: 0.9176470588235294, opacity: 1),
borderRed: Color(.sRGB, red: 0.9411764705882353, green: 0.792156862745098, blue: 0.7686274509803922, opacity: 1),
+ borderSuccess: Color(.sRGB, red: 0.20784313725490197, green: 0.30980392156862746, blue: 0.19215686274509805, opacity: 1),
borderTeal: Color(.sRGB, red: 0.7647058823529411, green: 0.8588235294117647, blue: 0.8235294117647058, opacity: 1),
+ borderWarning: Color(.sRGB, red: 0.3215686274509804, green: 0.2823529411764706, blue: 0.09411764705882353, opacity: 1),
borderYellow: Color(.sRGB, red: 0.9058823529411765, green: 0.8274509803921568, blue: 0.6431372549019608, opacity: 1),
dataBlue1: Color(.sRGB, red: 0.8588235294117647, green: 0.9254901960784314, blue: 1, opacity: 1),
dataBlue2: Color(.sRGB, red: 0.47058823529411764, green: 0.7450980392156863, blue: 1, opacity: 1),
@@ -102,23 +106,34 @@ extension Theme {
iconBlue: Color(.sRGB, red: 0.20392156862745098, green: 0.2823529411764706, blue: 0.3803921568627451, opacity: 1),
iconCyan: Color(.sRGB, red: 0.14901960784313725, green: 0.30196078431372547, blue: 0.3411764705882353, opacity: 1),
iconDisabled: Color(.sRGB, red: 0.8313725490196079, green: 0.8274509803921568, blue: 0.8666666666666667, opacity: 1),
+ iconError: Color(.sRGB, red: 0.3764705882352941, green: 0.23529411764705882, blue: 0.21568627450980393, opacity: 1),
iconGray: Color(.sRGB, red: 0.27450980392156865, green: 0.27450980392156865, blue: 0.3058823529411765, opacity: 1),
iconGreen: Color(.sRGB, red: 0.20784313725490197, green: 0.30980392156862746, blue: 0.19215686274509805, opacity: 1),
+ iconInfo: Color(.sRGB, red: 0.20392156862745098, green: 0.2823529411764706, blue: 0.3803921568627451, opacity: 1),
iconOrange: Color(.sRGB, red: 0.3686274509803922, green: 0.24705882352941178, blue: 0.15294117647058825, opacity: 1),
iconPink: Color(.sRGB, red: 0.35294117647058826, green: 0.23529411764705882, blue: 0.30980392156862746, opacity: 1),
iconPrimary: Color(.sRGB, red: 0.1450980392156863, green: 0.1450980392156863, blue: 0.16470588235294117, opacity: 1),
iconPurple: Color(.sRGB, red: 0.2980392156862745, green: 0.25098039215686274, blue: 0.3568627450980392, opacity: 1),
iconRed: Color(.sRGB, red: 0.3764705882352941, green: 0.23529411764705882, blue: 0.21568627450980393, opacity: 1),
iconSecondary: Color(.sRGB, red: 0.5176470588235295, green: 0.5176470588235295, blue: 0.5372549019607843, opacity: 1),
+ iconSuccess: Color(.sRGB, red: 0.20784313725490197, green: 0.30980392156862746, blue: 0.19215686274509805, opacity: 1),
iconTeal: Color(.sRGB, red: 0.17254901960784313, green: 0.30980392156862746, blue: 0.26666666666666666, opacity: 1),
+ iconWarning: Color(.sRGB, red: 0.3215686274509804, green: 0.2823529411764706, blue: 0.09411764705882353, opacity: 1),
iconYellow: Color(.sRGB, red: 0.3215686274509804, green: 0.2823529411764706, blue: 0.09411764705882353, opacity: 1),
+ info: Color(.sRGB, red: 0.3176470588235294, green: 0.3764705882352941, blue: 0.4549019607843137, opacity: 1),
+ infoMuted: Color(.sRGB, red: 0.8274509803921568, green: 0.8941176470588236, blue: 0.9882352941176471, opacity: 1),
neutral: Color(.sRGB, red: 0.1450980392156863, green: 0.1450980392156863, blue: 0.16470588235294117, opacity: 0.058823529411764705),
onAccent: Color(.sRGB, red: 1, green: 1, blue: 1, opacity: 1),
onDark: Color(.sRGB, red: 1, green: 1, blue: 1, opacity: 1),
- onError: Color(.sRGB, red: 0.3764705882352941, green: 0.23529411764705882, blue: 0.21568627450980393, opacity: 1),
+ onError: Color(.sRGB, red: 1, green: 1, blue: 1, opacity: 1),
+ onErrorMuted: Color(.sRGB, red: 0.3764705882352941, green: 0.23529411764705882, blue: 0.21568627450980393, opacity: 1),
+ onInfo: Color(.sRGB, red: 1, green: 1, blue: 1, opacity: 1),
+ onInfoMuted: Color(.sRGB, red: 0.20392156862745098, green: 0.2823529411764706, blue: 0.3803921568627451, opacity: 1),
onLight: Color(.sRGB, red: 0.1450980392156863, green: 0.1450980392156863, blue: 0.16470588235294117, opacity: 1),
- onSuccess: Color(.sRGB, red: 0.20784313725490197, green: 0.30980392156862746, blue: 0.19215686274509805, opacity: 1),
- onWarning: Color(.sRGB, red: 0.3215686274509804, green: 0.2823529411764706, blue: 0.09411764705882353, opacity: 1),
+ onSuccess: Color(.sRGB, red: 1, green: 1, blue: 1, opacity: 1),
+ onSuccessMuted: Color(.sRGB, red: 0.20784313725490197, green: 0.30980392156862746, blue: 0.19215686274509805, opacity: 1),
+ onWarning: Color(.sRGB, red: 1, green: 1, blue: 1, opacity: 1),
+ onWarningMuted: Color(.sRGB, red: 0.3215686274509804, green: 0.2823529411764706, blue: 0.09411764705882353, opacity: 1),
overlay: Color(.sRGB, red: 0.1450980392156863, green: 0.1450980392156863, blue: 0.16470588235294117, opacity: 0.5019607843137255),
overlayHover: Color(.sRGB, red: 0.1450980392156863, green: 0.1450980392156863, blue: 0.16470588235294117, opacity: 0.050980392156862744),
overlayPressed: Color(.sRGB, red: 0.1450980392156863, green: 0.1450980392156863, blue: 0.16470588235294117, opacity: 0.10196078431372549),
@@ -149,15 +164,19 @@ extension Theme {
textBlue: Color(.sRGB, red: 0.20392156862745098, green: 0.2823529411764706, blue: 0.3803921568627451, opacity: 1),
textCyan: Color(.sRGB, red: 0.14901960784313725, green: 0.30196078431372547, blue: 0.3411764705882353, opacity: 1),
textDisabled: Color(.sRGB, red: 0.8313725490196079, green: 0.8274509803921568, blue: 0.8666666666666667, opacity: 1),
+ textError: Color(.sRGB, red: 0.3764705882352941, green: 0.23529411764705882, blue: 0.21568627450980393, opacity: 1),
textGray: Color(.sRGB, red: 0.27450980392156865, green: 0.27450980392156865, blue: 0.3058823529411765, opacity: 1),
textGreen: Color(.sRGB, red: 0.20784313725490197, green: 0.30980392156862746, blue: 0.19215686274509805, opacity: 1),
+ textInfo: Color(.sRGB, red: 0.20392156862745098, green: 0.2823529411764706, blue: 0.3803921568627451, opacity: 1),
textOrange: Color(.sRGB, red: 0.3686274509803922, green: 0.24705882352941178, blue: 0.15294117647058825, opacity: 1),
textPink: Color(.sRGB, red: 0.35294117647058826, green: 0.23529411764705882, blue: 0.30980392156862746, opacity: 1),
textPrimary: Color(.sRGB, red: 0.1450980392156863, green: 0.1450980392156863, blue: 0.16470588235294117, opacity: 1),
textPurple: Color(.sRGB, red: 0.2980392156862745, green: 0.25098039215686274, blue: 0.3568627450980392, opacity: 1),
textRed: Color(.sRGB, red: 0.3764705882352941, green: 0.23529411764705882, blue: 0.21568627450980393, opacity: 1),
textSecondary: Color(.sRGB, red: 0.37254901960784315, green: 0.37254901960784315, blue: 0.39215686274509803, opacity: 1),
+ textSuccess: Color(.sRGB, red: 0.20784313725490197, green: 0.30980392156862746, blue: 0.19215686274509805, opacity: 1),
textTeal: Color(.sRGB, red: 0.17254901960784313, green: 0.30980392156862746, blue: 0.26666666666666666, opacity: 1),
+ textWarning: Color(.sRGB, red: 0.3215686274509804, green: 0.2823529411764706, blue: 0.09411764705882353, opacity: 1),
textYellow: Color(.sRGB, red: 0.3215686274509804, green: 0.2823529411764706, blue: 0.09411764705882353, opacity: 1),
tintHover: Color(.sRGB, red: 0, green: 0, blue: 0, opacity: 1),
track: Color(.sRGB, red: 0.8, green: 0.8274509803921568, blue: 0.8588235294117647, opacity: 1),
@@ -246,13 +265,17 @@ extension Theme {
borderBlue: Color(.sRGB, red: 0.17254901960784313, green: 0.23529411764705882, blue: 0.3215686274509804, opacity: 1),
borderCyan: Color(.sRGB, red: 0.13725490196078433, green: 0.25098039215686274, blue: 0.2823529411764706, opacity: 1),
borderEmphasized: Color(.sRGB, red: 0.3686274509803922, green: 0.3686274509803922, blue: 0.39215686274509803, opacity: 1),
+ borderError: Color(.sRGB, red: 0.9686274509803922, green: 0.8588235294117647, blue: 0.8431372549019608, opacity: 1),
borderGray: Color(.sRGB, red: 0.22745098039215686, green: 0.22745098039215686, blue: 0.25882352941176473, opacity: 1),
borderGreen: Color(.sRGB, red: 0.1843137254901961, green: 0.2549019607843137, blue: 0.17254901960784313, opacity: 1),
+ borderInfo: Color(.sRGB, red: 0.8352941176470589, green: 0.8941176470588236, blue: 0.9725490196078431, opacity: 1),
borderOrange: Color(.sRGB, red: 0.3058823529411765, green: 0.20784313725490197, blue: 0.13333333333333333, opacity: 1),
borderPink: Color(.sRGB, red: 0.29411764705882354, green: 0.19607843137254902, blue: 0.25882352941176473, opacity: 1),
borderPurple: Color(.sRGB, red: 0.24705882352941178, green: 0.21568627450980393, blue: 0.2980392156862745, opacity: 1),
borderRed: Color(.sRGB, red: 0.3137254901960784, green: 0.2, blue: 0.1803921568627451, opacity: 1),
+ borderSuccess: Color(.sRGB, red: 0.8352941176470589, green: 0.9137254901960784, blue: 0.8235294117647058, opacity: 1),
borderTeal: Color(.sRGB, red: 0.15294117647058825, green: 0.25882352941176473, blue: 0.2235294117647059, opacity: 1),
+ borderWarning: Color(.sRGB, red: 0.9450980392156862, green: 0.8823529411764706, blue: 0.7254901960784313, opacity: 1),
borderYellow: Color(.sRGB, red: 0.2627450980392157, green: 0.23137254901960785, blue: 0.10588235294117647, opacity: 1),
dataBlue1: Color(.sRGB, red: 0.8588235294117647, green: 0.9254901960784314, blue: 1, opacity: 1),
dataBlue2: Color(.sRGB, red: 0.47058823529411764, green: 0.7450980392156863, blue: 1, opacity: 1),
@@ -316,23 +339,34 @@ extension Theme {
iconBlue: Color(.sRGB, red: 0.8352941176470589, green: 0.8941176470588236, blue: 0.9725490196078431, opacity: 1),
iconCyan: Color(.sRGB, red: 0.8117647058823529, green: 0.9098039215686274, blue: 0.9333333333333333, opacity: 1),
iconDisabled: Color(.sRGB, red: 0.3686274509803922, green: 0.3686274509803922, blue: 0.39215686274509803, opacity: 1),
+ iconError: Color(.sRGB, red: 0.9686274509803922, green: 0.8588235294117647, blue: 0.8431372549019608, opacity: 1),
iconGray: Color(.sRGB, red: 0.8862745098039215, green: 0.8862745098039215, blue: 0.9098039215686274, opacity: 1),
iconGreen: Color(.sRGB, red: 0.8352941176470589, green: 0.9137254901960784, blue: 0.8235294117647058, opacity: 1),
+ iconInfo: Color(.sRGB, red: 0.8352941176470589, green: 0.8941176470588236, blue: 0.9725490196078431, opacity: 1),
iconOrange: Color(.sRGB, red: 1, green: 0.8627450980392157, blue: 0.7333333333333333, opacity: 1),
iconPink: Color(.sRGB, red: 0.9490196078431372, green: 0.8588235294117647, blue: 0.9098039215686274, opacity: 1),
iconPrimary: Color(.sRGB, red: 0.9411764705882353, green: 0.9411764705882353, blue: 0.9764705882352941, opacity: 1),
iconPurple: Color(.sRGB, red: 0.9019607843137255, green: 0.8705882352941177, blue: 0.9529411764705882, opacity: 1),
iconRed: Color(.sRGB, red: 0.9686274509803922, green: 0.8588235294117647, blue: 0.8431372549019608, opacity: 1),
iconSecondary: Color(.sRGB, red: 0.615686274509804, green: 0.6196078431372549, blue: 0.6470588235294118, opacity: 1),
+ iconSuccess: Color(.sRGB, red: 0.8352941176470589, green: 0.9137254901960784, blue: 0.8235294117647058, opacity: 1),
iconTeal: Color(.sRGB, red: 0.8392156862745098, green: 0.9058823529411765, blue: 0.8823529411764706, opacity: 1),
+ iconWarning: Color(.sRGB, red: 0.9450980392156862, green: 0.8823529411764706, blue: 0.7254901960784313, opacity: 1),
iconYellow: Color(.sRGB, red: 0.9450980392156862, green: 0.8823529411764706, blue: 0.7254901960784313, opacity: 1),
+ info: Color(.sRGB, red: 0.6039215686274509, green: 0.6784313725490196, blue: 0.7803921568627451, opacity: 1),
+ infoMuted: Color(.sRGB, red: 0.17254901960784313, green: 0.23529411764705882, blue: 0.3215686274509804, opacity: 1),
neutral: Color(.sRGB, red: 0.9411764705882353, green: 0.9411764705882353, blue: 0.9764705882352941, opacity: 0.10196078431372549),
onAccent: Color(.sRGB, red: 0.1450980392156863, green: 0.1450980392156863, blue: 0.16470588235294117, opacity: 1),
onDark: Color(.sRGB, red: 1, green: 1, blue: 1, opacity: 1),
- onError: Color(.sRGB, red: 0.9686274509803922, green: 0.8588235294117647, blue: 0.8431372549019608, opacity: 1),
+ onError: Color(.sRGB, red: 0.10588235294117647, green: 0.10588235294117647, blue: 0.12941176470588237, opacity: 1),
+ onErrorMuted: Color(.sRGB, red: 0.3137254901960784, green: 0.2, blue: 0.1803921568627451, opacity: 1),
+ onInfo: Color(.sRGB, red: 0.1450980392156863, green: 0.1450980392156863, blue: 0.16470588235294117, opacity: 1),
+ onInfoMuted: Color(.sRGB, red: 0.8352941176470589, green: 0.8941176470588236, blue: 0.9725490196078431, opacity: 1),
onLight: Color(.sRGB, red: 0.1450980392156863, green: 0.1450980392156863, blue: 0.16470588235294117, opacity: 1),
- onSuccess: Color(.sRGB, red: 0.8352941176470589, green: 0.9137254901960784, blue: 0.8235294117647058, opacity: 1),
- onWarning: Color(.sRGB, red: 0.9450980392156862, green: 0.8823529411764706, blue: 0.7254901960784313, opacity: 1),
+ onSuccess: Color(.sRGB, red: 0.10588235294117647, green: 0.10588235294117647, blue: 0.12941176470588237, opacity: 1),
+ onSuccessMuted: Color(.sRGB, red: 0.1843137254901961, green: 0.2549019607843137, blue: 0.17254901960784313, opacity: 1),
+ onWarning: Color(.sRGB, red: 0.10588235294117647, green: 0.10588235294117647, blue: 0.12941176470588237, opacity: 1),
+ onWarningMuted: Color(.sRGB, red: 0.2627450980392157, green: 0.23137254901960785, blue: 0.10588235294117647, opacity: 1),
overlay: Color(.sRGB, red: 0.1450980392156863, green: 0.1450980392156863, blue: 0.16470588235294117, opacity: 0.8),
overlayHover: Color(.sRGB, red: 0.9411764705882353, green: 0.9411764705882353, blue: 0.9764705882352941, opacity: 0.050980392156862744),
overlayPressed: Color(.sRGB, red: 0.9411764705882353, green: 0.9411764705882353, blue: 0.9764705882352941, opacity: 0.10196078431372549),
@@ -363,15 +397,19 @@ extension Theme {
textBlue: Color(.sRGB, red: 0.8352941176470589, green: 0.8941176470588236, blue: 0.9725490196078431, opacity: 1),
textCyan: Color(.sRGB, red: 0.8117647058823529, green: 0.9098039215686274, blue: 0.9333333333333333, opacity: 1),
textDisabled: Color(.sRGB, red: 0.3686274509803922, green: 0.3686274509803922, blue: 0.39215686274509803, opacity: 1),
+ textError: Color(.sRGB, red: 0.9686274509803922, green: 0.8588235294117647, blue: 0.8431372549019608, opacity: 1),
textGray: Color(.sRGB, red: 0.8862745098039215, green: 0.8862745098039215, blue: 0.9098039215686274, opacity: 1),
textGreen: Color(.sRGB, red: 0.8352941176470589, green: 0.9137254901960784, blue: 0.8235294117647058, opacity: 1),
+ textInfo: Color(.sRGB, red: 0.8352941176470589, green: 0.8941176470588236, blue: 0.9725490196078431, opacity: 1),
textOrange: Color(.sRGB, red: 1, green: 0.8627450980392157, blue: 0.7333333333333333, opacity: 1),
textPink: Color(.sRGB, red: 0.9490196078431372, green: 0.8588235294117647, blue: 0.9098039215686274, opacity: 1),
textPrimary: Color(.sRGB, red: 0.9411764705882353, green: 0.9411764705882353, blue: 0.9764705882352941, opacity: 1),
textPurple: Color(.sRGB, red: 0.9019607843137255, green: 0.8705882352941177, blue: 0.9529411764705882, opacity: 1),
textRed: Color(.sRGB, red: 0.9686274509803922, green: 0.8588235294117647, blue: 0.8431372549019608, opacity: 1),
textSecondary: Color(.sRGB, red: 0.6705882352941176, green: 0.6705882352941176, blue: 0.7019607843137254, opacity: 1),
+ textSuccess: Color(.sRGB, red: 0.8352941176470589, green: 0.9137254901960784, blue: 0.8235294117647058, opacity: 1),
textTeal: Color(.sRGB, red: 0.8392156862745098, green: 0.9058823529411765, blue: 0.8823529411764706, opacity: 1),
+ textWarning: Color(.sRGB, red: 0.9450980392156862, green: 0.8823529411764706, blue: 0.7254901960784313, opacity: 1),
textYellow: Color(.sRGB, red: 0.9450980392156862, green: 0.8823529411764706, blue: 0.7254901960784313, opacity: 1),
tintHover: Color(.sRGB, red: 1, green: 1, blue: 1, opacity: 1),
track: Color(.sRGB, red: 0.35294117647058826, green: 0.3686274509803922, blue: 0.4, opacity: 1),
diff --git a/packages/native/apple/Sources/Astryx/Theme/Generated/Tokens.swift b/packages/native/apple/Sources/Astryx/Theme/Generated/Tokens.swift
index d9b67944ce..46588d0e8b 100644
--- a/packages/native/apple/Sources/Astryx/Theme/Generated/Tokens.swift
+++ b/packages/native/apple/Sources/Astryx/Theme/Generated/Tokens.swift
@@ -100,10 +100,14 @@ public struct ColorTokens: Equatable, Sendable {
public var borderCyan: Color
/// `--color-border-emphasized`
public var borderEmphasized: Color
+ /// `--color-border-error`
+ public var borderError: Color
/// `--color-border-gray`
public var borderGray: Color
/// `--color-border-green`
public var borderGreen: Color
+ /// `--color-border-info`
+ public var borderInfo: Color
/// `--color-border-orange`
public var borderOrange: Color
/// `--color-border-pink`
@@ -112,8 +116,12 @@ public struct ColorTokens: Equatable, Sendable {
public var borderPurple: Color
/// `--color-border-red`
public var borderRed: Color
+ /// `--color-border-success`
+ public var borderSuccess: Color
/// `--color-border-teal`
public var borderTeal: Color
+ /// `--color-border-warning`
+ public var borderWarning: Color
/// `--color-border-yellow`
public var borderYellow: Color
/// `--color-data-blue-1`
@@ -240,10 +248,14 @@ public struct ColorTokens: Equatable, Sendable {
public var iconCyan: Color
/// `--color-icon-disabled`
public var iconDisabled: Color
+ /// `--color-icon-error`
+ public var iconError: Color
/// `--color-icon-gray`
public var iconGray: Color
/// `--color-icon-green`
public var iconGreen: Color
+ /// `--color-icon-info`
+ public var iconInfo: Color
/// `--color-icon-orange`
public var iconOrange: Color
/// `--color-icon-pink`
@@ -256,10 +268,18 @@ public struct ColorTokens: Equatable, Sendable {
public var iconRed: Color
/// `--color-icon-secondary`
public var iconSecondary: Color
+ /// `--color-icon-success`
+ public var iconSuccess: Color
/// `--color-icon-teal`
public var iconTeal: Color
+ /// `--color-icon-warning`
+ public var iconWarning: Color
/// `--color-icon-yellow`
public var iconYellow: Color
+ /// `--color-info`
+ public var info: Color
+ /// `--color-info-muted`
+ public var infoMuted: Color
/// `--color-neutral`
public var neutral: Color
/// `--color-on-accent`
@@ -268,12 +288,22 @@ public struct ColorTokens: Equatable, Sendable {
public var onDark: Color
/// `--color-on-error`
public var onError: Color
+ /// `--color-on-error-muted`
+ public var onErrorMuted: Color
+ /// `--color-on-info`
+ public var onInfo: Color
+ /// `--color-on-info-muted`
+ public var onInfoMuted: Color
/// `--color-on-light`
public var onLight: Color
/// `--color-on-success`
public var onSuccess: Color
+ /// `--color-on-success-muted`
+ public var onSuccessMuted: Color
/// `--color-on-warning`
public var onWarning: Color
+ /// `--color-on-warning-muted`
+ public var onWarningMuted: Color
/// `--color-overlay`
public var overlay: Color
/// `--color-overlay-hover`
@@ -334,10 +364,14 @@ public struct ColorTokens: Equatable, Sendable {
public var textCyan: Color
/// `--color-text-disabled`
public var textDisabled: Color
+ /// `--color-text-error`
+ public var textError: Color
/// `--color-text-gray`
public var textGray: Color
/// `--color-text-green`
public var textGreen: Color
+ /// `--color-text-info`
+ public var textInfo: Color
/// `--color-text-orange`
public var textOrange: Color
/// `--color-text-pink`
@@ -350,8 +384,12 @@ public struct ColorTokens: Equatable, Sendable {
public var textRed: Color
/// `--color-text-secondary`
public var textSecondary: Color
+ /// `--color-text-success`
+ public var textSuccess: Color
/// `--color-text-teal`
public var textTeal: Color
+ /// `--color-text-warning`
+ public var textWarning: Color
/// `--color-text-yellow`
public var textYellow: Color
/// `--color-tint-hover`
@@ -387,13 +425,17 @@ public struct ColorTokens: Equatable, Sendable {
borderBlue: Color,
borderCyan: Color,
borderEmphasized: Color,
+ borderError: Color,
borderGray: Color,
borderGreen: Color,
+ borderInfo: Color,
borderOrange: Color,
borderPink: Color,
borderPurple: Color,
borderRed: Color,
+ borderSuccess: Color,
borderTeal: Color,
+ borderWarning: Color,
borderYellow: Color,
dataBlue1: Color,
dataBlue2: Color,
@@ -457,23 +499,34 @@ public struct ColorTokens: Equatable, Sendable {
iconBlue: Color,
iconCyan: Color,
iconDisabled: Color,
+ iconError: Color,
iconGray: Color,
iconGreen: Color,
+ iconInfo: Color,
iconOrange: Color,
iconPink: Color,
iconPrimary: Color,
iconPurple: Color,
iconRed: Color,
iconSecondary: Color,
+ iconSuccess: Color,
iconTeal: Color,
+ iconWarning: Color,
iconYellow: Color,
+ info: Color,
+ infoMuted: Color,
neutral: Color,
onAccent: Color,
onDark: Color,
onError: Color,
+ onErrorMuted: Color,
+ onInfo: Color,
+ onInfoMuted: Color,
onLight: Color,
onSuccess: Color,
+ onSuccessMuted: Color,
onWarning: Color,
+ onWarningMuted: Color,
overlay: Color,
overlayHover: Color,
overlayPressed: Color,
@@ -504,15 +557,19 @@ public struct ColorTokens: Equatable, Sendable {
textBlue: Color,
textCyan: Color,
textDisabled: Color,
+ textError: Color,
textGray: Color,
textGreen: Color,
+ textInfo: Color,
textOrange: Color,
textPink: Color,
textPrimary: Color,
textPurple: Color,
textRed: Color,
textSecondary: Color,
+ textSuccess: Color,
textTeal: Color,
+ textWarning: Color,
textYellow: Color,
tintHover: Color,
track: Color,
@@ -542,13 +599,17 @@ public struct ColorTokens: Equatable, Sendable {
self.borderBlue = borderBlue
self.borderCyan = borderCyan
self.borderEmphasized = borderEmphasized
+ self.borderError = borderError
self.borderGray = borderGray
self.borderGreen = borderGreen
+ self.borderInfo = borderInfo
self.borderOrange = borderOrange
self.borderPink = borderPink
self.borderPurple = borderPurple
self.borderRed = borderRed
+ self.borderSuccess = borderSuccess
self.borderTeal = borderTeal
+ self.borderWarning = borderWarning
self.borderYellow = borderYellow
self.dataBlue1 = dataBlue1
self.dataBlue2 = dataBlue2
@@ -612,23 +673,34 @@ public struct ColorTokens: Equatable, Sendable {
self.iconBlue = iconBlue
self.iconCyan = iconCyan
self.iconDisabled = iconDisabled
+ self.iconError = iconError
self.iconGray = iconGray
self.iconGreen = iconGreen
+ self.iconInfo = iconInfo
self.iconOrange = iconOrange
self.iconPink = iconPink
self.iconPrimary = iconPrimary
self.iconPurple = iconPurple
self.iconRed = iconRed
self.iconSecondary = iconSecondary
+ self.iconSuccess = iconSuccess
self.iconTeal = iconTeal
+ self.iconWarning = iconWarning
self.iconYellow = iconYellow
+ self.info = info
+ self.infoMuted = infoMuted
self.neutral = neutral
self.onAccent = onAccent
self.onDark = onDark
self.onError = onError
+ self.onErrorMuted = onErrorMuted
+ self.onInfo = onInfo
+ self.onInfoMuted = onInfoMuted
self.onLight = onLight
self.onSuccess = onSuccess
+ self.onSuccessMuted = onSuccessMuted
self.onWarning = onWarning
+ self.onWarningMuted = onWarningMuted
self.overlay = overlay
self.overlayHover = overlayHover
self.overlayPressed = overlayPressed
@@ -659,15 +731,19 @@ public struct ColorTokens: Equatable, Sendable {
self.textBlue = textBlue
self.textCyan = textCyan
self.textDisabled = textDisabled
+ self.textError = textError
self.textGray = textGray
self.textGreen = textGreen
+ self.textInfo = textInfo
self.textOrange = textOrange
self.textPink = textPink
self.textPrimary = textPrimary
self.textPurple = textPurple
self.textRed = textRed
self.textSecondary = textSecondary
+ self.textSuccess = textSuccess
self.textTeal = textTeal
+ self.textWarning = textWarning
self.textYellow = textYellow
self.tintHover = tintHover
self.track = track
@@ -702,13 +778,17 @@ public struct ColorTokens: Equatable, Sendable {
case "color-border-blue": borderBlue
case "color-border-cyan": borderCyan
case "color-border-emphasized": borderEmphasized
+ case "color-border-error": borderError
case "color-border-gray": borderGray
case "color-border-green": borderGreen
+ case "color-border-info": borderInfo
case "color-border-orange": borderOrange
case "color-border-pink": borderPink
case "color-border-purple": borderPurple
case "color-border-red": borderRed
+ case "color-border-success": borderSuccess
case "color-border-teal": borderTeal
+ case "color-border-warning": borderWarning
case "color-border-yellow": borderYellow
case "color-data-blue-1": dataBlue1
case "color-data-blue-2": dataBlue2
@@ -772,23 +852,34 @@ public struct ColorTokens: Equatable, Sendable {
case "color-icon-blue": iconBlue
case "color-icon-cyan": iconCyan
case "color-icon-disabled": iconDisabled
+ case "color-icon-error": iconError
case "color-icon-gray": iconGray
case "color-icon-green": iconGreen
+ case "color-icon-info": iconInfo
case "color-icon-orange": iconOrange
case "color-icon-pink": iconPink
case "color-icon-primary": iconPrimary
case "color-icon-purple": iconPurple
case "color-icon-red": iconRed
case "color-icon-secondary": iconSecondary
+ case "color-icon-success": iconSuccess
case "color-icon-teal": iconTeal
+ case "color-icon-warning": iconWarning
case "color-icon-yellow": iconYellow
+ case "color-info": info
+ case "color-info-muted": infoMuted
case "color-neutral": neutral
case "color-on-accent": onAccent
case "color-on-dark": onDark
case "color-on-error": onError
+ case "color-on-error-muted": onErrorMuted
+ case "color-on-info": onInfo
+ case "color-on-info-muted": onInfoMuted
case "color-on-light": onLight
case "color-on-success": onSuccess
+ case "color-on-success-muted": onSuccessMuted
case "color-on-warning": onWarning
+ case "color-on-warning-muted": onWarningMuted
case "color-overlay": overlay
case "color-overlay-hover": overlayHover
case "color-overlay-pressed": overlayPressed
@@ -819,15 +910,19 @@ public struct ColorTokens: Equatable, Sendable {
case "color-text-blue": textBlue
case "color-text-cyan": textCyan
case "color-text-disabled": textDisabled
+ case "color-text-error": textError
case "color-text-gray": textGray
case "color-text-green": textGreen
+ case "color-text-info": textInfo
case "color-text-orange": textOrange
case "color-text-pink": textPink
case "color-text-primary": textPrimary
case "color-text-purple": textPurple
case "color-text-red": textRed
case "color-text-secondary": textSecondary
+ case "color-text-success": textSuccess
case "color-text-teal": textTeal
+ case "color-text-warning": textWarning
case "color-text-yellow": textYellow
case "color-tint-hover": tintHover
case "color-track": track
diff --git a/packages/native/apple/Sources/Astryx/Theme/Generated/Y2kTheme.swift b/packages/native/apple/Sources/Astryx/Theme/Generated/Y2kTheme.swift
index 7fb5c4da39..6eb9720fdc 100644
--- a/packages/native/apple/Sources/Astryx/Theme/Generated/Y2kTheme.swift
+++ b/packages/native/apple/Sources/Astryx/Theme/Generated/Y2kTheme.swift
@@ -32,13 +32,17 @@ extension Theme {
borderBlue: Color(.sRGB, red: 0.4392156862745098, green: 0.7568627450980392, blue: 1, opacity: 1),
borderCyan: Color(.sRGB, red: 0.45098039215686275, green: 0.8588235294117647, blue: 0.8431372549019608, opacity: 1),
borderEmphasized: Color(.sRGB, red: 0.2196078431372549, green: 0.1803921568627451, blue: 0.1411764705882353, opacity: 1),
+ borderError: Color(.sRGB, red: 0.5333333333333333, green: 0, blue: 0.13725490196078433, opacity: 1),
borderGray: Color(.sRGB, red: 0.8745098039215686, green: 0.8352941176470589, blue: 0.788235294117647, opacity: 1),
borderGreen: Color(.sRGB, red: 0.7098039215686275, green: 0.8274509803921568, blue: 0.3764705882352941, opacity: 1),
+ borderInfo: Color(.sRGB, red: 0, green: 0.20392156862745098, blue: 0.32941176470588235, opacity: 1),
borderOrange: Color(.sRGB, red: 1, green: 0.7058823529411765, blue: 0.4666666666666667, opacity: 1),
borderPink: Color(.sRGB, red: 1, green: 0.6588235294117647, blue: 0.803921568627451, opacity: 1),
borderPurple: Color(.sRGB, red: 0.7333333333333333, green: 0.6666666666666666, blue: 1, opacity: 1),
borderRed: Color(.sRGB, red: 1, green: 0.5882352941176471, blue: 0.6039215686274509, opacity: 1),
+ borderSuccess: Color(.sRGB, red: 0.24705882352941178, green: 0.3058823529411765, blue: 0, opacity: 1),
borderTeal: Color(.sRGB, red: 0.5058823529411764, green: 0.8627450980392157, blue: 0.7137254901960784, opacity: 1),
+ borderWarning: Color(.sRGB, red: 0.34509803921568627, green: 0.26666666666666666, blue: 0, opacity: 1),
borderYellow: Color(.sRGB, red: 0.9764705882352941, green: 0.8156862745098039, blue: 0.34901960784313724, opacity: 1),
dataBlue1: Color(.sRGB, red: 0.8588235294117647, green: 0.9254901960784314, blue: 1, opacity: 1),
dataBlue2: Color(.sRGB, red: 0.47058823529411764, green: 0.7450980392156863, blue: 1, opacity: 1),
@@ -102,23 +106,34 @@ extension Theme {
iconBlue: Color(.sRGB, red: 0, green: 0.20392156862745098, blue: 0.32941176470588235, opacity: 1),
iconCyan: Color(.sRGB, red: 0, green: 0.3215686274509804, blue: 0.3137254901960784, opacity: 1),
iconDisabled: Color(.sRGB, red: 0.8196078431372549, green: 0.7725490196078432, blue: 0.7215686274509804, opacity: 1),
+ iconError: Color(.sRGB, red: 0.5333333333333333, green: 0, blue: 0.13725490196078433, opacity: 1),
iconGray: Color(.sRGB, red: 0.30980392156862746, green: 0.27058823529411763, blue: 0.23137254901960785, opacity: 1),
iconGreen: Color(.sRGB, red: 0.24705882352941178, green: 0.3058823529411765, blue: 0, opacity: 1),
+ iconInfo: Color(.sRGB, red: 0, green: 0.20392156862745098, blue: 0.32941176470588235, opacity: 1),
iconOrange: Color(.sRGB, red: 0.4392156862745098, green: 0.20392156862745098, blue: 0, opacity: 1),
iconPink: Color(.sRGB, red: 0.5098039215686274, green: 0, blue: 0.30980392156862746, opacity: 1),
iconPrimary: Color(.sRGB, red: 0.17647058823529413, green: 0.1411764705882353, blue: 0.10588235294117647, opacity: 1),
iconPurple: Color(.sRGB, red: 0.2627450980392157, green: 0.10196078431372549, blue: 0.5333333333333333, opacity: 1),
iconRed: Color(.sRGB, red: 0.5333333333333333, green: 0, blue: 0.13725490196078433, opacity: 1),
iconSecondary: Color(.sRGB, red: 0.403921568627451, green: 0.36470588235294116, blue: 0.3215686274509804, opacity: 1),
+ iconSuccess: Color(.sRGB, red: 0.24705882352941178, green: 0.3058823529411765, blue: 0, opacity: 1),
iconTeal: Color(.sRGB, red: 0, green: 0.3333333333333333, blue: 0.23137254901960785, opacity: 1),
+ iconWarning: Color(.sRGB, red: 0.34509803921568627, green: 0.26666666666666666, blue: 0, opacity: 1),
iconYellow: Color(.sRGB, red: 0.34509803921568627, green: 0.26666666666666666, blue: 0, opacity: 1),
+ info: Color(.sRGB, red: 0, green: 0.39215686274509803, blue: 0.6078431372549019, opacity: 1),
+ infoMuted: Color(.sRGB, red: 0.6784313725490196, green: 0.8588235294117647, blue: 1, opacity: 1),
neutral: Color(.sRGB, red: 0.17647058823529413, green: 0.1411764705882353, blue: 0.10588235294117647, opacity: 0.06274509803921569),
onAccent: Color(.sRGB, red: 1, green: 1, blue: 1, opacity: 1),
onDark: Color(.sRGB, red: 1, green: 1, blue: 1, opacity: 1),
onError: Color(.sRGB, red: 0.5333333333333333, green: 0, blue: 0.13725490196078433, opacity: 1),
+ onErrorMuted: Color(.sRGB, red: 0.5333333333333333, green: 0, blue: 0.13725490196078433, opacity: 1),
+ onInfo: Color(.sRGB, red: 1, green: 1, blue: 1, opacity: 1),
+ onInfoMuted: Color(.sRGB, red: 0, green: 0.20392156862745098, blue: 0.32941176470588235, opacity: 1),
onLight: Color(.sRGB, red: 0.17647058823529413, green: 0.1411764705882353, blue: 0.10588235294117647, opacity: 1),
onSuccess: Color(.sRGB, red: 0.24705882352941178, green: 0.3058823529411765, blue: 0, opacity: 1),
+ onSuccessMuted: Color(.sRGB, red: 0.24705882352941178, green: 0.3058823529411765, blue: 0, opacity: 1),
onWarning: Color(.sRGB, red: 0.34509803921568627, green: 0.26666666666666666, blue: 0, opacity: 1),
+ onWarningMuted: Color(.sRGB, red: 0.34509803921568627, green: 0.26666666666666666, blue: 0, opacity: 1),
overlay: Color(.sRGB, red: 0.17647058823529413, green: 0.1411764705882353, blue: 0.10588235294117647, opacity: 0.5019607843137255),
overlayHover: Color(.sRGB, red: 0.17647058823529413, green: 0.1411764705882353, blue: 0.10588235294117647, opacity: 0.050980392156862744),
overlayPressed: Color(.sRGB, red: 0.17647058823529413, green: 0.1411764705882353, blue: 0.10588235294117647, opacity: 0.10196078431372549),
@@ -149,15 +164,19 @@ extension Theme {
textBlue: Color(.sRGB, red: 0, green: 0.20392156862745098, blue: 0.32941176470588235, opacity: 1),
textCyan: Color(.sRGB, red: 0, green: 0.3215686274509804, blue: 0.3137254901960784, opacity: 1),
textDisabled: Color(.sRGB, red: 0.8196078431372549, green: 0.7725490196078432, blue: 0.7215686274509804, opacity: 1),
+ textError: Color(.sRGB, red: 0.5333333333333333, green: 0, blue: 0.13725490196078433, opacity: 1),
textGray: Color(.sRGB, red: 0.30980392156862746, green: 0.27058823529411763, blue: 0.23137254901960785, opacity: 1),
textGreen: Color(.sRGB, red: 0.24705882352941178, green: 0.3058823529411765, blue: 0, opacity: 1),
+ textInfo: Color(.sRGB, red: 0, green: 0.20392156862745098, blue: 0.32941176470588235, opacity: 1),
textOrange: Color(.sRGB, red: 0.4392156862745098, green: 0.20392156862745098, blue: 0, opacity: 1),
textPink: Color(.sRGB, red: 0.5098039215686274, green: 0, blue: 0.30980392156862746, opacity: 1),
textPrimary: Color(.sRGB, red: 0.17647058823529413, green: 0.1411764705882353, blue: 0.10588235294117647, opacity: 1),
textPurple: Color(.sRGB, red: 0.2627450980392157, green: 0.10196078431372549, blue: 0.5333333333333333, opacity: 1),
textRed: Color(.sRGB, red: 0.5333333333333333, green: 0, blue: 0.13725490196078433, opacity: 1),
textSecondary: Color(.sRGB, red: 0.403921568627451, green: 0.36470588235294116, blue: 0.3215686274509804, opacity: 1),
+ textSuccess: Color(.sRGB, red: 0.24705882352941178, green: 0.3058823529411765, blue: 0, opacity: 1),
textTeal: Color(.sRGB, red: 0, green: 0.3333333333333333, blue: 0.23137254901960785, opacity: 1),
+ textWarning: Color(.sRGB, red: 0.34509803921568627, green: 0.26666666666666666, blue: 0, opacity: 1),
textYellow: Color(.sRGB, red: 0.34509803921568627, green: 0.26666666666666666, blue: 0, opacity: 1),
tintHover: Color(.sRGB, red: 0.17647058823529413, green: 0.1411764705882353, blue: 0.10588235294117647, opacity: 1),
track: Color(.sRGB, red: 0.8, green: 0.8274509803921568, blue: 0.8588235294117647, opacity: 1),
@@ -246,13 +265,17 @@ extension Theme {
borderBlue: Color(.sRGB, red: 0.4392156862745098, green: 0.7568627450980392, blue: 1, opacity: 1),
borderCyan: Color(.sRGB, red: 0.5176470588235295, green: 0.8470588235294118, blue: 0.8313725490196079, opacity: 1),
borderEmphasized: Color(.sRGB, red: 0.38823529411764707, green: 0.40784313725490196, blue: 0.5372549019607843, opacity: 1),
+ borderError: Color(.sRGB, red: 1, green: 0.5882352941176471, blue: 0.6039215686274509, opacity: 1),
borderGray: Color(.sRGB, red: 0.8156862745098039, green: 0.8313725490196079, blue: 0.9215686274509803, opacity: 1),
borderGreen: Color(.sRGB, red: 0.7098039215686275, green: 0.8235294117647058, blue: 0.38823529411764707, opacity: 1),
+ borderInfo: Color(.sRGB, red: 0.4392156862745098, green: 0.7568627450980392, blue: 1, opacity: 1),
borderOrange: Color(.sRGB, red: 1, green: 0.7058823529411765, blue: 0.4666666666666667, opacity: 1),
borderPink: Color(.sRGB, red: 1, green: 0.6588235294117647, blue: 0.803921568627451, opacity: 1),
borderPurple: Color(.sRGB, red: 0.7333333333333333, green: 0.6666666666666666, blue: 1, opacity: 1),
borderRed: Color(.sRGB, red: 1, green: 0.5882352941176471, blue: 0.6039215686274509, opacity: 1),
+ borderSuccess: Color(.sRGB, red: 0.7098039215686275, green: 0.8235294117647058, blue: 0.38823529411764707, opacity: 1),
borderTeal: Color(.sRGB, red: 0.5568627450980392, green: 0.8509803921568627, blue: 0.7254901960784313, opacity: 1),
+ borderWarning: Color(.sRGB, red: 0.9529411764705882, green: 0.8196078431372549, blue: 0.4470588235294118, opacity: 1),
borderYellow: Color(.sRGB, red: 0.9529411764705882, green: 0.8196078431372549, blue: 0.4470588235294118, opacity: 1),
dataBlue1: Color(.sRGB, red: 0.8588235294117647, green: 0.9254901960784314, blue: 1, opacity: 1),
dataBlue2: Color(.sRGB, red: 0.47058823529411764, green: 0.7450980392156863, blue: 1, opacity: 1),
@@ -316,23 +339,34 @@ extension Theme {
iconBlue: Color(.sRGB, red: 0, green: 0.20392156862745098, blue: 0.32941176470588235, opacity: 1),
iconCyan: Color(.sRGB, red: 0, green: 0.17647058823529413, blue: 0.17254901960784313, opacity: 1),
iconDisabled: Color(.sRGB, red: 0.2901960784313726, green: 0.30980392156862746, blue: 0.4196078431372549, opacity: 1),
+ iconError: Color(.sRGB, red: 1, green: 0.5882352941176471, blue: 0.6039215686274509, opacity: 1),
iconGray: Color(.sRGB, red: 0.08627450980392157, green: 0.09411764705882353, blue: 0.16862745098039217, opacity: 1),
iconGreen: Color(.sRGB, red: 0.16470588235294117, green: 0.21176470588235294, blue: 0, opacity: 1),
+ iconInfo: Color(.sRGB, red: 0.4392156862745098, green: 0.7568627450980392, blue: 1, opacity: 1),
iconOrange: Color(.sRGB, red: 0.2549019607843137, green: 0.09411764705882353, blue: 0, opacity: 1),
iconPink: Color(.sRGB, red: 0.36470588235294116, green: 0, blue: 0.21568627450980393, opacity: 1),
iconPrimary: Color(.sRGB, red: 0.9294117647058824, green: 0.9372549019607843, blue: 0.9882352941176471, opacity: 1),
iconPurple: Color(.sRGB, red: 0.16470588235294117, green: 0.06666666666666667, blue: 0.34901960784313724, opacity: 1),
iconRed: Color(.sRGB, red: 0.3803921568627451, green: 0, blue: 0.08627450980392157, opacity: 1),
iconSecondary: Color(.sRGB, red: 0.6509803921568628, green: 0.6745098039215687, blue: 0.8392156862745098, opacity: 1),
+ iconSuccess: Color(.sRGB, red: 0.7098039215686275, green: 0.8235294117647058, blue: 0.38823529411764707, opacity: 1),
iconTeal: Color(.sRGB, red: 0, green: 0.1843137254901961, blue: 0.11764705882352941, opacity: 1),
+ iconWarning: Color(.sRGB, red: 0.9529411764705882, green: 0.8196078431372549, blue: 0.4470588235294118, opacity: 1),
iconYellow: Color(.sRGB, red: 0.23921568627450981, green: 0.1803921568627451, blue: 0, opacity: 1),
+ info: Color(.sRGB, red: 0.4392156862745098, green: 0.7568627450980392, blue: 1, opacity: 1),
+ infoMuted: Color(.sRGB, red: 0.6784313725490196, green: 0.8588235294117647, blue: 1, opacity: 1),
neutral: Color(.sRGB, red: 0.9294117647058824, green: 0.9372549019607843, blue: 0.9882352941176471, opacity: 0.10196078431372549),
onAccent: Color(.sRGB, red: 0.08627450980392157, green: 0.09411764705882353, blue: 0.16862745098039217, opacity: 1),
onDark: Color(.sRGB, red: 1, green: 1, blue: 1, opacity: 1),
onError: Color(.sRGB, red: 0.3803921568627451, green: 0, blue: 0.08627450980392157, opacity: 1),
+ onErrorMuted: Color(.sRGB, red: 0.3803921568627451, green: 0, blue: 0.08627450980392157, opacity: 1),
+ onInfo: Color(.sRGB, red: 0.17647058823529413, green: 0.1411764705882353, blue: 0.10588235294117647, opacity: 1),
+ onInfoMuted: Color(.sRGB, red: 0, green: 0.20392156862745098, blue: 0.32941176470588235, opacity: 1),
onLight: Color(.sRGB, red: 0.17647058823529413, green: 0.1411764705882353, blue: 0.10588235294117647, opacity: 1),
onSuccess: Color(.sRGB, red: 0.16470588235294117, green: 0.21176470588235294, blue: 0, opacity: 1),
+ onSuccessMuted: Color(.sRGB, red: 0.16470588235294117, green: 0.21176470588235294, blue: 0, opacity: 1),
onWarning: Color(.sRGB, red: 0.23921568627450981, green: 0.1803921568627451, blue: 0, opacity: 1),
+ onWarningMuted: Color(.sRGB, red: 0.23921568627450981, green: 0.1803921568627451, blue: 0, opacity: 1),
overlay: Color(.sRGB, red: 0.054901960784313725, green: 0.058823529411764705, blue: 0.10196078431372549, opacity: 0.8),
overlayHover: Color(.sRGB, red: 0.9294117647058824, green: 0.9372549019607843, blue: 0.9882352941176471, opacity: 0.050980392156862744),
overlayPressed: Color(.sRGB, red: 0.9294117647058824, green: 0.9372549019607843, blue: 0.9882352941176471, opacity: 0.10196078431372549),
@@ -363,15 +397,19 @@ extension Theme {
textBlue: Color(.sRGB, red: 0, green: 0.20392156862745098, blue: 0.32941176470588235, opacity: 1),
textCyan: Color(.sRGB, red: 0, green: 0.17647058823529413, blue: 0.17254901960784313, opacity: 1),
textDisabled: Color(.sRGB, red: 0.2901960784313726, green: 0.30980392156862746, blue: 0.4196078431372549, opacity: 1),
+ textError: Color(.sRGB, red: 1, green: 0.5882352941176471, blue: 0.6039215686274509, opacity: 1),
textGray: Color(.sRGB, red: 0.08627450980392157, green: 0.09411764705882353, blue: 0.16862745098039217, opacity: 1),
textGreen: Color(.sRGB, red: 0.16470588235294117, green: 0.21176470588235294, blue: 0, opacity: 1),
+ textInfo: Color(.sRGB, red: 0.4392156862745098, green: 0.7568627450980392, blue: 1, opacity: 1),
textOrange: Color(.sRGB, red: 0.2549019607843137, green: 0.09411764705882353, blue: 0, opacity: 1),
textPink: Color(.sRGB, red: 0.36470588235294116, green: 0, blue: 0.21568627450980393, opacity: 1),
textPrimary: Color(.sRGB, red: 0.9294117647058824, green: 0.9372549019607843, blue: 0.9882352941176471, opacity: 1),
textPurple: Color(.sRGB, red: 0.16470588235294117, green: 0.06666666666666667, blue: 0.34901960784313724, opacity: 1),
textRed: Color(.sRGB, red: 0.3803921568627451, green: 0, blue: 0.08627450980392157, opacity: 1),
textSecondary: Color(.sRGB, red: 0.6509803921568628, green: 0.6745098039215687, blue: 0.8392156862745098, opacity: 1),
+ textSuccess: Color(.sRGB, red: 0.7098039215686275, green: 0.8235294117647058, blue: 0.38823529411764707, opacity: 1),
textTeal: Color(.sRGB, red: 0, green: 0.1843137254901961, blue: 0.11764705882352941, opacity: 1),
+ textWarning: Color(.sRGB, red: 0.9529411764705882, green: 0.8196078431372549, blue: 0.4470588235294118, opacity: 1),
textYellow: Color(.sRGB, red: 0.23921568627450981, green: 0.1803921568627451, blue: 0, opacity: 1),
tintHover: Color(.sRGB, red: 0.9294117647058824, green: 0.9372549019607843, blue: 0.9882352941176471, opacity: 1),
track: Color(.sRGB, red: 0.35294117647058826, green: 0.3686274509803922, blue: 0.4, opacity: 1),
diff --git a/packages/native/apple/Sources/AstryxNative/Generated/Icon.swift b/packages/native/apple/Sources/AstryxNative/Generated/Icon.swift
index e5a6daa431..b761f6a751 100644
--- a/packages/native/apple/Sources/AstryxNative/Generated/Icon.swift
+++ b/packages/native/apple/Sources/AstryxNative/Generated/Icon.swift
@@ -5,6 +5,7 @@ public enum IconColor: String, CaseIterable, Codable, Sendable {
case tertiary = "tertiary"
case disabled = "disabled"
case accent = "accent"
+ case info = "info"
case success = "success"
case error = "error"
case warning = "warning"
diff --git a/packages/native/apple/Tests/AstryxTests/IconTests.swift b/packages/native/apple/Tests/AstryxTests/IconTests.swift
index 7423ff2956..2e385550b7 100644
--- a/packages/native/apple/Tests/AstryxTests/IconTests.swift
+++ b/packages/native/apple/Tests/AstryxTests/IconTests.swift
@@ -126,9 +126,10 @@ import AppKit
#expect(Icon.color(for: .tertiary, in: tokens) == tokens.color.iconSecondary)
#expect(Icon.color(for: .disabled, in: tokens) == tokens.color.iconDisabled)
#expect(Icon.color(for: .accent, in: tokens) == tokens.color.accent)
- #expect(Icon.color(for: .success, in: tokens) == tokens.color.success)
- #expect(Icon.color(for: .error, in: tokens) == tokens.color.error)
- #expect(Icon.color(for: .warning, in: tokens) == tokens.color.warning)
+ #expect(Icon.color(for: .info, in: tokens) == tokens.color.iconInfo)
+ #expect(Icon.color(for: .success, in: tokens) == tokens.color.iconSuccess)
+ #expect(Icon.color(for: .error, in: tokens) == tokens.color.iconError)
+ #expect(Icon.color(for: .warning, in: tokens) == tokens.color.iconWarning)
#expect(Icon.color(for: .inherit, in: tokens) == nil)
}
diff --git a/packages/richtext/src/RichTextEditor.tsx b/packages/richtext/src/RichTextEditor.tsx
index 13fae1f0ea..c4ffcf8ed9 100644
--- a/packages/richtext/src/RichTextEditor.tsx
+++ b/packages/richtext/src/RichTextEditor.tsx
@@ -226,7 +226,7 @@ const styles = stylex.create({
color: colorVars['--color-text-secondary'],
},
counterError: {
- color: colorVars['--color-error'],
+ color: colorVars['--color-text-error'],
},
});
diff --git a/packages/themes/butter/src/butterPaletteRefs.generated.ts b/packages/themes/butter/src/butterPaletteRefs.generated.ts
index df32f360ca..2c0a61127d 100644
--- a/packages/themes/butter/src/butterPaletteRefs.generated.ts
+++ b/packages/themes/butter/src/butterPaletteRefs.generated.ts
@@ -11,7 +11,7 @@ export const butterPaletteRefs = {
dark: {25: '#52237b', 80: '#ddb9f6', 90: '#f2daff'},
},
green: {
- light: {25: '#004a05', 70: '#7bbf7a', 80: '#a2d7a0', 85: '#b6e3b4', 90: '#caeec8'},
+ light: {25: '#004a05', 55: '#4a984a', 70: '#7bbf7a', 80: '#a2d7a0', 85: '#b6e3b4', 90: '#caeec8'},
dark: {15: '#013004', 20: '#063c0a', 70: '#83bc82', 80: '#a8d4a6', 90: '#cdedcc'},
},
neutral: {
@@ -31,7 +31,7 @@ export const butterPaletteRefs = {
dark: {15: '#4c0700', 25: '#6f1400', 80: '#ffb09b', 85: '#ffc5b5', 90: '#ffd9cf'},
},
yellow: {
- light: {25: '#443c00', 30: '#514700', 70: '#bfae35', 80: '#dfcf5b', 85: '#f0df72', 90: '#fdee8c', 95: '#fff7c0'},
+ light: {25: '#443c00', 30: '#514700', 55: '#958500', 70: '#bfae35', 80: '#dfcf5b', 85: '#f0df72', 90: '#fdee8c', 95: '#fff7c0'},
dark: {15: '#2c2600', 25: '#443c00', 70: '#bcae4e', 75: '#cdbe59', 85: '#eedf75', 90: '#fdee8c'},
},
teal: {
@@ -40,6 +40,7 @@ export const butterPaletteRefs = {
},
accent: {
light: {35: '#194ce8', 40: '#225bff', 55: '#4d82ff'},
+ dark: {70: '#81a9ff'},
},
cyan: {
light: {25: '#004649', 80: '#8dd2d3', 90: '#a9eff0'},
diff --git a/packages/themes/butter/src/butterTheme.test.ts b/packages/themes/butter/src/butterTheme.test.ts
index 5529c84b11..8c8e4cc8c6 100644
--- a/packages/themes/butter/src/butterTheme.test.ts
+++ b/packages/themes/butter/src/butterTheme.test.ts
@@ -58,6 +58,39 @@ describe('butter touch + narrow type pin', () => {
});
});
+describe('butter input status roles', () => {
+ it('keeps bright per-input status rims and glyphs on the border and icon roles', () => {
+ const inputs = [
+ 'text-input',
+ 'text-area',
+ 'number-input',
+ 'date-input',
+ 'time-input',
+ 'selector',
+ 'multi-selector',
+ 'typeahead',
+ 'tokenizer',
+ ];
+
+ const {green, red, yellow} = butterModePalettes;
+ for (const input of inputs) {
+ const component = butterTheme.components![input];
+ expect(component['status:success']).toMatchObject({
+ '--color-border-success': `light-dark(${green.light[55]}, ${green.light[70]})`,
+ '--color-icon-success': `light-dark(${green.light[55]}, ${green.light[70]})`,
+ });
+ expect(component['status:warning']).toMatchObject({
+ '--color-border-warning': `light-dark(${yellow.light[55]}, ${yellow.light[80]})`,
+ '--color-icon-warning': `light-dark(${yellow.light[55]}, ${yellow.light[80]})`,
+ });
+ expect(component['status:error']).toMatchObject({
+ '--color-border-error': red.light[60],
+ '--color-icon-error': red.light[60],
+ });
+ }
+ });
+});
+
describe('butter secondary ComplexSelector', () => {
it('keeps the hover fill off a disabled trigger in either form', () => {
expect(generateThemeCSS(butterTheme).component).toMatch(
@@ -125,16 +158,12 @@ describe('butter color token mapping completeness', () => {
});
expect(butterTheme.components?.banner).toMatchObject({
'status:info': {
- '--color-accent-muted': accent.light[55],
- '--color-text-primary': neutral.light[15],
- '--color-text-secondary': neutral.light[15],
- '--color-accent': neutral.light[15],
+ '--color-info-muted': accent.light[55],
+ '--color-on-info-muted': neutral.light[15],
},
'status:error': {
'--color-error-muted': red.light[60],
- '--color-text-primary': neutral.light[15],
- '--color-text-secondary': neutral.light[15],
- '--color-error': neutral.light[15],
+ '--color-on-error-muted': neutral.light[15],
},
});
expect(
diff --git a/packages/themes/butter/src/butterTheme.ts b/packages/themes/butter/src/butterTheme.ts
index 6019ed7469..7a0a5fd6d8 100644
--- a/packages/themes/butter/src/butterTheme.ts
+++ b/packages/themes/butter/src/butterTheme.ts
@@ -107,6 +107,25 @@ const SECONDARY_COMPLEX_SELECTOR = {
SECONDARY_BUTTON[':hover'],
} as const;
+/**
+ * Butter's bright status rims and glyphs in input status scopes. Light mode
+ * uses mid-ramp stops so a rim reaches 3:1 on the field (theme-tokens INV11).
+ */
+const INPUT_STATUS_VARS = {
+ 'status:success': {
+ '--color-border-success': lightDark(green.light[55], green.light[70]),
+ '--color-icon-success': lightDark(green.light[55], green.light[70]),
+ },
+ 'status:warning': {
+ '--color-border-warning': lightDark(yellow.light[55], yellow.light[80]),
+ '--color-icon-warning': lightDark(yellow.light[55], yellow.light[80]),
+ },
+ 'status:error': {
+ '--color-border-error': red.light[60],
+ '--color-icon-error': red.light[60],
+ },
+} as const;
+
export const butterTheme = defineTheme({
name: 'butter',
@@ -187,6 +206,19 @@ export const butterTheme = defineTheme({
'--color-on-error': [red.light[95], red.dark[15]],
'--color-on-warning': [yellow.light[95], yellow.dark[15]],
+ // Info is its own blue status, independent of the accent.
+ '--color-info': [accent.light[40], accent.dark[70]],
+ '--color-info-muted': 'var(--color-background-blue)',
+
+ '--color-text-info': [accent.light[40], accent.dark[70]],
+ '--color-text-success': [green.light[25], green.dark[80]],
+ '--color-text-warning': [yellow.light[25], yellow.dark[85]],
+ '--color-text-error': [red.light[25], red.dark[80]],
+ '--color-on-info-muted': 'var(--color-text-blue)',
+ '--color-on-success-muted': [green.light[25], green.dark[80]],
+ '--color-on-warning-muted': [yellow.light[25], yellow.dark[85]],
+ '--color-on-error-muted': [red.light[25], red.dark[90]],
+
// Icon
'--color-icon-accent': [accent.light[40], yellow.dark[90]],
'--color-icon-primary': [neutral.light[15], neutral.dark[90]],
@@ -410,34 +442,23 @@ export const butterTheme = defineTheme({
},
},
- // Banner backgrounds match the semantic badge fills.
- // Banner status colors — override the muted tokens locally so the
- // header (which reads --color-*-muted via StyleX) renders vivid fills
- // matching the badge palette. Scoped to the banner root, doesn't leak.
+ // Banner status surfaces and content use the reviewed vivid pair.
banner: {
'status:info': {
- '--color-accent-muted': accent.light[55],
- '--color-text-primary': neutral.light[15],
- '--color-text-secondary': neutral.light[15],
- '--color-accent': neutral.light[15],
+ '--color-info-muted': accent.light[55],
+ '--color-on-info-muted': neutral.light[15],
},
'status:success': {
'--color-success-muted': green.light[70],
- '--color-text-primary': neutral.light[15],
- '--color-text-secondary': neutral.light[15],
- '--color-success': neutral.light[15],
+ '--color-on-success-muted': neutral.light[15],
},
'status:warning': {
'--color-warning-muted': yellow.light[80],
- '--color-text-primary': neutral.light[15],
- '--color-text-secondary': neutral.light[15],
- '--color-warning': neutral.light[15],
+ '--color-on-warning-muted': neutral.light[15],
},
'status:error': {
'--color-error-muted': red.light[60],
- '--color-text-primary': neutral.light[15],
- '--color-text-secondary': neutral.light[15],
- '--color-error': neutral.light[15],
+ '--color-on-error-muted': neutral.light[15],
},
},
@@ -561,9 +582,7 @@ export const butterTheme = defineTheme({
paddingInline: 'var(--spacing-3)',
borderColor: 'var(--color-border)',
},
- 'status:success': {'--color-success': green.light[70]},
- 'status:warning': {'--color-warning': yellow.light[80]},
- 'status:error': {'--color-error': red.light[60]},
+ ...INPUT_STATUS_VARS,
},
'text-area': {
base: {
@@ -571,9 +590,7 @@ export const butterTheme = defineTheme({
paddingInline: 'var(--spacing-3)',
borderColor: 'var(--color-border)',
},
- 'status:success': {'--color-success': green.light[70]},
- 'status:warning': {'--color-warning': yellow.light[80]},
- 'status:error': {'--color-error': red.light[60]},
+ ...INPUT_STATUS_VARS,
},
'number-input': {
base: {
@@ -581,9 +598,7 @@ export const butterTheme = defineTheme({
paddingInline: 'var(--spacing-3)',
borderColor: 'var(--color-border)',
},
- 'status:success': {'--color-success': green.light[70]},
- 'status:warning': {'--color-warning': yellow.light[80]},
- 'status:error': {'--color-error': red.light[60]},
+ ...INPUT_STATUS_VARS,
},
'date-input': {
base: {
@@ -591,9 +606,7 @@ export const butterTheme = defineTheme({
paddingInline: 'var(--spacing-3)',
borderColor: 'var(--color-border)',
},
- 'status:success': {'--color-success': green.light[70]},
- 'status:warning': {'--color-warning': yellow.light[80]},
- 'status:error': {'--color-error': red.light[60]},
+ ...INPUT_STATUS_VARS,
},
'time-input': {
base: {
@@ -601,9 +614,7 @@ export const butterTheme = defineTheme({
paddingInline: 'var(--spacing-3)',
borderColor: 'var(--color-border)',
},
- 'status:success': {'--color-success': green.light[70]},
- 'status:warning': {'--color-warning': yellow.light[80]},
- 'status:error': {'--color-error': red.light[60]},
+ ...INPUT_STATUS_VARS,
},
selector: {
base: {
@@ -611,9 +622,7 @@ export const butterTheme = defineTheme({
paddingInline: 'var(--spacing-3)',
borderColor: 'var(--color-border)',
},
- 'status:success': {'--color-success': green.light[70]},
- 'status:warning': {'--color-warning': yellow.light[80]},
- 'status:error': {'--color-error': red.light[60]},
+ ...INPUT_STATUS_VARS,
'variant:secondary': SECONDARY_SELECTOR,
},
'multi-selector': {
@@ -622,9 +631,7 @@ export const butterTheme = defineTheme({
paddingInline: 'var(--spacing-3)',
borderColor: 'var(--color-border)',
},
- 'status:success': {'--color-success': green.light[70]},
- 'status:warning': {'--color-warning': yellow.light[80]},
- 'status:error': {'--color-error': red.light[60]},
+ ...INPUT_STATUS_VARS,
'variant:secondary': SECONDARY_SELECTOR,
},
'complex-selector': {'variant:secondary': SECONDARY_COMPLEX_SELECTOR},
@@ -634,9 +641,7 @@ export const butterTheme = defineTheme({
paddingInline: 'var(--spacing-3)',
borderColor: 'var(--color-border)',
},
- 'status:success': {'--color-success': green.light[70]},
- 'status:warning': {'--color-warning': yellow.light[80]},
- 'status:error': {'--color-error': red.light[60]},
+ ...INPUT_STATUS_VARS,
},
tokenizer: {
base: {
@@ -644,9 +649,7 @@ export const butterTheme = defineTheme({
paddingInline: 'var(--spacing-3)',
borderColor: 'var(--color-border)',
},
- 'status:success': {'--color-success': green.light[70]},
- 'status:warning': {'--color-warning': yellow.light[80]},
- 'status:error': {'--color-error': red.light[60]},
+ ...INPUT_STATUS_VARS,
},
// Display sizes use Sarina — the signature buttery display
diff --git a/packages/themes/chocolate/src/chocolateTheme.ts b/packages/themes/chocolate/src/chocolateTheme.ts
index e7ef8fdf5e..8fd976afff 100644
--- a/packages/themes/chocolate/src/chocolateTheme.ts
+++ b/packages/themes/chocolate/src/chocolateTheme.ts
@@ -120,10 +120,23 @@ export const chocolateTheme = defineTheme({
'--color-on-dark': '#FFFCF7',
'--color-on-light': '#4a3520',
'--color-on-accent': ['#FFFFFF', '#4a3520'],
- '--color-on-success': ['#FFFFFF', '#4a3520'],
- '--color-on-error': ['#FFFFFF', '#4a3520'],
+ '--color-on-success': '#141010',
+ '--color-on-error': '#141010',
'--color-on-warning': ['#4a3520', '#4a3520'],
+ // Info is its own blue status, independent of the accent.
+ '--color-info': ['#3a5e8c', '#7ba8d4'],
+ '--color-info-muted': 'var(--color-background-blue)',
+
+ '--color-text-info': ['#2e4a6e', '#8dbce0'],
+ '--color-text-success': ['#526f00', '#a8d43a'],
+ '--color-text-warning': ['#7a5500', '#ffd960'],
+ '--color-text-error': ['#cc0000', '#ff7a7a'],
+ '--color-on-info-muted': ['#2e4a6e', '#8dbce0'],
+ '--color-on-success-muted': ['#4d6800', '#a8d43a'],
+ '--color-on-warning-muted': ['#7a5500', '#ffd960'],
+ '--color-on-error-muted': ['#b40000', '#ff7a7a'],
+
// Icon
'--color-icon-accent': ['#8C5927', '#d4a06a'],
'--color-icon-primary': ['#4a3520', '#EDE4D4'],
diff --git a/packages/themes/gothic/src/gothicTheme.ts b/packages/themes/gothic/src/gothicTheme.ts
index 96c0719972..5ae07cf979 100644
--- a/packages/themes/gothic/src/gothicTheme.ts
+++ b/packages/themes/gothic/src/gothicTheme.ts
@@ -135,6 +135,19 @@ export const gothicTheme = defineTheme({
'--color-on-error': neutral.dark[10],
'--color-on-warning': neutral.dark[10],
+ '--color-info': blue.dark[65],
+ '--color-info-muted': blue.dark[75],
+ '--color-on-info': neutral.dark[10],
+
+ '--color-text-info': blue.dark[75],
+ '--color-text-success': green.dark[75],
+ '--color-text-warning': yellow.dark[75],
+ '--color-text-error': red.dark[75],
+ '--color-on-info-muted': blue.dark[20],
+ '--color-on-success-muted': green.dark[20],
+ '--color-on-warning-muted': yellow.dark[15],
+ '--color-on-error-muted': red.dark[20],
+
'--color-icon-accent': neutral.dark[95],
'--color-icon-primary': neutral.dark[95],
'--color-icon-secondary': neutral.dark[75],
@@ -286,28 +299,20 @@ export const gothicTheme = defineTheme({
borderRadius: 'var(--radius-element)',
},
'status:info': {
- backgroundColor: 'var(--color-background-blue)',
- '--color-text-primary': 'var(--color-text-blue)',
- '--color-text-secondary': 'var(--color-text-blue)',
- '--color-accent': 'var(--color-text-blue)',
+ '--color-info-muted': 'var(--color-background-blue)',
+ '--color-on-info-muted': 'var(--color-text-blue)',
},
'status:success': {
- backgroundColor: 'var(--color-background-green)',
- '--color-text-primary': 'var(--color-text-green)',
- '--color-text-secondary': 'var(--color-text-green)',
- '--color-success': 'var(--color-text-green)',
+ '--color-success-muted': 'var(--color-background-green)',
+ '--color-on-success-muted': 'var(--color-text-green)',
},
'status:warning': {
- backgroundColor: 'var(--color-background-yellow)',
- '--color-text-primary': 'var(--color-text-yellow)',
- '--color-text-secondary': 'var(--color-text-yellow)',
- '--color-warning': 'var(--color-text-yellow)',
+ '--color-warning-muted': 'var(--color-background-yellow)',
+ '--color-on-warning-muted': 'var(--color-text-yellow)',
},
'status:error': {
- backgroundColor: 'var(--color-background-red)',
- '--color-text-primary': 'var(--color-text-red)',
- '--color-text-secondary': 'var(--color-text-red)',
- '--color-error': 'var(--color-text-red)',
+ '--color-error-muted': 'var(--color-background-red)',
+ '--color-on-error-muted': 'var(--color-text-red)',
},
},
diff --git a/packages/themes/matcha/matcha.spec.md b/packages/themes/matcha/matcha.spec.md
index 0a84bda88a..8f01b5548e 100644
--- a/packages/themes/matcha/matcha.spec.md
+++ b/packages/themes/matcha/matcha.spec.md
@@ -88,19 +88,11 @@ Known normal-text exceptions in the maintained mappings are:
- light secondary body text at 16px is 3.83:1 on the body; typographic role and
placement distinguish it from primary content;
-- light Banner descriptions at 13px over a white surface or card are 3.89:1
- for info, 3.83:1 for success, 4.10:1 for warning, and 3.54:1 for error. Over
- the light body `#f0f0e0`, the same translucent fills produce 3.39:1, 3.37:1,
- 3.63:1, and 3.11:1 respectively. The status icon, title, and written
- description identify each state independently of color;
-- success Badge labels at 13px are 3.58:1 light and 4.25:1 dark; the label and
- solid semantic fill identify the state;
-- error Badge labels at 13px and destructive Button labels at 16px are 4.06:1
- light and 3.23:1 dark; the written action or status, component shape, and
- error fill are independent cues;
-- light warning FieldStatus text at 13px is 2.52:1 when its translucent fill is
- composited over white and 2.23:1 over the light body `#f0f0e0`; its warning
- icon and message text identify the state;
+- light success, warning, and error Banner descriptions and FieldStatus text are
+ 4.58:1, 5.01:1, and 4.73:1 when their translucent fills are composited over
+ white. Over the light body `#f0f0e0`, the same pairs are 4.03:1, 4.42:1, and
+ 4.14:1. The status icon, title, and written description identify each state
+ independently of color;
- light Green, Orange, Pink, Red, and Yellow categorical text is respectively
4.21:1, 4.03:1, 4.94:1, 4.14:1, and 2.41:1 when each translucent tint is
composited over white. Over the light body `#f0f0e0`, the same pairs are
diff --git a/packages/themes/matcha/src/matchaPaletteRefs.generated.ts b/packages/themes/matcha/src/matchaPaletteRefs.generated.ts
index 9bb4bb5e9b..6993f9d2f9 100644
--- a/packages/themes/matcha/src/matchaPaletteRefs.generated.ts
+++ b/packages/themes/matcha/src/matchaPaletteRefs.generated.ts
@@ -20,7 +20,7 @@ export const matchaPaletteRefs = {
},
blue: {
light: {35: '#2e4a6e', 50: '#3a5e8c'},
- dark: {50: '#3a5e8c', 70: '#7ba8d4', 75: '#8dbce0'},
+ dark: {50: '#3a5e8c', 70: '#7ba8d4', 75: '#8dbce0', 80: '#a7c9e3'},
},
purple: {
light: {35: '#553a70', 50: '#6b4a8c'},
diff --git a/packages/themes/matcha/src/matchaTheme.ts b/packages/themes/matcha/src/matchaTheme.ts
index c30ac32496..073a678179 100644
--- a/packages/themes/matcha/src/matchaTheme.ts
+++ b/packages/themes/matcha/src/matchaTheme.ts
@@ -103,10 +103,23 @@ export const matchaTheme = defineTheme({
'--color-on-dark': neutral.light[100],
'--color-on-light': neutral.light[20],
'--color-on-accent': [neutral.light[100], neutral.dark[20]],
- '--color-on-success': [neutral.light[100], neutral.dark[20]],
- '--color-on-error': [neutral.light[100], neutral.dark[20]],
+ '--color-on-success': neutral.dark[5],
+ '--color-on-error': neutral.dark[5],
'--color-on-warning': [neutral.light[20], neutral.dark[20]],
+ // Info is its own blue status, independent of the accent.
+ '--color-info': [blue.light[50], blue.dark[80]],
+ '--color-info-muted': 'var(--color-background-blue)',
+
+ '--color-text-info': [blue.light[35], blue.dark[75]],
+ '--color-text-success': [green.light[35], green.dark[75]],
+ '--color-text-warning': [yellow.light[45], yellow.dark[90]],
+ '--color-text-error': [red.light[35], red.dark[75]],
+ '--color-on-info-muted': [blue.light[35], blue.dark[75]],
+ '--color-on-success-muted': [green.light[35], green.dark[75]],
+ '--color-on-warning-muted': [yellow.light[45], yellow.dark[90]],
+ '--color-on-error-muted': [red.light[35], red.dark[75]],
+
// Icon
'--color-icon-accent': [neutral.light[20], neutral.dark[75]],
'--color-icon-primary': [neutral.light[20], neutral.dark[75]],
diff --git a/packages/themes/neutral/neutral.spec.md b/packages/themes/neutral/neutral.spec.md
index a42f93dcba..0b61f05499 100644
--- a/packages/themes/neutral/neutral.spec.md
+++ b/packages/themes/neutral/neutral.spec.md
@@ -5,7 +5,7 @@ kind: theme
id: theme:neutral
authority: current
approved_by: rubyycheung
-approved_at: 2026-09-04
+approved_at: 2026-10-17
review_triggers:
[tokens, palette-values, component-mappings, contrast, artifacts]
verified_by: [scripts/check-badge-contrast.test.mjs]
@@ -53,49 +53,17 @@ vocabulary remains owned by `architecture:theme-tokens`.
## Theme-local role definitions
-Neutral's candidate implementation owns the approved accent role and proposes
-the related roles below for exact-head review:
-
-| Exact name | Neutral-only meaning | Proposed value | Status |
-| ------------------------------------------------------ | --------------------------------------------------- | ---------------------------- | -------- |
-| `--astryx-theme-neutral-color-status-fill-accent` | Filled accent status | `['#0074e2', '#6d9cfe']` | Approved |
-| `--astryx-theme-neutral-color-status-fill-success` | Filled success status | `['#198100', '#64af4c']` | Proposed |
-| `--astryx-theme-neutral-color-status-fill-warning` | Filled warning status | `'#ffce2f'` | Proposed |
-| `--astryx-theme-neutral-color-status-fill-error` | Filled error status | `['#c9303a', '#ff705d']` | Proposed |
-| `--astryx-theme-neutral-color-on-tint-neutral` | Neutral content placed on a semantic tinted surface | `['#fafafa4D', '#0a0a0a4D']` | Proposed |
-| `--astryx-theme-neutral-color-on-tint-overlay-hover` | Hover overlay placed on a semantic tinted surface | `['#fafafa1A', '#0a0a0a1A']` | Proposed |
-| `--astryx-theme-neutral-color-on-tint-overlay-pressed` | Pressed overlay placed on a semantic tinted surface | `['#fafafa33', '#0a0a0a33']` | Proposed |
-
-AST-006 is current and accepted, and its implementation is proposed separately
-in the parent local-token PR. This stacked candidate authors and consumes exact
-names without aliases:
-
-```ts
-localTokens: {
- '--astryx-theme-neutral-color-status-fill-accent': ['#0074e2', '#6d9cfe'],
-},
-components: {
- badge: {
- 'variant:info': {
- backgroundColor:
- 'var(--astryx-theme-neutral-color-status-fill-accent)',
- },
- },
-},
-```
-
-The `localTokens` key, component `var(...)` reference, `DefinedTheme` map, and
-emitted custom property use the same complete name. The proposed value prefers
-the approved `[light, dark]` `TokenValue` tuple, which normalizes exactly as the
-same tuple does under existing `tokens`. Opt-in uses Neutral's existing
-`name: 'neutral'` byte-for-byte; it is already a valid stable lower-kebab
-identifier, so no name normalization occurs.
-
-Once shipped, the exact name and filled-accent-status meaning are a public
-Neutral-family compatibility contract. The role is not portable to other themes
-and is not intended for Core component source. Its length is acceptable because
-it accurately names the context in which it may be applied; output alone does
-not authorize a broader meaning.
+Neutral emits one theme-local role, kept as a compatibility contract for
+Neutral extensions. It is deprecated: Neutral paints every status through the
+portable `--color-*` roles and does not read it, and it keeps its exact name,
+meaning, and value:
+
+| Exact name | Neutral-only meaning | Value | Status |
+| ------------------------------------------------- | -------------------- | ------------------------ | ---------- |
+| `--astryx-theme-neutral-color-status-fill-accent` | Filled accent status | `['#0074e2', '#6d9cfe']` | Deprecated |
+
+Core components consume the portable `--color-*` semantic roles; no Core
+implementation or Neutral mapping depends on this alias.
## Tonal palette definitions
@@ -115,10 +83,17 @@ tone coordinates.
## Component and state mappings
-The candidate maps the shared status-fill roles across Badge, StatusDot,
-AvatarStatusDot, Stepper indicators, and ProgressBar wherever the existing state
-already has the same semantic meaning. Banner uses the proposed tint-content and
-interaction roles. Every mapping remains subject to exact-head theme review and
+Core components choose semantic roles by surface (`architecture:theme-tokens`
+INV11): strong fills use `--color-<status>` with `--color-on-<status>`, pale
+surfaces use `--color-<status>-muted` with `--color-on-<status>-muted`, and
+status text, icons, and borders on the default surfaces use `--color-text-*`,
+`--color-icon-*`, and `--color-border-*`. Neutral sets the portable status
+fills directly: `--color-info` `['#0074e2', '#6d9cfe']`, `--color-success`
+`['#198100', '#64af4c']`, `--color-warning` `'#ffce2f'`, and `--color-error`
+`['#c9303a', '#ff705d']`, the colours its Badges have always shown. Accent
+variants of ProgressBar, StatusDot, and Stepper indicators paint Neutral's
+accent, and Banner and the pale destructive Button use the portable overlay
+and neutral roles; Neutral adds no component override for any of them. Every new mapping needs exact-head theme review and
rendered light/dark evidence; shared color alone is not enough.
This work does not add component states. It intentionally excludes
@@ -204,20 +179,20 @@ remain subject to the specific approval gates stated in their decisions.
**Reference:** `theme:neutral/DEC-1`
**System-boundary decider:** `cixzhang`, `2026-08-31`
-**Final Neutral adoption decider:** `rubyycheung`, after OQ1 passes and exact-head review
+**Final Neutral adoption decider:** `rubyycheung`, `2026-10-17`
-Neutral owns theme-local definitions in this colocated theme spec. It may adopt
-`--astryx-theme-neutral-color-status-fill-accent` for filled accent status using
-its exact stable `name: 'neutral'`. The exact name and semantic meaning become a
-public Neutral-family compatibility contract when shipped, despite not being
-portable across themes or intended for Core component source. The long name is
-acceptable because it precisely states the role.
+Neutral owns theme-local definitions in this colocated theme spec.
+`--astryx-theme-neutral-color-status-fill-accent` represents filled accent
+status under the stable `name: 'neutral'`. Its exact name, meaning, and
+`['#0074e2', '#6d9cfe']` value are a public Neutral-family
+compatibility contract, despite not being portable across themes or consumed by
+Core.
The token may be applied only where the mapped context genuinely means filled
-accent status. Each added mapping is a theme-spec compatibility review and needs
-rendered evidence for its actual light/dark and relevant interaction states.
-Neither the proposed value nor any mapping is authorized until OQ1 passes and
-`rubyycheung` ratifies the exact record head.
+accent status. It is deprecated: Neutral itself maps no component to it and
+uses the portable status roles instead, and it stays defined for Neutral
+extensions. A new component mapping requires rendered light/dark evidence for
+its actual interaction states.
Rejected: treating the role as global, treating it as disposable private output,
or applying it merely because two contexts currently share a color.
@@ -266,9 +241,9 @@ changing semantic token mappings in the palette-value change.
**Decider:** `rubyycheung`, `2026-09-04`
Neutral's semantic, categorical, syntax, and color-bearing effect values use
-named palette-stop references when an approved match exists. Token names and
-meanings remain unchanged. Alpha variants derive from the referenced stop
-rather than duplicating its hex value.
+named palette-stop references when an approved match exists; the status fills,
+which keep explicit values, are recorded in DEC-6. Alpha
+variants derive from the referenced stop rather than duplicating its hex value.
The mapping is role-aware rather than a blind nearest-color conversion. Very
dark foregrounds preserve their darker role, ordinary backgrounds do not become
@@ -297,17 +272,41 @@ Rejected: importing the complete palette at runtime, maintaining a second manual
selection manifest, or treating token-mapping assertions as proof that copied
hex values still match the approved palette.
+### DEC-6 — Paint status through the portable roles, with no other local tokens
+
+**Reference:** `theme:neutral/DEC-6`
+
+**Decider:** `cixzhang`, `2026-10-25`
+
+Neutral paints status, tinted surfaces, and the pale destructive Button through
+the portable `--color-*` roles. It defines no local token for them other than
+the deprecated `--astryx-theme-neutral-color-status-fill-accent` of DEC-1.
+
+This is the `spec:AST-006` FR10 exception for nine local names that earlier
+Neutral releases emitted: `--astryx-theme-neutral-color-status-fill-success`,
+`-status-fill-warning`, `-status-fill-error`, `-status-muted-accent`,
+`-on-tint-neutral`, `-on-tint-overlay-hover`, `-on-tint-overlay-pressed`,
+`-destructive-overlay-hover`, and `-destructive-overlay-pressed`. None of them
+was a Neutral-family contract: this record listed the first three and the
+on-tint names as proposed roles that must not be treated as an approved public
+contract, and never documented the others. They therefore carry no alias. Their
+replacements are `--color-success`, `--color-warning`, and `--color-error` for
+the status fills, `--color-info-muted` for the pale accent surface,
+`--color-neutral` for on-tint content, and `--color-overlay-hover` and
+`--color-overlay-pressed` for the overlays.
+
+Neutral's `--color-success`, `--color-warning`, and `--color-error` are its
+strong status fills under `architecture:theme-tokens` INV11, set to the
+explicit colours its Badges have always shown, which no palette stop matches.
+Their Neutral values therefore change from the darker colours earlier releases
+used, which `--color-text-<status>` now carries for status text on the page.
+
+Rejected: keeping the nine as deprecated aliases, which would preserve names
+that were never promised and that Neutral no longer reads.
+
## Open questions
-- **OQ1 — Is rendered light/dark evidence complete for the proposed tuple and
- Badge mapping, and for every later mapping's relevant interaction states?**
- (`checkable`) Neutral promotion and implementation remain blocked until the
- actual pairings meet the applicable current contrast methodology, each mapped
- context is visibly verified, and `rubyycheung` ratifies that exact record head.
-- **OQ2 — Do the proposed success, warning, error, and tint roles have stable
- meanings across every listed component mapping?** (`checkable`) The additional
- names remain proposals until reviewers confirm each mapping represents the
- same semantic role rather than merely sharing a current color value.
+None.
## Content boundary
diff --git a/packages/themes/neutral/src/neutralPaletteRefs.generated.ts b/packages/themes/neutral/src/neutralPaletteRefs.generated.ts
index 5de468265b..54e673774e 100644
--- a/packages/themes/neutral/src/neutralPaletteRefs.generated.ts
+++ b/packages/themes/neutral/src/neutralPaletteRefs.generated.ts
@@ -23,15 +23,15 @@ export const neutralPaletteRefs = {
dark: {25: '#503424', 65: '#df843f', 80: '#ffb37e'},
},
blue: {
- light: {25: '#003978', 30: '#00458c', 50: '#0074e2', 80: '#a1caff', 85: '#b9d7ff'},
+ light: {25: '#003978', 30: '#00458c', 45: '#0067ce', 50: '#0074e2', 80: '#a1caff', 85: '#b9d7ff'},
dark: {25: '#253c5a', 65: '#5aa0f8', 75: '#88bcff', 80: '#a1caff'},
},
red: {
- light: {25: '#76000c', 30: '#8a0011', 55: '#de4745', 65: '#fa6762', 70: '#ff7f77', 80: '#ffaea7', 85: '#ffc4be'},
- dark: {25: '#5b2b28', 65: '#ee736c', 75: '#ff9890', 80: '#ffaea7', 85: '#ffc4be'},
+ light: {25: '#76000c', 30: '#8a0011', 45: '#c0262c', 55: '#de4745', 65: '#fa6762', 80: '#ffaea7', 85: '#ffc4be'},
+ dark: {25: '#5b2b28', 75: '#ff9890', 80: '#ffaea7'},
},
yellow: {
- light: {25: '#4b3900', 30: '#584400', 65: '#c29900', 75: '#e2b623', 80: '#eec448', 85: '#f8d36a'},
+ light: {25: '#4b3900', 30: '#584400', 45: '#836700', 65: '#c29900', 75: '#e2b623', 80: '#eec448', 85: '#f8d36a'},
dark: {25: '#453a1c', 80: '#e3c36c', 90: '#fae19e'},
},
teal: {
diff --git a/packages/themes/neutral/src/neutralTheme.test.ts b/packages/themes/neutral/src/neutralTheme.test.ts
index 12f542d465..44ce365282 100644
--- a/packages/themes/neutral/src/neutralTheme.test.ts
+++ b/packages/themes/neutral/src/neutralTheme.test.ts
@@ -24,13 +24,6 @@ function contrastRatio(foreground: string, background: string): number {
return (lighter + 0.05) / (darker + 0.05);
}
-const statusFill = {
- accent: 'var(--astryx-theme-neutral-color-status-fill-accent)',
- success: 'var(--astryx-theme-neutral-color-status-fill-success)',
- warning: 'var(--astryx-theme-neutral-color-status-fill-warning)',
- error: 'var(--astryx-theme-neutral-color-status-fill-error)',
-} as const;
-
const lightDark = (light: string, dark: string) =>
`light-dark(${light}, ${dark})`;
@@ -81,17 +74,50 @@ describe('neutral theme palette mappings', () => {
neutralPalettes.neutral.light[10],
neutralPalettes.neutral.dark[95],
),
- '--color-success': lightDark(
+ '--color-info': lightDark('#0074e2', '#6d9cfe'),
+ '--color-info-muted': lightDark(
+ neutralPalettes.blue.light[85],
+ `${neutralPalettes.blue.dark[75]}3D`,
+ ),
+ '--color-on-info': lightDark(
+ neutralPalettes.neutral.light[100],
+ neutralPalettes.neutral.dark[5],
+ ),
+ // Strong status fills: Neutral's released Badge fill colours.
+ '--color-success': lightDark('#198100', '#64af4c'),
+ '--color-warning': '#ffce2f',
+ '--color-error': lightDark('#c9303a', '#ff705d'),
+ '--color-text-info': lightDark(
+ neutralPalettes.blue.light[45],
+ neutralPalettes.blue.dark[80],
+ ),
+ '--color-text-success': lightDark(
+ neutralPalettes.green.light[45],
+ neutralPalettes.green.light[75],
+ ),
+ '--color-text-warning': lightDark(
+ neutralPalettes.yellow.light[45],
+ neutralPalettes.yellow.light[80],
+ ),
+ '--color-text-error': lightDark(
+ neutralPalettes.red.light[45],
+ neutralPalettes.red.dark[80],
+ ),
+ '--color-on-info-muted': lightDark(
+ neutralPalettes.blue.light[25],
+ neutralPalettes.blue.dark[80],
+ ),
+ '--color-on-success-muted': lightDark(
neutralPalettes.green.light[25],
- neutralPalettes.green.light[80],
+ neutralPalettes.green.light[75],
),
- '--color-warning': lightDark(
+ '--color-on-warning-muted': lightDark(
neutralPalettes.yellow.light[25],
- neutralPalettes.yellow.light[85],
+ neutralPalettes.yellow.light[80],
),
- '--color-error': lightDark(
+ '--color-on-error-muted': lightDark(
neutralPalettes.red.light[25],
- neutralPalettes.red.dark[85],
+ neutralPalettes.red.dark[80],
),
'--color-background-red': lightDark(
neutralPalettes.red.light[85],
@@ -291,106 +317,114 @@ describe('neutral syntax contrast', () => {
});
});
-describe('neutral theme-local status mappings', () => {
- it('preserves the independently approved component status fills', () => {
- expect(neutralTheme.localTokens).toMatchObject({
- '--astryx-theme-neutral-color-status-fill-accent':
- 'light-dark(#0074e2, #6d9cfe)',
- '--astryx-theme-neutral-color-status-fill-success':
- 'light-dark(#198100, #64af4c)',
- '--astryx-theme-neutral-color-status-fill-warning': '#ffce2f',
- '--astryx-theme-neutral-color-status-fill-error':
- 'light-dark(#c9303a, #ff705d)',
+describe('neutral semantic status roles', () => {
+ it('keeps public plain-surface and on-muted roles on reviewed palette stops', () => {
+ expect(neutralTheme.tokens).toMatchObject({
+ '--color-text-info': lightDark(
+ neutralPalettes.blue.light[45],
+ neutralPalettes.blue.dark[80],
+ ),
+ '--color-text-success': lightDark(
+ neutralPalettes.green.light[45],
+ neutralPalettes.green.light[75],
+ ),
+ '--color-text-warning': lightDark(
+ neutralPalettes.yellow.light[45],
+ neutralPalettes.yellow.light[80],
+ ),
+ '--color-text-error': lightDark(
+ neutralPalettes.red.light[45],
+ neutralPalettes.red.dark[80],
+ ),
+ '--color-on-info-muted': lightDark(
+ neutralPalettes.blue.light[25],
+ neutralPalettes.blue.dark[80],
+ ),
+ '--color-on-success-muted': lightDark(
+ neutralPalettes.green.light[25],
+ neutralPalettes.green.light[75],
+ ),
+ '--color-on-warning-muted': lightDark(
+ neutralPalettes.yellow.light[25],
+ neutralPalettes.yellow.light[80],
+ ),
+ '--color-on-error-muted': lightDark(
+ neutralPalettes.red.light[25],
+ neutralPalettes.red.dark[80],
+ ),
});
- expect(neutralTheme.tokens).not.toHaveProperty(
- '--astryx-theme-neutral-color-status-fill-accent',
+ expect(neutralTheme.localTokens).not.toHaveProperty(
+ '--astryx-theme-neutral-color-status-emphasized-info',
);
});
- it('shares each status fill across the components with the same role', () => {
- expect(neutralTheme.components?.badge?.['variant:info']).toMatchObject({
- backgroundColor: statusFill.accent,
+ it('keeps only the released accent local token, unused by Neutral itself', () => {
+ expect(neutralTheme.localTokens).toEqual({
+ '--astryx-theme-neutral-color-status-fill-accent': lightDark(
+ '#0074e2',
+ '#6d9cfe',
+ ),
});
- expect(
- neutralTheme.components?.['status-dot']?.['variant:success'],
- ).toEqual({
- backgroundColor: statusFill.success,
+ const css = JSON.stringify({
+ tokens: neutralTheme.tokens,
+ components: neutralTheme.components,
});
+ expect(css).not.toContain('--astryx-theme-neutral-');
+ });
+
+ it('uses public semantic roles on plain and pale surfaces while preserving fill roles', () => {
+ expect(neutralTheme.tokens).toMatchObject({
+ '--color-info': lightDark('#0074e2', '#6d9cfe'),
+ // Strong status fills: Neutral's released Badge fill colours.
+ '--color-success': lightDark('#198100', '#64af4c'),
+ '--color-warning': '#ffce2f',
+ '--color-error': lightDark('#c9303a', '#ff705d'),
+ });
+ expect(neutralTheme.components).not.toHaveProperty('icon');
+ expect(neutralTheme.components).not.toHaveProperty('text-input');
+ expect(neutralTheme.components).not.toHaveProperty('text-area-counter');
+ expect(neutralTheme.components?.badge).not.toHaveProperty('variant:info');
+ // Status and accent variants read the portable roles, not overrides.
+ expect(neutralTheme.components).not.toHaveProperty('status-dot');
+ expect(neutralTheme.components).not.toHaveProperty('step-indicator');
+ expect(neutralTheme.components).not.toHaveProperty('avatar-status-dot');
+ expect(neutralTheme.components?.['progress-bar']).not.toHaveProperty(
+ 'variant:accent',
+ );
expect(
- neutralTheme.components?.['avatar-status-dot']?.['variant:error'],
- ).toEqual({backgroundColor: statusFill.error});
- expect(
- neutralTheme.components?.['step-indicator']?.['status:warning'],
- ).toEqual({'--color-warning': statusFill.warning});
- expect(
- neutralTheme.components?.['progress-bar']?.['variant:accent'],
- ).toEqual({
- '--color-accent': statusFill.accent,
+ neutralTheme.components?.button?.['variant:destructive'],
+ ).toMatchObject({
+ backgroundColor: 'var(--color-error-muted)',
+ color: 'var(--color-on-error-muted)',
});
});
+ it('keeps plain-surface status roles at their required contrast on the page background in light mode', () => {
+ const surface = neutralPalettes.neutral.light[95];
+ for (const foreground of [
+ neutralPalettes.blue.light[45],
+ neutralPalettes.green.light[45],
+ neutralPalettes.yellow.light[45],
+ neutralPalettes.red.light[45],
+ ]) {
+ expect(contrastRatio(foreground, surface)).toBeGreaterThanOrEqual(4.5);
+ }
+ });
+
it('does not adopt the unapproved table row-status target', () => {
expect(neutralTheme.components).not.toHaveProperty('table-row-status');
});
});
-describe('neutral Banner tint mappings', () => {
- it('uses a dedicated muted info surface without changing categorical blue', () => {
- const mutedAccent = 'var(--astryx-theme-neutral-color-status-muted-accent)';
- expect(neutralTheme.localTokens).toMatchObject({
- '--astryx-theme-neutral-color-status-muted-accent': lightDark(
- neutralPalettes.blue.light[85],
- `${neutralPalettes.blue.dark[75]}3D`,
- ),
- });
- expect(neutralTheme.components?.banner?.['status:info']).toMatchObject({
- '--color-accent-muted': mutedAccent,
- });
+describe('neutral Banner and destructive Button', () => {
+ it('paint with the portable roles and no Neutral-only overrides', () => {
+ expect(neutralTheme.components).not.toHaveProperty('banner');
expect(neutralTheme.tokens['--color-background-blue']).toBe(
lightDark(neutralPalettes.blue.light[85], neutralPalettes.blue.dark[25]),
);
- });
-
- it('keeps the error background on the semantic muted token', () => {
- expect(
- neutralTheme.components?.banner?.['status:error'],
- ).not.toHaveProperty('--color-error-muted');
- });
-
- it('uses light overlays in light mode and dark overlays in dark mode', () => {
- expect(neutralTheme.localTokens).toMatchObject({
- '--astryx-theme-neutral-color-on-tint-neutral':
- 'light-dark(#fafafa4D, #0a0a0a4D)',
- '--astryx-theme-neutral-color-on-tint-overlay-hover':
- 'light-dark(#fafafa1A, #0a0a0a1A)',
- '--astryx-theme-neutral-color-on-tint-overlay-pressed':
- 'light-dark(#fafafa33, #0a0a0a33)',
- });
- expect(neutralTheme.components?.banner?.base).toMatchObject({
- '--color-neutral': 'var(--astryx-theme-neutral-color-on-tint-neutral)',
- '--color-overlay-hover':
- 'var(--astryx-theme-neutral-color-on-tint-overlay-hover)',
- '--color-overlay-pressed':
- 'var(--astryx-theme-neutral-color-on-tint-overlay-pressed)',
- });
- });
-});
-
-describe('neutral destructive Button interaction treatment', () => {
- it('uses component-scoped red palette overlays', () => {
- expect(neutralTheme.localTokens).toMatchObject({
- '--astryx-theme-neutral-color-destructive-overlay-hover':
- 'light-dark(#ff7f770D, #ee736c0D)',
- '--astryx-theme-neutral-color-destructive-overlay-pressed':
- 'light-dark(#ff7f771A, #ee736c1A)',
- });
- expect(
- neutralTheme.components?.button?.['variant:destructive'],
- ).toMatchObject({
- '--color-overlay-hover':
- 'var(--astryx-theme-neutral-color-destructive-overlay-hover)',
- '--color-overlay-pressed':
- 'var(--astryx-theme-neutral-color-destructive-overlay-pressed)',
+ expect(neutralTheme.components?.button?.['variant:destructive']).toEqual({
+ backgroundColor: 'var(--color-error-muted)',
+ color: 'var(--color-on-error-muted)',
});
});
});
diff --git a/packages/themes/neutral/src/neutralTheme.ts b/packages/themes/neutral/src/neutralTheme.ts
index 57c7778bdd..ba07f2c263 100644
--- a/packages/themes/neutral/src/neutralTheme.ts
+++ b/packages/themes/neutral/src/neutralTheme.ts
@@ -33,40 +33,12 @@ const neutralSyntax = defineSyntaxTheme({
});
const neutralLocalTokens: Record<string, TokenValue> = {
+ // Deprecated: kept with its released name, meaning, and value for Neutral
+ // extensions (theme:neutral DEC-1); Neutral itself paints status through the
+ // portable --color-* roles and no longer reads it.
'--astryx-theme-neutral-color-status-fill-accent': ['#0074e2', '#6d9cfe'],
- '--astryx-theme-neutral-color-status-fill-success': ['#198100', '#64af4c'],
- '--astryx-theme-neutral-color-status-fill-warning': '#ffce2f',
- '--astryx-theme-neutral-color-status-fill-error': ['#c9303a', '#ff705d'],
- '--astryx-theme-neutral-color-status-muted-accent': [
- blue.light[85],
- withAlpha(blue.dark[75], '3D'),
- ],
- '--astryx-theme-neutral-color-on-tint-neutral': ['#fafafa4D', '#0a0a0a4D'],
- '--astryx-theme-neutral-color-on-tint-overlay-hover': [
- '#fafafa1A',
- '#0a0a0a1A',
- ],
- '--astryx-theme-neutral-color-on-tint-overlay-pressed': [
- '#fafafa33',
- '#0a0a0a33',
- ],
- '--astryx-theme-neutral-color-destructive-overlay-hover': [
- withAlpha(red.light[70], '0D'),
- withAlpha(red.dark[65], '0D'),
- ],
- '--astryx-theme-neutral-color-destructive-overlay-pressed': [
- withAlpha(red.light[70], '1A'),
- withAlpha(red.dark[65], '1A'),
- ],
};
-const statusFill = {
- accent: 'var(--astryx-theme-neutral-color-status-fill-accent)',
- success: 'var(--astryx-theme-neutral-color-status-fill-success)',
- warning: 'var(--astryx-theme-neutral-color-status-fill-warning)',
- error: 'var(--astryx-theme-neutral-color-status-fill-error)',
-} as const;
-
export const neutralTheme = defineTheme({
name: 'neutral',
localTokens: neutralLocalTokens,
@@ -154,15 +126,31 @@ export const neutralTheme = defineTheme({
'--color-on-error': [neutral.light[100], neutral.dark[5]],
'--color-on-warning': neutral.light[5],
+ '--color-info': ['#0074e2', '#6d9cfe'],
+ '--color-info-muted': [blue.light[85], withAlpha(blue.dark[75], '3D')],
+ '--color-on-info': [neutral.light[100], neutral.dark[5]],
+
+ '--color-text-info': [blue.light[45], blue.dark[80]],
+ '--color-text-success': [green.light[45], green.light[75]],
+ '--color-text-warning': [yellow.light[45], yellow.light[80]],
+ '--color-text-error': [red.light[45], red.dark[80]],
+
+ '--color-on-info-muted': [blue.light[25], blue.dark[80]],
+ '--color-on-success-muted': [green.light[25], green.light[75]],
+ '--color-on-warning-muted': [yellow.light[25], yellow.light[80]],
+ '--color-on-error-muted': [red.light[25], red.dark[80]],
+
// Icon
'--color-icon-accent': [neutral.light[10], neutral.dark[95]],
'--color-icon-primary': [neutral.light[0], neutral.dark[100]],
'--color-icon-secondary': [neutral.light[45], neutral.dark[65]],
'--color-icon-disabled': [neutral.light[60], neutral.dark[35]],
- '--color-success': [green.light[25], green.light[80]],
- '--color-error': [red.light[25], red.dark[85]],
- '--color-warning': [yellow.light[25], yellow.light[85]],
+ // Strong status fills (architecture:theme-tokens INV11): Neutral's
+ // reviewed status-fill colours, with --color-on-<status> above.
+ '--color-success': ['#198100', '#64af4c'],
+ '--color-warning': '#ffce2f',
+ '--color-error': ['#c9303a', '#ff705d'],
'--color-success-muted': [green.dark[85], withAlpha(green.light[75], '3D')],
'--color-error-muted': [red.light[85], withAlpha(red.dark[75], '3D')],
'--color-warning-muted': [
@@ -182,7 +170,7 @@ export const neutralTheme = defineTheme({
withAlpha(neutral.light[0], '1A'),
withAlpha(neutral.dark[0], '4D'),
],
- '--color-tint-hover': ['black', 'white'],
+ '--color-tint-hover': [neutral.light[0], neutral.dark[100]],
'--color-background-red': [red.light[85], red.dark[25]],
'--color-border-red': [red.light[80], red.light[65]],
@@ -288,35 +276,15 @@ export const neutralTheme = defineTheme({
button: {
'variant:destructive': {
backgroundColor: 'var(--color-error-muted)',
- color: 'var(--color-error)',
- '--color-overlay-hover':
- 'var(--astryx-theme-neutral-color-destructive-overlay-hover)',
- '--color-overlay-pressed':
- 'var(--astryx-theme-neutral-color-destructive-overlay-pressed)',
+ color: 'var(--color-on-error-muted)',
},
},
badge: {
- 'variant:info': {
- backgroundColor: statusFill.accent,
- color: 'var(--color-on-accent)',
- },
'variant:neutral': {
backgroundColor: 'var(--color-background-gray)',
color: 'var(--color-text-gray)',
},
- 'variant:success': {
- backgroundColor: statusFill.success,
- color: 'var(--color-on-success)',
- },
- 'variant:warning': {
- backgroundColor: statusFill.warning,
- color: 'var(--color-on-warning)',
- },
- 'variant:error': {
- backgroundColor: statusFill.error,
- color: 'var(--color-on-error)',
- },
'variant:red': {
backgroundColor: 'var(--color-background-red)',
@@ -360,18 +328,6 @@ export const neutralTheme = defineTheme({
},
},
- 'status-dot': {
- 'variant:success': {backgroundColor: statusFill.success},
- 'variant:warning': {backgroundColor: statusFill.warning},
- 'variant:error': {backgroundColor: statusFill.error},
- 'variant:accent': {backgroundColor: statusFill.accent},
- },
-
- 'avatar-status-dot': {
- 'variant:success': {backgroundColor: statusFill.success},
- 'variant:error': {backgroundColor: statusFill.error},
- },
-
// Give the Neutral segmented control a roomier inset without changing its
// outside height. The selected item stays flat against the tinted track.
'segmented-control': {
@@ -394,45 +350,6 @@ export const neutralTheme = defineTheme({
},
},
- banner: {
- base: {
- '--color-neutral': 'var(--astryx-theme-neutral-color-on-tint-neutral)',
- '--color-overlay-hover':
- 'var(--astryx-theme-neutral-color-on-tint-overlay-hover)',
- '--color-overlay-pressed':
- 'var(--astryx-theme-neutral-color-on-tint-overlay-pressed)',
- },
- 'status:info': {
- '--color-accent-muted':
- 'var(--astryx-theme-neutral-color-status-muted-accent)',
- '--color-text-primary': 'var(--color-text-blue)',
- '--color-text-secondary': 'var(--color-text-blue)',
- '--color-accent': 'var(--color-text-blue)',
- },
- 'status:success': {
- '--color-text-primary': 'var(--color-text-green)',
- '--color-text-secondary': 'var(--color-text-green)',
- '--color-success': 'var(--color-text-green)',
- },
- 'status:warning': {
- '--color-text-primary': 'var(--color-text-yellow)',
- '--color-text-secondary': 'var(--color-text-yellow)',
- '--color-warning': 'var(--color-text-yellow)',
- },
- 'status:error': {
- '--color-text-primary': 'var(--color-text-red)',
- '--color-text-secondary': 'var(--color-text-red)',
- '--color-error': 'var(--color-text-red)',
- },
- },
-
- 'step-indicator': {
- 'status:accent': {'--color-accent': statusFill.accent},
- 'status:success': {'--color-success': statusFill.success},
- 'status:warning': {'--color-warning': statusFill.warning},
- 'status:error': {'--color-error': statusFill.error},
- },
-
switch: {
base: {
'--color-background-gray': 'var(--color-border-emphasized)',
@@ -443,18 +360,6 @@ export const neutralTheme = defineTheme({
base: {
'--color-background-muted': 'var(--color-border-emphasized)',
},
- 'variant:accent': {
- '--color-accent': statusFill.accent,
- },
- 'variant:success': {
- '--color-success': statusFill.success,
- },
- 'variant:warning': {
- '--color-warning': statusFill.warning,
- },
- 'variant:error': {
- '--color-error': statusFill.error,
- },
},
card: {
diff --git a/packages/themes/stone/src/stoneTheme.test.ts b/packages/themes/stone/src/stoneTheme.test.ts
index 3008f809db..32faef7d4a 100644
--- a/packages/themes/stone/src/stoneTheme.test.ts
+++ b/packages/themes/stone/src/stoneTheme.test.ts
@@ -60,6 +60,62 @@ describe('stone touch + narrow type pin', () => {
});
});
+describe('stone input status roles', () => {
+ it('keeps soft per-input status rims and glyphs on the border and icon roles', () => {
+ const inputs = [
+ 'text-input',
+ 'text-area',
+ 'number-input',
+ 'date-input',
+ 'time-input',
+ 'selector',
+ 'multi-selector',
+ 'typeahead',
+ 'tokenizer',
+ ];
+
+ const {green, red, yellow} = stoneModePalettes;
+ for (const input of inputs) {
+ const component = stoneTheme.components![input];
+ expect(component['status:success']).toMatchObject({
+ '--color-border-success': `light-dark(${green.light[55]}, ${green.dark[70]})`,
+ '--color-icon-success': `light-dark(${green.light[55]}, ${green.dark[70]})`,
+ });
+ expect(component['status:warning']).toMatchObject({
+ '--color-border-warning': `light-dark(${yellow.light[55]}, ${yellow.dark[70]})`,
+ '--color-icon-warning': `light-dark(${yellow.light[55]}, ${yellow.dark[70]})`,
+ });
+ expect(component['status:error']).toMatchObject({
+ '--color-border-error': `light-dark(${red.light[60]}, ${red.dark[70]})`,
+ '--color-icon-error': `light-dark(${red.light[60]}, ${red.dark[70]})`,
+ });
+ }
+ });
+});
+
+describe('stone strong status contrast', () => {
+ it('pairs strong status fills with contrasting light and dark ink', () => {
+ for (const token of [
+ '--color-on-success',
+ '--color-on-warning',
+ '--color-on-error',
+ ] as const) {
+ expect(stoneTheme.tokens[token]).toBe(
+ `light-dark(${stoneModePalettes.neutral.light[100]}, ${stoneModePalettes.neutral.dark[10]})`,
+ );
+ }
+ });
+
+ it('uses dark ink for marks on Stone’s pale progress fills', () => {
+ const mark = stoneTheme.components!['progress-bar-mark'];
+ for (const variant of ['accent', 'success', 'warning', 'error']) {
+ expect(mark[`placement:fill+variant:${variant}`]).toMatchObject({
+ backgroundColor: 'var(--color-on-light)',
+ });
+ }
+ });
+});
+
describe('stone secondary ComplexSelector', () => {
it('keeps the hover fill off a disabled trigger in either form', () => {
expect(generateThemeCSS(stoneTheme).component).toMatch(
@@ -147,10 +203,12 @@ describe('stone palette mapping', () => {
}
expect(stoneTheme.components?.['text-input']?.['status:success']).toEqual({
- '--color-success': `light-dark(${green.light[55]}, ${green.dark[70]})`,
+ '--color-border-success': `light-dark(${green.light[55]}, ${green.dark[70]})`,
+ '--color-icon-success': `light-dark(${green.light[55]}, ${green.dark[70]})`,
});
expect(stoneTheme.components?.['text-input']?.['status:warning']).toEqual({
- '--color-warning': `light-dark(${yellow.light[55]}, ${yellow.dark[70]})`,
+ '--color-border-warning': `light-dark(${yellow.light[55]}, ${yellow.dark[70]})`,
+ '--color-icon-warning': `light-dark(${yellow.light[55]}, ${yellow.dark[70]})`,
});
});
});
diff --git a/packages/themes/stone/src/stoneTheme.ts b/packages/themes/stone/src/stoneTheme.ts
index 144336fe44..bde6befe59 100644
--- a/packages/themes/stone/src/stoneTheme.ts
+++ b/packages/themes/stone/src/stoneTheme.ts
@@ -26,13 +26,16 @@ const withAlpha = (color: string, alpha: string): string => `${color}${alpha}`;
*/
const INPUT_STATUS_VARS = {
'status:success': {
- '--color-success': lightDark(green.light[55], green.dark[70]),
+ '--color-border-success': lightDark(green.light[55], green.dark[70]),
+ '--color-icon-success': lightDark(green.light[55], green.dark[70]),
},
'status:warning': {
- '--color-warning': lightDark(yellow.light[55], yellow.dark[70]),
+ '--color-border-warning': lightDark(yellow.light[55], yellow.dark[70]),
+ '--color-icon-warning': lightDark(yellow.light[55], yellow.dark[70]),
},
'status:error': {
- '--color-error': lightDark(red.light[60], red.dark[70]),
+ '--color-border-error': lightDark(red.light[60], red.dark[70]),
+ '--color-icon-error': lightDark(red.light[60], red.dark[70]),
},
} as const;
@@ -188,9 +191,22 @@ export const stoneTheme = defineTheme({
'--color-on-dark': neutral.light[100],
'--color-on-light': [neutral.light[15], neutral.dark[15]],
'--color-on-accent': [neutral.light[100], neutral.dark[15]],
- '--color-on-success': [green.light[30], green.dark[90]],
- '--color-on-error': [red.light[30], red.dark[90]],
- '--color-on-warning': [yellow.light[30], yellow.dark[90]],
+ '--color-on-success': [neutral.light[100], neutral.dark[10]],
+ '--color-on-error': [neutral.light[100], neutral.dark[10]],
+ '--color-on-warning': [neutral.light[100], neutral.dark[10]],
+
+ '--color-info': [blue.light[40], blue.dark[70]],
+ '--color-info-muted': [blue.light[90], blue.dark[25]],
+ '--color-on-info': [neutral.light[100], neutral.dark[15]],
+
+ '--color-text-info': [blue.light[30], blue.dark[90]],
+ '--color-text-success': [green.light[30], green.dark[90]],
+ '--color-text-warning': [yellow.light[30], yellow.dark[90]],
+ '--color-text-error': [red.light[30], red.dark[90]],
+ '--color-on-info-muted': [blue.light[30], blue.dark[90]],
+ '--color-on-success-muted': [green.light[30], green.dark[25]],
+ '--color-on-warning-muted': [yellow.light[30], yellow.dark[25]],
+ '--color-on-error-muted': [red.light[30], red.dark[25]],
// Icon
'--color-icon-accent': [neutral.light[15], neutral.dark[95]],
@@ -336,32 +352,23 @@ export const stoneTheme = defineTheme({
},
},
- // Banner surface declarations live above the theme layer, so redirect the
- // semantic variables here instead of attempting a losing direct fill.
+ // Banner status surfaces and content use the matching categorical pair.
banner: {
'status:info': {
- '--color-accent-muted': 'var(--color-background-blue)',
- '--color-text-primary': 'var(--color-text-blue)',
- '--color-text-secondary': 'var(--color-text-blue)',
- '--color-accent': 'var(--color-text-blue)',
+ '--color-info-muted': 'var(--color-background-blue)',
+ '--color-on-info-muted': 'var(--color-text-blue)',
},
'status:success': {
'--color-success-muted': 'var(--color-background-green)',
- '--color-text-primary': 'var(--color-text-green)',
- '--color-text-secondary': 'var(--color-text-green)',
- '--color-success': 'var(--color-text-green)',
+ '--color-on-success-muted': 'var(--color-text-green)',
},
'status:warning': {
'--color-warning-muted': 'var(--color-background-yellow)',
- '--color-text-primary': 'var(--color-text-yellow)',
- '--color-text-secondary': 'var(--color-text-yellow)',
- '--color-warning': 'var(--color-text-yellow)',
+ '--color-on-warning-muted': 'var(--color-text-yellow)',
},
'status:error': {
'--color-error-muted': 'var(--color-background-red)',
- '--color-text-primary': 'var(--color-text-red)',
- '--color-text-secondary': 'var(--color-text-red)',
- '--color-error': 'var(--color-text-red)',
+ '--color-on-error-muted': 'var(--color-text-red)',
},
},
@@ -382,6 +389,21 @@ export const stoneTheme = defineTheme({
},
},
+ 'progress-bar-mark': {
+ 'placement:fill+variant:accent': {
+ backgroundColor: 'var(--color-on-light)',
+ },
+ 'placement:fill+variant:success': {
+ backgroundColor: 'var(--color-on-light)',
+ },
+ 'placement:fill+variant:warning': {
+ backgroundColor: 'var(--color-on-light)',
+ },
+ 'placement:fill+variant:error': {
+ backgroundColor: 'var(--color-on-light)',
+ },
+ },
+
// The default muted track is too close to Stone's body surface.
'progress-bar-track': {
base: {
@@ -400,12 +422,15 @@ export const stoneTheme = defineTheme({
'field-status': {
'type:success': {
backgroundColor: 'var(--color-background-green)',
+ color: 'var(--color-text-green)',
},
'type:warning': {
backgroundColor: 'var(--color-background-yellow)',
+ color: 'var(--color-text-yellow)',
},
'type:error': {
backgroundColor: 'var(--color-background-red)',
+ color: 'var(--color-text-red)',
},
},
diff --git a/packages/themes/y2k/src/y2kTheme.ts b/packages/themes/y2k/src/y2kTheme.ts
index f1b4be85e1..01c3b61899 100644
--- a/packages/themes/y2k/src/y2kTheme.ts
+++ b/packages/themes/y2k/src/y2kTheme.ts
@@ -192,6 +192,18 @@ export const y2kTheme = defineTheme({
'--color-on-error': [red.light[30], red.dark[20]],
'--color-on-warning': [yellow.light[30], yellow.dark[20]],
+ '--color-info': [blue.light[40], blue.dark[75]],
+ '--color-info-muted': 'var(--color-background-blue)',
+
+ '--color-text-info': [blue.light[20], blue.dark[75]],
+ '--color-text-success': [green.light[30], green.dark[75]],
+ '--color-text-warning': [yellow.light[30], yellow.dark[85]],
+ '--color-text-error': [red.light[30], red.dark[75]],
+ '--color-on-info-muted': 'var(--color-text-blue)',
+ '--color-on-success-muted': 'var(--color-text-green)',
+ '--color-on-warning-muted': 'var(--color-text-yellow)',
+ '--color-on-error-muted': 'var(--color-text-red)',
+
// Icon
'--color-icon-accent': [neutral.light[15], neutral.dark[95]],
'--color-icon-primary': [neutral.light[15], neutral.dark[95]],
@@ -393,28 +405,20 @@ export const y2kTheme = defineTheme({
borderRadius: '0px',
},
'status:info': {
- backgroundColor: 'var(--color-background-blue)',
- '--color-text-primary': 'var(--color-text-blue)',
- '--color-text-secondary': 'var(--color-text-blue)',
- '--color-accent': 'var(--color-text-blue)',
+ '--color-info-muted': 'var(--color-background-blue)',
+ '--color-on-info-muted': 'var(--color-text-blue)',
},
'status:success': {
- backgroundColor: 'var(--color-background-green)',
- '--color-text-primary': 'var(--color-text-green)',
- '--color-text-secondary': 'var(--color-text-green)',
- '--color-success': 'var(--color-text-green)',
+ '--color-success-muted': 'var(--color-background-green)',
+ '--color-on-success-muted': 'var(--color-text-green)',
},
'status:warning': {
- backgroundColor: 'var(--color-background-yellow)',
- '--color-text-primary': 'var(--color-text-yellow)',
- '--color-text-secondary': 'var(--color-text-yellow)',
- '--color-warning': 'var(--color-text-yellow)',
+ '--color-warning-muted': 'var(--color-background-yellow)',
+ '--color-on-warning-muted': 'var(--color-text-yellow)',
},
'status:error': {
- backgroundColor: 'var(--color-background-red)',
- '--color-text-primary': 'var(--color-text-red)',
- '--color-text-secondary': 'var(--color-text-red)',
- '--color-error': 'var(--color-text-red)',
+ '--color-error-muted': 'var(--color-background-red)',
+ '--color-on-error-muted': 'var(--color-text-red)',
},
},
diff --git a/scripts/check-badge-contrast.test.mjs b/scripts/check-badge-contrast.test.mjs
index d41b2f91cd..fb970e1522 100644
--- a/scripts/check-badge-contrast.test.mjs
+++ b/scripts/check-badge-contrast.test.mjs
@@ -4,10 +4,10 @@
* @file Badge label contrast guard.
*
* The Badge label renders at 12px / weight 500, so WCAG 2.1 AA asks for 4.5:1
- * — the 3:1 large-text allowance does not apply. Each theme re-binds the badge
- * fill and label in its own `components.badge` block, so the pairing that
- * actually ships cannot be read off the global `--color-*` tokens; it has to be
- * resolved through the block, `light-dark()` and any `var()` indirection.
+ * — the 3:1 large-text allowance does not apply. Semantic Badge pairings are
+ * owned by Core. Each theme supplies the token values and may optionally re-bind
+ * a variant in `components.badge`, so this guard resolves Core's defaults through
+ * every first-party theme and then applies any theme-local component override.
*
* @input The seven first-party theme objects.
* @output Fails when a badge variant's label/fill pair drops below 4.5:1 in
@@ -23,16 +23,21 @@ import {matchaTheme} from '../packages/themes/matcha/src/matchaTheme.ts';
import {neutralTheme} from '../packages/themes/neutral/src/neutralTheme.ts';
import {stoneTheme} from '../packages/themes/stone/src/stoneTheme.ts';
import {y2kTheme} from '../packages/themes/y2k/src/y2kTheme.ts';
+import {withEmittedTokens} from './lib/theme-emitted-tokens.mjs';
-const THEMES = {
- butter: butterTheme,
- chocolate: chocolateTheme,
- gothic: gothicTheme,
- matcha: matchaTheme,
- neutral: neutralTheme,
- stone: stoneTheme,
- y2k: y2kTheme,
-};
+// Each theme as its generated CSS sets it, so status roles it leaves to theme
+// generation (architecture:theme-compilation INV17) resolve too.
+const THEMES = Object.fromEntries(
+ Object.entries({
+ butter: butterTheme,
+ chocolate: chocolateTheme,
+ gothic: gothicTheme,
+ matcha: matchaTheme,
+ neutral: neutralTheme,
+ stone: stoneTheme,
+ y2k: y2kTheme,
+ }).map(([name, theme]) => [name, withEmittedTokens(theme)]),
+);
const MODES = ['light', 'dark'];
/** WCAG 2.1 AA, normal-size text. */
@@ -140,6 +145,25 @@ function surfaceOf(theme, modeIndex) {
: {r: 0, g: 0, b: 0, a: 1};
}
+const CORE_SEMANTIC_BADGE = {
+ info: {
+ backgroundColor: 'var(--color-info)',
+ color: 'var(--color-on-info)',
+ },
+ success: {
+ backgroundColor: 'var(--color-success)',
+ color: 'var(--color-on-success)',
+ },
+ warning: {
+ backgroundColor: 'var(--color-warning)',
+ color: 'var(--color-on-warning)',
+ },
+ error: {
+ backgroundColor: 'var(--color-error)',
+ color: 'var(--color-on-error)',
+ },
+};
+
/**
* Every resolvable badge label/fill pair, as
* `{theme, mode, variant, fg, bg, ratio}`.
@@ -147,20 +171,30 @@ function surfaceOf(theme, modeIndex) {
function badgePairs() {
const rows = [];
for (const [themeName, theme] of Object.entries(THEMES)) {
- const badge = theme.components?.badge;
- if (!badge) continue;
+ const badge = theme.components?.badge ?? {};
// A variant may inherit the block's own base colour/fill.
const baseColor = badge.color;
const baseBg = badge.backgroundColor;
+ const variants = new Set([
+ ...Object.keys(CORE_SEMANTIC_BADGE),
+ ...Object.keys(badge)
+ .filter(key => key.startsWith('variant:'))
+ .map(key => key.slice('variant:'.length)),
+ ]);
- for (const [key, block] of Object.entries(badge)) {
- if (!key.startsWith('variant:') || typeof block !== 'object') continue;
- const variant = key.slice('variant:'.length);
+ for (const variant of variants) {
+ const block = badge[`variant:${variant}`];
+ if (block != null && typeof block !== 'object') continue;
+ const core = CORE_SEMANTIC_BADGE[variant];
for (let modeIndex = 0; modeIndex < MODES.length; modeIndex++) {
- const fgHex = resolve(block.color ?? baseColor, theme, modeIndex);
+ const fgHex = resolve(
+ block?.color ?? baseColor ?? core?.color,
+ theme,
+ modeIndex,
+ );
const bgHex = resolve(
- block.backgroundColor ?? baseBg,
+ block?.backgroundColor ?? baseBg ?? core?.backgroundColor,
theme,
modeIndex,
);
@@ -183,30 +217,25 @@ function badgePairs() {
return rows;
}
-/** Themes that re-bind the badge fill/label. The rest inherit core's defaults. */
-const THEMES_WITH_BADGE_BLOCK = ['butter', 'gothic', 'neutral', 'stone', 'y2k'];
+const FIRST_PARTY_THEMES = Object.keys(THEMES).sort();
-/**
- * Pre-existing shortfalls this guard records rather than silently tolerates.
- * The set is exact: a new shortfall fails the build, and a fixed one fails until
- * it is deleted from this list.
- */
+/** Exact allowlist: every maintained Badge pair currently clears AA. */
const KNOWN_GAPS = [];
describe('Badge label contrast', () => {
const rows = badgePairs();
const label = r => `${r.theme}/${r.mode} variant:${r.variant}`;
- it('resolves the badge pairs of every theme that defines a badge block', () => {
+ it('resolves Core semantic badge pairs through every first-party theme', () => {
// Guards the resolver itself: a refactor that silently stops resolving
// would otherwise turn this whole file into a no-op.
const covered = [...new Set(rows.map(r => r.theme))].sort();
- expect(covered).toEqual(THEMES_WITH_BADGE_BLOCK);
+ expect(covered).toEqual(FIRST_PARTY_THEMES);
- // The four semantic variants must resolve in every theme and both schemes;
- // those are the filled pairs this guard exists for.
+ // The four Core semantic variants must resolve in every theme and both
+ // schemes, whether or not that theme adds a component-local override.
const missing = [];
- for (const theme of THEMES_WITH_BADGE_BLOCK) {
+ for (const theme of FIRST_PARTY_THEMES) {
for (const mode of MODES) {
for (const variant of ['info', 'success', 'warning', 'error']) {
const hit = rows.some(
diff --git a/scripts/check-muted-status-contrast.test.mjs b/scripts/check-muted-status-contrast.test.mjs
new file mode 100644
index 0000000000..8685f9376a
--- /dev/null
+++ b/scripts/check-muted-status-contrast.test.mjs
@@ -0,0 +1,205 @@
+// Copyright (c) Meta Platforms, Inc. and affiliates.
+
+/**
+ * @file Pale semantic surface contrast guard.
+ *
+ * Banner, FieldStatus, and ChatComposer pair each `--color-*-muted` surface
+ * with its matching `--color-on-*-muted` content role. This resolves the global
+ * pairs used by FieldStatus and ChatComposer separately from the effective
+ * Banner pairs after Banner-local token overrides, and requires normal-size
+ * text contrast in both colour schemes.
+ *
+ * @input The seven first-party theme objects and their Banner overrides.
+ * @output Fails when a global or Banner pale semantic pair drops below 4.5:1.
+ * @position Repo-level guard, sibling of the other scripts/check-*.
+ */
+
+import {describe, expect, it} from 'vitest';
+import {butterTheme} from '../packages/themes/butter/src/butterTheme.ts';
+import {chocolateTheme} from '../packages/themes/chocolate/src/chocolateTheme.ts';
+import {gothicTheme} from '../packages/themes/gothic/src/gothicTheme.ts';
+import {matchaTheme} from '../packages/themes/matcha/src/matchaTheme.ts';
+import {neutralTheme} from '../packages/themes/neutral/src/neutralTheme.ts';
+import {stoneTheme} from '../packages/themes/stone/src/stoneTheme.ts';
+import {y2kTheme} from '../packages/themes/y2k/src/y2kTheme.ts';
+
+const THEMES = {
+ butter: butterTheme,
+ chocolate: chocolateTheme,
+ gothic: gothicTheme,
+ matcha: matchaTheme,
+ neutral: neutralTheme,
+ stone: stoneTheme,
+ y2k: y2kTheme,
+};
+const MODES = ['light', 'dark'];
+const VARIANTS = ['info', 'success', 'warning', 'error'];
+const AA_NORMAL = 4.5;
+const SURFACE_TOKENS = [
+ '--color-background-card',
+ '--color-background-surface',
+ '--color-background-body',
+];
+
+function splitArgs(input) {
+ const out = [];
+ let depth = 0;
+ let current = '';
+ for (const ch of input) {
+ if (ch === '(') depth++;
+ if (ch === ')') depth--;
+ if (ch === ',' && depth === 0) {
+ out.push(current.trim());
+ current = '';
+ continue;
+ }
+ current += ch;
+ }
+ out.push(current.trim());
+ return out;
+}
+
+function resolve(value, theme, modeIndex, seen = new Set()) {
+ if (Array.isArray(value)) {
+ return resolve(value[modeIndex], theme, modeIndex, seen);
+ }
+ if (typeof value !== 'string') return null;
+ const v = value.trim();
+
+ if (v.startsWith('light-dark(')) {
+ const args = splitArgs(v.slice('light-dark('.length, -1));
+ return resolve(args[modeIndex], theme, modeIndex, seen);
+ }
+
+ if (v.startsWith('var(')) {
+ const [name, fallback] = splitArgs(v.slice('var('.length, -1));
+ if (seen.has(name)) return null;
+ const next = theme.localTokens?.[name] ?? theme.tokens?.[name];
+ if (next == null) {
+ return fallback ? resolve(fallback, theme, modeIndex, seen) : null;
+ }
+ return resolve(next, theme, modeIndex, new Set([...seen, name]));
+ }
+
+ return /^#[0-9a-f]{3,8}$/i.test(v) ? v : null;
+}
+
+function parseHex(hex) {
+ let h = hex.slice(1);
+ if (h.length === 3 || h.length === 4) h = [...h].map(c => c + c).join('');
+ const n = i => parseInt(h.slice(i, i + 2), 16);
+ return {r: n(0), g: n(2), b: n(4), a: h.length === 8 ? n(6) / 255 : 1};
+}
+
+function flatten(top, base) {
+ if (top.a >= 1) return top;
+ const mix = (t, b) => Math.round(t * top.a + b * (1 - top.a));
+ return {
+ r: mix(top.r, base.r),
+ g: mix(top.g, base.g),
+ b: mix(top.b, base.b),
+ a: 1,
+ };
+}
+
+function luminance({r, g, b}) {
+ const lin = c => {
+ const s = c / 255;
+ return s <= 0.03928 ? s / 12.92 : ((s + 0.055) / 1.055) ** 2.4;
+ };
+ return 0.2126 * lin(r) + 0.7152 * lin(g) + 0.0722 * lin(b);
+}
+
+function contrast(fg, bg) {
+ const [hi, lo] = [luminance(fg), luminance(bg)].sort((a, b) => b - a);
+ return (hi + 0.05) / (lo + 0.05);
+}
+
+function surfaceOf(theme, modeIndex) {
+ for (const token of SURFACE_TOKENS) {
+ const hex = resolve(theme.tokens?.[token], theme, modeIndex);
+ if (hex) {
+ const parsed = parseHex(hex);
+ if (parsed.a >= 1) return parsed;
+ }
+ }
+ return modeIndex === 0
+ ? {r: 255, g: 255, b: 255, a: 1}
+ : {r: 0, g: 0, b: 0, a: 1};
+}
+
+function measurePair(themeName, theme, scope, variant, modeIndex) {
+ const bgHex = resolve(`var(--color-${variant}-muted)`, theme, modeIndex);
+ const fgHex = resolve(`var(--color-on-${variant}-muted)`, theme, modeIndex);
+ if (!bgHex || !fgHex) {
+ return {
+ theme: themeName,
+ scope,
+ mode: MODES[modeIndex],
+ variant,
+ fg: fgHex,
+ bg: bgHex,
+ ratio: null,
+ };
+ }
+
+ const surface = surfaceOf(theme, modeIndex);
+ const bg = flatten(parseHex(bgHex), surface);
+ const fg = flatten(parseHex(fgHex), bg);
+ return {
+ theme: themeName,
+ scope,
+ mode: MODES[modeIndex],
+ variant,
+ fg: fgHex,
+ bg: bgHex,
+ ratio: contrast(fg, bg),
+ };
+}
+
+function mutedPairs() {
+ const rows = [];
+ for (const [themeName, theme] of Object.entries(THEMES)) {
+ for (const variant of VARIANTS) {
+ const override = theme.components?.banner?.[`status:${variant}`] ?? {};
+ const bannerTokens = {
+ ...theme.tokens,
+ ...Object.fromEntries(
+ Object.entries(override).filter(([key]) => key.startsWith('--')),
+ ),
+ };
+ const bannerTheme = {...theme, tokens: bannerTokens};
+
+ for (let modeIndex = 0; modeIndex < MODES.length; modeIndex++) {
+ rows.push(
+ measurePair(themeName, theme, 'global', variant, modeIndex),
+ measurePair(themeName, bannerTheme, 'banner', variant, modeIndex),
+ );
+ }
+ }
+ }
+ return rows;
+}
+
+describe('pale semantic surface content contrast', () => {
+ const rows = mutedPairs();
+ const label = row =>
+ `${row.theme}/${row.mode}/${row.scope} status:${row.variant}`;
+
+ it('resolves global and Banner pairs in every first-party theme and mode', () => {
+ const missing = rows.filter(row => row.ratio == null).map(label);
+ expect(missing).toEqual([]);
+ expect(rows).toHaveLength(
+ Object.keys(THEMES).length * MODES.length * VARIANTS.length * 2,
+ );
+ });
+
+ it('keeps every pair at normal-text AA without an allowlist', () => {
+ const failures = rows
+ .filter(row => row.ratio != null && row.ratio < AA_NORMAL)
+ .map(
+ row => `${label(row)} ${row.ratio.toFixed(2)}:1 ${row.fg} on ${row.bg}`,
+ );
+ expect(failures).toEqual([]);
+ });
+});
diff --git a/scripts/check-status-text-contrast.test.mjs b/scripts/check-status-text-contrast.test.mjs
new file mode 100644
index 0000000000..1dea657aad
--- /dev/null
+++ b/scripts/check-status-text-contrast.test.mjs
@@ -0,0 +1,543 @@
+// Copyright (c) Meta Platforms, Inc. and affiliates.
+
+/**
+ * @file Status role contrast and chroma guard (architecture:theme-tokens INV11).
+ *
+ * Resolves every status role in Core's defaults and in each first-party theme,
+ * including roles the theme leaves for theme generation to derive
+ * (architecture:theme-compilation INV17), and checks the INV11 floors in light
+ * and dark mode:
+ * - `--color-text-<status>` reaches 4.5:1 on the surface and card;
+ * - `--color-icon-<status>` and `--color-border-<status>` reach 3:1 there;
+ * - `--color-on-<status>` reaches 4.5:1 on the strong fill `--color-<status>`;
+ * - `--color-on-<status>-muted` reaches 4.5:1 on the pale fill over the surface;
+ * - every status fill and text colour is chromatic.
+ * It also pins Core's released fill values.
+ *
+ * @input Core defaults, the seven first-party theme objects, and theme generation.
+ * @output Fails naming the theme, mode, role, and measured value.
+ * @position Repo-level guard, sibling of check-muted-status-contrast.
+ */
+
+import {describe, expect, it} from 'vitest';
+import {
+ defineTheme,
+ generateAdaptationCSS,
+ generateOnMediaCSS,
+ generateThemeRules,
+ resolveThemeTokens,
+} from '../packages/core/dist/theme/index.js';
+
+/** All CSS a theme generates: root rules, adaptations, and media surfaces. */
+function allThemeCSS(theme) {
+ const text = value =>
+ typeof value === 'string'
+ ? value
+ : Array.isArray(value)
+ ? value.map(text).join('\n')
+ : value && typeof value === 'object'
+ ? Object.values(value).map(text).join('\n')
+ : '';
+ return [
+ generateThemeRules(theme),
+ generateAdaptationCSS(theme),
+ generateOnMediaCSS(theme),
+ ]
+ .map(text)
+ .join('\n');
+}
+import {emittedRootTokens} from './lib/theme-emitted-tokens.mjs';
+import {
+ composite,
+ contrastRatio,
+ isChromatic,
+} from '../packages/core/src/theme/statusColor.ts';
+import {parseColor} from '../packages/core/src/utils/color.ts';
+import {butterTheme} from '../packages/themes/butter/src/butterTheme.ts';
+import {chocolateTheme} from '../packages/themes/chocolate/src/chocolateTheme.ts';
+import {gothicTheme} from '../packages/themes/gothic/src/gothicTheme.ts';
+import {matchaTheme} from '../packages/themes/matcha/src/matchaTheme.ts';
+import {neutralTheme} from '../packages/themes/neutral/src/neutralTheme.ts';
+import {stoneTheme} from '../packages/themes/stone/src/stoneTheme.ts';
+import {y2kTheme} from '../packages/themes/y2k/src/y2kTheme.ts';
+
+export const THEMES = {
+ core: null,
+ butter: butterTheme,
+ chocolate: chocolateTheme,
+ gothic: gothicTheme,
+ matcha: matchaTheme,
+ neutral: neutralTheme,
+ stone: stoneTheme,
+ y2k: y2kTheme,
+};
+const MODES = ['light', 'dark'];
+const STATUSES = ['info', 'success', 'warning', 'error'];
+const WHITE = {r: 255, g: 255, b: 255, a: 1};
+
+/** Effective tokens for a theme and mode, as the generated CSS sets them. */
+export function effectiveTokens(theme, mode) {
+ if (theme === null) return resolveThemeTokens(null, {mode});
+ const tokens = {...(theme.localTokens ?? {}), ...emittedRootTokens(theme)};
+ return resolveThemeTokens({tokens}, {mode});
+}
+
+function color(tokens, name) {
+ const parsed = parseColor(tokens[name] ?? '');
+ if (parsed === null) {
+ throw new Error(`${name} does not resolve to a colour: ${tokens[name]}`);
+ }
+ return parsed;
+}
+
+function opaque(c, under) {
+ return c.a < 1 ? composite(c, under) : c;
+}
+
+const cases = [];
+for (const themeName of Object.keys(THEMES)) {
+ for (const mode of MODES) cases.push([themeName, mode]);
+}
+
+describe('status roles meet the INV11 floors', () => {
+ it.each(cases)('%s %s', (themeName, mode) => {
+ const t = effectiveTokens(THEMES[themeName], mode);
+ const surface = opaque(color(t, '--color-background-surface'), WHITE);
+ const card = opaque(color(t, '--color-background-card'), surface);
+ const failures = [];
+ const check = (label, value, floor) => {
+ if (value < floor)
+ failures.push(`${label} ${value.toFixed(2)}:1 < ${floor}:1`);
+ };
+ for (const s of STATUSES) {
+ const text = color(t, `--color-text-${s}`);
+ check(`text-${s} on surface`, contrastRatio(text, surface), 4.5);
+ check(`text-${s} on card`, contrastRatio(text, card), 4.5);
+ for (const role of ['icon', 'border']) {
+ const c = color(t, `--color-${role}-${s}`);
+ check(`${role}-${s} on surface`, contrastRatio(c, surface), 3);
+ check(`${role}-${s} on card`, contrastRatio(c, card), 3);
+ }
+ const fill = opaque(color(t, `--color-${s}`), surface);
+ check(
+ `on-${s} on ${s}`,
+ contrastRatio(color(t, `--color-on-${s}`), fill),
+ 4.5,
+ );
+ const pale = opaque(color(t, `--color-${s}-muted`), surface);
+ check(
+ `on-${s}-muted on ${s}-muted`,
+ contrastRatio(color(t, `--color-on-${s}-muted`), pale),
+ 4.5,
+ );
+ for (const role of [
+ `--color-text-${s}`,
+ `--color-${s}`,
+ `--color-${s}-muted`,
+ ]) {
+ if (!isChromatic(color(t, role)))
+ failures.push(`${role} is not chromatic: ${t[role]}`);
+ }
+ }
+ expect(failures).toEqual([]);
+ });
+});
+
+describe('component-scoped status icons and borders keep 3:1 (INV11)', () => {
+ // A theme may set its own icon and border roles inside a component scope,
+ // such as an input's status rim; those values keep the same 3:1 floor.
+ const scoped = [];
+ for (const [themeName, theme] of Object.entries(THEMES)) {
+ if (theme === null) continue;
+ for (const [component, blocks] of Object.entries(theme.components ?? {})) {
+ for (const [key, block] of Object.entries(blocks ?? {})) {
+ if (!key.startsWith('status:') || typeof block !== 'object') continue;
+ for (const [token, value] of Object.entries(block)) {
+ if (
+ /^--color-(icon|border)-(info|success|warning|error)$/.test(token)
+ ) {
+ scoped.push([
+ `${themeName} ${component} ${key} ${token}`,
+ theme,
+ value,
+ ]);
+ }
+ }
+ }
+ }
+ }
+
+ it('finds the scoped overrides it checks', () => {
+ expect(scoped.length).toBeGreaterThan(0);
+ });
+
+ it.each(scoped.map(([label, , value]) => [label, value]))('%s', label => {
+ const [, theme, value] = scoped.find(([l]) => l === label);
+ for (const mode of MODES) {
+ const t = resolveThemeTokens(
+ {tokens: {...emittedRootTokens(theme), '--status-probe': value}},
+ {mode},
+ );
+ const surface = opaque(color(t, '--color-background-surface'), WHITE);
+ expect(
+ contrastRatio(color(t, '--status-probe'), surface),
+ ).toBeGreaterThanOrEqual(3);
+ }
+ });
+});
+
+describe('component-scoped pale status fills keep their content at 4.5:1 (INV11)', () => {
+ // A theme may repaint a FieldStatus fill in its component map; the content
+ // drawn on it (its own colour, or the on-muted role) keeps the 4.5:1 floor.
+ const fills = [];
+ for (const [themeName, theme] of Object.entries(THEMES)) {
+ if (theme === null) continue;
+ for (const [key, block] of Object.entries(
+ theme.components?.['field-status'] ?? {},
+ )) {
+ const status = key.replace(/^type:/, '');
+ if (typeof block !== 'object' || block.backgroundColor === undefined) {
+ continue;
+ }
+ fills.push([`${themeName} field-status ${key}`, theme, status, block]);
+ }
+ }
+
+ it.each(fills.map(([label]) => [label]))('%s', label => {
+ const [, theme, status, block] = fills.find(([l]) => l === label);
+ for (const mode of MODES) {
+ const t = resolveThemeTokens(
+ {
+ tokens: {
+ ...emittedRootTokens(theme),
+ '--probe-fill': block.backgroundColor,
+ '--probe-ink': block.color ?? `var(--color-on-${status}-muted)`,
+ },
+ },
+ {mode},
+ );
+ const surface = opaque(color(t, '--color-background-surface'), WHITE);
+ const fill = opaque(color(t, '--probe-fill'), surface);
+ const ink = opaque(color(t, '--probe-ink'), fill);
+ expect(contrastRatio(ink, fill)).toBeGreaterThanOrEqual(4.5);
+ }
+ });
+});
+
+describe("Core's released status fills keep their values", () => {
+ // Core's released defaults (light, dark).
+ const RELEASED = {
+ '--color-success': ['#0D8626', '#0D8626'],
+ '--color-warning': ['#E9AF08', '#F2C00B'],
+ '--color-error': ['#E3193B', '#F5394F'],
+ };
+ it.each(Object.entries(RELEASED))('%s', (name, [light, dark]) => {
+ expect(resolveThemeTokens(null, {mode: 'light'})[name]).toBe(light);
+ expect(resolveThemeTokens(null, {mode: 'dark'})[name]).toBe(dark);
+ });
+});
+
+describe('theme generation derives a complete status set (INV17)', () => {
+ const minimal = defineTheme({
+ name: 'status-minimal',
+ tokens: {
+ '--color-info': 'light-dark(#1F6FEB, #79C0FF)',
+ '--color-success': 'light-dark(#3FB950, #3FB950)',
+ '--color-warning': 'light-dark(#D29922, #D29922)',
+ '--color-error': 'light-dark(#F85149, #F85149)',
+ },
+ });
+
+ it.each(MODES)('meets every floor in %s mode', mode => {
+ const t = effectiveTokens(minimal, mode);
+ const surface = opaque(color(t, '--color-background-surface'), WHITE);
+ for (const s of STATUSES) {
+ expect(
+ contrastRatio(color(t, `--color-text-${s}`), surface),
+ ).toBeGreaterThanOrEqual(4.5);
+ const fill = opaque(color(t, `--color-${s}`), surface);
+ expect(
+ contrastRatio(opaque(color(t, `--color-on-${s}`), fill), fill),
+ ).toBeGreaterThanOrEqual(4.5);
+ expect(isChromatic(color(t, `--color-text-${s}`))).toBe(true);
+ }
+ });
+
+ it('keeps the fills the theme sets and derives the content on them', () => {
+ const emitted = emittedRootTokens(minimal);
+ expect(emitted['--color-success']).toBe('light-dark(#3FB950, #3FB950)');
+ for (const s of STATUSES) {
+ expect(emitted[`--color-on-${s}`]).toMatch(/^light-dark\(#/);
+ }
+ });
+
+ it('derives dark content on a light fill', () => {
+ const theme = defineTheme({
+ name: 'status-light-fill',
+ tokens: {'--color-warning': '#F2C00B'},
+ });
+ for (const mode of MODES) {
+ const t = effectiveTokens(theme, mode);
+ const fill = opaque(color(t, '--color-warning'), WHITE);
+ expect(
+ contrastRatio(opaque(color(t, '--color-on-warning'), fill), fill),
+ ).toBeGreaterThanOrEqual(4.5);
+ }
+ });
+
+ it('falls back to white or black when the theme content colours miss 4.5:1', () => {
+ const theme = defineTheme({
+ name: 'status-soft-ink',
+ tokens: {
+ '--color-success': '#2E9E5B',
+ '--color-on-dark': '#E6E6E6',
+ '--color-on-light': '#3A3A3A',
+ },
+ });
+ for (const mode of MODES) {
+ const t = effectiveTokens(theme, mode);
+ const fill = opaque(color(t, '--color-success'), WHITE);
+ expect(
+ contrastRatio(opaque(color(t, '--color-on-success'), fill), fill),
+ ).toBeGreaterThanOrEqual(4.5);
+ }
+ });
+
+ it("falls back to Core's hue for text when a fill is grey", () => {
+ const grey = defineTheme({
+ name: 'status-grey-success',
+ tokens: {'--color-success': 'light-dark(#666666, #AAAAAA)'},
+ });
+ for (const mode of MODES) {
+ const t = effectiveTokens(grey, mode);
+ expect(isChromatic(color(t, '--color-text-success'))).toBe(true);
+ }
+ });
+
+ it('keeps aliases for a fill that is not a concrete colour', () => {
+ const theme = defineTheme({
+ name: 'status-unresolved',
+ tokens: {'--color-success': 'var(--brand-success)'},
+ });
+ const emitted = emittedRootTokens(theme);
+ // Unset here, so Core's own aliases to the hue text token apply.
+ expect(emitted).not.toHaveProperty('--color-text-success');
+ expect(emitted).not.toHaveProperty('--color-on-success');
+ expect(emitted).not.toHaveProperty('--color-on-success-muted');
+ });
+
+ it('keeps aliases when a measured surface is not a concrete colour', () => {
+ const theme = defineTheme({
+ name: 'status-unresolved-card',
+ tokens: {
+ '--color-success': '#3FB950',
+ '--color-background-card': 'var(--host-card)',
+ },
+ });
+ const emitted = emittedRootTokens(theme);
+ expect(emitted['--color-text-success'] ?? 'alias').not.toMatch(
+ /^light-dark\(#/,
+ );
+ });
+
+ it('re-derives in an adaptation rule that changes a fill', () => {
+ const theme = defineTheme({
+ name: 'status-adaptive',
+ tokens: {'--color-success': '#3FB950'},
+ adaptations: {
+ rules: [
+ {
+ when: {contrast: 'more'},
+ value: {tokens: {'--color-success': '#1A7F37'}},
+ },
+ ],
+ },
+ });
+ const css = allThemeCSS(theme);
+ expect(css).toContain('prefers-contrast: more');
+ const rule = css.slice(css.indexOf('prefers-contrast: more'));
+ expect(rule).toMatch(/--color-text-success: light-dark\(#/);
+ expect(rule).toMatch(/--color-on-success: light-dark\(#/);
+ });
+
+ it('derives in a rule when only that rule sets a fill', () => {
+ const theme = defineTheme({
+ name: 'status-rule-only',
+ tokens: {},
+ adaptations: {
+ rules: [
+ {
+ when: {contrast: 'more'},
+ value: {tokens: {'--color-success': '#ABCDEF'}},
+ },
+ ],
+ },
+ });
+ const css = allThemeCSS(theme);
+ const rule = css.slice(css.indexOf('prefers-contrast: more'));
+ expect(rule).toMatch(/--color-on-success: light-dark\(#/);
+ expect(rule).toContain('--color-icon-success: var(--color-text-success);');
+ });
+
+ it('aliases a hue text token a media surface sets, over a derived root role', () => {
+ const theme = defineTheme({
+ name: 'status-media',
+ tokens: {'--color-success': '#3FB950'},
+ onDark: {tokens: {'--color-text-green': '#A5F690'}},
+ });
+ const css = allThemeCSS(theme);
+ expect(css).toContain('[data-astryx-media="dark"]');
+ const media = css.slice(css.indexOf('[data-astryx-media="dark"]'));
+ expect(media).toContain('--color-text-success: var(--color-text-green);');
+ });
+
+ it('derives the content on a status fill a media surface sets', () => {
+ const theme = defineTheme({
+ name: 'status-media-fill',
+ onDark: {tokens: {'--color-success': '#7EE787'}},
+ });
+ const css = allThemeCSS(theme);
+ const media = css.slice(css.indexOf('[data-astryx-media="dark"]'));
+ const match = media.match(
+ /--color-on-success: light-dark\((#[0-9A-F]{6}), (#[0-9A-F]{6})\)/,
+ );
+ expect(match).not.toBeNull();
+ const fill = color({fill: '#7EE787'}, 'fill');
+ for (const ink of [match[1], match[2]]) {
+ expect(contrastRatio(color({ink}, 'ink'), fill)).toBeGreaterThanOrEqual(
+ 4.5,
+ );
+ }
+ });
+
+ it('re-derives text when a theme changes only a surface', () => {
+ const darkCard = defineTheme({
+ name: 'status-surface-only',
+ tokens: {
+ '--color-background-surface': '#101010',
+ '--color-background-card': '#101010',
+ },
+ });
+ for (const mode of MODES) {
+ const t = effectiveTokens(darkCard, mode);
+ const surface = opaque(color(t, '--color-background-surface'), WHITE);
+ for (const status of STATUSES) {
+ expect(
+ contrastRatio(color(t, `--color-text-${status}`), surface),
+ ).toBeGreaterThanOrEqual(4.5);
+ }
+ }
+ });
+
+ it('resolves every fixture the same way in JavaScript as in its CSS', () => {
+ const fixtures = [
+ minimal,
+ defineTheme({
+ name: 'js-grey-base',
+ tokens: {'--color-success': 'light-dark(#666666, #AAAAAA)'},
+ }),
+ defineTheme({
+ name: 'js-unresolved-source',
+ tokens: {'--color-success': 'var(--brand-success)'},
+ }),
+ defineTheme({
+ name: 'js-unresolved-card',
+ tokens: {
+ '--color-success': '#3FB950',
+ '--color-background-card': 'var(--host-card)',
+ },
+ }),
+ defineTheme({
+ name: 'js-child',
+ extends: defineTheme({
+ name: 'js-parent',
+ tokens: {'--color-text-success': '#0A5C2E'},
+ }),
+ tokens: {'--color-error': '#D1242F'},
+ }),
+ ];
+ for (const theme of fixtures) {
+ for (const mode of MODES) {
+ const fromCss = effectiveTokens(theme, mode);
+ const fromJs = resolveThemeTokens(theme, {mode});
+ for (const status of STATUSES) {
+ for (const role of [
+ `--color-text-${status}`,
+ `--color-icon-${status}`,
+ `--color-border-${status}`,
+ `--color-on-${status}`,
+ `--color-on-${status}-muted`,
+ ]) {
+ expect([theme.name, mode, role, fromJs[role]]).toEqual([
+ theme.name,
+ mode,
+ role,
+ fromCss[role],
+ ]);
+ }
+ }
+ }
+ }
+ });
+
+ it('aliases icon and border roles to a text role that is itself an alias', () => {
+ const theme = defineTheme({
+ name: 'status-hue-text-only',
+ tokens: {'--color-text-green': '#0A5C2E'},
+ });
+ const emitted = emittedRootTokens(theme);
+ expect(emitted['--color-text-success']).toBe('var(--color-text-green)');
+ expect(emitted['--color-icon-success']).toBe('var(--color-text-success)');
+ expect(emitted['--color-border-success']).toBe('var(--color-text-success)');
+ });
+
+ it('counts a role inherited through extends as set', () => {
+ const parent = defineTheme({
+ name: 'status-parent',
+ tokens: {'--color-success': '#3FB950', '--color-text-success': '#0A5C2E'},
+ });
+ const child = defineTheme({
+ name: 'status-child',
+ extends: parent,
+ tokens: {'--color-error': '#D1242F'},
+ });
+ const emitted = emittedRootTokens(child);
+ expect(emitted['--color-text-success']).toBe('#0A5C2E');
+ expect(emitted['--color-icon-success']).toBe('var(--color-text-success)');
+ });
+
+ it('never derives a fill or a pale fill', () => {
+ const emitted = emittedRootTokens(minimal);
+ for (const s of STATUSES) {
+ expect(emitted[`--color-${s}`]).toBe(minimal.tokens[`--color-${s}`]);
+ expect(emitted).not.toHaveProperty(`--color-${s}-muted`);
+ }
+ });
+
+ it('keeps a value the theme sets, and icon and border follow it', () => {
+ const theme = defineTheme({
+ name: 'status-set-text',
+ tokens: {
+ '--color-success': '#3FB950',
+ '--color-text-success': '#123456',
+ },
+ });
+ const emitted = emittedRootTokens(theme);
+ expect(emitted['--color-text-success']).toBe('#123456');
+ expect(emitted['--color-icon-success']).toBe('var(--color-text-success)');
+ expect(emitted['--color-border-success']).toBe('var(--color-text-success)');
+ });
+
+ it('does not alias an icon or border role the theme sets', () => {
+ const theme = defineTheme({
+ name: 'status-set-icon',
+ tokens: {
+ '--color-text-success': '#123456',
+ '--color-icon-success': '#0A5C2E',
+ },
+ });
+ const emitted = emittedRootTokens(theme);
+ expect(emitted['--color-icon-success']).toBe('#0A5C2E');
+ expect(emitted['--color-border-success']).toBe('var(--color-text-success)');
+ });
+});
diff --git a/scripts/generate-token-docs.mjs b/scripts/generate-token-docs.mjs
index a0316fc77f..335d2cd3a3 100644
--- a/scripts/generate-token-docs.mjs
+++ b/scripts/generate-token-docs.mjs
@@ -122,6 +122,55 @@ const groups = [
'Semantic colors for consistent theming. All colors use light-dark() for automatic mode switching.',
headers: ['Token', 'Light', 'Dark'],
formatRow: lightDarkRow,
+ // One line per status role (architecture:theme-tokens INV11), so a reader
+ // picks the token by the surface it sits on.
+ extraContent: [
+ {
+ type: 'prose',
+ text: 'Status roles: pick the token by the surface. `<status>` is info, success, warning, or error.',
+ },
+ {
+ type: 'table',
+ headers: ['Status role', 'Use it for', 'Pairs with'],
+ rows: [
+ [
+ '--color-text-<status>',
+ 'Status text on the page or a card (4.5:1 or more).',
+ '—',
+ ],
+ [
+ '--color-icon-<status>',
+ 'Status icons on the page or a card. Defaults to the text colour.',
+ '—',
+ ],
+ [
+ '--color-border-<status>',
+ 'Status borders on the page or a card, such as an invalid field. Defaults to the text colour.',
+ '—',
+ ],
+ [
+ '--color-<status>',
+ 'Strong status fill, such as a Badge or StatusDot.',
+ '--color-on-<status>',
+ ],
+ [
+ '--color-on-<status>',
+ 'Text and icons on the strong fill (4.5:1 or more).',
+ '--color-<status>',
+ ],
+ [
+ '--color-<status>-muted',
+ 'Pale status fill, such as a Banner.',
+ '--color-on-<status>-muted',
+ ],
+ [
+ '--color-on-<status>-muted',
+ 'Text and icons on the pale fill (4.5:1 or more).',
+ '--color-<status>-muted',
+ ],
+ ],
+ },
+ ],
},
{
key: 'data',
@@ -285,6 +334,7 @@ for (const group of groups) {
/** @type {import('@astryxdesign/cli/authoring').ReferenceContentBlock[]} */
const content = [
{type: 'prose', text: group.description},
+ ...(group.extraContent ?? []),
{type: 'table', headers: group.headers, rows},
];
diff --git a/scripts/lib/theme-emitted-tokens.mjs b/scripts/lib/theme-emitted-tokens.mjs
new file mode 100644
index 0000000000..51b0b1b056
--- /dev/null
+++ b/scripts/lib/theme-emitted-tokens.mjs
@@ -0,0 +1,28 @@
+// Copyright (c) Meta Platforms, Inc. and affiliates.
+
+/**
+ * @file theme-emitted-tokens.mjs
+ * @input A defined theme
+ * @output The custom properties its generated root rule declares
+ * @position Shared by the repo-level colour guards so they check the tokens a
+ * theme actually emits, including roles theme generation derives
+ * (architecture:theme-compilation INV17) and scoped aliases (INV16).
+ */
+
+import {generateThemeRules} from '../../packages/core/dist/theme/index.js';
+
+/** `{name: value}` for every declaration in the theme's root token rule. */
+export function emittedRootTokens(theme) {
+ const [root = ''] = generateThemeRules(theme);
+ const body = root.slice(root.indexOf('{') + 1, root.lastIndexOf('}'));
+ const tokens = {};
+ for (const match of body.matchAll(/(--[\w-]+)\s*:\s*([^;]+);/g)) {
+ tokens[match[1]] = match[2].trim();
+ }
+ return tokens;
+}
+
+/** The theme with its emitted root tokens merged under its authored ones. */
+export function withEmittedTokens(theme) {
+ return {...theme, tokens: {...emittedRootTokens(theme), ...theme.tokens}};
+}