@bsuite/theme 0.11.2 → 0.12.0

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.
Files changed (2) hide show
  1. package/package.json +8 -3
  2. package/src/css/fonts.css +130 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bsuite/theme",
3
- "version": "0.11.2",
3
+ "version": "0.12.0",
4
4
  "type": "module",
5
5
  "license": "UNLICENSED",
6
6
  "publishConfig": {
@@ -11,7 +11,7 @@
11
11
  "url": "https://github.com/GaryOcean428/bsuite.git",
12
12
  "directory": "packages/theme"
13
13
  },
14
- "description": "BSuite Universal theme D2C Neon Electric + Braden Corporate baselines. Tailwind v4 preset, CSS vars (5-layer), role aliases, colourblind-safe tokens, eye-strain-safe text scale, BrandingProvider (runtime white-label). Used by BSU, CRM7, conduit, R80.3, throughput (D2C) and braden.com.au (Corporate).",
14
+ "description": "BSuite Universal theme \u2014 D2C Neon Electric + Braden Corporate baselines. Tailwind v4 preset, CSS vars (5-layer), role aliases, colourblind-safe tokens, eye-strain-safe text scale, BrandingProvider (runtime white-label). Used by BSU, CRM7, conduit, R80.3, throughput (D2C) and braden.com.au (Corporate).",
15
15
  "files": [
16
16
  "dist",
17
17
  "src/css",
@@ -36,7 +36,8 @@
36
36
  "./css": "./src/css/index.css",
37
37
  "./vars.css": "./src/css/vars.css",
38
38
  "./utilities.css": "./src/css/utilities.css",
39
- "./braden-css": "./src/css/braden.css"
39
+ "./braden-css": "./src/css/braden.css",
40
+ "./fonts.css": "./src/css/fonts.css"
40
41
  },
41
42
  "scripts": {
42
43
  "build": "tsc -p tsconfig.build.json",
@@ -72,5 +73,9 @@
72
73
  "typescript": "~6.0.3",
73
74
  "vite": "^8.0.16",
74
75
  "vitest": "^4.1.8"
76
+ },
77
+ "dependencies": {
78
+ "@fontsource-variable/geist": "^5.3.0",
79
+ "@fontsource-variable/geist-mono": "^5.3.0"
75
80
  }
76
81
  }
@@ -0,0 +1,130 @@
1
+ /**
2
+ * @bsuite/theme/fonts.css — the faces the theme's own tokens name.
3
+ *
4
+ * WHY THIS FILE EXISTS
5
+ * ────────────────────
6
+ * `vars.css` declares the typography contract:
7
+ *
8
+ * --font-body: 'Geist Variable', Geist, system-ui, sans-serif
9
+ * --font-mono: 'Geist Mono Variable', 'Geist Mono', ui-monospace, monospace
10
+ *
11
+ * and until now this package shipped **zero `@font-face` rules**. A token NAMES a
12
+ * family; only an `@font-face` makes it EXIST. So six consumers each solved it
13
+ * independently and they diverged — measured across `origin/development`,
14
+ * 2026-08-17:
15
+ *
16
+ * business-suite-unified body ok mono ok hand-written @font-face
17
+ * crm7 body ok mono ok hand-written (mono added the same day)
18
+ * conduit body ok mono ok whole-package import, ALL FIVE SUBSETS
19
+ * throughput body ok mono ok whole-package import, ALL FIVE SUBSETS
20
+ * braden body ok mono MISSING third-party Google Fonts <link>
21
+ * R80.4 body MISSING mono MISSING NO WEBFONTS AT ALL
22
+ *
23
+ * R80.4 is the sharpest case: the wage calculator imports this theme, inherits
24
+ * `'Geist Variable'`, and has no Geist anywhere in its repo. It has always
25
+ * painted in `system-ui`. Its own `index.css` carries a long, careful note about
26
+ * theme VERSION drift — and the fonts that theme names were never there to drift.
27
+ *
28
+ * Six bespoke solutions is the defect, not the symptom. A token and its face
29
+ * belong together, in the package that owns the token.
30
+ *
31
+ * WHAT THIS SHIPS, AND WHAT IT DELIBERATELY DOES NOT
32
+ * ─────────────────────────────────────────────────
33
+ * Four faces: Geist Variable and Geist Mono Variable, latin and latin-ext, woff2
34
+ * only, upright only.
35
+ *
36
+ * - **woff2 only.** Every app targets es2022 / chrome100 / edge100 /
37
+ * firefox100 / safari15.4. woff2 has shipped in all of them since 2016, so a
38
+ * legacy `.woff` fallback is dead weight BY CONSTRUCTION, not by measurement.
39
+ * crm7 was carrying eight JetBrains Mono weights in both formats — sixteen
40
+ * files, ~400 KB — for a family nothing in crm7 ever requested.
41
+ *
42
+ * - **latin + latin-ext only.** `@fontsource-variable/geist` publishes no
43
+ * per-subset CSS, so `@import '@fontsource-variable/geist'` pulls cyrillic,
44
+ * cyrillic-ext and vietnamese too, upright AND italic — ten files per family.
45
+ * conduit and throughput are paying for Cyrillic today. An app that genuinely
46
+ * needs another subset should add that face itself and say why.
47
+ *
48
+ * - **upright only.** No italic face is declared, so italic text synthesises.
49
+ * Verified before deciding: no D2C surface in the estate sets an italic
50
+ * `font-family` against these tokens. If one ever does, add the italic file
51
+ * here rather than importing the whole package again.
52
+ *
53
+ * - **variable, not static weights.** One file per subset covers 100–900. The
54
+ * eight discrete weights it replaces were eight separate downloads.
55
+ *
56
+ * The `unicode-range` values are copied verbatim from crm7's own working faces
57
+ * rather than re-derived. Re-typing a subset range is how a subset silently loses
58
+ * a glyph, and those were already correct.
59
+ *
60
+ * HOW TO USE IT
61
+ * ─────────────
62
+ * @import '@bsuite/theme/fonts.css'; /* before your token import */
63
+ * @import '@bsuite/theme/css';
64
+ *
65
+ * This is a SEPARATE entry point, not folded into `./css`, on purpose: `braden`
66
+ * is BRADEN-EXEMPT and runs its corporate Open Sans / Montserrat stack, so it
67
+ * must be able to take the tokens without taking Geist.
68
+ */
69
+
70
+ /* ── Geist Variable — the family `--font-body` names ───────────────────────── */
71
+
72
+ @font-face {
73
+ font-family: 'Geist Variable';
74
+ font-style: normal;
75
+ font-display: swap;
76
+ font-weight: 100 900;
77
+ src: url('@fontsource-variable/geist/files/geist-latin-wght-normal.woff2')
78
+ format('woff2-variations');
79
+ unicode-range:
80
+ U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
81
+ U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
82
+ }
83
+
84
+ @font-face {
85
+ font-family: 'Geist Variable';
86
+ font-style: normal;
87
+ font-display: swap;
88
+ font-weight: 100 900;
89
+ src: url('@fontsource-variable/geist/files/geist-latin-ext-wght-normal.woff2')
90
+ format('woff2-variations');
91
+ unicode-range:
92
+ U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
93
+ U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
94
+ U+A720-A7FF;
95
+ }
96
+
97
+ /* ── Geist Mono Variable — the family `--font-mono` names ──────────────────── */
98
+ /*
99
+ * This is the one that was missing almost everywhere. `--font-mono` resolves to
100
+ * 'Geist Mono Variable' in the D2C palette, and until 2026-08-17 crm7 declared no
101
+ * face for it at all — so every `font-mono` element fell through to
102
+ * `ui-monospace`: TFN and bank-account digits on the payroll card, AASS
103
+ * registration numbers, the charge-rate build-up tables, code blocks in the AI
104
+ * assistant's markdown. The theme's mono face had never once rendered as designed.
105
+ */
106
+
107
+ @font-face {
108
+ font-family: 'Geist Mono Variable';
109
+ font-style: normal;
110
+ font-display: swap;
111
+ font-weight: 100 900;
112
+ src: url('@fontsource-variable/geist-mono/files/geist-mono-latin-wght-normal.woff2')
113
+ format('woff2-variations');
114
+ unicode-range:
115
+ U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
116
+ U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
117
+ }
118
+
119
+ @font-face {
120
+ font-family: 'Geist Mono Variable';
121
+ font-style: normal;
122
+ font-display: swap;
123
+ font-weight: 100 900;
124
+ src: url('@fontsource-variable/geist-mono/files/geist-mono-latin-ext-wght-normal.woff2')
125
+ format('woff2-variations');
126
+ unicode-range:
127
+ U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
128
+ U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
129
+ U+A720-A7FF;
130
+ }