@astryxdesign/theme-stone 0.7.3 → 0.7.4-canary.1b56e00

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,262 @@
1
+ {
2
+ "recipe": "astryx-oklch-v1",
3
+ "vibrancy": 16,
4
+ "neutralProfile": "neutral-v1",
5
+ "modeStrategy": "light-and-dark",
6
+ "stops": [
7
+ 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90,
8
+ 95, 100
9
+ ],
10
+ "families": [
11
+ {
12
+ "id": "neutral",
13
+ "name": "Stone Neutral",
14
+ "seed": "#77777c",
15
+ "anchors": [
16
+ {
17
+ "mode": "light",
18
+ "stop": 15,
19
+ "color": "#25252a",
20
+ "policy": "exact"
21
+ },
22
+ {
23
+ "mode": "light",
24
+ "stop": 50,
25
+ "color": "#77777c",
26
+ "policy": "exact"
27
+ },
28
+ {
29
+ "mode": "light",
30
+ "stop": 90,
31
+ "color": "#e2e2e8",
32
+ "policy": "exact"
33
+ },
34
+ {
35
+ "mode": "dark",
36
+ "stop": 15,
37
+ "color": "#25252a",
38
+ "policy": "exact"
39
+ },
40
+ {
41
+ "mode": "dark",
42
+ "stop": 50,
43
+ "color": "#77777c",
44
+ "policy": "exact"
45
+ },
46
+ {
47
+ "mode": "dark",
48
+ "stop": 90,
49
+ "color": "#e2e2e8",
50
+ "policy": "exact"
51
+ }
52
+ ]
53
+ },
54
+ {
55
+ "id": "red",
56
+ "name": "Red",
57
+ "seed": "#8a716d",
58
+ "anchors": [
59
+ {
60
+ "mode": "light",
61
+ "stop": 50,
62
+ "color": "#8a716d",
63
+ "policy": "exact"
64
+ },
65
+ {
66
+ "mode": "dark",
67
+ "stop": 50,
68
+ "color": "#8a716d",
69
+ "policy": "exact"
70
+ }
71
+ ]
72
+ },
73
+ {
74
+ "id": "orange",
75
+ "name": "Orange",
76
+ "seed": "#8f7154",
77
+ "anchors": [
78
+ {
79
+ "mode": "light",
80
+ "stop": 50,
81
+ "color": "#8f7154",
82
+ "policy": "exact"
83
+ },
84
+ {
85
+ "mode": "light",
86
+ "stop": 90,
87
+ "color": "#ffdcbb",
88
+ "policy": "exact"
89
+ },
90
+ {
91
+ "mode": "dark",
92
+ "stop": 50,
93
+ "color": "#8f7154",
94
+ "policy": "exact"
95
+ },
96
+ {
97
+ "mode": "dark",
98
+ "stop": 90,
99
+ "color": "#ffdcbb",
100
+ "policy": "exact"
101
+ }
102
+ ]
103
+ },
104
+ {
105
+ "id": "yellow",
106
+ "name": "Yellow",
107
+ "seed": "#927f25",
108
+ "anchors": [
109
+ {
110
+ "mode": "light",
111
+ "stop": 50,
112
+ "color": "#927f25",
113
+ "policy": "exact"
114
+ },
115
+ {
116
+ "mode": "light",
117
+ "stop": 90,
118
+ "color": "#f4e1b7",
119
+ "policy": "exact"
120
+ },
121
+ {
122
+ "mode": "dark",
123
+ "stop": 50,
124
+ "color": "#927f25",
125
+ "policy": "exact"
126
+ },
127
+ {
128
+ "mode": "dark",
129
+ "stop": 90,
130
+ "color": "#f1e1b9",
131
+ "policy": "exact"
132
+ }
133
+ ]
134
+ },
135
+ {
136
+ "id": "green",
137
+ "name": "Green",
138
+ "seed": "#528b49",
139
+ "anchors": [
140
+ {
141
+ "mode": "light",
142
+ "stop": 50,
143
+ "color": "#528b49",
144
+ "policy": "exact"
145
+ },
146
+ {
147
+ "mode": "light",
148
+ "stop": 85,
149
+ "color": "#bfdfbb",
150
+ "policy": "exact"
151
+ },
152
+ {
153
+ "mode": "dark",
154
+ "stop": 50,
155
+ "color": "#528b49",
156
+ "policy": "exact"
157
+ },
158
+ {
159
+ "mode": "dark",
160
+ "stop": 85,
161
+ "color": "#c3ddbf",
162
+ "policy": "exact"
163
+ }
164
+ ]
165
+ },
166
+ {
167
+ "id": "teal",
168
+ "name": "Teal",
169
+ "seed": "#477b6b",
170
+ "anchors": [
171
+ {
172
+ "mode": "light",
173
+ "stop": 50,
174
+ "color": "#588174",
175
+ "policy": "exact"
176
+ },
177
+ {
178
+ "mode": "dark",
179
+ "stop": 50,
180
+ "color": "#588174",
181
+ "policy": "exact"
182
+ }
183
+ ]
184
+ },
185
+ {
186
+ "id": "cyan",
187
+ "name": "Cyan",
188
+ "seed": "#507b86",
189
+ "anchors": [
190
+ {
191
+ "mode": "light",
192
+ "stop": 50,
193
+ "color": "#507b86",
194
+ "policy": "exact"
195
+ },
196
+ {
197
+ "mode": "dark",
198
+ "stop": 50,
199
+ "color": "#507b86",
200
+ "policy": "exact"
201
+ }
202
+ ]
203
+ },
204
+ {
205
+ "id": "blue",
206
+ "name": "Blue",
207
+ "seed": "#6c7888",
208
+ "anchors": [
209
+ {
210
+ "mode": "light",
211
+ "stop": 50,
212
+ "color": "#6c7888",
213
+ "policy": "exact"
214
+ },
215
+ {
216
+ "mode": "dark",
217
+ "stop": 50,
218
+ "color": "#6c7888",
219
+ "policy": "exact"
220
+ }
221
+ ]
222
+ },
223
+ {
224
+ "id": "purple",
225
+ "name": "Purple",
226
+ "seed": "#7b7486",
227
+ "anchors": [
228
+ {
229
+ "mode": "light",
230
+ "stop": 50,
231
+ "color": "#7b7486",
232
+ "policy": "exact"
233
+ },
234
+ {
235
+ "mode": "dark",
236
+ "stop": 50,
237
+ "color": "#7b7486",
238
+ "policy": "exact"
239
+ }
240
+ ]
241
+ },
242
+ {
243
+ "id": "pink",
244
+ "name": "Pink",
245
+ "seed": "#83727c",
246
+ "anchors": [
247
+ {
248
+ "mode": "light",
249
+ "stop": 50,
250
+ "color": "#83727c",
251
+ "policy": "exact"
252
+ },
253
+ {
254
+ "mode": "dark",
255
+ "stop": 50,
256
+ "color": "#83727c",
257
+ "policy": "exact"
258
+ }
259
+ ]
260
+ }
261
+ ]
262
+ }
package/src/source.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
- export {stoneTheme, stonePalettes} from './stoneTheme';
3
+ export {stonePalettes, stoneTheme} from './stoneTheme';
4
4
  export {stoneIconRegistry} from './icons';
@@ -0,0 +1,44 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ import {readFileSync} from 'node:fs';
4
+ import {describe, expect, it} from 'vitest';
5
+ import {stoneTheme} from './stoneTheme';
6
+
7
+ const source = readFileSync(
8
+ new URL('./stoneTheme.ts', import.meta.url),
9
+ 'utf8',
10
+ );
11
+
12
+ const publicPaletteStart = source.indexOf('export const stonePalettes');
13
+ if (publicPaletteStart < 0) {
14
+ throw new Error('stoneTheme.ts: stonePalettes export marker not found');
15
+ }
16
+ const maintainedThemeSource = source.slice(0, publicPaletteStart);
17
+
18
+ describe('stone color token mapping completeness', () => {
19
+ it('maps every color token Stone owns through its reviewed palette', () => {
20
+ expect(
21
+ Object.keys(stoneTheme.tokens).filter(name =>
22
+ name.startsWith('--color-data-'),
23
+ ),
24
+ ).toEqual([]);
25
+ });
26
+
27
+ it('keeps every resolved root color concrete', () => {
28
+ for (const [name, value] of Object.entries(stoneTheme.tokens)) {
29
+ if (!name.startsWith('--color-') || name.startsWith('--color-data-')) {
30
+ continue;
31
+ }
32
+ expect(typeof value, name).toBe('string');
33
+ expect(value, name).toMatch(
34
+ /^(?:transparent|#[0-9a-f]{6}(?:[0-9a-f]{2})?|light-dark\(#[0-9a-f]{6}(?:[0-9a-f]{2})?, #[0-9a-f]{6}(?:[0-9a-f]{2})?\))$/i,
35
+ );
36
+ }
37
+ });
38
+
39
+ it('uses no one-off color literals in the maintained theme source', () => {
40
+ expect(maintainedThemeSource).not.toMatch(
41
+ /#[0-9a-f]{3,8}\b|\brgba?\(|\bhsl[a]?\(|\boklch\(|\bblack\b|\bwhite\b/i,
42
+ );
43
+ });
44
+ });
@@ -0,0 +1,51 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ // Generated from the committed full palette for the stops used by Stone's
4
+ // theme source. Regenerate with `pnpm generate:stone-palette-refs`.
5
+ // Keep the complete palette available for authoring and audits without
6
+ // making consumers pay for unused palette stops.
7
+ // prettier-ignore
8
+ export const stonePaletteRefs = {
9
+ green: {
10
+ light: {30: '#354f31', 55: '#609757', 85: '#bfdfbb', 90: '#d2eccf'},
11
+ dark: {25: '#2f412c', 35: '#3e5d38', 70: '#90ba8a', 80: '#b3d0af', 90: '#d5e9d2'},
12
+ },
13
+ yellow: {
14
+ light: {30: '#524818', 40: '#736419', 55: '#a08c36', 85: '#e7d3a4', 90: '#f4e1b7'},
15
+ dark: {25: '#433b1b', 35: '#615620', 70: '#c2af6e', 80: '#d9c794', 90: '#f1e1b9'},
16
+ },
17
+ red: {
18
+ light: {30: '#603c37', 40: '#745752', 60: '#a98984', 85: '#f0cac4', 90: '#fbdad4'},
19
+ dark: {25: '#50332e', 35: '#684a45', 70: '#c6a29c', 80: '#e0bdb8', 90: '#f7dbd7'},
20
+ },
21
+ purple: {
22
+ light: {30: '#4c405b', 40: '#635a70', 85: '#d9cfea', 90: '#e7def5'},
23
+ dark: {25: '#3f374c', 35: '#574e64', 70: '#b0a5c0', 90: '#e6def3'},
24
+ },
25
+ teal: {
26
+ light: {30: '#2c4f44', 40: '#40675c', 85: '#c3dbd2', 90: '#d4e8e1'},
27
+ dark: {25: '#274239', 35: '#3a5b50', 70: '#94b3a9', 90: '#d6e7e1'},
28
+ },
29
+ neutral: {
30
+ light: {0: '#000000', 15: '#25252a', 30: '#46464e', 40: '#5f5f64', 55: '#848489', 85: '#d4d3dd', 90: '#e2e2e8', 95: '#f0f0f7', 100: '#ffffff'},
31
+ dark: {0: '#000000', 5: '#101018', 10: '#1b1b21', 15: '#25252a', 20: '#302f36', 25: '#3a3a42', 35: '#525159', 40: '#5e5e64', 65: '#9d9ea5', 70: '#ababb3', 90: '#e2e2e8', 95: '#f0f0f9', 100: '#ffffff'},
32
+ },
33
+ orange: {
34
+ dark: {25: '#4e3522', 35: '#684c34', 70: '#c9a382', 90: '#ffdcbb'},
35
+ light: {30: '#5e3f27', 85: '#f2cdaa', 90: '#ffdcbb'},
36
+ },
37
+ blue: {
38
+ light: {30: '#344861', 40: '#516074', 85: '#c2d6f1', 90: '#d3e4fc'},
39
+ dark: {25: '#2c3c52', 35: '#445469', 70: '#9aadc7', 90: '#d5e4f8'},
40
+ },
41
+ cyan: {
42
+ light: {30: '#264d57', 85: '#badbe4', 90: '#cbe9f0'},
43
+ dark: {25: '#234048', 35: '#345761', 90: '#cfe8ee'},
44
+ },
45
+ pink: {
46
+ light: {30: '#5a3c4f', 85: '#e9cadc', 90: '#f5d9ea'},
47
+ dark: {25: '#4b3242', 35: '#624a59', 90: '#f2dbe8'},
48
+ },
49
+ } as const;
50
+
51
+ export default stonePaletteRefs;