Skip to content

Commit b2711dc

Browse files
Revert CB a11y reversion (but preserve ellipses fix) (#517)
This reverts commit 3375101.
1 parent e204449 commit b2711dc

File tree

11 files changed

+76
-21
lines changed

11 files changed

+76
-21
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"@internetarchive/field-parsers": "^1.0.0",
2929
"@internetarchive/histogram-date-range": "^1.4.0",
3030
"@internetarchive/ia-activity-indicator": "^0.0.6",
31-
"@internetarchive/ia-dropdown": "^1.4.0",
31+
"@internetarchive/ia-dropdown": "^1.4.1",
3232
"@internetarchive/iaux-item-metadata": "^1.0.5",
3333
"@internetarchive/infinite-scroller": "^1.0.1",
3434
"@internetarchive/modal-manager": "^2.0.1",

src/collection-browser.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2687,6 +2687,7 @@ export class CollectionBrowser
26872687
26882688
#tile-blur-check {
26892689
margin: 0 5px 0 0;
2690+
width: 15px;
26902691
}
26912692
26922693
circular-activity-indicator {

src/collection-facets.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,7 @@ export class CollectionFacets extends LitElement {
397397
? html`<button
398398
class="expand-date-picker-btn"
399399
aria-hidden="true"
400+
tabindex="-1"
400401
@click=${this.showDatePickerModal}
401402
>
402403
${expandIcon}
@@ -425,7 +426,7 @@ export class CollectionFacets extends LitElement {
425426

426427
return html`
427428
<histogram-date-range
428-
class=${this.isTvSearch ? 'wide-inputs' : nothing}
429+
class=${this.isTvSearch ? 'wide-inputs' : ''}
429430
.minDate=${minDate}
430431
.maxDate=${maxDate}
431432
.minSelectedDate=${this.minSelectedDate ?? minDate}
@@ -951,6 +952,7 @@ export class CollectionFacets extends LitElement {
951952
font-size: 1.2rem;
952953
text-decoration: none;
953954
padding: 0;
955+
margin-top: 0.25rem;
954956
background: inherit;
955957
border: 0;
956958
color: var(--ia-theme-link-color, #4b64ff);

src/collection-facets/facet-row.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,8 @@ export class FacetRow extends LitElement {
213213
display: flex;
214214
font-weight: 500;
215215
font-size: 1.2rem;
216-
margin: 2.5px auto;
216+
margin: 0 auto;
217+
padding: 0.25rem 0;
217218
height: auto;
218219
border-top: ${facetRowBorderTop};
219220
border-bottom: ${facetRowBorderBottom};

src/tiles/grid/collection-tile.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export class CollectionTile extends BaseTileComponent {
5555

5656
private get getTitleTemplate() {
5757
return html`<div id="title">
58-
<h4 class="truncated">${this.model?.title}</h4>
58+
<h3 class="truncated">${this.model?.title}</h3>
5959
</div>`;
6060
}
6161

@@ -123,7 +123,8 @@ export class CollectionTile extends BaseTileComponent {
123123
flex-grow: initial;
124124
}
125125
126-
h4.truncated {
126+
h4.truncated,
127+
h3.truncated {
127128
color: ${whiteColor};
128129
}
129130

src/tiles/grid/item-tile.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ export class ItemTile extends BaseTileComponent {
6060
${this.imageBlockTemplate}
6161
6262
<div id="title">
63-
<h4 class="truncated" title=${ifDefined(itemTitle)}>
63+
<h3 class="truncated" title=${ifDefined(itemTitle)}>
6464
${itemTitle}
65-
</h4>
65+
</h3>
6666
</div>
6767
6868
${this.volumeIssueTemplate}

src/tiles/grid/search-tile.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export class SearchTile extends BaseTileComponent {
4949

5050
private get getTitleTemplate() {
5151
return html`<div id="title">
52-
<h4 class="truncated">${this.model?.title}</h4>
52+
<h3 class="truncated">${this.model?.title}</h3>
5353
</div>`;
5454
}
5555

@@ -70,7 +70,8 @@ export class SearchTile extends BaseTileComponent {
7070
flex-grow: initial;
7171
}
7272
73-
h4.truncated {
73+
h4.truncated,
74+
h3.truncated {
7475
color: ${whiteColor};
7576
-webkit-line-clamp: 4;
7677
}

src/tiles/grid/styles/tile-grid-shared-styles.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ export const baseTileStyles = css`
7272
-webkit-box-orient: vertical;
7373
}
7474
75-
h4.truncated {
75+
h4.truncated,
76+
h3.truncated {
7677
display: -webkit-box;
7778
margin: 0px;
7879
line-height: 15px;
@@ -114,7 +115,7 @@ export const baseTileStyles = css`
114115
align-items: center;
115116
background: rgba(220, 220, 220, 0.5);
116117
color: white;
117-
font-size: 2rem;
118+
font-size: 2.4rem;
118119
font-weight: bold;
119120
line-height: 1;
120121
text-shadow: black 1px 1px 3px;

src/tiles/list/tile-list.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { join } from 'lit/directives/join.js';
44
import { map } from 'lit/directives/map.js';
55
import { unsafeHTML } from 'lit/directives/unsafe-html.js';
66
import { customElement, property, state } from 'lit/decorators.js';
7-
import { msg } from '@lit/localize';
7+
import { msg, str } from '@lit/localize';
88
import DOMPurify from 'dompurify';
99

1010
import type { SortParam } from '@internetarchive/search-service';
@@ -94,7 +94,11 @@ export class TileList extends BaseTileComponent {
9494
isCollection,
9595
);
9696

97-
return html`<a href=${href}>
97+
return html`<a
98+
id="image-link"
99+
title=${msg(str`View ${this.model?.title}`)}
100+
href=${href}
101+
>
98102
<image-block
99103
.model=${this.model}
100104
.baseImageUrl=${this.baseImageUrl}
@@ -127,7 +131,11 @@ export class TileList extends BaseTileComponent {
127131
// Data templates
128132
private get iconRightTemplate() {
129133
return html`
130-
<a id="icon-right" href=${this.mediatypeURL}>
134+
<a
135+
id="icon-right"
136+
href=${this.mediatypeURL}
137+
title=${msg(str`See more: ${this.model?.mediatype}`)}
138+
>
131139
<tile-mediatype-icon .model=${this.model}> </tile-mediatype-icon>
132140
</a>
133141
`;

test/tiles/list/tile-list.test.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,20 @@ describe('List Tile', () => {
4949
expect(title?.getAttribute('href')).to.equal('/foo/bar');
5050
});
5151

52+
it('should add title to image link if provided', async () => {
53+
const el = await fixture<TileList>(html`
54+
<tile-list
55+
.baseNavigationUrl=${''}
56+
.model=${{ title: 'foo', href: '/foo/bar' }}
57+
></tile-list>
58+
`);
59+
60+
const imageLink = el.shadowRoot?.querySelector('#image-link');
61+
62+
expect(imageLink).to.exist;
63+
expect(imageLink?.getAttribute('title')).to.equal('View foo');
64+
});
65+
5266
it('should render with creator element but not dates', async () => {
5367
const el = await fixture<TileList>(html`
5468
<tile-list .model=${{ creators: ['someone'] }}></tile-list>
@@ -324,6 +338,7 @@ describe('List Tile', () => {
324338
expect(mediatypeLink?.getAttribute('href')).to.equal(
325339
`https://archive.org/details/texts`,
326340
);
341+
expect(mediatypeLink?.getAttribute('title')).to.equal('See more: texts');
327342
});
328343

329344
it('should render mediatype icon as link even with empty baseNavigationUrl', async () => {

0 commit comments

Comments
 (0)