{"version":3,"file":"ngwr-typography.mjs","sources":["../../../projects/lib/typography/typography.ts","../../../projects/lib/typography/ngwr-typography.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\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { Directive, computed, input } from '@angular/core';\n\nimport type { WrTypographyAlign, WrTypographyTone, WrTypographyVariant } from './interfaces';\n\n/**\n * Semantic typography directive. Attaches to any native element and\n * applies the visual treatment for the chosen `variant` (`h1`–`h6`,\n * `display`, `lead`, `body`, `small`, `caption`, `overline`, `code`).\n *\n * Reads from the same `--wr-text-*` / `--wr-font-weight-*` / `--wr-leading-*`\n * tokens used by the opt-in typography utility classes — themeable by\n * overriding tokens at `:root`.\n *\n * @example\n * ```html\n * <h1 wrTypography variant=\"display\">Build interfaces</h1>\n * <h2 wrTypography variant=\"h2\" tone=\"primary\">that feel alive.</h2>\n * <p wrTypography variant=\"lead\">A developer-first library.</p>\n * <span wrTypography variant=\"caption\" tone=\"medium\">v1.6.0 — released today</span>\n * <code wrTypography variant=\"code\">inject(WrTheme)</code>\n * ```\n *\n * @see https://ngwr.dev/typography/overview\n */\n@Directive({\n  selector: '[wrTypography]',\n  host: { '[class]': 'classes()' },\n})\nexport class WrTypography {\n  /** Visual variant. @default 'body' */\n  readonly variant = input<WrTypographyVariant>('body');\n\n  /**\n   * Color tone. `null` (default) keeps the variant's own color — the base\n   * dark for headings/body, medium for lead/caption, primary for links.\n   */\n  readonly tone = input<WrTypographyTone | null>(null);\n\n  /** Horizontal alignment. */\n  readonly align = input<WrTypographyAlign | null>(null);\n\n  /** Truncate to single line with ellipsis. @default false */\n  readonly truncate = input(false, { transform: coerceBooleanProperty });\n\n  /** Render with monospace font. @default false (auto-true for `code`) */\n  readonly mono = input(false, { transform: coerceBooleanProperty });\n\n  protected readonly classes = computed(() => {\n    const parts = ['wr-typography', `wr-typography--${this.variant()}`];\n    const tone = this.tone();\n    if (tone) parts.push(`wr-typography--tone-${tone}`);\n    const align = this.align();\n    if (align) parts.push(`wr-typography--align-${align}`);\n    if (this.truncate()) parts.push('wr-typography--truncate');\n    if (this.mono() || this.variant() === 'code') parts.push('wr-typography--mono');\n    return parts.join(' ');\n  });\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;AAAA;;;;;AAKG;AAOH;;;;;;;;;;;;;;;;;;;AAmBG;MAKU,YAAY,CAAA;;IAEd,OAAO,GAAG,KAAK,CAAsB,MAAM;gFAAC;AAErD;;;AAGG;IACM,IAAI,GAAG,KAAK,CAA0B,IAAI;6EAAC;;IAG3C,KAAK,GAAG,KAAK,CAA2B,IAAI;8EAAC;;IAG7C,QAAQ,GAAG,KAAK,CAAC,KAAK,gFAAI,SAAS,EAAE,qBAAqB,EAAA,CAAG;;IAG7D,IAAI,GAAG,KAAK,CAAC,KAAK,4EAAI,SAAS,EAAE,qBAAqB,EAAA,CAAG;AAE/C,IAAA,OAAO,GAAG,QAAQ,CAAC,MAAK;AACzC,QAAA,MAAM,KAAK,GAAG,CAAC,eAAe,EAAE,CAAA,eAAA,EAAkB,IAAI,CAAC,OAAO,EAAE,CAAA,CAAE,CAAC;AACnE,QAAA,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE;AACxB,QAAA,IAAI,IAAI;AAAE,YAAA,KAAK,CAAC,IAAI,CAAC,uBAAuB,IAAI,CAAA,CAAE,CAAC;AACnD,QAAA,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE;AAC1B,QAAA,IAAI,KAAK;AAAE,YAAA,KAAK,CAAC,IAAI,CAAC,wBAAwB,KAAK,CAAA,CAAE,CAAC;QACtD,IAAI,IAAI,CAAC,QAAQ,EAAE;AAAE,YAAA,KAAK,CAAC,IAAI,CAAC,yBAAyB,CAAC;QAC1D,IAAI,IAAI,CAAC,IAAI,EAAE,IAAI,IAAI,CAA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