@tekus/design-system 0.0.71 → 1.0.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.
- package/.eslintrc.json +37 -0
- package/.releaserc.json +70 -0
- package/.storybook/main.ts +19 -0
- package/.storybook/preview.ts +18 -0
- package/.storybook/tsconfig.json +23 -0
- package/.storybook/typings.d.ts +4 -0
- package/components/search-bar/index.ts +1 -0
- package/components/search-bar/ng-package.json +5 -0
- package/components/search-bar/public-api.ts +1 -0
- package/components/search-bar/search-bar.component.css +46 -0
- package/components/search-bar/search-bar.component.spec.ts +21 -0
- package/components/search-bar/search-bar.component.stories.ts +28 -0
- package/components/search-bar/search-bar.component.ts +78 -0
- package/documentation.json +353 -0
- package/index.ts +1 -0
- package/karma-ci.conf.js +54 -0
- package/karma.conf.js +33 -0
- package/ng-package.json +7 -0
- package/package.json +23 -17
- package/tsconfig.lib.json +14 -0
- package/tsconfig.lib.prod.json +10 -0
- package/tsconfig.spec.json +14 -0
- package/esm2022/index.mjs +0 -2
- package/esm2022/tekus-design-system.mjs +0 -5
- package/fesm2022/tekus-design-system.mjs +0 -4
- package/fesm2022/tekus-design-system.mjs.map +0 -1
- package/index.d.ts +0 -1
package/.eslintrc.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "../../.eslintrc.json",
|
|
3
|
+
"ignorePatterns": [
|
|
4
|
+
"!**/*"
|
|
5
|
+
],
|
|
6
|
+
"overrides": [
|
|
7
|
+
{
|
|
8
|
+
"files": [
|
|
9
|
+
"*.ts"
|
|
10
|
+
],
|
|
11
|
+
"rules": {
|
|
12
|
+
"@angular-eslint/directive-selector": [
|
|
13
|
+
"error",
|
|
14
|
+
{
|
|
15
|
+
"type": "attribute",
|
|
16
|
+
"prefix": "lib",
|
|
17
|
+
"style": "camelCase"
|
|
18
|
+
}
|
|
19
|
+
],
|
|
20
|
+
"@angular-eslint/component-selector": [
|
|
21
|
+
"error",
|
|
22
|
+
{
|
|
23
|
+
"type": "element",
|
|
24
|
+
"prefix": "lib",
|
|
25
|
+
"style": "kebab-case"
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"files": [
|
|
32
|
+
"*.html"
|
|
33
|
+
],
|
|
34
|
+
"rules": {}
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
}
|
package/.releaserc.json
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
{
|
|
2
|
+
"release": {
|
|
3
|
+
"branches": [
|
|
4
|
+
"master",
|
|
5
|
+
"develop"
|
|
6
|
+
],
|
|
7
|
+
"plugins": [
|
|
8
|
+
[
|
|
9
|
+
"@semantic-release/commit-analyzer",
|
|
10
|
+
{
|
|
11
|
+
"preset": "angular",
|
|
12
|
+
"releaseRules": [
|
|
13
|
+
{
|
|
14
|
+
"type": "breaking",
|
|
15
|
+
"release": "major"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"type": "refactor",
|
|
19
|
+
"release": "patch"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"type": "config",
|
|
23
|
+
"release": "patch"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"scope": "no-release",
|
|
27
|
+
"release": false
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"scope": "test",
|
|
31
|
+
"release": false
|
|
32
|
+
}
|
|
33
|
+
],
|
|
34
|
+
"parserOpts": {
|
|
35
|
+
"noteKeywords": [
|
|
36
|
+
"BREAKING CHANGE",
|
|
37
|
+
"BREAKING CHANGES",
|
|
38
|
+
"BREAKING"
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
[
|
|
44
|
+
"@semantic-release/release-notes-generator",
|
|
45
|
+
{
|
|
46
|
+
"preset": "angular",
|
|
47
|
+
"parserOpts": {
|
|
48
|
+
"noteKeywords": [
|
|
49
|
+
"BREAKING CHANGE",
|
|
50
|
+
"BREAKING CHANGES",
|
|
51
|
+
"BREAKING"
|
|
52
|
+
]
|
|
53
|
+
},
|
|
54
|
+
"writerOpts": {
|
|
55
|
+
"commitsSort": [
|
|
56
|
+
"subject",
|
|
57
|
+
"scope"
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
],
|
|
62
|
+
[
|
|
63
|
+
"@semantic-release/npm",
|
|
64
|
+
{
|
|
65
|
+
"pkgRoot": "dist/design-system"
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
]
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { StorybookConfig } from '@storybook/angular';
|
|
2
|
+
|
|
3
|
+
const config: StorybookConfig = {
|
|
4
|
+
stories: ['../**/*.mdx', '../**/*.stories.@(js|jsx|mjs|ts|tsx)'],
|
|
5
|
+
addons: [
|
|
6
|
+
'@storybook/addon-a11y',
|
|
7
|
+
'@storybook/addon-links',
|
|
8
|
+
'@storybook/addon-essentials',
|
|
9
|
+
'@storybook/addon-interactions',
|
|
10
|
+
],
|
|
11
|
+
framework: {
|
|
12
|
+
name: '@storybook/angular',
|
|
13
|
+
options: {},
|
|
14
|
+
},
|
|
15
|
+
docs: {
|
|
16
|
+
autodocs: 'tag',
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
export default config;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Preview } from "@storybook/angular";
|
|
2
|
+
import { setCompodocJson } from "@storybook/addon-docs/angular";
|
|
3
|
+
import docJson from "../documentation.json";
|
|
4
|
+
setCompodocJson(docJson);
|
|
5
|
+
|
|
6
|
+
const preview: Preview = {
|
|
7
|
+
parameters: {
|
|
8
|
+
actions: { argTypesRegex: "^on[A-Z].*" },
|
|
9
|
+
controls: {
|
|
10
|
+
matchers: {
|
|
11
|
+
color: /(background|color)$/i,
|
|
12
|
+
date: /Date$/i,
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default preview;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "../tsconfig.lib.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"types": [
|
|
5
|
+
"node"
|
|
6
|
+
],
|
|
7
|
+
"allowSyntheticDefaultImports": true,
|
|
8
|
+
"resolveJsonModule": true
|
|
9
|
+
},
|
|
10
|
+
"exclude": [
|
|
11
|
+
"../test.ts",
|
|
12
|
+
"../**/*.spec.ts"
|
|
13
|
+
],
|
|
14
|
+
"include": [
|
|
15
|
+
"../**/*",
|
|
16
|
+
"./preview.ts",
|
|
17
|
+
"../stories/**/*",
|
|
18
|
+
"../projects/**/*"
|
|
19
|
+
],
|
|
20
|
+
"files": [
|
|
21
|
+
"./typings.d.ts"
|
|
22
|
+
]
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './public-api';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './search-bar.component';
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
* {
|
|
2
|
+
margin: 0;
|
|
3
|
+
padding: 0;
|
|
4
|
+
box-sizing: border-box;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.search__bar {
|
|
8
|
+
display: flex;
|
|
9
|
+
cursor: pointer;
|
|
10
|
+
max-width: 15rem;
|
|
11
|
+
padding: 0.3rem 0;
|
|
12
|
+
width: fit-content;
|
|
13
|
+
align-items: center;
|
|
14
|
+
justify-content: center;
|
|
15
|
+
background-color: white;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.search__bar:hover {
|
|
19
|
+
border-bottom: 2px solid black;
|
|
20
|
+
.search__bar__input {
|
|
21
|
+
width: 13rem;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.search__bar__input {
|
|
26
|
+
width: 0;
|
|
27
|
+
border: none;
|
|
28
|
+
outline: none;
|
|
29
|
+
font-weight: 500;
|
|
30
|
+
background: transparent;
|
|
31
|
+
transition: all ease-in-out 0.5s;
|
|
32
|
+
font-size: clamp(0.8rem, 0.675rem + 0.333vw, 0.975rem);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.search__bar__input:focus {
|
|
36
|
+
width: 13rem;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.search__bar__clear__mark__icon {
|
|
40
|
+
margin: 0 0.5rem;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.search__bar__clear__mark__icon:hover {
|
|
44
|
+
scale: 1.3;
|
|
45
|
+
transition: all ease-in-out 0.1s;
|
|
46
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { SearchBarComponent } from './search-bar.component';
|
|
4
|
+
|
|
5
|
+
describe('SearchBarComponent', () => {
|
|
6
|
+
let component: SearchBarComponent;
|
|
7
|
+
let fixture: ComponentFixture<SearchBarComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(() => {
|
|
10
|
+
TestBed.configureTestingModule({
|
|
11
|
+
imports: [SearchBarComponent]
|
|
12
|
+
});
|
|
13
|
+
fixture = TestBed.createComponent(SearchBarComponent);
|
|
14
|
+
component = fixture.componentInstance;
|
|
15
|
+
fixture.detectChanges();
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('should create', () => {
|
|
19
|
+
expect(component).toBeTruthy();
|
|
20
|
+
});
|
|
21
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/angular';
|
|
2
|
+
import { SearchBarComponent } from './search-bar.component';
|
|
3
|
+
|
|
4
|
+
const meta: Meta<SearchBarComponent> = {
|
|
5
|
+
title: 'Components/Search bar',
|
|
6
|
+
component: SearchBarComponent,
|
|
7
|
+
tags: ['autodocs'],
|
|
8
|
+
render: (args: SearchBarComponent) => ({
|
|
9
|
+
props: {
|
|
10
|
+
backgroundColor: null,
|
|
11
|
+
...args,
|
|
12
|
+
},
|
|
13
|
+
}),
|
|
14
|
+
argTypes: {
|
|
15
|
+
backgroundColor: {
|
|
16
|
+
control: 'color',
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export default meta;
|
|
22
|
+
type Story = StoryObj<SearchBarComponent>;
|
|
23
|
+
|
|
24
|
+
export const Default: Story = {
|
|
25
|
+
args: {
|
|
26
|
+
hintLabel: 'Search...',
|
|
27
|
+
},
|
|
28
|
+
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Input,
|
|
3
|
+
Output,
|
|
4
|
+
Component,
|
|
5
|
+
ViewChild,
|
|
6
|
+
ElementRef,
|
|
7
|
+
EventEmitter,
|
|
8
|
+
} from '@angular/core';
|
|
9
|
+
import { FormsModule } from '@angular/forms';
|
|
10
|
+
import { NgClass, NgStyle, NgIf } from '@angular/common';
|
|
11
|
+
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
|
12
|
+
import { faMagnifyingGlass, faXmark } from '@fortawesome/pro-solid-svg-icons';
|
|
13
|
+
|
|
14
|
+
@Component({
|
|
15
|
+
selector: 'lib-tks-search-bar',
|
|
16
|
+
standalone: true,
|
|
17
|
+
imports: [NgIf, NgClass, NgStyle, FormsModule, FontAwesomeModule],
|
|
18
|
+
template: `<div
|
|
19
|
+
class="search__bar"
|
|
20
|
+
(mouseenter)="onMouseEnter()"
|
|
21
|
+
[ngStyle]="{ 'background-color': backgroundColor }"
|
|
22
|
+
>
|
|
23
|
+
<input
|
|
24
|
+
class="search__bar__input"
|
|
25
|
+
type="text"
|
|
26
|
+
#searchInput
|
|
27
|
+
[(ngModel)]="inputValue"
|
|
28
|
+
[placeholder]="hintLabel"
|
|
29
|
+
(input)="onInputChange()"
|
|
30
|
+
/>
|
|
31
|
+
<fa-icon
|
|
32
|
+
class="search__bar__clear__mark__icon"
|
|
33
|
+
[icon]="faXmark"
|
|
34
|
+
*ngIf="inputValue !== ''"
|
|
35
|
+
(click)="onInputClear()"
|
|
36
|
+
></fa-icon>
|
|
37
|
+
<fa-icon [icon]="faMagnifyingGlass"></fa-icon>
|
|
38
|
+
</div>`,
|
|
39
|
+
styleUrls: ['./search-bar.component.css'],
|
|
40
|
+
})
|
|
41
|
+
export class SearchBarComponent {
|
|
42
|
+
public inputValue = '';
|
|
43
|
+
public readonly faXmark = faXmark;
|
|
44
|
+
public readonly faMagnifyingGlass = faMagnifyingGlass;
|
|
45
|
+
|
|
46
|
+
@ViewChild('searchInput', { static: false }) searchInput!: ElementRef;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Search bar hint label
|
|
50
|
+
*/
|
|
51
|
+
@Input()
|
|
52
|
+
hintLabel = '';
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* What background color to use
|
|
56
|
+
*/
|
|
57
|
+
@Input()
|
|
58
|
+
backgroundColor?: string;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Input changes handler
|
|
62
|
+
*/
|
|
63
|
+
@Output()
|
|
64
|
+
inputValueChange = new EventEmitter<string>();
|
|
65
|
+
|
|
66
|
+
public onInputChange(): void {
|
|
67
|
+
this.inputValueChange.emit(this.inputValue);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
public onMouseEnter(): void {
|
|
71
|
+
this.searchInput.nativeElement.focus();
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
public onInputClear() {
|
|
75
|
+
this.inputValue = '';
|
|
76
|
+
this.inputValueChange.emit('');
|
|
77
|
+
}
|
|
78
|
+
}
|
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
{
|
|
2
|
+
"pipes": [],
|
|
3
|
+
"interfaces": [],
|
|
4
|
+
"injectables": [],
|
|
5
|
+
"guards": [],
|
|
6
|
+
"interceptors": [],
|
|
7
|
+
"classes": [],
|
|
8
|
+
"directives": [],
|
|
9
|
+
"components": [
|
|
10
|
+
{
|
|
11
|
+
"name": "SearchBarComponent",
|
|
12
|
+
"id": "component-SearchBarComponent-156c4af21a25c48d8e250fbc16afa094a51bca6928ab043169ccde6bdbe7f4f454ea3d4227dbcdcedae5f2248272488deb1fbe87782b500473a684e3318701d3",
|
|
13
|
+
"file": "projects/design-system/components/search-bar/search-bar.component.ts",
|
|
14
|
+
"encapsulation": [],
|
|
15
|
+
"entryComponents": [],
|
|
16
|
+
"inputs": [],
|
|
17
|
+
"outputs": [],
|
|
18
|
+
"providers": [],
|
|
19
|
+
"selector": "lib-tks-search-bar",
|
|
20
|
+
"styleUrls": [
|
|
21
|
+
"./search-bar.component.css"
|
|
22
|
+
],
|
|
23
|
+
"styles": [],
|
|
24
|
+
"template": "<div class=\"search__bar\"\n (mouseenter)=\"onMouseEnter()\"\n [ngStyle]=\"{ 'background-color': backgroundColor }\"\n >\n <input\n class=\"search__bar__input\"\n type=\"text\"\n #searchInput\n [(ngModel)]=\"inputValue\"\n [placeholder]=\"hintLabel\"\n (input)=\"onInputChange()\"\n />\n <fa-icon\n class=\"search__bar__clear__mark__icon\"\n [icon]=\"faXmark\"\n *ngIf=\"inputValue !== ''\"\n (click)=\"onInputClear()\"\n ></fa-icon>\n <fa-icon [icon]=\"faMagnifyingGlass\"></fa-icon>\n </div>",
|
|
25
|
+
"templateUrl": [],
|
|
26
|
+
"viewProviders": [],
|
|
27
|
+
"hostDirectives": [],
|
|
28
|
+
"inputsClass": [
|
|
29
|
+
{
|
|
30
|
+
"name": "backgroundColor",
|
|
31
|
+
"deprecated": false,
|
|
32
|
+
"deprecationMessage": "",
|
|
33
|
+
"rawdescription": "\n\nWhat background color to use\n",
|
|
34
|
+
"description": "<p>What background color to use</p>\n",
|
|
35
|
+
"line": 58,
|
|
36
|
+
"type": "string",
|
|
37
|
+
"decorators": []
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"name": "hintLabel",
|
|
41
|
+
"defaultValue": "''",
|
|
42
|
+
"deprecated": false,
|
|
43
|
+
"deprecationMessage": "",
|
|
44
|
+
"rawdescription": "\n\nSearch bar hint label\n",
|
|
45
|
+
"description": "<p>Search bar hint label</p>\n",
|
|
46
|
+
"line": 52,
|
|
47
|
+
"type": "string",
|
|
48
|
+
"decorators": []
|
|
49
|
+
}
|
|
50
|
+
],
|
|
51
|
+
"outputsClass": [
|
|
52
|
+
{
|
|
53
|
+
"name": "inputValueChange",
|
|
54
|
+
"defaultValue": "new EventEmitter<string>()",
|
|
55
|
+
"deprecated": false,
|
|
56
|
+
"deprecationMessage": "",
|
|
57
|
+
"rawdescription": "\n\nInput changes handler\n",
|
|
58
|
+
"description": "<p>Input changes handler</p>\n",
|
|
59
|
+
"line": 64,
|
|
60
|
+
"type": "EventEmitter"
|
|
61
|
+
}
|
|
62
|
+
],
|
|
63
|
+
"propertiesClass": [
|
|
64
|
+
{
|
|
65
|
+
"name": "faMagnifyingGlass",
|
|
66
|
+
"defaultValue": "faMagnifyingGlass",
|
|
67
|
+
"deprecated": false,
|
|
68
|
+
"deprecationMessage": "",
|
|
69
|
+
"type": "",
|
|
70
|
+
"optional": false,
|
|
71
|
+
"description": "",
|
|
72
|
+
"line": 44,
|
|
73
|
+
"modifierKind": [
|
|
74
|
+
125,
|
|
75
|
+
148
|
|
76
|
+
]
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"name": "faXmark",
|
|
80
|
+
"defaultValue": "faXmark",
|
|
81
|
+
"deprecated": false,
|
|
82
|
+
"deprecationMessage": "",
|
|
83
|
+
"type": "",
|
|
84
|
+
"optional": false,
|
|
85
|
+
"description": "",
|
|
86
|
+
"line": 43,
|
|
87
|
+
"modifierKind": [
|
|
88
|
+
125,
|
|
89
|
+
148
|
|
90
|
+
]
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"name": "inputValue",
|
|
94
|
+
"defaultValue": "''",
|
|
95
|
+
"deprecated": false,
|
|
96
|
+
"deprecationMessage": "",
|
|
97
|
+
"type": "string",
|
|
98
|
+
"optional": false,
|
|
99
|
+
"description": "",
|
|
100
|
+
"line": 42,
|
|
101
|
+
"modifierKind": [
|
|
102
|
+
125
|
|
103
|
+
]
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"name": "searchInput",
|
|
107
|
+
"deprecated": false,
|
|
108
|
+
"deprecationMessage": "",
|
|
109
|
+
"type": "ElementRef",
|
|
110
|
+
"optional": false,
|
|
111
|
+
"description": "",
|
|
112
|
+
"line": 46,
|
|
113
|
+
"decorators": [
|
|
114
|
+
{
|
|
115
|
+
"name": "ViewChild",
|
|
116
|
+
"stringifiedArguments": "'searchInput', {static: false}"
|
|
117
|
+
}
|
|
118
|
+
],
|
|
119
|
+
"modifierKind": [
|
|
120
|
+
170
|
|
121
|
+
]
|
|
122
|
+
}
|
|
123
|
+
],
|
|
124
|
+
"methodsClass": [
|
|
125
|
+
{
|
|
126
|
+
"name": "onInputChange",
|
|
127
|
+
"args": [],
|
|
128
|
+
"optional": false,
|
|
129
|
+
"returnType": "void",
|
|
130
|
+
"typeParameters": [],
|
|
131
|
+
"line": 66,
|
|
132
|
+
"deprecated": false,
|
|
133
|
+
"deprecationMessage": "",
|
|
134
|
+
"modifierKind": [
|
|
135
|
+
125
|
|
136
|
+
]
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"name": "onInputClear",
|
|
140
|
+
"args": [],
|
|
141
|
+
"optional": false,
|
|
142
|
+
"returnType": "void",
|
|
143
|
+
"typeParameters": [],
|
|
144
|
+
"line": 74,
|
|
145
|
+
"deprecated": false,
|
|
146
|
+
"deprecationMessage": "",
|
|
147
|
+
"modifierKind": [
|
|
148
|
+
125
|
|
149
|
+
]
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"name": "onMouseEnter",
|
|
153
|
+
"args": [],
|
|
154
|
+
"optional": false,
|
|
155
|
+
"returnType": "void",
|
|
156
|
+
"typeParameters": [],
|
|
157
|
+
"line": 70,
|
|
158
|
+
"deprecated": false,
|
|
159
|
+
"deprecationMessage": "",
|
|
160
|
+
"modifierKind": [
|
|
161
|
+
125
|
|
162
|
+
]
|
|
163
|
+
}
|
|
164
|
+
],
|
|
165
|
+
"deprecated": false,
|
|
166
|
+
"deprecationMessage": "",
|
|
167
|
+
"hostBindings": [],
|
|
168
|
+
"hostListeners": [],
|
|
169
|
+
"standalone": true,
|
|
170
|
+
"imports": [
|
|
171
|
+
{
|
|
172
|
+
"name": "NgIf"
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
"name": "NgClass"
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
"name": "NgStyle"
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
"name": "FormsModule",
|
|
182
|
+
"type": "module"
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"name": "FontAwesomeModule",
|
|
186
|
+
"type": "module"
|
|
187
|
+
}
|
|
188
|
+
],
|
|
189
|
+
"description": "",
|
|
190
|
+
"rawdescription": "\n",
|
|
191
|
+
"type": "component",
|
|
192
|
+
"sourceCode": "import {\r\n Input,\r\n Output,\r\n Component,\r\n ViewChild,\r\n ElementRef,\r\n EventEmitter,\r\n} from '@angular/core';\r\nimport { FormsModule } from '@angular/forms';\r\nimport { NgClass, NgStyle, NgIf } from '@angular/common';\r\nimport { FontAwesomeModule } from '@fortawesome/angular-fontawesome';\r\nimport { faMagnifyingGlass, faXmark } from '@fortawesome/pro-solid-svg-icons';\r\n\r\n@Component({\r\n selector: 'lib-tks-search-bar',\r\n standalone: true,\r\n imports: [NgIf, NgClass, NgStyle, FormsModule, FontAwesomeModule],\r\n template: `<div\r\n class=\"search__bar\"\r\n (mouseenter)=\"onMouseEnter()\"\r\n [ngStyle]=\"{ 'background-color': backgroundColor }\"\r\n >\r\n <input\r\n class=\"search__bar__input\"\r\n type=\"text\"\r\n #searchInput\r\n [(ngModel)]=\"inputValue\"\r\n [placeholder]=\"hintLabel\"\r\n (input)=\"onInputChange()\"\r\n />\r\n <fa-icon\r\n class=\"search__bar__clear__mark__icon\"\r\n [icon]=\"faXmark\"\r\n *ngIf=\"inputValue !== ''\"\r\n (click)=\"onInputClear()\"\r\n ></fa-icon>\r\n <fa-icon [icon]=\"faMagnifyingGlass\"></fa-icon>\r\n </div>`,\r\n styleUrls: ['./search-bar.component.css'],\r\n})\r\nexport class SearchBarComponent {\r\n public inputValue = '';\r\n public readonly faXmark = faXmark;\r\n public readonly faMagnifyingGlass = faMagnifyingGlass;\r\n\r\n @ViewChild('searchInput', { static: false }) searchInput!: ElementRef;\r\n\r\n /**\r\n * Search bar hint label\r\n */\r\n @Input()\r\n hintLabel = '';\r\n\r\n /**\r\n * What background color to use\r\n */\r\n @Input()\r\n backgroundColor?: string;\r\n\r\n /**\r\n * Input changes handler\r\n */\r\n @Output()\r\n inputValueChange = new EventEmitter<string>();\r\n\r\n public onInputChange(): void {\r\n this.inputValueChange.emit(this.inputValue);\r\n }\r\n\r\n public onMouseEnter(): void {\r\n this.searchInput.nativeElement.focus();\r\n }\r\n\r\n public onInputClear() {\r\n this.inputValue = '';\r\n this.inputValueChange.emit('');\r\n }\r\n}\r\n",
|
|
193
|
+
"assetsDirs": [],
|
|
194
|
+
"styleUrlsData": [
|
|
195
|
+
{
|
|
196
|
+
"data": "* {\r\n margin: 0;\r\n padding: 0;\r\n box-sizing: border-box;\r\n}\r\n\r\n.search__bar {\r\n display: flex;\r\n cursor: pointer;\r\n max-width: 15rem;\r\n padding: 0.3rem 0;\r\n width: fit-content;\r\n align-items: center;\r\n justify-content: center;\r\n background-color: white;\r\n}\r\n\r\n.search__bar:hover {\r\n border-bottom: 2px solid black;\r\n .search__bar__input {\r\n width: 13rem;\r\n }\r\n}\r\n\r\n.search__bar__input {\r\n width: 0;\r\n border: none;\r\n outline: none;\r\n font-weight: 500;\r\n background: transparent;\r\n transition: all ease-in-out 0.5s;\r\n font-size: clamp(0.8rem, 0.675rem + 0.333vw, 0.975rem);\r\n}\r\n\r\n.search__bar__input:focus {\r\n width: 13rem;\r\n}\r\n\r\n.search__bar__clear__mark__icon {\r\n margin: 0 0.5rem;\r\n}\r\n\r\n.search__bar__clear__mark__icon:hover {\r\n scale: 1.3;\r\n transition: all ease-in-out 0.1s;\r\n}\r\n",
|
|
197
|
+
"styleUrl": "./search-bar.component.css"
|
|
198
|
+
}
|
|
199
|
+
],
|
|
200
|
+
"stylesData": "",
|
|
201
|
+
"extends": []
|
|
202
|
+
}
|
|
203
|
+
],
|
|
204
|
+
"modules": [],
|
|
205
|
+
"miscellaneous": {
|
|
206
|
+
"variables": [
|
|
207
|
+
{
|
|
208
|
+
"name": "Default",
|
|
209
|
+
"ctype": "miscellaneous",
|
|
210
|
+
"subtype": "variable",
|
|
211
|
+
"file": "projects/design-system/components/search-bar/search-bar.component.stories.ts",
|
|
212
|
+
"deprecated": false,
|
|
213
|
+
"deprecationMessage": "",
|
|
214
|
+
"type": "Story",
|
|
215
|
+
"defaultValue": "{\r\n args: {\r\n hintLabel: 'Search...',\r\n },\r\n}"
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
"name": "meta",
|
|
219
|
+
"ctype": "miscellaneous",
|
|
220
|
+
"subtype": "variable",
|
|
221
|
+
"file": "projects/design-system/components/search-bar/search-bar.component.stories.ts",
|
|
222
|
+
"deprecated": false,
|
|
223
|
+
"deprecationMessage": "",
|
|
224
|
+
"type": "Meta<SearchBarComponent>",
|
|
225
|
+
"defaultValue": "{\r\n title: 'Components/Search bar',\r\n component: SearchBarComponent,\r\n tags: ['autodocs'],\r\n render: (args: SearchBarComponent) => ({\r\n props: {\r\n backgroundColor: null,\r\n ...args,\r\n },\r\n }),\r\n argTypes: {\r\n backgroundColor: {\r\n control: 'color',\r\n },\r\n },\r\n}"
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
"name": "preview",
|
|
229
|
+
"ctype": "miscellaneous",
|
|
230
|
+
"subtype": "variable",
|
|
231
|
+
"file": "projects/design-system/.storybook/preview.ts",
|
|
232
|
+
"deprecated": false,
|
|
233
|
+
"deprecationMessage": "",
|
|
234
|
+
"type": "Preview",
|
|
235
|
+
"defaultValue": "{\n parameters: {\n actions: { argTypesRegex: \"^on[A-Z].*\" },\n controls: {\n matchers: {\n color: /(background|color)$/i,\n date: /Date$/i,\n },\n },\n },\n}"
|
|
236
|
+
}
|
|
237
|
+
],
|
|
238
|
+
"functions": [],
|
|
239
|
+
"typealiases": [
|
|
240
|
+
{
|
|
241
|
+
"name": "Story",
|
|
242
|
+
"ctype": "miscellaneous",
|
|
243
|
+
"subtype": "typealias",
|
|
244
|
+
"rawtype": "StoryObj<SearchBarComponent>",
|
|
245
|
+
"file": "projects/design-system/components/search-bar/search-bar.component.stories.ts",
|
|
246
|
+
"deprecated": false,
|
|
247
|
+
"deprecationMessage": "",
|
|
248
|
+
"description": "",
|
|
249
|
+
"kind": 183
|
|
250
|
+
}
|
|
251
|
+
],
|
|
252
|
+
"enumerations": [],
|
|
253
|
+
"groupedVariables": {
|
|
254
|
+
"projects/design-system/components/search-bar/search-bar.component.stories.ts": [
|
|
255
|
+
{
|
|
256
|
+
"name": "Default",
|
|
257
|
+
"ctype": "miscellaneous",
|
|
258
|
+
"subtype": "variable",
|
|
259
|
+
"file": "projects/design-system/components/search-bar/search-bar.component.stories.ts",
|
|
260
|
+
"deprecated": false,
|
|
261
|
+
"deprecationMessage": "",
|
|
262
|
+
"type": "Story",
|
|
263
|
+
"defaultValue": "{\r\n args: {\r\n hintLabel: 'Search...',\r\n },\r\n}"
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
"name": "meta",
|
|
267
|
+
"ctype": "miscellaneous",
|
|
268
|
+
"subtype": "variable",
|
|
269
|
+
"file": "projects/design-system/components/search-bar/search-bar.component.stories.ts",
|
|
270
|
+
"deprecated": false,
|
|
271
|
+
"deprecationMessage": "",
|
|
272
|
+
"type": "Meta<SearchBarComponent>",
|
|
273
|
+
"defaultValue": "{\r\n title: 'Components/Search bar',\r\n component: SearchBarComponent,\r\n tags: ['autodocs'],\r\n render: (args: SearchBarComponent) => ({\r\n props: {\r\n backgroundColor: null,\r\n ...args,\r\n },\r\n }),\r\n argTypes: {\r\n backgroundColor: {\r\n control: 'color',\r\n },\r\n },\r\n}"
|
|
274
|
+
}
|
|
275
|
+
],
|
|
276
|
+
"projects/design-system/.storybook/preview.ts": [
|
|
277
|
+
{
|
|
278
|
+
"name": "preview",
|
|
279
|
+
"ctype": "miscellaneous",
|
|
280
|
+
"subtype": "variable",
|
|
281
|
+
"file": "projects/design-system/.storybook/preview.ts",
|
|
282
|
+
"deprecated": false,
|
|
283
|
+
"deprecationMessage": "",
|
|
284
|
+
"type": "Preview",
|
|
285
|
+
"defaultValue": "{\n parameters: {\n actions: { argTypesRegex: \"^on[A-Z].*\" },\n controls: {\n matchers: {\n color: /(background|color)$/i,\n date: /Date$/i,\n },\n },\n },\n}"
|
|
286
|
+
}
|
|
287
|
+
]
|
|
288
|
+
},
|
|
289
|
+
"groupedFunctions": {},
|
|
290
|
+
"groupedEnumerations": {},
|
|
291
|
+
"groupedTypeAliases": {
|
|
292
|
+
"projects/design-system/components/search-bar/search-bar.component.stories.ts": [
|
|
293
|
+
{
|
|
294
|
+
"name": "Story",
|
|
295
|
+
"ctype": "miscellaneous",
|
|
296
|
+
"subtype": "typealias",
|
|
297
|
+
"rawtype": "StoryObj<SearchBarComponent>",
|
|
298
|
+
"file": "projects/design-system/components/search-bar/search-bar.component.stories.ts",
|
|
299
|
+
"deprecated": false,
|
|
300
|
+
"deprecationMessage": "",
|
|
301
|
+
"description": "",
|
|
302
|
+
"kind": 183
|
|
303
|
+
}
|
|
304
|
+
]
|
|
305
|
+
}
|
|
306
|
+
},
|
|
307
|
+
"routes": [],
|
|
308
|
+
"coverage": {
|
|
309
|
+
"count": 6,
|
|
310
|
+
"status": "low",
|
|
311
|
+
"files": [
|
|
312
|
+
{
|
|
313
|
+
"filePath": "projects/design-system/.storybook/preview.ts",
|
|
314
|
+
"type": "variable",
|
|
315
|
+
"linktype": "miscellaneous",
|
|
316
|
+
"linksubtype": "variable",
|
|
317
|
+
"name": "preview",
|
|
318
|
+
"coveragePercent": 0,
|
|
319
|
+
"coverageCount": "0/1",
|
|
320
|
+
"status": "low"
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
"filePath": "projects/design-system/components/search-bar/search-bar.component.stories.ts",
|
|
324
|
+
"type": "variable",
|
|
325
|
+
"linktype": "miscellaneous",
|
|
326
|
+
"linksubtype": "variable",
|
|
327
|
+
"name": "Default",
|
|
328
|
+
"coveragePercent": 0,
|
|
329
|
+
"coverageCount": "0/1",
|
|
330
|
+
"status": "low"
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
"filePath": "projects/design-system/components/search-bar/search-bar.component.stories.ts",
|
|
334
|
+
"type": "variable",
|
|
335
|
+
"linktype": "miscellaneous",
|
|
336
|
+
"linksubtype": "variable",
|
|
337
|
+
"name": "meta",
|
|
338
|
+
"coveragePercent": 0,
|
|
339
|
+
"coverageCount": "0/1",
|
|
340
|
+
"status": "low"
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
"filePath": "projects/design-system/components/search-bar/search-bar.component.ts",
|
|
344
|
+
"type": "component",
|
|
345
|
+
"linktype": "component",
|
|
346
|
+
"name": "SearchBarComponent",
|
|
347
|
+
"coveragePercent": 27,
|
|
348
|
+
"coverageCount": "3/11",
|
|
349
|
+
"status": "medium"
|
|
350
|
+
}
|
|
351
|
+
]
|
|
352
|
+
}
|
|
353
|
+
}
|
package/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/karma-ci.conf.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// Karma configuration file, see link for more information
|
|
2
|
+
// https://karma-runner.github.io/1.0/config/configuration-file.html
|
|
3
|
+
|
|
4
|
+
module.exports = function (config) {
|
|
5
|
+
config.set({
|
|
6
|
+
basePath: "",
|
|
7
|
+
frameworks: ["jasmine", "@angular-devkit/build-angular"],
|
|
8
|
+
plugins: [
|
|
9
|
+
require("karma-jasmine"),
|
|
10
|
+
require("karma-chrome-launcher"),
|
|
11
|
+
require("karma-jasmine-html-reporter"),
|
|
12
|
+
require("karma-coverage"),
|
|
13
|
+
require("@angular-devkit/build-angular/plugins/karma"),
|
|
14
|
+
],
|
|
15
|
+
client: {
|
|
16
|
+
clearContext: false, // leave Jasmine Spec Runner output visible in browser
|
|
17
|
+
},
|
|
18
|
+
jasmineHtmlReporter: {
|
|
19
|
+
suppressAll: true, // removes the duplicated traces
|
|
20
|
+
},
|
|
21
|
+
coverageReporter: {
|
|
22
|
+
dir: require("path").join(__dirname, "../../coverage/design-system"),
|
|
23
|
+
subdir: ".",
|
|
24
|
+
reporters: [{ type: "lcov" }],
|
|
25
|
+
fixWebpackSourcePaths: true,
|
|
26
|
+
thresholds: {
|
|
27
|
+
statements: 50,
|
|
28
|
+
lines: 50,
|
|
29
|
+
branches: 50,
|
|
30
|
+
functions: 50,
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
reporters: ["progress", "kjhtml"],
|
|
34
|
+
port: 9876,
|
|
35
|
+
colors: true,
|
|
36
|
+
logLevel: config.LOG_INFO,
|
|
37
|
+
autoWatch: false,
|
|
38
|
+
restartOnFileChange: true,
|
|
39
|
+
browsers: ["ChromeHeadless"],
|
|
40
|
+
customLaunchers: {
|
|
41
|
+
ChromeHeadless: {
|
|
42
|
+
base: "Chrome",
|
|
43
|
+
flags: [
|
|
44
|
+
"--headless",
|
|
45
|
+
"--disable-gpu",
|
|
46
|
+
"--no-sandbox",
|
|
47
|
+
"--remote-debugging-port=9222",
|
|
48
|
+
],
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
singleRun: true,
|
|
52
|
+
browserNoActivityTimeout: 40000,
|
|
53
|
+
});
|
|
54
|
+
};
|
package/karma.conf.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// Karma configuration file, see link for more information
|
|
2
|
+
// https://karma-runner.github.io/1.0/config/configuration-file.html
|
|
3
|
+
|
|
4
|
+
module.exports = function (config) {
|
|
5
|
+
config.set({
|
|
6
|
+
basePath: "",
|
|
7
|
+
frameworks: ["jasmine", "@angular-devkit/build-angular"],
|
|
8
|
+
files: [
|
|
9
|
+
"projects/**/*.ts", // Buscará todos los archivos .ts dentro de la carpeta design-system y sus subdirectorios
|
|
10
|
+
],
|
|
11
|
+
plugins: [
|
|
12
|
+
require("karma-jasmine"),
|
|
13
|
+
require("karma-chrome-launcher"),
|
|
14
|
+
require("karma-jasmine-html-reporter"),
|
|
15
|
+
require("karma-coverage"),
|
|
16
|
+
require("@angular-devkit/build-angular/plugins/karma"),
|
|
17
|
+
],
|
|
18
|
+
client: {
|
|
19
|
+
clearContext: false, // leave Jasmine Spec Runner output visible in browser
|
|
20
|
+
},
|
|
21
|
+
jasmineHtmlReporter: {
|
|
22
|
+
suppressAll: true, // removes the duplicated traces
|
|
23
|
+
},
|
|
24
|
+
coverageReporter: {
|
|
25
|
+
dir: require("path").join(__dirname, "../../coverage/design-system"),
|
|
26
|
+
subdir: ".",
|
|
27
|
+
reporters: [{ type: "html" }, { type: "text-summary" }],
|
|
28
|
+
},
|
|
29
|
+
reporters: ["progress", "kjhtml"],
|
|
30
|
+
browsers: ["Chrome"],
|
|
31
|
+
restartOnFileChange: true,
|
|
32
|
+
});
|
|
33
|
+
};
|
package/ng-package.json
ADDED
package/package.json
CHANGED
|
@@ -1,25 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tekus/design-system",
|
|
3
|
-
"
|
|
3
|
+
"description": "Tekus design system library",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"license": "UNLICENSED",
|
|
4
6
|
"peerDependencies": {
|
|
5
7
|
"@angular/core": "^16.2.0",
|
|
6
|
-
"@angular/common": "^16.2.0"
|
|
8
|
+
"@angular/common": "^16.2.0",
|
|
9
|
+
"@fortawesome/pro-solid-svg-icons": "^6.4.2",
|
|
10
|
+
"@fortawesome/angular-fontawesome": "^0.13.0",
|
|
11
|
+
"@fortawesome/fontawesome-svg-core": "^6.4.2"
|
|
7
12
|
},
|
|
8
13
|
"dependencies": {
|
|
9
14
|
"tslib": "^2.3.0"
|
|
10
15
|
},
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
|
|
16
|
+
"release": {
|
|
17
|
+
"branches": [
|
|
18
|
+
"master",
|
|
19
|
+
"develop"
|
|
20
|
+
],
|
|
21
|
+
"plugins": [
|
|
22
|
+
"@semantic-release/commit-analyzer",
|
|
23
|
+
"@semantic-release/release-notes-generator",
|
|
24
|
+
"@semantic-release/npm"
|
|
25
|
+
]
|
|
26
|
+
},
|
|
27
|
+
"publishConfig": {
|
|
28
|
+
"access": "public"
|
|
29
|
+
},
|
|
30
|
+
"sideEffects": false
|
|
31
|
+
}
|
|
@@ -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,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
|
+
}
|
package/esm2022/index.mjs
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generated bundle index. Do not edit.
|
|
3
|
-
*/
|
|
4
|
-
export * from './index';
|
|
5
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVrdXMtZGVzaWduLXN5c3RlbS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3Byb2plY3RzL2Rlc2lnbi1zeXN0ZW0vdGVrdXMtZGVzaWduLXN5c3RlbS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUVILGNBQWMsU0FBUyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBHZW5lcmF0ZWQgYnVuZGxlIGluZGV4LiBEbyBub3QgZWRpdC5cbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL2luZGV4JztcbiJdfQ==
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tekus-design-system.mjs","sources":["../../../projects/design-system/tekus-design-system.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"AAAA;;AAEG"}
|
package/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|