@pandacss/node 0.0.0-dev-20221218120149 → 0.0.0-dev-20221219112004
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 +54 -3
- package/dist/index.mjs +55 -3
- 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,11 +1580,18 @@ 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
|
}
|
|
1580
1587
|
function getBaseCss(ctx) {
|
|
1581
|
-
const css2 = [
|
|
1588
|
+
const css2 = [
|
|
1589
|
+
generateReset(),
|
|
1590
|
+
generateTokenCss(ctx),
|
|
1591
|
+
generateKeyframes(ctx.keyframes),
|
|
1592
|
+
ctx.getGlobalCss(),
|
|
1593
|
+
ctx.getStaticCss()
|
|
1594
|
+
];
|
|
1582
1595
|
return css2.filter(Boolean).join("\n\n");
|
|
1583
1596
|
}
|
|
1584
1597
|
|
|
@@ -1657,7 +1670,8 @@ function createContext(conf, io = fileSystem) {
|
|
|
1657
1670
|
jsxFactory = "panda",
|
|
1658
1671
|
jsxFramework,
|
|
1659
1672
|
globalCss,
|
|
1660
|
-
separator
|
|
1673
|
+
separator,
|
|
1674
|
+
static: staticCss
|
|
1661
1675
|
} = config;
|
|
1662
1676
|
const cwd = (0, import_path2.resolve)(cwdProp);
|
|
1663
1677
|
const exclude = [".git", "node_modules", "test-results"].concat(excludeProp);
|
|
@@ -1727,6 +1741,13 @@ function createContext(conf, io = fileSystem) {
|
|
|
1727
1741
|
return [{}, props];
|
|
1728
1742
|
return splitProps(props, recipe.props);
|
|
1729
1743
|
}
|
|
1744
|
+
function getRecipeDetails() {
|
|
1745
|
+
return Object.entries(recipes).map(([name, recipe]) => ({
|
|
1746
|
+
[name]: Object.entries(recipe.variants ?? {}).map(([key, value]) => ({
|
|
1747
|
+
[key]: Object.keys(value)
|
|
1748
|
+
}))
|
|
1749
|
+
}));
|
|
1750
|
+
}
|
|
1730
1751
|
const hasRecipes = Object.keys(recipes).length > 0;
|
|
1731
1752
|
const properties = Array.from(/* @__PURE__ */ new Set(["css", ...utility.keys(), ...conditions.keys()]));
|
|
1732
1753
|
function isCustomCssProperty(prop) {
|
|
@@ -1803,6 +1824,8 @@ function createContext(conf, io = fileSystem) {
|
|
|
1803
1824
|
glob: [`${paths.chunk}/**/*.css`]
|
|
1804
1825
|
};
|
|
1805
1826
|
function getFiles() {
|
|
1827
|
+
if (!config.include)
|
|
1828
|
+
return [];
|
|
1806
1829
|
return import_fast_glob.default.sync(config.include, { cwd, ignore: config.exclude, absolute: true });
|
|
1807
1830
|
}
|
|
1808
1831
|
const files = getFiles();
|
|
@@ -1862,6 +1885,32 @@ function createContext(conf, io = fileSystem) {
|
|
|
1862
1885
|
sheet.processGlobalCss(globalCss);
|
|
1863
1886
|
return sheet.toCss();
|
|
1864
1887
|
}
|
|
1888
|
+
function getStaticCss() {
|
|
1889
|
+
if (!staticCss)
|
|
1890
|
+
return;
|
|
1891
|
+
const sheet = new import_core3.Stylesheet(context());
|
|
1892
|
+
const recipes2 = getRecipeDetails();
|
|
1893
|
+
const getResults = (0, import_core3.getStaticCss)(staticCss);
|
|
1894
|
+
const results = getResults({
|
|
1895
|
+
breakpoints: Object.keys(breakpoints ?? {}),
|
|
1896
|
+
getPropertyKeys: utility.getPropertyKeys,
|
|
1897
|
+
getRecipeKeys(recipe) {
|
|
1898
|
+
return recipes2[recipe];
|
|
1899
|
+
}
|
|
1900
|
+
});
|
|
1901
|
+
results.css.forEach((css2) => {
|
|
1902
|
+
sheet.processAtomic(css2);
|
|
1903
|
+
});
|
|
1904
|
+
results.recipes.forEach((result) => {
|
|
1905
|
+
Object.entries(result).forEach(([key, value]) => {
|
|
1906
|
+
const recipe = getRecipe(key);
|
|
1907
|
+
if (!recipe)
|
|
1908
|
+
return;
|
|
1909
|
+
sheet.processRecipe(recipe, value);
|
|
1910
|
+
});
|
|
1911
|
+
});
|
|
1912
|
+
return sheet.toCss();
|
|
1913
|
+
}
|
|
1865
1914
|
function getCss(collector, file) {
|
|
1866
1915
|
const sheet = new import_core3.Stylesheet(context());
|
|
1867
1916
|
collector.globalCss.forEach((result) => {
|
|
@@ -1951,6 +2000,7 @@ function createContext(conf, io = fileSystem) {
|
|
|
1951
2000
|
utility,
|
|
1952
2001
|
getCss,
|
|
1953
2002
|
getGlobalCss,
|
|
2003
|
+
getStaticCss,
|
|
1954
2004
|
patterns,
|
|
1955
2005
|
hasPatterns,
|
|
1956
2006
|
getPattern,
|
|
@@ -1960,6 +2010,7 @@ function createContext(conf, io = fileSystem) {
|
|
|
1960
2010
|
recipes,
|
|
1961
2011
|
getRecipe,
|
|
1962
2012
|
hasRecipes,
|
|
2013
|
+
getRecipeDetails,
|
|
1963
2014
|
jsxFramework,
|
|
1964
2015
|
jsxFactory,
|
|
1965
2016
|
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,11 +1534,18 @@ 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
|
}
|
|
1534
1541
|
function getBaseCss(ctx) {
|
|
1535
|
-
const css2 = [
|
|
1542
|
+
const css2 = [
|
|
1543
|
+
generateReset(),
|
|
1544
|
+
generateTokenCss(ctx),
|
|
1545
|
+
generateKeyframes(ctx.keyframes),
|
|
1546
|
+
ctx.getGlobalCss(),
|
|
1547
|
+
ctx.getStaticCss()
|
|
1548
|
+
];
|
|
1536
1549
|
return css2.filter(Boolean).join("\n\n");
|
|
1537
1550
|
}
|
|
1538
1551
|
|
|
@@ -1554,6 +1567,7 @@ import {
|
|
|
1554
1567
|
assignCompositions,
|
|
1555
1568
|
Conditions,
|
|
1556
1569
|
discardDuplicate,
|
|
1570
|
+
getStaticCss as getStaticCssCore,
|
|
1557
1571
|
Stylesheet as Stylesheet2,
|
|
1558
1572
|
Utility
|
|
1559
1573
|
} from "@pandacss/core";
|
|
@@ -1617,7 +1631,8 @@ function createContext(conf, io = fileSystem) {
|
|
|
1617
1631
|
jsxFactory = "panda",
|
|
1618
1632
|
jsxFramework,
|
|
1619
1633
|
globalCss,
|
|
1620
|
-
separator
|
|
1634
|
+
separator,
|
|
1635
|
+
static: staticCss
|
|
1621
1636
|
} = config;
|
|
1622
1637
|
const cwd = resolve(cwdProp);
|
|
1623
1638
|
const exclude = [".git", "node_modules", "test-results"].concat(excludeProp);
|
|
@@ -1687,6 +1702,13 @@ function createContext(conf, io = fileSystem) {
|
|
|
1687
1702
|
return [{}, props];
|
|
1688
1703
|
return splitProps(props, recipe.props);
|
|
1689
1704
|
}
|
|
1705
|
+
function getRecipeDetails() {
|
|
1706
|
+
return Object.entries(recipes).map(([name, recipe]) => ({
|
|
1707
|
+
[name]: Object.entries(recipe.variants ?? {}).map(([key, value]) => ({
|
|
1708
|
+
[key]: Object.keys(value)
|
|
1709
|
+
}))
|
|
1710
|
+
}));
|
|
1711
|
+
}
|
|
1690
1712
|
const hasRecipes = Object.keys(recipes).length > 0;
|
|
1691
1713
|
const properties = Array.from(/* @__PURE__ */ new Set(["css", ...utility.keys(), ...conditions.keys()]));
|
|
1692
1714
|
function isCustomCssProperty(prop) {
|
|
@@ -1763,6 +1785,8 @@ function createContext(conf, io = fileSystem) {
|
|
|
1763
1785
|
glob: [`${paths.chunk}/**/*.css`]
|
|
1764
1786
|
};
|
|
1765
1787
|
function getFiles() {
|
|
1788
|
+
if (!config.include)
|
|
1789
|
+
return [];
|
|
1766
1790
|
return glob.sync(config.include, { cwd, ignore: config.exclude, absolute: true });
|
|
1767
1791
|
}
|
|
1768
1792
|
const files = getFiles();
|
|
@@ -1822,6 +1846,32 @@ function createContext(conf, io = fileSystem) {
|
|
|
1822
1846
|
sheet.processGlobalCss(globalCss);
|
|
1823
1847
|
return sheet.toCss();
|
|
1824
1848
|
}
|
|
1849
|
+
function getStaticCss() {
|
|
1850
|
+
if (!staticCss)
|
|
1851
|
+
return;
|
|
1852
|
+
const sheet = new Stylesheet2(context());
|
|
1853
|
+
const recipes2 = getRecipeDetails();
|
|
1854
|
+
const getResults = getStaticCssCore(staticCss);
|
|
1855
|
+
const results = getResults({
|
|
1856
|
+
breakpoints: Object.keys(breakpoints ?? {}),
|
|
1857
|
+
getPropertyKeys: utility.getPropertyKeys,
|
|
1858
|
+
getRecipeKeys(recipe) {
|
|
1859
|
+
return recipes2[recipe];
|
|
1860
|
+
}
|
|
1861
|
+
});
|
|
1862
|
+
results.css.forEach((css2) => {
|
|
1863
|
+
sheet.processAtomic(css2);
|
|
1864
|
+
});
|
|
1865
|
+
results.recipes.forEach((result) => {
|
|
1866
|
+
Object.entries(result).forEach(([key, value]) => {
|
|
1867
|
+
const recipe = getRecipe(key);
|
|
1868
|
+
if (!recipe)
|
|
1869
|
+
return;
|
|
1870
|
+
sheet.processRecipe(recipe, value);
|
|
1871
|
+
});
|
|
1872
|
+
});
|
|
1873
|
+
return sheet.toCss();
|
|
1874
|
+
}
|
|
1825
1875
|
function getCss(collector, file) {
|
|
1826
1876
|
const sheet = new Stylesheet2(context());
|
|
1827
1877
|
collector.globalCss.forEach((result) => {
|
|
@@ -1911,6 +1961,7 @@ function createContext(conf, io = fileSystem) {
|
|
|
1911
1961
|
utility,
|
|
1912
1962
|
getCss,
|
|
1913
1963
|
getGlobalCss,
|
|
1964
|
+
getStaticCss,
|
|
1914
1965
|
patterns,
|
|
1915
1966
|
hasPatterns,
|
|
1916
1967
|
getPattern,
|
|
@@ -1920,6 +1971,7 @@ function createContext(conf, io = fileSystem) {
|
|
|
1920
1971
|
recipes,
|
|
1921
1972
|
getRecipe,
|
|
1922
1973
|
hasRecipes,
|
|
1974
|
+
getRecipeDetails,
|
|
1923
1975
|
jsxFramework,
|
|
1924
1976
|
jsxFactory,
|
|
1925
1977
|
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-20221219112004",
|
|
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-20221219112004",
|
|
34
|
+
"@pandacss/is-valid-prop": "0.0.0-dev-20221219112004",
|
|
35
|
+
"@pandacss/error": "0.0.0-dev-20221219112004",
|
|
36
|
+
"@pandacss/parser": "0.0.0-dev-20221219112004",
|
|
37
|
+
"@pandacss/shared": "0.0.0-dev-20221219112004",
|
|
38
|
+
"@pandacss/token-dictionary": "0.0.0-dev-20221219112004",
|
|
39
|
+
"@pandacss/logger": "0.0.0-dev-20221219112004",
|
|
40
|
+
"@pandacss/core": "0.0.0-dev-20221219112004",
|
|
41
|
+
"@pandacss/config": "0.0.0-dev-20221219112004"
|
|
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-20221219112004"
|
|
50
50
|
},
|
|
51
51
|
"scripts": {
|
|
52
52
|
"build": "tsup src/index.ts --format=cjs,esm --shims --dts",
|