@react-native-styled-system/core 2.2.0 → 2.2.1
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/bin/theme-gen.js +11 -22
- package/lib/commonjs/@types/ThemedDict.js +1 -318
- package/lib/commonjs/@types/ThemedDict.js.map +1 -1
- package/lib/module/@types/ThemedDict.js +0 -316
- package/lib/module/@types/ThemedDict.js.map +1 -1
- package/lib/typescript/src/@types/ThemedDict.d.ts +0 -11
- package/lib/typescript/src/@types/ThemedDict.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/@types/ThemedDict.ts +1 -359
package/bin/theme-gen.js
CHANGED
|
@@ -61,27 +61,16 @@ function printError(...args) {
|
|
|
61
61
|
console.log(`⚠️ [${_printTag}]`, ...args);
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
function
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
const localCli = [
|
|
72
|
-
path.resolve(__dirname, '../../node_modules/@react-native-styled-system/cli/bin/index.js'),
|
|
73
|
-
path.resolve(__dirname, '../../packages/cli/bin/index.js'),
|
|
74
|
-
path.resolve(process.cwd(), 'packages/cli/bin/index.js'),
|
|
75
|
-
path.resolve(process.cwd(), 'node_modules/@react-native-styled-system/cli/bin/index.js'),
|
|
76
|
-
].find((candidate) => exist(candidate));
|
|
77
|
-
|
|
78
|
-
if (!localCli) {
|
|
79
|
-
throw new Error(
|
|
80
|
-
'Theme generation requires @react-native-styled-system/cli as local dependency',
|
|
81
|
-
);
|
|
64
|
+
function getCoreVersion() {
|
|
65
|
+
const packageJsonPath = path.resolve(__dirname, '../package.json');
|
|
66
|
+
const packageJson = JSON.parse(read(packageJsonPath));
|
|
67
|
+
const version = packageJson.version;
|
|
68
|
+
|
|
69
|
+
if (!version) {
|
|
70
|
+
throw new Error(`Cannot resolve core version from '${packageJsonPath}'`);
|
|
82
71
|
}
|
|
83
72
|
|
|
84
|
-
return
|
|
73
|
+
return version;
|
|
85
74
|
}
|
|
86
75
|
|
|
87
76
|
// endregion
|
|
@@ -100,10 +89,10 @@ const go = async () => {
|
|
|
100
89
|
process.argv[3] ||
|
|
101
90
|
'./node_modules/@react-native-styled-system/core/lib/typescript/src/@types/ThemedTypings.d.ts';
|
|
102
91
|
|
|
103
|
-
const cliCommand = resolveCLI();
|
|
104
|
-
|
|
105
92
|
try {
|
|
106
|
-
|
|
93
|
+
const command = process.platform === 'win32' ? 'npx.cmd' : 'npx';
|
|
94
|
+
const cliPackage = `@react-native-styled-system/cli@${getCoreVersion()}`;
|
|
95
|
+
execFileSync(command, ['-y', cliPackage, 'generate', '--out', tmpFile, source], {
|
|
107
96
|
cwd: process.cwd(),
|
|
108
97
|
stdio: 'inherit',
|
|
109
98
|
});
|
|
@@ -3,11 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.emptyThemedDict =
|
|
7
|
-
/*
|
|
8
|
-
* Theme type from developer
|
|
9
|
-
*/
|
|
10
|
-
|
|
6
|
+
exports.emptyThemedDict = void 0;
|
|
11
7
|
const emptyThemedDict = exports.emptyThemedDict = {
|
|
12
8
|
space: {},
|
|
13
9
|
colors: {},
|
|
@@ -16,317 +12,4 @@ const emptyThemedDict = exports.emptyThemedDict = {
|
|
|
16
12
|
typography: {},
|
|
17
13
|
breakpoints: []
|
|
18
14
|
};
|
|
19
|
-
const defaultColors = {
|
|
20
|
-
'white': '#FFFFFF',
|
|
21
|
-
'black': '#000000',
|
|
22
|
-
'transparent': 'transparent',
|
|
23
|
-
'slate.50': '#f8fafc',
|
|
24
|
-
'slate.100': '#f1f5f9',
|
|
25
|
-
'slate.200': '#e2e8f0',
|
|
26
|
-
'slate.300': '#cad5e2',
|
|
27
|
-
'slate.400': '#90a1b9',
|
|
28
|
-
'slate.500': '#62748e',
|
|
29
|
-
'slate.600': '#45556c',
|
|
30
|
-
'slate.700': '#314158',
|
|
31
|
-
'slate.800': '#1d293d',
|
|
32
|
-
'slate.900': '#0f172b',
|
|
33
|
-
'slate.950': '#020618',
|
|
34
|
-
'gray.50': '#f9fafb',
|
|
35
|
-
'gray.100': '#f3f4f6',
|
|
36
|
-
'gray.200': '#e5e7eb',
|
|
37
|
-
'gray.300': '#d1d5dc',
|
|
38
|
-
'gray.400': '#99a1af',
|
|
39
|
-
'gray.500': '#6a7282',
|
|
40
|
-
'gray.600': '#4a5565',
|
|
41
|
-
'gray.700': '#364153',
|
|
42
|
-
'gray.800': '#1e2939',
|
|
43
|
-
'gray.900': '#101828',
|
|
44
|
-
'gray.950': '#030712',
|
|
45
|
-
'zinc.50': '#fafafa',
|
|
46
|
-
'zinc.100': '#f4f4f5',
|
|
47
|
-
'zinc.200': '#e4e4e7',
|
|
48
|
-
'zinc.300': '#d4d4d8',
|
|
49
|
-
'zinc.400': '#9f9fa9',
|
|
50
|
-
'zinc.500': '#71717b',
|
|
51
|
-
'zinc.600': '#52525c',
|
|
52
|
-
'zinc.700': '#3f3f46',
|
|
53
|
-
'zinc.800': '#27272a',
|
|
54
|
-
'zinc.900': '#18181b',
|
|
55
|
-
'zinc.950': '#09090b',
|
|
56
|
-
'neutral.50': '#fafafa',
|
|
57
|
-
'neutral.100': '#f5f5f5',
|
|
58
|
-
'neutral.200': '#e5e5e5',
|
|
59
|
-
'neutral.300': '#d4d4d4',
|
|
60
|
-
'neutral.400': '#a1a1a1',
|
|
61
|
-
'neutral.500': '#737373',
|
|
62
|
-
'neutral.600': '#525252',
|
|
63
|
-
'neutral.700': '#404040',
|
|
64
|
-
'neutral.800': '#262626',
|
|
65
|
-
'neutral.900': '#171717',
|
|
66
|
-
'neutral.950': '#0a0a0a',
|
|
67
|
-
'stone.50': '#fafaf9',
|
|
68
|
-
'stone.100': '#f5f5f4',
|
|
69
|
-
'stone.200': '#e7e5e4',
|
|
70
|
-
'stone.300': '#d7d3d1',
|
|
71
|
-
'stone.400': '#a6a09b',
|
|
72
|
-
'stone.500': '#79716b',
|
|
73
|
-
'stone.600': '#57534d',
|
|
74
|
-
'stone.700': '#44403b',
|
|
75
|
-
'stone.800': '#292524',
|
|
76
|
-
'stone.900': '#1c1917',
|
|
77
|
-
'stone.950': '#0c0a09',
|
|
78
|
-
'red.50': '#fef2f2',
|
|
79
|
-
'red.100': '#ffe2e2',
|
|
80
|
-
'red.200': '#ffc9c9',
|
|
81
|
-
'red.300': '#ffa2a2',
|
|
82
|
-
'red.400': '#ff6467',
|
|
83
|
-
'red.500': '#fb2c36',
|
|
84
|
-
'red.600': '#e7000b',
|
|
85
|
-
'red.700': '#c10007',
|
|
86
|
-
'red.800': '#9f0712',
|
|
87
|
-
'red.900': '#82181a',
|
|
88
|
-
'red.950': '#460809',
|
|
89
|
-
'orange.50': '#fff7ed',
|
|
90
|
-
'orange.100': '#ffedd4',
|
|
91
|
-
'orange.200': '#ffd6a7',
|
|
92
|
-
'orange.300': '#ffb869',
|
|
93
|
-
'orange.400': '#ff8903',
|
|
94
|
-
'orange.500': '#ff6900',
|
|
95
|
-
'orange.600': '#f54900',
|
|
96
|
-
'orange.700': '#ca3500',
|
|
97
|
-
'orange.800': '#9f2d00',
|
|
98
|
-
'orange.900': '#7e2a0c',
|
|
99
|
-
'orange.950': '#441306',
|
|
100
|
-
'amber.50': '#fffbeb',
|
|
101
|
-
'amber.100': '#fef3c6',
|
|
102
|
-
'amber.200': '#fee685',
|
|
103
|
-
'amber.300': '#ffd230',
|
|
104
|
-
'amber.400': '#ffb900',
|
|
105
|
-
'amber.500': '#fe9a00',
|
|
106
|
-
'amber.600': '#e17100',
|
|
107
|
-
'amber.700': '#bb4d00',
|
|
108
|
-
'amber.800': '#973c00',
|
|
109
|
-
'amber.900': '#7b3306',
|
|
110
|
-
'amber.950': '#461901',
|
|
111
|
-
'yellow.50': '#fefce8',
|
|
112
|
-
'yellow.100': '#fef9c2',
|
|
113
|
-
'yellow.200': '#fff085',
|
|
114
|
-
'yellow.300': '#ffdf20',
|
|
115
|
-
'yellow.400': '#fdc700',
|
|
116
|
-
'yellow.500': '#f0b100',
|
|
117
|
-
'yellow.600': '#d08700',
|
|
118
|
-
'yellow.700': '#a65f00',
|
|
119
|
-
'yellow.800': '#894b00',
|
|
120
|
-
'yellow.900': '#733e0a',
|
|
121
|
-
'yellow.950': '#432004',
|
|
122
|
-
'lime.50': '#f7fee7',
|
|
123
|
-
'lime.100': '#ecfcca',
|
|
124
|
-
'lime.200': '#d8f999',
|
|
125
|
-
'lime.300': '#bbf451',
|
|
126
|
-
'lime.400': '#9ae600',
|
|
127
|
-
'lime.500': '#7ccf00',
|
|
128
|
-
'lime.600': '#5ea500',
|
|
129
|
-
'lime.700': '#497d00',
|
|
130
|
-
'lime.800': '#3d6300',
|
|
131
|
-
'lime.900': '#35530e',
|
|
132
|
-
'lime.950': '#192e03',
|
|
133
|
-
'green.50': '#f0fdf4',
|
|
134
|
-
'green.100': '#dcfce7',
|
|
135
|
-
'green.200': '#b9f8cf',
|
|
136
|
-
'green.300': '#7bf1a7',
|
|
137
|
-
'green.400': '#06df72',
|
|
138
|
-
'green.500': '#00c950',
|
|
139
|
-
'green.600': '#00a63e',
|
|
140
|
-
'green.700': '#008235',
|
|
141
|
-
'green.800': '#026630',
|
|
142
|
-
'green.900': '#0d542b',
|
|
143
|
-
'green.950': '#032e15',
|
|
144
|
-
'emerald.50': '#ecfdf5',
|
|
145
|
-
'emerald.100': '#d0fae5',
|
|
146
|
-
'emerald.200': '#a4f4cf',
|
|
147
|
-
'emerald.300': '#5ee9b5',
|
|
148
|
-
'emerald.400': '#00d492',
|
|
149
|
-
'emerald.500': '#00bc7d',
|
|
150
|
-
'emerald.600': '#009966',
|
|
151
|
-
'emerald.700': '#007a55',
|
|
152
|
-
'emerald.800': '#006045',
|
|
153
|
-
'emerald.900': '#004f3b',
|
|
154
|
-
'emerald.950': '#002c22',
|
|
155
|
-
'teal.50': '#f0fdfa',
|
|
156
|
-
'teal.100': '#cbfbf1',
|
|
157
|
-
'teal.200': '#96f7e4',
|
|
158
|
-
'teal.300': '#46ecd4',
|
|
159
|
-
'teal.400': '#00d5bd',
|
|
160
|
-
'teal.500': '#00bba7',
|
|
161
|
-
'teal.600': '#009689',
|
|
162
|
-
'teal.700': '#00786f',
|
|
163
|
-
'teal.800': '#005f5a',
|
|
164
|
-
'teal.900': '#0b4f4a',
|
|
165
|
-
'teal.950': '#022f2e',
|
|
166
|
-
'cyan.50': '#ecfeff',
|
|
167
|
-
'cyan.100': '#cefafe',
|
|
168
|
-
'cyan.200': '#a2f4fd',
|
|
169
|
-
'cyan.300': '#53eafd',
|
|
170
|
-
'cyan.400': '#00d3f2',
|
|
171
|
-
'cyan.500': '#00b8db',
|
|
172
|
-
'cyan.600': '#0092b8',
|
|
173
|
-
'cyan.700': '#007595',
|
|
174
|
-
'cyan.800': '#005f78',
|
|
175
|
-
'cyan.900': '#104e64',
|
|
176
|
-
'cyan.950': '#053345',
|
|
177
|
-
'sky.50': '#f0f9ff',
|
|
178
|
-
'sky.100': '#dff2fe',
|
|
179
|
-
'sky.200': '#b8e6fe',
|
|
180
|
-
'sky.300': '#74d4ff',
|
|
181
|
-
'sky.400': '#00bcff',
|
|
182
|
-
'sky.500': '#00a6f4',
|
|
183
|
-
'sky.600': '#0084d1',
|
|
184
|
-
'sky.700': '#0069a8',
|
|
185
|
-
'sky.800': '#00598a',
|
|
186
|
-
'sky.900': '#024a70',
|
|
187
|
-
'sky.950': '#052f4a',
|
|
188
|
-
'blue.50': '#eff6ff',
|
|
189
|
-
'blue.100': '#dbeafe',
|
|
190
|
-
'blue.200': '#bedbff',
|
|
191
|
-
'blue.300': '#8ec5ff',
|
|
192
|
-
'blue.400': '#51a2ff',
|
|
193
|
-
'blue.500': '#2b7fff',
|
|
194
|
-
'blue.600': '#155dfb',
|
|
195
|
-
'blue.700': '#1447e6',
|
|
196
|
-
'blue.800': '#193cb8',
|
|
197
|
-
'blue.900': '#1c398e',
|
|
198
|
-
'blue.950': '#162556',
|
|
199
|
-
'indigo.50': '#eef2ff',
|
|
200
|
-
'indigo.100': '#e0e7ff',
|
|
201
|
-
'indigo.200': '#c7d2ff',
|
|
202
|
-
'indigo.300': '#a3b3ff',
|
|
203
|
-
'indigo.400': '#7c86ff',
|
|
204
|
-
'indigo.500': '#615fff',
|
|
205
|
-
'indigo.600': '#4f39f6',
|
|
206
|
-
'indigo.700': '#432dd7',
|
|
207
|
-
'indigo.800': '#372aac',
|
|
208
|
-
'indigo.900': '#312c85',
|
|
209
|
-
'indigo.950': '#1e1a4d',
|
|
210
|
-
'violet.50': '#f5f3ff',
|
|
211
|
-
'violet.100': '#ede9fe',
|
|
212
|
-
'violet.200': '#ddd6ff',
|
|
213
|
-
'violet.300': '#c4b4ff',
|
|
214
|
-
'violet.400': '#a684ff',
|
|
215
|
-
'violet.500': '#8e51ff',
|
|
216
|
-
'violet.600': '#7f22fe',
|
|
217
|
-
'violet.700': '#7008e7',
|
|
218
|
-
'violet.800': '#5d0ec0',
|
|
219
|
-
'violet.900': '#4d179a',
|
|
220
|
-
'violet.950': '#2f0d68',
|
|
221
|
-
'purple.50': '#faf5ff',
|
|
222
|
-
'purple.100': '#f3e8ff',
|
|
223
|
-
'purple.200': '#e9d4ff',
|
|
224
|
-
'purple.300': '#dab2ff',
|
|
225
|
-
'purple.400': '#c27aff',
|
|
226
|
-
'purple.500': '#ad46ff',
|
|
227
|
-
'purple.600': '#9810fa',
|
|
228
|
-
'purple.700': '#8200db',
|
|
229
|
-
'purple.800': '#6e11b0',
|
|
230
|
-
'purple.900': '#59168b',
|
|
231
|
-
'purple.950': '#3c0366',
|
|
232
|
-
'fuchsia.50': '#fdf4ff',
|
|
233
|
-
'fuchsia.100': '#fae8ff',
|
|
234
|
-
'fuchsia.200': '#f6cfff',
|
|
235
|
-
'fuchsia.300': '#f4a8ff',
|
|
236
|
-
'fuchsia.400': '#ed6aff',
|
|
237
|
-
'fuchsia.500': '#e12afb',
|
|
238
|
-
'fuchsia.600': '#c800de',
|
|
239
|
-
'fuchsia.700': '#a800b7',
|
|
240
|
-
'fuchsia.800': '#8a0194',
|
|
241
|
-
'fuchsia.900': '#721378',
|
|
242
|
-
'fuchsia.950': '#4b004f',
|
|
243
|
-
'pink.50': '#fdf2f8',
|
|
244
|
-
'pink.100': '#fce7f3',
|
|
245
|
-
'pink.200': '#fccee8',
|
|
246
|
-
'pink.300': '#fea5d5',
|
|
247
|
-
'pink.400': '#fb64b6',
|
|
248
|
-
'pink.500': '#f6339a',
|
|
249
|
-
'pink.600': '#e60076',
|
|
250
|
-
'pink.700': '#c6005b',
|
|
251
|
-
'pink.800': '#a3004c',
|
|
252
|
-
'pink.900': '#861043',
|
|
253
|
-
'pink.950': '#510424',
|
|
254
|
-
'rose.50': '#fff1f2',
|
|
255
|
-
'rose.100': '#ffe4e6',
|
|
256
|
-
'rose.200': '#ffccd2',
|
|
257
|
-
'rose.300': '#ffa1ad',
|
|
258
|
-
'rose.400': '#ff637e',
|
|
259
|
-
'rose.500': '#ff2056',
|
|
260
|
-
'rose.600': '#ec003f',
|
|
261
|
-
'rose.700': '#c70036',
|
|
262
|
-
'rose.800': '#a50036',
|
|
263
|
-
'rose.900': '#8b0836',
|
|
264
|
-
'rose.950': '#4d0218'
|
|
265
|
-
};
|
|
266
|
-
const grayScales = ['slate', 'gray', 'zinc', 'neutral', 'stone'];
|
|
267
|
-
const createThemeColors = ({
|
|
268
|
-
base,
|
|
269
|
-
theme
|
|
270
|
-
}) => {
|
|
271
|
-
const b = shade => defaultColors[`${base}.${shade}`];
|
|
272
|
-
const t = shade => defaultColors[`${theme}.${shade}`];
|
|
273
|
-
const isGray = grayScales.includes(theme);
|
|
274
|
-
const light = {
|
|
275
|
-
'background': '#FFFFFF',
|
|
276
|
-
'foreground': b(950),
|
|
277
|
-
'card': '#FFFFFF',
|
|
278
|
-
'card-foreground': b(950),
|
|
279
|
-
'popover': '#FFFFFF',
|
|
280
|
-
'popover-foreground': b(950),
|
|
281
|
-
'primary': isGray ? t(900) : t(600),
|
|
282
|
-
'primary-foreground': isGray ? t(50) : '#FFFFFF',
|
|
283
|
-
'secondary': b(100),
|
|
284
|
-
'secondary-foreground': b(900),
|
|
285
|
-
'muted': b(100),
|
|
286
|
-
'muted-foreground': b(500),
|
|
287
|
-
'accent': b(100),
|
|
288
|
-
'accent-foreground': b(900),
|
|
289
|
-
'destructive': defaultColors['red.600'],
|
|
290
|
-
'destructive-foreground': b(50),
|
|
291
|
-
'border': b(200),
|
|
292
|
-
'input': b(200),
|
|
293
|
-
'ring': isGray ? b(400) : t(400),
|
|
294
|
-
'chart-1': defaultColors['orange.600'],
|
|
295
|
-
'chart-2': defaultColors['teal.600'],
|
|
296
|
-
'chart-3': defaultColors['cyan.900'],
|
|
297
|
-
'chart-4': defaultColors['amber.400'],
|
|
298
|
-
'chart-5': defaultColors['amber.500']
|
|
299
|
-
};
|
|
300
|
-
const dark = {
|
|
301
|
-
'background': b(950),
|
|
302
|
-
'foreground': b(50),
|
|
303
|
-
'card': b(900),
|
|
304
|
-
'card-foreground': b(50),
|
|
305
|
-
'popover': b(900),
|
|
306
|
-
'popover-foreground': b(50),
|
|
307
|
-
'primary': isGray ? t(200) : t(500),
|
|
308
|
-
'primary-foreground': isGray ? t(900) : '#FFFFFF',
|
|
309
|
-
'secondary': b(800),
|
|
310
|
-
'secondary-foreground': b(50),
|
|
311
|
-
'muted': b(800),
|
|
312
|
-
'muted-foreground': b(400),
|
|
313
|
-
'accent': b(800),
|
|
314
|
-
'accent-foreground': b(50),
|
|
315
|
-
'destructive': defaultColors['red.400'],
|
|
316
|
-
'destructive-foreground': b(50),
|
|
317
|
-
'border': b(800),
|
|
318
|
-
'input': b(800),
|
|
319
|
-
'ring': isGray ? b(500) : t(500),
|
|
320
|
-
'chart-1': defaultColors['blue.700'],
|
|
321
|
-
'chart-2': defaultColors['emerald.500'],
|
|
322
|
-
'chart-3': defaultColors['amber.500'],
|
|
323
|
-
'chart-4': defaultColors['purple.500'],
|
|
324
|
-
'chart-5': defaultColors['rose.500']
|
|
325
|
-
};
|
|
326
|
-
return {
|
|
327
|
-
light,
|
|
328
|
-
dark
|
|
329
|
-
};
|
|
330
|
-
};
|
|
331
|
-
exports.createThemeColors = createThemeColors;
|
|
332
15
|
//# sourceMappingURL=ThemedDict.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["emptyThemedDict","exports","space","colors","sizes","radii","typography","breakpoints"
|
|
1
|
+
{"version":3,"names":["emptyThemedDict","exports","space","colors","sizes","radii","typography","breakpoints"],"sourceRoot":"../../../src","sources":["@types/ThemedDict.ts"],"mappings":";;;;;;AAWO,MAAMA,eAAe,GAAAC,OAAA,CAAAD,eAAA,GAAG;EAC7BE,KAAK,EAAE,CAAC,CAAC;EACTC,MAAM,EAAE,CAAC,CAAC;EACVC,KAAK,EAAE,CAAC,CAAC;EACTC,KAAK,EAAE,CAAC,CAAC;EACTC,UAAU,EAAE,CAAC,CAAC;EACdC,WAAW,EAAE;AACf,CAAsB","ignoreList":[]}
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Theme type from developer
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
1
|
export const emptyThemedDict = {
|
|
6
2
|
space: {},
|
|
7
3
|
colors: {},
|
|
@@ -10,316 +6,4 @@ export const emptyThemedDict = {
|
|
|
10
6
|
typography: {},
|
|
11
7
|
breakpoints: []
|
|
12
8
|
};
|
|
13
|
-
const defaultColors = {
|
|
14
|
-
'white': '#FFFFFF',
|
|
15
|
-
'black': '#000000',
|
|
16
|
-
'transparent': 'transparent',
|
|
17
|
-
'slate.50': '#f8fafc',
|
|
18
|
-
'slate.100': '#f1f5f9',
|
|
19
|
-
'slate.200': '#e2e8f0',
|
|
20
|
-
'slate.300': '#cad5e2',
|
|
21
|
-
'slate.400': '#90a1b9',
|
|
22
|
-
'slate.500': '#62748e',
|
|
23
|
-
'slate.600': '#45556c',
|
|
24
|
-
'slate.700': '#314158',
|
|
25
|
-
'slate.800': '#1d293d',
|
|
26
|
-
'slate.900': '#0f172b',
|
|
27
|
-
'slate.950': '#020618',
|
|
28
|
-
'gray.50': '#f9fafb',
|
|
29
|
-
'gray.100': '#f3f4f6',
|
|
30
|
-
'gray.200': '#e5e7eb',
|
|
31
|
-
'gray.300': '#d1d5dc',
|
|
32
|
-
'gray.400': '#99a1af',
|
|
33
|
-
'gray.500': '#6a7282',
|
|
34
|
-
'gray.600': '#4a5565',
|
|
35
|
-
'gray.700': '#364153',
|
|
36
|
-
'gray.800': '#1e2939',
|
|
37
|
-
'gray.900': '#101828',
|
|
38
|
-
'gray.950': '#030712',
|
|
39
|
-
'zinc.50': '#fafafa',
|
|
40
|
-
'zinc.100': '#f4f4f5',
|
|
41
|
-
'zinc.200': '#e4e4e7',
|
|
42
|
-
'zinc.300': '#d4d4d8',
|
|
43
|
-
'zinc.400': '#9f9fa9',
|
|
44
|
-
'zinc.500': '#71717b',
|
|
45
|
-
'zinc.600': '#52525c',
|
|
46
|
-
'zinc.700': '#3f3f46',
|
|
47
|
-
'zinc.800': '#27272a',
|
|
48
|
-
'zinc.900': '#18181b',
|
|
49
|
-
'zinc.950': '#09090b',
|
|
50
|
-
'neutral.50': '#fafafa',
|
|
51
|
-
'neutral.100': '#f5f5f5',
|
|
52
|
-
'neutral.200': '#e5e5e5',
|
|
53
|
-
'neutral.300': '#d4d4d4',
|
|
54
|
-
'neutral.400': '#a1a1a1',
|
|
55
|
-
'neutral.500': '#737373',
|
|
56
|
-
'neutral.600': '#525252',
|
|
57
|
-
'neutral.700': '#404040',
|
|
58
|
-
'neutral.800': '#262626',
|
|
59
|
-
'neutral.900': '#171717',
|
|
60
|
-
'neutral.950': '#0a0a0a',
|
|
61
|
-
'stone.50': '#fafaf9',
|
|
62
|
-
'stone.100': '#f5f5f4',
|
|
63
|
-
'stone.200': '#e7e5e4',
|
|
64
|
-
'stone.300': '#d7d3d1',
|
|
65
|
-
'stone.400': '#a6a09b',
|
|
66
|
-
'stone.500': '#79716b',
|
|
67
|
-
'stone.600': '#57534d',
|
|
68
|
-
'stone.700': '#44403b',
|
|
69
|
-
'stone.800': '#292524',
|
|
70
|
-
'stone.900': '#1c1917',
|
|
71
|
-
'stone.950': '#0c0a09',
|
|
72
|
-
'red.50': '#fef2f2',
|
|
73
|
-
'red.100': '#ffe2e2',
|
|
74
|
-
'red.200': '#ffc9c9',
|
|
75
|
-
'red.300': '#ffa2a2',
|
|
76
|
-
'red.400': '#ff6467',
|
|
77
|
-
'red.500': '#fb2c36',
|
|
78
|
-
'red.600': '#e7000b',
|
|
79
|
-
'red.700': '#c10007',
|
|
80
|
-
'red.800': '#9f0712',
|
|
81
|
-
'red.900': '#82181a',
|
|
82
|
-
'red.950': '#460809',
|
|
83
|
-
'orange.50': '#fff7ed',
|
|
84
|
-
'orange.100': '#ffedd4',
|
|
85
|
-
'orange.200': '#ffd6a7',
|
|
86
|
-
'orange.300': '#ffb869',
|
|
87
|
-
'orange.400': '#ff8903',
|
|
88
|
-
'orange.500': '#ff6900',
|
|
89
|
-
'orange.600': '#f54900',
|
|
90
|
-
'orange.700': '#ca3500',
|
|
91
|
-
'orange.800': '#9f2d00',
|
|
92
|
-
'orange.900': '#7e2a0c',
|
|
93
|
-
'orange.950': '#441306',
|
|
94
|
-
'amber.50': '#fffbeb',
|
|
95
|
-
'amber.100': '#fef3c6',
|
|
96
|
-
'amber.200': '#fee685',
|
|
97
|
-
'amber.300': '#ffd230',
|
|
98
|
-
'amber.400': '#ffb900',
|
|
99
|
-
'amber.500': '#fe9a00',
|
|
100
|
-
'amber.600': '#e17100',
|
|
101
|
-
'amber.700': '#bb4d00',
|
|
102
|
-
'amber.800': '#973c00',
|
|
103
|
-
'amber.900': '#7b3306',
|
|
104
|
-
'amber.950': '#461901',
|
|
105
|
-
'yellow.50': '#fefce8',
|
|
106
|
-
'yellow.100': '#fef9c2',
|
|
107
|
-
'yellow.200': '#fff085',
|
|
108
|
-
'yellow.300': '#ffdf20',
|
|
109
|
-
'yellow.400': '#fdc700',
|
|
110
|
-
'yellow.500': '#f0b100',
|
|
111
|
-
'yellow.600': '#d08700',
|
|
112
|
-
'yellow.700': '#a65f00',
|
|
113
|
-
'yellow.800': '#894b00',
|
|
114
|
-
'yellow.900': '#733e0a',
|
|
115
|
-
'yellow.950': '#432004',
|
|
116
|
-
'lime.50': '#f7fee7',
|
|
117
|
-
'lime.100': '#ecfcca',
|
|
118
|
-
'lime.200': '#d8f999',
|
|
119
|
-
'lime.300': '#bbf451',
|
|
120
|
-
'lime.400': '#9ae600',
|
|
121
|
-
'lime.500': '#7ccf00',
|
|
122
|
-
'lime.600': '#5ea500',
|
|
123
|
-
'lime.700': '#497d00',
|
|
124
|
-
'lime.800': '#3d6300',
|
|
125
|
-
'lime.900': '#35530e',
|
|
126
|
-
'lime.950': '#192e03',
|
|
127
|
-
'green.50': '#f0fdf4',
|
|
128
|
-
'green.100': '#dcfce7',
|
|
129
|
-
'green.200': '#b9f8cf',
|
|
130
|
-
'green.300': '#7bf1a7',
|
|
131
|
-
'green.400': '#06df72',
|
|
132
|
-
'green.500': '#00c950',
|
|
133
|
-
'green.600': '#00a63e',
|
|
134
|
-
'green.700': '#008235',
|
|
135
|
-
'green.800': '#026630',
|
|
136
|
-
'green.900': '#0d542b',
|
|
137
|
-
'green.950': '#032e15',
|
|
138
|
-
'emerald.50': '#ecfdf5',
|
|
139
|
-
'emerald.100': '#d0fae5',
|
|
140
|
-
'emerald.200': '#a4f4cf',
|
|
141
|
-
'emerald.300': '#5ee9b5',
|
|
142
|
-
'emerald.400': '#00d492',
|
|
143
|
-
'emerald.500': '#00bc7d',
|
|
144
|
-
'emerald.600': '#009966',
|
|
145
|
-
'emerald.700': '#007a55',
|
|
146
|
-
'emerald.800': '#006045',
|
|
147
|
-
'emerald.900': '#004f3b',
|
|
148
|
-
'emerald.950': '#002c22',
|
|
149
|
-
'teal.50': '#f0fdfa',
|
|
150
|
-
'teal.100': '#cbfbf1',
|
|
151
|
-
'teal.200': '#96f7e4',
|
|
152
|
-
'teal.300': '#46ecd4',
|
|
153
|
-
'teal.400': '#00d5bd',
|
|
154
|
-
'teal.500': '#00bba7',
|
|
155
|
-
'teal.600': '#009689',
|
|
156
|
-
'teal.700': '#00786f',
|
|
157
|
-
'teal.800': '#005f5a',
|
|
158
|
-
'teal.900': '#0b4f4a',
|
|
159
|
-
'teal.950': '#022f2e',
|
|
160
|
-
'cyan.50': '#ecfeff',
|
|
161
|
-
'cyan.100': '#cefafe',
|
|
162
|
-
'cyan.200': '#a2f4fd',
|
|
163
|
-
'cyan.300': '#53eafd',
|
|
164
|
-
'cyan.400': '#00d3f2',
|
|
165
|
-
'cyan.500': '#00b8db',
|
|
166
|
-
'cyan.600': '#0092b8',
|
|
167
|
-
'cyan.700': '#007595',
|
|
168
|
-
'cyan.800': '#005f78',
|
|
169
|
-
'cyan.900': '#104e64',
|
|
170
|
-
'cyan.950': '#053345',
|
|
171
|
-
'sky.50': '#f0f9ff',
|
|
172
|
-
'sky.100': '#dff2fe',
|
|
173
|
-
'sky.200': '#b8e6fe',
|
|
174
|
-
'sky.300': '#74d4ff',
|
|
175
|
-
'sky.400': '#00bcff',
|
|
176
|
-
'sky.500': '#00a6f4',
|
|
177
|
-
'sky.600': '#0084d1',
|
|
178
|
-
'sky.700': '#0069a8',
|
|
179
|
-
'sky.800': '#00598a',
|
|
180
|
-
'sky.900': '#024a70',
|
|
181
|
-
'sky.950': '#052f4a',
|
|
182
|
-
'blue.50': '#eff6ff',
|
|
183
|
-
'blue.100': '#dbeafe',
|
|
184
|
-
'blue.200': '#bedbff',
|
|
185
|
-
'blue.300': '#8ec5ff',
|
|
186
|
-
'blue.400': '#51a2ff',
|
|
187
|
-
'blue.500': '#2b7fff',
|
|
188
|
-
'blue.600': '#155dfb',
|
|
189
|
-
'blue.700': '#1447e6',
|
|
190
|
-
'blue.800': '#193cb8',
|
|
191
|
-
'blue.900': '#1c398e',
|
|
192
|
-
'blue.950': '#162556',
|
|
193
|
-
'indigo.50': '#eef2ff',
|
|
194
|
-
'indigo.100': '#e0e7ff',
|
|
195
|
-
'indigo.200': '#c7d2ff',
|
|
196
|
-
'indigo.300': '#a3b3ff',
|
|
197
|
-
'indigo.400': '#7c86ff',
|
|
198
|
-
'indigo.500': '#615fff',
|
|
199
|
-
'indigo.600': '#4f39f6',
|
|
200
|
-
'indigo.700': '#432dd7',
|
|
201
|
-
'indigo.800': '#372aac',
|
|
202
|
-
'indigo.900': '#312c85',
|
|
203
|
-
'indigo.950': '#1e1a4d',
|
|
204
|
-
'violet.50': '#f5f3ff',
|
|
205
|
-
'violet.100': '#ede9fe',
|
|
206
|
-
'violet.200': '#ddd6ff',
|
|
207
|
-
'violet.300': '#c4b4ff',
|
|
208
|
-
'violet.400': '#a684ff',
|
|
209
|
-
'violet.500': '#8e51ff',
|
|
210
|
-
'violet.600': '#7f22fe',
|
|
211
|
-
'violet.700': '#7008e7',
|
|
212
|
-
'violet.800': '#5d0ec0',
|
|
213
|
-
'violet.900': '#4d179a',
|
|
214
|
-
'violet.950': '#2f0d68',
|
|
215
|
-
'purple.50': '#faf5ff',
|
|
216
|
-
'purple.100': '#f3e8ff',
|
|
217
|
-
'purple.200': '#e9d4ff',
|
|
218
|
-
'purple.300': '#dab2ff',
|
|
219
|
-
'purple.400': '#c27aff',
|
|
220
|
-
'purple.500': '#ad46ff',
|
|
221
|
-
'purple.600': '#9810fa',
|
|
222
|
-
'purple.700': '#8200db',
|
|
223
|
-
'purple.800': '#6e11b0',
|
|
224
|
-
'purple.900': '#59168b',
|
|
225
|
-
'purple.950': '#3c0366',
|
|
226
|
-
'fuchsia.50': '#fdf4ff',
|
|
227
|
-
'fuchsia.100': '#fae8ff',
|
|
228
|
-
'fuchsia.200': '#f6cfff',
|
|
229
|
-
'fuchsia.300': '#f4a8ff',
|
|
230
|
-
'fuchsia.400': '#ed6aff',
|
|
231
|
-
'fuchsia.500': '#e12afb',
|
|
232
|
-
'fuchsia.600': '#c800de',
|
|
233
|
-
'fuchsia.700': '#a800b7',
|
|
234
|
-
'fuchsia.800': '#8a0194',
|
|
235
|
-
'fuchsia.900': '#721378',
|
|
236
|
-
'fuchsia.950': '#4b004f',
|
|
237
|
-
'pink.50': '#fdf2f8',
|
|
238
|
-
'pink.100': '#fce7f3',
|
|
239
|
-
'pink.200': '#fccee8',
|
|
240
|
-
'pink.300': '#fea5d5',
|
|
241
|
-
'pink.400': '#fb64b6',
|
|
242
|
-
'pink.500': '#f6339a',
|
|
243
|
-
'pink.600': '#e60076',
|
|
244
|
-
'pink.700': '#c6005b',
|
|
245
|
-
'pink.800': '#a3004c',
|
|
246
|
-
'pink.900': '#861043',
|
|
247
|
-
'pink.950': '#510424',
|
|
248
|
-
'rose.50': '#fff1f2',
|
|
249
|
-
'rose.100': '#ffe4e6',
|
|
250
|
-
'rose.200': '#ffccd2',
|
|
251
|
-
'rose.300': '#ffa1ad',
|
|
252
|
-
'rose.400': '#ff637e',
|
|
253
|
-
'rose.500': '#ff2056',
|
|
254
|
-
'rose.600': '#ec003f',
|
|
255
|
-
'rose.700': '#c70036',
|
|
256
|
-
'rose.800': '#a50036',
|
|
257
|
-
'rose.900': '#8b0836',
|
|
258
|
-
'rose.950': '#4d0218'
|
|
259
|
-
};
|
|
260
|
-
const grayScales = ['slate', 'gray', 'zinc', 'neutral', 'stone'];
|
|
261
|
-
export const createThemeColors = ({
|
|
262
|
-
base,
|
|
263
|
-
theme
|
|
264
|
-
}) => {
|
|
265
|
-
const b = shade => defaultColors[`${base}.${shade}`];
|
|
266
|
-
const t = shade => defaultColors[`${theme}.${shade}`];
|
|
267
|
-
const isGray = grayScales.includes(theme);
|
|
268
|
-
const light = {
|
|
269
|
-
'background': '#FFFFFF',
|
|
270
|
-
'foreground': b(950),
|
|
271
|
-
'card': '#FFFFFF',
|
|
272
|
-
'card-foreground': b(950),
|
|
273
|
-
'popover': '#FFFFFF',
|
|
274
|
-
'popover-foreground': b(950),
|
|
275
|
-
'primary': isGray ? t(900) : t(600),
|
|
276
|
-
'primary-foreground': isGray ? t(50) : '#FFFFFF',
|
|
277
|
-
'secondary': b(100),
|
|
278
|
-
'secondary-foreground': b(900),
|
|
279
|
-
'muted': b(100),
|
|
280
|
-
'muted-foreground': b(500),
|
|
281
|
-
'accent': b(100),
|
|
282
|
-
'accent-foreground': b(900),
|
|
283
|
-
'destructive': defaultColors['red.600'],
|
|
284
|
-
'destructive-foreground': b(50),
|
|
285
|
-
'border': b(200),
|
|
286
|
-
'input': b(200),
|
|
287
|
-
'ring': isGray ? b(400) : t(400),
|
|
288
|
-
'chart-1': defaultColors['orange.600'],
|
|
289
|
-
'chart-2': defaultColors['teal.600'],
|
|
290
|
-
'chart-3': defaultColors['cyan.900'],
|
|
291
|
-
'chart-4': defaultColors['amber.400'],
|
|
292
|
-
'chart-5': defaultColors['amber.500']
|
|
293
|
-
};
|
|
294
|
-
const dark = {
|
|
295
|
-
'background': b(950),
|
|
296
|
-
'foreground': b(50),
|
|
297
|
-
'card': b(900),
|
|
298
|
-
'card-foreground': b(50),
|
|
299
|
-
'popover': b(900),
|
|
300
|
-
'popover-foreground': b(50),
|
|
301
|
-
'primary': isGray ? t(200) : t(500),
|
|
302
|
-
'primary-foreground': isGray ? t(900) : '#FFFFFF',
|
|
303
|
-
'secondary': b(800),
|
|
304
|
-
'secondary-foreground': b(50),
|
|
305
|
-
'muted': b(800),
|
|
306
|
-
'muted-foreground': b(400),
|
|
307
|
-
'accent': b(800),
|
|
308
|
-
'accent-foreground': b(50),
|
|
309
|
-
'destructive': defaultColors['red.400'],
|
|
310
|
-
'destructive-foreground': b(50),
|
|
311
|
-
'border': b(800),
|
|
312
|
-
'input': b(800),
|
|
313
|
-
'ring': isGray ? b(500) : t(500),
|
|
314
|
-
'chart-1': defaultColors['blue.700'],
|
|
315
|
-
'chart-2': defaultColors['emerald.500'],
|
|
316
|
-
'chart-3': defaultColors['amber.500'],
|
|
317
|
-
'chart-4': defaultColors['purple.500'],
|
|
318
|
-
'chart-5': defaultColors['rose.500']
|
|
319
|
-
};
|
|
320
|
-
return {
|
|
321
|
-
light,
|
|
322
|
-
dark
|
|
323
|
-
};
|
|
324
|
-
};
|
|
325
9
|
//# sourceMappingURL=ThemedDict.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["emptyThemedDict","space","colors","sizes","radii","typography","breakpoints"
|
|
1
|
+
{"version":3,"names":["emptyThemedDict","space","colors","sizes","radii","typography","breakpoints"],"sourceRoot":"../../../src","sources":["@types/ThemedDict.ts"],"mappings":"AAWA,OAAO,MAAMA,eAAe,GAAG;EAC7BC,KAAK,EAAE,CAAC,CAAC;EACTC,MAAM,EAAE,CAAC,CAAC;EACVC,KAAK,EAAE,CAAC,CAAC;EACTC,KAAK,EAAE,CAAC,CAAC;EACTC,UAAU,EAAE,CAAC,CAAC;EACdC,WAAW,EAAE;AACf,CAAsB","ignoreList":[]}
|
|
@@ -15,15 +15,4 @@ export declare const emptyThemedDict: {
|
|
|
15
15
|
typography: {};
|
|
16
16
|
breakpoints: never[];
|
|
17
17
|
};
|
|
18
|
-
declare const grayScales: readonly ["slate", "gray", "zinc", "neutral", "stone"];
|
|
19
|
-
export type BaseColor = (typeof grayScales)[number];
|
|
20
|
-
export type ThemeColor = BaseColor | 'red' | 'orange' | 'amber' | 'yellow' | 'lime' | 'green' | 'emerald' | 'teal' | 'cyan' | 'sky' | 'blue' | 'indigo' | 'violet' | 'purple' | 'fuchsia' | 'pink' | 'rose';
|
|
21
|
-
export declare const createThemeColors: ({ base, theme }: {
|
|
22
|
-
base: BaseColor;
|
|
23
|
-
theme: ThemeColor;
|
|
24
|
-
}) => {
|
|
25
|
-
light: Record<string, string>;
|
|
26
|
-
dark: Record<string, string>;
|
|
27
|
-
};
|
|
28
|
-
export {};
|
|
29
18
|
//# sourceMappingURL=ThemedDict.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemedDict.d.ts","sourceRoot":"","sources":["../../../../src/@types/ThemedDict.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"ThemedDict.d.ts","sourceRoot":"","sources":["../../../../src/@types/ThemedDict.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAEhG,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC,MAAM,GAAG,MAAM,EAAE,UAAU,CAAC,CAAC;IAC3C,KAAK,EAAE,MAAM,CAAC,MAAM,GAAG,MAAM,EAAE,UAAU,CAAC,CAAC;IAC3C,MAAM,EAAE,MAAM,CAAC,MAAM,GAAG,MAAM,EAAE,WAAW,CAAC,CAAC;IAC7C,KAAK,EAAE,MAAM,CAAC,MAAM,GAAG,MAAM,EAAE,UAAU,CAAC,CAAC;IAC3C,UAAU,EAAE,MAAM,CAAC,MAAM,GAAG,MAAM,EAAE,eAAe,CAAC,CAAC;IACrD,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;CACxB;AAED,eAAO,MAAM,eAAe;;;;;;;CAON,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-native-styled-system/core",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.1",
|
|
4
4
|
"description": "React Native Styled System",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"types": "lib/typescript/src/index.d.ts",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"author": "MJ Studio <mym0404@gmail.com>",
|
|
18
18
|
"license": "MIT",
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@react-native-styled-system/cli": "2.2.
|
|
20
|
+
"@react-native-styled-system/cli": "2.2.1",
|
|
21
21
|
"@testing-library/react-native": "^13.3.3",
|
|
22
22
|
"@types/invariant": "^2.2.37",
|
|
23
23
|
"@types/react": "^19",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
],
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@mj-studio/js-util": "1.0.34",
|
|
45
|
-
"@react-native-styled-system/util": "^2.2.
|
|
45
|
+
"@react-native-styled-system/util": "^2.2.1",
|
|
46
46
|
"invariant": "^2.2.4",
|
|
47
47
|
"object-hash": "^3.0.0"
|
|
48
48
|
},
|
|
@@ -67,5 +67,5 @@
|
|
|
67
67
|
],
|
|
68
68
|
"exclude": "**/*.test.*"
|
|
69
69
|
},
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "018502a8248ed6d35cd06a74b521107d727c3f6c"
|
|
71
71
|
}
|
package/src/@types/ThemedDict.ts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import type { ColorsValue, RadiiValue, SizesValue, SpaceValue, TypographyValue } from './Token';
|
|
2
2
|
|
|
3
|
-
/*
|
|
4
|
-
* Theme type from developer
|
|
5
|
-
*/
|
|
6
3
|
export interface ThemedDict {
|
|
7
4
|
space: Record<string | number, SpaceValue>;
|
|
8
5
|
sizes: Record<string | number, SizesValue>;
|
|
@@ -11,6 +8,7 @@ export interface ThemedDict {
|
|
|
11
8
|
typography: Record<string | number, TypographyValue>;
|
|
12
9
|
breakpoints?: number[];
|
|
13
10
|
}
|
|
11
|
+
|
|
14
12
|
export const emptyThemedDict = {
|
|
15
13
|
space: {},
|
|
16
14
|
colors: {},
|
|
@@ -19,359 +17,3 @@ export const emptyThemedDict = {
|
|
|
19
17
|
typography: {},
|
|
20
18
|
breakpoints: [],
|
|
21
19
|
} satisfies ThemedDict;
|
|
22
|
-
|
|
23
|
-
const defaultColors: Record<string, ColorsValue> = {
|
|
24
|
-
'white': '#FFFFFF',
|
|
25
|
-
'black': '#000000',
|
|
26
|
-
'transparent': 'transparent',
|
|
27
|
-
|
|
28
|
-
'slate.50': '#f8fafc',
|
|
29
|
-
'slate.100': '#f1f5f9',
|
|
30
|
-
'slate.200': '#e2e8f0',
|
|
31
|
-
'slate.300': '#cad5e2',
|
|
32
|
-
'slate.400': '#90a1b9',
|
|
33
|
-
'slate.500': '#62748e',
|
|
34
|
-
'slate.600': '#45556c',
|
|
35
|
-
'slate.700': '#314158',
|
|
36
|
-
'slate.800': '#1d293d',
|
|
37
|
-
'slate.900': '#0f172b',
|
|
38
|
-
'slate.950': '#020618',
|
|
39
|
-
|
|
40
|
-
'gray.50': '#f9fafb',
|
|
41
|
-
'gray.100': '#f3f4f6',
|
|
42
|
-
'gray.200': '#e5e7eb',
|
|
43
|
-
'gray.300': '#d1d5dc',
|
|
44
|
-
'gray.400': '#99a1af',
|
|
45
|
-
'gray.500': '#6a7282',
|
|
46
|
-
'gray.600': '#4a5565',
|
|
47
|
-
'gray.700': '#364153',
|
|
48
|
-
'gray.800': '#1e2939',
|
|
49
|
-
'gray.900': '#101828',
|
|
50
|
-
'gray.950': '#030712',
|
|
51
|
-
|
|
52
|
-
'zinc.50': '#fafafa',
|
|
53
|
-
'zinc.100': '#f4f4f5',
|
|
54
|
-
'zinc.200': '#e4e4e7',
|
|
55
|
-
'zinc.300': '#d4d4d8',
|
|
56
|
-
'zinc.400': '#9f9fa9',
|
|
57
|
-
'zinc.500': '#71717b',
|
|
58
|
-
'zinc.600': '#52525c',
|
|
59
|
-
'zinc.700': '#3f3f46',
|
|
60
|
-
'zinc.800': '#27272a',
|
|
61
|
-
'zinc.900': '#18181b',
|
|
62
|
-
'zinc.950': '#09090b',
|
|
63
|
-
|
|
64
|
-
'neutral.50': '#fafafa',
|
|
65
|
-
'neutral.100': '#f5f5f5',
|
|
66
|
-
'neutral.200': '#e5e5e5',
|
|
67
|
-
'neutral.300': '#d4d4d4',
|
|
68
|
-
'neutral.400': '#a1a1a1',
|
|
69
|
-
'neutral.500': '#737373',
|
|
70
|
-
'neutral.600': '#525252',
|
|
71
|
-
'neutral.700': '#404040',
|
|
72
|
-
'neutral.800': '#262626',
|
|
73
|
-
'neutral.900': '#171717',
|
|
74
|
-
'neutral.950': '#0a0a0a',
|
|
75
|
-
|
|
76
|
-
'stone.50': '#fafaf9',
|
|
77
|
-
'stone.100': '#f5f5f4',
|
|
78
|
-
'stone.200': '#e7e5e4',
|
|
79
|
-
'stone.300': '#d7d3d1',
|
|
80
|
-
'stone.400': '#a6a09b',
|
|
81
|
-
'stone.500': '#79716b',
|
|
82
|
-
'stone.600': '#57534d',
|
|
83
|
-
'stone.700': '#44403b',
|
|
84
|
-
'stone.800': '#292524',
|
|
85
|
-
'stone.900': '#1c1917',
|
|
86
|
-
'stone.950': '#0c0a09',
|
|
87
|
-
|
|
88
|
-
'red.50': '#fef2f2',
|
|
89
|
-
'red.100': '#ffe2e2',
|
|
90
|
-
'red.200': '#ffc9c9',
|
|
91
|
-
'red.300': '#ffa2a2',
|
|
92
|
-
'red.400': '#ff6467',
|
|
93
|
-
'red.500': '#fb2c36',
|
|
94
|
-
'red.600': '#e7000b',
|
|
95
|
-
'red.700': '#c10007',
|
|
96
|
-
'red.800': '#9f0712',
|
|
97
|
-
'red.900': '#82181a',
|
|
98
|
-
'red.950': '#460809',
|
|
99
|
-
|
|
100
|
-
'orange.50': '#fff7ed',
|
|
101
|
-
'orange.100': '#ffedd4',
|
|
102
|
-
'orange.200': '#ffd6a7',
|
|
103
|
-
'orange.300': '#ffb869',
|
|
104
|
-
'orange.400': '#ff8903',
|
|
105
|
-
'orange.500': '#ff6900',
|
|
106
|
-
'orange.600': '#f54900',
|
|
107
|
-
'orange.700': '#ca3500',
|
|
108
|
-
'orange.800': '#9f2d00',
|
|
109
|
-
'orange.900': '#7e2a0c',
|
|
110
|
-
'orange.950': '#441306',
|
|
111
|
-
|
|
112
|
-
'amber.50': '#fffbeb',
|
|
113
|
-
'amber.100': '#fef3c6',
|
|
114
|
-
'amber.200': '#fee685',
|
|
115
|
-
'amber.300': '#ffd230',
|
|
116
|
-
'amber.400': '#ffb900',
|
|
117
|
-
'amber.500': '#fe9a00',
|
|
118
|
-
'amber.600': '#e17100',
|
|
119
|
-
'amber.700': '#bb4d00',
|
|
120
|
-
'amber.800': '#973c00',
|
|
121
|
-
'amber.900': '#7b3306',
|
|
122
|
-
'amber.950': '#461901',
|
|
123
|
-
|
|
124
|
-
'yellow.50': '#fefce8',
|
|
125
|
-
'yellow.100': '#fef9c2',
|
|
126
|
-
'yellow.200': '#fff085',
|
|
127
|
-
'yellow.300': '#ffdf20',
|
|
128
|
-
'yellow.400': '#fdc700',
|
|
129
|
-
'yellow.500': '#f0b100',
|
|
130
|
-
'yellow.600': '#d08700',
|
|
131
|
-
'yellow.700': '#a65f00',
|
|
132
|
-
'yellow.800': '#894b00',
|
|
133
|
-
'yellow.900': '#733e0a',
|
|
134
|
-
'yellow.950': '#432004',
|
|
135
|
-
|
|
136
|
-
'lime.50': '#f7fee7',
|
|
137
|
-
'lime.100': '#ecfcca',
|
|
138
|
-
'lime.200': '#d8f999',
|
|
139
|
-
'lime.300': '#bbf451',
|
|
140
|
-
'lime.400': '#9ae600',
|
|
141
|
-
'lime.500': '#7ccf00',
|
|
142
|
-
'lime.600': '#5ea500',
|
|
143
|
-
'lime.700': '#497d00',
|
|
144
|
-
'lime.800': '#3d6300',
|
|
145
|
-
'lime.900': '#35530e',
|
|
146
|
-
'lime.950': '#192e03',
|
|
147
|
-
|
|
148
|
-
'green.50': '#f0fdf4',
|
|
149
|
-
'green.100': '#dcfce7',
|
|
150
|
-
'green.200': '#b9f8cf',
|
|
151
|
-
'green.300': '#7bf1a7',
|
|
152
|
-
'green.400': '#06df72',
|
|
153
|
-
'green.500': '#00c950',
|
|
154
|
-
'green.600': '#00a63e',
|
|
155
|
-
'green.700': '#008235',
|
|
156
|
-
'green.800': '#026630',
|
|
157
|
-
'green.900': '#0d542b',
|
|
158
|
-
'green.950': '#032e15',
|
|
159
|
-
|
|
160
|
-
'emerald.50': '#ecfdf5',
|
|
161
|
-
'emerald.100': '#d0fae5',
|
|
162
|
-
'emerald.200': '#a4f4cf',
|
|
163
|
-
'emerald.300': '#5ee9b5',
|
|
164
|
-
'emerald.400': '#00d492',
|
|
165
|
-
'emerald.500': '#00bc7d',
|
|
166
|
-
'emerald.600': '#009966',
|
|
167
|
-
'emerald.700': '#007a55',
|
|
168
|
-
'emerald.800': '#006045',
|
|
169
|
-
'emerald.900': '#004f3b',
|
|
170
|
-
'emerald.950': '#002c22',
|
|
171
|
-
|
|
172
|
-
'teal.50': '#f0fdfa',
|
|
173
|
-
'teal.100': '#cbfbf1',
|
|
174
|
-
'teal.200': '#96f7e4',
|
|
175
|
-
'teal.300': '#46ecd4',
|
|
176
|
-
'teal.400': '#00d5bd',
|
|
177
|
-
'teal.500': '#00bba7',
|
|
178
|
-
'teal.600': '#009689',
|
|
179
|
-
'teal.700': '#00786f',
|
|
180
|
-
'teal.800': '#005f5a',
|
|
181
|
-
'teal.900': '#0b4f4a',
|
|
182
|
-
'teal.950': '#022f2e',
|
|
183
|
-
|
|
184
|
-
'cyan.50': '#ecfeff',
|
|
185
|
-
'cyan.100': '#cefafe',
|
|
186
|
-
'cyan.200': '#a2f4fd',
|
|
187
|
-
'cyan.300': '#53eafd',
|
|
188
|
-
'cyan.400': '#00d3f2',
|
|
189
|
-
'cyan.500': '#00b8db',
|
|
190
|
-
'cyan.600': '#0092b8',
|
|
191
|
-
'cyan.700': '#007595',
|
|
192
|
-
'cyan.800': '#005f78',
|
|
193
|
-
'cyan.900': '#104e64',
|
|
194
|
-
'cyan.950': '#053345',
|
|
195
|
-
|
|
196
|
-
'sky.50': '#f0f9ff',
|
|
197
|
-
'sky.100': '#dff2fe',
|
|
198
|
-
'sky.200': '#b8e6fe',
|
|
199
|
-
'sky.300': '#74d4ff',
|
|
200
|
-
'sky.400': '#00bcff',
|
|
201
|
-
'sky.500': '#00a6f4',
|
|
202
|
-
'sky.600': '#0084d1',
|
|
203
|
-
'sky.700': '#0069a8',
|
|
204
|
-
'sky.800': '#00598a',
|
|
205
|
-
'sky.900': '#024a70',
|
|
206
|
-
'sky.950': '#052f4a',
|
|
207
|
-
|
|
208
|
-
'blue.50': '#eff6ff',
|
|
209
|
-
'blue.100': '#dbeafe',
|
|
210
|
-
'blue.200': '#bedbff',
|
|
211
|
-
'blue.300': '#8ec5ff',
|
|
212
|
-
'blue.400': '#51a2ff',
|
|
213
|
-
'blue.500': '#2b7fff',
|
|
214
|
-
'blue.600': '#155dfb',
|
|
215
|
-
'blue.700': '#1447e6',
|
|
216
|
-
'blue.800': '#193cb8',
|
|
217
|
-
'blue.900': '#1c398e',
|
|
218
|
-
'blue.950': '#162556',
|
|
219
|
-
|
|
220
|
-
'indigo.50': '#eef2ff',
|
|
221
|
-
'indigo.100': '#e0e7ff',
|
|
222
|
-
'indigo.200': '#c7d2ff',
|
|
223
|
-
'indigo.300': '#a3b3ff',
|
|
224
|
-
'indigo.400': '#7c86ff',
|
|
225
|
-
'indigo.500': '#615fff',
|
|
226
|
-
'indigo.600': '#4f39f6',
|
|
227
|
-
'indigo.700': '#432dd7',
|
|
228
|
-
'indigo.800': '#372aac',
|
|
229
|
-
'indigo.900': '#312c85',
|
|
230
|
-
'indigo.950': '#1e1a4d',
|
|
231
|
-
|
|
232
|
-
'violet.50': '#f5f3ff',
|
|
233
|
-
'violet.100': '#ede9fe',
|
|
234
|
-
'violet.200': '#ddd6ff',
|
|
235
|
-
'violet.300': '#c4b4ff',
|
|
236
|
-
'violet.400': '#a684ff',
|
|
237
|
-
'violet.500': '#8e51ff',
|
|
238
|
-
'violet.600': '#7f22fe',
|
|
239
|
-
'violet.700': '#7008e7',
|
|
240
|
-
'violet.800': '#5d0ec0',
|
|
241
|
-
'violet.900': '#4d179a',
|
|
242
|
-
'violet.950': '#2f0d68',
|
|
243
|
-
|
|
244
|
-
'purple.50': '#faf5ff',
|
|
245
|
-
'purple.100': '#f3e8ff',
|
|
246
|
-
'purple.200': '#e9d4ff',
|
|
247
|
-
'purple.300': '#dab2ff',
|
|
248
|
-
'purple.400': '#c27aff',
|
|
249
|
-
'purple.500': '#ad46ff',
|
|
250
|
-
'purple.600': '#9810fa',
|
|
251
|
-
'purple.700': '#8200db',
|
|
252
|
-
'purple.800': '#6e11b0',
|
|
253
|
-
'purple.900': '#59168b',
|
|
254
|
-
'purple.950': '#3c0366',
|
|
255
|
-
|
|
256
|
-
'fuchsia.50': '#fdf4ff',
|
|
257
|
-
'fuchsia.100': '#fae8ff',
|
|
258
|
-
'fuchsia.200': '#f6cfff',
|
|
259
|
-
'fuchsia.300': '#f4a8ff',
|
|
260
|
-
'fuchsia.400': '#ed6aff',
|
|
261
|
-
'fuchsia.500': '#e12afb',
|
|
262
|
-
'fuchsia.600': '#c800de',
|
|
263
|
-
'fuchsia.700': '#a800b7',
|
|
264
|
-
'fuchsia.800': '#8a0194',
|
|
265
|
-
'fuchsia.900': '#721378',
|
|
266
|
-
'fuchsia.950': '#4b004f',
|
|
267
|
-
|
|
268
|
-
'pink.50': '#fdf2f8',
|
|
269
|
-
'pink.100': '#fce7f3',
|
|
270
|
-
'pink.200': '#fccee8',
|
|
271
|
-
'pink.300': '#fea5d5',
|
|
272
|
-
'pink.400': '#fb64b6',
|
|
273
|
-
'pink.500': '#f6339a',
|
|
274
|
-
'pink.600': '#e60076',
|
|
275
|
-
'pink.700': '#c6005b',
|
|
276
|
-
'pink.800': '#a3004c',
|
|
277
|
-
'pink.900': '#861043',
|
|
278
|
-
'pink.950': '#510424',
|
|
279
|
-
|
|
280
|
-
'rose.50': '#fff1f2',
|
|
281
|
-
'rose.100': '#ffe4e6',
|
|
282
|
-
'rose.200': '#ffccd2',
|
|
283
|
-
'rose.300': '#ffa1ad',
|
|
284
|
-
'rose.400': '#ff637e',
|
|
285
|
-
'rose.500': '#ff2056',
|
|
286
|
-
'rose.600': '#ec003f',
|
|
287
|
-
'rose.700': '#c70036',
|
|
288
|
-
'rose.800': '#a50036',
|
|
289
|
-
'rose.900': '#8b0836',
|
|
290
|
-
'rose.950': '#4d0218',
|
|
291
|
-
};
|
|
292
|
-
|
|
293
|
-
const grayScales = ['slate', 'gray', 'zinc', 'neutral', 'stone'] as const;
|
|
294
|
-
|
|
295
|
-
export type BaseColor = (typeof grayScales)[number];
|
|
296
|
-
|
|
297
|
-
export type ThemeColor =
|
|
298
|
-
| BaseColor
|
|
299
|
-
| 'red'
|
|
300
|
-
| 'orange'
|
|
301
|
-
| 'amber'
|
|
302
|
-
| 'yellow'
|
|
303
|
-
| 'lime'
|
|
304
|
-
| 'green'
|
|
305
|
-
| 'emerald'
|
|
306
|
-
| 'teal'
|
|
307
|
-
| 'cyan'
|
|
308
|
-
| 'sky'
|
|
309
|
-
| 'blue'
|
|
310
|
-
| 'indigo'
|
|
311
|
-
| 'violet'
|
|
312
|
-
| 'purple'
|
|
313
|
-
| 'fuchsia'
|
|
314
|
-
| 'pink'
|
|
315
|
-
| 'rose';
|
|
316
|
-
|
|
317
|
-
export const createThemeColors = ({ base, theme }: { base: BaseColor; theme: ThemeColor }) => {
|
|
318
|
-
const b = (shade: number) => defaultColors[`${base}.${shade}`]!;
|
|
319
|
-
const t = (shade: number) => defaultColors[`${theme}.${shade}`]!;
|
|
320
|
-
const isGray = (grayScales as readonly string[]).includes(theme);
|
|
321
|
-
|
|
322
|
-
const light: Record<string, ColorsValue> = {
|
|
323
|
-
'background': '#FFFFFF',
|
|
324
|
-
'foreground': b(950),
|
|
325
|
-
'card': '#FFFFFF',
|
|
326
|
-
'card-foreground': b(950),
|
|
327
|
-
'popover': '#FFFFFF',
|
|
328
|
-
'popover-foreground': b(950),
|
|
329
|
-
'primary': isGray ? t(900) : t(600),
|
|
330
|
-
'primary-foreground': isGray ? t(50) : '#FFFFFF',
|
|
331
|
-
'secondary': b(100),
|
|
332
|
-
'secondary-foreground': b(900),
|
|
333
|
-
'muted': b(100),
|
|
334
|
-
'muted-foreground': b(500),
|
|
335
|
-
'accent': b(100),
|
|
336
|
-
'accent-foreground': b(900),
|
|
337
|
-
'destructive': defaultColors['red.600']!,
|
|
338
|
-
'destructive-foreground': b(50),
|
|
339
|
-
'border': b(200),
|
|
340
|
-
'input': b(200),
|
|
341
|
-
'ring': isGray ? b(400) : t(400),
|
|
342
|
-
'chart-1': defaultColors['orange.600']!,
|
|
343
|
-
'chart-2': defaultColors['teal.600']!,
|
|
344
|
-
'chart-3': defaultColors['cyan.900']!,
|
|
345
|
-
'chart-4': defaultColors['amber.400']!,
|
|
346
|
-
'chart-5': defaultColors['amber.500']!,
|
|
347
|
-
};
|
|
348
|
-
|
|
349
|
-
const dark: Record<string, ColorsValue> = {
|
|
350
|
-
'background': b(950),
|
|
351
|
-
'foreground': b(50),
|
|
352
|
-
'card': b(900),
|
|
353
|
-
'card-foreground': b(50),
|
|
354
|
-
'popover': b(900),
|
|
355
|
-
'popover-foreground': b(50),
|
|
356
|
-
'primary': isGray ? t(200) : t(500),
|
|
357
|
-
'primary-foreground': isGray ? t(900) : '#FFFFFF',
|
|
358
|
-
'secondary': b(800),
|
|
359
|
-
'secondary-foreground': b(50),
|
|
360
|
-
'muted': b(800),
|
|
361
|
-
'muted-foreground': b(400),
|
|
362
|
-
'accent': b(800),
|
|
363
|
-
'accent-foreground': b(50),
|
|
364
|
-
'destructive': defaultColors['red.400']!,
|
|
365
|
-
'destructive-foreground': b(50),
|
|
366
|
-
'border': b(800),
|
|
367
|
-
'input': b(800),
|
|
368
|
-
'ring': isGray ? b(500) : t(500),
|
|
369
|
-
'chart-1': defaultColors['blue.700']!,
|
|
370
|
-
'chart-2': defaultColors['emerald.500']!,
|
|
371
|
-
'chart-3': defaultColors['amber.500']!,
|
|
372
|
-
'chart-4': defaultColors['purple.500']!,
|
|
373
|
-
'chart-5': defaultColors['rose.500']!,
|
|
374
|
-
};
|
|
375
|
-
|
|
376
|
-
return { light, dark };
|
|
377
|
-
};
|