refactor(ui): rename surface tokens to neutral background tokens
Replace --bui-surface-1..5 with --bui-bg-neutral-1..5 for both light and dark themes. --bui-bg-neutral-1 replaces the deprecated --bui-bg-app, and --bui-bg-neutral-2..5 extend the scale. The old bare --bui-bg-neutral-1..4 entries are removed from the deprecated section since their names are now reused; the hover/pressed/disabled variants remain deprecated. Updates colors.stories.tsx, the ESLint rule and tests, and all migration documentation and the PR description accordingly. Signed-off-by: Charles de Dreuille <charles.dedreuille@gmail.com>
This commit is contained in:
@@ -38,15 +38,11 @@ const style = { borderColor: 'var(--bui-positive-border)' };
|
||||
|
||||
Replace deprecated tokens with their equivalents from the new semantic families.
|
||||
|
||||
### Surfaces
|
||||
### Neutral backgrounds
|
||||
|
||||
| Deprecated | Replacement |
|
||||
| -------------------- | ----------------- |
|
||||
| `--bui-bg-app` | `--bui-surface-1` |
|
||||
| `--bui-bg-neutral-1` | `--bui-surface-2` |
|
||||
| `--bui-bg-neutral-2` | `--bui-surface-3` |
|
||||
| `--bui-bg-neutral-3` | `--bui-surface-4` |
|
||||
| `--bui-bg-neutral-4` | `--bui-surface-5` |
|
||||
| Deprecated | Replacement |
|
||||
| -------------- | -------------------- |
|
||||
| `--bui-bg-app` | `--bui-bg-neutral-1` |
|
||||
|
||||
### Foreground
|
||||
|
||||
|
||||
@@ -23,19 +23,15 @@ const DEPRECATED_TOKENS = [
|
||||
'--bui-bg-solid-pressed',
|
||||
'--bui-bg-solid-disabled',
|
||||
'--bui-bg-app',
|
||||
'--bui-bg-neutral-1',
|
||||
'--bui-bg-neutral-1-hover',
|
||||
'--bui-bg-neutral-1-pressed',
|
||||
'--bui-bg-neutral-1-disabled',
|
||||
'--bui-bg-neutral-2',
|
||||
'--bui-bg-neutral-2-hover',
|
||||
'--bui-bg-neutral-2-pressed',
|
||||
'--bui-bg-neutral-2-disabled',
|
||||
'--bui-bg-neutral-3',
|
||||
'--bui-bg-neutral-3-hover',
|
||||
'--bui-bg-neutral-3-pressed',
|
||||
'--bui-bg-neutral-3-disabled',
|
||||
'--bui-bg-neutral-4',
|
||||
'--bui-bg-neutral-4-hover',
|
||||
'--bui-bg-neutral-4-pressed',
|
||||
'--bui-bg-neutral-4-disabled',
|
||||
|
||||
@@ -46,7 +46,11 @@ ruleTester.run('no-deprecated-bui-tokens', rule, {
|
||||
{ code: `const s = 'var(--bui-warning-bg)'` },
|
||||
{ code: `const s = 'var(--bui-announcement-bg)'` },
|
||||
{ code: `const s = 'var(--bui-gray-1)'` },
|
||||
{ code: `const s = 'var(--bui-surface-1)'` },
|
||||
{ code: `const s = 'var(--bui-bg-neutral-1)'` },
|
||||
{ code: `const s = 'var(--bui-bg-neutral-2)'` },
|
||||
{ code: `const s = 'var(--bui-bg-neutral-3)'` },
|
||||
{ code: `const s = 'var(--bui-bg-neutral-4)'` },
|
||||
{ code: `const s = 'var(--bui-bg-neutral-5)'` },
|
||||
// Unrelated strings — should not warn
|
||||
{ code: `const s = 'some-other-string'` },
|
||||
{ code: `const n = 42` },
|
||||
@@ -83,12 +87,6 @@ ruleTester.run('no-deprecated-bui-tokens', rule, {
|
||||
code: `const s = 'var(--bui-bg-app)'`,
|
||||
errors: [{ messageId: 'deprecated', data: { token: '--bui-bg-app' } }],
|
||||
},
|
||||
{
|
||||
code: `const s = 'var(--bui-bg-neutral-1)'`,
|
||||
errors: [
|
||||
{ messageId: 'deprecated', data: { token: '--bui-bg-neutral-1' } },
|
||||
],
|
||||
},
|
||||
{
|
||||
code: `const s = 'var(--bui-bg-neutral-2-hover)'`,
|
||||
errors: [
|
||||
|
||||
Reference in New Issue
Block a user