@weasel-js/theme 1.7.0 → 1.7.2

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/dist/react.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { a as Theme, S as Selection, o as ResolvedTheme, v as ColorList } from './definition-Dqt5o6LR.js';
2
+ import { a as Theme, S as Selection, o as ResolvedTheme, v as ColorList } from './definition-DxvV2RH3.js';
3
3
  import { a as ColorModePreference, C as ColorMode } from './colorMode-CoklZomJ.js';
4
4
  export { i as isColorModePreference } from './colorMode-CoklZomJ.js';
5
5
 
package/dist/react.js CHANGED
@@ -1,6 +1,6 @@
1
- import { isColorModePreference, weaselTheme, themeTones, applyTheme } from './chunk-3KMZGDV5.js';
2
- export { isColorModePreference } from './chunk-3KMZGDV5.js';
3
- import { themeAxes, fullSelection, selectionKey, resolveTheme } from './chunk-C3S4A65R.js';
1
+ import { isColorModePreference, weaselTheme, themeTones, applyTheme } from './chunk-HO2AM2OB.js';
2
+ export { isColorModePreference } from './chunk-HO2AM2OB.js';
3
+ import { themeAxes, fullSelection, selectionKey, resolveTheme } from './chunk-AN5JVL2S.js';
4
4
  import { createContext, useState, useEffect, useCallback, useRef, useMemo, useLayoutEffect, useContext } from 'react';
5
5
  import { jsx } from 'react/jsx-runtime';
6
6
 
package/dist/tokens.css CHANGED
@@ -33,17 +33,17 @@
33
33
  --wzl-swatch-rose: #fa4590;
34
34
  --wzl-swatch-violet: #955cf9;
35
35
  /* Shortcut keys and index badges. The floor for chrome text. */
36
- --wzl-font-size-2xs: 9px;
36
+ --wzl-font-size-2xs: 10px;
37
37
  /* Tool-button labels under an icon. */
38
- --wzl-font-size-xs: 10px;
38
+ --wzl-font-size-xs: 12px;
39
39
  /* Chrome labels, status readouts, section headings. */
40
- --wzl-font-size-sm: 11px;
40
+ --wzl-font-size-sm: 13px;
41
41
  /* Controls and body text. */
42
- --wzl-font-size-md: 13px;
42
+ --wzl-font-size-md: 15px;
43
43
  /* Panel and dialog titles. */
44
- --wzl-font-size-lg: 16px;
44
+ --wzl-font-size-lg: 18px;
45
45
  /* The largest chrome text — a lab or app title. */
46
- --wzl-font-size-xl: 20px;
46
+ --wzl-font-size-xl: 23px;
47
47
  --wzl-space-1: 2px;
48
48
  --wzl-space-2: 4px;
49
49
  --wzl-space-3: 6px;
@@ -149,19 +149,23 @@
149
149
  /* Drawn data curves. Heavier than structural lines so data reads as primary content. */
150
150
  --wzl-curve-width: 3px;
151
151
  /* Height of a horizontal toolbar strip (ButtonBar, OptionsBar, ToolOptionsBar). Taller than control-h so the controls inside a strip are not flush with its edges. */
152
- --wzl-tb-height: 28px;
152
+ --wzl-tb-height: 32px;
153
153
  /* Height of the smallest interactive control -- a stepper, a keycap, a swatch button in a dense row. The rank below control-h-sm. */
154
- --wzl-control-h-xs: 18px;
154
+ --wzl-control-h-xs: 22px;
155
155
  /* Height of a control in a dense inspector -- a Properties field, a small Button. The rank below control-h, which sizes a standalone control. */
156
- --wzl-control-h-sm: 20px;
156
+ --wzl-control-h-sm: 24px;
157
157
  /* Height of an interactive control — button, input, select, segmented control. Distinct from tb-height, which sizes the strip a row of them sits in. */
158
- --wzl-control-h: 24px;
158
+ --wzl-control-h: 28px;
159
159
  /* Side of a square icon button -- a dialog close, a row remove, a field clear. Smaller than control-h because it carries a glyph rather than a label, and square, so it sizes both axes. */
160
- --wzl-icon-button-size: 22px;
160
+ --wzl-icon-button-size: 26px;
161
161
  /* Height of a linear range track. The kit's single-thumb ranges all wear this; Slider's default 24px canvas track does not. */
162
162
  --wzl-slider-track-h: 4px;
163
163
  /* Diameter of a linear range thumb. */
164
164
  --wzl-slider-thumb-size: 8px;
165
+ /* How far past a range track's edge a press still lands on it. Invisible, and overlaps whatever sits beside the track rather than taking layout space. */
166
+ --wzl-slider-track-slop: 6px;
167
+ /* How far past a range thumb's edge a press still grabs the thumb rather than landing on the track. Sits over the track's own slop. */
168
+ --wzl-slider-thumb-slop: 6px;
165
169
  /* Accent proportion in a range track, as a color-mix percentage — not a color. Mixed into a real property, never into another custom property. */
166
170
  --wzl-slider-track-mix: 18%;
167
171
  /* Accent proportion in a range thumb, as a color-mix percentage — not a color. */
@@ -214,6 +218,8 @@
214
218
  --wzl-ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
215
219
  /* Condensed UI/display face. The heavier cuts get blocky at any size, so the weight tokens stay in the 200-400 range. */
216
220
  --wzl-font-ui: Oswald, 'Helvetica Neue Condensed', 'Arial Narrow', system-ui, sans-serif;
221
+ /* The UI face with equal-width digits, for numbers read down a column or updated in place. Oswald Tabular carries only 0-9 and the figure space (U+2007); every other character falls through to the UI face. */
222
+ --wzl-font-numeric: 'Oswald Tabular', var(--wzl-font-ui);
217
223
  --wzl-font-display: Oswald, 'Helvetica Neue Condensed', 'Arial Narrow', system-ui, sans-serif;
218
224
  --wzl-font-body: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
219
225
  --wzl-font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
@@ -329,24 +335,6 @@
329
335
 
330
336
  [data-wzl-theme='weasel'][data-wzl-density='compact'],
331
337
  [data-wzl-density='compact'] {
332
- --wzl-font-size-2xs: 7px;
333
- --wzl-font-size-xs: 8px;
334
- --wzl-font-size-sm: 9px;
335
- --wzl-font-size-md: 11px;
336
- --wzl-font-size-lg: 14px;
337
- --wzl-font-size-xl: 17px;
338
- --wzl-tb-height: 24px;
339
- --wzl-control-h-xs: 16px;
340
- --wzl-control-h-sm: 18px;
341
- --wzl-control-h: 20px;
342
- --wzl-icon-button-size: 20px;
343
- --wzl-panel-title-size: var(--wzl-font-size-lg);
344
- --wzl-stance-preview-title-size: var(--wzl-font-size-xs);
345
- --wzl-font-size: var(--wzl-font-size-md);
346
- }
347
-
348
- [data-wzl-theme='weasel'][data-wzl-density='comfortable'],
349
- [data-wzl-density='comfortable'] {
350
338
  --wzl-font-size-2xs: 9px;
351
339
  --wzl-font-size-xs: 10px;
352
340
  --wzl-font-size-sm: 11px;
@@ -363,8 +351,8 @@
363
351
  --wzl-font-size: var(--wzl-font-size-md);
364
352
  }
365
353
 
366
- [data-wzl-theme='weasel'][data-wzl-density='roomy'],
367
- [data-wzl-density='roomy'] {
354
+ [data-wzl-theme='weasel'][data-wzl-density='comfortable'],
355
+ [data-wzl-density='comfortable'] {
368
356
  --wzl-font-size-2xs: 10px;
369
357
  --wzl-font-size-xs: 12px;
370
358
  --wzl-font-size-sm: 13px;
@@ -380,3 +368,21 @@
380
368
  --wzl-stance-preview-title-size: var(--wzl-font-size-xs);
381
369
  --wzl-font-size: var(--wzl-font-size-md);
382
370
  }
371
+
372
+ [data-wzl-theme='weasel'][data-wzl-density='roomy'],
373
+ [data-wzl-density='roomy'] {
374
+ --wzl-font-size-2xs: 12px;
375
+ --wzl-font-size-xs: 14px;
376
+ --wzl-font-size-sm: 15px;
377
+ --wzl-font-size-md: 18px;
378
+ --wzl-font-size-lg: 22px;
379
+ --wzl-font-size-xl: 28px;
380
+ --wzl-tb-height: 38px;
381
+ --wzl-control-h-xs: 26px;
382
+ --wzl-control-h-sm: 28px;
383
+ --wzl-control-h: 34px;
384
+ --wzl-icon-button-size: 32px;
385
+ --wzl-panel-title-size: var(--wzl-font-size-lg);
386
+ --wzl-stance-preview-title-size: var(--wzl-font-size-xs);
387
+ --wzl-font-size: var(--wzl-font-size-md);
388
+ }
package/fonts/README.md CHANGED
@@ -1,11 +1,12 @@
1
1
  # Bundled fonts
2
2
 
3
- Two OFL-1.1 faces, vendored so the kit never fetches a stylesheet from a
3
+ OFL-1.1 faces, vendored so the kit never fetches a stylesheet from a
4
4
  third-party host at runtime.
5
5
 
6
6
  | file | token | role |
7
7
  |---|---|---|
8
8
  | `oswald-latin-variable.woff2` | `--wzl-font-ui`, `--wzl-font-display` | condensed UI/display face, variable `wght 200–700` |
9
+ | `oswald-tabular-digits.woff2` | `--wzl-font-numeric` | Oswald's digits 0–9, plus (U+002B) and minus (U+2212), each centered in the widest digit's advance at every weight, and a figure space (U+2007) that wide, as family `Oswald Tabular` |
9
10
  | `inter-latin.woff2` | `--wzl-font-body` | body/prose face, weight 400 |
10
11
 
11
12
  Loading them is opt-in: `import '@weasel-js/theme/fonts.css'`, or
@@ -19,7 +20,7 @@ with no error anywhere.
19
20
 
20
21
  ## Tooling
21
22
 
22
- Both commands need `fontTools` **with the Brotli extension** — without it,
23
+ These commands need `fontTools` **with the Brotli extension** — without it,
23
24
  `--flavor=woff2` fails with `ImportError: No module named brotli`. Homebrew's
24
25
  `fonttools` formula does not include it, so use a throwaway venv:
25
26
 
@@ -53,6 +54,29 @@ in the kit reads hints.
53
54
  Oswald's OFL notice carries **no Reserved Font Name**, so a subset may keep the
54
55
  family name.
55
56
 
57
+ ## Provenance — Oswald Tabular
58
+
59
+ Built from `oswald-latin-variable.woff2` by `scripts/oswald-tabular.py` (same
60
+ venv): subset to U+0030–0039, U+002B and U+2212 with no layout features, then
61
+ every digit and sign gets the widest digit's advance at the default weight and
62
+ at each `wght` master, its outline shifted by half the difference so it stays
63
+ centered, and `HVAR` is rebuilt from the patched `gvar`. The minus is rebuilt
64
+ from the plus's crossbar first: Oswald draws it shorter than that arm, which a
65
+ column of signed figures would show. U+2212 rather than the hyphen, so a hyphen
66
+ in a date stays a hyphen; `@weasel-js/quantity` writes negatives with U+2212. A blank U+2007 of the same width is added, because
67
+ Oswald has none and `Jog` and `DetailList` pad numbers with it. Oswald ships no `tnum` feature, so this is the
68
+ only way its figures line up in a column. The widest digit is `0` at every
69
+ weight, so no digit is padded past Oswald's own widest.
70
+
71
+ ```sh
72
+ /tmp/fontvenv/bin/python packages/theme/scripts/oswald-tabular.py
73
+ ```
74
+
75
+ It is a separate family rather than a patched Oswald so that only text asking
76
+ for `--wzl-font-numeric` gets tabular digits; running text keeps Oswald's
77
+ proportional ones. The face covers digits, the two signs and the figure space alone, so the browser takes every
78
+ other character from the next family in the stack.
79
+
56
80
  ## Provenance — Inter
57
81
 
58
82
  Re-flavored from `assets/fonts/inter/inter.ttf`, which is already Inter v4.1
@@ -70,6 +94,6 @@ README for the original command):
70
94
 
71
95
  ## License
72
96
 
73
- Both faces are SIL Open Font License 1.1 — `OFL-Oswald.txt` and `OFL-Inter.txt`,
97
+ All three faces are SIL Open Font License 1.1 — `OFL-Oswald.txt` and `OFL-Inter.txt`,
74
98
  redistributed with the fonts as the license requires. The OFL covers these font
75
99
  binaries only; the package's code is MIT (see `../LICENSE`).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@weasel-js/theme",
3
- "version": "1.7.0",
3
+ "version": "1.7.2",
4
4
  "description": "Design tokens shared by weasel-ui and weasel-hud — CSS variables + a parallel TS export.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -26,10 +26,11 @@
26
26
  "./tokens.css": "./dist/tokens.css",
27
27
  "./fonts.css": "./dist/fonts.css",
28
28
  "./faces.css": "./dist/faces.css",
29
+ "./numeric.module.css": "./dist/numeric.module.css",
29
30
  "./package.json": "./package.json"
30
31
  },
31
32
  "dependencies": {
32
- "@weasel-js/paint": "1.7.0"
33
+ "@weasel-js/paint": "1.7.2"
33
34
  },
34
35
  "peerDependencies": {
35
36
  "react": ">=18"
@@ -61,7 +62,7 @@
61
62
  ],
62
63
  "scripts": {
63
64
  "gen:tokens": "tsx scripts/build-tokens.ts",
64
- "build": "npm run gen:tokens && tsup && cp src/generated/tokens.css dist/tokens.css && cp src/fonts.css src/faces.css dist/"
65
+ "build": "npm run gen:tokens && tsup && cp src/generated/tokens.css dist/tokens.css && cp src/fonts.css src/faces.css src/numeric.module.css dist/"
65
66
  },
66
67
  "publishConfig": {
67
68
  "access": "public",