@phcdevworks/spectre-tokens 2.0.0 → 2.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
@@ -54,16 +54,16 @@
54
54
  --sp-color-neutral-700: #334155;
55
55
  --sp-color-neutral-800: #1e293b;
56
56
  --sp-color-neutral-900: #0f172a;
57
- --sp-color-accent-50: #eff6ff;
58
- --sp-color-accent-100: #dbeafe;
57
+ --sp-color-accent-50: #f5f3ff;
58
+ --sp-color-accent-100: #ede9fe;
59
59
  --sp-color-accent-200: #ddd6fe;
60
- --sp-color-accent-300: #93c5fd;
61
- --sp-color-accent-400: #60a5fa;
60
+ --sp-color-accent-300: #c4b5fd;
61
+ --sp-color-accent-400: #a78bfa;
62
62
  --sp-color-accent-500: #8b5cf6;
63
63
  --sp-color-accent-600: #7c3aed;
64
64
  --sp-color-accent-700: #6d28d9;
65
- --sp-color-accent-800: #1e40af;
66
- --sp-color-accent-900: #1e3a8a;
65
+ --sp-color-accent-800: #5b21b6;
66
+ --sp-color-accent-900: #4c1d95;
67
67
  --sp-color-success-50: #f0fdf4;
68
68
  --sp-color-success-100: #dcfce7;
69
69
  --sp-color-success-200: #bbf7d0;
@@ -150,6 +150,9 @@
150
150
  --sp-layout-container-padding-inline-sm: 1rem;
151
151
  --sp-layout-container-padding-inline-md: 1.5rem;
152
152
  --sp-layout-container-padding-inline-lg: 2rem;
153
+ --sp-layout-container-max-width: 72rem;
154
+ --sp-border-width-base: 1px;
155
+ --sp-border-width-thick: 2px;
153
156
  --sp-radius-none: 0;
154
157
  --sp-radius-sm: 2px;
155
158
  --sp-radius-md: 4px;
@@ -246,6 +249,7 @@
246
249
  --sp-button-primary-bgdisabled: #e2e8f0;
247
250
  --sp-button-primary-text: #ffffff;
248
251
  --sp-button-primary-textdisabled: #94a3b8;
252
+ --sp-button-primary-focusring: rgba(59, 130, 246, 0.4);
249
253
  --sp-button-secondary-bg: #ffffff;
250
254
  --sp-button-secondary-bghover: #f8fafc;
251
255
  --sp-button-secondary-bgactive: #f1f5f9;
@@ -254,24 +258,28 @@
254
258
  --sp-button-secondary-textdisabled: #94a3b8;
255
259
  --sp-button-secondary-border: #2563eb;
256
260
  --sp-button-secondary-borderdisabled: #e2e8f0;
261
+ --sp-button-secondary-focusring: rgba(59, 130, 246, 0.4);
257
262
  --sp-button-ghost-bg: transparent;
258
263
  --sp-button-ghost-bghover: #eff6ff;
259
264
  --sp-button-ghost-bgactive: #dbeafe;
260
265
  --sp-button-ghost-bgdisabled: transparent;
261
266
  --sp-button-ghost-text: #2563eb;
262
267
  --sp-button-ghost-textdisabled: #94a3b8;
268
+ --sp-button-ghost-focusring: rgba(59, 130, 246, 0.4);
263
269
  --sp-button-danger-bg: #dc2626;
264
270
  --sp-button-danger-bghover: #b91c1c;
265
271
  --sp-button-danger-bgactive: #991b1b;
266
272
  --sp-button-danger-bgdisabled: #fecaca;
267
273
  --sp-button-danger-text: #ffffff;
268
274
  --sp-button-danger-textdisabled: #94a3b8;
275
+ --sp-button-danger-focusring: rgba(239, 68, 68, 0.4);
269
276
  --sp-button-success-bg: #15803d;
270
277
  --sp-button-success-bghover: #166534;
271
278
  --sp-button-success-bgactive: #14532d;
272
279
  --sp-button-success-bgdisabled: #bbf7d0;
273
280
  --sp-button-success-text: #ffffff;
274
281
  --sp-button-success-textdisabled: #94a3b8;
282
+ --sp-button-success-focusring: rgba(34, 197, 94, 0.4);
275
283
  --sp-button-cta-bg: #f59e0b;
276
284
  --sp-button-cta-bghover: #d97706;
277
285
  --sp-button-cta-bgactive: #b45309;
@@ -279,12 +287,14 @@
279
287
  --sp-button-cta-text: #0f172a;
280
288
  --sp-button-cta-textdisabled: #94a3b8;
281
289
  --sp-button-cta-shadow: 0 4px 14px 0 rgba(245, 158, 11, 0.39);
290
+ --sp-button-cta-focusring: rgba(245, 158, 11, 0.4);
282
291
  --sp-button-accent-bg: #7c3aed;
283
292
  --sp-button-accent-bghover: #6d28d9;
284
- --sp-button-accent-bgactive: #1e40af;
293
+ --sp-button-accent-bgactive: #5b21b6;
285
294
  --sp-button-accent-bgdisabled: #ddd6fe;
286
295
  --sp-button-accent-text: #ffffff;
287
296
  --sp-button-accent-textdisabled: #94a3b8;
297
+ --sp-button-accent-focusring: rgba(139, 92, 246, 0.4);
288
298
  --sp-form-default-bg: #ffffff;
289
299
  --sp-form-default-border: #cbd5e1;
290
300
  --sp-form-default-text: #0f172a;
@@ -331,7 +341,7 @@
331
341
  --sp-surface-card: #1e293b;
332
342
  --sp-surface-input: #334155;
333
343
  --sp-surface-overlay: #1e293b;
334
- --sp-surface-hero: linear-gradient(135deg, #1e3a8a 0%, #6d28d9 100%);
344
+ --sp-surface-hero: linear-gradient(135deg, #4c1d95 0%, #6d28d9 100%);
335
345
  --sp-text-on-page-default: #f8fafc;
336
346
  --sp-text-on-page-muted: #cbd5e1;
337
347
  --sp-text-on-page-subtle: #94a3b8;
package/dist/index.d.cts CHANGED
@@ -199,6 +199,9 @@ interface SpectreGeneratedTokens {
199
199
  textDisabled: {
200
200
  value: string;
201
201
  };
202
+ focusRing: {
203
+ value: string;
204
+ };
202
205
  };
203
206
  secondary: {
204
207
  bg: {
@@ -228,6 +231,9 @@ interface SpectreGeneratedTokens {
228
231
  borderDisabled: {
229
232
  value: string;
230
233
  };
234
+ focusRing: {
235
+ value: string;
236
+ };
231
237
  };
232
238
  ghost: {
233
239
  bg: {
@@ -248,6 +254,9 @@ interface SpectreGeneratedTokens {
248
254
  textDisabled: {
249
255
  value: string;
250
256
  };
257
+ focusRing: {
258
+ value: string;
259
+ };
251
260
  };
252
261
  danger: {
253
262
  bg: {
@@ -271,6 +280,9 @@ interface SpectreGeneratedTokens {
271
280
  textDisabled: {
272
281
  value: string;
273
282
  };
283
+ focusRing: {
284
+ value: string;
285
+ };
274
286
  };
275
287
  success: {
276
288
  bg: {
@@ -294,6 +306,9 @@ interface SpectreGeneratedTokens {
294
306
  textDisabled: {
295
307
  value: string;
296
308
  };
309
+ focusRing: {
310
+ value: string;
311
+ };
297
312
  };
298
313
  cta: {
299
314
  bg: {
@@ -320,6 +335,9 @@ interface SpectreGeneratedTokens {
320
335
  shadow: {
321
336
  value: string;
322
337
  };
338
+ focusRing: {
339
+ value: string;
340
+ };
323
341
  };
324
342
  accent: {
325
343
  bg: {
@@ -343,6 +361,9 @@ interface SpectreGeneratedTokens {
343
361
  textDisabled: {
344
362
  value: string;
345
363
  };
364
+ focusRing: {
365
+ value: string;
366
+ };
346
367
  };
347
368
  };
348
369
  forms: {
@@ -743,6 +764,9 @@ interface SpectreGeneratedTokens {
743
764
  pair: string;
744
765
  };
745
766
  };
767
+ neutralBgHover: {
768
+ value: string;
769
+ };
746
770
  neutralText: {
747
771
  value: string;
748
772
  metadata: {};
@@ -753,6 +777,9 @@ interface SpectreGeneratedTokens {
753
777
  pair: string;
754
778
  };
755
779
  };
780
+ infoBgHover: {
781
+ value: string;
782
+ };
756
783
  infoText: {
757
784
  value: string;
758
785
  metadata: {};
@@ -763,6 +790,9 @@ interface SpectreGeneratedTokens {
763
790
  pair: string;
764
791
  };
765
792
  };
793
+ successBgHover: {
794
+ value: string;
795
+ };
766
796
  successText: {
767
797
  value: string;
768
798
  metadata: {};
@@ -773,6 +803,9 @@ interface SpectreGeneratedTokens {
773
803
  pair: string;
774
804
  };
775
805
  };
806
+ warningBgHover: {
807
+ value: string;
808
+ };
776
809
  warningText: {
777
810
  value: string;
778
811
  metadata: {};
@@ -783,6 +816,9 @@ interface SpectreGeneratedTokens {
783
816
  pair: string;
784
817
  };
785
818
  };
819
+ dangerBgHover: {
820
+ value: string;
821
+ };
786
822
  dangerText: {
787
823
  value: string;
788
824
  metadata: {};
@@ -1138,6 +1174,12 @@ interface SpectreGeneratedTokens {
1138
1174
  card: string;
1139
1175
  input: string;
1140
1176
  };
1177
+ border: {
1178
+ width: {
1179
+ base: string;
1180
+ thick: string;
1181
+ };
1182
+ };
1141
1183
  surface: {
1142
1184
  page: {
1143
1185
  value: string;
@@ -1198,6 +1240,7 @@ interface SpectreGeneratedTokens {
1198
1240
  md: string;
1199
1241
  lg: string;
1200
1242
  };
1243
+ maxWidth: string;
1201
1244
  };
1202
1245
  };
1203
1246
  font: {
@@ -1447,6 +1490,7 @@ interface LayoutTokens {
1447
1490
  };
1448
1491
  container: {
1449
1492
  paddingInline: TokenScale;
1493
+ maxWidth: string;
1450
1494
  };
1451
1495
  }
1452
1496
  interface Tokens extends Omit<SpectreGeneratedTokens, 'modes' | 'surface' | 'text'> {
@@ -1471,6 +1515,8 @@ interface TailwindTheme {
1471
1515
  transitionDuration: SpectreGeneratedTokens['transitions']['duration'];
1472
1516
  transitionTimingFunction: SpectreGeneratedTokens['transitions']['easing'];
1473
1517
  opacity: SpectreGeneratedTokens['opacity'];
1518
+ maxWidth: Record<string, string | undefined>;
1519
+ borderWidth: Record<string, string | undefined>;
1474
1520
  }
1475
1521
 
1476
1522
  declare const generateCssVariables: (tokens: SpectreTokens, options?: CssVariableOptions) => string;
package/dist/index.d.ts CHANGED
@@ -199,6 +199,9 @@ interface SpectreGeneratedTokens {
199
199
  textDisabled: {
200
200
  value: string;
201
201
  };
202
+ focusRing: {
203
+ value: string;
204
+ };
202
205
  };
203
206
  secondary: {
204
207
  bg: {
@@ -228,6 +231,9 @@ interface SpectreGeneratedTokens {
228
231
  borderDisabled: {
229
232
  value: string;
230
233
  };
234
+ focusRing: {
235
+ value: string;
236
+ };
231
237
  };
232
238
  ghost: {
233
239
  bg: {
@@ -248,6 +254,9 @@ interface SpectreGeneratedTokens {
248
254
  textDisabled: {
249
255
  value: string;
250
256
  };
257
+ focusRing: {
258
+ value: string;
259
+ };
251
260
  };
252
261
  danger: {
253
262
  bg: {
@@ -271,6 +280,9 @@ interface SpectreGeneratedTokens {
271
280
  textDisabled: {
272
281
  value: string;
273
282
  };
283
+ focusRing: {
284
+ value: string;
285
+ };
274
286
  };
275
287
  success: {
276
288
  bg: {
@@ -294,6 +306,9 @@ interface SpectreGeneratedTokens {
294
306
  textDisabled: {
295
307
  value: string;
296
308
  };
309
+ focusRing: {
310
+ value: string;
311
+ };
297
312
  };
298
313
  cta: {
299
314
  bg: {
@@ -320,6 +335,9 @@ interface SpectreGeneratedTokens {
320
335
  shadow: {
321
336
  value: string;
322
337
  };
338
+ focusRing: {
339
+ value: string;
340
+ };
323
341
  };
324
342
  accent: {
325
343
  bg: {
@@ -343,6 +361,9 @@ interface SpectreGeneratedTokens {
343
361
  textDisabled: {
344
362
  value: string;
345
363
  };
364
+ focusRing: {
365
+ value: string;
366
+ };
346
367
  };
347
368
  };
348
369
  forms: {
@@ -743,6 +764,9 @@ interface SpectreGeneratedTokens {
743
764
  pair: string;
744
765
  };
745
766
  };
767
+ neutralBgHover: {
768
+ value: string;
769
+ };
746
770
  neutralText: {
747
771
  value: string;
748
772
  metadata: {};
@@ -753,6 +777,9 @@ interface SpectreGeneratedTokens {
753
777
  pair: string;
754
778
  };
755
779
  };
780
+ infoBgHover: {
781
+ value: string;
782
+ };
756
783
  infoText: {
757
784
  value: string;
758
785
  metadata: {};
@@ -763,6 +790,9 @@ interface SpectreGeneratedTokens {
763
790
  pair: string;
764
791
  };
765
792
  };
793
+ successBgHover: {
794
+ value: string;
795
+ };
766
796
  successText: {
767
797
  value: string;
768
798
  metadata: {};
@@ -773,6 +803,9 @@ interface SpectreGeneratedTokens {
773
803
  pair: string;
774
804
  };
775
805
  };
806
+ warningBgHover: {
807
+ value: string;
808
+ };
776
809
  warningText: {
777
810
  value: string;
778
811
  metadata: {};
@@ -783,6 +816,9 @@ interface SpectreGeneratedTokens {
783
816
  pair: string;
784
817
  };
785
818
  };
819
+ dangerBgHover: {
820
+ value: string;
821
+ };
786
822
  dangerText: {
787
823
  value: string;
788
824
  metadata: {};
@@ -1138,6 +1174,12 @@ interface SpectreGeneratedTokens {
1138
1174
  card: string;
1139
1175
  input: string;
1140
1176
  };
1177
+ border: {
1178
+ width: {
1179
+ base: string;
1180
+ thick: string;
1181
+ };
1182
+ };
1141
1183
  surface: {
1142
1184
  page: {
1143
1185
  value: string;
@@ -1198,6 +1240,7 @@ interface SpectreGeneratedTokens {
1198
1240
  md: string;
1199
1241
  lg: string;
1200
1242
  };
1243
+ maxWidth: string;
1201
1244
  };
1202
1245
  };
1203
1246
  font: {
@@ -1447,6 +1490,7 @@ interface LayoutTokens {
1447
1490
  };
1448
1491
  container: {
1449
1492
  paddingInline: TokenScale;
1493
+ maxWidth: string;
1450
1494
  };
1451
1495
  }
1452
1496
  interface Tokens extends Omit<SpectreGeneratedTokens, 'modes' | 'surface' | 'text'> {
@@ -1471,6 +1515,8 @@ interface TailwindTheme {
1471
1515
  transitionDuration: SpectreGeneratedTokens['transitions']['duration'];
1472
1516
  transitionTimingFunction: SpectreGeneratedTokens['transitions']['easing'];
1473
1517
  opacity: SpectreGeneratedTokens['opacity'];
1518
+ maxWidth: Record<string, string | undefined>;
1519
+ borderWidth: Record<string, string | undefined>;
1474
1520
  }
1475
1521
 
1476
1522
  declare const generateCssVariables: (tokens: SpectreTokens, options?: CssVariableOptions) => string;
package/dist/index.js CHANGED
@@ -199,6 +199,9 @@ var coreTokens = {
199
199
  },
200
200
  "textDisabled": {
201
201
  "value": "{colors.neutral.400}"
202
+ },
203
+ "focusRing": {
204
+ "value": "{colors.info.500} / 0.4"
202
205
  }
203
206
  },
204
207
  "secondary": {
@@ -228,6 +231,9 @@ var coreTokens = {
228
231
  },
229
232
  "borderDisabled": {
230
233
  "value": "{colors.neutral.200}"
234
+ },
235
+ "focusRing": {
236
+ "value": "{colors.info.500} / 0.4"
231
237
  }
232
238
  },
233
239
  "ghost": {
@@ -248,6 +254,9 @@ var coreTokens = {
248
254
  },
249
255
  "textDisabled": {
250
256
  "value": "{colors.neutral.400}"
257
+ },
258
+ "focusRing": {
259
+ "value": "{colors.info.500} / 0.4"
251
260
  }
252
261
  },
253
262
  "danger": {
@@ -271,6 +280,9 @@ var coreTokens = {
271
280
  },
272
281
  "textDisabled": {
273
282
  "value": "{colors.neutral.400}"
283
+ },
284
+ "focusRing": {
285
+ "value": "{colors.error.500} / 0.4"
274
286
  }
275
287
  },
276
288
  "success": {
@@ -294,6 +306,9 @@ var coreTokens = {
294
306
  },
295
307
  "textDisabled": {
296
308
  "value": "{colors.neutral.400}"
309
+ },
310
+ "focusRing": {
311
+ "value": "{colors.success.500} / 0.4"
297
312
  }
298
313
  },
299
314
  "cta": {
@@ -320,6 +335,9 @@ var coreTokens = {
320
335
  },
321
336
  "shadow": {
322
337
  "value": "0 4px 14px 0 {colors.warning.500} / 0.39"
338
+ },
339
+ "focusRing": {
340
+ "value": "{colors.warning.500} / 0.4"
323
341
  }
324
342
  },
325
343
  "accent": {
@@ -343,6 +361,9 @@ var coreTokens = {
343
361
  },
344
362
  "textDisabled": {
345
363
  "value": "{colors.neutral.400}"
364
+ },
365
+ "focusRing": {
366
+ "value": "{colors.accent.500} / 0.4"
346
367
  }
347
368
  }
348
369
  },
@@ -744,6 +765,9 @@ var coreTokens = {
744
765
  "pair": "modes.dark.component.badge.neutralText"
745
766
  }
746
767
  },
768
+ "neutralBgHover": {
769
+ "value": "{colors.neutral.600}"
770
+ },
747
771
  "neutralText": {
748
772
  "value": "{colors.neutral.100}",
749
773
  "metadata": {}
@@ -754,6 +778,9 @@ var coreTokens = {
754
778
  "pair": "modes.dark.component.badge.infoText"
755
779
  }
756
780
  },
781
+ "infoBgHover": {
782
+ "value": "{colors.info.700}"
783
+ },
757
784
  "infoText": {
758
785
  "value": "{colors.info.100}",
759
786
  "metadata": {}
@@ -764,6 +791,9 @@ var coreTokens = {
764
791
  "pair": "modes.dark.component.badge.successText"
765
792
  }
766
793
  },
794
+ "successBgHover": {
795
+ "value": "{colors.success.700}"
796
+ },
767
797
  "successText": {
768
798
  "value": "{colors.success.100}",
769
799
  "metadata": {}
@@ -774,6 +804,9 @@ var coreTokens = {
774
804
  "pair": "modes.dark.component.badge.warningText"
775
805
  }
776
806
  },
807
+ "warningBgHover": {
808
+ "value": "{colors.warning.700}"
809
+ },
777
810
  "warningText": {
778
811
  "value": "{colors.warning.100}",
779
812
  "metadata": {}
@@ -784,6 +817,9 @@ var coreTokens = {
784
817
  "pair": "modes.dark.component.badge.dangerText"
785
818
  }
786
819
  },
820
+ "dangerBgHover": {
821
+ "value": "{colors.error.700}"
822
+ },
787
823
  "dangerText": {
788
824
  "value": "{colors.error.100}",
789
825
  "metadata": {}
@@ -922,16 +958,16 @@ var coreTokens = {
922
958
  "900": "#0f172a"
923
959
  },
924
960
  "accent": {
925
- "50": "#eff6ff",
926
- "100": "#dbeafe",
961
+ "50": "#f5f3ff",
962
+ "100": "#ede9fe",
927
963
  "200": "#ddd6fe",
928
- "300": "#93c5fd",
929
- "400": "#60a5fa",
964
+ "300": "#c4b5fd",
965
+ "400": "#a78bfa",
930
966
  "500": "#8b5cf6",
931
967
  "600": "#7c3aed",
932
968
  "700": "#6d28d9",
933
- "800": "#1e40af",
934
- "900": "#1e3a8a"
969
+ "800": "#5b21b6",
970
+ "900": "#4c1d95"
935
971
  },
936
972
  "success": {
937
973
  "50": "#f0fdf4",
@@ -1139,6 +1175,12 @@ var coreTokens = {
1139
1175
  "card": "{colors.neutral.200}",
1140
1176
  "input": "{colors.neutral.300}"
1141
1177
  },
1178
+ "border": {
1179
+ "width": {
1180
+ "base": "1px",
1181
+ "thick": "2px"
1182
+ }
1183
+ },
1142
1184
  "surface": {
1143
1185
  "page": {
1144
1186
  "value": "{colors.neutral.50}",
@@ -1198,7 +1240,8 @@ var coreTokens = {
1198
1240
  "sm": "1rem",
1199
1241
  "md": "1.5rem",
1200
1242
  "lg": "2rem"
1201
- }
1243
+ },
1244
+ "maxWidth": "72rem"
1202
1245
  }
1203
1246
  },
1204
1247
  "font": {
@@ -1400,6 +1443,16 @@ var createCssVariableMap = (tokens2, options = {}) => {
1400
1443
  assign(toVariableName(prefix, "layout", "container", "padding-inline", key), value);
1401
1444
  });
1402
1445
  }
1446
+ const container = layout.container;
1447
+ if (container?.maxWidth) {
1448
+ assign(toVariableName(prefix, "layout", "container", "max-width"), container.maxWidth);
1449
+ }
1450
+ }
1451
+ const border = baseTokens.border;
1452
+ if (border?.width) {
1453
+ Object.entries(border.width).forEach(([key, value]) => {
1454
+ assign(toVariableName(prefix, "border", "width", key), value);
1455
+ });
1403
1456
  }
1404
1457
  Object.entries(baseTokens.radii).forEach(([key, value]) => {
1405
1458
  assign(toVariableName(prefix, "radius", key), value);
@@ -1778,7 +1831,7 @@ var createTailwindTheme = (source = tokens) => {
1778
1831
  return {
1779
1832
  colors,
1780
1833
  spacing: { ...source.space ?? {} },
1781
- borderRadius: { ...source.radii },
1834
+ borderRadius: { ...source.radii ?? {} },
1782
1835
  fontFamily,
1783
1836
  fontSize,
1784
1837
  boxShadow: { ...source.shadows },
@@ -1786,7 +1839,14 @@ var createTailwindTheme = (source = tokens) => {
1786
1839
  zIndex: { ...source.zIndex },
1787
1840
  transitionDuration: { ...source.transitions.duration },
1788
1841
  transitionTimingFunction: { ...source.transitions.easing },
1789
- opacity: { ...source.opacity }
1842
+ opacity: { ...source.opacity },
1843
+ maxWidth: {
1844
+ container: source.layout?.container?.maxWidth
1845
+ },
1846
+ borderWidth: {
1847
+ DEFAULT: source.border?.width.base,
1848
+ ...source.border?.width ?? {}
1849
+ }
1790
1850
  };
1791
1851
  };
1792
1852
  var tailwindTheme = createTailwindTheme(tokens);