import type { Preset } from 'unocss'; export type TokenValue = string | number; export interface ThemeToken { themes: Record; } /** * Typography configuration for font-related utilities * @example * typography: { * fonts: { sans: '"Inter", sans-serif' }, // creates font-sans * sizes: { base: '16px' }, // creates text-base * weights: { bold: 700 }, // creates font-bold * lineHeights: { normal: 1.5 }, // creates leading-normal * } */ export interface TypographyConfig { fonts?: Record; sizes?: Record; weights?: Record; lineHeights?: Record; } /** * Effects configuration for shadows and opacity * @example * effects: { * shadows: { sm: '0 1px 2px 0 rgb(0 0 0 / 0.05)' }, // creates shadow-sm * opacity: { 50: 0.5 }, // creates opacity-50 * } */ export interface EffectsConfig { shadows?: Record; opacity?: Record; } export interface PresetOptions { /** Name of the preset */ name: string; /** * Z-indexing tokens * @example * indexes: { * 10: 10, // create z-10 * 20: 20, // creates z-20 * '-20: '-20', // creates z- * } */ zindex?: Record; /** * Spacing tokens for margin, padding, and gap utilities * @example * spacing: { * sm: '8px', // creates m-sm, p-sm, gap-sm * md: '16px', // creates m-md, p-md, gap-md * } * Generates: * - Margins: m-{token}, mt-{token}, mb-{token}, ml-{token}, mr-{token}, mx-{token}, my-{token} * - Padding: p-{token}, pt-{token}, pb-{token}, pl-{token}, pr-{token}, px-{token}, py-{token} * - Gap: gap-{token}, gap-x-{token}, gap-y-{token} */ spacing?: Record; /** * Border radius tokens * @example * rounded: { * sm: '4px', // creates rounded-sm * md: '8px', // creates rounded-md * } * Generates: * - rounded-{token} */ rounded?: Record; /** * Size tokens for width and height utilities * Note: 'full', 'w-screen', 'screen' and 'h-screen' are reserved * @example * sizes: { * sm: '100px', // creates w-sm, h-sm * md: '200px', // creates w-md, h-md * } * Generates: * - w-{token} * - h-{token} */ sizes?: Record; /** * Color tokens with theme support * @example * colors: { * primary: { * themes: { * light: '#ffffff', * dark: '#000000' * } * } * } * Generates theme-aware utilities: * - bg-{color} * - text-{color} * - border-{color} * - outline-{color} */ colors: Record; /** * blur tokens * @example * blur: { * sm: "8px", // creates blur-sm * md: "10px", // creates blur-md * lg: "16px", // creates blur-lg * } */ blur?: Record; /** * Border width tokens * @example * borderWidths: { * thin: '1px', // creates border-thin * thick: '4px', // creates border-thick * } * Generates: * - border-{token} * - border-t-{token}, border-r-{token}, border-b-{token}, border-l-{token} * - outline-{token} */ borderWidths?: Record; /** * Typography configuration for font-related utilities * @example * typography: { * fonts: { sans: '"Inter", sans-serif' }, // creates font-sans * sizes: { base: '16px' }, // creates text-base * weights: { bold: 700 }, // creates font-bold * lineHeights: { normal: 1.5 }, // creates leading-normal * } */ typography?: TypographyConfig; /** * Effects configuration for shadows and opacity * @example * effects: { * shadows: { sm: '0 1px 2px 0 rgb(0 0 0 / 0.05)' }, // creates shadow-sm * opacity: { 50: 0.5 }, // creates opacity-50 * } */ effects?: EffectsConfig; /** * Enable arbitrary values using square bracket notation * @example allowArbitraryValues: true * Enables: * - p-[20px] * - m-[30px] * - w-[500px] * etc. */ allowArbitraryValues?: boolean; } /** * Creates a UnoCSS preset with customizable tokens and utilities * @param {PresetOptions} options - Configuration options * @param {string} options.name - Name of the token system preset * @param {Record} [options.zindex] - Z-index tokens * @param {Record} [options.spacing] - Spacing tokens for margin and padding utilities * @param {Record} [options.rounded] - Border radius tokens * @param {Record} [options.sizes] - Size tokens for width and height utilities * @param {Record>} [options.colors] - Color tokens for background and text utilities * @param {boolean} [options.allowArbitraryValues] - Enable arbitrary values using square bracket notation (e.g., p-[10px]) * @returns {Preset} UnoCSS preset with generated utilities * * @example * ```ts * const preset = defineTokenSystem({ * name: 'my-token-system', * spacing: { * sm: '8px', * md: '16px', * }, * colors: { * primary: { * 50: '#f8fafc', * 900: '#0f172a', * }, * text: 'black', * }, * allowArbitraryValues: true, * }) * ``` */ export declare function defineTokenSystem(options: PresetOptions): Preset;