@pandacss/shared 0.0.0-dev-20230416210337 → 0.0.0-dev-20230417092402
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 +13 -7
- package/dist/index.mjs +13 -7
- package/dist/shared.js +5 -3
- package/dist/shared.mjs +5 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -74,7 +74,8 @@ function isCssVar(value) {
|
|
|
74
74
|
function getRef(operand) {
|
|
75
75
|
return isCssVar(operand) ? operand.ref : operand.toString();
|
|
76
76
|
}
|
|
77
|
-
var
|
|
77
|
+
var calcRegex = /calc/g;
|
|
78
|
+
var toExpression = (operator, ...operands) => operands.map(getRef).join(` ${operator} `).replace(calcRegex, "");
|
|
78
79
|
var multiply = (...operands) => `calc(${toExpression("*", ...operands)})`;
|
|
79
80
|
var calc = {
|
|
80
81
|
negate(x) {
|
|
@@ -88,7 +89,8 @@ var calc = {
|
|
|
88
89
|
|
|
89
90
|
// src/capitalize.ts
|
|
90
91
|
var capitalize = (s) => s.charAt(0).toUpperCase() + s.slice(1);
|
|
91
|
-
var
|
|
92
|
+
var camelCaseRegex = /([a-z])([A-Z])/g;
|
|
93
|
+
var dashCase = (s) => s.replace(camelCaseRegex, "$1-$2").toLowerCase();
|
|
92
94
|
var uncapitalize = (s) => s.charAt(0).toLowerCase() + s.slice(1);
|
|
93
95
|
|
|
94
96
|
// src/compact.ts
|
|
@@ -103,11 +105,12 @@ function filterBaseConditions(c) {
|
|
|
103
105
|
}
|
|
104
106
|
|
|
105
107
|
// src/css-important.ts
|
|
108
|
+
var importantRegex = /!(important)?$/;
|
|
106
109
|
function isImportant(value) {
|
|
107
|
-
return typeof value === "string" ?
|
|
110
|
+
return typeof value === "string" ? importantRegex.test(value) : false;
|
|
108
111
|
}
|
|
109
112
|
function withoutImportant(value) {
|
|
110
|
-
return typeof value === "string" ? value.replace(
|
|
113
|
+
return typeof value === "string" ? value.replace(importantRegex, "").trim() : value;
|
|
111
114
|
}
|
|
112
115
|
function withoutSpace(str) {
|
|
113
116
|
return typeof str === "string" ? str.replaceAll(" ", "_") : str;
|
|
@@ -323,11 +326,13 @@ function toRem(value = "") {
|
|
|
323
326
|
}
|
|
324
327
|
|
|
325
328
|
// src/css-var.ts
|
|
329
|
+
var escRegex = /[.*+?^${}()|[\]\\]/g;
|
|
326
330
|
function esc(string) {
|
|
327
|
-
return string.replace(
|
|
331
|
+
return string.replace(escRegex, "\\$&");
|
|
328
332
|
}
|
|
333
|
+
var dashCaseRegex = /[A-Z]/g;
|
|
329
334
|
function dashCase2(string) {
|
|
330
|
-
return string.replace(
|
|
335
|
+
return string.replace(dashCaseRegex, (match) => `-${match.toLowerCase()}`);
|
|
331
336
|
}
|
|
332
337
|
function cssVar(name, options = {}) {
|
|
333
338
|
const { fallback = "", prefix = "" } = options;
|
|
@@ -378,10 +383,11 @@ var memo = (fn) => {
|
|
|
378
383
|
};
|
|
379
384
|
|
|
380
385
|
// src/hypenate.ts
|
|
386
|
+
var dashCaseRegex2 = /[A-Z]/g;
|
|
381
387
|
var hypenateProperty = memo((property) => {
|
|
382
388
|
if (property.startsWith("--"))
|
|
383
389
|
return property;
|
|
384
|
-
return property.replace(
|
|
390
|
+
return property.replace(dashCaseRegex2, (match) => `-${match.toLowerCase()}`);
|
|
385
391
|
});
|
|
386
392
|
|
|
387
393
|
// src/split.ts
|
package/dist/index.mjs
CHANGED
|
@@ -12,7 +12,8 @@ function isCssVar(value) {
|
|
|
12
12
|
function getRef(operand) {
|
|
13
13
|
return isCssVar(operand) ? operand.ref : operand.toString();
|
|
14
14
|
}
|
|
15
|
-
var
|
|
15
|
+
var calcRegex = /calc/g;
|
|
16
|
+
var toExpression = (operator, ...operands) => operands.map(getRef).join(` ${operator} `).replace(calcRegex, "");
|
|
16
17
|
var multiply = (...operands) => `calc(${toExpression("*", ...operands)})`;
|
|
17
18
|
var calc = {
|
|
18
19
|
negate(x) {
|
|
@@ -26,7 +27,8 @@ var calc = {
|
|
|
26
27
|
|
|
27
28
|
// src/capitalize.ts
|
|
28
29
|
var capitalize = (s) => s.charAt(0).toUpperCase() + s.slice(1);
|
|
29
|
-
var
|
|
30
|
+
var camelCaseRegex = /([a-z])([A-Z])/g;
|
|
31
|
+
var dashCase = (s) => s.replace(camelCaseRegex, "$1-$2").toLowerCase();
|
|
30
32
|
var uncapitalize = (s) => s.charAt(0).toLowerCase() + s.slice(1);
|
|
31
33
|
|
|
32
34
|
// src/compact.ts
|
|
@@ -41,11 +43,12 @@ function filterBaseConditions(c) {
|
|
|
41
43
|
}
|
|
42
44
|
|
|
43
45
|
// src/css-important.ts
|
|
46
|
+
var importantRegex = /!(important)?$/;
|
|
44
47
|
function isImportant(value) {
|
|
45
|
-
return typeof value === "string" ?
|
|
48
|
+
return typeof value === "string" ? importantRegex.test(value) : false;
|
|
46
49
|
}
|
|
47
50
|
function withoutImportant(value) {
|
|
48
|
-
return typeof value === "string" ? value.replace(
|
|
51
|
+
return typeof value === "string" ? value.replace(importantRegex, "").trim() : value;
|
|
49
52
|
}
|
|
50
53
|
function withoutSpace(str) {
|
|
51
54
|
return typeof str === "string" ? str.replaceAll(" ", "_") : str;
|
|
@@ -261,11 +264,13 @@ function toRem(value = "") {
|
|
|
261
264
|
}
|
|
262
265
|
|
|
263
266
|
// src/css-var.ts
|
|
267
|
+
var escRegex = /[.*+?^${}()|[\]\\]/g;
|
|
264
268
|
function esc(string) {
|
|
265
|
-
return string.replace(
|
|
269
|
+
return string.replace(escRegex, "\\$&");
|
|
266
270
|
}
|
|
271
|
+
var dashCaseRegex = /[A-Z]/g;
|
|
267
272
|
function dashCase2(string) {
|
|
268
|
-
return string.replace(
|
|
273
|
+
return string.replace(dashCaseRegex, (match) => `-${match.toLowerCase()}`);
|
|
269
274
|
}
|
|
270
275
|
function cssVar(name, options = {}) {
|
|
271
276
|
const { fallback = "", prefix = "" } = options;
|
|
@@ -316,10 +321,11 @@ var memo = (fn) => {
|
|
|
316
321
|
};
|
|
317
322
|
|
|
318
323
|
// src/hypenate.ts
|
|
324
|
+
var dashCaseRegex2 = /[A-Z]/g;
|
|
319
325
|
var hypenateProperty = memo((property) => {
|
|
320
326
|
if (property.startsWith("--"))
|
|
321
327
|
return property;
|
|
322
|
-
return property.replace(
|
|
328
|
+
return property.replace(dashCaseRegex2, (match) => `-${match.toLowerCase()}`);
|
|
323
329
|
});
|
|
324
330
|
|
|
325
331
|
// src/split.ts
|
package/dist/shared.js
CHANGED
|
@@ -54,11 +54,12 @@ function filterBaseConditions(c) {
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
// src/css-important.ts
|
|
57
|
+
var importantRegex = /!(important)?$/;
|
|
57
58
|
function isImportant(value) {
|
|
58
|
-
return typeof value === "string" ?
|
|
59
|
+
return typeof value === "string" ? importantRegex.test(value) : false;
|
|
59
60
|
}
|
|
60
61
|
function withoutImportant(value) {
|
|
61
|
-
return typeof value === "string" ? value.replace(
|
|
62
|
+
return typeof value === "string" ? value.replace(importantRegex, "").trim() : value;
|
|
62
63
|
}
|
|
63
64
|
function withoutSpace(str) {
|
|
64
65
|
return typeof str === "string" ? str.replaceAll(" ", "_") : str;
|
|
@@ -264,10 +265,11 @@ var memo = (fn) => {
|
|
|
264
265
|
};
|
|
265
266
|
|
|
266
267
|
// src/hypenate.ts
|
|
268
|
+
var dashCaseRegex = /[A-Z]/g;
|
|
267
269
|
var hypenateProperty = memo((property) => {
|
|
268
270
|
if (property.startsWith("--"))
|
|
269
271
|
return property;
|
|
270
|
-
return property.replace(
|
|
272
|
+
return property.replace(dashCaseRegex, (match) => `-${match.toLowerCase()}`);
|
|
271
273
|
});
|
|
272
274
|
// Annotate the CommonJS export names for ESM import in node:
|
|
273
275
|
0 && (module.exports = {
|
package/dist/shared.mjs
CHANGED
|
@@ -15,11 +15,12 @@ function filterBaseConditions(c) {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
// src/css-important.ts
|
|
18
|
+
var importantRegex = /!(important)?$/;
|
|
18
19
|
function isImportant(value) {
|
|
19
|
-
return typeof value === "string" ?
|
|
20
|
+
return typeof value === "string" ? importantRegex.test(value) : false;
|
|
20
21
|
}
|
|
21
22
|
function withoutImportant(value) {
|
|
22
|
-
return typeof value === "string" ? value.replace(
|
|
23
|
+
return typeof value === "string" ? value.replace(importantRegex, "").trim() : value;
|
|
23
24
|
}
|
|
24
25
|
function withoutSpace(str) {
|
|
25
26
|
return typeof str === "string" ? str.replaceAll(" ", "_") : str;
|
|
@@ -225,10 +226,11 @@ var memo = (fn) => {
|
|
|
225
226
|
};
|
|
226
227
|
|
|
227
228
|
// src/hypenate.ts
|
|
229
|
+
var dashCaseRegex = /[A-Z]/g;
|
|
228
230
|
var hypenateProperty = memo((property) => {
|
|
229
231
|
if (property.startsWith("--"))
|
|
230
232
|
return property;
|
|
231
|
-
return property.replace(
|
|
233
|
+
return property.replace(dashCaseRegex, (match) => `-${match.toLowerCase()}`);
|
|
232
234
|
});
|
|
233
235
|
export {
|
|
234
236
|
compact,
|