@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/css/grid.css
CHANGED
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
.sgds-col-sm-6 { grid-column: span 6; }
|
|
35
35
|
.sgds-col-sm-7 { grid-column: span 7; }
|
|
36
36
|
.sgds-col-sm-8 { grid-column: span 8; }
|
|
37
|
-
.sgds-col-sm-none { display: none; }
|
|
38
37
|
.sgds-col-none { display: revert; }
|
|
38
|
+
.sgds-col-sm-none { display: none; }
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
@media (min-width: 1024px) { /* sgds-breakpoint-md */
|
|
@@ -59,8 +59,8 @@
|
|
|
59
59
|
.sgds-col-md-10 { grid-column: span 10; }
|
|
60
60
|
.sgds-col-md-11 { grid-column: span 11; }
|
|
61
61
|
.sgds-col-md-12 { grid-column: span 12; }
|
|
62
|
-
.sgds-col-md-none { display: none; }
|
|
63
62
|
.sgds-col-sm-none { display: revert; }
|
|
63
|
+
.sgds-col-md-none { display: none; }
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
@media (min-width: 1280px) { /* sgds-breakpoint-lg */
|
|
@@ -84,8 +84,8 @@
|
|
|
84
84
|
.sgds-col-lg-10 { grid-column: span 10; }
|
|
85
85
|
.sgds-col-lg-11 { grid-column: span 11; }
|
|
86
86
|
.sgds-col-lg-12 { grid-column: span 12; }
|
|
87
|
-
.sgds-col-lg-none { display: none; }
|
|
88
87
|
.sgds-col-md-none { display: revert; }
|
|
88
|
+
.sgds-col-lg-none { display: none; }
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
@media (min-width: 1440px) { /* sgds-breakpoint-xl */
|
|
@@ -105,6 +105,6 @@
|
|
|
105
105
|
.sgds-col-xl-10 { grid-column: span 10; }
|
|
106
106
|
.sgds-col-xl-11 { grid-column: span 11; }
|
|
107
107
|
.sgds-col-xl-12 { grid-column: span 12; }
|
|
108
|
-
.sgds-col-xl-none { display: none; }
|
|
109
108
|
.sgds-col-lg-none { display: revert; }
|
|
109
|
+
.sgds-col-xl-none { display: none; }
|
|
110
110
|
}
|
package/index.umd.js
CHANGED
|
@@ -10109,6 +10109,7 @@
|
|
|
10109
10109
|
/**
|
|
10110
10110
|
* @summary Cards can be used for headers and footers, a wide variety of content, contain contextual background colors and images.
|
|
10111
10111
|
* @slot image - Accepts an image or svg element of the card. Only a single element is allowed to be passed in.
|
|
10112
|
+
* @slot icon - Accepts an icon element to visually represent the card. Only a single element is allowed to be passed in.
|
|
10112
10113
|
* @slot subtitle - The subtitle of the card
|
|
10113
10114
|
* @slot title - The title of the card
|
|
10114
10115
|
* @slot description - The paragrapher text of the card
|
|
@@ -10125,7 +10126,7 @@
|
|
|
10125
10126
|
this.orientation = "vertical";
|
|
10126
10127
|
/** Sets the image position of the card. Available options: `before`, `after` */
|
|
10127
10128
|
this.imagePosition = "before";
|
|
10128
|
-
/**
|
|
10129
|
+
/** Controls how the image is sized and aligned within the card. Available options: `default`, `padding around`, `aspect ratio` */
|
|
10129
10130
|
this.imageAdjustment = "default";
|
|
10130
10131
|
}
|
|
10131
10132
|
firstUpdated() {
|
|
@@ -10156,7 +10157,7 @@
|
|
|
10156
10157
|
if (childNodes.length > 1) {
|
|
10157
10158
|
return console.error("Multiple elements passed into SgdsCard's link slot");
|
|
10158
10159
|
}
|
|
10159
|
-
if (this.stretchedLink) {
|
|
10160
|
+
if (this.stretchedLink && childNodes[0] instanceof HTMLAnchorElement) {
|
|
10160
10161
|
const hyperlink = childNodes[0].querySelector("a") || childNodes[0];
|
|
10161
10162
|
this.card.setAttribute("href", hyperlink.href);
|
|
10162
10163
|
const linkSlot = this.shadowRoot.querySelector("slot[name='link']");
|
|
@@ -22455,7 +22456,7 @@
|
|
|
22455
22456
|
_updateDescriptionLists() {
|
|
22456
22457
|
if (!this._descriptionLists)
|
|
22457
22458
|
return;
|
|
22458
|
-
this._descriptionLists.forEach(descriptionList => {
|
|
22459
|
+
this._descriptionLists.forEach((descriptionList, index) => {
|
|
22459
22460
|
if (this.stacked) {
|
|
22460
22461
|
descriptionList.setAttribute("stacked", "");
|
|
22461
22462
|
}
|
|
@@ -22468,6 +22469,9 @@
|
|
|
22468
22469
|
else {
|
|
22469
22470
|
descriptionList.removeAttribute("bordered");
|
|
22470
22471
|
}
|
|
22472
|
+
if (index === this._descriptionLists.length - 1) {
|
|
22473
|
+
descriptionList.setAttribute("isLastChild", "");
|
|
22474
|
+
}
|
|
22471
22475
|
});
|
|
22472
22476
|
}
|
|
22473
22477
|
updated(_changedProperties) {
|
|
@@ -22519,7 +22523,7 @@
|
|
|
22519
22523
|
queryAssignedElements({ flatten: true })
|
|
22520
22524
|
], SgdsDescriptionListGroup.prototype, "_descriptionLists", void 0);
|
|
22521
22525
|
|
|
22522
|
-
var css_248z$w = css`:host([bordered]) .container:last-child{border-bottom:none}:host([stacked]) .container{align-items:flex-start;flex-direction:column;gap:var(--sgds-gap-xs);justify-content:flex-start}.container{align-items:flex-start;border-bottom:var(--sgds-border-width-1) solid var(--sgds-border-color-muted);display:flex;gap:var(--sgds-gap-xs);justify-content:space-between;padding:var(--sgds-padding-lg) var(--sgds-padding-xl)}.data-container,.label-container{flex:1}.label{color:var(--sgds-color-default);font-weight:var(--sgds-font-weight-semibold)}.data,.label{font-size:var(--sgds-font-size-2)}.data{color:var(--sgds-color-subtle);font-weight:var(--sgds-font-weight-regular);margin:0}`;
|
|
22526
|
+
var css_248z$w = css`:host([bordered][islastchild]) .container:last-child{border-bottom:none}:host([stacked]) .container{align-items:flex-start;flex-direction:column;gap:var(--sgds-gap-xs);justify-content:flex-start}.container{align-items:flex-start;border-bottom:var(--sgds-border-width-1) solid var(--sgds-border-color-muted);display:flex;gap:var(--sgds-gap-xs);justify-content:space-between;padding:var(--sgds-padding-lg) var(--sgds-padding-xl)}.data-container,.label-container{flex:1}.label{color:var(--sgds-color-default);font-weight:var(--sgds-font-weight-semibold)}.data,.label{font-size:var(--sgds-font-size-2)}.data{color:var(--sgds-color-subtle);font-weight:var(--sgds-font-weight-regular);margin:0}`;
|
|
22523
22527
|
|
|
22524
22528
|
let id$2 = 0;
|
|
22525
22529
|
/**
|
|
@@ -24470,7 +24474,7 @@
|
|
|
24470
24474
|
register("sgds-mainnav-dropdown", SgdsMainnavDropdown);
|
|
24471
24475
|
register("sgds-mainnav-item", SgdsMainnavItem);
|
|
24472
24476
|
|
|
24473
|
-
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}}`;
|
|
24474
24478
|
|
|
24475
24479
|
var css_248z$l = css`svg{vertical-align:middle}`;
|
|
24476
24480
|
|
|
@@ -24484,6 +24488,13 @@
|
|
|
24484
24488
|
this.toggleVisibility = false;
|
|
24485
24489
|
}
|
|
24486
24490
|
/** @internal */
|
|
24491
|
+
_handleKeydown(event) {
|
|
24492
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
24493
|
+
event.preventDefault();
|
|
24494
|
+
this._toggleVisibility();
|
|
24495
|
+
}
|
|
24496
|
+
}
|
|
24497
|
+
/** @internal */
|
|
24487
24498
|
_toggleVisibility() {
|
|
24488
24499
|
this.toggleVisibility = !this.toggleVisibility;
|
|
24489
24500
|
}
|
|
@@ -24532,9 +24543,11 @@
|
|
|
24532
24543
|
class="sgds-masthead-button"
|
|
24533
24544
|
id="sgds-masthead-identify"
|
|
24534
24545
|
role="button"
|
|
24546
|
+
tabindex="0"
|
|
24535
24547
|
aria-expanded="${this.toggleVisibility}"
|
|
24536
24548
|
aria-controls="sgds-masthead-content"
|
|
24537
|
-
@
|
|
24549
|
+
@keydown=${this._handleKeydown}
|
|
24550
|
+
@click=${this._toggleVisibility}
|
|
24538
24551
|
>
|
|
24539
24552
|
<span>How to identify</span>
|
|
24540
24553
|
<svg
|