@pandacss/generator 0.5.1 → 0.6.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.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +300 -282
- package/dist/index.mjs +301 -283
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -130,7 +130,7 @@ var getMessages = (ctx) => ({
|
|
|
130
130
|
|
|
131
131
|
// src/artifacts/index.ts
|
|
132
132
|
var import_shared4 = require("@pandacss/shared");
|
|
133
|
-
var
|
|
133
|
+
var import_outdent42 = __toESM(require("outdent"));
|
|
134
134
|
|
|
135
135
|
// src/artifacts/css/global-css.ts
|
|
136
136
|
var generateGlobalCss = (ctx) => {
|
|
@@ -206,199 +206,197 @@ function generateKeyframeCss(ctx) {
|
|
|
206
206
|
var css = String.raw;
|
|
207
207
|
function generateResetCss(ctx, scope = "") {
|
|
208
208
|
const selector = scope ? `${scope} ` : "";
|
|
209
|
-
const output = css
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
}
|
|
209
|
+
const output = css`@layer reset {
|
|
210
|
+
${selector}* {
|
|
211
|
+
margin: 0;
|
|
212
|
+
padding: 0;
|
|
213
|
+
font: inherit;
|
|
214
|
+
}
|
|
216
215
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
216
|
+
${selector}*,
|
|
217
|
+
${selector}*::before,
|
|
218
|
+
${selector}*::after {
|
|
219
|
+
box-sizing: border-box;
|
|
220
|
+
border-width: 0;
|
|
221
|
+
border-style: solid;
|
|
222
|
+
border-color: var(--global-color-border, currentColor);
|
|
223
|
+
}
|
|
225
224
|
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
225
|
+
${scope || "html"} {
|
|
226
|
+
line-height: 1.5;
|
|
227
|
+
--font-fallback: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
|
|
228
|
+
'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',
|
|
229
|
+
'Noto Color Emoji';
|
|
230
|
+
-webkit-text-size-adjust: 100%;
|
|
231
|
+
-webkit-text-size-adjust: 100%;
|
|
232
|
+
-webkit-font-smoothing: antialiased;
|
|
233
|
+
-moz-tab-size: 4;
|
|
234
|
+
tab-size: 4;
|
|
235
|
+
font-family: var(--global-font-body, var(--font-fallback));
|
|
236
|
+
}
|
|
238
237
|
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
238
|
+
${selector}hr {
|
|
239
|
+
height: 0;
|
|
240
|
+
color: inherit;
|
|
241
|
+
border-top-width: 1px;
|
|
242
|
+
}
|
|
244
243
|
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
244
|
+
body {
|
|
245
|
+
height: 100%;
|
|
246
|
+
line-height: inherit;
|
|
247
|
+
}
|
|
249
248
|
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
249
|
+
${selector}img {
|
|
250
|
+
border-style: none;
|
|
251
|
+
}
|
|
253
252
|
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
253
|
+
${selector}img,
|
|
254
|
+
${selector}svg,
|
|
255
|
+
${selector}video,
|
|
256
|
+
${selector}canvas,
|
|
257
|
+
${selector}audio,
|
|
258
|
+
${selector}iframe,
|
|
259
|
+
${selector}embed,
|
|
260
|
+
${selector}object {
|
|
261
|
+
display: block;
|
|
262
|
+
vertical-align: middle;
|
|
263
|
+
}
|
|
265
264
|
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
265
|
+
${selector}img,
|
|
266
|
+
${selector}video {
|
|
267
|
+
max-width: 100%;
|
|
268
|
+
height: auto;
|
|
269
|
+
}
|
|
271
270
|
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
271
|
+
${selector}p,
|
|
272
|
+
${selector}h1,
|
|
273
|
+
${selector}h2,
|
|
274
|
+
${selector}h3,
|
|
275
|
+
${selector}h4,
|
|
276
|
+
${selector}h5,
|
|
277
|
+
${selector}h6 {
|
|
278
|
+
overflow-wrap: break-word;
|
|
279
|
+
}
|
|
281
280
|
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
281
|
+
${selector}ol,
|
|
282
|
+
${selector}ul {
|
|
283
|
+
list-style: none;
|
|
284
|
+
}
|
|
286
285
|
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
286
|
+
${selector}code,
|
|
287
|
+
${selector}kbd,
|
|
288
|
+
${selector}pre,
|
|
289
|
+
${selector}samp {
|
|
290
|
+
font-size: 1em;
|
|
291
|
+
}
|
|
293
292
|
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
293
|
+
${selector}button,
|
|
294
|
+
${selector}[type='button'],
|
|
295
|
+
${selector}[type='reset'],
|
|
296
|
+
${selector}[type='submit'] {
|
|
297
|
+
-webkit-appearance: button;
|
|
298
|
+
background-color: transparent;
|
|
299
|
+
background-image: none;
|
|
300
|
+
}
|
|
302
301
|
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
302
|
+
${selector}button,
|
|
303
|
+
${selector}select {
|
|
304
|
+
text-transform: none;
|
|
305
|
+
}
|
|
307
306
|
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
307
|
+
${selector}table {
|
|
308
|
+
text-indent: 0;
|
|
309
|
+
border-color: inherit;
|
|
310
|
+
border-collapse: collapse;
|
|
311
|
+
}
|
|
313
312
|
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
313
|
+
${selector}input::placeholder,
|
|
314
|
+
${selector}textarea::placeholder {
|
|
315
|
+
opacity: 1;
|
|
316
|
+
color: var(--global-color-placeholder, #9ca3af);
|
|
317
|
+
}
|
|
319
318
|
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
319
|
+
${selector}textarea {
|
|
320
|
+
resize: vertical;
|
|
321
|
+
}
|
|
323
322
|
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
323
|
+
${selector}summary {
|
|
324
|
+
display: list-item;
|
|
325
|
+
}
|
|
327
326
|
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
327
|
+
${selector}small {
|
|
328
|
+
font-size: 80%;
|
|
329
|
+
}
|
|
331
330
|
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
331
|
+
${selector}sub,
|
|
332
|
+
${selector}sup {
|
|
333
|
+
font-size: 75%;
|
|
334
|
+
line-height: 0;
|
|
335
|
+
position: relative;
|
|
336
|
+
vertical-align: baseline;
|
|
337
|
+
}
|
|
339
338
|
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
339
|
+
${selector}sub {
|
|
340
|
+
bottom: -0.25em;
|
|
341
|
+
}
|
|
343
342
|
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
343
|
+
${selector}sup {
|
|
344
|
+
top: -0.5em;
|
|
345
|
+
}
|
|
347
346
|
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
347
|
+
${selector}dialog {
|
|
348
|
+
padding: 0;
|
|
349
|
+
}
|
|
351
350
|
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
351
|
+
${selector}a {
|
|
352
|
+
color: inherit;
|
|
353
|
+
text-decoration: inherit;
|
|
354
|
+
}
|
|
356
355
|
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
356
|
+
${selector}abbr:where([title]) {
|
|
357
|
+
text-decoration: underline dotted;
|
|
358
|
+
}
|
|
360
359
|
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
360
|
+
${selector}b,
|
|
361
|
+
${selector}strong {
|
|
362
|
+
font-weight: bolder;
|
|
363
|
+
}
|
|
365
364
|
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
365
|
+
${selector}code,
|
|
366
|
+
${selector}kbd,
|
|
367
|
+
${selector}samp,
|
|
368
|
+
${selector}pre {
|
|
369
|
+
font-size: 1em;
|
|
370
|
+
--font-mono-fallback: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New';
|
|
371
|
+
font-family: var(--global-font-mono, var(--font-fallback));
|
|
372
|
+
}
|
|
374
373
|
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
374
|
+
${selector}[type='search'] {
|
|
375
|
+
-webkit-appearance: textfield;
|
|
376
|
+
outline-offset: -2px;
|
|
377
|
+
}
|
|
379
378
|
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
379
|
+
${selector}::-webkit-search-decoration {
|
|
380
|
+
-webkit-appearance: none;
|
|
381
|
+
}
|
|
383
382
|
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
383
|
+
${selector}::-webkit-file-upload-button {
|
|
384
|
+
-webkit-appearance: button;
|
|
385
|
+
}
|
|
387
386
|
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
387
|
+
${selector}::-webkit-inner-spin-button,
|
|
388
|
+
${selector}::-webkit-outer-spin-button {
|
|
389
|
+
height: auto;
|
|
390
|
+
}
|
|
392
391
|
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
392
|
+
${selector}:-moz-ui-invalid {
|
|
393
|
+
box-shadow: none;
|
|
394
|
+
}
|
|
396
395
|
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
`;
|
|
396
|
+
${selector}:-moz-focusring {
|
|
397
|
+
outline: auto;
|
|
398
|
+
}
|
|
399
|
+
}`;
|
|
402
400
|
ctx.hooks.callHook("generator:css", "reset.css", output);
|
|
403
401
|
return output;
|
|
404
402
|
}
|
|
@@ -412,7 +410,15 @@ var generateStaticCss = (ctx) => {
|
|
|
412
410
|
const fn = (0, import_core2.getStaticCss)(staticCss);
|
|
413
411
|
const results = fn({
|
|
414
412
|
breakpoints: Object.keys(theme.breakpoints ?? {}),
|
|
415
|
-
getPropertyKeys: (prop) =>
|
|
413
|
+
getPropertyKeys: (prop) => {
|
|
414
|
+
const propConfig = utility.config[prop];
|
|
415
|
+
if (!propConfig)
|
|
416
|
+
return [];
|
|
417
|
+
const values = utility.getPropertyValues(propConfig);
|
|
418
|
+
if (!values)
|
|
419
|
+
return [];
|
|
420
|
+
return Object.keys(values);
|
|
421
|
+
},
|
|
416
422
|
getRecipeKeys: (recipe) => recipes.details.find((detail) => detail.config.name === recipe)?.variantKeyMap ?? {}
|
|
417
423
|
});
|
|
418
424
|
results.css.forEach((css2) => {
|
|
@@ -826,7 +832,7 @@ var import_outdent8 = require("outdent");
|
|
|
826
832
|
|
|
827
833
|
// src/artifacts/generated/helpers.mjs.json
|
|
828
834
|
var helpers_mjs_default = {
|
|
829
|
-
content: '// src/assert.ts\nfunction isObject(value) {\n return typeof value === "object" && value != null && !Array.isArray(value);\n}\n\n// src/astish.ts\nvar newRule = /(?:([\\u0080-\\uFFFF\\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\\s*)/g;\nvar ruleClean = /\\/\\*[^]*?\\*\\/|\\s\\s+|\\n/g;\nvar astish = (val, tree = [{}]) => {\n const block = newRule.exec((val ?? "").replace(ruleClean, ""));\n if (!block)\n return tree[0];\n if (block[4])\n tree.shift();\n else if (block[3])\n tree.unshift(tree[0][block[3]] = tree[0][block[3]] || {});\n else\n tree[0][block[1]] = block[2];\n return astish(val, tree);\n};\n\n// src/compact.ts\nfunction compact(value) {\n return Object.fromEntries(Object.entries(value ?? {}).filter(([_, value2]) => value2 !== void 0));\n}\n\n// src/condition.ts\nvar isBaseCondition = (v) => v === "base";\nfunction filterBaseConditions(c) {\n return c.slice().filter((v) => !isBaseCondition(v));\n}\n\n// src/css-important.ts\nvar importantRegex = /!(important)?$/;\nfunction isImportant(value) {\n return typeof value === "string" ? importantRegex.test(value) : false;\n}\nfunction withoutImportant(value) {\n return typeof value === "string" ? value.replace(importantRegex, "").trim() : value;\n}\nfunction withoutSpace(str) {\n return typeof str === "string" ? str.replaceAll(" ", "_") : str;\n}\n\n// src/hash.ts\nfunction toChar(code) {\n return String.fromCharCode(code + (code > 25 ? 39 : 97));\n}\nfunction toName(code) {\n let name = "";\n let x;\n for (x = Math.abs(code); x > 52; x = x / 52 | 0)\n name = toChar(x % 52) + name;\n return toChar(x % 52) + name;\n}\nfunction toPhash(h, x) {\n let i = x.length;\n while (i)\n h = h * 33 ^ x.charCodeAt(--i);\n return h;\n}\nfunction toHash(value) {\n return toName(toPhash(5381, value) >>> 0);\n}\n\n// src/merge-props.ts\nfunction mergeProps(...sources) {\n const result = {};\n for (const source of sources) {\n for (const [key, value] of Object.entries(source)) {\n if (isObject(value)) {\n result[key] = mergeProps(result[key] || {}, value);\n } else {\n result[key] = value;\n }\n }\n }\n return result;\n}\n\n// src/walk-object.ts\nvar isNotNullish = (element) => element != null;\nfunction walkObject(target, predicate, options = {}) {\n const { stop, getKey } = options;\n function inner(value, path = []) {\n if (isObject(value) || Array.isArray(value)) {\n const result = {};\n for (const [prop, child] of Object.entries(value)) {\n const key = getKey?.(prop) ?? prop;\n const childPath = [...path, key];\n if (stop?.(value, childPath)) {\n return predicate(value, path);\n }\n const next = inner(child, childPath);\n if (isNotNullish(next)) {\n result[key] = next;\n }\n }\n return result;\n }\n return predicate(value, path);\n }\n return inner(target);\n}\nfunction mapObject(obj, fn) {\n if (!isObject(obj))\n return fn(obj);\n return walkObject(obj, (value) => fn(value));\n}\n\n// src/normalize-style-object.ts\nfunction toResponsiveObject(values, breakpoints) {\n return values.reduce((acc, current, index) => {\n const key = breakpoints[index];\n if (current != null) {\n acc[key] = current;\n }\n return acc;\n }, {});\n}\nfunction normalizeShorthand(styles, context) {\n const { hasShorthand, resolveShorthand } = context.utility;\n return walkObject(styles, (v) => v, {\n getKey: (prop) => {\n return hasShorthand ? resolveShorthand(prop) : prop;\n }\n });\n}\nfunction normalizeStyleObject(styles, context) {\n const { utility, conditions } = context;\n const { hasShorthand, resolveShorthand } = utility;\n return walkObject(\n styles,\n (value) => {\n return Array.isArray(value) ? toResponsiveObject(value, conditions.breakpoints.keys) : value;\n },\n {\n stop: (value) => Array.isArray(value),\n getKey: (prop) => {\n return hasShorthand ? resolveShorthand(prop) : prop;\n }\n }\n );\n}\n\n// src/classname.ts\nvar fallbackCondition = {\n shift: (v) => v,\n finalize: (v) => v,\n breakpoints: { keys: [] }\n};\nvar sanitize = (value) => typeof value === "string" ? value.replaceAll(/[\\n\\s]+/g, " ") : value;\nfunction createCss(context) {\n const { utility, hash, conditions: conds = fallbackCondition } = context;\n const formatClassName = (str) => [utility.prefix, str].filter(Boolean).join("-");\n const hashFn = (conditions, className) => {\n let result;\n if (hash) {\n const baseArray = [...conds.finalize(conditions), className];\n result = formatClassName(toHash(baseArray.join(":")));\n } else {\n const baseArray = [...conds.finalize(conditions), formatClassName(className)];\n result = baseArray.join(":");\n }\n return result;\n };\n return (styleObject = {}) => {\n const normalizedObject = normalizeStyleObject(styleObject, context);\n const classNames = /* @__PURE__ */ new Set();\n walkObject(normalizedObject, (value, paths) => {\n const important = isImportant(value);\n if (value == null)\n return;\n const [prop, ...allConditions] = conds.shift(paths);\n const conditions = filterBaseConditions(allConditions);\n const transformed = utility.transform(prop, withoutImportant(sanitize(value)));\n let className = hashFn(conditions, transformed.className);\n if (important)\n className = `${className}!`;\n classNames.add(className);\n });\n return Array.from(classNames).join(" ");\n };\n}\nfunction compactStyles(...styles) {\n return styles.filter((style) => isObject(style) && Object.keys(compact(style)).length > 0);\n}\nfunction createMergeCss(context) {\n function resolve(styles) {\n const allStyles = compactStyles(...styles);\n if (allStyles.length === 1)\n return allStyles;\n return allStyles.map((style) => normalizeShorthand(style, context));\n }\n function mergeCss(...styles) {\n return mergeProps(...resolve(styles));\n }\n function assignCss(...styles) {\n return Object.assign({}, ...resolve(styles));\n }\n return { mergeCss, assignCss };\n}\n\n// src/memo.ts\nvar memo = (fn) => {\n const cache = /* @__PURE__ */ new Map();\n const get = (...args) => {\n const key = JSON.stringify(args);\n if (cache.has(key)) {\n return cache.get(key);\n }\n const result = fn(...args);\n cache.set(key, result);\n return result;\n };\n return get;\n};\n\n// src/hypenate.ts\nvar
|
|
835
|
+
content: '// src/assert.ts\nfunction isObject(value) {\n return typeof value === "object" && value != null && !Array.isArray(value);\n}\n\n// src/astish.ts\nvar newRule = /(?:([\\u0080-\\uFFFF\\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\\s*)/g;\nvar ruleClean = /\\/\\*[^]*?\\*\\/|\\s\\s+|\\n/g;\nvar astish = (val, tree = [{}]) => {\n const block = newRule.exec((val ?? "").replace(ruleClean, ""));\n if (!block)\n return tree[0];\n if (block[4])\n tree.shift();\n else if (block[3])\n tree.unshift(tree[0][block[3]] = tree[0][block[3]] || {});\n else\n tree[0][block[1]] = block[2];\n return astish(val, tree);\n};\n\n// src/compact.ts\nfunction compact(value) {\n return Object.fromEntries(Object.entries(value ?? {}).filter(([_, value2]) => value2 !== void 0));\n}\n\n// src/condition.ts\nvar isBaseCondition = (v) => v === "base";\nfunction filterBaseConditions(c) {\n return c.slice().filter((v) => !isBaseCondition(v));\n}\n\n// src/css-important.ts\nvar importantRegex = /!(important)?$/;\nfunction isImportant(value) {\n return typeof value === "string" ? importantRegex.test(value) : false;\n}\nfunction withoutImportant(value) {\n return typeof value === "string" ? value.replace(importantRegex, "").trim() : value;\n}\nfunction withoutSpace(str) {\n return typeof str === "string" ? str.replaceAll(" ", "_") : str;\n}\n\n// src/hash.ts\nfunction toChar(code) {\n return String.fromCharCode(code + (code > 25 ? 39 : 97));\n}\nfunction toName(code) {\n let name = "";\n let x;\n for (x = Math.abs(code); x > 52; x = x / 52 | 0)\n name = toChar(x % 52) + name;\n return toChar(x % 52) + name;\n}\nfunction toPhash(h, x) {\n let i = x.length;\n while (i)\n h = h * 33 ^ x.charCodeAt(--i);\n return h;\n}\nfunction toHash(value) {\n return toName(toPhash(5381, value) >>> 0);\n}\n\n// src/merge-props.ts\nfunction mergeProps(...sources) {\n const result = {};\n for (const source of sources) {\n for (const [key, value] of Object.entries(source)) {\n if (isObject(value)) {\n result[key] = mergeProps(result[key] || {}, value);\n } else {\n result[key] = value;\n }\n }\n }\n return result;\n}\n\n// src/walk-object.ts\nvar isNotNullish = (element) => element != null;\nfunction walkObject(target, predicate, options = {}) {\n const { stop, getKey } = options;\n function inner(value, path = []) {\n if (isObject(value) || Array.isArray(value)) {\n const result = {};\n for (const [prop, child] of Object.entries(value)) {\n const key = getKey?.(prop) ?? prop;\n const childPath = [...path, key];\n if (stop?.(value, childPath)) {\n return predicate(value, path);\n }\n const next = inner(child, childPath);\n if (isNotNullish(next)) {\n result[key] = next;\n }\n }\n return result;\n }\n return predicate(value, path);\n }\n return inner(target);\n}\nfunction mapObject(obj, fn) {\n if (!isObject(obj))\n return fn(obj);\n return walkObject(obj, (value) => fn(value));\n}\n\n// src/normalize-style-object.ts\nfunction toResponsiveObject(values, breakpoints) {\n return values.reduce((acc, current, index) => {\n const key = breakpoints[index];\n if (current != null) {\n acc[key] = current;\n }\n return acc;\n }, {});\n}\nfunction normalizeShorthand(styles, context) {\n const { hasShorthand, resolveShorthand } = context.utility;\n return walkObject(styles, (v) => v, {\n getKey: (prop) => {\n return hasShorthand ? resolveShorthand(prop) : prop;\n }\n });\n}\nfunction normalizeStyleObject(styles, context) {\n const { utility, conditions } = context;\n const { hasShorthand, resolveShorthand } = utility;\n return walkObject(\n styles,\n (value) => {\n return Array.isArray(value) ? toResponsiveObject(value, conditions.breakpoints.keys) : value;\n },\n {\n stop: (value) => Array.isArray(value),\n getKey: (prop) => {\n return hasShorthand ? resolveShorthand(prop) : prop;\n }\n }\n );\n}\n\n// src/classname.ts\nvar fallbackCondition = {\n shift: (v) => v,\n finalize: (v) => v,\n breakpoints: { keys: [] }\n};\nvar sanitize = (value) => typeof value === "string" ? value.replaceAll(/[\\n\\s]+/g, " ") : value;\nfunction createCss(context) {\n const { utility, hash, conditions: conds = fallbackCondition } = context;\n const formatClassName = (str) => [utility.prefix, str].filter(Boolean).join("-");\n const hashFn = (conditions, className) => {\n let result;\n if (hash) {\n const baseArray = [...conds.finalize(conditions), className];\n result = formatClassName(toHash(baseArray.join(":")));\n } else {\n const baseArray = [...conds.finalize(conditions), formatClassName(className)];\n result = baseArray.join(":");\n }\n return result;\n };\n return (styleObject = {}) => {\n const normalizedObject = normalizeStyleObject(styleObject, context);\n const classNames = /* @__PURE__ */ new Set();\n walkObject(normalizedObject, (value, paths) => {\n const important = isImportant(value);\n if (value == null)\n return;\n const [prop, ...allConditions] = conds.shift(paths);\n const conditions = filterBaseConditions(allConditions);\n const transformed = utility.transform(prop, withoutImportant(sanitize(value)));\n let className = hashFn(conditions, transformed.className);\n if (important)\n className = `${className}!`;\n classNames.add(className);\n });\n return Array.from(classNames).join(" ");\n };\n}\nfunction compactStyles(...styles) {\n return styles.filter((style) => isObject(style) && Object.keys(compact(style)).length > 0);\n}\nfunction createMergeCss(context) {\n function resolve(styles) {\n const allStyles = compactStyles(...styles);\n if (allStyles.length === 1)\n return allStyles;\n return allStyles.map((style) => normalizeShorthand(style, context));\n }\n function mergeCss(...styles) {\n return mergeProps(...resolve(styles));\n }\n function assignCss(...styles) {\n return Object.assign({}, ...resolve(styles));\n }\n return { mergeCss, assignCss };\n}\n\n// src/memo.ts\nvar memo = (fn) => {\n const cache = /* @__PURE__ */ new Map();\n const get = (...args) => {\n const key = JSON.stringify(args);\n if (cache.has(key)) {\n return cache.get(key);\n }\n const result = fn(...args);\n cache.set(key, result);\n return result;\n };\n return get;\n};\n\n// src/hypenate-property.ts\nvar wordRegex = /([A-Z])/g;\nvar msRegex = /^ms-/;\nvar hypenateProperty = memo((property) => {\n if (property.startsWith("--"))\n return property;\n return property.replace(wordRegex, "-$1").replace(msRegex, "-ms-").toLowerCase();\n});\n\n// src/normalize-html.ts\nvar htmlProps = ["htmlSize", "htmlTranslate", "htmlWidth", "htmlHeight"];\nfunction convert(key) {\n return htmlProps.includes(key) ? key.replace("html", "").toLowerCase() : key;\n}\nfunction normalizeHTMLProps(props) {\n return Object.fromEntries(Object.entries(props).map(([key, value]) => [convert(key), value]));\n}\nnormalizeHTMLProps.keys = htmlProps;\n\n// src/split-props.ts\nfunction splitProps(props, ...keys) {\n const descriptors = Object.getOwnPropertyDescriptors(props);\n const dKeys = Object.keys(descriptors);\n const split = (k) => {\n const clone = {};\n for (let i = 0; i < k.length; i++) {\n const key = k[i];\n if (descriptors[key]) {\n Object.defineProperty(clone, key, descriptors[key]);\n delete descriptors[key];\n }\n }\n return clone;\n };\n const fn = (key) => split(Array.isArray(key) ? key : dKeys.filter(key));\n return keys.map(fn).concat(split(dKeys));\n}\nexport {\n astish,\n compact,\n createCss,\n createMergeCss,\n filterBaseConditions,\n hypenateProperty,\n isBaseCondition,\n isObject,\n mapObject,\n mergeProps,\n normalizeHTMLProps,\n splitProps,\n toHash,\n walkObject,\n withoutSpace\n};\n'
|
|
830
836
|
};
|
|
831
837
|
|
|
832
838
|
// src/artifacts/js/helpers.ts
|
|
@@ -852,6 +858,7 @@ var is_valid_prop_mjs_default = {
|
|
|
852
858
|
};
|
|
853
859
|
|
|
854
860
|
// src/artifacts/js/is-valid-prop.ts
|
|
861
|
+
var import_outdent9 = require("outdent");
|
|
855
862
|
function generateisValidProp(ctx) {
|
|
856
863
|
if (ctx.isTemplateLiteralSyntax)
|
|
857
864
|
return;
|
|
@@ -861,14 +868,19 @@ function generateisValidProp(ctx) {
|
|
|
861
868
|
`var userGenerated = [${ctx.properties.map((key) => JSON.stringify(key)).join(",")}]`
|
|
862
869
|
);
|
|
863
870
|
return {
|
|
864
|
-
js: content
|
|
871
|
+
js: content,
|
|
872
|
+
dts: import_outdent9.outdent`
|
|
873
|
+
declare const isCssProperty: (value: string) => boolean;
|
|
874
|
+
|
|
875
|
+
export { isCssProperty };
|
|
876
|
+
`
|
|
865
877
|
};
|
|
866
878
|
}
|
|
867
879
|
|
|
868
880
|
// src/artifacts/js/pattern.ts
|
|
869
881
|
var import_shared = require("@pandacss/shared");
|
|
870
882
|
var import_javascript_stringify = require("javascript-stringify");
|
|
871
|
-
var
|
|
883
|
+
var import_outdent10 = require("outdent");
|
|
872
884
|
var import_ts_pattern = require("ts-pattern");
|
|
873
885
|
function generatePattern(ctx) {
|
|
874
886
|
if (ctx.patterns.isEmpty())
|
|
@@ -886,7 +898,7 @@ function generatePattern(ctx) {
|
|
|
886
898
|
}
|
|
887
899
|
return {
|
|
888
900
|
name: dashName,
|
|
889
|
-
dts:
|
|
901
|
+
dts: import_outdent10.outdent`
|
|
890
902
|
import type { SystemStyleObject, ConditionalValue } from '../types'
|
|
891
903
|
import type { PropertyValue } from '../types/prop-type'
|
|
892
904
|
import type { Properties } from '../types/csstype'
|
|
@@ -910,7 +922,7 @@ function generatePattern(ctx) {
|
|
|
910
922
|
}).join("\n ")}
|
|
911
923
|
}
|
|
912
924
|
|
|
913
|
-
${strict ?
|
|
925
|
+
${strict ? import_outdent10.outdent`export declare function ${name}(options: ${upperName}Properties): string` : import_outdent10.outdent`
|
|
914
926
|
|
|
915
927
|
type ${upperName}Options = ${upperName}Properties & Omit<SystemStyleObject, keyof ${upperName}Properties ${blocklistType}>
|
|
916
928
|
|
|
@@ -919,7 +931,7 @@ function generatePattern(ctx) {
|
|
|
919
931
|
`}
|
|
920
932
|
|
|
921
933
|
`,
|
|
922
|
-
js:
|
|
934
|
+
js: import_outdent10.outdent`
|
|
923
935
|
${ctx.file.import(helperImports.join(", "), "../helpers")}
|
|
924
936
|
${ctx.file.import("css", "../css/index")}
|
|
925
937
|
|
|
@@ -936,7 +948,7 @@ transform`)}
|
|
|
936
948
|
|
|
937
949
|
// src/artifacts/js/recipe.ts
|
|
938
950
|
var import_shared2 = require("@pandacss/shared");
|
|
939
|
-
var
|
|
951
|
+
var import_outdent11 = require("outdent");
|
|
940
952
|
var stringify3 = (value) => JSON.stringify(value, null, 2);
|
|
941
953
|
var isBooleanValue = (value) => value === "true" || value === "false";
|
|
942
954
|
function generateRecipes(ctx) {
|
|
@@ -950,7 +962,7 @@ function generateRecipes(ctx) {
|
|
|
950
962
|
const createRecipeFn = {
|
|
951
963
|
name: "create-recipe",
|
|
952
964
|
dts: "",
|
|
953
|
-
js:
|
|
965
|
+
js: import_outdent11.outdent`
|
|
954
966
|
${ctx.file.import("css", "../css/css")}
|
|
955
967
|
${ctx.file.import("assertCompoundVariant, getCompoundVariantCss", "../css/cva")}
|
|
956
968
|
${ctx.file.import("cx", "../css/cx")}
|
|
@@ -997,7 +1009,7 @@ function generateRecipes(ctx) {
|
|
|
997
1009
|
const { name, description, defaultVariants, compoundVariants } = config;
|
|
998
1010
|
return {
|
|
999
1011
|
name: dashName,
|
|
1000
|
-
js:
|
|
1012
|
+
js: import_outdent11.outdent`
|
|
1001
1013
|
${ctx.file.import("splitProps", "../helpers")}
|
|
1002
1014
|
${ctx.file.import("createRecipe", "./create-recipe")}
|
|
1003
1015
|
|
|
@@ -1018,7 +1030,7 @@ function generateRecipes(ctx) {
|
|
|
1018
1030
|
splitVariantProps,
|
|
1019
1031
|
})
|
|
1020
1032
|
`,
|
|
1021
|
-
dts:
|
|
1033
|
+
dts: import_outdent11.outdent`
|
|
1022
1034
|
import type { ConditionalValue } from '../types'
|
|
1023
1035
|
import type { Pretty } from '../types/helpers'
|
|
1024
1036
|
|
|
@@ -1056,7 +1068,7 @@ function generateRecipes(ctx) {
|
|
|
1056
1068
|
}
|
|
1057
1069
|
|
|
1058
1070
|
// src/artifacts/js/token.ts
|
|
1059
|
-
var
|
|
1071
|
+
var import_outdent12 = __toESM(require("outdent"));
|
|
1060
1072
|
function generateTokenJs(ctx) {
|
|
1061
1073
|
const { tokens } = ctx;
|
|
1062
1074
|
const map = /* @__PURE__ */ new Map();
|
|
@@ -1067,7 +1079,7 @@ function generateTokenJs(ctx) {
|
|
|
1067
1079
|
});
|
|
1068
1080
|
const obj = Object.fromEntries(map);
|
|
1069
1081
|
return {
|
|
1070
|
-
js:
|
|
1082
|
+
js: import_outdent12.default`
|
|
1071
1083
|
const tokens = ${JSON.stringify(obj, null, 2)}
|
|
1072
1084
|
|
|
1073
1085
|
export function token(path, fallback) {
|
|
@@ -1080,7 +1092,7 @@ function generateTokenJs(ctx) {
|
|
|
1080
1092
|
|
|
1081
1093
|
token.var = tokenVar
|
|
1082
1094
|
`,
|
|
1083
|
-
dts:
|
|
1095
|
+
dts: import_outdent12.default`
|
|
1084
1096
|
import type { Token } from './tokens'
|
|
1085
1097
|
|
|
1086
1098
|
export declare const token: {
|
|
@@ -1094,11 +1106,11 @@ function generateTokenJs(ctx) {
|
|
|
1094
1106
|
}
|
|
1095
1107
|
|
|
1096
1108
|
// src/artifacts/preact-jsx/jsx.ts
|
|
1097
|
-
var
|
|
1109
|
+
var import_outdent13 = require("outdent");
|
|
1098
1110
|
function generatePreactJsxFactory(ctx) {
|
|
1099
1111
|
const { factoryName, componentName } = ctx.jsx;
|
|
1100
1112
|
return {
|
|
1101
|
-
js:
|
|
1113
|
+
js: import_outdent13.outdent`
|
|
1102
1114
|
import { h } from 'preact'
|
|
1103
1115
|
import { forwardRef } from 'preact/compat'
|
|
1104
1116
|
import { useMemo } from 'preact/hooks'
|
|
@@ -1165,7 +1177,7 @@ function generatePreactJsxFactory(ctx) {
|
|
|
1165
1177
|
}
|
|
1166
1178
|
|
|
1167
1179
|
// src/artifacts/preact-jsx/pattern.ts
|
|
1168
|
-
var
|
|
1180
|
+
var import_outdent14 = require("outdent");
|
|
1169
1181
|
var import_ts_pattern2 = require("ts-pattern");
|
|
1170
1182
|
function generatePreactJsxPattern(ctx) {
|
|
1171
1183
|
const { typeName, factoryName } = ctx.jsx;
|
|
@@ -1174,7 +1186,7 @@ function generatePreactJsxPattern(ctx) {
|
|
|
1174
1186
|
const { description, jsxElement = "div" } = pattern.config;
|
|
1175
1187
|
return {
|
|
1176
1188
|
name: dashName,
|
|
1177
|
-
js:
|
|
1189
|
+
js: import_outdent14.outdent`
|
|
1178
1190
|
import { h } from 'preact'
|
|
1179
1191
|
import { forwardRef } from 'preact/compat'
|
|
1180
1192
|
${ctx.file.import(factoryName, "./factory")}
|
|
@@ -1183,12 +1195,12 @@ function generatePreactJsxPattern(ctx) {
|
|
|
1183
1195
|
export const ${jsxName} = forwardRef(function ${jsxName}(props, ref) {
|
|
1184
1196
|
${(0, import_ts_pattern2.match)(props.length).with(
|
|
1185
1197
|
0,
|
|
1186
|
-
() =>
|
|
1198
|
+
() => import_outdent14.outdent`
|
|
1187
1199
|
const styleProps = ${styleFnName}()
|
|
1188
1200
|
return h(${factoryName}.${jsxElement}, { ref, ...styleProps, ...props })
|
|
1189
1201
|
`
|
|
1190
1202
|
).otherwise(
|
|
1191
|
-
() =>
|
|
1203
|
+
() => import_outdent14.outdent`
|
|
1192
1204
|
const { ${props.join(", ")}, ...restProps } = props
|
|
1193
1205
|
const styleProps = ${styleFnName}({${props.join(", ")}})
|
|
1194
1206
|
return h(${factoryName}.${jsxElement}, { ref, ...styleProps, ...restProps })
|
|
@@ -1196,7 +1208,7 @@ function generatePreactJsxPattern(ctx) {
|
|
|
1196
1208
|
)}
|
|
1197
1209
|
})
|
|
1198
1210
|
`,
|
|
1199
|
-
dts:
|
|
1211
|
+
dts: import_outdent14.outdent`
|
|
1200
1212
|
import type { FunctionComponent } from 'preact'
|
|
1201
1213
|
import type { ${upperName}Properties } from '../patterns/${dashName}'
|
|
1202
1214
|
import type { ${typeName} } from '../types/jsx'
|
|
@@ -1211,15 +1223,15 @@ function generatePreactJsxPattern(ctx) {
|
|
|
1211
1223
|
}
|
|
1212
1224
|
|
|
1213
1225
|
// src/artifacts/preact-jsx/types.ts
|
|
1214
|
-
var
|
|
1226
|
+
var import_outdent15 = require("outdent");
|
|
1215
1227
|
function generatePreactJsxTypes(ctx) {
|
|
1216
1228
|
const { factoryName, componentName, upperName, typeName } = ctx.jsx;
|
|
1217
1229
|
return {
|
|
1218
|
-
jsxFactory:
|
|
1230
|
+
jsxFactory: import_outdent15.outdent`
|
|
1219
1231
|
import type { ${upperName} } from '../types/jsx'
|
|
1220
1232
|
export declare const ${factoryName}: ${upperName}
|
|
1221
1233
|
`,
|
|
1222
|
-
jsxType:
|
|
1234
|
+
jsxType: import_outdent15.outdent`
|
|
1223
1235
|
import type { ComponentProps, JSX } from 'preact'
|
|
1224
1236
|
import type { Assign, JsxStyleProps, JsxHTMLProps } from './system-types'
|
|
1225
1237
|
import type { RecipeDefinition, RecipeSelection, RecipeVariantRecord } from './recipe'
|
|
@@ -1254,11 +1266,11 @@ export type ${typeName}<T extends ElementType> = JsxHTMLProps<ComponentProps<T>,
|
|
|
1254
1266
|
}
|
|
1255
1267
|
|
|
1256
1268
|
// src/artifacts/preact-jsx/jsx.string-literal.ts
|
|
1257
|
-
var
|
|
1269
|
+
var import_outdent16 = require("outdent");
|
|
1258
1270
|
function generatePreactJsxStringLiteralFactory(ctx) {
|
|
1259
1271
|
const { factoryName, componentName } = ctx.jsx;
|
|
1260
1272
|
return {
|
|
1261
|
-
js:
|
|
1273
|
+
js: import_outdent16.outdent`
|
|
1262
1274
|
import { h } from 'preact'
|
|
1263
1275
|
import { forwardRef } from 'preact/compat'
|
|
1264
1276
|
${ctx.file.import("css, cx", "../css/index")}
|
|
@@ -1304,15 +1316,15 @@ function generatePreactJsxStringLiteralFactory(ctx) {
|
|
|
1304
1316
|
}
|
|
1305
1317
|
|
|
1306
1318
|
// src/artifacts/preact-jsx/types.string-literal.ts
|
|
1307
|
-
var
|
|
1319
|
+
var import_outdent17 = require("outdent");
|
|
1308
1320
|
function generatePreactJsxStringLiteralTypes(ctx) {
|
|
1309
1321
|
const { factoryName, componentName, upperName, typeName } = ctx.jsx;
|
|
1310
1322
|
return {
|
|
1311
|
-
jsxFactory:
|
|
1323
|
+
jsxFactory: import_outdent17.outdent`
|
|
1312
1324
|
import type { ${upperName} } from '../types/jsx'
|
|
1313
1325
|
export declare const ${factoryName}: ${upperName}
|
|
1314
1326
|
`,
|
|
1315
|
-
jsxType:
|
|
1327
|
+
jsxType: import_outdent17.outdent`
|
|
1316
1328
|
import type { ComponentProps, JSX } from 'preact'
|
|
1317
1329
|
|
|
1318
1330
|
type ElementType = keyof JSX.IntrinsicElements
|
|
@@ -1338,11 +1350,11 @@ export type ${typeName}<T extends ElementType> = ComponentProps<T>
|
|
|
1338
1350
|
}
|
|
1339
1351
|
|
|
1340
1352
|
// src/artifacts/qwik-jsx/jsx.ts
|
|
1341
|
-
var
|
|
1353
|
+
var import_outdent18 = require("outdent");
|
|
1342
1354
|
function generateQwikJsxFactory(ctx) {
|
|
1343
1355
|
const { factoryName, componentName } = ctx.jsx;
|
|
1344
1356
|
return {
|
|
1345
|
-
js:
|
|
1357
|
+
js: import_outdent18.outdent`
|
|
1346
1358
|
import { h } from '@builder.io/qwik'
|
|
1347
1359
|
${ctx.file.import("css, cx, cva, assignCss", "../css/index")}
|
|
1348
1360
|
${ctx.file.import("splitProps, normalizeHTMLProps", "../helpers")}
|
|
@@ -1406,7 +1418,7 @@ function generateQwikJsxFactory(ctx) {
|
|
|
1406
1418
|
}
|
|
1407
1419
|
|
|
1408
1420
|
// src/artifacts/qwik-jsx/pattern.ts
|
|
1409
|
-
var
|
|
1421
|
+
var import_outdent19 = require("outdent");
|
|
1410
1422
|
var import_ts_pattern3 = require("ts-pattern");
|
|
1411
1423
|
function generateQwikJsxPattern(ctx) {
|
|
1412
1424
|
const { typeName, factoryName } = ctx.jsx;
|
|
@@ -1415,7 +1427,7 @@ function generateQwikJsxPattern(ctx) {
|
|
|
1415
1427
|
const { description, jsxElement = "div" } = pattern.config;
|
|
1416
1428
|
return {
|
|
1417
1429
|
name: dashName,
|
|
1418
|
-
js:
|
|
1430
|
+
js: import_outdent19.outdent`
|
|
1419
1431
|
import { h } from '@builder.io/qwik'
|
|
1420
1432
|
${ctx.file.import(factoryName, "./factory")}
|
|
1421
1433
|
${ctx.file.import(styleFnName, `../patterns/${dashName}`)}
|
|
@@ -1423,12 +1435,12 @@ function generateQwikJsxPattern(ctx) {
|
|
|
1423
1435
|
export const ${jsxName} = function ${jsxName}(props) {
|
|
1424
1436
|
${(0, import_ts_pattern3.match)(props.length).with(
|
|
1425
1437
|
0,
|
|
1426
|
-
() =>
|
|
1438
|
+
() => import_outdent19.outdent`
|
|
1427
1439
|
const styleProps = ${styleFnName}()
|
|
1428
1440
|
return h(${factoryName}.${jsxElement}, { ...styleProps, ...props })
|
|
1429
1441
|
`
|
|
1430
1442
|
).otherwise(
|
|
1431
|
-
() =>
|
|
1443
|
+
() => import_outdent19.outdent`
|
|
1432
1444
|
const { ${props.join(", ")}, ...restProps } = props
|
|
1433
1445
|
const styleProps = ${styleFnName}({${props.join(", ")}})
|
|
1434
1446
|
return h(${factoryName}.${jsxElement}, { ...styleProps, ...restProps })
|
|
@@ -1436,7 +1448,7 @@ function generateQwikJsxPattern(ctx) {
|
|
|
1436
1448
|
)}
|
|
1437
1449
|
}
|
|
1438
1450
|
`,
|
|
1439
|
-
dts:
|
|
1451
|
+
dts: import_outdent19.outdent`
|
|
1440
1452
|
import type { FunctionComponent } from '@builder.io/qwik'
|
|
1441
1453
|
import type { ${upperName}Properties } from '../patterns/${dashName}'
|
|
1442
1454
|
import type { ${typeName} } from '../types/jsx'
|
|
@@ -1455,15 +1467,15 @@ function generateQwikJsxPattern(ctx) {
|
|
|
1455
1467
|
}
|
|
1456
1468
|
|
|
1457
1469
|
// src/artifacts/qwik-jsx/types.ts
|
|
1458
|
-
var
|
|
1470
|
+
var import_outdent20 = require("outdent");
|
|
1459
1471
|
function generateQwikJsxTypes(ctx) {
|
|
1460
1472
|
const { factoryName, componentName, upperName, typeName } = ctx.jsx;
|
|
1461
1473
|
return {
|
|
1462
|
-
jsxFactory:
|
|
1474
|
+
jsxFactory: import_outdent20.outdent`
|
|
1463
1475
|
import { ${upperName} } from '../types/jsx'
|
|
1464
1476
|
export declare const ${factoryName}: ${upperName}
|
|
1465
1477
|
`,
|
|
1466
|
-
jsxType:
|
|
1478
|
+
jsxType: import_outdent20.outdent`
|
|
1467
1479
|
import type { FunctionComponent, QwikIntrinsicElements } from '@builder.io/qwik'
|
|
1468
1480
|
import type { Assign as _Assign, JsxStyleProps, PatchedHTMLProps } from './system-types'
|
|
1469
1481
|
import type { RecipeDefinition, RecipeSelection, RecipeVariantRecord } from './recipe'
|
|
@@ -1517,11 +1529,11 @@ export type ${typeName}<T extends ElementType> = Assign<ComponentProps<T>, JsxSt
|
|
|
1517
1529
|
}
|
|
1518
1530
|
|
|
1519
1531
|
// src/artifacts/qwik-jsx/jsx.string-literal.ts
|
|
1520
|
-
var
|
|
1532
|
+
var import_outdent21 = require("outdent");
|
|
1521
1533
|
function generateQwikJsxStringLiteralFactory(ctx) {
|
|
1522
1534
|
const { factoryName, componentName } = ctx.jsx;
|
|
1523
1535
|
return {
|
|
1524
|
-
js:
|
|
1536
|
+
js: import_outdent21.outdent`
|
|
1525
1537
|
import { h } from '@builder.io/qwik'
|
|
1526
1538
|
${ctx.file.import("css, cx", "../css/index")}
|
|
1527
1539
|
|
|
@@ -1566,15 +1578,15 @@ function generateQwikJsxStringLiteralFactory(ctx) {
|
|
|
1566
1578
|
}
|
|
1567
1579
|
|
|
1568
1580
|
// src/artifacts/qwik-jsx/types.string-literal.ts
|
|
1569
|
-
var
|
|
1581
|
+
var import_outdent22 = require("outdent");
|
|
1570
1582
|
function generateQwikJsxStringLiteralTypes(ctx) {
|
|
1571
1583
|
const { factoryName, componentName, upperName, typeName } = ctx.jsx;
|
|
1572
1584
|
return {
|
|
1573
|
-
jsxFactory:
|
|
1585
|
+
jsxFactory: import_outdent22.outdent`
|
|
1574
1586
|
import { ${upperName} } from '../types/jsx'
|
|
1575
1587
|
export declare const ${factoryName}: ${upperName}
|
|
1576
1588
|
`,
|
|
1577
|
-
jsxType:
|
|
1589
|
+
jsxType: import_outdent22.outdent`
|
|
1578
1590
|
import type { FunctionComponent, QwikIntrinsicElements } from '@builder.io/qwik'
|
|
1579
1591
|
|
|
1580
1592
|
type ElementType = keyof QwikIntrinsicElements | FunctionComponent<any>
|
|
@@ -1605,11 +1617,11 @@ export type ${typeName}<T extends ElementType> = ComponentProps<T>
|
|
|
1605
1617
|
}
|
|
1606
1618
|
|
|
1607
1619
|
// src/artifacts/react-jsx/jsx.ts
|
|
1608
|
-
var
|
|
1620
|
+
var import_outdent23 = require("outdent");
|
|
1609
1621
|
function generateReactJsxFactory(ctx) {
|
|
1610
1622
|
const { factoryName, componentName } = ctx.jsx;
|
|
1611
1623
|
return {
|
|
1612
|
-
js:
|
|
1624
|
+
js: import_outdent23.outdent`
|
|
1613
1625
|
import { createElement, forwardRef, useMemo } from 'react'
|
|
1614
1626
|
${ctx.file.import("css, cx, cva, assignCss", "../css/index")}
|
|
1615
1627
|
${ctx.file.import("splitProps, normalizeHTMLProps", "../helpers")}
|
|
@@ -1675,7 +1687,7 @@ function generateReactJsxFactory(ctx) {
|
|
|
1675
1687
|
}
|
|
1676
1688
|
|
|
1677
1689
|
// src/artifacts/react-jsx/pattern.ts
|
|
1678
|
-
var
|
|
1690
|
+
var import_outdent24 = require("outdent");
|
|
1679
1691
|
var import_ts_pattern4 = require("ts-pattern");
|
|
1680
1692
|
function generateReactJsxPattern(ctx) {
|
|
1681
1693
|
const { typeName, factoryName } = ctx.jsx;
|
|
@@ -1684,7 +1696,7 @@ function generateReactJsxPattern(ctx) {
|
|
|
1684
1696
|
const { description, jsxElement = "div" } = pattern.config;
|
|
1685
1697
|
return {
|
|
1686
1698
|
name: dashName,
|
|
1687
|
-
js:
|
|
1699
|
+
js: import_outdent24.outdent`
|
|
1688
1700
|
import { createElement, forwardRef } from 'react'
|
|
1689
1701
|
${ctx.file.import(factoryName, "./factory")}
|
|
1690
1702
|
${ctx.file.import(styleFnName, `../patterns/${dashName}`)}
|
|
@@ -1692,12 +1704,12 @@ function generateReactJsxPattern(ctx) {
|
|
|
1692
1704
|
export const ${jsxName} = forwardRef(function ${jsxName}(props, ref) {
|
|
1693
1705
|
${(0, import_ts_pattern4.match)(props.length).with(
|
|
1694
1706
|
0,
|
|
1695
|
-
() =>
|
|
1707
|
+
() => import_outdent24.outdent`
|
|
1696
1708
|
const styleProps = ${styleFnName}()
|
|
1697
1709
|
return createElement(${factoryName}.${jsxElement}, { ref, ...styleProps, ...props })
|
|
1698
1710
|
`
|
|
1699
1711
|
).otherwise(
|
|
1700
|
-
() =>
|
|
1712
|
+
() => import_outdent24.outdent`
|
|
1701
1713
|
const { ${props.join(", ")}, ...restProps } = props
|
|
1702
1714
|
const styleProps = ${styleFnName}({${props.join(", ")}})
|
|
1703
1715
|
return createElement(${factoryName}.${jsxElement}, { ref, ...styleProps, ...restProps })
|
|
@@ -1705,7 +1717,7 @@ function generateReactJsxPattern(ctx) {
|
|
|
1705
1717
|
)}
|
|
1706
1718
|
})
|
|
1707
1719
|
`,
|
|
1708
|
-
dts:
|
|
1720
|
+
dts: import_outdent24.outdent`
|
|
1709
1721
|
import type { FunctionComponent } from 'react'
|
|
1710
1722
|
import type { ${upperName}Properties } from '../patterns/${dashName}'
|
|
1711
1723
|
import type { ${typeName} } from '../types/jsx'
|
|
@@ -1720,15 +1732,15 @@ function generateReactJsxPattern(ctx) {
|
|
|
1720
1732
|
}
|
|
1721
1733
|
|
|
1722
1734
|
// src/artifacts/react-jsx/types.ts
|
|
1723
|
-
var
|
|
1735
|
+
var import_outdent25 = require("outdent");
|
|
1724
1736
|
function generateReactJsxTypes(ctx) {
|
|
1725
1737
|
const { factoryName, componentName, upperName, typeName } = ctx.jsx;
|
|
1726
1738
|
return {
|
|
1727
|
-
jsxFactory:
|
|
1739
|
+
jsxFactory: import_outdent25.outdent`
|
|
1728
1740
|
import { ${upperName} } from '../types/jsx'
|
|
1729
1741
|
export declare const ${factoryName}: ${upperName}
|
|
1730
1742
|
`,
|
|
1731
|
-
jsxType:
|
|
1743
|
+
jsxType: import_outdent25.outdent`
|
|
1732
1744
|
import type { ComponentProps, ElementType } from 'react'
|
|
1733
1745
|
import type { Assign, JsxStyleProps, JsxHTMLProps } from './system-types'
|
|
1734
1746
|
import type { RecipeDefinition, RecipeSelection, RecipeVariantRecord } from './recipe'
|
|
@@ -1761,11 +1773,11 @@ export type ${typeName}<T extends ElementType> = JsxHTMLProps<ComponentProps<T>,
|
|
|
1761
1773
|
}
|
|
1762
1774
|
|
|
1763
1775
|
// src/artifacts/react-jsx/jsx.string-literal.ts
|
|
1764
|
-
var
|
|
1776
|
+
var import_outdent26 = require("outdent");
|
|
1765
1777
|
function generateReactJsxStringLiteralFactory(ctx) {
|
|
1766
1778
|
const { factoryName, componentName } = ctx.jsx;
|
|
1767
1779
|
return {
|
|
1768
|
-
js:
|
|
1780
|
+
js: import_outdent26.outdent`
|
|
1769
1781
|
import { createElement, forwardRef } from 'react'
|
|
1770
1782
|
${ctx.file.import("css, cx", "../css/index")}
|
|
1771
1783
|
|
|
@@ -1811,15 +1823,15 @@ function generateReactJsxStringLiteralFactory(ctx) {
|
|
|
1811
1823
|
}
|
|
1812
1824
|
|
|
1813
1825
|
// src/artifacts/react-jsx/types.string-literal.ts
|
|
1814
|
-
var
|
|
1826
|
+
var import_outdent27 = require("outdent");
|
|
1815
1827
|
function generateReactJsxStringLiteralTypes(ctx) {
|
|
1816
1828
|
const { factoryName, componentName, upperName, typeName } = ctx.jsx;
|
|
1817
1829
|
return {
|
|
1818
|
-
jsxFactory:
|
|
1830
|
+
jsxFactory: import_outdent27.outdent`
|
|
1819
1831
|
import { ${upperName} } from '../types/jsx'
|
|
1820
1832
|
export declare const ${factoryName}: ${upperName}
|
|
1821
1833
|
`,
|
|
1822
|
-
jsxType:
|
|
1834
|
+
jsxType: import_outdent27.outdent`
|
|
1823
1835
|
import type { ComponentProps, ElementType } from 'react'
|
|
1824
1836
|
|
|
1825
1837
|
type Dict = Record<string, unknown>
|
|
@@ -1843,11 +1855,11 @@ export type ${typeName}<T extends ElementType> = ComponentProps<T>
|
|
|
1843
1855
|
}
|
|
1844
1856
|
|
|
1845
1857
|
// src/artifacts/solid-jsx/jsx.ts
|
|
1846
|
-
var
|
|
1858
|
+
var import_outdent28 = require("outdent");
|
|
1847
1859
|
function generateSolidJsxFactory(ctx) {
|
|
1848
1860
|
const { componentName, factoryName } = ctx.jsx;
|
|
1849
1861
|
return {
|
|
1850
|
-
js:
|
|
1862
|
+
js: import_outdent28.outdent`
|
|
1851
1863
|
import { Dynamic } from 'solid-js/web'
|
|
1852
1864
|
import { mergeProps, splitProps } from 'solid-js'
|
|
1853
1865
|
import { createComponent } from 'solid-js/web'
|
|
@@ -1924,7 +1936,7 @@ function generateSolidJsxFactory(ctx) {
|
|
|
1924
1936
|
}
|
|
1925
1937
|
|
|
1926
1938
|
// src/artifacts/solid-jsx/pattern.ts
|
|
1927
|
-
var
|
|
1939
|
+
var import_outdent29 = require("outdent");
|
|
1928
1940
|
var import_ts_pattern5 = require("ts-pattern");
|
|
1929
1941
|
function generateSolidJsxPattern(ctx) {
|
|
1930
1942
|
const { typeName, factoryName } = ctx.jsx;
|
|
@@ -1933,7 +1945,7 @@ function generateSolidJsxPattern(ctx) {
|
|
|
1933
1945
|
const { description, jsxElement = "div" } = pattern.config;
|
|
1934
1946
|
return {
|
|
1935
1947
|
name: dashName,
|
|
1936
|
-
js:
|
|
1948
|
+
js: import_outdent29.outdent`
|
|
1937
1949
|
import { splitProps, mergeProps } from 'solid-js'
|
|
1938
1950
|
import { createComponent } from 'solid-js/web'
|
|
1939
1951
|
${ctx.file.import(factoryName, "./factory")}
|
|
@@ -1942,12 +1954,12 @@ function generateSolidJsxPattern(ctx) {
|
|
|
1942
1954
|
export function ${jsxName}(props) {
|
|
1943
1955
|
${(0, import_ts_pattern5.match)(props.length).with(
|
|
1944
1956
|
0,
|
|
1945
|
-
() =>
|
|
1957
|
+
() => import_outdent29.outdent`
|
|
1946
1958
|
const styleProps = ${styleFnName}()
|
|
1947
1959
|
return createComponent(${factoryName}.${jsxElement}, mergeProps(styleProps, props))
|
|
1948
1960
|
`
|
|
1949
1961
|
).otherwise(
|
|
1950
|
-
() =>
|
|
1962
|
+
() => import_outdent29.outdent`
|
|
1951
1963
|
const [patternProps, restProps] = splitProps(props, [${props.map((v) => JSON.stringify(v)).join(", ")}]);
|
|
1952
1964
|
const styleProps = ${styleFnName}(patternProps)
|
|
1953
1965
|
return createComponent(${factoryName}.${jsxElement}, mergeProps(styleProps, restProps))
|
|
@@ -1955,7 +1967,7 @@ function generateSolidJsxPattern(ctx) {
|
|
|
1955
1967
|
)}
|
|
1956
1968
|
}
|
|
1957
1969
|
`,
|
|
1958
|
-
dts:
|
|
1970
|
+
dts: import_outdent29.outdent`
|
|
1959
1971
|
import { Component } from 'solid-js'
|
|
1960
1972
|
import { ${upperName}Properties } from '../patterns/${dashName}'
|
|
1961
1973
|
import { ${typeName} } from '../types/jsx'
|
|
@@ -1970,15 +1982,15 @@ function generateSolidJsxPattern(ctx) {
|
|
|
1970
1982
|
}
|
|
1971
1983
|
|
|
1972
1984
|
// src/artifacts/solid-jsx/types.ts
|
|
1973
|
-
var
|
|
1985
|
+
var import_outdent30 = require("outdent");
|
|
1974
1986
|
function generateSolidJsxTypes(ctx) {
|
|
1975
1987
|
const { factoryName, componentName, upperName, typeName } = ctx.jsx;
|
|
1976
1988
|
return {
|
|
1977
|
-
jsxFactory:
|
|
1989
|
+
jsxFactory: import_outdent30.outdent`
|
|
1978
1990
|
import type { ${upperName} } from '../types/jsx'
|
|
1979
1991
|
export declare const ${factoryName}: ${upperName}
|
|
1980
1992
|
`,
|
|
1981
|
-
jsxType:
|
|
1993
|
+
jsxType: import_outdent30.outdent`
|
|
1982
1994
|
import type { ComponentProps, Component, JSX } from 'solid-js'
|
|
1983
1995
|
import type { Assign, JsxStyleProps, JsxHTMLProps } from './system-types'
|
|
1984
1996
|
import type { RecipeDefinition, RecipeSelection, RecipeVariantRecord } from './recipe'
|
|
@@ -2013,11 +2025,11 @@ export type ${typeName}<T extends ElementType> = JsxHTMLProps<ComponentProps<T>,
|
|
|
2013
2025
|
}
|
|
2014
2026
|
|
|
2015
2027
|
// src/artifacts/solid-jsx/jsx.string-literal.ts
|
|
2016
|
-
var
|
|
2028
|
+
var import_outdent31 = require("outdent");
|
|
2017
2029
|
function generateSolidJsxStringLiteralFactory(ctx) {
|
|
2018
2030
|
const { componentName, factoryName } = ctx.jsx;
|
|
2019
2031
|
return {
|
|
2020
|
-
js:
|
|
2032
|
+
js: import_outdent31.outdent`
|
|
2021
2033
|
import { mergeProps, splitProps } from 'solid-js'
|
|
2022
2034
|
import { Dynamic, createComponent } from 'solid-js/web'
|
|
2023
2035
|
${ctx.file.import("css, cx", "../css/index")}
|
|
@@ -2069,15 +2081,15 @@ export const ${factoryName} = createJsxFactory()
|
|
|
2069
2081
|
}
|
|
2070
2082
|
|
|
2071
2083
|
// src/artifacts/solid-jsx/types.string-literal.ts
|
|
2072
|
-
var
|
|
2084
|
+
var import_outdent32 = require("outdent");
|
|
2073
2085
|
function generateSolidJsxStringLiteralTypes(ctx) {
|
|
2074
2086
|
const { factoryName, componentName, upperName, typeName } = ctx.jsx;
|
|
2075
2087
|
return {
|
|
2076
|
-
jsxFactory:
|
|
2088
|
+
jsxFactory: import_outdent32.outdent`
|
|
2077
2089
|
import type { ${upperName} } from '../types/jsx'
|
|
2078
2090
|
export declare const ${factoryName}: ${upperName}
|
|
2079
2091
|
`,
|
|
2080
|
-
jsxType:
|
|
2092
|
+
jsxType: import_outdent32.outdent`
|
|
2081
2093
|
import type { Component, ComponentProps, JSX } from 'solid-js'
|
|
2082
2094
|
|
|
2083
2095
|
type Dict = Record<string, unknown>
|
|
@@ -2103,11 +2115,11 @@ export type ${typeName}<T extends ElementType> = ComponentProps<T>
|
|
|
2103
2115
|
}
|
|
2104
2116
|
|
|
2105
2117
|
// src/artifacts/vue-jsx/jsx.ts
|
|
2106
|
-
var
|
|
2118
|
+
var import_outdent33 = require("outdent");
|
|
2107
2119
|
function generateVueJsxFactory(ctx) {
|
|
2108
2120
|
const { factoryName } = ctx.jsx;
|
|
2109
2121
|
return {
|
|
2110
|
-
js:
|
|
2122
|
+
js: import_outdent33.outdent`
|
|
2111
2123
|
import { defineComponent, h, computed } from 'vue'
|
|
2112
2124
|
${ctx.file.import("css, cx, cva, assignCss", "../css/index")}
|
|
2113
2125
|
${ctx.file.import("splitProps, normalizeHTMLProps", "../helpers")}
|
|
@@ -2181,11 +2193,11 @@ function generateVueJsxFactory(ctx) {
|
|
|
2181
2193
|
}
|
|
2182
2194
|
|
|
2183
2195
|
// src/artifacts/vue-jsx/jsx.string-literal.ts
|
|
2184
|
-
var
|
|
2196
|
+
var import_outdent34 = require("outdent");
|
|
2185
2197
|
function generateVueJsxStringLiteralFactory(ctx) {
|
|
2186
2198
|
const { factoryName } = ctx.jsx;
|
|
2187
2199
|
return {
|
|
2188
|
-
js:
|
|
2200
|
+
js: import_outdent34.outdent`
|
|
2189
2201
|
import { defineComponent, h, computed } from 'vue'
|
|
2190
2202
|
${ctx.file.import("css, cx", "../css/index")}
|
|
2191
2203
|
|
|
@@ -2235,7 +2247,7 @@ function generateVueJsxStringLiteralFactory(ctx) {
|
|
|
2235
2247
|
}
|
|
2236
2248
|
|
|
2237
2249
|
// src/artifacts/vue-jsx/pattern.ts
|
|
2238
|
-
var
|
|
2250
|
+
var import_outdent35 = require("outdent");
|
|
2239
2251
|
function generateVueJsxPattern(ctx) {
|
|
2240
2252
|
const { typeName, factoryName } = ctx.jsx;
|
|
2241
2253
|
return ctx.patterns.details.map((pattern) => {
|
|
@@ -2244,7 +2256,7 @@ function generateVueJsxPattern(ctx) {
|
|
|
2244
2256
|
const propList = props.map((v) => JSON.stringify(v)).join(", ");
|
|
2245
2257
|
return {
|
|
2246
2258
|
name: dashName,
|
|
2247
|
-
js:
|
|
2259
|
+
js: import_outdent35.outdent`
|
|
2248
2260
|
import { defineComponent, h, computed } from 'vue'
|
|
2249
2261
|
${ctx.file.import(factoryName, "./factory")}
|
|
2250
2262
|
${ctx.file.import(styleFnName, `../patterns/${dashName}`)}
|
|
@@ -2262,7 +2274,7 @@ function generateVueJsxPattern(ctx) {
|
|
|
2262
2274
|
}
|
|
2263
2275
|
})
|
|
2264
2276
|
`,
|
|
2265
|
-
dts:
|
|
2277
|
+
dts: import_outdent35.outdent`
|
|
2266
2278
|
import { FunctionalComponent } from 'vue'
|
|
2267
2279
|
import { ${upperName}Properties } from '../patterns/${dashName}'
|
|
2268
2280
|
import { ${typeName} } from '../types/jsx'
|
|
@@ -2277,15 +2289,15 @@ function generateVueJsxPattern(ctx) {
|
|
|
2277
2289
|
}
|
|
2278
2290
|
|
|
2279
2291
|
// src/artifacts/vue-jsx/types.ts
|
|
2280
|
-
var
|
|
2292
|
+
var import_outdent36 = require("outdent");
|
|
2281
2293
|
function generateVueJsxTypes(ctx) {
|
|
2282
2294
|
const { factoryName, componentName, upperName, typeName } = ctx.jsx;
|
|
2283
2295
|
return {
|
|
2284
|
-
jsxFactory:
|
|
2296
|
+
jsxFactory: import_outdent36.outdent`
|
|
2285
2297
|
import { ${upperName} } from '../types/jsx'
|
|
2286
2298
|
export declare const ${factoryName}: ${upperName}
|
|
2287
2299
|
`,
|
|
2288
|
-
jsxType:
|
|
2300
|
+
jsxType: import_outdent36.outdent`
|
|
2289
2301
|
import type { Component, FunctionalComponent } from 'vue'
|
|
2290
2302
|
import type { Assign, JsxStyleProps, JsxHTMLProps } from './system-types'
|
|
2291
2303
|
import type { RecipeDefinition, RecipeSelection, RecipeVariantRecord } from './recipe'
|
|
@@ -2442,15 +2454,15 @@ type IntrinsicElement =
|
|
|
2442
2454
|
}
|
|
2443
2455
|
|
|
2444
2456
|
// src/artifacts/vue-jsx/types.string-literal.ts
|
|
2445
|
-
var
|
|
2457
|
+
var import_outdent37 = require("outdent");
|
|
2446
2458
|
function generateVueJsxStringLiteralTypes(ctx) {
|
|
2447
2459
|
const { factoryName, componentName, upperName, typeName } = ctx.jsx;
|
|
2448
2460
|
return {
|
|
2449
|
-
jsxFactory:
|
|
2461
|
+
jsxFactory: import_outdent37.outdent`
|
|
2450
2462
|
import { ${upperName} } from '../types/jsx'
|
|
2451
2463
|
export declare const ${factoryName}: ${upperName}
|
|
2452
2464
|
`,
|
|
2453
|
-
jsxType:
|
|
2465
|
+
jsxType: import_outdent37.outdent`
|
|
2454
2466
|
import type { Component, FunctionalComponent } from 'vue'
|
|
2455
2467
|
|
|
2456
2468
|
type IntrinsicElement =
|
|
@@ -2665,22 +2677,27 @@ function generatePackageJson(ctx) {
|
|
|
2665
2677
|
exports: {
|
|
2666
2678
|
"./css": {
|
|
2667
2679
|
types: "./css/index.d.ts",
|
|
2680
|
+
require: "./css/index.mjs",
|
|
2668
2681
|
import: "./css/index.mjs"
|
|
2669
2682
|
},
|
|
2670
2683
|
"./jsx": {
|
|
2671
2684
|
types: "./jsx/index.d.ts",
|
|
2685
|
+
require: "./jsx/index.mjs",
|
|
2672
2686
|
import: "./jsx/index.mjs"
|
|
2673
2687
|
},
|
|
2674
2688
|
"./patterns": {
|
|
2675
2689
|
types: "./patterns/index.d.ts",
|
|
2690
|
+
require: "./patterns/index.mjs",
|
|
2676
2691
|
import: "./patterns/index.mjs"
|
|
2677
2692
|
},
|
|
2678
2693
|
"./recipes": {
|
|
2679
2694
|
types: "./recipes/index.d.ts",
|
|
2695
|
+
require: "./recipes/index.mjs",
|
|
2680
2696
|
import: "./recipes/index.mjs"
|
|
2681
2697
|
},
|
|
2682
2698
|
"./tokens": {
|
|
2683
2699
|
types: "./tokens/index.d.ts",
|
|
2700
|
+
require: "./tokens/index.mjs",
|
|
2684
2701
|
import: "./tokens/index.mjs"
|
|
2685
2702
|
},
|
|
2686
2703
|
"./types": {
|
|
@@ -2714,7 +2731,7 @@ var recipe_d_ts_default = {
|
|
|
2714
2731
|
|
|
2715
2732
|
// src/artifacts/generated/pattern.d.ts.json
|
|
2716
2733
|
var pattern_d_ts_default = {
|
|
2717
|
-
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\
|
|
2734
|
+
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 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"
|
|
2718
2735
|
};
|
|
2719
2736
|
|
|
2720
2737
|
// src/artifacts/generated/parts.d.ts.json
|
|
@@ -2741,12 +2758,12 @@ function getGeneratedTypes() {
|
|
|
2741
2758
|
}
|
|
2742
2759
|
|
|
2743
2760
|
// src/artifacts/types/main.ts
|
|
2744
|
-
var
|
|
2761
|
+
var import_outdent38 = require("outdent");
|
|
2745
2762
|
var generateTypesEntry = () => ({
|
|
2746
|
-
global:
|
|
2763
|
+
global: import_outdent38.outdent`
|
|
2747
2764
|
import type { RecipeVariantRecord, RecipeConfig } from './recipe'
|
|
2748
2765
|
import type { Parts } from './parts'
|
|
2749
|
-
import type { PatternConfig } from './pattern'
|
|
2766
|
+
import type { PatternConfig, PatternProperties } from './pattern'
|
|
2750
2767
|
import type { GlobalStyleObject, SystemStyleObject } from './system-types'
|
|
2751
2768
|
import type { CompositionStyles } from './composition'
|
|
2752
2769
|
|
|
@@ -2756,23 +2773,23 @@ var generateTypesEntry = () => ({
|
|
|
2756
2773
|
export function defineGlobalStyles(definition: GlobalStyleObject): GlobalStyleObject
|
|
2757
2774
|
export function defineTextStyles(definition: CompositionStyles['textStyles']): CompositionStyles['textStyles']
|
|
2758
2775
|
export function defineLayerStyles(definition: CompositionStyles['layerStyles']): CompositionStyles['layerStyles']
|
|
2759
|
-
export function definePattern<T>(config: PatternConfig<T>): PatternConfig
|
|
2776
|
+
export function definePattern<T extends PatternProperties>(config: PatternConfig<T>): PatternConfig
|
|
2760
2777
|
export function defineParts<T extends Parts>(parts: T): (config: Partial<Record<keyof T, SystemStyleObject>>) => Partial<Record<keyof T, SystemStyleObject>>;
|
|
2761
2778
|
}
|
|
2762
2779
|
`,
|
|
2763
|
-
index:
|
|
2780
|
+
index: import_outdent38.outdent`
|
|
2764
2781
|
import './global'
|
|
2765
2782
|
export type { ConditionalValue } from './conditions'
|
|
2766
2783
|
export type { GlobalStyleObject, JsxStyleProps, SystemStyleObject } from './system-types'
|
|
2767
2784
|
|
|
2768
2785
|
`,
|
|
2769
|
-
helpers:
|
|
2786
|
+
helpers: import_outdent38.outdent`
|
|
2770
2787
|
export type Pretty<T> = T extends infer U ? { [K in keyof U]: U[K] } : never
|
|
2771
2788
|
`
|
|
2772
2789
|
});
|
|
2773
2790
|
|
|
2774
2791
|
// src/artifacts/types/prop-types.ts
|
|
2775
|
-
var
|
|
2792
|
+
var import_outdent39 = require("outdent");
|
|
2776
2793
|
function generatePropTypes(ctx) {
|
|
2777
2794
|
const {
|
|
2778
2795
|
config: { strictTokens },
|
|
@@ -2780,7 +2797,7 @@ function generatePropTypes(ctx) {
|
|
|
2780
2797
|
} = ctx;
|
|
2781
2798
|
const strictText = `${strictTokens ? "" : " | CssValue<T>"}`;
|
|
2782
2799
|
const result = [
|
|
2783
|
-
|
|
2800
|
+
import_outdent39.outdent`
|
|
2784
2801
|
import type { ConditionalValue } from './conditions';
|
|
2785
2802
|
import type { CssProperties } from './system-types'
|
|
2786
2803
|
import type { Tokens } from '../tokens'
|
|
@@ -2803,7 +2820,7 @@ function generatePropTypes(ctx) {
|
|
|
2803
2820
|
result.push(` ${key}: Shorthand<${JSON.stringify(value)}>;`);
|
|
2804
2821
|
});
|
|
2805
2822
|
result.push("}");
|
|
2806
|
-
return
|
|
2823
|
+
return import_outdent39.outdent`
|
|
2807
2824
|
${result.join("\n")}
|
|
2808
2825
|
|
|
2809
2826
|
export type PropertyValue<T extends string> = T extends keyof PropertyTypes
|
|
@@ -2816,10 +2833,10 @@ function generatePropTypes(ctx) {
|
|
|
2816
2833
|
|
|
2817
2834
|
// src/artifacts/types/style-props.ts
|
|
2818
2835
|
var import_is_valid_prop = require("@pandacss/is-valid-prop");
|
|
2819
|
-
var
|
|
2836
|
+
var import_outdent40 = __toESM(require("outdent"));
|
|
2820
2837
|
function generateStyleProps(ctx) {
|
|
2821
2838
|
const props = new Set(import_is_valid_prop.allCssProperties.concat(ctx.utility.keys()));
|
|
2822
|
-
return
|
|
2839
|
+
return import_outdent40.default`
|
|
2823
2840
|
import type { ConditionalValue } from './conditions'
|
|
2824
2841
|
import type { PropertyValue } from './prop-type'
|
|
2825
2842
|
import type { Token } from '../tokens'
|
|
@@ -2836,7 +2853,7 @@ function generateStyleProps(ctx) {
|
|
|
2836
2853
|
|
|
2837
2854
|
// src/artifacts/types/token-types.ts
|
|
2838
2855
|
var import_shared3 = require("@pandacss/shared");
|
|
2839
|
-
var
|
|
2856
|
+
var import_outdent41 = require("outdent");
|
|
2840
2857
|
var import_pluralize = __toESM(require("pluralize"));
|
|
2841
2858
|
var categories = [
|
|
2842
2859
|
"zIndex",
|
|
@@ -2881,7 +2898,7 @@ function generateTokenTypes(ctx) {
|
|
|
2881
2898
|
result.add("} & { [token: string]: never }");
|
|
2882
2899
|
set.add(Array.from(result).join("\n"));
|
|
2883
2900
|
set.add(`export type TokenCategory = ${(0, import_shared3.unionType)(categories)}`);
|
|
2884
|
-
return
|
|
2901
|
+
return import_outdent41.outdent.string(Array.from(set).join("\n\n"));
|
|
2885
2902
|
}
|
|
2886
2903
|
|
|
2887
2904
|
// src/artifacts/index.ts
|
|
@@ -2978,8 +2995,8 @@ function setupRecipes(ctx) {
|
|
|
2978
2995
|
return;
|
|
2979
2996
|
const indexFiles = files.filter((file) => !file.name.includes("create-recipe"));
|
|
2980
2997
|
const index = {
|
|
2981
|
-
js:
|
|
2982
|
-
dts:
|
|
2998
|
+
js: import_outdent42.default.string(indexFiles.map((file) => ctx.file.export(`./${file.name}`)).join("\n")),
|
|
2999
|
+
dts: import_outdent42.default.string(indexFiles.map((file) => `export * from './${file.name}'`).join("\n"))
|
|
2983
3000
|
};
|
|
2984
3001
|
return {
|
|
2985
3002
|
dir: ctx.paths.recipe,
|
|
@@ -2998,8 +3015,8 @@ function setupPatterns(ctx) {
|
|
|
2998
3015
|
if (!files)
|
|
2999
3016
|
return;
|
|
3000
3017
|
const index = {
|
|
3001
|
-
js:
|
|
3002
|
-
dts:
|
|
3018
|
+
js: import_outdent42.default.string(files.map((file) => ctx.file.export(`./${file.name}`)).join("\n")),
|
|
3019
|
+
dts: import_outdent42.default.string(files.map((file) => `export * from './${file.name}'`).join("\n"))
|
|
3003
3020
|
};
|
|
3004
3021
|
return {
|
|
3005
3022
|
dir: ctx.paths.pattern,
|
|
@@ -3019,13 +3036,15 @@ function setupJsx(ctx) {
|
|
|
3019
3036
|
const factory = generateJsxFactory(ctx);
|
|
3020
3037
|
const patterns = generateJsxPatterns(ctx);
|
|
3021
3038
|
const index = {
|
|
3022
|
-
js:
|
|
3039
|
+
js: import_outdent42.default`
|
|
3023
3040
|
${ctx.file.export("./factory")}
|
|
3024
|
-
${
|
|
3041
|
+
${isValidProp?.js ? ctx.file.export("./is-valid-prop") : ""}
|
|
3042
|
+
${import_outdent42.default.string(patterns.map((file) => ctx.file.export(`./${file.name}`)).join("\n"))}
|
|
3025
3043
|
`,
|
|
3026
|
-
dts:
|
|
3044
|
+
dts: import_outdent42.default`
|
|
3027
3045
|
export * from './factory'
|
|
3028
|
-
${
|
|
3046
|
+
${isValidProp?.dts ? `export * from './is-valid-prop'` : ""}
|
|
3047
|
+
${import_outdent42.default.string(patterns.map((file) => `export * from './${file.name}'`).join("\n"))}
|
|
3029
3048
|
export type { ${ctx.jsx.typeName} } from '../types/jsx'
|
|
3030
3049
|
`
|
|
3031
3050
|
};
|
|
@@ -3035,6 +3054,7 @@ function setupJsx(ctx) {
|
|
|
3035
3054
|
...patterns.map((file) => ({ file: ctx.file.ext(file.name), code: file.js })),
|
|
3036
3055
|
...patterns.map((file) => ({ file: `${file.name}.d.ts`, code: file.dts })),
|
|
3037
3056
|
{ file: ctx.file.ext("is-valid-prop"), code: isValidProp?.js },
|
|
3057
|
+
{ file: "is-valid-prop.d.ts", code: isValidProp?.dts },
|
|
3038
3058
|
{ file: "factory.d.ts", code: types.jsxFactory },
|
|
3039
3059
|
{ file: ctx.file.ext("factory"), code: factory?.js },
|
|
3040
3060
|
{ file: "index.d.ts", code: index.dts },
|
|
@@ -3044,12 +3064,12 @@ function setupJsx(ctx) {
|
|
|
3044
3064
|
}
|
|
3045
3065
|
function setupCssIndex(ctx) {
|
|
3046
3066
|
const index = {
|
|
3047
|
-
js:
|
|
3067
|
+
js: import_outdent42.default`
|
|
3048
3068
|
${ctx.file.export("./css")}
|
|
3049
3069
|
${ctx.file.export("./cx")}
|
|
3050
3070
|
${ctx.isTemplateLiteralSyntax ? "" : ctx.file.export("./cva")}
|
|
3051
3071
|
`,
|
|
3052
|
-
dts:
|
|
3072
|
+
dts: import_outdent42.default`
|
|
3053
3073
|
export * from './css'
|
|
3054
3074
|
export * from './cx'
|
|
3055
3075
|
${ctx.isTemplateLiteralSyntax ? "" : `export * from './cva'`}
|
|
@@ -3147,7 +3167,6 @@ var generateFlattenedCss = (ctx) => (options) => {
|
|
|
3147
3167
|
var import_logger2 = require("@pandacss/logger");
|
|
3148
3168
|
var import_func = require("lil-fp/func");
|
|
3149
3169
|
var import_ts_pattern6 = require("ts-pattern");
|
|
3150
|
-
var flattenStyles = (data) => Object.assign({}, data, { css: void 0 }, data.css ?? {});
|
|
3151
3170
|
var generateParserCss = (ctx) => (result) => (0, import_func.pipe)(
|
|
3152
3171
|
{ ...ctx, sheet: ctx.createSheet(), result },
|
|
3153
3172
|
(0, import_func.tap)(({ sheet, result: result2, patterns, recipes }) => {
|
|
@@ -3163,7 +3182,7 @@ var generateParserCss = (ctx) => (result) => (0, import_func.pipe)(
|
|
|
3163
3182
|
});
|
|
3164
3183
|
result2.jsx.forEach((jsx) => {
|
|
3165
3184
|
jsx.data.forEach((data) => {
|
|
3166
|
-
sheet.
|
|
3185
|
+
sheet.processStyleProps(data);
|
|
3167
3186
|
});
|
|
3168
3187
|
});
|
|
3169
3188
|
result2.recipe.forEach((recipeSet, name) => {
|
|
@@ -3174,8 +3193,8 @@ var generateParserCss = (ctx) => (result) => (0, import_func.pipe)(
|
|
|
3174
3193
|
continue;
|
|
3175
3194
|
(0, import_ts_pattern6.match)(recipe).with({ type: "jsx-recipe", name: import_ts_pattern6.P.string }, ({ name: name2 }) => {
|
|
3176
3195
|
recipe.data.forEach((data) => {
|
|
3177
|
-
const [recipeProps, styleProps] = recipes.splitProps(name2,
|
|
3178
|
-
sheet.
|
|
3196
|
+
const [recipeProps, styleProps] = recipes.splitProps(name2, data);
|
|
3197
|
+
sheet.processStyleProps(styleProps);
|
|
3179
3198
|
sheet.processRecipe(recipeConfig, recipeProps);
|
|
3180
3199
|
});
|
|
3181
3200
|
}).otherwise(() => {
|
|
@@ -3194,8 +3213,8 @@ var generateParserCss = (ctx) => (result) => (0, import_func.pipe)(
|
|
|
3194
3213
|
(0, import_ts_pattern6.match)(pattern).with({ type: "jsx-pattern", name: import_ts_pattern6.P.string }, ({ name: name2 }) => {
|
|
3195
3214
|
pattern.data.forEach((data) => {
|
|
3196
3215
|
const fnName = patterns.getFnName(name2);
|
|
3197
|
-
const styleProps = patterns.transform(fnName,
|
|
3198
|
-
sheet.
|
|
3216
|
+
const styleProps = patterns.transform(fnName, data);
|
|
3217
|
+
sheet.processStyleProps(styleProps);
|
|
3199
3218
|
});
|
|
3200
3219
|
}).otherwise(() => {
|
|
3201
3220
|
pattern.data.forEach((data) => {
|
|
@@ -3448,8 +3467,7 @@ var createGenerator = (conf) => {
|
|
|
3448
3467
|
isStyleProp: isValidProperty,
|
|
3449
3468
|
nodes: [...patterns.nodes, ...recipes.nodes]
|
|
3450
3469
|
},
|
|
3451
|
-
|
|
3452
|
-
getRecipeByName: recipes.getConfig
|
|
3470
|
+
getRecipesByJsxName: recipes.filter
|
|
3453
3471
|
}
|
|
3454
3472
|
};
|
|
3455
3473
|
};
|