@govtechsg/sgds-web-component 3.0.3 → 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/Masthead/index.js +11 -2
- package/components/Card/index.umd.js +3 -2
- package/components/Card/index.umd.js.map +1 -1
- package/components/Card/sgds-card.d.ts +2 -1
- package/components/Card/sgds-card.js +3 -2
- package/components/Card/sgds-card.js.map +1 -1
- package/components/DescriptionList/description-list.js +1 -1
- package/components/DescriptionList/index.umd.js +5 -2
- package/components/DescriptionList/index.umd.js.map +1 -1
- package/components/DescriptionList/sgds-description-list-group.js +4 -1
- package/components/DescriptionList/sgds-description-list-group.js.map +1 -1
- package/components/Masthead/index.umd.js +11 -2
- package/components/Masthead/index.umd.js.map +1 -1
- package/components/Masthead/masthead.js +1 -1
- package/components/Masthead/sgds-masthead.d.ts +2 -0
- package/components/Masthead/sgds-masthead.js +10 -1
- package/components/Masthead/sgds-masthead.js.map +1 -1
- package/components/index.umd.js +19 -6
- package/components/index.umd.js.map +1 -1
- package/css/grid.css +4 -4
- package/index.umd.js +19 -6
- package/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/react/components/Card/sgds-card.cjs.js +3 -2
- package/react/components/Card/sgds-card.cjs.js.map +1 -1
- package/react/components/Card/sgds-card.js +3 -2
- package/react/components/Card/sgds-card.js.map +1 -1
- package/react/components/DescriptionList/description-list.cjs.js +1 -1
- package/react/components/DescriptionList/description-list.js +1 -1
- package/react/components/DescriptionList/sgds-description-list-group.cjs.js +4 -1
- package/react/components/DescriptionList/sgds-description-list-group.cjs.js.map +1 -1
- package/react/components/DescriptionList/sgds-description-list-group.js +4 -1
- package/react/components/DescriptionList/sgds-description-list-group.js.map +1 -1
- package/react/components/Masthead/masthead.cjs.js +1 -1
- package/react/components/Masthead/masthead.js +1 -1
- package/react/components/Masthead/sgds-masthead.cjs.js +10 -1
- package/react/components/Masthead/sgds-masthead.cjs.js.map +1 -1
- package/react/components/Masthead/sgds-masthead.js +10 -1
- package/react/components/Masthead/sgds-masthead.js.map +1 -1
package/Masthead/index.js
CHANGED
|
@@ -4162,7 +4162,7 @@
|
|
|
4162
4162
|
/** @internal */
|
|
4163
4163
|
SgdsElement.dependencies = {};
|
|
4164
4164
|
|
|
4165
|
-
var css_248z$2 = 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}}`;
|
|
4165
|
+
var css_248z$2 = 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}}`;
|
|
4166
4166
|
|
|
4167
4167
|
var css_248z$1 = css`svg{vertical-align:middle}`;
|
|
4168
4168
|
|
|
@@ -4178,6 +4178,13 @@
|
|
|
4178
4178
|
this.toggleVisibility = false;
|
|
4179
4179
|
}
|
|
4180
4180
|
/** @internal */
|
|
4181
|
+
_handleKeydown(event) {
|
|
4182
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
4183
|
+
event.preventDefault();
|
|
4184
|
+
this._toggleVisibility();
|
|
4185
|
+
}
|
|
4186
|
+
}
|
|
4187
|
+
/** @internal */
|
|
4181
4188
|
_toggleVisibility() {
|
|
4182
4189
|
this.toggleVisibility = !this.toggleVisibility;
|
|
4183
4190
|
}
|
|
@@ -4226,9 +4233,11 @@
|
|
|
4226
4233
|
class="sgds-masthead-button"
|
|
4227
4234
|
id="sgds-masthead-identify"
|
|
4228
4235
|
role="button"
|
|
4236
|
+
tabindex="0"
|
|
4229
4237
|
aria-expanded="${this.toggleVisibility}"
|
|
4230
4238
|
aria-controls="sgds-masthead-content"
|
|
4231
|
-
@
|
|
4239
|
+
@keydown=${this._handleKeydown}
|
|
4240
|
+
@click=${this._toggleVisibility}
|
|
4232
4241
|
>
|
|
4233
4242
|
<span>How to identify</span>
|
|
4234
4243
|
<svg
|
|
@@ -4594,6 +4594,7 @@
|
|
|
4594
4594
|
/**
|
|
4595
4595
|
* @summary Cards can be used for headers and footers, a wide variety of content, contain contextual background colors and images.
|
|
4596
4596
|
* @slot image - Accepts an image or svg element of the card. Only a single element is allowed to be passed in.
|
|
4597
|
+
* @slot icon - Accepts an icon element to visually represent the card. Only a single element is allowed to be passed in.
|
|
4597
4598
|
* @slot subtitle - The subtitle of the card
|
|
4598
4599
|
* @slot title - The title of the card
|
|
4599
4600
|
* @slot description - The paragrapher text of the card
|
|
@@ -4610,7 +4611,7 @@
|
|
|
4610
4611
|
this.orientation = "vertical";
|
|
4611
4612
|
/** Sets the image position of the card. Available options: `before`, `after` */
|
|
4612
4613
|
this.imagePosition = "before";
|
|
4613
|
-
/**
|
|
4614
|
+
/** Controls how the image is sized and aligned within the card. Available options: `default`, `padding around`, `aspect ratio` */
|
|
4614
4615
|
this.imageAdjustment = "default";
|
|
4615
4616
|
}
|
|
4616
4617
|
firstUpdated() {
|
|
@@ -4641,7 +4642,7 @@
|
|
|
4641
4642
|
if (childNodes.length > 1) {
|
|
4642
4643
|
return console.error("Multiple elements passed into SgdsCard's link slot");
|
|
4643
4644
|
}
|
|
4644
|
-
if (this.stretchedLink) {
|
|
4645
|
+
if (this.stretchedLink && childNodes[0] instanceof HTMLAnchorElement) {
|
|
4645
4646
|
const hyperlink = childNodes[0].querySelector("a") || childNodes[0];
|
|
4646
4647
|
this.card.setAttribute("href", hyperlink.href);
|
|
4647
4648
|
const linkSlot = this.shadowRoot.querySelector("slot[name='link']");
|