@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
@@ -70,6 +70,7 @@ import {
70
70
  analyticsActions,
71
71
  analyticsCategories,
72
72
  } from './utils/analytics-events';
73
+ import { srOnlyStyle } from './styles/sr-only';
73
74
 
74
75
  @customElement('collection-browser')
75
76
  export class CollectionBrowser
@@ -324,6 +325,22 @@ export class CollectionBrowser
324
325
  return false;
325
326
  }
326
327
 
328
+ /**
329
+ * Returns true if there are any currently selected/negated facet buckets,
330
+ * any selected date range, or any selected letter filters. False otherwise.
331
+ *
332
+ * Ignores sorting options.
333
+ */
334
+ private get hasActiveFilters(): boolean {
335
+ return !!(
336
+ this.hasCheckedFacets ||
337
+ this.minSelectedDate ||
338
+ this.maxSelectedDate ||
339
+ this.selectedTitleFilter ||
340
+ this.selectedCreatorFilter
341
+ );
342
+ }
343
+
327
344
  render() {
328
345
  this.setPlaceholderType();
329
346
  return html`
@@ -377,7 +394,9 @@ export class CollectionBrowser
377
394
  class="column${this.isResizeToMobile ? ' preload' : ''}"
378
395
  >
379
396
  <div id="mobile-header-container">
380
- ${this.mobileView ? this.mobileFacetsTemplate : nothing}
397
+ ${this.mobileView
398
+ ? this.mobileFacetsTemplate
399
+ : html`<h2 id="facets-header" class="sr-only">Filters</h2>`}
381
400
  <div id="results-total">
382
401
  <span id="big-results-count">
383
402
  ${shouldShowSearching ? html`Searching&hellip;` : resultsCount}
@@ -386,16 +405,14 @@ export class CollectionBrowser
386
405
  ${shouldShowSearching ? nothing : resultsLabel}
387
406
  </span>
388
407
  </div>
408
+ ${this.mobileView ? nothing : this.clearFiltersBtnTemplate(false)}
389
409
  </div>
390
- <div
391
- id="facets-container"
392
- class=${!this.mobileView || this.mobileFacetsVisible
393
- ? 'expanded'
394
- : ''}
395
- >
396
- ${this.facetsTemplate}
397
- <div id="facets-scroll-sentinel"></div>
398
- </div>
410
+ ${this.mobileView
411
+ ? nothing
412
+ : html`<div id="facets-container" aria-labelledby="facets-header">
413
+ ${this.facetsTemplate}
414
+ <div id="facets-scroll-sentinel"></div>
415
+ </div>`}
399
416
  ${this.mobileView ? nothing : html`<div id="facets-bottom-fade"></div>`}
400
417
  </div>
401
418
  <div id="right-column" class="column">
@@ -411,6 +428,7 @@ export class CollectionBrowser
411
428
  return html`<infinite-scroller
412
429
  class=${this.infiniteScrollerClasses}
413
430
  itemCount=${this.placeholderType ? 0 : nothing}
431
+ ariaLandmarkLabel="Search results"
414
432
  .cellProvider=${this}
415
433
  .placeholderCellTemplate=${this.placeholderCellTemplate}
416
434
  @scrollThresholdReached=${this.scrollThresholdReached}
@@ -581,28 +599,35 @@ export class CollectionBrowser
581
599
  this.selectedCreatorFilter = e.detail.selectedLetter;
582
600
  }
583
601
 
584
- private get mobileFacetsTemplate() {
602
+ /**
603
+ * The full template for how the facets should be structured in mobile view,
604
+ * including the collapsible container (with header) and the facets themselves.
605
+ */
606
+ private get mobileFacetsTemplate(): TemplateResult {
607
+ const toggleFacetsVisible = () => {
608
+ this.isResizeToMobile = false;
609
+ this.mobileFacetsVisible = !this.mobileFacetsVisible;
610
+ };
611
+
585
612
  return html`
586
- <div id="mobile-filter-collapse">
587
- <h1
588
- @click=${() => {
589
- this.isResizeToMobile = false;
590
- this.mobileFacetsVisible = !this.mobileFacetsVisible;
591
- }}
592
- @keyup=${() => {
593
- this.isResizeToMobile = false;
594
- this.mobileFacetsVisible = !this.mobileFacetsVisible;
595
- }}
596
- >
597
- <span class="collapser ${this.mobileFacetsVisible ? 'open' : ''}">
598
- ${chevronIcon}
599
- </span>
600
- Filters
601
- </h1>
602
- </div>
613
+ <details
614
+ id="mobile-filter-collapse"
615
+ @click=${toggleFacetsVisible}
616
+ @keyup=${toggleFacetsVisible}
617
+ >
618
+ <summary>
619
+ <span class="collapser-icon">${chevronIcon}</span>
620
+ <h2>Filters</h2>
621
+ ${this.clearFiltersBtnTemplate(true)}
622
+ </summary>
623
+ ${this.facetsTemplate}
624
+ </details>
603
625
  `;
604
626
  }
605
627
 
628
+ /**
629
+ * The template for the facets component alone, without any surrounding wrappers.
630
+ */
606
631
  private get facetsTemplate() {
607
632
  return html`
608
633
  <collection-facets
@@ -634,6 +659,36 @@ export class CollectionBrowser
634
659
  `;
635
660
  }
636
661
 
662
+ /**
663
+ * The HTML template for the "Clear all filters" button, or `nothing` if no
664
+ * filters are currently active.
665
+ *
666
+ * @param mobile Whether to style/shorten the button for mobile view
667
+ */
668
+ private clearFiltersBtnTemplate(
669
+ mobile: boolean
670
+ ): TemplateResult | typeof nothing {
671
+ if (!this.hasActiveFilters) return nothing;
672
+
673
+ const buttonClasses = classMap({
674
+ 'clear-filters-btn': true,
675
+ mobile,
676
+ });
677
+
678
+ const buttonText = mobile ? 'Clear all' : 'Clear all filters';
679
+
680
+ return html`
681
+ <div class="clear-filters-btn-row">
682
+ ${mobile
683
+ ? html`<span class="clear-filters-btn-separator">&nbsp;</span>`
684
+ : nothing}
685
+ <button class=${buttonClasses} @click=${this.clearFilters}>
686
+ ${buttonText}
687
+ </button>
688
+ </div>
689
+ `;
690
+ }
691
+
637
692
  private get loadingTemplate() {
638
693
  return html`
639
694
  <div class="loading-cover">
@@ -1733,306 +1788,374 @@ export class CollectionBrowser
1733
1788
  }
1734
1789
  }
1735
1790
 
1736
- static styles = css`
1737
- :host {
1738
- display: block;
1791
+ static get styles() {
1792
+ return [
1793
+ srOnlyStyle,
1794
+ css`
1795
+ :host {
1796
+ display: block;
1739
1797
 
1740
- --leftColumnWidth: 18rem;
1741
- --leftColumnPaddingRight: 2.5rem;
1742
- }
1798
+ --leftColumnWidth: 18rem;
1799
+ --leftColumnPaddingRight: 2.5rem;
1800
+ }
1743
1801
 
1744
- /**
1745
- * When page width resizes from desktop to mobile, use this class to
1746
- * disable expand/collapse transition when loading.
1747
- */
1748
- .preload * {
1749
- transition: none !important;
1750
- -webkit-transition: none !important;
1751
- -moz-transition: none !important;
1752
- -ms-transition: none !important;
1753
- -o-transition: none !important;
1754
- }
1802
+ /**
1803
+ * When page width resizes from desktop to mobile, use this class to
1804
+ * disable expand/collapse transition when loading.
1805
+ */
1806
+ .preload * {
1807
+ transition: none !important;
1808
+ -webkit-transition: none !important;
1809
+ -moz-transition: none !important;
1810
+ -ms-transition: none !important;
1811
+ -o-transition: none !important;
1812
+ }
1755
1813
 
1756
- #content-container {
1757
- display: flex;
1758
- }
1814
+ #content-container {
1815
+ display: flex;
1816
+ }
1759
1817
 
1760
- .collapser {
1761
- display: inline-block;
1762
- }
1818
+ .collapser-icon {
1819
+ display: inline-block;
1820
+ }
1763
1821
 
1764
- .collapser svg {
1765
- width: 10px;
1766
- height: 10px;
1767
- transition: transform 0.2s ease-out;
1768
- }
1822
+ .collapser-icon svg {
1823
+ display: inline-block;
1824
+ width: 12px;
1825
+ height: 12px;
1826
+ transition: transform 0.2s ease-out;
1827
+ }
1769
1828
 
1770
- .collapser.open svg {
1771
- transform: rotate(90deg);
1772
- }
1829
+ #mobile-filter-collapse > summary {
1830
+ cursor: pointer;
1831
+ list-style: none;
1832
+ }
1773
1833
 
1774
- #mobile-filter-collapse h1 {
1775
- cursor: pointer;
1776
- }
1834
+ #mobile-filter-collapse[open] > summary {
1835
+ margin-bottom: 10px;
1836
+ }
1777
1837
 
1778
- #content-container.mobile {
1779
- display: block;
1780
- }
1838
+ #mobile-filter-collapse h2 {
1839
+ display: inline-block;
1840
+ margin: 0;
1841
+ font-size: 2rem;
1842
+ }
1781
1843
 
1782
- .column {
1783
- padding-top: 2rem;
1784
- }
1844
+ #mobile-filter-collapse[open] svg {
1845
+ transform: rotate(90deg);
1846
+ }
1785
1847
 
1786
- #right-column {
1787
- flex: 1;
1788
- position: relative;
1789
- border-left: 1px solid rgb(232, 232, 232);
1790
- border-right: 1px solid rgb(232, 232, 232);
1791
- padding-left: 1rem;
1792
- padding-right: 1rem;
1793
- background: #fff;
1794
- }
1848
+ #content-container.mobile {
1849
+ display: block;
1850
+ }
1795
1851
 
1796
- .mobile #right-column {
1797
- border-left: none;
1798
- padding: 5px 5px 0;
1799
- }
1852
+ .column {
1853
+ padding-top: 2rem;
1854
+ }
1800
1855
 
1801
- #left-column {
1802
- width: var(--leftColumnWidth, 18rem);
1803
- /* Prevents Safari from shrinking col at first draw */
1804
- min-width: var(--leftColumnWidth, 18rem);
1805
- padding-top: 0;
1806
- /* Reduced padding by 0.2rem to add the invisible border in the rule below */
1807
- padding-right: calc(var(--leftColumnPaddingRight, 2.5rem) - 0.2rem);
1808
- border-right: 0.2rem solid transparent; /* Pads to the right of the scrollbar a bit */
1809
- z-index: 1;
1810
- }
1856
+ #right-column {
1857
+ flex: 1;
1858
+ position: relative;
1859
+ border-left: 1px solid rgb(232, 232, 232);
1860
+ border-right: 1px solid rgb(232, 232, 232);
1861
+ padding-left: 1rem;
1862
+ padding-right: 1rem;
1863
+ background: #fff;
1864
+ }
1811
1865
 
1812
- .desktop #left-column {
1813
- top: 0;
1814
- position: sticky;
1815
- height: calc(100vh - 2rem);
1816
- max-height: calc(100vh - 2rem);
1817
- overflow-x: hidden;
1818
- overflow-y: scroll;
1819
-
1820
- /*
1821
- * Firefox doesn't support any of the -webkit-scrollbar stuff below, but
1822
- * does at least give us a tiny bit of control over width & color.
1823
- */
1824
- scrollbar-width: thin;
1825
- scrollbar-color: transparent transparent;
1826
- }
1827
- .desktop #left-column:hover {
1828
- scrollbar-color: auto;
1829
- }
1830
- .desktop #left-column::-webkit-scrollbar {
1831
- appearance: none;
1832
- width: 6px;
1833
- }
1834
- .desktop #left-column::-webkit-scrollbar-button {
1835
- height: 3px;
1836
- background: transparent;
1837
- }
1838
- .desktop #left-column::-webkit-scrollbar-corner {
1839
- background: transparent;
1840
- }
1841
- .desktop #left-column::-webkit-scrollbar-thumb {
1842
- border-radius: 4px;
1843
- }
1844
- .desktop #left-column:hover::-webkit-scrollbar-thumb {
1845
- background: rgba(0, 0, 0, 0.15);
1846
- }
1847
- .desktop #left-column:hover::-webkit-scrollbar-thumb:hover {
1848
- background: rgba(0, 0, 0, 0.2);
1849
- }
1850
- .desktop #left-column:hover::-webkit-scrollbar-thumb:active {
1851
- background: rgba(0, 0, 0, 0.3);
1852
- }
1866
+ .mobile #right-column {
1867
+ border-left: none;
1868
+ padding: 5px 5px 0;
1869
+ }
1853
1870
 
1854
- #facets-bottom-fade {
1855
- background: linear-gradient(
1856
- to bottom,
1857
- #f5f5f700 0%,
1858
- #f5f5f7c0 50%,
1859
- #f5f5f7 80%,
1860
- #f5f5f7 100%
1861
- );
1862
- position: fixed;
1863
- bottom: 0;
1864
- height: 50px;
1865
- /* Wide enough to cover the content, but leave the scrollbar uncovered */
1866
- width: calc(
1867
- var(--leftColumnWidth) + var(--leftColumnPaddingRight) - 10px
1868
- );
1869
- z-index: 2;
1870
- pointer-events: none;
1871
- transition: height 0.1s ease;
1872
- }
1873
- #facets-bottom-fade.hidden {
1874
- height: 0;
1875
- }
1871
+ #left-column {
1872
+ width: var(--leftColumnWidth, 18rem);
1873
+ /* Prevents Safari from shrinking col at first draw */
1874
+ min-width: var(--leftColumnWidth, 18rem);
1875
+ padding-top: 0;
1876
+ /* Reduced padding by 0.2rem to add the invisible border in the rule below */
1877
+ padding-right: calc(var(--leftColumnPaddingRight, 2.5rem) - 0.2rem);
1878
+ border-right: 0.2rem solid transparent; /* Pads to the right of the scrollbar a bit */
1879
+ z-index: 1;
1880
+ }
1876
1881
 
1877
- .desktop #left-column-scroll-sentinel {
1878
- width: 1px;
1879
- height: 100vh;
1880
- background: transparent;
1881
- }
1882
+ .desktop #left-column {
1883
+ top: 0;
1884
+ position: sticky;
1885
+ height: calc(100vh - 2rem);
1886
+ max-height: calc(100vh - 2rem);
1887
+ overflow-x: hidden;
1888
+ overflow-y: scroll;
1889
+
1890
+ /*
1891
+ * Firefox doesn't support any of the -webkit-scrollbar stuff below, but
1892
+ * does at least give us a tiny bit of control over width & color.
1893
+ */
1894
+ scrollbar-width: thin;
1895
+ scrollbar-color: transparent transparent;
1896
+ }
1897
+ .desktop #left-column:hover {
1898
+ scrollbar-color: auto;
1899
+ }
1900
+ .desktop #left-column::-webkit-scrollbar {
1901
+ appearance: none;
1902
+ width: 6px;
1903
+ }
1904
+ .desktop #left-column::-webkit-scrollbar-button {
1905
+ height: 3px;
1906
+ background: transparent;
1907
+ }
1908
+ .desktop #left-column::-webkit-scrollbar-corner {
1909
+ background: transparent;
1910
+ }
1911
+ .desktop #left-column::-webkit-scrollbar-thumb {
1912
+ border-radius: 4px;
1913
+ }
1914
+ .desktop #left-column:hover::-webkit-scrollbar-thumb {
1915
+ background: rgba(0, 0, 0, 0.15);
1916
+ }
1917
+ .desktop #left-column:hover::-webkit-scrollbar-thumb:hover {
1918
+ background: rgba(0, 0, 0, 0.2);
1919
+ }
1920
+ .desktop #left-column:hover::-webkit-scrollbar-thumb:active {
1921
+ background: rgba(0, 0, 0, 0.3);
1922
+ }
1882
1923
 
1883
- .desktop #facets-scroll-sentinel {
1884
- width: 1px;
1885
- height: 1px;
1886
- background: transparent;
1887
- }
1924
+ #facets-bottom-fade {
1925
+ background: linear-gradient(
1926
+ to bottom,
1927
+ #f5f5f700 0%,
1928
+ #f5f5f7c0 50%,
1929
+ #f5f5f7 80%,
1930
+ #f5f5f7 100%
1931
+ );
1932
+ position: fixed;
1933
+ bottom: 0;
1934
+ height: 50px;
1935
+ /* Wide enough to cover the content, but leave the scrollbar uncovered */
1936
+ width: calc(
1937
+ var(--leftColumnWidth) + var(--leftColumnPaddingRight) - 10px
1938
+ );
1939
+ z-index: 2;
1940
+ pointer-events: none;
1941
+ transition: height 0.1s ease;
1942
+ }
1943
+ #facets-bottom-fade.hidden {
1944
+ height: 0;
1945
+ }
1888
1946
 
1889
- .mobile #left-column {
1890
- width: 100%;
1891
- padding: 0;
1892
- }
1947
+ .desktop #left-column-scroll-sentinel {
1948
+ width: 1px;
1949
+ height: 100vh;
1950
+ background: transparent;
1951
+ }
1893
1952
 
1894
- #mobile-header-container {
1895
- display: flex;
1896
- justify-content: space-between;
1897
- align-items: center;
1898
- }
1953
+ .desktop #facets-scroll-sentinel {
1954
+ width: 1px;
1955
+ height: 1px;
1956
+ background: transparent;
1957
+ }
1899
1958
 
1900
- .desktop #mobile-header-container {
1901
- padding-top: 2rem;
1902
- }
1959
+ #mobile-header-container {
1960
+ display: flex;
1961
+ justify-content: space-between;
1962
+ align-items: flex-start;
1963
+ margin: 10px 0;
1964
+ }
1903
1965
 
1904
- #facets-container {
1905
- position: relative;
1906
- max-height: 0;
1907
- transition: max-height 0.2s ease-in-out;
1908
- z-index: 1;
1909
- padding-bottom: 2rem;
1910
- }
1966
+ .desktop #mobile-header-container {
1967
+ padding-top: 2rem;
1968
+ flex-wrap: wrap;
1969
+ }
1911
1970
 
1912
- .mobile #facets-container {
1913
- overflow: hidden;
1914
- padding-bottom: 0;
1915
- padding-left: 10px;
1916
- padding-right: 10px;
1917
- }
1971
+ .mobile #left-column {
1972
+ width: 100%;
1973
+ padding: 0;
1974
+ }
1918
1975
 
1919
- #facets-container.expanded {
1920
- max-height: 2000px;
1921
- }
1976
+ .clear-filters-btn-row {
1977
+ display: inline-block;
1978
+ }
1922
1979
 
1923
- #results-total {
1924
- display: flex;
1925
- align-items: baseline;
1926
- margin-bottom: 5rem;
1927
- }
1980
+ .desktop .clear-filters-btn-row {
1981
+ width: 100%;
1982
+ }
1928
1983
 
1929
- .mobile #results-total {
1930
- margin-bottom: 0;
1931
- }
1984
+ .clear-filters-btn {
1985
+ display: inline-block;
1986
+ appearance: none;
1987
+ margin: 0;
1988
+ padding: 0;
1989
+ border: 0;
1990
+ background: none;
1991
+ color: var(--ia-theme-link-color);
1992
+ font-size: 1.4rem;
1993
+ font-family: inherit;
1994
+ cursor: pointer;
1995
+ }
1932
1996
 
1933
- #big-results-count {
1934
- font-size: 2.4rem;
1935
- font-weight: 500;
1936
- margin-right: 5px;
1937
- }
1997
+ .clear-filters-btn:hover {
1998
+ text-decoration: underline;
1999
+ }
1938
2000
 
1939
- #big-results-label {
1940
- font-size: 1.4rem;
1941
- font-weight: 200;
1942
- }
2001
+ .clear-filters-btn-separator {
2002
+ display: inline-block;
2003
+ margin-left: 5px;
2004
+ border-left: 1px solid #2c2c2c;
2005
+ font-size: 1.4rem;
2006
+ line-height: 1.3rem;
2007
+ }
1943
2008
 
1944
- #list-header {
1945
- max-height: 4.2rem;
1946
- }
2009
+ #facets-container {
2010
+ position: relative;
2011
+ max-height: 0;
2012
+ transition: max-height 0.2s ease-in-out;
2013
+ z-index: 1;
2014
+ margin-top: 5rem;
2015
+ padding-bottom: 2rem;
2016
+ }
1947
2017
 
1948
- .loading-cover {
1949
- position: absolute;
1950
- top: 0;
1951
- left: 0;
1952
- width: 100%;
1953
- height: 100%;
1954
- display: flex;
1955
- justify-content: center;
1956
- z-index: 1;
1957
- padding-top: 50px;
1958
- }
2018
+ #facets-container {
2019
+ position: relative;
2020
+ max-height: 0;
2021
+ transition: max-height 0.2s ease-in-out;
2022
+ z-index: 1;
2023
+ padding-bottom: 2rem;
2024
+ }
1959
2025
 
1960
- circular-activity-indicator {
1961
- width: 30px;
1962
- height: 30px;
1963
- }
2026
+ .mobile #facets-container {
2027
+ overflow: hidden;
2028
+ padding-bottom: 0;
2029
+ padding-left: 10px;
2030
+ padding-right: 10px;
2031
+ }
1964
2032
 
1965
- sort-filter-bar {
1966
- display: block;
1967
- margin-bottom: 4rem;
1968
- }
2033
+ #facets-container.expanded {
2034
+ max-height: 2000px;
2035
+ }
1969
2036
 
1970
- infinite-scroller {
1971
- display: block;
1972
- --infiniteScrollerRowGap: var(--collectionBrowserRowGap, 1.7rem);
1973
- --infiniteScrollerColGap: var(--collectionBrowserColGap, 1.7rem);
1974
- }
2037
+ #results-total {
2038
+ display: flex;
2039
+ align-items: baseline;
2040
+ }
1975
2041
 
1976
- infinite-scroller.list-compact {
1977
- --infiniteScrollerCellMinWidth: var(
1978
- --collectionBrowserCellMinWidth,
1979
- 100%
1980
- );
1981
- --infiniteScrollerCellMinHeight: 34px; /* override infinite scroller component */
1982
- --infiniteScrollerCellMaxHeight: 56px;
1983
- --infiniteScrollerRowGap: 0px;
1984
- }
2042
+ .mobile #results-total {
2043
+ margin-bottom: 0;
2044
+ margin-right: 5px;
2045
+ }
1985
2046
 
1986
- infinite-scroller.list-detail {
1987
- --infiniteScrollerCellMinWidth: var(
1988
- --collectionBrowserCellMinWidth,
1989
- 100%
1990
- );
1991
- --infiniteScrollerCellMinHeight: var(
1992
- --collectionBrowserCellMinHeight,
1993
- 5rem
1994
- );
1995
- /*
1996
- 30px in spec, compensating for a -4px margin
1997
- to align title with top of item image
1998
- src/tiles/list/tile-list.ts
1999
- */
2000
- --infiniteScrollerRowGap: 34px;
2001
- }
2047
+ #big-results-count {
2048
+ font-size: 2.4rem;
2049
+ font-weight: 500;
2050
+ margin-right: 5px;
2051
+ }
2002
2052
 
2003
- .mobile infinite-scroller.list-detail {
2004
- --infiniteScrollerRowGap: 24px;
2005
- }
2053
+ .mobile #big-results-count {
2054
+ font-size: 2rem;
2055
+ }
2006
2056
 
2007
- infinite-scroller.grid {
2008
- --infiniteScrollerCellMinWidth: var(
2009
- --collectionBrowserCellMinWidth,
2010
- 17rem
2011
- );
2012
- --infiniteScrollerCellMaxWidth: var(--collectionBrowserCellMaxWidth, 1fr);
2013
- }
2057
+ #big-results-label {
2058
+ font-size: 1.4rem;
2059
+ font-weight: 200;
2060
+ }
2014
2061
 
2015
- /* Allow tiles to shrink a bit further at smaller viewport widths */
2016
- @media screen and (max-width: 880px) {
2017
- infinite-scroller.grid {
2018
- --infiniteScrollerCellMinWidth: var(
2019
- --collectionBrowserCellMinWidth,
2020
- 15rem
2021
- );
2022
- }
2023
- }
2024
- /* At very small widths, maintain a 2-tile layout as far as it can reasonably go */
2025
- @media screen and (max-width: 360px) {
2026
- infinite-scroller.grid {
2027
- --infiniteScrollerCellMinWidth: var(
2028
- --collectionBrowserCellMinWidth,
2029
- 12rem
2030
- );
2031
- }
2032
- }
2062
+ #list-header {
2063
+ max-height: 4.2rem;
2064
+ }
2033
2065
 
2034
- infinite-scroller.hidden {
2035
- display: none;
2036
- }
2037
- `;
2066
+ .loading-cover {
2067
+ position: absolute;
2068
+ top: 0;
2069
+ left: 0;
2070
+ width: 100%;
2071
+ height: 100%;
2072
+ display: flex;
2073
+ justify-content: center;
2074
+ z-index: 1;
2075
+ padding-top: 50px;
2076
+ }
2077
+
2078
+ circular-activity-indicator {
2079
+ width: 30px;
2080
+ height: 30px;
2081
+ }
2082
+
2083
+ sort-filter-bar {
2084
+ display: block;
2085
+ margin-bottom: 4rem;
2086
+ }
2087
+
2088
+ infinite-scroller {
2089
+ display: block;
2090
+ --infiniteScrollerRowGap: var(--collectionBrowserRowGap, 1.7rem);
2091
+ --infiniteScrollerColGap: var(--collectionBrowserColGap, 1.7rem);
2092
+ }
2093
+
2094
+ infinite-scroller.list-compact {
2095
+ --infiniteScrollerCellMinWidth: var(
2096
+ --collectionBrowserCellMinWidth,
2097
+ 100%
2098
+ );
2099
+ --infiniteScrollerCellMinHeight: 34px; /* override infinite scroller component */
2100
+ --infiniteScrollerCellMaxHeight: 56px;
2101
+ --infiniteScrollerRowGap: 0px;
2102
+ }
2103
+
2104
+ infinite-scroller.list-detail {
2105
+ --infiniteScrollerCellMinWidth: var(
2106
+ --collectionBrowserCellMinWidth,
2107
+ 100%
2108
+ );
2109
+ --infiniteScrollerCellMinHeight: var(
2110
+ --collectionBrowserCellMinHeight,
2111
+ 5rem
2112
+ );
2113
+ /*
2114
+ 30px in spec, compensating for a -4px margin
2115
+ to align title with top of item image
2116
+ src/tiles/list/tile-list.ts
2117
+ */
2118
+ --infiniteScrollerRowGap: 34px;
2119
+ }
2120
+
2121
+ .mobile infinite-scroller.list-detail {
2122
+ --infiniteScrollerRowGap: 24px;
2123
+ }
2124
+
2125
+ infinite-scroller.grid {
2126
+ --infiniteScrollerCellMinWidth: var(
2127
+ --collectionBrowserCellMinWidth,
2128
+ 17rem
2129
+ );
2130
+ --infiniteScrollerCellMaxWidth: var(
2131
+ --collectionBrowserCellMaxWidth,
2132
+ 1fr
2133
+ );
2134
+ }
2135
+
2136
+ /* Allow tiles to shrink a bit further at smaller viewport widths */
2137
+ @media screen and (max-width: 880px) {
2138
+ infinite-scroller.grid {
2139
+ --infiniteScrollerCellMinWidth: var(
2140
+ --collectionBrowserCellMinWidth,
2141
+ 15rem
2142
+ );
2143
+ }
2144
+ }
2145
+ /* At very small widths, maintain a 2-tile layout as far as it can reasonably go */
2146
+ @media screen and (max-width: 360px) {
2147
+ infinite-scroller.grid {
2148
+ --infiniteScrollerCellMinWidth: var(
2149
+ --collectionBrowserCellMinWidth,
2150
+ 12rem
2151
+ );
2152
+ }
2153
+ }
2154
+
2155
+ infinite-scroller.hidden {
2156
+ display: none;
2157
+ }
2158
+ `,
2159
+ ];
2160
+ }
2038
2161
  }