{"version":3,"file":"ngwr-squircle.mjs","sources":["../../../projects/lib/squircle/compute-squircle-path.ts","../../../projects/lib/squircle/wr-squircle.ts","../../../projects/lib/squircle/wr-squircle-host.ts","../../../projects/lib/squircle/ngwr-squircle.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n *\n * Squircle path computation — port of the algorithm from `figma-squircle`\n * (https://github.com/phamfoo/figma-squircle, MIT). Generates an SVG `d`\n * string for a smooth-corner rectangle.\n */\n\n/** Per-corner radii for the squircle. */\ninterface WrSquircleCorners {\n  readonly topLeft: number;\n  readonly topRight: number;\n  readonly bottomRight: number;\n  readonly bottomLeft: number;\n}\n\ninterface CornerParams {\n  readonly a: number;\n  readonly b: number;\n  readonly c: number;\n  readonly d: number;\n  readonly p: number;\n  readonly arcSectionLength: number;\n  readonly cornerRadius: number;\n}\n\nfunction toRadians(deg: number): number {\n  return (deg * Math.PI) / 180;\n}\n\nfunction cornerParams(cornerRadius: number, cornerSmoothing: number, budget: number): CornerParams {\n  if (cornerRadius <= 0) {\n    return { a: 0, b: 0, c: 0, d: 0, p: 0, arcSectionLength: 0, cornerRadius: 0 };\n  }\n  let p = (1 + cornerSmoothing) * cornerRadius;\n  // Cap smoothing so the corner fits within the available budget.\n  let s = cornerSmoothing;\n  const maxSmoothing = budget / cornerRadius - 1;\n  if (maxSmoothing < s) {\n    s = Math.max(0, maxSmoothing);\n    p = (1 + s) * cornerRadius;\n  }\n  const arcMeasure = 90 * (1 - s);\n  const arcSectionLength = Math.sin(toRadians(arcMeasure / 2)) * cornerRadius * Math.SQRT2;\n  const angleAlpha = (90 - arcMeasure) / 2;\n  const p3p4 = cornerRadius * Math.tan(toRadians(angleAlpha / 2));\n  const angleBeta = 45 * s;\n  const c = p3p4 * Math.cos(toRadians(angleBeta));\n  const d = c * Math.tan(toRadians(angleBeta));\n  const b = (p - arcSectionLength - c - d) / 3;\n  const a = 2 * b;\n  return { a, b, c, d, p, arcSectionLength, cornerRadius };\n}\n\n/** Cubic-bezier + arc commands for one corner — anchored at its `p` distance. */\nfunction drawCorner(c: CornerParams, rotation: 'tl' | 'tr' | 'br' | 'bl'): string {\n  if (c.cornerRadius === 0) return '';\n  const { a, b, c: cc, d, arcSectionLength, cornerRadius } = c;\n  switch (rotation) {\n    case 'tr':\n      return `c ${a} 0 ${a + b} 0 ${a + b + cc} ${d} a ${cornerRadius} ${cornerRadius} 0 0 1 ${arcSectionLength} ${arcSectionLength} c ${d} ${cc} ${d} ${b + cc} ${d} ${a + b + cc}`;\n    case 'br':\n      return `c 0 ${a} 0 ${a + b} ${-d} ${a + b + cc} a ${cornerRadius} ${cornerRadius} 0 0 1 ${-arcSectionLength} ${arcSectionLength} c ${-cc} ${d} ${-(b + cc)} ${d} ${-(a + b + cc)} ${d}`;\n    case 'bl':\n      return `c ${-a} 0 ${-(a + b)} 0 ${-(a + b + cc)} ${-d} a ${cornerRadius} ${cornerRadius} 0 0 1 ${-arcSectionLength} ${-arcSectionLength} c ${-d} ${-cc} ${-d} ${-(b + cc)} ${-d} ${-(a + b + cc)}`;\n    case 'tl':\n      return `c 0 ${-a} 0 ${-(a + b)} ${d} ${-(a + b + cc)} a ${cornerRadius} ${cornerRadius} 0 0 1 ${arcSectionLength} ${-arcSectionLength} c ${cc} ${-d} ${b + cc} ${-d} ${a + b + cc} ${-d}`;\n  }\n}\n\n/**\n * Generate an SVG `d` string for a squircle (smooth-corner rectangle).\n *\n * @param width Box width in user units.\n * @param height Box height in user units.\n * @param radius Either a single number applied to all four corners or a\n *               `WrSquircleCorners` object with per-corner radii.\n * @param smoothing 0–1. `0` = standard rounded rectangle; `1` = full\n *                  iOS-style smooth corner. @default 1\n */\nfunction squirclePath(width: number, height: number, radius: number | WrSquircleCorners, smoothing = 1): string {\n  const corners: WrSquircleCorners =\n    typeof radius === 'number'\n      ? { topLeft: radius, topRight: radius, bottomRight: radius, bottomLeft: radius }\n      : radius;\n\n  // Budget per corner = half of the shorter dimension.\n  const budget = Math.min(width / 2, height / 2);\n\n  const tl = cornerParams(Math.min(corners.topLeft, budget), smoothing, budget);\n  const tr = cornerParams(Math.min(corners.topRight, budget), smoothing, budget);\n  const br = cornerParams(Math.min(corners.bottomRight, budget), smoothing, budget);\n  const bl = cornerParams(Math.min(corners.bottomLeft, budget), smoothing, budget);\n\n  return [\n    `M ${tl.p} 0`,\n    `L ${width - tr.p} 0`,\n    drawCorner(tr, 'tr'),\n    `L ${width} ${height - br.p}`,\n    drawCorner(br, 'br'),\n    `L ${bl.p} ${height}`,\n    drawCorner(bl, 'bl'),\n    `L 0 ${tl.p}`,\n    drawCorner(tl, 'tl'),\n    'Z',\n  ]\n    .filter(Boolean)\n    .join(' ');\n}\n\nexport { squirclePath };\nexport type { WrSquircleCorners };\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { coerceNumberProperty } from '@angular/cdk/coercion';\nimport { isPlatformBrowser } from '@angular/common';\nimport { DestroyRef, Directive, ElementRef, PLATFORM_ID, effect, inject, input, model } from '@angular/core';\n\nimport { squirclePath, type WrSquircleCorners } from './compute-squircle-path';\nimport type { WrSquircleCornerMask } from './interfaces';\n\n/**\n * Which corners to squircle. `'all'` = standard four-corner squircle;\n * the side-named values squircle the two corners on that side and leave\n * the other two at 90°. Useful for tab-/segment-style controls where\n * only outer corners need smoothing.\n */\nfunction maskToRadii(mask: WrSquircleCornerMask, r: number): WrSquircleCorners {\n  switch (mask) {\n    case 'left':\n      return { topLeft: r, topRight: 0, bottomRight: 0, bottomLeft: r };\n    case 'right':\n      return { topLeft: 0, topRight: r, bottomRight: r, bottomLeft: 0 };\n    case 'top':\n      return { topLeft: r, topRight: r, bottomRight: 0, bottomLeft: 0 };\n    case 'bottom':\n      return { topLeft: 0, topRight: 0, bottomRight: r, bottomLeft: r };\n    case 'none':\n      return { topLeft: 0, topRight: 0, bottomRight: 0, bottomLeft: 0 };\n    case 'all':\n    default:\n      return { topLeft: r, topRight: r, bottomRight: r, bottomLeft: r };\n  }\n}\n\n/**\n * Apply a Figma-style smooth-corner (\"squircle\") `clip-path` to the host\n * element. Re-computes the path whenever the element resizes.\n *\n * Borders: pass `[borderWidth]` (px) + `[borderColor]` and the directive\n * paints a `::before` pseudo with an *inset* squircle path on top of the\n * host. The visible border is the host's own background colour, so set\n * `background: <border-color>` on the host (or use the convenience\n * `[borderColor]` input which writes the host background for you).\n *\n * @example\n * ```html\n * <button wrButton wrSquircle [radius]=\"16\">Save</button>\n * <wr-tag wrSquircle>v2.0</wr-tag>\n * <div wrSquircle [radius]=\"32\" [smoothing]=\"0.8\">…</div>\n * <div wrSquircle [borderWidth]=\"2\" borderColor=\"var(--wr-color-primary)\">…</div>\n * ```\n */\n@Directive({\n  selector: '[wrSquircle]',\n  host: { '[class.wr-squircle--bordered]': 'borderWidth() > 0 && enabled()' },\n})\nexport class WrSquircle {\n  /** Corner radius in CSS pixels. Falls back to `--wr-border-radius-base` × 16. @default 12 */\n  readonly radius = input(12, { transform: (v: unknown): number => Math.max(0, coerceNumberProperty(v, 12)) });\n\n  /** Smoothing factor — `0` = plain rounded rect; `1` = full smooth iOS corner. @default 1 */\n  readonly smoothing = input(1, {\n    transform: (v: unknown): number => Math.min(1, Math.max(0, coerceNumberProperty(v, 1))),\n  });\n\n  /**\n   * Whether the squircle clip-path is applied. When `false`, the directive\n   * stays inert (clip-path cleared).\n   *\n   * Modelled as `model()` so a parent component composing this directive\n   * (`inject(WrSquircle, { self: true }).enabled.set(...)`) can flip the\n   * state from outside without exposing an `enabled` input on its own API.\n   *\n   * @default true\n   */\n  readonly enabled = model(true);\n\n  /**\n   * Border thickness in CSS pixels. `0` disables the border ring entirely.\n   * Modelled (not `input()`) so parent components composing this directive\n   * can flip it imperatively — e.g. `WrButton` turning on a 1px ring when\n   * `shape=\"squircle\" outlined` is active.\n   * @default 0\n   */\n  readonly borderWidth = model(0);\n\n  /**\n   * Border colour — any CSS colour. Applied to the host's background so the\n   * outer squircle reveals it. Defaults to `currentColor` so the consuming\n   * element's text colour drives the ring.\n   * @default 'currentColor'\n   */\n  readonly borderColor = model<string>('currentColor');\n\n  /**\n   * Which corners to squircle. `'all'` (default) is the standard four-\n   * corner shape; `'left'` / `'right'` / `'top'` / `'bottom'` squircle\n   * only the two corners on the named side and leave the other two at\n   * 90°. `'none'` is equivalent to disabling the directive.\n   *\n   * Modelled so parent components composing the directive can flip the\n   * value imperatively — used by `WrButtonGroup` to squircle only the\n   * outer corners of the first / last child.\n   *\n   * @default 'all'\n   */\n  readonly corners = model<WrSquircleCornerMask>('all');\n\n  private readonly el = inject<ElementRef<HTMLElement>>(ElementRef);\n  private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n  private readonly destroyRef = inject(DestroyRef);\n  private observer: ResizeObserver | null = null;\n\n  constructor() {\n    if (!this.isBrowser) return;\n    const host = this.el.nativeElement;\n    // Reactively re-apply when inputs change.\n    effect(() => {\n      this.radius();\n      this.smoothing();\n      this.enabled();\n      this.borderWidth();\n      this.borderColor();\n      this.corners();\n      this.apply();\n    });\n    // Re-apply on resize.\n    this.observer = new ResizeObserver(() => this.apply());\n    this.observer.observe(host);\n    this.destroyRef.onDestroy(() => {\n      this.observer?.disconnect();\n      this.clear();\n    });\n  }\n\n  private apply(): void {\n    const host = this.el.nativeElement;\n    if (!this.enabled()) {\n      this.clear();\n      return;\n    }\n    const rect = host.getBoundingClientRect();\n    if (rect.width === 0 || rect.height === 0) return;\n\n    const r = this.radius();\n    const s = this.smoothing();\n    const radii = maskToRadii(this.corners(), r);\n    const outer = squirclePath(rect.width, rect.height, radii, s);\n    const value = `path(\"${outer}\")`;\n    host.style.clipPath = value;\n    host.style.setProperty('-webkit-clip-path', value);\n\n    // Border mode: paint an INNER squircle in a `::before` pseudo on top of\n    // the host so the host's own bg only shows at the border-width perimeter.\n    const bw = this.borderWidth();\n    if (bw > 0) {\n      const innerW = Math.max(0, rect.width - bw * 2);\n      const innerH = Math.max(0, rect.height - bw * 2);\n      const innerR = Math.max(0, r - bw);\n      if (innerW > 0 && innerH > 0) {\n        const innerRadii = maskToRadii(this.corners(), innerR);\n        const inner = squirclePath(innerW, innerH, innerRadii, s);\n        host.style.setProperty('--wr-squircle-inner-path', `path(\"${inner}\")`);\n      }\n      host.style.setProperty('--wr-squircle-border-width', `${bw}px`);\n      // Only set the colour var inline when the consumer asked for a\n      // specific colour. Leaving the default `'currentColor'` un-inlined\n      // lets host CSS (e.g. WrButton's outlined-squircle rule) override\n      // the var via SCSS without losing to inline-style specificity.\n      const bc = this.borderColor();\n      if (bc && bc !== 'currentColor') {\n        host.style.setProperty('--wr-squircle-border-color', bc);\n      } else {\n        host.style.removeProperty('--wr-squircle-border-color');\n      }\n    } else {\n      host.style.removeProperty('--wr-squircle-inner-path');\n      host.style.removeProperty('--wr-squircle-border-width');\n      host.style.removeProperty('--wr-squircle-border-color');\n    }\n  }\n\n  private clear(): void {\n    const host = this.el.nativeElement;\n    host.style.removeProperty('clip-path');\n    host.style.removeProperty('-webkit-clip-path');\n    host.style.removeProperty('--wr-squircle-inner-path');\n    host.style.removeProperty('--wr-squircle-border-width');\n    host.style.removeProperty('--wr-squircle-border-color');\n  }\n}\n\nexport type { WrSquircleCornerMask } from './interfaces';\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Component, ViewEncapsulation } from '@angular/core';\n\nimport { WrSquircle } from './wr-squircle';\n\n/**\n * Standalone squircle container. Equivalent to `<div wrSquircle>` but\n * named for ergonomics in templates.\n *\n * @example\n * ```html\n * <wr-squircle [radius]=\"24\" style=\"width: 160px; height: 160px; background: var(--wr-color-primary)\">\n *   …\n * </wr-squircle>\n * ```\n *\n * @see https://ngwr.dev/components/squircle\n */\n@Component({\n  selector: 'wr-squircle',\n  template: '<ng-content />',\n  encapsulation: ViewEncapsulation.None,\n  host: { class: 'wr-squircle' },\n  hostDirectives: [{ directive: WrSquircle, inputs: ['radius', 'smoothing', 'borderWidth', 'borderColor'] }],\n})\nexport class WrSquircleHost {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAAA;;;;;;;;;AASG;AAoBH,SAAS,SAAS,CAAC,GAAW,EAAA;IAC5B,OAAO,CAAC,GAAG,GAAG,IAAI,CAAC,EAAE,IAAI,GAAG;AAC9B;AAEA,SAAS,YAAY,CAAC,YAAoB,EAAE,eAAuB,EAAE,MAAc,EAAA;AACjF,IAAA,IAAI,YAAY,IAAI,CAAC,EAAE;AACrB,QAAA,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,gBAAgB,EAAE,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE;IAC/E;IACA,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,eAAe,IAAI,YAAY;;IAE5C,IAAI,CAAC,GAAG,eAAe;AACvB,IAAA,MAAM,YAAY,GAAG,MAAM,GAAG,YAAY,GAAG,CAAC;AAC9C,IAAA,IAAI,YAAY,GAAG,CAAC,EAAE;QACpB,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,YAAY,CAAC;QAC7B,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,IAAI,YAAY;IAC5B;IACA,MAAM,UAAU,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;AAC/B,IAAA,MAAM,gBAAgB,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC,GAAG,YAAY,GAAG,IAAI,CAAC,KAAK;IACxF,MAAM,UAAU,GAAG,CAAC,EAAE,GAAG,UAAU,IAAI,CAAC;AACxC,IAAA,M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