{"version":3,"file":"css-cx.cjs","names":[],"sources":["../src/css/css-cx.ts"],"sourcesContent":["/**\n * @internal Separate chunk so clsx + tailwind-merge + class-variance-authority are tree-shaken\n * away when `cx`/`cva` are not used. Consumers import from `yummies/css` — this module is not a\n * public entry point.\n */\n\nimport { cva as cvaLib } from 'class-variance-authority';\nimport clsx from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\n/**\n * Composes conditional class names like {@link https://github.com/lukeed/clsx | clsx}, then runs\n * the result through {@link https://github.com/dcastil/tailwind-merge | tailwind-merge} so\n * conflicting Tailwind utilities collapse to the last/intended one (e.g. two `padding-x` classes).\n *\n * Accepts the same argument shapes as `clsx`: strings, objects, arrays, falsy values to omit.\n *\n * @param args - Same as `clsx(...args)` — `ClassValue` rest parameters.\n * @returns A single merged class string, safe for `className` on DOM/React.\n *\n * @example\n * ```ts\n * cx('px-2 py-1 text-sm', 'px-4'); // 'py-1 text-sm px-4' — padding-x merged\n * ```\n *\n * @example\n * ```ts\n * cx('btn', { 'btn--active': isActive, 'btn--disabled': disabled }, className);\n * ```\n */\nexport const cx = (...args: Parameters<typeof clsx>) => twMerge(clsx(...args));\n\n/**\n * {@link https://cva.style/docs | Class Variance Authority (cva)} with the same **tailwind-merge**\n * pass as {@link cx}: the class string produced by the variant function is merged so Tailwind\n * conflicts resolve predictably.\n *\n * API matches `cva` from `class-variance-authority`: optional `base` classes, `config` with\n * `variants`, `defaultVariants`, and `compoundVariants`. The returned function accepts variant\n * props plus optional `class` / `className` for one-off overrides.\n *\n * Use {@link VariantProps} with `typeof buttonVariants` (or similar) to type component props.\n *\n * @param base - Base `ClassValue`(s) always applied.\n * @param config - Variant schema and defaults (same shape as upstream `cva`).\n * @returns A function `(props?) => string` that resolves variant classes, merged with tw-merge.\n *\n * @example\n * ```ts\n * const button = cva('rounded font-medium', {\n *   variants: {\n *     tone: { primary: 'bg-blue-600 text-white', ghost: 'bg-transparent' },\n *     size: { sm: 'text-sm px-2', md: 'text-base px-4' },\n *   },\n *   defaultVariants: { tone: 'primary', size: 'md' },\n * });\n * button({ tone: 'ghost', className: 'ml-2' });\n * ```\n *\n * @example\n * ```ts\n * const card = cva('border p-4', {\n *   variants: { elevated: { true: 'shadow-lg', false: 'shadow-none' } },\n *   defaultVariants: { elevated: false },\n * });\n * card({ elevated: true });\n * ```\n */\nexport const cva = ((...args: any[]) => {\n  const schema = cvaLib(...args);\n  return (...inputArgs: any[]) => twMerge(schema(...inputArgs));\n}) as unknown as typeof cvaLib;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA,IAAa,MAAM,GAAG,UAAA,GAAA,eAAA,UAAA,GAAA,KAAA,SAA+C,GAAG,IAAI,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsC7E,IAAa,QAAQ,GAAG,SAAgB;CACtC,MAAM,UAAA,GAAA,yBAAA,KAAgB,GAAG,IAAI;CAC7B,QAAQ,GAAG,eAAA,GAAA,eAAA,SAA6B,OAAO,GAAG,SAAS,CAAC;AAC9D"}