brand-intent 0.20.1 → 0.21.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "brand-intent",
3
- "version": "0.20.1",
3
+ "version": "0.21.0",
4
4
  "description": "An open file format specification for making brand intent machine-readable.",
5
5
  "author": "Christophe Stoll <christophe@stoll.studio>",
6
6
  "license": "MIT",
@@ -35,10 +35,13 @@
35
35
  ],
36
36
  "scripts": {
37
37
  "release": "./scripts/release.sh",
38
+ "typecheck": "tsc -p .",
38
39
  "test": "tsx tests/brandParser.test.ts && tsx tests/identityParser.test.ts && tsx tests/colorSystem.test.ts && tsx tests/icons.test.ts && tsx tests/purposeParser.test.ts && tsx tests/realBrands.test.ts"
39
40
  },
40
41
  "devDependencies": {
41
- "tsx": "^4.19.0"
42
+ "@types/node": "^26.6.5",
43
+ "tsx": "^4.19.0",
44
+ "typescript": "^6.0.3"
42
45
  },
43
46
  "files": [
44
47
  "cli/",
@@ -1658,8 +1658,9 @@ export function parseBrandFile(content: string, fileName: string): ParsedBrand {
1658
1658
  });
1659
1659
  }
1660
1660
 
1661
- // Counter colours default to the label badge's.
1661
+ // Counter colours default to the label badge's, headline to text-primary.
1662
1662
  for (const theme of Object.values(themes)) {
1663
+ if (theme['headline'] === undefined && theme['text-primary'] !== undefined) theme['headline'] = theme['text-primary'];
1663
1664
  if (theme['counter-bg'] === undefined && theme['label-bg'] !== undefined) theme['counter-bg'] = theme['label-bg'];
1664
1665
  if (theme['counter-fg'] === undefined && theme['label-fg'] !== undefined) theme['counter-fg'] = theme['label-fg'];
1665
1666
  }
@@ -101,6 +101,7 @@ export function derivePairSlots(ground: string, figure: string, text: string): R
101
101
  const slots: Record<string, string> = {
102
102
  'background': ground,
103
103
  'text-primary': text,
104
+ 'headline': text,
104
105
  };
105
106
  for (const [slot, alpha] of TEXT_TIERS) slots[slot] = withAlpha(text, alpha);
106
107
  for (const slot of ['logo', 'cta', 'divider', 'icon', 'illustration', 'sticker-bg', 'label-bg', 'counter-bg']) {
@@ -231,7 +232,9 @@ export function toneAnchorsFrom(
231
232
  if (!anchor) continue;
232
233
  for (const hex of Object.values(ladder)) {
233
234
  if (hex === anchor) continue;
234
- (out[hex] ??= []).includes(anchor) || out[hex].push(anchor);
235
+ const list: string[] = out[hex] ?? [];
236
+ if (!list.includes(anchor)) list.push(anchor);
237
+ out[hex] = list;
235
238
  }
236
239
  }
237
240
  return out;