@cdx-ui/styles 0.0.1-beta.46 → 0.0.1-beta.47

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/README.md +33 -8
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -51,9 +51,9 @@ import prestige from '@cdx-ui/styles/presets/prestige.json';
51
51
  import pulse from '@cdx-ui/styles/presets/pulse.json';
52
52
  ```
53
53
 
54
- ### TypeScript types
54
+ ### TypeScript exports
55
55
 
56
- The package exports DTCG-compatible type definitions for theme objects, overrides, and related structures, plus the `useForgeFonts` hook:
56
+ The package exports DTCG-compatible type definitions, runtime constants for the override contract, and the `useForgeFonts` hook:
57
57
 
58
58
  ```typescript
59
59
  import type {
@@ -63,16 +63,40 @@ import type {
63
63
  ThemeOverrideMetadata,
64
64
  TokenGroup,
65
65
  TokenValue,
66
+ Preset,
66
67
  Mode,
67
68
  Platform,
68
69
  } from '@cdx-ui/styles';
69
70
 
70
- import { useForgeFonts } from '@cdx-ui/styles';
71
+ import {
72
+ useForgeFonts,
73
+ OVERRIDE_SCHEMA_VERSION,
74
+ SUPPORTED_OVERRIDE_SCHEMA_VERSIONS,
75
+ INPUT_TOKEN_MAP,
76
+ presetFonts,
77
+ } from '@cdx-ui/styles';
71
78
  ```
72
79
 
73
- - `useForgeFonts` — Hook that loads all preset display fonts (nine families, three per preset) plus platform web fonts (Inter, IBM Plex Mono) via `expo-font`. Returns `{ loaded: boolean; error: Error | null }`. Call in your root layout and gate rendering on the returned `loaded` boolean. See [Getting Started](../../docs/getting-started.md) for usage.
74
- - `ThemeMetadata` — metadata stored under `$extensions.com.forge.ui.theme` (name, preset, schema version).
75
- - `ThemeOverrideMetadata` — metadata for FI overrides under `$extensions.com.forge.ui.themeOverride` (base preset, schema version). See [Override Structure](../../docs/internal/token-architecture/16-override-structure.md) for the recommended payload format.
80
+ **Types:**
81
+
82
+ - `ThemeObject` — Complete Forge UI theme object (DTCG-compatible), including `modes`, `platform`, and `$extensions`.
83
+ - `ThemeOverride` — Hybrid FI override structure with `inputs` (brand values for palette generation) and optional per-mode `overrides`.
84
+ - `ThemeMetadata` / `ThemeOverrideMetadata` — Metadata stored under `$extensions.com.forge.ui.theme` and `$extensions.com.forge.ui.themeOverride`.
85
+ - `Preset` — Union type: `'poise' | 'prestige' | 'pulse'`.
86
+ - `TokenValue` / `TokenGroup` — DTCG leaf node and recursive group types.
87
+ - `Mode` / `Platform` — `'light' | 'dark'` and `'web' | 'ios' | 'android'`.
88
+
89
+ **Constants:**
90
+
91
+ - `OVERRIDE_SCHEMA_VERSION` — Current override contract version (`'1.0.0'`). Consuming apps gate FI override compatibility on this value.
92
+ - `SUPPORTED_OVERRIDE_SCHEMA_VERSIONS` — Array of schema versions accepted by this package version (includes current and optionally one prior version during transition windows).
93
+ - `INPUT_TOKEN_MAP` — Maps known input keys (`brandPrimary`, `accentPrimary`, `basePrimary`, `displayFont`) to the token path pattern each affects. Used by override application to route inputs to the correct palette namespace.
94
+ - `presetFonts` — Allowed display font families per preset, used by the Theme Editor for font selection and by consuming apps for validation.
95
+
96
+ **Hooks:**
97
+
98
+ - `useForgeFonts` — Loads all preset display fonts (nine families, three per preset) plus platform web fonts (Inter, IBM Plex Mono) via `expo-font`. Returns `{ loaded: boolean; error: Error | null }`. Call in your root layout and gate rendering on the returned `loaded` boolean. See [Getting Started](../../docs/getting-started.md) for usage.
99
+ - `useCdxFonts` — **Deprecated** alias for `useForgeFonts`. Retained for backward compatibility during the CDX → Forge rename transition. See [Getting Started](../../docs/getting-started.md) for the migration path.
76
100
 
77
101
  ## Token pipeline
78
102
 
@@ -166,8 +190,9 @@ styles/
166
190
  │ ├── build-tokens.mjs # Style Dictionary build + artifact generation
167
191
  │ └── validate-font-tokens.mjs # CI check: --font-* values match useForgeFonts keys
168
192
  ├── src/
169
- │ ├── index.ts # TypeScript type exports (ThemeObject, ThemeOverride, etc.)
170
- └── useForgeFonts.ts # Font loader hook (expo-font) — loads all preset display fonts
193
+ │ ├── index.ts # Types, override constants, hook re-exports
194
+ ├── useForgeFonts.ts # Font loader hook (expo-font) — loads all preset display fonts
195
+ │ └── useCdxFonts.ts # Deprecated alias for useForgeFonts
171
196
  ├── tokens/
172
197
  │ └── presets/
173
198
  │ ├── .manifest.json # SHA-256 checksums (written by fetch)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cdx-ui/styles",
3
- "version": "0.0.1-beta.46",
3
+ "version": "0.0.1-beta.47",
4
4
  "main": "lib/commonjs/index.js",
5
5
  "module": "lib/module/index.js",
6
6
  "react-native": "src/index.ts",
@@ -53,7 +53,7 @@
53
53
  "@expo-google-fonts/manrope": "0.4.2",
54
54
  "@expo-google-fonts/outfit": "0.4.3",
55
55
  "@expo-google-fonts/public-sans": "0.4.2",
56
- "@cdx-ui/utils": "0.0.1-beta.46"
56
+ "@cdx-ui/utils": "0.0.1-beta.47"
57
57
  },
58
58
  "peerDependencies": {
59
59
  "react": "^18.2.0 || ^19.0.0",