@rxap/plugin-angular 16.1.0-dev.40 → 16.1.0-dev.42

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/CHANGELOG.md CHANGED
@@ -3,6 +3,18 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [16.1.0-dev.42](https://gitlab.com/rxap/packages/compare/@rxap/plugin-angular@16.1.0-dev.41...@rxap/plugin-angular@16.1.0-dev.42) (2023-09-28)
7
+
8
+ ### Bug Fixes
9
+
10
+ - improve dynamic theme handling ([7ffd28b](https://gitlab.com/rxap/packages/commit/7ffd28b0a6d86cd6690cac1d750bda104108fb74))
11
+
12
+ # [16.1.0-dev.41](https://gitlab.com/rxap/packages/compare/@rxap/plugin-angular@16.1.0-dev.40...@rxap/plugin-angular@16.1.0-dev.41) (2023-09-28)
13
+
14
+ ### Features
15
+
16
+ - support dynamic font families and theme density ([a212366](https://gitlab.com/rxap/packages/commit/a21236669cfe89f51b5946cd2d28e72411481dc9))
17
+
6
18
  # [16.1.0-dev.40](https://gitlab.com/rxap/packages/compare/@rxap/plugin-angular@16.1.0-dev.39...@rxap/plugin-angular@16.1.0-dev.40) (2023-09-27)
7
19
 
8
20
  ### Bug Fixes
package/README.md CHANGED
@@ -19,7 +19,7 @@ yarn add @rxap/plugin-angular
19
19
  ```
20
20
  **Install peer dependencies:**
21
21
  ```bash
22
- yarn add @nx/devkit@^16.5.0 @rxap/generator-utilities@^1.1.0-dev.14 @rxap/plugin-localazy@^16.1.0-dev.11 @rxap/plugin-utilities@^16.1.0-dev.15 @rxap/ts-morph@^0.1.0-dev.11 @rxap/utilities@^16.0.0-dev.18 @rxap/workspace-ts-morph@^0.1.0-dev.8 @rxap/workspace-utilities@^0.1.0-dev.16 nx@^16.5.0 ts-morph@^18.0.0 tslib@2.6.2
22
+ yarn add @nx/devkit@^16.5.0 @rxap/generator-utilities@^1.1.0-dev.15 @rxap/plugin-localazy@^16.1.0-dev.11 @rxap/plugin-utilities@^16.1.0-dev.16 @rxap/ts-morph@^0.1.0-dev.12 @rxap/utilities@^16.0.0-dev.19 @rxap/workspace-ts-morph@^0.1.0-dev.9 @rxap/workspace-utilities@^0.1.0-dev.17 nx@^16.5.0 ts-morph@^18.0.0 tslib@2.6.2
23
23
  ```
24
24
  **Execute the init generator:**
25
25
  ```bash
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "16.1.0-dev.40",
2
+ "version": "16.1.0-dev.42",
3
3
  "name": "@rxap/plugin-angular",
4
4
  "license": "GPL-3.0-or-later",
5
5
  "dependencies": {
@@ -11,17 +11,17 @@
11
11
  },
12
12
  "peerDependencies": {
13
13
  "@nx/devkit": "^16.5.0",
14
- "@rxap/generator-utilities": "^1.1.0-dev.14",
14
+ "@rxap/generator-utilities": "^1.1.0-dev.15",
15
15
  "@rxap/plugin-localazy": "^16.1.0-dev.11",
16
- "@rxap/plugin-utilities": "^16.1.0-dev.15",
17
- "@rxap/ts-morph": "^0.1.0-dev.11",
18
- "@rxap/utilities": "^16.0.0-dev.18",
19
- "@rxap/workspace-ts-morph": "^0.1.0-dev.8",
20
- "@rxap/workspace-utilities": "^0.1.0-dev.16",
16
+ "@rxap/plugin-utilities": "^16.1.0-dev.16",
17
+ "@rxap/ts-morph": "^0.1.0-dev.12",
18
+ "@rxap/utilities": "^16.0.0-dev.19",
19
+ "@rxap/workspace-ts-morph": "^0.1.0-dev.9",
20
+ "@rxap/workspace-utilities": "^0.1.0-dev.17",
21
21
  "nx": "^16.5.0",
22
22
  "ts-morph": "^18.0.0",
23
23
  "tslib": "2.6.2",
24
- "@rxap/node-utilities": "1.1.0-dev.10"
24
+ "@rxap/node-utilities": "1.1.0-dev.11"
25
25
  },
26
26
  "author": {
27
27
  "name": "Merzough Münker",
@@ -47,7 +47,7 @@
47
47
  "packageGroup": [
48
48
  {
49
49
  "package": "@rxap/generator-utilities",
50
- "version": "1.1.0-dev.14"
50
+ "version": "1.1.0-dev.15"
51
51
  },
52
52
  {
53
53
  "package": "@rxap/node-utilities",
@@ -59,7 +59,7 @@
59
59
  },
60
60
  {
61
61
  "package": "@rxap/plugin-utilities",
62
- "version": "16.1.0-dev.15"
62
+ "version": "16.1.0-dev.16"
63
63
  },
64
64
  {
65
65
  "package": "@rxap/schematics-ts-morph",
@@ -67,19 +67,19 @@
67
67
  },
68
68
  {
69
69
  "package": "@rxap/ts-morph",
70
- "version": "0.1.0-dev.11"
70
+ "version": "0.1.0-dev.12"
71
71
  },
72
72
  {
73
73
  "package": "@rxap/utilities",
74
- "version": "16.0.0-dev.18"
74
+ "version": "16.0.0-dev.19"
75
75
  },
76
76
  {
77
77
  "package": "@rxap/workspace-ts-morph",
78
- "version": "0.1.0-dev.8"
78
+ "version": "0.1.0-dev.9"
79
79
  },
80
80
  {
81
81
  "package": "@rxap/workspace-utilities",
82
- "version": "0.1.0-dev.16"
82
+ "version": "0.1.0-dev.17"
83
83
  }
84
84
  ]
85
85
  },
@@ -94,7 +94,7 @@
94
94
  },
95
95
  "schematics": "./generators.json",
96
96
  "type": "commonjs",
97
- "gitHead": "8d7aeb0f4a5ef9c6476b98d06c6f52f5d79d4a95",
97
+ "gitHead": "e28a10ac86b9cef14c9085244342d9e53bfe567e",
98
98
  "main": "./src/index.js",
99
99
  "types": "./src/index.d.ts"
100
100
  }
@@ -1 +1,9 @@
1
1
  @use "fonts/material-icons";
2
+ @import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap');
3
+ @import url('https://fonts.googleapis.com/css2?family=Mooli&display=swap');
4
+ @import url('https://fonts.googleapis.com/css2?family=Inclusive%20Sans&display=swap');
5
+ @import url('https://fonts.googleapis.com/css2?family=Pixelify%20Sans&display=swap');
6
+ @import url('https://fonts.googleapis.com/css2?family=Roboto%20Mono&display=swap');
7
+ @import url('https://fonts.googleapis.com/css2?family=Croissant%20One&display=swap');
8
+ @import url('https://fonts.googleapis.com/css2?family=Young%20Serif&display=swap');
9
+ @import url('https://fonts.googleapis.com/css2?family=Fuggles&display=swap');
@@ -3,8 +3,7 @@
3
3
  @use '@angular/material' as mat;
4
4
  @use 'palette' as palette;
5
5
 
6
- @import "table";
7
- @import 'loading-animation';
6
+ @import 'utilities';
8
7
 
9
8
  @tailwind base;
10
9
  @tailwind components;
@@ -12,91 +11,4 @@
12
11
 
13
12
  @include mat.core();
14
13
 
15
- $theme-primary: mat.define-palette(palette.$primary-pat);
16
- $theme-accent: mat.define-palette(palette.$accent-pat, A200, A100, A400);
17
- $theme-warn: mat.define-palette(palette.$warn-pat);
18
- $theme-typography: mat.define-typography-config(
19
- $font-family: theme("fontFamily.mono")
20
- );
21
-
22
-
23
- $light-theme: mat.define-light-theme((
24
- color: (
25
- primary: $theme-primary,
26
- accent: $theme-accent,
27
- warn: $theme-warn
28
- ),
29
- // Only include `typography` and `density` in the default theme.
30
- typography: $theme-typography,
31
- // https://m2.material.io/design/layout/applying-density.html#usage
32
- // between -3 and 0
33
- // density < -1 -> form field label not visible
34
- density: 0,
35
- ));
36
-
37
- $dark-theme: mat.define-dark-theme((
38
- color: (
39
- primary: $theme-primary,
40
- accent: $theme-accent,
41
- warn: $theme-warn
42
- ),
43
- ));
44
-
45
- // Emit theme-dependent styles for common features used across multiple components.
46
- @include mat.core-theme($light-theme);
47
-
48
- // Emit styles for MatButton based on `$light-theme`. Because the configuration
49
- // passed to `define-light-theme` omits typography, `button-theme` will not
50
- // emit any typography styles.
51
- @include mat.all-component-themes($light-theme);
52
- @include table-theme($light-theme);
53
-
54
- @mixin define-utility-variables($theme) {
55
- $foreground: map-get($theme, foreground);
56
- $background: map-get($theme, background);
57
- $primary: map-get($theme, primary);
58
- $accent: map-get($theme, accent);
59
- $warn: map-get($theme, warn);
60
- $isDark: map-get($theme, is-dark);
61
-
62
- --background-color: #{map-get($background, background)};
63
- --primary-color: #{mat.get-color-from-palette($primary)};
64
- --accent-color: #{mat.get-color-from-palette($accent)};
65
- --warn-color: #{mat.get-color-from-palette($warn)};
66
-
67
- --hint-text-color: #{mat.get-color-from-palette($foreground, hint-text)};
68
- --foreground-color: #{mat.get-color-from-palette($foreground, base)};
69
-
70
- --accept-color: rgb(115, 190, 105);
71
- --decline-color: rgb(204, 73, 51);
72
-
73
- }
74
-
75
- @mixin body-theme($theme) {
76
-
77
- $background: mat.get-color-from-palette(map-get($theme, background), background);
78
- background-color: $background;
79
- color: mat.get-color-from-palette(map-get($theme, foreground), text);
80
- @include loadingAnimation($background);
81
-
82
- }
83
-
84
- :root {
85
- @include define-utility-variables($light-theme);
86
- }
87
-
88
- body.dark {
89
- @include mat.core-color($dark-theme);
90
- @include mat.all-component-colors($dark-theme);
91
- @include table-theme($dark-theme);
92
- @include define-utility-variables($dark-theme);
93
- }
94
-
95
- body {
96
- @include body-theme($light-theme);
97
-
98
- &.dark, &.dark-theme {
99
- @include body-theme($dark-theme);
100
- }
101
-
102
- }
14
+ @include init-theme();
@@ -0,0 +1,112 @@
1
+ @use '@angular/material' as mat;
2
+ @use 'palette' as palette;
3
+
4
+ @import "table";
5
+ @import 'loading-animation';
6
+
7
+ @mixin colors($theme) {
8
+ $background: mat.get-color-from-palette(map-get($theme, background), background);
9
+ $foreground: mat.get-color-from-palette(map-get($theme, foreground), text);
10
+
11
+ --background-color: #{$background};
12
+ --foreground-color: #{$foreground};
13
+
14
+ --accept-color: rgb(115, 190, 105);
15
+ --decline-color: rgb(204, 73, 51);
16
+
17
+ @include mat.all-component-colors($theme);
18
+
19
+ @include table-theme($theme);
20
+ @include loadingAnimation($background);
21
+ }
22
+
23
+ @mixin density($theme) {
24
+ @include mat.all-component-densities($theme);
25
+ }
26
+
27
+ @mixin typography($theme) {
28
+ @include mat.all-component-typographies($theme);
29
+ }
30
+
31
+ @mixin base-theme() {
32
+ $theme: mat.define-light-theme((
33
+ color: (
34
+ primary: mat.$blue-palette,
35
+ accent: mat.$cyan-palette,
36
+ warn: mat.$red-palette
37
+ ),
38
+ typography: mat.define-typography-config(
39
+ $font-family: var(--font-family)
40
+ ),
41
+ ));
42
+ @include mat.core-theme($theme);
43
+ @include density($theme);
44
+ @include typography($theme);
45
+
46
+ body {
47
+ background-color: var(--background-color);
48
+ color: var(--foreground-color);
49
+
50
+ @for $i from -3 through -1 {
51
+ &.density#{$i} {
52
+ @include density(mat.define-light-theme((
53
+ // https://m2.material.io/design/layout/applying-density.html#usage
54
+ // between -3 and 0
55
+ // density < -1 -> form field label not visible
56
+ density: $i,
57
+ )));
58
+ --density: #{$i};
59
+ }
60
+ }
61
+ }
62
+
63
+ }
64
+
65
+ @mixin body-theme($theme) {
66
+ @include colors($theme);
67
+ }
68
+
69
+ @mixin init-theme(
70
+ $theme-primary: mat.define-palette(palette.$primary-pat),
71
+ $theme-accent: mat.define-palette(palette.$accent-pat),
72
+ $theme-warn: mat.define-palette(palette.$warn-pat),
73
+ $scope: null
74
+ ) {
75
+
76
+ $light-theme: mat.define-light-theme((
77
+ color: (
78
+ primary: $theme-primary,
79
+ accent: $theme-accent,
80
+ warn: $theme-warn
81
+ ),
82
+ ));
83
+
84
+ $dark-theme: mat.define-dark-theme((
85
+ color: (
86
+ primary: $theme-primary,
87
+ accent: $theme-accent,
88
+ warn: $theme-warn
89
+ ),
90
+ ));
91
+
92
+ // generate the base theme independent of the preferred color scheme
93
+ @include base-theme();
94
+
95
+ @if $scope {
96
+ body.#{$scope} {
97
+ @include body-theme($light-theme);
98
+
99
+ &.dark, &.dark-theme {
100
+ @include body-theme($dark-theme);
101
+ }
102
+ }
103
+ } @else {
104
+ body {
105
+ @include body-theme($light-theme);
106
+
107
+ &.dark, &.dark-theme {
108
+ @include body-theme($dark-theme);
109
+ }
110
+ }
111
+ }
112
+ }
@@ -59,5 +59,19 @@
59
59
  --contrast-a400: rgba(black, 0.87);
60
60
  --contrast-a700: rgba(black, 0.87);
61
61
 
62
+ --font-family-sans: 'ui-sans-serif', 'system-ui', '-apple-system', 'BlinkMacSystemFont', '"Segoe UI"', 'Roboto', '"Helvetica Neue"', 'Arial', '"Noto Sans"', 'sans-serif', '"Apple Color Emoji"', '"Segoe UI Emoji"', '"Segoe UI Symbol"', '"Noto Color Emoji"';
63
+ --font-family-serif: 'ui-serif', 'Georgia', 'Cambria', '"Times New Roman"', 'Times', 'serif';
64
+ --font-family-mono: 'ui-monospace', 'SFMono-Regular', 'Menlo', 'Monaco', 'Consolas', '"Liberation Mono"', '"Courier New"', 'monospace';
65
+ --font-family-default: 'Roboto', 'sans-serif';
66
+ --font-family-mooli: 'Mooli', 'sans-serif';
67
+ --font-family-inclusive-sans: 'Inclusive Sans', 'sans-serif';
68
+ --font-family-fuggles: 'Fuggles', 'sans-serif';
69
+ --font-family-pixelify-sans: 'Pixelify Sans', 'sans-serif';
70
+ --font-family-roboto-mono: 'Roboto Mono', 'sans-serif';
71
+ --font-family-croissant-one: 'Croissant One', 'sans-serif';
72
+ --font-family-young-serif: 'Young Serif', 'sans-serif';
73
+ --font-family: var(--font-family-default);
74
+ --density: 0;
75
+
62
76
  }
63
77