@djangocfg/ui-core 2.1.466 → 2.1.468

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.466",
3
+ "version": "2.1.468",
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.466",
131
+ "@djangocfg/i18n": "^2.1.468",
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.466",
210
- "@djangocfg/typescript-config": "^2.1.466",
209
+ "@djangocfg/i18n": "^2.1.468",
210
+ "@djangocfg/typescript-config": "^2.1.468",
211
211
  "@types/node": "^25.9.5",
212
212
  "@types/react": "19.2.15",
213
213
  "@types/react-dom": "19.2.3",
@@ -56,7 +56,8 @@ not depend on the physical path. The preset defines both `:root` (light) and
56
56
  For a product-specific adjustment, add a small override after the preset:
57
57
 
58
58
  ```css
59
- :root, .dark {
59
+ :root,
60
+ .dark {
60
61
  --font-size-base: 0.9375rem;
61
62
  --font-size-sm: 0.875rem;
62
63
  }
@@ -133,8 +134,12 @@ CSS rather than duplicating a pixel value in React.
133
134
  Color variables are complete CSS colors, never bare HSL triplets:
134
135
 
135
136
  ```css
136
- :root { --background: hsl(240 17% 97%); }
137
- .dark { --background: hsl(240 5% 8%); }
137
+ :root {
138
+ --background: hsl(240 17% 97%);
139
+ }
140
+ .dark {
141
+ --background: hsl(240 5% 8%);
142
+ }
138
143
  ```
139
144
 
140
145
  Tailwind maps semantic utilities to these variables through `@theme inline`.
@@ -144,7 +149,8 @@ Use `var(--background)` or `bg-background`; do not write
144
149
  Typography variables are ordinary CSS values:
145
150
 
146
151
  ```css
147
- :root, .dark {
152
+ :root,
153
+ .dark {
148
154
  --font-size-base: 0.8125rem;
149
155
  --font-size-sm: 0.75rem;
150
156
  }
@@ -157,6 +163,9 @@ Typography variables are ordinary CSS values:
157
163
  CSS color values.
158
164
  - Keep light and dark pairs together in the same file.
159
165
  - A preset may omit tokens that intentionally inherit from `theme.css`.
166
+ - In light mode, `--muted` must be at least 2 HSL lightness points darker
167
+ than `--background`. This keeps translucent muted fills visible on the
168
+ canvas and is enforced by `check:contrast`.
160
169
  - Changes to a preset require checking both light and dark modes.
161
170
  - Product density overrides belong in the consuming app's CSS, not in a copied
162
171
  TypeScript map.
@@ -168,11 +177,12 @@ pnpm check:contrast
168
177
  pnpm check
169
178
  ```
170
179
 
171
- `check:contrast` validates the macOS preset's compact-text semantic pairs at
172
- WCAG AA 4.5:1 in both modes. It includes primary, destructive, sidebar,
173
- status-surface, and muted text against every common surface. When tuning a
174
- token, change the semantic pair together rather than overriding text in a
175
- consumer component.
180
+ `check:contrast` merges every static preset over the base theme and validates
181
+ the light-mode background/muted surface hierarchy. It also keeps the complete
182
+ macOS compact-text audit: semantic pairs must reach WCAG AA 4.5:1 in both
183
+ modes, including primary, destructive, sidebar, status-surface, on-fill, and
184
+ muted text against every common surface. When tuning a token, change the
185
+ semantic pair together rather than overriding text in a consumer component.
176
186
 
177
187
  At the consumer, build the app that imports the preset and verify both modes.
178
188
  The important invariant is that changing a preset requires editing one CSS
@@ -19,6 +19,7 @@
19
19
  /* Keep white destructive labels AA-readable in the light theme (5.69:1). */
20
20
  --destructive: hsl(2 80% 44%);
21
21
  --destructive-foreground: hsl(0 0% 100%);
22
+ --on-destructive: hsl(0 0% 100%);
22
23
  --border: hsl(240 3% 78%);
23
24
  --input: hsl(240 8% 93%);
24
25
  --divider: hsl(240 4% 83%);
@@ -10,8 +10,10 @@
10
10
  */
11
11
 
12
12
  :root {
13
- /* Base colors - Clean white with neutral grays */
14
- --background: hsl(0 0% 94%);
13
+ /* Base colors - an off-white canvas with darker neutral fills and a white
14
+ * raised card. Keep `muted` below `background` in light mode so chips,
15
+ * message bubbles, and secondary controls never dissolve into the page. */
16
+ --background: hsl(0 0% 98%);
15
17
  --foreground: hsl(0 0% 9%);
16
18
  --card: hsl(0 0% 100%);
17
19
  --card-foreground: hsl(0 0% 9%);
@@ -22,7 +24,7 @@
22
24
  --primary-foreground: hsl(0 0% 100%);
23
25
  --secondary: hsl(0 0% 9%);
24
26
  --secondary-foreground: hsl(0 0% 98%);
25
- --muted: hsl(0 0% 96%);
27
+ --muted: hsl(0 0% 94%);
26
28
  --muted-foreground: hsl(0 0% 45%);
27
29
  /* Neutral interaction surface: a quiet step below the current light canvas.
28
30
  * It deliberately keys off --background, not white --card, so hover remains