@djangocfg/ui-core 2.1.495 → 2.1.497

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@djangocfg/ui-core",
3
- "version": "2.1.495",
3
+ "version": "2.1.497",
4
4
  "description": "Pure React UI component library without Next.js dependencies - for Electron, Vite, CRA apps",
5
5
  "keywords": [
6
6
  "ui-components",
@@ -128,7 +128,7 @@
128
128
  "check:contrast": "node scripts/check-preset-contrast.mjs"
129
129
  },
130
130
  "peerDependencies": {
131
- "@djangocfg/i18n": "^2.1.495",
131
+ "@djangocfg/i18n": "^2.1.497",
132
132
  "consola": "^3.4.2",
133
133
  "lucide-react": "^0.545.0",
134
134
  "moment": "^2.30.1",
@@ -206,8 +206,8 @@
206
206
  "@chenglou/pretext": "^0.0.8"
207
207
  },
208
208
  "devDependencies": {
209
- "@djangocfg/i18n": "^2.1.495",
210
- "@djangocfg/typescript-config": "^2.1.495",
209
+ "@djangocfg/i18n": "^2.1.497",
210
+ "@djangocfg/typescript-config": "^2.1.497",
211
211
  "@types/node": "^24.13.3",
212
212
  "@types/react": "19.2.15",
213
213
  "@types/react-dom": "19.2.3",
@@ -166,6 +166,19 @@ Typography variables are ordinary CSS values:
166
166
  - In light mode, `--muted` must be at least 2 HSL lightness points darker
167
167
  than `--background`. This keeps translucent muted fills visible on the
168
168
  canvas and is enforced by `check:contrast`.
169
+ - An interactive surface must sit at least 4 HSL lightness points away from the
170
+ surface it lands on, **in both modes**: `--accent` vs `--background`, and
171
+ `--sidebar-accent` vs `--sidebar-background`. Direction is deliberately not
172
+ asserted (light darkens its hover, dark lightens it) — only the size of the
173
+ step, so both modes do comparable work for the same interaction. Enforced by
174
+ `check:contrast`.
175
+
176
+ This rule exists because the one above it was not enough. A sidebar hover
177
+ lands on `--sidebar-background`, which nothing checked, so presets shipped
178
+ one-point steps in light against eleven in dark — and one stepped the wrong
179
+ way, its hover lighter than the rail it highlighted. Every one passed the
180
+ `--muted`/`--background` gate. **Check the surface the user actually sees,
181
+ not a neighbouring one that happens to be nearby.**
169
182
  - Changes to a preset require checking both light and dark modes.
170
183
  - Product density overrides belong in the consuming app's CSS, not in a copied
171
184
  TypeScript map.
@@ -24,7 +24,9 @@
24
24
  --divider: hsl(0 0% 46% / 0.18);
25
25
  --muted: hsl(0 0% 12%);
26
26
  --card: hsl(0 0% 10%);
27
- --accent: hsl(0 0% 14%);
27
+ /* 20%, not 14%: --background is 14.5%, so this was HALF a point — the
28
+ hover was effectively invisible. */
29
+ --accent: hsl(0 0% 20%);
28
30
  --radius-xs: calc(0.25rem - 6px);
29
31
  --radius-sm: calc(0.25rem - 4px);
30
32
  --radius-md: calc(0.25rem - 2px);
@@ -24,7 +24,8 @@
24
24
  .dark {
25
25
  --primary: hsl(189 100% 50%);
26
26
  --primary-foreground: hsl(0 0% 9%);
27
- --accent: hsl(189 40% 18%);
27
+ /* 20%, not 18%: --background is 14.5%, so this was 3.5 points. */
28
+ --accent: hsl(189 40% 20%);
28
29
  --accent-foreground: hsl(189 100% 78%);
29
30
  --ring: hsl(189 100% 50%);
30
31
  --sidebar-primary: hsl(189 100% 50%);
@@ -14,7 +14,8 @@
14
14
  --muted: hsl(240 8% 91%);
15
15
  /* Readable even when muted text sits on the muted fill itself (4.63:1). */
16
16
  --muted-foreground: hsl(240 3% 41%);
17
- --accent: hsl(211 50% 96%);
17
+ /* 91%, not 96%: --background is 97%, so this was a one-point step. */
18
+ --accent: hsl(211 50% 91%);
18
19
  --accent-foreground: hsl(211 100% 36%);
19
20
  /* Keep white destructive labels AA-readable in the light theme (5.69:1). */
20
21
  --destructive: hsl(2 80% 44%);
@@ -30,7 +31,14 @@
30
31
  --sidebar-foreground: hsl(0 0% 7%);
31
32
  --sidebar-primary: hsl(211 100% 44%);
32
33
  --sidebar-primary-foreground: hsl(0 0% 100%);
33
- --sidebar-accent: hsl(211 50% 93%);
34
+ /* 88%, not 93% (2026-08-03). The sidebar sits on 94%, so a 93% hover was a
35
+ ONE-point step — invisible — while the dark pair (5% -> 16%) gets eleven.
36
+ Light mode was doing a quarter of the work of dark for the same
37
+ interaction. Measured against --sidebar-background, which is the surface a
38
+ rail hover actually lands on; the contrast rule below only ever compared
39
+ --muted with --background, so this pair passed every gate while looking
40
+ flat on screen. */
41
+ --sidebar-accent: hsl(211 50% 88%);
34
42
  --sidebar-accent-foreground: hsl(211 100% 36%);
35
43
  --sidebar-border: hsl(240 3% 82%);
36
44
  --sidebar-ring: hsl(211 100% 50%);
@@ -12,7 +12,8 @@
12
12
  --secondary-foreground: hsl(0 0% 9%);
13
13
  --muted: hsl(0 0% 92%);
14
14
  --muted-foreground: hsl(0 0% 42%);
15
- --accent: hsl(210 60% 94%);
15
+ /* 89%, not 94%: --background is 95%, so this was a one-point step. */
16
+ --accent: hsl(210 60% 89%);
16
17
  --accent-foreground: hsl(210 100% 28%);
17
18
  --destructive: hsl(0 90% 55%);
18
19
  --destructive-foreground: hsl(0 0% 100%);
@@ -26,7 +27,11 @@
26
27
  --sidebar-foreground: hsl(0 0% 9%);
27
28
  --sidebar-primary: hsl(210 100% 38%);
28
29
  --sidebar-primary-foreground: hsl(0 0% 100%);
29
- --sidebar-accent: hsl(210 50% 93%);
30
+ /* 86%, not 93% (2026-08-03). The sidebar sits on 92%, so 93% was a ONE-point
31
+ step in the WRONG direction — the hover was lighter than the surface it sat
32
+ on, which reads as a smudge rather than a highlight. Dark gets eight
33
+ points; light now gets six. */
34
+ --sidebar-accent: hsl(210 50% 86%);
30
35
  --sidebar-accent-foreground: hsl(210 100% 28%);
31
36
  --sidebar-border: hsl(0 0% 86%);
32
37
  --sidebar-ring: hsl(210 100% 45%);
@@ -69,7 +69,10 @@
69
69
  --sidebar-foreground: hsl(0 0% 9%);
70
70
  --sidebar-primary: hsl(192 90% 35%);
71
71
  --sidebar-primary-foreground: hsl(0 0% 100%);
72
- --sidebar-accent: hsl(0 0% 95%);
72
+ /* 91%, not 95% (2026-08-03). The sidebar sits on 97%, so 95% was a two-point
73
+ step while the dark pair (11.8% -> 24%) gets twelve. Every preset that
74
+ inherits this token inherited an invisible hover with it. */
75
+ --sidebar-accent: hsl(0 0% 91%);
73
76
  --sidebar-accent-foreground: hsl(0 0% 9%);
74
77
  --sidebar-border: hsl(0 0% 90%);
75
78
  --sidebar-ring: hsl(217 91% 55%);