@cosxai/ui 0.3.3 → 0.4.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cosxai/ui",
3
- "version": "0.3.3",
3
+ "version": "0.4.0",
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",
@@ -346,7 +346,15 @@ export function ActionBar({
346
346
  bottom: pos.bottom,
347
347
  }),
348
348
  height: BAR_HEIGHT,
349
- padding: "0 6px 0 0",
349
+ // Symmetric horizontal padding so the bar's interior content
350
+ // area is centred. Previously only the right side had 6px
351
+ // padding (legacy from when the right edge held normal items
352
+ // and the left edge was an interactive grip), which made the
353
+ // grip sit flush against the left curve while the rightmost
354
+ // element (now the status dot) had visible breathing room.
355
+ // The asymmetry pushed the leading items a few pixels left of
356
+ // the bar's true centre.
357
+ padding: "0 6px",
350
358
  display: "flex",
351
359
  alignItems: "center",
352
360
  gap: 4,
@@ -431,7 +439,7 @@ export function ActionBar({
431
439
  <span
432
440
  aria-hidden
433
441
  data-ck-actionbar-spacer
434
- style={{ flex: "1 1 auto", minWidth: 12 }}
442
+ style={{ flex: "1 1 auto", minWidth: 0 }}
435
443
  />
436
444
  )}
437
445
 
@@ -1,22 +1,24 @@
1
- /* @font-face declarations for the kit's default sans + mono.
2
- Consumer projects supply the OTF/WOFF2 files under /fonts/ (the
3
- library's public/fonts/ directory is a reference copy for when
4
- the kit is consumed standalone). Swap out for your own brand
5
- stack by overriding --ck-font-sans / --ck-font-mono after
6
- importing this file. */
1
+ /* Web-font loading for the kit's typographic vocabulary.
2
+ Loaded from Google Fonts CDN Geist + Geist Mono cover the
3
+ default sans/mono slots; Playfair Display drives the editorial
4
+ chrome's display heading; Caveat covers the sketch chrome's
5
+ handwritten display. All four are SIL OFL — free to redistribute.
7
6
 
8
- @font-face {
9
- font-family: "Geist";
10
- src: url("/fonts/Geist-Regular.otf") format("opentype");
11
- font-weight: 400 700;
12
- font-style: normal;
13
- font-display: swap;
14
- }
7
+ Why Google Fonts CDN over self-hosting:
8
+ 1. Self-hosted /fonts/*.otf had to be shipped per-consumer
9
+ (the previous setup), and consumers that forgot returned
10
+ SPA index.html for the font URL, surfacing a noisy
11
+ "Failed to decode downloaded font" warning in every
12
+ production console.
13
+ 2. The CDN handles font-display, variable-font subsetting,
14
+ and per-browser format selection automatically; we just
15
+ consume the @import.
16
+ 3. font-display=swap means the system fallback paints first,
17
+ the web font upgrades on arrival — no FOIT.
15
18
 
16
- @font-face {
17
- font-family: "Geist Mono";
18
- src: url("/fonts/GeistMono-Regular.otf") format("opentype");
19
- font-weight: 400 600;
20
- font-style: normal;
21
- font-display: swap;
22
- }
19
+ For offline / enterprise deploys that block Google Fonts, a
20
+ consumer can override --ck-font-sans/serif/mono in tokens.css
21
+ to fall back entirely to the system-font slot at the tail of
22
+ each stack. */
23
+
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");
@@ -13,10 +13,25 @@
13
13
  serif (editorial body), and display (headlines). By default
14
14
  display = sans so headings inherit the same neutral grotesk;
15
15
  editorial chrome overrides display → serif to flip headlines
16
- to a high-contrast serif without touching component code. */
17
- --ck-font-sans: "Geist", "Inter", system-ui, -apple-system, sans-serif;
18
- --ck-font-mono: "Geist Mono", "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
19
- --ck-font-serif: "Playfair Display", "GT Sectra", "Canela", Georgia, serif;
16
+ to a high-contrast serif without touching component code.
17
+
18
+ Each stack ends with CJK system-font fallbacks before the
19
+ generic family so 中文 / 日本語 / 한국어 don't drop to the
20
+ browser's last-resort glyph (renders as tofu on locked-down
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. */
28
+ --ck-font-sans: "Geist", "Inter", system-ui, -apple-system,
29
+ "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
30
+ "Source Han Sans SC", sans-serif;
31
+ --ck-font-mono: "Geist Mono", "JetBrains Mono", ui-monospace, "SF Mono", Menlo,
32
+ "Sarasa Mono SC", monospace;
33
+ --ck-font-serif: "Playfair Display", "GT Sectra", "Canela", Georgia,
34
+ "Songti SC", "STSong", "Source Han Serif SC", serif;
20
35
  --ck-font-display: var(--ck-font-sans);
21
36
 
22
37
  /* ---------- Radii / motion ---------- */