
import { IntRange } from "type-fest";

//#region ../tailwind-internal/dist/packages/types/dist/index.d.ts
//#region ../types/dist/index.d.ts
/**
 * Icon size tokens
 */
type IconSize = 'xs' | 'sm' | 'md' | 'lg';
/**
 * Icon variant (fill, outline, multicolor)
 */
/** Ensure an array has a max length of N */
type MaxLengthArray<T, N extends number, A extends T[] = []> = A['length'] extends N ? A : T[] extends A ? T[] : A | MaxLengthArray<T, N, [...A, T]>;
type Percentage = IntRange<0, 101>;
type PixelsUnit = {
  value: number;
  type: 'px';
};
type UnitlessUnit = {
  value: number;
  type: 'unitless';
};
type Hue = 'gray' | 'purple' | 'indigo' | 'blue' | 'cyan' | 'teal' | 'mint' | 'green' | 'lime' | 'citron' | 'yellow' | 'brown' | 'nude' | 'orange' | 'sunset' | 'red' | 'rose' | 'pink' | 'magenta' | 'carbon';
type HueStep = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '10' | '11' | '12' | '13' | '14' | '15';
type SpectrumColor = `${Hue}-${HueStep}`;
type SharedPrimaryPaletteAlias = 'brand' | 'alert' | 'positive' | 'warning' | 'info';
type SharedSecondaryPaletteAlias = `${SharedPrimaryPaletteAlias}-secondary`;
type SharedPaletteAlias = SharedPrimaryPaletteAlias | SharedSecondaryPaletteAlias;
type DeprecatedAccentAlias = 'accent';
type OpacityStep = `${Percentage}`;
type BackgroundPaletteAlias = 'primary' | 'secondary' | DeprecatedAccentAlias | SharedPaletteAlias;
type BackgroundPalette = Record<BackgroundPaletteAlias, PaletteValue>;
type ForegroundPaletteAlias = 'primary' | 'secondary' | 'tertiary' | 'muted' | 'on-color' | DeprecatedAccentAlias | SharedPaletteAlias;
type ForegroundPalette = Record<ForegroundPaletteAlias, PaletteValue>;
type LinePaletteAlias = 'primary' | 'secondary' | 'tertiary' | 'muted' | DeprecatedAccentAlias | SharedPaletteAlias;
type LinePalette = Record<LinePaletteAlias, PaletteValue>;
type ShadowPaletteAlias = 'primary' | 'secondary';
type ShadowPalette = Record<ShadowPaletteAlias, PaletteValue>;
/** Always palette aliases with 'always/' prefix */
type AlwaysPaletteAliasWithPrefix = 'always/white' | 'always/black' | 'always/transparent' | 'always/current' | 'always/brand' | 'always/accent';
/** Deprecated always palette aliases (without prefix) */
type DeprecatedAlwaysPaletteAlias = 'white' | 'black' | 'transparent' | 'current';
type AlwaysPaletteAlias = DeprecatedAlwaysPaletteAlias | AlwaysPaletteAliasWithPrefix;
type LinkableValue<T extends Record<string, unknown> = Record<string, unknown>> = T & {
  $ref?: string | null;
};
type PaletteType = keyof PaletteConfig;
type PaletteValue = LinkableValue<{
  hue: Hue;
  step: HueStep;
  opacity?: OpacityStep;
}>;
type PaletteConfig = {
  background: BackgroundPalette;
  foreground: ForegroundPalette;
  line: LinePalette;
  shadow: ShadowPalette;
};
type ShadowColor = ShadowPaletteAlias | SpectrumColor | AlwaysPaletteAlias | ElevationAlias;
type ShadowSpectrumColor = {
  type: 'spectrum';
  value: SpectrumColor;
};
type ShadowPaletteColor = {
  type: 'palette';
  value: ShadowColor;
};
type ShadowAlwaysColor = {
  type: 'always';
  value: AlwaysPaletteAlias;
};
type ShadowColorConfig = ShadowPaletteColor | ShadowSpectrumColor | ShadowAlwaysColor;
type ShadowOffset = `-${Exclude<SpacingAlias, '0'>}` | SpacingAlias;
type ShadowOpacity = OpacityStep;
type ShadowSpreadRadius = `-${Exclude<SpacingAlias, '0'>}` | SpacingAlias;
type ShadowPreset = {
  offsetX: ShadowOffset;
  offsetY: ShadowOffset;
  blur: SpacingAlias;
  spread: ShadowSpreadRadius;
  color: ShadowColorConfig;
  opacity: ShadowOpacity;
};
type ShadowVariant = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
type ShadowVariantInvert = `${Exclude<ShadowVariant, 'none'>}-invert`;
type ShadowVariantWithInvert = ShadowVariant | ShadowVariantInvert;
type ShadowVariantConfig = MaxLengthArray<ShadowPreset, 3>;
type ShadowType = 'drop' | 'inset';
type ShadowConfig = {
  drop: Record<ShadowVariant, ShadowVariantConfig>;
  inset: Record<ShadowVariant | ShadowVariantInvert, ShadowVariantConfig>;
};
type BreakpointValue = PixelsUnit;
type BreakpointsConfig = {
  sm: BreakpointValue;
  md: BreakpointValue;
  lg: BreakpointValue;
  xl: BreakpointValue;
  '2xl': BreakpointValue;
};
type Breakpoint = keyof BreakpointsConfig;
type TextVariantTypography = 'display1' | 'display2' | 'display3' | 'title1' | 'title2' | 'title3' | 'title4' | 'headline1' | 'body1' | 'label1' | 'label2' | 'label3' | 'label4' | 'caption1' | 'caption2' | 'legal1';
type TextVariantUi = 'ui1' | 'ui2' | 'ui3' | 'ui4' | 'ui5' | 'ui6';
type TextVariantWithoutEmphasized = TextVariantTypography | TextVariantUi;
type TextVariant = TextVariantWithoutEmphasized | `${TextVariantWithoutEmphasized}/emphasized`;
type FontAlias = 'sans' | 'sans-alt' | 'serif' | 'serif-alt' | 'mono';
type TextTransform = 'none' | 'uppercase' | 'lowercase' | 'capitalize';
type TypographyUnitValue = PixelsUnit | UnitlessUnit;
type TypographyResponsiveProperty<T> = {
  base: T;
  breakpoints: Record<Breakpoint, T>;
};
type TypographyStyle = {
  fontFamily: TypographyResponsiveProperty<FontAlias>;
  textTransform: TypographyResponsiveProperty<TextTransform>;
  fontSize: TypographyResponsiveProperty<TypographyUnitValue>;
  fontWeight: TypographyResponsiveProperty<TypographyUnitValue>;
  lineHeight: TypographyResponsiveProperty<TypographyUnitValue>;
  fontSlant: TypographyResponsiveProperty<TypographyUnitValue>;
  fontWidth: TypographyResponsiveProperty<TypographyUnitValue>;
  letterSpacing: TypographyResponsiveProperty<PixelsUnit>;
};
type TypographyConfig = Record<TextVariant, TypographyStyle>;
type FontConfig = Record<FontAlias, string>;
type TShirtSize = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
type AvatarSize = '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl';
type AvatarSizeConfig = Record<AvatarSize, number>;
type IconSizeConfig = Record<IconSize, number>;
type SpacingAlias = '0' | 'px' | '0.5' | '1' | '1.5' | '2' | '2.5' | '3' | '3.5' | '4' | '4.5' | '5' | '5.5' | '6' | '7' | '8' | '9' | '10' | '11' | '12' | '14' | '16' | '20' | '24' | '28' | '32' | '36' | '40' | '44' | '48' | '52' | '56' | '60' | '64' | '72' | '80' | '96';
type AlwaysPaletteColor<T> = {
  type: 'always';
  value: T;
};
type ElevationSurfaceColor = AlwaysPaletteColor<AlwaysPaletteAlias> | {
  type: 'spectrum';
  value: {
    hue: Hue;
    step: HueStep;
  };
};
type ElevationBackgroundFillColor = {
  type: 'background';
  value: BackgroundPaletteAlias;
} | ElevationSurfaceColor;
type ElevationBorderColor = {
  type: 'line';
  value: LinePaletteAlias;
} | ElevationSurfaceColor;
type RGBColorValue = `${IntRange<0, 256>}`;
type RGBAUnit = {
  type: 'rgba';
  r: RGBColorValue;
  g: RGBColorValue;
  b: RGBColorValue;
  a: OpacityStep;
};
type ElevationCustomShadows = [ShadowPreset, ShadowPreset, ShadowPreset, ShadowPreset];
type ElevationCustomInsetShadows = [ShadowPreset, ShadowPreset];
type RGBUnit = {
  type: 'rgb';
  r: RGBColorValue;
  g: RGBColorValue;
  b: RGBColorValue;
};
type ElevationPreset = {
  surfaceColor: ElevationSurfaceColor & {
    opacity: OpacityStep;
  };
  layerWithBackgroundFill: boolean;
  backgroundFill: ElevationBackgroundFillColor;
  backgroundBlurRadius: number;
  finalBackgroundOpacity: OpacityStep;
  finalBackgroundValue: RGBAUnit;
  fallbackBlurredBackgroundValue: RGBUnit;
  borderColor: ElevationBorderColor;
  borderWidth: BorderWidth;
  dropShadow: ShadowVariant | ElevationCustomShadows;
  insetShadow: ShadowVariantWithInvert | ElevationCustomInsetShadows;
};
type ElevationLevel = '0' | '1' | '2' | '3' | '4' | '5';
type ElevationAlias = `elevation-${ElevationLevel}`;
type ElevationConfig = Record<ElevationLevel, Record<ColorMode, ElevationPreset>>;
type ElevationGlobalRampSettings = {
  progression: Percentage;
  ambientLight: Percentage;
  surfaceColor: ElevationSurfaceColor;
  borderColor: ElevationBorderColor;
  shadowDistance: Percentage;
  shadowOpacity: Percentage;
  shadowColor: ShadowColorConfig;
  backgroundOpacity: Percentage;
  backgroundBlurRadius: Percentage;
};
type ElevationGlobalRampConfig = {
  isAdvancedModeEnabled: boolean;
  colorMode: Record<ColorMode, ElevationGlobalRampSettings>;
};
type FocusRingWidth = 1 | 2 | 3 | 4;
type FocusRingOffset = 0 | 1 | 2 | 3 | 4;
type FocusRingColor = {
  type: 'line';
  value: LinePaletteAlias;
} | {
  type: 'spectrum';
  value: {
    hue: Hue;
    step: HueStep;
  };
} | {
  type: 'always';
  value: AlwaysPaletteAlias;
};
type FocusRingConfig = {
  width: FocusRingWidth;
  offset: FocusRingOffset;
  color: FocusRingColor;
};
type FocusRingModeConfig = Record<ColorMode, FocusRingConfig>;
type BorderRadius = TShirtSize;
type BorderRadiusConfig = Record<BorderRadius, number>;
type BorderWidth = 'none' | 'thin' | 'medium' | 'thick';
type BorderWidthConfig = Record<BorderWidth, number>;
type ColorMode = 'light' | 'dark';
type ColorModeConfig = Record<ColorMode, ColorsConfig>;
type ColorsConfig = {
  palette: PaletteConfig;
  spectrum: SpectrumConfig;
};
type SpectrumRGB = {
  type: 'rgb';
  r: number;
  g: number;
  b: number;
};
type SpectrumValueEntry = LinkableValue<{
  rgb: SpectrumRGB;
}>;
type SpectrumValue = Record<HueStep, SpectrumValueEntry>;
type SpectrumConfig = Record<Hue, SpectrumValue>;
type ScaleMode = 'xSmall' | 'small' | 'medium' | 'large' | 'xLarge' | 'xxLarge' | 'xxxLarge';
type ScaleConfig = {
  avatarSizes: AvatarSizeConfig;
  iconSizes: IconSizeConfig;
  borderRadius: BorderRadiusConfig;
  borderWidth: BorderWidthConfig;
};
type ScaleModeConfig = Record<ScaleMode, ScaleConfig>;
type MotionVariant = 'damped' | 'smooth' | 'subtle' | 'bouncy' | 'veryBouncy';
type MotionVariantSpeed = '1' | '2' | '3' | '4';
type MotionSpringConfig = {
  damping: number;
  stiffness: number;
};
type MotionVariantValues = { [key in MotionVariantSpeed]: MotionSpringConfig };
type MotionConfig = Record<MotionVariant, MotionVariantValues>;
/**
 * Base interface for UniversalTokensConfigAuto.
 * This is extended by @yahoo/uds with the full generated config.
 */
interface UniversalTokensConfigAutoBase {
  [key: string]: unknown;
}
/**
 * Base universal tokens configuration interface.
 * This contains the core config properties that all platforms need.
 */
interface UniversalTokensConfigBase {
  $defs?: {
    links: {
      systems: Record<string, string>;
    };
  };
  version: string;
  colorMode: ColorModeConfig;
  scaleMode: ScaleModeConfig;
  font: FontConfig;
  motion: MotionConfig;
  shadow: ShadowConfig;
  breakpoints: BreakpointsConfig;
  typography: TypographyConfig;
  elevation: ElevationConfig;
  elevationGlobalRamp: ElevationGlobalRampConfig;
  focusRing: FocusRingModeConfig;
  globalDefaults: GlobalDefaultsConfig;
}
/**
 * Universal tokens configuration type.
 * Combines base config with auto-generated component config.
 * @template ConfigAuto - The auto-generated component config type. Defaults to UniversalTokensConfigAutoBase.
 */
type UniversalTokensConfigGeneric<ConfigAuto = UniversalTokensConfigAutoBase> = UniversalTokensConfigBase & ConfigAuto;
type GlobalDefaultsConfig = {
  breakpoint: Breakpoint | 'base';
  enableResponsiveType: boolean;
}; //#endregion
//#endregion
//#endregion
export { type ColorMode, type ColorsConfig, type ElevationLevel, type ElevationPreset, type FocusRingConfig, type FontConfig, type Hue, type HueStep, type MotionConfig, type OpacityStep, type PaletteConfig, type PaletteType, type ScaleMode, type ShadowType, type TextVariantUi, type UniversalTokensConfigGeneric };