@internetarchive/collection-browser 0.4.18-alpha.6 → 0.4.18

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 +1 -8
  2. package/dist/src/collection-browser.js +291 -318
  3. package/dist/src/collection-browser.js.map +1 -1
  4. package/dist/src/collection-facets/facets-template.js +0 -2
  5. package/dist/src/collection-facets/facets-template.js.map +1 -1
  6. package/dist/src/collection-facets/more-facets-content.js +70 -63
  7. package/dist/src/collection-facets/more-facets-content.js.map +1 -1
  8. package/dist/src/collection-facets/more-facets-pagination.js +55 -49
  9. package/dist/src/collection-facets/more-facets-pagination.js.map +1 -1
  10. package/dist/src/collection-facets/toggle-switch.js +56 -46
  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 +84 -94
  14. package/dist/src/collection-facets.js.map +1 -1
  15. package/dist/src/sort-filter-bar/alpha-bar.d.ts +1 -2
  16. package/dist/src/sort-filter-bar/alpha-bar.js +25 -33
  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 +186 -198
  20. package/dist/src/sort-filter-bar/sort-filter-bar.js.map +1 -1
  21. package/dist/src/tiles/grid/account-tile.js +1 -1
  22. package/dist/src/tiles/grid/account-tile.js.map +1 -1
  23. package/dist/src/tiles/grid/collection-tile.js +2 -2
  24. package/dist/src/tiles/grid/collection-tile.js.map +1 -1
  25. package/dist/src/tiles/grid/item-tile.js +2 -2
  26. package/dist/src/tiles/grid/item-tile.js.map +1 -1
  27. package/dist/src/tiles/grid/styles/tile-grid-shared-styles.js +15 -5
  28. package/dist/src/tiles/grid/styles/tile-grid-shared-styles.js.map +1 -1
  29. package/dist/src/tiles/grid/tile-stats.js +65 -58
  30. package/dist/src/tiles/grid/tile-stats.js.map +1 -1
  31. package/dist/src/tiles/tile-dispatcher.js +2 -3
  32. package/dist/src/tiles/tile-dispatcher.js.map +1 -1
  33. package/dist/test/collection-facets.test.js +5 -8
  34. package/dist/test/collection-facets.test.js.map +1 -1
  35. package/dist/test/sort-filter-bar/alpha-bar.test.js +12 -12
  36. package/dist/test/sort-filter-bar/alpha-bar.test.js.map +1 -1
  37. package/dist/test/sort-filter-bar/sort-filter-bar.test.js +2 -2
  38. package/dist/test/sort-filter-bar/sort-filter-bar.test.js.map +1 -1
  39. package/package.json +5 -5
  40. package/src/collection-browser.ts +293 -321
  41. package/src/collection-facets/facets-template.ts +0 -2
  42. package/src/collection-facets/more-facets-content.ts +70 -63
  43. package/src/collection-facets/more-facets-pagination.ts +55 -49
  44. package/src/collection-facets/toggle-switch.ts +61 -51
  45. package/src/collection-facets.ts +85 -96
  46. package/src/sort-filter-bar/alpha-bar.ts +18 -26
  47. package/src/sort-filter-bar/sort-filter-bar.ts +186 -200
  48. package/src/tiles/grid/account-tile.ts +1 -1
  49. package/src/tiles/grid/collection-tile.ts +2 -2
  50. package/src/tiles/grid/item-tile.ts +2 -2
  51. package/src/tiles/grid/styles/tile-grid-shared-styles.ts +15 -5
  52. package/src/tiles/grid/tile-stats.ts +73 -66
  53. package/src/tiles/tile-dispatcher.ts +0 -1
  54. package/test/collection-facets.test.ts +2 -10
  55. package/test/sort-filter-bar/alpha-bar.test.ts +12 -16
  56. package/test/sort-filter-bar/sort-filter-bar.test.ts +2 -2
  57. package/dist/src/styles/sr-only.d.ts +0 -1
  58. package/dist/src/styles/sr-only.js +0 -18
  59. package/dist/src/styles/sr-only.js.map +0 -1
  60. package/src/styles/sr-only.ts +0 -18
@@ -10,7 +10,6 @@ import { sortDisabledIcon } from './img/sort-toggle-disabled';
10
10
  import { tileIcon } from './img/tile';
11
11
  import { listIcon } from './img/list';
12
12
  import { compactIcon } from './img/compact';
13
- import { srOnlyStyle } from '../styles/sr-only';
14
13
  let SortFilterBar = class SortFilterBar extends LitElement {
15
14
  constructor() {
16
15
  super(...arguments);
@@ -53,7 +52,7 @@ let SortFilterBar = class SortFilterBar extends LitElement {
53
52
  render() {
54
53
  return html `
55
54
  <div id="container">
56
- <section id="sort-bar" aria-label="Sorting options">
55
+ <div id="sort-bar">
57
56
  <div class="sort-direction-container">
58
57
  ${this.sortDirectionSelectorTemplate}
59
58
  </div>
@@ -65,7 +64,7 @@ let SortFilterBar = class SortFilterBar extends LitElement {
65
64
  </div>
66
65
 
67
66
  <div id="display-style-selector">${this.displayOptionTemplate}</div>
68
- </section>
67
+ </div>
69
68
 
70
69
  ${this.dropdownBackdropVisible ? this.dropdownBackdrop : nothing}
71
70
  ${this.alphaBarTemplate}
@@ -167,15 +166,12 @@ let SortFilterBar = class SortFilterBar extends LitElement {
167
166
  }
168
167
  /** Template to render the sort direction toggle button */
169
168
  get sortDirectionSelectorTemplate() {
170
- const oppositeSortDirectionReadable = this.sortDirection === 'asc' ? 'descending' : 'ascending';
171
- const srLabel = `Change to ${oppositeSortDirectionReadable} sort`;
172
169
  return html `
173
170
  <button
174
171
  class="sort-direction-selector"
175
172
  ?disabled=${this.selectedSort === 'relevance'}
176
173
  @click=${this.toggleSortDirection}
177
174
  >
178
- <span class="sr-only">${srLabel}</span>
179
175
  ${this.sortDirectionIcon}
180
176
  </button>
181
177
  `;
@@ -603,7 +599,6 @@ let SortFilterBar = class SortFilterBar extends LitElement {
603
599
  return html ` <alpha-bar
604
600
  .selectedLetter=${this.selectedTitleFilter}
605
601
  .letterCounts=${(_a = this.prefixFilterCountMap) === null || _a === void 0 ? void 0 : _a.title}
606
- ariaLandmarkLabel="Filter by title letter"
607
602
  @letterChanged=${this.titleLetterChanged}
608
603
  ></alpha-bar>`;
609
604
  }
@@ -612,7 +607,6 @@ let SortFilterBar = class SortFilterBar extends LitElement {
612
607
  return html ` <alpha-bar
613
608
  .selectedLetter=${this.selectedCreatorFilter}
614
609
  .letterCounts=${(_a = this.prefixFilterCountMap) === null || _a === void 0 ? void 0 : _a.creator}
615
- ariaLandmarkLabel="Filter by creator letter"
616
610
  @letterChanged=${this.creatorLetterChanged}
617
611
  ></alpha-bar>`;
618
612
  }
@@ -653,223 +647,217 @@ let SortFilterBar = class SortFilterBar extends LitElement {
653
647
  });
654
648
  this.dispatchEvent(event);
655
649
  }
656
- static get styles() {
657
- return [
658
- srOnlyStyle,
659
- css `
660
- #container {
661
- position: relative;
662
- }
650
+ };
651
+ SortFilterBar.styles = css `
652
+ #container {
653
+ position: relative;
654
+ }
663
655
 
664
- #sort-bar {
665
- display: flex;
666
- justify-content: space-between;
667
- align-items: center;
668
- border-bottom: 1px solid #2c2c2c;
669
- font-size: 1.4rem;
670
- }
656
+ #sort-bar {
657
+ display: flex;
658
+ justify-content: space-between;
659
+ align-items: center;
660
+ border-bottom: 1px solid #2c2c2c;
661
+ font-size: 1.4rem;
662
+ }
671
663
 
672
- ul {
673
- list-style: none;
674
- display: flex;
675
- align-items: center;
676
- margin: 0;
677
- padding: 0;
678
- }
664
+ ul {
665
+ list-style: none;
666
+ display: flex;
667
+ align-items: center;
668
+ margin: 0;
669
+ padding: 0;
670
+ }
679
671
 
680
- li {
681
- padding: 0;
682
- }
672
+ li {
673
+ padding: 0;
674
+ }
683
675
 
684
- .sort-by-text {
685
- margin-right: 5px;
686
- font-weight: bold;
687
- white-space: nowrap;
688
- }
676
+ .sort-by-text {
677
+ margin-right: 5px;
678
+ font-weight: bold;
679
+ white-space: nowrap;
680
+ }
689
681
 
690
- .sort-direction-container {
691
- display: flex;
692
- align-self: stretch;
693
- flex: 0;
694
- margin: 0 5px;
695
- }
682
+ .sort-direction-container {
683
+ display: flex;
684
+ align-self: stretch;
685
+ flex: 0;
686
+ margin: 0 5px;
687
+ }
696
688
 
697
- .sort-direction-selector {
698
- padding: 0;
699
- border: none;
700
- appearance: none;
701
- background: transparent;
702
- cursor: pointer;
703
- }
689
+ .sort-direction-selector {
690
+ padding: 0;
691
+ border: none;
692
+ appearance: none;
693
+ background: transparent;
694
+ cursor: pointer;
695
+ }
704
696
 
705
- .sort-direction-selector:disabled {
706
- cursor: default;
707
- }
697
+ .sort-direction-selector:disabled {
698
+ cursor: default;
699
+ }
708
700
 
709
- .sort-direction-icon {
710
- display: flex;
711
- align-items: center;
712
- background: none;
713
- color: inherit;
714
- border: none;
715
- padding: 0;
716
- outline: inherit;
717
- width: 14px;
718
- height: 14px;
719
- }
701
+ .sort-direction-icon {
702
+ display: flex;
703
+ align-items: center;
704
+ background: none;
705
+ color: inherit;
706
+ border: none;
707
+ padding: 0;
708
+ outline: inherit;
709
+ width: 14px;
710
+ height: 14px;
711
+ }
720
712
 
721
- .sort-direction-icon > svg {
722
- flex: 1;
723
- }
713
+ .sort-direction-icon > svg {
714
+ flex: 1;
715
+ }
724
716
 
725
- #date-sort-selector,
726
- #view-sort-selector {
727
- position: absolute;
728
- left: 150px;
729
- top: 45px;
717
+ #date-sort-selector,
718
+ #view-sort-selector {
719
+ position: absolute;
720
+ left: 150px;
721
+ top: 45px;
730
722
 
731
- z-index: 1;
732
- padding: 1rem;
733
- background-color: white;
734
- border-radius: 2.5rem;
735
- border: 1px solid #404142;
736
- }
723
+ z-index: 1;
724
+ padding: 1rem;
725
+ background-color: white;
726
+ border-radius: 2.5rem;
727
+ border: 1px solid #404142;
728
+ }
737
729
 
738
- #sort-selector-container {
739
- flex: 1;
740
- display: flex;
741
- justify-content: flex-start;
742
- align-items: center;
743
- }
730
+ #sort-selector-container {
731
+ flex: 1;
732
+ display: flex;
733
+ justify-content: flex-start;
734
+ align-items: center;
735
+ }
744
736
 
745
- #desktop-sort-container,
746
- #mobile-sort-container {
747
- display: flex;
748
- justify-content: flex-start;
749
- align-items: center;
750
- }
737
+ #desktop-sort-container,
738
+ #mobile-sort-container {
739
+ display: flex;
740
+ justify-content: flex-start;
741
+ align-items: center;
742
+ }
751
743
 
752
- /*
753
- we move the desktop sort selector offscreen instead of display: none
754
- because we need to observe the width of it vs its container to determine
755
- if it's wide enough to display the desktop version and if you display: none,
756
- the width becomes 0
757
- */
758
- #desktop-sort-container.hidden {
759
- position: absolute;
760
- top: -9999px;
761
- left: -9999px;
762
- visibility: hidden;
763
- }
744
+ /*
745
+ we move the desktop sort selector offscreen instead of display: none
746
+ because we need to observe the width of it vs its container to determine
747
+ if it's wide enough to display the desktop version and if you display: none,
748
+ the width becomes 0
749
+ */
750
+ #desktop-sort-container.hidden {
751
+ position: absolute;
752
+ top: -9999px;
753
+ left: -9999px;
754
+ visibility: hidden;
755
+ }
764
756
 
765
- #mobile-sort-container.hidden {
766
- display: none;
767
- }
757
+ #mobile-sort-container.hidden {
758
+ display: none;
759
+ }
768
760
 
769
- #sort-selector-backdrop {
770
- position: fixed;
771
- top: 0;
772
- left: 0;
773
- width: 100vw;
774
- height: 100vh;
775
- z-index: 1;
776
- background-color: transparent;
777
- }
761
+ #sort-selector-backdrop {
762
+ position: fixed;
763
+ top: 0;
764
+ left: 0;
765
+ width: 100vw;
766
+ height: 100vh;
767
+ z-index: 1;
768
+ background-color: transparent;
769
+ }
778
770
 
779
- #desktop-sort-selector {
780
- display: inline-flex;
781
- }
771
+ #desktop-sort-selector {
772
+ display: inline-flex;
773
+ }
782
774
 
783
- #desktop-sort-selector li {
784
- display: flex;
785
- align-items: center;
786
- padding-left: 5px;
787
- padding-right: 5px;
788
- }
775
+ #desktop-sort-selector li {
776
+ display: flex;
777
+ align-items: center;
778
+ padding-left: 5px;
779
+ padding-right: 5px;
780
+ }
789
781
 
790
- #desktop-sort-selector li a {
791
- padding: 0 5px;
792
- text-decoration: none;
793
- color: #333;
794
- line-height: 2;
795
- }
782
+ #desktop-sort-selector li a {
783
+ padding: 0 5px;
784
+ text-decoration: none;
785
+ color: #333;
786
+ line-height: 2;
787
+ }
796
788
 
797
- #desktop-sort-selector li button {
798
- padding: 0px 5px;
799
- border: none;
800
- background: none;
801
- font-family: inherit;
802
- font-size: inherit;
803
- color: #333;
804
- line-height: 2;
805
- cursor: pointer;
806
- appearance: none;
807
- }
789
+ #desktop-sort-selector li button {
790
+ padding: 0px 5px;
791
+ border: none;
792
+ background: none;
793
+ font-size: inherit;
794
+ color: #333;
795
+ line-height: 2;
796
+ cursor: pointer;
797
+ appearance: none;
798
+ }
808
799
 
809
- #desktop-sort-selector li button.selected {
810
- font-weight: bold;
811
- }
800
+ #desktop-sort-selector li button.selected {
801
+ font-weight: bold;
802
+ }
812
803
 
813
- #display-style-selector {
814
- flex: 0;
815
- }
804
+ #display-style-selector {
805
+ flex: 0;
806
+ }
816
807
 
817
- #display-style-selector button {
818
- background: none;
819
- color: inherit;
820
- border: none;
821
- appearance: none;
822
- cursor: pointer;
823
- -webkit-appearance: none;
824
- fill: #bbbbbb;
825
- }
808
+ #display-style-selector button {
809
+ background: none;
810
+ color: inherit;
811
+ border: none;
812
+ appearance: none;
813
+ cursor: pointer;
814
+ -webkit-appearance: none;
815
+ fill: #bbbbbb;
816
+ }
826
817
 
827
- #display-style-selector button.active {
828
- fill: var(--ia-theme-primary-text-color, #2c2c2c);
829
- }
818
+ #display-style-selector button.active {
819
+ fill: var(--ia-theme-primary-text-color, #2c2c2c);
820
+ }
830
821
 
831
- #display-style-selector button svg {
832
- width: 24px;
833
- height: 24px;
834
- }
822
+ #display-style-selector button svg {
823
+ width: 24px;
824
+ height: 24px;
825
+ }
835
826
 
836
- ia-dropdown {
837
- --dropdownTextColor: white;
838
- --dropdownOffsetTop: 0;
839
- --dropdownBorderTopWidth: 0;
840
- --dropdownBorderTopLeftRadius: 0;
841
- --dropdownBorderTopRightRadius: 0;
842
- --dropdownWhiteSpace: nowrap;
843
- --dropdownListZIndex: 2;
844
- --dropdownCaretColor: var(--ia-theme-primary-text-color, #2c2c2c);
845
- --dropdownSelectedTextColor: white;
846
- --dropdownSelectedBgColor: rgba(255, 255, 255, 0.3);
847
- --dropdownHoverBgColor: rgba(255, 255, 255, 0.3);
848
- --caretHeight: 9px;
849
- --caretWidth: 12px;
850
- --caretPadding: 0 5px 0 0;
851
- }
852
- ia-dropdown.selected .dropdown-label {
853
- font-weight: bold;
854
- }
855
- ia-dropdown.open {
856
- z-index: 2;
857
- }
827
+ ia-dropdown {
828
+ --dropdownTextColor: white;
829
+ --dropdownOffsetTop: 0;
830
+ --dropdownBorderTopWidth: 0;
831
+ --dropdownBorderTopLeftRadius: 0;
832
+ --dropdownBorderTopRightRadius: 0;
833
+ --dropdownWhiteSpace: nowrap;
834
+ --dropdownListZIndex: 2;
835
+ --dropdownCaretColor: var(--ia-theme-primary-text-color, #2c2c2c);
836
+ --dropdownSelectedTextColor: white;
837
+ --dropdownSelectedBgColor: rgba(255, 255, 255, 0.3);
838
+ --dropdownHoverBgColor: rgba(255, 255, 255, 0.3);
839
+ --caretHeight: 9px;
840
+ --caretWidth: 12px;
841
+ --caretPadding: 0 5px 0 0;
842
+ }
843
+ ia-dropdown.selected .dropdown-label {
844
+ font-weight: bold;
845
+ }
846
+ ia-dropdown.open {
847
+ z-index: 2;
848
+ }
858
849
 
859
- .dropdown-label {
860
- display: inline-block;
861
- height: 100%;
862
- padding-left: 5px;
863
- font-size: 1.4rem;
864
- line-height: 2;
865
- color: var(--ia-theme-primary-text-color, #2c2c2c);
866
- white-space: nowrap;
867
- user-select: none;
868
- }
869
- `,
870
- ];
871
- }
872
- };
850
+ .dropdown-label {
851
+ display: inline-block;
852
+ height: 100%;
853
+ padding-left: 5px;
854
+ font-size: 1.4rem;
855
+ line-height: 2;
856
+ color: var(--ia-theme-primary-text-color, #2c2c2c);
857
+ white-space: nowrap;
858
+ user-select: none;
859
+ }
860
+ `;
873
861
  __decorate([
874
862
  property({ type: String })
875
863
  ], SortFilterBar.prototype, "displayMode", void 0);