@internetarchive/collection-browser 2.18.3-alpha-webdev7768.0 → 2.18.3-alpha-webdev7768.1

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.
@@ -49,6 +49,8 @@ export class SmartFacetBar extends LitElement {
49
49
 
50
50
  @property({ type: Boolean }) filterToggleActive = false;
51
51
 
52
+ @property({ type: String }) label?: string;
53
+
52
54
  @state() private heuristicRecs: SmartFacet[] = [];
53
55
 
54
56
  @state() private smartFacets: SmartFacet[][] = [];
@@ -62,9 +64,13 @@ export class SmartFacetBar extends LitElement {
62
64
  render() {
63
65
  if (!this.query) return nothing;
64
66
 
67
+ const shouldShowLabel = !!this.label && this.smartFacets.length > 0;
65
68
  return html`
66
69
  <div id="smart-facets-container">
67
70
  ${this.filtersToggleTemplate}
71
+ ${shouldShowLabel
72
+ ? html`<p id="filters-label">${this.label}</p>`
73
+ : nothing}
68
74
  ${repeat(
69
75
  this.smartFacets,
70
76
  f =>
@@ -363,6 +369,12 @@ export class SmartFacetBar extends LitElement {
363
369
  #filters-toggle.active > svg {
364
370
  filter: invert(1);
365
371
  }
372
+
373
+ #filters-label {
374
+ font-size: 1.4rem;
375
+ font-weight: bold;
376
+ margin: 0 -5px 0 0;
377
+ }
366
378
  `;
367
379
  }
368
380
  }
@@ -31,13 +31,13 @@ export class SmartFacetDropdown extends LitElement {
31
31
  <ia-dropdown
32
32
  class="dropdown"
33
33
  displayCaret
34
- openViaButton
35
34
  closeOnSelect
36
35
  closeOnEscape
37
36
  closeOnBackdropClick
38
37
  includeSelectedOption
39
38
  .options=${this.dropdownOptions}
40
39
  .selectedOption=${this.activeDropdownOption}
40
+ .openViaButton=${false}
41
41
  @optionSelected=${this.optionSelected}
42
42
  @click=${this.onDropdownClick}
43
43
  >
@@ -1,129 +1,129 @@
1
- import { css } from 'lit';
2
- import { srOnlyStyle } from '../../../styles/sr-only';
3
-
4
- /**
5
- * Base tile styles
6
- */
7
-
8
- const tileBackgroundColor = css`var(--tileBackgroundColor, #ffffff)`;
9
- const tileCornerRadius = css`var(--tileCornerRadius, 4px)`;
10
-
11
- export const baseTileStyles = css`
12
- /* Include .sr-only styles for all tiles */
13
- ${srOnlyStyle}
14
-
15
- .container {
16
- background-color: ${tileBackgroundColor};
17
- border: 1px #2c2c2c;
18
- border-radius: ${tileCornerRadius};
19
- box-shadow: var(--tileBoxShadow, 1px 1px 2px 0);
20
- box-sizing: border-box;
21
- height: 100%;
22
- display: flex;
23
- flex-direction: column;
24
- width: 100%;
25
- }
26
-
27
- image-block {
28
- display: block;
29
- position: relative;
30
- text-align: center;
31
- }
32
-
33
- .tile-details {
34
- display: flex;
35
- flex-direction: column;
36
- height: 100%;
37
- row-gap: 10px;
38
- font-family: 'Helvetica Neue', ui-sans-serif, system-ui, sans-serif;
39
- }
40
-
41
- .item-info {
42
- display: flex;
43
- flex-direction: column;
44
- row-gap: 5px;
45
- flex-grow: 1;
46
- }
47
-
48
- #title {
49
- padding: 0 5px;
50
- }
51
-
52
- .created-by,
53
- .date-sorted-by,
54
- .volume-issue,
55
- .archivist-since {
56
- display: flex;
57
- justify-content: left;
58
- align-items: flex-start;
59
- padding: 0 5px;
60
- }
61
-
62
- .truncated {
63
- flex: 1;
64
- color: #2c2c2c;
65
- min-width: 0; /* Important for long words! */
66
- text-align: left;
67
- line-height: 15px;
68
- text-overflow: ellipsis;
69
- overflow: hidden;
70
- word-wrap: break-word;
71
- -webkit-line-clamp: 3;
72
- -webkit-box-orient: vertical;
73
- }
74
-
75
- h4.truncated {
76
- display: -webkit-box;
77
- margin: 0px;
78
- line-height: 15px;
79
- font-size: 14px;
80
- font-weight: 500;
81
- padding-bottom: 1px;
82
- }
83
-
84
- span {
85
- display: -webkit-box;
86
- font-size: 1.4rem;
87
- line-height: 15px;
88
- overflow: hidden;
89
- word-wrap: break-word;
90
- -webkit-line-clamp: 1;
91
- -webkit-box-orient: vertical;
92
- padding-bottom: 1px;
93
- }
94
-
95
- .container:hover > .tile-details > .item-info > #title > .truncated {
96
- text-decoration: underline;
97
- }
98
-
99
- /** this is a workaround for Safari 15 where the hover effects are not working */
100
- #title:hover > .truncated {
101
- text-decoration: underline;
102
- }
103
-
104
- .info-button {
105
- position: absolute;
106
- right: 10px;
107
- top: 10px;
108
- margin: 0;
109
- padding: 0;
110
- border: none;
111
- border-radius: 50%;
112
- display: flex;
113
- justify-content: center;
114
- align-items: center;
115
- background: rgba(220, 220, 220, 0.5);
116
- color: white;
117
- font-size: 2rem;
118
- font-weight: bold;
119
- line-height: 1;
120
- text-shadow: black 1px 1px 3px;
121
- overflow: visible;
122
- aspect-ratio: 1 / 1;
123
- z-index: 1;
124
- }
125
-
126
- .hidden {
127
- display: none;
128
- }
129
- `;
1
+ import { css } from 'lit';
2
+ import { srOnlyStyle } from '../../../styles/sr-only';
3
+
4
+ /**
5
+ * Base tile styles
6
+ */
7
+
8
+ const tileBackgroundColor = css`var(--tileBackgroundColor, #ffffff)`;
9
+ const tileCornerRadius = css`var(--tileCornerRadius, 4px)`;
10
+
11
+ export const baseTileStyles = css`
12
+ /* Include .sr-only styles for all tiles */
13
+ ${srOnlyStyle}
14
+
15
+ .container {
16
+ background-color: ${tileBackgroundColor};
17
+ border: 1px #2c2c2c;
18
+ border-radius: ${tileCornerRadius};
19
+ box-shadow: var(--tileBoxShadow, 1px 1px 2px 0);
20
+ box-sizing: border-box;
21
+ height: 100%;
22
+ display: flex;
23
+ flex-direction: column;
24
+ width: 100%;
25
+ }
26
+
27
+ image-block {
28
+ display: block;
29
+ position: relative;
30
+ text-align: center;
31
+ }
32
+
33
+ .tile-details {
34
+ display: flex;
35
+ flex-direction: column;
36
+ height: 100%;
37
+ row-gap: 10px;
38
+ font-family: 'Helvetica Neue', ui-sans-serif, system-ui, sans-serif;
39
+ }
40
+
41
+ .item-info {
42
+ display: flex;
43
+ flex-direction: column;
44
+ row-gap: 5px;
45
+ flex-grow: 1;
46
+ }
47
+
48
+ #title {
49
+ padding: 0 5px;
50
+ }
51
+
52
+ .created-by,
53
+ .date-sorted-by,
54
+ .volume-issue,
55
+ .archivist-since {
56
+ display: flex;
57
+ justify-content: left;
58
+ align-items: flex-start;
59
+ padding: 0 5px;
60
+ }
61
+
62
+ .truncated {
63
+ flex: 1;
64
+ color: #2c2c2c;
65
+ min-width: 0; /* Important for long words! */
66
+ text-align: left;
67
+ line-height: 15px;
68
+ text-overflow: ellipsis;
69
+ overflow: hidden;
70
+ word-wrap: break-word;
71
+ -webkit-line-clamp: 3;
72
+ -webkit-box-orient: vertical;
73
+ }
74
+
75
+ h4.truncated {
76
+ display: -webkit-box;
77
+ margin: 0px;
78
+ line-height: 15px;
79
+ font-size: 14px;
80
+ font-weight: 500;
81
+ padding-bottom: 1px;
82
+ }
83
+
84
+ span {
85
+ display: -webkit-box;
86
+ font-size: 1.4rem;
87
+ line-height: 15px;
88
+ overflow: hidden;
89
+ word-wrap: break-word;
90
+ -webkit-line-clamp: 1;
91
+ -webkit-box-orient: vertical;
92
+ padding-bottom: 1px;
93
+ }
94
+
95
+ .container:hover > .tile-details > .item-info > #title > .truncated {
96
+ text-decoration: underline;
97
+ }
98
+
99
+ /** this is a workaround for Safari 15 where the hover effects are not working */
100
+ #title:hover > .truncated {
101
+ text-decoration: underline;
102
+ }
103
+
104
+ .info-button {
105
+ position: absolute;
106
+ right: 10px;
107
+ top: 10px;
108
+ margin: 0;
109
+ padding: 0;
110
+ border: none;
111
+ border-radius: 50%;
112
+ display: flex;
113
+ justify-content: center;
114
+ align-items: center;
115
+ background: rgba(220, 220, 220, 0.5);
116
+ color: white;
117
+ font-size: 2rem;
118
+ font-weight: bold;
119
+ line-height: 1;
120
+ text-shadow: black 1px 1px 3px;
121
+ overflow: visible;
122
+ aspect-ratio: 1 / 1;
123
+ z-index: 1;
124
+ }
125
+
126
+ .hidden {
127
+ display: none;
128
+ }
129
+ `;