@pandacss/node 0.0.0-dev-20221218093122 → 0.0.0-dev-20221218210650
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.d.ts +21 -4
- package/dist/index.js +45 -2
- package/dist/index.mjs +46 -2
- package/package.json +11 -11
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ import * as _pandacss_core from '@pandacss/core';
|
|
|
2
2
|
import { StylesheetContext, Conditions, Utility } from '@pandacss/core';
|
|
3
3
|
export { discardDuplicate } from '@pandacss/core';
|
|
4
4
|
import * as _pandacss_types_dist_composition from '@pandacss/types/dist/composition';
|
|
5
|
-
import * as _pandacss_types_dist_static_css from '@pandacss/types/dist/static-css';
|
|
6
5
|
import * as _pandacss_types_dist_recipe from '@pandacss/types/dist/recipe';
|
|
7
6
|
import * as _pandacss_types_dist_system_types from '@pandacss/types/dist/system-types';
|
|
8
7
|
import * as ts_morph from 'ts-morph';
|
|
@@ -89,6 +88,7 @@ declare function createContext(conf: LoadConfigResult, io?: IO): {
|
|
|
89
88
|
file: string;
|
|
90
89
|
} | undefined;
|
|
91
90
|
getGlobalCss: () => string | undefined;
|
|
91
|
+
getStaticCss: () => string | undefined;
|
|
92
92
|
patterns: Record<string, PatternConfig>;
|
|
93
93
|
hasPatterns: boolean;
|
|
94
94
|
getPattern: (name: string) => PatternConfig | undefined;
|
|
@@ -103,6 +103,11 @@ declare function createContext(conf: LoadConfigResult, io?: IO): {
|
|
|
103
103
|
recipes: Record<string, RecipeConfig<_pandacss_types_dist_recipe.TVariants>>;
|
|
104
104
|
getRecipe: (name: string) => RecipeConfig | undefined;
|
|
105
105
|
hasRecipes: boolean;
|
|
106
|
+
getRecipeDetails: () => {
|
|
107
|
+
[x: string]: {
|
|
108
|
+
[x: string]: string[];
|
|
109
|
+
}[];
|
|
110
|
+
}[];
|
|
106
111
|
jsxFramework: "solid" | "react" | "preact" | undefined;
|
|
107
112
|
jsxFactory: string;
|
|
108
113
|
cssVarRoot: string;
|
|
@@ -117,7 +122,7 @@ declare function createContext(conf: LoadConfigResult, io?: IO): {
|
|
|
117
122
|
hash?: boolean | undefined;
|
|
118
123
|
semanticTokens?: _pandacss_types.SemanticTokens<string> | undefined;
|
|
119
124
|
separator?: "-" | "_" | "=" | undefined;
|
|
120
|
-
static?:
|
|
125
|
+
static?: _pandacss_types.StaticCssOptions | undefined;
|
|
121
126
|
breakpoints?: Dict<any> | undefined;
|
|
122
127
|
keyframes?: _pandacss_types.CssKeyframes | undefined;
|
|
123
128
|
minify?: boolean | undefined;
|
|
@@ -213,6 +218,7 @@ declare class Builder {
|
|
|
213
218
|
file: string;
|
|
214
219
|
} | undefined;
|
|
215
220
|
getGlobalCss: () => string | undefined;
|
|
221
|
+
getStaticCss: () => string | undefined;
|
|
216
222
|
patterns: Record<string, _pandacss_types.PatternConfig>;
|
|
217
223
|
hasPatterns: boolean;
|
|
218
224
|
getPattern: (name: string) => _pandacss_types.PatternConfig | undefined;
|
|
@@ -227,6 +233,11 @@ declare class Builder {
|
|
|
227
233
|
recipes: Record<string, _pandacss_types.RecipeConfig<_pandacss_types_dist_recipe.TVariants>>;
|
|
228
234
|
getRecipe: (name: string) => _pandacss_types.RecipeConfig<_pandacss_types_dist_recipe.TVariants> | undefined;
|
|
229
235
|
hasRecipes: boolean;
|
|
236
|
+
getRecipeDetails: () => {
|
|
237
|
+
[x: string]: {
|
|
238
|
+
[x: string]: string[];
|
|
239
|
+
}[];
|
|
240
|
+
}[];
|
|
230
241
|
jsxFramework: "solid" | "react" | "preact" | undefined;
|
|
231
242
|
jsxFactory: string;
|
|
232
243
|
cssVarRoot: string;
|
|
@@ -241,7 +252,7 @@ declare class Builder {
|
|
|
241
252
|
hash?: boolean | undefined;
|
|
242
253
|
semanticTokens?: _pandacss_types.SemanticTokens<string> | undefined;
|
|
243
254
|
separator?: "-" | "_" | "=" | undefined;
|
|
244
|
-
static?:
|
|
255
|
+
static?: _pandacss_types.StaticCssOptions | undefined;
|
|
245
256
|
breakpoints?: _pandacss_types.Dict<any> | undefined;
|
|
246
257
|
keyframes?: _pandacss_types.CssKeyframes | undefined;
|
|
247
258
|
minify?: boolean | undefined;
|
|
@@ -329,6 +340,7 @@ declare function loadConfigAndCreateContext(options?: {
|
|
|
329
340
|
file: string;
|
|
330
341
|
} | undefined;
|
|
331
342
|
getGlobalCss: () => string | undefined;
|
|
343
|
+
getStaticCss: () => string | undefined;
|
|
332
344
|
patterns: Record<string, _pandacss_types.PatternConfig>;
|
|
333
345
|
hasPatterns: boolean;
|
|
334
346
|
getPattern: (name: string) => _pandacss_types.PatternConfig | undefined;
|
|
@@ -343,6 +355,11 @@ declare function loadConfigAndCreateContext(options?: {
|
|
|
343
355
|
recipes: Record<string, _pandacss_types.RecipeConfig<_pandacss_types_dist_recipe.TVariants>>;
|
|
344
356
|
getRecipe: (name: string) => _pandacss_types.RecipeConfig<_pandacss_types_dist_recipe.TVariants> | undefined;
|
|
345
357
|
hasRecipes: boolean;
|
|
358
|
+
getRecipeDetails: () => {
|
|
359
|
+
[x: string]: {
|
|
360
|
+
[x: string]: string[];
|
|
361
|
+
}[];
|
|
362
|
+
}[];
|
|
346
363
|
jsxFramework: "solid" | "react" | "preact" | undefined;
|
|
347
364
|
jsxFactory: string;
|
|
348
365
|
cssVarRoot: string;
|
|
@@ -357,7 +374,7 @@ declare function loadConfigAndCreateContext(options?: {
|
|
|
357
374
|
hash?: boolean | undefined;
|
|
358
375
|
semanticTokens?: _pandacss_types.SemanticTokens<string> | undefined;
|
|
359
376
|
separator?: "-" | "_" | "=" | undefined;
|
|
360
|
-
static?:
|
|
377
|
+
static?: _pandacss_types.StaticCssOptions | undefined;
|
|
361
378
|
breakpoints?: _pandacss_types.Dict<any> | undefined;
|
|
362
379
|
keyframes?: _pandacss_types.CssKeyframes | undefined;
|
|
363
380
|
minify?: boolean | undefined;
|
package/dist/index.js
CHANGED
|
@@ -85,7 +85,13 @@ function extractGlobalCss(ctx) {
|
|
|
85
85
|
const css2 = ctx.getGlobalCss();
|
|
86
86
|
if (!css2)
|
|
87
87
|
return;
|
|
88
|
-
return ctx.chunks.write("
|
|
88
|
+
return ctx.chunks.write("system/global.css", css2);
|
|
89
|
+
}
|
|
90
|
+
function extractStaticCss(ctx) {
|
|
91
|
+
const css2 = ctx.getStaticCss();
|
|
92
|
+
if (!css2)
|
|
93
|
+
return;
|
|
94
|
+
return ctx.chunks.write("system/static.css", css2);
|
|
89
95
|
}
|
|
90
96
|
|
|
91
97
|
// src/chunks.ts
|
|
@@ -1574,6 +1580,7 @@ async function emitArtifacts(ctx) {
|
|
|
1574
1580
|
async function emitAndExtract(ctx) {
|
|
1575
1581
|
await emitArtifacts(ctx);
|
|
1576
1582
|
await extractGlobalCss(ctx);
|
|
1583
|
+
await extractStaticCss(ctx);
|
|
1577
1584
|
await extractFiles(ctx);
|
|
1578
1585
|
await bundleChunks(ctx);
|
|
1579
1586
|
}
|
|
@@ -1657,7 +1664,8 @@ function createContext(conf, io = fileSystem) {
|
|
|
1657
1664
|
jsxFactory = "panda",
|
|
1658
1665
|
jsxFramework,
|
|
1659
1666
|
globalCss,
|
|
1660
|
-
separator
|
|
1667
|
+
separator,
|
|
1668
|
+
static: staticCss
|
|
1661
1669
|
} = config;
|
|
1662
1670
|
const cwd = (0, import_path2.resolve)(cwdProp);
|
|
1663
1671
|
const exclude = [".git", "node_modules", "test-results"].concat(excludeProp);
|
|
@@ -1727,6 +1735,13 @@ function createContext(conf, io = fileSystem) {
|
|
|
1727
1735
|
return [{}, props];
|
|
1728
1736
|
return splitProps(props, recipe.props);
|
|
1729
1737
|
}
|
|
1738
|
+
function getRecipeDetails() {
|
|
1739
|
+
return Object.entries(recipes).map(([name, recipe]) => ({
|
|
1740
|
+
[name]: Object.entries(recipe.variants ?? {}).map(([key, value]) => ({
|
|
1741
|
+
[key]: Object.keys(value)
|
|
1742
|
+
}))
|
|
1743
|
+
}));
|
|
1744
|
+
}
|
|
1730
1745
|
const hasRecipes = Object.keys(recipes).length > 0;
|
|
1731
1746
|
const properties = Array.from(/* @__PURE__ */ new Set(["css", ...utility.keys(), ...conditions.keys()]));
|
|
1732
1747
|
function isCustomCssProperty(prop) {
|
|
@@ -1862,6 +1877,32 @@ function createContext(conf, io = fileSystem) {
|
|
|
1862
1877
|
sheet.processGlobalCss(globalCss);
|
|
1863
1878
|
return sheet.toCss();
|
|
1864
1879
|
}
|
|
1880
|
+
function getStaticCss() {
|
|
1881
|
+
if (!staticCss)
|
|
1882
|
+
return;
|
|
1883
|
+
const sheet = new import_core3.Stylesheet(context());
|
|
1884
|
+
const recipes2 = getRecipeDetails();
|
|
1885
|
+
const getResults = (0, import_core3.getStaticCss)(staticCss);
|
|
1886
|
+
const results = getResults({
|
|
1887
|
+
breakpoints: Object.keys(breakpoints ?? {}),
|
|
1888
|
+
getPropertyKeys: utility.getPropertyKeys,
|
|
1889
|
+
getRecipeKeys(recipe) {
|
|
1890
|
+
return recipes2[recipe];
|
|
1891
|
+
}
|
|
1892
|
+
});
|
|
1893
|
+
results.css.forEach((css2) => {
|
|
1894
|
+
sheet.processAtomic(css2);
|
|
1895
|
+
});
|
|
1896
|
+
results.recipes.forEach((result) => {
|
|
1897
|
+
Object.entries(result).forEach(([key, value]) => {
|
|
1898
|
+
const recipe = getRecipe(key);
|
|
1899
|
+
if (!recipe)
|
|
1900
|
+
return;
|
|
1901
|
+
sheet.processRecipe(recipe, value);
|
|
1902
|
+
});
|
|
1903
|
+
});
|
|
1904
|
+
return sheet.toCss();
|
|
1905
|
+
}
|
|
1865
1906
|
function getCss(collector, file) {
|
|
1866
1907
|
const sheet = new import_core3.Stylesheet(context());
|
|
1867
1908
|
collector.globalCss.forEach((result) => {
|
|
@@ -1951,6 +1992,7 @@ function createContext(conf, io = fileSystem) {
|
|
|
1951
1992
|
utility,
|
|
1952
1993
|
getCss,
|
|
1953
1994
|
getGlobalCss,
|
|
1995
|
+
getStaticCss,
|
|
1954
1996
|
patterns,
|
|
1955
1997
|
hasPatterns,
|
|
1956
1998
|
getPattern,
|
|
@@ -1960,6 +2002,7 @@ function createContext(conf, io = fileSystem) {
|
|
|
1960
2002
|
recipes,
|
|
1961
2003
|
getRecipe,
|
|
1962
2004
|
hasRecipes,
|
|
2005
|
+
getRecipeDetails,
|
|
1963
2006
|
jsxFramework,
|
|
1964
2007
|
jsxFactory,
|
|
1965
2008
|
cssVarRoot,
|
package/dist/index.mjs
CHANGED
|
@@ -39,7 +39,13 @@ function extractGlobalCss(ctx) {
|
|
|
39
39
|
const css2 = ctx.getGlobalCss();
|
|
40
40
|
if (!css2)
|
|
41
41
|
return;
|
|
42
|
-
return ctx.chunks.write("
|
|
42
|
+
return ctx.chunks.write("system/global.css", css2);
|
|
43
|
+
}
|
|
44
|
+
function extractStaticCss(ctx) {
|
|
45
|
+
const css2 = ctx.getStaticCss();
|
|
46
|
+
if (!css2)
|
|
47
|
+
return;
|
|
48
|
+
return ctx.chunks.write("system/static.css", css2);
|
|
43
49
|
}
|
|
44
50
|
|
|
45
51
|
// src/chunks.ts
|
|
@@ -1528,6 +1534,7 @@ async function emitArtifacts(ctx) {
|
|
|
1528
1534
|
async function emitAndExtract(ctx) {
|
|
1529
1535
|
await emitArtifacts(ctx);
|
|
1530
1536
|
await extractGlobalCss(ctx);
|
|
1537
|
+
await extractStaticCss(ctx);
|
|
1531
1538
|
await extractFiles(ctx);
|
|
1532
1539
|
await bundleChunks(ctx);
|
|
1533
1540
|
}
|
|
@@ -1554,6 +1561,7 @@ import {
|
|
|
1554
1561
|
assignCompositions,
|
|
1555
1562
|
Conditions,
|
|
1556
1563
|
discardDuplicate,
|
|
1564
|
+
getStaticCss as getStaticCssCore,
|
|
1557
1565
|
Stylesheet as Stylesheet2,
|
|
1558
1566
|
Utility
|
|
1559
1567
|
} from "@pandacss/core";
|
|
@@ -1617,7 +1625,8 @@ function createContext(conf, io = fileSystem) {
|
|
|
1617
1625
|
jsxFactory = "panda",
|
|
1618
1626
|
jsxFramework,
|
|
1619
1627
|
globalCss,
|
|
1620
|
-
separator
|
|
1628
|
+
separator,
|
|
1629
|
+
static: staticCss
|
|
1621
1630
|
} = config;
|
|
1622
1631
|
const cwd = resolve(cwdProp);
|
|
1623
1632
|
const exclude = [".git", "node_modules", "test-results"].concat(excludeProp);
|
|
@@ -1687,6 +1696,13 @@ function createContext(conf, io = fileSystem) {
|
|
|
1687
1696
|
return [{}, props];
|
|
1688
1697
|
return splitProps(props, recipe.props);
|
|
1689
1698
|
}
|
|
1699
|
+
function getRecipeDetails() {
|
|
1700
|
+
return Object.entries(recipes).map(([name, recipe]) => ({
|
|
1701
|
+
[name]: Object.entries(recipe.variants ?? {}).map(([key, value]) => ({
|
|
1702
|
+
[key]: Object.keys(value)
|
|
1703
|
+
}))
|
|
1704
|
+
}));
|
|
1705
|
+
}
|
|
1690
1706
|
const hasRecipes = Object.keys(recipes).length > 0;
|
|
1691
1707
|
const properties = Array.from(/* @__PURE__ */ new Set(["css", ...utility.keys(), ...conditions.keys()]));
|
|
1692
1708
|
function isCustomCssProperty(prop) {
|
|
@@ -1822,6 +1838,32 @@ function createContext(conf, io = fileSystem) {
|
|
|
1822
1838
|
sheet.processGlobalCss(globalCss);
|
|
1823
1839
|
return sheet.toCss();
|
|
1824
1840
|
}
|
|
1841
|
+
function getStaticCss() {
|
|
1842
|
+
if (!staticCss)
|
|
1843
|
+
return;
|
|
1844
|
+
const sheet = new Stylesheet2(context());
|
|
1845
|
+
const recipes2 = getRecipeDetails();
|
|
1846
|
+
const getResults = getStaticCssCore(staticCss);
|
|
1847
|
+
const results = getResults({
|
|
1848
|
+
breakpoints: Object.keys(breakpoints ?? {}),
|
|
1849
|
+
getPropertyKeys: utility.getPropertyKeys,
|
|
1850
|
+
getRecipeKeys(recipe) {
|
|
1851
|
+
return recipes2[recipe];
|
|
1852
|
+
}
|
|
1853
|
+
});
|
|
1854
|
+
results.css.forEach((css2) => {
|
|
1855
|
+
sheet.processAtomic(css2);
|
|
1856
|
+
});
|
|
1857
|
+
results.recipes.forEach((result) => {
|
|
1858
|
+
Object.entries(result).forEach(([key, value]) => {
|
|
1859
|
+
const recipe = getRecipe(key);
|
|
1860
|
+
if (!recipe)
|
|
1861
|
+
return;
|
|
1862
|
+
sheet.processRecipe(recipe, value);
|
|
1863
|
+
});
|
|
1864
|
+
});
|
|
1865
|
+
return sheet.toCss();
|
|
1866
|
+
}
|
|
1825
1867
|
function getCss(collector, file) {
|
|
1826
1868
|
const sheet = new Stylesheet2(context());
|
|
1827
1869
|
collector.globalCss.forEach((result) => {
|
|
@@ -1911,6 +1953,7 @@ function createContext(conf, io = fileSystem) {
|
|
|
1911
1953
|
utility,
|
|
1912
1954
|
getCss,
|
|
1913
1955
|
getGlobalCss,
|
|
1956
|
+
getStaticCss,
|
|
1914
1957
|
patterns,
|
|
1915
1958
|
hasPatterns,
|
|
1916
1959
|
getPattern,
|
|
@@ -1920,6 +1963,7 @@ function createContext(conf, io = fileSystem) {
|
|
|
1920
1963
|
recipes,
|
|
1921
1964
|
getRecipe,
|
|
1922
1965
|
hasRecipes,
|
|
1966
|
+
getRecipeDetails,
|
|
1923
1967
|
jsxFramework,
|
|
1924
1968
|
jsxFactory,
|
|
1925
1969
|
cssVarRoot,
|
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-20221218210650",
|
|
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-20221218210650",
|
|
34
|
+
"@pandacss/is-valid-prop": "0.0.0-dev-20221218210650",
|
|
35
|
+
"@pandacss/error": "0.0.0-dev-20221218210650",
|
|
36
|
+
"@pandacss/parser": "0.0.0-dev-20221218210650",
|
|
37
|
+
"@pandacss/shared": "0.0.0-dev-20221218210650",
|
|
38
|
+
"@pandacss/token-dictionary": "0.0.0-dev-20221218210650",
|
|
39
|
+
"@pandacss/logger": "0.0.0-dev-20221218210650",
|
|
40
|
+
"@pandacss/core": "0.0.0-dev-20221218210650",
|
|
41
|
+
"@pandacss/config": "0.0.0-dev-20221218210650"
|
|
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-20221218210650"
|
|
50
50
|
},
|
|
51
51
|
"scripts": {
|
|
52
52
|
"build": "tsup src/index.ts --format=cjs,esm --shims --dts",
|