@cosxai/ui 0.4.0 → 0.4.1

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": "@cosxai/ui",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "COSX design system — React 19 component primitives shared across product-meta and other consumers",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -2,7 +2,11 @@
2
2
  Loaded from Google Fonts CDN — Geist + Geist Mono cover the
3
3
  default sans/mono slots; Playfair Display drives the editorial
4
4
  chrome's display heading; Caveat covers the sketch chrome's
5
- handwritten display. All four are SIL OFL free to redistribute.
5
+ handwritten display; Noto Serif SC is the matching CJK serif for
6
+ the editorial heading so a name like "本杰明 Zoë" renders Latin in
7
+ Playfair Display and Chinese in Noto Serif SC without leaking to
8
+ PingFang SC / SimSun (sans-serif system fallbacks that mis-pair
9
+ with the editorial high-contrast serif). All five are SIL OFL.
6
10
 
7
11
  Why Google Fonts CDN over self-hosting:
8
12
  1. Self-hosted /fonts/*.otf had to be shipped per-consumer
@@ -16,9 +20,17 @@
16
20
  3. font-display=swap means the system fallback paints first,
17
21
  the web font upgrades on arrival — no FOIT.
18
22
 
23
+ Bandwidth shape — Noto Serif SC is the only large family in the
24
+ set (CJK fonts dwarf Latin by character count). Google Fonts ships
25
+ it as ~100 unicode-range subsets; the browser only fetches a
26
+ subset when a character in its range is rendered. Pure-Latin
27
+ pages pay the CSS file (~5-10KB gzip) but no .woff2 — pages with
28
+ Chinese names pay an additional ~200-400KB of subset binaries
29
+ spread across the few CJK ranges they actually use.
30
+
19
31
  For offline / enterprise deploys that block Google Fonts, a
20
32
  consumer can override --ck-font-sans/serif/mono in tokens.css
21
33
  to fall back entirely to the system-font slot at the tail of
22
34
  each stack. */
23
35
 
24
- @import url("https://fonts.googleapis.com/css2?family=Geist:wght@300..700&family=Geist+Mono:wght@400..700&family=Playfair+Display:wght@400..900&family=Caveat:wght@400..700&display=swap");
36
+ @import url("https://fonts.googleapis.com/css2?family=Geist:wght@300..700&family=Geist+Mono:wght@400..700&family=Playfair+Display:wght@400..900&family=Caveat:wght@400..700&family=Noto+Serif+SC:wght@400..900&display=swap");
@@ -19,19 +19,31 @@
19
19
  generic family so 中文 / 日本語 / 한국어 don't drop to the
20
20
  browser's last-resort glyph (renders as tofu on locked-down
21
21
  hosts). Browsers do per-character fallback — Latin hits
22
- Geist/Playfair, CJK hits the matching system serif/sans. We
23
- deliberately don't load a Noto SC web font here: every modern
24
- OS ships PingFang SC (macOS / iOS), Microsoft YaHei
25
- (Windows), or Source Han Sans (Android / ChromeOS), and the
26
- extra ~150KB Google Fonts request to serve users a font they
27
- already have is bad citizenship. */
22
+ Geist/Playfair, CJK hits the next matching family in the stack.
23
+
24
+ Serif slot ALSO carries Noto Serif SC as a web-font fallback
25
+ (loaded via fonts.css). Reason: the editorial chrome's display
26
+ heading uses Playfair Display, a high-contrast modern serif
27
+ pairing it with PingFang SC / SimSun (the system *sans-serif*
28
+ CJK fallbacks) reads as a style break. Adobe/Google's Noto Serif
29
+ SC matches Playfair's serif vocabulary cross-platform without
30
+ depending on the user having Songti SC / STSong / Source Han
31
+ Serif SC installed locally. Cost is lazy: subset .woff2 only
32
+ downloads when a CJK character is actually rendered (per
33
+ fonts.css's unicode-range mechanism); pure-Latin pages pay only
34
+ the small CSS file.
35
+
36
+ Sans + mono slots stay system-only — system sans CJK
37
+ (PingFang SC / Microsoft YaHei) is what users expect for UI
38
+ copy, and the visual mismatch concern doesn't apply when the
39
+ Latin half is also a clean grotesk. */
28
40
  --ck-font-sans: "Geist", "Inter", system-ui, -apple-system,
29
41
  "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
30
42
  "Source Han Sans SC", sans-serif;
31
43
  --ck-font-mono: "Geist Mono", "JetBrains Mono", ui-monospace, "SF Mono", Menlo,
32
44
  "Sarasa Mono SC", monospace;
33
- --ck-font-serif: "Playfair Display", "GT Sectra", "Canela", Georgia,
34
- "Songti SC", "STSong", "Source Han Serif SC", serif;
45
+ --ck-font-serif: "Playfair Display", "Noto Serif SC", "GT Sectra", "Canela",
46
+ Georgia, "Songti SC", "STSong", "Source Han Serif SC", serif;
35
47
  --ck-font-display: var(--ck-font-sans);
36
48
 
37
49
  /* ---------- Radii / motion ---------- */