{"version":3,"file":"ngwr-divider.mjs","sources":["../../../projects/lib/divider/divider.ts","../../../projects/lib/divider/ngwr-divider.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 { coerceNumberProperty } from '@angular/cdk/coercion';\nimport { Component, ViewEncapsulation, computed, input } from '@angular/core';\n\nimport type { WrColor } from 'ngwr/theme';\n\nimport type { WrDividerAlign, WrDividerType } from './interfaces';\n\n/**\n * Horizontal separator line. Projected content renders as a label\n * inline with the line (split into two halves on either side).\n *\n * @example\n * ```html\n * <wr-divider />\n * <wr-divider type=\"dashed\" color=\"primary\" [width]=\"2\" />\n * <wr-divider>OR</wr-divider>\n * <wr-divider align=\"start\">Section</wr-divider>\n * ```\n *\n * @see https://ngwr.dev/components/divider\n */\n@Component({\n  selector: 'wr-divider',\n  template: '<ng-content />',\n  encapsulation: ViewEncapsulation.None,\n  host: {\n    role: 'separator',\n    '[class]': 'classes()',\n    '[style.--wr-divider-width.px]': 'width()',\n  },\n})\nexport class WrDivider {\n  /**\n   * Color of the divider line. Omit for the neutral default.\n   *\n   * @default null\n   */\n  readonly color = input<WrColor | null>(null);\n\n  /**\n   * Line style.\n   *\n   * @default 'solid'\n   */\n  readonly type = input<WrDividerType>('solid');\n\n  /**\n   * Line width in pixels.\n   *\n   * @default 1\n   */\n  readonly width = input(1, { transform: (v: unknown): number => coerceNumberProperty(v, 1) });\n\n  /**\n   * Label position. Only meaningful when the divider has projected\n   * content — otherwise the line is symmetric and alignment has no\n   * visible effect.\n   *\n   * @default 'center'\n   */\n  readonly align = input<WrDividerAlign>('center');\n\n  protected readonly classes = computed(() => {\n    const parts = ['wr-divider', `wr-divider--${this.type()}`];\n    const color = this.color();\n    if (color) parts.push(`wr-divider--${color}`);\n    const align = this.align();\n    if (align !== 'center') parts.push(`wr-divider--${align}`);\n    return parts.join(' ');\n  });\n}\n","/**\n * Generated bundle index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