@pandacss/node 0.0.0-dev-20230124104736 → 0.0.0-dev-20230125082549
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 +6 -3
- package/dist/index.js +98 -89
- package/dist/index.mjs +98 -89
- package/package.json +11 -11
package/dist/index.d.ts
CHANGED
|
@@ -50,6 +50,7 @@ declare function createContext(conf: LoadConfigResult, io?: IO): {
|
|
|
50
50
|
format(file: string): string;
|
|
51
51
|
write(file: string, css: string): Promise<void[]>;
|
|
52
52
|
rm(file: string): Promise<void>;
|
|
53
|
+
empty(): Promise<void>;
|
|
53
54
|
glob: string[];
|
|
54
55
|
};
|
|
55
56
|
files: string[];
|
|
@@ -147,6 +148,7 @@ declare function createContext(conf: LoadConfigResult, io?: IO): {
|
|
|
147
148
|
file: string;
|
|
148
149
|
} | undefined)[]>;
|
|
149
150
|
hash?: boolean | undefined;
|
|
151
|
+
prefix?: string | undefined;
|
|
150
152
|
separator?: "-" | "_" | "=" | undefined;
|
|
151
153
|
static?: _pandacss_types.StaticCssOptions | undefined;
|
|
152
154
|
minify?: boolean | undefined;
|
|
@@ -158,7 +160,6 @@ declare function createContext(conf: LoadConfigResult, io?: IO): {
|
|
|
158
160
|
presets?: string[] | undefined;
|
|
159
161
|
preflight?: boolean | undefined;
|
|
160
162
|
clean?: boolean | undefined;
|
|
161
|
-
cssVarPrefix?: string | undefined;
|
|
162
163
|
watch?: boolean | undefined;
|
|
163
164
|
poll?: boolean | undefined;
|
|
164
165
|
globalCss?: _pandacss_types.GlobalStyleObject | undefined;
|
|
@@ -208,6 +209,7 @@ declare class Builder {
|
|
|
208
209
|
format(file: string): string;
|
|
209
210
|
write(file: string, css: string): Promise<void[]>;
|
|
210
211
|
rm(file: string): Promise<void>;
|
|
212
|
+
empty(): Promise<void>;
|
|
211
213
|
glob: string[];
|
|
212
214
|
};
|
|
213
215
|
files: string[];
|
|
@@ -305,6 +307,7 @@ declare class Builder {
|
|
|
305
307
|
file: string;
|
|
306
308
|
} | undefined)[]>;
|
|
307
309
|
hash?: boolean | undefined;
|
|
310
|
+
prefix?: string | undefined;
|
|
308
311
|
separator?: "-" | "_" | "=" | undefined;
|
|
309
312
|
static?: _pandacss_types.StaticCssOptions | undefined;
|
|
310
313
|
minify?: boolean | undefined;
|
|
@@ -316,7 +319,6 @@ declare class Builder {
|
|
|
316
319
|
presets?: string[] | undefined;
|
|
317
320
|
preflight?: boolean | undefined;
|
|
318
321
|
clean?: boolean | undefined;
|
|
319
|
-
cssVarPrefix?: string | undefined;
|
|
320
322
|
watch?: boolean | undefined;
|
|
321
323
|
poll?: boolean | undefined;
|
|
322
324
|
globalCss?: _pandacss_types.GlobalStyleObject | undefined;
|
|
@@ -358,6 +360,7 @@ declare function loadConfigAndCreateContext(options?: {
|
|
|
358
360
|
format(file: string): string;
|
|
359
361
|
write(file: string, css: string): Promise<void[]>;
|
|
360
362
|
rm(file: string): Promise<void>;
|
|
363
|
+
empty(): Promise<void>;
|
|
361
364
|
glob: string[];
|
|
362
365
|
};
|
|
363
366
|
files: string[];
|
|
@@ -455,6 +458,7 @@ declare function loadConfigAndCreateContext(options?: {
|
|
|
455
458
|
file: string;
|
|
456
459
|
} | undefined)[]>;
|
|
457
460
|
hash?: boolean | undefined;
|
|
461
|
+
prefix?: string | undefined;
|
|
458
462
|
separator?: "-" | "_" | "=" | undefined;
|
|
459
463
|
static?: _pandacss_types.StaticCssOptions | undefined;
|
|
460
464
|
minify?: boolean | undefined;
|
|
@@ -466,7 +470,6 @@ declare function loadConfigAndCreateContext(options?: {
|
|
|
466
470
|
presets?: string[] | undefined;
|
|
467
471
|
preflight?: boolean | undefined;
|
|
468
472
|
clean?: boolean | undefined;
|
|
469
|
-
cssVarPrefix?: string | undefined;
|
|
470
473
|
watch?: boolean | undefined;
|
|
471
474
|
poll?: boolean | undefined;
|
|
472
475
|
globalCss?: _pandacss_types.GlobalStyleObject | undefined;
|
package/dist/index.js
CHANGED
|
@@ -209,7 +209,7 @@ function generateCssFn(ctx) {
|
|
|
209
209
|
export declare function css(styles: SystemStyleObject): string
|
|
210
210
|
`,
|
|
211
211
|
js: import_outdent2.outdent`
|
|
212
|
-
${ctx.getImport("createCss, createMergeCss, withoutSpace", "../helpers")}
|
|
212
|
+
${ctx.getImport("createCss, createMergeCss, hypenateProperty, withoutSpace", "../helpers")}
|
|
213
213
|
${ctx.getImport("sortConditions, finalizeConditions", "./conditions")}
|
|
214
214
|
|
|
215
215
|
const classNameMap = ${stringify(utility.entries())}
|
|
@@ -224,7 +224,7 @@ function generateCssFn(ctx) {
|
|
|
224
224
|
|
|
225
225
|
function transform(prop, value) {
|
|
226
226
|
const key = resolveShorthand(prop)
|
|
227
|
-
const propKey = classNameMap[key] ||
|
|
227
|
+
const propKey = classNameMap[key] || hypenateProperty(key)
|
|
228
228
|
const className = \`$\{propKey}${separator}$\{withoutSpace(value)}\`
|
|
229
229
|
return { className }
|
|
230
230
|
}
|
|
@@ -237,6 +237,7 @@ function generateCssFn(ctx) {
|
|
|
237
237
|
breakpoints: { keys: breakpointKeys }
|
|
238
238
|
},
|
|
239
239
|
utility: {
|
|
240
|
+
prefix: ${ctx.prefix ? JSON.stringify(ctx.prefix) : void 0},
|
|
240
241
|
transform,
|
|
241
242
|
hasShorthand,
|
|
242
243
|
resolveShorthand,
|
|
@@ -426,47 +427,39 @@ function generatePreactLayoutGrid() {
|
|
|
426
427
|
import { FunctionComponent } from 'preact'
|
|
427
428
|
|
|
428
429
|
export type LayoutGridProps = {
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
430
|
+
count?: number
|
|
431
|
+
gutter?: string
|
|
432
|
+
maxWidth?: string
|
|
433
|
+
margin?: string
|
|
434
|
+
outline?: boolean
|
|
433
435
|
}
|
|
434
436
|
|
|
435
437
|
export declare const LayoutGrid: FunctionComponent<LayoutGridProps>
|
|
436
438
|
`,
|
|
437
439
|
js: import_outdent6.outdent`
|
|
440
|
+
import { h } from 'preact'
|
|
441
|
+
|
|
438
442
|
export function LayoutGrid(props) {
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
key={i}
|
|
460
|
-
style={{
|
|
461
|
-
display: 'flex',
|
|
462
|
-
background: 'rgba(255, 0, 0, 0.1)',
|
|
463
|
-
height: '100%',
|
|
464
|
-
}}
|
|
465
|
-
/>
|
|
466
|
-
))}
|
|
467
|
-
</div>
|
|
468
|
-
);
|
|
469
|
-
}
|
|
443
|
+
const { count = 12, margin, gutter = '24px', maxWidth, outline } = props
|
|
444
|
+
const hasMaxWidth = maxWidth != null
|
|
445
|
+
return h('div', {
|
|
446
|
+
className: 'panda-layout-grid',
|
|
447
|
+
style: {
|
|
448
|
+
'--gutter': gutter,
|
|
449
|
+
'--count': count,
|
|
450
|
+
'--max-width': hasMaxWidth ? maxWidth : 'initial',
|
|
451
|
+
'--margin-x': hasMaxWidth ? 'auto' : undefined,
|
|
452
|
+
'--padding-x': !hasMaxWidth ? margin : undefined,
|
|
453
|
+
},
|
|
454
|
+
children: Array.from({ length: count }).map((_, i) =>
|
|
455
|
+
h('span', {
|
|
456
|
+
'data-variant': outline ? 'outline' : 'bg',
|
|
457
|
+
key: i,
|
|
458
|
+
className: 'panda-layout-grid__item',
|
|
459
|
+
}),
|
|
460
|
+
),
|
|
461
|
+
});
|
|
462
|
+
}
|
|
470
463
|
`
|
|
471
464
|
};
|
|
472
465
|
}
|
|
@@ -628,10 +621,11 @@ function generateReactLayoutGrid() {
|
|
|
628
621
|
import type { FunctionComponent } from 'react'
|
|
629
622
|
|
|
630
623
|
export type LayoutGridProps = {
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
624
|
+
count?: number
|
|
625
|
+
gutter?: string
|
|
626
|
+
maxWidth?: string
|
|
627
|
+
margin?: string
|
|
628
|
+
outline?: boolean
|
|
635
629
|
}
|
|
636
630
|
|
|
637
631
|
export declare const LayoutGrid: FunctionComponent<LayoutGridProps>
|
|
@@ -640,30 +634,22 @@ function generateReactLayoutGrid() {
|
|
|
640
634
|
import { createElement } from 'react'
|
|
641
635
|
|
|
642
636
|
export function LayoutGrid(props) {
|
|
643
|
-
const { count = 12, margin, gutter = '24px', maxWidth } = props
|
|
637
|
+
const { count = 12, margin, gutter = '24px', maxWidth, outline } = props
|
|
644
638
|
const hasMaxWidth = maxWidth != null
|
|
645
639
|
return createElement('div', {
|
|
640
|
+
className: 'panda-layout-grid',
|
|
646
641
|
style: {
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
position: 'absolute',
|
|
653
|
-
inset: '0',
|
|
654
|
-
pointerEvents: 'none',
|
|
655
|
-
maxWidth: hasMaxWidth ? maxWidth : 'initial',
|
|
656
|
-
marginInline: hasMaxWidth ? 'auto' : undefined,
|
|
657
|
-
paddingInline: !hasMaxWidth ? margin : undefined,
|
|
642
|
+
'--gutter': gutter,
|
|
643
|
+
'--count': count,
|
|
644
|
+
'--max-width': hasMaxWidth ? maxWidth : 'initial',
|
|
645
|
+
'--margin-x': hasMaxWidth ? 'auto' : undefined,
|
|
646
|
+
'--padding-x': !hasMaxWidth ? margin : undefined,
|
|
658
647
|
},
|
|
659
648
|
children: Array.from({ length: count }).map((_, i) =>
|
|
660
649
|
createElement('span', {
|
|
650
|
+
'data-variant': outline ? 'outline' : 'bg',
|
|
661
651
|
key: i,
|
|
662
|
-
|
|
663
|
-
display: 'flex',
|
|
664
|
-
background: 'rgba(255, 0, 0, 0.1)',
|
|
665
|
-
height: '100%',
|
|
666
|
-
},
|
|
652
|
+
className: 'panda-layout-grid__item',
|
|
667
653
|
}),
|
|
668
654
|
),
|
|
669
655
|
})
|
|
@@ -838,10 +824,11 @@ function generateSolidLayoutGrid() {
|
|
|
838
824
|
import type { ParentProps } from 'solid-js'
|
|
839
825
|
|
|
840
826
|
export type LayoutGridProps = {
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
827
|
+
count?: number
|
|
828
|
+
gutter?: string
|
|
829
|
+
maxWidth?: string
|
|
830
|
+
margin?: string
|
|
831
|
+
outline?: boolean
|
|
845
832
|
}
|
|
846
833
|
|
|
847
834
|
export declare const LayoutGrid: ParentProps<LayoutGridProps>
|
|
@@ -850,21 +837,16 @@ function generateSolidLayoutGrid() {
|
|
|
850
837
|
import { createComponent, For } from 'solid-js/web'
|
|
851
838
|
|
|
852
839
|
export function LayoutGrid(props) {
|
|
853
|
-
const { count = 12, margin, gutter = '24px', maxWidth } = props
|
|
840
|
+
const { count = 12, margin, gutter = '24px', maxWidth, outline } = props
|
|
854
841
|
const hasMaxWidth = maxWidth != null
|
|
855
842
|
return createComponent('div', {
|
|
843
|
+
className: 'panda-layout-grid',
|
|
856
844
|
style: {
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
'
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
position: 'absolute',
|
|
863
|
-
inset: '0',
|
|
864
|
-
'pointer-events': 'none',
|
|
865
|
-
'max-width': hasMaxWidth ? maxWidth : 'initial',
|
|
866
|
-
'margin-inline': hasMaxWidth ? 'auto' : undefined,
|
|
867
|
-
'padding-inline': !hasMaxWidth ? margin : undefined,
|
|
845
|
+
'--gutter': gutter,
|
|
846
|
+
'--count': count,
|
|
847
|
+
'--max-width': hasMaxWidth ? maxWidth : 'initial',
|
|
848
|
+
'--margin-x': hasMaxWidth ? 'auto' : undefined,
|
|
849
|
+
'--padding-x': !hasMaxWidth ? margin : undefined,
|
|
868
850
|
},
|
|
869
851
|
get children() {
|
|
870
852
|
return createComponent(For, {
|
|
@@ -873,11 +855,8 @@ function generateSolidLayoutGrid() {
|
|
|
873
855
|
},
|
|
874
856
|
children: () =>
|
|
875
857
|
createComponent('span', {
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
background: 'rgba(255, 0, 0, 0.1)',
|
|
879
|
-
height: '100%',
|
|
880
|
-
},
|
|
858
|
+
'data-variant': outline ? 'outline' : 'bg',
|
|
859
|
+
className: 'panda-layout-grid__item',
|
|
881
860
|
}),
|
|
882
861
|
})
|
|
883
862
|
},
|
|
@@ -1160,6 +1139,7 @@ function generateRecipes(ctx) {
|
|
|
1160
1139
|
const context = {
|
|
1161
1140
|
hash: ${hash ? "true" : "false"},
|
|
1162
1141
|
utility: {
|
|
1142
|
+
prefix: ${ctx.prefix ? JSON.stringify(ctx.prefix) : void 0},
|
|
1163
1143
|
transform,
|
|
1164
1144
|
}
|
|
1165
1145
|
}
|
|
@@ -1415,21 +1395,22 @@ function generateTokenJs(dict) {
|
|
|
1415
1395
|
js: import_outdent21.default`
|
|
1416
1396
|
const tokens = ${JSON.stringify(obj, null, 2)}
|
|
1417
1397
|
|
|
1418
|
-
export function token(path) {
|
|
1419
|
-
|
|
1420
|
-
return value
|
|
1398
|
+
export function token(path, fallback) {
|
|
1399
|
+
return tokens[path]?.value || fallback
|
|
1421
1400
|
}
|
|
1422
1401
|
|
|
1423
|
-
function tokenVar(path) {
|
|
1424
|
-
|
|
1425
|
-
return variable
|
|
1402
|
+
function tokenVar(path, fallback) {
|
|
1403
|
+
return tokens[path]?.variable || fallback
|
|
1426
1404
|
}
|
|
1427
1405
|
|
|
1428
1406
|
token.var = tokenVar
|
|
1429
1407
|
`,
|
|
1430
1408
|
dts: import_outdent21.default`
|
|
1431
1409
|
import type { Token } from '../types/token'
|
|
1432
|
-
|
|
1410
|
+
|
|
1411
|
+
export declare function token(path: Token, fallback?: string): string & {
|
|
1412
|
+
var: (path: Token, fallback?: string) => string
|
|
1413
|
+
}
|
|
1433
1414
|
`
|
|
1434
1415
|
};
|
|
1435
1416
|
}
|
|
@@ -1585,7 +1566,7 @@ function setupPatterns(ctx) {
|
|
|
1585
1566
|
return;
|
|
1586
1567
|
const index = {
|
|
1587
1568
|
js: import_outdent23.default.string(files.map((file) => ctx.getExport(`./${file.name}`)).join("\n")),
|
|
1588
|
-
dts: import_outdent23.default.string(files.map((file) => `export
|
|
1569
|
+
dts: import_outdent23.default.string(files.map((file) => `export * from './${file.name}'`).join("\n"))
|
|
1589
1570
|
};
|
|
1590
1571
|
return {
|
|
1591
1572
|
dir: ctx.paths.pattern,
|
|
@@ -1834,7 +1815,7 @@ function createContext(conf, io = fileSystem) {
|
|
|
1834
1815
|
const {
|
|
1835
1816
|
cwd: cwdProp = process.cwd(),
|
|
1836
1817
|
conditions: conditionsProp = {},
|
|
1837
|
-
|
|
1818
|
+
prefix,
|
|
1838
1819
|
cssVarRoot = ":where(:root, :host)",
|
|
1839
1820
|
outdir,
|
|
1840
1821
|
exclude: excludeProp = [],
|
|
@@ -1871,11 +1852,12 @@ function createContext(conf, io = fileSystem) {
|
|
|
1871
1852
|
tokens: tokensProp,
|
|
1872
1853
|
breakpoints,
|
|
1873
1854
|
semanticTokens,
|
|
1874
|
-
prefix
|
|
1855
|
+
prefix
|
|
1875
1856
|
});
|
|
1876
1857
|
const hasTokens = !tokens.isEmpty;
|
|
1877
1858
|
import_logger4.logger.debug({ type: "ctx:token", msg: tokens.allNames });
|
|
1878
1859
|
const utility = new import_core3.Utility({
|
|
1860
|
+
prefix,
|
|
1879
1861
|
tokens,
|
|
1880
1862
|
config: utilities,
|
|
1881
1863
|
separator
|
|
@@ -2038,6 +2020,9 @@ function createContext(conf, io = fileSystem) {
|
|
|
2038
2020
|
const fileName = chunks.format(file);
|
|
2039
2021
|
return io.rm((0, import_path2.join)(paths.chunk, fileName));
|
|
2040
2022
|
},
|
|
2023
|
+
empty() {
|
|
2024
|
+
return (0, import_fs_extra2.emptyDir)(paths.chunk);
|
|
2025
|
+
},
|
|
2041
2026
|
glob: [`${paths.chunk}/**/*.css`]
|
|
2042
2027
|
};
|
|
2043
2028
|
function getFiles() {
|
|
@@ -2100,6 +2085,30 @@ function createContext(conf, io = fileSystem) {
|
|
|
2100
2085
|
sheet.processGlobalCss({
|
|
2101
2086
|
":root": {
|
|
2102
2087
|
"--made-with-panda": `'\u{1F43C}'`
|
|
2088
|
+
},
|
|
2089
|
+
".panda-layout-grid": {
|
|
2090
|
+
display: "grid",
|
|
2091
|
+
gap: "var(--gutter)",
|
|
2092
|
+
gridTemplateColumns: "repeat(var(--count), 1fr)",
|
|
2093
|
+
height: "100%",
|
|
2094
|
+
width: "100%",
|
|
2095
|
+
position: "absolute",
|
|
2096
|
+
inset: "0",
|
|
2097
|
+
pointerEvents: "none",
|
|
2098
|
+
maxWidth: "var(--max-width)",
|
|
2099
|
+
marginInline: "var(--margin-x)",
|
|
2100
|
+
paddingInline: "var(--padding-x)"
|
|
2101
|
+
},
|
|
2102
|
+
".panda-layout-grid__item": {
|
|
2103
|
+
display: "flex",
|
|
2104
|
+
"--color": "rgba(255, 0, 0, 0.1)",
|
|
2105
|
+
height: "100%",
|
|
2106
|
+
"&[data-variant=bg]": {
|
|
2107
|
+
background: "var(--color)"
|
|
2108
|
+
},
|
|
2109
|
+
"&[data-variant=outline]": {
|
|
2110
|
+
borderInline: "1px solid var(--color)"
|
|
2111
|
+
}
|
|
2103
2112
|
}
|
|
2104
2113
|
});
|
|
2105
2114
|
if (globalCss) {
|
package/dist/index.mjs
CHANGED
|
@@ -162,7 +162,7 @@ function generateCssFn(ctx) {
|
|
|
162
162
|
export declare function css(styles: SystemStyleObject): string
|
|
163
163
|
`,
|
|
164
164
|
js: outdent2`
|
|
165
|
-
${ctx.getImport("createCss, createMergeCss, withoutSpace", "../helpers")}
|
|
165
|
+
${ctx.getImport("createCss, createMergeCss, hypenateProperty, withoutSpace", "../helpers")}
|
|
166
166
|
${ctx.getImport("sortConditions, finalizeConditions", "./conditions")}
|
|
167
167
|
|
|
168
168
|
const classNameMap = ${stringify(utility.entries())}
|
|
@@ -177,7 +177,7 @@ function generateCssFn(ctx) {
|
|
|
177
177
|
|
|
178
178
|
function transform(prop, value) {
|
|
179
179
|
const key = resolveShorthand(prop)
|
|
180
|
-
const propKey = classNameMap[key] ||
|
|
180
|
+
const propKey = classNameMap[key] || hypenateProperty(key)
|
|
181
181
|
const className = \`$\{propKey}${separator}$\{withoutSpace(value)}\`
|
|
182
182
|
return { className }
|
|
183
183
|
}
|
|
@@ -190,6 +190,7 @@ function generateCssFn(ctx) {
|
|
|
190
190
|
breakpoints: { keys: breakpointKeys }
|
|
191
191
|
},
|
|
192
192
|
utility: {
|
|
193
|
+
prefix: ${ctx.prefix ? JSON.stringify(ctx.prefix) : void 0},
|
|
193
194
|
transform,
|
|
194
195
|
hasShorthand,
|
|
195
196
|
resolveShorthand,
|
|
@@ -379,47 +380,39 @@ function generatePreactLayoutGrid() {
|
|
|
379
380
|
import { FunctionComponent } from 'preact'
|
|
380
381
|
|
|
381
382
|
export type LayoutGridProps = {
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
383
|
+
count?: number
|
|
384
|
+
gutter?: string
|
|
385
|
+
maxWidth?: string
|
|
386
|
+
margin?: string
|
|
387
|
+
outline?: boolean
|
|
386
388
|
}
|
|
387
389
|
|
|
388
390
|
export declare const LayoutGrid: FunctionComponent<LayoutGridProps>
|
|
389
391
|
`,
|
|
390
392
|
js: outdent6`
|
|
393
|
+
import { h } from 'preact'
|
|
394
|
+
|
|
391
395
|
export function LayoutGrid(props) {
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
key={i}
|
|
413
|
-
style={{
|
|
414
|
-
display: 'flex',
|
|
415
|
-
background: 'rgba(255, 0, 0, 0.1)',
|
|
416
|
-
height: '100%',
|
|
417
|
-
}}
|
|
418
|
-
/>
|
|
419
|
-
))}
|
|
420
|
-
</div>
|
|
421
|
-
);
|
|
422
|
-
}
|
|
396
|
+
const { count = 12, margin, gutter = '24px', maxWidth, outline } = props
|
|
397
|
+
const hasMaxWidth = maxWidth != null
|
|
398
|
+
return h('div', {
|
|
399
|
+
className: 'panda-layout-grid',
|
|
400
|
+
style: {
|
|
401
|
+
'--gutter': gutter,
|
|
402
|
+
'--count': count,
|
|
403
|
+
'--max-width': hasMaxWidth ? maxWidth : 'initial',
|
|
404
|
+
'--margin-x': hasMaxWidth ? 'auto' : undefined,
|
|
405
|
+
'--padding-x': !hasMaxWidth ? margin : undefined,
|
|
406
|
+
},
|
|
407
|
+
children: Array.from({ length: count }).map((_, i) =>
|
|
408
|
+
h('span', {
|
|
409
|
+
'data-variant': outline ? 'outline' : 'bg',
|
|
410
|
+
key: i,
|
|
411
|
+
className: 'panda-layout-grid__item',
|
|
412
|
+
}),
|
|
413
|
+
),
|
|
414
|
+
});
|
|
415
|
+
}
|
|
423
416
|
`
|
|
424
417
|
};
|
|
425
418
|
}
|
|
@@ -581,10 +574,11 @@ function generateReactLayoutGrid() {
|
|
|
581
574
|
import type { FunctionComponent } from 'react'
|
|
582
575
|
|
|
583
576
|
export type LayoutGridProps = {
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
577
|
+
count?: number
|
|
578
|
+
gutter?: string
|
|
579
|
+
maxWidth?: string
|
|
580
|
+
margin?: string
|
|
581
|
+
outline?: boolean
|
|
588
582
|
}
|
|
589
583
|
|
|
590
584
|
export declare const LayoutGrid: FunctionComponent<LayoutGridProps>
|
|
@@ -593,30 +587,22 @@ function generateReactLayoutGrid() {
|
|
|
593
587
|
import { createElement } from 'react'
|
|
594
588
|
|
|
595
589
|
export function LayoutGrid(props) {
|
|
596
|
-
const { count = 12, margin, gutter = '24px', maxWidth } = props
|
|
590
|
+
const { count = 12, margin, gutter = '24px', maxWidth, outline } = props
|
|
597
591
|
const hasMaxWidth = maxWidth != null
|
|
598
592
|
return createElement('div', {
|
|
593
|
+
className: 'panda-layout-grid',
|
|
599
594
|
style: {
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
position: 'absolute',
|
|
606
|
-
inset: '0',
|
|
607
|
-
pointerEvents: 'none',
|
|
608
|
-
maxWidth: hasMaxWidth ? maxWidth : 'initial',
|
|
609
|
-
marginInline: hasMaxWidth ? 'auto' : undefined,
|
|
610
|
-
paddingInline: !hasMaxWidth ? margin : undefined,
|
|
595
|
+
'--gutter': gutter,
|
|
596
|
+
'--count': count,
|
|
597
|
+
'--max-width': hasMaxWidth ? maxWidth : 'initial',
|
|
598
|
+
'--margin-x': hasMaxWidth ? 'auto' : undefined,
|
|
599
|
+
'--padding-x': !hasMaxWidth ? margin : undefined,
|
|
611
600
|
},
|
|
612
601
|
children: Array.from({ length: count }).map((_, i) =>
|
|
613
602
|
createElement('span', {
|
|
603
|
+
'data-variant': outline ? 'outline' : 'bg',
|
|
614
604
|
key: i,
|
|
615
|
-
|
|
616
|
-
display: 'flex',
|
|
617
|
-
background: 'rgba(255, 0, 0, 0.1)',
|
|
618
|
-
height: '100%',
|
|
619
|
-
},
|
|
605
|
+
className: 'panda-layout-grid__item',
|
|
620
606
|
}),
|
|
621
607
|
),
|
|
622
608
|
})
|
|
@@ -791,10 +777,11 @@ function generateSolidLayoutGrid() {
|
|
|
791
777
|
import type { ParentProps } from 'solid-js'
|
|
792
778
|
|
|
793
779
|
export type LayoutGridProps = {
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
780
|
+
count?: number
|
|
781
|
+
gutter?: string
|
|
782
|
+
maxWidth?: string
|
|
783
|
+
margin?: string
|
|
784
|
+
outline?: boolean
|
|
798
785
|
}
|
|
799
786
|
|
|
800
787
|
export declare const LayoutGrid: ParentProps<LayoutGridProps>
|
|
@@ -803,21 +790,16 @@ function generateSolidLayoutGrid() {
|
|
|
803
790
|
import { createComponent, For } from 'solid-js/web'
|
|
804
791
|
|
|
805
792
|
export function LayoutGrid(props) {
|
|
806
|
-
const { count = 12, margin, gutter = '24px', maxWidth } = props
|
|
793
|
+
const { count = 12, margin, gutter = '24px', maxWidth, outline } = props
|
|
807
794
|
const hasMaxWidth = maxWidth != null
|
|
808
795
|
return createComponent('div', {
|
|
796
|
+
className: 'panda-layout-grid',
|
|
809
797
|
style: {
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
'
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
position: 'absolute',
|
|
816
|
-
inset: '0',
|
|
817
|
-
'pointer-events': 'none',
|
|
818
|
-
'max-width': hasMaxWidth ? maxWidth : 'initial',
|
|
819
|
-
'margin-inline': hasMaxWidth ? 'auto' : undefined,
|
|
820
|
-
'padding-inline': !hasMaxWidth ? margin : undefined,
|
|
798
|
+
'--gutter': gutter,
|
|
799
|
+
'--count': count,
|
|
800
|
+
'--max-width': hasMaxWidth ? maxWidth : 'initial',
|
|
801
|
+
'--margin-x': hasMaxWidth ? 'auto' : undefined,
|
|
802
|
+
'--padding-x': !hasMaxWidth ? margin : undefined,
|
|
821
803
|
},
|
|
822
804
|
get children() {
|
|
823
805
|
return createComponent(For, {
|
|
@@ -826,11 +808,8 @@ function generateSolidLayoutGrid() {
|
|
|
826
808
|
},
|
|
827
809
|
children: () =>
|
|
828
810
|
createComponent('span', {
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
background: 'rgba(255, 0, 0, 0.1)',
|
|
832
|
-
height: '100%',
|
|
833
|
-
},
|
|
811
|
+
'data-variant': outline ? 'outline' : 'bg',
|
|
812
|
+
className: 'panda-layout-grid__item',
|
|
834
813
|
}),
|
|
835
814
|
})
|
|
836
815
|
},
|
|
@@ -1113,6 +1092,7 @@ function generateRecipes(ctx) {
|
|
|
1113
1092
|
const context = {
|
|
1114
1093
|
hash: ${hash ? "true" : "false"},
|
|
1115
1094
|
utility: {
|
|
1095
|
+
prefix: ${ctx.prefix ? JSON.stringify(ctx.prefix) : void 0},
|
|
1116
1096
|
transform,
|
|
1117
1097
|
}
|
|
1118
1098
|
}
|
|
@@ -1368,21 +1348,22 @@ function generateTokenJs(dict) {
|
|
|
1368
1348
|
js: outdent21`
|
|
1369
1349
|
const tokens = ${JSON.stringify(obj, null, 2)}
|
|
1370
1350
|
|
|
1371
|
-
export function token(path) {
|
|
1372
|
-
|
|
1373
|
-
return value
|
|
1351
|
+
export function token(path, fallback) {
|
|
1352
|
+
return tokens[path]?.value || fallback
|
|
1374
1353
|
}
|
|
1375
1354
|
|
|
1376
|
-
function tokenVar(path) {
|
|
1377
|
-
|
|
1378
|
-
return variable
|
|
1355
|
+
function tokenVar(path, fallback) {
|
|
1356
|
+
return tokens[path]?.variable || fallback
|
|
1379
1357
|
}
|
|
1380
1358
|
|
|
1381
1359
|
token.var = tokenVar
|
|
1382
1360
|
`,
|
|
1383
1361
|
dts: outdent21`
|
|
1384
1362
|
import type { Token } from '../types/token'
|
|
1385
|
-
|
|
1363
|
+
|
|
1364
|
+
export declare function token(path: Token, fallback?: string): string & {
|
|
1365
|
+
var: (path: Token, fallback?: string) => string
|
|
1366
|
+
}
|
|
1386
1367
|
`
|
|
1387
1368
|
};
|
|
1388
1369
|
}
|
|
@@ -1538,7 +1519,7 @@ function setupPatterns(ctx) {
|
|
|
1538
1519
|
return;
|
|
1539
1520
|
const index = {
|
|
1540
1521
|
js: outdent23.string(files.map((file) => ctx.getExport(`./${file.name}`)).join("\n")),
|
|
1541
|
-
dts: outdent23.string(files.map((file) => `export
|
|
1522
|
+
dts: outdent23.string(files.map((file) => `export * from './${file.name}'`).join("\n"))
|
|
1542
1523
|
};
|
|
1543
1524
|
return {
|
|
1544
1525
|
dir: ctx.paths.pattern,
|
|
@@ -1794,7 +1775,7 @@ function createContext(conf, io = fileSystem) {
|
|
|
1794
1775
|
const {
|
|
1795
1776
|
cwd: cwdProp = process.cwd(),
|
|
1796
1777
|
conditions: conditionsProp = {},
|
|
1797
|
-
|
|
1778
|
+
prefix,
|
|
1798
1779
|
cssVarRoot = ":where(:root, :host)",
|
|
1799
1780
|
outdir,
|
|
1800
1781
|
exclude: excludeProp = [],
|
|
@@ -1831,11 +1812,12 @@ function createContext(conf, io = fileSystem) {
|
|
|
1831
1812
|
tokens: tokensProp,
|
|
1832
1813
|
breakpoints,
|
|
1833
1814
|
semanticTokens,
|
|
1834
|
-
prefix
|
|
1815
|
+
prefix
|
|
1835
1816
|
});
|
|
1836
1817
|
const hasTokens = !tokens.isEmpty;
|
|
1837
1818
|
logger4.debug({ type: "ctx:token", msg: tokens.allNames });
|
|
1838
1819
|
const utility = new Utility({
|
|
1820
|
+
prefix,
|
|
1839
1821
|
tokens,
|
|
1840
1822
|
config: utilities,
|
|
1841
1823
|
separator
|
|
@@ -1998,6 +1980,9 @@ function createContext(conf, io = fileSystem) {
|
|
|
1998
1980
|
const fileName = chunks.format(file);
|
|
1999
1981
|
return io.rm(join2(paths.chunk, fileName));
|
|
2000
1982
|
},
|
|
1983
|
+
empty() {
|
|
1984
|
+
return emptyDir(paths.chunk);
|
|
1985
|
+
},
|
|
2001
1986
|
glob: [`${paths.chunk}/**/*.css`]
|
|
2002
1987
|
};
|
|
2003
1988
|
function getFiles() {
|
|
@@ -2060,6 +2045,30 @@ function createContext(conf, io = fileSystem) {
|
|
|
2060
2045
|
sheet.processGlobalCss({
|
|
2061
2046
|
":root": {
|
|
2062
2047
|
"--made-with-panda": `'\u{1F43C}'`
|
|
2048
|
+
},
|
|
2049
|
+
".panda-layout-grid": {
|
|
2050
|
+
display: "grid",
|
|
2051
|
+
gap: "var(--gutter)",
|
|
2052
|
+
gridTemplateColumns: "repeat(var(--count), 1fr)",
|
|
2053
|
+
height: "100%",
|
|
2054
|
+
width: "100%",
|
|
2055
|
+
position: "absolute",
|
|
2056
|
+
inset: "0",
|
|
2057
|
+
pointerEvents: "none",
|
|
2058
|
+
maxWidth: "var(--max-width)",
|
|
2059
|
+
marginInline: "var(--margin-x)",
|
|
2060
|
+
paddingInline: "var(--padding-x)"
|
|
2061
|
+
},
|
|
2062
|
+
".panda-layout-grid__item": {
|
|
2063
|
+
display: "flex",
|
|
2064
|
+
"--color": "rgba(255, 0, 0, 0.1)",
|
|
2065
|
+
height: "100%",
|
|
2066
|
+
"&[data-variant=bg]": {
|
|
2067
|
+
background: "var(--color)"
|
|
2068
|
+
},
|
|
2069
|
+
"&[data-variant=outline]": {
|
|
2070
|
+
borderInline: "1px solid var(--color)"
|
|
2071
|
+
}
|
|
2063
2072
|
}
|
|
2064
2073
|
});
|
|
2065
2074
|
if (globalCss) {
|
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-20230125082549",
|
|
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
|
"javascript-stringify": "2.1.0",
|
|
31
31
|
"ts-pattern": "4.1.3",
|
|
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-20230125082549",
|
|
34
|
+
"@pandacss/is-valid-prop": "0.0.0-dev-20230125082549",
|
|
35
|
+
"@pandacss/error": "0.0.0-dev-20230125082549",
|
|
36
|
+
"@pandacss/parser": "0.0.0-dev-20230125082549",
|
|
37
|
+
"@pandacss/shared": "0.0.0-dev-20230125082549",
|
|
38
|
+
"@pandacss/token-dictionary": "0.0.0-dev-20230125082549",
|
|
39
|
+
"@pandacss/logger": "0.0.0-dev-20230125082549",
|
|
40
|
+
"@pandacss/core": "0.0.0-dev-20230125082549",
|
|
41
|
+
"@pandacss/config": "0.0.0-dev-20230125082549"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@types/fs-extra": "11.0.1",
|
|
@@ -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-20230125082549"
|
|
50
50
|
},
|
|
51
51
|
"scripts": {
|
|
52
52
|
"build": "tsup src/index.ts --format=cjs,esm --shims --dts",
|