@govtechsg/sgds-web-component 3.2.0-rc.4 → 3.3.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 (196) hide show
  1. package/Masthead/index.js +46 -15
  2. package/base/card-element.js +2 -53
  3. package/base/card-element.js.map +1 -1
  4. package/base/card.js +1 -1
  5. package/components/Breadcrumb/index.umd.js +3 -3
  6. package/components/Breadcrumb/index.umd.js.map +1 -1
  7. package/components/Breadcrumb/sgds-breadcrumb.js +1 -1
  8. package/components/Breadcrumb/sgds-breadcrumb.js.map +1 -1
  9. package/components/Card/card.js +1 -1
  10. package/components/Card/index.umd.js +76 -87
  11. package/components/Card/index.umd.js.map +1 -1
  12. package/components/Card/sgds-card.js +56 -16
  13. package/components/Card/sgds-card.js.map +1 -1
  14. package/components/Dropdown/dropdown.js +1 -1
  15. package/components/Dropdown/index.umd.js +1 -1
  16. package/components/Footer/index.umd.js +40 -84
  17. package/components/Footer/index.umd.js.map +1 -1
  18. package/components/Footer/sgds-footer.js +41 -36
  19. package/components/Footer/sgds-footer.js.map +1 -1
  20. package/components/Link/index.umd.js +2 -2
  21. package/components/Link/index.umd.js.map +1 -1
  22. package/components/Link/link.js +1 -1
  23. package/components/Link/sgds-link.js +1 -1
  24. package/components/Link/sgds-link.js.map +1 -1
  25. package/components/Mainnav/index.umd.js +4 -4
  26. package/components/Mainnav/index.umd.js.map +1 -1
  27. package/components/Mainnav/mainnav-item.js +1 -1
  28. package/components/Mainnav/mainnav.js +1 -1
  29. package/components/Mainnav/sgds-mainnav.js +1 -1
  30. package/components/Mainnav/sgds-mainnav.js.map +1 -1
  31. package/components/Masthead/index.umd.js +46 -15
  32. package/components/Masthead/index.umd.js.map +1 -1
  33. package/components/Masthead/masthead.js +1 -1
  34. package/components/Masthead/sgds-masthead.js +45 -14
  35. package/components/Masthead/sgds-masthead.js.map +1 -1
  36. package/components/index.js +0 -4
  37. package/components/index.js.map +1 -1
  38. package/components/index.umd.js +281 -502
  39. package/components/index.umd.js.map +1 -1
  40. package/css/reboot.css +0 -1
  41. package/index.js +0 -4
  42. package/index.js.map +1 -1
  43. package/index.umd.js +295 -520
  44. package/index.umd.js.map +1 -1
  45. package/{components → internals}/OverflowMenu/sgds-overflow-menu.js +3 -3
  46. package/internals/OverflowMenu/sgds-overflow-menu.js.map +1 -0
  47. package/package.json +1 -1
  48. package/react/base/card-element.cjs.js +1 -52
  49. package/react/base/card-element.cjs.js.map +1 -1
  50. package/react/base/card-element.js +2 -53
  51. package/react/base/card-element.js.map +1 -1
  52. package/react/base/card.cjs.js +1 -1
  53. package/react/base/card.js +1 -1
  54. package/react/components/Breadcrumb/sgds-breadcrumb.cjs.js +1 -1
  55. package/react/components/Breadcrumb/sgds-breadcrumb.cjs.js.map +1 -1
  56. package/react/components/Breadcrumb/sgds-breadcrumb.js +1 -1
  57. package/react/components/Breadcrumb/sgds-breadcrumb.js.map +1 -1
  58. package/react/components/Card/card.cjs.js +1 -1
  59. package/react/components/Card/card.js +1 -1
  60. package/react/components/Card/sgds-card.cjs.js +55 -15
  61. package/react/components/Card/sgds-card.cjs.js.map +1 -1
  62. package/react/components/Card/sgds-card.js +56 -16
  63. package/react/components/Card/sgds-card.js.map +1 -1
  64. package/react/components/Dropdown/dropdown.cjs.js +1 -1
  65. package/react/components/Dropdown/dropdown.js +1 -1
  66. package/react/components/Footer/sgds-footer.cjs.js +40 -35
  67. package/react/components/Footer/sgds-footer.cjs.js.map +1 -1
  68. package/react/components/Footer/sgds-footer.js +41 -36
  69. package/react/components/Footer/sgds-footer.js.map +1 -1
  70. package/react/components/Link/link.cjs.js +1 -1
  71. package/react/components/Link/link.js +1 -1
  72. package/react/components/Link/sgds-link.cjs.js +1 -1
  73. package/react/components/Link/sgds-link.cjs.js.map +1 -1
  74. package/react/components/Link/sgds-link.js +1 -1
  75. package/react/components/Link/sgds-link.js.map +1 -1
  76. package/react/components/Mainnav/mainnav-item.cjs.js +1 -1
  77. package/react/components/Mainnav/mainnav-item.js +1 -1
  78. package/react/components/Mainnav/mainnav.cjs.js +1 -1
  79. package/react/components/Mainnav/mainnav.js +1 -1
  80. package/react/components/Mainnav/sgds-mainnav.cjs.js +1 -1
  81. package/react/components/Mainnav/sgds-mainnav.cjs.js.map +1 -1
  82. package/react/components/Mainnav/sgds-mainnav.js +1 -1
  83. package/react/components/Mainnav/sgds-mainnav.js.map +1 -1
  84. package/react/components/Masthead/masthead.cjs.js +1 -1
  85. package/react/components/Masthead/masthead.js +1 -1
  86. package/react/components/Masthead/sgds-masthead.cjs.js +45 -14
  87. package/react/components/Masthead/sgds-masthead.cjs.js.map +1 -1
  88. package/react/components/Masthead/sgds-masthead.js +45 -14
  89. package/react/components/Masthead/sgds-masthead.js.map +1 -1
  90. package/react/index.cjs.js +70 -78
  91. package/react/index.cjs.js.map +1 -1
  92. package/react/index.js +0 -4
  93. package/react/index.js.map +1 -1
  94. package/react/{components → internals}/OverflowMenu/sgds-overflow-menu.cjs.js +3 -3
  95. package/react/internals/OverflowMenu/sgds-overflow-menu.cjs.js.map +1 -0
  96. package/react/{components → internals}/OverflowMenu/sgds-overflow-menu.js +3 -3
  97. package/react/internals/OverflowMenu/sgds-overflow-menu.js.map +1 -0
  98. package/src/base/card-element.d.ts +0 -14
  99. package/src/components/Breadcrumb/sgds-breadcrumb.d.ts +1 -1
  100. package/src/components/Card/sgds-card.d.ts +15 -4
  101. package/src/components/Footer/sgds-footer.d.ts +1 -1
  102. package/src/components/Link/sgds-link.d.ts +2 -2
  103. package/src/components/index.d.ts +0 -4
  104. package/src/index.d.ts +0 -4
  105. package/src/{components → internals}/OverflowMenu/sgds-overflow-menu.d.ts +3 -3
  106. package/src/react/index.d.ts +0 -4
  107. package/themes/root.css +2 -0
  108. package/components/IconCard/icon-card.js +0 -6
  109. package/components/IconCard/icon-card.js.map +0 -1
  110. package/components/IconCard/index.js +0 -4
  111. package/components/IconCard/index.js.map +0 -1
  112. package/components/IconCard/index.umd.js +0 -4760
  113. package/components/IconCard/index.umd.js.map +0 -1
  114. package/components/IconCard/sgds-icon-card.js +0 -83
  115. package/components/IconCard/sgds-icon-card.js.map +0 -1
  116. package/components/ImageCard/image-card.js +0 -6
  117. package/components/ImageCard/image-card.js.map +0 -1
  118. package/components/ImageCard/index.js +0 -4
  119. package/components/ImageCard/index.js.map +0 -1
  120. package/components/ImageCard/index.umd.js +0 -4774
  121. package/components/ImageCard/index.umd.js.map +0 -1
  122. package/components/ImageCard/sgds-image-card.js +0 -97
  123. package/components/ImageCard/sgds-image-card.js.map +0 -1
  124. package/components/OverflowMenu/index.js +0 -5
  125. package/components/OverflowMenu/index.js.map +0 -1
  126. package/components/OverflowMenu/index.umd.js +0 -11129
  127. package/components/OverflowMenu/index.umd.js.map +0 -1
  128. package/components/OverflowMenu/sgds-overflow-menu.js.map +0 -1
  129. package/components/ThumbnailCard/index.js +0 -4
  130. package/components/ThumbnailCard/index.js.map +0 -1
  131. package/components/ThumbnailCard/index.umd.js +0 -4764
  132. package/components/ThumbnailCard/index.umd.js.map +0 -1
  133. package/components/ThumbnailCard/sgds-thumbnail-card.js +0 -87
  134. package/components/ThumbnailCard/sgds-thumbnail-card.js.map +0 -1
  135. package/components/ThumbnailCard/thumbnail-card.js +0 -6
  136. package/components/ThumbnailCard/thumbnail-card.js.map +0 -1
  137. package/react/components/IconCard/icon-card.cjs.js +0 -11
  138. package/react/components/IconCard/icon-card.cjs.js.map +0 -1
  139. package/react/components/IconCard/icon-card.js +0 -7
  140. package/react/components/IconCard/icon-card.js.map +0 -1
  141. package/react/components/IconCard/sgds-icon-card.cjs.js +0 -89
  142. package/react/components/IconCard/sgds-icon-card.cjs.js.map +0 -1
  143. package/react/components/IconCard/sgds-icon-card.js +0 -84
  144. package/react/components/IconCard/sgds-icon-card.js.map +0 -1
  145. package/react/components/ImageCard/image-card.cjs.js +0 -11
  146. package/react/components/ImageCard/image-card.cjs.js.map +0 -1
  147. package/react/components/ImageCard/image-card.js +0 -7
  148. package/react/components/ImageCard/image-card.js.map +0 -1
  149. package/react/components/ImageCard/sgds-image-card.cjs.js +0 -103
  150. package/react/components/ImageCard/sgds-image-card.cjs.js.map +0 -1
  151. package/react/components/ImageCard/sgds-image-card.js +0 -98
  152. package/react/components/ImageCard/sgds-image-card.js.map +0 -1
  153. package/react/components/OverflowMenu/sgds-overflow-menu.cjs.js.map +0 -1
  154. package/react/components/OverflowMenu/sgds-overflow-menu.js.map +0 -1
  155. package/react/components/ThumbnailCard/sgds-thumbnail-card.cjs.js +0 -93
  156. package/react/components/ThumbnailCard/sgds-thumbnail-card.cjs.js.map +0 -1
  157. package/react/components/ThumbnailCard/sgds-thumbnail-card.js +0 -88
  158. package/react/components/ThumbnailCard/sgds-thumbnail-card.js.map +0 -1
  159. package/react/components/ThumbnailCard/thumbnail-card.cjs.js +0 -11
  160. package/react/components/ThumbnailCard/thumbnail-card.cjs.js.map +0 -1
  161. package/react/components/ThumbnailCard/thumbnail-card.js +0 -7
  162. package/react/components/ThumbnailCard/thumbnail-card.js.map +0 -1
  163. package/react/icon-card/index.cjs.js +0 -40
  164. package/react/icon-card/index.cjs.js.map +0 -1
  165. package/react/icon-card/index.js +0 -16
  166. package/react/icon-card/index.js.map +0 -1
  167. package/react/image-card/index.cjs.js +0 -40
  168. package/react/image-card/index.cjs.js.map +0 -1
  169. package/react/image-card/index.js +0 -16
  170. package/react/image-card/index.js.map +0 -1
  171. package/react/overflow-menu/index.cjs.js +0 -40
  172. package/react/overflow-menu/index.cjs.js.map +0 -1
  173. package/react/overflow-menu/index.js +0 -16
  174. package/react/overflow-menu/index.js.map +0 -1
  175. package/react/thumbnail-card/index.cjs.js +0 -40
  176. package/react/thumbnail-card/index.cjs.js.map +0 -1
  177. package/react/thumbnail-card/index.js +0 -16
  178. package/react/thumbnail-card/index.js.map +0 -1
  179. package/src/components/Card/types.d.ts +0 -3
  180. package/src/components/IconCard/index.d.ts +0 -6
  181. package/src/components/IconCard/sgds-icon-card.d.ts +0 -24
  182. package/src/components/ImageCard/index.d.ts +0 -6
  183. package/src/components/ImageCard/sgds-image-card.d.ts +0 -30
  184. package/src/components/ThumbnailCard/index.d.ts +0 -6
  185. package/src/components/ThumbnailCard/sgds-thumbnail-card.d.ts +0 -24
  186. package/src/react/icon-card/index.d.ts +0 -2
  187. package/src/react/image-card/index.d.ts +0 -2
  188. package/src/react/overflow-menu/index.d.ts +0 -2
  189. package/src/react/thumbnail-card/index.d.ts +0 -2
  190. /package/{components → internals}/OverflowMenu/overflow-menu.js +0 -0
  191. /package/{components → internals}/OverflowMenu/overflow-menu.js.map +0 -0
  192. /package/react/{components → internals}/OverflowMenu/overflow-menu.cjs.js +0 -0
  193. /package/react/{components → internals}/OverflowMenu/overflow-menu.cjs.js.map +0 -0
  194. /package/react/{components → internals}/OverflowMenu/overflow-menu.js +0 -0
  195. /package/react/{components → internals}/OverflowMenu/overflow-menu.js.map +0 -0
  196. /package/src/{components → internals}/OverflowMenu/index.d.ts +0 -0
@@ -1,26 +1,30 @@
1
1
  'use client';
2
2
  import { __decorate } from 'tslib';
3
3
  import { literal, html } from 'lit/static-html.js';
4
- import { queryAssignedNodes, property } from 'lit/decorators.js';
4
+ import { query, queryAssignedNodes, property } from 'lit/decorators.js';
5
5
  import { classMap } from 'lit/directives/class-map.js';
6
6
  import { CardElement } from '../../base/card-element.js';
7
+ import { SgdsLink } from '../Link/sgds-link.js';
7
8
  import css_248z from './card.js';
8
9
 
9
10
  /**
10
11
  * @summary Cards can be used for headers and footers, a wide variety of content, contain contextual background colors and images.
11
- * @slot default - The content area of the card, placed directly under the title. Accepts any HTML or custom elements.
12
- * @slot menu - Accepts an element for an overflow or contextual menu, positioned at the top-right corner of the card. Typically used for action menus or dropdowns.
13
12
  * @slot image - Accepts an image or svg element of the card. Only a single element is allowed to be passed in.
14
13
  * @slot icon - Accepts an icon element to visually represent the card. Only a single element is allowed to be passed in.
15
14
  * @slot subtitle - The subtitle of the card
16
15
  * @slot title - The title of the card
17
16
  * @slot description - The paragrapher text of the card
18
- * @slot lower - Accepts any additional content to be displayed below the card description, such as badges, metadata, or supplementary information.
19
17
  * @slot link - Accepts an anchor element. Only a single element is allowed to be passed in.
20
18
  */
21
19
  class SgdsCard extends CardElement {
22
20
  constructor() {
23
21
  super(...arguments);
22
+ /** Extends the link passed in slot[name="link"] to the entire card */
23
+ this.stretchedLink = false;
24
+ /** Disables the card */
25
+ this.disabled = false;
26
+ /** Sets the orientation of the card. Available options: `vertical`, `horizontal` */
27
+ this.orientation = "vertical";
24
28
  /** Sets the image position of the card. Available options: `before`, `after` */
25
29
  this.imagePosition = "before";
26
30
  /** Controls how the image is sized and aligned within the card. Available options: `default`, `padding around`, `aspect ratio` */
@@ -32,8 +36,35 @@ class SgdsCard extends CardElement {
32
36
  icon.style.display = "none";
33
37
  }
34
38
  if (this._iconNode.length === 0) {
35
- const media = this.shadowRoot.querySelector(".card-media");
36
- media.style.display = "none";
39
+ const icon = this.shadowRoot.querySelector(".card-icon");
40
+ icon.style.display = "none";
41
+ }
42
+ if (this.disabled && this._linkNode.length > 0) {
43
+ const hyperlink = this._linkNode[0].querySelector("a");
44
+ hyperlink.setAttribute("disabled", "true");
45
+ hyperlink.removeAttribute("href");
46
+ }
47
+ }
48
+ handleTitleSlotChange(e) {
49
+ const childNodes = e.target.assignedNodes({ flatten: true });
50
+ if (this.stretchedLink && childNodes[0] instanceof HTMLAnchorElement) {
51
+ const hyperlink = childNodes[0].querySelector("a") || childNodes[0];
52
+ hyperlink.removeAttribute("href");
53
+ }
54
+ return;
55
+ }
56
+ handleLinkSlotChange(e) {
57
+ const childNodes = e.target.assignedNodes({ flatten: true });
58
+ if (childNodes.length > 1) {
59
+ return console.error("Multiple elements passed into SgdsCard's link slot");
60
+ }
61
+ if (!this.stretchedLink)
62
+ return;
63
+ if (childNodes[0] instanceof HTMLAnchorElement || childNodes[0] instanceof SgdsLink) {
64
+ const hyperlink = (childNodes[0].querySelector("a") || childNodes[0]);
65
+ this.card.setAttribute("href", hyperlink.href);
66
+ const linkSlot = this.shadowRoot.querySelector("slot[name='link']");
67
+ linkSlot.style.display = "none";
37
68
  }
38
69
  }
39
70
  handleImgSlotChange(e) {
@@ -52,26 +83,20 @@ class SgdsCard extends CardElement {
52
83
  })}"
53
84
  tabindex=${cardTabIndex}
54
85
  >
55
- <div class="card-tinted-bg"></div>
56
- <slot name="menu"></slot>
57
86
  <div class="card-image">
58
87
  <slot name="image" @slotchange=${this.handleImgSlotChange}></slot>
59
88
  </div>
60
- <div class="card-media">
89
+ <div class="card-icon">
61
90
  <slot name="icon"></slot>
62
91
  </div>
63
92
  <div class="card-body">
64
- <div class="card-header-container">
65
- <div class="card-header">
66
- <slot name="subtitle"></slot>
67
- <h3 class="card-title"><slot name="title" @slotchange=${this.handleTitleSlotChange}></slot></h3>
68
- </div>
69
- <slot></slot>
93
+ <div class="card-header">
94
+ <slot name="subtitle"></slot>
95
+ <h3 class="card-title"><slot name="title" @slotchange=${this.handleTitleSlotChange}></slot></h3>
70
96
  </div>
71
97
  <p class="card-text">
72
98
  <slot name="description"></slot>
73
99
  </p>
74
- <slot name="lower"></slot>
75
100
  <slot name="link" @slotchange=${this.handleLinkSlotChange}></slot>
76
101
  </div>
77
102
  </${tag}>
@@ -79,12 +104,27 @@ class SgdsCard extends CardElement {
79
104
  }
80
105
  }
81
106
  SgdsCard.styles = [...CardElement.styles, css_248z];
107
+ __decorate([
108
+ query("a.card")
109
+ ], SgdsCard.prototype, "card", void 0);
82
110
  __decorate([
83
111
  queryAssignedNodes({ slot: "image", flatten: true })
84
112
  ], SgdsCard.prototype, "_imageNode", void 0);
85
113
  __decorate([
86
114
  queryAssignedNodes({ slot: "icon", flatten: true })
87
115
  ], SgdsCard.prototype, "_iconNode", void 0);
116
+ __decorate([
117
+ queryAssignedNodes({ slot: "link", flatten: true })
118
+ ], SgdsCard.prototype, "_linkNode", void 0);
119
+ __decorate([
120
+ property({ type: Boolean, reflect: true })
121
+ ], SgdsCard.prototype, "stretchedLink", void 0);
122
+ __decorate([
123
+ property({ type: Boolean, reflect: true })
124
+ ], SgdsCard.prototype, "disabled", void 0);
125
+ __decorate([
126
+ property({ type: String, reflect: true })
127
+ ], SgdsCard.prototype, "orientation", void 0);
88
128
  __decorate([
89
129
  property({ type: String, reflect: true })
90
130
  ], SgdsCard.prototype, "imagePosition", void 0);
@@ -1 +1 @@
1
- {"version":3,"file":"sgds-card.js","sources":["../../../../src/components/Card/sgds-card.ts"],"sourcesContent":["import { html, literal } from \"lit/static-html.js\";\nimport { property, queryAssignedNodes } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { CardElement } from \"../../base/card-element\";\nimport { CardImageAdjustment, CardImagePosition } from \"./types\";\nimport cardStyle from \"./card.css\";\n\n/**\n * @summary Cards can be used for headers and footers, a wide variety of content, contain contextual background colors and images.\n * @slot default - The content area of the card, placed directly under the title. Accepts any HTML or custom elements.\n * @slot menu - Accepts an element for an overflow or contextual menu, positioned at the top-right corner of the card. Typically used for action menus or dropdowns.\n * @slot image - Accepts an image or svg element of the card. Only a single element is allowed to be passed in.\n * @slot icon - Accepts an icon element to visually represent the card. Only a single element is allowed to be passed in.\n * @slot subtitle - The subtitle of the card\n * @slot title - The title of the card\n * @slot description - The paragrapher text of the card\n * @slot lower - Accepts any additional content to be displayed below the card description, such as badges, metadata, or supplementary information.\n * @slot link - Accepts an anchor element. Only a single element is allowed to be passed in.\n */\nexport class SgdsCard extends CardElement {\n static styles = [...CardElement.styles, cardStyle];\n\n /** @internal */\n @queryAssignedNodes({ slot: \"image\", flatten: true })\n _imageNode!: Array<Node>;\n /** @internal */\n @queryAssignedNodes({ slot: \"icon\", flatten: true })\n _iconNode!: Array<Node>;\n\n /** Sets the image position of the card. Available options: `before`, `after` */\n @property({ type: String, reflect: true }) imagePosition: CardImagePosition = \"before\";\n\n /** Controls how the image is sized and aligned within the card. Available options: `default`, `padding around`, `aspect ratio` */\n @property({ type: String, reflect: true }) imageAdjustment: CardImageAdjustment = \"default\";\n\n protected firstUpdated() {\n if (this._imageNode.length === 0) {\n const icon = this.shadowRoot.querySelector(\".card-image\") as HTMLDivElement;\n icon.style.display = \"none\";\n }\n if (this._iconNode.length === 0) {\n const media = this.shadowRoot.querySelector(\".card-media\") as HTMLDivElement;\n media.style.display = \"none\";\n }\n }\n\n handleImgSlotChange(e: Event) {\n const childNodes = (e.target as HTMLSlotElement).assignedNodes({ flatten: true }) as Array<HTMLOrSVGImageElement>;\n\n if (childNodes.length > 1) {\n return console.error(\"Multiple elements passed into SgdsCard's image slot\");\n }\n }\n\n render() {\n const tag = this.stretchedLink ? literal`a` : literal`div`;\n const cardTabIndex = !this.stretchedLink || this.disabled ? -1 : 0;\n\n return html`\n <${tag} \n class=\"card ${classMap({\n disabled: this.disabled\n })}\"\n tabindex=${cardTabIndex}\n >\n <div class=\"card-tinted-bg\"></div>\n <slot name=\"menu\"></slot>\n <div class=\"card-image\">\n <slot name=\"image\" @slotchange=${this.handleImgSlotChange}></slot>\n </div>\n <div class=\"card-media\">\n <slot name=\"icon\"></slot>\n </div>\n <div class=\"card-body\">\n <div class=\"card-header-container\">\n <div class=\"card-header\">\n <slot name=\"subtitle\"></slot>\n <h3 class=\"card-title\"><slot name=\"title\" @slotchange=${this.handleTitleSlotChange}></slot></h3>\n </div>\n <slot></slot>\n </div>\n <p class=\"card-text\">\n <slot name=\"description\"></slot>\n </p>\n <slot name=\"lower\"></slot>\n <slot name=\"link\" @slotchange=${this.handleLinkSlotChange}></slot>\n </div>\n </${tag}>\n `;\n }\n}\n\nexport default SgdsCard;\n"],"names":["cardStyle"],"mappings":";;;;;;;;AAOA;;;;;;;;;;;AAWG;AACG,MAAO,QAAS,SAAQ,WAAW,CAAA;AAAzC,IAAA,WAAA,GAAA;;;QAW6C,IAAa,CAAA,aAAA,GAAsB,QAAQ,CAAC;;QAG5C,IAAe,CAAA,eAAA,GAAwB,SAAS,CAAC;KAyD7F;IAvDW,YAAY,GAAA;QACpB,IAAI,IAAI,CAAC,UAAU,CAAC,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G,CAAA;KACR,CAAC;KACH;;AArEM,QAAM,CAAA,MAAA,GAAG,CAAC,GAAG,WAAW,CAAC,MAAM,EAAEA,QAAS,CAApC,CAAsC;AAInD,UAAA,CAAA;IADC,kBAAkB,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAC5B,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,YAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAGzB,UAAA,CAAA;IADC,kBAAkB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAC5B,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,WAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAGmB,UAAA,CAAA;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAA6C,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,eAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAG5C,UAAA,CAAA;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAAkD,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,iBAAA,EAAA,KAAA,CAAA,CAAA;;;;"}
1
+ {"version":3,"file":"sgds-card.js","sources":["../../../../src/components/Card/sgds-card.ts"],"sourcesContent":["import { html, literal } from \"lit/static-html.js\";\nimport { property, query, queryAssignedNodes } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { CardElement } from \"../../base/card-element\";\nimport SgdsLink from \"../Link/sgds-link\";\nimport cardStyle from \"./card.css\";\n\nexport type CardImageAdjustment = \"default\" | \"padding around\" | \"aspect ratio\";\nexport type CardImagePosition = \"before\" | \"after\";\nexport type CardOrientation = \"vertical\" | \"horizontal\";\n\n/**\n * @summary Cards can be used for headers and footers, a wide variety of content, contain contextual background colors and images.\n * @slot image - Accepts an image or svg element of the card. Only a single element is allowed to be passed in.\n * @slot icon - Accepts an icon element to visually represent the card. Only a single element is allowed to be passed in.\n * @slot subtitle - The subtitle of the card\n * @slot title - The title of the card\n * @slot description - The paragrapher text of the card\n * @slot link - Accepts an anchor element. Only a single element is allowed to be passed in.\n */\nexport class SgdsCard extends CardElement {\n static styles = [...CardElement.styles, cardStyle];\n\n /** @internal */\n @query(\"a.card\") card: HTMLAnchorElement;\n\n /** @internal */\n @queryAssignedNodes({ slot: \"image\", flatten: true })\n _imageNode!: Array<Node>;\n /** @internal */\n @queryAssignedNodes({ slot: \"icon\", flatten: true })\n _iconNode!: Array<Node>;\n /** @internal */\n @queryAssignedNodes({ slot: \"link\", flatten: true })\n _linkNode!: Array<Node>;\n\n /** Extends the link passed in slot[name=\"link\"] to the entire card */\n @property({ type: Boolean, reflect: true }) stretchedLink = false;\n\n /** Disables the card */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /** Sets the orientation of the card. Available options: `vertical`, `horizontal` */\n @property({ type: String, reflect: true }) orientation: CardOrientation = \"vertical\";\n\n /** Sets the image position of the card. Available options: `before`, `after` */\n @property({ type: String, reflect: true }) imagePosition: CardImagePosition = \"before\";\n\n /** Controls how the image is sized and aligned within the card. Available options: `default`, `padding around`, `aspect ratio` */\n @property({ type: String, reflect: true }) imageAdjustment: CardImageAdjustment = \"default\";\n\n protected firstUpdated() {\n if (this._imageNode.length === 0) {\n const icon = this.shadowRoot.querySelector(\".card-image\") as HTMLDivElement;\n icon.style.display = \"none\";\n }\n if (this._iconNode.length === 0) {\n const icon = this.shadowRoot.querySelector(\".card-icon\") as HTMLDivElement;\n icon.style.display = \"none\";\n }\n if (this.disabled && this._linkNode.length > 0) {\n const hyperlink = (this._linkNode[0] as HTMLLinkElement).querySelector(\"a\");\n hyperlink.setAttribute(\"disabled\", \"true\");\n hyperlink.removeAttribute(\"href\");\n }\n }\n\n handleTitleSlotChange(e: Event) {\n const childNodes = (e.target as HTMLSlotElement).assignedNodes({ flatten: true }) as Array<HTMLElement>;\n\n if (this.stretchedLink && childNodes[0] instanceof HTMLAnchorElement) {\n const hyperlink = childNodes[0].querySelector(\"a\") || childNodes[0];\n hyperlink.removeAttribute(\"href\");\n }\n return;\n }\n\n handleLinkSlotChange(e: Event) {\n const childNodes = (e.target as HTMLSlotElement).assignedNodes({ flatten: true }) as\n | Array<HTMLLinkElement>\n | Array<HTMLAnchorElement>\n | Array<SgdsLink>;\n\n if (childNodes.length > 1) {\n return console.error(\"Multiple elements passed into SgdsCard's link slot\");\n }\n\n if (!this.stretchedLink) return;\n\n if (childNodes[0] instanceof HTMLAnchorElement || childNodes[0] instanceof SgdsLink) {\n const hyperlink = (childNodes[0].querySelector(\"a\") || childNodes[0]) as HTMLAnchorElement;\n this.card.setAttribute(\"href\", hyperlink.href);\n const linkSlot = this.shadowRoot.querySelector(\"slot[name='link']\") as HTMLSlotElement;\n linkSlot.style.display = \"none\";\n }\n }\n\n handleImgSlotChange(e: Event) {\n const childNodes = (e.target as HTMLSlotElement).assignedNodes({ flatten: true }) as Array<HTMLOrSVGImageElement>;\n\n if (childNodes.length > 1) {\n return console.error(\"Multiple elements passed into SgdsCard's image slot\");\n }\n }\n\n render() {\n const tag = this.stretchedLink ? literal`a` : literal`div`;\n const cardTabIndex = !this.stretchedLink || this.disabled ? -1 : 0;\n\n return html`\n <${tag} \n class=\"card ${classMap({\n disabled: this.disabled\n })}\"\n tabindex=${cardTabIndex}\n >\n <div class=\"card-image\">\n <slot name=\"image\" @slotchange=${this.handleImgSlotChange}></slot>\n </div>\n <div class=\"card-icon\">\n <slot name=\"icon\"></slot>\n </div>\n <div class=\"card-body\">\n <div class=\"card-header\">\n <slot name=\"subtitle\"></slot>\n <h3 class=\"card-title\"><slot name=\"title\" @slotchange=${this.handleTitleSlotChange}></slot></h3>\n </div>\n <p class=\"card-text\">\n <slot name=\"description\"></slot>\n </p>\n <slot name=\"link\" @slotchange=${this.handleLinkSlotChange}></slot>\n </div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Property(exports, '__esModule', { value: true });
5
5
 
6
6
  var lit = require('lit');
7
7
 
8
- var css_248z = lit.css`.dropdown{display:flex;height:inherit;position:relative}`;
8
+ var css_248z = lit.css`:host{position:relative}.dropdown{display:flex;height:inherit}`;
9
9
 
10
10
  exports["default"] = css_248z;
11
11
  //# sourceMappingURL=dropdown.cjs.js.map
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import { css } from 'lit';
3
3
 
4
- var css_248z = css`.dropdown{display:flex;height:inherit;position:relative}`;
4
+ var css_248z = css`:host{position:relative}.dropdown{display:flex;height:inherit}`;
5
5
 
6
6
  export { css_248z as default };
7
7
  //# sourceMappingURL=dropdown.js.map
@@ -7,7 +7,6 @@ var tslib = require('tslib');
7
7
  var lit = require('lit');
8
8
  var decorators_js = require('lit/decorators.js');
9
9
  var sgdsElement = require('../../base/sgds-element.cjs.js');
10
- var slot = require('../../utils/slot.cjs.js');
11
10
  var footer = require('./footer.cjs.js');
12
11
 
13
12
  /**
@@ -46,45 +45,51 @@ class SgdsFooter extends sgdsElement["default"] {
46
45
  * href link for terms of use
47
46
  */
48
47
  this.termsOfUseHref = "#";
49
- this.hasSlotController = new slot.HasSlotController(this, "social-media", "title", "description", "items");
48
+ }
49
+ firstUpdated() {
50
+ const socialMediaSlot = this.shadowRoot.querySelector("slot[name='social-media']");
51
+ const footerTitleSlot = this.shadowRoot.querySelector("slot[name='title']");
52
+ const footerDescriptionSlot = this.shadowRoot.querySelector("slot[name='description']");
53
+ const footerItemsSlot = this.shadowRoot.querySelector("slot[name='items']");
54
+ const socialMediaChildNodes = socialMediaSlot.assignedNodes({ flatten: true });
55
+ const footerTitleChildNodes = footerTitleSlot.assignedNodes({ flatten: true });
56
+ const footerDescriptionChildNodes = footerDescriptionSlot.assignedNodes({ flatten: true });
57
+ const footerItemsChildNodes = footerItemsSlot.assignedNodes({ flatten: true });
58
+ if (socialMediaChildNodes.length === 0) {
59
+ const socialMediaContainer = this.shadowRoot.querySelector(".social-media");
60
+ socialMediaContainer.style.display = "none";
61
+ }
62
+ if (footerTitleChildNodes.length === 0 && footerDescriptionChildNodes.length === 0) {
63
+ const footerHeaderContainer = this.shadowRoot.querySelector(".footer-header");
64
+ footerHeaderContainer.style.display = "none";
65
+ }
66
+ if (footerItemsChildNodes.length === 0) {
67
+ const footerItemsContainer = this.shadowRoot.querySelector(".footer-items");
68
+ footerItemsContainer.style.display = "none";
69
+ }
70
+ if (footerTitleChildNodes.length === 0 &&
71
+ footerDescriptionChildNodes.length === 0 &&
72
+ footerItemsChildNodes.length === 0) {
73
+ const footerTopContainer = this.shadowRoot.querySelector(".footer-top");
74
+ footerTopContainer.style.display = "none";
75
+ }
50
76
  }
51
77
  render() {
52
- const hasSocialMediaSlot = this.hasSlotController.test("social-media");
53
- const hasTitleSlot = this.hasSlotController.test("title");
54
- const hasDescriptionSlot = this.hasSlotController.test("description");
55
- const hasItemsSlot = this.hasSlotController.test("items");
56
- const displayFooterHeader = hasTitleSlot || hasDescriptionSlot;
57
- const displayFooterItems = hasItemsSlot;
58
- const displaySocialMedia = hasSocialMediaSlot;
59
- const displayFooterTop = displayFooterHeader || displayFooterItems;
60
78
  return lit.html `
61
79
  <footer class="footer">
62
- ${displayFooterTop
63
- ? lit.html ` <section class="footer-top">
64
- ${displayFooterHeader
65
- ? lit.html `
66
- <div class="footer-header">
67
- <slot name="title"></slot>
68
- <slot name="description"></slot>
69
- </div>
70
- `
71
- : lit.nothing}
72
- ${displayFooterItems
73
- ? lit.html ` <div class="footer-items">
74
- <slot name="items"></slot>
75
- </div>`
76
- : lit.nothing}
77
- </section>`
78
- : lit.nothing}
79
-
80
+ <section class="footer-top">
81
+ <div class="footer-header">
82
+ <slot name="title"></slot>
83
+ <slot name="description"></slot>
84
+ </div>
85
+ <div class="footer-items">
86
+ <slot name="items"></slot>
87
+ </div>
88
+ </section>
80
89
  <section class="footer-bottom">
81
- ${displaySocialMedia
82
- ? lit.html `
83
- <div class="social-media">
84
- <slot name="social-media"></slot>
85
- </div>
86
- `
87
- : lit.nothing}
90
+ <div class="social-media">
91
+ <slot name="social-media"></slot>
92
+ </div>
88
93
  <div class="footer-mandatory-links">
89
94
  <ul>
90
95
  <li><a href=${this.contactHref}>Contact</a></li>
@@ -1 +1 @@
1
- {"version":3,"file":"sgds-footer.cjs.js","sources":["../../../../src/components/Footer/sgds-footer.ts"],"sourcesContent":["import { html, nothing } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport SgdsElement from \"../../base/sgds-element\";\nimport { HasSlotController } from \"../../utils/slot\";\nimport footerStyle from \"./footer.css\";\n\n/**\n * @summary The footer contains supporting information for your service at the bottom of your website. All .gov.sg digital services shall contain a Global Footer Bar across all pages. The Global Footer Bar should include the name of the digital service, contact information, a privacy statement and the terms of use.\n *\n * @slot title - The slot for title\n * @slot description - The slot for description\n * @slot items - The slot for the list of footer items\n * @slot social-media - The slot for the list of social media with icons\n *\n */\nexport class SgdsFooter extends SgdsElement {\n static styles = [...SgdsElement.styles, footerStyle];\n\n /**\n * \tSets copyrightLiner of SgdsFooter\n */\n @property({ type: String })\n copyrightLiner = \"Government of Singapore\";\n\n /**\n * \thref link for contacts\n */\n @property({ type: String })\n contactHref = \"#\";\n\n /**\n * \thref link for feedback\n */\n @property({ type: String })\n feedbackHref = \"#\";\n\n /**\n * \thref link for faq\n */\n @property({ type: String })\n faqHref = \"#\";\n\n /**\n * \thref link for privacy statement\n */\n @property({ type: String })\n privacyHref = \"#\";\n\n /**\n * \thref link for terms of use\n */\n @property({ type: String })\n termsOfUseHref = \"#\";\n\n private readonly hasSlotController = new HasSlotController(this, \"social-media\", \"title\", \"description\", \"items\");\n\n render() {\n const hasSocialMediaSlot = this.hasSlotController.test(\"social-media\");\n const hasTitleSlot = this.hasSlotController.test(\"title\");\n const hasDescriptionSlot = this.hasSlotController.test(\"description\");\n const hasItemsSlot = this.hasSlotController.test(\"items\");\n\n const displayFooterHeader = hasTitleSlot || hasDescriptionSlot;\n const displayFooterItems = hasItemsSlot;\n const displaySocialMedia = hasSocialMediaSlot;\n const displayFooterTop = displayFooterHeader || displayFooterItems;\n\n return html`\n <footer class=\"footer\">\n ${displayFooterTop\n ? html` <section class=\"footer-top\">\n ${displayFooterHeader\n ? html`\n <div class=\"footer-header\">\n <slot name=\"title\"></slot>\n <slot name=\"description\"></slot>\n </div>\n `\n : nothing}\n ${displayFooterItems\n ? html` <div class=\"footer-items\">\n <slot name=\"items\"></slot>\n </div>`\n : nothing}\n </section>`\n : nothing}\n\n <section class=\"footer-bottom\">\n ${displaySocialMedia\n ? html`\n <div class=\"social-media\">\n <slot name=\"social-media\"></slot>\n </div>\n `\n : nothing}\n <div class=\"footer-mandatory-links\">\n <ul>\n <li><a href=${this.contactHref}>Contact</a></li>\n <li><a href=${this.feedbackHref}>Feedback</a></li>\n <li><a href=${this.faqHref}>FAQ</a></li>\n <li>\n <a href=\"https://tech.gov.sg/report_vulnerability\" target=\"_blank\" rel=\"noopener noreferrer\">\n Report Vulnerability\n </a>\n </li>\n <li><a href=${this.privacyHref}>Privacy Statement</a></li>\n <li><a href=${this.termsOfUseHref}>Terms of use</a></li>\n </ul>\n <div class=\"footer-copyrights\">© ${new Date().getFullYear()}, ${this.copyrightLiner}</div>\n </div>\n </section>\n </footer>\n `;\n }\n}\n\nexport default SgdsFooter;\n"],"names":["SgdsElement","HasSlotController","html","nothing","footerStyle","__decorate","property"],"mappings":";;;;;;;;;;;;AAMA;;;;;;;;AAQG;AACG,MAAO,UAAW,SAAQA,sBAAW,CAAA;AAA3C,IAAA,WAAA,GAAA;;AAGE;;AAEG;QAEH,IAAc,CAAA,cAAA,GAAG,yBAAyB,CAAC;AAE3C;;AAEG;QAEH,IAAW,CAAA,WAAA,GAAG,GAAG,CAAC;AAElB;;AAEG;QAEH,IAAY,CAAA,YAAA,GAAG,GAAG,CAAC;AAEnB;;AAEG;QAEH,IAAO,CAAA,OAAA,GAAG,GAAG,CAAC;AAEd;;AAEG;QAEH,IAAW,CAAA,WAAA,GAAG,GAAG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,EAAA,UAAA,CAAA,SAAA,EAAA,gBAAA,EAAA,KAAA,CAAA,CAAA;;;;;"}
1
+ {"version":3,"file":"sgds-footer.cjs.js","sources":["../../../../src/components/Footer/sgds-footer.ts"],"sourcesContent":["import { html } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport SgdsElement from \"../../base/sgds-element\";\nimport footerStyle from \"./footer.css\";\n\n/**\n * @summary The footer contains supporting information for your service at the bottom of your website. All .gov.sg digital services shall contain a Global Footer Bar across all pages. The Global Footer Bar should include the name of the digital service, contact information, a privacy statement and the terms of use.\n *\n * @slot title - The slot for title\n * @slot description - The slot for description\n * @slot items - The slot for the list of footer items\n * @slot social-media - The slot for the list of social media with icons\n *\n */\nexport class SgdsFooter extends SgdsElement {\n static styles = [...SgdsElement.styles, footerStyle];\n\n /**\n * \tSets copyrightLiner of SgdsFooter\n */\n @property({ type: String })\n copyrightLiner = \"Government of Singapore\";\n\n /**\n * \thref link for contacts\n */\n @property({ type: String })\n contactHref = \"#\";\n\n /**\n * \thref link for feedback\n */\n @property({ type: String })\n feedbackHref = \"#\";\n\n /**\n * \thref link for faq\n */\n @property({ type: String })\n faqHref = \"#\";\n\n /**\n * \thref link for privacy statement\n */\n @property({ type: String })\n privacyHref = \"#\";\n\n /**\n * \thref link for terms of use\n */\n @property({ type: String })\n termsOfUseHref = \"#\";\n\n firstUpdated() {\n const socialMediaSlot = this.shadowRoot.querySelector(\"slot[name='social-media']\") as HTMLSlotElement;\n const footerTitleSlot = this.shadowRoot.querySelector(\"slot[name='title']\") as HTMLSlotElement;\n const footerDescriptionSlot = this.shadowRoot.querySelector(\"slot[name='description']\") as HTMLSlotElement;\n const footerItemsSlot = this.shadowRoot.querySelector(\"slot[name='items']\") as HTMLSlotElement;\n const socialMediaChildNodes = socialMediaSlot.assignedNodes({ flatten: true });\n const footerTitleChildNodes = footerTitleSlot.assignedNodes({ flatten: true });\n const footerDescriptionChildNodes = footerDescriptionSlot.assignedNodes({ flatten: true });\n const footerItemsChildNodes = footerItemsSlot.assignedNodes({ flatten: true });\n if (socialMediaChildNodes.length === 0) {\n const socialMediaContainer = this.shadowRoot.querySelector(\".social-media\") as HTMLDivElement;\n socialMediaContainer.style.display = \"none\";\n }\n\n if (footerTitleChildNodes.length === 0 && footerDescriptionChildNodes.length === 0) {\n const footerHeaderContainer = this.shadowRoot.querySelector(\".footer-header\") as HTMLDivElement;\n footerHeaderContainer.style.display = \"none\";\n }\n\n if (footerItemsChildNodes.length === 0) {\n const footerItemsContainer = this.shadowRoot.querySelector(\".footer-items\") as HTMLDivElement;\n footerItemsContainer.style.display = \"none\";\n }\n\n if (\n footerTitleChildNodes.length === 0 &&\n footerDescriptionChildNodes.length === 0 &&\n footerItemsChildNodes.length === 0\n ) {\n const footerTopContainer = this.shadowRoot.querySelector(\".footer-top\") as HTMLDivElement;\n footerTopContainer.style.display = \"none\";\n }\n }\n\n render() {\n return html`\n <footer class=\"footer\">\n <section class=\"footer-top\">\n <div class=\"footer-header\">\n <slot name=\"title\"></slot>\n <slot name=\"description\"></slot>\n </div>\n <div class=\"footer-items\">\n <slot name=\"items\"></slot>\n </div>\n </section>\n <section class=\"footer-bottom\">\n <div class=\"social-media\">\n <slot name=\"social-media\"></slot>\n </div>\n <div class=\"footer-mandatory-links\">\n <ul>\n <li><a href=${this.contactHref}>Contact</a></li>\n <li><a href=${this.feedbackHref}>Feedback</a></li>\n <li><a href=${this.faqHref}>FAQ</a></li>\n <li>\n <a href=\"https://tech.gov.sg/report_vulnerability\" target=\"_blank\" rel=\"noopener noreferrer\">\n Report Vulnerability\n </a>\n </li>\n <li><a href=${this.privacyHref}>Privacy Statement</a></li>\n <li><a href=${this.termsOfUseHref}>Terms of use</a></li>\n </ul>\n <div class=\"footer-copyrights\">© ${new Date().getFullYear()}, ${this.copyrightLiner}</div>\n </div>\n </section>\n </footer>\n `;\n }\n}\n\nexport default SgdsFooter;\n"],"names":["SgdsElement","html","footerStyle","__decorate","property"],"mappings":";;;;;;;;;;;AAK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from 'lit';
4
4
  import { property } from 'lit/decorators.js';
5
5
  import SgdsElement from '../../base/sgds-element.js';
6
- import { HasSlotController } from '../../utils/slot.js';
7
6
  import css_248z from './footer.js';
8
7
 
9
8
  /**
@@ -42,45 +41,51 @@ class SgdsFooter extends SgdsElement {
42
41
  * href link for terms of use
43
42
  */
44
43
  this.termsOfUseHref = "#";
45
- this.hasSlotController = new HasSlotController(this, "social-media", "title", "description", "items");
44
+ }
45
+ firstUpdated() {
46
+ const socialMediaSlot = this.shadowRoot.querySelector("slot[name='social-media']");
47
+ const footerTitleSlot = this.shadowRoot.querySelector("slot[name='title']");
48
+ const footerDescriptionSlot = this.shadowRoot.querySelector("slot[name='description']");
49
+ const footerItemsSlot = this.shadowRoot.querySelector("slot[name='items']");
50
+ const socialMediaChildNodes = socialMediaSlot.assignedNodes({ flatten: true });
51
+ const footerTitleChildNodes = footerTitleSlot.assignedNodes({ flatten: true });
52
+ const footerDescriptionChildNodes = footerDescriptionSlot.assignedNodes({ flatten: true });
53
+ const footerItemsChildNodes = footerItemsSlot.assignedNodes({ flatten: true });
54
+ if (socialMediaChildNodes.length === 0) {
55
+ const socialMediaContainer = this.shadowRoot.querySelector(".social-media");
56
+ socialMediaContainer.style.display = "none";
57
+ }
58
+ if (footerTitleChildNodes.length === 0 && footerDescriptionChildNodes.length === 0) {
59
+ const footerHeaderContainer = this.shadowRoot.querySelector(".footer-header");
60
+ footerHeaderContainer.style.display = "none";
61
+ }
62
+ if (footerItemsChildNodes.length === 0) {
63
+ const footerItemsContainer = this.shadowRoot.querySelector(".footer-items");
64
+ footerItemsContainer.style.display = "none";
65
+ }
66
+ if (footerTitleChildNodes.length === 0 &&
67
+ footerDescriptionChildNodes.length === 0 &&
68
+ footerItemsChildNodes.length === 0) {
69
+ const footerTopContainer = this.shadowRoot.querySelector(".footer-top");
70
+ footerTopContainer.style.display = "none";
71
+ }
46
72
  }
47
73
  render() {
48
- const hasSocialMediaSlot = this.hasSlotController.test("social-media");
49
- const hasTitleSlot = this.hasSlotController.test("title");
50
- const hasDescriptionSlot = this.hasSlotController.test("description");
51
- const hasItemsSlot = this.hasSlotController.test("items");
52
- const displayFooterHeader = hasTitleSlot || hasDescriptionSlot;
53
- const displayFooterItems = hasItemsSlot;
54
- const displaySocialMedia = hasSocialMediaSlot;
55
- const displayFooterTop = displayFooterHeader || displayFooterItems;
56
74
  return html `
57
75
  <footer class="footer">
58
- ${displayFooterTop
59
- ? html ` <section class="footer-top">
60
- ${displayFooterHeader
61
- ? html `
62
- <div class="footer-header">
63
- <slot name="title"></slot>
64
- <slot name="description"></slot>
65
- </div>
66
- `
67
- : nothing}
68
- ${displayFooterItems
69
- ? html ` <div class="footer-items">
70
- <slot name="items"></slot>
71
- </div>`
72
- : nothing}
73
- </section>`
74
- : nothing}
75
-
76
+ <section class="footer-top">
77
+ <div class="footer-header">
78
+ <slot name="title"></slot>
79
+ <slot name="description"></slot>
80
+ </div>
81
+ <div class="footer-items">
82
+ <slot name="items"></slot>
83
+ </div>
84
+ </section>
76
85
  <section class="footer-bottom">
77
- ${displaySocialMedia
78
- ? html `
79
- <div class="social-media">
80
- <slot name="social-media"></slot>
81
- </div>
82
- `
83
- : nothing}
86
+ <div class="social-media">
87
+ <slot name="social-media"></slot>
88
+ </div>
84
89
  <div class="footer-mandatory-links">
85
90
  <ul>
86
91
  <li><a href=${this.contactHref}>Contact</a></li>
@@ -1 +1 @@
1
- {"version":3,"file":"sgds-footer.js","sources":["../../../../src/components/Footer/sgds-footer.ts"],"sourcesContent":["import { html, nothing } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport SgdsElement from \"../../base/sgds-element\";\nimport { HasSlotController } from \"../../utils/slot\";\nimport footerStyle from \"./footer.css\";\n\n/**\n * @summary The footer contains supporting information for your service at the bottom of your website. All .gov.sg digital services shall contain a Global Footer Bar across all pages. The Global Footer Bar should include the name of the digital service, contact information, a privacy statement and the terms of use.\n *\n * @slot title - The slot for title\n * @slot description - The slot for description\n * @slot items - The slot for the list of footer items\n * @slot social-media - The slot for the list of social media with icons\n *\n */\nexport class SgdsFooter extends SgdsElement {\n static styles = [...SgdsElement.styles, footerStyle];\n\n /**\n * \tSets copyrightLiner of SgdsFooter\n */\n @property({ type: String })\n copyrightLiner = \"Government of Singapore\";\n\n /**\n * \thref link for contacts\n */\n @property({ type: String })\n contactHref = \"#\";\n\n /**\n * \thref link for feedback\n */\n @property({ type: String })\n feedbackHref = \"#\";\n\n /**\n * \thref link for faq\n */\n @property({ type: String })\n faqHref = \"#\";\n\n /**\n * \thref link for privacy statement\n */\n @property({ type: String })\n privacyHref = \"#\";\n\n /**\n * \thref link for terms of use\n */\n @property({ type: String })\n termsOfUseHref = \"#\";\n\n private readonly hasSlotController = new HasSlotController(this, \"social-media\", \"title\", \"description\", \"items\");\n\n render() {\n const hasSocialMediaSlot = this.hasSlotController.test(\"social-media\");\n const hasTitleSlot = this.hasSlotController.test(\"title\");\n const hasDescriptionSlot = this.hasSlotController.test(\"description\");\n const hasItemsSlot = this.hasSlotController.test(\"items\");\n\n const displayFooterHeader = hasTitleSlot || hasDescriptionSlot;\n const displayFooterItems = hasItemsSlot;\n const displaySocialMedia = hasSocialMediaSlot;\n const displayFooterTop = displayFooterHeader || displayFooterItems;\n\n return html`\n <footer class=\"footer\">\n ${displayFooterTop\n ? html` <section class=\"footer-top\">\n ${displayFooterHeader\n ? html`\n <div class=\"footer-header\">\n <slot name=\"title\"></slot>\n <slot name=\"description\"></slot>\n </div>\n `\n : nothing}\n ${displayFooterItems\n ? html` <div class=\"footer-items\">\n <slot name=\"items\"></slot>\n </div>`\n : nothing}\n </section>`\n : nothing}\n\n <section class=\"footer-bottom\">\n ${displaySocialMedia\n ? html`\n <div class=\"social-media\">\n <slot name=\"social-media\"></slot>\n </div>\n `\n : nothing}\n <div class=\"footer-mandatory-links\">\n <ul>\n <li><a href=${this.contactHref}>Contact</a></li>\n <li><a href=${this.feedbackHref}>Feedback</a></li>\n <li><a href=${this.faqHref}>FAQ</a></li>\n <li>\n <a href=\"https://tech.gov.sg/report_vulnerability\" target=\"_blank\" rel=\"noopener noreferrer\">\n Report Vulnerability\n </a>\n </li>\n <li><a href=${this.privacyHref}>Privacy Statement</a></li>\n <li><a href=${this.termsOfUseHref}>Terms of use</a></li>\n </ul>\n <div class=\"footer-copyrights\">© ${new Date().getFullYear()}, ${this.copyrightLiner}</div>\n </div>\n </section>\n </footer>\n `;\n }\n}\n\nexport default SgdsFooter;\n"],"names":["footerStyle"],"mappings":";;;;;;;;AAMA;;;;;;;;AAQG;AACG,MAAO,UAAW,SAAQ,WAAW,CAAA;AAA3C,IAAA,WAAA,GAAA;;AAGE;;AAEG;QAEH,IAAc,CAAA,cAAA,GAAG,yBAAyB,CAAC;AAE3C;;AAEG;QAEH,IAAW,CAAA,WAAA,GAAG,GAAG,CAAC;AAElB;;AAEG;QAEH,IAAY,CAAA,YAAA,GAAG,GAAG,CAAC;AAEnB;;AAEG;QAEH,IAAO,CAAA,OAAA,GAAG,GAAG,CAAC;AAEd;;AAEG;QAEH,IAAW,CAAA,WAAA,GAAG,GAAG,CAAC;AAElB;;AAEG;QAEH,IAAc,CAAA,cAAA,GAAG,GAAG,CAAC;AAEJ,QAAA,IAAA,CAAA,iBAAiB,GAAG,IAAI,iBAAiB,CAAC,IAAI,EAAE,cAAc,EAAE,OAAO,EAAE,aAAa,EAAE,OAAO,CAAC,CAAC;KA4DnH;IA1DC,MAAM,GAAA;QACJ,MAAM,kBAAkB,GAAG,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QACvE,MAAM,YAAY,GAAG,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC1D,MAAM,kBAAkB,GAAG,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACtE,MAAM,YAAY,GAAG,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAE1D,QAAA,MAA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A,EAAA,UAAA,CAAA,SAAA,EAAA,aAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAMlB,UAAA,CAAA;AADC,IAAA,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AACR,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,cAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAMnB,UAAA,CAAA;AADC,IAAA,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AACb,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,SAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAMd,UAAA,CAAA;AADC,IAAA,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AACT,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,aAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAMlB,UAAA,CAAA;AADC,IAAA,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AACN,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,gBAAA,EAAA,KAAA,CAAA,CAAA;;;;"}
1
+ {"version":3,"file":"sgds-footer.js","sources":["../../../../src/components/Footer/sgds-footer.ts"],"sourcesContent":["import { html } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport SgdsElement from \"../../base/sgds-element\";\nimport footerStyle from \"./footer.css\";\n\n/**\n * @summary The footer contains supporting information for your service at the bottom of your website. All .gov.sg digital services shall contain a Global Footer Bar across all pages. The Global Footer Bar should include the name of the digital service, contact information, a privacy statement and the terms of use.\n *\n * @slot title - The slot for title\n * @slot description - The slot for description\n * @slot items - The slot for the list of footer items\n * @slot social-media - The slot for the list of social media with icons\n *\n */\nexport class SgdsFooter extends SgdsElement {\n static styles = [...SgdsElement.styles, footerStyle];\n\n /**\n * \tSets copyrightLiner of SgdsFooter\n */\n @property({ type: String })\n copyrightLiner = \"Government of Singapore\";\n\n /**\n * \thref link for contacts\n */\n @property({ type: String })\n contactHref = \"#\";\n\n /**\n * \thref link for feedback\n */\n @property({ type: String })\n feedbackHref = \"#\";\n\n /**\n * \thref link for faq\n */\n @property({ type: String })\n faqHref = \"#\";\n\n /**\n * \thref link for privacy statement\n */\n @property({ type: String })\n privacyHref = \"#\";\n\n /**\n * \thref link for terms of use\n */\n @property({ type: String })\n termsOfUseHref = \"#\";\n\n firstUpdated() {\n const socialMediaSlot = this.shadowRoot.querySelector(\"slot[name='social-media']\") as HTMLSlotElement;\n const footerTitleSlot = this.shadowRoot.querySelector(\"slot[name='title']\") as HTMLSlotElement;\n const footerDescriptionSlot = this.shadowRoot.querySelector(\"slot[name='description']\") as HTMLSlotElement;\n const footerItemsSlot = this.shadowRoot.querySelector(\"slot[name='items']\") as HTMLSlotElement;\n const socialMediaChildNodes = socialMediaSlot.assignedNodes({ flatten: true });\n const footerTitleChildNodes = footerTitleSlot.assignedNodes({ flatten: true });\n const footerDescriptionChildNodes = footerDescriptionSlot.assignedNodes({ flatten: true });\n const footerItemsChildNodes = footerItemsSlot.assignedNodes({ flatten: true });\n if (socialMediaChildNodes.length === 0) {\n const socialMediaContainer = this.shadowRoot.querySelector(\".social-media\") as HTMLDivElement;\n socialMediaContainer.style.display = \"none\";\n }\n\n if (footerTitleChildNodes.length === 0 && footerDescriptionChildNodes.length === 0) {\n const footerHeaderContainer = this.shadowRoot.querySelector(\".footer-header\") as HTMLDivElement;\n footerHeaderContainer.style.display = \"none\";\n }\n\n if (footerItemsChildNodes.length === 0) {\n const footerItemsContainer = this.shadowRoot.querySelector(\".footer-items\") as HTMLDivElement;\n footerItemsContainer.style.display = \"none\";\n }\n\n if (\n footerTitleChildNodes.length === 0 &&\n footerDescriptionChildNodes.length === 0 &&\n footerItemsChildNodes.length === 0\n ) {\n const footerTopContainer = this.shadowRoot.querySelector(\".footer-top\") as HTMLDivElement;\n footerTopContainer.style.display = \"none\";\n }\n }\n\n render() {\n return html`\n <footer class=\"footer\">\n <section class=\"footer-top\">\n <div class=\"footer-header\">\n <slot name=\"title\"></slot>\n <slot name=\"description\"></slot>\n </div>\n <div class=\"footer-items\">\n <slot name=\"items\"></slot>\n </div>\n </section>\n <section class=\"footer-bottom\">\n <div class=\"social-media\">\n <slot name=\"social-media\"></slot>\n </div>\n <div class=\"footer-mandatory-links\">\n <ul>\n <li><a href=${this.contactHref}>Contact</a></li>\n <li><a href=${this.feedbackHref}>Feedback</a></li>\n <li><a href=${this.faqHref}>FAQ</a></li>\n <li>\n <a href=\"https://tech.gov.sg/report_vulnerability\" target=\"_blank\" rel=\"noopener noreferrer\">\n Report Vulnerability\n </a>\n </li>\n <li><a href=${this.privacyHref}>Privacy Statement</a></li>\n <li><a href=${this.termsOfUseHref}>Terms of use</a></li>\n </ul>\n <div class=\"footer-copyrights\">© ${new Date().getFullYear()}, ${this.copyrightLiner}</div>\n </div>\n </section>\n </footer>\n `;\n }\n}\n\nexport default SgdsFooter;\n"],"names":["footerStyle"],"mappings":";;;;;;;AAKA;;;;;;;;AAQG;AACG,MAAO,UAAW,SAAQ,WAAW,CAAA;AAA3C,IAAA,WAAA,GAAA;;AAGE;;AAEG;QAEH,IAAc,CAAA,cAAA,GAAG,yBAAyB,CAAC;AAE3C;;AAEG;QAEH,IAAW,CAAA,WAAA,GAAG,GAAG,CAAC;AAElB;;AAEG;QAEH,IAAY,CAAA,YAAA,GAAG,GAAG,CAAC;AAEnB;;AAEG;QAEH,IAAO,CAAA,OAAA,GAAG,GAAG,CAAC;AAEd;;AAEG;QAEH,IAAW,CAAA,WAAA,GAAG,GAAG,CAAC;AAElB;;AAEG;QAEH,IAAc,CAAA,cAAA,GAAG,GAAG,CAAC;KAuEtB;IArEC,YAAY,GAAA;QACV,MAAM,eAAe,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,2BAA2B,CAAoB,CAAC;QACtG,MAAM,eAAe,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,oBAAoB,CAAoB,CAAC;QAC/F,MAAM,qBAAqB,GAAG,IAA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A;AAMnB,UAAA,CAAA;AADC,IAAA,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AACb,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,SAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAMd,UAAA,CAAA;AADC,IAAA,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AACT,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,aAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAMlB,UAAA,CAAA;AADC,IAAA,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AACN,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,gBAAA,EAAA,KAAA,CAAA,CAAA;;;;"}
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
6
  var lit = require('lit');
7
7
 
8
- var css_248z = lit.css`.nav-link::slotted(a){align-items:center;color:var(--sgds-link-color-default);cursor:pointer;display:inline-flex;flex-shrink:0;gap:var(--sgds-gap-2-xs);height:var(--sgds-dimension-24);justify-content:center;text-decoration:none!important}.nav-link::slotted(a:focus),.nav-link::slotted(a:focus-visible),.nav-link::slotted(a:hover),.nav-link::slotted(a[active]){color:var( --sgds-link-color-emphasis)}.nav-link::slotted(a:focus),.nav-link::slotted(a:focus-visible){box-shadow:var(--sgds-box-shadow-focus);outline:0}.nav-link::slotted(a[disabled]){cursor:not-allowed;opacity:var(--sgds-opacity-50)}:host([variant=danger]) .nav-link::slotted(a){--sgds-link-color-default:var(--sgds-danger-color-default);color:var(--sgds-link-color-default,--sgds-danger-color-default)}:host([variant=danger]) .nav-link::slotted(a:focus),:host([variant=danger]) .nav-link::slotted(a:focus-visible),:host([variant=danger]) .nav-link::slotted(a:hover){--sgds-link-color-emphasis:var(--sgds-danger-color-emphasis);color:var(--sgds-link-color-emphasis,--sgds-danger-color-emphasis)}:host([variant=light]) .nav-link::slotted(a){--sgds-link-color-default:var(--sgds-color-fixed-light);color:var(--sgds-link-color-default,--sgds-color-fixed-light)}:host([variant=light]) .nav-link::slotted(a:focus),:host([variant=light]) .nav-link::slotted(a:focus-visible),:host([variant=light]) .nav-link::slotted(a:hover){--sgds-link-color-emphasis:var(--sgds-color-fixed-light);color:var(--sgds-link-color-emphasis,--sgds-color-fixed-light)}:host([variant=dark]) .nav-link::slotted(a){--sgds-link-color-default:var(--sgds-color-fixed-dark);color:var(--sgds-link-color-default,--sgds-color-fixed-dark)}:host([variant=dark]) .nav-link::slotted(a:focus),:host([variant=dark]) .nav-link::slotted(a:focus-visible),:host([variant=dark]) .nav-link::slotted(a:hover){--sgds-link-color-emphasis:var(--sgds-color-fixed-dark);color:var(--sgds-link-color-emphasis,--sgds-color-fixed-dark)}:host([size=lg]) .nav-link::slotted(a){font-size:var(--sgds-font-size-3)!important;height:var(--sgds-dimension-32)}:host([size=sm]) .nav-link::slotted(a){font-size:var(--sgds-font-size-1)!important;height:var(--sgds-dimension-20)}`;
8
+ var css_248z = lit.css`.nav-link::slotted(a){align-items:center;color:var(--sgds-link-color-default);cursor:pointer;display:inline-flex;flex-shrink:0;gap:var(--sgds-gap-2-xs);justify-content:center;line-height:var(--sgds-line-height-body);text-decoration:none!important}.nav-link::slotted(a:focus),.nav-link::slotted(a:focus-visible),.nav-link::slotted(a:hover),.nav-link::slotted(a[active]){color:var( --sgds-link-color-emphasis)}.nav-link::slotted(a:focus),.nav-link::slotted(a:focus-visible){outline:0}.nav-link::slotted(a:focus-visible:not([disabled])),.nav-link::slotted(a:focus:not([disabled])){box-shadow:var(--sgds-box-shadow-focus)}.nav-link::slotted(a[disabled]){cursor:not-allowed;opacity:var(--sgds-opacity-50)}:host([variant=danger]) .nav-link::slotted(a){--sgds-link-color-default:var(--sgds-danger-color-default);color:var(--sgds-link-color-default,--sgds-danger-color-default)}:host([variant=danger]) .nav-link::slotted(a:focus),:host([variant=danger]) .nav-link::slotted(a:focus-visible),:host([variant=danger]) .nav-link::slotted(a:hover){--sgds-link-color-emphasis:var(--sgds-danger-color-emphasis);color:var(--sgds-link-color-emphasis,--sgds-danger-color-emphasis)}:host([variant=neutral]) .nav-link::slotted(a){--sgds-link-color-default:var(--sgds-color-default);color:var(--sgds-link-color-default,--sgds-color-default)}:host([variant=neutral]) .nav-link::slotted(a:focus),:host([variant=neutral]) .nav-link::slotted(a:focus-visible),:host([variant=neutral]) .nav-link::slotted(a:hover){--sgds-link-color-emphasis:var(--sgds-color-default);color:var(--sgds-link-color-emphasis,--sgds-color-default)}:host([variant=light]) .nav-link::slotted(a){--sgds-link-color-default:var(--sgds-color-fixed-light);color:var(--sgds-link-color-default,--sgds-color-fixed-light)}:host([variant=light]) .nav-link::slotted(a:focus),:host([variant=light]) .nav-link::slotted(a:focus-visible),:host([variant=light]) .nav-link::slotted(a:hover){--sgds-link-color-emphasis:var(--sgds-color-fixed-light);color:var(--sgds-link-color-emphasis,--sgds-color-fixed-light)}:host([variant=dark]) .nav-link::slotted(a){--sgds-link-color-default:var(--sgds-color-fixed-dark);color:var(--sgds-link-color-default,--sgds-color-fixed-dark)}:host([variant=dark]) .nav-link::slotted(a:focus),:host([variant=dark]) .nav-link::slotted(a:focus-visible),:host([variant=dark]) .nav-link::slotted(a:hover){--sgds-link-color-emphasis:var(--sgds-color-fixed-dark);color:var(--sgds-link-color-emphasis,--sgds-color-fixed-dark)}:host([size=lg]) .nav-link::slotted(a){font-size:var(--sgds-font-size-3)!important}:host([size=sm]) .nav-link::slotted(a){font-size:var(--sgds-font-size-1)!important;line-height:var(--sgds-line-height-min)}:host([size=xs]) .nav-link::slotted(a){font-size:var(--sgds-font-size-0)!important;line-height:var(--sgds-line-height-16)}`;
9
9
 
10
10
  exports["default"] = css_248z;
11
11
  //# sourceMappingURL=link.cjs.js.map
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import { css } from 'lit';
3
3
 
4
- var css_248z = css`.nav-link::slotted(a){align-items:center;color:var(--sgds-link-color-default);cursor:pointer;display:inline-flex;flex-shrink:0;gap:var(--sgds-gap-2-xs);height:var(--sgds-dimension-24);justify-content:center;text-decoration:none!important}.nav-link::slotted(a:focus),.nav-link::slotted(a:focus-visible),.nav-link::slotted(a:hover),.nav-link::slotted(a[active]){color:var( --sgds-link-color-emphasis)}.nav-link::slotted(a:focus),.nav-link::slotted(a:focus-visible){box-shadow:var(--sgds-box-shadow-focus);outline:0}.nav-link::slotted(a[disabled]){cursor:not-allowed;opacity:var(--sgds-opacity-50)}:host([variant=danger]) .nav-link::slotted(a){--sgds-link-color-default:var(--sgds-danger-color-default);color:var(--sgds-link-color-default,--sgds-danger-color-default)}:host([variant=danger]) .nav-link::slotted(a:focus),:host([variant=danger]) .nav-link::slotted(a:focus-visible),:host([variant=danger]) .nav-link::slotted(a:hover){--sgds-link-color-emphasis:var(--sgds-danger-color-emphasis);color:var(--sgds-link-color-emphasis,--sgds-danger-color-emphasis)}:host([variant=light]) .nav-link::slotted(a){--sgds-link-color-default:var(--sgds-color-fixed-light);color:var(--sgds-link-color-default,--sgds-color-fixed-light)}:host([variant=light]) .nav-link::slotted(a:focus),:host([variant=light]) .nav-link::slotted(a:focus-visible),:host([variant=light]) .nav-link::slotted(a:hover){--sgds-link-color-emphasis:var(--sgds-color-fixed-light);color:var(--sgds-link-color-emphasis,--sgds-color-fixed-light)}:host([variant=dark]) .nav-link::slotted(a){--sgds-link-color-default:var(--sgds-color-fixed-dark);color:var(--sgds-link-color-default,--sgds-color-fixed-dark)}:host([variant=dark]) .nav-link::slotted(a:focus),:host([variant=dark]) .nav-link::slotted(a:focus-visible),:host([variant=dark]) .nav-link::slotted(a:hover){--sgds-link-color-emphasis:var(--sgds-color-fixed-dark);color:var(--sgds-link-color-emphasis,--sgds-color-fixed-dark)}:host([size=lg]) .nav-link::slotted(a){font-size:var(--sgds-font-size-3)!important;height:var(--sgds-dimension-32)}:host([size=sm]) .nav-link::slotted(a){font-size:var(--sgds-font-size-1)!important;height:var(--sgds-dimension-20)}`;
4
+ var css_248z = css`.nav-link::slotted(a){align-items:center;color:var(--sgds-link-color-default);cursor:pointer;display:inline-flex;flex-shrink:0;gap:var(--sgds-gap-2-xs);justify-content:center;line-height:var(--sgds-line-height-body);text-decoration:none!important}.nav-link::slotted(a:focus),.nav-link::slotted(a:focus-visible),.nav-link::slotted(a:hover),.nav-link::slotted(a[active]){color:var( --sgds-link-color-emphasis)}.nav-link::slotted(a:focus),.nav-link::slotted(a:focus-visible){outline:0}.nav-link::slotted(a:focus-visible:not([disabled])),.nav-link::slotted(a:focus:not([disabled])){box-shadow:var(--sgds-box-shadow-focus)}.nav-link::slotted(a[disabled]){cursor:not-allowed;opacity:var(--sgds-opacity-50)}:host([variant=danger]) .nav-link::slotted(a){--sgds-link-color-default:var(--sgds-danger-color-default);color:var(--sgds-link-color-default,--sgds-danger-color-default)}:host([variant=danger]) .nav-link::slotted(a:focus),:host([variant=danger]) .nav-link::slotted(a:focus-visible),:host([variant=danger]) .nav-link::slotted(a:hover){--sgds-link-color-emphasis:var(--sgds-danger-color-emphasis);color:var(--sgds-link-color-emphasis,--sgds-danger-color-emphasis)}:host([variant=neutral]) .nav-link::slotted(a){--sgds-link-color-default:var(--sgds-color-default);color:var(--sgds-link-color-default,--sgds-color-default)}:host([variant=neutral]) .nav-link::slotted(a:focus),:host([variant=neutral]) .nav-link::slotted(a:focus-visible),:host([variant=neutral]) .nav-link::slotted(a:hover){--sgds-link-color-emphasis:var(--sgds-color-default);color:var(--sgds-link-color-emphasis,--sgds-color-default)}:host([variant=light]) .nav-link::slotted(a){--sgds-link-color-default:var(--sgds-color-fixed-light);color:var(--sgds-link-color-default,--sgds-color-fixed-light)}:host([variant=light]) .nav-link::slotted(a:focus),:host([variant=light]) .nav-link::slotted(a:focus-visible),:host([variant=light]) .nav-link::slotted(a:hover){--sgds-link-color-emphasis:var(--sgds-color-fixed-light);color:var(--sgds-link-color-emphasis,--sgds-color-fixed-light)}:host([variant=dark]) .nav-link::slotted(a){--sgds-link-color-default:var(--sgds-color-fixed-dark);color:var(--sgds-link-color-default,--sgds-color-fixed-dark)}:host([variant=dark]) .nav-link::slotted(a:focus),:host([variant=dark]) .nav-link::slotted(a:focus-visible),:host([variant=dark]) .nav-link::slotted(a:hover){--sgds-link-color-emphasis:var(--sgds-color-fixed-dark);color:var(--sgds-link-color-emphasis,--sgds-color-fixed-dark)}:host([size=lg]) .nav-link::slotted(a){font-size:var(--sgds-font-size-3)!important}:host([size=sm]) .nav-link::slotted(a){font-size:var(--sgds-font-size-1)!important;line-height:var(--sgds-line-height-min)}:host([size=xs]) .nav-link::slotted(a){font-size:var(--sgds-font-size-0)!important;line-height:var(--sgds-line-height-16)}`;
5
5
 
6
6
  export { css_248z as default };
7
7
  //# sourceMappingURL=link.js.map
@@ -22,7 +22,7 @@ class SgdsLink extends sgdsElement["default"] {
22
22
  /** when true, sets the active stylings of the link */
23
23
  this.variant = "primary";
24
24
  }
25
- _handleSlotChange(e) {
25
+ _handleSlotChange() {
26
26
  const anchor = this.querySelector("a");
27
27
  if (anchor) {
28
28
  if (anchor.hasAttribute("disabled")) {
@@ -1 +1 @@
1
- {"version":3,"file":"sgds-link.cjs.js","sources":["../../../../src/components/Link/sgds-link.ts"],"sourcesContent":["import { html } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport SgdsElement from \"../../base/sgds-element\";\nimport linkStyles from \"./link.css\";\n/**\n * @summary Link allows users to click and navigate their way from page to page\n *\n * @slot default - Pass in a single anchor tag here\n */\nexport class SgdsLink extends SgdsElement {\n static styles = [...SgdsElement.styles, linkStyles];\n /** Determines the size of the link */\n @property({ type: String, reflect: true })\n size: \"sm\" | \"md\" | \"lg\" = \"md\";\n /** when true, sets the active stylings of the link */\n @property({ type: String, reflect: true })\n variant: \"primary\" | \"danger\" | \"light\" | \"dark\" = \"primary\";\n\n private _handleSlotChange(e: Event) {\n const anchor = this.querySelector(\"a\");\n if (anchor) {\n if (anchor.hasAttribute(\"disabled\")) {\n anchor.setAttribute(\"href\", \"javascript:void(0)\");\n anchor.setAttribute(\"tabindex\", \"-1\");\n } else {\n anchor.setAttribute(\"tabindex\", \"0\");\n }\n }\n }\n\n render() {\n /** When removing href, link is no longer focusable */\n return html`<slot class=\"nav-link\" @slotchange=${this._handleSlotChange}></slot>`;\n }\n}\n\nexport default SgdsLink;\n"],"names":["SgdsElement","html","linkStyles","__decorate","property"],"mappings":";;;;;;;;;;;AAIA;;;;AAIG;AACG,MAAO,QAAS,SAAQA,sBAAW,CAAA;AAAzC,IAAA,WAAA,GAAA;;;QAIE,IAAI,CAAA,IAAA,GAAuB,IAAI,CAAC;;QAGhC,IAAO,CAAA,OAAA,GAA4C,SAAS,CAAC;KAkB9D;AAhBS,IAAA,iBAAiB,CAAC,CAAQ,EAAA;QAChC,MAAM,MAAM,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;QACvC,IAAI,MAAM,EAAE;AACV,YAAA,IAAI,MAAM,CAAC,YAAY,CAAC,UAAU,CAAC,EAAE;AACnC,gBAAA,MAAM,CAAC,YAAY,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;AAClD,gBAAA,MAAM,CAAC,YAAY,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;aACvC;iBAAM;AACL,gBAAA,MAAM,CAAC,YAAY,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC;aACtC;SACF;KACF;IAED,MAAM,GAAA;;AAEJ,QAAA,OAAOC,QAAI,CAAA,CAAA,mCAAA,EAAsC,IAAI,CAAC,iBAAiB,UAAU,CAAC;KACnF;;AAvBM,QAAM,CAAA,MAAA,GAAG,CAAC,GAAGD,sBAAW,CAAC,MAAM,EAAEE,eAAU,CAArC,CAAuC;AAGpDC,gBAAA,CAAA;IADCC,sBAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AACV,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,MAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAGhCD,gBAAA,CAAA;IADCC,sBAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AACmB,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,SAAA,EAAA,KAAA,CAAA,CAAA;;;;;"}
1
+ {"version":3,"file":"sgds-link.cjs.js","sources":["../../../../src/components/Link/sgds-link.ts"],"sourcesContent":["import { html } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport SgdsElement from \"../../base/sgds-element\";\nimport linkStyles from \"./link.css\";\n/**\n * @summary Link allows users to click and navigate their way from page to page\n *\n * @slot default - Pass in a single anchor tag here\n */\nexport class SgdsLink extends SgdsElement {\n static styles = [...SgdsElement.styles, linkStyles];\n /** Determines the size of the link */\n @property({ type: String, reflect: true })\n size: \"xs\" | \"sm\" | \"md\" | \"lg\" = \"md\";\n /** when true, sets the active stylings of the link */\n @property({ type: String, reflect: true })\n variant: \"primary\" | \"danger\" | \"neutral\" | \"light\" | \"dark\" = \"primary\";\n\n private _handleSlotChange() {\n const anchor = this.querySelector(\"a\");\n if (anchor) {\n if (anchor.hasAttribute(\"disabled\")) {\n anchor.setAttribute(\"href\", \"javascript:void(0)\");\n anchor.setAttribute(\"tabindex\", \"-1\");\n } else {\n anchor.setAttribute(\"tabindex\", \"0\");\n }\n }\n }\n\n render() {\n /** When removing href, link is no longer focusable */\n return html`<slot class=\"nav-link\" @slotchange=${this._handleSlotChange}></slot>`;\n }\n}\n\nexport default SgdsLink;\n"],"names":["SgdsElement","html","linkStyles","__decorate","property"],"mappings":";;;;;;;;;;;AAIA;;;;AAIG;AACG,MAAO,QAAS,SAAQA,sBAAW,CAAA;AAAzC,IAAA,WAAA,GAAA;;;QAIE,IAAI,CAAA,IAAA,GAA8B,IAAI,CAAC;;QAGvC,IAAO,CAAA,OAAA,GAAwD,SAAS,CAAC;KAkB1E;IAhBS,iBAAiB,GAAA;QACvB,MAAM,MAAM,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;QACvC,IAAI,MAAM,EAAE;AACV,YAAA,IAAI,MAAM,CAAC,YAAY,CAAC,UAAU,CAAC,EAAE;AACnC,gBAAA,MAAM,CAAC,YAAY,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;AAClD,gBAAA,MAAM,CAAC,YAAY,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;aACvC;iBAAM;AACL,gBAAA,MAAM,CAAC,YAAY,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC;aACtC;SACF;KACF;IAED,MAAM,GAAA;;AAEJ,QAAA,OAAOC,QAAI,CAAA,CAAA,mCAAA,EAAsC,IAAI,CAAC,iBAAiB,UAAU,CAAC;KACnF;;AAvBM,QAAM,CAAA,MAAA,GAAG,CAAC,GAAGD,sBAAW,CAAC,MAAM,EAAEE,eAAU,CAArC,CAAuC;AAGpDC,gBAAA,CAAA;IADCC,sBAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AACH,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,MAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAGvCD,gBAAA,CAAA;IADCC,sBAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAC+B,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,SAAA,EAAA,KAAA,CAAA,CAAA;;;;;"}
@@ -18,7 +18,7 @@ class SgdsLink extends SgdsElement {
18
18
  /** when true, sets the active stylings of the link */
19
19
  this.variant = "primary";
20
20
  }
21
- _handleSlotChange(e) {
21
+ _handleSlotChange() {
22
22
  const anchor = this.querySelector("a");
23
23
  if (anchor) {
24
24
  if (anchor.hasAttribute("disabled")) {
@@ -1 +1 @@
1
- {"version":3,"file":"sgds-link.js","sources":["../../../../src/components/Link/sgds-link.ts"],"sourcesContent":["import { html } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport SgdsElement from \"../../base/sgds-element\";\nimport linkStyles from \"./link.css\";\n/**\n * @summary Link allows users to click and navigate their way from page to page\n *\n * @slot default - Pass in a single anchor tag here\n */\nexport class SgdsLink extends SgdsElement {\n static styles = [...SgdsElement.styles, linkStyles];\n /** Determines the size of the link */\n @property({ type: String, reflect: true })\n size: \"sm\" | \"md\" | \"lg\" = \"md\";\n /** when true, sets the active stylings of the link */\n @property({ type: String, reflect: true })\n variant: \"primary\" | \"danger\" | \"light\" | \"dark\" = \"primary\";\n\n private _handleSlotChange(e: Event) {\n const anchor = this.querySelector(\"a\");\n if (anchor) {\n if (anchor.hasAttribute(\"disabled\")) {\n anchor.setAttribute(\"href\", \"javascript:void(0)\");\n anchor.setAttribute(\"tabindex\", \"-1\");\n } else {\n anchor.setAttribute(\"tabindex\", \"0\");\n }\n }\n }\n\n render() {\n /** When removing href, link is no longer focusable */\n return html`<slot class=\"nav-link\" @slotchange=${this._handleSlotChange}></slot>`;\n }\n}\n\nexport default SgdsLink;\n"],"names":["linkStyles"],"mappings":";;;;;;;AAIA;;;;AAIG;AACG,MAAO,QAAS,SAAQ,WAAW,CAAA;AAAzC,IAAA,WAAA,GAAA;;;QAIE,IAAI,CAAA,IAAA,GAAuB,IAAI,CAAC;;QAGhC,IAAO,CAAA,OAAA,GAA4C,SAAS,CAAC;KAkB9D;AAhBS,IAAA,iBAAiB,CAAC,CAAQ,EAAA;QAChC,MAAM,MAAM,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;QACvC,IAAI,MAAM,EAAE;AACV,YAAA,IAAI,MAAM,CAAC,YAAY,CAAC,UAAU,CAAC,EAAE;AACnC,gBAAA,MAAM,CAAC,YAAY,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;AAClD,gBAAA,MAAM,CAAC,YAAY,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;aACvC;iBAAM;AACL,gBAAA,MAAM,CAAC,YAAY,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC;aACtC;SACF;KACF;IAED,MAAM,GAAA;;AAEJ,QAAA,OAAO,IAAI,CAAA,CAAA,mCAAA,EAAsC,IAAI,CAAC,iBAAiB,UAAU,CAAC;KACnF;;AAvBM,QAAM,CAAA,MAAA,GAAG,CAAC,GAAG,WAAW,CAAC,MAAM,EAAEA,QAAU,CAArC,CAAuC;AAGpD,UAAA,CAAA;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AACV,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,MAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAGhC,UAAA,CAAA;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AACmB,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,SAAA,EAAA,KAAA,CAAA,CAAA;;;;"}
1
+ {"version":3,"file":"sgds-link.js","sources":["../../../../src/components/Link/sgds-link.ts"],"sourcesContent":["import { html } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport SgdsElement from \"../../base/sgds-element\";\nimport linkStyles from \"./link.css\";\n/**\n * @summary Link allows users to click and navigate their way from page to page\n *\n * @slot default - Pass in a single anchor tag here\n */\nexport class SgdsLink extends SgdsElement {\n static styles = [...SgdsElement.styles, linkStyles];\n /** Determines the size of the link */\n @property({ type: String, reflect: true })\n size: \"xs\" | \"sm\" | \"md\" | \"lg\" = \"md\";\n /** when true, sets the active stylings of the link */\n @property({ type: String, reflect: true })\n variant: \"primary\" | \"danger\" | \"neutral\" | \"light\" | \"dark\" = \"primary\";\n\n private _handleSlotChange() {\n const anchor = this.querySelector(\"a\");\n if (anchor) {\n if (anchor.hasAttribute(\"disabled\")) {\n anchor.setAttribute(\"href\", \"javascript:void(0)\");\n anchor.setAttribute(\"tabindex\", \"-1\");\n } else {\n anchor.setAttribute(\"tabindex\", \"0\");\n }\n }\n }\n\n render() {\n /** When removing href, link is no longer focusable */\n return html`<slot class=\"nav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7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
6
  var lit = require('lit');
7
7
 
8
- var css_248z = lit.css`:host([expand=always]) ::slotted(*){border-bottom:var(--sgds-border-width-4) solid transparent;min-height:100%;padding:0 var(--sgds-padding-md)}@media screen and (min-width:512px){:host([expand=sm]) ::slotted(*){border-bottom:var(--sgds-border-width-4) solid transparent;min-height:100%;padding:0 var(--sgds-padding-md)}:host(:not([disabled])[active][expand=sm]) ::slotted(*){border-color:var(--sgds-primary-border-color-default)}:host([expand=sm]) ::slotted(a:focus-visible){box-shadow:var(--sgds-box-shadow-focus)}}@media screen and (min-width:768px){:host([expand=md]) ::slotted(*){border-bottom:var(--sgds-border-width-4) solid transparent;min-height:100%;padding:0 var(--sgds-padding-md)}:host(:not([disabled])[active][expand=md]) ::slotted(*){border-color:var(--sgds-primary-border-color-default)}:host([expand=md]) ::slotted(a:focus-visible){box-shadow:var(--sgds-box-shadow-focus)}}@media screen and (min-width:1024px){:host([expand=lg]) ::slotted(*){border-bottom:var(--sgds-border-width-4) solid transparent;min-height:100%;padding:0 var(--sgds-padding-md)}:host(:not([disabled])[active][expand=lg]) ::slotted(*){border-color:var(--sgds-primary-border-color-default)}:host([expand=lg]) ::slotted(a:focus-visible){box-shadow:var(--sgds-box-shadow-focus)}}@media screen and (min-width:1280px){:host([expand=xl]) ::slotted(*){border-bottom:var(--sgds-border-width-4) solid transparent;min-height:100%;padding:0 var(--sgds-padding-md)}:host(:not([disabled])[active][expand=xl]) ::slotted(*){border-color:var(--sgds-primary-border-color-default)}:host([expand=xl]) ::slotted(a:focus-visible){box-shadow:var(--sgds-box-shadow-focus)}}@media screen and (min-width:1440px){:host([expand=xxl]) ::slotted(*){border-bottom:var(--sgds-border-width-4) solid transparent;min-height:100%;padding:0 var(--sgds-padding-md)}:host(:not([disabled])[active][expand=xxl]) ::slotted(*){border-color:var(--sgds-primary-border-color-default)}:host([expand=xxl]) ::slotted(a:focus-visible){box-shadow:var(--sgds-box-shadow-focus)}}@media screen and (max-width:511px){:host(:not([disabled])[active][expand=sm]) ::slotted(*){background-color:var(--sgds-bg-translucent-subtle)}}@media screen and (max-width:767px){:host(:not([disabled])[active][expand=md]) ::slotted(*){background-color:var(--sgds-bg-translucent-subtle)}}@media screen and (max-width:1023px){:host(:not([disabled])[active][expand=lg]) ::slotted(*){background-color:var(--sgds-bg-translucent-subtle)}}@media screen and (max-width:1279px){:host(:not([disabled])[active][expand=xl]) ::slotted(*){background-color:var(--sgds-bg-translucent-subtle)}}@media screen and (max-width:1439px){:host(:not([disabled])[active][expand=xxl]) ::slotted(*){background-color:var(--sgds-bg-translucent-subtle)}}::slotted(*){--sgds-link-color-default:var(--sgds-color-default);align-items:center;box-sizing:border-box;color:var(--sgds-link-color-default,var(--sgds-color-default));cursor:pointer;display:flex;height:auto!important;padding:var(--sgds-padding-sm) var(--sgds-mainnav-padding-x);text-decoration:none!important;text-decoration:none}@media screen and (max-width:767px){::slotted(*){padding:var(--sgds-padding-sm) var(--sgds-mainnav-mobile-padding-x)}}:host(:not([disabled])[active]) ::slotted(*){--sgds-link-color-default:var(--sgds-primary-color-default);color:var(--sgds-link-color-default,var(--sgds-primary-color-default))}:host([disabled]) ::slotted(a:hover){--sgds-link-color-emphasis:var(--sgds-color-default);color:var(--sgds-link-color-emphasis,var(--sgds-color-default))}:host(:not([disabled])) ::slotted(a:hover){--sgds-link-color-emphasis:var(--sgds-primary-color-default);color:var(--sgds-link-color-emphasis,var(--sgds-primary-color-default))}::slotted(a:focus),::slotted(a:focus-visible){outline:0}::slotted(a:focus-visible){--sgds-link-color-emphasis:var(--sgds-primary-color-default);box-shadow:var(--sgds-box-shadow-focus) inset;color:var(--sgds-link-color-emphasis,var(--sgds-primary-color-default))}:host([disabled]) ::slotted(*){cursor:not-allowed;opacity:var(--sgds-opacity-50)}`;
8
+ var css_248z = lit.css`:host([expand=always]) ::slotted(*){border-bottom:var(--sgds-border-width-4) solid transparent;padding:0 var(--sgds-padding-md)}@media screen and (min-width:512px){:host([expand=sm]) ::slotted(*){border-bottom:var(--sgds-border-width-4) solid transparent;padding:0 var(--sgds-padding-md)}:host(:not([disabled])[active][expand=sm]) ::slotted(*){border-color:var(--sgds-primary-border-color-default)}:host([expand=sm]) ::slotted(a:focus-visible){box-shadow:var(--sgds-box-shadow-focus)}}@media screen and (min-width:768px){:host([expand=md]) ::slotted(*){border-bottom:var(--sgds-border-width-4) solid transparent;padding:0 var(--sgds-padding-md)}:host(:not([disabled])[active][expand=md]) ::slotted(*){border-color:var(--sgds-primary-border-color-default)}:host([expand=md]) ::slotted(a:focus-visible){box-shadow:var(--sgds-box-shadow-focus)}}@media screen and (min-width:1024px){:host([expand=lg]) ::slotted(*){border-bottom:var(--sgds-border-width-4) solid transparent;padding:0 var(--sgds-padding-md)}:host(:not([disabled])[active][expand=lg]) ::slotted(*){border-color:var(--sgds-primary-border-color-default)}:host([expand=lg]) ::slotted(a:focus-visible){box-shadow:var(--sgds-box-shadow-focus)}}@media screen and (min-width:1280px){:host([expand=xl]) ::slotted(*){border-bottom:var(--sgds-border-width-4) solid transparent;padding:0 var(--sgds-padding-md)}:host(:not([disabled])[active][expand=xl]) ::slotted(*){border-color:var(--sgds-primary-border-color-default)}:host([expand=xl]) ::slotted(a:focus-visible){box-shadow:var(--sgds-box-shadow-focus)}}@media screen and (min-width:1440px){:host([expand=xxl]) ::slotted(*){border-bottom:var(--sgds-border-width-4) solid transparent;padding:0 var(--sgds-padding-md)}:host(:not([disabled])[active][expand=xxl]) ::slotted(*){border-color:var(--sgds-primary-border-color-default)}:host([expand=xxl]) ::slotted(a:focus-visible){box-shadow:var(--sgds-box-shadow-focus)}}@media screen and (max-width:511px){:host(:not([disabled])[active][expand=sm]) ::slotted(*){background-color:var(--sgds-bg-translucent-subtle)}}@media screen and (max-width:767px){:host(:not([disabled])[active][expand=md]) ::slotted(*){background-color:var(--sgds-bg-translucent-subtle)}}@media screen and (max-width:1023px){:host(:not([disabled])[active][expand=lg]) ::slotted(*){background-color:var(--sgds-bg-translucent-subtle)}}@media screen and (max-width:1279px){:host(:not([disabled])[active][expand=xl]) ::slotted(*){background-color:var(--sgds-bg-translucent-subtle)}}@media screen and (max-width:1439px){:host(:not([disabled])[active][expand=xxl]) ::slotted(*){background-color:var(--sgds-bg-translucent-subtle)}}::slotted(*){--sgds-link-color-default:var(--sgds-color-default);align-items:center;box-sizing:border-box;color:var(--sgds-link-color-default,var(--sgds-color-default));cursor:pointer;display:flex;height:auto!important;min-height:100%;padding:var(--sgds-padding-sm) var(--sgds-mainnav-padding-x);text-decoration:none!important;text-decoration:none}@media screen and (max-width:767px){::slotted(*){padding:var(--sgds-padding-sm) var(--sgds-mainnav-mobile-padding-x)}}:host(:not([disabled])[active]) ::slotted(*){--sgds-link-color-default:var(--sgds-primary-color-default);color:var(--sgds-link-color-default,var(--sgds-primary-color-default))}:host([disabled]) ::slotted(a:hover){--sgds-link-color-emphasis:var(--sgds-color-default);color:var(--sgds-link-color-emphasis,var(--sgds-color-default))}:host(:not([disabled])) ::slotted(a:hover){--sgds-link-color-emphasis:var(--sgds-primary-color-default);color:var(--sgds-link-color-emphasis,var(--sgds-primary-color-default))}::slotted(a:focus),::slotted(a:focus-visible){outline:0}::slotted(a:focus-visible){--sgds-link-color-emphasis:var(--sgds-primary-color-default);box-shadow:var(--sgds-box-shadow-focus) inset;color:var(--sgds-link-color-emphasis,var(--sgds-primary-color-default))}:host([disabled]) ::slotted(*){cursor:not-allowed;opacity:var(--sgds-opacity-50)}`;
9
9
 
10
10
  exports["default"] = css_248z;
11
11
  //# sourceMappingURL=mainnav-item.cjs.js.map