/** * A prop-conditional style rule. Its non-`class` keys are matched against a * component's active variant props — exactly like a `tv()` compoundVariant * (`string` = equality, `string[]` = "one of"). On a match, the `class` * record (slot → classes) is merged into the slot-class cascade. Additive: * every matching rule contributes; later sources win per Tailwind bucket. * * @example * { variant: 'outlined', class: { base: 'border' } } // 1px border only on outlined */ export interface ConditionalOverride { /** Per-slot classes applied when the prop conditions match. */ class: Record; /** Prop conditions: prop name → required value (or one of several). */ [propCondition: string]: string | string[] | Record | undefined; } export interface ComponentDefaults { slotClasses?: Record; /** * Prop-conditional style rules, applied after unconditional `slotClasses` * (so they win per bucket) but before instance-level `slotClasses` / `class`. * Use for surgical per-variant tweaks the unconditional `slotClasses` cannot * express, e.g. `overrides: [{ variant: 'outlined', class: { base: 'border' } }]`. */ overrides?: ConditionalOverride[]; } /** * A preset is a named, project-defined visual style for a component. * It provides `slotClasses` that are merged *after* provider defaults * but *before* instance-level `slotClasses` / `class`. * * Presets are the recommended way to introduce custom looks that fall * outside the semantic intent palette — instead of overriding styles * with `class="bg-…!"` at each usage site. */ export interface ComponentPreset { slotClasses?: Record; /** Prop-conditional rules scoped to this preset (see {@link ConditionalOverride}). */ overrides?: ConditionalOverride[]; } /** Map of component name → preset name → preset definition. */ export type PresetMap = Record>; export interface BlocksConfig { readonly unstyled: boolean; readonly defaults: Readonly>; readonly presets: Readonly; } declare const getBlocksConfig: () => BlocksConfig | undefined, setBlocksConfig: (value: BlocksConfig | undefined) => BlocksConfig | undefined; export { getBlocksConfig, setBlocksConfig }; export declare function mergeSlotClasses(...sources: (Record | undefined)[]): Record; /** * Look up a preset's `slotClasses` for a given component + preset name. * Returns `undefined` if no preset is registered (caller falls back to * provider defaults only). Emits a dev-only warning when a preset name * is used but not registered, so missing presets are discoverable. */ export declare function resolvePresetSlotClasses(presets: PresetMap | undefined, component: string, presetName: string | undefined): Record | undefined; /** * Collect the per-slot classes of every `overrides` entry whose prop * conditions match `activeProps`. Returns `undefined` when there are no * overrides or none match. Multiple matches merge additively, in order. */ export declare function resolveOverrideSlotClasses(overrides: ConditionalOverride[] | undefined, activeProps: Record): Record | undefined; /** * Resolve the full slot-class cascade for a component instance, honoring * conditional `overrides` from both provider defaults and the active preset. * * Precedence (weak → strong), conflict-resolved per slot so a later source * wins within the same Tailwind bucket: * * defaults.slotClasses → defaults.overrides[match] * → preset.slotClasses → preset.overrides[match] → instance.slotClasses * * The result is handed to the component's `tv()` slot fn as the `class` * override, where it additionally strips conflicting library classes. */ export declare function resolveSlotClasses(config: BlocksConfig | undefined, component: string, preset: string | undefined, activeProps: Record, instanceSlotClasses: Record | undefined): Record;