@mochi-css/vanilla 0.1.0 → 1.0.1
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/README.md +58 -2
- package/dist/index.d.mts +396 -124
- package/dist/index.d.ts +396 -124
- package/dist/index.js +462 -136
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +460 -132
- package/dist/index.mjs.map +1 -1
- package/package.json +16 -2
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["value: number","suffix: T","name: string","properties","parser: ((v: any, k: string) => string) | undefined","cssSelectors: string[]","mediaSelectors: string[]","cssProps: Record<string, string>","selector: MochiSelector","propsToProcess: { key: string, selector: MochiSelector, props: StyleProps }[]","props","selector","styles","classNames: string[]","variantClassNames: { [K in keyof V]: { [P in keyof V[K]]: string } }","defaultVariants: Partial<RefineVariants<V>>","cssToMerge: MochiCSS<DefaultVariants>[]","css","styles"],"sources":["../src/values/number.ts","../src/values/length.ts","../src/values/color.ts","../src/token.ts","../src/props.ts","../src/selector.ts","../src/hash.ts","../src/compare.ts","../src/cssObject.ts","../src/css.ts","../src/styled.ts"],"sourcesContent":["import {LengthUnit} from \"@/values/length\";\n\nexport type Unit = \"%\" | \"px\" | \"deg\" | \"rad\" | \"grad\" | \"rem\" | \"vw\" | \"vh\"\nexport class NumericValue<T extends LengthUnit = LengthUnit> {\n constructor(\n private readonly value: number,\n private readonly suffix: T\n ) {}\n\n toString(): `${number}${T}` {\n return `${this.value}${this.suffix}`\n }\n}\n","import {CssLike, CssVarVal} from \"./shared\";\nimport { NumericValue } from \"./number\";\nimport {Globals} from \"csstype\"\n\nexport class PixelValue extends NumericValue<\"px\"> {\n constructor(value: number) { super(value, \"px\") }\n}\n\nexport class PercentValue extends NumericValue<\"%\"> {\n constructor(value: number) { super(value, \"%\") }\n}\n\nexport type LengthUnit = \"%\" | \"px\" | \"vw\" | \"vh\" | \"rem\"\nexport type CssLengthString = `${number}${LengthUnit}` | CssVarVal | Globals | \"auto\"\nexport type CssLength = number | CssLengthString | CssVarVal\nexport type CssLengthLike = CssLike<CssLength>\n\nexport function asLength(value: CssLengthLike): CssLengthString {\n switch (typeof value) {\n case \"number\": return `${value}px`\n case \"string\": return value\n default: return asLength(value.value)\n }\n}\n","import {DataType} from \"csstype\"\nimport {CssLike, CssVarVal} from \"@/values/shared\";\n\nexport type RGBColorString = `rgb(${number},${number},${number})`\nexport type RGBAColorString = `rgba(${number},${number},${number},${number})`\n\nexport type HSLColorString = `hsl(${number},${number},${number})`\nexport type HSLAColorString = `hsla(${number},${number},${number},${number})`\n\nexport type ColorString = RGBColorString | RGBAColorString | HSLColorString | HSLAColorString\nexport type CssColor = DataType.NamedColor | \"transparent\" | \"currentColor\" | \"auto\" | ColorString | CssVarVal\n\nexport type CssColorLike = CssLike<CssColor>\n\nexport function asColor(value: CssColorLike): CssColor {\n if (typeof value === \"string\") return value\n return value.value\n}\n","/**\n * CSS custom property (design token) utilities.\n * Provides type-safe access to CSS variables with proper `var()` syntax.\n * @module token\n */\n\nimport {CssVar, CssVarVal} from \"@/values\";\n\n/**\n * Represents a CSS custom property (design token) with type information.\n * Provides convenient access to both the variable name and its `var()` reference.\n * @template T - The expected value type of the token (for type checking)\n * @example\n * const primaryColor = new Token<string>('primary-color')\n * primaryColor.variable // '--primary-color'\n * primaryColor.value // 'var(--primary-color)'\n */\nexport class Token<T> {\n /**\n * Creates a new CSS token.\n * @param name - The token name (without the `--` prefix)\n */\n constructor(public readonly name: string) {}\n\n /**\n * Gets the CSS custom property name (with `--` prefix).\n * Use this when defining the variable.\n */\n get variable(): CssVar {\n return `--${this.name}`\n }\n\n /**\n * Gets the CSS `var()` reference to this token.\n * Use this when consuming the variable value.\n */\n get value(): CssVarVal {\n return `var(${this.variable})`\n }\n\n /**\n * Returns the variable name for string coercion.\n */\n toString(): CssVar {\n return this.variable\n }\n}\n\n/**\n * Creates a new CSS design token.\n * @template T - The expected value type of the token\n * @param name - The token name (without the `--` prefix)\n * @returns A new Token instance\n * @example\n * const spacing = createToken<number>('spacing-md')\n * // Use in styles: { gap: spacing.value }\n */\nexport function createToken<T>(name: string): Token<T> {\n return new Token(name)\n}\n","/**\n * CSS property handling and type definitions.\n * Provides type-safe mappings from JavaScript objects to CSS properties,\n * with automatic unit conversion and value formatting.\n * @module props\n */\n\nimport {Properties, ObsoleteProperties } from \"csstype\"\nimport {asColor, asLength, CssLike, CssVar} from \"@/values\"\nimport properties from \"known-css-properties\"\n\n/**\n * Converts a CSS-like value to its string representation.\n * Handles strings, numbers, and wrapped values with a `.value` property.\n * @param v - The value to convert\n * @returns The string representation of the value\n */\nfunction asEnum<E extends string | number>(v: CssLike<E>): string {\n if (typeof v === \"string\") return v\n if (typeof v === \"number\") return v.toString()\n return v.value.toString()\n}\n\n/** All non-obsolete CSS properties from csstype */\ntype Props = Required<Omit<Properties, keyof ObsoleteProperties>>\n\nconst styles = {\n borderBlockEndWidth: asLength,\n borderBlockStartWidth: asLength,\n borderBottomColor: asColor,\n borderBottomLeftRadius: asLength,\n borderBottomRightRadius: asLength,\n borderBottomWidth: asLength,\n borderEndEndRadius: asLength,\n borderEndStartRadius: asLength,\n borderInlineEndWidth: asLength,\n borderInlineStartWidth: asLength,\n borderLeftWidth: asLength,\n borderRightWidth: asLength,\n borderStartEndRadius: asLength,\n borderStartStartRadius: asLength,\n borderTopLeftRadius: asLength,\n borderTopRightRadius: asLength,\n borderTopWidth: asLength,\n borderBlockWidth: asLength,\n borderInlineWidth: asLength,\n borderWidth: asLength,\n gap: asLength,\n height: asLength,\n lineHeight: asLength,\n marginBottom: asLength,\n marginLeft: asLength,\n marginRight: asLength,\n marginTop: asLength,\n paddingBottom: asLength,\n paddingLeft: asLength,\n paddingRight: asLength,\n paddingTop: asLength,\n width: asLength,\n} satisfies { [K in keyof Props]?: (v: any, n: string) => string }\n\n/** Set of all known CSS property names in camelCase format */\nconst knownPropertySet = new Set<string>(properties.all.map(kebabToCamel))\n\n/**\n * Type guard that checks if a string starts with a specific prefix.\n */\nfunction startsWith<P extends string>(value: string, prefix: P): value is `${P}${string}` {\n return value.startsWith(prefix)\n}\n\n/**\n * Checks if a property name is a CSS custom property (variable).\n */\nexport function isCssVariableName(key: string): key is CssVar {\n return startsWith(key, '--')\n}\n\n/**\n * Converts a CSS-like value to a string for use as a CSS variable value.\n * @param value - The value to convert (string, number, or wrapped value)\n * @returns The string representation\n */\nexport function asVar(value: CssLike<string | number>): string {\n switch (typeof value) {\n case 'string': return value\n case 'number': return `${value}`\n default: return asVar(value.value)\n }\n}\n\n/**\n * Checks if a property name is a known CSS property.\n */\nexport function isKnownPropertyName(key: string): key is keyof Props {\n return knownPropertySet.has(key)\n}\n\n/**\n * Converts a value to a CSS property string using the appropriate parser.\n * Uses specialized parsers for properties with unit requirements (lengths, colors).\n * @param value - The value to convert\n * @param key - The CSS property name\n * @returns The formatted CSS value string\n */\nexport function asKnownProp(value: any, key: keyof Props): string {\n const parser: ((v: any, k: string) => string) | undefined = key in styles ? styles[key as keyof typeof styles] : undefined\n if (!parser) return asEnum(value)\n return parser(value, key)\n}\n\n/**\n * Checks if a key represents a nested CSS selector.\n */\n//TODO: make better validation, provide human readable errors\nexport function isNestedSelector(key: string): key is NestedCssSelector {\n return key.includes(\"&\")\n}\n\n/**\n * Checks if a key represents a media query.\n */\n//TODO: make better validation, provide human readable errors\nexport function isMediaSelector(key: string): key is MediaSelector {\n return key.startsWith(\"@\")\n}\n\n/** A nested CSS selector pattern containing the parent reference `&` */\nexport type NestedCssSelector = `${string}&${string}`\n\n/** A CSS media query starting with `@` */\nexport type MediaSelector = `@${string}`\n\ntype NestedStyleKeys = MediaSelector | NestedCssSelector\n\n/**\n * Style properties without nesting support.\n * Includes all standard CSS properties with type-safe value converters,\n * plus CSS custom properties (variables).\n */\nexport type SimpleStyleProps\n = { [K in keyof typeof styles]?: Parameters<(typeof styles)[K]>[0] }\n & { [K in Exclude<keyof Props, keyof typeof styles>]?: CssLike<Props[K]> }\n & { [K in CssVar]?: Parameters<(typeof asVar)>[0] }\n\n/**\n * Full style properties type with support for nested selectors and media queries.\n * Extends SimpleStyleProps to allow recursive style definitions.\n *\n * @example\n * const styles: StyleProps = {\n * color: 'blue',\n * padding: 16,\n * '&:hover': { color: 'red' },\n * '@min-width: 768px': { padding: 24 }\n * }\n */\nexport type StyleProps = SimpleStyleProps & { [K in NestedStyleKeys]?: StyleProps | CssLike<string | number> }\n\n/**\n * Converts a camelCase string to kebab-case.\n */\nexport function camelToKebab(str: string): string {\n return str.replace(/[A-Z]/g, m => \"-\" + m.toLowerCase())\n}\n\n/**\n * Converts a kebab-case string to camelCase.\n */\nexport function kebabToCamel(str: string): string {\n return str.replace(/-[a-z]/g, m => m.substring(1).toUpperCase())\n}\n\n/**\n * Converts a SimpleStyleProps object to a CSS properties record.\n * Transforms camelCase property names to kebab-case and applies value converters.\n * @param props - The style properties object\n * @returns A record of CSS property names (kebab-case) to string values\n * @example\n * cssFromProps({ backgroundColor: 'blue', padding: 16 })\n * // { 'background-color': 'blue', 'padding': '16px' }\n */\nexport function cssFromProps(props: SimpleStyleProps): Record<string, string> {\n return Object.fromEntries(Object.entries(props).map(([key, value]) => {\n if (value === undefined) return undefined\n // transform variable\n if (isCssVariableName(key)) return [key, asVar(value as CssLike<string | number>)]\n // transform CSS prop\n if (isKnownPropertyName(key)) return [camelToKebab(key), asKnownProp(value, key)]\n return undefined\n }).filter(v => v !== undefined))\n}\n","/**\n * CSS selector building and manipulation utilities.\n * Handles nested selectors (using `&` placeholder) and media queries.\n * @module selector\n */\n\nimport {isMediaSelector, isNestedSelector} from \"@/props\";\n\n/**\n * Immutable CSS selector builder that handles nested selectors and media queries.\n * Uses the `&` character as a placeholder for parent selector substitution.\n *\n * @example\n * const selector = new MochiSelector(['.button'])\n * selector.extend('&:hover').cssSelector // '.button:hover'\n * selector.wrap('@media (min-width: 768px)').mediaQuery // '@media (min-width: 768px)'\n */\nexport class MochiSelector {\n /**\n * Creates a new MochiSelector instance.\n * @param cssSelectors - Array of CSS selectors (may contain `&` placeholders)\n * @param mediaSelectors - Array of media query conditions (without `@media` prefix)\n */\n constructor(\n private readonly cssSelectors: string[] = [],\n private readonly mediaSelectors: string[] = []\n ) {}\n\n /**\n * Gets the combined CSS selector string.\n * Multiple selectors are joined with commas.\n * @returns The CSS selector, or \"*\" if no selectors are defined\n */\n get cssSelector(): string {\n if (this.cssSelectors.length === 0) return \"*\"\n return this.cssSelectors.join(\", \")\n }\n\n /**\n * Gets the combined media query string, if any.\n * @returns The full `@media` query string, or undefined if no media conditions\n */\n get mediaQuery(): string | undefined {\n if (this.mediaSelectors.length === 0) return undefined\n return `@media ${this.mediaSelectors.map(s => `(${s})`).join(\" and \")}`\n }\n\n /**\n * Substitutes all `&` placeholders with the given root selector.\n * @param root - The selector to replace `&` with\n * @returns A new MochiSelector with substituted selectors\n */\n substitute(root: string): MochiSelector {\n return new MochiSelector(\n this.cssSelectors.map(selector => selector.replace(/&/g, root)),\n this.mediaSelectors\n )\n }\n\n /**\n * Extends this selector by nesting a child selector.\n * The `&` in the child selector is replaced with each parent selector.\n * @param child - The child selector pattern (must contain `&`)\n * @returns A new MochiSelector with the extended selectors\n * @example\n * new MochiSelector(['.btn']).extend('&:hover') // '.btn:hover'\n * new MochiSelector(['.btn']).extend('& .icon') // '.btn .icon'\n */\n extend(child: string): MochiSelector {\n if (!isNestedSelector(child)) return this\n const children = MochiSelector.split(child)\n const selectors = this.cssSelectors.flatMap(parentSelector => children.map(childSelector => {\n return childSelector.replace(/&/g, parentSelector)\n }))\n return new MochiSelector(selectors, this.mediaSelectors)\n }\n\n /**\n * Wraps this selector with a media query condition.\n * @param mediaQuery - The media query string (starting with `@`)\n * @returns A new MochiSelector with the added media condition\n * @example\n * selector.wrap('@min-width: 768px') // Adds media query condition\n */\n wrap(mediaQuery: string): MochiSelector {\n if (!isMediaSelector(mediaQuery)) return this\n const mediaQueryPart = mediaQuery.substring(1)\n return new MochiSelector(this.cssSelectors, [...this.mediaSelectors, mediaQueryPart])\n }\n\n /**\n * Splits a comma-separated selector string into individual selectors.\n * @param selector - The selector string to split\n * @returns Array of individual selector strings\n */\n private static split(selector: string): string[] {\n return [selector]\n }\n}\n","/**\n * Hashing utilities for generating short, deterministic class names.\n * Uses djb2 algorithm for fast string hashing.\n * @module hash\n */\n\n/** Characters used for base-62 encoding (css-name safe variant of base-64) */\nconst hashBase = \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_\";\nconst base = hashBase.length\n\n/**\n * Converts a number to a base-62 string representation.\n * @param num - The number to convert\n * @param maxLength - Optional maximum length of the output string\n * @returns Base-62 encoded string representation of the number\n */\nexport function numberToBase62(num: number, maxLength?: number): string {\n let out = \"\"\n while (num > 0 && out.length < (maxLength ?? Infinity)) {\n out = hashBase[num % base] + out\n num = Math.floor(num / base)\n }\n return out.length > 0 ? out : \"0\"\n}\n\n/**\n * Generates a short hash string from input using the djb2 algorithm.\n * Used to create unique, deterministic CSS class names from style content.\n * @param input - The string to hash\n * @param length - Maximum length of the hash output (default: 8)\n * @returns A short, css-safe hash string\n * @example\n * shortHash(\"color: red;\") // Returns something like \"A1b2C3d4\"\n */\nexport function shortHash(input: string, length = 8): string {\n // fast 32-bit integer hash (djb2 variant)\n let h = 5381\n for (let i = 0; i < input.length; i++) {\n h = (h * 33) ^ input.charCodeAt(i)\n }\n // force unsigned\n h >>>= 0\n\n return numberToBase62(h, length)\n}\n","/**\n * String comparison utilities for deterministic sorting.\n * Used internally to ensure consistent CSS output order.\n * @module compare\n */\n\n/**\n * Compares two strings lexicographically.\n */\nexport function compareString<T extends string>(a: T, b: T) {\n return a < b ? -1 : a === b ? 0 : 1\n}\n\n/**\n * Compares two tuples by their first element (string key).\n * Useful for sorting Object.entries() results.\n */\nexport function compareStringKey<T extends [string, any]>(a: T, b: T) {\n return compareString(a[0], b[0])\n}\n\n/**\n * Creates a comparator function for objects with a specific string property.\n * @param name - The property name to compare by\n * @returns A comparator function that compares objects by the specified property\n * @example\n * const items = [{ key: 'b' }, { key: 'a' }]\n * items.sort(stringPropComparator('key')) // [{ key: 'a' }, { key: 'b' }]\n */\nexport function stringPropComparator<N extends string>(name: N) {\n return <T extends { [K in N]: string }>(a: T, b: T) => compareString(a[name], b[name])\n}\n","/**\n * CSS object model for representing and serializing styles.\n * Converts JavaScript style objects into CSS blocks with proper\n * selector handling, nesting support, and deterministic output.\n * @module cssObject\n */\n\nimport {\n asKnownProp,\n asVar,\n camelToKebab,\n isCssVariableName,\n isKnownPropertyName,\n isMediaSelector,\n isNestedSelector,\n StyleProps\n} from \"@/props\";\nimport {shortHash} from \"@/hash\";\nimport {MochiSelector} from \"@/selector\";\nimport {compareStringKey, stringPropComparator} from \"@/compare\";\n\n/**\n * Represents a single CSS rule block with properties and a selector.\n * Handles conversion to CSS string format and hash generation.\n */\nexport class CssObjectSubBlock {\n /**\n * Creates a new CSS sub-block.\n * @param cssProps - Map of CSS property names (kebab-case) to values\n * @param selector - The selector this block applies to\n */\n constructor(\n public readonly cssProps: Record<string, string>,\n public readonly selector: MochiSelector\n ) {}\n\n /**\n * Computes a deterministic hash of this block's CSS content.\n * Used for generating unique class names.\n */\n get hash(): string {\n const str = this.asCssString(\"&\")\n return shortHash(str)\n }\n\n /**\n * Converts this block to a CSS string.\n * Handles media query wrapping if the selector has media conditions.\n * @param root - The root selector to substitute for `&`\n * @returns Formatted CSS string\n */\n asCssString(root: string): string {\n const selector = this.selector.substitute(root)\n const mediaQuery = selector.mediaQuery\n\n const mediaIndent = mediaQuery === undefined ? \"\" : \" \"\n\n const props = Object.entries(this.cssProps)\n .toSorted(compareStringKey)\n .map(([k, v]) => `${mediaIndent} ${k}: ${v};\\n`)\n .join('')\n\n const blockCss = `${mediaIndent}${selector.cssSelector} {\\n${props}${mediaIndent}}`\n\n return mediaQuery === undefined ? blockCss : `${mediaQuery} {\\n${blockCss}\\n}`\n }\n\n /**\n * Parses StyleProps into an array of CSS sub-blocks.\n * Recursively processes nested selectors and media queries.\n * Output order is deterministic for consistent hash generation.\n *\n * @param props - The style properties to parse\n * @param selector - The parent selector context (defaults to `&`)\n * @returns Non-empty array of sub-blocks (main block first, then nested)\n */\n static fromProps(props: StyleProps, selector?: MochiSelector): [CssObjectSubBlock, ...CssObjectSubBlock[]] {\n selector ??= new MochiSelector([\"&\"])\n\n const cssProps: Record<string, string> = {}\n const propsToProcess: { key: string, selector: MochiSelector, props: StyleProps }[] = []\n\n for (const [key, value] of Object.entries(props)) {\n // skip undefined value\n if (value === undefined) continue\n\n // transform variable\n if (isCssVariableName(key)) {\n cssProps[key] = asVar(value as StyleProps[typeof key] & {})\n continue\n }\n\n // transform known CSS prop\n if (isKnownPropertyName(key)) {\n cssProps[camelToKebab(key)] = asKnownProp(value, key)\n continue\n }\n\n // transform nested and media selectors\n if (isNestedSelector(key)) {\n propsToProcess.push({\n key,\n props: value as StyleProps,\n selector: selector.extend(key)\n })\n continue\n }\n\n // transform media selector\n if (isMediaSelector(key)) {\n propsToProcess.push({\n key,\n props: value as StyleProps,\n selector: selector.wrap(key)\n })\n }\n }\n\n return [\n new CssObjectSubBlock(cssProps, selector),\n ...propsToProcess\n .toSorted(stringPropComparator(\"key\"))\n .flatMap(({ props, selector }) =>\n CssObjectSubBlock.fromProps(props, selector)\n )\n ] as const\n }\n}\n\n/**\n * Represents an abstract CSS block definition.\n * Contains one or more sub-blocks for nested selectors and media queries.\n */\nexport class CssObjectBlock {\n /** The generated unique class name for this block */\n public readonly className: string\n /** All sub-blocks (main styles and nested/media rules) */\n public readonly subBlocks: CssObjectSubBlock[] = []\n\n /**\n * Creates a new CSS block from style properties.\n * Generates a unique class name based on the content hash.\n * @param styles - The style properties to compile\n */\n constructor(\n styles: StyleProps\n ) {\n const blocks = CssObjectSubBlock.fromProps(styles)\n\n this.className = \"c\" + shortHash(blocks.map(b => b.hash).join('+'))\n this.subBlocks = blocks\n }\n\n /**\n * Gets the CSS class selector for this block.\n */\n get selector(): string {\n return `.${this.className}`\n }\n\n /**\n * Converts style block to a CSS string.\n * @param root - The root selector to scope styles to\n * @returns Complete CSS string for this block\n */\n asCssString(root: string): string {\n return this.subBlocks.map(b => b.asCssString(new MochiSelector([root]).extend(`&.${this.className}`).cssSelector)).join('\\n\\n')\n }\n}\n\n/** Default type for variant definitions: maps variant names to option names to styles */\nexport type DefaultVariants = Record<string, Record<string, StyleProps>>\n\n/**\n * Refines string literal types to their proper runtime types.\n * Converts \"true\"/\"false\" strings to boolean literals.\n */\ntype RefineVariantType<T extends string> = T extends \"true\" ? true : T extends \"false\" ? false : T extends string ? T : string\n\n/**\n * Props for defining variants in a style object.\n * @template V - The variant definitions type\n */\nexport type VariantProps<V extends DefaultVariants> = {\n /** Variant definitions mapping names to options to styles */\n variants?: V\n /** Default variant selections for when not explicitly provided */\n defaultVariants?: { [K in keyof V]: (keyof V[K]) extends any ? RefineVariantType<keyof V[K] & string> : never }\n}\n\n/** Combined type for style props with optional variants */\nexport type MochiCSSProps<V extends DefaultVariants> = StyleProps & VariantProps<V>\n\n/** Utility type to override properties of A with properties of B */\ntype Override<A extends object, B extends object> = B & Omit<A, keyof B>\n\n/** Recursively merges variant types from a tuple, with later types overriding earlier */\nexport type MergeCSSVariants<V extends DefaultVariants[]> = V extends [infer V1 extends DefaultVariants, ...infer VRest extends DefaultVariants[]] ? Override<V1, MergeCSSVariants<VRest>> : {}\n\n/** Refines all values in a string record to their proper variant types */\ntype RefineVariantTypes<V extends Record<string, string>> = { [K in keyof V]: RefineVariantType<V[K]> }\n\n/** Extracts and refines variant option types from a DefaultVariants definition */\nexport type RefineVariants<T extends DefaultVariants> = RefineVariantTypes<{ [K in keyof T]: keyof T[K] & string }>\n\n/**\n * Complete CSS object representation with main and variant styles.\n *\n * @template V - The variant definitions type\n *\n * @example\n * const obj = new CSSObject({\n * color: 'blue',\n * variants: {\n * size: {\n * small: { fontSize: 12 },\n * large: { fontSize: 18 }\n * }\n * },\n * defaultVariants: { size: 'small' }\n * })\n * obj.asCssString() // Returns complete CSS with all variants\n */\nexport class CSSObject<V extends Record<string, Record<string, StyleProps>> = {}> {\n /** The main style block (non-variant styles) */\n public readonly mainBlock: CssObjectBlock\n /** Compiled blocks for each variant option */\n public readonly variantBlocks: { [K in keyof V & string]: { [I in keyof V[K] & string]: CssObjectBlock } }\n /** Default variant selections */\n public readonly variantDefaults: Partial<RefineVariants<V>>\n\n /**\n * Creates a new CSSObject from style props.\n * Compiles main styles and all variant options into CSS blocks.\n * @param props - Style properties with optional variants and defaults\n */\n public constructor(\n {variants, defaultVariants, ...props}: MochiCSSProps<V>\n ) {\n this.mainBlock = new CssObjectBlock(props)\n this.variantBlocks = {} as typeof this.variantBlocks\n this.variantDefaults = {} as typeof this.variantDefaults\n\n if (!variants) return\n for (const variantGroupName in variants) {\n this.variantBlocks[variantGroupName] = {} as typeof this.variantBlocks[keyof typeof this.variantBlocks]\n const variantGroup = variants[variantGroupName]\n for (const variantItemName in variantGroup) {\n this.variantBlocks[variantGroupName][variantItemName] = new CssObjectBlock(variantGroup[variantItemName]!)\n }\n }\n this.variantDefaults = defaultVariants!\n }\n\n /**\n * Serializes the entire CSS object to a CSS string.\n * Outputs main block first, then all variant blocks in sorted order.\n * @returns Complete CSS string ready for injection into a stylesheet\n */\n public asCssString(): string {\n return [\n this.mainBlock.asCssString(this.mainBlock.selector),\n ...Object.entries(this.variantBlocks)\n .toSorted(compareStringKey)\n .flatMap(([_, b]) => Object.entries(b).toSorted(compareStringKey))\n .map(([_, b]) => b.asCssString(this.mainBlock.selector))\n ].join('\\n\\n')\n }\n}\n","/**\n * Core CSS-in-JS runtime for generating and applying styles.\n * Provides the main `css` function and `MochiCSS` class for style management.\n * @module css\n */\n\nimport {StyleProps} from \"@/props\";\nimport clsx from \"clsx\";\nimport {CSSObject, DefaultVariants, MergeCSSVariants, MochiCSSProps, RefineVariants} from \"@/cssObject\";\n\n/**\n * Runtime representation of a CSS style definition with variant support.\n * Holds generated class names and provides methods to compute the final\n * className string based on selected variants.\n *\n * @template V - The variant definitions type mapping variant names to their options\n *\n * @example\n * const styles = MochiCSS.from(new CSSObject({\n * color: 'blue',\n * variants: { size: { small: { fontSize: 12 }, large: { fontSize: 18 } } }\n * }))\n * styles.variant({ size: 'large' }) // Returns combined class names\n */\nexport class MochiCSS<V extends Record<string, Record<string, StyleProps>> = {}> {\n /**\n * Creates a new MochiCSS instance.\n * @param classNames - Base class names to always include\n * @param variantClassNames - Mapping of variant names to option class names\n * @param defaultVariants - Default variant selections when not specified\n */\n constructor(\n public readonly classNames: string[],\n public readonly variantClassNames: { [K in keyof V]: { [P in keyof V[K]]: string } },\n public readonly defaultVariants: Partial<RefineVariants<V>>\n ) {}\n\n /**\n * Computes the final className string based on variant selections.\n * @param props - Variant selections\n * @returns Combined className string for use in components\n */\n variant(props: Partial<RefineVariants<V>>): string {\n const keys = new Set<keyof V & string>([\n ...Object.keys(props),\n ...Object.keys(this.defaultVariants)\n ].filter(k => k in this.variantClassNames))\n return clsx(this.classNames, ...keys.values().map(k => {\n const variantKey = (k in props ? props[k] : undefined) ?? this.defaultVariants[k]!\n return this.variantClassNames[k][`${variantKey}`]\n }))\n }\n\n /**\n * Creates a MochiCSS instance from a CSSObject.\n * Extracts class names from the compiled CSS blocks.\n * @template V - The variant definitions type\n * @param object - The compiled CSSObject to extract from\n * @returns A new MochiCSS instance with the extracted class names\n */\n static from<V extends Record<string, Record<string, StyleProps>> = {}>(object: CSSObject<V>): MochiCSS<V> {\n return new MochiCSS<V>(\n [object.mainBlock.className],\n Object.fromEntries(Object.entries(object.variantBlocks).map(([key, variantOptions]) => {\n return [key, Object.fromEntries(Object.entries(variantOptions).map(([optionKey, block]) => {\n return [optionKey, block.className]\n }))]\n })) as { [K in keyof V]: { [P in keyof V[K]]: string } },\n object.variantDefaults ?? {}\n )\n }\n}\n\n/**\n * Creates a CSS style definition.\n * The primary API for defining styles in Mochi-CSS.\n *\n * @template V - Tuple of variant definition types\n * @param props - One or more style objects or existing MochiCSS instances to merge\n * @returns A MochiCSS instance with all styles and variants combined\n *\n * @example\n * // Simple usage\n * const button = css({ padding: 8, borderRadius: 4 })\n *\n * @example\n * // With variants\n * const button = css({\n * padding: 8,\n * variants: {\n * size: {\n * small: { padding: 4 },\n * large: { padding: 16 }\n * }\n * },\n * defaultVariants: { size: 'small' }\n * })\n * button.variant({ size: 'large' }) // Get class names for large size\n *\n * @example\n * // Merging multiple styles\n * const combined = css(baseStyles, additionalStyles)\n */\nexport function css<V extends DefaultVariants[]>(...props: { [K in keyof V]: MochiCSSProps<V[K]> | MochiCSS }): MochiCSS<MergeCSSVariants<V>>\n{\n const cssToMerge: MochiCSS<DefaultVariants>[] = props.map(p => {\n if (p instanceof MochiCSS) return p\n return MochiCSS.from(new CSSObject<DefaultVariants>(p))\n })\n\n return new MochiCSS<DefaultVariants>(\n cssToMerge.flatMap(css => css.classNames),\n cssToMerge.reduce((a, b) => Object.assign(a, b.variantClassNames), {}),\n cssToMerge.reduce((a, b) => Object.assign(a, b.defaultVariants), {})\n ) as MochiCSS<MergeCSSVariants<V>>\n}\n","/**\n * React styled component utilities.\n * Creates styled components with CSS-in-JS support and variant props.\n * @module styled\n */\n\nimport {ComponentProps, ComponentType, createElement, FC, HTMLElementType} from \"react\";\nimport {css} from \"@/css\";\nimport clsx from \"clsx\";\nimport {DefaultVariants, MergeCSSVariants, MochiCSSProps, RefineVariants} from \"@/cssObject\";\n\n/** Props added by MochiCSS to styled components */\ntype MochiProps<V extends DefaultVariants[]> = {\n className?: string\n} & Partial<RefineVariants<MergeCSSVariants<V>>>\n\n/** Minimal interface for components that accept className */\ntype Cls = { className?: string }\n\n/**\n * Creates a styled React component with CSS-in-JS support and variant props.\n * Similar to styled-components or Stitches, but with zero runtime overhead.\n *\n * @template T - The base element type or component type\n * @template V - The variant definitions tuple type\n * @param target - The HTML element tag name or React component to style\n * @param props - One or more style objects with optional variants\n * @returns A React functional component with merged props and variant support\n *\n * @example\n * const Button = styled('button', {\n * padding: 8,\n * borderRadius: 4,\n * variants: {\n * size: {\n * small: { padding: 4 },\n * large: { padding: 16 }\n * },\n * variant: {\n * primary: { backgroundColor: 'blue' },\n * secondary: { backgroundColor: 'gray' }\n * }\n * }\n * })\n *\n * // Usage: <Button size=\"large\" variant=\"primary\">Click me</Button>\n */\n//TODO: Move to dedicated \"styled\" package\nexport function styled<T extends HTMLElementType | ComponentType<Cls>, V extends DefaultVariants[]>(target: T, ...props: { [K in keyof V]: MochiCSSProps<V[K]> }): FC<Omit<ComponentProps<T>, keyof MochiProps<V>> & MochiProps<V>>\n{\n const styles = css<V>(...props)\n return ({ className, ...p }: Omit<ComponentProps<T>, keyof MochiProps<V>> & MochiProps<V>) =>\n //TODO: omit variant props in p\n createElement(target, { className: clsx(styles.variant(p as any), className), ...p })\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAa,eAAb,MAA6D;CACzD,YACI,AAAiBA,OACjB,AAAiBC,QACnB;EAFmB;EACA;;CAGrB,WAA4B;AACxB,SAAO,GAAG,KAAK,QAAQ,KAAK;;;;;;ACNpC,IAAa,aAAb,cAAgC,aAAmB;CAC/C,YAAY,OAAe;AAAE,QAAM,OAAO,KAAK;;;AAGnD,IAAa,eAAb,cAAkC,aAAkB;CAChD,YAAY,OAAe;AAAE,QAAM,OAAO,IAAI;;;AAQlD,SAAgB,SAAS,OAAuC;AAC5D,SAAQ,OAAO,OAAf;EACI,KAAK,SAAU,QAAO,GAAG,MAAM;EAC/B,KAAK,SAAU,QAAO;EACtB,QAAS,QAAO,SAAS,MAAM,MAAM;;;;;;ACP7C,SAAgB,QAAQ,OAA+B;AACnD,KAAI,OAAO,UAAU,SAAU,QAAO;AACtC,QAAO,MAAM;;;;;;;;;;;;;;ACCjB,IAAa,QAAb,MAAsB;;;;;CAKlB,YAAY,AAAgBC,MAAc;EAAd;;;;;;CAM5B,IAAI,WAAmB;AACnB,SAAO,KAAK,KAAK;;;;;;CAOrB,IAAI,QAAmB;AACnB,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QAAO,IAAI,SACP,WAAW,SAAQ,UAAOC,MAAI,WAAW,EACzC,WAAW,QAAQ,GAAG,MAAM,OAAO,OAAO,GAAG,EAAE,kBAAkB,EAAE,EAAE,CAAC,EACtE,WAAW,QAAQ,GAAG,MAAM,OAAO,OAAO,GAAG,EAAE,gBAAgB,EAAE,EAAE,CAAC,CACvE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AClEL,SAAgB,OAAoF,QAAW,GAAG,OAClH;CACI,MAAMC,WAAS,IAAO,GAAG,MAAM;AAC/B,SAAQ,EAAE,UAAW,GAAG,iCAEN,QAAQ;EAAE,6BAAgBA,SAAO,QAAQ,EAAS,EAAE,UAAU;EAAE,GAAG;EAAG,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["name: string","properties","cssSelectors: string[]","mediaSelectors: string[]","cssProps: Record<string, string>","selector: MochiSelector","propsToProcess: { key: string; selector: MochiSelector; props: StyleProps }[]","props","selector","classNames: string[]","variantClassNames: { [K in keyof V]: { [P in keyof V[K]]: string } }","defaultVariants: Partial<RefineVariants<V>>","cssToMerge: MochiCSS<AllVariants>[]","css","name: string"],"sources":["../src/token.ts","../src/propertyUnits.generated.ts","../src/props.ts","../src/selector.ts","../src/hash.ts","../src/compare.ts","../src/cssObject.ts","../src/css.ts","../src/styled.ts","../src/keyframesObject.ts","../src/keyframes.ts"],"sourcesContent":["/**\n * CSS custom property (design token) utilities.\n * Provides type-safe access to CSS variables with proper `var()` syntax.\n * @module token\n */\n\nimport { CssVar, CssVarVal } from \"@/values\"\n\n/**\n * Represents a CSS custom property (design token) with type information.\n * Provides convenient access to both the variable name and its `var()` reference.\n * @template T - The expected value type of the token (for type checking)\n * @example\n * const primaryColor = new Token<string>('primary-color')\n * primaryColor.variable // '--primary-color'\n * primaryColor.value // 'var(--primary-color)'\n */\nexport class Token {\n /**\n * Creates a new CSS token.\n * @param name - The token name (without the `--` prefix)\n */\n constructor(public readonly name: string) {}\n\n /**\n * Gets the CSS custom property name (with `--` prefix).\n * Use this when defining the variable.\n */\n get variable(): CssVar {\n return `--${this.name}`\n }\n\n /**\n * Gets the CSS `var()` reference to this token.\n * Use this when consuming the variable value.\n */\n get value(): CssVarVal {\n return `var(${this.variable})`\n }\n\n /**\n * Returns the variable name for string coercion.\n */\n toString(): CssVar {\n return this.variable\n }\n}\n\n/**\n * Creates a new CSS design token.\n * @template T - The expected value type of the token\n * @param name - The token name (without the `--` prefix)\n * @returns A new Token instance\n * @example\n * const spacing = createToken<number>('spacing-md')\n * // Use in styles: { gap: spacing.value }\n */\nexport function createToken(name: string): Token {\n return new Token(name)\n}\n","// Auto-generated from @webref/css - do not edit manually\n// Run \"yarn build\" to regenerate\n\nexport const propertyUnits = {\n animation: \"ms\",\n animationDelay: \"ms\",\n animationDuration: \"ms\",\n animationRange: \"px\",\n animationRangeCenter: \"px\",\n animationRangeEnd: \"px\",\n animationRangeStart: \"px\",\n background: \"px\",\n backgroundPosition: \"px\",\n backgroundPositionBlock: \"px\",\n backgroundPositionInline: \"px\",\n backgroundPositionX: \"px\",\n backgroundPositionY: \"px\",\n backgroundSize: \"px\",\n backgroundTbd: \"px\",\n baselineShift: \"px\",\n blockSize: \"px\",\n blockStep: \"px\",\n blockStepSize: \"px\",\n border: \"px\",\n borderBlock: \"px\",\n borderBlockClip: \"px\",\n borderBlockEnd: \"px\",\n borderBlockEndClip: \"px\",\n borderBlockEndRadius: \"px\",\n borderBlockEndWidth: \"px\",\n borderBlockStart: \"px\",\n borderBlockStartClip: \"px\",\n borderBlockStartRadius: \"px\",\n borderBlockStartWidth: \"px\",\n borderBlockWidth: \"px\",\n borderBottom: \"px\",\n borderBottomClip: \"px\",\n borderBottomLeftRadius: \"px\",\n borderBottomRadius: \"px\",\n borderBottomRightRadius: \"px\",\n borderBottomWidth: \"px\",\n borderClip: \"px\",\n borderEndEndRadius: \"px\",\n borderEndStartRadius: \"px\",\n borderImage: \"%\",\n borderImageOutset: \"px\",\n borderImageSlice: \"%\",\n borderImageWidth: \"px\",\n borderInline: \"px\",\n borderInlineClip: \"px\",\n borderInlineEnd: \"px\",\n borderInlineEndClip: \"px\",\n borderInlineEndRadius: \"px\",\n borderInlineEndWidth: \"px\",\n borderInlineStart: \"px\",\n borderInlineStartClip: \"px\",\n borderInlineStartRadius: \"px\",\n borderInlineStartWidth: \"px\",\n borderInlineWidth: \"px\",\n borderLeft: \"px\",\n borderLeftClip: \"px\",\n borderLeftRadius: \"px\",\n borderLeftWidth: \"px\",\n borderLimit: \"px\",\n borderRadius: \"px\",\n borderRight: \"px\",\n borderRightClip: \"px\",\n borderRightRadius: \"px\",\n borderRightWidth: \"px\",\n borderSpacing: \"px\",\n borderStartEndRadius: \"px\",\n borderStartStartRadius: \"px\",\n borderTop: \"px\",\n borderTopClip: \"px\",\n borderTopLeftRadius: \"px\",\n borderTopRadius: \"px\",\n borderTopRightRadius: \"px\",\n borderTopWidth: \"px\",\n borderWidth: \"px\",\n bottom: \"px\",\n boxShadow: \"px\",\n boxShadowBlur: \"px\",\n boxShadowOffset: \"px\",\n boxShadowSpread: \"px\",\n columnGap: \"px\",\n columnHeight: \"px\",\n columnRule: \"px\",\n columnRuleEdgeInset: \"px\",\n columnRuleEdgeInsetEnd: \"px\",\n columnRuleEdgeInsetStart: \"px\",\n columnRuleInset: \"px\",\n columnRuleInsetEnd: \"px\",\n columnRuleInsetStart: \"px\",\n columnRuleInteriorInset: \"px\",\n columnRuleInteriorInsetEnd: \"px\",\n columnRuleInteriorInsetStart: \"px\",\n columnRuleWidth: \"px\",\n columns: \"px\",\n columnWidth: \"px\",\n containIntrinsicBlockSize: \"px\",\n containIntrinsicHeight: \"px\",\n containIntrinsicInlineSize: \"px\",\n containIntrinsicSize: \"px\",\n containIntrinsicWidth: \"px\",\n corner: \"px\",\n cornerBlockEnd: \"px\",\n cornerBlockStart: \"px\",\n cornerBottom: \"px\",\n cornerBottomLeft: \"px\",\n cornerBottomRight: \"px\",\n cornerEndEnd: \"px\",\n cornerEndStart: \"px\",\n cornerInlineEnd: \"px\",\n cornerInlineStart: \"px\",\n cornerLeft: \"px\",\n cornerRight: \"px\",\n cornerStartEnd: \"px\",\n cornerStartStart: \"px\",\n cornerTop: \"px\",\n cornerTopLeft: \"px\",\n cornerTopRight: \"px\",\n cx: \"px\",\n cy: \"px\",\n fillOpacity: \"%\",\n fillPosition: \"px\",\n fillSize: \"px\",\n flex: \"px\",\n flexBasis: \"px\",\n floatOffset: \"px\",\n floodOpacity: \"%\",\n flowTolerance: \"px\",\n font: \"deg\",\n fontSize: \"px\",\n fontStretch: \"%\",\n fontStyle: \"deg\",\n fontWidth: \"%\",\n gap: \"px\",\n grid: \"px\",\n gridAutoColumns: \"px\",\n gridAutoRows: \"px\",\n gridColumnGap: \"px\",\n gridGap: \"px\",\n gridRowGap: \"px\",\n gridTemplate: \"px\",\n gridTemplateColumns: \"px\",\n gridTemplateRows: \"px\",\n height: \"px\",\n hyphenateLimitZone: \"px\",\n imageOrientation: \"deg\",\n imageResolution: \"dppx\",\n initialLetterWrap: \"px\",\n inlineSize: \"px\",\n inset: \"px\",\n insetBlock: \"px\",\n insetBlockEnd: \"px\",\n insetBlockStart: \"px\",\n insetInline: \"px\",\n insetInlineEnd: \"px\",\n insetInlineStart: \"px\",\n interestDelay: \"ms\",\n interestDelayEnd: \"ms\",\n interestDelayStart: \"ms\",\n itemFlow: \"px\",\n left: \"px\",\n letterSpacing: \"px\",\n lineHeight: \"px\",\n lineHeightStep: \"px\",\n linePadding: \"px\",\n margin: \"px\",\n marginBlock: \"px\",\n marginBlockEnd: \"px\",\n marginBlockStart: \"px\",\n marginBottom: \"px\",\n marginInline: \"px\",\n marginInlineEnd: \"px\",\n marginInlineStart: \"px\",\n marginLeft: \"px\",\n marginRight: \"px\",\n marginTop: \"px\",\n mask: \"px\",\n maskBorder: \"%\",\n maskBorderOutset: \"px\",\n maskBorderSlice: \"%\",\n maskBorderWidth: \"px\",\n maskPosition: \"px\",\n maskSize: \"px\",\n maxBlockSize: \"px\",\n maxHeight: \"px\",\n maxInlineSize: \"px\",\n maxWidth: \"px\",\n minBlockSize: \"px\",\n minHeight: \"px\",\n minInlineSize: \"px\",\n minWidth: \"px\",\n objectPosition: \"px\",\n offset: \"px\",\n offsetAnchor: \"px\",\n offsetDistance: \"px\",\n offsetPosition: \"px\",\n offsetRotate: \"deg\",\n opacity: \"%\",\n outline: \"px\",\n outlineOffset: \"px\",\n outlineWidth: \"px\",\n overflowClipMargin: \"px\",\n overflowClipMarginBlock: \"px\",\n overflowClipMarginBlockEnd: \"px\",\n overflowClipMarginBlockStart: \"px\",\n overflowClipMarginBottom: \"px\",\n overflowClipMarginInline: \"px\",\n overflowClipMarginInlineEnd: \"px\",\n overflowClipMarginInlineStart: \"px\",\n overflowClipMarginLeft: \"px\",\n overflowClipMarginRight: \"px\",\n overflowClipMarginTop: \"px\",\n padding: \"px\",\n paddingBlock: \"px\",\n paddingBlockEnd: \"px\",\n paddingBlockStart: \"px\",\n paddingBottom: \"px\",\n paddingInline: \"px\",\n paddingInlineEnd: \"px\",\n paddingInlineStart: \"px\",\n paddingLeft: \"px\",\n paddingRight: \"px\",\n paddingTop: \"px\",\n pause: \"ms\",\n pauseAfter: \"ms\",\n pauseBefore: \"ms\",\n perspective: \"px\",\n perspectiveOrigin: \"px\",\n r: \"px\",\n rest: \"ms\",\n restAfter: \"ms\",\n restBefore: \"ms\",\n right: \"px\",\n rotate: \"deg\",\n rowGap: \"px\",\n rowRule: \"px\",\n rowRuleEdgeInset: \"px\",\n rowRuleEdgeInsetEnd: \"px\",\n rowRuleEdgeInsetStart: \"px\",\n rowRuleInset: \"px\",\n rowRuleInsetEnd: \"px\",\n rowRuleInsetStart: \"px\",\n rowRuleInteriorInset: \"px\",\n rowRuleInteriorInsetEnd: \"px\",\n rowRuleInteriorInsetStart: \"px\",\n rowRuleWidth: \"px\",\n rule: \"px\",\n ruleEdgeInset: \"px\",\n ruleInset: \"px\",\n ruleInsetEnd: \"px\",\n ruleInsetStart: \"px\",\n ruleInteriorInset: \"px\",\n ruleWidth: \"px\",\n rx: \"px\",\n ry: \"px\",\n scale: \"%\",\n scrollMargin: \"px\",\n scrollMarginBlock: \"px\",\n scrollMarginBlockEnd: \"px\",\n scrollMarginBlockStart: \"px\",\n scrollMarginBottom: \"px\",\n scrollMarginInline: \"px\",\n scrollMarginInlineEnd: \"px\",\n scrollMarginInlineStart: \"px\",\n scrollMarginLeft: \"px\",\n scrollMarginRight: \"px\",\n scrollMarginTop: \"px\",\n scrollPadding: \"px\",\n scrollPaddingBlock: \"px\",\n scrollPaddingBlockEnd: \"px\",\n scrollPaddingBlockStart: \"px\",\n scrollPaddingBottom: \"px\",\n scrollPaddingInline: \"px\",\n scrollPaddingInlineEnd: \"px\",\n scrollPaddingInlineStart: \"px\",\n scrollPaddingLeft: \"px\",\n scrollPaddingRight: \"px\",\n scrollPaddingTop: \"px\",\n shapeImageThreshold: \"%\",\n shapeMargin: \"px\",\n shapePadding: \"px\",\n stopOpacity: \"%\",\n strokeDasharray: \"px\",\n strokeDashcorner: \"px\",\n strokeDashCorner: \"px\",\n strokeDashoffset: \"px\",\n strokeOpacity: \"%\",\n strokePosition: \"px\",\n strokeSize: \"px\",\n strokeWidth: \"px\",\n tabSize: \"px\",\n textDecoration: \"px\",\n textDecorationInset: \"px\",\n textDecorationThickness: \"px\",\n textIndent: \"px\",\n textShadow: \"px\",\n textSizeAdjust: \"%\",\n textUnderlineOffset: \"px\",\n timelineTrigger: \"px\",\n timelineTriggerExitRange: \"px\",\n timelineTriggerExitRangeEnd: \"px\",\n timelineTriggerExitRangeStart: \"px\",\n timelineTriggerRange: \"px\",\n timelineTriggerRangeEnd: \"px\",\n timelineTriggerRangeStart: \"px\",\n top: \"px\",\n transformOrigin: \"px\",\n transition: \"ms\",\n transitionDelay: \"ms\",\n transitionDuration: \"ms\",\n translate: \"px\",\n verticalAlign: \"px\",\n viewTimeline: \"px\",\n viewTimelineInset: \"px\",\n voiceDuration: \"ms\",\n voicePitch: \"Hz\",\n voiceRange: \"Hz\",\n voiceRate: \"%\",\n width: \"px\",\n wordSpacing: \"px\",\n x: \"px\",\n y: \"px\",\n zoom: \"%\",\n} as const\n\nexport type PropertyWithUnit = keyof typeof propertyUnits\n","/**\n * CSS property handling and type definitions.\n * Provides type-safe mappings from JavaScript objects to CSS properties,\n * with automatic unit conversion and value formatting.\n * @module props\n */\n\nimport { Properties, ObsoleteProperties } from \"csstype\"\nimport { CssLike, CssVar } from \"@/values\"\nimport properties from \"known-css-properties\"\nimport { propertyUnits, type PropertyWithUnit } from \"./propertyUnits.generated\"\n\n/** All non-obsolete CSS properties from csstype */\ntype Props = Required<Omit<Properties, keyof ObsoleteProperties>>\n\n/** Properties that have default units and are valid CSS properties */\ntype PropsWithUnit = PropertyWithUnit & keyof Props\n\n/**\n * Converts a kebab-case string to camelCase.\n */\nexport function kebabToCamel(str: string): string {\n return str.replace(/-([a-z])/g, (_, c: string) => c.toUpperCase())\n}\n\n/**\n * Converts a camelCase string to kebab-case.\n */\nexport function camelToKebab(str: string): string {\n return str.replace(/[A-Z]/g, (m) => \"-\" + m.toLowerCase())\n}\n\nfunction getUnitForProperty(propertyName: string): string | undefined {\n return propertyName in propertyUnits ? propertyUnits[propertyName as PropertyWithUnit] : undefined\n}\n\n/**\n * Converts a CSS-like value to its string representation.\n * For properties with known units, numbers are automatically suffixed.\n */\nfunction formatValue(value: CssLike<string | number>, propertyName: string, maxDepth = 10): string {\n if (maxDepth <= 0) return \"\"\n if (typeof value === \"string\") return value\n if (typeof value === \"number\") {\n const unit = getUnitForProperty(propertyName)\n if (unit === \"%\") return `${value * 100}${unit}`\n if (value === 0) return \"0\"\n return unit ? `${value}${unit}` : value.toString()\n }\n return formatValue(value.value, propertyName, maxDepth - 1)\n}\n\n//TODO: generate this list and drop known-css-properties package\nconst knownPropertySet = new Set<string>(properties.all.map(kebabToCamel))\n\n/**\n * Checks if a property name is a CSS custom property (variable).\n */\nexport function isCssVariableName(key: string): key is CssVar {\n return key.startsWith(\"--\")\n}\n\n/**\n * Converts a CSS-like value to a string for use as a CSS variable value.\n * @param value - The value to convert (string, number, or wrapped value)\n * @param maxDepth - Maximum recursion depth for evaluating the value\n * @returns The string representation\n */\nexport function asVar(value: CssLike<string | number>, maxDepth = 10): string {\n if (maxDepth <= 0) return \"\"\n switch (typeof value) {\n case \"string\":\n return value\n case \"number\":\n return value.toString()\n default:\n return asVar(value.value, maxDepth - 1)\n }\n}\n\n/**\n * Checks if a property name is a known CSS property.\n */\nexport function isKnownPropertyName(key: string): key is keyof Props {\n return knownPropertySet.has(key)\n}\n\n/**\n * Converts a value to a CSS property string.\n * Automatically appends units to numeric values for properties that require them.\n * @param value - The value to convert\n * @param key - The CSS property name\n * @returns The formatted CSS value string\n */\nexport function asKnownProp(value: unknown, key: keyof Props): string {\n return formatValue(value as CssLike<string | number>, key)\n}\n\n/**\n * Checks if a key represents a nested CSS selector.\n */\n//TODO: make better validation, provide human readable errors\nexport function isNestedSelector(key: string): key is NestedCssSelector {\n return key.includes(\"&\")\n}\n\n/**\n * Checks if a key represents a media query.\n */\n//TODO: make better validation, provide human readable errors\nexport function isMediaSelector(key: string): key is MediaSelector {\n return key.startsWith(\"@\")\n}\n\n/** A nested CSS selector pattern containing the parent reference `&` */\nexport type NestedCssSelector = `${string}&${string}`\n\n/** A CSS media query starting with `@` */\nexport type MediaSelector = `@${string}`\n\ntype NestedStyleKeys = MediaSelector | NestedCssSelector\n\n/**\n * Style properties without nesting support.\n * Includes all standard CSS properties with type-safe value converters,\n * plus CSS custom properties (variables).\n *\n * Properties with known units (e.g., width, height, padding) accept numbers\n * that are automatically converted with their default unit (e.g., px, ms).\n */\nexport type SimpleStyleProps = { [K in PropsWithUnit]?: CssLike<number | Props[K]> } & {\n [K in Exclude<keyof Props, PropsWithUnit>]?: CssLike<Props[K]>\n} & Partial<Record<CssVar, CssLike<string | number>>>\n\n/**\n * Full style properties type with support for nested selectors and media queries.\n * Extends SimpleStyleProps to allow recursive style definitions.\n *\n * @example\n * const styles: StyleProps = {\n * color: 'blue',\n * padding: 16,\n * '&:hover': { color: 'red' },\n * '@min-width: 768px': { padding: 24 }\n * }\n */\nexport type StyleProps = SimpleStyleProps & { [K in NestedStyleKeys]?: StyleProps | CssLike<string | number> }\n\n/**\n * Converts a SimpleStyleProps object to a CSS properties record.\n * Transforms camelCase property names to kebab-case and applies value converters.\n * @param props - The style properties object\n * @returns A record of CSS property names (kebab-case) to string values\n * @example\n * cssFromProps({ backgroundColor: 'blue', padding: 16 })\n * // { 'background-color': 'blue', 'padding': '16px' }\n */\nexport function cssFromProps(props: SimpleStyleProps): Record<string, string> {\n return Object.fromEntries(\n Object.entries(props)\n .map(([key, value]): [string, string] | undefined => {\n if (value === undefined) return undefined\n // transform variable\n if (isCssVariableName(key)) return [key, asVar(value as CssLike<string | number>)]\n // transform CSS prop\n if (isKnownPropertyName(key)) return [camelToKebab(key), asKnownProp(value, key)]\n return undefined\n })\n .filter((v) => v !== undefined),\n )\n}\n","/**\n * CSS selector building and manipulation utilities.\n * Handles nested selectors (using `&` placeholder) and media queries.\n * @module selector\n */\n\nimport { isMediaSelector, isNestedSelector } from \"@/props\"\n\n/**\n * Immutable CSS selector builder that handles nested selectors and media queries.\n * Uses the `&` character as a placeholder for parent selector substitution.\n *\n * @example\n * const selector = new MochiSelector(['.button'])\n * selector.extend('&:hover').cssSelector // '.button:hover'\n * selector.wrap('@media (min-width: 768px)').mediaQuery // '@media (min-width: 768px)'\n */\nexport class MochiSelector {\n /**\n * Creates a new MochiSelector instance.\n * @param cssSelectors - Array of CSS selectors (may contain `&` placeholders)\n * @param mediaSelectors - Array of media query conditions (without `@media` prefix)\n */\n constructor(\n private readonly cssSelectors: string[] = [],\n private readonly mediaSelectors: string[] = [],\n ) {}\n\n /**\n * Gets the combined CSS selector string.\n * Multiple selectors are joined with commas.\n * @returns The CSS selector, or \"*\" if no selectors are defined\n */\n get cssSelector(): string {\n if (this.cssSelectors.length === 0) return \"*\"\n return this.cssSelectors.join(\", \")\n }\n\n /**\n * Gets the combined media query string, if any.\n * @returns The full `@media` query string, or undefined if no media conditions\n */\n get mediaQuery(): string | undefined {\n if (this.mediaSelectors.length === 0) return undefined\n return `@media ${this.mediaSelectors.map((s) => `(${s})`).join(\" and \")}`\n }\n\n /**\n * Substitutes all `&` placeholders with the given root selector.\n * @param root - The selector to replace `&` with\n * @returns A new MochiSelector with substituted selectors\n */\n substitute(root: string): MochiSelector {\n return new MochiSelector(\n this.cssSelectors.map((selector) => selector.replace(/&/g, root)),\n this.mediaSelectors,\n )\n }\n\n /**\n * Extends this selector by nesting a child selector.\n * The `&` in the child selector is replaced with each parent selector.\n * @param child - The child selector pattern (must contain `&`)\n * @returns A new MochiSelector with the extended selectors\n * @example\n * new MochiSelector(['.btn']).extend('&:hover') // '.btn:hover'\n * new MochiSelector(['.btn']).extend('& .icon') // '.btn .icon'\n */\n extend(child: string): MochiSelector {\n if (!isNestedSelector(child)) return this\n const children = MochiSelector.split(child)\n const selectors = this.cssSelectors.flatMap((parentSelector) =>\n children.map((childSelector) => {\n return childSelector.replace(/&/g, parentSelector)\n }),\n )\n return new MochiSelector(selectors, this.mediaSelectors)\n }\n\n /**\n * Wraps this selector with a media query condition.\n * @param mediaQuery - The media query string (starting with `@`)\n * @returns A new MochiSelector with the added media condition\n * @example\n * selector.wrap('@min-width: 768px') // Adds media query condition\n */\n wrap(mediaQuery: string): MochiSelector {\n if (!isMediaSelector(mediaQuery)) return this\n const mediaQueryPart = mediaQuery.substring(1)\n return new MochiSelector(this.cssSelectors, [...this.mediaSelectors, mediaQueryPart])\n }\n\n /**\n * Splits a comma-separated selector string into individual selectors.\n * @param selector - The selector string to split\n * @returns Array of individual selector strings\n */\n private static split(selector: string): string[] {\n return [selector]\n }\n}\n","/**\n * Hashing utilities for generating short, deterministic class names.\n * Uses djb2 algorithm for fast string hashing.\n * @module hash\n */\n\n/** Characters used for base-62 encoding (css-name safe variant of base-64) */\nconst hashBase = \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_\"\nconst base = hashBase.length\n\n/**\n * Converts a number to a base-62 string representation.\n * @param num - The number to convert\n * @param maxLength - Optional maximum length of the output string\n * @returns Base-62 encoded string representation of the number\n */\nexport function numberToBase62(num: number, maxLength?: number): string {\n let out = \"\"\n while (num > 0 && out.length < (maxLength ?? Infinity)) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n out = hashBase[num % base]! + out\n num = Math.floor(num / base)\n }\n return out.length > 0 ? out : \"0\"\n}\n\n/**\n * Generates a short hash string from input using the djb2 algorithm.\n * Used to create unique, deterministic CSS class names from style content.\n * @param input - The string to hash\n * @param length - Maximum length of the hash output (default: 8)\n * @returns A short, css-safe hash string\n * @example\n * shortHash(\"color: red;\") // Returns something like \"A1b2C3d4\"\n */\nexport function shortHash(input: string, length = 8): string {\n // fast 32-bit integer hash (djb2 variant)\n let h = 5381\n for (let i = 0; i < input.length; i++) {\n h = (h * 33) ^ input.charCodeAt(i)\n }\n // force unsigned\n h >>>= 0\n\n return numberToBase62(h, length)\n}\n","/**\n * String comparison utilities for deterministic sorting.\n * Used internally to ensure consistent CSS output order.\n * @module compare\n */\n\n/**\n * Compares two strings lexicographically.\n */\nexport function compareString<T extends string>(a: T, b: T) {\n return a < b ? -1 : a === b ? 0 : 1\n}\n\n/**\n * Compares two tuples by their first element (string key).\n * Useful for sorting Object.entries() results.\n */\nexport function compareStringKey<T extends [string, unknown]>(a: T, b: T) {\n return compareString(a[0], b[0])\n}\n\n/**\n * Creates a comparator function for objects with a specific string property.\n * @param name - The property name to compare by\n * @returns A comparator function that compares objects by the specified property\n * @example\n * const items = [{ key: 'b' }, { key: 'a' }]\n * items.sort(stringPropComparator('key')) // [{ key: 'a' }, { key: 'b' }]\n */\nexport function stringPropComparator<N extends string>(name: N) {\n return <T extends Record<N, string>>(a: T, b: T) => compareString(a[name], b[name])\n}\n","/**\n * CSS object model for representing and serializing styles.\n * Converts JavaScript style objects into CSS blocks with proper\n * selector handling, nesting support, and deterministic output.\n * @module cssObject\n */\n\nimport {\n asKnownProp,\n asVar,\n camelToKebab,\n isCssVariableName,\n isKnownPropertyName,\n isMediaSelector,\n isNestedSelector,\n StyleProps,\n} from \"@/props\"\nimport { shortHash } from \"@/hash\"\nimport { MochiSelector } from \"@/selector\"\nimport { compareStringKey, stringPropComparator } from \"@/compare\"\n\n/**\n * Represents a single CSS rule block with properties and a selector.\n * Handles conversion to CSS string format and hash generation.\n */\nexport class CssObjectSubBlock {\n /**\n * Creates a new CSS sub-block.\n * @param cssProps - Map of CSS property names (kebab-case) to values\n * @param selector - The selector this block applies to\n */\n constructor(\n public readonly cssProps: Record<string, string>,\n public readonly selector: MochiSelector,\n ) {}\n\n /**\n * Computes a deterministic hash of this block's CSS content.\n * Used for generating unique class names.\n */\n get hash(): string {\n const str = this.asCssString(\"&\")\n return shortHash(str)\n }\n\n /**\n * Converts this block to a CSS string.\n * Handles media query wrapping if the selector has media conditions.\n * @param root - The root selector to substitute for `&`\n * @returns Formatted CSS string\n */\n asCssString(root: string): string {\n const selector = this.selector.substitute(root)\n const mediaQuery = selector.mediaQuery\n\n const mediaIndent = mediaQuery === undefined ? \"\" : \" \"\n\n const props = Object.entries(this.cssProps)\n .toSorted(compareStringKey)\n .map(([k, v]) => `${mediaIndent} ${k}: ${v};\\n`)\n .join(\"\")\n\n const blockCss = `${mediaIndent}${selector.cssSelector} {\\n${props}${mediaIndent}}`\n\n return mediaQuery === undefined ? blockCss : `${mediaQuery} {\\n${blockCss}\\n}`\n }\n\n /**\n * Parses StyleProps into an array of CSS sub-blocks.\n * Recursively processes nested selectors and media queries.\n * Output order is deterministic for consistent hash generation.\n *\n * @param props - The style properties to parse\n * @param selector - The parent selector context (defaults to `&`)\n * @returns Non-empty array of sub-blocks (main block first, then nested)\n */\n static fromProps(props: StyleProps, selector?: MochiSelector): [CssObjectSubBlock, ...CssObjectSubBlock[]] {\n selector ??= new MochiSelector([\"&\"])\n\n const cssProps: Record<string, string> = {}\n const propsToProcess: { key: string; selector: MochiSelector; props: StyleProps }[] = []\n\n for (const [key, value] of Object.entries(props)) {\n // skip undefined value\n if (value === undefined) continue\n\n // transform variable\n if (isCssVariableName(key)) {\n cssProps[key] = asVar(value as StyleProps[typeof key] & {})\n continue\n }\n\n // transform known CSS prop\n if (isKnownPropertyName(key)) {\n cssProps[camelToKebab(key)] = asKnownProp(value, key)\n continue\n }\n\n // transform nested and media selectors\n if (isNestedSelector(key)) {\n propsToProcess.push({\n key,\n props: value as StyleProps,\n selector: selector.extend(key),\n })\n continue\n }\n\n // transform media selector\n if (isMediaSelector(key)) {\n propsToProcess.push({\n key,\n props: value as StyleProps,\n selector: selector.wrap(key),\n })\n continue\n }\n\n if (process.env[\"NODE_ENV\"] !== \"production\") {\n console.warn(`[mochi-css] Unknown style property \"${key}\" will be ignored`)\n }\n }\n\n return [\n new CssObjectSubBlock(cssProps, selector),\n ...propsToProcess\n .toSorted(stringPropComparator(\"key\"))\n .flatMap(({ props, selector }) => CssObjectSubBlock.fromProps(props, selector)),\n ] as const\n }\n}\n\n/**\n * Represents an abstract CSS block definition.\n * Contains one or more sub-blocks for nested selectors and media queries.\n */\nexport class CssObjectBlock {\n /** The generated unique class name for this block */\n public readonly className: string\n /** All sub-blocks (main styles and nested/media rules) */\n public readonly subBlocks: CssObjectSubBlock[] = []\n\n /**\n * Creates a new CSS block from style properties.\n * Generates a unique class name based on the content hash.\n * @param styles - The style properties to compile\n */\n constructor(styles: StyleProps) {\n const blocks = CssObjectSubBlock.fromProps(styles)\n\n this.className = \"c\" + shortHash(blocks.map((b) => b.hash).join(\"+\"))\n this.subBlocks = blocks\n }\n\n /**\n * Gets the CSS class selector for this block.\n */\n get selector(): string {\n return `.${this.className}`\n }\n\n /**\n * Converts style block to a CSS string.\n * @param root - The root selector to scope styles to\n * @returns Complete CSS string for this block\n */\n asCssString(root: string): string {\n return this.subBlocks\n .map((b) => b.asCssString(new MochiSelector([root]).extend(`&.${this.className}`).cssSelector))\n .join(\"\\n\\n\")\n }\n}\n\nexport type AllVariants = Record<string, Record<string, StyleProps>>\nexport type DefaultVariants = Record<never, Record<string, StyleProps>>\n\n/**\n * A compound variant entry that applies styles when multiple variant conditions match.\n * Each entry specifies a set of variant conditions and a `css` property with styles\n * that apply only when all conditions are satisfied simultaneously.\n *\n * @template V - The variant definitions type\n *\n * @example\n * { color: 'red', size: 'large', css: { fontWeight: 'bold' } }\n */\nexport type CompoundVariant<V extends AllVariants> = {\n [K in keyof V]?: keyof V[K]\n} & { css: StyleProps }\n\n/**\n * Refines string literal types to their proper runtime types.\n * Converts \"true\"/\"false\" strings to boolean literals.\n */\ntype RefineVariantType<T extends string> = T extends \"true\"\n ? true\n : T extends \"false\"\n ? false\n : T extends string\n ? T\n : string\n\n/**\n * Props for defining variants in a style object.\n * @template V - The variant definitions type\n */\nexport type VariantProps<V extends AllVariants> = {\n /** Variant definitions mapping names to options to styles */\n variants?: V\n /** Default variant selections for when not explicitly provided */\n defaultVariants?: { [K in keyof V]?: keyof V[K] extends string ? RefineVariantType<keyof V[K] & string> : never }\n /** Compound variant definitions that apply when multiple variant conditions match */\n compoundVariants?: CompoundVariant<V>[]\n}\n\n/** Combined type for style props with optional variants */\nexport type MochiCSSProps<V extends AllVariants> = StyleProps & VariantProps<V>\n\n/** Utility type to override properties of A with properties of B */\ntype Override<A extends object, B extends object> = B & Omit<A, keyof B>\n\n/** Recursively merges variant types from a tuple, with later types overriding earlier */\nexport type MergeCSSVariants<V extends AllVariants[]> = V extends [\n infer V1 extends AllVariants,\n ...infer VRest extends AllVariants[],\n]\n ? Override<V1, MergeCSSVariants<VRest>>\n : DefaultVariants\n\n/** Refines all values in a string record to their proper variant types */\ntype RefineVariantTypes<V extends Record<string, string>> = { [K in keyof V]: RefineVariantType<V[K]> }\n\n/** Extracts and refines variant option types from a DefaultVariants definition */\nexport type RefineVariants<T extends AllVariants> = RefineVariantTypes<{ [K in keyof T]: keyof T[K] & string }>\n\n/**\n * Complete CSS object representation with main and variant styles.\n *\n * @template V - The variant definitions type\n *\n * @example\n * const obj = new CSSObject({\n * color: 'blue',\n * variants: {\n * size: {\n * small: { fontSize: 12 },\n * large: { fontSize: 18 }\n * }\n * },\n * defaultVariants: { size: 'small' }\n * })\n * obj.asCssString() // Returns complete CSS with all variants\n */\nexport class CSSObject<V extends AllVariants = DefaultVariants> {\n /** The main style block (non-variant styles) */\n public readonly mainBlock: CssObjectBlock\n /** Compiled blocks for each variant option */\n public readonly variantBlocks: { [K in keyof V & string]: Record<keyof V[K] & string, CssObjectBlock> }\n /** Default variant selections */\n public readonly variantDefaults: Partial<RefineVariants<V>>\n /** Compound variant conditions and their parsed sub-blocks */\n public readonly compoundVariants: { conditions: Record<string, string>; subBlocks: CssObjectSubBlock[] }[]\n\n /**\n * Creates a new CSSObject from style props.\n * Compiles main styles and all variant options into CSS blocks.\n */\n public constructor({ variants, defaultVariants, compoundVariants, ...props }: MochiCSSProps<V>) {\n this.mainBlock = new CssObjectBlock(props)\n this.variantBlocks = {} as typeof this.variantBlocks\n this.variantDefaults = defaultVariants ?? {}\n this.compoundVariants = []\n\n if (variants) {\n for (const variantGroupName in variants) {\n this.variantBlocks[variantGroupName] =\n {} as (typeof this.variantBlocks)[keyof typeof this.variantBlocks]\n const variantGroup = variants[variantGroupName]\n for (const variantItemName in variantGroup) {\n this.variantBlocks[variantGroupName][variantItemName] = new CssObjectBlock(\n variantGroup[variantItemName] ?? {},\n )\n }\n }\n }\n\n if (compoundVariants) {\n for (const compound of compoundVariants) {\n const { css: styles, ...conditions } = compound\n this.compoundVariants.push({\n conditions: conditions as Record<string, string>,\n subBlocks: CssObjectSubBlock.fromProps(styles),\n })\n }\n }\n }\n\n /**\n * Serializes the entire CSS object to a CSS string.\n * Outputs main block first, then all variant blocks in sorted order.\n * @returns Complete CSS string ready for injection into a stylesheet\n */\n public asCssString(): string {\n return [\n this.mainBlock.asCssString(this.mainBlock.selector),\n ...Object.entries(this.variantBlocks)\n .toSorted(compareStringKey)\n .flatMap(([_, b]) => Object.entries(b).toSorted(compareStringKey))\n .map(([_, b]) => b.asCssString(this.mainBlock.selector)),\n ...this.compoundVariants.map(({ conditions, subBlocks }) => {\n const variantSelectors = Object.entries(conditions)\n .toSorted(compareStringKey)\n .map(([variantName, optionName]) => {\n const block = this.variantBlocks[variantName]?.[optionName]\n return block?.selector ?? \"\"\n })\n .filter(Boolean)\n .join(\"\")\n const combinedSelector = `${this.mainBlock.selector}${variantSelectors}`\n return subBlocks.map((b) => b.asCssString(combinedSelector)).join(\"\\n\\n\")\n }),\n ].join(\"\\n\\n\")\n }\n}\n","/**\n * Core CSS-in-JS runtime for generating and applying styles.\n * Provides the main `css` function and `MochiCSS` class for style management.\n * @module css\n */\n\nimport clsx from \"clsx\"\nimport { CSSObject, AllVariants, DefaultVariants, MergeCSSVariants, MochiCSSProps, RefineVariants } from \"@/cssObject\"\n\n/**\n * Runtime representation of a CSS style definition with variant support.\n * Holds generated class names and provides methods to compute the final\n * className string based on selected variants.\n *\n * @template V - The variant definitions type mapping variant names to their options\n *\n * @example\n * const styles = MochiCSS.from(new CSSObject({\n * color: 'blue',\n * variants: { size: { small: { fontSize: 12 }, large: { fontSize: 18 } } }\n * }))\n * styles.variant({ size: 'large' }) // Returns combined class names\n */\nexport class MochiCSS<V extends AllVariants = DefaultVariants> {\n /**\n * Creates a new MochiCSS instance.\n * @param classNames - Base class names to always include\n * @param variantClassNames - Mapping of variant names to option class names\n * @param defaultVariants - Default variant selections when not specified\n */\n constructor(\n public readonly classNames: string[],\n public readonly variantClassNames: { [K in keyof V]: { [P in keyof V[K]]: string } },\n public readonly defaultVariants: Partial<RefineVariants<V>>,\n ) {}\n\n /**\n * Computes the final className string based on variant selections.\n * Compound variants are handled purely via CSS combined selectors,\n * so no runtime matching is needed here.\n * @param props - Variant selections\n * @returns Combined className string for use in components\n */\n variant(props: Partial<RefineVariants<V>>): string {\n const keys = new Set<keyof V & string>(\n [...Object.keys(props), ...Object.keys(this.defaultVariants)].filter((k) => k in this.variantClassNames),\n )\n\n return clsx(\n this.classNames,\n ...keys.values().map((k) => {\n const variantGroup = this.variantClassNames[k]\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (!variantGroup) return false\n\n const variantKey = ((k in props ? props[k] : undefined) ?? this.defaultVariants[k])?.toString()\n if (variantKey == null) return false\n\n const selectedClassname = variantGroup[variantKey]\n if (selectedClassname !== undefined) return selectedClassname\n\n const defaultKey = this.defaultVariants[k]\n if (defaultKey == null) return false\n\n return variantGroup[defaultKey.toString()]\n }),\n )\n }\n\n /**\n * Creates a MochiCSS instance from a CSSObject.\n * Extracts class names from the compiled CSS blocks.\n * @template V - The variant definitions type\n * @param object - The compiled CSSObject to extract from\n * @returns A new MochiCSS instance with the extracted class names\n */\n static from<V extends AllVariants = DefaultVariants>(object: CSSObject<V>): MochiCSS<V> {\n return new MochiCSS<V>(\n [object.mainBlock.className],\n Object.fromEntries(\n Object.entries(object.variantBlocks).map(([key, variantOptions]) => {\n return [\n key,\n Object.fromEntries(\n Object.entries(variantOptions).map(([optionKey, block]) => {\n return [optionKey, block.className]\n }),\n ),\n ]\n }),\n ) as { [K in keyof V]: { [P in keyof V[K]]: string } },\n object.variantDefaults,\n )\n }\n}\n\n/**\n * Creates a CSS style definition.\n * The primary API for defining styles in Mochi-CSS.\n *\n * @template V - Tuple of variant definition types\n * @param props - One or more style objects or existing MochiCSS instances to merge\n * @returns A MochiCSS instance with all styles and variants combined\n *\n * @example\n * // Simple usage\n * const button = css({ padding: 8, borderRadius: 4 })\n *\n * @example\n * // With variants\n * const button = css({\n * padding: 8,\n * variants: {\n * size: {\n * small: { padding: 4 },\n * large: { padding: 16 }\n * }\n * },\n * defaultVariants: { size: 'small' }\n * })\n * button.variant({ size: 'large' }) // Get class names for large size\n *\n * @example\n * // Merging multiple styles\n * const combined = css(baseStyles, additionalStyles)\n */\nconst emptyMochiCSS = new MochiCSS<AllVariants>([], {}, {})\n\nexport function css<V extends AllVariants[]>(\n ...props: { [K in keyof V]: MochiCSSProps<V[K]> | MochiCSS }\n): MochiCSS<MergeCSSVariants<V>> {\n const cssToMerge: MochiCSS<AllVariants>[] = []\n for (const p of props) {\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (p == null || typeof p !== \"object\") continue\n if (p instanceof MochiCSS) {\n cssToMerge.push(p)\n } else {\n cssToMerge.push(MochiCSS.from(new CSSObject<AllVariants>(p)))\n }\n }\n\n if (cssToMerge.length === 0) return emptyMochiCSS as MochiCSS<MergeCSSVariants<V>>\n\n return new MochiCSS<AllVariants>(\n cssToMerge.flatMap((css) => css.classNames),\n cssToMerge.reduce((a, b) => Object.assign(a, b.variantClassNames), {}),\n cssToMerge.reduce((a, b) => Object.assign(a, b.defaultVariants), {}),\n ) as MochiCSS<MergeCSSVariants<V>>\n}\n","/**\n * React styled component utilities.\n * Creates styled components with CSS-in-JS support and variant props.\n * @module styled\n */\n\nimport { ComponentProps, ComponentType, createElement, FC, HTMLElementType } from \"react\"\nimport { css } from \"@/css\"\nimport clsx from \"clsx\"\nimport { AllVariants, MergeCSSVariants, MochiCSSProps, RefineVariants } from \"@/cssObject\"\n\n/** Props added by MochiCSS to styled components */\ntype MochiProps<V extends AllVariants[]> = {\n className?: string\n} & Partial<RefineVariants<MergeCSSVariants<V>>>\n\n/** Minimal interface for components that accept className */\ntype Cls = { className?: string }\n\n/**\n * Creates a styled React component with CSS-in-JS support and variant props.\n * Similar to styled-components or Stitches, but with zero runtime overhead.\n *\n * @template T - The base element type or component type\n * @template V - The variant definitions tuple type\n * @param target - The HTML element tag name or React component to style\n * @param props - One or more style objects with optional variants\n * @returns A React functional component with merged props and variant support\n *\n * @example\n * const Button = styled('button', {\n * padding: 8,\n * borderRadius: 4,\n * variants: {\n * size: {\n * small: { padding: 4 },\n * large: { padding: 16 }\n * },\n * variant: {\n * primary: { backgroundColor: 'blue' },\n * secondary: { backgroundColor: 'gray' }\n * }\n * }\n * })\n *\n * // Usage: <Button size=\"large\" variant=\"primary\">Click me</Button>\n */\n//TODO: Move to dedicated \"styled\" package\nexport function styled<T extends HTMLElementType | ComponentType<Cls>, V extends AllVariants[]>(\n target: T,\n ...props: { [K in keyof V]: MochiCSSProps<V[K]> }\n): FC<Omit<ComponentProps<T>, keyof MochiProps<V>> & MochiProps<V>> {\n const styles = css<V>(...props)\n return ({ className, ...p }: Omit<ComponentProps<T>, keyof MochiProps<V>> & MochiProps<V>) =>\n //TODO: pick only variant props from p\n //TODO: omit variant props in p\n createElement(target, {\n className: clsx(styles.variant(p as unknown as Parameters<typeof styles.variant>[0]), className),\n ...p,\n })\n}\n","import { shortHash } from \"@/hash\"\nimport { cssFromProps, SimpleStyleProps } from \"@/props\"\nimport { compareStringKey } from \"@/compare\"\n\nexport type KeyframeStops = Record<string, SimpleStyleProps>\n\nexport class KeyframesObject {\n public readonly name: string\n private readonly body: string\n\n constructor(stops: KeyframeStops) {\n this.body = KeyframesObject.generateBody(stops)\n this.name = \"kf\" + shortHash(this.body)\n }\n\n asCssString(): string {\n return `@keyframes ${this.name} {\\n${this.body}\\n}`\n }\n\n private static generateBody(stops: KeyframeStops): string {\n return Object.entries(stops)\n .toSorted(compareStringKey)\n .map(([stopKey, props]) => {\n const cssProps = cssFromProps(props)\n const propsStr = Object.entries(cssProps)\n .toSorted(compareStringKey)\n .map(([k, v]) => ` ${k}: ${v};`)\n .join(\"\\n\")\n return ` ${stopKey} {\\n${propsStr}\\n }`\n })\n .join(\"\\n\\n\")\n }\n}\n","import { KeyframesObject, type KeyframeStops } from \"@/keyframesObject\"\nexport type { KeyframeStops } from \"@/keyframesObject\"\n\nexport class MochiKeyframes {\n constructor(public readonly name: string) {}\n\n toString(): string {\n return this.name\n }\n\n get value(): string {\n return this.name\n }\n\n static from(object: KeyframesObject): MochiKeyframes {\n return new MochiKeyframes(object.name)\n }\n}\n\nexport function keyframes(stops: KeyframeStops): MochiKeyframes {\n return MochiKeyframes.from(new KeyframesObject(stops))\n}\n"],"mappings":";;;;;;;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