{"version":3,"file":"sixbell-telco-sdk-components-text.mjs","sources":["../../../projects/sdk/components/text/src/text.component.ts","../../../projects/sdk/components/text/sixbell-telco-sdk-components-text.ts"],"sourcesContent":["import { NgTemplateOutlet } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, ElementRef, inject, input } from '@angular/core';\nimport { TextColor, TextDirective, TextLineClamp, TextOverflow, TextPreset, TextWeight } from '@sixbell-telco/sdk/directives/text';\n\n/** Supported HTML tags for the text component */\nexport type TextTag = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span' | 'div' | 'label';\n\n/**\n * A polymorphic text component that renders the correct semantic HTML tag\n * and delegates typography styling to the `TextDirective`.\n *\n * Use the `as` input to select the HTML tag. All typography inputs\n * (`preset`, `weight`, `color`, `overflow`) are forwarded to the inner `TextDirective`.\n *\n * @example\n * ```html\n * <st-text as=\"h1\" preset=\"1\">Hero Title</st-text>\n * <st-text as=\"p\" preset=\"7\" weight=\"bold\" class=\"mb-4\">Body text</st-text>\n * <st-text as=\"span\" preset=\"9\" color=\"primary\" class=\"uppercase\">Label</st-text>\n * ```\n *\n * @publicApi\n */\n@Component({\n\tselector: 'st-text',\n\tstandalone: true,\n\timports: [NgTemplateOutlet, TextDirective],\n\ttemplate: `\n\t\t<ng-template #contentTpl><ng-content /></ng-template>\n\t\t@switch (tag()) {\n\t\t\t@case ('h1') {\n\t\t\t\t<h1\n\t\t\t\t\t[stText]=\"preset()\"\n\t\t\t\t\t[stTextWeight]=\"weight()\"\n\t\t\t\t\t[stTextColor]=\"color()\"\n\t\t\t\t\t[stTextOverflow]=\"overflow()\"\n\t\t\t\t\t[stTextLineClamp]=\"lineClamp()\"\n\t\t\t\t\t[stTextClass]=\"hostStaticClasses\"\n\t\t\t\t>\n\t\t\t\t\t<ng-container [ngTemplateOutlet]=\"contentTpl\" />\n\t\t\t\t</h1>\n\t\t\t}\n\t\t\t@case ('h2') {\n\t\t\t\t<h2\n\t\t\t\t\t[stText]=\"preset()\"\n\t\t\t\t\t[stTextWeight]=\"weight()\"\n\t\t\t\t\t[stTextColor]=\"color()\"\n\t\t\t\t\t[stTextOverflow]=\"overflow()\"\n\t\t\t\t\t[stTextLineClamp]=\"lineClamp()\"\n\t\t\t\t\t[stTextClass]=\"hostStaticClasses\"\n\t\t\t\t>\n\t\t\t\t\t<ng-container [ngTemplateOutlet]=\"contentTpl\" />\n\t\t\t\t</h2>\n\t\t\t}\n\t\t\t@case ('h3') {\n\t\t\t\t<h3\n\t\t\t\t\t[stText]=\"preset()\"\n\t\t\t\t\t[stTextWeight]=\"weight()\"\n\t\t\t\t\t[stTextColor]=\"color()\"\n\t\t\t\t\t[stTextOverflow]=\"overflow()\"\n\t\t\t\t\t[stTextLineClamp]=\"lineClamp()\"\n\t\t\t\t\t[stTextClass]=\"hostStaticClasses\"\n\t\t\t\t>\n\t\t\t\t\t<ng-container [ngTemplateOutlet]=\"contentTpl\" />\n\t\t\t\t</h3>\n\t\t\t}\n\t\t\t@case ('h4') {\n\t\t\t\t<h4\n\t\t\t\t\t[stText]=\"preset()\"\n\t\t\t\t\t[stTextWeight]=\"weight()\"\n\t\t\t\t\t[stTextColor]=\"color()\"\n\t\t\t\t\t[stTextOverflow]=\"overflow()\"\n\t\t\t\t\t[stTextLineClamp]=\"lineClamp()\"\n\t\t\t\t\t[stTextClass]=\"hostStaticClasses\"\n\t\t\t\t>\n\t\t\t\t\t<ng-container [ngTemplateOutlet]=\"contentTpl\" />\n\t\t\t\t</h4>\n\t\t\t}\n\t\t\t@case ('h5') {\n\t\t\t\t<h5\n\t\t\t\t\t[stText]=\"preset()\"\n\t\t\t\t\t[stTextWeight]=\"weight()\"\n\t\t\t\t\t[stTextColor]=\"color()\"\n\t\t\t\t\t[stTextOverflow]=\"overflow()\"\n\t\t\t\t\t[stTextLineClamp]=\"lineClamp()\"\n\t\t\t\t\t[stTextClass]=\"hostStaticClasses\"\n\t\t\t\t>\n\t\t\t\t\t<ng-container [ngTemplateOutlet]=\"contentTpl\" />\n\t\t\t\t</h5>\n\t\t\t}\n\t\t\t@case ('h6') {\n\t\t\t\t<h6\n\t\t\t\t\t[stText]=\"preset()\"\n\t\t\t\t\t[stTextWeight]=\"weight()\"\n\t\t\t\t\t[stTextColor]=\"color()\"\n\t\t\t\t\t[stTextOverflow]=\"overflow()\"\n\t\t\t\t\t[stTextLineClamp]=\"lineClamp()\"\n\t\t\t\t\t[stTextClass]=\"hostStaticClasses\"\n\t\t\t\t>\n\t\t\t\t\t<ng-container [ngTemplateOutlet]=\"contentTpl\" />\n\t\t\t\t</h6>\n\t\t\t}\n\t\t\t@case ('span') {\n\t\t\t\t<span\n\t\t\t\t\t[stText]=\"preset()\"\n\t\t\t\t\t[stTextWeight]=\"weight()\"\n\t\t\t\t\t[stTextColor]=\"color()\"\n\t\t\t\t\t[stTextOverflow]=\"overflow()\"\n\t\t\t\t\t[stTextLineClamp]=\"lineClamp()\"\n\t\t\t\t\t[stTextClass]=\"hostStaticClasses\"\n\t\t\t\t>\n\t\t\t\t\t<ng-container [ngTemplateOutlet]=\"contentTpl\" />\n\t\t\t\t</span>\n\t\t\t}\n\t\t\t@case ('div') {\n\t\t\t\t<div\n\t\t\t\t\t[stText]=\"preset()\"\n\t\t\t\t\t[stTextWeight]=\"weight()\"\n\t\t\t\t\t[stTextColor]=\"color()\"\n\t\t\t\t\t[stTextOverflow]=\"overflow()\"\n\t\t\t\t\t[stTextLineClamp]=\"lineClamp()\"\n\t\t\t\t\t[stTextClass]=\"hostStaticClasses\"\n\t\t\t\t>\n\t\t\t\t\t<ng-container [ngTemplateOutlet]=\"contentTpl\" />\n\t\t\t\t</div>\n\t\t\t}\n\t\t\t@case ('label') {\n\t\t\t\t<!-- eslint-disable-next-line @angular-eslint/template/label-has-associated-control -->\n\t\t\t\t<label\n\t\t\t\t\t[stText]=\"preset()\"\n\t\t\t\t\t[stTextWeight]=\"weight()\"\n\t\t\t\t\t[stTextColor]=\"color()\"\n\t\t\t\t\t[stTextOverflow]=\"overflow()\"\n\t\t\t\t\t[stTextLineClamp]=\"lineClamp()\"\n\t\t\t\t\t[stTextClass]=\"hostStaticClasses\"\n\t\t\t\t>\n\t\t\t\t\t<ng-container [ngTemplateOutlet]=\"contentTpl\" />\n\t\t\t\t</label>\n\t\t\t}\n\t\t\t@default {\n\t\t\t\t<p\n\t\t\t\t\t[stText]=\"preset()\"\n\t\t\t\t\t[stTextWeight]=\"weight()\"\n\t\t\t\t\t[stTextColor]=\"color()\"\n\t\t\t\t\t[stTextOverflow]=\"overflow()\"\n\t\t\t\t\t[stTextLineClamp]=\"lineClamp()\"\n\t\t\t\t\t[stTextClass]=\"hostStaticClasses\"\n\t\t\t\t>\n\t\t\t\t\t<ng-container [ngTemplateOutlet]=\"contentTpl\" />\n\t\t\t\t</p>\n\t\t\t}\n\t\t}\n\t`,\n\thost: { style: 'display: contents' },\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TextComponent {\n\t/** HTML tag to render. Consumers use `as` in templates. @defaultValue 'p' */\n\t// eslint-disable-next-line @angular-eslint/no-input-rename\n\ttag = input<TextTag>('p', { alias: 'as' });\n\n\t/** Text preset (1 = largest, 10 = smallest). @defaultValue '7' */\n\tpreset = input<TextPreset>('7');\n\n\t/** Override the preset's default font weight. */\n\tweight = input<TextWeight>(undefined);\n\n\t/** Text color variant. @defaultValue 'base' */\n\tcolor = input<TextColor>('base');\n\n\t/** Text overflow handling. @defaultValue 'clip' */\n\toverflow = input<TextOverflow>('clip');\n\n\t/** Line clamp — limits visible text to a given number of lines. */\n\tlineClamp = input<TextLineClamp>(undefined);\n\n\t/** @internal Static classes captured from the host element before the first render. */\n\tprotected readonly hostStaticClasses = inject(ElementRef).nativeElement.getAttribute('class') ?? '';\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAOA;;;;;;;;;;;;;;;AAeG;MAsIU,aAAa,CAAA;;;IAGzB,GAAG,GAAG,KAAK,CAAU,G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