@pandacss/generator 0.0.0-dev-20230511092049 → 0.0.0-dev-20230511140820
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 +11 -15
- package/dist/index.mjs +11 -15
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -626,7 +626,7 @@ function generatePattern(ctx) {
|
|
|
626
626
|
import type { SystemStyleObject, ConditionalValue } from '../types'
|
|
627
627
|
import type { PropertyValue } from '../types/prop-type'
|
|
628
628
|
import type { Properties } from '../types/csstype'
|
|
629
|
-
import type { Tokens } from '../
|
|
629
|
+
import type { Tokens } from '../tokens'
|
|
630
630
|
|
|
631
631
|
export type ${upperName}Properties = {
|
|
632
632
|
${Object.keys(properties ?? {}).map((key) => {
|
|
@@ -801,12 +801,14 @@ function generateTokenJs(ctx) {
|
|
|
801
801
|
token.var = tokenVar
|
|
802
802
|
`,
|
|
803
803
|
dts: import_outdent9.default`
|
|
804
|
-
import type { Token } from '
|
|
804
|
+
import type { Token } from './tokens'
|
|
805
805
|
|
|
806
806
|
export declare const token: {
|
|
807
807
|
(path: Token, fallback?: string): string
|
|
808
808
|
var: (path: Token, fallback?: string) => string
|
|
809
809
|
}
|
|
810
|
+
|
|
811
|
+
export * from './tokens'
|
|
810
812
|
`
|
|
811
813
|
};
|
|
812
814
|
}
|
|
@@ -1625,7 +1627,7 @@ function generatePropTypes(ctx) {
|
|
|
1625
1627
|
import_outdent22.outdent`
|
|
1626
1628
|
import type { ConditionalValue } from './conditions';
|
|
1627
1629
|
import type { CssProperties } from './system-types'
|
|
1628
|
-
import type { Tokens } from '
|
|
1630
|
+
import type { Tokens } from '../tokens'
|
|
1629
1631
|
|
|
1630
1632
|
type PropertyValueTypes = {`
|
|
1631
1633
|
];
|
|
@@ -1664,7 +1666,7 @@ function generateStyleProps(ctx) {
|
|
|
1664
1666
|
return import_outdent23.default`
|
|
1665
1667
|
import { ConditionalValue } from './conditions'
|
|
1666
1668
|
import { PropertyValue } from './prop-type'
|
|
1667
|
-
import { Token } from '
|
|
1669
|
+
import { Token } from '../tokens'
|
|
1668
1670
|
|
|
1669
1671
|
export type CssVarProperties = {
|
|
1670
1672
|
[key in \`--\${string}\`]?: ConditionalValue<Token | (string & {}) | (number & {})>
|
|
@@ -1712,9 +1714,9 @@ function generateTokenTypes(ctx) {
|
|
|
1712
1714
|
} else {
|
|
1713
1715
|
for (const [key, value] of tokens.categoryMap.entries()) {
|
|
1714
1716
|
const typeName = (0, import_shared3.capitalize)(import_pluralize.default.singular(key));
|
|
1715
|
-
set.add(`export type ${typeName} = ${(0, import_shared3.unionType)(value.keys())}`);
|
|
1717
|
+
set.add(`export type ${typeName}Token = ${(0, import_shared3.unionType)(value.keys())}`);
|
|
1716
1718
|
set.add(`export type ColorPalette = ${(0, import_shared3.unionType)(Object.keys(tokens.colorPalettes))}`);
|
|
1717
|
-
result.add(` ${key}: ${typeName}`);
|
|
1719
|
+
result.add(` ${key}: ${typeName}Token`);
|
|
1718
1720
|
}
|
|
1719
1721
|
}
|
|
1720
1722
|
result.add("} & { [token: string]: never }");
|
|
@@ -1816,7 +1818,8 @@ function setupDesignTokens(ctx) {
|
|
|
1816
1818
|
files: [
|
|
1817
1819
|
{ file: "index.css", code: css2 },
|
|
1818
1820
|
{ file: "index.d.ts", code: code.dts },
|
|
1819
|
-
{ file: ctx.file.ext("index"), code: code.js }
|
|
1821
|
+
{ file: ctx.file.ext("index"), code: code.js },
|
|
1822
|
+
{ file: "tokens.d.ts", code: generateTokenTypes(ctx) }
|
|
1820
1823
|
]
|
|
1821
1824
|
};
|
|
1822
1825
|
}
|
|
@@ -1839,19 +1842,12 @@ function setupTypes(ctx) {
|
|
|
1839
1842
|
{ file: "pattern.d.ts", code: gen.pattern },
|
|
1840
1843
|
{ file: "parts.d.ts", code: gen.parts },
|
|
1841
1844
|
{ file: "index.d.ts", code: entry.index },
|
|
1842
|
-
{ file: "tokens.d.ts", code: generateTokenTypes(ctx) },
|
|
1843
1845
|
{ file: "prop-type.d.ts", code: generatePropTypes(ctx) },
|
|
1844
1846
|
{ file: "style-props.d.ts", code: generateStyleProps(ctx) },
|
|
1845
1847
|
{ file: "conditions.d.ts", code: conditions.dts }
|
|
1846
1848
|
].filter(Boolean)
|
|
1847
1849
|
};
|
|
1848
1850
|
}
|
|
1849
|
-
function setupTokenTypes(ctx) {
|
|
1850
|
-
return {
|
|
1851
|
-
dir: ctx.paths.types,
|
|
1852
|
-
files: [{ file: "tokens.d.ts", code: generateTokenTypes(ctx) }]
|
|
1853
|
-
};
|
|
1854
|
-
}
|
|
1855
1851
|
function setupCss(ctx) {
|
|
1856
1852
|
const code = generateCssFn(ctx);
|
|
1857
1853
|
const conditions = generateConditions(ctx);
|
|
@@ -1996,7 +1992,7 @@ function setupPackageJson(ctx) {
|
|
|
1996
1992
|
}
|
|
1997
1993
|
var generateArtifacts = (ctx) => () => {
|
|
1998
1994
|
if (ctx.config.emitTokensOnly) {
|
|
1999
|
-
return [setupDesignTokens(ctx)
|
|
1995
|
+
return [setupDesignTokens(ctx)];
|
|
2000
1996
|
}
|
|
2001
1997
|
return [
|
|
2002
1998
|
setupHelpers(ctx),
|
package/dist/index.mjs
CHANGED
|
@@ -595,7 +595,7 @@ function generatePattern(ctx) {
|
|
|
595
595
|
import type { SystemStyleObject, ConditionalValue } from '../types'
|
|
596
596
|
import type { PropertyValue } from '../types/prop-type'
|
|
597
597
|
import type { Properties } from '../types/csstype'
|
|
598
|
-
import type { Tokens } from '../
|
|
598
|
+
import type { Tokens } from '../tokens'
|
|
599
599
|
|
|
600
600
|
export type ${upperName}Properties = {
|
|
601
601
|
${Object.keys(properties ?? {}).map((key) => {
|
|
@@ -770,12 +770,14 @@ function generateTokenJs(ctx) {
|
|
|
770
770
|
token.var = tokenVar
|
|
771
771
|
`,
|
|
772
772
|
dts: outdent9`
|
|
773
|
-
import type { Token } from '
|
|
773
|
+
import type { Token } from './tokens'
|
|
774
774
|
|
|
775
775
|
export declare const token: {
|
|
776
776
|
(path: Token, fallback?: string): string
|
|
777
777
|
var: (path: Token, fallback?: string) => string
|
|
778
778
|
}
|
|
779
|
+
|
|
780
|
+
export * from './tokens'
|
|
779
781
|
`
|
|
780
782
|
};
|
|
781
783
|
}
|
|
@@ -1594,7 +1596,7 @@ function generatePropTypes(ctx) {
|
|
|
1594
1596
|
outdent22`
|
|
1595
1597
|
import type { ConditionalValue } from './conditions';
|
|
1596
1598
|
import type { CssProperties } from './system-types'
|
|
1597
|
-
import type { Tokens } from '
|
|
1599
|
+
import type { Tokens } from '../tokens'
|
|
1598
1600
|
|
|
1599
1601
|
type PropertyValueTypes = {`
|
|
1600
1602
|
];
|
|
@@ -1633,7 +1635,7 @@ function generateStyleProps(ctx) {
|
|
|
1633
1635
|
return outdent23`
|
|
1634
1636
|
import { ConditionalValue } from './conditions'
|
|
1635
1637
|
import { PropertyValue } from './prop-type'
|
|
1636
|
-
import { Token } from '
|
|
1638
|
+
import { Token } from '../tokens'
|
|
1637
1639
|
|
|
1638
1640
|
export type CssVarProperties = {
|
|
1639
1641
|
[key in \`--\${string}\`]?: ConditionalValue<Token | (string & {}) | (number & {})>
|
|
@@ -1681,9 +1683,9 @@ function generateTokenTypes(ctx) {
|
|
|
1681
1683
|
} else {
|
|
1682
1684
|
for (const [key, value] of tokens.categoryMap.entries()) {
|
|
1683
1685
|
const typeName = capitalize(pluralize.singular(key));
|
|
1684
|
-
set.add(`export type ${typeName} = ${unionType3(value.keys())}`);
|
|
1686
|
+
set.add(`export type ${typeName}Token = ${unionType3(value.keys())}`);
|
|
1685
1687
|
set.add(`export type ColorPalette = ${unionType3(Object.keys(tokens.colorPalettes))}`);
|
|
1686
|
-
result.add(` ${key}: ${typeName}`);
|
|
1688
|
+
result.add(` ${key}: ${typeName}Token`);
|
|
1687
1689
|
}
|
|
1688
1690
|
}
|
|
1689
1691
|
result.add("} & { [token: string]: never }");
|
|
@@ -1785,7 +1787,8 @@ function setupDesignTokens(ctx) {
|
|
|
1785
1787
|
files: [
|
|
1786
1788
|
{ file: "index.css", code: css2 },
|
|
1787
1789
|
{ file: "index.d.ts", code: code.dts },
|
|
1788
|
-
{ file: ctx.file.ext("index"), code: code.js }
|
|
1790
|
+
{ file: ctx.file.ext("index"), code: code.js },
|
|
1791
|
+
{ file: "tokens.d.ts", code: generateTokenTypes(ctx) }
|
|
1789
1792
|
]
|
|
1790
1793
|
};
|
|
1791
1794
|
}
|
|
@@ -1808,19 +1811,12 @@ function setupTypes(ctx) {
|
|
|
1808
1811
|
{ file: "pattern.d.ts", code: gen.pattern },
|
|
1809
1812
|
{ file: "parts.d.ts", code: gen.parts },
|
|
1810
1813
|
{ file: "index.d.ts", code: entry.index },
|
|
1811
|
-
{ file: "tokens.d.ts", code: generateTokenTypes(ctx) },
|
|
1812
1814
|
{ file: "prop-type.d.ts", code: generatePropTypes(ctx) },
|
|
1813
1815
|
{ file: "style-props.d.ts", code: generateStyleProps(ctx) },
|
|
1814
1816
|
{ file: "conditions.d.ts", code: conditions.dts }
|
|
1815
1817
|
].filter(Boolean)
|
|
1816
1818
|
};
|
|
1817
1819
|
}
|
|
1818
|
-
function setupTokenTypes(ctx) {
|
|
1819
|
-
return {
|
|
1820
|
-
dir: ctx.paths.types,
|
|
1821
|
-
files: [{ file: "tokens.d.ts", code: generateTokenTypes(ctx) }]
|
|
1822
|
-
};
|
|
1823
|
-
}
|
|
1824
1820
|
function setupCss(ctx) {
|
|
1825
1821
|
const code = generateCssFn(ctx);
|
|
1826
1822
|
const conditions = generateConditions(ctx);
|
|
@@ -1965,7 +1961,7 @@ function setupPackageJson(ctx) {
|
|
|
1965
1961
|
}
|
|
1966
1962
|
var generateArtifacts = (ctx) => () => {
|
|
1967
1963
|
if (ctx.config.emitTokensOnly) {
|
|
1968
|
-
return [setupDesignTokens(ctx)
|
|
1964
|
+
return [setupDesignTokens(ctx)];
|
|
1969
1965
|
}
|
|
1970
1966
|
return [
|
|
1971
1967
|
setupHelpers(ctx),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pandacss/generator",
|
|
3
|
-
"version": "0.0.0-dev-
|
|
3
|
+
"version": "0.0.0-dev-20230511140820",
|
|
4
4
|
"description": "The css generator for css panda",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -20,16 +20,16 @@
|
|
|
20
20
|
"pluralize": "8.0.0",
|
|
21
21
|
"postcss": "8.4.23",
|
|
22
22
|
"ts-pattern": "4.3.0",
|
|
23
|
-
"@pandacss/core": "0.0.0-dev-
|
|
24
|
-
"@pandacss/logger": "0.0.0-dev-
|
|
25
|
-
"@pandacss/is-valid-prop": "0.0.0-dev-
|
|
26
|
-
"@pandacss/shared": "0.0.0-dev-
|
|
27
|
-
"@pandacss/types": "0.0.0-dev-
|
|
28
|
-
"@pandacss/token-dictionary": "0.0.0-dev-
|
|
23
|
+
"@pandacss/core": "0.0.0-dev-20230511140820",
|
|
24
|
+
"@pandacss/logger": "0.0.0-dev-20230511140820",
|
|
25
|
+
"@pandacss/is-valid-prop": "0.0.0-dev-20230511140820",
|
|
26
|
+
"@pandacss/shared": "0.0.0-dev-20230511140820",
|
|
27
|
+
"@pandacss/types": "0.0.0-dev-20230511140820",
|
|
28
|
+
"@pandacss/token-dictionary": "0.0.0-dev-20230511140820"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/pluralize": "0.0.29",
|
|
32
|
-
"@pandacss/fixture": "0.0.0-dev-
|
|
32
|
+
"@pandacss/fixture": "0.0.0-dev-20230511140820"
|
|
33
33
|
},
|
|
34
34
|
"scripts": {
|
|
35
35
|
"prebuild": "tsx scripts/prebuild.ts",
|