@camaradesuk/m3e-angular 0.2.0-alpha.7 → 0.2.0-alpha.8
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/README.md +6 -4
- package/fesm2022/camaradesuk-m3e-angular.mjs +2299 -47
- package/fesm2022/camaradesuk-m3e-angular.mjs.map +1 -1
- package/package.json +5 -4
- package/src/lib/styles/_index.scss +1 -0
- package/src/lib/styles/_mat-exp-styles.scss +2 -0
- package/src/lib/styles/components/all-buttons/button/_index.scss +3 -0
- package/src/lib/styles/components/all-buttons/icon-button/_index.scss +3 -0
- package/src/lib/styles/components/autocomplete/_index.scss +183 -0
- package/src/styles/styles.css +211 -55
- package/src/styles/styles.css.map +1 -1
- package/types/camaradesuk-m3e-angular.d.ts +528 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camaradesuk/m3e-angular",
|
|
3
|
-
"version": "0.2.0-alpha.
|
|
3
|
+
"version": "0.2.0-alpha.8",
|
|
4
4
|
"description": "Angular Material Expressive is a library that provides a set of components and styles for Angular Material based on the latest Material Design 3 Expressive Design System.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
@@ -29,13 +29,14 @@
|
|
|
29
29
|
},
|
|
30
30
|
"homepage": "https://github.com/camaradesuk/m3e-angular",
|
|
31
31
|
"peerDependencies": {
|
|
32
|
-
"@angular/cdk": "^22.
|
|
32
|
+
"@angular/cdk": "^22.2.4",
|
|
33
33
|
"@angular/common": "^22.0.0",
|
|
34
34
|
"@angular/core": "^22.0.0",
|
|
35
35
|
"@angular/forms": "^22.0.0",
|
|
36
|
-
"@angular/material": "^22.
|
|
36
|
+
"@angular/material": "^22.2.4",
|
|
37
37
|
"gsap": "^3.13.0",
|
|
38
|
-
"rxjs": "^7.8.0"
|
|
38
|
+
"rxjs": "^7.8.0",
|
|
39
|
+
"@angular/aria": "^22.2.4"
|
|
39
40
|
},
|
|
40
41
|
"dependencies": {
|
|
41
42
|
"tslib": "^2.3.0"
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
@use './components/dialog';
|
|
3
3
|
@use './components/toolbars';
|
|
4
4
|
@use './components/lists';
|
|
5
|
+
@use './components/autocomplete';
|
|
5
6
|
|
|
6
7
|
@mixin mat-exp-all-styles(
|
|
7
8
|
$options: (
|
|
@@ -15,4 +16,5 @@
|
|
|
15
16
|
@include dialog.mat-exp-dialog-styles($options);
|
|
16
17
|
@include toolbars.mat-exp-toolbar-styles($options);
|
|
17
18
|
@include lists.mat-exp-list-styles($options);
|
|
19
|
+
@include autocomplete.mat-exp-autocomplete-styles();
|
|
18
20
|
}
|
|
@@ -70,6 +70,9 @@ $_mat-exp-button-class: 'mat-exp-button';
|
|
|
70
70
|
@if map.has-key($item, state) {
|
|
71
71
|
$state: map.get($item, state);
|
|
72
72
|
$pseudo-selector: functions.get-state-pseudo($state);
|
|
73
|
+
@if $state == 'pressed' {
|
|
74
|
+
$pseudo-selector: ":is(:active, .mat-exp-menu-trigger[data-menu-open='true'])";
|
|
75
|
+
}
|
|
73
76
|
|
|
74
77
|
// Generate styles with data attribute selector
|
|
75
78
|
#{$selector}[data-state='#{$state}'] {
|
|
@@ -85,6 +85,9 @@ $_mat-exp-icon-button-class: 'mat-exp-icon-button';
|
|
|
85
85
|
@if map.has-key($item, state) {
|
|
86
86
|
$state: map.get($item, state);
|
|
87
87
|
$pseudo-selector: functions.get-state-pseudo($state);
|
|
88
|
+
@if $state == 'pressed' {
|
|
89
|
+
$pseudo-selector: ":is(:active, .mat-exp-menu-trigger[data-menu-open='true'])";
|
|
90
|
+
}
|
|
88
91
|
|
|
89
92
|
// Generate styles with data attribute selector
|
|
90
93
|
#{$selector}[data-state='#{$state}'] {
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
@use '@angular/material' as mat;
|
|
2
|
+
|
|
3
|
+
/// Expressive appearance for an existing Material autocomplete.
|
|
4
|
+
/// Pass mat-exp-autocomplete-panel via its public class input and put
|
|
5
|
+
/// mat-exp-autocomplete-option on native mat-option elements.
|
|
6
|
+
/// Navigation, selection, and popup lifecycle remain owned by Angular Material.
|
|
7
|
+
@mixin mat-exp-autocomplete-styles() {
|
|
8
|
+
.mat-exp-autocomplete-panel[role='listbox'] {
|
|
9
|
+
--city-surface: var(--mat-exp-menu-container-color, var(--mat-sys-surface-container-low));
|
|
10
|
+
--city-label: var(--mat-exp-menu-label-color, var(--mat-sys-on-surface));
|
|
11
|
+
--city-selected: var(
|
|
12
|
+
--mat-exp-menu-selected-container-color,
|
|
13
|
+
var(--mat-sys-tertiary-container)
|
|
14
|
+
);
|
|
15
|
+
--city-on-selected: var(
|
|
16
|
+
--mat-exp-menu-selected-content-color,
|
|
17
|
+
var(--mat-sys-on-tertiary-container)
|
|
18
|
+
);
|
|
19
|
+
--city-state: var(--mat-exp-menu-state-layer-color, var(--mat-sys-on-surface));
|
|
20
|
+
--city-target: 48px;
|
|
21
|
+
|
|
22
|
+
@include mat.autocomplete-overrides(
|
|
23
|
+
(
|
|
24
|
+
container-shape: var(--mat-exp-menu-container-shape, 16px),
|
|
25
|
+
background-color: var(--city-surface),
|
|
26
|
+
container-elevation-shadow: var(--mat-exp-menu-elevation, var(--mat-sys-level2)),
|
|
27
|
+
)
|
|
28
|
+
);
|
|
29
|
+
@include mat.option-overrides(
|
|
30
|
+
(
|
|
31
|
+
label-text-color: var(--city-label),
|
|
32
|
+
selected-state-label-text-color: var(--city-on-selected),
|
|
33
|
+
selected-state-layer-color: transparent,
|
|
34
|
+
hover-state-layer-color: transparent,
|
|
35
|
+
focus-state-layer-color: transparent,
|
|
36
|
+
label-text-font: var(--mat-exp-menu-label-font, var(--mat-sys-label-large-font, sans-serif)),
|
|
37
|
+
label-text-size: var(--mat-exp-menu-label-size, 14px),
|
|
38
|
+
label-text-weight: var(--mat-exp-menu-label-weight, 500),
|
|
39
|
+
label-text-line-height: var(--mat-exp-menu-label-line-height, 20px),
|
|
40
|
+
label-text-tracking: var(--mat-exp-menu-label-tracking, 0.1px),
|
|
41
|
+
)
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
// Native autocomplete flattens the edge beside its field. This opt-in
|
|
45
|
+
// surface keeps all four corners rounded without targeting private classes.
|
|
46
|
+
border-radius: var(--mat-exp-menu-container-shape, 16px) !important;
|
|
47
|
+
max-block-size: 18rem;
|
|
48
|
+
padding: 2px;
|
|
49
|
+
overflow-y: auto;
|
|
50
|
+
overflow-x: hidden;
|
|
51
|
+
overscroll-behavior: contain;
|
|
52
|
+
scrollbar-gutter: auto;
|
|
53
|
+
scrollbar-width: auto;
|
|
54
|
+
scrollbar-color: var(--mat-exp-menu-scrollbar-color, var(--mat-sys-outline)) var(--city-surface);
|
|
55
|
+
clip-path: inset(0 round var(--mat-exp-menu-container-shape, 16px));
|
|
56
|
+
|
|
57
|
+
&.mat-exp-autocomplete-panel-vibrant {
|
|
58
|
+
--city-surface: var(--mat-exp-menu-container-color, var(--mat-sys-tertiary-container));
|
|
59
|
+
--city-label: var(--mat-exp-menu-label-color, var(--mat-sys-on-tertiary-container));
|
|
60
|
+
--city-selected: var(--mat-exp-menu-selected-container-color, var(--mat-sys-tertiary));
|
|
61
|
+
--city-on-selected: var(--mat-exp-menu-selected-content-color, var(--mat-sys-on-tertiary));
|
|
62
|
+
--city-state: var(--mat-exp-menu-state-layer-color, var(--mat-sys-on-tertiary-container));
|
|
63
|
+
}
|
|
64
|
+
&.mat-exp-autocomplete-density-1 {
|
|
65
|
+
--city-target: 44px;
|
|
66
|
+
}
|
|
67
|
+
&.mat-exp-autocomplete-density-2 {
|
|
68
|
+
--city-target: 40px;
|
|
69
|
+
}
|
|
70
|
+
&.mat-exp-autocomplete-density-3 {
|
|
71
|
+
--city-target: 36px;
|
|
72
|
+
}
|
|
73
|
+
&.mat-exp-autocomplete-no-motion {
|
|
74
|
+
animation: none;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.mat-exp-autocomplete-option {
|
|
78
|
+
--city-row-shape: var(--mat-exp-menu-item-shape, 4px);
|
|
79
|
+
--city-row-state: var(--city-state);
|
|
80
|
+
position: relative;
|
|
81
|
+
isolation: isolate;
|
|
82
|
+
min-block-size: var(--city-target);
|
|
83
|
+
padding-inline: 16px;
|
|
84
|
+
border-radius: var(--city-row-shape);
|
|
85
|
+
background: transparent;
|
|
86
|
+
|
|
87
|
+
&:first-child {
|
|
88
|
+
--city-row-shape: var(--mat-exp-menu-item-outer-shape, 12px)
|
|
89
|
+
var(--mat-exp-menu-item-outer-shape, 12px) var(--mat-exp-menu-item-shape, 4px)
|
|
90
|
+
var(--mat-exp-menu-item-shape, 4px);
|
|
91
|
+
}
|
|
92
|
+
&:last-child {
|
|
93
|
+
--city-row-shape: var(--mat-exp-menu-item-shape, 4px) var(--mat-exp-menu-item-shape, 4px)
|
|
94
|
+
var(--mat-exp-menu-item-outer-shape, 12px) var(--mat-exp-menu-item-outer-shape, 12px);
|
|
95
|
+
}
|
|
96
|
+
&:only-child {
|
|
97
|
+
--city-row-shape: var(--mat-exp-menu-item-outer-shape, 12px);
|
|
98
|
+
}
|
|
99
|
+
&::before,
|
|
100
|
+
&::after {
|
|
101
|
+
content: '';
|
|
102
|
+
position: absolute;
|
|
103
|
+
inset: 2px 0;
|
|
104
|
+
z-index: -1;
|
|
105
|
+
border-radius: var(--city-row-shape);
|
|
106
|
+
pointer-events: none;
|
|
107
|
+
}
|
|
108
|
+
&:not([aria-disabled='true']):hover::after {
|
|
109
|
+
background: color-mix(in srgb, var(--city-row-state) 8%, transparent);
|
|
110
|
+
}
|
|
111
|
+
&:not([aria-disabled='true']).mat-exp-autocomplete-active::after,
|
|
112
|
+
&:not([aria-disabled='true']):active::after {
|
|
113
|
+
background: color-mix(in srgb, var(--city-row-state) 10%, transparent);
|
|
114
|
+
}
|
|
115
|
+
&.mat-exp-autocomplete-selected {
|
|
116
|
+
--city-row-shape: var(--mat-exp-menu-selected-shape, 12px);
|
|
117
|
+
--city-row-state: var(--city-on-selected);
|
|
118
|
+
color: var(--city-on-selected);
|
|
119
|
+
&::before {
|
|
120
|
+
background: var(--city-selected);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
&:not([aria-disabled='true']).mat-exp-autocomplete-active {
|
|
124
|
+
outline: var(--mat-exp-menu-focus-width, 3px) solid
|
|
125
|
+
var(--mat-exp-menu-focus-color, var(--mat-sys-secondary));
|
|
126
|
+
outline-offset: var(--mat-exp-menu-focus-offset, -3px);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
@supports selector(::-webkit-scrollbar) {
|
|
132
|
+
.mat-exp-autocomplete-panel[role='listbox'] {
|
|
133
|
+
scrollbar-color: auto;
|
|
134
|
+
scrollbar-width: auto;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
.mat-exp-autocomplete-panel::-webkit-scrollbar {
|
|
138
|
+
width: var(--mat-exp-menu-scrollbar-width, 12px);
|
|
139
|
+
}
|
|
140
|
+
.mat-exp-autocomplete-panel::-webkit-scrollbar-button {
|
|
141
|
+
display: none;
|
|
142
|
+
}
|
|
143
|
+
.mat-exp-autocomplete-panel::-webkit-scrollbar-track {
|
|
144
|
+
margin-block: 4px;
|
|
145
|
+
background: var(--city-surface);
|
|
146
|
+
}
|
|
147
|
+
.mat-exp-autocomplete-panel::-webkit-scrollbar-thumb {
|
|
148
|
+
border: 3px solid var(--city-surface);
|
|
149
|
+
border-radius: 12px;
|
|
150
|
+
background: var(--mat-exp-menu-scrollbar-color, var(--mat-sys-outline));
|
|
151
|
+
}
|
|
152
|
+
.mat-exp-autocomplete-row {
|
|
153
|
+
display: flex;
|
|
154
|
+
align-items: center;
|
|
155
|
+
justify-content: space-between;
|
|
156
|
+
gap: 12px;
|
|
157
|
+
inline-size: 100%;
|
|
158
|
+
}
|
|
159
|
+
.mat-exp-autocomplete-check {
|
|
160
|
+
inline-size: 20px;
|
|
161
|
+
block-size: 20px;
|
|
162
|
+
font-size: 20px;
|
|
163
|
+
line-height: 20px;
|
|
164
|
+
flex-shrink: 0;
|
|
165
|
+
}
|
|
166
|
+
@media (prefers-reduced-motion: reduce) {
|
|
167
|
+
.mat-exp-autocomplete-panel[role='listbox'] {
|
|
168
|
+
animation: none;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
@media (forced-colors: active) {
|
|
172
|
+
.mat-exp-autocomplete-panel .mat-exp-autocomplete-option.mat-exp-autocomplete-active {
|
|
173
|
+
outline-color: Highlight;
|
|
174
|
+
}
|
|
175
|
+
.mat-exp-autocomplete-panel .mat-exp-autocomplete-option.mat-exp-autocomplete-selected {
|
|
176
|
+
color: SelectedItemText;
|
|
177
|
+
&::before {
|
|
178
|
+
background: SelectedItem;
|
|
179
|
+
forced-color-adjust: none;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|