{"version":3,"file":"tableau-ui-angular-icon.mjs","sources":["../../../projects/component-library/icon/src/icon.component.ts","../../../projects/component-library/icon/src/tableau-ui-icon.module.ts","../../../projects/component-library/icon/src/tableau-ui-angular-icon.ts"],"sourcesContent":["import type { InputSignal } from '@angular/core';\nimport { Component, input, computed, ChangeDetectionStrategy } from '@angular/core';\n@Component({\n  selector: 'tab-icon',\n  standalone: false,\n  template: ` {{ $value() }} `,\n  styleUrl: './icon.component.scss',\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  host: {\n    role: 'img',\n    class: 'tab-icon',\n    '[class.error]': \"$actualColor() === 'error'\",\n    '[class.primary]': \"$actualColor() === 'primary'\",\n    '[class.success]': \"$actualColor() === 'success'\",\n    '[style.font-family]': '$actualType()',\n    '[style.font-variation-settings]': '$fontVariationSettings()',\n    '[style.font-size]': '$actualFontSize()',\n  },\n})\nexport class IconComponent {\n  // nullable Signal type needs to be set explicitly -> ng-packagr strips nullability\n  /**\n   * The icon name to display.\n   * This should be a valid Material Symbols icon name.\n   * For example, 'home', 'settings', 'favorite', etc.\n   */\n  readonly $value = input<string>(undefined, {\n    alias: 'value',\n  });\n  // nullable Signal type needs to be set explicitly -> ng-packagr strips nullability\n  /**\n   * The color of the icon.\n   * Can be 'error', 'none', 'primary', 'success', or null.\n   * - 'error': Indicates an error state.\n   * - 'none'/null/undefined: No color applied.\n   * - 'primary': Indicates a primary action or state.\n   * - 'success': Indicates a successful action or state.\n   * @default undefined\n   */\n  readonly $color: InputSignal<'error' | 'none' | 'primary' | 'success' | null | undefined> = input<'error' | 'none' | 'primary' | 'success' | null>(undefined, {\n    alias: 'color',\n  });\n  /**\n   * The type of Material Symbols icon to use.\n   * Can be 'Material Symbols Outlined', 'Material Symbols Rounded', or 'Material Symbols Sharp'.\n   * - 'Material Symbols Outlined': Uses the outlined style of Material Symbols.\n   * - 'Material Symbols Rounded': Uses the rounded style of Material Symbols.\n   * - 'Material Symbols Sharp': Uses the sharp style of Material Symbols.\n   * @default 'Material Symbols Rounded'\n   */\n  readonly $type = input<'Material Symbols Outlined' | 'Material Symbols Rounded' | 'Material Symbols Sharp'>('Material Symbols Rounded', {\n    alias: 'type',\n  });\n  /**\n   * Whether to fill the icon with color.\n   * @default false\n   */\n  readonly $fill = input<boolean>(false, {\n    alias: 'fill',\n  });\n  /**\n   * The font size of the icon.\n   * This should be a valid CSS font size value, such as '16px', '1rem', '2em', etc.\n   * If not specified, the default font size will be used that is passed from outside.\n   * @default undefined\n   */\n  readonly $fontSize = input<string>(undefined, {\n    alias: 'fontSize',\n  });\n  /**\n   * The weight of the icon.\n   * Can be 100, 200, 300, 400, 500, 600, or 700.\n   * @default 400\n   */\n  readonly $weight = input<100 | 200 | 300 | 400 | 500 | 600 | 700>(400, {\n    alias: 'weight',\n  });\n  /**\n   * The grade of the icon.\n   * Can be -25, 0, or 200.\n   * - -25: Indicates a lighter grade.\n   * - 0: Indicates a normal grade.\n   * - 200: Indicates a heavier grade.\n   * @default 0\n   */\n  readonly $grade = input<-25 | 0 | 200>(0, {\n    alias: 'grade',\n  });\n  /**\n   * The optical size of the icon in pixels.\n   * Can be 20, 24, 40, or 48.\n   * - 20: Small optical size.\n   * - 24: Default optical size.\n   * - 40: Larger optical size.\n   * - 48: Extra large optical size.\n   * @default 24\n   */\n  readonly $opticalSizePx = input<20 | 24 | 40 | 48>(24, {\n    alias: 'opticalSizePx',\n  });\n\n  /**\n   * Used to pass all parameters as a single object except for value.\n   * This is useful for passing multiple parameters at once.\n   * @example\n   * <tab-icon value=\"home\" [params]=\"{ color: 'primary', type: 'Material Symbols Rounded', fill: true, weight: 500, grade: 0, opticalSizePx: 24 }\"></tab-icon>\n   * @default undefined\n   */\n  readonly $params = input<Partial<IconParams>>(undefined, {\n    alias: 'params',\n  });\n\n  private readonly $actualColor = computed(() => {\n    return this.$params()?.color ?? this.$color() ?? 'none';\n  });\n  private readonly $actualType = computed(() => {\n    return this.$params()?.type ?? this.$type();\n  });\n  private readonly $actualFontSize = computed(() => {\n    return this.$params()?.fontSize ?? this.$fontSize();\n  });\n  private readonly $actualFill = computed(() => {\n    return this.$params()?.fill ?? this.$fill();\n  });\n  private readonly $actualWeight = computed(() => {\n    return this.$params()?.weight ?? this.$weight();\n  });\n  private readonly $actualGrade = computed(() => {\n    return this.$params()?.grade ?? this.$grade();\n  });\n  private readonly $actualOpticalSizePx = computed(() => {\n    return this.$params()?.opticalSizePx ?? this.$opticalSizePx();\n  });\n\n  private readonly $fontVariationSettings = computed(() => {\n    return `'FILL' ${this.$actualFill() ? 1 : 0}, 'wght' ${this.$actualWeight()}, 'GRAD' ${this.$actualGrade()}, 'opsz' ${this.$actualOpticalSizePx()}`;\n  });\n}\nexport interface IconParams {\n  color?: 'error' | 'none' | 'primary' | 'success';\n  type?: 'Material Symbols Outlined' | 'Material Symbols Rounded' | 'Material Symbols Sharp';\n  fontSize?: string; // CSS font size value, e.g., '16px', '1rem', '2em'\n  fill?: boolean;\n  weight?: 100 | 200 | 300 | 400 | 500 | 600 | 700;\n  grade?: -25 | 0 | 200;\n  opticalSizePx?: 20 | 24 | 40 | 48;\n}\n","import { NgModule } from '@angular/core';\nimport { IconComponent } from './icon.component';\nimport { CommonModule } from '@angular/common';\n\n@NgModule({\n  imports: [CommonModule],\n  declarations: [IconComponent],\n  exports: [IconComponent],\n})\nexport class TableauUiIconModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;MAmBa,aAAa,CAAA;;AAExB;;;;AAIG;AACM,IAAA,MAAM,GAAG,KAAK,CAAS,SAAS,EAAE;AACzC,QAAA,KAAK,EAAE,OAAO;AACf,KAAA,CAAC;;AAEF;;;;;;;;AAQG;AACM,IAAA,MAAM,GAA6E,KAAK,CAAkD,SAAS,EAAE;AAC5J,QAAA,KAAK,EAAE,OAAO;AACf,KAAA,CAAC;AACF;;;;;;;AAOG;AACM,IAAA,KAAK,GAAG,KAAK,CAAsF,0BAA0B,EAAE;AACtI,QAAA,KAA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