@wtfalch/design 0.2.0 → 0.3.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.
@@ -0,0 +1,103 @@
1
+ /**
2
+ * valet's two palettes.
3
+ *
4
+ * One hue that belongs to nothing else. The accent is an indigo, chosen so it
5
+ * sits apart from all four status tones: good is green, warn is amber, bad is
6
+ * red, and info is a cyan rather than a blue so a link and an information pill
7
+ * cannot be confused at a glance. The accent is what a person acts on; the
8
+ * tones are what the system says. They never share a colour.
9
+ *
10
+ * Every colour is measured, not judged: `contrast.test.ts` holds both palettes
11
+ * to the same pairs as tf's.
12
+ *
13
+ * The palettes name colours and nothing else. What makes valet valet under
14
+ * either of them -- the type and the corners -- is the identity below, on
15
+ * `:root` in valet's stylesheet and under every palette `applyTheme` lays on.
16
+ * Both palettes used to restate it, which is the shape that breaks the moment
17
+ * a theme is shared between products: silent on the font, it would have fallen
18
+ * back to tf's.
19
+ */
20
+ const FONT = 'var(--font-sans, "IBM Plex Sans"), -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif';
21
+ const FONT_MONO = 'var(--font-mono, "JetBrains Mono"), ui-monospace, SFMono-Regular, Menlo, monospace';
22
+ /**
23
+ * valet's identity: what it is under every theme.
24
+ *
25
+ * The fonts are named, not shipped. `--font` reads a `--font-sans` variable
26
+ * the app defines with whatever loads its fonts, and falls back to the family
27
+ * by name; the gallery loads both families from `gallery/public/fonts` so the
28
+ * specimens are photographed in them. Sharper corners than the package
29
+ * default, because a console is read in rows and columns and a large radius
30
+ * rounds the grid away.
31
+ */
32
+ export const VALET_IDENTITY = {
33
+ '--font': FONT,
34
+ '--font-mono': FONT_MONO,
35
+ '--radius-sm': '2px',
36
+ '--radius': '4px',
37
+ '--radius-md': '6px',
38
+ '--radius-lg': '10px',
39
+ };
40
+ export const light = {
41
+ name: 'valet',
42
+ note: 'Light. Ink on paper, indigo where you act.',
43
+ scheme: 'light',
44
+ tokens: {
45
+ '--bg': '#f4f5f8',
46
+ '--panel': '#ffffff',
47
+ '--panel-2': '#eceef3',
48
+ '--border': '#dcdfe7',
49
+ '--border-strong': '#7b8597',
50
+ '--text': '#171a21',
51
+ '--muted': '#5b6474',
52
+ '--accent': '#4f46e5',
53
+ '--accent-dim': '#a9a4f0',
54
+ '--on-accent': '#ffffff',
55
+ '--good': '#1b7f4b',
56
+ '--warn': '#8a5f0a',
57
+ '--bad': '#bf3a31',
58
+ '--info': '#0e6f8e',
59
+ '--app-bg': '#f4f5f8',
60
+ // Black shadows muddy a light surface; these carry the page's own ink.
61
+ '--shadow-1': '0 4px 14px rgba(23, 26, 33, 0.08)',
62
+ '--shadow-2': '0 8px 24px rgba(23, 26, 33, 0.10)',
63
+ '--shadow-3': '0 12px 32px rgba(23, 26, 33, 0.12)',
64
+ '--scrim': 'rgba(23, 26, 33, 0.32)',
65
+ },
66
+ };
67
+ export const night = {
68
+ name: 'valet night',
69
+ note: 'Dark. The same ink, lit from behind.',
70
+ scheme: 'dark',
71
+ tokens: {
72
+ '--bg': '#0c0f14',
73
+ '--panel': '#141820',
74
+ '--panel-2': '#1b2029',
75
+ '--border': '#262c37',
76
+ '--border-strong': '#616b7d',
77
+ '--text': '#e8eaf0',
78
+ '--muted': '#9ba4b5',
79
+ '--accent': '#8f88ff',
80
+ '--accent-dim': '#3f3a8f',
81
+ // Near-black on the pale indigo, 6.46:1. White would be 2.6:1.
82
+ '--on-accent': '#0d0b2e',
83
+ '--good': '#5fcb8f',
84
+ '--warn': '#e2ae58',
85
+ '--bad': '#f28b84',
86
+ '--info': '#57c4e8',
87
+ '--app-bg': '#0c0f14',
88
+ '--shadow-1': '0 6px 20px rgba(0, 0, 0, 0.28)',
89
+ '--shadow-2': '0 8px 28px rgba(0, 0, 0, 0.34)',
90
+ '--shadow-3': '0 10px 34px rgba(0, 0, 0, 0.38)',
91
+ '--scrim': 'rgba(0, 0, 0, 0.5)',
92
+ },
93
+ };
94
+ /** Keyed by the name `applyTheme` takes: `name` lowercased, spaces to hyphens. */
95
+ export const VALET_THEMES = { valet: light, 'valet-night': night };
96
+ /** valet, the product: its badge in `brandMarks.ts`, the identity above, the
97
+ * two palettes, and light until somebody picks. */
98
+ export const valet = {
99
+ name: 'valet',
100
+ identity: VALET_IDENTITY,
101
+ themes: VALET_THEMES,
102
+ defaultTheme: 'valet',
103
+ };