{"version":3,"file":"talenra-ngx-base-icons.mjs","sources":["../../../projects/ngx-base/icons/src/icon/icon.component.ts","../../../projects/ngx-base/icons/talenra-ngx-base-icons.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, effect, input } from '@angular/core';\nimport iconData from '@talenra/icons/meta.json';\nimport { IIconMeta } from './icon.types';\n\n/**\n * This Angular implementation of `@talenra-ui/icons` provides a simple and comfortable way to\n * use the Talenra icons in Angular apps.\n *\n * @example\n * <talenra-icon name=\"attach-file\" />\n *\n * #### Size\n *\n * Icons are designed to be used on `24px`, which is the default size returned by the component.\n * In some edge cases you might need to render the icon in a different size. The preferred way to set\n * the icons size is to use a stylesheet with a custom selector/rule to override the default size.\n * In very rare cases, it might make sense to set the size via the element's `style` attribute.\n *\n * ```html\n * <!-- Template / HTML -->\n * <talenra-icon class=\"my-icon\" name=\"attach-file\" />\n * ```\n *\n * ```scss\n * // Stylesheet / CSS\n * .my-icon {\n *   font-size: 18px;\n * }\n * ```\n *\n * #### Duplex (duo-tone, two colors)\n *\n * As for regular single-colored icons, the colors of duplex icons is typically set in your custom\n * stylesheet. In very rare cases, you might need to set the color via the element's `style` attribute\n * (e.g. if the color can be customized by the user or is picked randomly).\n *\n * ```html\n * <!-- Template / HTML -->\n * <talenra-icon name=\"person-checkmark-duplex\" />\n * <talenra-icon name=\"task-alt-duplex\" class=\"neon-colors\" />\n * ```\n *\n * ```scss\n * // Stylesheet / CSS\n * // Set default colors used for duplex icons in your app\n * .talenra-icon-duplex {\n *   --color-primary: black;\n *   --color-secondary: red;\n * }\n *\n * // Override default colors set above\n * .neon-colors {\n *   --color-primary: deeppink;\n *   --color-secondary: deepskyblue;\n * }\n * ```\n *\n * ### Import\n *\n * ```typescript\n * import { IconComponent } from '@talenra-ui/ngx-base/icons';\n * ```\n *\n * <example-url>../../../#/icons</example-url>\n */\n@Component({\n  selector: 'talenra-icon',\n  template: ``,\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  host: {\n    '[class]': '`talenra-icon talenra-icon--${name()}`',\n    '[class.talenra-icon-duplex]': 'iconsMeta[name()]?.duplex',\n  },\n})\nexport class IconComponent {\n  /** The name of the icon to be rendered. e.g. `'attach-file'` */\n  public name = input<string>('');\n\n  /** Object containing all icons metadata, indexed by icon name. */\n  private iconsMeta: Record<string, IIconMeta> = iconData.icons.reduce(\n    (icons, icon: IIconMeta) => ({ ...icons, [icon.name]: icon }),\n    {}\n  );\n\n  /** @internal */\n  constructor() {\n    // Throw warning if icon does not exist\n    effect(() => {\n      if (!(this.name() in this.iconsMeta)) {\n        console.warn(`@talenra-ui/ngx-base/icons, IconComponent: \"${this.name()}\" is not a valid icon name.`);\n      }\n    });\n  }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4DG;MAUU,aAAa,CAAA;;AAWxB,IAAA,WAAA,GAAA;;AATO,QAAA,IAAA,CAAA,IAAI,GAAG,KAAK,CAAS,EAAE,CAAC;;AAGvB,QAAA,IAAA,CAAA,SAAS,GAA8B,QAAQ,CAAC,KAAK,CAAC,MAAM,CAClE,CAAC,KAAK,EAAE,IAAe,MAAM,EAAE,GAAG,KAAK,EAAE,CAAC,IAAI,CAAC,IAAI,GAAG,IAAI,EAAE,CAAC,EAC7D,EAAE,CACH;;QAKC,MAAM,CAAC,MAAK;AACV,YAAA,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,IAAI,CAAC,SAAS,CAAC,EAAE;gBACpC,OAAO,CAAC,IAAI,CAAC,CAA+C,4CAAA,EAAA,IAAI,CAAC,IAAI,EAAE,CAA6B,2BAAA,CAAA,CAAC;;AAEzG,SAAC,CAAC;;8GAjBO,aAAa,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAb,IAAA,S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