Skip to content

Commit fdfe3a1

Browse files
authored
Merge branch 'angular:main' into slide-toggle-tt
2 parents 6ae6659 + 6716f50 commit fdfe3a1

File tree

18 files changed

+87
-80
lines changed

18 files changed

+87
-80
lines changed

src/components-examples/cdk-experimental/listbox/cdk-listbox-active-descendant/cdk-listbox-active-descendant-example.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
<ul
44
cdkListbox
55
focusMode="activedescendant"
6-
class="example-listbox"
6+
class="example-listbox example-parent"
77
aria-labelledby="active-descendant-label"
88
>
99
<label class="example-label" id="active-descendant-label">Active Descendant Fruits</label>
1010
@for (fruit of fruits; track fruit) {
1111
<li
12-
class="example-option"
12+
class="example-option example-stateful example-selectable"
1313
[value]="fruit"
1414
cdkOption
1515
#option="cdkOption"

src/components-examples/cdk-experimental/listbox/cdk-listbox-configurable/cdk-listbox-configurable-example.css

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@
3131
display: block;
3232
}
3333

34-
.example-listbox[aria-disabled='true'] {
35-
opacity: 0.5;
36-
}
37-
3834
.example-listbox[aria-disabled='true'] .example-option {
3935
pointer-events: none;
4036
}
@@ -53,39 +49,3 @@
5349
align-items: center;
5450
border-radius: var(--mat-sys-corner-extra-small);
5551
}
56-
57-
.example-option.cdk-active,
58-
.example-option[aria-disabled='false']:hover {
59-
outline: 1px solid var(--mat-sys-outline);
60-
background: var(--mat-sys-surface-container);
61-
}
62-
63-
.example-option[aria-disabled='false']:focus-within {
64-
outline: 2px solid var(--mat-sys-primary);
65-
background: var(--mat-sys-surface-container);
66-
}
67-
68-
.example-option[aria-disabled='false'][aria-selected='true'] {
69-
background-color: var(--mat-sys-secondary-container);
70-
}
71-
72-
.example-option.cdk-active[aria-disabled='true'],
73-
.example-option[aria-disabled='true']:focus-within {
74-
outline: 2px solid var(--mat-sys-outline);
75-
}
76-
77-
.example-option[aria-disabled='true'] span {
78-
opacity: 0.3;
79-
}
80-
81-
.example-option[aria-disabled='true']::before {
82-
content: '';
83-
position: absolute;
84-
width: 100%;
85-
height: 100%;
86-
top: 0;
87-
left: 0;
88-
border-radius: var(--mat-sys-corner-extra-small);
89-
background-color: var(--mat-sys-on-surface);
90-
opacity: var(--mat-sys-focus-state-layer-opacity);
91-
}

src/components-examples/cdk-experimental/listbox/cdk-listbox-configurable/cdk-listbox-configurable-example.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
<!-- #docregion listbox -->
5252
<ul
5353
cdkListbox
54+
#listbox="cdkListbox"
5455
[value]="selection"
5556
[wrap]="wrap.value"
5657
[multi]="multi.value"
@@ -60,22 +61,22 @@
6061
[orientation]="orientation"
6162
[focusMode]="focusMode"
6263
[selectionMode]="selectionMode"
63-
class="example-listbox"
64+
class="example-listbox example-parent"
6465
>
6566
<label class="example-label" id="fruit-example-label">List of Fruits</label>
6667

6768
@for (fruit of fruits; track fruit) {
6869
@let optionDisabled = disabledOptions.includes(fruit);
6970

7071
<li
71-
class="example-option"
72+
class="example-option example-stateful example-selectable"
7273
[disabled]="optionDisabled"
7374
[value]="fruit"
7475
cdkOption
7576
#option="cdkOption"
7677
>
7778
<mat-pseudo-checkbox
78-
[disabled]="optionDisabled"
79+
[disabled]="optionDisabled || listbox.disabled()"
7980
[state]="option.pattern.selected() ? 'checked' : 'unchecked'"
8081
></mat-pseudo-checkbox>
8182
<span>{{ fruit }}</span>

src/components-examples/cdk-experimental/listbox/cdk-listbox-disabled-focusable/cdk-listbox-disabled-focusable-example.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
<ul
44
cdkListbox
55
[skipDisabled]="false"
6-
class="example-listbox"
6+
class="example-listbox example-parent"
77
aria-labelledby="disabled-focusable-label"
88
>
99
<label class="example-label" id="disabled-focusable-label">Disabled Focusable Fruits</label>
1010
@for (fruit of fruits; track fruit; let i = $index) {
1111
<li
12-
class="example-option"
12+
class="example-option example-stateful example-selectable"
1313
[value]="fruit"
1414
[disabled]="i % 2 === 0"
1515
cdkOption

src/components-examples/cdk-experimental/listbox/cdk-listbox-disabled-skipped/cdk-listbox-disabled-skipped-example.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
<ul
44
cdkListbox
55
[skipDisabled]="true"
6-
class="example-listbox"
6+
class="example-listbox example-parent"
77
aria-labelledby="disabled-skipped-label"
88
>
99
<label class="example-label" id="disabled-skipped-label">Disabled Skipped Fruits</label>
1010
@for (fruit of fruits; track fruit; let i = $index) {
1111
<li
12-
class="example-option"
12+
class="example-option example-stateful example-selectable"
1313
[value]="fruit"
1414
[disabled]="i % 2 === 0"
1515
cdkOption

src/components-examples/cdk-experimental/listbox/cdk-listbox-disabled/cdk-listbox-disabled-example.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
<ul
33
cdkListbox
44
[disabled]="true"
5-
class="example-listbox"
5+
class="example-listbox example-parent"
66
aria-labelledby="disabled-label"
77
>
88
<label class="example-label" id="disabled-label">Disabled Fruits</label>
99
@for (fruit of fruits; track fruit) {
1010
<li
11-
class="example-option"
11+
class="example-option example-stateful example-selectable"
1212
[value]="fruit"
1313
cdkOption
1414
#option="cdkOption"

src/components-examples/cdk-experimental/listbox/cdk-listbox-horizontal/cdk-listbox-horizontal-example.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
<ul
44
cdkListbox
55
orientation="horizontal"
6-
class="example-listbox"
6+
class="example-listbox example-parent"
77
aria-labelledby="horizontal-label"
88
>
99
<label class="example-label" id="horizontal-label">Horizontal Fruits</label>
1010
@for (fruit of fruits; track fruit) {
1111
<li
12-
class="example-option"
12+
class="example-option example-stateful example-selectable"
1313
[value]="fruit"
1414
cdkOption
1515
#option="cdkOption"

src/components-examples/cdk-experimental/listbox/cdk-listbox-multi-select-follow-focus/cdk-listbox-multi-select-follow-focus-example.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
cdkListbox
55
[multi]="true"
66
selectionMode="follow"
7-
class="example-listbox"
7+
class="example-listbox example-parent"
88
aria-labelledby="multi-follow-label"
99
>
1010
<label class="example-label" id="multi-follow-label">Multi Select (Follow Focus) Fruits</label>
1111
@for (fruit of fruits; track fruit) {
1212
<li
13-
class="example-option"
13+
class="example-option example-stateful example-selectable"
1414
[value]="fruit"
1515
cdkOption
1616
#option="cdkOption"

src/components-examples/cdk-experimental/listbox/cdk-listbox-multi-select/cdk-listbox-multi-select-example.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
cdkListbox
55
[multi]="true"
66
selectionMode="explicit"
7-
class="example-listbox"
7+
class="example-listbox example-parent"
88
aria-labelledby="multi-select-label"
99
>
1010
<label class="example-label" id="multi-select-label">Multi Select Fruits</label>
1111
@for (fruit of fruits; track fruit) {
1212
<li
13-
class="example-option"
13+
class="example-option example-stateful example-selectable"
1414
[value]="fruit"
1515
cdkOption
1616
#option="cdkOption"

src/components-examples/cdk-experimental/listbox/cdk-listbox-readonly/cdk-listbox-readonly-example.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
<ul
44
cdkListbox
55
[readonly]="true"
6-
class="example-listbox"
6+
class="example-listbox example-parent"
77
aria-labelledby="readonly-label"
88
>
99
<label class="example-label" id="readonly-label">Readonly Fruits</label>
1010
@for (fruit of fruits; track fruit) {
1111
<li
12-
class="example-option"
12+
class="example-option example-stateful example-selectable"
1313
[value]="fruit"
1414
cdkOption
1515
#option="cdkOption"

src/components-examples/cdk-experimental/listbox/cdk-listbox-rtl-horizontal/cdk-listbox-rtl-horizontal-example.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
<ul
44
cdkListbox
55
orientation="horizontal"
6-
class="example-listbox"
6+
class="example-listbox example-parent"
77
aria-labelledby="rtl-horizontal-label"
88
>
99
<label class="example-label" id="rtl-horizontal-label">RTL Horizontal Fruits</label>
1010
@for (fruit of fruits; track fruit) {
1111
<li
12-
class="example-option"
12+
class="example-option example-stateful example-selectable"
1313
[value]="fruit"
1414
cdkOption
1515
#option="cdkOption"

src/components-examples/cdk-experimental/listbox/cdk-listbox-single-select-follow-focus/cdk-listbox-single-select-follow-focus-example.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
cdkListbox
55
[multi]="false"
66
selectionMode="follow"
7-
class="example-listbox"
7+
class="example-listbox example-parent"
88
aria-labelledby="single-follow-label"
99
>
1010
<label class="example-label" id="single-follow-label">Single Select (Follow Focus) Fruits</label>
1111
@for (fruit of fruits; track fruit) {
1212
<li
13-
class="example-option"
13+
class="example-option example-stateful example-selectable"
1414
[value]="fruit"
1515
cdkOption
1616
#option="cdkOption"

src/components-examples/cdk-experimental/listbox/cdk-listbox-single-select/cdk-listbox-single-select-example.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
cdkListbox
55
[multi]="false"
66
selectionMode="explicit"
7-
class="example-listbox"
7+
class="example-listbox example-parent"
88
aria-labelledby="single-select-label"
99
>
1010
<label class="example-label" id="single-select-label">Single Select Fruits</label>
1111
@for (fruit of fruits; track fruit) {
1212
<li
13-
class="example-option"
13+
class="example-option example-stateful example-selectable"
1414
[value]="fruit"
1515
cdkOption
1616
#option="cdkOption"

src/components-examples/cdk-experimental/tree/cdk-tree/cdk-tree-example.css

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,6 @@
2424
list-style: none;
2525
}
2626

27-
.example-tree-item[aria-selected='true'] {
28-
background-color: var(--mat-sys-inverse-primary);
29-
}
30-
31-
.example-tree-item[aria-selected='false'] {
32-
background-color: var(--mat-sys-background);
33-
}
34-
35-
.example-tree-item[aria-disabled='true'] {
36-
background-color: var(--mat-sys-surface-container);
37-
color: var(--mat-sys-on-surface-variant);
38-
}
39-
4027
.example-tree-item-content {
4128
display: flex;
4229
align-items: center;

src/components-examples/cdk-experimental/tree/cdk-tree/cdk-tree-example.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ interface ExampleNode {
2525
template: `
2626
<li
2727
cdkTreeItem
28-
class="example-tree-item"
28+
class="example-tree-item example-selectable"
2929
[value]="node().value"
3030
[label]="node().label || node().value"
3131
[disabled]="node().disabled"
3232
#treeItem="cdkTreeItem"
3333
>
3434
<span
35-
class="example-tree-item-content"
35+
class="example-tree-item-content example-stateful"
3636
[style.paddingLeft.px]="(treeItem.pattern.level() - 1) * 24"
3737
>
3838
<mat-icon class="example-tree-item-icon" aria-hidden="true">

src/dev-app/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ filegroup(
153153
filegroup(
154154
name = "dev_app_static_files",
155155
srcs = [
156+
"common-classes.css",
156157
"favicon.ico",
157158
"index.html",
158159
":theme",

src/dev-app/common-classes.css

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
.example-surface {
2+
background: var(--mat-sys-surface);
3+
color: var(--mat-sys-on-surface);
4+
}
5+
6+
.example-stateful {
7+
background-color: color-mix(in srgb, var(--mat-sys-surface) 10%, transparent);
8+
}
9+
10+
[aria-disabled='true'] .example-stateful,
11+
.example-stateful[aria-disabled='true'] {
12+
color: color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent);
13+
}
14+
15+
.example-stateful:focus {
16+
background: color-mix(
17+
in srgb,
18+
var(--mat-sys-on-surface) calc(var(--mat-sys-focus-state-layer-opacity) * 100%),
19+
transparent
20+
);
21+
}
22+
23+
.example-stateful:hover {
24+
background: color-mix(
25+
in srgb,
26+
var(--mat-sys-on-surface) calc(var(--mat-sys-hover-state-layer-opacity) * 100%),
27+
transparent
28+
);
29+
}
30+
31+
.example-stateful:focus[aria-disabled='true'],
32+
.example-stateful:hover[aria-disabled='true'],
33+
[aria-disabled='true'] .example-stateful:focus,
34+
[aria-disabled='true'] .example-stateful:hover {
35+
background: var(--mat-sys-surface);
36+
}
37+
38+
.example-selectable[aria-selected='true'],
39+
.example-selectable[aria-checked='true'] {
40+
background: color-mix(
41+
in srgb,
42+
var(--mat-sys-primary) calc(var(--mat-sys-pressed-state-layer-opacity) * 100%),
43+
transparent
44+
);
45+
}
46+
47+
.example-selectable[aria-selected='true']:focus-within,
48+
.example-selectable[aria-checked='true']:focus-within {
49+
outline: var(--mat-sys-primary) solid 2px;
50+
}
51+
52+
[aria-disabled='true'] .example-selectable[aria-selected='true'],
53+
.example-selectable[aria-disabled='true'][aria-selected='true'],
54+
[aria-disabled='true'] .example-selectable[aria-checked='true'],
55+
.example-selectable[aria-disabled='true'][aria-checked='true'] {
56+
background: color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent);
57+
}

src/dev-app/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap"
1818
rel="stylesheet"
1919
/>
20+
<link href="common-classes.css" rel="stylesheet" />
2021

2122
<!-- FontAwesome for mat-icon demo. -->
2223
<link

0 commit comments

Comments
 (0)