{"version":3,"file":"sixbell-telco-sdk-directives-typography.mjs","sources":["../../../projects/sdk/directives/typography/src/typography.directive.ts","../../../projects/sdk/directives/typography/sixbell-telco-sdk-directives-typography.ts"],"sourcesContent":["/* eslint-disable @angular-eslint/no-input-rename */\nimport { Directive, ElementRef, Renderer2, effect, inject, input } from '@angular/core';\nimport { cn } from '@sixbell-telco/sdk/utils/cn';\nimport { cva } from 'class-variance-authority';\n\n/**\n * @internal\n * CSS class generator for typography variants\n */\nconst typographyDirective = cva([], {\n\tvariants: {\n\t\tvariant: {\n\t\t\th1: ['text-[24px]', 'text-balance', 'font-heading', 'leading-tight', 'tracking-wide'],\n\t\t\th2: ['text-[20px]', 'text-balance', 'font-heading', 'leading-tight', 'tracking-wide'],\n\t\t\th3: ['text-[18px]', 'text-balance', 'font-heading', 'leading-tight', 'tracking-wide'],\n\t\t\th4: ['text-[16px]', 'text-balance', 'font-heading', 'leading-tight', 'tracking-wide'],\n\t\t\th5: ['text-[15px]', 'text-balance', 'font-heading', 'leading-tight', 'tracking-wide'],\n\t\t\th6: ['text-[14px]', 'text-balance', 'font-heading', 'leading-tight', 'tracking-wide'],\n\t\t\tbody: ['text-[14px]', 'text-pretty', 'font-body', 'leading-normal', 'tracking-tight'],\n\t\t\t'body-sm': ['text-[13px]', 'text-pretty', 'font-body', 'leading-normal', 'tracking-tight'],\n\t\t\t'body-xs': ['text-[12px]', 'text-pretty', 'font-body', 'leading-normal', 'tracking-tight'],\n\t\t\t'body-xxs': ['text-[11px]', 'text-pretty', 'font-body', 'leading-normal', 'tracking-tight'],\n\t\t\tinherit: ['font-body'],\n\t\t},\n\t\tcolor: {\n\t\t\tbase: 'text-base-content',\n\t\t\t'base-placeholder': 'text-neutral',\n\t\t\tinherit: 'text-inherit',\n\t\t},\n\t\tfontWeight: {\n\t\t\tbold: 'font-bold',\n\t\t\tsemibold: 'font-semibold',\n\t\t\tmedium: 'font-medium',\n\t\t\tnormal: 'font-normal',\n\t\t\tinherit: 'font-inherit',\n\t\t},\n\t\ttextOverflow: {\n\t\t\tclip: 'text-clip',\n\t\t\tellipsis: 'text-ellipsis',\n\t\t\ttruncate: 'text-truncate',\n\t\t},\n\t},\n\tcompoundVariants: [],\n\tdefaultVariants: {\n\t\tvariant: 'body',\n\t\tcolor: 'inherit',\n\t\tfontWeight: 'normal',\n\t\ttextOverflow: 'clip',\n\t},\n});\n\n/** Available typography heading and body variants */\nexport type TypographyVariantProps =\n\t| 'h1'\n\t| 'h2'\n\t| 'h3'\n\t| 'h4'\n\t| 'h5'\n\t| 'h6'\n\t| 'body'\n\t| 'body-sm'\n\t| 'body-xs'\n\t| 'body-xxs'\n\t| 'inherit'\n\t| null\n\t| undefined;\n\n/** Text color variants for typography */\nexport type TypographyColorProps = 'base' | 'base-placeholder' | 'inherit' | null | undefined;\n\n/** Font weight options for typography */\nexport type TypographyFontWeightProps = 'bold' | 'semibold' | 'medium' | 'normal' | 'inherit' | null | undefined;\n\n/** Text overflow handling methods */\nexport type TypographyTextOverflowProps = 'clip' | 'ellipsis' | 'truncate' | null | undefined;\n\n/** Configuration object for typography styles */\nexport type TypographyProps = {\n\tvariant?: TypographyVariantProps;\n\tcolor?: TypographyColorProps;\n\tfontWeight?: TypographyFontWeightProps;\n\ttextOverflow?: TypographyTextOverflowProps;\n};\n\n/**\n * A directive for applying consistent typography styles using Tailwind CSS\n *\n * @remarks\n * Applies text styling based on variant, color, weight, and overflow properties.\n * Uses Angular's signal-based inputs for reactive style updates.\n *\n * @example\n * ```html\n * <h1 typography tyVariant=\"h2\" tyColor=\"base\" tyFontWeight=\"bold\">\n *   Heading with custom typography\n * </h1>\n *\n * <p typography tyVariant=\"body-sm\" tyTextOverflow=\"ellipsis\">\n *   Small body text with ellipsis overflow\n * </p>\n * ```\n */\n@Directive({\n\t// eslint-disable-next-line @angular-eslint/directive-selector\n\tselector: '[typography]',\n\tstandalone: true,\n})\nexport class TypographyDirective {\n\t/**\n\t * Typography variant style (heading level or body type)\n\t * @alias tyVariant\n\t * @defaultValue 'body'\n\t */\n\tvariant = input<TypographyVariantProps>('body', { alias: 'tyVariant' });\n\n\t/**\n\t * Text color variant\n\t * @alias tyColor\n\t * @defaultValue 'inherit'\n\t */\n\tcolor = input<TypographyColorProps>('inherit', { alias: 'tyColor' });\n\n\t/**\n\t * Font weight variant\n\t * @alias tyFontWeight\n\t * @defaultValue 'normal'\n\t */\n\tfontWeight = input<TypographyFontWeightProps>('normal', { alias: 'tyFontWeight' });\n\n\t/**\n\t * Text overflow handling method\n\t * @alias tyTextOverflow\n\t * @defaultValue 'clip'\n\t */\n\ttextOverflow = input<TypographyTextOverflowProps>('clip', { alias: 'tyTextOverflow' });\n\n\t/** @internal Reference to host element */\n\tprivate element: ElementRef = inject(ElementRef);\n\n\t/** @internal Angular renderer instance */\n\tprivate renderer: Renderer2 = inject(Renderer2);\n\n\t/** @internal Effect to update classes when inputs change */\n\tclassListEffect = effect(() => {\n\t\tconst classList = cn(\n\t\t\ttypographyDirective({\n\t\t\t\tvariant: this.variant(),\n\t\t\t\tcolor: this.color(),\n\t\t\t\tfontWeight: this.fontWeight(),\n\t\t\t\ttextOverflow: this.textOverflow(),\n\t\t\t}),\n\t\t);\n\t\tthis.renderer.setAttribute(this.element.nativeElement, 'class', classList);\n\t});\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAAA;AAKA;;;AAGG;AACH,MAAM,mBAAmB,GAAG,GAAG,CAAC,EAAE,EAAE;AACnC,IAAA,QAAQ,EAAE;AACT,QAAA,OAAO,EAAE;YACR,EAAE,EAAE,CAAC,aAAa,EAAE,cAAc,EAAE,cAAc,EAAE,eAAe,EAAE,eAAe,CAAC;YACrF,EAAE,EAAE,CAAC,aAAa,EAAE,cAAc,EAAE,cAAc,EAAE,eAAe,EAAE,eAAe,CAAC;YACrF,EAAE,EAAE,CAAC,aAAa,EAAE,cAAc,EAAE,cAAc,EAAE,eAAe,EAAE,eAAe,CAAC;YACrF,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