@astryxdesign/theme-gothic 0.7.17-canary.gffd1fc0 → 0.7.17

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.
Files changed (63) hide show
  1. package/README.md +6 -10
  2. package/dist/gothic.d.ts +1 -0
  3. package/dist/gothic.js +320 -1
  4. package/dist/gothicPaletteRefs.generated.d.ts +16 -15
  5. package/dist/gothicPaletteRefs.generated.d.ts.map +1 -1
  6. package/dist/gothicTheme.d.cts +6 -0
  7. package/dist/gothicTheme.d.ts +6 -0
  8. package/dist/gothicTheme.d.ts.map +1 -1
  9. package/dist/source.cjs +104 -7
  10. package/dist/source.d.cts +1 -1
  11. package/dist/source.d.ts +1 -1
  12. package/dist/source.d.ts.map +1 -1
  13. package/dist/source.mjs +103 -7
  14. package/dist/theme.css +296 -0
  15. package/fonts/fustat-arabic-400-normal.woff2 +0 -0
  16. package/fonts/fustat-arabic-500-normal.woff2 +0 -0
  17. package/fonts/fustat-arabic-600-normal.woff2 +0 -0
  18. package/fonts/fustat-arabic-700-normal.woff2 +0 -0
  19. package/fonts/fustat-latin-400-normal.woff2 +0 -0
  20. package/fonts/fustat-latin-500-normal.woff2 +0 -0
  21. package/fonts/fustat-latin-600-normal.woff2 +0 -0
  22. package/fonts/fustat-latin-700-normal.woff2 +0 -0
  23. package/fonts/fustat-latin-ext-400-normal.woff2 +0 -0
  24. package/fonts/fustat-latin-ext-500-normal.woff2 +0 -0
  25. package/fonts/fustat-latin-ext-600-normal.woff2 +0 -0
  26. package/fonts/fustat-latin-ext-700-normal.woff2 +0 -0
  27. package/fonts/fustat.LICENSE.txt +93 -0
  28. package/fonts/jetbrains-mono-cyrillic-400-normal.woff2 +0 -0
  29. package/fonts/jetbrains-mono-cyrillic-500-normal.woff2 +0 -0
  30. package/fonts/jetbrains-mono-cyrillic-600-normal.woff2 +0 -0
  31. package/fonts/jetbrains-mono-cyrillic-700-normal.woff2 +0 -0
  32. package/fonts/jetbrains-mono-cyrillic-ext-400-normal.woff2 +0 -0
  33. package/fonts/jetbrains-mono-cyrillic-ext-500-normal.woff2 +0 -0
  34. package/fonts/jetbrains-mono-cyrillic-ext-600-normal.woff2 +0 -0
  35. package/fonts/jetbrains-mono-cyrillic-ext-700-normal.woff2 +0 -0
  36. package/fonts/jetbrains-mono-greek-400-normal.woff2 +0 -0
  37. package/fonts/jetbrains-mono-greek-500-normal.woff2 +0 -0
  38. package/fonts/jetbrains-mono-greek-600-normal.woff2 +0 -0
  39. package/fonts/jetbrains-mono-greek-700-normal.woff2 +0 -0
  40. package/fonts/jetbrains-mono-latin-400-normal.woff2 +0 -0
  41. package/fonts/jetbrains-mono-latin-500-normal.woff2 +0 -0
  42. package/fonts/jetbrains-mono-latin-600-normal.woff2 +0 -0
  43. package/fonts/jetbrains-mono-latin-700-normal.woff2 +0 -0
  44. package/fonts/jetbrains-mono-latin-ext-400-normal.woff2 +0 -0
  45. package/fonts/jetbrains-mono-latin-ext-500-normal.woff2 +0 -0
  46. package/fonts/jetbrains-mono-latin-ext-600-normal.woff2 +0 -0
  47. package/fonts/jetbrains-mono-latin-ext-700-normal.woff2 +0 -0
  48. package/fonts/jetbrains-mono-vietnamese-400-normal.woff2 +0 -0
  49. package/fonts/jetbrains-mono-vietnamese-500-normal.woff2 +0 -0
  50. package/fonts/jetbrains-mono-vietnamese-600-normal.woff2 +0 -0
  51. package/fonts/jetbrains-mono-vietnamese-700-normal.woff2 +0 -0
  52. package/fonts/jetbrains-mono.LICENSE.txt +93 -0
  53. package/fonts/manufacturing-consent-latin-400-normal.woff2 +0 -0
  54. package/fonts/manufacturing-consent-latin-ext-400-normal.woff2 +0 -0
  55. package/fonts/manufacturing-consent.LICENSE.txt +93 -0
  56. package/fonts/unifrakturmaguntia-latin-400-normal.woff2 +0 -0
  57. package/fonts/unifrakturmaguntia.LICENSE.txt +93 -0
  58. package/fonts.css +480 -1
  59. package/package.json +4 -3
  60. package/src/gothicPaletteRefs.generated.ts +3 -3
  61. package/src/gothicTheme.ts +126 -4
  62. package/src/source.ts +1 -1
  63. package/LICENSE +0 -21
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astryxdesign/theme-gothic",
3
- "version": "0.7.17-canary.gffd1fc0",
3
+ "version": "0.7.17",
4
4
  "displayName": "Gothic Theme",
5
5
  "private": false,
6
6
  "description": "Deep blue-grays and a signature display serif. Dramatic and editorial, for surfaces that want to be remembered.",
@@ -58,6 +58,7 @@
58
58
  "src",
59
59
  "fonts.css",
60
60
  "fonts.css.d.ts",
61
+ "fonts",
61
62
  "theme.css.d.ts",
62
63
  "palette.config.json",
63
64
  "!**/*.test.*",
@@ -78,11 +79,11 @@
78
79
  "lucide-react": "^1.66.0"
79
80
  },
80
81
  "peerDependencies": {
81
- "@astryxdesign/core": "0.7.17-canary.gffd1fc0",
82
+ "@astryxdesign/core": "0.7.17",
82
83
  "react": ">=19"
83
84
  },
84
85
  "devDependencies": {
85
- "@astryxdesign/cli": "0.7.17-canary.gffd1fc0"
86
+ "@astryxdesign/cli": "0.7.17"
86
87
  },
87
88
  "module": "./dist/source.mjs",
88
89
  "scripts": {
@@ -6,15 +6,15 @@
6
6
  // making consumers pay for unused palette stops.
7
7
  // prettier-ignore
8
8
  export const gothicPaletteRefs = {
9
+ neutral: {
10
+ dark: {0: '#000000', 10: '#101314', 15: '#191d20', 20: '#24292d', 35: '#3e454b', 40: '#495056', 50: '#5e676e', 65: '#7e8791', 75: '#96a0ab', 80: '#a7b1bb', 95: '#e8f1f6', 100: '#ffffff'},
11
+ },
9
12
  purple: {
10
13
  dark: {20: '#481b58', 30: '#5a2370', 60: '#947da6', 75: '#b29bc4', 80: '#c39adb'},
11
14
  },
12
15
  green: {
13
16
  dark: {5: '#071607', 20: '#244023', 30: '#3a5e2c', 55: '#869b72', 60: '#96a880', 70: '#a3c987', 75: '#b3c79a'},
14
17
  },
15
- neutral: {
16
- dark: {0: '#000000', 10: '#101314', 15: '#191d20', 20: '#24292d', 35: '#3e454b', 40: '#495056', 50: '#5e676e', 65: '#7e8791', 75: '#96a0ab', 95: '#e8f1f6', 100: '#ffffff'},
17
- },
18
18
  yellow: {
19
19
  dark: {15: '#573f0b', 30: '#876515', 60: '#b6a775', 65: '#e6b85e', 70: '#dec074', 75: '#d3c490'},
20
20
  },
@@ -13,6 +13,7 @@
13
13
  */
14
14
 
15
15
  import {defineTheme, defineSyntaxTheme} from '@astryxdesign/core/theme';
16
+ import type {ComponentStyleMap} from '@astryxdesign/core/theme';
16
17
  import {gothicIconRegistry} from './icons';
17
18
  import {gothicPaletteRefs} from './gothicPaletteRefs.generated';
18
19
 
@@ -21,6 +22,100 @@ const {blue, cyan, green, neutral, orange, pink, purple, red, teal, yellow} =
21
22
 
22
23
  const withAlpha = (color: string, alpha: string): string => `${color}${alpha}`;
23
24
 
25
+ // The theme's own text and link colours, which a part that paints a fill
26
+ // of its own sets again (OWN_FILL_RULES).
27
+ const SURFACE_TEXT = {
28
+ '--color-text-primary': neutral.dark[95],
29
+ '--color-text-secondary': neutral.dark[75],
30
+ '--color-text-accent': neutral.dark[95],
31
+ };
32
+
33
+ /**
34
+ * Core's selector for a striped table's painted rows, under the row's
35
+ * `striped` state.
36
+ */
37
+ const STRIPED_ROW = ':nth-child(even of :not([data-expansion-panel]))';
38
+
39
+ /**
40
+ * The rules of the parts that paint a fill of their own (a surface, a
41
+ * popover, the muted fill or a card fill) and draw text on it, each as
42
+ * `[part, rule, selector?]`. A coloured card's ink must not reach them, so
43
+ * each sets the theme's own text and link colours again. A transparent card
44
+ * is left out: it paints nothing, so it keeps its parent's ink.
45
+ */
46
+ const OWN_FILL_RULES: ReadonlyArray<readonly [string, string, string?]> = [
47
+ ['card', 'variant:default'],
48
+ ['card', 'variant:muted'],
49
+ ['clickable-card', 'variant:default'],
50
+ ['clickable-card', 'variant:muted'],
51
+ ['selectable-card', 'variant:default'],
52
+ ['selectable-card', 'variant:muted'],
53
+ ['section', 'variant:section'],
54
+ ['section', 'variant:muted'],
55
+ ['app-shell', 'variant:surface'],
56
+ ['app-shell', 'variant:section'],
57
+ ['app-shell-header', 'variant:surface'],
58
+ ['app-shell-sidenav', 'variant:surface'],
59
+ ['layout-panel', 'base'],
60
+ ['layout-content', 'base'],
61
+ ['code', 'base'],
62
+ ['avatar', 'base'],
63
+ ['avatar-group-overflow', 'base'],
64
+ ['segmented-control-item', 'selected'],
65
+ ['step-indicator', 'progress:not-started'],
66
+ ['table-row', 'striped', STRIPED_ROW],
67
+ ['banner-content', 'base'],
68
+ ['input-group-text', 'base'],
69
+ ['text-input', 'base'],
70
+ ['text-area', 'base'],
71
+ ['number-input', 'base'],
72
+ ['date-input', 'base'],
73
+ ['date-range-input', 'base'],
74
+ ['date-time-input-date-segment', 'base'],
75
+ ['date-time-input-time-segment', 'base'],
76
+ ['time-input', 'base'],
77
+ ['file-input', 'base'],
78
+ ['typeahead', 'base'],
79
+ ['tokenizer', 'base'],
80
+ ['selector', 'variant:input'],
81
+ ['multi-selector', 'variant:input'],
82
+ ['selector-popup', 'base'],
83
+ ['multi-selector-popup', 'base'],
84
+ ['dropdown-menu', 'base'],
85
+ ['dropdown-menu-radio', 'base'],
86
+ ['context-menu', 'base'],
87
+ ['popover', 'base'],
88
+ ['hover-card', 'base'],
89
+ ['dialog', 'base'],
90
+ ['drawer', 'base'],
91
+ ['bottom-sheet', 'base'],
92
+ ['chat-composer-drawer', 'base'],
93
+ ];
94
+
95
+ /** Puts SURFACE_TEXT under each own-fill rule; a rule's own values win. */
96
+ function withOwnFillText(components: ComponentStyleMap): ComponentStyleMap {
97
+ const out: ComponentStyleMap = {...components};
98
+ for (const [part, key, selector] of OWN_FILL_RULES) {
99
+ const rule = out[part]?.[key] ?? {};
100
+ out[part] = {
101
+ ...out[part],
102
+ [key]: selector
103
+ ? {
104
+ ...rule,
105
+ // A table sets its text color on its root, so a painted row
106
+ // sets it again as well as the tokens.
107
+ [selector]: {
108
+ ...SURFACE_TEXT,
109
+ color: 'var(--color-text-primary)',
110
+ ...((rule as Record<string, object>)[selector] ?? {}),
111
+ },
112
+ }
113
+ : {...SURFACE_TEXT, ...rule},
114
+ };
115
+ }
116
+ return out;
117
+ }
118
+
24
119
  /**
25
120
  * Gothic syntax palette — atmospheric tones drawn from the gothic
26
121
  * categorical palette: deep purples (cathedral), blood crimson (tags),
@@ -82,6 +177,13 @@ const SECONDARY_SELECTOR = {
82
177
  },
83
178
  } as const;
84
179
 
180
+ /**
181
+ * Gothic draws one color mode, dark, in light and dark pages alike. Tools
182
+ * read this to judge it in that mode; the build writes it into the built
183
+ * module.
184
+ */
185
+ export const colorModes = ['dark'] as const;
186
+
85
187
  export const gothicTheme = defineTheme({
86
188
  name: 'gothic',
87
189
 
@@ -237,6 +339,8 @@ export const gothicTheme = defineTheme({
237
339
  '--radius-element': '0.5rem',
238
340
  '--radius-container': '0.75rem',
239
341
  '--radius-page': '1.5rem',
342
+ // Chat surfaces stay rounder than cards.
343
+ '--radius-chat': '28px',
240
344
  '--radius-full': '9999px',
241
345
 
242
346
  // =========================================================================
@@ -252,7 +356,7 @@ export const gothicTheme = defineTheme({
252
356
  '--shadow-inset-error': `inset 0 0 0 1px ${withAlpha(red.dark[75], '50')}`,
253
357
  },
254
358
 
255
- components: {
359
+ components: withOwnFillText({
256
360
  button: {
257
361
  'variant:secondary': SECONDARY_BUTTON,
258
362
  'variant:ghost': {
@@ -268,8 +372,12 @@ export const gothicTheme = defineTheme({
268
372
  },
269
373
  },
270
374
  // Secondary selector triggers match the secondary Button (AST-079 FR2).
271
- selector: {'variant:secondary': SECONDARY_SELECTOR},
272
- 'multi-selector': {'variant:secondary': SECONDARY_SELECTOR},
375
+ selector: {
376
+ 'variant:secondary': SECONDARY_SELECTOR,
377
+ },
378
+ 'multi-selector': {
379
+ 'variant:secondary': SECONDARY_SELECTOR,
380
+ },
273
381
  'complex-selector': {'variant:secondary': SECONDARY_BUTTON},
274
382
 
275
383
  badge: {
@@ -326,45 +434,59 @@ export const gothicTheme = defineTheme({
326
434
  padding: 'var(--spacing-3)',
327
435
  borderRadius: 'var(--radius-container)',
328
436
  },
437
+ // On the accent tint of a selected row or a numbered citation over the
438
+ // card's fill, secondary text needs the next stop.
439
+ 'variant:default': {'--color-text-secondary': neutral.dark[80]},
440
+ 'variant:muted': {'--color-text-secondary': neutral.dark[80]},
329
441
  // Categorical variants — flip --color-text-primary so child
330
442
  // XDSText labels stay readable against the dusty pastel bg.
331
443
  'variant:blue': {
444
+ '--color-text-accent': 'var(--color-text-blue)',
332
445
  '--color-text-primary': 'var(--color-text-blue)',
333
446
  '--color-text-secondary': 'var(--color-text-blue)',
334
447
  },
335
448
  'variant:cyan': {
449
+ '--color-text-accent': 'var(--color-text-cyan)',
336
450
  '--color-text-primary': 'var(--color-text-cyan)',
337
451
  '--color-text-secondary': 'var(--color-text-cyan)',
338
452
  },
339
453
  'variant:gray': {
454
+ '--color-text-accent': 'var(--color-text-gray)',
340
455
  '--color-text-primary': 'var(--color-text-gray)',
341
456
  '--color-text-secondary': 'var(--color-text-gray)',
342
457
  },
343
458
  'variant:green': {
459
+ '--color-text-accent': 'var(--color-text-green)',
344
460
  '--color-text-primary': 'var(--color-text-green)',
345
461
  '--color-text-secondary': 'var(--color-text-green)',
346
462
  },
347
463
  'variant:orange': {
464
+ '--color-text-accent': 'var(--color-text-orange)',
348
465
  '--color-text-primary': 'var(--color-text-orange)',
349
466
  '--color-text-secondary': 'var(--color-text-orange)',
350
467
  },
351
468
  'variant:pink': {
469
+ '--color-text-accent': 'var(--color-text-pink)',
352
470
  '--color-text-primary': 'var(--color-text-pink)',
353
471
  '--color-text-secondary': 'var(--color-text-pink)',
354
472
  },
355
473
  'variant:purple': {
474
+ '--color-text-accent': 'var(--color-text-purple)',
356
475
  '--color-text-primary': 'var(--color-text-purple)',
357
476
  '--color-text-secondary': 'var(--color-text-purple)',
358
477
  },
359
478
  'variant:red': {
479
+ '--color-text-accent': 'var(--color-text-red)',
360
480
  '--color-text-primary': 'var(--color-text-red)',
361
481
  '--color-text-secondary': 'var(--color-text-red)',
362
482
  },
363
483
  'variant:teal': {
484
+ '--color-text-accent': 'var(--color-text-teal)',
364
485
  '--color-text-primary': 'var(--color-text-teal)',
365
486
  '--color-text-secondary': 'var(--color-text-teal)',
366
487
  },
367
488
  'variant:yellow': {
489
+ '--color-text-accent': 'var(--color-text-yellow)',
368
490
  '--color-text-primary': 'var(--color-text-yellow)',
369
491
  '--color-text-secondary': 'var(--color-text-yellow)',
370
492
  },
@@ -398,7 +520,7 @@ export const gothicTheme = defineTheme({
398
520
  '"Manufacturing Consent", "UnifrakturMaguntia", "Old English Text MT", serif',
399
521
  },
400
522
  },
401
- },
523
+ }),
402
524
 
403
525
  // Gothic's accent text and icons are one light color. On a media surface
404
526
  // they follow that surface's accent, so a dark surface inside a light one
package/src/source.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
- export {gothicPalettes, gothicTheme} from './gothicTheme';
3
+ export {colorModes, gothicPalettes, gothicTheme} from './gothicTheme';
4
4
  export {gothicIconRegistry} from './icons';
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Meta Platforms, Inc.
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.