@react-native-rethemed/chakra-ui-tokens 0.1.0 → 0.1.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.
@@ -0,0 +1,602 @@
1
+ //#region src/colors.ts
2
+ /**
3
+ * Color tokens mirroring Chakra UI's Color Tokens / Semantic Tokens.
4
+ * https://www.chakra-ui.com/docs/theming/colors
5
+ */
6
+ const colors = {
7
+ white: "#ffffff",
8
+ black: "#000000",
9
+ "gray.50": "#fafafa",
10
+ "gray.100": "#f4f4f5",
11
+ "gray.200": "#e4e4e7",
12
+ "gray.300": "#d4d4d8",
13
+ "gray.400": "#a1a1aa",
14
+ "gray.500": "#71717a",
15
+ "gray.600": "#52525b",
16
+ "gray.700": "#3f3f46",
17
+ "gray.800": "#27272a",
18
+ "gray.900": "#18181b",
19
+ "gray.950": "#111111",
20
+ "neutral.50": "#fafafa",
21
+ "neutral.100": "#f5f5f5",
22
+ "neutral.200": "#e5e5e5",
23
+ "neutral.300": "#d4d4d4",
24
+ "neutral.400": "#a3a3a3",
25
+ "neutral.500": "#737373",
26
+ "neutral.600": "#525252",
27
+ "neutral.700": "#404040",
28
+ "neutral.800": "#262626",
29
+ "neutral.900": "#171717",
30
+ "neutral.950": "#0a0a0a",
31
+ "red.50": "#fef2f2",
32
+ "red.100": "#fee2e2",
33
+ "red.200": "#fecaca",
34
+ "red.300": "#fca5a5",
35
+ "red.400": "#f87171",
36
+ "red.500": "#ef4444",
37
+ "red.600": "#dc2626",
38
+ "red.700": "#991919",
39
+ "red.800": "#511111",
40
+ "red.900": "#300c0c",
41
+ "red.950": "#1f0808",
42
+ "orange.50": "#fff7ed",
43
+ "orange.100": "#ffedd5",
44
+ "orange.200": "#fed7aa",
45
+ "orange.300": "#fdba74",
46
+ "orange.400": "#fb923c",
47
+ "orange.500": "#f97316",
48
+ "orange.600": "#ea580c",
49
+ "orange.700": "#92310a",
50
+ "orange.800": "#6c2710",
51
+ "orange.900": "#3b1106",
52
+ "orange.950": "#220a04",
53
+ "yellow.50": "#fefce8",
54
+ "yellow.100": "#fef9c3",
55
+ "yellow.200": "#fef08a",
56
+ "yellow.300": "#fde047",
57
+ "yellow.400": "#facc15",
58
+ "yellow.500": "#eab308",
59
+ "yellow.600": "#ca8a04",
60
+ "yellow.700": "#845209",
61
+ "yellow.800": "#713f12",
62
+ "yellow.900": "#422006",
63
+ "yellow.950": "#281304",
64
+ "green.50": "#f0fdf4",
65
+ "green.100": "#dcfce7",
66
+ "green.200": "#bbf7d0",
67
+ "green.300": "#86efac",
68
+ "green.400": "#4ade80",
69
+ "green.500": "#22c55e",
70
+ "green.600": "#16a34a",
71
+ "green.700": "#116932",
72
+ "green.800": "#124a28",
73
+ "green.900": "#042713",
74
+ "green.950": "#03190c",
75
+ "teal.50": "#f0fdfa",
76
+ "teal.100": "#ccfbf1",
77
+ "teal.200": "#99f6e4",
78
+ "teal.300": "#5eead4",
79
+ "teal.400": "#2dd4bf",
80
+ "teal.500": "#14b8a6",
81
+ "teal.600": "#0d9488",
82
+ "teal.700": "#0c5d56",
83
+ "teal.800": "#114240",
84
+ "teal.900": "#032726",
85
+ "teal.950": "#021716",
86
+ "blue.50": "#eff6ff",
87
+ "blue.100": "#dbeafe",
88
+ "blue.200": "#bfdbfe",
89
+ "blue.300": "#a3cfff",
90
+ "blue.400": "#60a5fa",
91
+ "blue.500": "#3b82f6",
92
+ "blue.600": "#2563eb",
93
+ "blue.700": "#173da6",
94
+ "blue.800": "#1a3478",
95
+ "blue.900": "#14204a",
96
+ "blue.950": "#0c142e",
97
+ "cyan.50": "#ecfeff",
98
+ "cyan.100": "#cffafe",
99
+ "cyan.200": "#a5f3fc",
100
+ "cyan.300": "#67e8f9",
101
+ "cyan.400": "#22d3ee",
102
+ "cyan.500": "#06b6d4",
103
+ "cyan.600": "#0891b2",
104
+ "cyan.700": "#0c5c72",
105
+ "cyan.800": "#134152",
106
+ "cyan.900": "#072a38",
107
+ "cyan.950": "#051b24",
108
+ "purple.50": "#faf5ff",
109
+ "purple.100": "#f3e8ff",
110
+ "purple.200": "#e9d5ff",
111
+ "purple.300": "#d8b4fe",
112
+ "purple.400": "#c084fc",
113
+ "purple.500": "#a855f7",
114
+ "purple.600": "#9333ea",
115
+ "purple.700": "#641ba3",
116
+ "purple.800": "#4a1772",
117
+ "purple.900": "#2f0553",
118
+ "purple.950": "#1a032e",
119
+ "pink.50": "#fdf2f8",
120
+ "pink.100": "#fce7f3",
121
+ "pink.200": "#fbcfe8",
122
+ "pink.300": "#f9a8d4",
123
+ "pink.400": "#f472b6",
124
+ "pink.500": "#ec4899",
125
+ "pink.600": "#db2777",
126
+ "pink.700": "#a41752",
127
+ "pink.800": "#6d0e34",
128
+ "pink.900": "#45061f",
129
+ "pink.950": "#2c0514"
130
+ };
131
+ /**
132
+ * Scheme-dependent colors in `ThemeConfig['semanticTokens']['colors']`'s
133
+ * shape: group -> token -> scheme, so `'fg.default'` resolves in one lookup.
134
+ */
135
+ const semanticColors = {
136
+ primary: {
137
+ bg: {
138
+ light: colors.black,
139
+ dark: colors.white
140
+ },
141
+ fg: {
142
+ light: colors.white,
143
+ dark: colors.black
144
+ }
145
+ },
146
+ bg: {
147
+ default: {
148
+ light: colors.white,
149
+ dark: colors.black
150
+ },
151
+ subtle: {
152
+ light: colors["gray.50"],
153
+ dark: colors["gray.950"]
154
+ },
155
+ muted: {
156
+ light: colors["gray.100"],
157
+ dark: colors["gray.900"]
158
+ },
159
+ emphasized: {
160
+ light: colors["gray.200"],
161
+ dark: colors["gray.700"]
162
+ },
163
+ inverted: {
164
+ light: colors.black,
165
+ dark: colors.white
166
+ },
167
+ panel: {
168
+ light: colors.white,
169
+ dark: colors["gray.950"]
170
+ },
171
+ error: {
172
+ light: colors["red.50"],
173
+ dark: colors["red.950"]
174
+ },
175
+ warning: {
176
+ light: colors["yellow.50"],
177
+ dark: colors["yellow.950"]
178
+ },
179
+ success: {
180
+ light: colors["green.50"],
181
+ dark: colors["green.950"]
182
+ },
183
+ info: {
184
+ light: colors["blue.50"],
185
+ dark: colors["blue.950"]
186
+ }
187
+ },
188
+ border: {
189
+ default: {
190
+ light: colors["gray.200"],
191
+ dark: colors["gray.800"]
192
+ },
193
+ muted: {
194
+ light: colors["gray.100"],
195
+ dark: colors["gray.900"]
196
+ },
197
+ subtle: {
198
+ light: colors["gray.50"],
199
+ dark: colors["gray.950"]
200
+ },
201
+ emphasized: {
202
+ light: colors["gray.300"],
203
+ dark: colors["gray.700"]
204
+ },
205
+ inverted: {
206
+ light: colors["gray.800"],
207
+ dark: colors["gray.200"]
208
+ },
209
+ error: {
210
+ light: colors["red.500"],
211
+ dark: colors["red.400"]
212
+ },
213
+ warning: {
214
+ light: colors["orange.500"],
215
+ dark: colors["orange.400"]
216
+ },
217
+ success: {
218
+ light: colors["green.500"],
219
+ dark: colors["green.400"]
220
+ },
221
+ info: {
222
+ light: colors["blue.500"],
223
+ dark: colors["blue.400"]
224
+ }
225
+ },
226
+ fg: {
227
+ default: {
228
+ light: colors.black,
229
+ dark: colors["gray.50"]
230
+ },
231
+ muted: {
232
+ light: colors["gray.600"],
233
+ dark: colors["gray.400"]
234
+ },
235
+ subtle: {
236
+ light: colors["gray.400"],
237
+ dark: colors["gray.500"]
238
+ },
239
+ inverted: {
240
+ light: colors["gray.50"],
241
+ dark: colors.black
242
+ },
243
+ error: {
244
+ light: colors["red.500"],
245
+ dark: colors["red.400"]
246
+ },
247
+ warning: {
248
+ light: colors["orange.600"],
249
+ dark: colors["orange.300"]
250
+ },
251
+ success: {
252
+ light: colors["green.600"],
253
+ dark: colors["green.300"]
254
+ },
255
+ info: {
256
+ light: colors["blue.600"],
257
+ dark: colors["blue.300"]
258
+ }
259
+ },
260
+ gray: {
261
+ contrast: {
262
+ light: colors.white,
263
+ dark: colors.black
264
+ },
265
+ fg: {
266
+ light: colors["gray.800"],
267
+ dark: colors["gray.200"]
268
+ },
269
+ subtle: {
270
+ light: colors["gray.100"],
271
+ dark: colors["gray.900"]
272
+ },
273
+ muted: {
274
+ light: colors["gray.200"],
275
+ dark: colors["gray.800"]
276
+ },
277
+ emphasized: {
278
+ light: colors["gray.300"],
279
+ dark: colors["gray.700"]
280
+ },
281
+ solid: {
282
+ light: colors["gray.900"],
283
+ dark: colors.white
284
+ },
285
+ focusRing: {
286
+ light: colors["gray.400"],
287
+ dark: colors["gray.400"]
288
+ },
289
+ border: {
290
+ light: colors["gray.200"],
291
+ dark: colors["gray.800"]
292
+ }
293
+ },
294
+ red: {
295
+ contrast: {
296
+ light: colors.white,
297
+ dark: colors.white
298
+ },
299
+ fg: {
300
+ light: colors["red.700"],
301
+ dark: colors["red.300"]
302
+ },
303
+ subtle: {
304
+ light: colors["red.100"],
305
+ dark: colors["red.900"]
306
+ },
307
+ muted: {
308
+ light: colors["red.200"],
309
+ dark: colors["red.800"]
310
+ },
311
+ emphasized: {
312
+ light: colors["red.300"],
313
+ dark: colors["red.700"]
314
+ },
315
+ solid: {
316
+ light: colors["red.600"],
317
+ dark: colors["red.600"]
318
+ },
319
+ focusRing: {
320
+ light: colors["red.500"],
321
+ dark: colors["red.500"]
322
+ },
323
+ border: {
324
+ light: colors["red.500"],
325
+ dark: colors["red.400"]
326
+ }
327
+ },
328
+ pink: {
329
+ contrast: {
330
+ light: colors.white,
331
+ dark: colors.white
332
+ },
333
+ fg: {
334
+ light: colors["pink.700"],
335
+ dark: colors["pink.300"]
336
+ },
337
+ subtle: {
338
+ light: colors["pink.100"],
339
+ dark: colors["pink.900"]
340
+ },
341
+ muted: {
342
+ light: colors["pink.200"],
343
+ dark: colors["pink.800"]
344
+ },
345
+ emphasized: {
346
+ light: colors["pink.300"],
347
+ dark: colors["pink.700"]
348
+ },
349
+ solid: {
350
+ light: colors["pink.600"],
351
+ dark: colors["pink.600"]
352
+ },
353
+ focusRing: {
354
+ light: colors["pink.500"],
355
+ dark: colors["pink.500"]
356
+ },
357
+ border: {
358
+ light: colors["pink.500"],
359
+ dark: colors["pink.400"]
360
+ }
361
+ },
362
+ purple: {
363
+ contrast: {
364
+ light: colors.white,
365
+ dark: colors.white
366
+ },
367
+ fg: {
368
+ light: colors["purple.700"],
369
+ dark: colors["purple.300"]
370
+ },
371
+ subtle: {
372
+ light: colors["purple.100"],
373
+ dark: colors["purple.900"]
374
+ },
375
+ muted: {
376
+ light: colors["purple.200"],
377
+ dark: colors["purple.800"]
378
+ },
379
+ emphasized: {
380
+ light: colors["purple.300"],
381
+ dark: colors["purple.700"]
382
+ },
383
+ solid: {
384
+ light: colors["purple.600"],
385
+ dark: colors["purple.600"]
386
+ },
387
+ focusRing: {
388
+ light: colors["purple.500"],
389
+ dark: colors["purple.500"]
390
+ },
391
+ border: {
392
+ light: colors["purple.500"],
393
+ dark: colors["purple.400"]
394
+ }
395
+ },
396
+ cyan: {
397
+ contrast: {
398
+ light: colors.white,
399
+ dark: colors.white
400
+ },
401
+ fg: {
402
+ light: colors["cyan.700"],
403
+ dark: colors["cyan.300"]
404
+ },
405
+ subtle: {
406
+ light: colors["cyan.100"],
407
+ dark: colors["cyan.900"]
408
+ },
409
+ muted: {
410
+ light: colors["cyan.200"],
411
+ dark: colors["cyan.800"]
412
+ },
413
+ emphasized: {
414
+ light: colors["cyan.300"],
415
+ dark: colors["cyan.700"]
416
+ },
417
+ solid: {
418
+ light: colors["cyan.600"],
419
+ dark: colors["cyan.600"]
420
+ },
421
+ focusRing: {
422
+ light: colors["cyan.500"],
423
+ dark: colors["cyan.500"]
424
+ },
425
+ border: {
426
+ light: colors["cyan.500"],
427
+ dark: colors["cyan.400"]
428
+ }
429
+ },
430
+ blue: {
431
+ contrast: {
432
+ light: colors.white,
433
+ dark: colors.white
434
+ },
435
+ fg: {
436
+ light: colors["blue.700"],
437
+ dark: colors["blue.300"]
438
+ },
439
+ subtle: {
440
+ light: colors["blue.100"],
441
+ dark: colors["blue.900"]
442
+ },
443
+ muted: {
444
+ light: colors["blue.200"],
445
+ dark: colors["blue.800"]
446
+ },
447
+ emphasized: {
448
+ light: colors["blue.300"],
449
+ dark: colors["blue.700"]
450
+ },
451
+ solid: {
452
+ light: colors["blue.600"],
453
+ dark: colors["blue.600"]
454
+ },
455
+ focusRing: {
456
+ light: colors["blue.500"],
457
+ dark: colors["blue.500"]
458
+ },
459
+ border: {
460
+ light: colors["blue.500"],
461
+ dark: colors["blue.400"]
462
+ }
463
+ },
464
+ teal: {
465
+ contrast: {
466
+ light: colors.white,
467
+ dark: colors.white
468
+ },
469
+ fg: {
470
+ light: colors["teal.700"],
471
+ dark: colors["teal.300"]
472
+ },
473
+ subtle: {
474
+ light: colors["teal.100"],
475
+ dark: colors["teal.900"]
476
+ },
477
+ muted: {
478
+ light: colors["teal.200"],
479
+ dark: colors["teal.800"]
480
+ },
481
+ emphasized: {
482
+ light: colors["teal.300"],
483
+ dark: colors["teal.700"]
484
+ },
485
+ solid: {
486
+ light: colors["teal.600"],
487
+ dark: colors["teal.600"]
488
+ },
489
+ focusRing: {
490
+ light: colors["teal.500"],
491
+ dark: colors["teal.500"]
492
+ },
493
+ border: {
494
+ light: colors["teal.500"],
495
+ dark: colors["teal.400"]
496
+ }
497
+ },
498
+ green: {
499
+ contrast: {
500
+ light: colors.white,
501
+ dark: colors.white
502
+ },
503
+ fg: {
504
+ light: colors["green.700"],
505
+ dark: colors["green.300"]
506
+ },
507
+ subtle: {
508
+ light: colors["green.100"],
509
+ dark: colors["green.900"]
510
+ },
511
+ muted: {
512
+ light: colors["green.200"],
513
+ dark: colors["green.800"]
514
+ },
515
+ emphasized: {
516
+ light: colors["green.300"],
517
+ dark: colors["green.700"]
518
+ },
519
+ solid: {
520
+ light: colors["green.600"],
521
+ dark: colors["green.600"]
522
+ },
523
+ focusRing: {
524
+ light: colors["green.500"],
525
+ dark: colors["green.500"]
526
+ },
527
+ border: {
528
+ light: colors["green.500"],
529
+ dark: colors["green.400"]
530
+ }
531
+ },
532
+ yellow: {
533
+ contrast: {
534
+ light: colors.black,
535
+ dark: colors.black
536
+ },
537
+ fg: {
538
+ light: colors["yellow.800"],
539
+ dark: colors["yellow.300"]
540
+ },
541
+ subtle: {
542
+ light: colors["yellow.100"],
543
+ dark: colors["yellow.900"]
544
+ },
545
+ muted: {
546
+ light: colors["yellow.200"],
547
+ dark: colors["yellow.800"]
548
+ },
549
+ emphasized: {
550
+ light: colors["yellow.300"],
551
+ dark: colors["yellow.700"]
552
+ },
553
+ solid: {
554
+ light: colors["yellow.300"],
555
+ dark: colors["yellow.300"]
556
+ },
557
+ focusRing: {
558
+ light: colors["yellow.500"],
559
+ dark: colors["yellow.500"]
560
+ },
561
+ border: {
562
+ light: colors["yellow.500"],
563
+ dark: colors["yellow.500"]
564
+ }
565
+ },
566
+ orange: {
567
+ contrast: {
568
+ light: colors.white,
569
+ dark: colors.black
570
+ },
571
+ fg: {
572
+ light: colors["orange.700"],
573
+ dark: colors["orange.300"]
574
+ },
575
+ subtle: {
576
+ light: colors["orange.100"],
577
+ dark: colors["orange.900"]
578
+ },
579
+ muted: {
580
+ light: colors["orange.200"],
581
+ dark: colors["orange.800"]
582
+ },
583
+ emphasized: {
584
+ light: colors["orange.300"],
585
+ dark: colors["orange.700"]
586
+ },
587
+ solid: {
588
+ light: colors["orange.600"],
589
+ dark: colors["orange.600"]
590
+ },
591
+ focusRing: {
592
+ light: colors["orange.500"],
593
+ dark: colors["orange.500"]
594
+ },
595
+ border: {
596
+ light: colors["orange.500"],
597
+ dark: colors["orange.400"]
598
+ }
599
+ }
600
+ };
601
+ //#endregion
602
+ export { colors, semanticColors };
package/dist/index.cjs ADDED
@@ -0,0 +1,31 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_colors = require("./colors.cjs");
3
+ const require_scales = require("./scales.cjs");
4
+ //#region src/index.ts
5
+ const chakraUiTheme = (0, require("@react-native-rethemed/core/config").defineTheme)({
6
+ tokens: {
7
+ colors: require_colors.colors,
8
+ radii: require_scales.radii,
9
+ spacing: require_scales.spacing,
10
+ fontSizes: require_scales.fontSizes,
11
+ fontWeights: require_scales.fontWeights,
12
+ lineHeights: require_scales.lineHeights,
13
+ letterSpacings: require_scales.letterSpacings,
14
+ zIndices: require_scales.zIndices,
15
+ shadows: require_scales.shadows
16
+ },
17
+ semanticTokens: { colors: require_colors.semanticColors },
18
+ defaults: { fontSize: "md" }
19
+ });
20
+ //#endregion
21
+ exports.chakraUiTheme = chakraUiTheme;
22
+ exports.colors = require_colors.colors;
23
+ exports.fontSizes = require_scales.fontSizes;
24
+ exports.fontWeights = require_scales.fontWeights;
25
+ exports.letterSpacings = require_scales.letterSpacings;
26
+ exports.lineHeights = require_scales.lineHeights;
27
+ exports.radii = require_scales.radii;
28
+ exports.semanticColors = require_colors.semanticColors;
29
+ exports.shadows = require_scales.shadows;
30
+ exports.spacing = require_scales.spacing;
31
+ exports.zIndices = require_scales.zIndices;
@@ -1,4 +1,6 @@
1
- import { colors, semanticColors } from './colors.js';
2
- import { fontSizes, fontWeights, letterSpacings, lineHeights, radii, shadows, spacing, zIndices } from './scales.js';
1
+ import { colors, semanticColors } from "./colors.cjs";
2
+ import { fontSizes, fontWeights, letterSpacings, lineHeights, radii, shadows, spacing, zIndices } from "./scales.cjs";
3
+ //#region src/index.d.ts
3
4
  export declare const chakraUiTheme: import("@react-native-rethemed/core/config").ThemeConfig;
4
- export { colors, fontSizes, fontWeights, letterSpacings, lineHeights, radii, semanticColors, shadows, spacing, zIndices, };
5
+ //#endregion
6
+ export { colors, fontSizes, fontWeights, letterSpacings, lineHeights, radii, semanticColors, shadows, spacing, zIndices };
@@ -1,4 +1,6 @@
1
- import { colors, semanticColors } from './colors';
2
- import { fontSizes, fontWeights, letterSpacings, lineHeights, radii, shadows, spacing, zIndices } from './scales';
1
+ import { colors, semanticColors } from "./colors.mjs";
2
+ import { fontSizes, fontWeights, letterSpacings, lineHeights, radii, shadows, spacing, zIndices } from "./scales.mjs";
3
+ //#region src/index.d.ts
3
4
  export declare const chakraUiTheme: import("@react-native-rethemed/core/config").ThemeConfig;
4
- export { colors, fontSizes, fontWeights, letterSpacings, lineHeights, radii, semanticColors, shadows, spacing, zIndices, };
5
+ //#endregion
6
+ export { colors, fontSizes, fontWeights, letterSpacings, lineHeights, radii, semanticColors, shadows, spacing, zIndices };
package/dist/index.mjs ADDED
@@ -0,0 +1,21 @@
1
+ import { colors, semanticColors } from "./colors.mjs";
2
+ import { fontSizes, fontWeights, letterSpacings, lineHeights, radii, shadows, spacing, zIndices } from "./scales.mjs";
3
+ import { defineTheme } from "@react-native-rethemed/core/config";
4
+ //#region src/index.ts
5
+ const chakraUiTheme = defineTheme({
6
+ tokens: {
7
+ colors,
8
+ radii,
9
+ spacing,
10
+ fontSizes,
11
+ fontWeights,
12
+ lineHeights,
13
+ letterSpacings,
14
+ zIndices,
15
+ shadows
16
+ },
17
+ semanticTokens: { colors: semanticColors },
18
+ defaults: { fontSize: "md" }
19
+ });
20
+ //#endregion
21
+ export { chakraUiTheme, colors, fontSizes, fontWeights, letterSpacings, lineHeights, radii, semanticColors, shadows, spacing, zIndices };