@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.
Files changed (96) hide show
  1. package/.eslintrc.json +5 -0
  2. package/CHANGELOG.md +15 -0
  3. package/LICENSE.md +288 -0
  4. package/README.md +10 -0
  5. package/angular.json +37 -0
  6. package/dist/README.md +10 -0
  7. package/dist/action-group/action-group.component.d.ts +6 -0
  8. package/dist/button/button.component.d.ts +8 -0
  9. package/dist/fesm2022/rijkshuisstijl-community-components-angular.mjs +335 -0
  10. package/dist/fesm2022/rijkshuisstijl-community-components-angular.mjs.map +1 -0
  11. package/dist/heading/heading.component.d.ts +11 -0
  12. package/dist/icon/RHCIconIDs.d.ts +2 -0
  13. package/dist/icon/dutch-map-icon/dutch-map-icon.component.d.ts +5 -0
  14. package/dist/icon/flag-icons/bg-flag/bg-flag.component.d.ts +5 -0
  15. package/dist/icon/flag-icons/de-flag/de-flag.component.d.ts +5 -0
  16. package/dist/icon/flag-icons/es-flag/es-flag.component.d.ts +5 -0
  17. package/dist/icon/flag-icons/fr-flag/fr-flag.component.d.ts +5 -0
  18. package/dist/icon/flag-icons/gr-flag/gr-flag.component.d.ts +5 -0
  19. package/dist/icon/flag-icons/hu-flag/hu-flag.component.d.ts +5 -0
  20. package/dist/icon/flag-icons/it-flag/it-flag.component.d.ts +5 -0
  21. package/dist/icon/flag-icons/lv-flag/lv-flag.component.d.ts +5 -0
  22. package/dist/icon/flag-icons/nl-flag/nl-flag.component.d.ts +5 -0
  23. package/dist/icon/flag-icons/pl-flag/pl-flag.component.d.ts +5 -0
  24. package/dist/icon/flag-icons/pt-flag/pt-flag.component.d.ts +5 -0
  25. package/dist/icon/flag-icons/ro-flag/ro-flag.component.d.ts +5 -0
  26. package/dist/icon/flag-icons/sk-flag/sk-flag.component.d.ts +5 -0
  27. package/dist/icon/flag-icons/uk-flag/uk-flag.component.d.ts +5 -0
  28. package/dist/icon/icon.component.d.ts +10 -0
  29. package/dist/icon/public-api.d.ts +16 -0
  30. package/dist/index.d.ts +5 -0
  31. package/dist/link/link.component.d.ts +6 -0
  32. package/dist/paragraph/paragraph.component.d.ts +9 -0
  33. package/dist/public-api.d.ts +6 -0
  34. package/jest.config.js +5 -0
  35. package/ng-package.json +7 -0
  36. package/package.json +57 -0
  37. package/setup-jest.ts +3 -0
  38. package/src/action-group/action-group.component.html +9 -0
  39. package/src/action-group/action-group.component.spec.ts +46 -0
  40. package/src/action-group/action-group.component.ts +10 -0
  41. package/src/button/button.component.html +3 -0
  42. package/src/button/button.component.spec.ts +41 -0
  43. package/src/button/button.component.ts +14 -0
  44. package/src/heading/heading.component.css +1 -0
  45. package/src/heading/heading.component.html +31 -0
  46. package/src/heading/heading.component.spec.ts +54 -0
  47. package/src/heading/heading.component.ts +19 -0
  48. package/src/icon/RHCIconIDs.ts +1182 -0
  49. package/src/icon/dutch-map-icon/dutch-map-icon.component.html +6 -0
  50. package/src/icon/dutch-map-icon/dutch-map-icon.component.ts +8 -0
  51. package/src/icon/flag-icons/bg-flag/bg-flag.component.html +5 -0
  52. package/src/icon/flag-icons/bg-flag/bg-flag.component.ts +8 -0
  53. package/src/icon/flag-icons/de-flag/de-flag.component.html +6 -0
  54. package/src/icon/flag-icons/de-flag/de-flag.component.ts +8 -0
  55. package/src/icon/flag-icons/es-flag/es-flag.component.html +2233 -0
  56. package/src/icon/flag-icons/es-flag/es-flag.component.ts +8 -0
  57. package/src/icon/flag-icons/fr-flag/fr-flag.component.html +5 -0
  58. package/src/icon/flag-icons/fr-flag/fr-flag.component.ts +8 -0
  59. package/src/icon/flag-icons/gr-flag/gr-flag.component.html +4 -0
  60. package/src/icon/flag-icons/gr-flag/gr-flag.component.ts +8 -0
  61. package/src/icon/flag-icons/hu-flag/hu-flag.component.html +5 -0
  62. package/src/icon/flag-icons/hu-flag/hu-flag.component.ts +8 -0
  63. package/src/icon/flag-icons/it-flag/it-flag.component.html +5 -0
  64. package/src/icon/flag-icons/it-flag/it-flag.component.ts +8 -0
  65. package/src/icon/flag-icons/lv-flag/lv-flag.component.html +4 -0
  66. package/src/icon/flag-icons/lv-flag/lv-flag.component.ts +8 -0
  67. package/src/icon/flag-icons/nl-flag/nl-flag.component.html +5 -0
  68. package/src/icon/flag-icons/nl-flag/nl-flag.component.ts +8 -0
  69. package/src/icon/flag-icons/pl-flag/pl-flag.component.html +4 -0
  70. package/src/icon/flag-icons/pl-flag/pl-flag.component.ts +8 -0
  71. package/src/icon/flag-icons/pt-flag/pt-flag.component.html +156 -0
  72. package/src/icon/flag-icons/pt-flag/pt-flag.component.ts +8 -0
  73. package/src/icon/flag-icons/ro-flag/ro-flag.component.html +5 -0
  74. package/src/icon/flag-icons/ro-flag/ro-flag.component.ts +8 -0
  75. package/src/icon/flag-icons/sk-flag/sk-flag.component.html +34 -0
  76. package/src/icon/flag-icons/sk-flag/sk-flag.component.ts +8 -0
  77. package/src/icon/flag-icons/uk-flag/uk-flag.component.html +15 -0
  78. package/src/icon/flag-icons/uk-flag/uk-flag.component.ts +8 -0
  79. package/src/icon/icon.component.css +3 -0
  80. package/src/icon/icon.component.html +6 -0
  81. package/src/icon/icon.component.spec.ts +61 -0
  82. package/src/icon/icon.component.ts +105 -0
  83. package/src/icon/public-api.ts +16 -0
  84. package/src/link/link.component.css +1 -0
  85. package/src/link/link.component.html +3 -0
  86. package/src/link/link.component.spec.ts +33 -0
  87. package/src/link/link.component.ts +11 -0
  88. package/src/paragraph/paragraph.component.css +1 -0
  89. package/src/paragraph/paragraph.component.html +3 -0
  90. package/src/paragraph/paragraph.component.spec.ts +45 -0
  91. package/src/paragraph/paragraph.component.ts +23 -0
  92. package/src/public-api.ts +9 -0
  93. package/tsconfig.json +28 -0
  94. package/tsconfig.lib.json +11 -0
  95. package/tsconfig.lib.prod.json +9 -0
  96. package/tsconfig.spec.json +11 -0
@@ -0,0 +1,3 @@
1
+ <p class="{{ computedClass() }}">
2
+ <ng-content></ng-content>
3
+ </p>
@@ -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
+ "outDir": "../../out-tsc/lib",
5
+ "declaration": true,
6
+ "declarationMap": true,
7
+ "inlineSources": true,
8
+ "types": []
9
+ },
10
+ "exclude": ["**/*.spec.ts"]
11
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "extends": "./tsconfig.lib.json",
3
+ "compilerOptions": {
4
+ "declarationMap": false
5
+ },
6
+ "angularCompilerOptions": {
7
+ "compilationMode": "partial"
8
+ }
9
+ }
@@ -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
+ }