@ucd-lib/theme-elements 1.2.5 → 1.2.7

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ucd-lib/theme-elements",
3
- "version": "1.2.5",
3
+ "version": "1.2.7",
4
4
  "description": "Custom elements for the UCD brand theme",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -80,7 +80,7 @@ export default class UcdlibBrandingBar extends Mixin(LitElement)
80
80
  * @returns {TemplateResult}
81
81
  */
82
82
  _renderFigure(){
83
- if( this.figureUrl ) {
83
+ if( this.figure === 'custom' ) {
84
84
  return html`<img src="${this.figureUrl}" />`;
85
85
  }
86
86
  if ( this.figure === 'logo') return logo;
@@ -23,6 +23,10 @@ import {
23
23
  * <a href="#">LINK 2</a>
24
24
  * <a href="#">LINK 3</a>
25
25
  * </ucd-theme-primary-nav>
26
+ * <ucd-theme-search-popup>
27
+ * <ucd-theme-search-form>
28
+ * </ucd-theme-search-form>
29
+ * </ucd-theme-search-popup>
26
30
  * </ucdlib-header>
27
31
  *
28
32
  */
@@ -38,6 +42,7 @@ export default class UcdlibHeader extends LitElement {
38
42
  isDemo: {type: Boolean, attribute: "is-demo"},
39
43
  _transitioning: {type: Boolean, state: true},
40
44
  _hasPrimaryNav: {type: Boolean, state: true},
45
+ _hasQuickLinks: {type: Boolean, state: true},
41
46
  _hasSearch: {type: Boolean, state: true},
42
47
  _components: {type: Object, state: true}
43
48
  };
@@ -63,6 +68,7 @@ export default class UcdlibHeader extends LitElement {
63
68
 
64
69
  this._transitioning = false;
65
70
  this._hasPrimaryNav = false;
71
+ this._hasQuickLinks = false;
66
72
  this._hasSearch = false;
67
73
  this._animationDuration = 500;
68
74
  this._slottedComponents = {};
@@ -74,6 +80,9 @@ export default class UcdlibHeader extends LitElement {
74
80
  */
75
81
  _onLocationChange(){
76
82
  this.close();
83
+ if ( this._hasQuickLinks ){
84
+ this._slottedComponents.quickLinks.close();
85
+ }
77
86
  }
78
87
 
79
88
  /**
@@ -200,6 +209,15 @@ export default class UcdlibHeader extends LitElement {
200
209
  }
201
210
  this._hasPrimaryNav = false;
202
211
  }
212
+
213
+ let search = this.querySelector('ucd-theme-search-popup');
214
+ if ( search ) {
215
+ search.setAttribute('slot', 'search');
216
+ this._hasSearch = true;
217
+ this._slottedComponents.search = search;
218
+ } else {
219
+ this._hasSearch = false;
220
+ }
203
221
  }
204
222
 
205
223
  }
@@ -8,7 +8,7 @@ import headerLayoutStyles from "@ucd-lib/theme-sass/5_layout/_l-header.css.js"
8
8
  import brandingStyles from "@ucd-lib/theme-sass/4_component/_site-branding.css.js"
9
9
  import mobileBarStyles from "@ucd-lib/theme-sass/4_component/_mobile-bar.css.js";
10
10
  import navToggleStyles from "@ucd-lib/theme-sass/4_component/_nav-toggle.css.js"
11
- // import offCanvasStyles from "@ucd-lib/theme-sass/4_component/_nav-off-canvas.css.js"
11
+ import offCanvasStyles from "@ucd-lib/theme-sass/4_component/_nav-off-canvas.css.js"
12
12
 
13
13
  export function styles() {
14
14
  const elementStyles = css`
@@ -25,7 +25,7 @@ export function styles() {
25
25
  #nav-bar .ucd-logo {
26
26
  height: 1.25rem;
27
27
  position: relative;
28
- top: .95rem;
28
+ top: -10px;
29
29
  margin: 0 1rem;
30
30
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="16.157"><path fill="white" d="M58.865 4.877c.101.661 1.101 5.405 1.101 5.405h-2.194l1.093-5.405zm-8.328 11.03h5.806l.438-1.947h4.144l.554 1.947h5.806L61.846.403h-6.087l-5.222 15.504zM36.284.402h5.624c5.107 0 9.007 2.277 9.007 7.974 0 4.591-3.18 7.529-7.645 7.529l-6.986-.009V.402zm5.524 11.052h.376c1.843 0 3.207-1.072 3.207-3.096 0-2.179-1.21-3.395-3.234-3.395h-.349v6.491zM32.941.888l.296 2.545c.071.604.426 2.052-.011 1.858-.276-.121-.502-.776-.726-1.36-.114-.295-.658-1.695-.801-1.799-.685-.501-2.401-1.064-3.561-1.069-3.521-.013-5.847 2.509-5.847 6.982 0 3.208 1.582 7.061 5.607 7.061 1.441 0 4.201-.443 4.952-2.436.339-.9.65-1.703.876-1.459.166.177-.05.899-.15 1.289-.474 1.847-.501 2.406-.65 2.479-1.818.885-4.15 1.178-6.191 1.178-6.485 0-8.726-3.678-8.726-7.354 0-6.379 4.032-9.021 10.286-8.791 1.58.058 3.163.334 4.646.876M13.784 1.171L12.745.819c-.35-.306.075-.391.075-.391s1.5.271 5.24-.036c0 0 .328.062.103.319l-1.228.511c-.798.338-.798.143-.798.994l-.007 7.902c0 6.178-6.47 6.039-7.73 6.039-.6 0-6.488 0-6.488-4.961V2.834c0-1.46.159-1.419-.338-1.591L.071.695S-.183.347.269.368c1.227.06 3.004.316 7.133.024 0 0 .362.085.125.342l-1.201.339c-.95.414-.825.098-.849 1.045l.028 8.248c0 2.021 1.07 4.524 4.395 4.524 4.585 0 4.627-3.854 4.627-4.71l.009-8.167c.049-.77-.052-.551-.752-.842M87.65 14.715l1.6-4.111.281.23c.982.781 2.316 1.443 3.574 1.471 1.127.023 1.676-.268 1.527-1.191-.113-.693-.916-.812-1.417-.91l-1.103-.213c-2.143-.39-3.941-1.673-3.941-4.104 0-3.677 3.262-5.737 6.544-5.737 1.726 0 3.306.424 4.786 1.36L98.11 5.156c-.762-.533-1.918-1.285-3.377-1.337-.482-.018-1.58.229-1.229 1.312.152.462.833.657 1.252.755l1.241.292c2.325.526 4.003 1.81 4.003 4.432 0 3.699-3.281 5.529-6.542 5.529-1.901 0-4.106-.527-5.808-1.424M80.979.403h5.492v15.504h-5.492zM74.684.402h5.72l-5.843 15.503h-4.644L64.09.402h5.704l2.442 9.354z"/></svg>') no-repeat;
31
31
  width: 7.7rem;
@@ -40,16 +40,18 @@ export function styles() {
40
40
 
41
41
  .logo-container {
42
42
  display: flex;
43
+
44
+ }
45
+
46
+ .website-link-container {
47
+ padding-left: 0.5rem;
43
48
  background-color: #13639E;
44
- clip-path: polygon(1rem 0px, 110% 0px, 110% 102%, 0% 102%);
49
+ clip-path: polygon(1rem 0px, 110% 0px, 110% 104%, 0% 104%);
45
50
  }
46
51
 
47
- .logo-container::before {
48
- width: 1rem;
52
+ .website-link-container::before {
49
53
  margin-left: 0.5rem;
50
- background-color: #14447A;
51
54
  content: "";
52
- transform: skewX(-16deg);
53
55
  }
54
56
 
55
57
  .logo-link::before {
@@ -57,10 +59,18 @@ export function styles() {
57
59
  color: white;
58
60
  }
59
61
 
60
- .logo-container:hover {
62
+ .website-link-container:hover {
61
63
  background-color: #FFBF00;
64
+ }
62
65
 
66
+ .logo-border {
67
+ background-color: #14447A;
68
+ width: 1rem;
69
+ transform: skewX(-16deg);
70
+ position: relative;
71
+ left: 0.55rem;
63
72
  }
73
+
64
74
  .logo-link img {
65
75
  fill: #FFFFFF;
66
76
  }
@@ -92,7 +102,8 @@ export function styles() {
92
102
  brandingStyles,
93
103
  mobileBarStyles,
94
104
  navToggleStyles,
95
- elementStyles
105
+ offCanvasStyles,
106
+ elementStyles,
96
107
  ];
97
108
  }
98
109
 
@@ -211,6 +222,7 @@ ${this.isDemo ? html`
211
222
  }
212
223
  .menu--hidden .off-canvas__container {
213
224
  display: grid;
225
+ grid-template-areas: "nav quick search logo";
214
226
  }
215
227
  .l-nav-horizontal {
216
228
  display: grid;
@@ -268,10 +280,19 @@ ${this.isDemo ? html`
268
280
  <div>
269
281
  <slot name="primary-nav"></slot>
270
282
  </div>
283
+ ${this._hasSearch ? html`
284
+ <div class="l-nav-horizontal__search-popup">
285
+ <slot name="search"></slot>
286
+ </div>
287
+ ` : html``}
288
+
271
289
  <div class="logo-container">
272
- <a class="logo-link" href="https://www.ucdavis.edu/" aria-label="UC Davis main website link">
273
- <div class="ucd-logo"></div>
274
- </a>
290
+ <div ?hidden=${this._hasSearch} class="logo-border"></div>
291
+ <div class="website-link-container">
292
+ <a class="logo-link" href="https://www.ucdavis.edu/" aria-label="UC Davis main website link">
293
+ <div class="ucd-logo"></div>
294
+ </a>
295
+ </div>
275
296
  </div>
276
297
 
277
298
  </div>
@@ -140,7 +140,6 @@ return html`
140
140
  padding: 0 !important;
141
141
  border-bottom: 0 !important;
142
142
  background-color: transparent !important;
143
- font-weight: 700 !important;
144
143
  line-height: 3.25rem !important;
145
144
  }
146
145
  .primary-nav a:before, .primary-nav__nolink:before {