import * as _angular_core from '@angular/core'; /** * @license * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE * * Squircle path computation — port of the algorithm from `figma-squircle` * (https://github.com/phamfoo/figma-squircle, MIT). Generates an SVG `d` * string for a smooth-corner rectangle. */ /** Per-corner radii for the squircle. */ interface WrSquircleCorners { readonly topLeft: number; readonly topRight: number; readonly bottomRight: number; readonly bottomLeft: number; } /** * Generate an SVG `d` string for a squircle (smooth-corner rectangle). * * @param width Box width in user units. * @param height Box height in user units. * @param radius Either a single number applied to all four corners or a * `WrSquircleCorners` object with per-corner radii. * @param smoothing 0–1. `0` = standard rounded rectangle; `1` = full * iOS-style smooth corner. @default 1 */ declare function squirclePath(width: number, height: number, radius: number | WrSquircleCorners, smoothing?: number): string; /** * Which corners to squircle. `'all'` = standard four-corner squircle; * the side-named values squircle the two corners on that side and leave * the other two at 90°. Useful for tab-/segment-style controls where * only outer corners need smoothing. */ type WrSquircleCornerMask = 'all' | 'left' | 'right' | 'top' | 'bottom' | 'none'; /** * Apply a Figma-style smooth-corner ("squircle") `clip-path` to the host * element. Re-computes the path whenever the element resizes. * * Borders: pass `[borderWidth]` (px) + `[borderColor]` and the directive * paints a `::before` pseudo with an *inset* squircle path on top of the * host. The visible border is the host's own background colour, so set * `background: ` on the host (or use the convenience * `[borderColor]` input which writes the host background for you). * * @example * ```html * * v2.0 *
*
* ``` */ declare class WrSquircle { /** Corner radius in CSS pixels. Falls back to `--wr-border-radius-base` × 16. @default 12 */ readonly radius: _angular_core.InputSignalWithTransform; /** Smoothing factor — `0` = plain rounded rect; `1` = full smooth iOS corner. @default 1 */ readonly smoothing: _angular_core.InputSignalWithTransform; /** * Whether the squircle clip-path is applied. When `false`, the directive * stays inert (clip-path cleared). * * Modelled as `model()` so a parent component composing this directive * (`inject(WrSquircle, { self: true }).enabled.set(...)`) can flip the * state from outside without exposing an `enabled` input on its own API. * * @default true */ readonly enabled: _angular_core.ModelSignal; /** * Border thickness in CSS pixels. `0` disables the border ring entirely. * Modelled (not `input()`) so parent components composing this directive * can flip it imperatively — e.g. `WrButton` turning on a 1px ring when * `shape="squircle" outlined` is active. * @default 0 */ readonly borderWidth: _angular_core.ModelSignal; /** * Border colour — any CSS colour. Applied to the host's background so the * outer squircle reveals it. Defaults to `currentColor` so the consuming * element's text colour drives the ring. * @default 'currentColor' */ readonly borderColor: _angular_core.ModelSignal; /** * Which corners to squircle. `'all'` (default) is the standard four- * corner shape; `'left'` / `'right'` / `'top'` / `'bottom'` squircle * only the two corners on the named side and leave the other two at * 90°. `'none'` is equivalent to disabling the directive. * * Modelled so parent components composing the directive can flip the * value imperatively — used by `WrButtonGroup` to squircle only the * outer corners of the first / last child. * * @default 'all' */ readonly corners: _angular_core.ModelSignal; private readonly el; private readonly isBrowser; private readonly destroyRef; private observer; constructor(); private apply; private clear; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } /** * Standalone squircle container. Equivalent to `
` but * named for ergonomics in templates. * * @example * ```html * * … * * ``` * * @see https://ngwr.dev/components/squircle */ declare class WrSquircleHost { static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } export { WrSquircle, WrSquircleHost, squirclePath }; export type { WrSquircleCornerMask, WrSquircleCorners };