@rijkshuisstijl-community/components-angular 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 +5 -0
- package/CHANGELOG.md +15 -0
- package/LICENSE.md +288 -0
- package/README.md +10 -0
- package/angular.json +37 -0
- package/dist/README.md +10 -0
- package/dist/action-group/action-group.component.d.ts +6 -0
- package/dist/button/button.component.d.ts +8 -0
- package/dist/fesm2022/rijkshuisstijl-community-components-angular.mjs +335 -0
- package/dist/fesm2022/rijkshuisstijl-community-components-angular.mjs.map +1 -0
- package/dist/heading/heading.component.d.ts +11 -0
- package/dist/icon/RHCIconIDs.d.ts +2 -0
- package/dist/icon/dutch-map-icon/dutch-map-icon.component.d.ts +5 -0
- package/dist/icon/flag-icons/bg-flag/bg-flag.component.d.ts +5 -0
- package/dist/icon/flag-icons/de-flag/de-flag.component.d.ts +5 -0
- package/dist/icon/flag-icons/es-flag/es-flag.component.d.ts +5 -0
- package/dist/icon/flag-icons/fr-flag/fr-flag.component.d.ts +5 -0
- package/dist/icon/flag-icons/gr-flag/gr-flag.component.d.ts +5 -0
- package/dist/icon/flag-icons/hu-flag/hu-flag.component.d.ts +5 -0
- package/dist/icon/flag-icons/it-flag/it-flag.component.d.ts +5 -0
- package/dist/icon/flag-icons/lv-flag/lv-flag.component.d.ts +5 -0
- package/dist/icon/flag-icons/nl-flag/nl-flag.component.d.ts +5 -0
- package/dist/icon/flag-icons/pl-flag/pl-flag.component.d.ts +5 -0
- package/dist/icon/flag-icons/pt-flag/pt-flag.component.d.ts +5 -0
- package/dist/icon/flag-icons/ro-flag/ro-flag.component.d.ts +5 -0
- package/dist/icon/flag-icons/sk-flag/sk-flag.component.d.ts +5 -0
- package/dist/icon/flag-icons/uk-flag/uk-flag.component.d.ts +5 -0
- package/dist/icon/icon.component.d.ts +10 -0
- package/dist/icon/public-api.d.ts +16 -0
- package/dist/index.d.ts +5 -0
- package/dist/link/link.component.d.ts +6 -0
- package/dist/paragraph/paragraph.component.d.ts +9 -0
- package/dist/public-api.d.ts +6 -0
- package/jest.config.js +5 -0
- package/ng-package.json +7 -0
- package/package.json +57 -0
- package/setup-jest.ts +3 -0
- package/src/action-group/action-group.component.html +9 -0
- package/src/action-group/action-group.component.spec.ts +46 -0
- package/src/action-group/action-group.component.ts +10 -0
- package/src/button/button.component.html +3 -0
- package/src/button/button.component.spec.ts +41 -0
- package/src/button/button.component.ts +14 -0
- package/src/heading/heading.component.css +1 -0
- package/src/heading/heading.component.html +31 -0
- package/src/heading/heading.component.spec.ts +54 -0
- package/src/heading/heading.component.ts +19 -0
- package/src/icon/RHCIconIDs.ts +1182 -0
- package/src/icon/dutch-map-icon/dutch-map-icon.component.html +6 -0
- package/src/icon/dutch-map-icon/dutch-map-icon.component.ts +8 -0
- package/src/icon/flag-icons/bg-flag/bg-flag.component.html +5 -0
- package/src/icon/flag-icons/bg-flag/bg-flag.component.ts +8 -0
- package/src/icon/flag-icons/de-flag/de-flag.component.html +6 -0
- package/src/icon/flag-icons/de-flag/de-flag.component.ts +8 -0
- package/src/icon/flag-icons/es-flag/es-flag.component.html +2233 -0
- package/src/icon/flag-icons/es-flag/es-flag.component.ts +8 -0
- package/src/icon/flag-icons/fr-flag/fr-flag.component.html +5 -0
- package/src/icon/flag-icons/fr-flag/fr-flag.component.ts +8 -0
- package/src/icon/flag-icons/gr-flag/gr-flag.component.html +4 -0
- package/src/icon/flag-icons/gr-flag/gr-flag.component.ts +8 -0
- package/src/icon/flag-icons/hu-flag/hu-flag.component.html +5 -0
- package/src/icon/flag-icons/hu-flag/hu-flag.component.ts +8 -0
- package/src/icon/flag-icons/it-flag/it-flag.component.html +5 -0
- package/src/icon/flag-icons/it-flag/it-flag.component.ts +8 -0
- package/src/icon/flag-icons/lv-flag/lv-flag.component.html +4 -0
- package/src/icon/flag-icons/lv-flag/lv-flag.component.ts +8 -0
- package/src/icon/flag-icons/nl-flag/nl-flag.component.html +5 -0
- package/src/icon/flag-icons/nl-flag/nl-flag.component.ts +8 -0
- package/src/icon/flag-icons/pl-flag/pl-flag.component.html +4 -0
- package/src/icon/flag-icons/pl-flag/pl-flag.component.ts +8 -0
- package/src/icon/flag-icons/pt-flag/pt-flag.component.html +156 -0
- package/src/icon/flag-icons/pt-flag/pt-flag.component.ts +8 -0
- package/src/icon/flag-icons/ro-flag/ro-flag.component.html +5 -0
- package/src/icon/flag-icons/ro-flag/ro-flag.component.ts +8 -0
- package/src/icon/flag-icons/sk-flag/sk-flag.component.html +34 -0
- package/src/icon/flag-icons/sk-flag/sk-flag.component.ts +8 -0
- package/src/icon/flag-icons/uk-flag/uk-flag.component.html +15 -0
- package/src/icon/flag-icons/uk-flag/uk-flag.component.ts +8 -0
- package/src/icon/icon.component.css +3 -0
- package/src/icon/icon.component.html +6 -0
- package/src/icon/icon.component.spec.ts +61 -0
- package/src/icon/icon.component.ts +105 -0
- package/src/icon/public-api.ts +16 -0
- package/src/link/link.component.css +1 -0
- package/src/link/link.component.html +3 -0
- package/src/link/link.component.spec.ts +33 -0
- package/src/link/link.component.ts +11 -0
- package/src/paragraph/paragraph.component.css +1 -0
- package/src/paragraph/paragraph.component.html +3 -0
- package/src/paragraph/paragraph.component.spec.ts +45 -0
- package/src/paragraph/paragraph.component.ts +23 -0
- package/src/public-api.ts +9 -0
- package/tsconfig.json +28 -0
- package/tsconfig.lib.json +11 -0
- package/tsconfig.lib.prod.json +9 -0
- package/tsconfig.spec.json +11 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
import { By } from '@angular/platform-browser';
|
|
3
|
+
import { ParagraphComponent } from './paragraph.component';
|
|
4
|
+
|
|
5
|
+
describe('ParagraphComponent', () => {
|
|
6
|
+
let component: ParagraphComponent;
|
|
7
|
+
let fixture: ComponentFixture<ParagraphComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
imports: [ParagraphComponent],
|
|
12
|
+
}).compileComponents();
|
|
13
|
+
|
|
14
|
+
fixture = TestBed.createComponent(ParagraphComponent);
|
|
15
|
+
component = fixture.componentInstance;
|
|
16
|
+
fixture.detectChanges();
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it('should create', () => {
|
|
20
|
+
expect(component).toBeTruthy();
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it('should contain the nl-paragraph class', () => {
|
|
24
|
+
const element = fixture.debugElement.query(By.css('.nl-paragraph'));
|
|
25
|
+
expect(element).toBeTruthy();
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it('should apply the css classes conditionally according to appearance', () => {
|
|
29
|
+
component.appearance = 'lead';
|
|
30
|
+
fixture.detectChanges();
|
|
31
|
+
let element = fixture.debugElement.query(By.css('.nl-paragraph--lead'));
|
|
32
|
+
expect(element).toBeTruthy();
|
|
33
|
+
|
|
34
|
+
component.appearance = undefined;
|
|
35
|
+
fixture.detectChanges();
|
|
36
|
+
element = fixture.debugElement.query(By.css('.nl-paragraph--lead'));
|
|
37
|
+
expect(element).toBeFalsy();
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
it('should render rich text content', () => {
|
|
41
|
+
const paragraphDebugElement = fixture.debugElement.query(By.css('.nl-paragraph'));
|
|
42
|
+
paragraphDebugElement.nativeElement.innerHTML = '<strong>Breaking</strong> news';
|
|
43
|
+
expect(fixture.nativeElement).toContainHTML('strong');
|
|
44
|
+
});
|
|
45
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Component, Input } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
export const appearanceOptions = [undefined, 'lead'] as const;
|
|
4
|
+
export type AppearanceType = (typeof appearanceOptions)[number];
|
|
5
|
+
|
|
6
|
+
@Component({
|
|
7
|
+
selector: 'rhc-paragraph',
|
|
8
|
+
imports: [],
|
|
9
|
+
templateUrl: './paragraph.component.html',
|
|
10
|
+
styleUrl: './paragraph.component.css',
|
|
11
|
+
})
|
|
12
|
+
export class ParagraphComponent {
|
|
13
|
+
@Input() appearance?: AppearanceType;
|
|
14
|
+
|
|
15
|
+
computedClass = () => {
|
|
16
|
+
switch (this.appearance) {
|
|
17
|
+
case 'lead':
|
|
18
|
+
return 'nl-paragraph nl-paragraph--lead';
|
|
19
|
+
default:
|
|
20
|
+
return 'nl-paragraph';
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Public API Surface of components-angular
|
|
3
|
+
*/
|
|
4
|
+
export * from './heading/heading.component';
|
|
5
|
+
export * from './paragraph/paragraph.component';
|
|
6
|
+
export * from './link/link.component';
|
|
7
|
+
export * from './button/button.component';
|
|
8
|
+
export * from './action-group/action-group.component';
|
|
9
|
+
export * from './icon/public-api';
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compileOnSave": false,
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"paths": {
|
|
5
|
+
"components-angular": ["./dist/components-angular"]
|
|
6
|
+
},
|
|
7
|
+
"outDir": "./dist/out-tsc",
|
|
8
|
+
"strict": true,
|
|
9
|
+
"noImplicitOverride": true,
|
|
10
|
+
"noPropertyAccessFromIndexSignature": true,
|
|
11
|
+
"noImplicitReturns": true,
|
|
12
|
+
"noFallthroughCasesInSwitch": true,
|
|
13
|
+
"skipLibCheck": true,
|
|
14
|
+
"isolatedModules": true,
|
|
15
|
+
"esModuleInterop": true,
|
|
16
|
+
"experimentalDecorators": true,
|
|
17
|
+
"moduleResolution": "bundler",
|
|
18
|
+
"importHelpers": true,
|
|
19
|
+
"target": "ES2022",
|
|
20
|
+
"module": "ES2022"
|
|
21
|
+
},
|
|
22
|
+
"angularCompilerOptions": {
|
|
23
|
+
"enableI18nLegacyMessageIdFormat": false,
|
|
24
|
+
"strictInjectionParameters": true,
|
|
25
|
+
"strictInputAccessModifiers": true,
|
|
26
|
+
"strictTemplates": true
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "./tsconfig.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"module": "CommonJs",
|
|
5
|
+
"types": ["jest", "@testing-library/jest-dom"],
|
|
6
|
+
"esModuleInterop": true,
|
|
7
|
+
"emitDecoratorMetadata": true
|
|
8
|
+
},
|
|
9
|
+
"include": ["./setup-jest.ts", "src/**/*.spec.ts", "src/**/*.d.ts"],
|
|
10
|
+
"exclude": ["**/node_modules/*"]
|
|
11
|
+
}
|