@internetarchive/collection-browser 0.4.19 → 1.0.0
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/dist/src/collection-browser.d.ts +22 -1
- package/dist/src/collection-browser.js +405 -291
- package/dist/src/collection-browser.js.map +1 -1
- package/dist/src/collection-facets/facets-template.js +2 -0
- package/dist/src/collection-facets/facets-template.js.map +1 -1
- package/dist/src/collection-facets/more-facets-content.js +63 -70
- package/dist/src/collection-facets/more-facets-content.js.map +1 -1
- package/dist/src/collection-facets/more-facets-pagination.js +49 -55
- package/dist/src/collection-facets/more-facets-pagination.js.map +1 -1
- package/dist/src/collection-facets/toggle-switch.js +46 -56
- package/dist/src/collection-facets/toggle-switch.js.map +1 -1
- package/dist/src/collection-facets.d.ts +1 -1
- package/dist/src/collection-facets.js +98 -84
- package/dist/src/collection-facets.js.map +1 -1
- package/dist/src/sort-filter-bar/alpha-bar.d.ts +2 -1
- package/dist/src/sort-filter-bar/alpha-bar.js +33 -25
- package/dist/src/sort-filter-bar/alpha-bar.js.map +1 -1
- package/dist/src/sort-filter-bar/sort-filter-bar.d.ts +1 -1
- package/dist/src/sort-filter-bar/sort-filter-bar.js +198 -186
- package/dist/src/sort-filter-bar/sort-filter-bar.js.map +1 -1
- package/dist/src/styles/sr-only.d.ts +1 -0
- package/dist/src/styles/sr-only.js +18 -0
- package/dist/src/styles/sr-only.js.map +1 -0
- package/dist/src/tiles/grid/account-tile.js +1 -1
- package/dist/src/tiles/grid/account-tile.js.map +1 -1
- package/dist/src/tiles/grid/collection-tile.js +2 -2
- package/dist/src/tiles/grid/collection-tile.js.map +1 -1
- package/dist/src/tiles/grid/item-tile.js +2 -2
- package/dist/src/tiles/grid/item-tile.js.map +1 -1
- package/dist/src/tiles/grid/styles/tile-grid-shared-styles.js +5 -15
- package/dist/src/tiles/grid/styles/tile-grid-shared-styles.js.map +1 -1
- package/dist/src/tiles/grid/tile-stats.js +58 -65
- package/dist/src/tiles/grid/tile-stats.js.map +1 -1
- package/dist/src/tiles/tile-dispatcher.js +3 -2
- package/dist/src/tiles/tile-dispatcher.js.map +1 -1
- package/dist/test/collection-facets.test.js +8 -5
- package/dist/test/collection-facets.test.js.map +1 -1
- package/dist/test/sort-filter-bar/alpha-bar.test.js +12 -12
- package/dist/test/sort-filter-bar/alpha-bar.test.js.map +1 -1
- package/dist/test/sort-filter-bar/sort-filter-bar.test.js +2 -2
- package/dist/test/sort-filter-bar/sort-filter-bar.test.js.map +1 -1
- package/package.json +3 -3
- package/src/collection-browser.ts +416 -293
- package/src/collection-facets/facets-template.ts +2 -0
- package/src/collection-facets/more-facets-content.ts +63 -70
- package/src/collection-facets/more-facets-pagination.ts +49 -55
- package/src/collection-facets/toggle-switch.ts +51 -61
- package/src/collection-facets.ts +99 -85
- package/src/sort-filter-bar/alpha-bar.ts +26 -18
- package/src/sort-filter-bar/sort-filter-bar.ts +200 -186
- package/src/styles/sr-only.ts +18 -0
- package/src/tiles/grid/account-tile.ts +1 -1
- package/src/tiles/grid/collection-tile.ts +2 -2
- package/src/tiles/grid/item-tile.ts +2 -2
- package/src/tiles/grid/styles/tile-grid-shared-styles.ts +5 -15
- package/src/tiles/grid/tile-stats.ts +66 -73
- package/src/tiles/tile-dispatcher.ts +1 -0
- package/test/collection-facets.test.ts +10 -2
- package/test/sort-filter-bar/alpha-bar.test.ts +16 -12
- package/test/sort-filter-bar/sort-filter-bar.test.ts +2 -2
|
@@ -11,6 +11,8 @@ export class AlphaBar extends LitElement {
|
|
|
11
11
|
|
|
12
12
|
@property({ type: Object }) letterCounts?: PrefixFilterCounts;
|
|
13
13
|
|
|
14
|
+
@property({ type: String }) ariaLandmarkLabel?: string;
|
|
15
|
+
|
|
14
16
|
@state()
|
|
15
17
|
private tooltipShown: boolean = false;
|
|
16
18
|
|
|
@@ -28,7 +30,7 @@ export class AlphaBar extends LitElement {
|
|
|
28
30
|
|
|
29
31
|
render() {
|
|
30
32
|
return html`
|
|
31
|
-
<
|
|
33
|
+
<section id="container" aria-label=${this.ariaLandmarkLabel ?? nothing}>
|
|
32
34
|
<ul>
|
|
33
35
|
${this.alphabet.map(
|
|
34
36
|
letter =>
|
|
@@ -40,29 +42,28 @@ export class AlphaBar extends LitElement {
|
|
|
40
42
|
@mousemove=${this.handleMouseMove}
|
|
41
43
|
@mouseleave=${this.handleMouseLeave}
|
|
42
44
|
>
|
|
43
|
-
${this.
|
|
44
|
-
? this.letterLinkTemplate(letter)
|
|
45
|
-
: html`<span>${letter}</span>`}
|
|
45
|
+
${this.letterButtonTemplate(letter)}
|
|
46
46
|
${this.tooltipTemplate(letter)}
|
|
47
47
|
</li>
|
|
48
48
|
`
|
|
49
49
|
)}
|
|
50
50
|
</ul>
|
|
51
|
-
</
|
|
51
|
+
</section>
|
|
52
52
|
`;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
private
|
|
55
|
+
private letterButtonTemplate(letter: string) {
|
|
56
|
+
const ariaLabel = `${letter}: ${this.letterCounts?.[letter] ?? 0} results`;
|
|
56
57
|
return html`
|
|
57
|
-
<
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
<button
|
|
59
|
+
aria-label=${ariaLabel}
|
|
60
|
+
?disabled=${!this.letterCounts?.[letter]}
|
|
61
|
+
@click=${() => {
|
|
61
62
|
this.letterClicked(letter);
|
|
62
63
|
}}
|
|
63
64
|
>
|
|
64
65
|
${letter}
|
|
65
|
-
</
|
|
66
|
+
</button>
|
|
66
67
|
`;
|
|
67
68
|
}
|
|
68
69
|
|
|
@@ -189,25 +190,31 @@ export class AlphaBar extends LitElement {
|
|
|
189
190
|
border-radius: 4px;
|
|
190
191
|
}
|
|
191
192
|
|
|
192
|
-
li:hover:not(.selected)
|
|
193
|
+
li:hover:not(.selected) button:not(:disabled) {
|
|
193
194
|
background-color: #c0c0c0;
|
|
194
195
|
}
|
|
195
196
|
|
|
196
|
-
|
|
197
|
-
span {
|
|
197
|
+
button {
|
|
198
198
|
display: flex;
|
|
199
199
|
justify-content: center;
|
|
200
200
|
align-items: center;
|
|
201
201
|
aspect-ratio: 1 / 1;
|
|
202
202
|
}
|
|
203
203
|
|
|
204
|
-
|
|
204
|
+
button {
|
|
205
|
+
width: 100%;
|
|
206
|
+
height: 100%;
|
|
205
207
|
color: #333;
|
|
206
|
-
|
|
208
|
+
appearance: none;
|
|
209
|
+
background: none;
|
|
210
|
+
border: none;
|
|
207
211
|
border-radius: 4px;
|
|
212
|
+
font-family: inherit;
|
|
213
|
+
font-size: inherit;
|
|
214
|
+
cursor: pointer;
|
|
208
215
|
}
|
|
209
216
|
|
|
210
|
-
|
|
217
|
+
button:disabled {
|
|
211
218
|
color: #aaa;
|
|
212
219
|
cursor: default;
|
|
213
220
|
}
|
|
@@ -216,7 +223,7 @@ export class AlphaBar extends LitElement {
|
|
|
216
223
|
background-color: #2c2c2c;
|
|
217
224
|
}
|
|
218
225
|
|
|
219
|
-
.selected
|
|
226
|
+
.selected button {
|
|
220
227
|
color: white;
|
|
221
228
|
}
|
|
222
229
|
|
|
@@ -225,6 +232,7 @@ export class AlphaBar extends LitElement {
|
|
|
225
232
|
top: 100%;
|
|
226
233
|
left: -9999px;
|
|
227
234
|
margin-top: 3px;
|
|
235
|
+
z-index: 1;
|
|
228
236
|
|
|
229
237
|
opacity: 0;
|
|
230
238
|
transition: opacity 0.2s ease;
|
|
@@ -30,6 +30,7 @@ import { sortDisabledIcon } from './img/sort-toggle-disabled';
|
|
|
30
30
|
import { tileIcon } from './img/tile';
|
|
31
31
|
import { listIcon } from './img/list';
|
|
32
32
|
import { compactIcon } from './img/compact';
|
|
33
|
+
import { srOnlyStyle } from '../styles/sr-only';
|
|
33
34
|
|
|
34
35
|
type AlphaSelector = 'creator' | 'title';
|
|
35
36
|
|
|
@@ -117,7 +118,7 @@ export class SortFilterBar
|
|
|
117
118
|
render() {
|
|
118
119
|
return html`
|
|
119
120
|
<div id="container">
|
|
120
|
-
<
|
|
121
|
+
<section id="sort-bar" aria-label="Sorting options">
|
|
121
122
|
<div class="sort-direction-container">
|
|
122
123
|
${this.sortDirectionSelectorTemplate}
|
|
123
124
|
</div>
|
|
@@ -129,7 +130,7 @@ export class SortFilterBar
|
|
|
129
130
|
</div>
|
|
130
131
|
|
|
131
132
|
<div id="display-style-selector">${this.displayOptionTemplate}</div>
|
|
132
|
-
</
|
|
133
|
+
</section>
|
|
133
134
|
|
|
134
135
|
${this.dropdownBackdropVisible ? this.dropdownBackdrop : nothing}
|
|
135
136
|
${this.alphaBarTemplate}
|
|
@@ -257,12 +258,17 @@ export class SortFilterBar
|
|
|
257
258
|
|
|
258
259
|
/** Template to render the sort direction toggle button */
|
|
259
260
|
private get sortDirectionSelectorTemplate(): TemplateResult {
|
|
261
|
+
const oppositeSortDirectionReadable =
|
|
262
|
+
this.sortDirection === 'asc' ? 'descending' : 'ascending';
|
|
263
|
+
const srLabel = `Change to ${oppositeSortDirectionReadable} sort`;
|
|
264
|
+
|
|
260
265
|
return html`
|
|
261
266
|
<button
|
|
262
267
|
class="sort-direction-selector"
|
|
263
268
|
?disabled=${this.selectedSort === 'relevance'}
|
|
264
269
|
@click=${this.toggleSortDirection}
|
|
265
270
|
>
|
|
271
|
+
<span class="sr-only">${srLabel}</span>
|
|
266
272
|
${this.sortDirectionIcon}
|
|
267
273
|
</button>
|
|
268
274
|
`;
|
|
@@ -729,6 +735,7 @@ export class SortFilterBar
|
|
|
729
735
|
return html` <alpha-bar
|
|
730
736
|
.selectedLetter=${this.selectedTitleFilter}
|
|
731
737
|
.letterCounts=${this.prefixFilterCountMap?.title}
|
|
738
|
+
ariaLandmarkLabel="Filter by title letter"
|
|
732
739
|
@letterChanged=${this.titleLetterChanged}
|
|
733
740
|
></alpha-bar>`;
|
|
734
741
|
}
|
|
@@ -737,6 +744,7 @@ export class SortFilterBar
|
|
|
737
744
|
return html` <alpha-bar
|
|
738
745
|
.selectedLetter=${this.selectedCreatorFilter}
|
|
739
746
|
.letterCounts=${this.prefixFilterCountMap?.creator}
|
|
747
|
+
ariaLandmarkLabel="Filter by creator letter"
|
|
740
748
|
@letterChanged=${this.creatorLetterChanged}
|
|
741
749
|
></alpha-bar>`;
|
|
742
750
|
}
|
|
@@ -797,214 +805,220 @@ export class SortFilterBar
|
|
|
797
805
|
this.dispatchEvent(event);
|
|
798
806
|
}
|
|
799
807
|
|
|
800
|
-
static styles
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
808
|
+
static get styles() {
|
|
809
|
+
return [
|
|
810
|
+
srOnlyStyle,
|
|
811
|
+
css`
|
|
812
|
+
#container {
|
|
813
|
+
position: relative;
|
|
814
|
+
}
|
|
804
815
|
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
816
|
+
#sort-bar {
|
|
817
|
+
display: flex;
|
|
818
|
+
justify-content: space-between;
|
|
819
|
+
align-items: center;
|
|
820
|
+
border-bottom: 1px solid #2c2c2c;
|
|
821
|
+
font-size: 1.4rem;
|
|
822
|
+
}
|
|
812
823
|
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
824
|
+
ul {
|
|
825
|
+
list-style: none;
|
|
826
|
+
display: flex;
|
|
827
|
+
align-items: center;
|
|
828
|
+
margin: 0;
|
|
829
|
+
padding: 0;
|
|
830
|
+
}
|
|
820
831
|
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
832
|
+
li {
|
|
833
|
+
padding: 0;
|
|
834
|
+
}
|
|
824
835
|
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
836
|
+
.sort-by-text {
|
|
837
|
+
margin-right: 5px;
|
|
838
|
+
font-weight: bold;
|
|
839
|
+
white-space: nowrap;
|
|
840
|
+
}
|
|
830
841
|
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
842
|
+
.sort-direction-container {
|
|
843
|
+
display: flex;
|
|
844
|
+
align-self: stretch;
|
|
845
|
+
flex: 0;
|
|
846
|
+
margin: 0 5px;
|
|
847
|
+
}
|
|
837
848
|
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
849
|
+
.sort-direction-selector {
|
|
850
|
+
padding: 0;
|
|
851
|
+
border: none;
|
|
852
|
+
appearance: none;
|
|
853
|
+
background: transparent;
|
|
854
|
+
cursor: pointer;
|
|
855
|
+
}
|
|
845
856
|
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
857
|
+
.sort-direction-selector:disabled {
|
|
858
|
+
cursor: default;
|
|
859
|
+
}
|
|
849
860
|
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
+
.sort-direction-icon {
|
|
862
|
+
display: flex;
|
|
863
|
+
align-items: center;
|
|
864
|
+
background: none;
|
|
865
|
+
color: inherit;
|
|
866
|
+
border: none;
|
|
867
|
+
padding: 0;
|
|
868
|
+
outline: inherit;
|
|
869
|
+
width: 14px;
|
|
870
|
+
height: 14px;
|
|
871
|
+
}
|
|
861
872
|
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
873
|
+
.sort-direction-icon > svg {
|
|
874
|
+
flex: 1;
|
|
875
|
+
}
|
|
865
876
|
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
877
|
+
#date-sort-selector,
|
|
878
|
+
#view-sort-selector {
|
|
879
|
+
position: absolute;
|
|
880
|
+
left: 150px;
|
|
881
|
+
top: 45px;
|
|
882
|
+
|
|
883
|
+
z-index: 1;
|
|
884
|
+
padding: 1rem;
|
|
885
|
+
background-color: white;
|
|
886
|
+
border-radius: 2.5rem;
|
|
887
|
+
border: 1px solid #404142;
|
|
888
|
+
}
|
|
878
889
|
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
890
|
+
#sort-selector-container {
|
|
891
|
+
flex: 1;
|
|
892
|
+
display: flex;
|
|
893
|
+
justify-content: flex-start;
|
|
894
|
+
align-items: center;
|
|
895
|
+
}
|
|
885
896
|
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
897
|
+
#desktop-sort-container,
|
|
898
|
+
#mobile-sort-container {
|
|
899
|
+
display: flex;
|
|
900
|
+
justify-content: flex-start;
|
|
901
|
+
align-items: center;
|
|
902
|
+
}
|
|
892
903
|
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
904
|
+
/*
|
|
905
|
+
we move the desktop sort selector offscreen instead of display: none
|
|
906
|
+
because we need to observe the width of it vs its container to determine
|
|
907
|
+
if it's wide enough to display the desktop version and if you display: none,
|
|
908
|
+
the width becomes 0
|
|
909
|
+
*/
|
|
910
|
+
#desktop-sort-container.hidden {
|
|
911
|
+
position: absolute;
|
|
912
|
+
top: -9999px;
|
|
913
|
+
left: -9999px;
|
|
914
|
+
visibility: hidden;
|
|
915
|
+
}
|
|
905
916
|
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
917
|
+
#mobile-sort-container.hidden {
|
|
918
|
+
display: none;
|
|
919
|
+
}
|
|
909
920
|
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
921
|
+
#sort-selector-backdrop {
|
|
922
|
+
position: fixed;
|
|
923
|
+
top: 0;
|
|
924
|
+
left: 0;
|
|
925
|
+
width: 100vw;
|
|
926
|
+
height: 100vh;
|
|
927
|
+
z-index: 1;
|
|
928
|
+
background-color: transparent;
|
|
929
|
+
}
|
|
919
930
|
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
931
|
+
#desktop-sort-selector {
|
|
932
|
+
display: inline-flex;
|
|
933
|
+
}
|
|
923
934
|
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
935
|
+
#desktop-sort-selector li {
|
|
936
|
+
display: flex;
|
|
937
|
+
align-items: center;
|
|
938
|
+
padding-left: 5px;
|
|
939
|
+
padding-right: 5px;
|
|
940
|
+
}
|
|
930
941
|
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
942
|
+
#desktop-sort-selector li a {
|
|
943
|
+
padding: 0 5px;
|
|
944
|
+
text-decoration: none;
|
|
945
|
+
color: #333;
|
|
946
|
+
line-height: 2;
|
|
947
|
+
}
|
|
937
948
|
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
949
|
+
#desktop-sort-selector li button {
|
|
950
|
+
padding: 0px 5px;
|
|
951
|
+
border: none;
|
|
952
|
+
background: none;
|
|
953
|
+
font-family: inherit;
|
|
954
|
+
font-size: inherit;
|
|
955
|
+
color: #333;
|
|
956
|
+
line-height: 2;
|
|
957
|
+
cursor: pointer;
|
|
958
|
+
appearance: none;
|
|
959
|
+
}
|
|
948
960
|
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
961
|
+
#desktop-sort-selector li button.selected {
|
|
962
|
+
font-weight: bold;
|
|
963
|
+
}
|
|
952
964
|
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
965
|
+
#display-style-selector {
|
|
966
|
+
flex: 0;
|
|
967
|
+
}
|
|
956
968
|
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
969
|
+
#display-style-selector button {
|
|
970
|
+
background: none;
|
|
971
|
+
color: inherit;
|
|
972
|
+
border: none;
|
|
973
|
+
appearance: none;
|
|
974
|
+
cursor: pointer;
|
|
975
|
+
-webkit-appearance: none;
|
|
976
|
+
fill: #bbbbbb;
|
|
977
|
+
}
|
|
966
978
|
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
979
|
+
#display-style-selector button.active {
|
|
980
|
+
fill: var(--ia-theme-primary-text-color, #2c2c2c);
|
|
981
|
+
}
|
|
970
982
|
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
983
|
+
#display-style-selector button svg {
|
|
984
|
+
width: 24px;
|
|
985
|
+
height: 24px;
|
|
986
|
+
}
|
|
975
987
|
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
988
|
+
ia-dropdown {
|
|
989
|
+
--dropdownTextColor: white;
|
|
990
|
+
--dropdownOffsetTop: 0;
|
|
991
|
+
--dropdownBorderTopWidth: 0;
|
|
992
|
+
--dropdownBorderTopLeftRadius: 0;
|
|
993
|
+
--dropdownBorderTopRightRadius: 0;
|
|
994
|
+
--dropdownWhiteSpace: nowrap;
|
|
995
|
+
--dropdownListZIndex: 2;
|
|
996
|
+
--dropdownCaretColor: var(--ia-theme-primary-text-color, #2c2c2c);
|
|
997
|
+
--dropdownSelectedTextColor: white;
|
|
998
|
+
--dropdownSelectedBgColor: rgba(255, 255, 255, 0.3);
|
|
999
|
+
--dropdownHoverBgColor: rgba(255, 255, 255, 0.3);
|
|
1000
|
+
--caretHeight: 9px;
|
|
1001
|
+
--caretWidth: 12px;
|
|
1002
|
+
--caretPadding: 0 5px 0 0;
|
|
1003
|
+
}
|
|
1004
|
+
ia-dropdown.selected .dropdown-label {
|
|
1005
|
+
font-weight: bold;
|
|
1006
|
+
}
|
|
1007
|
+
ia-dropdown.open {
|
|
1008
|
+
z-index: 2;
|
|
1009
|
+
}
|
|
998
1010
|
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1011
|
+
.dropdown-label {
|
|
1012
|
+
display: inline-block;
|
|
1013
|
+
height: 100%;
|
|
1014
|
+
padding-left: 5px;
|
|
1015
|
+
font-size: 1.4rem;
|
|
1016
|
+
line-height: 2;
|
|
1017
|
+
color: var(--ia-theme-primary-text-color, #2c2c2c);
|
|
1018
|
+
white-space: nowrap;
|
|
1019
|
+
user-select: none;
|
|
1020
|
+
}
|
|
1021
|
+
`,
|
|
1022
|
+
];
|
|
1023
|
+
}
|
|
1010
1024
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
|
|
3
|
+
export const srOnlyStyle = css`
|
|
4
|
+
.sr-only {
|
|
5
|
+
position: absolute !important;
|
|
6
|
+
width: 1px !important;
|
|
7
|
+
height: 1px !important;
|
|
8
|
+
margin: -1px !important;
|
|
9
|
+
padding: 0 !important;
|
|
10
|
+
border: 0 !important;
|
|
11
|
+
overflow: hidden !important;
|
|
12
|
+
white-space: nowrap !important;
|
|
13
|
+
clip: rect(1px, 1px, 1px, 1px) !important;
|
|
14
|
+
-webkit-clip-path: inset(50%) !important;
|
|
15
|
+
clip-path: inset(50%) !important;
|
|
16
|
+
user-select: none !important;
|
|
17
|
+
}
|
|
18
|
+
`;
|
|
@@ -49,7 +49,7 @@ export class CollectionTile extends LitElement {
|
|
|
49
49
|
|
|
50
50
|
private get getTitleTemplate() {
|
|
51
51
|
return html`<div id="title">
|
|
52
|
-
<
|
|
52
|
+
<h4 class="truncated">${this.model?.title}</h4>
|
|
53
53
|
</div>`;
|
|
54
54
|
}
|
|
55
55
|
|
|
@@ -117,7 +117,7 @@ export class CollectionTile extends LitElement {
|
|
|
117
117
|
flex-grow: initial;
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
-
|
|
120
|
+
h4.truncated {
|
|
121
121
|
color: ${whiteColor};
|
|
122
122
|
}
|
|
123
123
|
|
|
@@ -49,9 +49,9 @@ export class ItemTile extends LitElement {
|
|
|
49
49
|
${this.imageBlockTemplate}
|
|
50
50
|
|
|
51
51
|
<div id="title">
|
|
52
|
-
<
|
|
52
|
+
<h4 class="truncated" title=${ifDefined(itemTitle)}>
|
|
53
53
|
${itemTitle}
|
|
54
|
-
</
|
|
54
|
+
</h4>
|
|
55
55
|
</div>
|
|
56
56
|
|
|
57
57
|
${this.volumeIssueTemplate}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
+
import { srOnlyStyle } from '../../../styles/sr-only';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* Base tile styles
|
|
@@ -8,6 +9,9 @@ const tileBackgroundColor = css`var(--tileBackgroundColor, #ffffff)`;
|
|
|
8
9
|
const tileCornerRadius = css`var(--tileCornerRadius, 4px)`;
|
|
9
10
|
|
|
10
11
|
export const baseTileStyles = css`
|
|
12
|
+
/* Include .sr-only styles for all tiles */
|
|
13
|
+
${srOnlyStyle}
|
|
14
|
+
|
|
11
15
|
.container {
|
|
12
16
|
background-color: ${tileBackgroundColor};
|
|
13
17
|
border: 1px #2c2c2c;
|
|
@@ -68,7 +72,7 @@ export const baseTileStyles = css`
|
|
|
68
72
|
-webkit-box-orient: vertical;
|
|
69
73
|
}
|
|
70
74
|
|
|
71
|
-
|
|
75
|
+
h4.truncated {
|
|
72
76
|
display: -webkit-box;
|
|
73
77
|
margin: 0px;
|
|
74
78
|
line-height: 15px;
|
|
@@ -122,18 +126,4 @@ export const baseTileStyles = css`
|
|
|
122
126
|
.hidden {
|
|
123
127
|
display: none;
|
|
124
128
|
}
|
|
125
|
-
|
|
126
|
-
.sr-only {
|
|
127
|
-
position: absolute !important;
|
|
128
|
-
width: 1px !important;
|
|
129
|
-
height: 1px !important;
|
|
130
|
-
margin: -1px !important;
|
|
131
|
-
padding: 0 !important;
|
|
132
|
-
border: 0 !important;
|
|
133
|
-
overflow: hidden !important;
|
|
134
|
-
white-space: nowrap !important;
|
|
135
|
-
clip: rect(1px, 1px, 1px, 1px) !important;
|
|
136
|
-
-webkit-clip-path: inset(50%) !important;
|
|
137
|
-
clip-path: inset(50%) !important;
|
|
138
|
-
}
|
|
139
129
|
`;
|