@govtechsg/sgds-web-component 3.0.4 → 3.0.5

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/index.umd.js CHANGED
@@ -10126,7 +10126,7 @@
10126
10126
  this.orientation = "vertical";
10127
10127
  /** Sets the image position of the card. Available options: `before`, `after` */
10128
10128
  this.imagePosition = "before";
10129
- /** Sets the orientation of the card. Available options: `default`, `padding around`, `aspect ratio` */
10129
+ /** Controls how the image is sized and aligned within the card. Available options: `default`, `padding around`, `aspect ratio` */
10130
10130
  this.imageAdjustment = "default";
10131
10131
  }
10132
10132
  firstUpdated() {
@@ -10157,7 +10157,7 @@
10157
10157
  if (childNodes.length > 1) {
10158
10158
  return console.error("Multiple elements passed into SgdsCard's link slot");
10159
10159
  }
10160
- if (this.stretchedLink) {
10160
+ if (this.stretchedLink && childNodes[0] instanceof HTMLAnchorElement) {
10161
10161
  const hyperlink = childNodes[0].querySelector("a") || childNodes[0];
10162
10162
  this.card.setAttribute("href", hyperlink.href);
10163
10163
  const linkSlot = this.shadowRoot.querySelector("slot[name='link']");
@@ -24474,7 +24474,7 @@
24474
24474
  register("sgds-mainnav-dropdown", SgdsMainnavDropdown);
24475
24475
  register("sgds-mainnav-item", SgdsMainnavItem);
24476
24476
 
24477
- var css_248z$m = css`b{font-weight:bolder}[role=button]{cursor:pointer}a{color:#0049dc}a:hover{color:#0022b9}.sgds-masthead{font-family:Inter,system-ui,sans-serif;font-size:.875rem;line-height:1.25rem}.banner{background-color:light-dark(#f3f3f3,#1a1a1a)}.container{margin-left:auto;margin-right:auto;max-width:var(--sgds-mainnav-max-width);padding:.25rem var(--sgds-mainnav-padding-x);width:100%}.sg-crest{flex-shrink:0;height:20px;width:20px}.sg-crest path{fill:#db0000}.masthead-layout{display:flex;gap:.25rem}.masthead-text-layout{align-items:center;display:flex;flex-wrap:wrap;gap:0 .75rem}.sgds-masthead-identify-icon{align-self:center;display:block;height:20px;transform:rotate(180deg);transition:transform .3s ease-in-out 0s;user-select:none;width:20px}.sgds-masthead-identify-icon.show{transform:rotate(0deg)}.sgds-masthead-button{align-items:center;color:light-dark(#0269d0,#60aaf4);cursor:pointer;display:flex;gap:4px}.sgds-masthead-button:hover{color:light-dark(#0151a0,#96c7f7)}.panel{background-color:light-dark(oklch(from #0e0e0e l c h/.1),oklch(from #fff l c h/.1))}.sgds-masthead .sgds-masthead-content{display:none;padding-bottom:1rem;padding-top:1rem}.sgds-masthead .sgds-masthead-content.show{display:block}.content-grid{display:grid;gap:1.5rem;grid-template-columns:repeat(auto-fit,minmax(300px,1fr))}.icon{margin-top:-.1em}.wrapper{display:flex;gap:.5rem}.content{display:flex;flex-direction:column;gap:.25rem}.content .title{font-weight:600}.content article{color:light-dark(#525252,#a5a5a5)}.banner-icon,.banner-icon-inline{height:20px;width:20px}.banner-icon path,.banner-icon-inline path{fill:light-dark(#1a1a1a,#f3f3f3)}a.trusted-websites-link{color:light-dark(#0269d0,#60aaf4);text-decoration:underline;width:fit-content}a.trusted-websites-link:hover{color:light-dark(#0151a0,#96c7f7)}@media screen and (max-width:768px){.container{padding:.25rem var(--sgds-mainnav-mobile-padding-x)}.sgds-masthead-content .content-grid{gap:1rem;grid-template-columns:1fr}}`;
24477
+ var css_248z$m = css`b{font-weight:bolder}[role=button]{cursor:pointer}a{color:#0049dc}a:hover{color:#0022b9}.sgds-masthead{font-family:Inter,system-ui,sans-serif;font-size:.875rem;line-height:1.25rem}.banner{background-color:light-dark(#f3f3f3,#1a1a1a)}.container{margin-left:auto;margin-right:auto;max-width:var(--sgds-mainnav-max-width);padding:.25rem var(--sgds-mainnav-padding-x);width:100%}.sg-crest{flex-shrink:0;height:20px;width:20px}.sg-crest path{fill:#db0000}.masthead-layout{display:flex;gap:.25rem}.masthead-text-layout{align-items:center;display:flex;flex-wrap:wrap;gap:0 .75rem}.sgds-masthead-identify-icon{align-self:center;display:block;height:20px;transform:rotate(180deg);transition:transform .3s ease-in-out 0s;user-select:none;width:20px}.sgds-masthead-identify-icon.show{transform:rotate(0deg)}.sgds-masthead-button{align-items:center;color:light-dark(#0269d0,#60aaf4);cursor:pointer;display:flex;gap:4px}.sgds-masthead-button:hover{color:light-dark(#0151a0,#96c7f7)}.panel{background-color:light-dark(oklch(from #0e0e0e l c h/.1),oklch(from #fff l c h/.1))}.sgds-masthead .sgds-masthead-content{display:none;padding-bottom:1rem;padding-top:1rem}.sgds-masthead .sgds-masthead-content.show{display:block}.content-grid{display:grid;gap:1.5rem;grid-template-columns:repeat(auto-fit,minmax(300px,1fr))}.icon{margin-top:-.1em}.wrapper{display:flex;gap:.5rem}.content{display:flex;flex-direction:column;gap:.25rem}.content .title{font-weight:600}.content article{color:light-dark(#525252,#a5a5a5)}.banner-icon,.banner-icon-inline{height:20px;width:20px}.banner-icon path,.banner-icon-inline path{fill:light-dark(#1a1a1a,#f3f3f3)}a.trusted-websites-link{color:light-dark(#0269d0,#60aaf4);text-decoration:underline;width:fit-content}a.trusted-websites-link:hover{color:light-dark(#0151a0,#96c7f7)}.sgds-masthead-button:focus,.sgds-masthead-button:focus-visible,a.trusted-websites-link:focus,a.trusted-websites-link:focus-visible{box-shadow:0 0 0 4px #60aaf4;outline:0}@media screen and (max-width:768px){.container{padding:.25rem var(--sgds-mainnav-mobile-padding-x)}.sgds-masthead-content .content-grid{gap:1rem;grid-template-columns:1fr}}`;
24478
24478
 
24479
24479
  var css_248z$l = css`svg{vertical-align:middle}`;
24480
24480
 
@@ -24488,6 +24488,13 @@
24488
24488
  this.toggleVisibility = false;
24489
24489
  }
24490
24490
  /** @internal */
24491
+ _handleKeydown(event) {
24492
+ if (event.key === "Enter" || event.key === " ") {
24493
+ event.preventDefault();
24494
+ this._toggleVisibility();
24495
+ }
24496
+ }
24497
+ /** @internal */
24491
24498
  _toggleVisibility() {
24492
24499
  this.toggleVisibility = !this.toggleVisibility;
24493
24500
  }
@@ -24536,9 +24543,11 @@
24536
24543
  class="sgds-masthead-button"
24537
24544
  id="sgds-masthead-identify"
24538
24545
  role="button"
24546
+ tabindex="0"
24539
24547
  aria-expanded="${this.toggleVisibility}"
24540
24548
  aria-controls="sgds-masthead-content"
24541
- @click=${() => this._toggleVisibility()}
24549
+ @keydown=${this._handleKeydown}
24550
+ @click=${this._toggleVisibility}
24542
24551
  >
24543
24552
  <span>How to identify</span>
24544
24553
  <svg