@ascentgl/ads-icons 21.4.0 → 21.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -19,10 +19,10 @@ class AdsIconRegistry {
19
19
  }
20
20
  return this.registry.get(iconName);
21
21
  }
22
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: AdsIconRegistry, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
23
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: AdsIconRegistry, providedIn: 'root' }); }
22
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: AdsIconRegistry, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
23
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: AdsIconRegistry, providedIn: 'root' }); }
24
24
  }
25
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: AdsIconRegistry, decorators: [{
25
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: AdsIconRegistry, decorators: [{
26
26
  type: Injectable,
27
27
  args: [{
28
28
  providedIn: 'root',
@@ -63,6 +63,7 @@ class AdsIconComponent {
63
63
  white: '--color-white',
64
64
  'dark-50': '--color-dark-50',
65
65
  dark: '--color-dark',
66
+ light: '--color-light',
66
67
  link: '--color-link',
67
68
  secondaryHover: '--color-secondary-hover',
68
69
  };
@@ -138,10 +139,10 @@ class AdsIconComponent {
138
139
  getSvgElement() {
139
140
  return this.element.nativeElement.querySelector('svg');
140
141
  }
141
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: AdsIconComponent, deps: [{ token: i0.ElementRef }, { token: AdsIconRegistry }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component }); }
142
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.2", type: AdsIconComponent, isStandalone: false, selector: "ads-icon", inputs: { size: "size", name: "name", color: "color", theme: "theme", stroke: "stroke" }, usesOnChanges: true, ngImport: i0, template: '', isInline: true, styles: [":host{display:inline-flex;justify-content:center;align-items:center;width:32px;height:32px;font-size:32px;fill:currentColor}:host ::ng-deep [data-no-fill]{fill:none!important}:host ::ng-deep [data-no-stroke]{stroke:none!important}:host ::ng-deep [data-stroke-white]{stroke:var(--color-white)}:host ::ng-deep [data-fill-white]{fill:var(--color-white)}\n"] }); }
142
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: AdsIconComponent, deps: [{ token: i0.ElementRef }, { token: AdsIconRegistry }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component }); }
143
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.6", type: AdsIconComponent, isStandalone: false, selector: "ads-icon", inputs: { size: "size", name: "name", color: "color", theme: "theme", stroke: "stroke" }, usesOnChanges: true, ngImport: i0, template: '', isInline: true, styles: [":host{display:inline-flex;justify-content:center;align-items:center;width:32px;height:32px;font-size:32px;fill:currentColor}:host ::ng-deep [data-no-fill]{fill:none!important}:host ::ng-deep [data-no-stroke]{stroke:none!important}:host ::ng-deep [data-stroke-white]{stroke:var(--color-white)}:host ::ng-deep [data-fill-white]{fill:var(--color-white)}\n"] }); }
143
144
  }
144
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: AdsIconComponent, decorators: [{
145
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: AdsIconComponent, decorators: [{
145
146
  type: Component,
146
147
  args: [{ selector: 'ads-icon', template: '', standalone: false, styles: [":host{display:inline-flex;justify-content:center;align-items:center;width:32px;height:32px;font-size:32px;fill:currentColor}:host ::ng-deep [data-no-fill]{fill:none!important}:host ::ng-deep [data-no-stroke]{stroke:none!important}:host ::ng-deep [data-stroke-white]{stroke:var(--color-white)}:host ::ng-deep [data-fill-white]{fill:var(--color-white)}\n"] }]
147
148
  }], ctorParameters: () => [{ type: i0.ElementRef }, { type: AdsIconRegistry }, { type: i0.Renderer2 }], propDecorators: { size: [{
@@ -157,11 +158,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImpor
157
158
  }] } });
158
159
 
159
160
  class AdsIconModule {
160
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: AdsIconModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
161
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.0.2", ngImport: i0, type: AdsIconModule, declarations: [AdsIconComponent], exports: [AdsIconComponent] }); }
162
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: AdsIconModule }); }
161
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: AdsIconModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
162
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.0.6", ngImport: i0, type: AdsIconModule, declarations: [AdsIconComponent], exports: [AdsIconComponent] }); }
163
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: AdsIconModule }); }
163
164
  }
164
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: AdsIconModule, decorators: [{
165
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: AdsIconModule, decorators: [{
165
166
  type: NgModule,
166
167
  args: [{
167
168
  declarations: [AdsIconComponent],
@@ -1 +1 @@
1
- {"version":3,"file":"ascentgl-ads-icons.mjs","sources":["../../../../libs/ads-icons/src/lib/ads-icon-registry.service.ts","../../../../libs/ads-icons/src/lib/ads-icon.component.ts","../../../../libs/ads-icons/src/lib/ads-icon.module.ts","../../../../libs/ads-icons/src/public-api.ts","../../../../libs/ads-icons/src/ascentgl-ads-icons.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { AdsIcon } from '@ascentgl/ads-icons/icons';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class AdsIconRegistry {\n private registry = new Map<string, string>();\n\n public register(icons: AdsIcon | AdsIcon[]): void {\n if (Array.isArray(icons)) {\n icons.forEach((icon: AdsIcon) => this.registry.set(icon.name, icon.data));\n } else {\n this.registry.set(icons.name, icons.data);\n }\n }\n\n public get(iconName: string): string | undefined {\n if (!this.registry.has(iconName)) {\n console.warn(`Could not find a Ads Icon with the name ${iconName}. Did you add it to the icon registry?`);\n }\n\n return this.registry.get(iconName);\n }\n}\n","import { Component, ElementRef, Input, OnInit, Renderer2, OnChanges, SimpleChanges } from '@angular/core';\nimport { AdsIconRegistry } from './ads-icon-registry.service';\nimport { adsIcon } from '@ascentgl/ads-icons/icons';\n\ntype Sizes = {\n xxl: string;\n xl: string;\n lg: string;\n md: string;\n sm: string;\n xs: string;\n xxs: string;\n xxxs: string;\n xxxxs: string;\n auto: string;\n};\n\nexport type IconThemes = {\n iconPrimary: string;\n primary: string;\n secondary: string;\n secondaryHover: string;\n success: string;\n warn: string;\n white: string;\n 'dark-50': string;\n dark: string;\n link: string;\n 'medium-50': string;\n};\n\n@Component({\n selector: 'ads-icon',\n template: '',\n styleUrls: ['./ads-icon.component.scss'],\n standalone: false,\n})\nexport class AdsIconComponent implements OnInit, OnChanges {\n /**\n * The size of the icon\n */\n @Input() size: keyof Sizes = 'md';\n /**\n * The icon name\n */\n @Input() name!: adsIcon;\n /**\n * The color of the icon\n */\n @Input() color?: string;\n\n /**\n * The icon theme\n */\n @Input() theme?: keyof IconThemes;\n /**\n * The icon stroke\n */\n @Input() stroke?: keyof IconThemes;\n\n /** @ignore */\n private sizes: Sizes = {\n xxl: '128px',\n xl: '64px',\n lg: '48px',\n md: '32px',\n sm: '24px',\n xs: '20px',\n xxs: '14px',\n xxxs: '12px',\n xxxxs: '8px',\n auto: 'auto',\n };\n\n /** @ignore */\n private themes: IconThemes = {\n iconPrimary: '--color-medium',\n 'medium-50': '--color-medium-50',\n secondary: '--color-secondary',\n success: '--color-success',\n warn: '--color-error',\n primary: '--color-primary',\n white: '--color-white',\n 'dark-50': '--color-dark-50',\n dark: '--color-dark',\n link: '--color-link',\n secondaryHover: '--color-secondary-hover',\n };\n\n /** @ignore */\n constructor(\n private element: ElementRef,\n private registry: AdsIconRegistry,\n private renderer: Renderer2,\n ) {}\n\n /** @ignore */\n ngOnInit(): void {\n this.renderIcon();\n }\n\n /** @ignore */\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.size || changes.color || changes.theme || changes.stroke || changes.fill || changes.name) {\n this.renderIcon();\n }\n }\n\n /** @ignore */\n private renderIcon(): void {\n const iconSVG = this.registry.get(this.name);\n\n if (iconSVG) {\n this.element.nativeElement.innerHTML = iconSVG;\n this.updateSize();\n this.updateColor();\n this.updateTheme();\n this.updateStroke();\n } else {\n console.warn(`${this.name} is missing from the icon registry`);\n }\n }\n\n /** @ignore */\n private updateSize(): void {\n const size = this.sizes[this.size];\n this.renderer.setStyle(this.element.nativeElement, 'fontSize', size);\n this.renderer.setStyle(this.element.nativeElement, 'width', size);\n this.renderer.setStyle(this.element.nativeElement, 'height', size);\n\n const svgElement = this.getSvgElement();\n if (svgElement) {\n this.renderer.setStyle(svgElement, 'width', size);\n this.renderer.setStyle(svgElement, 'height', size);\n }\n }\n\n /** @ignore */\n private updateColor(): void {\n if (this.color) {\n const svg = this.element.nativeElement.querySelector('svg');\n this.renderer.setStyle(svg, 'fill', `var(${this.color})`);\n }\n }\n\n /** @ignore */\n private updateTheme(): void {\n if (this.theme) {\n const themeColor = this.themes[this.theme];\n if (themeColor) {\n this.renderer.setStyle(this.element.nativeElement, 'color', `var(${themeColor})`);\n } else {\n console.warn(\n `${this.theme} is not a valid ads-icon theme. Valid themes include: 'iconPrimary', 'primary', 'secondary', 'success', 'warn', 'white'`,\n );\n }\n }\n }\n\n /** @ignore */\n private updateStroke(): void {\n if (this.stroke) {\n const strokeColor = this.themes[this.stroke];\n if (strokeColor) {\n this.renderer.setStyle(this.element.nativeElement, 'stroke', `var(${strokeColor})`);\n } else {\n console.warn(\n `${this.stroke} is not a valid ads-icon stroke. Valid strokes include: 'iconPrimary', 'primary', 'secondary', 'success', 'warn', 'white', 'dark-50', 'dark'`,\n );\n }\n }\n }\n\n /** @ignore */\n private getSvgElement(): SVGElement | null {\n return this.element.nativeElement.querySelector('svg');\n }\n}\n","import { NgModule } from '@angular/core';\nimport { AdsIconComponent } from './ads-icon.component';\n\n@NgModule({\n declarations: [AdsIconComponent],\n exports: [AdsIconComponent],\n})\nexport class AdsIconModule {}\n","/*\n * Public API Surface of ads-icons\n */\n\nexport * from './lib/ads-icon-registry.service';\nexport * from './lib/ads-icon.component';\nexport * from './lib/ads-icon.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1.AdsIconRegistry"],"mappings":";;;MAMa,eAAe,CAAA;AAH5B,IAAA,WAAA,GAAA;AAIU,QAAA,IAAA,CAAA,QAAQ,GAAG,IAAI,GAAG,EAAkB;AAiB7C,IAAA;AAfQ,IAAA,QAAQ,CAAC,KAA0B,EAAA;AACxC,QAAA,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;YACxB,KAAK,CAAC,OAAO,CAAC,CAAC,IAAa,KAAK,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAA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N5B,SAAS;+BACE,UAAU,EAAA,QAAA,EACV,EAAE,EAAA,UAAA,EAEA,KAAK,EAAA,MAAA,EAAA,CAAA,kWAAA,CAAA,EAAA;;sBAMhB;;sBAIA;;sBAIA;;sBAKA;;sBAIA;;;MCnDU,aAAa,CAAA;8GAAb,aAAa,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;+GAAb,aAAa,EAAA,YAAA,EAAA,CAHT,gBAAgB,CAAA,EAAA,OAAA,EAAA,CACrB,gBAAgB,CAAA,EAAA,CAAA,CAAA;+GAEf,aAAa,EAAA,CAAA,CAAA;;2FAAb,aAAa,EAAA,UAAA,EAAA,CAAA;kBAJzB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,YAAY,EAAE,CAAC,gBAAgB,CAAC;oBAChC,OAAO,EAAE,CAAC,gBAAgB,CAAC;AAC5B,iBAAA;;;ACND;;AAEG;;ACFH;;AAEG;;;;"}
1
+ {"version":3,"file":"ascentgl-ads-icons.mjs","sources":["../../../../libs/ads-icons/src/lib/ads-icon-registry.service.ts","../../../../libs/ads-icons/src/lib/ads-icon.component.ts","../../../../libs/ads-icons/src/lib/ads-icon.module.ts","../../../../libs/ads-icons/src/public-api.ts","../../../../libs/ads-icons/src/ascentgl-ads-icons.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { AdsIcon } from '@ascentgl/ads-icons/icons';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class AdsIconRegistry {\n private registry = new Map<string, string>();\n\n public register(icons: AdsIcon | AdsIcon[]): void {\n if (Array.isArray(icons)) {\n icons.forEach((icon: AdsIcon) => this.registry.set(icon.name, icon.data));\n } else {\n this.registry.set(icons.name, icons.data);\n }\n }\n\n public get(iconName: string): string | undefined {\n if (!this.registry.has(iconName)) {\n console.warn(`Could not find a Ads Icon with the name ${iconName}. Did you add it to the icon registry?`);\n }\n\n return this.registry.get(iconName);\n }\n}\n","import { Component, ElementRef, Input, OnInit, Renderer2, OnChanges, SimpleChanges } from '@angular/core';\nimport { AdsIconRegistry } from './ads-icon-registry.service';\nimport { adsIcon } from '@ascentgl/ads-icons/icons';\n\ntype Sizes = {\n xxl: string;\n xl: string;\n lg: string;\n md: string;\n sm: string;\n xs: string;\n xxs: string;\n xxxs: string;\n xxxxs: string;\n auto: string;\n};\n\nexport type IconThemes = {\n iconPrimary: string;\n primary: string;\n secondary: string;\n secondaryHover: string;\n success: string;\n warn: string;\n white: string;\n 'dark-50': string;\n dark: string;\n link: string;\n 'medium-50': string;\n light: string;\n};\n\n@Component({\n selector: 'ads-icon',\n template: '',\n styleUrls: ['./ads-icon.component.scss'],\n standalone: false,\n})\nexport class AdsIconComponent implements OnInit, OnChanges {\n /**\n * The size of the icon\n */\n @Input() size: keyof Sizes = 'md';\n /**\n * The icon name\n */\n @Input() name!: adsIcon;\n /**\n * The color of the icon\n */\n @Input() color?: string;\n\n /**\n * The icon theme\n */\n @Input() theme?: keyof IconThemes;\n /**\n * The icon stroke\n */\n @Input() stroke?: keyof IconThemes;\n\n /** @ignore */\n private sizes: Sizes = {\n xxl: '128px',\n xl: '64px',\n lg: '48px',\n md: '32px',\n sm: '24px',\n xs: '20px',\n xxs: '14px',\n xxxs: '12px',\n xxxxs: '8px',\n auto: 'auto',\n };\n\n /** @ignore */\n private themes: IconThemes = {\n iconPrimary: '--color-medium',\n 'medium-50': '--color-medium-50',\n secondary: '--color-secondary',\n success: '--color-success',\n warn: '--color-error',\n primary: '--color-primary',\n white: '--color-white',\n 'dark-50': '--color-dark-50',\n dark: '--color-dark',\n light: '--color-light',\n link: '--color-link',\n secondaryHover: '--color-secondary-hover',\n };\n\n /** @ignore */\n constructor(\n private element: ElementRef,\n private registry: AdsIconRegistry,\n private renderer: Renderer2,\n ) {}\n\n /** @ignore */\n ngOnInit(): void {\n this.renderIcon();\n }\n\n /** @ignore */\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.size || changes.color || changes.theme || changes.stroke || changes.fill || changes.name) {\n this.renderIcon();\n }\n }\n\n /** @ignore */\n private renderIcon(): void {\n const iconSVG = this.registry.get(this.name);\n\n if (iconSVG) {\n this.element.nativeElement.innerHTML = iconSVG;\n this.updateSize();\n this.updateColor();\n this.updateTheme();\n this.updateStroke();\n } else {\n console.warn(`${this.name} is missing from the icon registry`);\n }\n }\n\n /** @ignore */\n private updateSize(): void {\n const size = this.sizes[this.size];\n this.renderer.setStyle(this.element.nativeElement, 'fontSize', size);\n this.renderer.setStyle(this.element.nativeElement, 'width', size);\n this.renderer.setStyle(this.element.nativeElement, 'height', size);\n\n const svgElement = this.getSvgElement();\n if (svgElement) {\n this.renderer.setStyle(svgElement, 'width', size);\n this.renderer.setStyle(svgElement, 'height', size);\n }\n }\n\n /** @ignore */\n private updateColor(): void {\n if (this.color) {\n const svg = this.element.nativeElement.querySelector('svg');\n this.renderer.setStyle(svg, 'fill', `var(${this.color})`);\n }\n }\n\n /** @ignore */\n private updateTheme(): void {\n if (this.theme) {\n const themeColor = this.themes[this.theme];\n if (themeColor) {\n this.renderer.setStyle(this.element.nativeElement, 'color', `var(${themeColor})`);\n } else {\n console.warn(\n `${this.theme} is not a valid ads-icon theme. Valid themes include: 'iconPrimary', 'primary', 'secondary', 'success', 'warn', 'white'`,\n );\n }\n }\n }\n\n /** @ignore */\n private updateStroke(): void {\n if (this.stroke) {\n const strokeColor = this.themes[this.stroke];\n if (strokeColor) {\n this.renderer.setStyle(this.element.nativeElement, 'stroke', `var(${strokeColor})`);\n } else {\n console.warn(\n `${this.stroke} is not a valid ads-icon stroke. Valid strokes include: 'iconPrimary', 'primary', 'secondary', 'success', 'warn', 'white', 'dark-50', 'dark'`,\n );\n }\n }\n }\n\n /** @ignore */\n private getSvgElement(): SVGElement | null {\n return this.element.nativeElement.querySelector('svg');\n }\n}\n","import { NgModule } from '@angular/core';\nimport { AdsIconComponent } from './ads-icon.component';\n\n@NgModule({\n declarations: [AdsIconComponent],\n exports: [AdsIconComponent],\n})\nexport class AdsIconModule {}\n","/*\n * Public API Surface of ads-icons\n */\n\nexport * from './lib/ads-icon-registry.service';\nexport * from './lib/ads-icon.component';\nexport * from './lib/ads-icon.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1.AdsIconRegistry"],"mappings":";;;MAMa,eAAe,CAAA;AAH5B,IAAA,WAAA,GAAA;AAIU,QAAA,IAAA,CAAA,QAAQ,GAAG,IAAI,GAAG,EAAkB;AAiB7C,IAAA;AAfQ,IAAA,QAAQ,CAAC,KAA0B,EAAA;AACxC,QAAA,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;YACxB,KAAK,CAAC,OAAO,CAAC,CAAC,IAAa,KAAK,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3E;aAAO;AACL,YAAA,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC;QAC3C;IACF;AAEO,IAAA,GAAG,CAAC,QAAgB,EAAA;QACzB,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE;AAChC,YAAA,OAAO,CAAC,IAAI,CAAC,2CAA2C,QAAQ,CAAA,sCAAA,CAAwC,CAAC;QAC3G;QAEA,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC;IACpC;8GAjBW,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAf,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,eAAe,cAFd,MAAM,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CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ascentgl/ads-icons",
3
- "version": "21.4.0",
3
+ "version": "21.5.0",
4
4
  "description": "This library was generated with [Nx](https://nx.dev).",
5
5
  "main": "jest.config.js",
6
6
  "author": "Sergii Sichkar",
@@ -34,6 +34,7 @@ type IconThemes = {
34
34
  dark: string;
35
35
  link: string;
36
36
  'medium-50': string;
37
+ light: string;
37
38
  };
38
39
  declare class AdsIconComponent implements OnInit, OnChanges {
39
40
  private element;