@pandacss/generator 0.0.0-dev-20230720154108 → 0.0.0-dev-20230720173817
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 +18 -4
- package/dist/index.mjs +18 -4
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -624,16 +624,22 @@ function generateCssFn(ctx) {
|
|
|
624
624
|
return {
|
|
625
625
|
dts: import_outdent4.outdent`
|
|
626
626
|
import type { SystemStyleObject } from '../types'
|
|
627
|
-
|
|
627
|
+
|
|
628
|
+
interface CssFunction {
|
|
629
|
+
(styles: SystemStyleObject): string
|
|
630
|
+
raw: (styles: SystemStyleObject) => SystemStyleObject
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
export declare const css: CssFunction;
|
|
628
634
|
`,
|
|
629
635
|
js: import_outdent4.outdent`
|
|
630
636
|
${ctx.file.import("createCss, createMergeCss, hypenateProperty, withoutSpace", "../helpers")}
|
|
631
637
|
${ctx.file.import("sortConditions, finalizeConditions", "./conditions")}
|
|
632
638
|
|
|
633
639
|
const classNameMap = ${stringify(utility.entries())}
|
|
634
|
-
|
|
640
|
+
|
|
635
641
|
const shorthands = ${stringify(utility.shorthands)}
|
|
636
|
-
|
|
642
|
+
|
|
637
643
|
const breakpointKeys = ${JSON.stringify(conditions.breakpoints.keys)}
|
|
638
644
|
|
|
639
645
|
const hasShorthand = ${utility.hasShorthand ? "true" : "false"}
|
|
@@ -663,6 +669,7 @@ function generateCssFn(ctx) {
|
|
|
663
669
|
}
|
|
664
670
|
|
|
665
671
|
export const css = createCss(context)
|
|
672
|
+
css.raw = (styles) => styles
|
|
666
673
|
|
|
667
674
|
export const { mergeCss, assignCss } = createMergeCss(context)
|
|
668
675
|
`
|
|
@@ -926,8 +933,13 @@ function generatePattern(ctx) {
|
|
|
926
933
|
|
|
927
934
|
type ${upperName}Options = ${upperName}Properties & Omit<SystemStyleObject, keyof ${upperName}Properties ${blocklistType}>
|
|
928
935
|
|
|
936
|
+
interface ${upperName}PatternFn {
|
|
937
|
+
(options?: ${upperName}Options): string
|
|
938
|
+
raw: (options: ${upperName}Options) => ${upperName}Options
|
|
939
|
+
}
|
|
940
|
+
|
|
929
941
|
${description ? `/** ${description} */` : ""}
|
|
930
|
-
export declare
|
|
942
|
+
export declare const ${name}: ${upperName}PatternFn;
|
|
931
943
|
`}
|
|
932
944
|
|
|
933
945
|
`,
|
|
@@ -941,6 +953,7 @@ transform`)}
|
|
|
941
953
|
export const ${styleFnName} = (styles = {}) => ${name}Config.transform(styles, { map: mapObject })
|
|
942
954
|
|
|
943
955
|
export const ${name} = (styles) => css(${styleFnName}(styles))
|
|
956
|
+
${name}.raw = (styles) => styles
|
|
944
957
|
`
|
|
945
958
|
};
|
|
946
959
|
});
|
|
@@ -1050,6 +1063,7 @@ function generateRecipes(ctx) {
|
|
|
1050
1063
|
interface ${upperName}Recipe {
|
|
1051
1064
|
__type: ${upperName}VariantProps
|
|
1052
1065
|
(props?: ${upperName}VariantProps): string
|
|
1066
|
+
raw: (props?: ${upperName}VariantProps) => ${upperName}VariantProps
|
|
1053
1067
|
variantMap: ${upperName}VariantMap
|
|
1054
1068
|
variantKeys: Array<keyof ${upperName}Variant>
|
|
1055
1069
|
splitVariantProps<Props extends ${upperName}VariantProps>(props: Props): [${upperName}VariantProps, Pretty<Omit<Props, keyof ${upperName}VariantProps>>]
|
package/dist/index.mjs
CHANGED
|
@@ -593,16 +593,22 @@ function generateCssFn(ctx) {
|
|
|
593
593
|
return {
|
|
594
594
|
dts: outdent4`
|
|
595
595
|
import type { SystemStyleObject } from '../types'
|
|
596
|
-
|
|
596
|
+
|
|
597
|
+
interface CssFunction {
|
|
598
|
+
(styles: SystemStyleObject): string
|
|
599
|
+
raw: (styles: SystemStyleObject) => SystemStyleObject
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
export declare const css: CssFunction;
|
|
597
603
|
`,
|
|
598
604
|
js: outdent4`
|
|
599
605
|
${ctx.file.import("createCss, createMergeCss, hypenateProperty, withoutSpace", "../helpers")}
|
|
600
606
|
${ctx.file.import("sortConditions, finalizeConditions", "./conditions")}
|
|
601
607
|
|
|
602
608
|
const classNameMap = ${stringify(utility.entries())}
|
|
603
|
-
|
|
609
|
+
|
|
604
610
|
const shorthands = ${stringify(utility.shorthands)}
|
|
605
|
-
|
|
611
|
+
|
|
606
612
|
const breakpointKeys = ${JSON.stringify(conditions.breakpoints.keys)}
|
|
607
613
|
|
|
608
614
|
const hasShorthand = ${utility.hasShorthand ? "true" : "false"}
|
|
@@ -632,6 +638,7 @@ function generateCssFn(ctx) {
|
|
|
632
638
|
}
|
|
633
639
|
|
|
634
640
|
export const css = createCss(context)
|
|
641
|
+
css.raw = (styles) => styles
|
|
635
642
|
|
|
636
643
|
export const { mergeCss, assignCss } = createMergeCss(context)
|
|
637
644
|
`
|
|
@@ -895,8 +902,13 @@ function generatePattern(ctx) {
|
|
|
895
902
|
|
|
896
903
|
type ${upperName}Options = ${upperName}Properties & Omit<SystemStyleObject, keyof ${upperName}Properties ${blocklistType}>
|
|
897
904
|
|
|
905
|
+
interface ${upperName}PatternFn {
|
|
906
|
+
(options?: ${upperName}Options): string
|
|
907
|
+
raw: (options: ${upperName}Options) => ${upperName}Options
|
|
908
|
+
}
|
|
909
|
+
|
|
898
910
|
${description ? `/** ${description} */` : ""}
|
|
899
|
-
export declare
|
|
911
|
+
export declare const ${name}: ${upperName}PatternFn;
|
|
900
912
|
`}
|
|
901
913
|
|
|
902
914
|
`,
|
|
@@ -910,6 +922,7 @@ transform`)}
|
|
|
910
922
|
export const ${styleFnName} = (styles = {}) => ${name}Config.transform(styles, { map: mapObject })
|
|
911
923
|
|
|
912
924
|
export const ${name} = (styles) => css(${styleFnName}(styles))
|
|
925
|
+
${name}.raw = (styles) => styles
|
|
913
926
|
`
|
|
914
927
|
};
|
|
915
928
|
});
|
|
@@ -1019,6 +1032,7 @@ function generateRecipes(ctx) {
|
|
|
1019
1032
|
interface ${upperName}Recipe {
|
|
1020
1033
|
__type: ${upperName}VariantProps
|
|
1021
1034
|
(props?: ${upperName}VariantProps): string
|
|
1035
|
+
raw: (props?: ${upperName}VariantProps) => ${upperName}VariantProps
|
|
1022
1036
|
variantMap: ${upperName}VariantMap
|
|
1023
1037
|
variantKeys: Array<keyof ${upperName}Variant>
|
|
1024
1038
|
splitVariantProps<Props extends ${upperName}VariantProps>(props: Props): [${upperName}VariantProps, Pretty<Omit<Props, keyof ${upperName}VariantProps>>]
|
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-20230720173817",
|
|
4
4
|
"description": "The css generator for css panda",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -20,17 +20,17 @@
|
|
|
20
20
|
"pluralize": "8.0.0",
|
|
21
21
|
"postcss": "8.4.25",
|
|
22
22
|
"ts-pattern": "5.0.1",
|
|
23
|
-
"@pandacss/core": "0.0.0-dev-
|
|
24
|
-
"@pandacss/is-valid-prop": "0.0.0-dev-
|
|
25
|
-
"@pandacss/logger": "0.0.0-dev-
|
|
26
|
-
"@pandacss/shared": "0.0.0-dev-
|
|
27
|
-
"@pandacss/token-dictionary": "0.0.0-dev-
|
|
28
|
-
"@pandacss/types": "0.0.0-dev-
|
|
23
|
+
"@pandacss/core": "0.0.0-dev-20230720173817",
|
|
24
|
+
"@pandacss/is-valid-prop": "0.0.0-dev-20230720173817",
|
|
25
|
+
"@pandacss/logger": "0.0.0-dev-20230720173817",
|
|
26
|
+
"@pandacss/shared": "0.0.0-dev-20230720173817",
|
|
27
|
+
"@pandacss/token-dictionary": "0.0.0-dev-20230720173817",
|
|
28
|
+
"@pandacss/types": "0.0.0-dev-20230720173817"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/pluralize": "0.0.30",
|
|
32
32
|
"hookable": "5.5.3",
|
|
33
|
-
"@pandacss/fixture": "0.0.0-dev-
|
|
33
|
+
"@pandacss/fixture": "0.0.0-dev-20230720173817"
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
36
|
"prebuild": "tsx scripts/prebuild.ts",
|