@nxds/core 0.10.0 → 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.
@@ -2303,6 +2303,13 @@ var CHART_PALETTE_REFERENCES = [
2303
2303
  { palette: "rose", light: "600", dark: "200" },
2304
2304
  { palette: "indigo", light: "600", dark: "200" }
2305
2305
  ];
2306
+ var SYNTAX_PALETTE_REFERENCES = {
2307
+ keyword: CHART_PALETTE_REFERENCES[3],
2308
+ string: CHART_PALETTE_REFERENCES[1],
2309
+ function: CHART_PALETTE_REFERENCES[4],
2310
+ type: CHART_PALETTE_REFERENCES[0],
2311
+ constant: CHART_PALETTE_REFERENCES[2]
2312
+ };
2306
2313
 
2307
2314
  // src/lib/apca-pairs.ts
2308
2315
  var COLOR_FAMILIES = [
@@ -2317,6 +2324,8 @@ var CATEGORICAL_INDICES = CHART_PALETTE_REFERENCES.map(
2317
2324
  (_, index) => index + 1
2318
2325
  );
2319
2326
  var CHART_STAGGER_LC = 4.5;
2327
+ var DIFF_SURFACES = ["success-subtle", "error-subtle"];
2328
+ var CODE_SURFACES = ["container", "container-hover", ...DIFF_SURFACES];
2320
2329
  var FOCUS_SURFACES = [
2321
2330
  "background",
2322
2331
  "container",
@@ -2376,11 +2385,23 @@ var APCA_PAIRS = [
2376
2385
  ink(`${family}-subtle-foreground`, `${family}-subtle-active`, "ui")
2377
2386
  ]),
2378
2387
  ...CATEGORICAL_INDICES.flatMap(
2379
- (index) => ["container", "background"].map((bg) => ({
2388
+ (index) => ["container", "container-hover", "background"].map((bg) => ({
2380
2389
  ...ink(`chart-categorical-${index}`, bg, "ui"),
2381
2390
  offset: (index - 1) * CHART_STAGGER_LC
2382
2391
  }))
2383
2392
  ),
2393
+ ...CODE_SURFACES.flatMap(
2394
+ (bg) => Object.keys(SYNTAX_PALETTE_REFERENCES).map(
2395
+ (role) => ink(`syntax-${role}`, bg, "ui")
2396
+ )
2397
+ ),
2398
+ // codeBlockTheme also colours code with the text tokens, which already read
2399
+ // on container and container-hover.
2400
+ ...DIFF_SURFACES.flatMap((bg) => [
2401
+ text("foreground", bg, "ui"),
2402
+ text("muted-foreground", bg, "ui"),
2403
+ text("muted-foreground-subtle", bg, "incidental")
2404
+ ]),
2384
2405
  // Focus is the primary accent (components.md § Focus States), so it shares
2385
2406
  // one solved color with primary-subtle-foreground.
2386
2407
  ...FOCUS_SURFACES.flatMap((surface) => [
@@ -4461,6 +4482,14 @@ function deriveChart(mode) {
4461
4482
  ])
4462
4483
  );
4463
4484
  }
4485
+ function deriveSyntax(mode) {
4486
+ return Object.fromEntries(
4487
+ Object.entries(SYNTAX_PALETTE_REFERENCES).map(([role, reference]) => [
4488
+ `--nx-color-syntax-${role}`,
4489
+ getPaletteShade(reference.palette, reference[mode])
4490
+ ])
4491
+ );
4492
+ }
4464
4493
  function deriveAlpha(surfaceTone, mode, profile) {
4465
4494
  const tone = SURFACE_TONE[surfaceTone];
4466
4495
  const dark = mode === "dark";
@@ -4576,6 +4605,7 @@ function deriveThemeMode(input, mode) {
4576
4605
  ...deriveSecondary(mode),
4577
4606
  ...deriveStatus(mode),
4578
4607
  ...deriveChart(mode),
4608
+ ...deriveSyntax(mode),
4579
4609
  ...deriveAlpha(surfaceTone, mode, profile),
4580
4610
  "--nx-color-focus-error": getPaletteShade(
4581
4611
  STATUS_PALETTE_FAMILIES.error,
@@ -5008,6 +5038,13 @@ var CHART_TOKEN_NAMES = [
5008
5038
  "chart-categorical-4",
5009
5039
  "chart-categorical-5"
5010
5040
  ];
5041
+ var SYNTAX_TOKEN_NAMES = [
5042
+ "syntax-keyword",
5043
+ "syntax-string",
5044
+ "syntax-function",
5045
+ "syntax-type",
5046
+ "syntax-constant"
5047
+ ];
5011
5048
  var FOCUS_TOKEN_NAMES = ["focus-default", "focus-error"];
5012
5049
  var ALPHA_TOKEN_NAMES = [
5013
5050
  "background-hover-alpha",
@@ -5026,6 +5063,7 @@ var SEMANTIC_TOKEN_REGISTRY = [
5026
5063
  ...metas("brand", BRAND_TOKEN_NAMES),
5027
5064
  ...metas("status", STATUS_TOKEN_NAMES),
5028
5065
  ...metas("chart", CHART_TOKEN_NAMES),
5066
+ ...metas("syntax", SYNTAX_TOKEN_NAMES),
5029
5067
  ...metas("focus", FOCUS_TOKEN_NAMES),
5030
5068
  ...metas("alpha", ALPHA_TOKEN_NAMES)
5031
5069
  ];