@react-native-rethemed/panda-css-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,466 @@
1
+ //#region src/tokens.gen.ts
2
+ /** Panda's palette (Tailwind's), converted from oklch to hex. `current` is omitted. */
3
+ const colors = {
4
+ transparent: "#00000000",
5
+ black: "#000000",
6
+ white: "#ffffff",
7
+ "slate.50": "#f8fafc",
8
+ "slate.100": "#f1f5f9",
9
+ "slate.200": "#e2e8f0",
10
+ "slate.300": "#cad5e2",
11
+ "slate.400": "#90a1b9",
12
+ "slate.500": "#62748e",
13
+ "slate.600": "#45556c",
14
+ "slate.700": "#314158",
15
+ "slate.800": "#1d293d",
16
+ "slate.900": "#0f172b",
17
+ "slate.950": "#020618",
18
+ "gray.50": "#f9fafb",
19
+ "gray.100": "#f3f4f6",
20
+ "gray.200": "#e5e7eb",
21
+ "gray.300": "#d1d5dc",
22
+ "gray.400": "#99a1af",
23
+ "gray.500": "#6a7282",
24
+ "gray.600": "#4a5565",
25
+ "gray.700": "#364153",
26
+ "gray.800": "#1e2939",
27
+ "gray.900": "#101828",
28
+ "gray.950": "#030712",
29
+ "zinc.50": "#fafafa",
30
+ "zinc.100": "#f4f4f5",
31
+ "zinc.200": "#e4e4e7",
32
+ "zinc.300": "#d4d4d8",
33
+ "zinc.400": "#9f9fa9",
34
+ "zinc.500": "#71717b",
35
+ "zinc.600": "#52525c",
36
+ "zinc.700": "#3f3f46",
37
+ "zinc.800": "#27272a",
38
+ "zinc.900": "#18181b",
39
+ "zinc.950": "#09090b",
40
+ "neutral.50": "#fafafa",
41
+ "neutral.100": "#f5f5f5",
42
+ "neutral.200": "#e5e5e5",
43
+ "neutral.300": "#d4d4d4",
44
+ "neutral.400": "#a1a1a1",
45
+ "neutral.500": "#737373",
46
+ "neutral.600": "#525252",
47
+ "neutral.700": "#404040",
48
+ "neutral.800": "#262626",
49
+ "neutral.900": "#171717",
50
+ "neutral.950": "#0a0a0a",
51
+ "stone.50": "#fafaf9",
52
+ "stone.100": "#f5f5f4",
53
+ "stone.200": "#e7e5e4",
54
+ "stone.300": "#d6d3d1",
55
+ "stone.400": "#a6a09b",
56
+ "stone.500": "#79716b",
57
+ "stone.600": "#57534d",
58
+ "stone.700": "#44403b",
59
+ "stone.800": "#292524",
60
+ "stone.900": "#1c1917",
61
+ "stone.950": "#0c0a09",
62
+ "mauve.50": "#fafafa",
63
+ "mauve.100": "#f3f1f3",
64
+ "mauve.200": "#e7e4e7",
65
+ "mauve.300": "#d7d0d7",
66
+ "mauve.400": "#a89ea9",
67
+ "mauve.500": "#79697b",
68
+ "mauve.600": "#594c5b",
69
+ "mauve.700": "#463947",
70
+ "mauve.800": "#2a212c",
71
+ "mauve.900": "#1d161e",
72
+ "mauve.950": "#0c090c",
73
+ "olive.50": "#fbfbf9",
74
+ "olive.100": "#f4f4f0",
75
+ "olive.200": "#e8e8e3",
76
+ "olive.300": "#d8d8d0",
77
+ "olive.400": "#abab9c",
78
+ "olive.500": "#7c7c67",
79
+ "olive.600": "#5b5b4b",
80
+ "olive.700": "#474739",
81
+ "olive.800": "#2b2b22",
82
+ "olive.900": "#1d1d16",
83
+ "olive.950": "#0c0c09",
84
+ "mist.50": "#f9fbfb",
85
+ "mist.100": "#f1f3f3",
86
+ "mist.200": "#e3e7e8",
87
+ "mist.300": "#d0d6d8",
88
+ "mist.400": "#9ca8ab",
89
+ "mist.500": "#67787c",
90
+ "mist.600": "#4b585b",
91
+ "mist.700": "#394447",
92
+ "mist.800": "#22292b",
93
+ "mist.900": "#161b1d",
94
+ "mist.950": "#090b0c",
95
+ "taupe.50": "#fbfaf9",
96
+ "taupe.100": "#f3f1f1",
97
+ "taupe.200": "#e8e4e3",
98
+ "taupe.300": "#d8d2d0",
99
+ "taupe.400": "#aba09c",
100
+ "taupe.500": "#7c6d67",
101
+ "taupe.600": "#5b4f4b",
102
+ "taupe.700": "#473c39",
103
+ "taupe.800": "#2b2422",
104
+ "taupe.900": "#1d1816",
105
+ "taupe.950": "#0c0a09",
106
+ "red.50": "#fef2f2",
107
+ "red.100": "#ffe2e2",
108
+ "red.200": "#ffc9c9",
109
+ "red.300": "#ffa2a2",
110
+ "red.400": "#ff6467",
111
+ "red.500": "#fb2c36",
112
+ "red.600": "#e7000b",
113
+ "red.700": "#c10007",
114
+ "red.800": "#9f0712",
115
+ "red.900": "#82181a",
116
+ "red.950": "#460809",
117
+ "orange.50": "#fff7ed",
118
+ "orange.100": "#ffedd4",
119
+ "orange.200": "#ffd6a8",
120
+ "orange.300": "#ffb86a",
121
+ "orange.400": "#ff8904",
122
+ "orange.500": "#ff6900",
123
+ "orange.600": "#f54a00",
124
+ "orange.700": "#ca3500",
125
+ "orange.800": "#9f2d00",
126
+ "orange.900": "#7e2a0c",
127
+ "orange.950": "#441306",
128
+ "amber.50": "#fffbeb",
129
+ "amber.100": "#fef3c6",
130
+ "amber.200": "#fee685",
131
+ "amber.300": "#ffd230",
132
+ "amber.400": "#ffba00",
133
+ "amber.500": "#fd9a00",
134
+ "amber.600": "#e17100",
135
+ "amber.700": "#bb4d00",
136
+ "amber.800": "#973c00",
137
+ "amber.900": "#7b3306",
138
+ "amber.950": "#461901",
139
+ "yellow.50": "#fefce8",
140
+ "yellow.100": "#fef9c2",
141
+ "yellow.200": "#fff085",
142
+ "yellow.300": "#ffdf20",
143
+ "yellow.400": "#fcc800",
144
+ "yellow.500": "#efb100",
145
+ "yellow.600": "#d08700",
146
+ "yellow.700": "#a65f00",
147
+ "yellow.800": "#894b00",
148
+ "yellow.900": "#733e0a",
149
+ "yellow.950": "#432004",
150
+ "lime.50": "#f7fee7",
151
+ "lime.100": "#ecfcca",
152
+ "lime.200": "#d8f999",
153
+ "lime.300": "#bbf451",
154
+ "lime.400": "#9ae600",
155
+ "lime.500": "#7ccf00",
156
+ "lime.600": "#5ea500",
157
+ "lime.700": "#497d00",
158
+ "lime.800": "#3d6300",
159
+ "lime.900": "#35530e",
160
+ "lime.950": "#192e03",
161
+ "green.50": "#f0fdf4",
162
+ "green.100": "#dcfce7",
163
+ "green.200": "#b9f8cf",
164
+ "green.300": "#7bf1a8",
165
+ "green.400": "#05df72",
166
+ "green.500": "#00c951",
167
+ "green.600": "#00a63e",
168
+ "green.700": "#008236",
169
+ "green.800": "#016630",
170
+ "green.900": "#0d542b",
171
+ "green.950": "#032e15",
172
+ "emerald.50": "#ecfdf5",
173
+ "emerald.100": "#d0fae5",
174
+ "emerald.200": "#a4f4cf",
175
+ "emerald.300": "#5ee9b5",
176
+ "emerald.400": "#00d492",
177
+ "emerald.500": "#00bc7d",
178
+ "emerald.600": "#009966",
179
+ "emerald.700": "#007a55",
180
+ "emerald.800": "#006045",
181
+ "emerald.900": "#004f3b",
182
+ "emerald.950": "#002c22",
183
+ "teal.50": "#f0fdfa",
184
+ "teal.100": "#cbfbf1",
185
+ "teal.200": "#96f7e4",
186
+ "teal.300": "#46ecd5",
187
+ "teal.400": "#00d5be",
188
+ "teal.500": "#00bba7",
189
+ "teal.600": "#009689",
190
+ "teal.700": "#00786f",
191
+ "teal.800": "#005f5a",
192
+ "teal.900": "#0b4f4a",
193
+ "teal.950": "#022f2e",
194
+ "cyan.50": "#ecfeff",
195
+ "cyan.100": "#cefafe",
196
+ "cyan.200": "#a2f4fd",
197
+ "cyan.300": "#53eafd",
198
+ "cyan.400": "#00d3f2",
199
+ "cyan.500": "#00b8db",
200
+ "cyan.600": "#0092b8",
201
+ "cyan.700": "#007595",
202
+ "cyan.800": "#005f78",
203
+ "cyan.900": "#104e64",
204
+ "cyan.950": "#053345",
205
+ "sky.50": "#f0f9ff",
206
+ "sky.100": "#dff2fe",
207
+ "sky.200": "#b8e6fe",
208
+ "sky.300": "#74d4ff",
209
+ "sky.400": "#00bcff",
210
+ "sky.500": "#00a6f4",
211
+ "sky.600": "#0084d1",
212
+ "sky.700": "#0069a8",
213
+ "sky.800": "#00598a",
214
+ "sky.900": "#024a70",
215
+ "sky.950": "#052f4a",
216
+ "blue.50": "#eff6ff",
217
+ "blue.100": "#dbeafe",
218
+ "blue.200": "#bedbff",
219
+ "blue.300": "#8ec5ff",
220
+ "blue.400": "#51a2ff",
221
+ "blue.500": "#2b7fff",
222
+ "blue.600": "#155dfc",
223
+ "blue.700": "#1447e6",
224
+ "blue.800": "#193cb8",
225
+ "blue.900": "#1c398e",
226
+ "blue.950": "#162456",
227
+ "indigo.50": "#eef2ff",
228
+ "indigo.100": "#e0e7ff",
229
+ "indigo.200": "#c6d2ff",
230
+ "indigo.300": "#a3b3ff",
231
+ "indigo.400": "#7c86ff",
232
+ "indigo.500": "#615fff",
233
+ "indigo.600": "#4f39f6",
234
+ "indigo.700": "#432dd7",
235
+ "indigo.800": "#372aac",
236
+ "indigo.900": "#312c85",
237
+ "indigo.950": "#1e1a4d",
238
+ "violet.50": "#f5f3ff",
239
+ "violet.100": "#ede9fe",
240
+ "violet.200": "#ddd6ff",
241
+ "violet.300": "#c4b4ff",
242
+ "violet.400": "#a684ff",
243
+ "violet.500": "#8e51ff",
244
+ "violet.600": "#7f22fe",
245
+ "violet.700": "#7008e7",
246
+ "violet.800": "#5d0ec0",
247
+ "violet.900": "#4d179a",
248
+ "violet.950": "#2f0d68",
249
+ "purple.50": "#faf5ff",
250
+ "purple.100": "#f3e8ff",
251
+ "purple.200": "#e9d4ff",
252
+ "purple.300": "#dab2ff",
253
+ "purple.400": "#c27aff",
254
+ "purple.500": "#ad46ff",
255
+ "purple.600": "#9810fa",
256
+ "purple.700": "#8200db",
257
+ "purple.800": "#6e11b0",
258
+ "purple.900": "#59168b",
259
+ "purple.950": "#3c0366",
260
+ "fuchsia.50": "#fdf4ff",
261
+ "fuchsia.100": "#fae8ff",
262
+ "fuchsia.200": "#f6cfff",
263
+ "fuchsia.300": "#f4a8ff",
264
+ "fuchsia.400": "#ed6bff",
265
+ "fuchsia.500": "#e12afb",
266
+ "fuchsia.600": "#c800de",
267
+ "fuchsia.700": "#a800b7",
268
+ "fuchsia.800": "#8a0194",
269
+ "fuchsia.900": "#721378",
270
+ "fuchsia.950": "#4b004f",
271
+ "pink.50": "#fdf2f8",
272
+ "pink.100": "#fce7f3",
273
+ "pink.200": "#fccee8",
274
+ "pink.300": "#fda5d5",
275
+ "pink.400": "#fb64b6",
276
+ "pink.500": "#f6339a",
277
+ "pink.600": "#e60076",
278
+ "pink.700": "#c6005c",
279
+ "pink.800": "#a3004c",
280
+ "pink.900": "#861043",
281
+ "pink.950": "#510424",
282
+ "rose.50": "#fff1f2",
283
+ "rose.100": "#ffe4e6",
284
+ "rose.200": "#ffccd3",
285
+ "rose.300": "#ffa1ad",
286
+ "rose.400": "#ff637e",
287
+ "rose.500": "#ff2056",
288
+ "rose.600": "#ec003f",
289
+ "rose.700": "#c70036",
290
+ "rose.800": "#a50036",
291
+ "rose.900": "#8b0836",
292
+ "rose.950": "#4d0218"
293
+ };
294
+ /** Border radii, in points (1rem = 16). */
295
+ const radii = {
296
+ xs: 2,
297
+ sm: 4,
298
+ md: 6,
299
+ lg: 8,
300
+ xl: 12,
301
+ "2xl": 16,
302
+ "3xl": 24,
303
+ "4xl": 32,
304
+ full: 9999
305
+ };
306
+ /** Spacing scale, in points (1rem = 16). */
307
+ const spacing = {
308
+ 0: 0,
309
+ .5: 2,
310
+ 1: 4,
311
+ 1.5: 6,
312
+ 2: 8,
313
+ 2.5: 10,
314
+ 3: 12,
315
+ 3.5: 14,
316
+ 4: 16,
317
+ 4.5: 18,
318
+ 5: 20,
319
+ 5.5: 22,
320
+ 6: 24,
321
+ 7: 28,
322
+ 8: 32,
323
+ 9: 36,
324
+ 10: 40,
325
+ 11: 44,
326
+ 12: 48,
327
+ 14: 56,
328
+ 16: 64,
329
+ 20: 80,
330
+ 24: 96,
331
+ 28: 112,
332
+ 32: 128,
333
+ 36: 144,
334
+ 40: 160,
335
+ 44: 176,
336
+ 48: 192,
337
+ 52: 208,
338
+ 56: 224,
339
+ 60: 240,
340
+ 64: 256,
341
+ 72: 288,
342
+ 80: 320,
343
+ 96: 384
344
+ };
345
+ /** Font sizes, in points (1rem = 16). */
346
+ const fontSizes = {
347
+ "2xs": 8,
348
+ xs: 12,
349
+ sm: 14,
350
+ md: 16,
351
+ lg: 18,
352
+ xl: 20,
353
+ "2xl": 24,
354
+ "3xl": 30,
355
+ "4xl": 36,
356
+ "5xl": 48,
357
+ "6xl": 60,
358
+ "7xl": 72,
359
+ "8xl": 96,
360
+ "9xl": 128
361
+ };
362
+ /** Font weights. */
363
+ const fontWeights = {
364
+ thin: "100",
365
+ extralight: "200",
366
+ light: "300",
367
+ normal: "400",
368
+ medium: "500",
369
+ semibold: "600",
370
+ bold: "700",
371
+ extrabold: "800",
372
+ black: "900"
373
+ };
374
+ /** Line heights, as ratios of `fontSize`. */
375
+ const lineHeights = {
376
+ none: 1,
377
+ tight: 1.25,
378
+ snug: 1.375,
379
+ normal: 1.5,
380
+ relaxed: 1.625,
381
+ loose: 2
382
+ };
383
+ /** Letter spacings: em values converted to points at a 16px font size. */
384
+ const letterSpacings = {
385
+ tighter: -.8,
386
+ tight: -.4,
387
+ normal: 0,
388
+ wide: .4,
389
+ wider: .8,
390
+ widest: 1.6
391
+ };
392
+ /** Box shadows as single-layer RN shadows. Inset shadows are omitted. */
393
+ const shadows = {
394
+ "2xs": {
395
+ shadowColor: "#000000",
396
+ shadowOffset: {
397
+ width: 0,
398
+ height: 1
399
+ },
400
+ shadowOpacity: .05,
401
+ shadowRadius: 0,
402
+ elevation: 1
403
+ },
404
+ xs: {
405
+ shadowColor: "#000000",
406
+ shadowOffset: {
407
+ width: 0,
408
+ height: 1
409
+ },
410
+ shadowOpacity: .05,
411
+ shadowRadius: 1,
412
+ elevation: 1
413
+ },
414
+ sm: {
415
+ shadowColor: "#000000",
416
+ shadowOffset: {
417
+ width: 0,
418
+ height: 1
419
+ },
420
+ shadowOpacity: .1,
421
+ shadowRadius: 1.5,
422
+ elevation: 2
423
+ },
424
+ md: {
425
+ shadowColor: "#000000",
426
+ shadowOffset: {
427
+ width: 0,
428
+ height: 4
429
+ },
430
+ shadowOpacity: .1,
431
+ shadowRadius: 3,
432
+ elevation: 4
433
+ },
434
+ lg: {
435
+ shadowColor: "#000000",
436
+ shadowOffset: {
437
+ width: 0,
438
+ height: 10
439
+ },
440
+ shadowOpacity: .1,
441
+ shadowRadius: 7.5,
442
+ elevation: 8
443
+ },
444
+ xl: {
445
+ shadowColor: "#000000",
446
+ shadowOffset: {
447
+ width: 0,
448
+ height: 20
449
+ },
450
+ shadowOpacity: .1,
451
+ shadowRadius: 12.5,
452
+ elevation: 12
453
+ },
454
+ "2xl": {
455
+ shadowColor: "#000000",
456
+ shadowOffset: {
457
+ width: 0,
458
+ height: 25
459
+ },
460
+ shadowOpacity: .25,
461
+ shadowRadius: 25,
462
+ elevation: 16
463
+ }
464
+ };
465
+ //#endregion
466
+ export { colors, fontSizes, fontWeights, letterSpacings, lineHeights, radii, shadows, spacing };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-native-rethemed/panda-css-tokens",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Panda CSS's default theme tokens for React Native, ready for react-native-rethemed.",
5
5
  "keywords": [
6
6
  "react-native",
@@ -20,18 +20,11 @@
20
20
  "directory": "packages/react-native-rethemed/panda-css"
21
21
  },
22
22
  "sideEffects": false,
23
- "main": "./dist/cjs/index.js",
24
- "types": "./dist/cjs/index.d.ts",
23
+ "types": "./dist/index.d.cts",
25
24
  "exports": {
26
25
  ".": {
27
- "import": {
28
- "types": "./dist/esm/index.d.ts",
29
- "default": "./dist/esm/index.js"
30
- },
31
- "require": {
32
- "types": "./dist/cjs/index.d.ts",
33
- "default": "./dist/cjs/index.js"
34
- }
26
+ "import": "./dist/index.mjs",
27
+ "require": "./dist/index.cjs"
35
28
  },
36
29
  "./package.json": "./package.json"
37
30
  },
@@ -42,25 +35,29 @@
42
35
  "access": "public"
43
36
  },
44
37
  "dependencies": {
45
- "@react-native-rethemed/core": "^0.1.0"
38
+ "@react-native-rethemed/core": "^0.1.1"
46
39
  },
47
40
  "devDependencies": {
41
+ "@arethetypeswrong/core": "0.18.5",
48
42
  "@biomejs/biome": "2.5.4",
49
43
  "@pandacss/preset-panda": "2.0.0",
50
- "@react-native-rethemed/cli": "0.1.0",
44
+ "@react-native-rethemed/cli": "0.1.1",
51
45
  "@types/culori": "4.0.1",
52
46
  "@types/node": "24.10.4",
53
47
  "@types/react": "19.2.17",
54
48
  "biome-config": "0.0.0",
55
49
  "culori": "4.0.2",
56
50
  "jiti": "2.7.0",
51
+ "publint": "0.3.25",
57
52
  "react": "19.2.3",
58
53
  "react-native": "0.86.2",
54
+ "tsdown": "0.23.0",
55
+ "tsdown-config": "0.0.0",
59
56
  "typescript": "6.0.3",
60
57
  "vitest": "4.1.10"
61
58
  },
62
59
  "scripts": {
63
- "build": "node ../../../scripts/build-package.mjs",
60
+ "build": "tsdown",
64
61
  "generate": "jiti scripts/generate.ts",
65
62
  "example:codegen": "react-native-rethemed codegen example/theme.ts --docs example/themed.md",
66
63
  "lint": "biome check src scripts example",
@@ -68,5 +65,6 @@
68
65
  "tsc": "tsc --noEmit",
69
66
  "test": "vitest",
70
67
  "test:ci": "vitest run"
71
- }
68
+ },
69
+ "main": "./dist/index.cjs"
72
70
  }
package/dist/cjs/index.js DELETED
@@ -1,45 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.spacing = exports.shadows = exports.radii = exports.lineHeights = exports.letterSpacings = exports.fontWeights = exports.fontSizes = exports.colors = exports.pandaCssTheme = void 0;
4
- const config_1 = require("@react-native-rethemed/core/config");
5
- const tokens_gen_1 = require("./tokens.gen");
6
- Object.defineProperty(exports, "colors", { enumerable: true, get: function () { return tokens_gen_1.colors; } });
7
- Object.defineProperty(exports, "fontSizes", { enumerable: true, get: function () { return tokens_gen_1.fontSizes; } });
8
- Object.defineProperty(exports, "fontWeights", { enumerable: true, get: function () { return tokens_gen_1.fontWeights; } });
9
- Object.defineProperty(exports, "letterSpacings", { enumerable: true, get: function () { return tokens_gen_1.letterSpacings; } });
10
- Object.defineProperty(exports, "lineHeights", { enumerable: true, get: function () { return tokens_gen_1.lineHeights; } });
11
- Object.defineProperty(exports, "radii", { enumerable: true, get: function () { return tokens_gen_1.radii; } });
12
- Object.defineProperty(exports, "shadows", { enumerable: true, get: function () { return tokens_gen_1.shadows; } });
13
- Object.defineProperty(exports, "spacing", { enumerable: true, get: function () { return tokens_gen_1.spacing; } });
14
- /**
15
- * Panda CSS's default theme (`@pandacss/preset-panda`), converted for React
16
- * Native. Values are generated by `scripts/generate.ts`; see
17
- * `src/tokens.gen.ts`.
18
- *
19
- * - Lengths: rem → points at 16px; em letter spacings → points at 16px.
20
- * - `colors`: Panda's (Tailwind's) oklch palette as hex. Color props take
21
- * them by name (`themed.view({ backgroundColor: 'red.500' })`).
22
- * - `shadows`: first layer only; inset shadows are omitted.
23
- * - No `semanticTokens`: Panda ships none. Define `semanticTokens.colors`
24
- * and `semanticTokens.text` in the app (they can reference these values).
25
- * Panda's `textStyles` are not converted for the same reason.
26
- * - Not included (no RN style equivalent): sizes, fonts, blurs, durations,
27
- * easings, animations, aspect ratios, borders, breakpoints, keyframes.
28
- */
29
- exports.pandaCssTheme = (0, config_1.defineTheme)({
30
- tokens: {
31
- colors: tokens_gen_1.colors,
32
- radii: tokens_gen_1.radii,
33
- spacing: tokens_gen_1.spacing,
34
- fontSizes: tokens_gen_1.fontSizes,
35
- fontWeights: tokens_gen_1.fontWeights,
36
- lineHeights: tokens_gen_1.lineHeights,
37
- letterSpacings: tokens_gen_1.letterSpacings,
38
- shadows: tokens_gen_1.shadows,
39
- },
40
- // The browser default (16px); `lineHeights` are ratios of it when a style
41
- // has no `fontSize` of its own.
42
- defaults: {
43
- fontSize: 'md',
44
- },
45
- });
@@ -1 +0,0 @@
1
- {"type":"commonjs"}