@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.
@@ -1,5 +1,5 @@
1
- import { N as NxdsPresetField, a as NxdsAppearancePrefs, b as NxdsAppearanceState } from './surface-ladder-C8HTwT7z.cjs';
2
- export { D as DARK_SURFACE_LADDER, L as LIGHT_SURFACE_LADDER, S as SURFACE_TOKENS, c as ShadeAnchor } from './surface-ladder-C8HTwT7z.cjs';
1
+ import { N as NxdsColorAppearance, a as NxdsAppearancePrefs, b as NxdsPresetField } from './surface-ladder-DZQFqJvm.cjs';
2
+ export { D as DARK_SURFACE_LADDER, L as LIGHT_SURFACE_LADDER, S as SURFACE_TOKENS, c as ShadeAnchor } from './surface-ladder-DZQFqJvm.cjs';
3
3
  import { M as Mode } from './palette-BKTIQ0WC.cjs';
4
4
 
5
5
  /** An authored DTCG `$value`: a scalar, a reference string, or a composite. */
@@ -11,6 +11,14 @@ type TokenValue = string | number | boolean | null | readonly TokenValue[] | {
11
11
  type DeepReadonly<T> = T extends object ? {
12
12
  readonly [Key in keyof T]: DeepReadonly<T[Key]>;
13
13
  } : T;
14
+ /**
15
+ * The appearance fields the catalogue derives values from: runtime colours
16
+ * from the brand colour, surface tone and contrasts, and type sizes from the
17
+ * UI and code font sizes.
18
+ */
19
+ type CatalogueAppearance = NxdsColorAppearance & {
20
+ readonly prefs: Pick<NxdsAppearancePrefs, 'uiFontSize' | 'codeFontSize'>;
21
+ };
14
22
  /** Token families the catalogue covers. */
15
23
  type CatalogueFamily = 'borderwidth' | 'breakpoint' | 'color' | 'motion' | 'radius' | 'shadow' | 'spacing' | 'typography' | 'z-index';
16
24
  /**
@@ -63,8 +71,10 @@ interface CatalogueVariant {
63
71
  readonly preset: string | null;
64
72
  /** The authored leaf, or `null` for a colour the engine derives. */
65
73
  readonly source: CatalogueSource | null;
66
- /** The full appearance config a derived colour was computed from. */
67
- readonly appearance: DeepReadonly<NxdsAppearanceState> | null;
74
+ /** The appearance fields a derived colour was computed from, and its mode. */
75
+ readonly appearance: DeepReadonly<NxdsColorAppearance & {
76
+ readonly mode: Mode;
77
+ }> | null;
68
78
  readonly authoredValue: TokenValue | null;
69
79
  /**
70
80
  * What the generated CSS declares: one custom property for a scalar or a
@@ -107,9 +117,13 @@ interface CatalogueToken {
107
117
  * Every nxds token, identified by its `--nx-*` name: primitives, runtime
108
118
  * colours, spacing, z-index, breakpoints, and typography and shadow styles.
109
119
  * Shadow layer primitives only compose the shadow styles.
110
- * Runtime colours are computed from `DEFAULT_NXDS_APPEARANCE` in explicit
111
- * light and dark modes; each variant records the appearance it used.
120
+ * Runtime colours are computed from `appearance` in explicit light and dark
121
+ * modes; each variant records the colour fields and mode it used. Type sizes
122
+ * and line heights follow its UI font size, and the code size its code font
123
+ * size. Font families and the preset families keep
124
+ * their authored values: every preset's variants are listed, and the
125
+ * appearance only says which one is in use.
112
126
  */
113
- declare function createTokenCatalogue(): readonly CatalogueToken[];
127
+ declare function createTokenCatalogue(appearance?: CatalogueAppearance): readonly CatalogueToken[];
114
128
 
115
- export { type CatalogueAlias, type CatalogueControl, type CatalogueDeclaration, type CatalogueFamily, type CatalogueReference, type CatalogueSource, type CatalogueToken, type CatalogueTokenName, type CatalogueVariant, type TokenValue, createTokenCatalogue };
129
+ export { type CatalogueAlias, type CatalogueAppearance, type CatalogueControl, type CatalogueDeclaration, type CatalogueFamily, type CatalogueReference, type CatalogueSource, type CatalogueToken, type CatalogueTokenName, type CatalogueVariant, type TokenValue, createTokenCatalogue };
@@ -1,5 +1,5 @@
1
- import { N as NxdsPresetField, a as NxdsAppearancePrefs, b as NxdsAppearanceState } from './surface-ladder-B950TU4_.js';
2
- export { D as DARK_SURFACE_LADDER, L as LIGHT_SURFACE_LADDER, S as SURFACE_TOKENS, c as ShadeAnchor } from './surface-ladder-B950TU4_.js';
1
+ import { N as NxdsColorAppearance, a as NxdsAppearancePrefs, b as NxdsPresetField } from './surface-ladder-Cqo5DfZW.js';
2
+ export { D as DARK_SURFACE_LADDER, L as LIGHT_SURFACE_LADDER, S as SURFACE_TOKENS, c as ShadeAnchor } from './surface-ladder-Cqo5DfZW.js';
3
3
  import { M as Mode } from './palette-BKTIQ0WC.js';
4
4
 
5
5
  /** An authored DTCG `$value`: a scalar, a reference string, or a composite. */
@@ -11,6 +11,14 @@ type TokenValue = string | number | boolean | null | readonly TokenValue[] | {
11
11
  type DeepReadonly<T> = T extends object ? {
12
12
  readonly [Key in keyof T]: DeepReadonly<T[Key]>;
13
13
  } : T;
14
+ /**
15
+ * The appearance fields the catalogue derives values from: runtime colours
16
+ * from the brand colour, surface tone and contrasts, and type sizes from the
17
+ * UI and code font sizes.
18
+ */
19
+ type CatalogueAppearance = NxdsColorAppearance & {
20
+ readonly prefs: Pick<NxdsAppearancePrefs, 'uiFontSize' | 'codeFontSize'>;
21
+ };
14
22
  /** Token families the catalogue covers. */
15
23
  type CatalogueFamily = 'borderwidth' | 'breakpoint' | 'color' | 'motion' | 'radius' | 'shadow' | 'spacing' | 'typography' | 'z-index';
16
24
  /**
@@ -63,8 +71,10 @@ interface CatalogueVariant {
63
71
  readonly preset: string | null;
64
72
  /** The authored leaf, or `null` for a colour the engine derives. */
65
73
  readonly source: CatalogueSource | null;
66
- /** The full appearance config a derived colour was computed from. */
67
- readonly appearance: DeepReadonly<NxdsAppearanceState> | null;
74
+ /** The appearance fields a derived colour was computed from, and its mode. */
75
+ readonly appearance: DeepReadonly<NxdsColorAppearance & {
76
+ readonly mode: Mode;
77
+ }> | null;
68
78
  readonly authoredValue: TokenValue | null;
69
79
  /**
70
80
  * What the generated CSS declares: one custom property for a scalar or a
@@ -107,9 +117,13 @@ interface CatalogueToken {
107
117
  * Every nxds token, identified by its `--nx-*` name: primitives, runtime
108
118
  * colours, spacing, z-index, breakpoints, and typography and shadow styles.
109
119
  * Shadow layer primitives only compose the shadow styles.
110
- * Runtime colours are computed from `DEFAULT_NXDS_APPEARANCE` in explicit
111
- * light and dark modes; each variant records the appearance it used.
120
+ * Runtime colours are computed from `appearance` in explicit light and dark
121
+ * modes; each variant records the colour fields and mode it used. Type sizes
122
+ * and line heights follow its UI font size, and the code size its code font
123
+ * size. Font families and the preset families keep
124
+ * their authored values: every preset's variants are listed, and the
125
+ * appearance only says which one is in use.
112
126
  */
113
- declare function createTokenCatalogue(): readonly CatalogueToken[];
127
+ declare function createTokenCatalogue(appearance?: CatalogueAppearance): readonly CatalogueToken[];
114
128
 
115
- export { type CatalogueAlias, type CatalogueControl, type CatalogueDeclaration, type CatalogueFamily, type CatalogueReference, type CatalogueSource, type CatalogueToken, type CatalogueTokenName, type CatalogueVariant, type TokenValue, createTokenCatalogue };
129
+ export { type CatalogueAlias, type CatalogueAppearance, type CatalogueControl, type CatalogueDeclaration, type CatalogueFamily, type CatalogueReference, type CatalogueSource, type CatalogueToken, type CatalogueTokenName, type CatalogueVariant, type TokenValue, createTokenCatalogue };