@nxds/core 0.9.1 → 0.11.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.
@@ -2,6 +2,7 @@ import { T as Tier, P as PaletteKey, M as Mode } from './palette-BKTIQ0WC.cjs';
2
2
  export { N as NxdsSurfaceTone, a as PALETTE_KEYS, b as TIER_THRESHOLDS } from './palette-BKTIQ0WC.cjs';
3
3
  import { b as NxdsAppearanceState, d as DerivedTheme } from './surface-ladder-C8HTwT7z.cjs';
4
4
  export { B as BASE_TONE_OPTIONS, e as BASE_TONE_SEEDS, C as CORNER_OPTIONS, f as DEFAULT_BRAND_COLOR, g as DEFAULT_NXDS_APPEARANCE, h as DENSITY_OPTIONS, E as ELEVATION_OPTIONS, i as NxdsAppearanceMode, a as NxdsAppearancePrefs, j as NxdsCorners, k as NxdsDensity, l as NxdsElevation, N as NxdsPresetField, m as NxdsStroke, n as NxdsThemeContract, o as STROKE_OPTIONS, p as SurfaceToken, T as ThemeDerivationInput, q as ThemeSeeds, r as TokenMap, s as appearancePrefsToCss, t as createNxdsThemeContract, u as deriveTheme, v as normalizeAppearanceModeIds, w as sanitizeNxdsAppearance, x as sanitizeNxdsAppearancePrefs, y as themeToCss } from './surface-ladder-C8HTwT7z.cjs';
5
+ export { S as SpacingStep } from './token-scales.generated-CCNkHJ3I.cjs';
5
6
 
6
7
  type AdjustContrastTier = Tier;
7
8
  type AdjustContrastPalette = PaletteKey;
@@ -145,6 +146,12 @@ declare function findBrandColorPreset(color: string): BrandColorPreset | undefin
145
146
  /** Whether a string is a CSS color culori (and thus the engine) can parse. */
146
147
  declare function isColor(value: string): boolean;
147
148
 
149
+ /**
150
+ * The layer order nxds declares in every stylesheet that layers its CSS. It
151
+ * ranks `nx-runtime` after Tailwind's layers whichever stylesheet loads first.
152
+ */
153
+ declare const RUNTIME_LAYER_ORDER = "@layer properties, theme, base, components, utilities, nx-runtime;";
154
+
148
155
  /** One registered foreground/background pair, measured in one mode. */
149
156
  interface ThemeContrastCheck {
150
157
  mode: Mode;
@@ -165,7 +172,7 @@ interface ThemeContrastCheck {
165
172
  /** Measure every registered APCA pair of a derived theme in both modes. */
166
173
  declare function measureThemeContrast(theme: DerivedTheme): ThemeContrastCheck[];
167
174
 
168
- type TokenCategory = 'surface' | 'text' | 'border' | 'brand' | 'status' | 'chart' | 'focus' | 'alpha';
175
+ type TokenCategory = 'surface' | 'text' | 'border' | 'brand' | 'status' | 'chart' | 'syntax' | 'focus' | 'alpha';
169
176
  interface SemanticTokenMeta {
170
177
  /** Bare token name, without the --nx-color- prefix. */
171
178
  name: SemanticColorName;
@@ -177,10 +184,11 @@ declare const BORDER_TOKEN_NAMES: readonly ["border-default", "border-disabled",
177
184
  declare const BRAND_TOKEN_NAMES: readonly ["primary-background", "primary-background-hover", "primary-background-active", "primary-foreground", "primary-disabled", "primary-subtle", "primary-subtle-foreground", "primary-subtle-hover", "primary-subtle-active", "primary-border", "primary-border-active", "secondary-background", "secondary-background-hover", "secondary-background-active", "secondary-foreground", "secondary-disabled", "secondary-subtle", "secondary-subtle-foreground", "secondary-subtle-hover", "secondary-subtle-active"];
178
185
  declare const STATUS_TOKEN_NAMES: readonly ["success-background", "success-background-hover", "success-background-active", "success-foreground", "success-disabled", "success-subtle", "success-subtle-foreground", "success-subtle-hover", "success-subtle-active", "success-border", "border-success-active", "warning-background", "warning-background-hover", "warning-background-active", "warning-foreground", "warning-disabled", "warning-subtle", "warning-subtle-foreground", "warning-subtle-hover", "warning-subtle-active", "warning-border", "border-warning-active", "error-background", "error-background-hover", "error-background-active", "error-foreground", "error-disabled", "error-subtle", "error-subtle-foreground", "error-subtle-hover", "error-subtle-active", "error-border", "border-error-active", "information-background", "information-background-hover", "information-background-active", "information-foreground", "information-disabled", "information-subtle", "information-subtle-foreground", "information-subtle-hover", "information-subtle-active", "information-border", "border-information-active"];
179
186
  declare const CHART_TOKEN_NAMES: readonly ["chart-categorical-1", "chart-categorical-2", "chart-categorical-3", "chart-categorical-4", "chart-categorical-5"];
187
+ declare const SYNTAX_TOKEN_NAMES: readonly ["syntax-keyword", "syntax-string", "syntax-function", "syntax-type", "syntax-constant"];
180
188
  declare const FOCUS_TOKEN_NAMES: readonly ["focus-default", "focus-error"];
181
189
  declare const ALPHA_TOKEN_NAMES: readonly ["background-hover-alpha", "border-default-alpha", "overlay", "popover-alpha", "popover-backdrop"];
182
190
  /** Bare name of every semantic colour token, without the --nx-color- prefix. */
183
- type SemanticColorName = (typeof SURFACE_TOKEN_NAMES)[number] | (typeof TEXT_TOKEN_NAMES)[number] | (typeof BORDER_TOKEN_NAMES)[number] | (typeof BRAND_TOKEN_NAMES)[number] | (typeof STATUS_TOKEN_NAMES)[number] | (typeof CHART_TOKEN_NAMES)[number] | (typeof FOCUS_TOKEN_NAMES)[number] | (typeof ALPHA_TOKEN_NAMES)[number];
191
+ type SemanticColorName = (typeof SURFACE_TOKEN_NAMES)[number] | (typeof TEXT_TOKEN_NAMES)[number] | (typeof BORDER_TOKEN_NAMES)[number] | (typeof BRAND_TOKEN_NAMES)[number] | (typeof STATUS_TOKEN_NAMES)[number] | (typeof CHART_TOKEN_NAMES)[number] | (typeof SYNTAX_TOKEN_NAMES)[number] | (typeof FOCUS_TOKEN_NAMES)[number] | (typeof ALPHA_TOKEN_NAMES)[number];
184
192
  declare const SEMANTIC_TOKEN_REGISTRY: readonly SemanticTokenMeta[];
185
193
 
186
- export { type AdjustContrastOptions, type AdjustContrastPalette, type AdjustContrastTier, BRAND_COLOR_PRESETS, type BrandColorPreset, DEFAULT_COOKIE_KEY, DEFAULT_STORAGE_KEY, DerivedTheme, Mode, NXDS_APPEARANCE_COOKIE_MAX_AGE_SECONDS, NXDS_APPEARANCE_DATA_ATTRS, type NxdsAppearanceBootstrapScriptOptions, type NxdsAppearanceCookieOptions, type NxdsAppearanceCookieSameSite, type NxdsAppearanceDataAttr, type NxdsAppearancePersistOptions, type NxdsAppearanceSnapshot, NxdsAppearanceState, type NxdsAppearanceStateCookie, type NxdsFirstPaintResolution, type NxdsResolvedAppearanceMode, SEMANTIC_TOKEN_REGISTRY, SNAPSHOT_VERSION, type SemanticColorName, type SemanticTokenMeta, type ThemeContrastCheck, Tier, type TokenCategory, adjustContrast, apcaLc, applyNxdsAppearance, createDefaultNxdsAppearanceSnapshot, createNxdsAppearanceBootstrapScript, createNxdsAppearanceSnapshot, createNxdsAppearanceSnapshotFromCookie, createNxdsAppearanceSnapshotFromState, createNxdsAppearanceStateCookie, findBrandColorPreset, isColor, measureThemeContrast, parseNxdsAppearanceStateCookie, persistNxdsAppearance, prefersDarkColorScheme, readStoredNxdsAppearance, removeNxdsAppearance, resolveFirstPaint, resolveNxdsAppearanceMode, sanitizeNxdsAppearanceSnapshot, serializeNxdsAppearanceStateCookie, watchColorScheme };
194
+ export { type AdjustContrastOptions, type AdjustContrastPalette, type AdjustContrastTier, BRAND_COLOR_PRESETS, type BrandColorPreset, DEFAULT_COOKIE_KEY, DEFAULT_STORAGE_KEY, DerivedTheme, Mode, NXDS_APPEARANCE_COOKIE_MAX_AGE_SECONDS, NXDS_APPEARANCE_DATA_ATTRS, type NxdsAppearanceBootstrapScriptOptions, type NxdsAppearanceCookieOptions, type NxdsAppearanceCookieSameSite, type NxdsAppearanceDataAttr, type NxdsAppearancePersistOptions, type NxdsAppearanceSnapshot, NxdsAppearanceState, type NxdsAppearanceStateCookie, type NxdsFirstPaintResolution, type NxdsResolvedAppearanceMode, RUNTIME_LAYER_ORDER, SEMANTIC_TOKEN_REGISTRY, SNAPSHOT_VERSION, type SemanticColorName, type SemanticTokenMeta, type ThemeContrastCheck, Tier, type TokenCategory, adjustContrast, apcaLc, applyNxdsAppearance, createDefaultNxdsAppearanceSnapshot, createNxdsAppearanceBootstrapScript, createNxdsAppearanceSnapshot, createNxdsAppearanceSnapshotFromCookie, createNxdsAppearanceSnapshotFromState, createNxdsAppearanceStateCookie, findBrandColorPreset, isColor, measureThemeContrast, parseNxdsAppearanceStateCookie, persistNxdsAppearance, prefersDarkColorScheme, readStoredNxdsAppearance, removeNxdsAppearance, resolveFirstPaint, resolveNxdsAppearanceMode, sanitizeNxdsAppearanceSnapshot, serializeNxdsAppearanceStateCookie, watchColorScheme };
@@ -2,6 +2,7 @@ import { T as Tier, P as PaletteKey, M as Mode } from './palette-BKTIQ0WC.js';
2
2
  export { N as NxdsSurfaceTone, a as PALETTE_KEYS, b as TIER_THRESHOLDS } from './palette-BKTIQ0WC.js';
3
3
  import { b as NxdsAppearanceState, d as DerivedTheme } from './surface-ladder-B950TU4_.js';
4
4
  export { B as BASE_TONE_OPTIONS, e as BASE_TONE_SEEDS, C as CORNER_OPTIONS, f as DEFAULT_BRAND_COLOR, g as DEFAULT_NXDS_APPEARANCE, h as DENSITY_OPTIONS, E as ELEVATION_OPTIONS, i as NxdsAppearanceMode, a as NxdsAppearancePrefs, j as NxdsCorners, k as NxdsDensity, l as NxdsElevation, N as NxdsPresetField, m as NxdsStroke, n as NxdsThemeContract, o as STROKE_OPTIONS, p as SurfaceToken, T as ThemeDerivationInput, q as ThemeSeeds, r as TokenMap, s as appearancePrefsToCss, t as createNxdsThemeContract, u as deriveTheme, v as normalizeAppearanceModeIds, w as sanitizeNxdsAppearance, x as sanitizeNxdsAppearancePrefs, y as themeToCss } from './surface-ladder-B950TU4_.js';
5
+ export { S as SpacingStep } from './token-scales.generated-CCNkHJ3I.js';
5
6
 
6
7
  type AdjustContrastTier = Tier;
7
8
  type AdjustContrastPalette = PaletteKey;
@@ -145,6 +146,12 @@ declare function findBrandColorPreset(color: string): BrandColorPreset | undefin
145
146
  /** Whether a string is a CSS color culori (and thus the engine) can parse. */
146
147
  declare function isColor(value: string): boolean;
147
148
 
149
+ /**
150
+ * The layer order nxds declares in every stylesheet that layers its CSS. It
151
+ * ranks `nx-runtime` after Tailwind's layers whichever stylesheet loads first.
152
+ */
153
+ declare const RUNTIME_LAYER_ORDER = "@layer properties, theme, base, components, utilities, nx-runtime;";
154
+
148
155
  /** One registered foreground/background pair, measured in one mode. */
149
156
  interface ThemeContrastCheck {
150
157
  mode: Mode;
@@ -165,7 +172,7 @@ interface ThemeContrastCheck {
165
172
  /** Measure every registered APCA pair of a derived theme in both modes. */
166
173
  declare function measureThemeContrast(theme: DerivedTheme): ThemeContrastCheck[];
167
174
 
168
- type TokenCategory = 'surface' | 'text' | 'border' | 'brand' | 'status' | 'chart' | 'focus' | 'alpha';
175
+ type TokenCategory = 'surface' | 'text' | 'border' | 'brand' | 'status' | 'chart' | 'syntax' | 'focus' | 'alpha';
169
176
  interface SemanticTokenMeta {
170
177
  /** Bare token name, without the --nx-color- prefix. */
171
178
  name: SemanticColorName;
@@ -177,10 +184,11 @@ declare const BORDER_TOKEN_NAMES: readonly ["border-default", "border-disabled",
177
184
  declare const BRAND_TOKEN_NAMES: readonly ["primary-background", "primary-background-hover", "primary-background-active", "primary-foreground", "primary-disabled", "primary-subtle", "primary-subtle-foreground", "primary-subtle-hover", "primary-subtle-active", "primary-border", "primary-border-active", "secondary-background", "secondary-background-hover", "secondary-background-active", "secondary-foreground", "secondary-disabled", "secondary-subtle", "secondary-subtle-foreground", "secondary-subtle-hover", "secondary-subtle-active"];
178
185
  declare const STATUS_TOKEN_NAMES: readonly ["success-background", "success-background-hover", "success-background-active", "success-foreground", "success-disabled", "success-subtle", "success-subtle-foreground", "success-subtle-hover", "success-subtle-active", "success-border", "border-success-active", "warning-background", "warning-background-hover", "warning-background-active", "warning-foreground", "warning-disabled", "warning-subtle", "warning-subtle-foreground", "warning-subtle-hover", "warning-subtle-active", "warning-border", "border-warning-active", "error-background", "error-background-hover", "error-background-active", "error-foreground", "error-disabled", "error-subtle", "error-subtle-foreground", "error-subtle-hover", "error-subtle-active", "error-border", "border-error-active", "information-background", "information-background-hover", "information-background-active", "information-foreground", "information-disabled", "information-subtle", "information-subtle-foreground", "information-subtle-hover", "information-subtle-active", "information-border", "border-information-active"];
179
186
  declare const CHART_TOKEN_NAMES: readonly ["chart-categorical-1", "chart-categorical-2", "chart-categorical-3", "chart-categorical-4", "chart-categorical-5"];
187
+ declare const SYNTAX_TOKEN_NAMES: readonly ["syntax-keyword", "syntax-string", "syntax-function", "syntax-type", "syntax-constant"];
180
188
  declare const FOCUS_TOKEN_NAMES: readonly ["focus-default", "focus-error"];
181
189
  declare const ALPHA_TOKEN_NAMES: readonly ["background-hover-alpha", "border-default-alpha", "overlay", "popover-alpha", "popover-backdrop"];
182
190
  /** Bare name of every semantic colour token, without the --nx-color- prefix. */
183
- type SemanticColorName = (typeof SURFACE_TOKEN_NAMES)[number] | (typeof TEXT_TOKEN_NAMES)[number] | (typeof BORDER_TOKEN_NAMES)[number] | (typeof BRAND_TOKEN_NAMES)[number] | (typeof STATUS_TOKEN_NAMES)[number] | (typeof CHART_TOKEN_NAMES)[number] | (typeof FOCUS_TOKEN_NAMES)[number] | (typeof ALPHA_TOKEN_NAMES)[number];
191
+ type SemanticColorName = (typeof SURFACE_TOKEN_NAMES)[number] | (typeof TEXT_TOKEN_NAMES)[number] | (typeof BORDER_TOKEN_NAMES)[number] | (typeof BRAND_TOKEN_NAMES)[number] | (typeof STATUS_TOKEN_NAMES)[number] | (typeof CHART_TOKEN_NAMES)[number] | (typeof SYNTAX_TOKEN_NAMES)[number] | (typeof FOCUS_TOKEN_NAMES)[number] | (typeof ALPHA_TOKEN_NAMES)[number];
184
192
  declare const SEMANTIC_TOKEN_REGISTRY: readonly SemanticTokenMeta[];
185
193
 
186
- export { type AdjustContrastOptions, type AdjustContrastPalette, type AdjustContrastTier, BRAND_COLOR_PRESETS, type BrandColorPreset, DEFAULT_COOKIE_KEY, DEFAULT_STORAGE_KEY, DerivedTheme, Mode, NXDS_APPEARANCE_COOKIE_MAX_AGE_SECONDS, NXDS_APPEARANCE_DATA_ATTRS, type NxdsAppearanceBootstrapScriptOptions, type NxdsAppearanceCookieOptions, type NxdsAppearanceCookieSameSite, type NxdsAppearanceDataAttr, type NxdsAppearancePersistOptions, type NxdsAppearanceSnapshot, NxdsAppearanceState, type NxdsAppearanceStateCookie, type NxdsFirstPaintResolution, type NxdsResolvedAppearanceMode, SEMANTIC_TOKEN_REGISTRY, SNAPSHOT_VERSION, type SemanticColorName, type SemanticTokenMeta, type ThemeContrastCheck, Tier, type TokenCategory, adjustContrast, apcaLc, applyNxdsAppearance, createDefaultNxdsAppearanceSnapshot, createNxdsAppearanceBootstrapScript, createNxdsAppearanceSnapshot, createNxdsAppearanceSnapshotFromCookie, createNxdsAppearanceSnapshotFromState, createNxdsAppearanceStateCookie, findBrandColorPreset, isColor, measureThemeContrast, parseNxdsAppearanceStateCookie, persistNxdsAppearance, prefersDarkColorScheme, readStoredNxdsAppearance, removeNxdsAppearance, resolveFirstPaint, resolveNxdsAppearanceMode, sanitizeNxdsAppearanceSnapshot, serializeNxdsAppearanceStateCookie, watchColorScheme };
194
+ export { type AdjustContrastOptions, type AdjustContrastPalette, type AdjustContrastTier, BRAND_COLOR_PRESETS, type BrandColorPreset, DEFAULT_COOKIE_KEY, DEFAULT_STORAGE_KEY, DerivedTheme, Mode, NXDS_APPEARANCE_COOKIE_MAX_AGE_SECONDS, NXDS_APPEARANCE_DATA_ATTRS, type NxdsAppearanceBootstrapScriptOptions, type NxdsAppearanceCookieOptions, type NxdsAppearanceCookieSameSite, type NxdsAppearanceDataAttr, type NxdsAppearancePersistOptions, type NxdsAppearanceSnapshot, NxdsAppearanceState, type NxdsAppearanceStateCookie, type NxdsFirstPaintResolution, type NxdsResolvedAppearanceMode, RUNTIME_LAYER_ORDER, SEMANTIC_TOKEN_REGISTRY, SNAPSHOT_VERSION, type SemanticColorName, type SemanticTokenMeta, type ThemeContrastCheck, Tier, type TokenCategory, adjustContrast, apcaLc, applyNxdsAppearance, createDefaultNxdsAppearanceSnapshot, createNxdsAppearanceBootstrapScript, createNxdsAppearanceSnapshot, createNxdsAppearanceSnapshotFromCookie, createNxdsAppearanceSnapshotFromState, createNxdsAppearanceStateCookie, findBrandColorPreset, isColor, measureThemeContrast, parseNxdsAppearanceStateCookie, persistNxdsAppearance, prefersDarkColorScheme, readStoredNxdsAppearance, removeNxdsAppearance, resolveFirstPaint, resolveNxdsAppearanceMode, sanitizeNxdsAppearanceSnapshot, serializeNxdsAppearanceStateCookie, watchColorScheme };
@@ -2231,6 +2231,13 @@ var CHART_PALETTE_REFERENCES = [
2231
2231
  { palette: "rose", light: "600", dark: "200" },
2232
2232
  { palette: "indigo", light: "600", dark: "200" }
2233
2233
  ];
2234
+ var SYNTAX_PALETTE_REFERENCES = {
2235
+ keyword: CHART_PALETTE_REFERENCES[3],
2236
+ string: CHART_PALETTE_REFERENCES[1],
2237
+ function: CHART_PALETTE_REFERENCES[4],
2238
+ type: CHART_PALETTE_REFERENCES[0],
2239
+ constant: CHART_PALETTE_REFERENCES[2]
2240
+ };
2234
2241
 
2235
2242
  // src/lib/apca-pairs.ts
2236
2243
  var COLOR_FAMILIES = [
@@ -2245,6 +2252,8 @@ var CATEGORICAL_INDICES = CHART_PALETTE_REFERENCES.map(
2245
2252
  (_, index) => index + 1
2246
2253
  );
2247
2254
  var CHART_STAGGER_LC = 4.5;
2255
+ var DIFF_SURFACES = ["success-subtle", "error-subtle"];
2256
+ var CODE_SURFACES = ["container", "container-hover", ...DIFF_SURFACES];
2248
2257
  var FOCUS_SURFACES = [
2249
2258
  "background",
2250
2259
  "container",
@@ -2304,11 +2313,23 @@ var APCA_PAIRS = [
2304
2313
  ink(`${family}-subtle-foreground`, `${family}-subtle-active`, "ui")
2305
2314
  ]),
2306
2315
  ...CATEGORICAL_INDICES.flatMap(
2307
- (index) => ["container", "background"].map((bg) => ({
2316
+ (index) => ["container", "container-hover", "background"].map((bg) => ({
2308
2317
  ...ink(`chart-categorical-${index}`, bg, "ui"),
2309
2318
  offset: (index - 1) * CHART_STAGGER_LC
2310
2319
  }))
2311
2320
  ),
2321
+ ...CODE_SURFACES.flatMap(
2322
+ (bg) => Object.keys(SYNTAX_PALETTE_REFERENCES).map(
2323
+ (role) => ink(`syntax-${role}`, bg, "ui")
2324
+ )
2325
+ ),
2326
+ // codeBlockTheme also colours code with the text tokens, which already read
2327
+ // on container and container-hover.
2328
+ ...DIFF_SURFACES.flatMap((bg) => [
2329
+ text("foreground", bg, "ui"),
2330
+ text("muted-foreground", bg, "ui"),
2331
+ text("muted-foreground-subtle", bg, "incidental")
2332
+ ]),
2312
2333
  // Focus is the primary accent (components.md § Focus States), so it shares
2313
2334
  // one solved color with primary-subtle-foreground.
2314
2335
  ...FOCUS_SURFACES.flatMap((surface) => [
@@ -2496,8 +2517,9 @@ function constrainColors(map, mode, contrast) {
2496
2517
  }
2497
2518
 
2498
2519
  // src/lib/runtime-layer.ts
2520
+ var RUNTIME_LAYER_ORDER = "@layer properties, theme, base, components, utilities, nx-runtime;";
2499
2521
  function inRuntimeLayer(css) {
2500
- return `@layer properties, theme, base, components, utilities, nx-runtime;
2522
+ return `${RUNTIME_LAYER_ORDER}
2501
2523
  @layer nx-runtime {
2502
2524
  ${css}
2503
2525
  }
@@ -4108,10 +4130,33 @@ var color_default2 = {
4108
4130
  }
4109
4131
  };
4110
4132
 
4133
+ // src/lib/token-scales.generated.ts
4134
+ var PRIMITIVE_PALETTE_NAMES = [
4135
+ "green",
4136
+ "emerald",
4137
+ "teal",
4138
+ "cyan",
4139
+ "sky",
4140
+ "indigo",
4141
+ "violet",
4142
+ "purple",
4143
+ "fuchsia",
4144
+ "pink",
4145
+ "slate",
4146
+ "rose",
4147
+ "lime",
4148
+ "yellow",
4149
+ "blue",
4150
+ "gray",
4151
+ "zinc",
4152
+ "neutral",
4153
+ "stone",
4154
+ "red",
4155
+ "orange",
4156
+ "amber"
4157
+ ];
4158
+
4111
4159
  // src/lib/primitive-palette.ts
4112
- var PRIMITIVE_PALETTE_NAMES = Object.keys(color_default2).filter(
4113
- (name) => name !== "white" && name !== "black"
4114
- );
4115
4160
  var rampCache = /* @__PURE__ */ new Map();
4116
4161
  function getPaletteRamp(palette) {
4117
4162
  if (!PRIMITIVE_PALETTE_NAMES.includes(palette)) {
@@ -4365,6 +4410,14 @@ function deriveChart(mode) {
4365
4410
  ])
4366
4411
  );
4367
4412
  }
4413
+ function deriveSyntax(mode) {
4414
+ return Object.fromEntries(
4415
+ Object.entries(SYNTAX_PALETTE_REFERENCES).map(([role, reference]) => [
4416
+ `--nx-color-syntax-${role}`,
4417
+ getPaletteShade(reference.palette, reference[mode])
4418
+ ])
4419
+ );
4420
+ }
4368
4421
  function deriveAlpha(surfaceTone, mode, profile) {
4369
4422
  const tone = SURFACE_TONE[surfaceTone];
4370
4423
  const dark = mode === "dark";
@@ -4480,6 +4533,7 @@ function deriveThemeMode(input, mode) {
4480
4533
  ...deriveSecondary(mode),
4481
4534
  ...deriveStatus(mode),
4482
4535
  ...deriveChart(mode),
4536
+ ...deriveSyntax(mode),
4483
4537
  ...deriveAlpha(surfaceTone, mode, profile),
4484
4538
  "--nx-color-focus-error": getPaletteShade(
4485
4539
  STATUS_PALETTE_FAMILIES.error,
@@ -4912,6 +4966,13 @@ var CHART_TOKEN_NAMES = [
4912
4966
  "chart-categorical-4",
4913
4967
  "chart-categorical-5"
4914
4968
  ];
4969
+ var SYNTAX_TOKEN_NAMES = [
4970
+ "syntax-keyword",
4971
+ "syntax-string",
4972
+ "syntax-function",
4973
+ "syntax-type",
4974
+ "syntax-constant"
4975
+ ];
4915
4976
  var FOCUS_TOKEN_NAMES = ["focus-default", "focus-error"];
4916
4977
  var ALPHA_TOKEN_NAMES = [
4917
4978
  "background-hover-alpha",
@@ -4930,6 +4991,7 @@ var SEMANTIC_TOKEN_REGISTRY = [
4930
4991
  ...metas("brand", BRAND_TOKEN_NAMES),
4931
4992
  ...metas("status", STATUS_TOKEN_NAMES),
4932
4993
  ...metas("chart", CHART_TOKEN_NAMES),
4994
+ ...metas("syntax", SYNTAX_TOKEN_NAMES),
4933
4995
  ...metas("focus", FOCUS_TOKEN_NAMES),
4934
4996
  ...metas("alpha", ALPHA_TOKEN_NAMES)
4935
4997
  ];
@@ -4947,6 +5009,7 @@ export {
4947
5009
  NXDS_APPEARANCE_COOKIE_MAX_AGE_SECONDS,
4948
5010
  NXDS_APPEARANCE_DATA_ATTRS,
4949
5011
  PALETTE_KEYS,
5012
+ RUNTIME_LAYER_ORDER,
4950
5013
  SEMANTIC_TOKEN_REGISTRY,
4951
5014
  SNAPSHOT_VERSION,
4952
5015
  STROKE_OPTIONS,