@nxds/core 0.11.0 → 0.13.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.
@@ -49,6 +49,8 @@ type NxdsElevation = 'flat' | 'quiet' | 'soft' | 'standard' | 'strong';
49
49
  type NxdsStroke = 'fine' | 'normal' | 'strong';
50
50
  interface NxdsAppearancePrefs {
51
51
  uiFont: string;
52
+ /** The heading `font-family` stack. `null` follows `uiFont`. */
53
+ headingFont: string | null;
52
54
  codeFont: string;
53
55
  uiFontSize: number;
54
56
  codeFontSize: number;
@@ -158,10 +160,15 @@ declare const STROKE_OPTIONS: readonly [{
158
160
  readonly label: "Strong";
159
161
  }];
160
162
  declare const DEFAULT_NXDS_APPEARANCE: NxdsAppearanceState;
163
+ /** The font sizes, in px, the appearance prefs take. */
164
+ declare const FONT_SIZE_PX_MIN = 8;
165
+ declare const FONT_SIZE_PX_MAX = 32;
161
166
  declare function normalizeAppearanceModeIds(raw: unknown): unknown;
162
167
  declare function sanitizeNxdsAppearancePrefs(raw: unknown): NxdsAppearancePrefs;
163
168
  declare function sanitizeNxdsAppearance(rawInput: unknown): NxdsAppearanceState;
164
- declare function createNxdsThemeContract(state: NxdsAppearanceState): ThemeDerivationInput;
169
+ /** The appearance fields runtime colours derive from. */
170
+ type NxdsColorAppearance = Pick<NxdsAppearanceState, 'brandColor' | 'surfaceTone' | 'lightContrast' | 'darkContrast'>;
171
+ declare function createNxdsThemeContract(state: NxdsColorAppearance): ThemeDerivationInput;
165
172
  declare function appearancePrefsToCss(prefs: NxdsAppearancePrefs): string;
166
173
 
167
174
  /**
@@ -254,4 +261,4 @@ declare const DARK_SURFACE_LADDER: {
254
261
  };
255
262
  };
256
263
 
257
- export { BASE_TONE_OPTIONS as B, CORNER_OPTIONS as C, DARK_SURFACE_LADDER as D, ELEVATION_OPTIONS as E, LIGHT_SURFACE_LADDER as L, type NxdsPresetField as N, SURFACE_TOKENS as S, type ThemeDerivationInput as T, type NxdsAppearancePrefs as a, type NxdsAppearanceState as b, type ShadeAnchor as c, type DerivedTheme as d, BASE_TONE_SEEDS as e, DEFAULT_BRAND_COLOR as f, DEFAULT_NXDS_APPEARANCE as g, DENSITY_OPTIONS as h, type NxdsAppearanceMode as i, type NxdsCorners as j, type NxdsDensity as k, type NxdsElevation as l, type NxdsStroke as m, type NxdsThemeContract as n, STROKE_OPTIONS as o, type SurfaceToken as p, type ThemeSeeds as q, type TokenMap as r, appearancePrefsToCss as s, createNxdsThemeContract as t, deriveTheme as u, normalizeAppearanceModeIds as v, sanitizeNxdsAppearance as w, sanitizeNxdsAppearancePrefs as x, themeToCss as y };
264
+ export { themeToCss as A, BASE_TONE_OPTIONS as B, CORNER_OPTIONS as C, DARK_SURFACE_LADDER as D, ELEVATION_OPTIONS as E, FONT_SIZE_PX_MAX as F, LIGHT_SURFACE_LADDER as L, type NxdsColorAppearance as N, SURFACE_TOKENS as S, type ThemeDerivationInput as T, type NxdsAppearancePrefs as a, type NxdsPresetField as b, type ShadeAnchor as c, type NxdsAppearanceState as d, type DerivedTheme as e, BASE_TONE_SEEDS as f, DEFAULT_BRAND_COLOR as g, DEFAULT_NXDS_APPEARANCE as h, DENSITY_OPTIONS as i, FONT_SIZE_PX_MIN as j, type NxdsAppearanceMode as k, type NxdsCorners as l, type NxdsDensity as m, type NxdsElevation as n, type NxdsStroke as o, type NxdsThemeContract as p, STROKE_OPTIONS as q, type SurfaceToken as r, type ThemeSeeds as s, type TokenMap as t, appearancePrefsToCss as u, createNxdsThemeContract as v, deriveTheme as w, normalizeAppearanceModeIds as x, sanitizeNxdsAppearance as y, sanitizeNxdsAppearancePrefs as z };
@@ -49,6 +49,8 @@ type NxdsElevation = 'flat' | 'quiet' | 'soft' | 'standard' | 'strong';
49
49
  type NxdsStroke = 'fine' | 'normal' | 'strong';
50
50
  interface NxdsAppearancePrefs {
51
51
  uiFont: string;
52
+ /** The heading `font-family` stack. `null` follows `uiFont`. */
53
+ headingFont: string | null;
52
54
  codeFont: string;
53
55
  uiFontSize: number;
54
56
  codeFontSize: number;
@@ -158,10 +160,15 @@ declare const STROKE_OPTIONS: readonly [{
158
160
  readonly label: "Strong";
159
161
  }];
160
162
  declare const DEFAULT_NXDS_APPEARANCE: NxdsAppearanceState;
163
+ /** The font sizes, in px, the appearance prefs take. */
164
+ declare const FONT_SIZE_PX_MIN = 8;
165
+ declare const FONT_SIZE_PX_MAX = 32;
161
166
  declare function normalizeAppearanceModeIds(raw: unknown): unknown;
162
167
  declare function sanitizeNxdsAppearancePrefs(raw: unknown): NxdsAppearancePrefs;
163
168
  declare function sanitizeNxdsAppearance(rawInput: unknown): NxdsAppearanceState;
164
- declare function createNxdsThemeContract(state: NxdsAppearanceState): ThemeDerivationInput;
169
+ /** The appearance fields runtime colours derive from. */
170
+ type NxdsColorAppearance = Pick<NxdsAppearanceState, 'brandColor' | 'surfaceTone' | 'lightContrast' | 'darkContrast'>;
171
+ declare function createNxdsThemeContract(state: NxdsColorAppearance): ThemeDerivationInput;
165
172
  declare function appearancePrefsToCss(prefs: NxdsAppearancePrefs): string;
166
173
 
167
174
  /**
@@ -254,4 +261,4 @@ declare const DARK_SURFACE_LADDER: {
254
261
  };
255
262
  };
256
263
 
257
- export { BASE_TONE_OPTIONS as B, CORNER_OPTIONS as C, DARK_SURFACE_LADDER as D, ELEVATION_OPTIONS as E, LIGHT_SURFACE_LADDER as L, type NxdsPresetField as N, SURFACE_TOKENS as S, type ThemeDerivationInput as T, type NxdsAppearancePrefs as a, type NxdsAppearanceState as b, type ShadeAnchor as c, type DerivedTheme as d, BASE_TONE_SEEDS as e, DEFAULT_BRAND_COLOR as f, DEFAULT_NXDS_APPEARANCE as g, DENSITY_OPTIONS as h, type NxdsAppearanceMode as i, type NxdsCorners as j, type NxdsDensity as k, type NxdsElevation as l, type NxdsStroke as m, type NxdsThemeContract as n, STROKE_OPTIONS as o, type SurfaceToken as p, type ThemeSeeds as q, type TokenMap as r, appearancePrefsToCss as s, createNxdsThemeContract as t, deriveTheme as u, normalizeAppearanceModeIds as v, sanitizeNxdsAppearance as w, sanitizeNxdsAppearancePrefs as x, themeToCss as y };
264
+ export { themeToCss as A, BASE_TONE_OPTIONS as B, CORNER_OPTIONS as C, DARK_SURFACE_LADDER as D, ELEVATION_OPTIONS as E, FONT_SIZE_PX_MAX as F, LIGHT_SURFACE_LADDER as L, type NxdsColorAppearance as N, SURFACE_TOKENS as S, type ThemeDerivationInput as T, type NxdsAppearancePrefs as a, type NxdsPresetField as b, type ShadeAnchor as c, type NxdsAppearanceState as d, type DerivedTheme as e, BASE_TONE_SEEDS as f, DEFAULT_BRAND_COLOR as g, DEFAULT_NXDS_APPEARANCE as h, DENSITY_OPTIONS as i, FONT_SIZE_PX_MIN as j, type NxdsAppearanceMode as k, type NxdsCorners as l, type NxdsDensity as m, type NxdsElevation as n, type NxdsStroke as o, type NxdsThemeContract as p, STROKE_OPTIONS as q, type SurfaceToken as r, type ThemeSeeds as s, type TokenMap as t, appearancePrefsToCss as u, createNxdsThemeContract as v, deriveTheme as w, normalizeAppearanceModeIds as x, sanitizeNxdsAppearance as y, sanitizeNxdsAppearancePrefs as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxds/core",
3
- "version": "0.11.0",
3
+ "version": "0.13.0",
4
4
  "type": "module",
5
5
  "description": "nxds theme engine: a framework-agnostic appearance model, runtime theme derivation and first-paint snapshots.",
6
6
  "keywords": [