@govtechsg/sgds-web-component 3.3.2 → 3.3.3-rc.0

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.
Files changed (134) hide show
  1. package/Masthead/index.js +2 -2
  2. package/base/card.js +1 -1
  3. package/base/sgds-element2.js +1 -1
  4. package/components/Accordion/index.umd.js +1 -1
  5. package/components/Alert/index.umd.js +2 -2
  6. package/components/Badge/index.umd.js +1 -1
  7. package/components/Breadcrumb/index.umd.js +36 -11
  8. package/components/Breadcrumb/index.umd.js.map +1 -1
  9. package/components/Button/button.js +1 -1
  10. package/components/Button/index.umd.js +61 -54
  11. package/components/Button/index.umd.js.map +1 -1
  12. package/components/Button/sgds-button.d.ts +1 -6
  13. package/components/Button/sgds-button.js +11 -27
  14. package/components/Button/sgds-button.js.map +1 -1
  15. package/components/Card/index.umd.js +3330 -3251
  16. package/components/Card/index.umd.js.map +1 -1
  17. package/components/Card/sgds-card.d.ts +1 -0
  18. package/components/Card/sgds-card.js +9 -3
  19. package/components/Card/sgds-card.js.map +1 -1
  20. package/components/Checkbox/index.umd.js +1 -1
  21. package/components/ComboBox/index.umd.js +2 -2
  22. package/components/Datepicker/index.umd.js +62 -29
  23. package/components/Datepicker/index.umd.js.map +1 -1
  24. package/components/DescriptionList/index.umd.js +1 -1
  25. package/components/Divider/index.umd.js +1 -1
  26. package/components/Drawer/index.umd.js +1 -1
  27. package/components/Dropdown/index.umd.js +2 -2
  28. package/components/FileUpload/index.umd.js +62 -29
  29. package/components/FileUpload/index.umd.js.map +1 -1
  30. package/components/Footer/footer-item.js +1 -1
  31. package/components/Footer/index.umd.js +89 -45
  32. package/components/Footer/index.umd.js.map +1 -1
  33. package/components/Footer/sgds-footer.d.ts +1 -1
  34. package/components/Footer/sgds-footer.js +39 -44
  35. package/components/Footer/sgds-footer.js.map +1 -1
  36. package/components/Icon/icon.js +1 -1
  37. package/components/Icon/index.umd.js +2 -2
  38. package/components/IconButton/index.umd.js +2 -2
  39. package/components/IconCard/index.umd.js +93 -14
  40. package/components/IconCard/index.umd.js.map +1 -1
  41. package/components/IconCard/sgds-icon-card.d.ts +1 -0
  42. package/components/IconCard/sgds-icon-card.js +8 -3
  43. package/components/IconCard/sgds-icon-card.js.map +1 -1
  44. package/components/IconList/index.umd.js +1 -1
  45. package/components/ImageCard/index.umd.js +93 -14
  46. package/components/ImageCard/index.umd.js.map +1 -1
  47. package/components/ImageCard/sgds-image-card.d.ts +1 -0
  48. package/components/ImageCard/sgds-image-card.js +8 -3
  49. package/components/ImageCard/sgds-image-card.js.map +1 -1
  50. package/components/Input/index.umd.js +2 -2
  51. package/components/Link/index.umd.js +35 -10
  52. package/components/Link/index.umd.js.map +1 -1
  53. package/components/Link/link.js +1 -1
  54. package/components/Link/sgds-link.d.ts +3 -0
  55. package/components/Link/sgds-link.js +33 -8
  56. package/components/Link/sgds-link.js.map +1 -1
  57. package/components/Mainnav/index.umd.js +2 -2
  58. package/components/Masthead/index.umd.js +2 -2
  59. package/components/Masthead/masthead.js +1 -1
  60. package/components/Modal/index.umd.js +1 -1
  61. package/components/OverflowMenu/index.umd.js +2 -2
  62. package/components/Pagination/index.umd.js +62 -29
  63. package/components/Pagination/index.umd.js.map +1 -1
  64. package/components/ProgressBar/index.umd.js +1 -1
  65. package/components/QuantityToggle/index.umd.js +2 -2
  66. package/components/Radio/index.umd.js +1 -1
  67. package/components/Select/index.umd.js +2 -2
  68. package/components/Sidenav/index.umd.js +2 -2
  69. package/components/Skeleton/index.umd.js +1 -1
  70. package/components/Spinner/index.umd.js +1 -1
  71. package/components/Stepper/index.umd.js +2 -2
  72. package/components/Subnav/index.umd.js +3 -3
  73. package/components/Subnav/subnav-item.js +1 -1
  74. package/components/Switch/index.umd.js +1 -1
  75. package/components/Tab/index.umd.js +1 -1
  76. package/components/Table/index.umd.js +1 -1
  77. package/components/TableOfContents/index.umd.js +1 -1
  78. package/components/Textarea/index.umd.js +1 -1
  79. package/components/ThumbnailCard/index.umd.js +93 -14
  80. package/components/ThumbnailCard/index.umd.js.map +1 -1
  81. package/components/ThumbnailCard/sgds-thumbnail-card.d.ts +1 -0
  82. package/components/ThumbnailCard/sgds-thumbnail-card.js +8 -3
  83. package/components/ThumbnailCard/sgds-thumbnail-card.js.map +1 -1
  84. package/components/Toast/index.umd.js +1 -1
  85. package/components/Tooltip/index.umd.js +1 -1
  86. package/components/index.umd.js +113 -95
  87. package/components/index.umd.js.map +1 -1
  88. package/index.umd.js +115 -97
  89. package/index.umd.js.map +1 -1
  90. package/package.json +1 -1
  91. package/react/base/card.cjs.js +1 -1
  92. package/react/base/card.js +1 -1
  93. package/react/base/sgds-element.cjs2.js +1 -1
  94. package/react/base/sgds-element2.js +1 -1
  95. package/react/components/Button/button.cjs.js +1 -1
  96. package/react/components/Button/button.js +1 -1
  97. package/react/components/Button/sgds-button.cjs.js +10 -26
  98. package/react/components/Button/sgds-button.cjs.js.map +1 -1
  99. package/react/components/Button/sgds-button.js +11 -27
  100. package/react/components/Button/sgds-button.js.map +1 -1
  101. package/react/components/Card/sgds-card.cjs.js +9 -3
  102. package/react/components/Card/sgds-card.cjs.js.map +1 -1
  103. package/react/components/Card/sgds-card.js +9 -3
  104. package/react/components/Card/sgds-card.js.map +1 -1
  105. package/react/components/Footer/footer-item.cjs.js +1 -1
  106. package/react/components/Footer/footer-item.js +1 -1
  107. package/react/components/Footer/sgds-footer.cjs.js +38 -43
  108. package/react/components/Footer/sgds-footer.cjs.js.map +1 -1
  109. package/react/components/Footer/sgds-footer.js +39 -44
  110. package/react/components/Footer/sgds-footer.js.map +1 -1
  111. package/react/components/Icon/icon.cjs.js +1 -1
  112. package/react/components/Icon/icon.js +1 -1
  113. package/react/components/IconCard/sgds-icon-card.cjs.js +8 -3
  114. package/react/components/IconCard/sgds-icon-card.cjs.js.map +1 -1
  115. package/react/components/IconCard/sgds-icon-card.js +8 -3
  116. package/react/components/IconCard/sgds-icon-card.js.map +1 -1
  117. package/react/components/ImageCard/sgds-image-card.cjs.js +8 -3
  118. package/react/components/ImageCard/sgds-image-card.cjs.js.map +1 -1
  119. package/react/components/ImageCard/sgds-image-card.js +8 -3
  120. package/react/components/ImageCard/sgds-image-card.js.map +1 -1
  121. package/react/components/Link/link.cjs.js +1 -1
  122. package/react/components/Link/link.js +1 -1
  123. package/react/components/Link/sgds-link.cjs.js +33 -8
  124. package/react/components/Link/sgds-link.cjs.js.map +1 -1
  125. package/react/components/Link/sgds-link.js +33 -8
  126. package/react/components/Link/sgds-link.js.map +1 -1
  127. package/react/components/Masthead/masthead.cjs.js +1 -1
  128. package/react/components/Masthead/masthead.js +1 -1
  129. package/react/components/Subnav/subnav-item.cjs.js +1 -1
  130. package/react/components/Subnav/subnav-item.js +1 -1
  131. package/react/components/ThumbnailCard/sgds-thumbnail-card.cjs.js +8 -3
  132. package/react/components/ThumbnailCard/sgds-thumbnail-card.cjs.js.map +1 -1
  133. package/react/components/ThumbnailCard/sgds-thumbnail-card.js +8 -3
  134. package/react/components/ThumbnailCard/sgds-thumbnail-card.js.map +1 -1
@@ -1,6 +1,6 @@
1
1
  import { css } from 'lit';
2
2
 
3
- var css_248z = css`.footer-item{margin-bottom:var(--sgds-margin-3-xs)}.footer-item,.links{display:flex;flex-direction:column;gap:var(--sgds-gap-xs)}slot[name=title]::slotted(*){--sgds-paragraph-spacing-xl:var(--sgds-margin-none);--sgds-font-weight-regular:var(--sgds-font-weight-semibold);color:var(--sgds-color-fixed-light);font-weight:var(--sgds-font-weight-regular,--sgds-font-weight-semibold);margin:var(--sgds-paragraph-spacing-xl,--sgds-margin-none)}.links{margin:0;padding:0}.links slot::slotted(a){--sgds-link-color-default:var(--sgds-color-fixed-light);color:var(--sgds-link-color-default,--sgds-fixed-light);text-decoration:none!important;width:fit-content}.links slot::slotted(a[target=_blank]){align-items:center;display:flex;gap:var(--sgds-gap-2-xs);justify-content:center}.links slot::slotted(a:focus),.links slot::slotted(a:focus-visible),slot::slotted(a:hover){--sgds-link-color-emphasis:var(--sgds-color-fixed-light);color:var(--sgds-link-color-emphasis,--sgds-color-fixed-light)}.links slot::slotted(a:focus),.links slot::slotted(a:focus-visible){outline:0}.links slot::slotted(a:focus-visible){box-shadow:var(--sgds-box-shadow-focus)}`;
3
+ var css_248z = css`.footer-item{margin-bottom:var(--sgds-margin-3-xs)}.footer-item,.links{display:flex;flex-direction:column;gap:var(--sgds-gap-xs)}slot[name=title]::slotted(*){--sgds-paragraph-spacing-xl:var(--sgds-margin-none);--sgds-font-weight-regular:var(--sgds-font-weight-semibold);color:var(--sgds-color-fixed-light);font-weight:var(--sgds-font-weight-regular,--sgds-font-weight-semibold);margin:var(--sgds-paragraph-spacing-xl,--sgds-margin-none)}.links{margin:0;padding:0}.links slot::slotted(a){--sgds-link-color-default:var(--sgds-color-fixed-light);color:var(--sgds-link-color-default,--sgds-fixed-light);text-decoration:none!important;width:fit-content}.links slot::slotted(a:focus),.links slot::slotted(a:focus-visible),slot::slotted(a:hover){--sgds-link-color-emphasis:var(--sgds-color-fixed-light);color:var(--sgds-link-color-emphasis,--sgds-color-fixed-light)}.links slot::slotted(a:focus),.links slot::slotted(a:focus-visible){outline:0}.links slot::slotted(a:focus-visible){box-shadow:var(--sgds-box-shadow-focus)}`;
4
4
 
5
5
  export { css_248z as default };
6
6
  //# sourceMappingURL=footer-item.js.map
@@ -4075,7 +4075,7 @@
4075
4075
  (globalThis.litIssuedWarnings ??= new Set());
4076
4076
  }
4077
4077
 
4078
- var css_248z$2 = css`:host{-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0);color:var(--sgds-body-color-default);font-family:var(--sgds-font-family-brand);font-size:var(--sgds-font-size-2);font-weight:var(--sgds-font-weight-regular);line-height:var(--sgds-line-height-body);margin:0;*,:after,:before{box-sizing:border-box}:disabled{cursor:not-allowed}@media (prefers-reduced-motion:no-preference){:root{scroll-behavior:smooth}}a[target=_blank]{align-items:center;display:flex;gap:var(--sgds-gap-2-xs)}::slotted(a[target=_blank]):after,a[target=_blank]:after{background-color:currentColor;content:"/";display:inline-block;-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M9.274 3.9H9.3a.6.6 0 0 1 0 1.2c-.85 0-1.451 0-1.922.039-.463.038-.745.11-.968.223A2.4 2.4 0 0 0 5.361 6.41c-.113.223-.184.505-.222.968-.039.47-.04 1.072-.04 1.922v5.4c0 .85.001 1.451.04 1.922.038.463.11.745.222.968a2.4 2.4 0 0 0 1.05 1.048c.222.114.504.185.967.223.47.038 1.072.039 1.922.039h5.4c.85 0 1.451 0 1.921-.039.464-.038.746-.11.969-.223a2.4 2.4 0 0 0 1.048-1.048c.113-.223.185-.505.223-.968.038-.47.039-1.072.039-1.922a.6.6 0 1 1 1.2 0v.026c0 .818 0 1.469-.043 1.993-.044.538-.136.996-.35 1.415a3.6 3.6 0 0 1-1.573 1.574c-.42.213-.878.305-1.415.35-.525.042-1.175.042-1.993.042H9.274c-.818 0-1.469 0-1.993-.043-.538-.044-.996-.136-1.415-.35a3.6 3.6 0 0 1-1.574-1.573c-.213-.42-.305-.877-.35-1.415-.042-.524-.042-1.175-.042-1.993V9.274c0-.818 0-1.468.043-1.993.044-.538.136-.996.35-1.415a3.6 3.6 0 0 1 1.573-1.574c.42-.213.877-.305 1.415-.35C7.805 3.9 8.456 3.9 9.274 3.9Zm3.626.6a.6.6 0 0 1 .6-.6h6a.6.6 0 0 1 .6.6v6a.6.6 0 1 1-1.2 0V5.949l-5.976 5.975a.6.6 0 0 1-.848-.848L18.05 5.1H13.5a.6.6 0 0 1-.6-.6Z' fill='%230E0E0E'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M9.274 3.9H9.3a.6.6 0 0 1 0 1.2c-.85 0-1.451 0-1.922.039-.463.038-.745.11-.968.223A2.4 2.4 0 0 0 5.361 6.41c-.113.223-.184.505-.222.968-.039.47-.04 1.072-.04 1.922v5.4c0 .85.001 1.451.04 1.922.038.463.11.745.222.968a2.4 2.4 0 0 0 1.05 1.048c.222.114.504.185.967.223.47.038 1.072.039 1.922.039h5.4c.85 0 1.451 0 1.921-.039.464-.038.746-.11.969-.223a2.4 2.4 0 0 0 1.048-1.048c.113-.223.185-.505.223-.968.038-.47.039-1.072.039-1.922a.6.6 0 1 1 1.2 0v.026c0 .818 0 1.469-.043 1.993-.044.538-.136.996-.35 1.415a3.6 3.6 0 0 1-1.573 1.574c-.42.213-.878.305-1.415.35-.525.042-1.175.042-1.993.042H9.274c-.818 0-1.469 0-1.993-.043-.538-.044-.996-.136-1.415-.35a3.6 3.6 0 0 1-1.574-1.573c-.213-.42-.305-.877-.35-1.415-.042-.524-.042-1.175-.042-1.993V9.274c0-.818 0-1.468.043-1.993.044-.538.136-.996.35-1.415a3.6 3.6 0 0 1 1.573-1.574c.42-.213.877-.305 1.415-.35C7.805 3.9 8.456 3.9 9.274 3.9Zm3.626.6a.6.6 0 0 1 .6-.6h6a.6.6 0 0 1 .6.6v6a.6.6 0 1 1-1.2 0V5.949l-5.976 5.975a.6.6 0 0 1-.848-.848L18.05 5.1H13.5a.6.6 0 0 1-.6-.6Z' fill='%230E0E0E'/%3E%3C/svg%3E");-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;padding:0 .45em}::slotted(svg){vertical-align:middle}}`;
4078
+ var css_248z$2 = css`:host{-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0);color:var(--sgds-body-color-default);font-family:var(--sgds-font-family-brand);font-size:var(--sgds-font-size-2);font-weight:var(--sgds-font-weight-regular);line-height:var(--sgds-line-height-body);margin:0;*,:after,:before{box-sizing:border-box}:disabled{cursor:not-allowed}@media (prefers-reduced-motion:no-preference){:root{scroll-behavior:smooth}}::slotted(a[target=_blank]):after,a[target=_blank]:after{background-color:currentColor;content:"/";display:inline-block;height:var(--sgds-icon-size-lg);margin-left:.25rem;-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M9.774 4.4H9.8a.6.6 0 1 1 0 1.2c-.85 0-1.451 0-1.922.039-.463.038-.745.11-.968.223A2.4 2.4 0 0 0 5.861 6.91c-.113.223-.184.505-.222.968-.039.47-.04 1.072-.04 1.922v4.4c0 .85.001 1.451.04 1.922.038.463.11.745.222.968a2.4 2.4 0 0 0 1.05 1.048c.222.114.504.185.967.223.47.038 1.072.039 1.922.039h4.4c.85 0 1.451 0 1.921-.039.464-.038.746-.11.969-.223a2.4 2.4 0 0 0 1.048-1.048c.113-.223.185-.505.223-.968.038-.47.039-1.072.039-1.922a.6.6 0 1 1 1.2 0v.026c0 .818 0 1.468-.043 1.993-.044.538-.136.996-.35 1.415a3.6 3.6 0 0 1-1.573 1.574c-.42.213-.878.305-1.415.35-.525.042-1.175.042-1.993.042H9.774c-.818 0-1.469 0-1.993-.043-.538-.044-.996-.136-1.415-.35a3.6 3.6 0 0 1-1.574-1.573c-.213-.42-.305-.877-.35-1.415-.042-.525-.042-1.175-.042-1.993V9.774c0-.818 0-1.468.043-1.993.044-.538.136-.996.35-1.415a3.6 3.6 0 0 1 1.573-1.574c.42-.213.877-.305 1.415-.35C8.305 4.4 8.956 4.4 9.774 4.4ZM12.4 5a.6.6 0 0 1 .6-.6h6a.6.6 0 0 1 .6.6v6a.6.6 0 1 1-1.2 0V6.449l-5.976 5.975a.6.6 0 0 1-.848-.848L17.55 5.6H13a.6.6 0 0 1-.6-.6Z' fill='%230E0E0E'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M9.774 4.4H9.8a.6.6 0 1 1 0 1.2c-.85 0-1.451 0-1.922.039-.463.038-.745.11-.968.223A2.4 2.4 0 0 0 5.861 6.91c-.113.223-.184.505-.222.968-.039.47-.04 1.072-.04 1.922v4.4c0 .85.001 1.451.04 1.922.038.463.11.745.222.968a2.4 2.4 0 0 0 1.05 1.048c.222.114.504.185.967.223.47.038 1.072.039 1.922.039h4.4c.85 0 1.451 0 1.921-.039.464-.038.746-.11.969-.223a2.4 2.4 0 0 0 1.048-1.048c.113-.223.185-.505.223-.968.038-.47.039-1.072.039-1.922a.6.6 0 1 1 1.2 0v.026c0 .818 0 1.468-.043 1.993-.044.538-.136.996-.35 1.415a3.6 3.6 0 0 1-1.573 1.574c-.42.213-.878.305-1.415.35-.525.042-1.175.042-1.993.042H9.774c-.818 0-1.469 0-1.993-.043-.538-.044-.996-.136-1.415-.35a3.6 3.6 0 0 1-1.574-1.573c-.213-.42-.305-.877-.35-1.415-.042-.525-.042-1.175-.042-1.993V9.774c0-.818 0-1.468.043-1.993.044-.538.136-.996.35-1.415a3.6 3.6 0 0 1 1.573-1.574c.42-.213.877-.305 1.415-.35C8.305 4.4 8.956 4.4 9.774 4.4ZM12.4 5a.6.6 0 0 1 .6-.6h6a.6.6 0 0 1 .6.6v6a.6.6 0 1 1-1.2 0V6.449l-5.976 5.975a.6.6 0 0 1-.848-.848L17.55 5.6H13a.6.6 0 0 1-.6-.6Z' fill='%230E0E0E'/%3E%3C/svg%3E");-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;vertical-align:bottom;width:var(--sgds-icon-size-lg)}::slotted(svg){vertical-align:middle}}`;
4079
4079
 
4080
4080
  /**
4081
4081
  * @cssprop --sgds-{stateColor} - State colors in hexadecimal value
@@ -4136,6 +4136,56 @@
4136
4136
  /** @internal */
4137
4137
  SgdsElement.dependencies = {};
4138
4138
 
4139
+ class HasSlotController {
4140
+ constructor(host, ...slotNames) {
4141
+ this.slotNames = [];
4142
+ (this.host = host).addController(this);
4143
+ this.slotNames = slotNames;
4144
+ this.handleSlotChange = this.handleSlotChange.bind(this);
4145
+ }
4146
+ hasDefaultSlot() {
4147
+ return [...this.host.childNodes].some(node => {
4148
+ var _a;
4149
+ if (node.nodeType === node.TEXT_NODE && ((_a = node.textContent) === null || _a === void 0 ? void 0 : _a.trim()) !== "") {
4150
+ return true;
4151
+ }
4152
+ if (node.nodeType === node.ELEMENT_NODE) {
4153
+ const el = node;
4154
+ const tagName = el.tagName.toLowerCase();
4155
+ // Ignore visually hidden elements since they aren't rendered
4156
+ if (tagName === "sl-visually-hidden") {
4157
+ return false;
4158
+ }
4159
+ // If it doesn't have a slot attribute, it's part of the default slot
4160
+ if (!el.hasAttribute("slot")) {
4161
+ return true;
4162
+ }
4163
+ }
4164
+ return false;
4165
+ });
4166
+ }
4167
+ hasNamedSlot(name) {
4168
+ return this.host.querySelector(`:scope > [slot="${name}"]`) !== null;
4169
+ }
4170
+ test(slotName) {
4171
+ return slotName === "[default]" ? this.hasDefaultSlot() : this.hasNamedSlot(slotName);
4172
+ }
4173
+ hostConnected() {
4174
+ var _a;
4175
+ (_a = this.host.shadowRoot) === null || _a === void 0 ? void 0 : _a.addEventListener("slotchange", this.handleSlotChange);
4176
+ }
4177
+ hostDisconnected() {
4178
+ var _a;
4179
+ (_a = this.host.shadowRoot) === null || _a === void 0 ? void 0 : _a.removeEventListener("slotchange", this.handleSlotChange);
4180
+ }
4181
+ handleSlotChange(event) {
4182
+ const slot = event.target;
4183
+ if ((this.slotNames.includes("[default]") && !slot.name) || (slot.name && this.slotNames.includes(slot.name))) {
4184
+ this.host.requestUpdate();
4185
+ }
4186
+ }
4187
+ }
4188
+
4139
4189
  var css_248z$1 = css`.footer{container:footer/inline-size;height:auto}.footer-top{background-color:var(--sgds-bg-fixed-dark);border-bottom:var(--sgds-border-width-1) solid var(--sgds-border-color-default);gap:var(--sgds-gap-md);padding:var(--sgds-padding-xl) var(--sgds-padding-2-xl)}.footer-header,.footer-top{display:flex;flex-direction:column}.footer-header{gap:var(--sgds-gap-xs);margin:var(--sgds-margin-3-xs) 0}slot[name=title]::slotted(*){--sgds-header-color-default:var(--sgds-color-fixed-light);--sgds-font-size-6:var(--sgds-font-size-5);--sgds-margin-2-xs:var(--sgds-margin-none);color:var(--sgds-header-color-default,--sgds-color-fixed-light);font-size:var(--sgds-font-size-6,--sgds-font-size-5);font-weight:var(--sgds-font-weight-bold);letter-spacing:var(--sgds-letter-spacing-tight);line-height:var(--sgds-line-height-heading);margin-bottom:var(--sgds-margin-2-xs,--sgds-margin-none);margin-top:var(--sgds-margin-none)}slot[name=description]::slotted(*){--sgds-font-size-2:var(--sgds-font-size-3);--sgds-paragraph-spacing-xl:var(--sgds-margin-none);color:var(--sgds-color-fixed-light);font-size:var(--sgds-font-size-2,--sgds-font-size-3);margin-bottom:var(--sgds-paragraph-spacing-xl,--sgds-margin-none);margin-top:var(--sgds-margin-none)}.footer-items{display:grid;gap:var(--sgds-gap-md) var(--sgds-gap-lg);grid-template-columns:repeat(auto-fit,minmax(240px,1fr))}.footer ul{margin:0;padding:0}.footer ul li{list-style-type:none}.footer-mandatory-links ul li a{text-decoration:none}.footer-mandatory-links ul li a,.footer-mandatory-links ul li a:focus,.footer-mandatory-links ul li a:hover{color:var(--sgds-color-fixed-light)}.footer-mandatory-links ul li a:focus,.footer-mandatory-links ul li a:focus-visible{outline:0}.footer-mandatory-links ul li a:focus-visible{box-shadow:var(--sgds-box-shadow-focus)}.footer-bottom{background-color:var(--sgds-bg-fixed-dark);display:flex;flex-direction:column;gap:var(--sgds-gap-md);padding:var(--sgds-padding-xl) var(--sgds-padding-2-xl)}.social-media{display:flex;gap:var(--sgds-gap-sm)}slot[name=social-media]::slotted(a){--sgds-link-color-default:var(--sgds-color-fixed-light);--sgds-body-color-default:var(--sgds-color-fixed-light);color:var(--sgds-body-color-default,--sgds-link-color-default);display:inline-flex}slot[name=social-media]::slotted(a:hover){--sgds-link-color-emphasis:var(--sgds-color-fixed-light);color:var(--sgds-link-color-emphasis)}slot[name=social-media]::slotted(a:focus),slot[name=social-media]::slotted(a:focus-visible){--sgds-link-color-emphasis:var(--sgds-color-fixed-light);color:var(--sgds-link-color-emphasis);outline:0}slot[name=social-media]::slotted(a:focus-visible){box-shadow:var(--sgds-box-shadow-focus)}.footer-mandatory-links{display:flex;flex-wrap:wrap;gap:var(--sgds-gap-xl) var(--sgds-gap-lg);justify-content:space-between}.footer-mandatory-links ul{display:flex;flex-wrap:wrap;gap:var(--sgds-gap-xs) var(--sgds-gap-xl)}.footer-copyrights{color:var(--sgds-color-fixed-light)}@container footer (max-width: 711px){.footer-bottom,.footer-top{padding:var(--sgds-padding-lg)}.footer-top{gap:var(--sgds-gap-lg)}.footer-mandatory-links,.footer-mandatory-links ul{flex-direction:column}}`;
4140
4190
 
4141
4191
  /**
@@ -4174,60 +4224,54 @@
4174
4224
  * href link for terms of use
4175
4225
  */
4176
4226
  this.termsOfUseHref = "#";
4177
- }
4178
- firstUpdated() {
4179
- const socialMediaSlot = this.shadowRoot.querySelector("slot[name='social-media']");
4180
- const footerTitleSlot = this.shadowRoot.querySelector("slot[name='title']");
4181
- const footerDescriptionSlot = this.shadowRoot.querySelector("slot[name='description']");
4182
- const footerItemsSlot = this.shadowRoot.querySelector("slot[name='items']");
4183
- const socialMediaChildNodes = socialMediaSlot.assignedNodes({ flatten: true });
4184
- const footerTitleChildNodes = footerTitleSlot.assignedNodes({ flatten: true });
4185
- const footerDescriptionChildNodes = footerDescriptionSlot.assignedNodes({ flatten: true });
4186
- const footerItemsChildNodes = footerItemsSlot.assignedNodes({ flatten: true });
4187
- if (socialMediaChildNodes.length === 0) {
4188
- const socialMediaContainer = this.shadowRoot.querySelector(".social-media");
4189
- socialMediaContainer.style.display = "none";
4190
- }
4191
- if (footerTitleChildNodes.length === 0 && footerDescriptionChildNodes.length === 0) {
4192
- const footerHeaderContainer = this.shadowRoot.querySelector(".footer-header");
4193
- footerHeaderContainer.style.display = "none";
4194
- }
4195
- if (footerItemsChildNodes.length === 0) {
4196
- const footerItemsContainer = this.shadowRoot.querySelector(".footer-items");
4197
- footerItemsContainer.style.display = "none";
4198
- }
4199
- if (footerTitleChildNodes.length === 0 &&
4200
- footerDescriptionChildNodes.length === 0 &&
4201
- footerItemsChildNodes.length === 0) {
4202
- const footerTopContainer = this.shadowRoot.querySelector(".footer-top");
4203
- footerTopContainer.style.display = "none";
4204
- }
4227
+ this.hasSlotController = new HasSlotController(this, "social-media", "title", "description", "items");
4205
4228
  }
4206
4229
  render() {
4230
+ const hasSocialMediaSlot = this.hasSlotController.test("social-media");
4231
+ const hasTitleSlot = this.hasSlotController.test("title");
4232
+ const hasDescriptionSlot = this.hasSlotController.test("description");
4233
+ const hasItemsSlot = this.hasSlotController.test("items");
4234
+ const displayFooterHeader = hasTitleSlot || hasDescriptionSlot;
4235
+ const displayFooterItems = hasItemsSlot;
4236
+ const displaySocialMedia = hasSocialMediaSlot;
4237
+ const displayFooterTop = displayFooterHeader || displayFooterItems;
4207
4238
  return html `
4208
4239
  <footer class="footer">
4209
- <section class="footer-top">
4210
- <div class="footer-header">
4211
- <slot name="title"></slot>
4212
- <slot name="description"></slot>
4213
- </div>
4214
- <div class="footer-items">
4215
- <slot name="items"></slot>
4216
- </div>
4217
- </section>
4240
+ ${displayFooterTop
4241
+ ? html ` <section class="footer-top">
4242
+ ${displayFooterHeader
4243
+ ? html `
4244
+ <div class="footer-header">
4245
+ <slot name="title"></slot>
4246
+ <slot name="description"></slot>
4247
+ </div>
4248
+ `
4249
+ : nothing}
4250
+ ${displayFooterItems
4251
+ ? html ` <div class="footer-items">
4252
+ <slot name="items"></slot>
4253
+ </div>`
4254
+ : nothing}
4255
+ </section>`
4256
+ : nothing}
4257
+
4218
4258
  <section class="footer-bottom">
4219
- <div class="social-media">
4220
- <slot name="social-media"></slot>
4221
- </div>
4259
+ ${displaySocialMedia
4260
+ ? html `
4261
+ <div class="social-media">
4262
+ <slot name="social-media"></slot>
4263
+ </div>
4264
+ `
4265
+ : nothing}
4222
4266
  <div class="footer-mandatory-links">
4223
4267
  <ul>
4224
4268
  <li><a href=${this.contactHref}>Contact</a></li>
4225
4269
  <li><a href=${this.feedbackHref}>Feedback</a></li>
4226
4270
  <li><a href=${this.faqHref}>FAQ</a></li>
4227
4271
  <li>
4228
- <a href="https://tech.gov.sg/report_vulnerability" target="_blank" rel="noopener noreferrer">
4229
- Report Vulnerability
4230
- </a>
4272
+ <a href="https://tech.gov.sg/report_vulnerability" target="_blank" rel="noopener noreferrer"
4273
+ >Report Vulnerability</a
4274
+ >
4231
4275
  </li>
4232
4276
  <li><a href=${this.privacyHref}>Privacy Statement</a></li>
4233
4277
  <li><a href=${this.termsOfUseHref}>Terms of use</a></li>
@@ -4259,7 +4303,7 @@
4259
4303
  property({ type: String })
4260
4304
  ], SgdsFooter.prototype, "termsOfUseHref", void 0);
4261
4305
 
4262
- var css_248z = css`.footer-item{margin-bottom:var(--sgds-margin-3-xs)}.footer-item,.links{display:flex;flex-direction:column;gap:var(--sgds-gap-xs)}slot[name=title]::slotted(*){--sgds-paragraph-spacing-xl:var(--sgds-margin-none);--sgds-font-weight-regular:var(--sgds-font-weight-semibold);color:var(--sgds-color-fixed-light);font-weight:var(--sgds-font-weight-regular,--sgds-font-weight-semibold);margin:var(--sgds-paragraph-spacing-xl,--sgds-margin-none)}.links{margin:0;padding:0}.links slot::slotted(a){--sgds-link-color-default:var(--sgds-color-fixed-light);color:var(--sgds-link-color-default,--sgds-fixed-light);text-decoration:none!important;width:fit-content}.links slot::slotted(a[target=_blank]){align-items:center;display:flex;gap:var(--sgds-gap-2-xs);justify-content:center}.links slot::slotted(a:focus),.links slot::slotted(a:focus-visible),slot::slotted(a:hover){--sgds-link-color-emphasis:var(--sgds-color-fixed-light);color:var(--sgds-link-color-emphasis,--sgds-color-fixed-light)}.links slot::slotted(a:focus),.links slot::slotted(a:focus-visible){outline:0}.links slot::slotted(a:focus-visible){box-shadow:var(--sgds-box-shadow-focus)}`;
4306
+ var css_248z = css`.footer-item{margin-bottom:var(--sgds-margin-3-xs)}.footer-item,.links{display:flex;flex-direction:column;gap:var(--sgds-gap-xs)}slot[name=title]::slotted(*){--sgds-paragraph-spacing-xl:var(--sgds-margin-none);--sgds-font-weight-regular:var(--sgds-font-weight-semibold);color:var(--sgds-color-fixed-light);font-weight:var(--sgds-font-weight-regular,--sgds-font-weight-semibold);margin:var(--sgds-paragraph-spacing-xl,--sgds-margin-none)}.links{margin:0;padding:0}.links slot::slotted(a){--sgds-link-color-default:var(--sgds-color-fixed-light);color:var(--sgds-link-color-default,--sgds-fixed-light);text-decoration:none!important;width:fit-content}.links slot::slotted(a:focus),.links slot::slotted(a:focus-visible),slot::slotted(a:hover){--sgds-link-color-emphasis:var(--sgds-color-fixed-light);color:var(--sgds-link-color-emphasis,--sgds-color-fixed-light)}.links slot::slotted(a:focus),.links slot::slotted(a:focus-visible){outline:0}.links slot::slotted(a:focus-visible){box-shadow:var(--sgds-box-shadow-focus)}`;
4263
4307
 
4264
4308
  /**
4265
4309
  * @summary The footer item component organizes links under a clear, descriptive title within the footer. It helps users easily navigate to related resources or information, ensuring clarity and accessibility.