@pandacss/generator 0.38.0 → 0.39.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.js CHANGED
@@ -152,9 +152,18 @@ function generateCssFn(ctx) {
152
152
  dts: import_outdent3.outdent`
153
153
  ${ctx.file.importType("SystemStyleObject", "../types/index")}
154
154
 
155
+ type Styles = SystemStyleObject | undefined | null | false
156
+
155
157
  interface CssFunction {
156
- (...styles: Array<SystemStyleObject | undefined | null | false>): string
157
- raw: (...styles: Array<SystemStyleObject | undefined | null | false>) => SystemStyleObject
158
+ (styles: Styles): string
159
+ (styles: Styles[]): string
160
+ (...styles: Array<Styles | Styles[]>): string
161
+ (styles: Styles): string
162
+
163
+ raw: (styles: Styles) => string
164
+ raw: (styles: Styles[]) => string
165
+ raw: (...styles: Array<Styles | Styles[]>) => string
166
+ raw: (styles: Styles) => string
158
167
  }
159
168
 
160
169
  export declare const css: CssFunction;
@@ -418,7 +427,7 @@ var astish_mjs_default = {
418
427
 
419
428
  // src/artifacts/generated/helpers.mjs.json
420
429
  var helpers_mjs_default = {
421
- content: '// src/assert.ts\nfunction isObject(value) {\n return typeof value === "object" && value != null && !Array.isArray(value);\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/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/important.ts\nvar importantRegex = /\\s*!(important)?/i;\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/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/merge-props.ts\nfunction mergeProps(...sources) {\n const objects = sources.filter(Boolean);\n return objects.reduce((prev, obj) => {\n Object.keys(obj).forEach((key) => {\n const prevValue = prev[key];\n const value = obj[key];\n if (isObject(prevValue) && isObject(value)) {\n prev[key] = mergeProps(prevValue, value);\n } else {\n prev[key] = value;\n }\n });\n return prev;\n }, {});\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, child) ?? 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 (Array.isArray(obj))\n return obj.map((value) => fn(value));\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(\n (acc, current, index) => {\n const key = breakpoints[index];\n if (current != null) {\n acc[key] = current;\n }\n return acc;\n },\n {}\n );\n}\nfunction normalizeStyleObject(styles, context, shorthand = true) {\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: shorthand ? (prop) => hasShorthand ? resolveShorthand(prop) : prop : void 0\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(utility.toHash(baseArray, toHash));\n } else {\n const baseArray = [...conds.finalize(conditions), formatClassName(className)];\n result = baseArray.join(":");\n }\n return result;\n };\n return memo(({ base, ...styles } = {}) => {\n const styleObject = Object.assign(styles, base);\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) => normalizeStyleObject(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: memo(mergeCss), assignCss };\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/is-css-function.ts\nvar fns = ["min", "max", "clamp", "calc"];\nvar fnRegExp = new RegExp(`^(${fns.join("|")})\\\\(.*\\\\)`);\nvar isCssFunction = (v) => typeof v === "string" && fnRegExp.test(v);\n\n// src/is-css-unit.ts\nvar lengthUnits = "cm,mm,Q,in,pc,pt,px,em,ex,ch,rem,lh,rlh,vw,vh,vmin,vmax,vb,vi,svw,svh,lvw,lvh,dvw,dvh,cqw,cqh,cqi,cqb,cqmin,cqmax,%";\nvar lengthUnitsPattern = `(?:${lengthUnits.split(",").join("|")})`;\nvar lengthRegExp = new RegExp(`^[+-]?[0-9]*.?[0-9]+(?:[eE][+-]?[0-9]+)?${lengthUnitsPattern}$`);\nvar isCssUnit = (v) => typeof v === "string" && lengthRegExp.test(v);\n\n// src/is-css-var.ts\nvar isCssVar = (v) => typeof v === "string" && /^var\\(--.+\\)$/.test(v);\n\n// src/pattern-fns.ts\nvar patternFns = {\n map: mapObject,\n isCssFunction,\n isCssVar,\n isCssUnit\n};\nvar getPatternStyles = (pattern, styles) => {\n if (!pattern?.defaultValues)\n return styles;\n const defaults = typeof pattern.defaultValues === "function" ? pattern.defaultValues(styles) : pattern.defaultValues;\n return Object.assign({}, defaults, compact(styles));\n};\n\n// src/slot.ts\nvar getSlotRecipes = (recipe = {}) => {\n const init = (slot) => ({\n className: [recipe.className, slot].filter(Boolean).join("__"),\n base: recipe.base?.[slot] ?? {},\n variants: {},\n defaultVariants: recipe.defaultVariants ?? {},\n compoundVariants: recipe.compoundVariants ? getSlotCompoundVariant(recipe.compoundVariants, slot) : []\n });\n const slots = recipe.slots ?? [];\n const recipeParts = slots.map((slot) => [slot, init(slot)]);\n for (const [variantsKey, variantsSpec] of Object.entries(recipe.variants ?? {})) {\n for (const [variantKey, variantSpec] of Object.entries(variantsSpec)) {\n recipeParts.forEach(([slot, slotRecipe]) => {\n slotRecipe.variants[variantsKey] ??= {};\n slotRecipe.variants[variantsKey][variantKey] = variantSpec[slot] ?? {};\n });\n }\n }\n return Object.fromEntries(recipeParts);\n};\nvar getSlotCompoundVariant = (compoundVariants, slotName) => compoundVariants.filter((compoundVariant) => compoundVariant.css[slotName]).map((compoundVariant) => ({ ...compoundVariant, css: compoundVariant.css[slotName] }));\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}\n\n// src/uniq.ts\nvar uniq = (...items) => items.filter(Boolean).reduce((acc, item) => Array.from(/* @__PURE__ */ new Set([...acc, ...item])), []);\nexport {\n compact,\n createCss,\n createMergeCss,\n filterBaseConditions,\n getPatternStyles,\n getSlotCompoundVariant,\n getSlotRecipes,\n hypenateProperty,\n isBaseCondition,\n isObject,\n mapObject,\n memo,\n mergeProps,\n patternFns,\n splitProps,\n toHash,\n uniq,\n walkObject,\n withoutSpace\n};\n'
430
+ content: '// src/assert.ts\nfunction isObject(value) {\n return typeof value === "object" && value != null && !Array.isArray(value);\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/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/important.ts\nvar importantRegex = /\\s*!(important)?/i;\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/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/merge-props.ts\nfunction mergeProps(...sources) {\n const objects = sources.filter(Boolean);\n return objects.reduce((prev, obj) => {\n Object.keys(obj).forEach((key) => {\n const prevValue = prev[key];\n const value = obj[key];\n if (isObject(prevValue) && isObject(value)) {\n prev[key] = mergeProps(prevValue, value);\n } else {\n prev[key] = value;\n }\n });\n return prev;\n }, {});\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, child) ?? 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 (Array.isArray(obj))\n return obj.map((value) => fn(value));\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(\n (acc, current, index) => {\n const key = breakpoints[index];\n if (current != null) {\n acc[key] = current;\n }\n return acc;\n },\n {}\n );\n}\nfunction normalizeStyleObject(styles, context, shorthand = true) {\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: shorthand ? (prop) => hasShorthand ? resolveShorthand(prop) : prop : void 0\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(utility.toHash(baseArray, toHash));\n } else {\n const baseArray = [...conds.finalize(conditions), formatClassName(className)];\n result = baseArray.join(":");\n }\n return result;\n };\n return memo(({ base, ...styles } = {}) => {\n const styleObject = Object.assign(styles, base);\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.flat().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) => normalizeStyleObject(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: memo(mergeCss), assignCss };\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/is-css-function.ts\nvar fns = ["min", "max", "clamp", "calc"];\nvar fnRegExp = new RegExp(`^(${fns.join("|")})\\\\(.*\\\\)`);\nvar isCssFunction = (v) => typeof v === "string" && fnRegExp.test(v);\n\n// src/is-css-unit.ts\nvar lengthUnits = "cm,mm,Q,in,pc,pt,px,em,ex,ch,rem,lh,rlh,vw,vh,vmin,vmax,vb,vi,svw,svh,lvw,lvh,dvw,dvh,cqw,cqh,cqi,cqb,cqmin,cqmax,%";\nvar lengthUnitsPattern = `(?:${lengthUnits.split(",").join("|")})`;\nvar lengthRegExp = new RegExp(`^[+-]?[0-9]*.?[0-9]+(?:[eE][+-]?[0-9]+)?${lengthUnitsPattern}$`);\nvar isCssUnit = (v) => typeof v === "string" && lengthRegExp.test(v);\n\n// src/is-css-var.ts\nvar isCssVar = (v) => typeof v === "string" && /^var\\(--.+\\)$/.test(v);\n\n// src/pattern-fns.ts\nvar patternFns = {\n map: mapObject,\n isCssFunction,\n isCssVar,\n isCssUnit\n};\nvar getPatternStyles = (pattern, styles) => {\n if (!pattern?.defaultValues)\n return styles;\n const defaults = typeof pattern.defaultValues === "function" ? pattern.defaultValues(styles) : pattern.defaultValues;\n return Object.assign({}, defaults, compact(styles));\n};\n\n// src/slot.ts\nvar getSlotRecipes = (recipe = {}) => {\n const init = (slot) => ({\n className: [recipe.className, slot].filter(Boolean).join("__"),\n base: recipe.base?.[slot] ?? {},\n variants: {},\n defaultVariants: recipe.defaultVariants ?? {},\n compoundVariants: recipe.compoundVariants ? getSlotCompoundVariant(recipe.compoundVariants, slot) : []\n });\n const slots = recipe.slots ?? [];\n const recipeParts = slots.map((slot) => [slot, init(slot)]);\n for (const [variantsKey, variantsSpec] of Object.entries(recipe.variants ?? {})) {\n for (const [variantKey, variantSpec] of Object.entries(variantsSpec)) {\n recipeParts.forEach(([slot, slotRecipe]) => {\n slotRecipe.variants[variantsKey] ??= {};\n slotRecipe.variants[variantsKey][variantKey] = variantSpec[slot] ?? {};\n });\n }\n }\n return Object.fromEntries(recipeParts);\n};\nvar getSlotCompoundVariant = (compoundVariants, slotName) => compoundVariants.filter((compoundVariant) => compoundVariant.css[slotName]).map((compoundVariant) => ({ ...compoundVariant, css: compoundVariant.css[slotName] }));\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}\n\n// src/uniq.ts\nvar uniq = (...items) => items.filter(Boolean).reduce((acc, item) => Array.from(/* @__PURE__ */ new Set([...acc, ...item])), []);\nexport {\n compact,\n createCss,\n createMergeCss,\n filterBaseConditions,\n getPatternStyles,\n getSlotCompoundVariant,\n getSlotRecipes,\n hypenateProperty,\n isBaseCondition,\n isObject,\n mapObject,\n memo,\n mergeProps,\n patternFns,\n splitProps,\n toHash,\n uniq,\n walkObject,\n withoutSpace\n};\n'
422
431
  };
423
432
 
424
433
  // src/artifacts/generated/normalize-html.mjs.json
@@ -963,13 +972,13 @@ function generatePreactJsxFactory(ctx) {
963
972
  function recipeClass() {
964
973
  const { css: cssStyles, ...propStyles } = styleProps
965
974
  const compoundVariantStyles = __cvaFn__.__getCompoundVariantCss__?.(variantProps)
966
- return cx(__cvaFn__(variantProps, false), css(compoundVariantStyles, propStyles, ...(Array.isArray(cssStyles) ? cssStyles : [cssStyles])), combinedProps.class, combinedProps.className)
975
+ return cx(__cvaFn__(variantProps, false), css(compoundVariantStyles, propStyles, cssStyles), combinedProps.class, combinedProps.className)
967
976
  }
968
977
 
969
978
  function cvaClass() {
970
979
  const { css: cssStyles, ...propStyles } = styleProps
971
980
  const cvaStyles = __cvaFn__.raw(variantProps)
972
- return cx(css(cvaStyles, propStyles, ...(Array.isArray(cssStyles) ? cssStyles : [cssStyles])), combinedProps.class, combinedProps.className)
981
+ return cx(css(cvaStyles, propStyles, cssStyles), combinedProps.class, combinedProps.className)
973
982
  }
974
983
 
975
984
  const classes = configOrCva.__recipe__ ? recipeClass : cvaClass
@@ -1028,7 +1037,7 @@ function generatePreactJsxPattern(ctx, filters) {
1028
1037
  js: import_outdent15.outdent`
1029
1038
  import { h } from 'preact'
1030
1039
  import { forwardRef } from 'preact/compat'
1031
- ${ctx.file.import("mergeCss", "../css/css")}
1040
+ ${jsxStyleProps2 === "minimal" ? ctx.file.import("mergeCss", "../css/css") : ""}
1032
1041
  ${ctx.file.import("splitProps", "../helpers")}
1033
1042
  ${ctx.file.import(styleFnName, `../patterns/${dashName}`)}
1034
1043
  ${ctx.file.import(factoryName, "./factory")}
@@ -1291,13 +1300,13 @@ function generateQwikJsxFactory(ctx) {
1291
1300
  function recipeClass() {
1292
1301
  const { css: cssStyles, ...propStyles } = styleProps
1293
1302
  const compoundVariantStyles = __cvaFn__.__getCompoundVariantCss__?.(variantProps);
1294
- return cx(__cvaFn__(variantProps, false), css(compoundVariantStyles, propStyles, ...(Array.isArray(cssStyles) ? cssStyles : [cssStyles])), combinedProps.class, className)
1303
+ return cx(__cvaFn__(variantProps, false), css(compoundVariantStyles, propStyles, cssStyles), combinedProps.class, className)
1295
1304
  }
1296
1305
 
1297
1306
  function cvaClass() {
1298
1307
  const { css: cssStyles, ...propStyles } = styleProps
1299
1308
  const cvaStyles = __cvaFn__.raw(variantProps)
1300
- return cx(css(cvaStyles, propStyles, ...(Array.isArray(cssStyles) ? cssStyles : [cssStyles])), combinedProps.class, className)
1309
+ return cx(css(cvaStyles, propStyles, cssStyles), combinedProps.class, className)
1301
1310
  }
1302
1311
 
1303
1312
  const classes = configOrCva.__recipe__ ? recipeClass : cvaClass
@@ -1355,7 +1364,7 @@ function generateQwikJsxPattern(ctx, filters) {
1355
1364
  name: dashName,
1356
1365
  js: import_outdent20.outdent`
1357
1366
  import { h } from '@builder.io/qwik'
1358
- ${ctx.file.import("mergeCss", "../css/css")}
1367
+ ${jsxStyleProps2 === "minimal" ? ctx.file.import("mergeCss", "../css/css") : ""}
1359
1368
  ${ctx.file.import("splitProps", "../helpers")}
1360
1369
  ${ctx.file.import(styleFnName, `../patterns/${dashName}`)}
1361
1370
  ${ctx.file.import(factoryName, "./factory")}
@@ -1624,13 +1633,13 @@ function generateReactJsxFactory(ctx) {
1624
1633
  function recipeClass() {
1625
1634
  const { css: cssStyles, ...propStyles } = styleProps
1626
1635
  const compoundVariantStyles = __cvaFn__.__getCompoundVariantCss__?.(variantProps)
1627
- return cx(__cvaFn__(variantProps, false), css(compoundVariantStyles, propStyles, ...(Array.isArray(cssStyles) ? cssStyles : [cssStyles])), combinedProps.className)
1636
+ return cx(__cvaFn__(variantProps, false), css(compoundVariantStyles, propStyles, cssStyles), combinedProps.className)
1628
1637
  }
1629
1638
 
1630
1639
  function cvaClass() {
1631
1640
  const { css: cssStyles, ...propStyles } = styleProps
1632
1641
  const cvaStyles = __cvaFn__.raw(variantProps)
1633
- return cx(css(cvaStyles, propStyles, ...(Array.isArray(cssStyles) ? cssStyles : [cssStyles])), combinedProps.className)
1642
+ return cx(css(cvaStyles, propStyles, cssStyles), combinedProps.className)
1634
1643
  }
1635
1644
 
1636
1645
  const classes = configOrCva.__recipe__ ? recipeClass : cvaClass
@@ -1689,7 +1698,7 @@ function generateReactJsxPattern(ctx, filters) {
1689
1698
  name: dashName,
1690
1699
  js: import_outdent25.outdent`
1691
1700
  import { createElement, forwardRef } from 'react'
1692
- ${ctx.file.import("mergeCss", "../css/css")}
1701
+ ${jsxStyleProps2 === "minimal" ? ctx.file.import("mergeCss", "../css/css") : ""}
1693
1702
  ${ctx.file.import("splitProps", "../helpers")}
1694
1703
  ${ctx.file.import(styleFnName, `../patterns/${dashName}`)}
1695
1704
  ${ctx.file.import(factoryName, "./factory")}
@@ -1987,7 +1996,7 @@ function generateSolidJsxFactory(ctx) {
1987
1996
  __cvaFn__.__getCompoundVariantCss__?.(variantProps)
1988
1997
  return cx(
1989
1998
  __cvaFn__(variantProps, false),
1990
- css(compoundVariantStyles, propStyles, ...(Array.isArray(cssStyles) ? cssStyles : [cssStyles])),
1999
+ css(compoundVariantStyles, propStyles, cssStyles),
1991
2000
  localProps.class,
1992
2001
  localProps.className
1993
2002
  )
@@ -1997,7 +2006,7 @@ function generateSolidJsxFactory(ctx) {
1997
2006
  const { css: cssStyles, ...propStyles } = styleProps
1998
2007
  const cvaStyles = __cvaFn__.raw(variantProps)
1999
2008
  return cx(
2000
- css(cvaStyles, propStyles, ...(Array.isArray(cssStyles) ? cssStyles : [cssStyles])),
2009
+ css(cvaStyles, propStyles, cssStyles),
2001
2010
  localProps.class,
2002
2011
  localProps.className
2003
2012
  )
@@ -2067,7 +2076,7 @@ function generateSolidJsxPattern(ctx, filters) {
2067
2076
  js: import_outdent30.outdent`
2068
2077
  import { createMemo, mergeProps, splitProps } from 'solid-js'
2069
2078
  import { createComponent } from 'solid-js/web'
2070
- ${ctx.file.import("mergeCss", "../css/css")}
2079
+ ${jsxStyleProps2 === "minimal" ? ctx.file.import("mergeCss", "../css/css") : ""}
2071
2080
  ${ctx.file.import(styleFnName, `../patterns/${dashName}`)}
2072
2081
  ${ctx.file.import(factoryName, "./factory")}
2073
2082
 
@@ -2341,14 +2350,14 @@ function generateVueJsxFactory(ctx) {
2341
2350
  const [_htmlProps, _forwardedProps, variantProps, styleProps, _elementProps] = splittedProps.value
2342
2351
  const { css: cssStyles, ...propStyles } = styleProps
2343
2352
  const compoundVariantStyles = __cvaFn__.__getCompoundVariantCss__?.(variantProps);
2344
- return cx(__cvaFn__(variantProps, false), css(compoundVariantStyles, propStyles, ...(Array.isArray(cssStyles) ? cssStyles : [cssStyles])), combinedProps.value.className, combinedProps.value.class)
2353
+ return cx(__cvaFn__(variantProps, false), css(compoundVariantStyles, propStyles, cssStyles), combinedProps.value.className, combinedProps.value.class)
2345
2354
  })
2346
2355
 
2347
2356
  const cvaClass = computed(() => {
2348
2357
  const [_htmlProps, _forwardedProps, variantProps, styleProps, _elementProps] = splittedProps.value
2349
2358
  const { css: cssStyles, ...propStyles } = styleProps
2350
2359
  const cvaStyles = __cvaFn__.raw(variantProps)
2351
- return cx(css(cvaStyles, propStyles, ...(Array.isArray(cssStyles) ? cssStyles : [cssStyles])), combinedProps.value.className, combinedProps.value.class)
2360
+ return cx(css(cvaStyles, propStyles, cssStyles), combinedProps.value.className, combinedProps.value.class)
2352
2361
  })
2353
2362
 
2354
2363
  const classes = configOrCva.__recipe__ ? recipeClass : cvaClass
@@ -2521,7 +2530,7 @@ function generateVueJsxPattern(ctx, filters) {
2521
2530
  name: dashName,
2522
2531
  js: import_outdent36.outdent`
2523
2532
  import { defineComponent, h, computed } from 'vue'
2524
- ${ctx.file.import("mergeCss", "../css/css")}
2533
+ ${jsxStyleProps2 === "minimal" ? ctx.file.import("mergeCss", "../css/css") : ""}
2525
2534
  ${ctx.file.import(styleFnName, `../patterns/${dashName}`)}
2526
2535
  ${ctx.file.import(factoryName, "./factory")}
2527
2536
 
@@ -2812,7 +2821,7 @@ var import_ts_pattern10 = require("ts-pattern");
2812
2821
 
2813
2822
  // src/artifacts/generated/composition.d.ts.json
2814
2823
  var composition_d_ts_default = {
2815
- content: "import type { CompositionStyleObject } from './system-types'\n\ninterface Token<T> {\n value: T\n description?: string\n}\n\ninterface Recursive<T> {\n [key: string]: Recursive<T> | T\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 interface CompositionStyles {\n textStyles: TextStyles\n layerStyles: LayerStyles\n}\n"
2824
+ content: "import type { CompositionStyleObject } from './system-types'\n\ninterface Token<T> {\n value: T\n description?: string\n}\n\ninterface Recursive<T> {\n [key: string]: Recursive<T> | T\n}\n\n/* -----------------------------------------------------------------------------\n * Text styles\n * -----------------------------------------------------------------------------*/\n\ntype TextStyleProperty =\n | 'font'\n | 'fontFamily'\n | 'fontFeatureSettings'\n | 'fontKerning'\n | 'fontLanguageOverride'\n | 'fontOpticalSizing'\n | 'fontPalette'\n | 'fontSize'\n | 'fontSizeAdjust'\n | 'fontStretch'\n | 'fontStyle'\n | 'fontSynthesis'\n | 'fontVariant'\n | 'fontVariantAlternates'\n | 'fontVariantCaps'\n | 'fontVariantLigatures'\n | 'fontVariantNumeric'\n | 'fontVariantPosition'\n | 'fontVariationSettings'\n | 'fontWeight'\n | 'hypens'\n | 'hyphenateCharacter'\n | 'hyphenateLimitChars'\n | 'letterSpacing'\n | 'lineBreak'\n | 'lineHeight'\n | 'quotes'\n | 'overflowWrap'\n | 'textCombineUpright'\n | 'textDecoration'\n | 'textDecorationColor'\n | 'textDecorationLine'\n | 'textDecorationSkipInk'\n | 'textDecorationStyle'\n | 'textDecorationThickness'\n | 'textEmphasis'\n | 'textEmphasisColor'\n | 'textEmphasisPosition'\n | 'textEmphasisStyle'\n | 'textIndent'\n | 'textJustify'\n | 'textOrientation'\n | 'textOverflow'\n | 'textRendering'\n | 'textShadow'\n | 'textTransform'\n | 'textUnderlineOffset'\n | 'textUnderlinePosition'\n | 'textWrap'\n | 'textWrapMode'\n | 'textWrapStyle'\n | 'verticalAlign'\n | 'whiteSpace'\n | 'wordBreak'\n | 'wordSpacing'\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 interface CompositionStyles {\n textStyles: TextStyles\n layerStyles: LayerStyles\n}\n"
2816
2825
  };
2817
2826
 
2818
2827
  // src/artifacts/generated/csstype.d.ts.json
@@ -3832,10 +3841,7 @@ var categories = [
3832
3841
  "assets"
3833
3842
  ];
3834
3843
  function generateTokenTypes(ctx) {
3835
- const {
3836
- tokens,
3837
- config: { theme }
3838
- } = ctx;
3844
+ const { tokens } = ctx;
3839
3845
  const set = /* @__PURE__ */ new Set();
3840
3846
  set.add(`export type Token = ${tokens.isEmpty ? "string" : (0, import_shared4.unionType)(Array.from(tokens.byName.keys()))}`);
3841
3847
  const result = /* @__PURE__ */ new Set(["export type Tokens = {"]);
@@ -3851,11 +3857,6 @@ function generateTokenTypes(ctx) {
3851
3857
  set.add(`export type ${typeName}Token = ${(0, import_shared4.unionType)(value.keys())}`);
3852
3858
  result.add(` ${key}: ${typeName}Token`);
3853
3859
  }
3854
- const keyframes = Object.keys(theme?.keyframes ?? {});
3855
- if (keyframes.length) {
3856
- set.add(`export type AnimationName = ${(0, import_shared4.unionType)(keyframes)}`);
3857
- result.add(` animationName: AnimationName`);
3858
- }
3859
3860
  }
3860
3861
  result.add("} & { [token: string]: never }");
3861
3862
  set.add(Array.from(result).join("\n"));
package/dist/index.mjs CHANGED
@@ -116,9 +116,18 @@ function generateCssFn(ctx) {
116
116
  dts: outdent3`
117
117
  ${ctx.file.importType("SystemStyleObject", "../types/index")}
118
118
 
119
+ type Styles = SystemStyleObject | undefined | null | false
120
+
119
121
  interface CssFunction {
120
- (...styles: Array<SystemStyleObject | undefined | null | false>): string
121
- raw: (...styles: Array<SystemStyleObject | undefined | null | false>) => SystemStyleObject
122
+ (styles: Styles): string
123
+ (styles: Styles[]): string
124
+ (...styles: Array<Styles | Styles[]>): string
125
+ (styles: Styles): string
126
+
127
+ raw: (styles: Styles) => string
128
+ raw: (styles: Styles[]) => string
129
+ raw: (...styles: Array<Styles | Styles[]>) => string
130
+ raw: (styles: Styles) => string
122
131
  }
123
132
 
124
133
  export declare const css: CssFunction;
@@ -382,7 +391,7 @@ var astish_mjs_default = {
382
391
 
383
392
  // src/artifacts/generated/helpers.mjs.json
384
393
  var helpers_mjs_default = {
385
- content: '// src/assert.ts\nfunction isObject(value) {\n return typeof value === "object" && value != null && !Array.isArray(value);\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/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/important.ts\nvar importantRegex = /\\s*!(important)?/i;\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/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/merge-props.ts\nfunction mergeProps(...sources) {\n const objects = sources.filter(Boolean);\n return objects.reduce((prev, obj) => {\n Object.keys(obj).forEach((key) => {\n const prevValue = prev[key];\n const value = obj[key];\n if (isObject(prevValue) && isObject(value)) {\n prev[key] = mergeProps(prevValue, value);\n } else {\n prev[key] = value;\n }\n });\n return prev;\n }, {});\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, child) ?? 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 (Array.isArray(obj))\n return obj.map((value) => fn(value));\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(\n (acc, current, index) => {\n const key = breakpoints[index];\n if (current != null) {\n acc[key] = current;\n }\n return acc;\n },\n {}\n );\n}\nfunction normalizeStyleObject(styles, context, shorthand = true) {\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: shorthand ? (prop) => hasShorthand ? resolveShorthand(prop) : prop : void 0\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(utility.toHash(baseArray, toHash));\n } else {\n const baseArray = [...conds.finalize(conditions), formatClassName(className)];\n result = baseArray.join(":");\n }\n return result;\n };\n return memo(({ base, ...styles } = {}) => {\n const styleObject = Object.assign(styles, base);\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) => normalizeStyleObject(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: memo(mergeCss), assignCss };\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/is-css-function.ts\nvar fns = ["min", "max", "clamp", "calc"];\nvar fnRegExp = new RegExp(`^(${fns.join("|")})\\\\(.*\\\\)`);\nvar isCssFunction = (v) => typeof v === "string" && fnRegExp.test(v);\n\n// src/is-css-unit.ts\nvar lengthUnits = "cm,mm,Q,in,pc,pt,px,em,ex,ch,rem,lh,rlh,vw,vh,vmin,vmax,vb,vi,svw,svh,lvw,lvh,dvw,dvh,cqw,cqh,cqi,cqb,cqmin,cqmax,%";\nvar lengthUnitsPattern = `(?:${lengthUnits.split(",").join("|")})`;\nvar lengthRegExp = new RegExp(`^[+-]?[0-9]*.?[0-9]+(?:[eE][+-]?[0-9]+)?${lengthUnitsPattern}$`);\nvar isCssUnit = (v) => typeof v === "string" && lengthRegExp.test(v);\n\n// src/is-css-var.ts\nvar isCssVar = (v) => typeof v === "string" && /^var\\(--.+\\)$/.test(v);\n\n// src/pattern-fns.ts\nvar patternFns = {\n map: mapObject,\n isCssFunction,\n isCssVar,\n isCssUnit\n};\nvar getPatternStyles = (pattern, styles) => {\n if (!pattern?.defaultValues)\n return styles;\n const defaults = typeof pattern.defaultValues === "function" ? pattern.defaultValues(styles) : pattern.defaultValues;\n return Object.assign({}, defaults, compact(styles));\n};\n\n// src/slot.ts\nvar getSlotRecipes = (recipe = {}) => {\n const init = (slot) => ({\n className: [recipe.className, slot].filter(Boolean).join("__"),\n base: recipe.base?.[slot] ?? {},\n variants: {},\n defaultVariants: recipe.defaultVariants ?? {},\n compoundVariants: recipe.compoundVariants ? getSlotCompoundVariant(recipe.compoundVariants, slot) : []\n });\n const slots = recipe.slots ?? [];\n const recipeParts = slots.map((slot) => [slot, init(slot)]);\n for (const [variantsKey, variantsSpec] of Object.entries(recipe.variants ?? {})) {\n for (const [variantKey, variantSpec] of Object.entries(variantsSpec)) {\n recipeParts.forEach(([slot, slotRecipe]) => {\n slotRecipe.variants[variantsKey] ??= {};\n slotRecipe.variants[variantsKey][variantKey] = variantSpec[slot] ?? {};\n });\n }\n }\n return Object.fromEntries(recipeParts);\n};\nvar getSlotCompoundVariant = (compoundVariants, slotName) => compoundVariants.filter((compoundVariant) => compoundVariant.css[slotName]).map((compoundVariant) => ({ ...compoundVariant, css: compoundVariant.css[slotName] }));\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}\n\n// src/uniq.ts\nvar uniq = (...items) => items.filter(Boolean).reduce((acc, item) => Array.from(/* @__PURE__ */ new Set([...acc, ...item])), []);\nexport {\n compact,\n createCss,\n createMergeCss,\n filterBaseConditions,\n getPatternStyles,\n getSlotCompoundVariant,\n getSlotRecipes,\n hypenateProperty,\n isBaseCondition,\n isObject,\n mapObject,\n memo,\n mergeProps,\n patternFns,\n splitProps,\n toHash,\n uniq,\n walkObject,\n withoutSpace\n};\n'
394
+ content: '// src/assert.ts\nfunction isObject(value) {\n return typeof value === "object" && value != null && !Array.isArray(value);\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/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/important.ts\nvar importantRegex = /\\s*!(important)?/i;\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/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/merge-props.ts\nfunction mergeProps(...sources) {\n const objects = sources.filter(Boolean);\n return objects.reduce((prev, obj) => {\n Object.keys(obj).forEach((key) => {\n const prevValue = prev[key];\n const value = obj[key];\n if (isObject(prevValue) && isObject(value)) {\n prev[key] = mergeProps(prevValue, value);\n } else {\n prev[key] = value;\n }\n });\n return prev;\n }, {});\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, child) ?? 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 (Array.isArray(obj))\n return obj.map((value) => fn(value));\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(\n (acc, current, index) => {\n const key = breakpoints[index];\n if (current != null) {\n acc[key] = current;\n }\n return acc;\n },\n {}\n );\n}\nfunction normalizeStyleObject(styles, context, shorthand = true) {\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: shorthand ? (prop) => hasShorthand ? resolveShorthand(prop) : prop : void 0\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(utility.toHash(baseArray, toHash));\n } else {\n const baseArray = [...conds.finalize(conditions), formatClassName(className)];\n result = baseArray.join(":");\n }\n return result;\n };\n return memo(({ base, ...styles } = {}) => {\n const styleObject = Object.assign(styles, base);\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.flat().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) => normalizeStyleObject(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: memo(mergeCss), assignCss };\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/is-css-function.ts\nvar fns = ["min", "max", "clamp", "calc"];\nvar fnRegExp = new RegExp(`^(${fns.join("|")})\\\\(.*\\\\)`);\nvar isCssFunction = (v) => typeof v === "string" && fnRegExp.test(v);\n\n// src/is-css-unit.ts\nvar lengthUnits = "cm,mm,Q,in,pc,pt,px,em,ex,ch,rem,lh,rlh,vw,vh,vmin,vmax,vb,vi,svw,svh,lvw,lvh,dvw,dvh,cqw,cqh,cqi,cqb,cqmin,cqmax,%";\nvar lengthUnitsPattern = `(?:${lengthUnits.split(",").join("|")})`;\nvar lengthRegExp = new RegExp(`^[+-]?[0-9]*.?[0-9]+(?:[eE][+-]?[0-9]+)?${lengthUnitsPattern}$`);\nvar isCssUnit = (v) => typeof v === "string" && lengthRegExp.test(v);\n\n// src/is-css-var.ts\nvar isCssVar = (v) => typeof v === "string" && /^var\\(--.+\\)$/.test(v);\n\n// src/pattern-fns.ts\nvar patternFns = {\n map: mapObject,\n isCssFunction,\n isCssVar,\n isCssUnit\n};\nvar getPatternStyles = (pattern, styles) => {\n if (!pattern?.defaultValues)\n return styles;\n const defaults = typeof pattern.defaultValues === "function" ? pattern.defaultValues(styles) : pattern.defaultValues;\n return Object.assign({}, defaults, compact(styles));\n};\n\n// src/slot.ts\nvar getSlotRecipes = (recipe = {}) => {\n const init = (slot) => ({\n className: [recipe.className, slot].filter(Boolean).join("__"),\n base: recipe.base?.[slot] ?? {},\n variants: {},\n defaultVariants: recipe.defaultVariants ?? {},\n compoundVariants: recipe.compoundVariants ? getSlotCompoundVariant(recipe.compoundVariants, slot) : []\n });\n const slots = recipe.slots ?? [];\n const recipeParts = slots.map((slot) => [slot, init(slot)]);\n for (const [variantsKey, variantsSpec] of Object.entries(recipe.variants ?? {})) {\n for (const [variantKey, variantSpec] of Object.entries(variantsSpec)) {\n recipeParts.forEach(([slot, slotRecipe]) => {\n slotRecipe.variants[variantsKey] ??= {};\n slotRecipe.variants[variantsKey][variantKey] = variantSpec[slot] ?? {};\n });\n }\n }\n return Object.fromEntries(recipeParts);\n};\nvar getSlotCompoundVariant = (compoundVariants, slotName) => compoundVariants.filter((compoundVariant) => compoundVariant.css[slotName]).map((compoundVariant) => ({ ...compoundVariant, css: compoundVariant.css[slotName] }));\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}\n\n// src/uniq.ts\nvar uniq = (...items) => items.filter(Boolean).reduce((acc, item) => Array.from(/* @__PURE__ */ new Set([...acc, ...item])), []);\nexport {\n compact,\n createCss,\n createMergeCss,\n filterBaseConditions,\n getPatternStyles,\n getSlotCompoundVariant,\n getSlotRecipes,\n hypenateProperty,\n isBaseCondition,\n isObject,\n mapObject,\n memo,\n mergeProps,\n patternFns,\n splitProps,\n toHash,\n uniq,\n walkObject,\n withoutSpace\n};\n'
386
395
  };
387
396
 
388
397
  // src/artifacts/generated/normalize-html.mjs.json
@@ -927,13 +936,13 @@ function generatePreactJsxFactory(ctx) {
927
936
  function recipeClass() {
928
937
  const { css: cssStyles, ...propStyles } = styleProps
929
938
  const compoundVariantStyles = __cvaFn__.__getCompoundVariantCss__?.(variantProps)
930
- return cx(__cvaFn__(variantProps, false), css(compoundVariantStyles, propStyles, ...(Array.isArray(cssStyles) ? cssStyles : [cssStyles])), combinedProps.class, combinedProps.className)
939
+ return cx(__cvaFn__(variantProps, false), css(compoundVariantStyles, propStyles, cssStyles), combinedProps.class, combinedProps.className)
931
940
  }
932
941
 
933
942
  function cvaClass() {
934
943
  const { css: cssStyles, ...propStyles } = styleProps
935
944
  const cvaStyles = __cvaFn__.raw(variantProps)
936
- return cx(css(cvaStyles, propStyles, ...(Array.isArray(cssStyles) ? cssStyles : [cssStyles])), combinedProps.class, combinedProps.className)
945
+ return cx(css(cvaStyles, propStyles, cssStyles), combinedProps.class, combinedProps.className)
937
946
  }
938
947
 
939
948
  const classes = configOrCva.__recipe__ ? recipeClass : cvaClass
@@ -992,7 +1001,7 @@ function generatePreactJsxPattern(ctx, filters) {
992
1001
  js: outdent15`
993
1002
  import { h } from 'preact'
994
1003
  import { forwardRef } from 'preact/compat'
995
- ${ctx.file.import("mergeCss", "../css/css")}
1004
+ ${jsxStyleProps2 === "minimal" ? ctx.file.import("mergeCss", "../css/css") : ""}
996
1005
  ${ctx.file.import("splitProps", "../helpers")}
997
1006
  ${ctx.file.import(styleFnName, `../patterns/${dashName}`)}
998
1007
  ${ctx.file.import(factoryName, "./factory")}
@@ -1255,13 +1264,13 @@ function generateQwikJsxFactory(ctx) {
1255
1264
  function recipeClass() {
1256
1265
  const { css: cssStyles, ...propStyles } = styleProps
1257
1266
  const compoundVariantStyles = __cvaFn__.__getCompoundVariantCss__?.(variantProps);
1258
- return cx(__cvaFn__(variantProps, false), css(compoundVariantStyles, propStyles, ...(Array.isArray(cssStyles) ? cssStyles : [cssStyles])), combinedProps.class, className)
1267
+ return cx(__cvaFn__(variantProps, false), css(compoundVariantStyles, propStyles, cssStyles), combinedProps.class, className)
1259
1268
  }
1260
1269
 
1261
1270
  function cvaClass() {
1262
1271
  const { css: cssStyles, ...propStyles } = styleProps
1263
1272
  const cvaStyles = __cvaFn__.raw(variantProps)
1264
- return cx(css(cvaStyles, propStyles, ...(Array.isArray(cssStyles) ? cssStyles : [cssStyles])), combinedProps.class, className)
1273
+ return cx(css(cvaStyles, propStyles, cssStyles), combinedProps.class, className)
1265
1274
  }
1266
1275
 
1267
1276
  const classes = configOrCva.__recipe__ ? recipeClass : cvaClass
@@ -1319,7 +1328,7 @@ function generateQwikJsxPattern(ctx, filters) {
1319
1328
  name: dashName,
1320
1329
  js: outdent20`
1321
1330
  import { h } from '@builder.io/qwik'
1322
- ${ctx.file.import("mergeCss", "../css/css")}
1331
+ ${jsxStyleProps2 === "minimal" ? ctx.file.import("mergeCss", "../css/css") : ""}
1323
1332
  ${ctx.file.import("splitProps", "../helpers")}
1324
1333
  ${ctx.file.import(styleFnName, `../patterns/${dashName}`)}
1325
1334
  ${ctx.file.import(factoryName, "./factory")}
@@ -1588,13 +1597,13 @@ function generateReactJsxFactory(ctx) {
1588
1597
  function recipeClass() {
1589
1598
  const { css: cssStyles, ...propStyles } = styleProps
1590
1599
  const compoundVariantStyles = __cvaFn__.__getCompoundVariantCss__?.(variantProps)
1591
- return cx(__cvaFn__(variantProps, false), css(compoundVariantStyles, propStyles, ...(Array.isArray(cssStyles) ? cssStyles : [cssStyles])), combinedProps.className)
1600
+ return cx(__cvaFn__(variantProps, false), css(compoundVariantStyles, propStyles, cssStyles), combinedProps.className)
1592
1601
  }
1593
1602
 
1594
1603
  function cvaClass() {
1595
1604
  const { css: cssStyles, ...propStyles } = styleProps
1596
1605
  const cvaStyles = __cvaFn__.raw(variantProps)
1597
- return cx(css(cvaStyles, propStyles, ...(Array.isArray(cssStyles) ? cssStyles : [cssStyles])), combinedProps.className)
1606
+ return cx(css(cvaStyles, propStyles, cssStyles), combinedProps.className)
1598
1607
  }
1599
1608
 
1600
1609
  const classes = configOrCva.__recipe__ ? recipeClass : cvaClass
@@ -1653,7 +1662,7 @@ function generateReactJsxPattern(ctx, filters) {
1653
1662
  name: dashName,
1654
1663
  js: outdent25`
1655
1664
  import { createElement, forwardRef } from 'react'
1656
- ${ctx.file.import("mergeCss", "../css/css")}
1665
+ ${jsxStyleProps2 === "minimal" ? ctx.file.import("mergeCss", "../css/css") : ""}
1657
1666
  ${ctx.file.import("splitProps", "../helpers")}
1658
1667
  ${ctx.file.import(styleFnName, `../patterns/${dashName}`)}
1659
1668
  ${ctx.file.import(factoryName, "./factory")}
@@ -1951,7 +1960,7 @@ function generateSolidJsxFactory(ctx) {
1951
1960
  __cvaFn__.__getCompoundVariantCss__?.(variantProps)
1952
1961
  return cx(
1953
1962
  __cvaFn__(variantProps, false),
1954
- css(compoundVariantStyles, propStyles, ...(Array.isArray(cssStyles) ? cssStyles : [cssStyles])),
1963
+ css(compoundVariantStyles, propStyles, cssStyles),
1955
1964
  localProps.class,
1956
1965
  localProps.className
1957
1966
  )
@@ -1961,7 +1970,7 @@ function generateSolidJsxFactory(ctx) {
1961
1970
  const { css: cssStyles, ...propStyles } = styleProps
1962
1971
  const cvaStyles = __cvaFn__.raw(variantProps)
1963
1972
  return cx(
1964
- css(cvaStyles, propStyles, ...(Array.isArray(cssStyles) ? cssStyles : [cssStyles])),
1973
+ css(cvaStyles, propStyles, cssStyles),
1965
1974
  localProps.class,
1966
1975
  localProps.className
1967
1976
  )
@@ -2031,7 +2040,7 @@ function generateSolidJsxPattern(ctx, filters) {
2031
2040
  js: outdent30`
2032
2041
  import { createMemo, mergeProps, splitProps } from 'solid-js'
2033
2042
  import { createComponent } from 'solid-js/web'
2034
- ${ctx.file.import("mergeCss", "../css/css")}
2043
+ ${jsxStyleProps2 === "minimal" ? ctx.file.import("mergeCss", "../css/css") : ""}
2035
2044
  ${ctx.file.import(styleFnName, `../patterns/${dashName}`)}
2036
2045
  ${ctx.file.import(factoryName, "./factory")}
2037
2046
 
@@ -2305,14 +2314,14 @@ function generateVueJsxFactory(ctx) {
2305
2314
  const [_htmlProps, _forwardedProps, variantProps, styleProps, _elementProps] = splittedProps.value
2306
2315
  const { css: cssStyles, ...propStyles } = styleProps
2307
2316
  const compoundVariantStyles = __cvaFn__.__getCompoundVariantCss__?.(variantProps);
2308
- return cx(__cvaFn__(variantProps, false), css(compoundVariantStyles, propStyles, ...(Array.isArray(cssStyles) ? cssStyles : [cssStyles])), combinedProps.value.className, combinedProps.value.class)
2317
+ return cx(__cvaFn__(variantProps, false), css(compoundVariantStyles, propStyles, cssStyles), combinedProps.value.className, combinedProps.value.class)
2309
2318
  })
2310
2319
 
2311
2320
  const cvaClass = computed(() => {
2312
2321
  const [_htmlProps, _forwardedProps, variantProps, styleProps, _elementProps] = splittedProps.value
2313
2322
  const { css: cssStyles, ...propStyles } = styleProps
2314
2323
  const cvaStyles = __cvaFn__.raw(variantProps)
2315
- return cx(css(cvaStyles, propStyles, ...(Array.isArray(cssStyles) ? cssStyles : [cssStyles])), combinedProps.value.className, combinedProps.value.class)
2324
+ return cx(css(cvaStyles, propStyles, cssStyles), combinedProps.value.className, combinedProps.value.class)
2316
2325
  })
2317
2326
 
2318
2327
  const classes = configOrCva.__recipe__ ? recipeClass : cvaClass
@@ -2485,7 +2494,7 @@ function generateVueJsxPattern(ctx, filters) {
2485
2494
  name: dashName,
2486
2495
  js: outdent36`
2487
2496
  import { defineComponent, h, computed } from 'vue'
2488
- ${ctx.file.import("mergeCss", "../css/css")}
2497
+ ${jsxStyleProps2 === "minimal" ? ctx.file.import("mergeCss", "../css/css") : ""}
2489
2498
  ${ctx.file.import(styleFnName, `../patterns/${dashName}`)}
2490
2499
  ${ctx.file.import(factoryName, "./factory")}
2491
2500
 
@@ -2776,7 +2785,7 @@ import { match as match10 } from "ts-pattern";
2776
2785
 
2777
2786
  // src/artifacts/generated/composition.d.ts.json
2778
2787
  var composition_d_ts_default = {
2779
- content: "import type { CompositionStyleObject } from './system-types'\n\ninterface Token<T> {\n value: T\n description?: string\n}\n\ninterface Recursive<T> {\n [key: string]: Recursive<T> | T\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 interface CompositionStyles {\n textStyles: TextStyles\n layerStyles: LayerStyles\n}\n"
2788
+ content: "import type { CompositionStyleObject } from './system-types'\n\ninterface Token<T> {\n value: T\n description?: string\n}\n\ninterface Recursive<T> {\n [key: string]: Recursive<T> | T\n}\n\n/* -----------------------------------------------------------------------------\n * Text styles\n * -----------------------------------------------------------------------------*/\n\ntype TextStyleProperty =\n | 'font'\n | 'fontFamily'\n | 'fontFeatureSettings'\n | 'fontKerning'\n | 'fontLanguageOverride'\n | 'fontOpticalSizing'\n | 'fontPalette'\n | 'fontSize'\n | 'fontSizeAdjust'\n | 'fontStretch'\n | 'fontStyle'\n | 'fontSynthesis'\n | 'fontVariant'\n | 'fontVariantAlternates'\n | 'fontVariantCaps'\n | 'fontVariantLigatures'\n | 'fontVariantNumeric'\n | 'fontVariantPosition'\n | 'fontVariationSettings'\n | 'fontWeight'\n | 'hypens'\n | 'hyphenateCharacter'\n | 'hyphenateLimitChars'\n | 'letterSpacing'\n | 'lineBreak'\n | 'lineHeight'\n | 'quotes'\n | 'overflowWrap'\n | 'textCombineUpright'\n | 'textDecoration'\n | 'textDecorationColor'\n | 'textDecorationLine'\n | 'textDecorationSkipInk'\n | 'textDecorationStyle'\n | 'textDecorationThickness'\n | 'textEmphasis'\n | 'textEmphasisColor'\n | 'textEmphasisPosition'\n | 'textEmphasisStyle'\n | 'textIndent'\n | 'textJustify'\n | 'textOrientation'\n | 'textOverflow'\n | 'textRendering'\n | 'textShadow'\n | 'textTransform'\n | 'textUnderlineOffset'\n | 'textUnderlinePosition'\n | 'textWrap'\n | 'textWrapMode'\n | 'textWrapStyle'\n | 'verticalAlign'\n | 'whiteSpace'\n | 'wordBreak'\n | 'wordSpacing'\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 interface CompositionStyles {\n textStyles: TextStyles\n layerStyles: LayerStyles\n}\n"
2780
2789
  };
2781
2790
 
2782
2791
  // src/artifacts/generated/csstype.d.ts.json
@@ -3796,10 +3805,7 @@ var categories = [
3796
3805
  "assets"
3797
3806
  ];
3798
3807
  function generateTokenTypes(ctx) {
3799
- const {
3800
- tokens,
3801
- config: { theme }
3802
- } = ctx;
3808
+ const { tokens } = ctx;
3803
3809
  const set = /* @__PURE__ */ new Set();
3804
3810
  set.add(`export type Token = ${tokens.isEmpty ? "string" : unionType4(Array.from(tokens.byName.keys()))}`);
3805
3811
  const result = /* @__PURE__ */ new Set(["export type Tokens = {"]);
@@ -3815,11 +3821,6 @@ function generateTokenTypes(ctx) {
3815
3821
  set.add(`export type ${typeName}Token = ${unionType4(value.keys())}`);
3816
3822
  result.add(` ${key}: ${typeName}Token`);
3817
3823
  }
3818
- const keyframes = Object.keys(theme?.keyframes ?? {});
3819
- if (keyframes.length) {
3820
- set.add(`export type AnimationName = ${unionType4(keyframes)}`);
3821
- result.add(` animationName: AnimationName`);
3822
- }
3823
3824
  }
3824
3825
  result.add("} & { [token: string]: never }");
3825
3826
  set.add(Array.from(result).join("\n"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pandacss/generator",
3
- "version": "0.38.0",
3
+ "version": "0.39.0",
4
4
  "description": "The css generator for css panda",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -37,12 +37,12 @@
37
37
  "pluralize": "8.0.0",
38
38
  "postcss": "8.4.35",
39
39
  "ts-pattern": "5.0.8",
40
- "@pandacss/core": "0.38.0",
41
- "@pandacss/is-valid-prop": "^0.38.0",
42
- "@pandacss/logger": "0.38.0",
43
- "@pandacss/shared": "0.38.0",
44
- "@pandacss/token-dictionary": "0.38.0",
45
- "@pandacss/types": "0.38.0"
40
+ "@pandacss/core": "0.39.0",
41
+ "@pandacss/is-valid-prop": "^0.39.0",
42
+ "@pandacss/logger": "0.39.0",
43
+ "@pandacss/shared": "0.39.0",
44
+ "@pandacss/token-dictionary": "0.39.0",
45
+ "@pandacss/types": "0.39.0"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@types/pluralize": "0.0.33"