@enigmatry/entry-components 1.15.1-preview.15 → 1.15.1-preview.16

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enigmatry/entry-components",
3
- "version": "1.15.1-preview.15",
3
+ "version": "1.15.1-preview.16",
4
4
  "author": "Enigmatry",
5
5
  "description": "Enigmatry entry angular material components",
6
6
  "homepage": "https://github.com/enigmatry/entry-angular-building-blocks/tree/master/libs/entry-components#readme",
@@ -1,16 +1,14 @@
1
1
  @use 'modules/components/dialogs/generator' as dialog;
2
2
  @use 'modules/components/headers/generator' as header;
3
3
  @use 'modules/components/tables/generator' as table;
4
- @use 'modules/elements/generator' as elements;
5
4
  @use 'modules/default-theme' as default;
6
- @use 'modules/angular-material-generator' as material-theme;
5
+ @use 'modules/vendors/angular-material/generator' as material-theme;
7
6
  @use 'sass:map';
8
7
 
9
8
  @mixin generate-from($custom-theme: ()) {
10
9
  $merged-theme: map.deep-merge(default.$theme, $custom-theme);
11
10
 
12
11
  @include material-theme.generate-from($merged-theme);
13
- @include elements.generate-from($merged-theme);
14
12
  @include table.generate-from($merged-theme);
15
13
  @include dialog.generate-from($merged-theme);
16
14
  @include header.generate-from($merged-theme);
@@ -7,18 +7,26 @@ $theme: (
7
7
  primary: #2581C4,
8
8
  accent: #EA518D,
9
9
  dark: #323232,
10
- disabled: #D9D9D9,
11
10
  disabled-light: #F5F5F5
12
11
  ),
13
- font: (
14
- family: '',
15
- size: 14px
16
- ),
17
- buttons: (
18
- color: #FFF
19
- ),
20
- inputs: (
21
- background-color: #FFF
12
+ typography: null,
13
+ fonts: (
14
+ hero-titles: (
15
+ family: '',
16
+ size: 0
17
+ ),
18
+ titles: (
19
+ family: '',
20
+ size: 0
21
+ ),
22
+ body: (
23
+ family: '',
24
+ size: 0
25
+ ),
26
+ buttons: (
27
+ family: '',
28
+ size: 0
29
+ )
22
30
  )
23
31
  ),
24
32
  tables: (
@@ -1,6 +1,6 @@
1
1
  @use 'sass:map';
2
2
 
3
- $font-path: '../../../../assets/fonts/';
3
+ $font-path: 'assets/fonts/';
4
4
  $font-sources: (
5
5
  (
6
6
  name: 'OpenSans',
@@ -38,34 +38,3 @@ $font-sources: (
38
38
  }
39
39
  }
40
40
  }
41
-
42
- @mixin font($family: 'OpenSans-normal', $size: 14px) {
43
- font: {
44
- family: $family;
45
- size: $size;
46
- };
47
- }
48
-
49
- @mixin main-font($size: 14px) {
50
- @include font('OpenSans-normal', $size);
51
- }
52
-
53
- @mixin main-bolded-font($size: 14px) {
54
- @include font('OpenSans-Bold', $size);
55
- }
56
-
57
- @mixin title-font($size: 20px) {
58
- @include font('Montserrat-bold', $size);
59
- }
60
-
61
- @mixin font-family-from($theme) {
62
- $font-family: map.get($theme, 'general', 'font', 'family');
63
-
64
- @if $font-family == '' {
65
- @content;
66
- }
67
- @else {
68
- $font-size: map.get($theme, 'general', 'font', 'size');
69
- @include font($font-family, $font-size);
70
- }
71
- }
@@ -1,22 +1,32 @@
1
1
  @use '@angular/material' as theming;
2
2
  @use 'palette-generator';
3
+ @use 'typography-generator';
3
4
  @use 'sass:map';
5
+ @use '../../typography/fonts';
4
6
 
5
7
  /* stylelint-disable scss/function-no-unknown */
6
8
  @mixin generate-from($theme) {
7
9
  @include theming.core();
10
+ $body-font: map.get($theme, 'general', 'fonts', 'body', 'family');
11
+
12
+ @if $body-font == '' {
13
+ @include fonts.generate-default-font();
14
+ }
8
15
 
9
16
  $primary-palette: theming.define-palette(-get-material-palette-for('primary', $theme));
10
17
  $accent-palette: theming.define-palette(-get-material-palette-for('accent', $theme));
11
18
  $warn-palette: theming.define-palette(theming.$red-palette);
12
19
 
20
+ $typography: typography-generator.generate-from($theme);
21
+ @include theming.typography-hierarchy($typography);
22
+
13
23
  $default-theme: theming.define-light-theme((
14
24
  color: (
15
25
  primary: $primary-palette,
16
26
  accent: $accent-palette,
17
27
  warn: $warn-palette
18
28
  ),
19
- typography: theming.define-typography-config()
29
+ typography: $typography
20
30
  ));
21
31
 
22
32
  @include theming.all-component-themes($default-theme);
@@ -0,0 +1,98 @@
1
+ /* stylelint-disable scss/no-duplicate-dollar-variables, scss/function-no-unknown */
2
+ @use '@angular/material' as theming;
3
+ @use 'sass:map';
4
+
5
+ @function generate-from($theme) {
6
+ $theme-typography: map.get($theme, 'general', 'typography');
7
+
8
+ @if $theme-typography {
9
+ @return $theme-typography;
10
+ }
11
+
12
+ @return -generate-typography-from($theme);
13
+ }
14
+
15
+ @function -generate-typography-from($theme) {
16
+ $fonts: map.get($theme, 'general', 'fonts');
17
+ $typography: theming.define-typography-config();
18
+
19
+ $typography: -set-font-size-for('body', $typography, $fonts, ('body-1', 'body-2'));
20
+ $typography: -set-font-size-for('buttons', $typography, $fonts, ('buttons'));
21
+ $typography: -set-font-size-for('hero-titles', $typography, $fonts, ('headline-1', 'headline-2', 'headline-3', 'headline-4'));
22
+ $typography: -set-font-size-for('titles', $typography, $fonts, ('headline-5', 'headline-6', 'subtitle-1', 'subtitle-2'));
23
+ $typography: -set-font-family($typography, $fonts);
24
+
25
+ @return $typography;
26
+ }
27
+
28
+ @function -set-font-size-for($selector, $typography, $fonts, $desired-size-settings) {
29
+ $desired-size: map.get($fonts, $selector, 'size');
30
+
31
+ @if $desired-size != 0 {
32
+ @each $setting in $desired-size-settings {
33
+ $typography: map.set($typography, $setting, 'font-size', $desired-size);
34
+ }
35
+ }
36
+
37
+ @return $typography;
38
+ }
39
+
40
+ @function -set-font-family($typography, $fonts) {
41
+ $body-font: map.get($fonts, 'body', 'family');
42
+
43
+ @if $body-font == '' {
44
+ @return -generate-defaults-from($typography);
45
+ }
46
+
47
+ $typography: -set-typography-group($typography, ('body-1', 'body-2', 'caption'), $body-font);
48
+
49
+ $titles-font: map.get($fonts, 'titles', 'family');
50
+ $hero-titles-font: map.get($fonts, 'hero-titles', 'family');
51
+ $buttons-font: map.get($fonts, 'buttons', 'family');
52
+
53
+ // We fallback to body font if buttons font isn't provided.
54
+ @if $buttons-font == '' {
55
+ $buttons-font: $body-font;
56
+ }
57
+
58
+ // Both titles font fallback to body font unless main one's being set.
59
+ @if $hero-titles-font == '' and $titles-font == '' {
60
+ $hero-titles-font: $body-font;
61
+ $titles-font: $body-font;
62
+ }
63
+ @else if $hero-titles-font == '' and $titles-font != '' {
64
+ $hero-titles-font: $titles-font;
65
+ }
66
+
67
+ $typography: -set-text-groups-for($typography, $body-font, $buttons-font);
68
+ $typography: -set-typography-group($typography, ('headline-1', 'headline-2', 'headline-3', 'headline-4'), $hero-titles-font);
69
+ $typography: -set-typography-group($typography, ('headline-5', 'headline-6', 'subtitle-1', 'subtitle-2'), $titles-font);
70
+
71
+ @return $typography;
72
+ }
73
+
74
+ @function -set-text-groups-for($typography, $body-font, $buttons-font) {
75
+ $typography: -set-typography-group($typography, ('body-1', 'body-2', 'caption'), $body-font);
76
+ $typography: -set-typography-group($typography, ('button'), $buttons-font);
77
+ @return $typography;
78
+ }
79
+
80
+ @function -generate-defaults-from($typography) {
81
+ $typography: -set-text-groups-for($typography, 'OpenSans-normal', 'OpenSans-bold');
82
+ $typography: -set-typography-group($typography,('headline-1', 'headline-2', 'headline-3',
83
+ 'headline-4', 'headline-5', 'headline-6', 'subtitle-1', 'subtitle-2'),'Montserrat-bold');
84
+ @return $typography;
85
+ }
86
+
87
+ @function -set-typography-group($typography, $desired-typography-group, $font) {
88
+ @each $setting in $desired-typography-group {
89
+ $typography: -set-typography-font($typography, $setting, $font);
90
+ }
91
+
92
+ @return $typography;
93
+ }
94
+
95
+ @function -set-typography-font($typography, $section, $font) {
96
+ $typography: map.set($typography, $section, 'font-family', $font);
97
+ @return $typography;
98
+ }
@@ -8,6 +8,10 @@
8
8
  margin-left: 10px;
9
9
  }
10
10
  }
11
+
12
+ .entry-checkbox {
13
+ display: block;
14
+ }
11
15
  }
12
16
 
13
17
  .mat-mdc-form-field {
@@ -5,11 +5,11 @@ $custom-theme: (
5
5
  colors: (
6
6
  primary: #FAE3C1
7
7
  ),
8
- font: (
9
- size: 13px
10
- ),
11
- buttons: (
12
- color: #AAA
8
+ fonts: (
9
+ body: (
10
+ family: 'My-Font',
11
+ size: 41px
12
+ )
13
13
  )
14
14
  ),
15
15
  tables: (
@@ -1,20 +0,0 @@
1
- @use 'sass:map';
2
- @use '../default-theme' as default;
3
- @use '../typography/fonts';
4
- @use 'anchors/generator' as anchors;
5
- @use 'buttons/generator' as buttons;
6
-
7
- $default-theme: default.$theme;
8
-
9
- @mixin generate-from($custom-theme: ()) {
10
- $merged-theme: map.deep-merge($default-theme, $custom-theme);
11
-
12
- $font-family: map.get($merged-theme, 'general', 'font', 'family');
13
-
14
- @if $font-family == '' {
15
- // @include fonts.generate-default-font();
16
- }
17
-
18
- @include anchors.generate-from($merged-theme);
19
- @include buttons.generate-from($merged-theme);
20
- }
@@ -1,16 +0,0 @@
1
- @use 'sass:map';
2
-
3
- @mixin generate-from($theme) {
4
- $colors: map.get($theme, 'general', 'colors');
5
- $primary-color: map.get($colors, 'primary');
6
- $accent-color: map.get($colors, 'accent');
7
-
8
- .entry-link {
9
- color: $primary-color;
10
- text-decoration: none;
11
-
12
- &:hover {
13
- color: $accent-color;
14
- }
15
- }
16
- }
@@ -1,12 +0,0 @@
1
- %entry-button {
2
- display: inline-block;
3
- padding: 10px 20px;
4
- transition: .4s;
5
- border: 0;
6
- line-height: 1.25;
7
- cursor: pointer;
8
- text: {
9
- align: center;
10
- decoration: none;
11
- }
12
- }
@@ -1,45 +0,0 @@
1
- @use 'default';
2
- @use 'sass:map';
3
- @use '../../typography/fonts';
4
- @use '../../states/hover';
5
-
6
- @mixin generate-from($theme) {
7
- $button-color: map.get($theme, 'general', 'buttons', 'color');
8
- $colors: map.get($theme, 'general', 'colors');
9
- $primary-color: map.get($colors, 'primary');
10
- $accent-color: map.get($colors, 'accent');
11
- $disabled-color: map.get($colors, 'disabled');
12
-
13
- .entry-button-accent, .entry-button-primary, .entry-button-dark {
14
- @extend %entry-button;
15
- @include fonts.font-family-from($theme) {
16
- @include fonts.main-bolded-font();
17
- }
18
- color: $button-color;
19
- }
20
-
21
- .entry-button-primary {
22
- @include hover.default($primary-color, $accent-color, $button-color, $disabled-color);
23
- }
24
-
25
- .entry-button-accent {
26
- @include hover.default($accent-color, $primary-color, $button-color, $disabled-color);
27
- }
28
-
29
- .entry-button-dark {
30
- @include hover.default(map.get($colors, 'dark'), $primary-color, $button-color, $disabled-color);
31
- }
32
-
33
- .entry-button-blank {
34
- @include fonts.font-family-from($theme) {
35
- @include fonts.main-font();
36
- }
37
-
38
- @include hover.default(transparent, transparent, $accent-color, transparent);
39
- color: $primary-color;
40
-
41
- &:disabled {
42
- color: $primary-color;
43
- }
44
- }
45
- }
@@ -1,18 +0,0 @@
1
- @mixin default($background, $hover-background, $color, $disabled-background) {
2
- background-color: $background;
3
-
4
- &:hover, &:active {
5
- background-color: $hover-background;
6
- color: $color;
7
- }
8
-
9
- &:disabled, &.disabled {
10
- background-color: $disabled-background;
11
- cursor: not-allowed;
12
-
13
- /* stylelint-disable-next-line selector-max-pseudo-class */
14
- &:hover {
15
- background-color: $disabled-background;
16
- }
17
- }
18
- }