@pandacss/generator 0.0.2 → 0.3.0
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 +64 -85
- package/dist/index.js +832 -425
- package/dist/index.mjs +832 -419
- package/package.json +10 -9
package/dist/index.js
CHANGED
|
@@ -124,10 +124,56 @@ var getMessages = (ctx) => ({
|
|
|
124
124
|
});
|
|
125
125
|
|
|
126
126
|
// src/generator.ts
|
|
127
|
-
var
|
|
127
|
+
var import_lil_fp3 = require("lil-fp");
|
|
128
128
|
|
|
129
129
|
// src/artifacts/index.ts
|
|
130
|
-
var
|
|
130
|
+
var import_shared4 = require("@pandacss/shared");
|
|
131
|
+
var import_outdent29 = __toESM(require("outdent"));
|
|
132
|
+
|
|
133
|
+
// src/artifacts/css/global-css.ts
|
|
134
|
+
var generateGlobalCss = (ctx) => {
|
|
135
|
+
const { globalCss = {}, optimize = true } = ctx.config;
|
|
136
|
+
const sheet = ctx.createSheet();
|
|
137
|
+
sheet.processGlobalCss({
|
|
138
|
+
":root": {
|
|
139
|
+
"--made-with-panda": `'\u{1F43C}'`
|
|
140
|
+
},
|
|
141
|
+
"*, *::before, *::after, ::backdrop": {
|
|
142
|
+
"--blur": "/*!*/ /*!*/",
|
|
143
|
+
"--brightness": "/*!*/ /*!*/",
|
|
144
|
+
"--contrast": "/*!*/ /*!*/",
|
|
145
|
+
"--grayscale": "/*!*/ /*!*/",
|
|
146
|
+
"--hue-rotate": "/*!*/ /*!*/",
|
|
147
|
+
"--invert": "/*!*/ /*!*/",
|
|
148
|
+
"--saturate": "/*!*/ /*!*/",
|
|
149
|
+
"--sepia": "/*!*/ /*!*/",
|
|
150
|
+
"--drop-shadow": "/*!*/ /*!*/",
|
|
151
|
+
"--backdrop-blur": "/*!*/ /*!*/",
|
|
152
|
+
"--backdrop-brightness": "/*!*/ /*!*/",
|
|
153
|
+
"--backdrop-contrast": "/*!*/ /*!*/",
|
|
154
|
+
"--backdrop-grayscale": "/*!*/ /*!*/",
|
|
155
|
+
"--backdrop-hue-rotate": "/*!*/ /*!*/",
|
|
156
|
+
"--backdrop-invert": "/*!*/ /*!*/",
|
|
157
|
+
"--backdrop-opacity": "/*!*/ /*!*/",
|
|
158
|
+
"--backdrop-saturate": "/*!*/ /*!*/",
|
|
159
|
+
"--backdrop-sepia": "/*!*/ /*!*/",
|
|
160
|
+
"--scroll-snap-strictness": "proximity",
|
|
161
|
+
"--border-spacing-x": 0,
|
|
162
|
+
"--border-spacing-y": 0,
|
|
163
|
+
"--translate-x": 0,
|
|
164
|
+
"--translate-y": 0,
|
|
165
|
+
"--rotate": 0,
|
|
166
|
+
"--skew-x": 0,
|
|
167
|
+
"--skew-y": 0,
|
|
168
|
+
"--scale-x": 1,
|
|
169
|
+
"--scale-y": 1
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
sheet.processGlobalCss(globalCss);
|
|
173
|
+
const output = sheet.toCss({ optimize });
|
|
174
|
+
ctx.hooks.callHook("generator:css", "global.css", output);
|
|
175
|
+
return output;
|
|
176
|
+
};
|
|
131
177
|
|
|
132
178
|
// src/artifacts/css/keyframe-css.ts
|
|
133
179
|
var import_core = require("@pandacss/core");
|
|
@@ -149,116 +195,242 @@ function generateKeyframeCss(ctx) {
|
|
|
149
195
|
params: "tokens",
|
|
150
196
|
nodes: root.nodes
|
|
151
197
|
});
|
|
152
|
-
|
|
198
|
+
const output = rule.toString();
|
|
199
|
+
ctx.hooks.callHook("generator:css", "keyframes.css", output);
|
|
200
|
+
return output;
|
|
153
201
|
}
|
|
154
202
|
|
|
155
203
|
// src/artifacts/css/reset-css.ts
|
|
156
204
|
var css = String.raw;
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
205
|
+
function generateResetCss(ctx, scope = "") {
|
|
206
|
+
const selector = scope ? `${scope} ` : "";
|
|
207
|
+
const output = css`
|
|
208
|
+
@layer reset {
|
|
209
|
+
${selector}* {
|
|
210
|
+
margin: 0;
|
|
211
|
+
padding: 0;
|
|
212
|
+
font: inherit;
|
|
213
|
+
}
|
|
161
214
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
215
|
+
${selector}*,
|
|
216
|
+
${selector}*::before,
|
|
217
|
+
${selector}*::after {
|
|
218
|
+
box-sizing: border-box;
|
|
219
|
+
border-width: 0;
|
|
220
|
+
border-style: solid;
|
|
221
|
+
border-color: var(--global-color-border, currentColor);
|
|
222
|
+
}
|
|
169
223
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
224
|
+
${scope || "html"} {
|
|
225
|
+
line-height: 1.5;
|
|
226
|
+
--font-fallback: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
|
|
227
|
+
'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',
|
|
228
|
+
'Noto Color Emoji';
|
|
229
|
+
-webkit-text-size-adjust: 100%;
|
|
230
|
+
-webkit-text-size-adjust: 100%;
|
|
231
|
+
-webkit-font-smoothing: antialiased;
|
|
232
|
+
-moz-tab-size: 4;
|
|
233
|
+
tab-size: 4;
|
|
234
|
+
font-family: var(--global-font-body, var(--font-fallback));
|
|
235
|
+
}
|
|
174
236
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
237
|
+
${selector}hr {
|
|
238
|
+
height: 0;
|
|
239
|
+
color: inherit;
|
|
240
|
+
border-top-width: 1px;
|
|
241
|
+
}
|
|
180
242
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
243
|
+
body {
|
|
244
|
+
height: 100%;
|
|
245
|
+
line-height: inherit;
|
|
246
|
+
}
|
|
184
247
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
canvas,
|
|
189
|
-
svg {
|
|
190
|
-
display: block;
|
|
191
|
-
max-width: 100%;
|
|
192
|
-
}
|
|
248
|
+
${selector}img {
|
|
249
|
+
border-style: none;
|
|
250
|
+
}
|
|
193
251
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
252
|
+
${selector}img,
|
|
253
|
+
${selector}svg,
|
|
254
|
+
${selector}video,
|
|
255
|
+
${selector}canvas,
|
|
256
|
+
${selector}audio,
|
|
257
|
+
${selector}iframe,
|
|
258
|
+
${selector}embed,
|
|
259
|
+
${selector}object {
|
|
260
|
+
display: block;
|
|
261
|
+
vertical-align: middle;
|
|
262
|
+
}
|
|
200
263
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
h5,
|
|
207
|
-
h6 {
|
|
208
|
-
overflow-wrap: break-word;
|
|
209
|
-
}
|
|
264
|
+
${selector}img,
|
|
265
|
+
${selector}video {
|
|
266
|
+
max-width: 100%;
|
|
267
|
+
height: auto;
|
|
268
|
+
}
|
|
210
269
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
270
|
+
${selector}p,
|
|
271
|
+
${selector}h1,
|
|
272
|
+
${selector}h2,
|
|
273
|
+
${selector}h3,
|
|
274
|
+
${selector}h4,
|
|
275
|
+
${selector}h5,
|
|
276
|
+
${selector}h6 {
|
|
277
|
+
overflow-wrap: break-word;
|
|
278
|
+
}
|
|
215
279
|
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
}
|
|
280
|
+
${selector}ol,
|
|
281
|
+
${selector}ul {
|
|
282
|
+
list-style: none;
|
|
283
|
+
}
|
|
221
284
|
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
285
|
+
${selector}code,
|
|
286
|
+
${selector}kbd,
|
|
287
|
+
${selector}pre,
|
|
288
|
+
${selector}samp {
|
|
289
|
+
font-size: 1em;
|
|
290
|
+
}
|
|
226
291
|
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
292
|
+
${selector}button,
|
|
293
|
+
${selector}[type='button'],
|
|
294
|
+
${selector}[type='reset'],
|
|
295
|
+
${selector}[type='submit'] {
|
|
296
|
+
-webkit-appearance: button;
|
|
297
|
+
background-color: transparent;
|
|
298
|
+
background-image: none;
|
|
299
|
+
}
|
|
233
300
|
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
301
|
+
${selector}button,
|
|
302
|
+
${selector}select {
|
|
303
|
+
text-transform: none;
|
|
304
|
+
}
|
|
237
305
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
306
|
+
${selector}table {
|
|
307
|
+
text-indent: 0;
|
|
308
|
+
border-color: inherit;
|
|
309
|
+
border-collapse: collapse;
|
|
310
|
+
}
|
|
241
311
|
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
312
|
+
${selector}input::placeholder,
|
|
313
|
+
${selector}textarea::placeholder {
|
|
314
|
+
opacity: 1;
|
|
315
|
+
color: var(--global-color-placeholder, #9ca3af);
|
|
316
|
+
}
|
|
245
317
|
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
318
|
+
${selector}textarea {
|
|
319
|
+
resize: vertical;
|
|
320
|
+
}
|
|
249
321
|
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
322
|
+
${selector}summary {
|
|
323
|
+
display: list-item;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
${selector}small {
|
|
327
|
+
font-size: 80%;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
${selector}sub,
|
|
331
|
+
${selector}sup {
|
|
332
|
+
font-size: 75%;
|
|
333
|
+
line-height: 0;
|
|
334
|
+
position: relative;
|
|
335
|
+
vertical-align: baseline;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
${selector}sub {
|
|
339
|
+
bottom: -0.25em;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
${selector}sup {
|
|
343
|
+
top: -0.5em;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
${selector}dialog {
|
|
347
|
+
padding: 0;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
${selector}a {
|
|
351
|
+
color: inherit;
|
|
352
|
+
text-decoration: inherit;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
${selector}abbr:where([title]) {
|
|
356
|
+
text-decoration: underline dotted;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
${selector}b,
|
|
360
|
+
${selector}strong {
|
|
361
|
+
font-weight: bolder;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
${selector}code,
|
|
365
|
+
${selector}kbd,
|
|
366
|
+
${selector}samp,
|
|
367
|
+
${selector}pre {
|
|
368
|
+
font-size: 1em;
|
|
369
|
+
--font-mono-fallback: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New';
|
|
370
|
+
font-family: var(--global-font-mono, var(--font-fallback));
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
${selector}[type='search'] {
|
|
374
|
+
-webkit-appearance: textfield;
|
|
375
|
+
outline-offset: -2px;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
${selector}::-webkit-search-decoration {
|
|
379
|
+
-webkit-appearance: none;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
${selector}::-webkit-file-upload-button {
|
|
383
|
+
-webkit-appearance: button;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
${selector}::-webkit-inner-spin-button,
|
|
387
|
+
${selector}::-webkit-outer-spin-button {
|
|
388
|
+
height: auto;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
${selector}:-moz-ui-invalid {
|
|
392
|
+
box-shadow: none;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
${selector}:-moz-focusring {
|
|
396
|
+
outline: auto;
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
`;
|
|
400
|
+
ctx.hooks.callHook("generator:css", "reset.css", output);
|
|
401
|
+
return output;
|
|
258
402
|
}
|
|
259
403
|
|
|
260
|
-
// src/artifacts/css/
|
|
404
|
+
// src/artifacts/css/static-css.ts
|
|
261
405
|
var import_core2 = require("@pandacss/core");
|
|
406
|
+
var generateStaticCss = (ctx) => {
|
|
407
|
+
const { config, createSheet, utility, recipes } = ctx;
|
|
408
|
+
const { staticCss = {}, theme = {}, optimize = true } = config;
|
|
409
|
+
const sheet = createSheet();
|
|
410
|
+
const fn = (0, import_core2.getStaticCss)(staticCss);
|
|
411
|
+
const results = fn({
|
|
412
|
+
breakpoints: Object.keys(theme.breakpoints ?? {}),
|
|
413
|
+
getPropertyKeys: utility.getPropertyKeys,
|
|
414
|
+
getRecipeKeys: (recipe) => recipes.details.find((detail) => detail.config.name === recipe)?.variantKeyMap ?? {}
|
|
415
|
+
});
|
|
416
|
+
results.css.forEach((css2) => {
|
|
417
|
+
sheet.processAtomic(css2);
|
|
418
|
+
});
|
|
419
|
+
results.recipes.forEach((result) => {
|
|
420
|
+
Object.entries(result).forEach(([name, value]) => {
|
|
421
|
+
const recipeConfig = recipes.getConfig(name);
|
|
422
|
+
if (!recipeConfig)
|
|
423
|
+
return;
|
|
424
|
+
sheet.processRecipe(recipeConfig, value);
|
|
425
|
+
});
|
|
426
|
+
});
|
|
427
|
+
const output = sheet.toCss({ optimize });
|
|
428
|
+
ctx.hooks.callHook("generator:css", "static.css", output);
|
|
429
|
+
return output;
|
|
430
|
+
};
|
|
431
|
+
|
|
432
|
+
// src/artifacts/css/token-css.ts
|
|
433
|
+
var import_core3 = require("@pandacss/core");
|
|
262
434
|
var import_postcss2 = __toESM(require("postcss"));
|
|
263
435
|
function generateTokenCss(ctx) {
|
|
264
436
|
const {
|
|
@@ -273,27 +445,29 @@ function generateTokenCss(ctx) {
|
|
|
273
445
|
if (Object.keys(varsObj).length === 0)
|
|
274
446
|
continue;
|
|
275
447
|
if (key === "base") {
|
|
276
|
-
const { css: css3 } = (0,
|
|
448
|
+
const { css: css3 } = (0, import_core3.toCss)({ [root]: varsObj });
|
|
277
449
|
results.push(css3);
|
|
278
450
|
} else {
|
|
279
451
|
const keys = key.split(":");
|
|
280
|
-
const { css: css3 } = (0,
|
|
452
|
+
const { css: css3 } = (0, import_core3.toCss)(varsObj);
|
|
281
453
|
const mapped = keys.map((key2) => conditions.get(key2)).filter(Boolean).map((condition) => {
|
|
282
|
-
const parent = (0,
|
|
454
|
+
const parent = (0, import_core3.extractParentSelectors)(condition);
|
|
283
455
|
return parent ? `&${parent}` : condition;
|
|
284
456
|
});
|
|
285
457
|
const rule = getDeepestRule(root, mapped);
|
|
286
458
|
if (!rule)
|
|
287
459
|
continue;
|
|
288
460
|
getDeepestNode(rule)?.append(css3);
|
|
289
|
-
results.push((0,
|
|
461
|
+
results.push((0, import_core3.expandNestedCss)(rule.toString()));
|
|
290
462
|
}
|
|
291
463
|
}
|
|
292
464
|
const css2 = results.join("\n\n");
|
|
293
|
-
|
|
294
|
-
${(0,
|
|
465
|
+
const output = `@layer tokens {
|
|
466
|
+
${(0, import_core3.prettifyCss)(cleanupSelectors(css2, root))}
|
|
295
467
|
}
|
|
296
468
|
`;
|
|
469
|
+
ctx.hooks.callHook("generator:css", "tokens.css", output);
|
|
470
|
+
return output;
|
|
297
471
|
}
|
|
298
472
|
function getDeepestRule(root, selectors) {
|
|
299
473
|
const rule = import_postcss2.default.rule({ selector: "" });
|
|
@@ -682,6 +856,7 @@ transform`)}
|
|
|
682
856
|
var import_shared2 = require("@pandacss/shared");
|
|
683
857
|
var import_outdent8 = require("outdent");
|
|
684
858
|
var stringify3 = (value) => JSON.stringify(value, null, 2);
|
|
859
|
+
var isBooleanValue = (value) => value === "true" || value === "false";
|
|
685
860
|
function generateRecipes(ctx) {
|
|
686
861
|
const {
|
|
687
862
|
recipes,
|
|
@@ -744,21 +919,34 @@ function generateRecipes(ctx) {
|
|
|
744
919
|
${ctx.file.import("splitProps", "../helpers")}
|
|
745
920
|
${ctx.file.import("createRecipe", "./create-recipe")}
|
|
746
921
|
|
|
747
|
-
|
|
922
|
+
const ${name}Fn = createRecipe('${name}', ${stringify3(defaultVariants ?? {})}, ${stringify3(
|
|
748
923
|
compoundVariants ?? []
|
|
749
924
|
)})
|
|
750
925
|
|
|
751
|
-
${name}.variants = ${stringify3(variantKeyMap)}
|
|
752
|
-
|
|
753
926
|
const variantKeys = ${stringify3(Object.keys(variantKeyMap))}
|
|
754
|
-
|
|
927
|
+
|
|
928
|
+
function splitVariantProps(props) {
|
|
929
|
+
return splitProps(props, variantKeys)
|
|
930
|
+
}
|
|
931
|
+
|
|
932
|
+
export const ${name} = Object.assign(${name}Fn, {
|
|
933
|
+
__recipe__: true,
|
|
934
|
+
variantKeys,
|
|
935
|
+
variantMap: ${stringify3(variantKeyMap)},
|
|
936
|
+
splitVariantProps,
|
|
937
|
+
})
|
|
755
938
|
`,
|
|
756
939
|
dts: import_outdent8.outdent`
|
|
757
940
|
import type { ConditionalValue } from '../types'
|
|
758
941
|
import type { Pretty } from '../types/helpers'
|
|
759
942
|
|
|
760
943
|
type ${upperName}Variant = {
|
|
761
|
-
${Object.keys(variantKeyMap).map((key) =>
|
|
944
|
+
${Object.keys(variantKeyMap).map((key) => {
|
|
945
|
+
const values = variantKeyMap[key];
|
|
946
|
+
if (values.every(isBooleanValue))
|
|
947
|
+
return `${key}: boolean`;
|
|
948
|
+
return `${key}: ${(0, import_shared2.unionType)(values)}`;
|
|
949
|
+
}).join("\n")}
|
|
762
950
|
}
|
|
763
951
|
|
|
764
952
|
type ${upperName}VariantMap = {
|
|
@@ -770,8 +958,10 @@ function generateRecipes(ctx) {
|
|
|
770
958
|
}
|
|
771
959
|
|
|
772
960
|
interface ${upperName}Recipe {
|
|
773
|
-
|
|
774
|
-
|
|
961
|
+
__type: ${upperName}VariantProps
|
|
962
|
+
(props?: ${upperName}VariantProps): string
|
|
963
|
+
variantMap: ${upperName}VariantMap
|
|
964
|
+
variantKeys: Array<keyof ${upperName}Variant>
|
|
775
965
|
splitVariantProps<Props extends ${upperName}VariantProps>(props: Props): [${upperName}VariantProps, Pretty<Omit<Props, keyof ${upperName}VariantProps>>]
|
|
776
966
|
}
|
|
777
967
|
|
|
@@ -834,23 +1024,31 @@ function generatePreactJsxFactory(ctx) {
|
|
|
834
1024
|
${ctx.file.import("splitProps, normalizeHTMLProps", "../helpers")}
|
|
835
1025
|
${ctx.file.import("isCssProperty", "./is-valid-prop")}
|
|
836
1026
|
|
|
837
|
-
function
|
|
838
|
-
const cvaFn = configOrCva.__cva__ ? configOrCva : cva(configOrCva)
|
|
1027
|
+
function styledFn(Dynamic, configOrCva = {}) {
|
|
1028
|
+
const cvaFn = configOrCva.__cva__ || configOrCva.__recipe__ ? configOrCva : cva(configOrCva)
|
|
839
1029
|
|
|
840
1030
|
const ${componentName} = forwardRef(function ${componentName}(props, ref) {
|
|
841
1031
|
const { as: Element = Dynamic, ...restProps } = props
|
|
842
1032
|
|
|
843
|
-
const [
|
|
844
|
-
return splitProps(restProps,
|
|
1033
|
+
const [variantProps, styleProps, htmlProps, elementProps] = useMemo(() => {
|
|
1034
|
+
return splitProps(restProps, cvaFn.variantKeys, isCssProperty, normalizeHTMLProps.keys)
|
|
845
1035
|
}, [restProps])
|
|
846
1036
|
|
|
847
|
-
function
|
|
1037
|
+
function recipeClass() {
|
|
1038
|
+
const { css: cssStyles, ...propStyles } = styleProps
|
|
1039
|
+
const styles = assignCss(propStyles, cssStyles)
|
|
1040
|
+
return cx(cvaFn(variantProps), css(styles), elementProps.className, elementProps.class)
|
|
1041
|
+
}
|
|
1042
|
+
|
|
1043
|
+
function cvaClass() {
|
|
848
1044
|
const { css: cssStyles, ...propStyles } = styleProps
|
|
849
1045
|
const cvaStyles = cvaFn.resolve(variantProps)
|
|
850
1046
|
const styles = assignCss(cvaStyles, propStyles, cssStyles)
|
|
851
|
-
return cx(css(styles), elementProps.className)
|
|
1047
|
+
return cx(css(styles), elementProps.className, elementProps.class)
|
|
852
1048
|
}
|
|
853
1049
|
|
|
1050
|
+
const classes = configOrCva.__recipe__ ? recipeClass : cvaClass
|
|
1051
|
+
|
|
854
1052
|
return h(Element, {
|
|
855
1053
|
...elementProps,
|
|
856
1054
|
...normalizeHTMLProps(htmlProps),
|
|
@@ -866,13 +1064,13 @@ function generatePreactJsxFactory(ctx) {
|
|
|
866
1064
|
function createJsxFactory() {
|
|
867
1065
|
const cache = new Map()
|
|
868
1066
|
|
|
869
|
-
return new Proxy(
|
|
1067
|
+
return new Proxy(styledFn, {
|
|
870
1068
|
apply(_, __, args) {
|
|
871
|
-
return
|
|
1069
|
+
return styledFn(...args)
|
|
872
1070
|
},
|
|
873
1071
|
get(_, el) {
|
|
874
1072
|
if (!cache.has(el)) {
|
|
875
|
-
cache.set(el,
|
|
1073
|
+
cache.set(el, styledFn(el))
|
|
876
1074
|
}
|
|
877
1075
|
return cache.get(el)
|
|
878
1076
|
},
|
|
@@ -904,7 +1102,8 @@ function generatePreactJsxPattern(ctx) {
|
|
|
904
1102
|
${(0, import_ts_pattern2.match)(props.length).with(
|
|
905
1103
|
0,
|
|
906
1104
|
() => import_outdent11.outdent`
|
|
907
|
-
|
|
1105
|
+
const styleProps = ${styleFnName}()
|
|
1106
|
+
return h(${factoryName}.${jsxElement}, { ref, ...styleProps, ...props })
|
|
908
1107
|
`
|
|
909
1108
|
).otherwise(
|
|
910
1109
|
() => import_outdent11.outdent`
|
|
@@ -939,9 +1138,9 @@ import type { ${upperName} } from '../types/jsx'
|
|
|
939
1138
|
export declare const ${factoryName}: ${upperName}
|
|
940
1139
|
`,
|
|
941
1140
|
jsxType: import_outdent12.outdent`
|
|
942
|
-
import type {
|
|
943
|
-
import type { JsxStyleProps, JsxHTMLProps } from './system-types'
|
|
944
|
-
import type { RecipeDefinition,
|
|
1141
|
+
import type { ComponentProps, JSX } from 'preact'
|
|
1142
|
+
import type { Assign, JsxStyleProps, JsxHTMLProps } from './system-types'
|
|
1143
|
+
import type { RecipeDefinition, RecipeSelection, RecipeVariantRecord } from './recipe'
|
|
945
1144
|
|
|
946
1145
|
type ElementType = keyof JSX.IntrinsicElements
|
|
947
1146
|
|
|
@@ -952,43 +1151,241 @@ export type ${componentName}<T extends ElementType, P extends Dict = {}> = {
|
|
|
952
1151
|
displayName?: string
|
|
953
1152
|
}
|
|
954
1153
|
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
1154
|
+
type RecipeFn = { __type: any }
|
|
1155
|
+
|
|
1156
|
+
interface JsxFactory {
|
|
1157
|
+
<T extends ElementType>(component: T): ${componentName}<T, {}>
|
|
1158
|
+
<T extends ElementType, P extends RecipeVariantRecord>(component: T, recipe: RecipeDefinition<P>): ${componentName}<
|
|
1159
|
+
T,
|
|
1160
|
+
RecipeSelection<P>
|
|
1161
|
+
>
|
|
1162
|
+
<T extends ElementType, P extends RecipeFn>(component: T, recipeFn: P): ${componentName}<T, P['__type']>
|
|
1163
|
+
}
|
|
1164
|
+
|
|
1165
|
+
type JsxElements = { [K in keyof JSX.IntrinsicElements]: ${componentName}<K, {}> }
|
|
1166
|
+
|
|
1167
|
+
export type ${upperName} = JsxFactory & JsxElements
|
|
958
1168
|
|
|
959
1169
|
export type ${typeName}<T extends ElementType> = JsxHTMLProps<ComponentProps<T>, JsxStyleProps>
|
|
960
1170
|
`
|
|
961
1171
|
};
|
|
962
1172
|
}
|
|
963
1173
|
|
|
964
|
-
// src/artifacts/
|
|
1174
|
+
// src/artifacts/qwik-jsx/jsx.ts
|
|
965
1175
|
var import_outdent13 = require("outdent");
|
|
966
|
-
function
|
|
1176
|
+
function generateQwikJsxFactory(ctx) {
|
|
967
1177
|
const { factoryName, componentName } = ctx.jsx;
|
|
968
1178
|
return {
|
|
969
1179
|
js: import_outdent13.outdent`
|
|
1180
|
+
import { h } from '@builder.io/qwik'
|
|
1181
|
+
${ctx.file.import("css, cx, cva, assignCss", "../css/index")}
|
|
1182
|
+
${ctx.file.import("splitProps, normalizeHTMLProps", "../helpers")}
|
|
1183
|
+
${ctx.file.import("isCssProperty", "./is-valid-prop")}
|
|
1184
|
+
|
|
1185
|
+
function styledFn(Dynamic, configOrCva = {}) {
|
|
1186
|
+
const cvaFn = configOrCva.__cva__ || configOrCva.__recipe__ ? configOrCva : cva(configOrCva)
|
|
1187
|
+
|
|
1188
|
+
const ${componentName} = function ${componentName}(props) {
|
|
1189
|
+
const { as: Element = Dynamic, ...restProps } = props
|
|
1190
|
+
|
|
1191
|
+
const [variantProps, styleProps, htmlProps, elementProps] =
|
|
1192
|
+
splitProps(restProps, cvaFn.variantKeys, isCssProperty, normalizeHTMLProps.keys)
|
|
1193
|
+
|
|
1194
|
+
const { css: cssStyles, ...propStyles } = styleProps
|
|
1195
|
+
|
|
1196
|
+
function recipeClass() {
|
|
1197
|
+
const styles = assignCss(propStyles, cssStyles)
|
|
1198
|
+
return cx(cvaFn(variantProps), css(styles), elementProps.class)
|
|
1199
|
+
}
|
|
1200
|
+
|
|
1201
|
+
function cvaClass() {
|
|
1202
|
+
const cvaStyles = cvaFn.resolve(variantProps)
|
|
1203
|
+
const styles = assignCss(cvaStyles, propStyles, cssStyles)
|
|
1204
|
+
return cx(css(styles), elementProps.class)
|
|
1205
|
+
}
|
|
1206
|
+
|
|
1207
|
+
const classes = configOrCva.__recipe__ ? recipeClass : cvaClass
|
|
1208
|
+
|
|
1209
|
+
return h(Element, {
|
|
1210
|
+
...elementProps,
|
|
1211
|
+
...normalizeHTMLProps(htmlProps),
|
|
1212
|
+
class: classes(),
|
|
1213
|
+
})
|
|
1214
|
+
}
|
|
1215
|
+
|
|
1216
|
+
${componentName}.displayName = \`${factoryName}.\${Dynamic}\`
|
|
1217
|
+
return ${componentName}
|
|
1218
|
+
}
|
|
1219
|
+
|
|
1220
|
+
function createJsxFactory() {
|
|
1221
|
+
const cache = new Map()
|
|
1222
|
+
|
|
1223
|
+
return new Proxy(styledFn, {
|
|
1224
|
+
apply(_, __, args) {
|
|
1225
|
+
return styledFn(...args)
|
|
1226
|
+
},
|
|
1227
|
+
get(_, el) {
|
|
1228
|
+
if (!cache.has(el)) {
|
|
1229
|
+
cache.set(el, styledFn(el))
|
|
1230
|
+
}
|
|
1231
|
+
return cache.get(el)
|
|
1232
|
+
},
|
|
1233
|
+
})
|
|
1234
|
+
}
|
|
1235
|
+
|
|
1236
|
+
export const ${factoryName} = createJsxFactory()
|
|
1237
|
+
|
|
1238
|
+
`
|
|
1239
|
+
};
|
|
1240
|
+
}
|
|
1241
|
+
|
|
1242
|
+
// src/artifacts/qwik-jsx/pattern.ts
|
|
1243
|
+
var import_outdent14 = require("outdent");
|
|
1244
|
+
var import_ts_pattern3 = require("ts-pattern");
|
|
1245
|
+
function generateQwikJsxPattern(ctx) {
|
|
1246
|
+
const { typeName, factoryName } = ctx.jsx;
|
|
1247
|
+
return ctx.patterns.details.map((pattern) => {
|
|
1248
|
+
const { upperName, styleFnName, dashName, jsxName, props, blocklistType } = pattern;
|
|
1249
|
+
const { description, jsxElement = "div" } = pattern.config;
|
|
1250
|
+
return {
|
|
1251
|
+
name: dashName,
|
|
1252
|
+
js: import_outdent14.outdent`
|
|
1253
|
+
import { h } from '@builder.io/qwik'
|
|
1254
|
+
${ctx.file.import(factoryName, "./factory")}
|
|
1255
|
+
${ctx.file.import(styleFnName, `../patterns/${dashName}`)}
|
|
1256
|
+
|
|
1257
|
+
export const ${jsxName} = function ${jsxName}(props) {
|
|
1258
|
+
${(0, import_ts_pattern3.match)(props.length).with(
|
|
1259
|
+
0,
|
|
1260
|
+
() => import_outdent14.outdent`
|
|
1261
|
+
const styleProps = ${styleFnName}()
|
|
1262
|
+
return h(${factoryName}.${jsxElement}, { ...styleProps, ...props })
|
|
1263
|
+
`
|
|
1264
|
+
).otherwise(
|
|
1265
|
+
() => import_outdent14.outdent`
|
|
1266
|
+
const { ${props.join(", ")}, ...restProps } = props
|
|
1267
|
+
const styleProps = ${styleFnName}({${props.join(", ")}})
|
|
1268
|
+
return h(${factoryName}.${jsxElement}, { ...styleProps, ...restProps })
|
|
1269
|
+
`
|
|
1270
|
+
)}
|
|
1271
|
+
}
|
|
1272
|
+
`,
|
|
1273
|
+
dts: import_outdent14.outdent`
|
|
1274
|
+
import type { FunctionComponent } from '@builder.io/qwik'
|
|
1275
|
+
import type { ${upperName}Properties } from '../patterns/${dashName}'
|
|
1276
|
+
import type { ${typeName} } from '../types/jsx'
|
|
1277
|
+
|
|
1278
|
+
type Assign<T, U> = {
|
|
1279
|
+
[K in keyof T]?: K extends keyof T ? (K extends keyof U ? T[K] & U[K] : T[K]) : never
|
|
1280
|
+
} & U
|
|
1281
|
+
|
|
1282
|
+
export type ${upperName}Props = Assign<${typeName}<'${jsxElement}'>, Omit<${upperName}Properties, ${blocklistType || '""'}>>
|
|
1283
|
+
|
|
1284
|
+
${description ? `/** ${description} */` : ""}
|
|
1285
|
+
export declare const ${jsxName}: FunctionComponent<${upperName}Props>
|
|
1286
|
+
`
|
|
1287
|
+
};
|
|
1288
|
+
});
|
|
1289
|
+
}
|
|
1290
|
+
|
|
1291
|
+
// src/artifacts/qwik-jsx/types.ts
|
|
1292
|
+
var import_outdent15 = require("outdent");
|
|
1293
|
+
function generateQwikJsxTypes(ctx) {
|
|
1294
|
+
const { factoryName, componentName, upperName, typeName } = ctx.jsx;
|
|
1295
|
+
return {
|
|
1296
|
+
jsxFactory: import_outdent15.outdent`
|
|
1297
|
+
import { ${upperName} } from '../types/jsx'
|
|
1298
|
+
export declare const ${factoryName}: ${upperName}
|
|
1299
|
+
`,
|
|
1300
|
+
jsxType: import_outdent15.outdent`
|
|
1301
|
+
import type { FunctionComponent, QwikIntrinsicElements } from '@builder.io/qwik'
|
|
1302
|
+
import type { Assign as _Assign, JsxStyleProps, PatchedHTMLProps } from './system-types'
|
|
1303
|
+
import type { RecipeDefinition, RecipeSelection, RecipeVariantRecord } from './recipe'
|
|
1304
|
+
|
|
1305
|
+
type ElementType = keyof QwikIntrinsicElements | FunctionComponent<any>
|
|
1306
|
+
|
|
1307
|
+
type ComponentProps<T extends ElementType> = T extends keyof QwikIntrinsicElements
|
|
1308
|
+
? QwikIntrinsicElements[T]
|
|
1309
|
+
: T extends FunctionComponent<infer P>
|
|
1310
|
+
? P
|
|
1311
|
+
: never
|
|
1312
|
+
|
|
1313
|
+
type Dict = Record<string, unknown>
|
|
1314
|
+
|
|
1315
|
+
type Omitted = 'color' | 'translate' | 'transition' | 'width' | 'height' | 'size' | 'content'
|
|
1316
|
+
|
|
1317
|
+
// Patch due to Omit<T, K> not working with Qwik JSX Types
|
|
1318
|
+
|
|
1319
|
+
type Assign<T, U> = {
|
|
1320
|
+
[K in keyof T]?: K extends Omitted
|
|
1321
|
+
? K extends keyof U
|
|
1322
|
+
? U[K]
|
|
1323
|
+
: never
|
|
1324
|
+
: K extends keyof T
|
|
1325
|
+
? K extends keyof U
|
|
1326
|
+
? T[K] & U[K]
|
|
1327
|
+
: T[K]
|
|
1328
|
+
: never
|
|
1329
|
+
} & U & PatchedHTMLProps
|
|
1330
|
+
|
|
1331
|
+
export type ${componentName}<T extends ElementType, P extends Dict = {}> = FunctionComponent<Assign<ComponentProps<T>, _Assign<JsxStyleProps, P>>>
|
|
1332
|
+
|
|
1333
|
+
type RecipeFn = { __type: any }
|
|
1334
|
+
|
|
1335
|
+
interface JsxFactory {
|
|
1336
|
+
<T extends ElementType>(component: T): ${componentName}<T, {}>
|
|
1337
|
+
<T extends ElementType, P extends RecipeVariantRecord>(component: T, recipe: RecipeDefinition<P>): ${componentName}<
|
|
1338
|
+
T,
|
|
1339
|
+
RecipeSelection<P>
|
|
1340
|
+
>
|
|
1341
|
+
<T extends ElementType, P extends RecipeFn>(component: T, recipeFn: P): ${componentName}<T, P['__type']>
|
|
1342
|
+
}
|
|
1343
|
+
|
|
1344
|
+
type JsxElements = { [K in keyof QwikIntrinsicElements]: ${componentName}<K, {}> }
|
|
1345
|
+
|
|
1346
|
+
export type ${upperName} = JsxFactory & JsxElements
|
|
1347
|
+
|
|
1348
|
+
export type ${typeName}<T extends ElementType> = Assign<ComponentProps<T>, JsxStyleProps>
|
|
1349
|
+
`
|
|
1350
|
+
};
|
|
1351
|
+
}
|
|
1352
|
+
|
|
1353
|
+
// src/artifacts/react-jsx/jsx.ts
|
|
1354
|
+
var import_outdent16 = require("outdent");
|
|
1355
|
+
function generateReactJsxFactory(ctx) {
|
|
1356
|
+
const { factoryName, componentName } = ctx.jsx;
|
|
1357
|
+
return {
|
|
1358
|
+
js: import_outdent16.outdent`
|
|
970
1359
|
import { createElement, forwardRef, useMemo } from 'react'
|
|
971
1360
|
${ctx.file.import("css, cx, cva, assignCss", "../css/index")}
|
|
972
1361
|
${ctx.file.import("splitProps, normalizeHTMLProps", "../helpers")}
|
|
973
1362
|
${ctx.file.import("isCssProperty", "./is-valid-prop")}
|
|
974
1363
|
|
|
975
|
-
function
|
|
976
|
-
const cvaFn = configOrCva.__cva__ ? configOrCva : cva(configOrCva)
|
|
1364
|
+
function styledFn(Dynamic, configOrCva = {}) {
|
|
1365
|
+
const cvaFn = configOrCva.__cva__ || configOrCva.__recipe__ ? configOrCva : cva(configOrCva)
|
|
977
1366
|
|
|
978
1367
|
const ${componentName} = forwardRef(function ${componentName}(props, ref) {
|
|
979
1368
|
const { as: Element = Dynamic, ...restProps } = props
|
|
980
1369
|
|
|
981
|
-
const [
|
|
982
|
-
return splitProps(restProps,
|
|
1370
|
+
const [variantProps, styleProps, htmlProps, elementProps] = useMemo(() => {
|
|
1371
|
+
return splitProps(restProps, cvaFn.variantKeys, isCssProperty, normalizeHTMLProps.keys)
|
|
983
1372
|
}, [restProps])
|
|
984
|
-
|
|
985
|
-
function
|
|
1373
|
+
|
|
1374
|
+
function recipeClass() {
|
|
1375
|
+
const { css: cssStyles, ...propStyles } = styleProps
|
|
1376
|
+
const styles = assignCss(propStyles, cssStyles)
|
|
1377
|
+
return cx(cvaFn(variantProps), css(styles), elementProps.className)
|
|
1378
|
+
}
|
|
1379
|
+
|
|
1380
|
+
function cvaClass() {
|
|
986
1381
|
const { css: cssStyles, ...propStyles } = styleProps
|
|
987
1382
|
const cvaStyles = cvaFn.resolve(variantProps)
|
|
988
1383
|
const styles = assignCss(cvaStyles, propStyles, cssStyles)
|
|
989
1384
|
return cx(css(styles), elementProps.className)
|
|
990
1385
|
}
|
|
991
1386
|
|
|
1387
|
+
const classes = configOrCva.__recipe__ ? recipeClass : cvaClass
|
|
1388
|
+
|
|
992
1389
|
return createElement(Element, {
|
|
993
1390
|
ref,
|
|
994
1391
|
...elementProps,
|
|
@@ -1004,13 +1401,13 @@ function generateReactJsxFactory(ctx) {
|
|
|
1004
1401
|
function createJsxFactory() {
|
|
1005
1402
|
const cache = new Map()
|
|
1006
1403
|
|
|
1007
|
-
return new Proxy(
|
|
1404
|
+
return new Proxy(styledFn, {
|
|
1008
1405
|
apply(_, __, args) {
|
|
1009
|
-
return
|
|
1406
|
+
return styledFn(...args)
|
|
1010
1407
|
},
|
|
1011
1408
|
get(_, el) {
|
|
1012
1409
|
if (!cache.has(el)) {
|
|
1013
|
-
cache.set(el,
|
|
1410
|
+
cache.set(el, styledFn(el))
|
|
1014
1411
|
}
|
|
1015
1412
|
return cache.get(el)
|
|
1016
1413
|
},
|
|
@@ -1024,8 +1421,8 @@ function generateReactJsxFactory(ctx) {
|
|
|
1024
1421
|
}
|
|
1025
1422
|
|
|
1026
1423
|
// src/artifacts/react-jsx/pattern.ts
|
|
1027
|
-
var
|
|
1028
|
-
var
|
|
1424
|
+
var import_outdent17 = require("outdent");
|
|
1425
|
+
var import_ts_pattern4 = require("ts-pattern");
|
|
1029
1426
|
function generateReactJsxPattern(ctx) {
|
|
1030
1427
|
const { typeName, factoryName } = ctx.jsx;
|
|
1031
1428
|
return ctx.patterns.details.map((pattern) => {
|
|
@@ -1033,19 +1430,20 @@ function generateReactJsxPattern(ctx) {
|
|
|
1033
1430
|
const { description, jsxElement = "div" } = pattern.config;
|
|
1034
1431
|
return {
|
|
1035
1432
|
name: dashName,
|
|
1036
|
-
js:
|
|
1433
|
+
js: import_outdent17.outdent`
|
|
1037
1434
|
import { createElement, forwardRef } from 'react'
|
|
1038
1435
|
${ctx.file.import(factoryName, "./factory")}
|
|
1039
1436
|
${ctx.file.import(styleFnName, `../patterns/${dashName}`)}
|
|
1040
1437
|
|
|
1041
1438
|
export const ${jsxName} = forwardRef(function ${jsxName}(props, ref) {
|
|
1042
|
-
${(0,
|
|
1439
|
+
${(0, import_ts_pattern4.match)(props.length).with(
|
|
1043
1440
|
0,
|
|
1044
|
-
() =>
|
|
1045
|
-
|
|
1441
|
+
() => import_outdent17.outdent`
|
|
1442
|
+
const styleProps = ${styleFnName}()
|
|
1443
|
+
return createElement(${factoryName}.${jsxElement}, { ref, ...styleProps, ...props })
|
|
1046
1444
|
`
|
|
1047
1445
|
).otherwise(
|
|
1048
|
-
() =>
|
|
1446
|
+
() => import_outdent17.outdent`
|
|
1049
1447
|
const { ${props.join(", ")}, ...restProps } = props
|
|
1050
1448
|
const styleProps = ${styleFnName}({${props.join(", ")}})
|
|
1051
1449
|
return createElement(${factoryName}.${jsxElement}, { ref, ...styleProps, ...restProps })
|
|
@@ -1053,7 +1451,7 @@ function generateReactJsxPattern(ctx) {
|
|
|
1053
1451
|
)}
|
|
1054
1452
|
})
|
|
1055
1453
|
`,
|
|
1056
|
-
dts:
|
|
1454
|
+
dts: import_outdent17.outdent`
|
|
1057
1455
|
import type { FunctionComponent } from 'react'
|
|
1058
1456
|
import type { ${upperName}Properties } from '../patterns/${dashName}'
|
|
1059
1457
|
import type { ${typeName} } from '../types/jsx'
|
|
@@ -1068,18 +1466,18 @@ function generateReactJsxPattern(ctx) {
|
|
|
1068
1466
|
}
|
|
1069
1467
|
|
|
1070
1468
|
// src/artifacts/react-jsx/types.ts
|
|
1071
|
-
var
|
|
1469
|
+
var import_outdent18 = require("outdent");
|
|
1072
1470
|
function generateReactJsxTypes(ctx) {
|
|
1073
1471
|
const { factoryName, componentName, upperName, typeName } = ctx.jsx;
|
|
1074
1472
|
return {
|
|
1075
|
-
jsxFactory:
|
|
1473
|
+
jsxFactory: import_outdent18.outdent`
|
|
1076
1474
|
import { ${upperName} } from '../types/jsx'
|
|
1077
1475
|
export declare const ${factoryName}: ${upperName}
|
|
1078
1476
|
`,
|
|
1079
|
-
jsxType:
|
|
1080
|
-
import type {
|
|
1081
|
-
import type { JsxStyleProps, JsxHTMLProps
|
|
1082
|
-
import type { RecipeDefinition,
|
|
1477
|
+
jsxType: import_outdent18.outdent`
|
|
1478
|
+
import type { ComponentProps, ElementType } from 'react'
|
|
1479
|
+
import type { Assign, JsxStyleProps, JsxHTMLProps } from './system-types'
|
|
1480
|
+
import type { RecipeDefinition, RecipeSelection, RecipeVariantRecord } from './recipe'
|
|
1083
1481
|
|
|
1084
1482
|
type Dict = Record<string, unknown>
|
|
1085
1483
|
|
|
@@ -1088,9 +1486,20 @@ export type ${componentName}<T extends ElementType, P extends Dict = {}> = {
|
|
|
1088
1486
|
displayName?: string
|
|
1089
1487
|
}
|
|
1090
1488
|
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1489
|
+
type RecipeFn = { __type: any }
|
|
1490
|
+
|
|
1491
|
+
interface JsxFactory {
|
|
1492
|
+
<T extends ElementType>(component: T): ${componentName}<T, {}>
|
|
1493
|
+
<T extends ElementType, P extends RecipeVariantRecord>(component: T, recipe: RecipeDefinition<P>): ${componentName}<
|
|
1494
|
+
T,
|
|
1495
|
+
RecipeSelection<P>
|
|
1496
|
+
>
|
|
1497
|
+
<T extends ElementType, P extends RecipeFn>(component: T, recipeFn: P): ${componentName}<T, P['__type']>
|
|
1498
|
+
}
|
|
1499
|
+
|
|
1500
|
+
type JsxElements = { [K in keyof JSX.IntrinsicElements]: ${componentName}<K, {}> }
|
|
1501
|
+
|
|
1502
|
+
export type ${upperName} = JsxFactory & JsxElements
|
|
1094
1503
|
|
|
1095
1504
|
export type ${typeName}<T extends ElementType> = JsxHTMLProps<ComponentProps<T>, JsxStyleProps>
|
|
1096
1505
|
`
|
|
@@ -1098,11 +1507,11 @@ export type ${typeName}<T extends ElementType> = JsxHTMLProps<ComponentProps<T>,
|
|
|
1098
1507
|
}
|
|
1099
1508
|
|
|
1100
1509
|
// src/artifacts/solid-jsx/jsx.ts
|
|
1101
|
-
var
|
|
1510
|
+
var import_outdent19 = require("outdent");
|
|
1102
1511
|
function generateSolidJsxFactory(ctx) {
|
|
1103
1512
|
const { componentName, factoryName } = ctx.jsx;
|
|
1104
1513
|
return {
|
|
1105
|
-
js:
|
|
1514
|
+
js: import_outdent19.outdent`
|
|
1106
1515
|
import { Dynamic } from 'solid-js/web'
|
|
1107
1516
|
import { mergeProps, splitProps } from 'solid-js'
|
|
1108
1517
|
import { createComponent } from 'solid-js/web'
|
|
@@ -1110,27 +1519,35 @@ function generateSolidJsxFactory(ctx) {
|
|
|
1110
1519
|
${ctx.file.import("normalizeHTMLProps", "../helpers")}
|
|
1111
1520
|
${ctx.file.import("allCssProperties", "./is-valid-prop")}
|
|
1112
1521
|
|
|
1113
|
-
function
|
|
1522
|
+
function styledFn(element, configOrCva = {}) {
|
|
1114
1523
|
const cvaFn = configOrCva.__cva__ ? configOrCva : cva(configOrCva)
|
|
1115
1524
|
|
|
1116
1525
|
return function ${componentName}(props) {
|
|
1117
1526
|
const mergedProps = mergeProps({ as: element }, props)
|
|
1118
1527
|
|
|
1119
|
-
const [localProps,
|
|
1528
|
+
const [localProps, variantProps, styleProps, htmlProps, elementProps] = splitProps(
|
|
1120
1529
|
mergedProps,
|
|
1121
1530
|
['as', 'class'],
|
|
1122
|
-
allCssProperties,
|
|
1123
1531
|
cvaFn.variantKeys,
|
|
1532
|
+
allCssProperties,
|
|
1124
1533
|
normalizeHTMLProps.keys
|
|
1125
1534
|
)
|
|
1126
|
-
|
|
1127
|
-
|
|
1535
|
+
|
|
1536
|
+
function recipeClass() {
|
|
1537
|
+
const { css: cssStyles, ...propStyles } = styleProps
|
|
1538
|
+
const styles = assignCss(propStyles, cssStyles)
|
|
1539
|
+
return cx(cvaFn(variantProps), css(styles), localProps.class)
|
|
1540
|
+
}
|
|
1541
|
+
|
|
1542
|
+
function cvaClass() {
|
|
1128
1543
|
const { css: cssStyles, ...propStyles } = styleProps
|
|
1129
1544
|
const cvaStyles = cvaFn.resolve(variantProps)
|
|
1130
1545
|
const styles = assignCss(cvaStyles, propStyles, cssStyles)
|
|
1131
1546
|
return cx(css(styles), localProps.class)
|
|
1132
1547
|
}
|
|
1133
1548
|
|
|
1549
|
+
const classes = configOrCva.__recipe__ ? recipeClass : cvaClass
|
|
1550
|
+
|
|
1134
1551
|
return createComponent(
|
|
1135
1552
|
Dynamic,
|
|
1136
1553
|
mergeProps(
|
|
@@ -1152,13 +1569,13 @@ function generateSolidJsxFactory(ctx) {
|
|
|
1152
1569
|
function createJsxFactory() {
|
|
1153
1570
|
const cache = new Map()
|
|
1154
1571
|
|
|
1155
|
-
return new Proxy(
|
|
1572
|
+
return new Proxy(styledFn, {
|
|
1156
1573
|
apply(_, __, args) {
|
|
1157
|
-
return
|
|
1574
|
+
return styledFn(...args)
|
|
1158
1575
|
},
|
|
1159
1576
|
get(_, el) {
|
|
1160
1577
|
if (!cache.has(el)) {
|
|
1161
|
-
cache.set(el,
|
|
1578
|
+
cache.set(el, styledFn(el))
|
|
1162
1579
|
}
|
|
1163
1580
|
return cache.get(el)
|
|
1164
1581
|
},
|
|
@@ -1171,8 +1588,8 @@ function generateSolidJsxFactory(ctx) {
|
|
|
1171
1588
|
}
|
|
1172
1589
|
|
|
1173
1590
|
// src/artifacts/solid-jsx/pattern.ts
|
|
1174
|
-
var
|
|
1175
|
-
var
|
|
1591
|
+
var import_outdent20 = require("outdent");
|
|
1592
|
+
var import_ts_pattern5 = require("ts-pattern");
|
|
1176
1593
|
function generateSolidJsxPattern(ctx) {
|
|
1177
1594
|
const { typeName, factoryName } = ctx.jsx;
|
|
1178
1595
|
return ctx.patterns.details.map((pattern) => {
|
|
@@ -1180,20 +1597,21 @@ function generateSolidJsxPattern(ctx) {
|
|
|
1180
1597
|
const { description, jsxElement = "div" } = pattern.config;
|
|
1181
1598
|
return {
|
|
1182
1599
|
name: dashName,
|
|
1183
|
-
js:
|
|
1600
|
+
js: import_outdent20.outdent`
|
|
1184
1601
|
import { splitProps, mergeProps } from 'solid-js'
|
|
1185
1602
|
import { createComponent } from 'solid-js/web'
|
|
1186
1603
|
${ctx.file.import(factoryName, "./factory")}
|
|
1187
1604
|
${ctx.file.import(styleFnName, `../patterns/${dashName}`)}
|
|
1188
1605
|
|
|
1189
1606
|
export function ${jsxName}(props) {
|
|
1190
|
-
${(0,
|
|
1607
|
+
${(0, import_ts_pattern5.match)(props.length).with(
|
|
1191
1608
|
0,
|
|
1192
|
-
() =>
|
|
1193
|
-
|
|
1609
|
+
() => import_outdent20.outdent`
|
|
1610
|
+
const styleProps = ${styleFnName}()
|
|
1611
|
+
return createComponent(${factoryName}.${jsxElement}, mergeProps(styleProps, props))
|
|
1194
1612
|
`
|
|
1195
1613
|
).otherwise(
|
|
1196
|
-
() =>
|
|
1614
|
+
() => import_outdent20.outdent`
|
|
1197
1615
|
const [patternProps, restProps] = splitProps(props, [${props.map((v) => JSON.stringify(v)).join(", ")}]);
|
|
1198
1616
|
const styleProps = ${styleFnName}(patternProps)
|
|
1199
1617
|
return createComponent(${factoryName}.${jsxElement}, mergeProps(styleProps, restProps))
|
|
@@ -1201,7 +1619,7 @@ function generateSolidJsxPattern(ctx) {
|
|
|
1201
1619
|
)}
|
|
1202
1620
|
}
|
|
1203
1621
|
`,
|
|
1204
|
-
dts:
|
|
1622
|
+
dts: import_outdent20.outdent`
|
|
1205
1623
|
import { Component } from 'solid-js'
|
|
1206
1624
|
import { ${upperName}Properties } from '../patterns/${dashName}'
|
|
1207
1625
|
import { ${typeName} } from '../types/jsx'
|
|
@@ -1216,18 +1634,18 @@ function generateSolidJsxPattern(ctx) {
|
|
|
1216
1634
|
}
|
|
1217
1635
|
|
|
1218
1636
|
// src/artifacts/solid-jsx/types.ts
|
|
1219
|
-
var
|
|
1637
|
+
var import_outdent21 = require("outdent");
|
|
1220
1638
|
function generateSolidJsxTypes(ctx) {
|
|
1221
1639
|
const { factoryName, componentName, upperName, typeName } = ctx.jsx;
|
|
1222
1640
|
return {
|
|
1223
|
-
jsxFactory:
|
|
1641
|
+
jsxFactory: import_outdent21.outdent`
|
|
1224
1642
|
import type { ${upperName} } from '../types/jsx'
|
|
1225
1643
|
export declare const ${factoryName}: ${upperName}
|
|
1226
1644
|
`,
|
|
1227
|
-
jsxType:
|
|
1228
|
-
import type {
|
|
1229
|
-
import type { JsxStyleProps, JsxHTMLProps } from './system-types'
|
|
1230
|
-
import type { RecipeDefinition,
|
|
1645
|
+
jsxType: import_outdent21.outdent`
|
|
1646
|
+
import type { ComponentProps, Component, JSX } from 'solid-js'
|
|
1647
|
+
import type { Assign, JsxStyleProps, JsxHTMLProps } from './system-types'
|
|
1648
|
+
import type { RecipeDefinition, RecipeSelection, RecipeVariantRecord } from './recipe'
|
|
1231
1649
|
|
|
1232
1650
|
type Dict = Record<string, unknown>
|
|
1233
1651
|
|
|
@@ -1238,9 +1656,20 @@ export type ${componentName}<T extends ElementType, P extends Dict = {}> = {
|
|
|
1238
1656
|
displayName?: string
|
|
1239
1657
|
}
|
|
1240
1658
|
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1659
|
+
type RecipeFn = { __type: any }
|
|
1660
|
+
|
|
1661
|
+
interface JsxFactory {
|
|
1662
|
+
<T extends ElementType>(component: T): ${componentName}<T, {}>
|
|
1663
|
+
<T extends ElementType, P extends RecipeVariantRecord>(component: T, recipe: RecipeDefinition<P>): ${componentName}<
|
|
1664
|
+
T,
|
|
1665
|
+
RecipeSelection<P>
|
|
1666
|
+
>
|
|
1667
|
+
<T extends ElementType, P extends RecipeFn>(component: T, recipeFn: P): ${componentName}<T, P['__type']>
|
|
1668
|
+
}
|
|
1669
|
+
|
|
1670
|
+
type JsxElements = { [K in keyof JSX.IntrinsicElements]: ${componentName}<K, {}> }
|
|
1671
|
+
|
|
1672
|
+
export type ${upperName} = JsxFactory & JsxElements
|
|
1244
1673
|
|
|
1245
1674
|
export type ${typeName}<T extends ElementType> = JsxHTMLProps<ComponentProps<T>, JsxStyleProps>
|
|
1246
1675
|
`
|
|
@@ -1248,18 +1677,18 @@ export type ${typeName}<T extends ElementType> = JsxHTMLProps<ComponentProps<T>,
|
|
|
1248
1677
|
}
|
|
1249
1678
|
|
|
1250
1679
|
// src/artifacts/vue-jsx/jsx.ts
|
|
1251
|
-
var
|
|
1680
|
+
var import_outdent22 = require("outdent");
|
|
1252
1681
|
function generateVueJsxFactory(ctx) {
|
|
1253
1682
|
const { factoryName } = ctx.jsx;
|
|
1254
1683
|
return {
|
|
1255
|
-
js:
|
|
1684
|
+
js: import_outdent22.outdent`
|
|
1256
1685
|
import { defineComponent, h, computed } from 'vue'
|
|
1257
1686
|
${ctx.file.import("css, cx, cva, assignCss", "../css/index")}
|
|
1258
1687
|
${ctx.file.import("splitProps, normalizeHTMLProps", "../helpers")}
|
|
1259
1688
|
${ctx.file.import("isCssProperty", "./is-valid-prop")}
|
|
1260
1689
|
|
|
1261
|
-
function
|
|
1262
|
-
const cvaFn = configOrCva.__cva__ ? configOrCva : cva(configOrCva)
|
|
1690
|
+
function styledFn(Dynamic, configOrCva = {}) {
|
|
1691
|
+
const cvaFn = configOrCva.__cva__ || configOrCva.__recipe__ ? configOrCva : cva(configOrCva)
|
|
1263
1692
|
|
|
1264
1693
|
return defineComponent({
|
|
1265
1694
|
name: \`${factoryName}.\${Dynamic}\`,
|
|
@@ -1267,19 +1696,28 @@ function generateVueJsxFactory(ctx) {
|
|
|
1267
1696
|
props: { as: { type: [String, Object], default: Dynamic } },
|
|
1268
1697
|
setup(props, { slots, attrs }) {
|
|
1269
1698
|
const splittedProps = computed(() => {
|
|
1270
|
-
return splitProps(attrs,
|
|
1699
|
+
return splitProps(attrs, cvaFn.variantKeys, isCssProperty, normalizeHTMLProps.keys)
|
|
1271
1700
|
})
|
|
1272
|
-
|
|
1273
|
-
const
|
|
1274
|
-
const [
|
|
1701
|
+
|
|
1702
|
+
const recipeClass = computed(() => {
|
|
1703
|
+
const [variantProps, styleProps, _htmlProps, elementProps] = splittedProps.value
|
|
1275
1704
|
const { css: cssStyles, ...propStyles } = styleProps
|
|
1276
|
-
const
|
|
1277
|
-
|
|
1278
|
-
return cx(css(styles), elementProps.className)
|
|
1705
|
+
const styles = assignCss(propStyles, cssStyles)
|
|
1706
|
+
return cx(cvaFn(variantProps), css(styles), elementProps.className)
|
|
1279
1707
|
})
|
|
1708
|
+
|
|
1709
|
+
const cvaClass = computed(() => {
|
|
1710
|
+
const [variantProps, styleProps, _htmlProps, elementProps] = splittedProps.value
|
|
1711
|
+
const { css: cssStyles, ...propStyles } = styleProps
|
|
1712
|
+
const styles = assignCss(propStyles, cssStyles)
|
|
1713
|
+
return cx(cvaFn(variantProps), css(styles), elementProps.className)
|
|
1714
|
+
})
|
|
1715
|
+
|
|
1716
|
+
const classes = configOrCva.__recipe__ ? recipeClass : cvaClass
|
|
1280
1717
|
|
|
1281
1718
|
return () => {
|
|
1282
1719
|
const [_styleProps, _variantProps, htmlProps, elementProps] = splittedProps.value
|
|
1720
|
+
|
|
1283
1721
|
return h(
|
|
1284
1722
|
props.as,
|
|
1285
1723
|
{
|
|
@@ -1297,13 +1735,13 @@ function generateVueJsxFactory(ctx) {
|
|
|
1297
1735
|
function createJsxFactory() {
|
|
1298
1736
|
const cache = new Map()
|
|
1299
1737
|
|
|
1300
|
-
return new Proxy(
|
|
1738
|
+
return new Proxy(styledFn, {
|
|
1301
1739
|
apply(_, __, args) {
|
|
1302
|
-
return
|
|
1740
|
+
return styledFn(...args)
|
|
1303
1741
|
},
|
|
1304
1742
|
get(_, el) {
|
|
1305
1743
|
if (!cache.has(el)) {
|
|
1306
|
-
cache.set(el,
|
|
1744
|
+
cache.set(el, styledFn(el))
|
|
1307
1745
|
}
|
|
1308
1746
|
return cache.get(el)
|
|
1309
1747
|
},
|
|
@@ -1316,19 +1754,61 @@ function generateVueJsxFactory(ctx) {
|
|
|
1316
1754
|
};
|
|
1317
1755
|
}
|
|
1318
1756
|
|
|
1757
|
+
// src/artifacts/vue-jsx/pattern.ts
|
|
1758
|
+
var import_outdent23 = require("outdent");
|
|
1759
|
+
function generateVueJsxPattern(ctx) {
|
|
1760
|
+
const { typeName, factoryName } = ctx.jsx;
|
|
1761
|
+
return ctx.patterns.details.map((pattern) => {
|
|
1762
|
+
const { upperName, styleFnName, dashName, jsxName, props, blocklistType } = pattern;
|
|
1763
|
+
const { description, jsxElement = "div" } = pattern.config;
|
|
1764
|
+
const propList = props.map((v) => JSON.stringify(v)).join(", ");
|
|
1765
|
+
return {
|
|
1766
|
+
name: dashName,
|
|
1767
|
+
js: import_outdent23.outdent`
|
|
1768
|
+
import { defineComponent, h, computed } from 'vue'
|
|
1769
|
+
${ctx.file.import(factoryName, "./factory")}
|
|
1770
|
+
${ctx.file.import(styleFnName, `../patterns/${dashName}`)}
|
|
1771
|
+
|
|
1772
|
+
export const ${jsxName} = defineComponent({
|
|
1773
|
+
name: '${jsxName}',
|
|
1774
|
+
inheritAttrs: false,
|
|
1775
|
+
props: [${propList}],
|
|
1776
|
+
setup(props, { attrs, slots }) {
|
|
1777
|
+
const styleProps = computed(() => ${styleFnName}(props))
|
|
1778
|
+
return () => {
|
|
1779
|
+
const computedProps = { ...styleProps.value, ...attrs }
|
|
1780
|
+
return h(${factoryName}.${jsxElement}, computedProps, slots)
|
|
1781
|
+
}
|
|
1782
|
+
}
|
|
1783
|
+
})
|
|
1784
|
+
`,
|
|
1785
|
+
dts: import_outdent23.outdent`
|
|
1786
|
+
import { FunctionalComponent } from 'vue'
|
|
1787
|
+
import { ${upperName}Properties } from '../patterns/${dashName}'
|
|
1788
|
+
import { ${typeName} } from '../types/jsx'
|
|
1789
|
+
|
|
1790
|
+
export type ${upperName}Props = ${upperName}Properties & Omit<${typeName}<'${jsxElement}'>, keyof ${upperName}Properties ${blocklistType}>
|
|
1791
|
+
|
|
1792
|
+
${description ? `/** ${description} */` : ""}
|
|
1793
|
+
export declare const ${jsxName}: FunctionalComponent<${upperName}Props>
|
|
1794
|
+
`
|
|
1795
|
+
};
|
|
1796
|
+
});
|
|
1797
|
+
}
|
|
1798
|
+
|
|
1319
1799
|
// src/artifacts/vue-jsx/types.ts
|
|
1320
|
-
var
|
|
1800
|
+
var import_outdent24 = require("outdent");
|
|
1321
1801
|
function generateVueJsxTypes(ctx) {
|
|
1322
1802
|
const { factoryName, componentName, upperName, typeName } = ctx.jsx;
|
|
1323
1803
|
return {
|
|
1324
|
-
jsxFactory:
|
|
1804
|
+
jsxFactory: import_outdent24.outdent`
|
|
1325
1805
|
import { ${upperName} } from '../types/jsx'
|
|
1326
1806
|
export declare const ${factoryName}: ${upperName}
|
|
1327
1807
|
`,
|
|
1328
|
-
jsxType:
|
|
1808
|
+
jsxType: import_outdent24.outdent`
|
|
1329
1809
|
import type { Component, FunctionalComponent } from 'vue'
|
|
1330
|
-
import type { JsxStyleProps, JsxHTMLProps } from './system-types'
|
|
1331
|
-
import type { RecipeDefinition,
|
|
1810
|
+
import type { Assign, JsxStyleProps, JsxHTMLProps } from './system-types'
|
|
1811
|
+
import type { RecipeDefinition, RecipeSelection, RecipeVariantRecord } from './recipe'
|
|
1332
1812
|
|
|
1333
1813
|
type IntrinsicElement =
|
|
1334
1814
|
| 'a'
|
|
@@ -1461,9 +1941,20 @@ type IntrinsicElement =
|
|
|
1461
1941
|
JsxHTMLProps<ComponentProps<T>, Assign<JsxStyleProps, P>>
|
|
1462
1942
|
>
|
|
1463
1943
|
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1944
|
+
type RecipeFn = { __type: any }
|
|
1945
|
+
|
|
1946
|
+
interface JsxFactory {
|
|
1947
|
+
<T extends ElementType>(component: T): ${componentName}<T, {}>
|
|
1948
|
+
<T extends ElementType, P extends RecipeVariantRecord>(component: T, recipe: RecipeDefinition<P>): ${componentName}<
|
|
1949
|
+
T,
|
|
1950
|
+
RecipeSelection<P>
|
|
1951
|
+
>
|
|
1952
|
+
<T extends ElementType, P extends RecipeFn>(component: T, recipeFn: P): ${componentName}<T, P['__type']>
|
|
1953
|
+
}
|
|
1954
|
+
|
|
1955
|
+
type JsxElements = { [K in keyof JSX.IntrinsicElements]: ${componentName}<K, {}> }
|
|
1956
|
+
|
|
1957
|
+
export type ${upperName} = JsxFactory & JsxElements
|
|
1467
1958
|
|
|
1468
1959
|
export type ${typeName}<T extends ElementType> = JsxHTMLProps<ComponentProps<T>, JsxStyleProps>
|
|
1469
1960
|
`
|
|
@@ -1475,7 +1966,8 @@ var typesMap = {
|
|
|
1475
1966
|
react: generateReactJsxTypes,
|
|
1476
1967
|
preact: generatePreactJsxTypes,
|
|
1477
1968
|
solid: generateSolidJsxTypes,
|
|
1478
|
-
vue: generateVueJsxTypes
|
|
1969
|
+
vue: generateVueJsxTypes,
|
|
1970
|
+
qwik: generateQwikJsxTypes
|
|
1479
1971
|
};
|
|
1480
1972
|
function generateJsxTypes(ctx) {
|
|
1481
1973
|
if (!ctx.jsx.framework)
|
|
@@ -1486,7 +1978,8 @@ var factoryMap = {
|
|
|
1486
1978
|
react: generateReactJsxFactory,
|
|
1487
1979
|
solid: generateSolidJsxFactory,
|
|
1488
1980
|
preact: generatePreactJsxFactory,
|
|
1489
|
-
vue: generateVueJsxFactory
|
|
1981
|
+
vue: generateVueJsxFactory,
|
|
1982
|
+
qwik: generateQwikJsxFactory
|
|
1490
1983
|
};
|
|
1491
1984
|
function generateJsxFactory(ctx) {
|
|
1492
1985
|
if (!ctx.jsx.framework)
|
|
@@ -1497,7 +1990,8 @@ var patternMap = {
|
|
|
1497
1990
|
react: generateReactJsxPattern,
|
|
1498
1991
|
solid: generateSolidJsxPattern,
|
|
1499
1992
|
preact: generatePreactJsxPattern,
|
|
1500
|
-
vue:
|
|
1993
|
+
vue: generateVueJsxPattern,
|
|
1994
|
+
qwik: generateQwikJsxPattern
|
|
1501
1995
|
};
|
|
1502
1996
|
function generateJsxPatterns(ctx) {
|
|
1503
1997
|
if (ctx.patterns.isEmpty() && !ctx.jsx.framework)
|
|
@@ -1552,22 +2046,22 @@ var csstype_d_ts_default = {
|
|
|
1552
2046
|
|
|
1553
2047
|
// src/artifacts/generated/system-types.d.ts.json
|
|
1554
2048
|
var system_types_d_ts_default = {
|
|
1555
|
-
content: "import type { ConditionalValue, Conditions, Nested } from './conditions'\nimport type { PropertiesFallback } from './csstype'\nimport type { SystemProperties, CssVarProperties } from './style-props'\n\ntype String = string & {}\ntype Number = number & {}\n\n/* -----------------------------------------------------------------------------\n * Native css properties\n * -----------------------------------------------------------------------------*/\n\nexport type CssProperty = keyof PropertiesFallback\n\nexport type CssProperties = PropertiesFallback<String | Number> & CssVarProperties\n\nexport type CssKeyframes = {\n [name: string]: {\n [time: string]: CssProperties\n }\n}\n\n/* -----------------------------------------------------------------------------\n * Conditional css properties\n * -----------------------------------------------------------------------------*/\n\ntype MinimalNested<P> = {\n [K in keyof Conditions]?: Nested<P>\n}\n\ntype GenericProperties = {\n [key: string]: ConditionalValue<String | Number | boolean>\n}\n\n/* -----------------------------------------------------------------------------\n * Native css props\n * -----------------------------------------------------------------------------*/\n\nexport type NestedCssProperties = Nested<CssProperties>\n\nexport type SystemStyleObject = Nested<
|
|
2049
|
+
content: "import type { ConditionalValue, Conditions, Nested } from './conditions'\nimport type { PropertiesFallback } from './csstype'\nimport type { SystemProperties, CssVarProperties } from './style-props'\n\ntype String = string & {}\ntype Number = number & {}\n\n/* -----------------------------------------------------------------------------\n * Native css properties\n * -----------------------------------------------------------------------------*/\n\nexport type CssProperty = keyof PropertiesFallback\n\nexport type CssProperties = PropertiesFallback<String | Number> & CssVarProperties\n\nexport type CssKeyframes = {\n [name: string]: {\n [time: string]: CssProperties\n }\n}\n\n/* -----------------------------------------------------------------------------\n * Conditional css properties\n * -----------------------------------------------------------------------------*/\n\ntype MinimalNested<P> = {\n [K in keyof Conditions]?: Nested<P>\n}\n\ntype GenericProperties = {\n [key: string]: ConditionalValue<String | Number | boolean>\n}\n\n/* -----------------------------------------------------------------------------\n * Native css props\n * -----------------------------------------------------------------------------*/\n\nexport type NestedCssProperties = Nested<CssProperties>\n\nexport type SystemStyleObject = Nested<SystemProperties & CssVarProperties>\n\nexport type GlobalStyleObject = {\n [selector: string]: SystemStyleObject\n}\n\nexport type CompositionStyleObject<Property extends string> = Nested<{\n [K in Property]?: K extends keyof SystemStyleObject ? SystemStyleObject[K] : unknown\n}>\n\n/* -----------------------------------------------------------------------------\n * Jsx style props\n * -----------------------------------------------------------------------------*/\n\nexport type JsxStyleProps = SystemProperties &\n MinimalNested<SystemStyleObject> & {\n css?: SystemStyleObject\n }\n\ntype Assign<T, U> = Omit<T, keyof U> & U\n\nexport type PatchedHTMLProps = {\n htmlSize?: string | number\n htmlWidth?: string | number\n htmlHeight?: string | number\n htmlTranslate?: 'yes' | 'no' | undefined\n htmlContent?: string\n}\n\nexport type OmittedHTMLProps = 'color' | 'translate' | 'transition' | 'width' | 'height' | 'size' | 'content'\n\ntype WithHTMLProps<T> = Omit<T, OmittedHTMLProps> & PatchedHTMLProps\n\nexport type JsxHTMLProps<T extends Record<string, any>, P extends Record<string, any> = {}> = Assign<\n WithHTMLProps<T>,\n P\n>\n"
|
|
1556
2050
|
};
|
|
1557
2051
|
|
|
1558
2052
|
// src/artifacts/generated/composition.d.ts.json
|
|
1559
2053
|
var composition_d_ts_default = {
|
|
1560
|
-
content: "import type { CompositionStyleObject } from './system-types'\n\ntype Recursive<T> = {\n [key: string]: Recursive<T> | T\n}\n\nexport type Token<Value = any> = {\n value: Value\n description?: string\n}\n\n/* -----------------------------------------------------------------------------\n * Text styles\n * -----------------------------------------------------------------------------*/\n\ntype TextStyleProperty =\n | 'fontSize'\n | 'fontSizeAdjust'\n | 'fontVariationSettings'\n | 'fontVariantPosition'\n | 'fontVariantCaps'\n | 'fontVariantNumeric'\n | 'fontVariantAlternates'\n | 'fontVariantLigatures'\n | 'fontFamily'\n | 'fontWeight'\n | 'fontSynthesis'\n | 'fontStyle'\n | 'fontVariant'\n | 'lineHeight'\n | 'letterSpacing'\n | 'textDecoration'\n | 'textTransform'\n | 'textIndent'\n | 'textDecorationColor'\n | 'textDecorationLine'\n | 'textDecorationStyle'\n | 'textEmphasisColor'\n | 'textEmphasisPosition'\n | 'textEmphasisStyle'\n | 'hyphenateCharacter'\n | 'textOrientation'\n | 'textOverflow'\n | 'textRendering'\n\nexport type TextStyle = CompositionStyleObject<TextStyleProperty>\n\nexport type TextStyles = Recursive<Token<TextStyle>>\n\n/* -----------------------------------------------------------------------------\n * Layer styles\n * -----------------------------------------------------------------------------*/\n\ntype Placement =\n | 'Top'\n | 'Right'\n | 'Bottom'\n | 'Left'\n | 'Inline'\n | 'Block'\n | 'InlineStart'\n | 'InlineEnd'\n | 'BlockStart'\n | 'BlockEnd'\n\ntype Radius =\n | `Top${'Right' | 'Left'
|
|
2054
|
+
content: "import type { CompositionStyleObject } from './system-types'\n\ntype Recursive<T> = {\n [key: string]: Recursive<T> | T\n}\n\nexport type Token<Value = any> = {\n value: Value\n description?: string\n}\n\n/* -----------------------------------------------------------------------------\n * Text styles\n * -----------------------------------------------------------------------------*/\n\ntype TextStyleProperty =\n | 'fontSize'\n | 'fontSizeAdjust'\n | 'fontVariationSettings'\n | 'fontVariantPosition'\n | 'fontVariantCaps'\n | 'fontVariantNumeric'\n | 'fontVariantAlternates'\n | 'fontVariantLigatures'\n | 'fontFamily'\n | 'fontWeight'\n | 'fontSynthesis'\n | 'fontStyle'\n | 'fontVariant'\n | 'lineHeight'\n | 'letterSpacing'\n | 'textDecoration'\n | 'textTransform'\n | 'textIndent'\n | 'textDecorationColor'\n | 'textDecorationLine'\n | 'textDecorationStyle'\n | 'textEmphasisColor'\n | 'textEmphasisPosition'\n | 'textEmphasisStyle'\n | 'hyphenateCharacter'\n | 'textOrientation'\n | 'textOverflow'\n | 'textRendering'\n\nexport type TextStyle = CompositionStyleObject<TextStyleProperty>\n\nexport type TextStyles = Recursive<Token<TextStyle>>\n\n/* -----------------------------------------------------------------------------\n * Layer styles\n * -----------------------------------------------------------------------------*/\n\ntype Placement =\n | 'Top'\n | 'Right'\n | 'Bottom'\n | 'Left'\n | 'Inline'\n | 'Block'\n | 'InlineStart'\n | 'InlineEnd'\n | 'BlockStart'\n | 'BlockEnd'\n\ntype Radius =\n | `Top${'Right' | 'Left'}`\n | `Bottom${'Right' | 'Left'}`\n | `Start${'Start' | 'End'}`\n | `End${'Start' | 'End'}`\n\ntype LayerStyleProperty =\n | 'background'\n | 'backgroundColor'\n | 'backgroundImage'\n | 'borderRadius'\n | 'border'\n | 'borderWidth'\n | 'borderColor'\n | 'borderStyle'\n | 'boxShadow'\n | 'filter'\n | 'backdropFilter'\n | 'transform'\n | 'color'\n | 'opacity'\n | 'backgroundBlendMode'\n | 'backgroundAttachment'\n | 'backgroundClip'\n | 'backgroundOrigin'\n | 'backgroundPosition'\n | 'backgroundRepeat'\n | 'backgroundSize'\n | `border${Placement}`\n | `border${Placement}Width`\n | 'borderRadius'\n | `border${Radius}Radius`\n | `border${Placement}Color`\n | `border${Placement}Style`\n | 'padding'\n | `padding${Placement}`\n\nexport type LayerStyle = CompositionStyleObject<LayerStyleProperty>\n\nexport type LayerStyles = Recursive<Token<LayerStyle>>\n\nexport type CompositionStyles = {\n textStyles: TextStyles\n layerStyles: LayerStyles\n}\n"
|
|
1561
2055
|
};
|
|
1562
2056
|
|
|
1563
2057
|
// src/artifacts/generated/recipe.d.ts.json
|
|
1564
2058
|
var recipe_d_ts_default = {
|
|
1565
|
-
content: "import type { SystemStyleObject } from './system-types'\n\ntype Pretty<T> = T extends infer U ? { [K in keyof U]: U[K] } : never\n\ntype StringToBoolean<T> = T extends 'true' | 'false' ? boolean : T\n\nexport type RecipeVariantRecord = Record<
|
|
2059
|
+
content: "import type { SystemStyleObject } from './system-types'\n\ntype Pretty<T> = T extends infer U ? { [K in keyof U]: U[K] } : never\n\ntype StringToBoolean<T> = T extends 'true' | 'false' ? boolean : T\n\nexport type RecipeVariantRecord = Record<any, Record<any, SystemStyleObject>>\n\nexport type RecipeSelection<T extends RecipeVariantRecord> = keyof any extends keyof T\n ? {}\n : {\n [K in keyof T]?: StringToBoolean<keyof T[K]>\n }\n\nexport type RecipeVariantFn<T extends RecipeVariantRecord> = (props?: RecipeSelection<T>) => string\n\nexport type RecipeVariantProps<T extends RecipeVariantFn<RecipeVariantRecord>> = Pretty<Parameters<T>[0]>\n\ntype RecipeVariantMap<T extends RecipeVariantRecord> = {\n [K in keyof T]: Array<keyof T[K]>\n}\n\nexport type RecipeRuntimeFn<T extends RecipeVariantRecord> = RecipeVariantFn<T> & {\n __type: RecipeSelection<T>\n variantKeys: (keyof T)[]\n variantMap: RecipeVariantMap<T>\n resolve: (props: RecipeSelection<T>) => SystemStyleObject\n config: RecipeConfig<T>\n splitVariantProps<Props extends RecipeSelection<T>>(\n props: Props,\n ): [RecipeSelection<T>, Pretty<Omit<Props, keyof RecipeVariantRecord>>]\n}\n\nexport type RecipeCompoundSelection<T extends RecipeVariantRecord> = {\n [K in keyof T]?: StringToBoolean<keyof T[K]> | Array<StringToBoolean<keyof T[K]>>\n}\n\nexport type RecipeCompoundVariant<T extends RecipeVariantRecord> = RecipeCompoundSelection<T> & {\n css: SystemStyleObject\n}\n\nexport type RecipeDefinition<T extends RecipeVariantRecord> = {\n /**\n * The base styles of the recipe.\n */\n base?: SystemStyleObject\n /**\n * The multi-variant styles of the recipe.\n */\n variants?: T | RecipeVariantRecord\n /**\n * The default variants of the recipe.\n */\n defaultVariants?: RecipeSelection<T>\n /**\n * The styles to apply when a combination of variants is selected.\n */\n compoundVariants?: Array<RecipeCompoundVariant<T>>\n}\n\nexport type RecipeCreatorFn = <T extends RecipeVariantRecord>(config: RecipeDefinition<T>) => RecipeRuntimeFn<T>\n\nexport type RecipeConfig<T extends RecipeVariantRecord = RecipeVariantRecord> = RecipeDefinition<T> & {\n /**\n * The name of the recipe.\n */\n name: string\n /**\n * The description of the recipe. This will be used in the JSDoc comment.\n */\n description?: string\n /**\n * The jsx elements to track for this recipe. Can be string or Regexp.\n *\n * @default capitalize(recipe.name)\n * @example ['Button', 'Link', /Button$/]\n */\n jsx?: Array<string | RegExp>\n}\n"
|
|
1566
2060
|
};
|
|
1567
2061
|
|
|
1568
2062
|
// src/artifacts/generated/pattern.d.ts.json
|
|
1569
2063
|
var pattern_d_ts_default = {
|
|
1570
|
-
content: "import type { CssProperty, SystemStyleObject } from './system-types'\nimport type { TokenCategory } from '../tokens'\n\ntype Primitive = string | number | boolean | null | undefined\ntype LiteralUnion<T, K extends Primitive = string> = T | (K & Record<never, never>)\n\nexport type PatternProperty =\n | { type: 'property'; value: CssProperty }\n | { type: 'enum'; value: string[] }\n | { type: 'token'; value: TokenCategory; property?: CssProperty }\n | { type: 'string' | 'boolean' | 'number' }\n\nexport type PatternHelpers = {\n map: (value: any, fn: (value: string) => string | undefined) => any\n}\n\nexport type PatternConfig<T> = {\n /**\n * The description of the pattern. This will be used in the JSDoc comment.\n */\n description?: string\n /**\n * The JSX element rendered by the pattern\n * @default 'div'\n */\n jsxElement?: string\n /**\n * The properties of the pattern.\n */\n properties: T
|
|
2064
|
+
content: "import type { CssProperty, SystemStyleObject } from './system-types'\nimport type { TokenCategory } from '../tokens'\n\ntype Primitive = string | number | boolean | null | undefined\ntype LiteralUnion<T, K extends Primitive = string> = T | (K & Record<never, never>)\n\nexport type PatternProperty =\n | { type: 'property'; value: CssProperty }\n | { type: 'enum'; value: string[] }\n | { type: 'token'; value: TokenCategory; property?: CssProperty }\n | { type: 'string' | 'boolean' | 'number' }\n\nexport type PatternHelpers = {\n map: (value: any, fn: (value: string) => string | undefined) => any\n}\n\ntype PatternProperties = Record<string, PatternProperty>\n\ntype Props<T> = Record<LiteralUnion<keyof T>, any>\n\nexport type PatternConfig<T extends PatternProperties = PatternProperties> = {\n /**\n * The description of the pattern. This will be used in the JSDoc comment.\n */\n description?: string\n /**\n * The JSX element rendered by the pattern\n * @default 'div'\n */\n jsxElement?: string\n /**\n * The properties of the pattern.\n */\n properties: T\n /**\n * The css object this pattern will generate.\n */\n transform?: (props: Props<T>, helpers: PatternHelpers) => SystemStyleObject\n /**\n * The jsx element name this pattern will generate.\n */\n jsx?: string\n /**\n * Whether to only generate types for the specified properties.\n * This will disallow css properties\n */\n strict?: boolean\n /**\n * @experimental\n * Disallow certain css properties for this pattern\n */\n blocklist?: LiteralUnion<CssProperty>[]\n}\n"
|
|
1571
2065
|
};
|
|
1572
2066
|
|
|
1573
2067
|
// src/artifacts/generated/parts.d.ts.json
|
|
@@ -1594,38 +2088,38 @@ function getGeneratedTypes() {
|
|
|
1594
2088
|
}
|
|
1595
2089
|
|
|
1596
2090
|
// src/artifacts/types/main.ts
|
|
1597
|
-
var
|
|
2091
|
+
var import_outdent25 = require("outdent");
|
|
1598
2092
|
var generateTypesEntry = () => ({
|
|
1599
|
-
global:
|
|
1600
|
-
import {
|
|
2093
|
+
global: import_outdent25.outdent`
|
|
2094
|
+
import { RecipeVariantRecord, RecipeConfig } from './recipe'
|
|
1601
2095
|
import { Parts } from './parts'
|
|
1602
|
-
import {
|
|
2096
|
+
import { PatternConfig } from './pattern'
|
|
1603
2097
|
import { GlobalStyleObject, SystemStyleObject } from './system-types'
|
|
1604
2098
|
import { CompositionStyles } from './composition'
|
|
1605
2099
|
|
|
1606
2100
|
declare module '@pandacss/dev' {
|
|
1607
|
-
export function defineRecipe<V extends RecipeVariantRecord>(config: RecipeConfig<V>):
|
|
2101
|
+
export function defineRecipe<V extends RecipeVariantRecord>(config: RecipeConfig<V>): RecipeConfig
|
|
1608
2102
|
export function defineStyles(definition: SystemStyleObject): SystemStyleObject
|
|
1609
2103
|
export function defineGlobalStyles(definition: GlobalStyleObject): GlobalStyleObject
|
|
1610
2104
|
export function defineTextStyles(definition: CompositionStyles['textStyles']): CompositionStyles['textStyles']
|
|
1611
2105
|
export function defineLayerStyles(definition: CompositionStyles['layerStyles']): CompositionStyles['layerStyles']
|
|
1612
|
-
export function definePattern<
|
|
2106
|
+
export function definePattern<T>(config: PatternConfig<T>): PatternConfig
|
|
1613
2107
|
export function defineParts<T extends Parts>(parts: T): (config: Partial<Record<keyof T, SystemStyleObject>>) => Partial<Record<keyof T, SystemStyleObject>>;
|
|
1614
2108
|
}
|
|
1615
2109
|
`,
|
|
1616
|
-
index:
|
|
2110
|
+
index: import_outdent25.outdent`
|
|
1617
2111
|
import './global'
|
|
1618
2112
|
export { ConditionalValue } from './conditions'
|
|
1619
2113
|
export { GlobalStyleObject, JsxStyleProps, SystemStyleObject } from './system-types'
|
|
1620
2114
|
|
|
1621
2115
|
`,
|
|
1622
|
-
helpers:
|
|
2116
|
+
helpers: import_outdent25.outdent`
|
|
1623
2117
|
export type Pretty<T> = T extends infer U ? { [K in keyof U]: U[K] } : never
|
|
1624
2118
|
`
|
|
1625
2119
|
});
|
|
1626
2120
|
|
|
1627
2121
|
// src/artifacts/types/prop-types.ts
|
|
1628
|
-
var
|
|
2122
|
+
var import_outdent26 = require("outdent");
|
|
1629
2123
|
function generatePropTypes(ctx) {
|
|
1630
2124
|
const {
|
|
1631
2125
|
config: { strictTokens },
|
|
@@ -1633,7 +2127,7 @@ function generatePropTypes(ctx) {
|
|
|
1633
2127
|
} = ctx;
|
|
1634
2128
|
const strictText = `${strictTokens ? "" : " | CssValue<T>"}`;
|
|
1635
2129
|
const result = [
|
|
1636
|
-
|
|
2130
|
+
import_outdent26.outdent`
|
|
1637
2131
|
import type { ConditionalValue } from './conditions';
|
|
1638
2132
|
import type { CssProperties } from './system-types'
|
|
1639
2133
|
import type { Tokens } from '../tokens'
|
|
@@ -1656,7 +2150,7 @@ function generatePropTypes(ctx) {
|
|
|
1656
2150
|
result.push(` ${key}: Shorthand<${JSON.stringify(value)}>;`);
|
|
1657
2151
|
});
|
|
1658
2152
|
result.push("}");
|
|
1659
|
-
return
|
|
2153
|
+
return import_outdent26.outdent`
|
|
1660
2154
|
${result.join("\n")}
|
|
1661
2155
|
|
|
1662
2156
|
export type PropertyValue<T extends string> = T extends keyof PropertyTypes
|
|
@@ -1669,10 +2163,10 @@ function generatePropTypes(ctx) {
|
|
|
1669
2163
|
|
|
1670
2164
|
// src/artifacts/types/style-props.ts
|
|
1671
2165
|
var import_is_valid_prop = require("@pandacss/is-valid-prop");
|
|
1672
|
-
var
|
|
2166
|
+
var import_outdent27 = __toESM(require("outdent"));
|
|
1673
2167
|
function generateStyleProps(ctx) {
|
|
1674
2168
|
const props = new Set(import_is_valid_prop.allCssProperties.concat(ctx.utility.keys()));
|
|
1675
|
-
return
|
|
2169
|
+
return import_outdent27.default`
|
|
1676
2170
|
import { ConditionalValue } from './conditions'
|
|
1677
2171
|
import { PropertyValue } from './prop-type'
|
|
1678
2172
|
import { Token } from '../tokens'
|
|
@@ -1689,7 +2183,7 @@ function generateStyleProps(ctx) {
|
|
|
1689
2183
|
|
|
1690
2184
|
// src/artifacts/types/token-types.ts
|
|
1691
2185
|
var import_shared3 = require("@pandacss/shared");
|
|
1692
|
-
var
|
|
2186
|
+
var import_outdent28 = require("outdent");
|
|
1693
2187
|
var import_pluralize = __toESM(require("pluralize"));
|
|
1694
2188
|
var categories = [
|
|
1695
2189
|
"zIndex",
|
|
@@ -1721,88 +2215,22 @@ function generateTokenTypes(ctx) {
|
|
|
1721
2215
|
if (tokens.isEmpty) {
|
|
1722
2216
|
result.add("[token: string]: string");
|
|
1723
2217
|
} else {
|
|
2218
|
+
const colorPaletteKeys = Object.keys(tokens.colorPalettes);
|
|
2219
|
+
if (colorPaletteKeys.length) {
|
|
2220
|
+
set.add(`export type ColorPalette = ${(0, import_shared3.unionType)(Object.keys(tokens.colorPalettes))}`);
|
|
2221
|
+
}
|
|
1724
2222
|
for (const [key, value] of tokens.categoryMap.entries()) {
|
|
1725
2223
|
const typeName = (0, import_shared3.capitalize)(import_pluralize.default.singular(key));
|
|
1726
2224
|
set.add(`export type ${typeName}Token = ${(0, import_shared3.unionType)(value.keys())}`);
|
|
1727
|
-
set.add(`export type ColorPalette = ${(0, import_shared3.unionType)(Object.keys(tokens.colorPalettes))}`);
|
|
1728
2225
|
result.add(` ${key}: ${typeName}Token`);
|
|
1729
2226
|
}
|
|
1730
2227
|
}
|
|
1731
2228
|
result.add("} & { [token: string]: never }");
|
|
1732
2229
|
set.add(Array.from(result).join("\n"));
|
|
1733
2230
|
set.add(`export type TokenCategory = ${(0, import_shared3.unionType)(categories)}`);
|
|
1734
|
-
return
|
|
2231
|
+
return import_outdent28.outdent.string(Array.from(set).join("\n\n"));
|
|
1735
2232
|
}
|
|
1736
2233
|
|
|
1737
|
-
// src/artifacts/css/global-css.ts
|
|
1738
|
-
var generateGlobalCss = (ctx) => {
|
|
1739
|
-
const { globalCss = {}, optimize = true } = ctx.config;
|
|
1740
|
-
const sheet = ctx.createSheet();
|
|
1741
|
-
sheet.processGlobalCss({
|
|
1742
|
-
":root": {
|
|
1743
|
-
"--made-with-panda": `'\u{1F43C}'`
|
|
1744
|
-
},
|
|
1745
|
-
"*, *::before, *::after, ::backdrop": {
|
|
1746
|
-
"--blur": "/*!*/ /*!*/",
|
|
1747
|
-
"--brightness": "/*!*/ /*!*/",
|
|
1748
|
-
"--contrast": "/*!*/ /*!*/",
|
|
1749
|
-
"--grayscale": "/*!*/ /*!*/",
|
|
1750
|
-
"--hue-rotate": "/*!*/ /*!*/",
|
|
1751
|
-
"--invert": "/*!*/ /*!*/",
|
|
1752
|
-
"--saturate": "/*!*/ /*!*/",
|
|
1753
|
-
"--sepia": "/*!*/ /*!*/",
|
|
1754
|
-
"--drop-shadow": "/*!*/ /*!*/",
|
|
1755
|
-
"--backdrop-blur": "/*!*/ /*!*/",
|
|
1756
|
-
"--backdrop-brightness": "/*!*/ /*!*/",
|
|
1757
|
-
"--backdrop-contrast": "/*!*/ /*!*/",
|
|
1758
|
-
"--backdrop-grayscale": "/*!*/ /*!*/",
|
|
1759
|
-
"--backdrop-hue-rotate": "/*!*/ /*!*/",
|
|
1760
|
-
"--backdrop-invert": "/*!*/ /*!*/",
|
|
1761
|
-
"--backdrop-opacity": "/*!*/ /*!*/",
|
|
1762
|
-
"--backdrop-saturate": "/*!*/ /*!*/",
|
|
1763
|
-
"--backdrop-sepia": "/*!*/ /*!*/",
|
|
1764
|
-
"--scroll-snap-strictness": "proximity",
|
|
1765
|
-
"--border-spacing-x": 0,
|
|
1766
|
-
"--border-spacing-y": 0,
|
|
1767
|
-
"--translate-x": 0,
|
|
1768
|
-
"--translate-y": 0,
|
|
1769
|
-
"--rotate": 0,
|
|
1770
|
-
"--skew-x": 0,
|
|
1771
|
-
"--skew-y": 0,
|
|
1772
|
-
"--scale-x": 1,
|
|
1773
|
-
"--scale-y": 1
|
|
1774
|
-
}
|
|
1775
|
-
});
|
|
1776
|
-
sheet.processGlobalCss(globalCss);
|
|
1777
|
-
return sheet.toCss({ optimize });
|
|
1778
|
-
};
|
|
1779
|
-
|
|
1780
|
-
// src/artifacts/css/static-css.ts
|
|
1781
|
-
var import_core3 = require("@pandacss/core");
|
|
1782
|
-
var generateStaticCss = (ctx) => {
|
|
1783
|
-
const { config, createSheet, utility, recipes } = ctx;
|
|
1784
|
-
const { staticCss = {}, theme = {}, optimize = true } = config;
|
|
1785
|
-
const sheet = createSheet();
|
|
1786
|
-
const fn = (0, import_core3.getStaticCss)(staticCss);
|
|
1787
|
-
const results = fn({
|
|
1788
|
-
breakpoints: Object.keys(theme.breakpoints ?? {}),
|
|
1789
|
-
getPropertyKeys: utility.getPropertyKeys,
|
|
1790
|
-
getRecipeKeys: (recipe) => recipes.details.find((detail) => detail.config.name === recipe)?.variantKeyMap ?? {}
|
|
1791
|
-
});
|
|
1792
|
-
results.css.forEach((css2) => {
|
|
1793
|
-
sheet.processAtomic(css2);
|
|
1794
|
-
});
|
|
1795
|
-
results.recipes.forEach((result) => {
|
|
1796
|
-
Object.entries(result).forEach(([name, value]) => {
|
|
1797
|
-
const recipeConfig = recipes.getConfig(name);
|
|
1798
|
-
if (!recipeConfig)
|
|
1799
|
-
return;
|
|
1800
|
-
sheet.processRecipe(recipeConfig, value);
|
|
1801
|
-
});
|
|
1802
|
-
});
|
|
1803
|
-
return sheet.toCss({ optimize });
|
|
1804
|
-
};
|
|
1805
|
-
|
|
1806
2234
|
// src/artifacts/index.ts
|
|
1807
2235
|
function setupHelpers(ctx) {
|
|
1808
2236
|
const code = generateHelpers();
|
|
@@ -1895,8 +2323,8 @@ function setupRecipes(ctx) {
|
|
|
1895
2323
|
return;
|
|
1896
2324
|
const indexFiles = files.filter((file) => !file.name.includes("create-recipe"));
|
|
1897
2325
|
const index = {
|
|
1898
|
-
js:
|
|
1899
|
-
dts:
|
|
2326
|
+
js: import_outdent29.default.string(indexFiles.map((file) => ctx.file.export(`./${file.name}`)).join("\n")),
|
|
2327
|
+
dts: import_outdent29.default.string(indexFiles.map((file) => `export * from './${file.name}'`).join("\n"))
|
|
1900
2328
|
};
|
|
1901
2329
|
return {
|
|
1902
2330
|
dir: ctx.paths.recipe,
|
|
@@ -1913,8 +2341,8 @@ function setupPatterns(ctx) {
|
|
|
1913
2341
|
if (!files)
|
|
1914
2342
|
return;
|
|
1915
2343
|
const index = {
|
|
1916
|
-
js:
|
|
1917
|
-
dts:
|
|
2344
|
+
js: import_outdent29.default.string(files.map((file) => ctx.file.export(`./${file.name}`)).join("\n")),
|
|
2345
|
+
dts: import_outdent29.default.string(files.map((file) => `export * from './${file.name}'`).join("\n"))
|
|
1918
2346
|
};
|
|
1919
2347
|
return {
|
|
1920
2348
|
dir: ctx.paths.pattern,
|
|
@@ -1934,13 +2362,13 @@ function setupJsx(ctx) {
|
|
|
1934
2362
|
const factory = generateJsxFactory(ctx);
|
|
1935
2363
|
const patterns = generateJsxPatterns(ctx);
|
|
1936
2364
|
const index = {
|
|
1937
|
-
js:
|
|
2365
|
+
js: import_outdent29.default`
|
|
1938
2366
|
${ctx.file.export("./factory")}
|
|
1939
|
-
${
|
|
2367
|
+
${import_outdent29.default.string(patterns.map((file) => ctx.file.export(`./${file.name}`)).join("\n"))}
|
|
1940
2368
|
`,
|
|
1941
|
-
dts:
|
|
2369
|
+
dts: import_outdent29.default`
|
|
1942
2370
|
export * from './factory'
|
|
1943
|
-
${
|
|
2371
|
+
${import_outdent29.default.string(patterns.map((file) => `export * from './${file.name}'`).join("\n"))}
|
|
1944
2372
|
export type { ${ctx.jsx.typeName} } from '../types/jsx'
|
|
1945
2373
|
`
|
|
1946
2374
|
};
|
|
@@ -1959,12 +2387,12 @@ function setupJsx(ctx) {
|
|
|
1959
2387
|
}
|
|
1960
2388
|
function setupCssIndex(ctx) {
|
|
1961
2389
|
const index = {
|
|
1962
|
-
js:
|
|
2390
|
+
js: import_outdent29.default`
|
|
1963
2391
|
${ctx.file.export("./css")}
|
|
1964
2392
|
${ctx.file.export("./cx")}
|
|
1965
2393
|
${ctx.file.export("./cva")}
|
|
1966
2394
|
`,
|
|
1967
|
-
dts:
|
|
2395
|
+
dts: import_outdent29.default`
|
|
1968
2396
|
export * from './css'
|
|
1969
2397
|
export * from './cx'
|
|
1970
2398
|
export * from './cva'
|
|
@@ -1979,9 +2407,11 @@ function setupCssIndex(ctx) {
|
|
|
1979
2407
|
};
|
|
1980
2408
|
}
|
|
1981
2409
|
function setupResetCss(ctx) {
|
|
1982
|
-
|
|
2410
|
+
const { preflight } = ctx.config;
|
|
2411
|
+
if (!preflight)
|
|
1983
2412
|
return;
|
|
1984
|
-
const
|
|
2413
|
+
const scope = (0, import_shared4.isObject)(preflight) ? preflight.scope : void 0;
|
|
2414
|
+
const code = generateResetCss(ctx, scope);
|
|
1985
2415
|
return { files: [{ file: "reset.css", code }] };
|
|
1986
2416
|
}
|
|
1987
2417
|
function setupGlobalCss(ctx) {
|
|
@@ -2037,10 +2467,10 @@ var generateFlattenedCss = (ctx) => (options) => {
|
|
|
2037
2467
|
const sheet = ctx.createSheet({
|
|
2038
2468
|
content: resolve ? [
|
|
2039
2469
|
generateGlobalCss(ctx),
|
|
2040
|
-
generateStaticCss(ctx),
|
|
2041
|
-
generateResetCss(),
|
|
2042
|
-
generateTokenCss(ctx),
|
|
2043
|
-
generateKeyframeCss(ctx)
|
|
2470
|
+
staticCss && generateStaticCss(ctx),
|
|
2471
|
+
preflight && generateResetCss(ctx),
|
|
2472
|
+
!ctx.tokens.isEmpty && generateTokenCss(ctx),
|
|
2473
|
+
keyframes && generateKeyframeCss(ctx)
|
|
2044
2474
|
].filter(Boolean).join("\n\n") : unresolved
|
|
2045
2475
|
});
|
|
2046
2476
|
sheet.append(...files);
|
|
@@ -2050,7 +2480,7 @@ var generateFlattenedCss = (ctx) => (options) => {
|
|
|
2050
2480
|
// src/artifacts/css/parser-css.ts
|
|
2051
2481
|
var import_logger2 = require("@pandacss/logger");
|
|
2052
2482
|
var import_func = require("lil-fp/func");
|
|
2053
|
-
var
|
|
2483
|
+
var import_ts_pattern6 = require("ts-pattern");
|
|
2054
2484
|
var flattenStyles = (data) => Object.assign({}, data, { css: void 0 }, data.css ?? {});
|
|
2055
2485
|
var generateParserCss = (ctx) => (result) => (0, import_func.pipe)(
|
|
2056
2486
|
{ ...ctx, sheet: ctx.createSheet(), result },
|
|
@@ -2076,7 +2506,7 @@ var generateParserCss = (ctx) => (result) => (0, import_func.pipe)(
|
|
|
2076
2506
|
const recipeConfig = recipes.getConfig(name);
|
|
2077
2507
|
if (!recipeConfig)
|
|
2078
2508
|
continue;
|
|
2079
|
-
(0,
|
|
2509
|
+
(0, import_ts_pattern6.match)(recipe).with({ type: "jsx-recipe", name: import_ts_pattern6.P.string }, ({ name: name2 }) => {
|
|
2080
2510
|
recipe.data.forEach((data) => {
|
|
2081
2511
|
const [recipeProps, styleProps] = recipes.splitProps(name2, flattenStyles(data));
|
|
2082
2512
|
sheet.processAtomic(styleProps);
|
|
@@ -2095,7 +2525,7 @@ var generateParserCss = (ctx) => (result) => (0, import_func.pipe)(
|
|
|
2095
2525
|
result2.pattern.forEach((patternSet, name) => {
|
|
2096
2526
|
try {
|
|
2097
2527
|
for (const pattern of patternSet) {
|
|
2098
|
-
(0,
|
|
2528
|
+
(0, import_ts_pattern6.match)(pattern).with({ type: "jsx-pattern", name: import_ts_pattern6.P.string }, ({ name: name2 }) => {
|
|
2099
2529
|
pattern.data.forEach((data) => {
|
|
2100
2530
|
const fnName = patterns.getFnName(name2);
|
|
2101
2531
|
const styleProps = patterns.transform(fnName, flattenStyles(data));
|
|
@@ -2115,7 +2545,9 @@ var generateParserCss = (ctx) => (result) => (0, import_func.pipe)(
|
|
|
2115
2545
|
}),
|
|
2116
2546
|
(0, import_func.tryCatch)(
|
|
2117
2547
|
({ sheet, result: result2, config: { minify, optimize } }) => {
|
|
2118
|
-
|
|
2548
|
+
const css2 = !result2.isEmpty() ? sheet.toCss({ minify, optimize }) : void 0;
|
|
2549
|
+
ctx.hooks.callHook("parser:css", result2.filePath ?? "", css2);
|
|
2550
|
+
return css2;
|
|
2119
2551
|
},
|
|
2120
2552
|
(err) => {
|
|
2121
2553
|
import_logger2.logger.error("serializer:css", "Failed to serialize CSS: " + err);
|
|
@@ -2126,60 +2558,99 @@ var generateParserCss = (ctx) => (result) => (0, import_func.pipe)(
|
|
|
2126
2558
|
// src/engines/base.ts
|
|
2127
2559
|
var import_core4 = require("@pandacss/core");
|
|
2128
2560
|
var import_is_valid_prop3 = require("@pandacss/is-valid-prop");
|
|
2129
|
-
var
|
|
2130
|
-
var import_shared4 = require("@pandacss/shared");
|
|
2561
|
+
var import_shared5 = require("@pandacss/shared");
|
|
2131
2562
|
var import_token_dictionary = require("@pandacss/token-dictionary");
|
|
2132
2563
|
var import_lil_fp = require("lil-fp");
|
|
2133
2564
|
var import_postcss3 = __toESM(require("postcss"));
|
|
2134
|
-
var helpers = {
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
}
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2565
|
+
var helpers = {
|
|
2566
|
+
map: import_shared5.mapObject
|
|
2567
|
+
};
|
|
2568
|
+
var getBaseEngine = (conf) => {
|
|
2569
|
+
const { config } = conf;
|
|
2570
|
+
const theme = config.theme ?? {};
|
|
2571
|
+
const hash = {
|
|
2572
|
+
tokens: (0, import_lil_fp.isBool)(config.hash) ? config.hash : config.hash?.cssVar,
|
|
2573
|
+
className: (0, import_lil_fp.isBool)(config.hash) ? config.hash : config.hash?.className
|
|
2574
|
+
};
|
|
2575
|
+
const prefix = {
|
|
2576
|
+
tokens: (0, import_lil_fp.isStr)(config.prefix) ? config.prefix : config.prefix?.cssVar,
|
|
2577
|
+
className: (0, import_lil_fp.isStr)(config.prefix) ? config.prefix : config.prefix?.className
|
|
2578
|
+
};
|
|
2579
|
+
const tokens = new import_token_dictionary.TokenDictionary({
|
|
2580
|
+
breakpoints: theme.breakpoints,
|
|
2581
|
+
tokens: theme.tokens,
|
|
2582
|
+
semanticTokens: theme.semanticTokens,
|
|
2583
|
+
prefix: prefix.tokens,
|
|
2584
|
+
hash: hash.tokens
|
|
2585
|
+
});
|
|
2586
|
+
const utility = new import_core4.Utility({
|
|
2587
|
+
prefix: prefix.className,
|
|
2588
|
+
tokens,
|
|
2589
|
+
config: config.utilities,
|
|
2590
|
+
separator: config.separator
|
|
2591
|
+
});
|
|
2592
|
+
const conditions = new import_core4.Conditions({
|
|
2593
|
+
conditions: config.conditions,
|
|
2594
|
+
breakpoints: config.theme?.breakpoints
|
|
2595
|
+
});
|
|
2596
|
+
const { textStyles, layerStyles } = theme;
|
|
2597
|
+
const compositions = (0, import_shared5.compact)({
|
|
2598
|
+
textStyle: textStyles,
|
|
2599
|
+
layerStyle: layerStyles
|
|
2600
|
+
});
|
|
2601
|
+
const compositionContext = { conditions, utility };
|
|
2602
|
+
(0, import_core4.assignCompositions)(compositions, compositionContext);
|
|
2603
|
+
const createSheetContext = () => ({
|
|
2604
|
+
root: import_postcss3.default.root(),
|
|
2605
|
+
conditions,
|
|
2606
|
+
utility,
|
|
2607
|
+
hash: hash.className,
|
|
2608
|
+
helpers
|
|
2609
|
+
});
|
|
2610
|
+
const createSheet = (options) => {
|
|
2611
|
+
const sheetContext = createSheetContext();
|
|
2612
|
+
return new import_core4.Stylesheet(sheetContext, {
|
|
2613
|
+
content: options?.content,
|
|
2614
|
+
recipes: theme?.recipes
|
|
2170
2615
|
});
|
|
2171
|
-
}
|
|
2172
|
-
);
|
|
2616
|
+
};
|
|
2617
|
+
const recipeContext = createSheetContext();
|
|
2618
|
+
const recipes = new import_core4.Recipes(theme?.recipes ?? {}, recipeContext);
|
|
2619
|
+
recipes.save();
|
|
2620
|
+
const properties = Array.from(/* @__PURE__ */ new Set(["css", ...utility.keys(), ...conditions.keys()]));
|
|
2621
|
+
const propertyMap = new Map(properties.map((prop) => [prop, true]));
|
|
2622
|
+
const isValidProperty = (0, import_shared5.memo)((key) => {
|
|
2623
|
+
return propertyMap.has(key) || (0, import_is_valid_prop3.isCssProperty)(key);
|
|
2624
|
+
});
|
|
2625
|
+
const studio = {
|
|
2626
|
+
outdir: `${config.outdir}-studio`,
|
|
2627
|
+
...conf.config.studio
|
|
2628
|
+
};
|
|
2629
|
+
return {
|
|
2630
|
+
...conf,
|
|
2631
|
+
studio,
|
|
2632
|
+
hash,
|
|
2633
|
+
prefix,
|
|
2634
|
+
tokens,
|
|
2635
|
+
utility,
|
|
2636
|
+
properties,
|
|
2637
|
+
isValidProperty,
|
|
2638
|
+
recipes,
|
|
2639
|
+
conditions,
|
|
2640
|
+
createSheetContext,
|
|
2641
|
+
createSheet
|
|
2642
|
+
};
|
|
2643
|
+
};
|
|
2173
2644
|
|
|
2174
2645
|
// src/engines/jsx.ts
|
|
2175
|
-
var
|
|
2646
|
+
var import_shared6 = require("@pandacss/shared");
|
|
2176
2647
|
var getJsxEngine = (config) => {
|
|
2177
2648
|
const { jsxFactory, jsxFramework } = config;
|
|
2178
2649
|
return {
|
|
2179
2650
|
factoryName: jsxFactory,
|
|
2180
|
-
upperName: (0,
|
|
2181
|
-
typeName: `HTML${(0,
|
|
2182
|
-
componentName: `${(0,
|
|
2651
|
+
upperName: (0, import_shared6.capitalize)(jsxFactory),
|
|
2652
|
+
typeName: `HTML${(0, import_shared6.capitalize)(jsxFactory)}Props`,
|
|
2653
|
+
componentName: `${(0, import_shared6.capitalize)(jsxFactory)}Component`,
|
|
2183
2654
|
framework: jsxFramework
|
|
2184
2655
|
};
|
|
2185
2656
|
};
|
|
@@ -2202,9 +2673,9 @@ var getPathEngine = ({ cwd, emitPackage, outdir }) => {
|
|
|
2202
2673
|
};
|
|
2203
2674
|
|
|
2204
2675
|
// src/engines/pattern.ts
|
|
2205
|
-
var
|
|
2676
|
+
var import_shared7 = require("@pandacss/shared");
|
|
2206
2677
|
var import_lil_fp2 = require("lil-fp");
|
|
2207
|
-
var helpers2 = { map:
|
|
2678
|
+
var helpers2 = { map: import_shared7.mapObject };
|
|
2208
2679
|
var getPatternEngine = (config) => {
|
|
2209
2680
|
return (0, import_lil_fp2.pipe)(
|
|
2210
2681
|
{ patterns: config.patterns ?? {} },
|
|
@@ -2217,11 +2688,11 @@ var getPatternEngine = (config) => {
|
|
|
2217
2688
|
};
|
|
2218
2689
|
}),
|
|
2219
2690
|
import_lil_fp2.Obj.bind("getNames", ({ getConfig }) => (name) => {
|
|
2220
|
-
const upperName = (0,
|
|
2691
|
+
const upperName = (0, import_shared7.capitalize)(name);
|
|
2221
2692
|
return {
|
|
2222
2693
|
name,
|
|
2223
2694
|
upperName,
|
|
2224
|
-
dashName: (0,
|
|
2695
|
+
dashName: (0, import_shared7.dashCase)(name),
|
|
2225
2696
|
styleFnName: `get${upperName}Style`,
|
|
2226
2697
|
jsxName: getConfig(name)?.jsx ?? upperName
|
|
2227
2698
|
};
|
|
@@ -2237,13 +2708,13 @@ var getPatternEngine = (config) => {
|
|
|
2237
2708
|
import_lil_fp2.Obj.bind("nodes", ({ patterns }) => {
|
|
2238
2709
|
return Object.entries(patterns).map(([name, pattern]) => ({
|
|
2239
2710
|
type: "pattern",
|
|
2240
|
-
name: pattern.jsx ?? (0,
|
|
2711
|
+
name: pattern.jsx ?? (0, import_shared7.capitalize)(name),
|
|
2241
2712
|
props: Object.keys(pattern.properties),
|
|
2242
2713
|
baseName: name
|
|
2243
2714
|
}));
|
|
2244
2715
|
}),
|
|
2245
2716
|
import_lil_fp2.Obj.bind("getFnName", ({ nodes }) => (jsx) => {
|
|
2246
|
-
return nodes.find((node) => node.name === jsx)?.baseName ?? (0,
|
|
2717
|
+
return nodes.find((node) => node.name === jsx)?.baseName ?? (0, import_shared7.uncapitalize)(jsx);
|
|
2247
2718
|
}),
|
|
2248
2719
|
import_lil_fp2.Obj.bind("isEmpty", ({ patterns }) => {
|
|
2249
2720
|
return () => Object.keys(patterns).length === 0;
|
|
@@ -2251,74 +2722,10 @@ var getPatternEngine = (config) => {
|
|
|
2251
2722
|
);
|
|
2252
2723
|
};
|
|
2253
2724
|
|
|
2254
|
-
// src/engines/recipe.ts
|
|
2255
|
-
var import_shared7 = require("@pandacss/shared");
|
|
2256
|
-
var import_lil_fp3 = require("lil-fp");
|
|
2257
|
-
var mergeRegex = (item) => {
|
|
2258
|
-
const regex = item.map((item2) => typeof item2 === "string" ? item2 : item2.source).join("|");
|
|
2259
|
-
return new RegExp(`^${regex}$`);
|
|
2260
|
-
};
|
|
2261
|
-
var getRecipeEngine = (config) => {
|
|
2262
|
-
return (0, import_lil_fp3.pipe)(
|
|
2263
|
-
{ recipes: config.theme?.recipes ?? {} },
|
|
2264
|
-
import_lil_fp3.Obj.bind("getConfig", ({ recipes }) => {
|
|
2265
|
-
return (name) => recipes[name];
|
|
2266
|
-
}),
|
|
2267
|
-
import_lil_fp3.Obj.bind("getNames", () => {
|
|
2268
|
-
return (name) => ({
|
|
2269
|
-
upperName: (0, import_shared7.capitalize)(name),
|
|
2270
|
-
dashName: (0, import_shared7.dashCase)(name),
|
|
2271
|
-
jsxName: (0, import_shared7.capitalize)(name)
|
|
2272
|
-
});
|
|
2273
|
-
}),
|
|
2274
|
-
import_lil_fp3.Obj.bind("nodes", ({ recipes }) => {
|
|
2275
|
-
return Object.entries(recipes).map(([name, recipe]) => {
|
|
2276
|
-
const jsx = recipe.jsx ?? [(0, import_shared7.capitalize)(name)];
|
|
2277
|
-
const match6 = mergeRegex(jsx);
|
|
2278
|
-
return {
|
|
2279
|
-
type: "recipe",
|
|
2280
|
-
name: (0, import_shared7.capitalize)(name),
|
|
2281
|
-
props: Object.keys(recipe.variants ?? {}),
|
|
2282
|
-
baseName: name,
|
|
2283
|
-
jsx,
|
|
2284
|
-
match: match6
|
|
2285
|
-
};
|
|
2286
|
-
});
|
|
2287
|
-
}),
|
|
2288
|
-
import_lil_fp3.Obj.bind("getFnName", ({ nodes }) => {
|
|
2289
|
-
return (jsx) => {
|
|
2290
|
-
const recipe = nodes.find((node) => node.match.test(jsx));
|
|
2291
|
-
return recipe?.baseName ?? (0, import_shared7.uncapitalize)(jsx);
|
|
2292
|
-
};
|
|
2293
|
-
}),
|
|
2294
|
-
import_lil_fp3.Obj.bind("splitProps", ({ nodes }) => {
|
|
2295
|
-
return (name, props) => {
|
|
2296
|
-
const recipe = nodes.find((node) => node.match.test(name));
|
|
2297
|
-
if (!recipe)
|
|
2298
|
-
return [{}, props];
|
|
2299
|
-
return (0, import_shared7.splitProps)(props, recipe.props);
|
|
2300
|
-
};
|
|
2301
|
-
}),
|
|
2302
|
-
import_lil_fp3.Obj.bind("details", ({ getNames, recipes }) => {
|
|
2303
|
-
return Object.entries(recipes).map(([name, recipe]) => ({
|
|
2304
|
-
...getNames(name),
|
|
2305
|
-
config: recipe,
|
|
2306
|
-
variantKeyMap: Object.fromEntries(
|
|
2307
|
-
Object.entries(recipe.variants ?? {}).map(([key, value]) => [key, Object.keys(value)])
|
|
2308
|
-
)
|
|
2309
|
-
}));
|
|
2310
|
-
}),
|
|
2311
|
-
import_lil_fp3.Obj.bind("isEmpty", ({ recipes }) => {
|
|
2312
|
-
return () => Object.keys(recipes).length === 0;
|
|
2313
|
-
})
|
|
2314
|
-
);
|
|
2315
|
-
};
|
|
2316
|
-
|
|
2317
2725
|
// src/engines/index.ts
|
|
2318
2726
|
var getEngine = (conf) => ({
|
|
2319
2727
|
...getBaseEngine(conf),
|
|
2320
2728
|
patterns: getPatternEngine(conf.config),
|
|
2321
|
-
recipes: getRecipeEngine(conf.config),
|
|
2322
2729
|
jsx: getJsxEngine(conf.config),
|
|
2323
2730
|
paths: getPathEngine(conf.config),
|
|
2324
2731
|
file: {
|
|
@@ -2339,7 +2746,7 @@ var defaults = (conf) => ({
|
|
|
2339
2746
|
...conf,
|
|
2340
2747
|
config: {
|
|
2341
2748
|
cssVarRoot: ":where(:root, :host)",
|
|
2342
|
-
jsxFactory: "
|
|
2749
|
+
jsxFactory: "styled",
|
|
2343
2750
|
outExtension: "mjs",
|
|
2344
2751
|
...conf.config
|
|
2345
2752
|
}
|
|
@@ -2350,15 +2757,15 @@ var getImportMap = (outdir) => ({
|
|
|
2350
2757
|
pattern: `${outdir}/patterns`,
|
|
2351
2758
|
jsx: `${outdir}/jsx`
|
|
2352
2759
|
});
|
|
2353
|
-
var createGenerator = (conf) => (0,
|
|
2760
|
+
var createGenerator = (conf) => (0, import_lil_fp3.pipe)(
|
|
2354
2761
|
getEngine(defaults(conf)),
|
|
2355
|
-
|
|
2762
|
+
import_lil_fp3.Obj.assign((ctx) => ({
|
|
2356
2763
|
getArtifacts: generateArtifacts(ctx),
|
|
2357
2764
|
getCss: generateFlattenedCss(ctx),
|
|
2358
2765
|
getParserCss: generateParserCss(ctx),
|
|
2359
2766
|
messages: getMessages(ctx)
|
|
2360
2767
|
})),
|
|
2361
|
-
|
|
2768
|
+
import_lil_fp3.Obj.bind("parserOptions", ({ config: { outdir }, jsx, isValidProperty, patterns, recipes }) => ({
|
|
2362
2769
|
importMap: getImportMap(outdir),
|
|
2363
2770
|
jsx: {
|
|
2364
2771
|
factory: jsx.factoryName,
|