@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.
Files changed (60) hide show
  1. package/dist/src/collection-browser.d.ts +22 -1
  2. package/dist/src/collection-browser.js +405 -291
  3. package/dist/src/collection-browser.js.map +1 -1
  4. package/dist/src/collection-facets/facets-template.js +2 -0
  5. package/dist/src/collection-facets/facets-template.js.map +1 -1
  6. package/dist/src/collection-facets/more-facets-content.js +63 -70
  7. package/dist/src/collection-facets/more-facets-content.js.map +1 -1
  8. package/dist/src/collection-facets/more-facets-pagination.js +49 -55
  9. package/dist/src/collection-facets/more-facets-pagination.js.map +1 -1
  10. package/dist/src/collection-facets/toggle-switch.js +46 -56
  11. package/dist/src/collection-facets/toggle-switch.js.map +1 -1
  12. package/dist/src/collection-facets.d.ts +1 -1
  13. package/dist/src/collection-facets.js +98 -84
  14. package/dist/src/collection-facets.js.map +1 -1
  15. package/dist/src/sort-filter-bar/alpha-bar.d.ts +2 -1
  16. package/dist/src/sort-filter-bar/alpha-bar.js +33 -25
  17. package/dist/src/sort-filter-bar/alpha-bar.js.map +1 -1
  18. package/dist/src/sort-filter-bar/sort-filter-bar.d.ts +1 -1
  19. package/dist/src/sort-filter-bar/sort-filter-bar.js +198 -186
  20. package/dist/src/sort-filter-bar/sort-filter-bar.js.map +1 -1
  21. package/dist/src/styles/sr-only.d.ts +1 -0
  22. package/dist/src/styles/sr-only.js +18 -0
  23. package/dist/src/styles/sr-only.js.map +1 -0
  24. package/dist/src/tiles/grid/account-tile.js +1 -1
  25. package/dist/src/tiles/grid/account-tile.js.map +1 -1
  26. package/dist/src/tiles/grid/collection-tile.js +2 -2
  27. package/dist/src/tiles/grid/collection-tile.js.map +1 -1
  28. package/dist/src/tiles/grid/item-tile.js +2 -2
  29. package/dist/src/tiles/grid/item-tile.js.map +1 -1
  30. package/dist/src/tiles/grid/styles/tile-grid-shared-styles.js +5 -15
  31. package/dist/src/tiles/grid/styles/tile-grid-shared-styles.js.map +1 -1
  32. package/dist/src/tiles/grid/tile-stats.js +58 -65
  33. package/dist/src/tiles/grid/tile-stats.js.map +1 -1
  34. package/dist/src/tiles/tile-dispatcher.js +3 -2
  35. package/dist/src/tiles/tile-dispatcher.js.map +1 -1
  36. package/dist/test/collection-facets.test.js +8 -5
  37. package/dist/test/collection-facets.test.js.map +1 -1
  38. package/dist/test/sort-filter-bar/alpha-bar.test.js +12 -12
  39. package/dist/test/sort-filter-bar/alpha-bar.test.js.map +1 -1
  40. package/dist/test/sort-filter-bar/sort-filter-bar.test.js +2 -2
  41. package/dist/test/sort-filter-bar/sort-filter-bar.test.js.map +1 -1
  42. package/package.json +3 -3
  43. package/src/collection-browser.ts +416 -293
  44. package/src/collection-facets/facets-template.ts +2 -0
  45. package/src/collection-facets/more-facets-content.ts +63 -70
  46. package/src/collection-facets/more-facets-pagination.ts +49 -55
  47. package/src/collection-facets/toggle-switch.ts +51 -61
  48. package/src/collection-facets.ts +99 -85
  49. package/src/sort-filter-bar/alpha-bar.ts +26 -18
  50. package/src/sort-filter-bar/sort-filter-bar.ts +200 -186
  51. package/src/styles/sr-only.ts +18 -0
  52. package/src/tiles/grid/account-tile.ts +1 -1
  53. package/src/tiles/grid/collection-tile.ts +2 -2
  54. package/src/tiles/grid/item-tile.ts +2 -2
  55. package/src/tiles/grid/styles/tile-grid-shared-styles.ts +5 -15
  56. package/src/tiles/grid/tile-stats.ts +66 -73
  57. package/src/tiles/tile-dispatcher.ts +1 -0
  58. package/test/collection-facets.test.ts +10 -2
  59. package/test/sort-filter-bar/alpha-bar.test.ts +16 -12
  60. 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
- <div id="container">
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.letterCounts?.[letter]
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
- </div>
51
+ </section>
52
52
  `;
53
53
  }
54
54
 
55
- private letterLinkTemplate(letter: string) {
55
+ private letterButtonTemplate(letter: string) {
56
+ const ariaLabel = `${letter}: ${this.letterCounts?.[letter] ?? 0} results`;
56
57
  return html`
57
- <a
58
- href="#"
59
- @click=${(e: Event) => {
60
- e.preventDefault();
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
- </a>
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) a {
193
+ li:hover:not(.selected) button:not(:disabled) {
193
194
  background-color: #c0c0c0;
194
195
  }
195
196
 
196
- a,
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
- a {
204
+ button {
205
+ width: 100%;
206
+ height: 100%;
205
207
  color: #333;
206
- text-decoration: none;
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
- span {
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 a {
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
- <div id="sort-bar">
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
- </div>
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 = css`
801
- #container {
802
- position: relative;
803
- }
808
+ static get styles() {
809
+ return [
810
+ srOnlyStyle,
811
+ css`
812
+ #container {
813
+ position: relative;
814
+ }
804
815
 
805
- #sort-bar {
806
- display: flex;
807
- justify-content: space-between;
808
- align-items: center;
809
- border-bottom: 1px solid #2c2c2c;
810
- font-size: 1.4rem;
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
- ul {
814
- list-style: none;
815
- display: flex;
816
- align-items: center;
817
- margin: 0;
818
- padding: 0;
819
- }
824
+ ul {
825
+ list-style: none;
826
+ display: flex;
827
+ align-items: center;
828
+ margin: 0;
829
+ padding: 0;
830
+ }
820
831
 
821
- li {
822
- padding: 0;
823
- }
832
+ li {
833
+ padding: 0;
834
+ }
824
835
 
825
- .sort-by-text {
826
- margin-right: 5px;
827
- font-weight: bold;
828
- white-space: nowrap;
829
- }
836
+ .sort-by-text {
837
+ margin-right: 5px;
838
+ font-weight: bold;
839
+ white-space: nowrap;
840
+ }
830
841
 
831
- .sort-direction-container {
832
- display: flex;
833
- align-self: stretch;
834
- flex: 0;
835
- margin: 0 5px;
836
- }
842
+ .sort-direction-container {
843
+ display: flex;
844
+ align-self: stretch;
845
+ flex: 0;
846
+ margin: 0 5px;
847
+ }
837
848
 
838
- .sort-direction-selector {
839
- padding: 0;
840
- border: none;
841
- appearance: none;
842
- background: transparent;
843
- cursor: pointer;
844
- }
849
+ .sort-direction-selector {
850
+ padding: 0;
851
+ border: none;
852
+ appearance: none;
853
+ background: transparent;
854
+ cursor: pointer;
855
+ }
845
856
 
846
- .sort-direction-selector:disabled {
847
- cursor: default;
848
- }
857
+ .sort-direction-selector:disabled {
858
+ cursor: default;
859
+ }
849
860
 
850
- .sort-direction-icon {
851
- display: flex;
852
- align-items: center;
853
- background: none;
854
- color: inherit;
855
- border: none;
856
- padding: 0;
857
- outline: inherit;
858
- width: 14px;
859
- height: 14px;
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
- .sort-direction-icon > svg {
863
- flex: 1;
864
- }
873
+ .sort-direction-icon > svg {
874
+ flex: 1;
875
+ }
865
876
 
866
- #date-sort-selector,
867
- #view-sort-selector {
868
- position: absolute;
869
- left: 150px;
870
- top: 45px;
871
-
872
- z-index: 1;
873
- padding: 1rem;
874
- background-color: white;
875
- border-radius: 2.5rem;
876
- border: 1px solid #404142;
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
- #sort-selector-container {
880
- flex: 1;
881
- display: flex;
882
- justify-content: flex-start;
883
- align-items: center;
884
- }
890
+ #sort-selector-container {
891
+ flex: 1;
892
+ display: flex;
893
+ justify-content: flex-start;
894
+ align-items: center;
895
+ }
885
896
 
886
- #desktop-sort-container,
887
- #mobile-sort-container {
888
- display: flex;
889
- justify-content: flex-start;
890
- align-items: center;
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
- we move the desktop sort selector offscreen instead of display: none
895
- because we need to observe the width of it vs its container to determine
896
- if it's wide enough to display the desktop version and if you display: none,
897
- the width becomes 0
898
- */
899
- #desktop-sort-container.hidden {
900
- position: absolute;
901
- top: -9999px;
902
- left: -9999px;
903
- visibility: hidden;
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
- #mobile-sort-container.hidden {
907
- display: none;
908
- }
917
+ #mobile-sort-container.hidden {
918
+ display: none;
919
+ }
909
920
 
910
- #sort-selector-backdrop {
911
- position: fixed;
912
- top: 0;
913
- left: 0;
914
- width: 100vw;
915
- height: 100vh;
916
- z-index: 1;
917
- background-color: transparent;
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
- #desktop-sort-selector {
921
- display: inline-flex;
922
- }
931
+ #desktop-sort-selector {
932
+ display: inline-flex;
933
+ }
923
934
 
924
- #desktop-sort-selector li {
925
- display: flex;
926
- align-items: center;
927
- padding-left: 5px;
928
- padding-right: 5px;
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
- #desktop-sort-selector li a {
932
- padding: 0 5px;
933
- text-decoration: none;
934
- color: #333;
935
- line-height: 2;
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
- #desktop-sort-selector li button {
939
- padding: 0px 5px;
940
- border: none;
941
- background: none;
942
- font-size: inherit;
943
- color: #333;
944
- line-height: 2;
945
- cursor: pointer;
946
- appearance: none;
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
- #desktop-sort-selector li button.selected {
950
- font-weight: bold;
951
- }
961
+ #desktop-sort-selector li button.selected {
962
+ font-weight: bold;
963
+ }
952
964
 
953
- #display-style-selector {
954
- flex: 0;
955
- }
965
+ #display-style-selector {
966
+ flex: 0;
967
+ }
956
968
 
957
- #display-style-selector button {
958
- background: none;
959
- color: inherit;
960
- border: none;
961
- appearance: none;
962
- cursor: pointer;
963
- -webkit-appearance: none;
964
- fill: #bbbbbb;
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
- #display-style-selector button.active {
968
- fill: var(--ia-theme-primary-text-color, #2c2c2c);
969
- }
979
+ #display-style-selector button.active {
980
+ fill: var(--ia-theme-primary-text-color, #2c2c2c);
981
+ }
970
982
 
971
- #display-style-selector button svg {
972
- width: 24px;
973
- height: 24px;
974
- }
983
+ #display-style-selector button svg {
984
+ width: 24px;
985
+ height: 24px;
986
+ }
975
987
 
976
- ia-dropdown {
977
- --dropdownTextColor: white;
978
- --dropdownOffsetTop: 0;
979
- --dropdownBorderTopWidth: 0;
980
- --dropdownBorderTopLeftRadius: 0;
981
- --dropdownBorderTopRightRadius: 0;
982
- --dropdownWhiteSpace: nowrap;
983
- --dropdownListZIndex: 2;
984
- --dropdownCaretColor: var(--ia-theme-primary-text-color, #2c2c2c);
985
- --dropdownSelectedTextColor: white;
986
- --dropdownSelectedBgColor: rgba(255, 255, 255, 0.3);
987
- --dropdownHoverBgColor: rgba(255, 255, 255, 0.3);
988
- --caretHeight: 9px;
989
- --caretWidth: 12px;
990
- --caretPadding: 0 5px 0 0;
991
- }
992
- ia-dropdown.selected .dropdown-label {
993
- font-weight: bold;
994
- }
995
- ia-dropdown.open {
996
- z-index: 2;
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
- .dropdown-label {
1000
- display: inline-block;
1001
- height: 100%;
1002
- padding-left: 5px;
1003
- font-size: 1.4rem;
1004
- line-height: 2;
1005
- color: var(--ia-theme-primary-text-color, #2c2c2c);
1006
- white-space: nowrap;
1007
- user-select: none;
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
+ `;
@@ -42,7 +42,7 @@ export class AccountTile extends LitElement {
42
42
 
43
43
  private get getTitleTemplate() {
44
44
  return html`<div id="title">
45
- <h1 class="truncated">${this.model?.identifier}</h1>
45
+ <h4 class="truncated">${this.model?.identifier}</h4>
46
46
  </div>`;
47
47
  }
48
48
 
@@ -49,7 +49,7 @@ export class CollectionTile extends LitElement {
49
49
 
50
50
  private get getTitleTemplate() {
51
51
  return html`<div id="title">
52
- <h1 class="truncated">${this.model?.title}</h1>
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
- h1.truncated {
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
- <h1 class="truncated" title=${ifDefined(itemTitle)}>
52
+ <h4 class="truncated" title=${ifDefined(itemTitle)}>
53
53
  ${itemTitle}
54
- </h1>
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
- h1.truncated {
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
  `;