
import { AtomicState, INTERACTIVE_ATOMICS, InteractiveAtomic, MAX_MODIFIERS_PER_COMPOUND, MODIFIER_ATOMICS, ModifierAtomic, isAtomicState, isInteractiveAtomic, isModifierAtomic } from "../types/StateAxis.js";
import { ArbitraryFixtures, InferArbitraryType } from "../../../fixtures/dist/index.js";
import { ConfigurablePropertiesName, SelectedConfigurableProperty, configurableProperties } from "../properties.js";
import { ComponentConfig, ComponentStateConfig, LayerConfig, PossibleStates, PossibleStatesWithRest, SubComponentConfig, VariantConfig, VariantConfigWithComponentStates, VariantConfigWithProperties } from "../types/ComponentConfig.js";
import { VariableState } from "../types/ConfigSchema.js";
import { ComponentSchema, buildConfigSchema, findFixtureType, findFixtureTypeForValue } from "./buildConfigSchema.js";
import { canonicalizeStateKey, splitStateKey } from "./canonicalizeStateKey.js";
import { cartesianProduct } from "./cartesianProduct.js";
import { coalesceConfigVariant } from "./coalesceConfigVariant.js";
import { getConfigDefaultValue, isConfigDefaultValue } from "./defaults.js";
import { generateDefaultClassName } from "./generateDefaultClassName.js";
import { generateKeyFromFlatConfigPath } from "./generateKeyFromFlatConfigPath.js";
import { generateSchemaKey } from "./generateSchemaKey.js";
import { IconButtonMatchButtonHeightConfig, IconButtonMatchButtonHeightSize, disableIconButtonMatchButtonHeight, enableIconButtonMatchButtonHeight, isIconButtonMatchButtonHeightEnabled } from "./iconButtonMatchButtonHeight.js";
import { ButtonControlSchema, SHARED_BUTTON_ICONBUTTON_SIZES, applyButtonControlHeightDeclarations, applyIconButtonControlHeightDeclarations, getButtonContentLineHeight, getButtonControlContentSize, getButtonControlHeight, getButtonIconSizeVar, getIconButtonControlHeight } from "./getButtonControlHeight.js";
import { getButtonControlHeightPx, getIconButtonControlHeightPx, getIconButtonOnlyControlHeightPx, syncButtonControlHeightVarForSize, syncIconButtonControlHeightVarForSize, syncIconButtonOnlyControlHeightVarForSize } from "./getButtonControlHeightPx.js";
import { getConfigComponentVariant } from "./getConfigComponentVariant.js";
import { getConfigVariantComponentStates, getConfigVariantComponentStatesMatrix } from "./getConfigVariantComponentStatesMatrix.js";
import { getConfigVariantProperties } from "./getConfigVariantProperties.js";
import { getConfigVariantPseudoStates } from "./getConfigVariantPseudoStates.js";
import { getConfigVariants } from "./getConfigVariants.js";
import { PaginationWidthConfig, getPaginationControlWidthPx, syncPaginationWidthVarForSize } from "./getPaginationControlWidthPx.js";
import { isConfiguratorPropertyVisible } from "./isConfiguratorPropertyVisible.js";
import { getStateDocsClass, getStateSelector, isKnownStateAtom } from "./pseudoStateSelectors.js";
import { resolvePropertyStates } from "./resolvePropertyStates.js";
import { PropertyStates, StateSlot, propertyUsesPerStateEnabled, resolveSlotByCascade } from "./resolveSlotByCascade.js";
import { getConfigSubcomponents } from "./subcomponents.js";
import { isVariantConfigWithComponentStates, isVariantConfigWithProperties } from "./variantConfigGuards.js";

//#region ../automated-config/dist/utils/index.d.ts
//#region src/utils/index.d.ts
type ThemeFn = (path: string) => string;
type EmitMode = 'exhaustive' | 'selective';
declare const statePseudoMapDocsMode: Record<PossibleStatesWithRest, string>;
/**
 * Forces button borders to use box-shadow instead of border properties.
 * Converts border-width and border-color into an inset box-shadow layer.
 *
 * Why box-shadow for borders?
 * - Respects border-radius (unlike outline which stays rectangular)
 * - Allows layering multiple shadows in a single property
 * - GPU-accelerated and performant
 * - Works perfectly with rounded/circular buttons
 *
 * @param classStyles - The CSS declarations for a button class
 * @returns Modified styles with box-shadow layers, or original if no border
 *
 * @example
 * Input:  { border-width: '2px', border-color: 'red', box-shadow: '0 2px 4px rgba(0,0,0,0.1)' }
 * Output: { box-shadow: 'inset 0 0 0 2px red, 0 2px 4px rgba(0,0,0,0.1)' }
 * Renders borders using inset box-shadows instead of CSS border widths.
 * This preserves visual borders without affecting layout dimensions.
 */
declare function applyBoxShadowBorder(classStyles: Record<string, string>): Record<string, string>;
declare function generateClassName({
  componentName,
  subComponentName,
  variantKey,
  variantValue,
  componentStateKey,
  componentStateValue,
  layer,
  layerOptionalPseudoSelector
}: {
  componentName: string;
  subComponentName?: string;
  variantKey: string;
  variantValue?: string;
  componentStateKey?: string;
  componentStateValue?: string;
  layer: string;
  layerOptionalPseudoSelector?: string;
}): string;
/**
 * Builds the per-state resolution map for a per-componentState OVERRIDE in
 * exhaustive mode: the universal layer's state map with the override's ENABLED
 * (and `rest`) slots layered on top. An unset or disabled override slot defers
 * to the universal layer's value, so `resolveSlotByCascade` picks the
 * most-specific *enabled* slot across both layers (override winning ties) rather
 * than collapsing every unset state to the override's own `rest`.
 */
declare function mergeUniversalUnderOverride(universal: VariableState, override: VariableState): VariableState;
declare function generateDeclaration({
  componentName,
  subComponentName,
  variantKey,
  variantValue,
  layer,
  layerOptionalPseudoSelector,
  componentStateKey,
  componentStateValue,
  schema,
  propertyKey,
  originalPropertyDefinition,
  declaredStates,
  layerUsesAtomicStates,
  theme,
  currentStyles,
  previewOptions,
  excludedPseudoStates,
  emit,
  fallbackStateMap,
  bumpRootSpecificity,
  buttonHeightReferenceSchema
}: {
  componentName: string;
  subComponentName?: string;
  variantKey: string;
  variantValue: string;
  componentStateKey?: string;
  componentStateValue?: string;
  layer: string;
  layerOptionalPseudoSelector?: string;
  schema: unknown;
  propertyKey: string;
  originalPropertyDefinition: SelectedConfigurableProperty<ConfigurablePropertiesName, any>;
  declaredStates: ReadonlySet<string>;
  layerUsesAtomicStates: boolean;
  theme: ThemeFn;
  currentStyles: Readonly<Record<string, Record<string, string>>>;
  previewOptions?: {
    generatePseudoStateClassModifier?: boolean;
  };
  excludedPseudoStates?: readonly PossibleStates[];
  emit?: EmitMode;
  fallbackStateMap?: VariableState;
  bumpRootSpecificity?: boolean;
  buttonHeightReferenceSchema?: ButtonControlSchema;
}): Record<string, Record<string, string>>;
declare function generateConfigStyles<C extends ComponentConfig>(config: C, schema: ComponentSchema<ComponentConfig>, theme: ThemeFn, previewOptions?: {
  generatePseudoStateClassModifier?: boolean;
}, emit?: EmitMode, generateStylesContext?: {
  buttonHeightReferenceSchema?: ButtonControlSchema;
}): Record<string, Record<string, string>>;
/**
 * Public entry point. Generates a component's CSS, emitting each declared state
 * as its own rule (one selector per rule) so the cascade is carried entirely by
 * per-rule specificity — which CSS minifiers preserve.
 *
 * An earlier optimization merged rules sharing a declaration block into a single
 * comma-separated selector list (to avoid repeating invariant declarations per
 * state). It was removed: a minifier's forgiving-`:is()` rewrite — applied to a
 * comma-separated list that contains `:has()` when targeting browsers without
 * native `:has()` support — collapses the list to its single highest
 * specificity, inflating the weakest selector (`rest`) above genuinely
 * customized states and corrupting the cascade. Separate rules never form such a
 * list, so minifiers leave their specificity intact. (gzip already collapses the
 * repeated declaration blocks, so the shipped-size cost is minimal.)
 */
declare const generateStyles: (config: ComponentConfig, schema: ComponentSchema<ComponentConfig>, theme: ThemeFn, previewOptions: {
  generatePseudoStateClassModifier: boolean;
  emit?: EmitMode;
}, generateStylesContext?: {
  buttonHeightReferenceSchema?: ButtonControlSchema;
}) => Record<string, Record<string, string>>;
declare function createConfigurableProperty<C extends ConfigurablePropertiesName, O extends string, T extends (typeof configurableProperties)[C]['possibleFixtures'], V extends readonly (readonly unknown[])[] = readonly (readonly unknown[])[]>(prop: {
  name: C;
  typeOfFixture: T;
  values: V;
  defaults: { [K in O]: V[number][number] | (Extract<T[number], ArbitraryFixtures> extends never ? never : InferArbitraryType<Extract<T[number], ArbitraryFixtures>>) };
  label: string;
  skipRestState?: boolean;
  optionalInDefaultSchema?: boolean; /** @deprecated Prefer layer-level `atomicStates` + `excludeAtomics`. */
  pseudoStates?: PossibleStates[];
  excludeAtomics?: AtomicState[];
  supportsCustom?: boolean;
  layerReference?: {
    variablePath: string;
    propertyName: string;
  };
}): SelectedConfigurableProperty<C, O, T, V>;
declare function createVariantConfig(config: {
  label: string;
  description: string;
  default: string;
  options: readonly string[];
}): VariantConfig;
declare function createVariantConfigWithProperties(config: {
  label: string;
  description: string;
  default: string;
  options: readonly string[];
  layers: {
    root: LayerConfig;
  } & Record<string, LayerConfig>;
  variantProperties?: Readonly<Record<string, SelectedConfigurableProperty<ConfigurablePropertiesName, string>>>;
}): VariantConfigWithProperties;
declare function createVariantConfigWithComponentStates(config: {
  label: string;
  description: string;
  default: string;
  options: readonly string[];
  componentStates: Record<string, ComponentStateConfig>;
  layers?: {
    root: LayerConfig;
  } & Record<string, LayerConfig>;
}): VariantConfigWithComponentStates;
declare function createComponentStates<T extends {
  label: string;
  options: readonly string[];
  excludePseudoStatesForOptions?: Partial<Record<string, readonly PossibleStates[]>>;
  excludeLayersForOptions?: Partial<Record<string, readonly string[]>>;
  layers?: {
    root: LayerConfig;
  } & Record<string, LayerConfig>;
}>(config: T): T;
declare function createLayerConfig<T extends {
  label: string;
  pseudoSelector?: string;
  /**
   * Atomic states this layer can style. Properties on the layer pick up rest,
   * each declared atom, and every auto-generated compound up to
   * `MAX_MODIFIERS_PER_COMPOUND` modifiers optionally combined with one
   * interactive (skipping pairs the browser suppresses). Properties opt out
   * of individual atoms via `excludeAtomics`. See {@link LayerConfig} for the
   * full breakdown.
   */
  atomicStates?: AtomicState[];
  properties: Readonly<Record<string, SelectedConfigurableProperty<ConfigurablePropertiesName, string>>>;
}>(config: T): T;
declare function createSubComponentConfig(config: {
  label: string;
  description: string;
  variants: Record<string, VariantConfigWithProperties | VariantConfigWithComponentStates>;
}): SubComponentConfig; //#endregion
//#endregion
export { EmitMode, applyBoxShadowBorder, createComponentStates, createConfigurableProperty, createLayerConfig, createSubComponentConfig, createVariantConfig, createVariantConfigWithComponentStates, createVariantConfigWithProperties, generateClassName, generateConfigStyles, generateDeclaration, generateStyles, mergeUniversalUnderOverride, statePseudoMapDocsMode };