@internetarchive/collection-browser 2.18.2 → 2.18.3-alpha-webdev7768.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 (48) hide show
  1. package/.editorconfig +29 -29
  2. package/.github/workflows/ci.yml +27 -27
  3. package/.github/workflows/gh-pages-main.yml +39 -39
  4. package/.github/workflows/npm-publish.yml +39 -39
  5. package/.github/workflows/pr-preview.yml +38 -38
  6. package/.husky/pre-commit +4 -4
  7. package/.prettierignore +1 -1
  8. package/LICENSE +661 -661
  9. package/README.md +83 -83
  10. package/dist/src/collection-browser.js +682 -682
  11. package/dist/src/collection-browser.js.map +1 -1
  12. package/dist/src/collection-facets.js +291 -274
  13. package/dist/src/collection-facets.js.map +1 -1
  14. package/dist/src/expanded-date-picker.d.ts +6 -4
  15. package/dist/src/expanded-date-picker.js +64 -55
  16. package/dist/src/expanded-date-picker.js.map +1 -1
  17. package/dist/src/models.js.map +1 -1
  18. package/dist/src/sort-filter-bar/sort-filter-bar.js +382 -382
  19. package/dist/src/sort-filter-bar/sort-filter-bar.js.map +1 -1
  20. package/dist/src/tiles/grid/item-tile.js +139 -139
  21. package/dist/src/tiles/grid/item-tile.js.map +1 -1
  22. package/dist/src/tiles/grid/styles/tile-grid-shared-styles.js +118 -118
  23. package/dist/src/tiles/grid/styles/tile-grid-shared-styles.js.map +1 -1
  24. package/dist/src/tiles/list/tile-list.js +289 -289
  25. package/dist/src/tiles/list/tile-list.js.map +1 -1
  26. package/dist/src/tiles/tile-dispatcher.js +200 -200
  27. package/dist/src/tiles/tile-dispatcher.js.map +1 -1
  28. package/dist/test/sort-filter-bar/sort-filter-bar.test.js +37 -37
  29. package/dist/test/sort-filter-bar/sort-filter-bar.test.js.map +1 -1
  30. package/eslint.config.mjs +53 -53
  31. package/index.html +24 -24
  32. package/local.archive.org.cert +86 -86
  33. package/local.archive.org.key +27 -27
  34. package/package.json +117 -117
  35. package/renovate.json +6 -6
  36. package/src/collection-browser.ts +2712 -2712
  37. package/src/collection-facets.ts +990 -966
  38. package/src/expanded-date-picker.ts +191 -175
  39. package/src/models.ts +822 -822
  40. package/src/sort-filter-bar/sort-filter-bar.ts +1189 -1189
  41. package/src/tiles/grid/item-tile.ts +339 -339
  42. package/src/tiles/grid/styles/tile-grid-shared-styles.ts +129 -129
  43. package/src/tiles/list/tile-list.ts +688 -688
  44. package/src/tiles/tile-dispatcher.ts +486 -486
  45. package/test/sort-filter-bar/sort-filter-bar.test.ts +692 -692
  46. package/tsconfig.json +20 -20
  47. package/web-dev-server.config.mjs +30 -30
  48. package/web-test-runner.config.mjs +41 -41
@@ -70,36 +70,36 @@ let SortFilterBar = class SortFilterBar extends LitElement {
70
70
  };
71
71
  }
72
72
  render() {
73
- return html `
74
- <div id="container">
75
- <section id="sort-bar" aria-label="Sorting options">
76
- <slot name="sort-options-left"></slot>
77
- <div id="sort-options">
73
+ return html `
74
+ <div id="container">
75
+ <section id="sort-bar" aria-label="Sorting options">
76
+ <slot name="sort-options-left"></slot>
77
+ <div id="sort-options">
78
78
  ${!this.enableSortOptionsSlot
79
- ? html `
80
- <div class="sort-direction-container">
81
- ${this.sortDirectionSelectorTemplate}
82
- </div>
83
- <span class="sort-by-text">${msg('Sort by:')}</span>
84
- <div id="sort-selector-container">
85
- ${this.mobileSortSelectorTemplate}
86
- ${this.desktopSortSelectorTemplate}
87
- </div>
79
+ ? html `
80
+ <div class="sort-direction-container">
81
+ ${this.sortDirectionSelectorTemplate}
82
+ </div>
83
+ <span class="sort-by-text">${msg('Sort by:')}</span>
84
+ <div id="sort-selector-container">
85
+ ${this.mobileSortSelectorTemplate}
86
+ ${this.desktopSortSelectorTemplate}
87
+ </div>
88
88
  `
89
- : html `<slot name="sort-options"></slot>`}
90
- </div>
91
- <slot name="sort-options-right"></slot>
92
-
89
+ : html `<slot name="sort-options"></slot>`}
90
+ </div>
91
+ <slot name="sort-options-right"></slot>
92
+
93
93
  ${this.suppressDisplayModes
94
94
  ? nothing
95
- : html `<div id="display-style-selector">
96
- ${this.displayOptionTemplate}
97
- </div>`}
98
- </section>
99
-
100
- ${this.dropdownBackdropVisible ? this.dropdownBackdrop : nothing}
101
- ${this.alphaBarTemplate}
102
- </div>
95
+ : html `<div id="display-style-selector">
96
+ ${this.displayOptionTemplate}
97
+ </div>`}
98
+ </section>
99
+
100
+ ${this.dropdownBackdropVisible ? this.dropdownBackdrop : nothing}
101
+ ${this.alphaBarTemplate}
102
+ </div>
103
103
  `;
104
104
  }
105
105
  willUpdate(changed) {
@@ -233,15 +233,15 @@ let SortFilterBar = class SortFilterBar extends LitElement {
233
233
  get sortDirectionSelectorTemplate() {
234
234
  const oppositeSortDirectionReadable = this.sortDirection === 'asc' ? 'descending' : 'ascending';
235
235
  const srLabel = `Change to ${oppositeSortDirectionReadable} sort`;
236
- return html `
237
- <button
238
- class="sort-direction-selector"
239
- ?disabled=${!this.canChangeSortDirection}
240
- @click=${this.handleSortDirectionClicked}
241
- >
242
- <span class="sr-only">${srLabel}</span>
243
- ${this.sortDirectionIcon}
244
- </button>
236
+ return html `
237
+ <button
238
+ class="sort-direction-selector"
239
+ ?disabled=${!this.canChangeSortDirection}
240
+ @click=${this.handleSortDirectionClicked}
241
+ >
242
+ <span class="sr-only">${srLabel}</span>
243
+ ${this.sortDirectionIcon}
244
+ </button>
245
245
  `;
246
246
  }
247
247
  /** Template to render the sort direction button's icon in the correct current state */
@@ -251,22 +251,22 @@ let SortFilterBar = class SortFilterBar extends LitElement {
251
251
  return html `<div class="sort-direction-icon">${sortDisabledIcon}</div>`;
252
252
  }
253
253
  // For all other sorts, show the ascending/descending direction
254
- return html `
255
- <div class="sort-direction-icon">
256
- ${this.finalizedSortDirection === 'asc' ? sortUpIcon : sortDownIcon}
257
- </div>
254
+ return html `
255
+ <div class="sort-direction-icon">
256
+ ${this.finalizedSortDirection === 'asc' ? sortUpIcon : sortDownIcon}
257
+ </div>
258
258
  `;
259
259
  }
260
260
  /** The template to render all the sort options in desktop view */
261
261
  get desktopSortSelectorTemplate() {
262
- return html `
263
- <div
264
- id="desktop-sort-container"
265
- class=${this.mobileSelectorVisible ? 'hidden' : 'visible'}
266
- >
267
- <ul id="desktop-sort-selector">
262
+ return html `
263
+ <div
264
+ id="desktop-sort-container"
265
+ class=${this.mobileSelectorVisible ? 'hidden' : 'visible'}
266
+ >
267
+ <ul id="desktop-sort-selector">
268
268
  ${this.showRelevance
269
- ? html `<li>
269
+ ? html `<li>
270
270
  ${this.getSortDisplayOption(SortField.relevance, {
271
271
  onClick: () => {
272
272
  this.dropdownBackdropVisible = false;
@@ -275,11 +275,11 @@ let SortFilterBar = class SortFilterBar extends LitElement {
275
275
  this.setSelectedSort(SortField.relevance);
276
276
  }
277
277
  },
278
- })}
278
+ })}
279
279
  </li>`
280
- : nothing}
281
- <li>${this.viewsDropdownTemplate}</li>
282
- <li>
280
+ : nothing}
281
+ <li>${this.viewsDropdownTemplate}</li>
282
+ <li>
283
283
  ${this.getSortDisplayOption(SortField.title, {
284
284
  onClick: () => {
285
285
  this.dropdownBackdropVisible = false;
@@ -290,10 +290,10 @@ let SortFilterBar = class SortFilterBar extends LitElement {
290
290
  this.emitCreatorLetterChangedEvent();
291
291
  }
292
292
  },
293
- })}
294
- </li>
295
- <li>${this.dateDropdownTemplate}</li>
296
- <li>
293
+ })}
294
+ </li>
295
+ <li>${this.dateDropdownTemplate}</li>
296
+ <li>
297
297
  ${this.getSortDisplayOption(SortField.creator, {
298
298
  onClick: () => {
299
299
  this.dropdownBackdropVisible = false;
@@ -304,10 +304,10 @@ let SortFilterBar = class SortFilterBar extends LitElement {
304
304
  this.emitTitleLetterChangedEvent();
305
305
  }
306
306
  },
307
- })}
308
- </li>
309
- </ul>
310
- </div>
307
+ })}
308
+ </li>
309
+ </ul>
310
+ </div>
311
311
  `;
312
312
  }
313
313
  /** The template to render all the sort options in mobile view */
@@ -316,11 +316,11 @@ let SortFilterBar = class SortFilterBar extends LitElement {
316
316
  .filter(opt => opt.shownInSortBar)
317
317
  .filter(opt => this.showRelevance || opt.field !== SortField.relevance)
318
318
  .filter(opt => this.showDateFavorited || opt.field !== SortField.datefavorited);
319
- return html `
320
- <div
321
- id="mobile-sort-container"
322
- class=${this.mobileSelectorVisible ? 'visible' : 'hidden'}
323
- >
319
+ return html `
320
+ <div
321
+ id="mobile-sort-container"
322
+ class=${this.mobileSelectorVisible ? 'visible' : 'hidden'}
323
+ >
324
324
  ${this.getSortDropdown({
325
325
  displayName: html `${SORT_OPTIONS[this.finalizedSortField].displayName}`,
326
326
  id: 'mobile-dropdown',
@@ -332,8 +332,8 @@ let SortFilterBar = class SortFilterBar extends LitElement {
332
332
  this.dropdownBackdropVisible = this.mobileDropdown.open;
333
333
  this.mobileDropdown.classList.toggle('open', this.mobileDropdown.open);
334
334
  },
335
- })}
336
- </div>
335
+ })}
336
+ </div>
337
337
  `;
338
338
  }
339
339
  /**
@@ -353,18 +353,18 @@ let SortFilterBar = class SortFilterBar extends LitElement {
353
353
  var _a, _b;
354
354
  const isSelected = (_a = options === null || options === void 0 ? void 0 : options.selected) !== null && _a !== void 0 ? _a : this.finalizedSortField === sortField;
355
355
  const displayName = (_b = options === null || options === void 0 ? void 0 : options.displayName) !== null && _b !== void 0 ? _b : SORT_OPTIONS[sortField].displayName;
356
- return html `
357
- <button
358
- class=${isSelected ? 'selected' : nothing}
359
- data-title="${displayName}"
356
+ return html `
357
+ <button
358
+ class=${isSelected ? 'selected' : nothing}
359
+ data-title="${displayName}"
360
360
  @click=${(e) => {
361
361
  var _a;
362
362
  e.preventDefault();
363
363
  (_a = options === null || options === void 0 ? void 0 : options.onClick) === null || _a === void 0 ? void 0 : _a.call(options, e);
364
- }}
365
- >
366
- ${displayName}
367
- </button>
364
+ }}
365
+ >
366
+ ${displayName}
367
+ </button>
368
368
  `;
369
369
  }
370
370
  /**
@@ -383,24 +383,24 @@ let SortFilterBar = class SortFilterBar extends LitElement {
383
383
  */
384
384
  getSortDropdown(options) {
385
385
  var _a, _b, _c, _d, _e;
386
- return html `
387
- <ia-dropdown
388
- id=${(_a = options.id) !== null && _a !== void 0 ? _a : nothing}
389
- class=${options.selected ? 'selected' : nothing}
390
- displayCaret
391
- closeOnSelect
392
- includeSelectedOption
393
- .openViaButton=${options.selected}
394
- .options=${options.dropdownOptions}
395
- .selectedOption=${(_b = options.selectedOption) !== null && _b !== void 0 ? _b : ''}
396
- @optionSelected=${(_c = options.onOptionSelected) !== null && _c !== void 0 ? _c : nothing}
397
- @click=${(_d = options.onDropdownClick) !== null && _d !== void 0 ? _d : nothing}
398
- >
399
- <span
400
- class="dropdown-label"
401
- slot="dropdown-label"
402
- data-title="${options.displayName.values}"
403
- @click=${(_e = options.onLabelInteraction) !== null && _e !== void 0 ? _e : nothing}
386
+ return html `
387
+ <ia-dropdown
388
+ id=${(_a = options.id) !== null && _a !== void 0 ? _a : nothing}
389
+ class=${options.selected ? 'selected' : nothing}
390
+ displayCaret
391
+ closeOnSelect
392
+ includeSelectedOption
393
+ .openViaButton=${options.selected}
394
+ .options=${options.dropdownOptions}
395
+ .selectedOption=${(_b = options.selectedOption) !== null && _b !== void 0 ? _b : ''}
396
+ @optionSelected=${(_c = options.onOptionSelected) !== null && _c !== void 0 ? _c : nothing}
397
+ @click=${(_d = options.onDropdownClick) !== null && _d !== void 0 ? _d : nothing}
398
+ >
399
+ <span
400
+ class="dropdown-label"
401
+ slot="dropdown-label"
402
+ data-title="${options.displayName.values}"
403
+ @click=${(_e = options.onLabelInteraction) !== null && _e !== void 0 ? _e : nothing}
404
404
  @keydown=${options.onLabelInteraction
405
405
  ? (e) => {
406
406
  var _a;
@@ -408,11 +408,11 @@ let SortFilterBar = class SortFilterBar extends LitElement {
408
408
  (_a = options.onLabelInteraction) === null || _a === void 0 ? void 0 : _a.call(options, e);
409
409
  }
410
410
  }
411
- : nothing}
412
- >
413
- ${options.displayName}
414
- </span>
415
- </ia-dropdown>
411
+ : nothing}
412
+ >
413
+ ${options.displayName}
414
+ </span>
415
+ </ia-dropdown>
416
416
  `;
417
417
  }
418
418
  /** Generates a single dropdown option object for the given sort field */
@@ -422,10 +422,10 @@ let SortFilterBar = class SortFilterBar extends LitElement {
422
422
  selectedHandler: () => {
423
423
  this.selectDropdownSortField(sortField);
424
424
  },
425
- label: html `
426
- <span class="dropdown-option-label">
427
- ${SORT_OPTIONS[sortField].displayName}
428
- </span>
425
+ label: html `
426
+ <span class="dropdown-option-label">
427
+ ${SORT_OPTIONS[sortField].displayName}
428
+ </span>
429
429
  `,
430
430
  };
431
431
  }
@@ -517,48 +517,48 @@ let SortFilterBar = class SortFilterBar extends LitElement {
517
517
  /** Template for rendering the three display mode options */
518
518
  /** Added data-testid for Playwright testing * */
519
519
  get displayOptionTemplate() {
520
- return html `
521
- <ul>
522
- <li>
523
- <button
524
- id="grid-button"
520
+ return html `
521
+ <ul>
522
+ <li>
523
+ <button
524
+ id="grid-button"
525
525
  @click=${() => {
526
526
  this.displayMode = 'grid';
527
- }}
528
- class=${this.displayMode === 'grid' ? 'active' : ''}
529
- title="Tile view"
530
- data-testid="grid-button"
531
- >
532
- ${tileIcon}
533
- </button>
534
- </li>
535
- <li>
536
- <button
537
- id="list-detail-button"
527
+ }}
528
+ class=${this.displayMode === 'grid' ? 'active' : ''}
529
+ title="Tile view"
530
+ data-testid="grid-button"
531
+ >
532
+ ${tileIcon}
533
+ </button>
534
+ </li>
535
+ <li>
536
+ <button
537
+ id="list-detail-button"
538
538
  @click=${() => {
539
539
  this.displayMode = 'list-detail';
540
- }}
541
- class=${this.displayMode === 'list-detail' ? 'active' : ''}
542
- title="List view"
543
- data-testid="list-detail-button"
544
- >
545
- ${listIcon}
546
- </button>
547
- </li>
548
- <li>
549
- <button
550
- id="list-compact-button"
540
+ }}
541
+ class=${this.displayMode === 'list-detail' ? 'active' : ''}
542
+ title="List view"
543
+ data-testid="list-detail-button"
544
+ >
545
+ ${listIcon}
546
+ </button>
547
+ </li>
548
+ <li>
549
+ <button
550
+ id="list-compact-button"
551
551
  @click=${() => {
552
552
  this.displayMode = 'list-compact';
553
- }}
554
- class=${this.displayMode === 'list-compact' ? 'active' : ''}
555
- title="Compact list view"
556
- data-testid="list-compact-button"
557
- >
558
- ${compactIcon}
559
- </button>
560
- </li>
561
- </ul>
553
+ }}
554
+ class=${this.displayMode === 'list-compact' ? 'active' : ''}
555
+ title="Compact list view"
556
+ data-testid="list-compact-button"
557
+ >
558
+ ${compactIcon}
559
+ </button>
560
+ </li>
561
+ </ul>
562
562
  `;
563
563
  }
564
564
  /**
@@ -566,12 +566,12 @@ let SortFilterBar = class SortFilterBar extends LitElement {
566
566
  * dropdown menu while it is open.
567
567
  */
568
568
  get dropdownBackdrop() {
569
- return html `
570
- <div
571
- id="sort-selector-backdrop"
572
- @keyup=${this.closeDropdowns}
573
- @click=${this.closeDropdowns}
574
- ></div>
569
+ return html `
570
+ <div
571
+ id="sort-selector-backdrop"
572
+ @keyup=${this.closeDropdowns}
573
+ @click=${this.closeDropdowns}
574
+ ></div>
575
575
  `;
576
576
  }
577
577
  /** Closes all of the sorting dropdown components' menus */
@@ -710,20 +710,20 @@ let SortFilterBar = class SortFilterBar extends LitElement {
710
710
  }
711
711
  get titleSelectorBar() {
712
712
  var _a;
713
- return html ` <alpha-bar
714
- .selectedLetter=${this.selectedTitleFilter}
715
- .letterCounts=${(_a = this.prefixFilterCountMap) === null || _a === void 0 ? void 0 : _a.title}
716
- ariaLandmarkLabel="Filter by title letter"
717
- @letterChanged=${this.titleLetterChanged}
713
+ return html ` <alpha-bar
714
+ .selectedLetter=${this.selectedTitleFilter}
715
+ .letterCounts=${(_a = this.prefixFilterCountMap) === null || _a === void 0 ? void 0 : _a.title}
716
+ ariaLandmarkLabel="Filter by title letter"
717
+ @letterChanged=${this.titleLetterChanged}
718
718
  ></alpha-bar>`;
719
719
  }
720
720
  get creatorSelectorBar() {
721
721
  var _a;
722
- return html ` <alpha-bar
723
- .selectedLetter=${this.selectedCreatorFilter}
724
- .letterCounts=${(_a = this.prefixFilterCountMap) === null || _a === void 0 ? void 0 : _a.creator}
725
- ariaLandmarkLabel="Filter by creator letter"
726
- @letterChanged=${this.creatorLetterChanged}
722
+ return html ` <alpha-bar
723
+ .selectedLetter=${this.selectedCreatorFilter}
724
+ .letterCounts=${(_a = this.prefixFilterCountMap) === null || _a === void 0 ? void 0 : _a.creator}
725
+ ariaLandmarkLabel="Filter by creator letter"
726
+ @letterChanged=${this.creatorLetterChanged}
727
727
  ></alpha-bar>`;
728
728
  }
729
729
  titleLetterChanged(e) {
@@ -766,236 +766,236 @@ let SortFilterBar = class SortFilterBar extends LitElement {
766
766
  static get styles() {
767
767
  return [
768
768
  srOnlyStyle,
769
- css `
770
- #container {
771
- position: relative;
772
- }
773
-
774
- #sort-bar {
775
- display: flex;
776
- justify-content: flex-start;
777
- align-items: center;
778
- border-bottom: 1px solid #2c2c2c;
779
- font-size: 1.4rem;
780
- }
781
-
782
- #sort-options {
783
- display: flex;
784
- align-items: center;
785
- flex-grow: 1;
786
- }
787
-
788
- ul {
789
- list-style: none;
790
- display: flex;
791
- align-items: center;
792
- margin: 0;
793
- padding: 0;
794
- }
795
-
796
- li {
797
- padding: 0;
798
- }
799
-
800
- .sort-by-text {
801
- margin-right: 5px;
802
- font-weight: bold;
803
- white-space: nowrap;
804
- }
805
-
806
- .sort-direction-container {
807
- display: flex;
808
- align-self: stretch;
809
- flex: 0;
810
- margin: 0 5px;
811
- }
812
-
813
- .sort-direction-selector {
814
- padding: 0;
815
- border: none;
816
- appearance: none;
817
- background: transparent;
818
- cursor: pointer;
819
- }
820
-
821
- .sort-direction-selector:disabled {
822
- cursor: default;
823
- }
824
-
825
- .sort-direction-icon {
826
- display: flex;
827
- align-items: center;
828
- background: none;
829
- color: inherit;
830
- border: none;
831
- padding: 0;
832
- outline: inherit;
833
- width: 14px;
834
- height: 14px;
835
- }
836
-
837
- .sort-direction-icon > svg {
838
- flex: 1;
839
- }
840
-
841
- #date-sort-selector,
842
- #view-sort-selector {
843
- position: absolute;
844
- left: 150px;
845
- top: 45px;
846
-
847
- z-index: 1;
848
- padding: 1rem;
849
- background-color: white;
850
- border-radius: 2.5rem;
851
- border: 1px solid #404142;
852
- }
853
-
854
- #sort-selector-container {
855
- flex: 1;
856
- display: flex;
857
- justify-content: flex-start;
858
- align-items: center;
859
- }
860
-
861
- #desktop-sort-container,
862
- #mobile-sort-container {
863
- display: flex;
864
- justify-content: flex-start;
865
- align-items: center;
866
- }
867
-
868
- /*
869
- we move the desktop sort selector offscreen instead of display: none
870
- because we need to observe the width of it vs its container to determine
871
- if it's wide enough to display the desktop version and if you display: none,
872
- the width becomes 0
873
- */
874
- #desktop-sort-container.hidden {
875
- position: absolute;
876
- top: -9999px;
877
- left: -9999px;
878
- visibility: hidden;
879
- }
880
-
881
- #mobile-sort-container.hidden {
882
- display: none;
883
- }
884
-
885
- #sort-selector-backdrop {
886
- position: fixed;
887
- top: 0;
888
- left: 0;
889
- width: 100vw;
890
- height: 100vh;
891
- z-index: 1;
892
- background-color: transparent;
893
- }
894
-
895
- #desktop-sort-selector {
896
- display: inline-flex;
897
- }
898
-
899
- #desktop-sort-selector li {
900
- display: flex;
901
- align-items: center;
902
- padding-left: 5px;
903
- padding-right: 5px;
904
- }
905
-
906
- #desktop-sort-selector li a {
907
- padding: 0 5px;
908
- text-decoration: none;
909
- color: #333;
910
- line-height: 2;
911
- }
912
-
913
- #desktop-sort-selector li button {
914
- padding: 0px 5px;
915
- border: none;
916
- background: none;
917
- font-family: inherit;
918
- font-size: inherit;
919
- color: #333;
920
- line-height: 2;
921
- cursor: pointer;
922
- appearance: none;
923
- }
924
-
925
- #desktop-sort-selector li button.selected {
926
- font-weight: bold;
927
- }
928
-
929
- /**
930
- * Fix to not shift the sort-bar options when get selected
931
- */
932
- #desktop-sort-selector li button::before,
933
- #desktop-sort-selector .dropdown-label::before {
934
- display: block;
935
- content: attr(data-title);
936
- font-weight: bold;
937
- height: 0;
938
- overflow: hidden;
939
- visibility: hidden;
940
- }
941
-
942
- #display-style-selector {
943
- flex: 0;
944
- }
945
-
946
- #display-style-selector button {
947
- background: none;
948
- color: inherit;
949
- border: none;
950
- appearance: none;
951
- cursor: pointer;
952
- -webkit-appearance: none;
953
- fill: #bbbbbb;
954
- }
955
-
956
- #display-style-selector button.active {
957
- fill: var(--ia-theme-primary-text-color, #2c2c2c);
958
- }
959
-
960
- #display-style-selector button svg {
961
- width: 24px;
962
- height: 24px;
963
- }
964
-
965
- ia-dropdown {
966
- --dropdownTextColor: white;
967
- --dropdownOffsetTop: 0;
968
- --dropdownBorderTopWidth: 0;
969
- --dropdownBorderTopLeftRadius: 0;
970
- --dropdownBorderTopRightRadius: 0;
971
- --dropdownWhiteSpace: nowrap;
972
- --dropdownListZIndex: 2;
973
- --dropdownCaretColor: var(--ia-theme-primary-text-color, #2c2c2c);
974
- --dropdownSelectedTextColor: white;
975
- --dropdownSelectedBgColor: rgba(255, 255, 255, 0.3);
976
- --dropdownHoverBgColor: rgba(255, 255, 255, 0.3);
977
- --caretHeight: 9px;
978
- --caretWidth: 12px;
979
- --caretPadding: 0 5px 0 0;
980
- }
981
- ia-dropdown.selected .dropdown-label {
982
- font-weight: bold;
983
- }
984
- ia-dropdown.open {
985
- z-index: 2;
986
- }
987
-
988
- .dropdown-label {
989
- display: inline-block;
990
- height: 100%;
991
- padding-left: 5px;
992
- font-size: 1.4rem;
993
- font-family: var(--ia-theme-base-font-family);
994
- line-height: 2;
995
- color: var(--ia-theme-primary-text-color, #2c2c2c);
996
- white-space: nowrap;
997
- user-select: none;
998
- }
769
+ css `
770
+ #container {
771
+ position: relative;
772
+ }
773
+
774
+ #sort-bar {
775
+ display: flex;
776
+ justify-content: flex-start;
777
+ align-items: center;
778
+ border-bottom: 1px solid #2c2c2c;
779
+ font-size: 1.4rem;
780
+ }
781
+
782
+ #sort-options {
783
+ display: flex;
784
+ align-items: center;
785
+ flex-grow: 1;
786
+ }
787
+
788
+ ul {
789
+ list-style: none;
790
+ display: flex;
791
+ align-items: center;
792
+ margin: 0;
793
+ padding: 0;
794
+ }
795
+
796
+ li {
797
+ padding: 0;
798
+ }
799
+
800
+ .sort-by-text {
801
+ margin-right: 5px;
802
+ font-weight: bold;
803
+ white-space: nowrap;
804
+ }
805
+
806
+ .sort-direction-container {
807
+ display: flex;
808
+ align-self: stretch;
809
+ flex: 0;
810
+ margin: 0 5px;
811
+ }
812
+
813
+ .sort-direction-selector {
814
+ padding: 0;
815
+ border: none;
816
+ appearance: none;
817
+ background: transparent;
818
+ cursor: pointer;
819
+ }
820
+
821
+ .sort-direction-selector:disabled {
822
+ cursor: default;
823
+ }
824
+
825
+ .sort-direction-icon {
826
+ display: flex;
827
+ align-items: center;
828
+ background: none;
829
+ color: inherit;
830
+ border: none;
831
+ padding: 0;
832
+ outline: inherit;
833
+ width: 14px;
834
+ height: 14px;
835
+ }
836
+
837
+ .sort-direction-icon > svg {
838
+ flex: 1;
839
+ }
840
+
841
+ #date-sort-selector,
842
+ #view-sort-selector {
843
+ position: absolute;
844
+ left: 150px;
845
+ top: 45px;
846
+
847
+ z-index: 1;
848
+ padding: 1rem;
849
+ background-color: white;
850
+ border-radius: 2.5rem;
851
+ border: 1px solid #404142;
852
+ }
853
+
854
+ #sort-selector-container {
855
+ flex: 1;
856
+ display: flex;
857
+ justify-content: flex-start;
858
+ align-items: center;
859
+ }
860
+
861
+ #desktop-sort-container,
862
+ #mobile-sort-container {
863
+ display: flex;
864
+ justify-content: flex-start;
865
+ align-items: center;
866
+ }
867
+
868
+ /*
869
+ we move the desktop sort selector offscreen instead of display: none
870
+ because we need to observe the width of it vs its container to determine
871
+ if it's wide enough to display the desktop version and if you display: none,
872
+ the width becomes 0
873
+ */
874
+ #desktop-sort-container.hidden {
875
+ position: absolute;
876
+ top: -9999px;
877
+ left: -9999px;
878
+ visibility: hidden;
879
+ }
880
+
881
+ #mobile-sort-container.hidden {
882
+ display: none;
883
+ }
884
+
885
+ #sort-selector-backdrop {
886
+ position: fixed;
887
+ top: 0;
888
+ left: 0;
889
+ width: 100vw;
890
+ height: 100vh;
891
+ z-index: 1;
892
+ background-color: transparent;
893
+ }
894
+
895
+ #desktop-sort-selector {
896
+ display: inline-flex;
897
+ }
898
+
899
+ #desktop-sort-selector li {
900
+ display: flex;
901
+ align-items: center;
902
+ padding-left: 5px;
903
+ padding-right: 5px;
904
+ }
905
+
906
+ #desktop-sort-selector li a {
907
+ padding: 0 5px;
908
+ text-decoration: none;
909
+ color: #333;
910
+ line-height: 2;
911
+ }
912
+
913
+ #desktop-sort-selector li button {
914
+ padding: 0px 5px;
915
+ border: none;
916
+ background: none;
917
+ font-family: inherit;
918
+ font-size: inherit;
919
+ color: #333;
920
+ line-height: 2;
921
+ cursor: pointer;
922
+ appearance: none;
923
+ }
924
+
925
+ #desktop-sort-selector li button.selected {
926
+ font-weight: bold;
927
+ }
928
+
929
+ /**
930
+ * Fix to not shift the sort-bar options when get selected
931
+ */
932
+ #desktop-sort-selector li button::before,
933
+ #desktop-sort-selector .dropdown-label::before {
934
+ display: block;
935
+ content: attr(data-title);
936
+ font-weight: bold;
937
+ height: 0;
938
+ overflow: hidden;
939
+ visibility: hidden;
940
+ }
941
+
942
+ #display-style-selector {
943
+ flex: 0;
944
+ }
945
+
946
+ #display-style-selector button {
947
+ background: none;
948
+ color: inherit;
949
+ border: none;
950
+ appearance: none;
951
+ cursor: pointer;
952
+ -webkit-appearance: none;
953
+ fill: #bbbbbb;
954
+ }
955
+
956
+ #display-style-selector button.active {
957
+ fill: var(--ia-theme-primary-text-color, #2c2c2c);
958
+ }
959
+
960
+ #display-style-selector button svg {
961
+ width: 24px;
962
+ height: 24px;
963
+ }
964
+
965
+ ia-dropdown {
966
+ --dropdownTextColor: white;
967
+ --dropdownOffsetTop: 0;
968
+ --dropdownBorderTopWidth: 0;
969
+ --dropdownBorderTopLeftRadius: 0;
970
+ --dropdownBorderTopRightRadius: 0;
971
+ --dropdownWhiteSpace: nowrap;
972
+ --dropdownListZIndex: 2;
973
+ --dropdownCaretColor: var(--ia-theme-primary-text-color, #2c2c2c);
974
+ --dropdownSelectedTextColor: white;
975
+ --dropdownSelectedBgColor: rgba(255, 255, 255, 0.3);
976
+ --dropdownHoverBgColor: rgba(255, 255, 255, 0.3);
977
+ --caretHeight: 9px;
978
+ --caretWidth: 12px;
979
+ --caretPadding: 0 5px 0 0;
980
+ }
981
+ ia-dropdown.selected .dropdown-label {
982
+ font-weight: bold;
983
+ }
984
+ ia-dropdown.open {
985
+ z-index: 2;
986
+ }
987
+
988
+ .dropdown-label {
989
+ display: inline-block;
990
+ height: 100%;
991
+ padding-left: 5px;
992
+ font-size: 1.4rem;
993
+ font-family: var(--ia-theme-base-font-family);
994
+ line-height: 2;
995
+ color: var(--ia-theme-primary-text-color, #2c2c2c);
996
+ white-space: nowrap;
997
+ user-select: none;
998
+ }
999
999
  `,
1000
1000
  ];
1001
1001
  }