@govtechsg/sgds-web-component 3.23.0-rc.0 → 3.23.0-rc.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.
- package/base/card.js +1 -1
- package/components/Breadcrumb/index.umd.min.js +34 -33
- package/components/Breadcrumb/index.umd.min.js.map +1 -1
- package/components/Card/index.umd.min.js +1 -1
- package/components/Card/index.umd.min.js.map +1 -1
- package/components/Dropdown/index.umd.min.js +9 -3
- package/components/Dropdown/index.umd.min.js.map +1 -1
- package/components/Dropdown/sgds-dropdown-item.d.ts +2 -0
- package/components/Dropdown/sgds-dropdown-item.js +7 -0
- package/components/Dropdown/sgds-dropdown-item.js.map +1 -1
- package/components/IconCard/index.umd.min.js +1 -1
- package/components/IconCard/index.umd.min.js.map +1 -1
- package/components/ImageCard/index.umd.min.js +1 -1
- package/components/ImageCard/index.umd.min.js.map +1 -1
- package/components/Mainnav/index.umd.min.js +3 -2
- package/components/Mainnav/index.umd.min.js.map +1 -1
- package/components/OverflowMenu/index.umd.min.js +9 -3
- package/components/OverflowMenu/index.umd.min.js.map +1 -1
- package/components/ThumbnailCard/index.umd.min.js +1 -1
- package/components/ThumbnailCard/index.umd.min.js.map +1 -1
- package/components/index.umd.min.js +4 -3
- package/components/index.umd.min.js.map +1 -1
- package/css/fouc.css +2 -2
- package/custom-elements.json +1074 -1055
- package/index.umd.min.js +4 -3
- package/index.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/react/base/card.cjs.js +1 -1
- package/react/base/card.js +1 -1
- package/react/components/Dropdown/sgds-dropdown-item.cjs.js +7 -0
- package/react/components/Dropdown/sgds-dropdown-item.cjs.js.map +1 -1
- package/react/components/Dropdown/sgds-dropdown-item.js +7 -0
- package/react/components/Dropdown/sgds-dropdown-item.js.map +1 -1
- package/react/index.cjs.js +10 -10
- package/react/index.d.ts +2 -2
- package/react/index.js +2 -2
- package/types/react.d.ts +46 -44
|
@@ -77,7 +77,12 @@ function Le(e){return(t,l)=>{const{slot:i,selector:a}=e??{},o="slot"+(i?`[name=$
|
|
|
77
77
|
* Copyright 2018 Google LLC
|
|
78
78
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
79
79
|
*/
|
|
80
|
-
class extends Oe{constructor(e){if(super(e),e.type!==Ee||"class"!==e.name||e.strings?.length>2)throw new Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(e){return" "+Object.keys(e).filter(t=>e[t]).join(" ")+" "}update(e,[t]){if(void 0===this._previousClasses){this._previousClasses=new Set,void 0!==e.strings&&(this._staticClasses=new Set(e.strings.join(" ").split(/\s/).filter(e=>""!==e)));for(const e in t)t[e]&&!this._staticClasses?.has(e)&&this._previousClasses.add(e);return this.render(t)}const l=e.element.classList;for(const e of this._previousClasses)e in t||(l.remove(e),this._previousClasses.delete(e));for(const e in t){const i=!!t[e];i===this._previousClasses.has(e)||this._staticClasses?.has(e)||(i?(l.add(e),this._previousClasses.add(e)):(l.remove(e),this._previousClasses.delete(e)))}return te}});
|
|
80
|
+
class extends Oe{constructor(e){if(super(e),e.type!==Ee||"class"!==e.name||e.strings?.length>2)throw new Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(e){return" "+Object.keys(e).filter(t=>e[t]).join(" ")+" "}update(e,[t]){if(void 0===this._previousClasses){this._previousClasses=new Set,void 0!==e.strings&&(this._staticClasses=new Set(e.strings.join(" ").split(/\s/).filter(e=>""!==e)));for(const e in t)t[e]&&!this._staticClasses?.has(e)&&this._previousClasses.add(e);return this.render(t)}const l=e.element.classList;for(const e of this._previousClasses)e in t||(l.remove(e),this._previousClasses.delete(e));for(const e in t){const i=!!t[e];i===this._previousClasses.has(e)||this._staticClasses?.has(e)||(i?(l.add(e),this._previousClasses.add(e)):(l.remove(e),this._previousClasses.delete(e)))}return te}});
|
|
81
|
+
/**
|
|
82
|
+
* @license
|
|
83
|
+
* Copyright 2018 Google LLC
|
|
84
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
85
|
+
*/var Bl=Q`
|
|
81
86
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24">
|
|
82
87
|
<path
|
|
83
88
|
fill="currentColor"
|
|
@@ -2293,14 +2298,15 @@ class extends Oe{constructor(e){if(super(e),e.type!==Ee||"class"!==e.name||e.str
|
|
|
2293
2298
|
clip-rule="evenodd"
|
|
2294
2299
|
/>
|
|
2295
2300
|
</svg>
|
|
2296
|
-
`};var Wl=n`:host{color:inherit;display:inline-flex;vertical-align:bottom}:host(.icon-left){margin-right:.25rem}:host(.icon-right){margin-left:.25rem}:host([size=xs]) svg{height:var(--sgds-icon-size-xs);width:var(--sgds-icon-size-xs)}:host([size=sm]) svg{height:var(--sgds-icon-size-sm);width:var(--sgds-icon-size-sm)}:host([size=md]) svg{height:var(--sgds-icon-size-md);width:var(--sgds-icon-size-md)}:host([size=xl]) svg{height:var(--sgds-icon-size-xl);width:var(--sgds-icon-size-xl)}:host([size="2-xl"]) svg{height:var(--sgds-icon-size-2-xl);width:var(--sgds-icon-size-2-xl)}:host([size="3-xl"]) svg{height:var(--sgds-icon-size-3-xl);width:var(--sgds-icon-size-3-xl)}svg{display:inline-block;height:var(--sgds-icon-size-lg);width:var(--sgds-icon-size-lg)}`;class Fl extends Se{constructor(){super(...arguments),this.size="lg"}_getIconByName(e){if(!e)return;const t=Ul[e];if(t)return t;console.warn(`Icon not found: ${e}`)}updated(){var e;const t=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector("svg");t&&(this.ariaLabel?(t.removeAttribute("aria-hidden"),t.setAttribute("aria-label",this.ariaLabel)):(t.removeAttribute("aria-label"),t.setAttribute("aria-hidden","true")))}render(){const e=this._getIconByName(this.name);return e||le}}Fl.styles=[...Se.styles,Wl],e([He({type:String,reflect:!0})],Fl.prototype,"name",void 0),e([He({type:String,reflect:!0})],Fl.prototype,"size",void 0),e([He({type:String})],Fl.prototype,"ariaLabel",void 0);var ql,jl,Kl=n`:host([disabled]){cursor:not-allowed}.dropdown-item{align-items:center;background-color:var(--sgds-bg-transparent);clear:both;color:var(--sgds-color-default);cursor:pointer;display:flex;gap:var(--sgds-gap-sm);padding:var(--sgds-padding-sm) var(--sgds-padding-lg);text-align:inherit}.dropdown-item:hover{background-color:var(--sgds-bg-translucent-subtle)}.dropdown-item:focus,.dropdown-item:focus-visible{background-color:var(--sgds-bg-translucent-subtle)}.dropdown-item:focus-visible{outline:var(--sgds-outline-focus);outline-offset:var(--sgds-outline-offset-focus)}.dropdown-item.active{background-color:var(--sgds-bg-translucent-subtle);color:var(--sgds-primary-color-default);text-decoration:none}.dropdown-item.disabled,.dropdown-item:disabled{opacity:var(--sgds-opacity-40);pointer-events:none}::slotted(*){color:inherit!important;display:flex;gap:var(--sgds-gap-sm);text-decoration:none!important}::slotted(a),::slotted(sgds-checkbox){flex:1;margin:calc(var(--sgds-padding-sm)*-1) calc(var(--sgds-padding-lg)*-1);padding:var(--sgds-padding-sm) var(--sgds-padding-lg)}.dropdown-item.mainnav-dropdown-link{padding:var(--sgds-padding-none)}.dropdown-item.mainnav-dropdown-link ::slotted(*){box-sizing:border-box;margin:auto;max-width:var(--sgds-mainnav-max-width,1440px);padding:var(--sgds-padding-sm) var(--sgds-mainnav-mobile-padding-x)}@media screen and (min-width:1024px){.dropdown-item.mainnav-dropdown-link ::slotted(*){padding:var(--sgds-padding-sm) var(--sgds-mainnav-padding-x)}}`;class Jl extends Se{constructor(){super(...arguments),this.active=!1,this.disabled=!1}connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",e=>{"Enter"===e.key&&this.anchor.length>0&&this.anchor[0].click()}),this.setAttribute("role","menuitem"),this.setAttribute("aria-disabled",`${this.disabled}`)}render(){return Q`
|
|
2301
|
+
`};var Wl=n`:host{color:inherit;display:inline-flex;vertical-align:bottom}:host(.icon-left){margin-right:.25rem}:host(.icon-right){margin-left:.25rem}:host([size=xs]) svg{height:var(--sgds-icon-size-xs);width:var(--sgds-icon-size-xs)}:host([size=sm]) svg{height:var(--sgds-icon-size-sm);width:var(--sgds-icon-size-sm)}:host([size=md]) svg{height:var(--sgds-icon-size-md);width:var(--sgds-icon-size-md)}:host([size=xl]) svg{height:var(--sgds-icon-size-xl);width:var(--sgds-icon-size-xl)}:host([size="2-xl"]) svg{height:var(--sgds-icon-size-2-xl);width:var(--sgds-icon-size-2-xl)}:host([size="3-xl"]) svg{height:var(--sgds-icon-size-3-xl);width:var(--sgds-icon-size-3-xl)}svg{display:inline-block;height:var(--sgds-icon-size-lg);width:var(--sgds-icon-size-lg)}`;class Fl extends Se{constructor(){super(...arguments),this.size="lg"}_getIconByName(e){if(!e)return;const t=Ul[e];if(t)return t;console.warn(`Icon not found: ${e}`)}updated(){var e;const t=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector("svg");t&&(this.ariaLabel?(t.removeAttribute("aria-hidden"),t.setAttribute("aria-label",this.ariaLabel)):(t.removeAttribute("aria-label"),t.setAttribute("aria-hidden","true")))}render(){const e=this._getIconByName(this.name);return e||le}}Fl.styles=[...Se.styles,Wl],e([He({type:String,reflect:!0})],Fl.prototype,"name",void 0),e([He({type:String,reflect:!0})],Fl.prototype,"size",void 0),e([He({type:String})],Fl.prototype,"ariaLabel",void 0);var ql,jl,Kl=n`:host([disabled]){cursor:not-allowed}.dropdown-item{align-items:center;background-color:var(--sgds-bg-transparent);clear:both;color:var(--sgds-color-default);cursor:pointer;display:flex;gap:var(--sgds-gap-sm);padding:var(--sgds-padding-sm) var(--sgds-padding-lg);text-align:inherit}.dropdown-item:hover{background-color:var(--sgds-bg-translucent-subtle)}.dropdown-item:focus,.dropdown-item:focus-visible{background-color:var(--sgds-bg-translucent-subtle)}.dropdown-item:focus-visible{outline:var(--sgds-outline-focus);outline-offset:var(--sgds-outline-offset-focus)}.dropdown-item.active{background-color:var(--sgds-bg-translucent-subtle);color:var(--sgds-primary-color-default);text-decoration:none}.dropdown-item.disabled,.dropdown-item:disabled{opacity:var(--sgds-opacity-40);pointer-events:none}::slotted(*){color:inherit!important;display:flex;gap:var(--sgds-gap-sm);text-decoration:none!important}::slotted(a),::slotted(sgds-checkbox){flex:1;margin:calc(var(--sgds-padding-sm)*-1) calc(var(--sgds-padding-lg)*-1);padding:var(--sgds-padding-sm) var(--sgds-padding-lg)}.dropdown-item.mainnav-dropdown-link{padding:var(--sgds-padding-none)}.dropdown-item.mainnav-dropdown-link ::slotted(*){box-sizing:border-box;margin:auto;max-width:var(--sgds-mainnav-max-width,1440px);padding:var(--sgds-padding-sm) var(--sgds-mainnav-mobile-padding-x)}@media screen and (min-width:1024px){.dropdown-item.mainnav-dropdown-link ::slotted(*){padding:var(--sgds-padding-sm) var(--sgds-mainnav-padding-x)}}`;class Jl extends Se{constructor(){super(...arguments),this.active=!1,this.disabled=!1,this.ariaLabel=""}connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",e=>{"Enter"===e.key&&this.anchor.length>0&&this.anchor[0].click()}),this.setAttribute("role","menuitem"),this.setAttribute("aria-disabled",`${this.disabled}`)}render(){return Q`
|
|
2297
2302
|
<div
|
|
2298
2303
|
class="dropdown-item ${Hl({disabled:this.disabled,active:this.active})}"
|
|
2299
2304
|
tabindex=${this.disabled?"-1":"0"}
|
|
2305
|
+
aria-label=${e=this.ariaLabel||void 0,e??le}
|
|
2300
2306
|
>
|
|
2301
2307
|
<slot></slot>
|
|
2302
2308
|
</div>
|
|
2303
|
-
|
|
2309
|
+
`;var e}}Jl.styles=[_l,Kl],Jl.dependencies={"sgds-icon":Fl},e([Le({flatten:!0})],Jl.prototype,"anchor",void 0),e([He({type:Boolean})],Jl.prototype,"active",void 0),e([He({type:Boolean,reflect:!0})],Jl.prototype,"disabled",void 0),e([He({type:String})],Jl.prototype,"ariaLabel",void 0);class Yl extends Se{constructor(){super(...arguments),this.size="md"}render(){return Q`
|
|
2304
2310
|
<sgds-dropdown>
|
|
2305
2311
|
<button slot="toggler" class="overflow-btn" aria-label="More options">
|
|
2306
2312
|
<sgds-icon name="three-dots" size=${this.size}></sgds-icon>
|