import { r as __name } from "./rolldown-runtime.mjs"; import { Br as DefaultTagColors, Cr as LikeC4StyleDefaults, Dt as LikeC4ProjectStylesConfig, Fr as ThemeColor, Ir as ThemeColorValues, Ji as Tag, Nr as SpacingSize, Nt as TagSpecification, Or as RelationshipColorValues, Ot as LikeC4ProjectStylesCustomStylesheets, Pr as TextSize, Sr as IconSize, Tr as LikeC4Theme, _r as CustomColorDefinitions, br as HexColor, et as ComputedNodeStyle, hr as ColorLiteral, jr as ShapeSize, mr as Color, pr as BorderStyle, va as NTuple, vr as ElementColorValues, wr as LikeC4StylesConfig, xr as IconPosition } from "./index.mjs"; import { LiteralUnion } from "type-fest"; import chroma from "chroma-js"; //#region src/styles/assignTagColors.d.ts declare function assignTagColors(tags: { [kind: string]: Partial; }): Record; //#endregion //#region src/styles/LikeC4Styles.d.ts /** * Styles of a LikeC4 project * * Accepts an array of LikeC4ProjectStylesConfig objects as a parameter * and constructs a LikeC4Styles merged with the default styles. * * The class provides methods to get the default element colors, relationship * colors, group colors, font size in pixels, padding in pixels, and to compute * the ThemeColorValues from a given color. */ declare class LikeC4Styles { protected config: LikeC4StylesConfig; protected customCss?: LikeC4ProjectStylesCustomStylesheets | undefined; readonly theme: LikeC4Theme; readonly defaults: LikeC4StyleDefaults; static readonly DEFAULT: LikeC4Styles; static from(stylesConfig: LikeC4ProjectStylesConfig | undefined, customColors?: CustomColorDefinitions | undefined): LikeC4Styles; private constructor(); get fingerprint(): string; /** * Default element colors */ get elementColors(): ElementColorValues; /** * Default relationship colors */ get relationshipColors(): RelationshipColorValues; /** * Default group colors */ get groupColors(): ElementColorValues; isDefaultColor(color: LiteralUnion): color is ThemeColor; /** * Get color values * * @param color - The color to use * @default color From the defaults */ colors(color?: LiteralUnion): ThemeColorValues; private compoundColorsCache; /** * Get colors for compound nodes * * @param baseElementColors - The base element colors to compute from */ colorsForCompounds(baseElementColors: ElementColorValues, depth?: Depth): NTuple; /** * Get font size in pixels * * @param textSize - The text size to use * @default textSize From the defaults */ fontSize(textSize?: TextSize): number; /** * Get padding in pixels * * @param paddingSize - The padding size to use * @default paddingSize From the defaults */ padding(paddingSize?: SpacingSize): number; /** * Get icon size in pixels * * @param iconSize - The icon size to use * @default iconSize From the defaults */ iconSize(iconSize?: IconSize): number; isThemeColor(color: string): color is ThemeColor; /** * Calculate sizes and values based on the node styles * * @example * ```typescript * const { sizes, values } = styles.nodeSizes(node.style) * * // sizes * sizes.size // enum Size * sizes.padding // enum SpacingSize * sizes.textSize // enum TextSize * sizes.iconSize // enum ShapeSize * * // values * values.sizes // { width: number, height: number } * values.padding // number * values.textSize // number * values.iconSize // number * ``` */ nodeSizes(nodestyles: ComputedNodeStyle): { sizes: Omit<{ icon?: never; readonly iconColor?: Color; readonly iconSize?: IconSize; readonly iconPosition?: IconPosition; shape?: never; color?: never; readonly border?: BorderStyle; readonly opacity?: number; readonly multiple?: boolean; readonly size?: ShapeSize; readonly padding?: SpacingSize; readonly textSize?: TextSize; }, "size" | "padding" | "iconSize" | "textSize"> & Required<{ readonly size?: ShapeSize; readonly padding?: SpacingSize; readonly iconSize?: IconSize; readonly textSize?: TextSize; }>; values: { sizes: { readonly width: number; readonly height: number; }; padding: number; textSize: number; iconSize: number; }; }; /** * Compute ThemeColorValues from a given color * @param color - HEX, RGB, RGBA, etc. */ computeFrom(color: string): ThemeColorValues; equals(other: LikeC4Styles): boolean; /** * Get color values for a tag (including default tag colors) */ tagColor(tag: typeof DefaultTagColors[number] | ThemeColor | ColorLiteral): ThemeColorValues['elements']; } //#endregion //#region src/styles/compute-color-values.d.ts /** * Returns true when the input is a valid color literal parseable by chroma-js * (e.g. `#ff0000`, `rgb(255, 0, 0)`, named CSS colors). Useful as a safety * check before calling color-math helpers that throw on malformed input. */ declare function isValidColor(color: string | chroma.Color): boolean; declare function computeColorValues(color: ColorLiteral): ThemeColorValues; declare function getContrastedColorsAPCA(refColor: string | chroma.Color): { hiContrast: HexColor; loContrast: HexColor; }; //#endregion //#region src/styles/defaults.d.ts declare const styleDefaults: LikeC4StyleDefaults; //#endregion //#region src/styles/theme.d.ts declare const defaultTheme: LikeC4Theme; //#endregion export { isValidColor as a, getContrastedColorsAPCA as i, styleDefaults as n, LikeC4Styles as o, computeColorValues as r, assignTagColors as s, defaultTheme as t };