@nxds/core 0.13.0 → 0.14.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 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';
1
+ import { N as NxdsColorAppearance, a as NxdsUiScale, b as NxdsTextSize, c as NxdsAppearancePrefs, d as NxdsPresetField } from './surface-ladder-DQ9Yfwie.cjs';
2
+ export { D as DARK_SURFACE_LADDER, L as LIGHT_SURFACE_LADDER, S as SURFACE_TOKENS, e as ShadeAnchor } from './surface-ladder-DQ9Yfwie.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. */
@@ -13,14 +13,16 @@ type DeepReadonly<T> = T extends object ? {
13
13
  } : T;
14
14
  /**
15
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.
16
+ * from the brand colour, surface tone and contrasts, sizes from the UI scale,
17
+ * type sizes from the text size too, and the code size from `codeFontSize`.
18
18
  */
19
19
  type CatalogueAppearance = NxdsColorAppearance & {
20
- readonly prefs: Pick<NxdsAppearancePrefs, 'uiFontSize' | 'codeFontSize'>;
20
+ readonly uiScale: NxdsUiScale;
21
+ readonly textSize: NxdsTextSize;
22
+ readonly prefs: Pick<NxdsAppearancePrefs, 'codeFontSize'>;
21
23
  };
22
24
  /** Token families the catalogue covers. */
23
- type CatalogueFamily = 'borderwidth' | 'breakpoint' | 'color' | 'motion' | 'radius' | 'shadow' | 'spacing' | 'typography' | 'z-index';
25
+ type CatalogueFamily = 'borderwidth' | 'breakpoint' | 'color' | 'icon' | 'motion' | 'radius' | 'shadow' | 'spacing' | 'typography' | 'ui-scale' | 'width' | 'z-index';
24
26
  /**
25
27
  * Canonical identity: an identifier in the `--nx-*` custom property scheme.
26
28
  * Most tokens declare it in the generated CSS. Typography styles and
@@ -69,7 +71,10 @@ interface CatalogueVariant {
69
71
  * file.
70
72
  */
71
73
  readonly preset: string | null;
72
- /** The authored leaf, or `null` for a colour the engine derives. */
74
+ /**
75
+ * The authored leaf, or `null` for a colour the engine derives and for the
76
+ * UI scale factor and page widths.
77
+ */
73
78
  readonly source: CatalogueSource | null;
74
79
  /** The appearance fields a derived colour was computed from, and its mode. */
75
80
  readonly appearance: DeepReadonly<NxdsColorAppearance & {
@@ -86,12 +91,16 @@ interface CatalogueVariant {
86
91
  readonly references: readonly CatalogueReference[];
87
92
  }
88
93
  /**
89
- * The appearance setting that writes a token at runtime: a preset field that
90
- * picks one of its moded values, or a preference the provider computes it from.
94
+ * An appearance setting that writes a token at runtime: a preset field that
95
+ * picks one of its moded values, the UI scale or text size that scales its
96
+ * value, or a preference the provider computes it from.
91
97
  */
92
98
  type CatalogueControl = {
93
99
  readonly kind: 'preset';
94
100
  readonly field: NxdsPresetField;
101
+ } | {
102
+ readonly kind: 'scale';
103
+ readonly field: 'uiScale' | 'textSize';
95
104
  } | {
96
105
  readonly kind: 'pref';
97
106
  readonly field: keyof NxdsAppearancePrefs;
@@ -101,28 +110,29 @@ interface CatalogueToken {
101
110
  readonly family: CatalogueFamily;
102
111
  /**
103
112
  * The registry category for a derived colour, the first path key for a
104
- * nested leaf (`green`, `size`, `container`), or the family for a flat file.
113
+ * nested leaf (`green`, `size`, `container`), or the family for a flat file
114
+ * and for a token no file authors.
105
115
  */
106
116
  readonly group: string;
107
117
  /** The DTCG `$type`. */
108
118
  readonly type: string;
109
119
  readonly description: string | null;
110
120
  readonly aliases: readonly CatalogueAlias[];
111
- /** The appearance setting that writes it, or `null` when nothing does. */
112
- readonly control: CatalogueControl | null;
121
+ /** The appearance settings that write it. Empty when nothing does. */
122
+ readonly controls: readonly CatalogueControl[];
113
123
  readonly variants: readonly CatalogueVariant[];
114
124
  }
115
125
 
116
126
  /**
117
127
  * Every nxds token, identified by its `--nx-*` name: primitives, runtime
118
- * colours, spacing, z-index, breakpoints, and typography and shadow styles.
128
+ * colours, spacing, z-index, breakpoints, typography and shadow styles, and
129
+ * the UI scale factor and page widths.
119
130
  * Shadow layer primitives only compose the shadow styles.
120
131
  * 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.
132
+ * modes; each variant records the colour fields and mode it used. Sizes
133
+ * follow its UI scale, type sizes its text size too, and the code size its
134
+ * code font size. Every preset's variants are listed, and the appearance only
135
+ * says which one is in use.
126
136
  */
127
137
  declare function createTokenCatalogue(appearance?: CatalogueAppearance): readonly CatalogueToken[];
128
138
 
@@ -1,5 +1,5 @@
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';
1
+ import { N as NxdsColorAppearance, a as NxdsUiScale, b as NxdsTextSize, c as NxdsAppearancePrefs, d as NxdsPresetField } from './surface-ladder-B8LyPHC_.js';
2
+ export { D as DARK_SURFACE_LADDER, L as LIGHT_SURFACE_LADDER, S as SURFACE_TOKENS, e as ShadeAnchor } from './surface-ladder-B8LyPHC_.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. */
@@ -13,14 +13,16 @@ type DeepReadonly<T> = T extends object ? {
13
13
  } : T;
14
14
  /**
15
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.
16
+ * from the brand colour, surface tone and contrasts, sizes from the UI scale,
17
+ * type sizes from the text size too, and the code size from `codeFontSize`.
18
18
  */
19
19
  type CatalogueAppearance = NxdsColorAppearance & {
20
- readonly prefs: Pick<NxdsAppearancePrefs, 'uiFontSize' | 'codeFontSize'>;
20
+ readonly uiScale: NxdsUiScale;
21
+ readonly textSize: NxdsTextSize;
22
+ readonly prefs: Pick<NxdsAppearancePrefs, 'codeFontSize'>;
21
23
  };
22
24
  /** Token families the catalogue covers. */
23
- type CatalogueFamily = 'borderwidth' | 'breakpoint' | 'color' | 'motion' | 'radius' | 'shadow' | 'spacing' | 'typography' | 'z-index';
25
+ type CatalogueFamily = 'borderwidth' | 'breakpoint' | 'color' | 'icon' | 'motion' | 'radius' | 'shadow' | 'spacing' | 'typography' | 'ui-scale' | 'width' | 'z-index';
24
26
  /**
25
27
  * Canonical identity: an identifier in the `--nx-*` custom property scheme.
26
28
  * Most tokens declare it in the generated CSS. Typography styles and
@@ -69,7 +71,10 @@ interface CatalogueVariant {
69
71
  * file.
70
72
  */
71
73
  readonly preset: string | null;
72
- /** The authored leaf, or `null` for a colour the engine derives. */
74
+ /**
75
+ * The authored leaf, or `null` for a colour the engine derives and for the
76
+ * UI scale factor and page widths.
77
+ */
73
78
  readonly source: CatalogueSource | null;
74
79
  /** The appearance fields a derived colour was computed from, and its mode. */
75
80
  readonly appearance: DeepReadonly<NxdsColorAppearance & {
@@ -86,12 +91,16 @@ interface CatalogueVariant {
86
91
  readonly references: readonly CatalogueReference[];
87
92
  }
88
93
  /**
89
- * The appearance setting that writes a token at runtime: a preset field that
90
- * picks one of its moded values, or a preference the provider computes it from.
94
+ * An appearance setting that writes a token at runtime: a preset field that
95
+ * picks one of its moded values, the UI scale or text size that scales its
96
+ * value, or a preference the provider computes it from.
91
97
  */
92
98
  type CatalogueControl = {
93
99
  readonly kind: 'preset';
94
100
  readonly field: NxdsPresetField;
101
+ } | {
102
+ readonly kind: 'scale';
103
+ readonly field: 'uiScale' | 'textSize';
95
104
  } | {
96
105
  readonly kind: 'pref';
97
106
  readonly field: keyof NxdsAppearancePrefs;
@@ -101,28 +110,29 @@ interface CatalogueToken {
101
110
  readonly family: CatalogueFamily;
102
111
  /**
103
112
  * The registry category for a derived colour, the first path key for a
104
- * nested leaf (`green`, `size`, `container`), or the family for a flat file.
113
+ * nested leaf (`green`, `size`, `container`), or the family for a flat file
114
+ * and for a token no file authors.
105
115
  */
106
116
  readonly group: string;
107
117
  /** The DTCG `$type`. */
108
118
  readonly type: string;
109
119
  readonly description: string | null;
110
120
  readonly aliases: readonly CatalogueAlias[];
111
- /** The appearance setting that writes it, or `null` when nothing does. */
112
- readonly control: CatalogueControl | null;
121
+ /** The appearance settings that write it. Empty when nothing does. */
122
+ readonly controls: readonly CatalogueControl[];
113
123
  readonly variants: readonly CatalogueVariant[];
114
124
  }
115
125
 
116
126
  /**
117
127
  * Every nxds token, identified by its `--nx-*` name: primitives, runtime
118
- * colours, spacing, z-index, breakpoints, and typography and shadow styles.
128
+ * colours, spacing, z-index, breakpoints, typography and shadow styles, and
129
+ * the UI scale factor and page widths.
119
130
  * Shadow layer primitives only compose the shadow styles.
120
131
  * 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.
132
+ * modes; each variant records the colour fields and mode it used. Sizes
133
+ * follow its UI scale, type sizes its text size too, and the code size its
134
+ * code font size. Every preset's variants are listed, and the appearance only
135
+ * says which one is in use.
126
136
  */
127
137
  declare function createTokenCatalogue(appearance?: CatalogueAppearance): readonly CatalogueToken[];
128
138