@camaradesuk/m3e-angular 0.2.0-alpha.8 → 0.2.0-alpha.9

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 (40) hide show
  1. package/fesm2022/camaradesuk-m3e-angular.mjs +226 -42
  2. package/fesm2022/camaradesuk-m3e-angular.mjs.map +1 -1
  3. package/package.json +1 -1
  4. package/src/lib/styles/_index.scss +1 -0
  5. package/src/lib/styles/components/all-buttons/_common-selectors.scss +7 -6
  6. package/src/lib/styles/components/all-buttons/button/_index.scss +12 -0
  7. package/src/lib/styles/components/all-buttons/button/tokens/_common.scss +18 -0
  8. package/src/lib/styles/components/all-buttons/button/tokens/_l.scss +25 -0
  9. package/src/lib/styles/components/all-buttons/button/tokens/_m.scss +25 -0
  10. package/src/lib/styles/components/all-buttons/button/tokens/_s.scss +25 -0
  11. package/src/lib/styles/components/all-buttons/button/tokens/_xl.scss +25 -0
  12. package/src/lib/styles/components/all-buttons/button/tokens/_xs.scss +30 -5
  13. package/src/lib/styles/components/all-buttons/button-group/_connected-l-corners.scss +2 -78
  14. package/src/lib/styles/components/all-buttons/button-group/_connected-m-corners.scss +2 -78
  15. package/src/lib/styles/components/all-buttons/button-group/_connected-s-corners.scss +2 -80
  16. package/src/lib/styles/components/all-buttons/button-group/_connected-xl-corners.scss +2 -78
  17. package/src/lib/styles/components/all-buttons/button-group/_connected-xs-corners.scss +2 -79
  18. package/src/lib/styles/components/all-buttons/button-group/_index.scss +6 -0
  19. package/src/lib/styles/components/all-buttons/fab/_index.scss +109 -0
  20. package/src/lib/styles/components/all-buttons/icon-button/_index.scss +26 -0
  21. package/src/lib/styles/components/all-buttons/icon-button/configs/_s.scss +1 -1
  22. package/src/lib/styles/components/all-buttons/icon-button/configs/_xl.scss +2 -2
  23. package/src/lib/styles/components/all-buttons/icon-button/tokens/_l.scss +1 -1
  24. package/src/lib/styles/components/all-buttons/icon-button/tokens/_m.scss +1 -1
  25. package/src/lib/styles/components/all-buttons/icon-button/tokens/_s.scss +2 -0
  26. package/src/lib/styles/components/all-buttons/icon-button/tokens/_xl.scss +3 -0
  27. package/src/lib/styles/components/all-buttons/icon-button/tokens/_xs.scss +1 -1
  28. package/src/lib/styles/components/all-buttons/split-button/_connected-l-corners.scss +15 -57
  29. package/src/lib/styles/components/all-buttons/split-button/_connected-m-corners.scss +15 -57
  30. package/src/lib/styles/components/all-buttons/split-button/_connected-s-corners.scss +15 -58
  31. package/src/lib/styles/components/all-buttons/split-button/_connected-xl-corners.scss +15 -57
  32. package/src/lib/styles/components/all-buttons/split-button/_connected-xs-corners.scss +15 -58
  33. package/src/lib/styles/components/all-buttons/split-button/_index.scss +16 -5
  34. package/src/lib/styles/components/all-buttons/utils/_connected-corners.scss +146 -0
  35. package/src/lib/styles/components/all-buttons/utils/_elevated-icon.scss +52 -0
  36. package/src/lib/styles/utils/mixins/_button-focus.scss +24 -0
  37. package/src/lib/styles/utils/mixins/_index.scss +1 -0
  38. package/src/styles/styles.css +1929 -269
  39. package/src/styles/styles.css.map +1 -1
  40. package/types/camaradesuk-m3e-angular.d.ts +34 -7
@@ -1,60 +1,17 @@
1
- @use '@angular/material' as mat;
2
- @use '../utils/functions' as button-functions;
3
- @use '../../../utils/functions' as utils-functions;
4
- @use 'sass:map';
5
- @use '../common-selectors';
1
+ @use '../utils/connected-corners';
6
2
 
7
- @mixin mat-exp-split-button-connected-xs-corners($host-selector) {
8
- #{$host-selector}[data-size='xs'] {
9
- > :first-child {
10
- @include mat.button-overrides(
11
- button-functions.button-shape-tokens-raw(
12
- utils-functions.rem(16) utils-functions.rem(4) utils-functions.rem(4)
13
- utils-functions.rem(16)
14
- )
15
- );
16
- @include mat.icon-button-overrides(
17
- button-functions.icon-button-shape-tokens-raw(
18
- utils-functions.rem(16) utils-functions.rem(4) utils-functions.rem(4)
19
- utils-functions.rem(16)
20
- )
21
- );
22
-
23
- &:active {
24
- @each $selector in common-selectors.$icon-button-ripple-selectors {
25
- #{$selector} {
26
- border-radius: inherit !important;
27
- }
28
- }
29
- }
30
- }
31
-
32
- > :last-child {
33
- @include mat.button-overrides(
34
- button-functions.button-shape-tokens-raw(
35
- utils-functions.rem(4) utils-functions.rem(16) utils-functions.rem(16)
36
- utils-functions.rem(4)
37
- )
38
- );
39
- @include mat.icon-button-overrides(
40
- button-functions.icon-button-shape-tokens-raw(
41
- utils-functions.rem(4) utils-functions.rem(16) utils-functions.rem(16)
42
- utils-functions.rem(4)
43
- )
44
- );
45
-
46
- &[data-appearance='outlined']:active {
47
- @each $selector in common-selectors.$icon-button-only-ripple-selectors {
48
- #{$selector} {
49
- border-radius: inherit;
50
- }
51
- }
52
- }
53
- }
54
-
55
- > :last-child[data-menu-open='true'] {
56
- @include mat.button-overrides(button-functions.button-shape-tokens(16));
57
- @include mat.icon-button-overrides(button-functions.icon-button-shape-tokens(16));
58
- }
59
- }
3
+ @mixin mat-exp-split-button-connected-xs-corners($host-selector, $skip-properties: false) {
4
+ @include connected-corners.split(
5
+ $host-selector,
6
+ 'xs',
7
+ 32,
8
+ 4,
9
+ 8,
10
+ 22,
11
+ 48,
12
+ 1,
13
+ 12,
14
+ 10,
15
+ $skip-properties
16
+ );
60
17
  }
@@ -1,3 +1,4 @@
1
+ @use '../utils/elevated-icon';
1
2
  @use './config';
2
3
  @use './connected-xs-corners';
3
4
  @use './connected-s-corners';
@@ -7,6 +8,7 @@
7
8
  @use '../../../utils/functions';
8
9
  @use '../../../utils/mixins';
9
10
  @use 'sass:map';
11
+ @use '@angular/material' as mat;
10
12
 
11
13
  $_mat-exp-split-button-class: 'mat-exp-split-button';
12
14
 
@@ -88,27 +90,36 @@ $_mat-exp-split-button-class: 'mat-exp-split-button';
88
90
  // gated on the same `sizes` option directly rather than via filter-config().
89
91
  @if functions.size-included('xs', $sizes) {
90
92
  @include connected-xs-corners.mat-exp-split-button-connected-xs-corners(
91
- $mat-exp-split-button-class
93
+ $mat-exp-split-button-class,
94
+ $skip-html-element-styles
92
95
  );
93
96
  }
94
97
  @if functions.size-included('s', $sizes) {
95
98
  @include connected-s-corners.mat-exp-split-button-connected-s-corners(
96
- $mat-exp-split-button-class
99
+ $mat-exp-split-button-class,
100
+ $skip-html-element-styles
97
101
  );
98
102
  }
99
103
  @if functions.size-included('m', $sizes) {
100
104
  @include connected-m-corners.mat-exp-split-button-connected-m-corners(
101
- $mat-exp-split-button-class
105
+ $mat-exp-split-button-class,
106
+ $skip-html-element-styles
102
107
  );
103
108
  }
104
109
  @if functions.size-included('l', $sizes) {
105
110
  @include connected-l-corners.mat-exp-split-button-connected-l-corners(
106
- $mat-exp-split-button-class
111
+ $mat-exp-split-button-class,
112
+ $skip-html-element-styles
107
113
  );
108
114
  }
109
115
  @if functions.size-included('xl', $sizes) {
110
116
  @include connected-xl-corners.mat-exp-split-button-connected-xl-corners(
111
- $mat-exp-split-button-class
117
+ $mat-exp-split-button-class,
118
+ $skip-html-element-styles
112
119
  );
113
120
  }
121
+ @include elevated-icon.styles(
122
+ "#{$mat-exp-split-button-class}[data-appearance='elevated'] > .mat-exp-icon-button",
123
+ $skip-html-element-styles
124
+ );
114
125
  }
@@ -0,0 +1,146 @@
1
+ @use '@angular/material' as mat;
2
+ @use 'sass:math';
3
+ @use './functions' as button-functions;
4
+ @use '../../../utils/functions' as functions;
5
+
6
+ @mixin _shape($shape) {
7
+ @include mat.button-overrides(button-functions.button-shape-tokens-raw($shape));
8
+ @include mat.icon-button-overrides(button-functions.icon-button-shape-tokens-raw($shape));
9
+ }
10
+
11
+ @mixin _end-shape($outer, $inner, $first) {
12
+ @if $first {
13
+ @include _shape($outer $inner $inner $outer);
14
+ &:dir(rtl) {
15
+ @include _shape($inner $outer $outer $inner);
16
+ }
17
+ } @else {
18
+ @include _shape($inner $outer $outer $inner);
19
+ &:dir(rtl) {
20
+ @include _shape($outer $inner $inner $outer);
21
+ }
22
+ }
23
+ }
24
+
25
+ // One implementation for all five sizes; wrappers contain only source-token values.
26
+ @mixin group($selector, $size, $height, $inner, $pressed) {
27
+ $outer: functions.rem(math.div($height, 2));
28
+ $inner: functions.rem($inner);
29
+ $pressed: functions.rem($pressed);
30
+ #{$selector}[data-variant='connected'][data-size='#{$size}'] {
31
+ @each $shape, $outside in (round: $outer, square: $inner) {
32
+ &[data-shape='#{$shape}'] {
33
+ > :first-child:not([data-toggle='selected']) {
34
+ @include _end-shape($outside, $inner, true);
35
+ }
36
+ > :last-child:not([data-toggle='selected']) {
37
+ @include _end-shape($outside, $inner, false);
38
+ }
39
+ > :not(:first-child):not(:last-child):not([data-toggle='selected']) {
40
+ @include _shape($inner);
41
+ }
42
+ > [data-toggle='selected'] {
43
+ @include _shape($outer);
44
+ }
45
+ > :not([disabled]):not(.mat-mdc-button-disabled):is(:active, [data-state='pressed']) {
46
+ @include _shape($pressed);
47
+ &:first-child {
48
+ @include _end-shape($outside, $pressed, true);
49
+ }
50
+ &:last-child {
51
+ @include _end-shape($outside, $pressed, false);
52
+ }
53
+ }
54
+ > :only-child:not([data-toggle='selected']) {
55
+ @include _shape($outside);
56
+ }
57
+ }
58
+ }
59
+ }
60
+ }
61
+
62
+ @mixin split(
63
+ $selector,
64
+ $size,
65
+ $height,
66
+ $inner,
67
+ $interacted,
68
+ $icon,
69
+ $width,
70
+ $offset,
71
+ $leading-start,
72
+ $leading-end,
73
+ $skip-properties: false
74
+ ) {
75
+ $outer: functions.rem(math.div($height, 2));
76
+ $inner: functions.rem($inner);
77
+ $interacted: functions.rem($interacted);
78
+ #{$selector}[data-size='#{$size}'] {
79
+ @if not $skip-properties {
80
+ > .mat-exp-button:first-child {
81
+ padding-inline-start: functions.rem($leading-start);
82
+ padding-inline-end: functions.rem($leading-end);
83
+ }
84
+ > .mat-exp-icon-button.mat-mdc-icon-button:last-child {
85
+ display: inline-flex;
86
+ align-items: center;
87
+ justify-content: center;
88
+ width: functions.rem($width);
89
+ min-width: functions.rem($width);
90
+ padding: 0;
91
+ --_mat-exp-split-icon-offset: #{functions.rem(-$offset)};
92
+ &:dir(rtl) {
93
+ --_mat-exp-split-icon-offset: #{functions.rem($offset)};
94
+ --_mat-exp-split-rotation-direction: -1;
95
+ }
96
+ > :is(
97
+ .mat-icon,
98
+ .material-icons,
99
+ .material-symbols-outlined,
100
+ .material-symbols-rounded,
101
+ .material-symbols-sharp,
102
+ [matButtonIcon]
103
+ ) {
104
+ width: functions.rem($icon);
105
+ height: functions.rem($icon);
106
+ font-size: functions.rem($icon);
107
+ line-height: functions.rem($icon);
108
+ transform: translateX(
109
+ calc(var(--_mat-exp-split-icon-offset) * (1 - var(--_mat-exp-split-icon-progress, 0)))
110
+ )
111
+ rotate(
112
+ calc(
113
+ var(--_mat-exp-split-icon-rotation, 0) *
114
+ var(--_mat-exp-split-rotation-direction, 1) *
115
+ 1deg
116
+ )
117
+ );
118
+ transition: none;
119
+ }
120
+ }
121
+ }
122
+ > :first-child {
123
+ @include _end-shape($outer, $inner, true);
124
+ &:not([disabled]):not(.mat-mdc-button-disabled):is(:hover, :active, [data-state='pressed']) {
125
+ @include _end-shape($outer, $interacted, true);
126
+ }
127
+ }
128
+ > :last-child {
129
+ @include _end-shape($outer, $inner, false);
130
+ &:not([data-menu-open='true']):not([disabled]):not(.mat-mdc-button-disabled):hover {
131
+ @include _end-shape($outer, $interacted, false);
132
+ }
133
+ &[data-menu-open='true'] {
134
+ @include _shape($outer);
135
+ @if not $skip-properties {
136
+ .mat-mdc-button-persistent-ripple::before {
137
+ opacity: 0.1;
138
+ }
139
+ }
140
+ }
141
+ &:not([disabled]):not(.mat-mdc-button-disabled):is(:active, [data-state='pressed']) {
142
+ @include _end-shape($outer, $interacted, false);
143
+ }
144
+ }
145
+ }
146
+ }
@@ -0,0 +1,52 @@
1
+ @use '@angular/material' as mat;
2
+
3
+ // Elevated is a composed group/split appearance, rather than a standalone
4
+ // icon-button appearance. Keep the native icon button's behavior and state layer.
5
+ @mixin styles($selector, $skip-properties: false, $toggle: false) {
6
+ #{$selector} {
7
+ @include mat.icon-button-overrides(
8
+ (
9
+ icon-color: var(--mat-sys-primary),
10
+ state-layer-color: currentColor,
11
+ )
12
+ );
13
+ @if not $skip-properties {
14
+ background-color: var(--mat-sys-surface-container-low);
15
+ box-shadow: var(--mat-sys-level1);
16
+ &:hover {
17
+ box-shadow: var(--mat-sys-level2);
18
+ }
19
+ &:focus,
20
+ &:active {
21
+ box-shadow: var(--mat-sys-level1);
22
+ }
23
+ @if $toggle {
24
+ &[data-toggle='selected'] {
25
+ @include mat.icon-button-overrides(
26
+ (
27
+ icon-color: var(--mat-sys-on-primary),
28
+ )
29
+ );
30
+ background-color: var(--mat-sys-primary);
31
+ }
32
+ }
33
+ &[disabled],
34
+ &.mat-mdc-button-disabled {
35
+ color: color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent);
36
+ background-color: color-mix(in srgb, var(--mat-sys-on-surface) 10%, transparent);
37
+ box-shadow: none;
38
+ }
39
+ @media (forced-colors: active) {
40
+ &[data-toggle='selected'] {
41
+ @include mat.icon-button-overrides(
42
+ (
43
+ icon-color: HighlightText,
44
+ )
45
+ );
46
+ background-color: Highlight;
47
+ color: HighlightText;
48
+ }
49
+ }
50
+ }
51
+ }
52
+ }
@@ -0,0 +1,24 @@
1
+ // The state diagrams show a visible outer keyboard-focus indicator. Keep its
2
+ // width/color customizable while retaining a visible system-color ring in HCM.
3
+ @mixin button-focus($selector) {
4
+ #{$selector}:focus-visible {
5
+ outline: var(--mat-exp-button-focus-ring-width, 3px) solid
6
+ var(--mat-exp-button-focus-ring-color, var(--mat-sys-secondary));
7
+ outline-offset: var(--mat-exp-button-focus-ring-offset, 2px);
8
+ }
9
+ #{$selector} .mat-mdc-button-touch-target {
10
+ display: block;
11
+ min-width: 48px;
12
+ min-height: 48px;
13
+ }
14
+ @media (forced-colors: active) {
15
+ #{$selector}:focus-visible {
16
+ outline-color: Highlight;
17
+ }
18
+ #{$selector}[data-toggle='selected'] {
19
+ forced-color-adjust: none;
20
+ background-color: Highlight;
21
+ color: HighlightText;
22
+ }
23
+ }
24
+ }
@@ -1,2 +1,3 @@
1
1
  @forward './apply-tokens-properties';
2
2
  @forward './keyframes';
3
+ @forward './button-focus';