@phcdevworks/spectre-tokens 2.9.0 → 3.1.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/dist/index.css CHANGED
@@ -3,8 +3,12 @@
3
3
  --sp-surface-card: #ffffff;
4
4
  --sp-surface-input: #ffffff;
5
5
  --sp-surface-overlay: rgba(0, 0, 0, 0.6);
6
- --sp-surface-alternate: #eef1f6;
6
+ --sp-surface-subtle: #eef1f6;
7
7
  --sp-surface-hero: linear-gradient(135deg, #5b6ee1 0%, #6f3fd7 100%);
8
+ --sp-surface-hover: #eef1f6;
9
+ --sp-surface-selected: #f0f9ff;
10
+ --sp-surface-active: #d9dfeb;
11
+ --sp-surface-divider: #d9dfeb;
8
12
  --sp-text-on-page-default: #141b24;
9
13
  --sp-text-on-page-muted: #4b576a;
10
14
  --sp-text-on-page-subtle: #657287;
@@ -72,6 +76,10 @@
72
76
  --sp-dropdown-item-hover: #eef1f6;
73
77
  --sp-dropdown-item-active: #f0f9ff;
74
78
  --sp-dropdown-item-text: #141b24;
79
+ --sp-link-default: #1f57db;
80
+ --sp-link-hover: #1946b4;
81
+ --sp-link-active: #173b8f;
82
+ --sp-link-visited: #5d28b8;
75
83
  --sp-color-brand-50: #eef4ff;
76
84
  --sp-color-brand-100: #d9e7ff;
77
85
  --sp-color-brand-200: #b9d2ff;
@@ -184,6 +192,8 @@
184
192
  --sp-layout-container-padding-inline-md: 1.5rem;
185
193
  --sp-layout-container-padding-inline-lg: 2rem;
186
194
  --sp-layout-container-max-width: 72rem;
195
+ --sp-layout-container-max-width-prose: 65ch;
196
+ --sp-layout-sidebar-width: 16rem;
187
197
  --sp-border-width-none: 0;
188
198
  --sp-border-width-base: 1px;
189
199
  --sp-border-width-thick: 2px;
@@ -422,8 +432,12 @@
422
432
  --sp-surface-card: #222b38;
423
433
  --sp-surface-input: #374253;
424
434
  --sp-surface-overlay: rgba(0, 0, 0, 0.6);
425
- --sp-surface-alternate: #222b38;
435
+ --sp-surface-subtle: #222b38;
426
436
  --sp-surface-hero: linear-gradient(135deg, #5d28b8 0%, #401f75 100%);
437
+ --sp-surface-hover: #374253;
438
+ --sp-surface-selected: #082f49;
439
+ --sp-surface-active: #4b576a;
440
+ --sp-surface-divider: #374253;
427
441
  --sp-text-on-page-default: #f7f8fb;
428
442
  --sp-text-on-page-muted: #b7c1d4;
429
443
  --sp-text-on-page-subtle: #8a96ad;
@@ -491,4 +505,8 @@
491
505
  --sp-dropdown-item-hover: #374253;
492
506
  --sp-dropdown-item-active: #082f49;
493
507
  --sp-dropdown-item-text: #eef1f6;
508
+ --sp-link-default: #1f57db;
509
+ --sp-link-hover: #1946b4;
510
+ --sp-link-active: #173b8f;
511
+ --sp-link-visited: #5d28b8;
494
512
  }
package/dist/index.d.cts CHANGED
@@ -233,7 +233,7 @@ interface SpectreGeneratedTokens {
233
233
  card: string;
234
234
  input: string;
235
235
  overlay: string;
236
- alternate: string;
236
+ subtle: string;
237
237
  hero: string;
238
238
  hover: string;
239
239
  selected: string;
@@ -379,7 +379,7 @@ interface SpectreGeneratedTokens {
379
379
  card: string;
380
380
  input: string;
381
381
  overlay: string;
382
- alternate: string;
382
+ subtle: string;
383
383
  hero: string;
384
384
  hover: string;
385
385
  selected: string;
@@ -899,6 +899,10 @@ interface SpectreGeneratedTokens {
899
899
  lg: string;
900
900
  };
901
901
  maxWidth: string;
902
+ maxWidthProse: string;
903
+ };
904
+ sidebar: {
905
+ width: string;
902
906
  };
903
907
  };
904
908
  font: {
@@ -1208,7 +1212,7 @@ interface SpectreModeTokens {
1208
1212
  card: SemanticTokenValue;
1209
1213
  input: SemanticTokenValue;
1210
1214
  overlay: SemanticTokenValue;
1211
- alternate: SemanticTokenValue;
1215
+ subtle: SemanticTokenValue;
1212
1216
  hero: SemanticTokenValue;
1213
1217
  hover: SemanticTokenValue;
1214
1218
  selected: SemanticTokenValue;
@@ -1245,6 +1249,10 @@ interface LayoutTokens {
1245
1249
  container: {
1246
1250
  paddingInline: TokenScale;
1247
1251
  maxWidth: string;
1252
+ maxWidthProse: string;
1253
+ };
1254
+ sidebar: {
1255
+ width: string;
1248
1256
  };
1249
1257
  }
1250
1258
  type Tokens = SpectreGeneratedTokens;
@@ -1269,6 +1277,7 @@ interface TailwindTheme {
1269
1277
  transitionTimingFunction: SpectreGeneratedTokens['transitions']['easing'];
1270
1278
  opacity: SpectreGeneratedTokens['opacity'];
1271
1279
  maxWidth: Record<string, string | undefined>;
1280
+ width: Record<string, string | undefined>;
1272
1281
  borderWidth: Record<string, string | undefined>;
1273
1282
  }
1274
1283
 
package/dist/index.d.ts CHANGED
@@ -233,7 +233,7 @@ interface SpectreGeneratedTokens {
233
233
  card: string;
234
234
  input: string;
235
235
  overlay: string;
236
- alternate: string;
236
+ subtle: string;
237
237
  hero: string;
238
238
  hover: string;
239
239
  selected: string;
@@ -379,7 +379,7 @@ interface SpectreGeneratedTokens {
379
379
  card: string;
380
380
  input: string;
381
381
  overlay: string;
382
- alternate: string;
382
+ subtle: string;
383
383
  hero: string;
384
384
  hover: string;
385
385
  selected: string;
@@ -899,6 +899,10 @@ interface SpectreGeneratedTokens {
899
899
  lg: string;
900
900
  };
901
901
  maxWidth: string;
902
+ maxWidthProse: string;
903
+ };
904
+ sidebar: {
905
+ width: string;
902
906
  };
903
907
  };
904
908
  font: {
@@ -1208,7 +1212,7 @@ interface SpectreModeTokens {
1208
1212
  card: SemanticTokenValue;
1209
1213
  input: SemanticTokenValue;
1210
1214
  overlay: SemanticTokenValue;
1211
- alternate: SemanticTokenValue;
1215
+ subtle: SemanticTokenValue;
1212
1216
  hero: SemanticTokenValue;
1213
1217
  hover: SemanticTokenValue;
1214
1218
  selected: SemanticTokenValue;
@@ -1245,6 +1249,10 @@ interface LayoutTokens {
1245
1249
  container: {
1246
1250
  paddingInline: TokenScale;
1247
1251
  maxWidth: string;
1252
+ maxWidthProse: string;
1253
+ };
1254
+ sidebar: {
1255
+ width: string;
1248
1256
  };
1249
1257
  }
1250
1258
  type Tokens = SpectreGeneratedTokens;
@@ -1269,6 +1277,7 @@ interface TailwindTheme {
1269
1277
  transitionTimingFunction: SpectreGeneratedTokens['transitions']['easing'];
1270
1278
  opacity: SpectreGeneratedTokens['opacity'];
1271
1279
  maxWidth: Record<string, string | undefined>;
1280
+ width: Record<string, string | undefined>;
1272
1281
  borderWidth: Record<string, string | undefined>;
1273
1282
  }
1274
1283
 
package/dist/index.js CHANGED
@@ -234,7 +234,7 @@ var coreTokens = {
234
234
  "card": "{colors.white}",
235
235
  "input": "{colors.white}",
236
236
  "overlay": "{colors.black} / 0.6",
237
- "alternate": "{colors.neutral.100}",
237
+ "subtle": "{colors.neutral.100}",
238
238
  "hero": "linear-gradient(135deg, {colors.indigo.500} 0%, {colors.violet.600} 100%)",
239
239
  "hover": "{colors.neutral.100}",
240
240
  "selected": "{colors.info.50}",
@@ -380,7 +380,7 @@ var coreTokens = {
380
380
  "card": "{colors.neutral.800}",
381
381
  "input": "{colors.neutral.700}",
382
382
  "overlay": "{colors.black} / 0.6",
383
- "alternate": "{colors.neutral.800}",
383
+ "subtle": "{colors.neutral.800}",
384
384
  "hero": "linear-gradient(135deg, {colors.accent.700} 0%, {colors.accent.900} 100%)",
385
385
  "hover": "{colors.neutral.700}",
386
386
  "selected": "{colors.info.900}",
@@ -899,7 +899,11 @@ var coreTokens = {
899
899
  "md": "1.5rem",
900
900
  "lg": "2rem"
901
901
  },
902
- "maxWidth": "72rem"
902
+ "maxWidth": "72rem",
903
+ "maxWidthProse": "65ch"
904
+ },
905
+ "sidebar": {
906
+ "width": "16rem"
903
907
  }
904
908
  },
905
909
  "font": {
@@ -1201,6 +1205,13 @@ var createCssVariableMap = (tokens2, options = {}) => {
1201
1205
  if (container?.maxWidth) {
1202
1206
  assign(toVariableName(prefix, "layout", "container", "max-width"), container.maxWidth);
1203
1207
  }
1208
+ if (container?.maxWidthProse) {
1209
+ assign(toVariableName(prefix, "layout", "container", "max-width-prose"), container.maxWidthProse);
1210
+ }
1211
+ const sidebar = layout.sidebar;
1212
+ if (sidebar?.width) {
1213
+ assign(toVariableName(prefix, "layout", "sidebar", "width"), sidebar.width);
1214
+ }
1204
1215
  }
1205
1216
  const border = baseTokens.border;
1206
1217
  if (border?.width) {
@@ -1302,13 +1313,18 @@ var generateCssVariables = (tokens2, options = {}) => {
1302
1313
  const surfaceAliases = tokens2.surface ?? {};
1303
1314
  const textAliases = tokens2.text ?? {};
1304
1315
  const componentAliases = tokens2.component ?? {};
1316
+ const linkTokens = tokens2.link ?? {};
1305
1317
  const semanticEntries = [
1306
1318
  { varParts: ["surface", "page"], modePath: ["surface", "page"], aliasSrc: surfaceAliases, aliasPath: ["page"] },
1307
1319
  { varParts: ["surface", "card"], modePath: ["surface", "card"], aliasSrc: surfaceAliases, aliasPath: ["card"] },
1308
1320
  { varParts: ["surface", "input"], modePath: ["surface", "input"], aliasSrc: surfaceAliases, aliasPath: ["input"] },
1309
1321
  { varParts: ["surface", "overlay"], modePath: ["surface", "overlay"], aliasSrc: surfaceAliases, aliasPath: ["overlay"] },
1310
- { varParts: ["surface", "alternate"], modePath: ["surface", "alternate"] },
1322
+ { varParts: ["surface", "subtle"], modePath: ["surface", "subtle"] },
1311
1323
  { varParts: ["surface", "hero"], modePath: ["surface", "hero"], aliasSrc: surfaceAliases, aliasPath: ["hero"] },
1324
+ { varParts: ["surface", "hover"], modePath: ["surface", "hover"], aliasSrc: surfaceAliases, aliasPath: ["hover"] },
1325
+ { varParts: ["surface", "selected"], modePath: ["surface", "selected"], aliasSrc: surfaceAliases, aliasPath: ["selected"] },
1326
+ { varParts: ["surface", "active"], modePath: ["surface", "active"], aliasSrc: surfaceAliases, aliasPath: ["active"] },
1327
+ { varParts: ["surface", "divider"], modePath: ["surface", "divider"], aliasSrc: surfaceAliases, aliasPath: ["divider"] },
1312
1328
  { varParts: ["text", "on", "page", "default"], modePath: ["text", "onPage", "default"], aliasSrc: textAliases, aliasPath: ["onPage", "default"] },
1313
1329
  { varParts: ["text", "on", "page", "muted"], modePath: ["text", "onPage", "muted"], aliasSrc: textAliases, aliasPath: ["onPage", "muted"] },
1314
1330
  { varParts: ["text", "on", "page", "subtle"], modePath: ["text", "onPage", "subtle"], aliasSrc: textAliases, aliasPath: ["onPage", "subtle"] },
@@ -1380,6 +1396,12 @@ var generateCssVariables = (tokens2, options = {}) => {
1380
1396
  addBase(varName, pickSemantic(tokens2, getPath(defaultMode, modePath), ...aliasCandidate));
1381
1397
  addDark(varName, pickSemantic(tokens2, getPath(darkMode, modePath), getPath(defaultMode, modePath), ...aliasCandidate));
1382
1398
  });
1399
+ Object.entries(linkTokens).forEach(([key, value]) => {
1400
+ const varName = toVariableName(prefix, "link", key);
1401
+ const resolved = pickSemantic(tokens2, value);
1402
+ addBase(varName, resolved);
1403
+ addDark(varName, resolved);
1404
+ });
1383
1405
  const rootBlock = `${selector} {
1384
1406
  ${[...baseLines, ...mapLines].join("\n")}
1385
1407
  }`;
@@ -1431,7 +1453,11 @@ var createTailwindTheme = (source = tokens) => {
1431
1453
  transitionTimingFunction: { ...source.transitions.easing },
1432
1454
  opacity: { ...source.opacity },
1433
1455
  maxWidth: {
1434
- container: source.layout?.container?.maxWidth
1456
+ container: source.layout?.container?.maxWidth,
1457
+ prose: source.layout?.container?.maxWidthProse
1458
+ },
1459
+ width: {
1460
+ sidebar: source.layout?.sidebar?.width
1435
1461
  },
1436
1462
  borderWidth: {
1437
1463
  DEFAULT: source.border?.width.base,