@pandacss/node 0.0.0-dev-20230104133247 → 0.0.0-dev-20230104161128
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/dist/index.js +14 -13
- package/dist/index.mjs +14 -13
- package/package.json +11 -11
package/dist/index.js
CHANGED
|
@@ -1047,7 +1047,8 @@ var import_outdent19 = require("outdent");
|
|
|
1047
1047
|
function generatePropTypes(utility) {
|
|
1048
1048
|
const result = [
|
|
1049
1049
|
import_outdent19.outdent`
|
|
1050
|
-
import { Properties as CSSProperties } from
|
|
1050
|
+
import { Properties as CSSProperties } from './csstype'
|
|
1051
|
+
import { Tokens } from './token'
|
|
1051
1052
|
|
|
1052
1053
|
type BasePropTypes = {`
|
|
1053
1054
|
];
|
|
@@ -1057,9 +1058,9 @@ function generatePropTypes(utility) {
|
|
|
1057
1058
|
}
|
|
1058
1059
|
result.push("}", "\n");
|
|
1059
1060
|
result.push(`
|
|
1060
|
-
type CssProp<T> = T extends keyof CSSProperties ? CSSProperties[T] :
|
|
1061
|
+
type CssProp<T> = T extends keyof CSSProperties ? CSSProperties[T] : never
|
|
1061
1062
|
|
|
1062
|
-
type BaseProp<T> = T extends keyof BasePropTypes ? BasePropTypes[T] :
|
|
1063
|
+
type BaseProp<T> = T extends keyof BasePropTypes ? BasePropTypes[T] : never
|
|
1063
1064
|
|
|
1064
1065
|
type Shorthand<T> = CssProp<T> | BaseProp<T>
|
|
1065
1066
|
|
|
@@ -1317,19 +1318,19 @@ var import_pluralize = __toESM(require("pluralize"));
|
|
|
1317
1318
|
function generateTokenDts(dict) {
|
|
1318
1319
|
const set = /* @__PURE__ */ new Set();
|
|
1319
1320
|
set.add(`export type Token = ${dict.isEmpty ? "string" : (0, import_shared13.unionType)(dict.allNames)}`);
|
|
1320
|
-
const
|
|
1321
|
+
const result = /* @__PURE__ */ new Set(["export type Tokens = {"]);
|
|
1321
1322
|
if (dict.isEmpty) {
|
|
1322
|
-
|
|
1323
|
+
result.add("[token: string]: string");
|
|
1323
1324
|
} else {
|
|
1324
1325
|
for (const [key, value] of dict.categoryMap.entries()) {
|
|
1325
1326
|
const typeName = (0, import_shared13.capitalize)(import_pluralize.default.singular(key));
|
|
1326
1327
|
set.add(`export type ${typeName} = ${(0, import_shared13.unionType)(value.keys())}`);
|
|
1327
1328
|
set.add(`export type ColorPalette = ${(0, import_shared13.unionType)(Object.keys(dict.colorPalettes))}`);
|
|
1328
|
-
|
|
1329
|
+
result.add(` ${key}: ${typeName}`);
|
|
1329
1330
|
}
|
|
1330
1331
|
}
|
|
1331
|
-
|
|
1332
|
-
set.add(Array.from(
|
|
1332
|
+
result.add("} & { [token: string]: never }");
|
|
1333
|
+
set.add(Array.from(result).join("\n"));
|
|
1333
1334
|
return import_outdent22.outdent.string(Array.from(set).join("\n\n"));
|
|
1334
1335
|
}
|
|
1335
1336
|
|
|
@@ -1347,12 +1348,12 @@ function generateTokenJs(dict) {
|
|
|
1347
1348
|
js: import_outdent23.default`
|
|
1348
1349
|
const tokens = ${JSON.stringify(obj, null, 2)}
|
|
1349
1350
|
|
|
1350
|
-
function getToken(path) {
|
|
1351
|
+
export function getToken(path) {
|
|
1351
1352
|
const { value } = tokens[path] || {}
|
|
1352
1353
|
return value
|
|
1353
1354
|
}
|
|
1354
1355
|
|
|
1355
|
-
function getTokenVar(path) {
|
|
1356
|
+
export function getTokenVar(path) {
|
|
1356
1357
|
const { variable } = tokens[path] || {}
|
|
1357
1358
|
return variable
|
|
1358
1359
|
}
|
|
@@ -1383,9 +1384,9 @@ function generateCssType(ctx) {
|
|
|
1383
1384
|
import { PropTypes } from './prop-type'
|
|
1384
1385
|
import { Conditions } from './conditions'
|
|
1385
1386
|
|
|
1386
|
-
export type SystemStyleObject<Overrides = {}> = System.StyleObject<Conditions, PropTypes, ${strictArg}, Overrides>
|
|
1387
|
-
export type GlobalStyleObject<Overrides = {}> = System.GlobalStyleObject<Conditions, PropTypes, ${strictArg}, Overrides>
|
|
1388
|
-
export type JsxStyleProps<Overrides = {}> = System.JsxStyleProps<Conditions, PropTypes, ${strictArg}, Overrides>
|
|
1387
|
+
export type SystemStyleObject<Overrides extends Record<string, unknown> = {}> = System.StyleObject<Conditions, PropTypes, ${strictArg}, Overrides>
|
|
1388
|
+
export type GlobalStyleObject<Overrides extends Record<string, unknown> = {}> = System.GlobalStyleObject<Conditions, PropTypes, ${strictArg}, Overrides>
|
|
1389
|
+
export type JsxStyleProps<Overrides extends Record<string, unknown> = {}> = System.JsxStyleProps<Conditions, PropTypes, ${strictArg}, Overrides>
|
|
1389
1390
|
export type ConditionalValue<Value> = System.Conditional<Conditions, Value>
|
|
1390
1391
|
|
|
1391
1392
|
type DistributiveOmit<T, U> = T extends any ? Pick<T, Exclude<keyof T, U>> : never
|
package/dist/index.mjs
CHANGED
|
@@ -1001,7 +1001,8 @@ import { outdent as outdent19 } from "outdent";
|
|
|
1001
1001
|
function generatePropTypes(utility) {
|
|
1002
1002
|
const result = [
|
|
1003
1003
|
outdent19`
|
|
1004
|
-
import { Properties as CSSProperties } from
|
|
1004
|
+
import { Properties as CSSProperties } from './csstype'
|
|
1005
|
+
import { Tokens } from './token'
|
|
1005
1006
|
|
|
1006
1007
|
type BasePropTypes = {`
|
|
1007
1008
|
];
|
|
@@ -1011,9 +1012,9 @@ function generatePropTypes(utility) {
|
|
|
1011
1012
|
}
|
|
1012
1013
|
result.push("}", "\n");
|
|
1013
1014
|
result.push(`
|
|
1014
|
-
type CssProp<T> = T extends keyof CSSProperties ? CSSProperties[T] :
|
|
1015
|
+
type CssProp<T> = T extends keyof CSSProperties ? CSSProperties[T] : never
|
|
1015
1016
|
|
|
1016
|
-
type BaseProp<T> = T extends keyof BasePropTypes ? BasePropTypes[T] :
|
|
1017
|
+
type BaseProp<T> = T extends keyof BasePropTypes ? BasePropTypes[T] : never
|
|
1017
1018
|
|
|
1018
1019
|
type Shorthand<T> = CssProp<T> | BaseProp<T>
|
|
1019
1020
|
|
|
@@ -1271,19 +1272,19 @@ import pluralize from "pluralize";
|
|
|
1271
1272
|
function generateTokenDts(dict) {
|
|
1272
1273
|
const set = /* @__PURE__ */ new Set();
|
|
1273
1274
|
set.add(`export type Token = ${dict.isEmpty ? "string" : unionType4(dict.allNames)}`);
|
|
1274
|
-
const
|
|
1275
|
+
const result = /* @__PURE__ */ new Set(["export type Tokens = {"]);
|
|
1275
1276
|
if (dict.isEmpty) {
|
|
1276
|
-
|
|
1277
|
+
result.add("[token: string]: string");
|
|
1277
1278
|
} else {
|
|
1278
1279
|
for (const [key, value] of dict.categoryMap.entries()) {
|
|
1279
1280
|
const typeName = capitalize12(pluralize.singular(key));
|
|
1280
1281
|
set.add(`export type ${typeName} = ${unionType4(value.keys())}`);
|
|
1281
1282
|
set.add(`export type ColorPalette = ${unionType4(Object.keys(dict.colorPalettes))}`);
|
|
1282
|
-
|
|
1283
|
+
result.add(` ${key}: ${typeName}`);
|
|
1283
1284
|
}
|
|
1284
1285
|
}
|
|
1285
|
-
|
|
1286
|
-
set.add(Array.from(
|
|
1286
|
+
result.add("} & { [token: string]: never }");
|
|
1287
|
+
set.add(Array.from(result).join("\n"));
|
|
1287
1288
|
return outdent22.string(Array.from(set).join("\n\n"));
|
|
1288
1289
|
}
|
|
1289
1290
|
|
|
@@ -1301,12 +1302,12 @@ function generateTokenJs(dict) {
|
|
|
1301
1302
|
js: outdent23`
|
|
1302
1303
|
const tokens = ${JSON.stringify(obj, null, 2)}
|
|
1303
1304
|
|
|
1304
|
-
function getToken(path) {
|
|
1305
|
+
export function getToken(path) {
|
|
1305
1306
|
const { value } = tokens[path] || {}
|
|
1306
1307
|
return value
|
|
1307
1308
|
}
|
|
1308
1309
|
|
|
1309
|
-
function getTokenVar(path) {
|
|
1310
|
+
export function getTokenVar(path) {
|
|
1310
1311
|
const { variable } = tokens[path] || {}
|
|
1311
1312
|
return variable
|
|
1312
1313
|
}
|
|
@@ -1337,9 +1338,9 @@ function generateCssType(ctx) {
|
|
|
1337
1338
|
import { PropTypes } from './prop-type'
|
|
1338
1339
|
import { Conditions } from './conditions'
|
|
1339
1340
|
|
|
1340
|
-
export type SystemStyleObject<Overrides = {}> = System.StyleObject<Conditions, PropTypes, ${strictArg}, Overrides>
|
|
1341
|
-
export type GlobalStyleObject<Overrides = {}> = System.GlobalStyleObject<Conditions, PropTypes, ${strictArg}, Overrides>
|
|
1342
|
-
export type JsxStyleProps<Overrides = {}> = System.JsxStyleProps<Conditions, PropTypes, ${strictArg}, Overrides>
|
|
1341
|
+
export type SystemStyleObject<Overrides extends Record<string, unknown> = {}> = System.StyleObject<Conditions, PropTypes, ${strictArg}, Overrides>
|
|
1342
|
+
export type GlobalStyleObject<Overrides extends Record<string, unknown> = {}> = System.GlobalStyleObject<Conditions, PropTypes, ${strictArg}, Overrides>
|
|
1343
|
+
export type JsxStyleProps<Overrides extends Record<string, unknown> = {}> = System.JsxStyleProps<Conditions, PropTypes, ${strictArg}, Overrides>
|
|
1343
1344
|
export type ConditionalValue<Value> = System.Conditional<Conditions, Value>
|
|
1344
1345
|
|
|
1345
1346
|
type DistributiveOmit<T, U> = T extends any ? Pick<T, Exclude<keyof T, U>> : never
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pandacss/node",
|
|
3
|
-
"version": "0.0.0-dev-
|
|
3
|
+
"version": "0.0.0-dev-20230104161128",
|
|
4
4
|
"description": "The core css panda library",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -30,15 +30,15 @@
|
|
|
30
30
|
"telejson": "7.0.4",
|
|
31
31
|
"ts-pattern": "4.0.6",
|
|
32
32
|
"ts-morph": "17.0.1",
|
|
33
|
-
"@pandacss/types": "0.0.0-dev-
|
|
34
|
-
"@pandacss/is-valid-prop": "0.0.0-dev-
|
|
35
|
-
"@pandacss/error": "0.0.0-dev-
|
|
36
|
-
"@pandacss/parser": "0.0.0-dev-
|
|
37
|
-
"@pandacss/shared": "0.0.0-dev-
|
|
38
|
-
"@pandacss/token-dictionary": "0.0.0-dev-
|
|
39
|
-
"@pandacss/logger": "0.0.0-dev-
|
|
40
|
-
"@pandacss/core": "0.0.0-dev-
|
|
41
|
-
"@pandacss/config": "0.0.0-dev-
|
|
33
|
+
"@pandacss/types": "0.0.0-dev-20230104161128",
|
|
34
|
+
"@pandacss/is-valid-prop": "0.0.0-dev-20230104161128",
|
|
35
|
+
"@pandacss/error": "0.0.0-dev-20230104161128",
|
|
36
|
+
"@pandacss/parser": "0.0.0-dev-20230104161128",
|
|
37
|
+
"@pandacss/shared": "0.0.0-dev-20230104161128",
|
|
38
|
+
"@pandacss/token-dictionary": "0.0.0-dev-20230104161128",
|
|
39
|
+
"@pandacss/logger": "0.0.0-dev-20230104161128",
|
|
40
|
+
"@pandacss/core": "0.0.0-dev-20230104161128",
|
|
41
|
+
"@pandacss/config": "0.0.0-dev-20230104161128"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@types/fs-extra": "9.0.13",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@types/glob-parent": "^5.1.1",
|
|
47
47
|
"@types/pluralize": "0.0.29",
|
|
48
48
|
"@types/lodash.merge": "4.6.7",
|
|
49
|
-
"@pandacss/fixture": "0.0.0-dev-
|
|
49
|
+
"@pandacss/fixture": "0.0.0-dev-20230104161128"
|
|
50
50
|
},
|
|
51
51
|
"scripts": {
|
|
52
52
|
"build": "tsup src/index.ts --format=cjs,esm --shims --dts",
|