sn-card 0.0.2

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.
package/README.md ADDED
@@ -0,0 +1,24 @@
1
+ # SnCard
2
+
3
+ This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 21.0.0.
4
+
5
+ ## Code scaffolding
6
+
7
+ Run `ng generate component component-name --project snCard` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project snCard`.
8
+ > Note: Don't forget to add `--project snCard` or else it will be added to the default project in your `angular.json` file.
9
+
10
+ ## Build
11
+
12
+ Run `ng build snCard` to build the project. The build artifacts will be stored in the `dist/` directory.
13
+
14
+ ## Publishing
15
+
16
+ After building your library with `ng build snCard`, go to the dist folder `cd dist/sn-card` and run `npm publish`.
17
+
18
+ ## Running unit tests
19
+
20
+ Run `ng test snCard` to execute the unit tests via [Karma](https://karma-runner.github.io).
21
+
22
+ ## Further help
23
+
24
+ To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
@@ -0,0 +1,7 @@
1
+ {
2
+ "$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
3
+ "dest": "../../dist/sn-card",
4
+ "lib": {
5
+ "entryFile": "src/public-api.ts"
6
+ }
7
+ }
package/package.json ADDED
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "sn-card",
3
+ "version": "0.0.2",
4
+ "description": "Angular card component for displaying content in containers - SnUI Library",
5
+ "author": {
6
+ "name": "Swapnil Nakate",
7
+ "email": "nakate.swapnil7@gmail.com",
8
+ "url": "https://swapnilnakate.in"
9
+ },
10
+ "peerDependencies": {
11
+ "@angular/common": "^21.0.0",
12
+ "@angular/core": "^21.0.0",
13
+ "autoprefixer": "^10.4.19",
14
+ "postcss": "^8.4.40",
15
+ "tailwindcss": "^3.4.7"
16
+ },
17
+ "dependencies": {
18
+ "tslib": "^2.3.0"
19
+ },
20
+ "sideEffects": false,
21
+ "bugs": {
22
+ "url": "https://github.com/swapnilnakate7/sn-ui/issues",
23
+ "email": "nakate.swapnil7@gmail.com"
24
+ },
25
+ "repository": {
26
+ "url": "https://github.com/swapnilnakate7/sn-ui",
27
+ "type": "git",
28
+ "directory": "projects/sn-card"
29
+ },
30
+ "license": "MIT"
31
+ }
@@ -0,0 +1,23 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { SnCardComponent } from './sn-card.component';
4
+
5
+ describe('SnCardComponent', () => {
6
+ let component: SnCardComponent;
7
+ let fixture: ComponentFixture<SnCardComponent>;
8
+
9
+ beforeEach(async () => {
10
+ await TestBed.configureTestingModule({
11
+ imports: [SnCardComponent]
12
+ })
13
+ .compileComponents();
14
+
15
+ fixture = TestBed.createComponent(SnCardComponent);
16
+ component = fixture.componentInstance;
17
+ fixture.detectChanges();
18
+ });
19
+
20
+ it('should create', () => {
21
+ expect(component).toBeTruthy();
22
+ });
23
+ });
@@ -0,0 +1,22 @@
1
+ import { Component, Input, OnInit } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+
4
+ @Component({
5
+ selector: 'sn-card',
6
+ standalone: true,
7
+ imports: [CommonModule],
8
+ templateUrl: './sn-card.html',
9
+ styleUrl: 'sn-card.scss',
10
+ })
11
+ export class SnCardComponent implements OnInit {
12
+
13
+
14
+ @Input() title?: string;
15
+ _imageSrc : string="https://picsum.photos/200";
16
+ _actions: any[] = []
17
+
18
+ ngOnInit(): void {
19
+ // this._imageSrc ="";
20
+ }
21
+
22
+ }
@@ -0,0 +1,36 @@
1
+ <div class="grid grid-flow-row grid-cols-12 grid-card-row
2
+ gap-1
3
+ w-full pt-4 container border rounded-md shadow-md">
4
+
5
+ @if (_imageSrc) {
6
+ <div class="col-span-2 row-span-1 p-2">
7
+ <img [src]="_imageSrc" class="rounded-xl" />
8
+ </div>
9
+ }
10
+
11
+
12
+ <div class="col-span-10 row-span-1">
13
+ @if(title){
14
+ <h1 class="text-3xl font-bold text-center">{{title}}</h1>
15
+ }
16
+ <div class="text-left">
17
+ <ng-content></ng-content>
18
+ </div>
19
+ </div>
20
+
21
+ @if(_actions.length){
22
+ <div class="row-span-1 col-span-12 flex text-sm justify-center">
23
+ <div class="flex-1 shadow-sm text-center border-t-2
24
+ hover:shadow-inner">Action 1</div>
25
+ <div class="flex-1 shadow-sm text-center border-t-2
26
+ hover:shadow-inner border-l-2 -ml-1">Action 2</div>
27
+
28
+ </div>
29
+ }
30
+
31
+ <!-- <div class="row-span-1 col-span-6 shadow-sm text-center border-t-2 border-r-gray-600 hover:shadow-inner">Action 1</div>
32
+ <div class="row-span-1 col-span-6 shadow-sm text-center border-t-2 hover:shadow-inner">Action 2</div>
33
+ -->
34
+ </div>
35
+
36
+
@@ -0,0 +1,17 @@
1
+ @tailwind base;
2
+ @tailwind components;
3
+ @tailwind utilities;
4
+ .card {
5
+ background: #ffffff;
6
+ border: 1px solid #ececec;
7
+ border-radius: 0.625rem;
8
+ padding: 0.625rem;
9
+ box-shadow: 0 4px 10px #00000008, 0 0 2px #0000000f, 0 2px 6px #0000001f;
10
+ .card-title {
11
+ text-align: center;
12
+ }
13
+ }
14
+
15
+ .grid-card-row{
16
+ grid-template-rows: auto 2rem;
17
+ }
@@ -0,0 +1,16 @@
1
+ import { TestBed } from '@angular/core/testing';
2
+
3
+ import { SnCardService } from './sn-card.service';
4
+
5
+ describe('SnCardService', () => {
6
+ let service: SnCardService;
7
+
8
+ beforeEach(() => {
9
+ TestBed.configureTestingModule({});
10
+ service = TestBed.inject(SnCardService);
11
+ });
12
+
13
+ it('should be created', () => {
14
+ expect(service).toBeTruthy();
15
+ });
16
+ });
@@ -0,0 +1,9 @@
1
+ import { Injectable } from '@angular/core';
2
+
3
+ @Injectable({
4
+ providedIn: 'root'
5
+ })
6
+ export class SnCardService {
7
+
8
+ constructor() { }
9
+ }
@@ -0,0 +1,6 @@
1
+ /*
2
+ * Public API Surface of sn-card
3
+ */
4
+
5
+ export * from './lib/sn-card.service';
6
+ export * from './lib/sn-card.component';
@@ -0,0 +1,14 @@
1
+ /* To learn more about this file see: https://angular.io/config/tsconfig. */
2
+ {
3
+ "extends": "../../tsconfig.json",
4
+ "compilerOptions": {
5
+ "outDir": "../../out-tsc/lib",
6
+ "declaration": true,
7
+ "declarationMap": true,
8
+ "inlineSources": true,
9
+ "types": []
10
+ },
11
+ "exclude": [
12
+ "**/*.spec.ts"
13
+ ]
14
+ }
@@ -0,0 +1,10 @@
1
+ /* To learn more about this file see: https://angular.io/config/tsconfig. */
2
+ {
3
+ "extends": "./tsconfig.lib.json",
4
+ "compilerOptions": {
5
+ "declarationMap": false
6
+ },
7
+ "angularCompilerOptions": {
8
+ "compilationMode": "partial"
9
+ }
10
+ }
@@ -0,0 +1,14 @@
1
+ /* To learn more about this file see: https://angular.io/config/tsconfig. */
2
+ {
3
+ "extends": "../../tsconfig.json",
4
+ "compilerOptions": {
5
+ "outDir": "../../out-tsc/spec",
6
+ "types": [
7
+ "jasmine"
8
+ ]
9
+ },
10
+ "include": [
11
+ "**/*.spec.ts",
12
+ "**/*.d.ts"
13
+ ]
14
+ }