@pandacss/node 0.0.0-dev-20230106195931 → 0.0.0-dev-20230106201243
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 +86 -115
- package/dist/index.mjs +86 -115
- package/package.json +11 -11
package/dist/index.js
CHANGED
|
@@ -127,7 +127,7 @@ async function writeFileChunk(ctx, file) {
|
|
|
127
127
|
|
|
128
128
|
// src/generators/index.ts
|
|
129
129
|
var import_fs2 = require("fs");
|
|
130
|
-
var
|
|
130
|
+
var import_outdent23 = __toESM(require("outdent"));
|
|
131
131
|
|
|
132
132
|
// src/generators/conditions.ts
|
|
133
133
|
var import_shared = require("@pandacss/shared");
|
|
@@ -298,23 +298,6 @@ function getEntrypoint(pkg, file) {
|
|
|
298
298
|
return (0, import_path.join)((0, import_path.dirname)(entry), prod);
|
|
299
299
|
}
|
|
300
300
|
|
|
301
|
-
// src/generators/global-css.ts
|
|
302
|
-
var import_outdent5 = require("outdent");
|
|
303
|
-
function generateGlobalCss() {
|
|
304
|
-
return {
|
|
305
|
-
js: import_outdent5.outdent`
|
|
306
|
-
export function globalCss(styles){
|
|
307
|
-
void styles
|
|
308
|
-
}
|
|
309
|
-
`,
|
|
310
|
-
dts: import_outdent5.outdent`
|
|
311
|
-
import { GlobalStyleObject } from '../types'
|
|
312
|
-
|
|
313
|
-
export declare function globalCss(styles: GlobalStyleObject): void
|
|
314
|
-
`
|
|
315
|
-
};
|
|
316
|
-
}
|
|
317
|
-
|
|
318
301
|
// src/generators/is-valid-prop.ts
|
|
319
302
|
var import_fs = require("fs");
|
|
320
303
|
function generateisValidProp(ctx) {
|
|
@@ -330,11 +313,11 @@ function generateisValidProp(ctx) {
|
|
|
330
313
|
}
|
|
331
314
|
|
|
332
315
|
// src/generators/jsx/preact-jsx.ts
|
|
333
|
-
var
|
|
316
|
+
var import_outdent5 = require("outdent");
|
|
334
317
|
function generatePreactJsxFactory(ctx) {
|
|
335
318
|
const { name, componentName } = ctx.jsxFactoryDetails;
|
|
336
319
|
return {
|
|
337
|
-
js:
|
|
320
|
+
js: import_outdent5.outdent`
|
|
338
321
|
import { h } from 'preact'
|
|
339
322
|
import { forwardRef } from 'preact/compat'
|
|
340
323
|
import { useMemo } from 'preact/hooks'
|
|
@@ -403,10 +386,10 @@ function generatePreactJsxFactory(ctx) {
|
|
|
403
386
|
}
|
|
404
387
|
|
|
405
388
|
// src/generators/jsx/preact-layout-grid.ts
|
|
406
|
-
var
|
|
389
|
+
var import_outdent6 = require("outdent");
|
|
407
390
|
function generatePreactLayoutGrid() {
|
|
408
391
|
return {
|
|
409
|
-
dts:
|
|
392
|
+
dts: import_outdent6.outdent`
|
|
410
393
|
import { FunctionComponent } from 'preact'
|
|
411
394
|
|
|
412
395
|
export type LayoutGridProps = {
|
|
@@ -418,7 +401,7 @@ function generatePreactLayoutGrid() {
|
|
|
418
401
|
|
|
419
402
|
export declare const LayoutGrid: FunctionComponent<LayoutGridProps>
|
|
420
403
|
`,
|
|
421
|
-
js:
|
|
404
|
+
js: import_outdent6.outdent`
|
|
422
405
|
export function LayoutGrid(props) {
|
|
423
406
|
const { count = 12, margin, gutter = '24px', maxWidth } = props
|
|
424
407
|
const hasMaxWidth = maxWidth != null;
|
|
@@ -456,14 +439,14 @@ function generatePreactLayoutGrid() {
|
|
|
456
439
|
}
|
|
457
440
|
|
|
458
441
|
// src/generators/jsx/preact-pattern.ts
|
|
459
|
-
var
|
|
442
|
+
var import_outdent7 = require("outdent");
|
|
460
443
|
var import_ts_pattern = require("ts-pattern");
|
|
461
444
|
function generate(ctx, name, pattern) {
|
|
462
445
|
const { upperName, styleFn, dashName, jsxName, props } = ctx.getPatternDetails(name, pattern);
|
|
463
446
|
const { componentName } = ctx.jsxFactoryDetails;
|
|
464
447
|
return {
|
|
465
448
|
name: dashName,
|
|
466
|
-
js:
|
|
449
|
+
js: import_outdent7.outdent`
|
|
467
450
|
import { forwardRef } from 'preact/compat'
|
|
468
451
|
import { ${ctx.jsxFactory} } from './factory'
|
|
469
452
|
import { ${styleFn} } from '../patterns/${dashName}'
|
|
@@ -471,11 +454,11 @@ function generate(ctx, name, pattern) {
|
|
|
471
454
|
export const ${jsxName} = forwardRef(function ${jsxName}(props, ref) {
|
|
472
455
|
${(0, import_ts_pattern.match)(props.length).with(
|
|
473
456
|
0,
|
|
474
|
-
() =>
|
|
457
|
+
() => import_outdent7.outdent`
|
|
475
458
|
return <${ctx.jsxFactory}.div ref={ref} {...props} />
|
|
476
459
|
`
|
|
477
460
|
).otherwise(
|
|
478
|
-
() =>
|
|
461
|
+
() => import_outdent7.outdent`
|
|
479
462
|
const { ${props.join(", ")}, ...restProps } = props
|
|
480
463
|
const styleProps = ${styleFn}({${props.join(", ")}})
|
|
481
464
|
return <${ctx.jsxFactory}.div ref={ref} {...styleProps} {...restProps} />
|
|
@@ -483,7 +466,7 @@ function generate(ctx, name, pattern) {
|
|
|
483
466
|
)}
|
|
484
467
|
})
|
|
485
468
|
`,
|
|
486
|
-
dts:
|
|
469
|
+
dts: import_outdent7.outdent`
|
|
487
470
|
import { ${upperName}Properties } from '../patterns/${dashName}'
|
|
488
471
|
import { ${componentName} } from '../types/jsx'
|
|
489
472
|
|
|
@@ -497,15 +480,15 @@ function generatePreactJsxPattern(ctx) {
|
|
|
497
480
|
}
|
|
498
481
|
|
|
499
482
|
// src/generators/jsx/preact-types.ts
|
|
500
|
-
var
|
|
483
|
+
var import_outdent8 = require("outdent");
|
|
501
484
|
function generatePreactJsxTypes(ctx) {
|
|
502
485
|
const { name, componentName, upperName, typeName } = ctx.jsxFactoryDetails;
|
|
503
486
|
return {
|
|
504
|
-
jsxFactory:
|
|
487
|
+
jsxFactory: import_outdent8.outdent`
|
|
505
488
|
import { ${upperName} } from '../types/jsx'
|
|
506
489
|
export declare const ${name}: ${upperName}
|
|
507
490
|
`,
|
|
508
|
-
jsxType:
|
|
491
|
+
jsxType: import_outdent8.outdent`
|
|
509
492
|
import type { JSX, ElementType, ComponentProps } from 'preact'
|
|
510
493
|
import type { JsxStyleProps, Assign } from '.'
|
|
511
494
|
|
|
@@ -549,11 +532,11 @@ export type ${typeName}<ComponentType extends ElementType> = Polyfill<ComponentP
|
|
|
549
532
|
}
|
|
550
533
|
|
|
551
534
|
// src/generators/jsx/react-jsx.ts
|
|
552
|
-
var
|
|
535
|
+
var import_outdent9 = require("outdent");
|
|
553
536
|
function generateReactJsxFactory(ctx) {
|
|
554
537
|
const { name, componentName } = ctx.jsxFactoryDetails;
|
|
555
538
|
return {
|
|
556
|
-
js:
|
|
539
|
+
js: import_outdent9.outdent`
|
|
557
540
|
import { forwardRef, useMemo } from 'react'
|
|
558
541
|
import { isCssProperty } from './is-valid-prop'
|
|
559
542
|
import { css, cx } from '../css'
|
|
@@ -621,10 +604,10 @@ function generateReactJsxFactory(ctx) {
|
|
|
621
604
|
}
|
|
622
605
|
|
|
623
606
|
// src/generators/jsx/react-layout-grid.ts
|
|
624
|
-
var
|
|
607
|
+
var import_outdent10 = require("outdent");
|
|
625
608
|
function generateReactLayoutGrid() {
|
|
626
609
|
return {
|
|
627
|
-
dts:
|
|
610
|
+
dts: import_outdent10.outdent`
|
|
628
611
|
import type { FunctionComponent } from 'react'
|
|
629
612
|
|
|
630
613
|
export type LayoutGridProps = {
|
|
@@ -636,7 +619,7 @@ function generateReactLayoutGrid() {
|
|
|
636
619
|
|
|
637
620
|
export declare const LayoutGrid: FunctionComponent<LayoutGridProps>
|
|
638
621
|
`,
|
|
639
|
-
js:
|
|
622
|
+
js: import_outdent10.outdent`
|
|
640
623
|
export function LayoutGrid(props) {
|
|
641
624
|
const { count = 12, margin, gutter = '24px', maxWidth } = props
|
|
642
625
|
const hasMaxWidth = maxWidth != null;
|
|
@@ -674,14 +657,14 @@ function generateReactLayoutGrid() {
|
|
|
674
657
|
}
|
|
675
658
|
|
|
676
659
|
// src/generators/jsx/react-pattern.ts
|
|
677
|
-
var
|
|
660
|
+
var import_outdent11 = require("outdent");
|
|
678
661
|
var import_ts_pattern2 = require("ts-pattern");
|
|
679
662
|
function generate2(ctx, name, pattern) {
|
|
680
663
|
const { upperName, styleFn, dashName, jsxName, props } = ctx.getPatternDetails(name, pattern);
|
|
681
664
|
const { componentName } = ctx.jsxFactoryDetails;
|
|
682
665
|
return {
|
|
683
666
|
name: dashName,
|
|
684
|
-
js:
|
|
667
|
+
js: import_outdent11.outdent`
|
|
685
668
|
import { forwardRef } from 'react'
|
|
686
669
|
import { ${ctx.jsxFactory} } from './factory'
|
|
687
670
|
import { ${styleFn} } from '../patterns/${dashName}'
|
|
@@ -689,11 +672,11 @@ function generate2(ctx, name, pattern) {
|
|
|
689
672
|
export const ${jsxName} = forwardRef(function ${jsxName}(props, ref) {
|
|
690
673
|
${(0, import_ts_pattern2.match)(props.length).with(
|
|
691
674
|
0,
|
|
692
|
-
() =>
|
|
675
|
+
() => import_outdent11.outdent`
|
|
693
676
|
return <${ctx.jsxFactory}.div ref={ref} {...props} />
|
|
694
677
|
`
|
|
695
678
|
).otherwise(
|
|
696
|
-
() =>
|
|
679
|
+
() => import_outdent11.outdent`
|
|
697
680
|
const { ${props.join(", ")}, ...restProps } = props
|
|
698
681
|
const styleProps = ${styleFn}({${props.join(", ")}})
|
|
699
682
|
return <${ctx.jsxFactory}.div ref={ref} {...styleProps} {...restProps} />
|
|
@@ -702,7 +685,7 @@ function generate2(ctx, name, pattern) {
|
|
|
702
685
|
|
|
703
686
|
})
|
|
704
687
|
`,
|
|
705
|
-
dts:
|
|
688
|
+
dts: import_outdent11.outdent`
|
|
706
689
|
import { ${upperName}Properties } from '../patterns/${dashName}'
|
|
707
690
|
import { ${componentName} } from '../types/jsx'
|
|
708
691
|
|
|
@@ -716,15 +699,15 @@ function generateReactJsxPattern(ctx) {
|
|
|
716
699
|
}
|
|
717
700
|
|
|
718
701
|
// src/generators/jsx/react-types.ts
|
|
719
|
-
var
|
|
702
|
+
var import_outdent12 = require("outdent");
|
|
720
703
|
function generateReactJsxTypes(ctx) {
|
|
721
704
|
const { name, componentName, upperName, typeName } = ctx.jsxFactoryDetails;
|
|
722
705
|
return {
|
|
723
|
-
jsxFactory:
|
|
706
|
+
jsxFactory: import_outdent12.outdent`
|
|
724
707
|
import { ${upperName} } from '../types/jsx'
|
|
725
708
|
export declare const ${name}: ${upperName}
|
|
726
709
|
`,
|
|
727
|
-
jsxType:
|
|
710
|
+
jsxType: import_outdent12.outdent`
|
|
728
711
|
import type { ElementType, ComponentProps } from 'react'
|
|
729
712
|
import type { JsxStyleProps, Assign } from '.'
|
|
730
713
|
|
|
@@ -768,11 +751,11 @@ export type ${typeName}<ComponentType extends ElementType> = Polyfill<ComponentP
|
|
|
768
751
|
}
|
|
769
752
|
|
|
770
753
|
// src/generators/jsx/solid-jsx.ts
|
|
771
|
-
var
|
|
754
|
+
var import_outdent13 = require("outdent");
|
|
772
755
|
function generateSolidJsxFactory(ctx) {
|
|
773
756
|
const { componentName, name } = ctx.jsxFactoryDetails;
|
|
774
757
|
return {
|
|
775
|
-
js:
|
|
758
|
+
js: import_outdent13.outdent`
|
|
776
759
|
import { Dynamic } from 'solid-js/web'
|
|
777
760
|
import { mergeProps, splitProps } from 'solid-js'
|
|
778
761
|
import { allCssProperties } from './is-valid-prop'
|
|
@@ -835,10 +818,10 @@ function generateSolidJsxFactory(ctx) {
|
|
|
835
818
|
}
|
|
836
819
|
|
|
837
820
|
// src/generators/jsx/solid-layout-grid.ts
|
|
838
|
-
var
|
|
821
|
+
var import_outdent14 = require("outdent");
|
|
839
822
|
function generateSolidLayoutGrid() {
|
|
840
823
|
return {
|
|
841
|
-
dts:
|
|
824
|
+
dts: import_outdent14.outdent`
|
|
842
825
|
import { ParentProps } from 'solid-js'
|
|
843
826
|
|
|
844
827
|
export type LayoutGridProps = {
|
|
@@ -850,7 +833,7 @@ function generateSolidLayoutGrid() {
|
|
|
850
833
|
|
|
851
834
|
export declare const LayoutGrid: ParentProps<LayoutGridProps>
|
|
852
835
|
`,
|
|
853
|
-
js:
|
|
836
|
+
js: import_outdent14.outdent`
|
|
854
837
|
export function LayoutGrid(props) {
|
|
855
838
|
const { count = 12, margin, gutter = '24px', maxWidth } = props
|
|
856
839
|
const hasMaxWidth = maxWidth != null;
|
|
@@ -888,14 +871,14 @@ function generateSolidLayoutGrid() {
|
|
|
888
871
|
}
|
|
889
872
|
|
|
890
873
|
// src/generators/jsx/solid-pattern.ts
|
|
891
|
-
var
|
|
874
|
+
var import_outdent15 = require("outdent");
|
|
892
875
|
var import_ts_pattern3 = require("ts-pattern");
|
|
893
876
|
function generate3(ctx, name, pattern) {
|
|
894
877
|
const { upperName, styleFn, dashName, jsxName, props } = ctx.getPatternDetails(name, pattern);
|
|
895
878
|
const { componentName } = ctx.jsxFactoryDetails;
|
|
896
879
|
return {
|
|
897
880
|
name: dashName,
|
|
898
|
-
js:
|
|
881
|
+
js: import_outdent15.outdent`
|
|
899
882
|
import { splitProps } from 'solid-js'
|
|
900
883
|
import { ${ctx.jsxFactory} } from './factory'
|
|
901
884
|
import { ${styleFn} } from '../patterns/${dashName}'
|
|
@@ -903,11 +886,11 @@ function generate3(ctx, name, pattern) {
|
|
|
903
886
|
export function ${jsxName}(props) {
|
|
904
887
|
${(0, import_ts_pattern3.match)(props.length).with(
|
|
905
888
|
0,
|
|
906
|
-
() =>
|
|
889
|
+
() => import_outdent15.outdent`
|
|
907
890
|
return <${ctx.jsxFactory}.div {...props} />
|
|
908
891
|
`
|
|
909
892
|
).otherwise(
|
|
910
|
-
() =>
|
|
893
|
+
() => import_outdent15.outdent`
|
|
911
894
|
const [patternProps, restProps] = splitProps(props, [${props.map((v) => JSON.stringify(v)).join(", ")}]);
|
|
912
895
|
const styleProps = ${styleFn}(patternProps)
|
|
913
896
|
return <${ctx.jsxFactory}.div {...styleProps} {...restProps} />
|
|
@@ -915,7 +898,7 @@ function generate3(ctx, name, pattern) {
|
|
|
915
898
|
)}
|
|
916
899
|
}
|
|
917
900
|
`,
|
|
918
|
-
dts:
|
|
901
|
+
dts: import_outdent15.outdent`
|
|
919
902
|
import { ${upperName}Properties } from '../patterns/${dashName}'
|
|
920
903
|
import { ${componentName} } from '../types/jsx'
|
|
921
904
|
|
|
@@ -929,15 +912,15 @@ function generateSolidJsxPattern(ctx) {
|
|
|
929
912
|
}
|
|
930
913
|
|
|
931
914
|
// src/generators/jsx/solid-types.ts
|
|
932
|
-
var
|
|
915
|
+
var import_outdent16 = require("outdent");
|
|
933
916
|
function generateSolidJsxTypes(ctx) {
|
|
934
917
|
const { name, componentName, upperName, typeName } = ctx.jsxFactoryDetails;
|
|
935
918
|
return {
|
|
936
|
-
jsxFactory:
|
|
919
|
+
jsxFactory: import_outdent16.outdent`
|
|
937
920
|
import { ${upperName} } from '../types/jsx'
|
|
938
921
|
export declare const ${name}: ${upperName}
|
|
939
922
|
`,
|
|
940
|
-
jsxType:
|
|
923
|
+
jsxType: import_outdent16.outdent`
|
|
941
924
|
import type { JSX, ComponentProps, Component } from 'solid-js'
|
|
942
925
|
import type { JsxStyleProps, Assign } from '.'
|
|
943
926
|
|
|
@@ -1023,7 +1006,7 @@ function generateLayoutGrid(ctx) {
|
|
|
1023
1006
|
|
|
1024
1007
|
// src/generators/pattern.ts
|
|
1025
1008
|
var import_shared2 = require("@pandacss/shared");
|
|
1026
|
-
var
|
|
1009
|
+
var import_outdent17 = require("outdent");
|
|
1027
1010
|
var import_telejson = require("telejson");
|
|
1028
1011
|
var import_ts_pattern4 = require("ts-pattern");
|
|
1029
1012
|
function generate4(name, pattern) {
|
|
@@ -1032,7 +1015,7 @@ function generate4(name, pattern) {
|
|
|
1032
1015
|
const upperFn = `get${upperName}Style`;
|
|
1033
1016
|
return {
|
|
1034
1017
|
name: (0, import_shared2.dashCase)(name),
|
|
1035
|
-
dts:
|
|
1018
|
+
dts: import_outdent17.outdent`
|
|
1036
1019
|
import { SystemStyleObject, ConditionalValue } from "../types"
|
|
1037
1020
|
import { Properties } from "../types/csstype"
|
|
1038
1021
|
import { Tokens } from "../types/token"
|
|
@@ -1055,14 +1038,14 @@ function generate4(name, pattern) {
|
|
|
1055
1038
|
}).join("\n ")}
|
|
1056
1039
|
}
|
|
1057
1040
|
|
|
1058
|
-
${strict ?
|
|
1041
|
+
${strict ? import_outdent17.outdent`export declare function ${name}(options: ${upperName}Properties): string` : import_outdent17.outdent`
|
|
1059
1042
|
|
|
1060
1043
|
${description ? `/** ${description} */` : ""}
|
|
1061
1044
|
export declare function ${name}(options: SystemStyleObject<${upperName}Properties>): string
|
|
1062
1045
|
`}
|
|
1063
1046
|
|
|
1064
1047
|
`,
|
|
1065
|
-
js:
|
|
1048
|
+
js: import_outdent17.outdent`
|
|
1066
1049
|
import { mapObject } from "../helpers"
|
|
1067
1050
|
import { css } from "../css"
|
|
1068
1051
|
|
|
@@ -1081,10 +1064,10 @@ function generatePattern(ctx) {
|
|
|
1081
1064
|
}
|
|
1082
1065
|
|
|
1083
1066
|
// src/generators/prop-types.ts
|
|
1084
|
-
var
|
|
1067
|
+
var import_outdent18 = require("outdent");
|
|
1085
1068
|
function generatePropTypes(utility) {
|
|
1086
1069
|
const result = [
|
|
1087
|
-
|
|
1070
|
+
import_outdent18.outdent`
|
|
1088
1071
|
import { Properties as CSSProperties } from './csstype'
|
|
1089
1072
|
import { Tokens } from './token'
|
|
1090
1073
|
|
|
@@ -1113,15 +1096,15 @@ function generatePropTypes(utility) {
|
|
|
1113
1096
|
|
|
1114
1097
|
// src/generators/recipe.ts
|
|
1115
1098
|
var import_shared3 = require("@pandacss/shared");
|
|
1116
|
-
var
|
|
1099
|
+
var import_outdent19 = require("outdent");
|
|
1117
1100
|
function generateRecipes(ctx) {
|
|
1118
1101
|
const { recipes = {}, hash, hasRecipes, utility } = ctx;
|
|
1119
1102
|
const { separator } = utility;
|
|
1120
1103
|
if (!hasRecipes)
|
|
1121
1104
|
return;
|
|
1122
1105
|
const js = [
|
|
1123
|
-
|
|
1124
|
-
import { createCss, withoutSpace, compact } from
|
|
1106
|
+
import_outdent19.outdent`
|
|
1107
|
+
import { createCss, withoutSpace, compact } from '../helpers'
|
|
1125
1108
|
|
|
1126
1109
|
const createRecipe = (name, defaultVariants) => {
|
|
1127
1110
|
return (variants) => {
|
|
@@ -1152,15 +1135,17 @@ function generateRecipes(ctx) {
|
|
|
1152
1135
|
}
|
|
1153
1136
|
`
|
|
1154
1137
|
];
|
|
1155
|
-
const dts = [
|
|
1138
|
+
const dts = [
|
|
1139
|
+
import_outdent19.outdent`
|
|
1140
|
+
import { ConditionalValue } from '../types'
|
|
1141
|
+
`
|
|
1142
|
+
];
|
|
1156
1143
|
Object.values(recipes).forEach((recipe) => {
|
|
1157
1144
|
const { name, description, defaultVariants, variants } = recipe;
|
|
1158
|
-
js.push(
|
|
1145
|
+
js.push(import_outdent19.outdent`
|
|
1159
1146
|
export const ${name} = createRecipe('${name}', ${JSON.stringify(defaultVariants ?? {})})
|
|
1160
1147
|
`);
|
|
1161
|
-
dts.push(
|
|
1162
|
-
import { ConditionalValue } from "../types"
|
|
1163
|
-
|
|
1148
|
+
dts.push(import_outdent19.outdent`
|
|
1164
1149
|
export type ${(0, import_shared3.capitalize)(name)}Variants = {
|
|
1165
1150
|
${Object.keys(variants ?? {}).map((key) => {
|
|
1166
1151
|
const value = variants[key];
|
|
@@ -1174,8 +1159,8 @@ function generateRecipes(ctx) {
|
|
|
1174
1159
|
`);
|
|
1175
1160
|
});
|
|
1176
1161
|
return {
|
|
1177
|
-
js:
|
|
1178
|
-
dts:
|
|
1162
|
+
js: import_outdent19.outdent.string(js.join("\n\n")),
|
|
1163
|
+
dts: import_outdent19.outdent.string(dts.join("\n\n"))
|
|
1179
1164
|
};
|
|
1180
1165
|
}
|
|
1181
1166
|
|
|
@@ -1354,7 +1339,7 @@ function cleanupSelectors(css2, varSelector) {
|
|
|
1354
1339
|
|
|
1355
1340
|
// src/generators/token-dts.ts
|
|
1356
1341
|
var import_shared4 = require("@pandacss/shared");
|
|
1357
|
-
var
|
|
1342
|
+
var import_outdent20 = require("outdent");
|
|
1358
1343
|
var import_pluralize = __toESM(require("pluralize"));
|
|
1359
1344
|
function generateTokenDts(dict) {
|
|
1360
1345
|
const set = /* @__PURE__ */ new Set();
|
|
@@ -1372,11 +1357,11 @@ function generateTokenDts(dict) {
|
|
|
1372
1357
|
}
|
|
1373
1358
|
result.add("} & { [token: string]: never }");
|
|
1374
1359
|
set.add(Array.from(result).join("\n"));
|
|
1375
|
-
return
|
|
1360
|
+
return import_outdent20.outdent.string(Array.from(set).join("\n\n"));
|
|
1376
1361
|
}
|
|
1377
1362
|
|
|
1378
1363
|
// src/generators/token-js.ts
|
|
1379
|
-
var
|
|
1364
|
+
var import_outdent21 = __toESM(require("outdent"));
|
|
1380
1365
|
function generateTokenJs(dict) {
|
|
1381
1366
|
const map = /* @__PURE__ */ new Map();
|
|
1382
1367
|
dict.allTokens.forEach((token) => {
|
|
@@ -1386,7 +1371,7 @@ function generateTokenJs(dict) {
|
|
|
1386
1371
|
});
|
|
1387
1372
|
const obj = Object.fromEntries(map);
|
|
1388
1373
|
return {
|
|
1389
|
-
js:
|
|
1374
|
+
js: import_outdent21.default`
|
|
1390
1375
|
const tokens = ${JSON.stringify(obj, null, 2)}
|
|
1391
1376
|
|
|
1392
1377
|
export function getToken(path) {
|
|
@@ -1399,7 +1384,7 @@ function generateTokenJs(dict) {
|
|
|
1399
1384
|
return variable
|
|
1400
1385
|
}
|
|
1401
1386
|
`,
|
|
1402
|
-
dts:
|
|
1387
|
+
dts: import_outdent21.default`
|
|
1403
1388
|
import { Token } from "../types/token"
|
|
1404
1389
|
export declare function getToken(path: Token): string
|
|
1405
1390
|
export declare function getTokenVar(path: Token): string
|
|
@@ -1409,7 +1394,7 @@ function generateTokenJs(dict) {
|
|
|
1409
1394
|
|
|
1410
1395
|
// src/generators/types.ts
|
|
1411
1396
|
var import_fs_extra = require("fs-extra");
|
|
1412
|
-
var
|
|
1397
|
+
var import_outdent22 = __toESM(require("outdent"));
|
|
1413
1398
|
function getType(file) {
|
|
1414
1399
|
const filepath = getEntrypoint("@pandacss/types", { dev: file });
|
|
1415
1400
|
return (0, import_fs_extra.readFileSync)(filepath, "utf8");
|
|
@@ -1420,7 +1405,7 @@ function generateCssType(ctx) {
|
|
|
1420
1405
|
return {
|
|
1421
1406
|
cssType: getType("csstype.d.ts"),
|
|
1422
1407
|
pandaCssType: getType("system-types.d.ts"),
|
|
1423
|
-
publicType:
|
|
1408
|
+
publicType: import_outdent22.default`
|
|
1424
1409
|
import * as System from './system-types'
|
|
1425
1410
|
import { PropTypes } from './prop-type'
|
|
1426
1411
|
import { Conditions } from './conditions'
|
|
@@ -1471,16 +1456,6 @@ function setupDesignTokens(ctx) {
|
|
|
1471
1456
|
]
|
|
1472
1457
|
};
|
|
1473
1458
|
}
|
|
1474
|
-
function setupGlobalCss(ctx) {
|
|
1475
|
-
const code = generateGlobalCss();
|
|
1476
|
-
return {
|
|
1477
|
-
dir: ctx.paths.css,
|
|
1478
|
-
files: [
|
|
1479
|
-
{ file: "global-css.mjs", code: code.js },
|
|
1480
|
-
{ file: "global-css.d.ts", code: code.dts }
|
|
1481
|
-
]
|
|
1482
|
-
};
|
|
1483
|
-
}
|
|
1484
1459
|
function setupTypes(ctx) {
|
|
1485
1460
|
const code = generateCssType(ctx);
|
|
1486
1461
|
const conditions = generateConditions(ctx);
|
|
@@ -1548,7 +1523,7 @@ function setupPatterns(ctx) {
|
|
|
1548
1523
|
if (!files) {
|
|
1549
1524
|
return { files: [] };
|
|
1550
1525
|
}
|
|
1551
|
-
const indexCode =
|
|
1526
|
+
const indexCode = import_outdent23.default.string(files.map((file) => `export * from './${file.name}'`).join("\n"));
|
|
1552
1527
|
return {
|
|
1553
1528
|
dir: ctx.paths.pattern,
|
|
1554
1529
|
files: [
|
|
@@ -1567,10 +1542,10 @@ function setupJsx(ctx) {
|
|
|
1567
1542
|
const factory = generateJsxFactory(ctx);
|
|
1568
1543
|
const patterns = generateJsxPatterns(ctx);
|
|
1569
1544
|
const layoutGrid = generateLayoutGrid(ctx);
|
|
1570
|
-
const indexCode =
|
|
1545
|
+
const indexCode = import_outdent23.default`
|
|
1571
1546
|
export * from './factory'
|
|
1572
1547
|
export * from './layout-grid'
|
|
1573
|
-
${
|
|
1548
|
+
${import_outdent23.default.string(patterns.map((file) => `export * from './${file.name}'`).join("\n"))}
|
|
1574
1549
|
`;
|
|
1575
1550
|
return {
|
|
1576
1551
|
dir: ctx.paths.jsx,
|
|
@@ -1584,7 +1559,7 @@ function setupJsx(ctx) {
|
|
|
1584
1559
|
{ file: "factory.jsx", code: factory.js },
|
|
1585
1560
|
{
|
|
1586
1561
|
file: "index.d.ts",
|
|
1587
|
-
code:
|
|
1562
|
+
code: import_outdent23.default`
|
|
1588
1563
|
${indexCode}
|
|
1589
1564
|
export type { ${ctx.jsxFactoryDetails.typeName} } from '../types/jsx'
|
|
1590
1565
|
`
|
|
@@ -1594,7 +1569,7 @@ function setupJsx(ctx) {
|
|
|
1594
1569
|
};
|
|
1595
1570
|
}
|
|
1596
1571
|
function setupCssIndex(ctx) {
|
|
1597
|
-
const code =
|
|
1572
|
+
const code = import_outdent23.default`
|
|
1598
1573
|
export * from './css'
|
|
1599
1574
|
export * from './cx'
|
|
1600
1575
|
export * from './global-css'
|
|
@@ -1623,7 +1598,6 @@ function generateSystem(ctx) {
|
|
|
1623
1598
|
setupCssMap(ctx),
|
|
1624
1599
|
setupCx(ctx),
|
|
1625
1600
|
setupCss(ctx),
|
|
1626
|
-
setupGlobalCss(ctx),
|
|
1627
1601
|
setupRecipes(ctx),
|
|
1628
1602
|
setupPatterns(ctx),
|
|
1629
1603
|
setupCssIndex(ctx),
|
|
@@ -1634,30 +1608,30 @@ function generateSystem(ctx) {
|
|
|
1634
1608
|
|
|
1635
1609
|
// src/messages.ts
|
|
1636
1610
|
var import_logger3 = require("@pandacss/logger");
|
|
1637
|
-
var
|
|
1611
|
+
var import_outdent24 = require("outdent");
|
|
1638
1612
|
var tick = import_logger3.colors.green().bold("\u2714\uFE0F");
|
|
1639
1613
|
function artifactsGeneratedMessage(ctx) {
|
|
1640
1614
|
return [
|
|
1641
|
-
|
|
1615
|
+
import_outdent24.outdent`
|
|
1642
1616
|
${tick} ${(0, import_logger3.quote)(ctx.outdir, "/css")}: the css function to author styles
|
|
1643
1617
|
`,
|
|
1644
|
-
ctx.hasTokens &&
|
|
1618
|
+
ctx.hasTokens && import_outdent24.outdent`
|
|
1645
1619
|
${tick} ${(0, import_logger3.quote)(ctx.outdir, "/tokens")}: the css variables and js function to query your tokens
|
|
1646
1620
|
`,
|
|
1647
|
-
ctx.hasPatterns &&
|
|
1621
|
+
ctx.hasPatterns && import_outdent24.outdent`
|
|
1648
1622
|
${tick} ${(0, import_logger3.quote)(ctx.outdir, "/patterns")}: functions to implement common css patterns
|
|
1649
1623
|
`,
|
|
1650
|
-
ctx.hasRecipes &&
|
|
1624
|
+
ctx.hasRecipes && import_outdent24.outdent`
|
|
1651
1625
|
${tick} ${(0, import_logger3.quote)(ctx.outdir, "/recipes")}: functions to create multi-variant styles
|
|
1652
1626
|
`,
|
|
1653
|
-
ctx.jsxFramework &&
|
|
1627
|
+
ctx.jsxFramework && import_outdent24.outdent`
|
|
1654
1628
|
${tick} ${(0, import_logger3.quote)(ctx.outdir, "/jsx")}: style prop powered elements for ${ctx.jsxFramework}
|
|
1655
1629
|
`,
|
|
1656
1630
|
"\n"
|
|
1657
1631
|
].filter(Boolean).join("\n");
|
|
1658
1632
|
}
|
|
1659
1633
|
function configExistsMessage(cmd) {
|
|
1660
|
-
return
|
|
1634
|
+
return import_outdent24.outdent`
|
|
1661
1635
|
\n
|
|
1662
1636
|
It looks like you already have panda created\`.
|
|
1663
1637
|
|
|
@@ -1666,7 +1640,7 @@ function configExistsMessage(cmd) {
|
|
|
1666
1640
|
`;
|
|
1667
1641
|
}
|
|
1668
1642
|
function thankYouMessage() {
|
|
1669
|
-
return
|
|
1643
|
+
return import_outdent24.outdent`
|
|
1670
1644
|
|
|
1671
1645
|
🚀 Thanks for choosing ${import_logger3.colors.cyan("Panda")} to write your css.
|
|
1672
1646
|
|
|
@@ -1678,7 +1652,7 @@ var randomWords = ["Sweet", "Divine", "Pandalicious", "Super"];
|
|
|
1678
1652
|
var pickRandom = (arr) => arr[Math.floor(Math.random() * arr.length)];
|
|
1679
1653
|
function scaffoldCompleteMessage() {
|
|
1680
1654
|
return import_logger3.logger.box(
|
|
1681
|
-
|
|
1655
|
+
import_outdent24.outdent`
|
|
1682
1656
|
|
|
1683
1657
|
${import_logger3.colors.bold().cyan("Next steps:")}
|
|
1684
1658
|
|
|
@@ -1694,12 +1668,12 @@ function scaffoldCompleteMessage() {
|
|
|
1694
1668
|
);
|
|
1695
1669
|
}
|
|
1696
1670
|
function watchMessage() {
|
|
1697
|
-
return
|
|
1671
|
+
return import_outdent24.outdent`
|
|
1698
1672
|
Watching for file changes...
|
|
1699
1673
|
`;
|
|
1700
1674
|
}
|
|
1701
1675
|
function buildCompleteMessage(ctx) {
|
|
1702
|
-
return
|
|
1676
|
+
return import_outdent24.outdent`
|
|
1703
1677
|
Successfully extracted css from ${ctx.files.length} file(s) ✨
|
|
1704
1678
|
`;
|
|
1705
1679
|
}
|
|
@@ -2057,9 +2031,6 @@ function createContext(conf, io = fileSystem) {
|
|
|
2057
2031
|
}
|
|
2058
2032
|
function getCss(collector, file) {
|
|
2059
2033
|
const sheet = new import_core3.Stylesheet(context());
|
|
2060
|
-
collector.globalCss.forEach((result) => {
|
|
2061
|
-
sheet.processGlobalCss(result.data);
|
|
2062
|
-
});
|
|
2063
2034
|
collector.css.forEach((result) => {
|
|
2064
2035
|
sheet.processAtomic(result.data);
|
|
2065
2036
|
});
|
|
@@ -2440,9 +2411,9 @@ async function generate5(config, configPath) {
|
|
|
2440
2411
|
// src/git-ignore.ts
|
|
2441
2412
|
var import_fs5 = require("fs");
|
|
2442
2413
|
var import_look_it_up2 = require("look-it-up");
|
|
2443
|
-
var
|
|
2414
|
+
var import_outdent25 = __toESM(require("outdent"));
|
|
2444
2415
|
function setupGitIgnore(ctx) {
|
|
2445
|
-
const txt =
|
|
2416
|
+
const txt = import_outdent25.default`## CSS Panda
|
|
2446
2417
|
${ctx.outdir}
|
|
2447
2418
|
${ctx.outdir}-static
|
|
2448
2419
|
`;
|
|
@@ -2460,7 +2431,7 @@ function setupGitIgnore(ctx) {
|
|
|
2460
2431
|
var import_logger9 = require("@pandacss/logger");
|
|
2461
2432
|
var import_fs_extra4 = require("fs-extra");
|
|
2462
2433
|
var import_look_it_up3 = require("look-it-up");
|
|
2463
|
-
var
|
|
2434
|
+
var import_outdent26 = require("outdent");
|
|
2464
2435
|
var import_path6 = require("path");
|
|
2465
2436
|
var import_preferred_pm2 = __toESM(require("preferred-pm"));
|
|
2466
2437
|
async function setupConfig(cwd, { force }) {
|
|
@@ -2474,7 +2445,7 @@ async function setupConfig(cwd, { force }) {
|
|
|
2474
2445
|
if (!force && configFile) {
|
|
2475
2446
|
import_logger9.logger.warn("config exists", configExistsMessage(cmd));
|
|
2476
2447
|
} else {
|
|
2477
|
-
const content =
|
|
2448
|
+
const content = import_outdent26.outdent`
|
|
2478
2449
|
import { defineConfig } from "css-panda"
|
|
2479
2450
|
|
|
2480
2451
|
export default defineConfig({
|
|
@@ -2500,7 +2471,7 @@ async function setupConfig(cwd, { force }) {
|
|
|
2500
2471
|
}
|
|
2501
2472
|
async function setupPostcss(cwd) {
|
|
2502
2473
|
import_logger9.logger.info({ type: "init", msg: `creating postcss config file: ${(0, import_logger9.quote)("postcss.config.cjs")}` });
|
|
2503
|
-
const content =
|
|
2474
|
+
const content = import_outdent26.outdent`
|
|
2504
2475
|
module.exports = {
|
|
2505
2476
|
plugins: {
|
|
2506
2477
|
'css-panda/postcss': {},
|
package/dist/index.mjs
CHANGED
|
@@ -81,7 +81,7 @@ async function writeFileChunk(ctx, file) {
|
|
|
81
81
|
|
|
82
82
|
// src/generators/index.ts
|
|
83
83
|
import { readFileSync as readFileSync3 } from "fs";
|
|
84
|
-
import
|
|
84
|
+
import outdent23 from "outdent";
|
|
85
85
|
|
|
86
86
|
// src/generators/conditions.ts
|
|
87
87
|
import { unionType } from "@pandacss/shared";
|
|
@@ -252,23 +252,6 @@ function getEntrypoint(pkg, file) {
|
|
|
252
252
|
return join(dirname(entry), prod);
|
|
253
253
|
}
|
|
254
254
|
|
|
255
|
-
// src/generators/global-css.ts
|
|
256
|
-
import { outdent as outdent5 } from "outdent";
|
|
257
|
-
function generateGlobalCss() {
|
|
258
|
-
return {
|
|
259
|
-
js: outdent5`
|
|
260
|
-
export function globalCss(styles){
|
|
261
|
-
void styles
|
|
262
|
-
}
|
|
263
|
-
`,
|
|
264
|
-
dts: outdent5`
|
|
265
|
-
import { GlobalStyleObject } from '../types'
|
|
266
|
-
|
|
267
|
-
export declare function globalCss(styles: GlobalStyleObject): void
|
|
268
|
-
`
|
|
269
|
-
};
|
|
270
|
-
}
|
|
271
|
-
|
|
272
255
|
// src/generators/is-valid-prop.ts
|
|
273
256
|
import { readFileSync } from "fs";
|
|
274
257
|
function generateisValidProp(ctx) {
|
|
@@ -284,11 +267,11 @@ function generateisValidProp(ctx) {
|
|
|
284
267
|
}
|
|
285
268
|
|
|
286
269
|
// src/generators/jsx/preact-jsx.ts
|
|
287
|
-
import { outdent as
|
|
270
|
+
import { outdent as outdent5 } from "outdent";
|
|
288
271
|
function generatePreactJsxFactory(ctx) {
|
|
289
272
|
const { name, componentName } = ctx.jsxFactoryDetails;
|
|
290
273
|
return {
|
|
291
|
-
js:
|
|
274
|
+
js: outdent5`
|
|
292
275
|
import { h } from 'preact'
|
|
293
276
|
import { forwardRef } from 'preact/compat'
|
|
294
277
|
import { useMemo } from 'preact/hooks'
|
|
@@ -357,10 +340,10 @@ function generatePreactJsxFactory(ctx) {
|
|
|
357
340
|
}
|
|
358
341
|
|
|
359
342
|
// src/generators/jsx/preact-layout-grid.ts
|
|
360
|
-
import { outdent as
|
|
343
|
+
import { outdent as outdent6 } from "outdent";
|
|
361
344
|
function generatePreactLayoutGrid() {
|
|
362
345
|
return {
|
|
363
|
-
dts:
|
|
346
|
+
dts: outdent6`
|
|
364
347
|
import { FunctionComponent } from 'preact'
|
|
365
348
|
|
|
366
349
|
export type LayoutGridProps = {
|
|
@@ -372,7 +355,7 @@ function generatePreactLayoutGrid() {
|
|
|
372
355
|
|
|
373
356
|
export declare const LayoutGrid: FunctionComponent<LayoutGridProps>
|
|
374
357
|
`,
|
|
375
|
-
js:
|
|
358
|
+
js: outdent6`
|
|
376
359
|
export function LayoutGrid(props) {
|
|
377
360
|
const { count = 12, margin, gutter = '24px', maxWidth } = props
|
|
378
361
|
const hasMaxWidth = maxWidth != null;
|
|
@@ -410,14 +393,14 @@ function generatePreactLayoutGrid() {
|
|
|
410
393
|
}
|
|
411
394
|
|
|
412
395
|
// src/generators/jsx/preact-pattern.ts
|
|
413
|
-
import { outdent as
|
|
396
|
+
import { outdent as outdent7 } from "outdent";
|
|
414
397
|
import { match } from "ts-pattern";
|
|
415
398
|
function generate(ctx, name, pattern) {
|
|
416
399
|
const { upperName, styleFn, dashName, jsxName, props } = ctx.getPatternDetails(name, pattern);
|
|
417
400
|
const { componentName } = ctx.jsxFactoryDetails;
|
|
418
401
|
return {
|
|
419
402
|
name: dashName,
|
|
420
|
-
js:
|
|
403
|
+
js: outdent7`
|
|
421
404
|
import { forwardRef } from 'preact/compat'
|
|
422
405
|
import { ${ctx.jsxFactory} } from './factory'
|
|
423
406
|
import { ${styleFn} } from '../patterns/${dashName}'
|
|
@@ -425,11 +408,11 @@ function generate(ctx, name, pattern) {
|
|
|
425
408
|
export const ${jsxName} = forwardRef(function ${jsxName}(props, ref) {
|
|
426
409
|
${match(props.length).with(
|
|
427
410
|
0,
|
|
428
|
-
() =>
|
|
411
|
+
() => outdent7`
|
|
429
412
|
return <${ctx.jsxFactory}.div ref={ref} {...props} />
|
|
430
413
|
`
|
|
431
414
|
).otherwise(
|
|
432
|
-
() =>
|
|
415
|
+
() => outdent7`
|
|
433
416
|
const { ${props.join(", ")}, ...restProps } = props
|
|
434
417
|
const styleProps = ${styleFn}({${props.join(", ")}})
|
|
435
418
|
return <${ctx.jsxFactory}.div ref={ref} {...styleProps} {...restProps} />
|
|
@@ -437,7 +420,7 @@ function generate(ctx, name, pattern) {
|
|
|
437
420
|
)}
|
|
438
421
|
})
|
|
439
422
|
`,
|
|
440
|
-
dts:
|
|
423
|
+
dts: outdent7`
|
|
441
424
|
import { ${upperName}Properties } from '../patterns/${dashName}'
|
|
442
425
|
import { ${componentName} } from '../types/jsx'
|
|
443
426
|
|
|
@@ -451,15 +434,15 @@ function generatePreactJsxPattern(ctx) {
|
|
|
451
434
|
}
|
|
452
435
|
|
|
453
436
|
// src/generators/jsx/preact-types.ts
|
|
454
|
-
import { outdent as
|
|
437
|
+
import { outdent as outdent8 } from "outdent";
|
|
455
438
|
function generatePreactJsxTypes(ctx) {
|
|
456
439
|
const { name, componentName, upperName, typeName } = ctx.jsxFactoryDetails;
|
|
457
440
|
return {
|
|
458
|
-
jsxFactory:
|
|
441
|
+
jsxFactory: outdent8`
|
|
459
442
|
import { ${upperName} } from '../types/jsx'
|
|
460
443
|
export declare const ${name}: ${upperName}
|
|
461
444
|
`,
|
|
462
|
-
jsxType:
|
|
445
|
+
jsxType: outdent8`
|
|
463
446
|
import type { JSX, ElementType, ComponentProps } from 'preact'
|
|
464
447
|
import type { JsxStyleProps, Assign } from '.'
|
|
465
448
|
|
|
@@ -503,11 +486,11 @@ export type ${typeName}<ComponentType extends ElementType> = Polyfill<ComponentP
|
|
|
503
486
|
}
|
|
504
487
|
|
|
505
488
|
// src/generators/jsx/react-jsx.ts
|
|
506
|
-
import { outdent as
|
|
489
|
+
import { outdent as outdent9 } from "outdent";
|
|
507
490
|
function generateReactJsxFactory(ctx) {
|
|
508
491
|
const { name, componentName } = ctx.jsxFactoryDetails;
|
|
509
492
|
return {
|
|
510
|
-
js:
|
|
493
|
+
js: outdent9`
|
|
511
494
|
import { forwardRef, useMemo } from 'react'
|
|
512
495
|
import { isCssProperty } from './is-valid-prop'
|
|
513
496
|
import { css, cx } from '../css'
|
|
@@ -575,10 +558,10 @@ function generateReactJsxFactory(ctx) {
|
|
|
575
558
|
}
|
|
576
559
|
|
|
577
560
|
// src/generators/jsx/react-layout-grid.ts
|
|
578
|
-
import { outdent as
|
|
561
|
+
import { outdent as outdent10 } from "outdent";
|
|
579
562
|
function generateReactLayoutGrid() {
|
|
580
563
|
return {
|
|
581
|
-
dts:
|
|
564
|
+
dts: outdent10`
|
|
582
565
|
import type { FunctionComponent } from 'react'
|
|
583
566
|
|
|
584
567
|
export type LayoutGridProps = {
|
|
@@ -590,7 +573,7 @@ function generateReactLayoutGrid() {
|
|
|
590
573
|
|
|
591
574
|
export declare const LayoutGrid: FunctionComponent<LayoutGridProps>
|
|
592
575
|
`,
|
|
593
|
-
js:
|
|
576
|
+
js: outdent10`
|
|
594
577
|
export function LayoutGrid(props) {
|
|
595
578
|
const { count = 12, margin, gutter = '24px', maxWidth } = props
|
|
596
579
|
const hasMaxWidth = maxWidth != null;
|
|
@@ -628,14 +611,14 @@ function generateReactLayoutGrid() {
|
|
|
628
611
|
}
|
|
629
612
|
|
|
630
613
|
// src/generators/jsx/react-pattern.ts
|
|
631
|
-
import { outdent as
|
|
614
|
+
import { outdent as outdent11 } from "outdent";
|
|
632
615
|
import { match as match2 } from "ts-pattern";
|
|
633
616
|
function generate2(ctx, name, pattern) {
|
|
634
617
|
const { upperName, styleFn, dashName, jsxName, props } = ctx.getPatternDetails(name, pattern);
|
|
635
618
|
const { componentName } = ctx.jsxFactoryDetails;
|
|
636
619
|
return {
|
|
637
620
|
name: dashName,
|
|
638
|
-
js:
|
|
621
|
+
js: outdent11`
|
|
639
622
|
import { forwardRef } from 'react'
|
|
640
623
|
import { ${ctx.jsxFactory} } from './factory'
|
|
641
624
|
import { ${styleFn} } from '../patterns/${dashName}'
|
|
@@ -643,11 +626,11 @@ function generate2(ctx, name, pattern) {
|
|
|
643
626
|
export const ${jsxName} = forwardRef(function ${jsxName}(props, ref) {
|
|
644
627
|
${match2(props.length).with(
|
|
645
628
|
0,
|
|
646
|
-
() =>
|
|
629
|
+
() => outdent11`
|
|
647
630
|
return <${ctx.jsxFactory}.div ref={ref} {...props} />
|
|
648
631
|
`
|
|
649
632
|
).otherwise(
|
|
650
|
-
() =>
|
|
633
|
+
() => outdent11`
|
|
651
634
|
const { ${props.join(", ")}, ...restProps } = props
|
|
652
635
|
const styleProps = ${styleFn}({${props.join(", ")}})
|
|
653
636
|
return <${ctx.jsxFactory}.div ref={ref} {...styleProps} {...restProps} />
|
|
@@ -656,7 +639,7 @@ function generate2(ctx, name, pattern) {
|
|
|
656
639
|
|
|
657
640
|
})
|
|
658
641
|
`,
|
|
659
|
-
dts:
|
|
642
|
+
dts: outdent11`
|
|
660
643
|
import { ${upperName}Properties } from '../patterns/${dashName}'
|
|
661
644
|
import { ${componentName} } from '../types/jsx'
|
|
662
645
|
|
|
@@ -670,15 +653,15 @@ function generateReactJsxPattern(ctx) {
|
|
|
670
653
|
}
|
|
671
654
|
|
|
672
655
|
// src/generators/jsx/react-types.ts
|
|
673
|
-
import { outdent as
|
|
656
|
+
import { outdent as outdent12 } from "outdent";
|
|
674
657
|
function generateReactJsxTypes(ctx) {
|
|
675
658
|
const { name, componentName, upperName, typeName } = ctx.jsxFactoryDetails;
|
|
676
659
|
return {
|
|
677
|
-
jsxFactory:
|
|
660
|
+
jsxFactory: outdent12`
|
|
678
661
|
import { ${upperName} } from '../types/jsx'
|
|
679
662
|
export declare const ${name}: ${upperName}
|
|
680
663
|
`,
|
|
681
|
-
jsxType:
|
|
664
|
+
jsxType: outdent12`
|
|
682
665
|
import type { ElementType, ComponentProps } from 'react'
|
|
683
666
|
import type { JsxStyleProps, Assign } from '.'
|
|
684
667
|
|
|
@@ -722,11 +705,11 @@ export type ${typeName}<ComponentType extends ElementType> = Polyfill<ComponentP
|
|
|
722
705
|
}
|
|
723
706
|
|
|
724
707
|
// src/generators/jsx/solid-jsx.ts
|
|
725
|
-
import { outdent as
|
|
708
|
+
import { outdent as outdent13 } from "outdent";
|
|
726
709
|
function generateSolidJsxFactory(ctx) {
|
|
727
710
|
const { componentName, name } = ctx.jsxFactoryDetails;
|
|
728
711
|
return {
|
|
729
|
-
js:
|
|
712
|
+
js: outdent13`
|
|
730
713
|
import { Dynamic } from 'solid-js/web'
|
|
731
714
|
import { mergeProps, splitProps } from 'solid-js'
|
|
732
715
|
import { allCssProperties } from './is-valid-prop'
|
|
@@ -789,10 +772,10 @@ function generateSolidJsxFactory(ctx) {
|
|
|
789
772
|
}
|
|
790
773
|
|
|
791
774
|
// src/generators/jsx/solid-layout-grid.ts
|
|
792
|
-
import { outdent as
|
|
775
|
+
import { outdent as outdent14 } from "outdent";
|
|
793
776
|
function generateSolidLayoutGrid() {
|
|
794
777
|
return {
|
|
795
|
-
dts:
|
|
778
|
+
dts: outdent14`
|
|
796
779
|
import { ParentProps } from 'solid-js'
|
|
797
780
|
|
|
798
781
|
export type LayoutGridProps = {
|
|
@@ -804,7 +787,7 @@ function generateSolidLayoutGrid() {
|
|
|
804
787
|
|
|
805
788
|
export declare const LayoutGrid: ParentProps<LayoutGridProps>
|
|
806
789
|
`,
|
|
807
|
-
js:
|
|
790
|
+
js: outdent14`
|
|
808
791
|
export function LayoutGrid(props) {
|
|
809
792
|
const { count = 12, margin, gutter = '24px', maxWidth } = props
|
|
810
793
|
const hasMaxWidth = maxWidth != null;
|
|
@@ -842,14 +825,14 @@ function generateSolidLayoutGrid() {
|
|
|
842
825
|
}
|
|
843
826
|
|
|
844
827
|
// src/generators/jsx/solid-pattern.ts
|
|
845
|
-
import { outdent as
|
|
828
|
+
import { outdent as outdent15 } from "outdent";
|
|
846
829
|
import { match as match3 } from "ts-pattern";
|
|
847
830
|
function generate3(ctx, name, pattern) {
|
|
848
831
|
const { upperName, styleFn, dashName, jsxName, props } = ctx.getPatternDetails(name, pattern);
|
|
849
832
|
const { componentName } = ctx.jsxFactoryDetails;
|
|
850
833
|
return {
|
|
851
834
|
name: dashName,
|
|
852
|
-
js:
|
|
835
|
+
js: outdent15`
|
|
853
836
|
import { splitProps } from 'solid-js'
|
|
854
837
|
import { ${ctx.jsxFactory} } from './factory'
|
|
855
838
|
import { ${styleFn} } from '../patterns/${dashName}'
|
|
@@ -857,11 +840,11 @@ function generate3(ctx, name, pattern) {
|
|
|
857
840
|
export function ${jsxName}(props) {
|
|
858
841
|
${match3(props.length).with(
|
|
859
842
|
0,
|
|
860
|
-
() =>
|
|
843
|
+
() => outdent15`
|
|
861
844
|
return <${ctx.jsxFactory}.div {...props} />
|
|
862
845
|
`
|
|
863
846
|
).otherwise(
|
|
864
|
-
() =>
|
|
847
|
+
() => outdent15`
|
|
865
848
|
const [patternProps, restProps] = splitProps(props, [${props.map((v) => JSON.stringify(v)).join(", ")}]);
|
|
866
849
|
const styleProps = ${styleFn}(patternProps)
|
|
867
850
|
return <${ctx.jsxFactory}.div {...styleProps} {...restProps} />
|
|
@@ -869,7 +852,7 @@ function generate3(ctx, name, pattern) {
|
|
|
869
852
|
)}
|
|
870
853
|
}
|
|
871
854
|
`,
|
|
872
|
-
dts:
|
|
855
|
+
dts: outdent15`
|
|
873
856
|
import { ${upperName}Properties } from '../patterns/${dashName}'
|
|
874
857
|
import { ${componentName} } from '../types/jsx'
|
|
875
858
|
|
|
@@ -883,15 +866,15 @@ function generateSolidJsxPattern(ctx) {
|
|
|
883
866
|
}
|
|
884
867
|
|
|
885
868
|
// src/generators/jsx/solid-types.ts
|
|
886
|
-
import { outdent as
|
|
869
|
+
import { outdent as outdent16 } from "outdent";
|
|
887
870
|
function generateSolidJsxTypes(ctx) {
|
|
888
871
|
const { name, componentName, upperName, typeName } = ctx.jsxFactoryDetails;
|
|
889
872
|
return {
|
|
890
|
-
jsxFactory:
|
|
873
|
+
jsxFactory: outdent16`
|
|
891
874
|
import { ${upperName} } from '../types/jsx'
|
|
892
875
|
export declare const ${name}: ${upperName}
|
|
893
876
|
`,
|
|
894
|
-
jsxType:
|
|
877
|
+
jsxType: outdent16`
|
|
895
878
|
import type { JSX, ComponentProps, Component } from 'solid-js'
|
|
896
879
|
import type { JsxStyleProps, Assign } from '.'
|
|
897
880
|
|
|
@@ -977,7 +960,7 @@ function generateLayoutGrid(ctx) {
|
|
|
977
960
|
|
|
978
961
|
// src/generators/pattern.ts
|
|
979
962
|
import { capitalize, dashCase, unionType as unionType2 } from "@pandacss/shared";
|
|
980
|
-
import { outdent as
|
|
963
|
+
import { outdent as outdent17 } from "outdent";
|
|
981
964
|
import { stringify as stringify2 } from "telejson";
|
|
982
965
|
import { match as match4 } from "ts-pattern";
|
|
983
966
|
function generate4(name, pattern) {
|
|
@@ -986,7 +969,7 @@ function generate4(name, pattern) {
|
|
|
986
969
|
const upperFn = `get${upperName}Style`;
|
|
987
970
|
return {
|
|
988
971
|
name: dashCase(name),
|
|
989
|
-
dts:
|
|
972
|
+
dts: outdent17`
|
|
990
973
|
import { SystemStyleObject, ConditionalValue } from "../types"
|
|
991
974
|
import { Properties } from "../types/csstype"
|
|
992
975
|
import { Tokens } from "../types/token"
|
|
@@ -1009,14 +992,14 @@ function generate4(name, pattern) {
|
|
|
1009
992
|
}).join("\n ")}
|
|
1010
993
|
}
|
|
1011
994
|
|
|
1012
|
-
${strict ?
|
|
995
|
+
${strict ? outdent17`export declare function ${name}(options: ${upperName}Properties): string` : outdent17`
|
|
1013
996
|
|
|
1014
997
|
${description ? `/** ${description} */` : ""}
|
|
1015
998
|
export declare function ${name}(options: SystemStyleObject<${upperName}Properties>): string
|
|
1016
999
|
`}
|
|
1017
1000
|
|
|
1018
1001
|
`,
|
|
1019
|
-
js:
|
|
1002
|
+
js: outdent17`
|
|
1020
1003
|
import { mapObject } from "../helpers"
|
|
1021
1004
|
import { css } from "../css"
|
|
1022
1005
|
|
|
@@ -1035,10 +1018,10 @@ function generatePattern(ctx) {
|
|
|
1035
1018
|
}
|
|
1036
1019
|
|
|
1037
1020
|
// src/generators/prop-types.ts
|
|
1038
|
-
import { outdent as
|
|
1021
|
+
import { outdent as outdent18 } from "outdent";
|
|
1039
1022
|
function generatePropTypes(utility) {
|
|
1040
1023
|
const result = [
|
|
1041
|
-
|
|
1024
|
+
outdent18`
|
|
1042
1025
|
import { Properties as CSSProperties } from './csstype'
|
|
1043
1026
|
import { Tokens } from './token'
|
|
1044
1027
|
|
|
@@ -1067,15 +1050,15 @@ function generatePropTypes(utility) {
|
|
|
1067
1050
|
|
|
1068
1051
|
// src/generators/recipe.ts
|
|
1069
1052
|
import { capitalize as capitalize2, unionType as unionType3 } from "@pandacss/shared";
|
|
1070
|
-
import { outdent as
|
|
1053
|
+
import { outdent as outdent19 } from "outdent";
|
|
1071
1054
|
function generateRecipes(ctx) {
|
|
1072
1055
|
const { recipes = {}, hash, hasRecipes, utility } = ctx;
|
|
1073
1056
|
const { separator } = utility;
|
|
1074
1057
|
if (!hasRecipes)
|
|
1075
1058
|
return;
|
|
1076
1059
|
const js = [
|
|
1077
|
-
|
|
1078
|
-
import { createCss, withoutSpace, compact } from
|
|
1060
|
+
outdent19`
|
|
1061
|
+
import { createCss, withoutSpace, compact } from '../helpers'
|
|
1079
1062
|
|
|
1080
1063
|
const createRecipe = (name, defaultVariants) => {
|
|
1081
1064
|
return (variants) => {
|
|
@@ -1106,15 +1089,17 @@ function generateRecipes(ctx) {
|
|
|
1106
1089
|
}
|
|
1107
1090
|
`
|
|
1108
1091
|
];
|
|
1109
|
-
const dts = [
|
|
1092
|
+
const dts = [
|
|
1093
|
+
outdent19`
|
|
1094
|
+
import { ConditionalValue } from '../types'
|
|
1095
|
+
`
|
|
1096
|
+
];
|
|
1110
1097
|
Object.values(recipes).forEach((recipe) => {
|
|
1111
1098
|
const { name, description, defaultVariants, variants } = recipe;
|
|
1112
|
-
js.push(
|
|
1099
|
+
js.push(outdent19`
|
|
1113
1100
|
export const ${name} = createRecipe('${name}', ${JSON.stringify(defaultVariants ?? {})})
|
|
1114
1101
|
`);
|
|
1115
|
-
dts.push(
|
|
1116
|
-
import { ConditionalValue } from "../types"
|
|
1117
|
-
|
|
1102
|
+
dts.push(outdent19`
|
|
1118
1103
|
export type ${capitalize2(name)}Variants = {
|
|
1119
1104
|
${Object.keys(variants ?? {}).map((key) => {
|
|
1120
1105
|
const value = variants[key];
|
|
@@ -1128,8 +1113,8 @@ function generateRecipes(ctx) {
|
|
|
1128
1113
|
`);
|
|
1129
1114
|
});
|
|
1130
1115
|
return {
|
|
1131
|
-
js:
|
|
1132
|
-
dts:
|
|
1116
|
+
js: outdent19.string(js.join("\n\n")),
|
|
1117
|
+
dts: outdent19.string(dts.join("\n\n"))
|
|
1133
1118
|
};
|
|
1134
1119
|
}
|
|
1135
1120
|
|
|
@@ -1308,7 +1293,7 @@ function cleanupSelectors(css2, varSelector) {
|
|
|
1308
1293
|
|
|
1309
1294
|
// src/generators/token-dts.ts
|
|
1310
1295
|
import { unionType as unionType4, capitalize as capitalize3 } from "@pandacss/shared";
|
|
1311
|
-
import { outdent as
|
|
1296
|
+
import { outdent as outdent20 } from "outdent";
|
|
1312
1297
|
import pluralize from "pluralize";
|
|
1313
1298
|
function generateTokenDts(dict) {
|
|
1314
1299
|
const set = /* @__PURE__ */ new Set();
|
|
@@ -1326,11 +1311,11 @@ function generateTokenDts(dict) {
|
|
|
1326
1311
|
}
|
|
1327
1312
|
result.add("} & { [token: string]: never }");
|
|
1328
1313
|
set.add(Array.from(result).join("\n"));
|
|
1329
|
-
return
|
|
1314
|
+
return outdent20.string(Array.from(set).join("\n\n"));
|
|
1330
1315
|
}
|
|
1331
1316
|
|
|
1332
1317
|
// src/generators/token-js.ts
|
|
1333
|
-
import
|
|
1318
|
+
import outdent21 from "outdent";
|
|
1334
1319
|
function generateTokenJs(dict) {
|
|
1335
1320
|
const map = /* @__PURE__ */ new Map();
|
|
1336
1321
|
dict.allTokens.forEach((token) => {
|
|
@@ -1340,7 +1325,7 @@ function generateTokenJs(dict) {
|
|
|
1340
1325
|
});
|
|
1341
1326
|
const obj = Object.fromEntries(map);
|
|
1342
1327
|
return {
|
|
1343
|
-
js:
|
|
1328
|
+
js: outdent21`
|
|
1344
1329
|
const tokens = ${JSON.stringify(obj, null, 2)}
|
|
1345
1330
|
|
|
1346
1331
|
export function getToken(path) {
|
|
@@ -1353,7 +1338,7 @@ function generateTokenJs(dict) {
|
|
|
1353
1338
|
return variable
|
|
1354
1339
|
}
|
|
1355
1340
|
`,
|
|
1356
|
-
dts:
|
|
1341
|
+
dts: outdent21`
|
|
1357
1342
|
import { Token } from "../types/token"
|
|
1358
1343
|
export declare function getToken(path: Token): string
|
|
1359
1344
|
export declare function getTokenVar(path: Token): string
|
|
@@ -1363,7 +1348,7 @@ function generateTokenJs(dict) {
|
|
|
1363
1348
|
|
|
1364
1349
|
// src/generators/types.ts
|
|
1365
1350
|
import { readFileSync as readFileSync2 } from "fs-extra";
|
|
1366
|
-
import
|
|
1351
|
+
import outdent22 from "outdent";
|
|
1367
1352
|
function getType(file) {
|
|
1368
1353
|
const filepath = getEntrypoint("@pandacss/types", { dev: file });
|
|
1369
1354
|
return readFileSync2(filepath, "utf8");
|
|
@@ -1374,7 +1359,7 @@ function generateCssType(ctx) {
|
|
|
1374
1359
|
return {
|
|
1375
1360
|
cssType: getType("csstype.d.ts"),
|
|
1376
1361
|
pandaCssType: getType("system-types.d.ts"),
|
|
1377
|
-
publicType:
|
|
1362
|
+
publicType: outdent22`
|
|
1378
1363
|
import * as System from './system-types'
|
|
1379
1364
|
import { PropTypes } from './prop-type'
|
|
1380
1365
|
import { Conditions } from './conditions'
|
|
@@ -1425,16 +1410,6 @@ function setupDesignTokens(ctx) {
|
|
|
1425
1410
|
]
|
|
1426
1411
|
};
|
|
1427
1412
|
}
|
|
1428
|
-
function setupGlobalCss(ctx) {
|
|
1429
|
-
const code = generateGlobalCss();
|
|
1430
|
-
return {
|
|
1431
|
-
dir: ctx.paths.css,
|
|
1432
|
-
files: [
|
|
1433
|
-
{ file: "global-css.mjs", code: code.js },
|
|
1434
|
-
{ file: "global-css.d.ts", code: code.dts }
|
|
1435
|
-
]
|
|
1436
|
-
};
|
|
1437
|
-
}
|
|
1438
1413
|
function setupTypes(ctx) {
|
|
1439
1414
|
const code = generateCssType(ctx);
|
|
1440
1415
|
const conditions = generateConditions(ctx);
|
|
@@ -1502,7 +1477,7 @@ function setupPatterns(ctx) {
|
|
|
1502
1477
|
if (!files) {
|
|
1503
1478
|
return { files: [] };
|
|
1504
1479
|
}
|
|
1505
|
-
const indexCode =
|
|
1480
|
+
const indexCode = outdent23.string(files.map((file) => `export * from './${file.name}'`).join("\n"));
|
|
1506
1481
|
return {
|
|
1507
1482
|
dir: ctx.paths.pattern,
|
|
1508
1483
|
files: [
|
|
@@ -1521,10 +1496,10 @@ function setupJsx(ctx) {
|
|
|
1521
1496
|
const factory = generateJsxFactory(ctx);
|
|
1522
1497
|
const patterns = generateJsxPatterns(ctx);
|
|
1523
1498
|
const layoutGrid = generateLayoutGrid(ctx);
|
|
1524
|
-
const indexCode =
|
|
1499
|
+
const indexCode = outdent23`
|
|
1525
1500
|
export * from './factory'
|
|
1526
1501
|
export * from './layout-grid'
|
|
1527
|
-
${
|
|
1502
|
+
${outdent23.string(patterns.map((file) => `export * from './${file.name}'`).join("\n"))}
|
|
1528
1503
|
`;
|
|
1529
1504
|
return {
|
|
1530
1505
|
dir: ctx.paths.jsx,
|
|
@@ -1538,7 +1513,7 @@ function setupJsx(ctx) {
|
|
|
1538
1513
|
{ file: "factory.jsx", code: factory.js },
|
|
1539
1514
|
{
|
|
1540
1515
|
file: "index.d.ts",
|
|
1541
|
-
code:
|
|
1516
|
+
code: outdent23`
|
|
1542
1517
|
${indexCode}
|
|
1543
1518
|
export type { ${ctx.jsxFactoryDetails.typeName} } from '../types/jsx'
|
|
1544
1519
|
`
|
|
@@ -1548,7 +1523,7 @@ function setupJsx(ctx) {
|
|
|
1548
1523
|
};
|
|
1549
1524
|
}
|
|
1550
1525
|
function setupCssIndex(ctx) {
|
|
1551
|
-
const code =
|
|
1526
|
+
const code = outdent23`
|
|
1552
1527
|
export * from './css'
|
|
1553
1528
|
export * from './cx'
|
|
1554
1529
|
export * from './global-css'
|
|
@@ -1577,7 +1552,6 @@ function generateSystem(ctx) {
|
|
|
1577
1552
|
setupCssMap(ctx),
|
|
1578
1553
|
setupCx(ctx),
|
|
1579
1554
|
setupCss(ctx),
|
|
1580
|
-
setupGlobalCss(ctx),
|
|
1581
1555
|
setupRecipes(ctx),
|
|
1582
1556
|
setupPatterns(ctx),
|
|
1583
1557
|
setupCssIndex(ctx),
|
|
@@ -1588,30 +1562,30 @@ function generateSystem(ctx) {
|
|
|
1588
1562
|
|
|
1589
1563
|
// src/messages.ts
|
|
1590
1564
|
import { colors, logger as logger3, quote as quote2 } from "@pandacss/logger";
|
|
1591
|
-
import { outdent as
|
|
1565
|
+
import { outdent as outdent24 } from "outdent";
|
|
1592
1566
|
var tick = colors.green().bold("\u2714\uFE0F");
|
|
1593
1567
|
function artifactsGeneratedMessage(ctx) {
|
|
1594
1568
|
return [
|
|
1595
|
-
|
|
1569
|
+
outdent24`
|
|
1596
1570
|
${tick} ${quote2(ctx.outdir, "/css")}: the css function to author styles
|
|
1597
1571
|
`,
|
|
1598
|
-
ctx.hasTokens &&
|
|
1572
|
+
ctx.hasTokens && outdent24`
|
|
1599
1573
|
${tick} ${quote2(ctx.outdir, "/tokens")}: the css variables and js function to query your tokens
|
|
1600
1574
|
`,
|
|
1601
|
-
ctx.hasPatterns &&
|
|
1575
|
+
ctx.hasPatterns && outdent24`
|
|
1602
1576
|
${tick} ${quote2(ctx.outdir, "/patterns")}: functions to implement common css patterns
|
|
1603
1577
|
`,
|
|
1604
|
-
ctx.hasRecipes &&
|
|
1578
|
+
ctx.hasRecipes && outdent24`
|
|
1605
1579
|
${tick} ${quote2(ctx.outdir, "/recipes")}: functions to create multi-variant styles
|
|
1606
1580
|
`,
|
|
1607
|
-
ctx.jsxFramework &&
|
|
1581
|
+
ctx.jsxFramework && outdent24`
|
|
1608
1582
|
${tick} ${quote2(ctx.outdir, "/jsx")}: style prop powered elements for ${ctx.jsxFramework}
|
|
1609
1583
|
`,
|
|
1610
1584
|
"\n"
|
|
1611
1585
|
].filter(Boolean).join("\n");
|
|
1612
1586
|
}
|
|
1613
1587
|
function configExistsMessage(cmd) {
|
|
1614
|
-
return
|
|
1588
|
+
return outdent24`
|
|
1615
1589
|
\n
|
|
1616
1590
|
It looks like you already have panda created\`.
|
|
1617
1591
|
|
|
@@ -1620,7 +1594,7 @@ function configExistsMessage(cmd) {
|
|
|
1620
1594
|
`;
|
|
1621
1595
|
}
|
|
1622
1596
|
function thankYouMessage() {
|
|
1623
|
-
return
|
|
1597
|
+
return outdent24`
|
|
1624
1598
|
|
|
1625
1599
|
🚀 Thanks for choosing ${colors.cyan("Panda")} to write your css.
|
|
1626
1600
|
|
|
@@ -1632,7 +1606,7 @@ var randomWords = ["Sweet", "Divine", "Pandalicious", "Super"];
|
|
|
1632
1606
|
var pickRandom = (arr) => arr[Math.floor(Math.random() * arr.length)];
|
|
1633
1607
|
function scaffoldCompleteMessage() {
|
|
1634
1608
|
return logger3.box(
|
|
1635
|
-
|
|
1609
|
+
outdent24`
|
|
1636
1610
|
|
|
1637
1611
|
${colors.bold().cyan("Next steps:")}
|
|
1638
1612
|
|
|
@@ -1648,12 +1622,12 @@ function scaffoldCompleteMessage() {
|
|
|
1648
1622
|
);
|
|
1649
1623
|
}
|
|
1650
1624
|
function watchMessage() {
|
|
1651
|
-
return
|
|
1625
|
+
return outdent24`
|
|
1652
1626
|
Watching for file changes...
|
|
1653
1627
|
`;
|
|
1654
1628
|
}
|
|
1655
1629
|
function buildCompleteMessage(ctx) {
|
|
1656
|
-
return
|
|
1630
|
+
return outdent24`
|
|
1657
1631
|
Successfully extracted css from ${ctx.files.length} file(s) ✨
|
|
1658
1632
|
`;
|
|
1659
1633
|
}
|
|
@@ -2018,9 +1992,6 @@ function createContext(conf, io = fileSystem) {
|
|
|
2018
1992
|
}
|
|
2019
1993
|
function getCss(collector, file) {
|
|
2020
1994
|
const sheet = new Stylesheet2(context());
|
|
2021
|
-
collector.globalCss.forEach((result) => {
|
|
2022
|
-
sheet.processGlobalCss(result.data);
|
|
2023
|
-
});
|
|
2024
1995
|
collector.css.forEach((result) => {
|
|
2025
1996
|
sheet.processAtomic(result.data);
|
|
2026
1997
|
});
|
|
@@ -2401,9 +2372,9 @@ async function generate5(config, configPath) {
|
|
|
2401
2372
|
// src/git-ignore.ts
|
|
2402
2373
|
import { appendFileSync, readFileSync as readFileSync6, writeFileSync } from "fs";
|
|
2403
2374
|
import { lookItUpSync as lookItUpSync2 } from "look-it-up";
|
|
2404
|
-
import
|
|
2375
|
+
import outdent25 from "outdent";
|
|
2405
2376
|
function setupGitIgnore(ctx) {
|
|
2406
|
-
const txt =
|
|
2377
|
+
const txt = outdent25`## CSS Panda
|
|
2407
2378
|
${ctx.outdir}
|
|
2408
2379
|
${ctx.outdir}-static
|
|
2409
2380
|
`;
|
|
@@ -2421,7 +2392,7 @@ function setupGitIgnore(ctx) {
|
|
|
2421
2392
|
import { logger as logger9, quote as quote3 } from "@pandacss/logger";
|
|
2422
2393
|
import { writeFile as writeFile2 } from "fs-extra";
|
|
2423
2394
|
import { lookItUpSync as lookItUpSync3 } from "look-it-up";
|
|
2424
|
-
import { outdent as
|
|
2395
|
+
import { outdent as outdent26 } from "outdent";
|
|
2425
2396
|
import { join as join4 } from "path";
|
|
2426
2397
|
import getPackageManager2 from "preferred-pm";
|
|
2427
2398
|
async function setupConfig(cwd, { force }) {
|
|
@@ -2435,7 +2406,7 @@ async function setupConfig(cwd, { force }) {
|
|
|
2435
2406
|
if (!force && configFile) {
|
|
2436
2407
|
logger9.warn("config exists", configExistsMessage(cmd));
|
|
2437
2408
|
} else {
|
|
2438
|
-
const content =
|
|
2409
|
+
const content = outdent26`
|
|
2439
2410
|
import { defineConfig } from "css-panda"
|
|
2440
2411
|
|
|
2441
2412
|
export default defineConfig({
|
|
@@ -2461,7 +2432,7 @@ async function setupConfig(cwd, { force }) {
|
|
|
2461
2432
|
}
|
|
2462
2433
|
async function setupPostcss(cwd) {
|
|
2463
2434
|
logger9.info({ type: "init", msg: `creating postcss config file: ${quote3("postcss.config.cjs")}` });
|
|
2464
|
-
const content =
|
|
2435
|
+
const content = outdent26`
|
|
2465
2436
|
module.exports = {
|
|
2466
2437
|
plugins: {
|
|
2467
2438
|
'css-panda/postcss': {},
|
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-20230106201243",
|
|
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-20230106201243",
|
|
34
|
+
"@pandacss/is-valid-prop": "0.0.0-dev-20230106201243",
|
|
35
|
+
"@pandacss/error": "0.0.0-dev-20230106201243",
|
|
36
|
+
"@pandacss/parser": "0.0.0-dev-20230106201243",
|
|
37
|
+
"@pandacss/shared": "0.0.0-dev-20230106201243",
|
|
38
|
+
"@pandacss/token-dictionary": "0.0.0-dev-20230106201243",
|
|
39
|
+
"@pandacss/logger": "0.0.0-dev-20230106201243",
|
|
40
|
+
"@pandacss/core": "0.0.0-dev-20230106201243",
|
|
41
|
+
"@pandacss/config": "0.0.0-dev-20230106201243"
|
|
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-20230106201243"
|
|
50
50
|
},
|
|
51
51
|
"scripts": {
|
|
52
52
|
"build": "tsup src/index.ts --format=cjs,esm --shims --dts",
|