Skip to content

Commit

Permalink
feat(sf-icon-add): new component
Browse files Browse the repository at this point in the history
  • Loading branch information
runyasak committed Sep 5, 2023
1 parent a927af8 commit 7cdccb2
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 0 deletions.
2 changes: 2 additions & 0 deletions projects/ng-storefront-ui/src/lib/sf-icons/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export * from './sf-icon-add/sf-icon-add.component';

export * from './sf-icon-base/sf-icon-base.component';

export * from './sf-icon-chevron-right/sf-icon-chevron-right.component';
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { SfIconAddComponent } from './sf-icon-add.component';

describe('SfIconAddComponent', () => {
let component: SfIconAddComponent;
let fixture: ComponentFixture<SfIconAddComponent>;

beforeEach(() => {
TestBed.configureTestingModule({
imports: [SfIconAddComponent],
});
fixture = TestBed.createComponent(SfIconAddComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
import { CommonModule } from '@angular/common';
import { SfIconSize } from '../../../types';
import { SfIconBaseComponent } from '../sf-icon-base/sf-icon-base.component';

@Component({
selector: 'sf-icon-add',
standalone: true,
imports: [CommonModule, SfIconBaseComponent],
template: `<sf-icon-base [size]="size" viewBox="0 0 24 24" data-testid="add">
<svg:path
d="M12 19a.965.965 0 0 1-.712-.288A.965.965 0 0 1 11 18v-5H6a.968.968 0 0 1-.713-.288A.967.967 0 0 1 5 12a.97.97 0 0 1 .287-.713A.97.97 0 0 1 6 11h5V6c0-.283.096-.521.288-.713A.967.967 0 0 1 12 5a.97.97 0 0 1 .713.287A.97.97 0 0 1 13 6v5h5a.97.97 0 0 1 .712.287c.192.192.288.43.288.713s-.096.52-.288.712A.965.965 0 0 1 18 13h-5v5a.97.97 0 0 1-.287.712A.968.968 0 0 1 12 19Z"
/>
</sf-icon-base>`,
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class SfIconAddComponent {
@Input() size: keyof typeof SfIconSize = SfIconSize.base;
}

0 comments on commit 7cdccb2

Please sign in to comment.