@igo2/sdg-core 1.0.0-next.60

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 (51) hide show
  1. package/README.md +1 -0
  2. package/fesm2022/igo2-sdg-core.mjs +186 -0
  3. package/fesm2022/igo2-sdg-core.mjs.map +1 -0
  4. package/index.d.ts +5 -0
  5. package/layout/breakpoint/breakpoint.service.d.ts +12 -0
  6. package/layout/breakpoint/index.d.ts +1 -0
  7. package/layout/index.d.ts +1 -0
  8. package/package.json +38 -0
  9. package/public-api.d.ts +4 -0
  10. package/router/index.d.ts +4 -0
  11. package/router/route.interface.d.ts +8 -0
  12. package/router/route.utils.d.ts +1 -0
  13. package/router/router.d.ts +5 -0
  14. package/router/title-resolver/index.d.ts +2 -0
  15. package/router/title-resolver/title-resolver.d.ts +8 -0
  16. package/router/title-resolver/title-resolver.pipe.d.ts +11 -0
  17. package/src/_index.scss +3 -0
  18. package/src/layout/_breakpoints.scss +120 -0
  19. package/src/layout/_index.scss +1 -0
  20. package/src/layout/layout.scss +5349 -0
  21. package/src/style/_index.scss +1 -0
  22. package/src/style/overrides/_index.scss +2 -0
  23. package/src/style/overrides/igo2-lib/_index-theme.scss +13 -0
  24. package/src/style/overrides/igo2-lib/_index.scss +6 -0
  25. package/src/style/overrides/igo2-lib/_search-bar-theme.scss +33 -0
  26. package/src/style/overrides/igo2-lib/list.scss +24 -0
  27. package/src/style/overrides/igo2-lib/panel.scss +8 -0
  28. package/src/style/overrides/igo2-lib/scrollbar.scss +15 -0
  29. package/src/style/overrides/igo2-lib/search-bar.scss +43 -0
  30. package/src/style/overrides/material/_button-theme.scss +74 -0
  31. package/src/style/overrides/material/_index-theme.scss +13 -0
  32. package/src/style/overrides/material/_index.scss +6 -0
  33. package/src/style/overrides/material/button.scss +5 -0
  34. package/src/style/overrides/material/dialog.scss +36 -0
  35. package/src/style/overrides/material/form-field.scss +5 -0
  36. package/src/style/overrides/material/input.scss +5 -0
  37. package/src/theme/_colors.scss +128 -0
  38. package/src/theme/_index.scss +3 -0
  39. package/src/theme/_palettes.scss +112 -0
  40. package/src/theme/_theme.scss +46 -0
  41. package/src/typography/_index.scss +2 -0
  42. package/src/typography/typography.scss +156 -0
  43. package/src/typography/typography.utils.scss +18 -0
  44. package/translation/index.d.ts +5 -0
  45. package/translation/translation-mock.provider.d.ts +12 -0
  46. package/translation/translation.interface.d.ts +1 -0
  47. package/translation/translation.provider.d.ts +21 -0
  48. package/translation/translation.service.d.ts +13 -0
  49. package/translation/translation.utils.d.ts +2 -0
  50. package/utils/coercion.d.ts +2 -0
  51. package/utils/index.d.ts +1 -0
@@ -0,0 +1,156 @@
1
+ @use '@angular/material' as mat;
2
+ @use '../theme/colors';
3
+ @use '../theme/palettes';
4
+ @use '../layout/breakpoints';
5
+ @use './typography.utils' as typo-utils;
6
+
7
+ // https://design.quebec.ca/bases/polices-caracteres
8
+ // https://design.quebec.ca/bases/niveaux-titres
9
+ // https://material.angular.io/guide/typography
10
+ $font-family-text: 'Open Sans', sans-serif;
11
+ $font-family-title: 'Roboto', sans-serif;
12
+
13
+ $typography: mat.m2-define-typography-config(
14
+ $font-family: $font-family-text,
15
+ $headline-1: mat.m2-define-typography-level(110px, 110px, 500),
16
+ $headline-2: mat.m2-define-typography-level(54px, 54px, 500),
17
+ $headline-3: mat.m2-define-typography-level(43px, 46px, 500),
18
+ $headline-4: mat.m2-define-typography-level(32px, 38px, 500),
19
+ // h1
20
+ $headline-5: mat.m2-define-typography-level(48px, 56px, bold),
21
+ // h2
22
+ $headline-6: mat.m2-define-typography-level(36px, 40px, bold),
23
+ // h3
24
+ $subtitle-1: mat.m2-define-typography-level(28px, 32px, bold),
25
+ // h4
26
+ $subtitle-2: mat.m2-define-typography-level(21px, 24px, bold),
27
+ $body-1: mat.m2-define-typography-level(16px, 24px, 400),
28
+ $body-2: mat.m2-define-typography-level(12px, 18px, 400),
29
+ $caption: mat.m2-define-typography-level(12px, 18px, 400),
30
+ $button: mat.m2-define-typography-level(13px, 13px, 500)
31
+ );
32
+
33
+ $typography-mobile: mat.m2-define-typography-config(
34
+ // h1
35
+ $headline-5: mat.m2-define-typography-level(36px, 40px, bold),
36
+ // h2
37
+ $headline-6: mat.m2-define-typography-level(28px, 32px, bold),
38
+ // h3
39
+ $subtitle-1: mat.m2-define-typography-level(25px, 32px, bold)
40
+ );
41
+
42
+ $font-color: colors.$blue-dark;
43
+
44
+ @mixin typo-set-base-styles {
45
+ body {
46
+ color: $font-color;
47
+ }
48
+
49
+ a {
50
+ font-family: $font-family-text;
51
+ word-break: break-word;
52
+ overflow-wrap: break-word;
53
+ cursor: pointer;
54
+ color: colors.$blue-piv;
55
+ text-decoration: underline;
56
+ background-color: transparent;
57
+ width: fit-content;
58
+ }
59
+
60
+ a:hover {
61
+ text-decoration: none;
62
+ }
63
+
64
+ p,
65
+ ul,
66
+ li,
67
+ u,
68
+ .text {
69
+ font-family: $font-family-text;
70
+ color: $font-color;
71
+ font-size: 16px;
72
+ line-height: 24px;
73
+ }
74
+
75
+ p {
76
+ margin-bottom: 24px;
77
+ }
78
+
79
+ strong {
80
+ font-weight: 600;
81
+ }
82
+
83
+ h1,
84
+ h2,
85
+ h3,
86
+ h4,
87
+ h5,
88
+ h6,
89
+ .h1,
90
+ .h2,
91
+ .h3,
92
+ .h4,
93
+ .h5,
94
+ .h6 {
95
+ font-family: $font-family-title !important;
96
+ color: $font-color;
97
+ }
98
+
99
+ h1 {
100
+ margin-top: 72px !important;
101
+ margin-bottom: 32px !important;
102
+
103
+ @include typo-utils.title-border;
104
+
105
+ @include breakpoints.media(mobile) {
106
+ margin-top: 48px !important;
107
+ margin-bottom: 16px !important;
108
+ }
109
+ }
110
+
111
+ h2 {
112
+ margin-top: 48px !important;
113
+ margin-bottom: 16px !important;
114
+ }
115
+
116
+ h3 {
117
+ margin-top: 24px !important;
118
+ margin-bottom: 16px !important;
119
+ }
120
+
121
+ // WORKAROUND, mat-typography area of intersection h4 is using mat-body-1
122
+ // https://github.com/angular/components/issues/26351
123
+ h4 {
124
+ @include typo-utils.title-level-4;
125
+ }
126
+
127
+ h4 {
128
+ margin-top: 24px !important;
129
+ margin-bottom: 8px !important;
130
+ }
131
+
132
+ h5 {
133
+ font-size: 19px !important;
134
+ line-height: 24px !important;
135
+ }
136
+
137
+ h6 {
138
+ font-size: 16px !important;
139
+ line-height: 20px !important;
140
+ }
141
+
142
+ h5,
143
+ h6 {
144
+ font-weight: bold !important;
145
+ margin-top: 16px !important;
146
+ margin-bottom: 0px !important;
147
+ }
148
+
149
+ .accroche {
150
+ font-size: 18px;
151
+ line-height: 28px;
152
+ font-weight: 600;
153
+ max-width: 82.5rem;
154
+ padding-bottom: 24px;
155
+ }
156
+ }
@@ -0,0 +1,18 @@
1
+ @use '../theme/colors';
2
+
3
+ @mixin title-border {
4
+ &:after {
5
+ content: '';
6
+ display: block;
7
+ margin: 0;
8
+ width: 48px;
9
+ padding-top: 4px;
10
+ border-bottom: 4px solid colors.$pink;
11
+ }
12
+ }
13
+
14
+ @mixin title-level-4 {
15
+ font-size: 21px !important;
16
+ line-height: 24px !important;
17
+ font-weight: bold !important;
18
+ }
@@ -0,0 +1,5 @@
1
+ export * from './translation.interface';
2
+ export * from './translation.service';
3
+ export * from './translation.provider';
4
+ export * from './translation-mock.provider';
5
+ export * from './translation.utils';
@@ -0,0 +1,12 @@
1
+ import { WritableSignal } from '@angular/core';
2
+ import { Observable } from 'rxjs';
3
+ import { Language } from './translation.interface';
4
+ import { TranslationFeature, TranslationFeatureKind } from './translation.provider';
5
+ import { TranslationService } from './translation.service';
6
+ export declare function withIgo2TranslationMock(): TranslationFeature<TranslationFeatureKind.Translation>;
7
+ export declare class TranslationServiceMock implements TranslationService {
8
+ lang: WritableSignal<Language>;
9
+ get(key: string | string[]): string;
10
+ getAsync(key: string | string[]): Observable<string>;
11
+ setLanguage(): void;
12
+ }
@@ -0,0 +1 @@
1
+ export type Language = 'fr' | 'en';
@@ -0,0 +1,21 @@
1
+ import { EnvironmentProviders, Provider, Type } from '@angular/core';
2
+ import { LanguageOptions } from '@igo2/core/language';
3
+ import { TitleResolver } from '../router';
4
+ import { TranslationService } from './translation.service';
5
+ export interface TranslationFeature<KindT extends TranslationFeatureKind> {
6
+ kind: KindT;
7
+ providers: (Provider | EnvironmentProviders)[];
8
+ }
9
+ export declare enum TranslationFeatureKind {
10
+ Translation = 0,
11
+ RouterTitleResolver = 1
12
+ }
13
+ export declare function provideTranslation(...features: TranslationFeature<TranslationFeatureKind>[]): EnvironmentProviders;
14
+ /** Base on the @ngx-translate library with the IgoLanguageModule */
15
+ export declare function withIgo2Translation(options: LanguageOptions, service: Type<TranslationService>): TranslationFeature<TranslationFeatureKind.Translation>;
16
+ /**
17
+ * Provide a translater for the Route title.
18
+ * Some components is base on the title of the route and
19
+ * this Resolver will allow to automatically resolve the translation
20
+ **/
21
+ export declare function withRouterTitleResolver<T>(resolver: Type<TitleResolver<T>>): TranslationFeature<TranslationFeatureKind.RouterTitleResolver>;
@@ -0,0 +1,13 @@
1
+ import { WritableSignal } from '@angular/core';
2
+ import { Observable } from 'rxjs';
3
+ import { Language } from './translation.interface';
4
+ export type Translation = string | Translation[] | TranslationObject | any;
5
+ export interface TranslationObject {
6
+ [key: string]: Translation;
7
+ }
8
+ export declare abstract class TranslationService {
9
+ abstract lang: WritableSignal<Language>;
10
+ abstract get(key: string | string[], interpolateParams?: Record<string, unknown>): Translation | TranslationObject;
11
+ abstract getAsync(key: string | string[], interpolateParams?: Record<string, unknown>): Observable<Translation | TranslationObject>;
12
+ abstract setLanguage(lang: Language): void;
13
+ }
@@ -0,0 +1,2 @@
1
+ export declare function readQueryParamLanguage(): string | undefined;
2
+ export declare function parseUrlWithLanguage(routerUrl: string, lang: string): [url: string, params: string | undefined];
@@ -0,0 +1,2 @@
1
+ import { Translation, TranslationObject } from '../translation';
2
+ export declare function labelAttribute(value: Translation | TranslationObject, defaultValue?: Translation | TranslationObject): Translation | TranslationObject;
@@ -0,0 +1 @@
1
+ export * from './coercion';