@sankhyatronics/sankhya-cms 0.1.16 → 0.2.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 (111) hide show
  1. package/custom-elements.json +842 -213
  2. package/dist/bento-grid/index.d.ts +8 -1
  3. package/dist/bento-grid/index.js +2 -1
  4. package/dist/card/index.d.ts +3 -4
  5. package/dist/card/index.js +1 -1
  6. package/dist/{chunk-LEXZKGQX.js → chunk-2DXHPEB5.js} +1 -1
  7. package/dist/chunk-2DXHPEB5.js.map +1 -0
  8. package/dist/{chunk-R5G6KFTJ.js → chunk-2FJDNJ7R.js} +1 -1
  9. package/dist/chunk-2FJDNJ7R.js.map +1 -0
  10. package/dist/{chunk-ZN4LIKVG.js → chunk-3OEEOBHB.js} +1 -1
  11. package/dist/chunk-3OEEOBHB.js.map +1 -0
  12. package/dist/{chunk-BMHMNXIA.js → chunk-4AFOKKSU.js} +1 -1
  13. package/dist/chunk-4AFOKKSU.js.map +1 -0
  14. package/dist/{chunk-76AVBQUA.js → chunk-5C6C6K5U.js} +98 -4
  15. package/dist/chunk-5C6C6K5U.js.map +1 -0
  16. package/dist/{chunk-7NLZND6Q.js → chunk-5F5PTVWR.js} +27 -2
  17. package/dist/chunk-5F5PTVWR.js.map +1 -0
  18. package/dist/chunk-5MY6OWMK.js +125 -0
  19. package/dist/chunk-5MY6OWMK.js.map +1 -0
  20. package/dist/{chunk-FLY7TNRT.js → chunk-7NIWQWTA.js} +1 -1
  21. package/dist/chunk-7NIWQWTA.js.map +1 -0
  22. package/dist/{chunk-ALI26WOB.js → chunk-EE6PAN3B.js} +33 -2
  23. package/dist/chunk-EE6PAN3B.js.map +1 -0
  24. package/dist/chunk-FML6AG2V.js +107 -0
  25. package/dist/chunk-FML6AG2V.js.map +1 -0
  26. package/dist/{chunk-VWS53WY4.js → chunk-HMUZON6I.js} +49 -4
  27. package/dist/chunk-HMUZON6I.js.map +1 -0
  28. package/dist/{chunk-G3CF7MBO.js → chunk-J6EO4R73.js} +27 -1
  29. package/dist/{chunk-G3CF7MBO.js.map → chunk-J6EO4R73.js.map} +1 -1
  30. package/dist/chunk-O4FCRKDX.js +178 -0
  31. package/dist/chunk-O4FCRKDX.js.map +1 -0
  32. package/dist/{chunk-SMLR736E.js → chunk-OELI3IWC.js} +1 -1
  33. package/dist/chunk-OELI3IWC.js.map +1 -0
  34. package/dist/{chunk-JQY2G4QK.js → chunk-OLA35A2O.js} +1 -1
  35. package/dist/chunk-OLA35A2O.js.map +1 -0
  36. package/dist/{chunk-YQ42EBK5.js → chunk-PHEGSCOM.js} +1 -1
  37. package/dist/chunk-PHEGSCOM.js.map +1 -0
  38. package/dist/{chunk-5EBWMPJS.js → chunk-QLA4BH2B.js} +5 -5
  39. package/dist/chunk-QLA4BH2B.js.map +1 -0
  40. package/dist/{chunk-JKBWZLG4.js → chunk-SQ3OZO32.js} +141 -3
  41. package/dist/chunk-SQ3OZO32.js.map +1 -0
  42. package/dist/chunk-UAIUBPDN.js +11 -0
  43. package/dist/chunk-UAIUBPDN.js.map +1 -0
  44. package/dist/{chunk-XWB4CKDU.js → chunk-XUGEXERO.js} +6 -6
  45. package/dist/chunk-XUGEXERO.js.map +1 -0
  46. package/dist/chunk-ZRC5BVDX.js +219 -0
  47. package/dist/chunk-ZRC5BVDX.js.map +1 -0
  48. package/dist/cms-theme.css +7 -0
  49. package/dist/content-block/index.d.ts +2 -3
  50. package/dist/content-block/index.js +3 -2
  51. package/dist/dropdown/index.d.ts +8 -11
  52. package/dist/dropdown/index.js +1 -1
  53. package/dist/feature-split/index.js +2 -1
  54. package/dist/features-section/index.d.ts +4 -4
  55. package/dist/features-section/index.js +4 -3
  56. package/dist/flow/index.d.ts +35 -0
  57. package/dist/flow/index.js +9 -0
  58. package/dist/flow/index.js.map +1 -0
  59. package/dist/header/index.d.ts +8 -15
  60. package/dist/header/index.js +1 -1
  61. package/dist/hero/index.d.ts +18 -3
  62. package/dist/hero/index.js +1 -1
  63. package/dist/icon-button/index.d.ts +2 -4
  64. package/dist/icon-button/index.js +1 -1
  65. package/dist/index.d.ts +3 -0
  66. package/dist/index.js +38 -25
  67. package/dist/items-accordion/index.d.ts +5 -0
  68. package/dist/items-accordion/index.js +2 -1
  69. package/dist/markdown/index.d.ts +1 -2
  70. package/dist/markdown/index.js +2 -1
  71. package/dist/mega-menu/index.d.ts +2 -2
  72. package/dist/mega-menu/index.js +1 -1
  73. package/dist/menu-grid/index.d.ts +2 -3
  74. package/dist/menu-grid/index.js +1 -1
  75. package/dist/menu-grid-item/index.d.ts +6 -8
  76. package/dist/menu-grid-item/index.js +1 -1
  77. package/dist/menu-item/index.d.ts +5 -7
  78. package/dist/menu-item/index.js +1 -1
  79. package/dist/promo-banner/index.d.ts +14 -3
  80. package/dist/promo-banner/index.js +1 -1
  81. package/dist/schema/index.d.ts +3 -0
  82. package/dist/schema/index.js +3 -0
  83. package/dist/schema/index.js.map +1 -1
  84. package/dist/section/index.d.ts +3 -0
  85. package/dist/section/index.js +1 -1
  86. package/dist/steps/index.d.ts +33 -0
  87. package/dist/steps/index.js +10 -0
  88. package/dist/steps/index.js.map +1 -0
  89. package/dist/tag-strip/index.d.ts +26 -0
  90. package/dist/tag-strip/index.js +9 -0
  91. package/dist/tag-strip/index.js.map +1 -0
  92. package/dist/tooltip/index.d.ts +18 -6
  93. package/dist/tooltip/index.js +1 -1
  94. package/package.json +14 -2
  95. package/dist/chunk-5EBWMPJS.js.map +0 -1
  96. package/dist/chunk-76AVBQUA.js.map +0 -1
  97. package/dist/chunk-7NLZND6Q.js.map +0 -1
  98. package/dist/chunk-ALI26WOB.js.map +0 -1
  99. package/dist/chunk-BMHMNXIA.js.map +0 -1
  100. package/dist/chunk-FLY7TNRT.js.map +0 -1
  101. package/dist/chunk-JKBWZLG4.js.map +0 -1
  102. package/dist/chunk-JQY2G4QK.js.map +0 -1
  103. package/dist/chunk-LEXZKGQX.js.map +0 -1
  104. package/dist/chunk-R5G6KFTJ.js.map +0 -1
  105. package/dist/chunk-SMLR736E.js.map +0 -1
  106. package/dist/chunk-VWS53WY4.js.map +0 -1
  107. package/dist/chunk-XCA3XFFG.js +0 -74
  108. package/dist/chunk-XCA3XFFG.js.map +0 -1
  109. package/dist/chunk-XWB4CKDU.js.map +0 -1
  110. package/dist/chunk-YQ42EBK5.js.map +0 -1
  111. package/dist/chunk-ZN4LIKVG.js.map +0 -1
@@ -278,4 +278,4 @@ export {
278
278
  FeatureItem,
279
279
  FeaturesSection
280
280
  };
281
- //# sourceMappingURL=chunk-FLY7TNRT.js.map
281
+ //# sourceMappingURL=chunk-7NIWQWTA.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/features-section/FeaturesSection.ts","../src/features-section/FeatureItem.ts"],"sourcesContent":["import { LitElement, css, html, nothing } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n\nimport { controlBaseStyles, fontFamilyStyles } from '../shared/styles';\nimport { sectionSubtitleStyles, sectionTitleStyles, sectionHeaderStyles } from '../shared/section-styles';\nimport './FeatureItem';\n\n/** Data for one tile when using the `items` property (mirrors `st-feature-item`'s properties). */\nexport interface FeatureItemData {\n icon?: string;\n title: string;\n description: string;\n href?: string;\n}\n\n/**\n * A titled grid of feature tiles. Tiles come from the `items` property, from slotted\n * `st-feature-item` elements, or both (slotted first). `columns` sets the grid width (default 2;\n * one column below 768px). `inverted` is passed on to the `items` tiles; slotted tiles need their\n * own `inverted` attribute.\n *\n * @cssprop --st-features-section-padding - Overrides the section's padding.\n */\n@customElement('st-features-section')\nexport class FeaturesSection extends LitElement {\n static styles = css`\n ${controlBaseStyles}\n\n :host {\n display: block;\n ${fontFamilyStyles}\n /* !important: a page-level reset (e.g. Tailwind Preflight) otherwise zeroes a shadow host's\n padding; override with --st-features-section-padding instead. */\n padding: var(--st-features-section-padding, var(--st-cms-section-padding) var(--st-space-24)) !important;\n background: var(--st-color-surface);\n }\n\n :host([inverted]) {\n background: var(--st-color-text-strong);\n }\n\n .container {\n max-width: var(--st-cms-container-max);\n margin: 0 auto;\n }\n\n .header {\n ${sectionHeaderStyles}\n }\n\n .title {\n ${sectionTitleStyles}\n margin: 0;\n }\n\n .subtitle {\n ${sectionSubtitleStyles}\n margin: 0 auto;\n }\n\n :host([inverted]) .title,\n :host([inverted]) .subtitle {\n color: var(--st-color-on-solid);\n }\n\n .grid {\n display: grid;\n grid-template-columns: repeat(var(--features-columns, 2), 1fr);\n gap: var(--st-space-32);\n }\n\n @media (max-width: 768px) {\n :host {\n padding: var(--st-features-section-padding, var(--st-space-48) var(--st-space-16)) !important;\n }\n\n .grid {\n grid-template-columns: 1fr;\n }\n }\n `;\n\n @property({ type: String })\n title = '';\n\n @property({ type: String })\n subtitle = '';\n\n /** Applied to every tile built from `items`. */\n @property({ type: String, attribute: 'action-label' })\n actionLabel = 'Learn more';\n\n @property({ type: Number })\n columns = 0;\n\n @property({ type: Boolean, reflect: true })\n inverted = false;\n\n /** Tiles to render (property only). */\n @property({ attribute: false })\n items: FeatureItemData[] = [];\n\n render() {\n const gridStyle = this.columns ? `--features-columns: ${this.columns}` : nothing;\n return html`\n <section class=\"container\" part=\"container\">\n <div class=\"header\" part=\"header\">\n <div class=\"title\" part=\"title\">${this.title}</div>\n ${this.subtitle ? html`<div class=\"subtitle\" part=\"subtitle\">${this.subtitle}</div>` : nothing}\n </div>\n <div class=\"grid\" part=\"grid\" style=${gridStyle}>\n <slot></slot>\n ${this.items.map(\n (item) => html`\n <st-feature-item\n .icon=${item.icon ?? ''}\n .title=${item.title}\n .description=${item.description}\n .href=${item.href ?? ''}\n .actionLabel=${this.actionLabel}\n ?inverted=${this.inverted}\n ></st-feature-item>\n `\n )}\n </div>\n </section>\n `;\n }\n}\n","import { LitElement, css, html, nothing } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport 'iconify-icon';\n\nimport { controlBaseStyles, fontFamilyStyles } from '../shared/styles';\nimport { cardDescriptionStyles, cardTitleStyles } from '../shared/section-styles';\nimport '../card';\nimport '../markdown';\n\n/**\n * One feature tile for `st-features-section`: optional icon, title, Markdown description and an\n * optional \"Learn more\" link, rendered on an `st-card`. `icon` is an Iconify name (e.g.\n * `mdi:rocket`). The link is a plain `<a>` (the source used react-router's `Link` for non-http\n * hrefs; there is no Lit equivalent). The click is composed, so an SPA router can intercept it\n * (e.g. via `event.composedPath()`) and navigate client-side; `http(s)` links open in a new tab.\n */\n@customElement('st-feature-item')\nexport class FeatureItem extends LitElement {\n static styles = css`\n ${controlBaseStyles}\n\n :host {\n display: block;\n ${fontFamilyStyles}\n }\n\n st-card {\n height: 100%;\n }\n\n .content {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n gap: var(--st-space-16);\n height: 100%;\n }\n\n .icon {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 48px;\n height: 48px;\n border-radius: var(--st-radius-lg);\n background: var(--st-color-subtle);\n color: var(--st-color-text-strong);\n margin-bottom: var(--st-space-8);\n font-size: 24px;\n }\n\n :host([inverted]) .icon {\n background: var(--st-color-text-muted);\n color: var(--st-color-on-solid);\n }\n\n .title {\n ${cardTitleStyles}\n margin: 0;\n }\n\n .description {\n ${cardDescriptionStyles}\n margin: 0;\n }\n\n :host([inverted]) .title,\n :host([inverted]) .description {\n color: inherit;\n }\n\n .link {\n display: flex;\n align-items: center;\n gap: var(--st-space-4);\n margin-top: auto;\n color: var(--st-color-text-muted);\n font-weight: var(--st-font-weight-medium);\n font-size: var(--st-text-md);\n text-decoration: none;\n transition: color 0.2s ease;\n }\n\n .link:hover {\n color: var(--st-color-text-strong);\n text-decoration: underline;\n }\n\n :host([inverted]) .link,\n :host([inverted]) .link:hover {\n color: inherit;\n }\n\n @media (prefers-reduced-motion: reduce) {\n .link {\n transition: none;\n }\n }\n `;\n\n /** Iconify icon name, e.g. `mdi:rocket`. */\n @property({ type: String })\n icon = '';\n\n @property({ type: String })\n title = '';\n\n /** Markdown. */\n @property({ type: String })\n description = '';\n\n @property({ type: String })\n href = '';\n\n @property({ type: String, attribute: 'action-label' })\n actionLabel = 'Learn more';\n\n @property({ type: Boolean, reflect: true })\n inverted = false;\n\n render() {\n const external = this.href.startsWith('http');\n return html`\n <st-card hoverable elevation=\"sm\" ?inverted=${this.inverted} part=\"card\">\n <div class=\"content\" part=\"content\">\n ${this.icon\n ? html`<div class=\"icon\" part=\"icon\"><iconify-icon icon=${this.icon}></iconify-icon></div>`\n : nothing}\n <h3 class=\"title\" part=\"title\">${this.title}</h3>\n <st-markdown class=\"description\" part=\"description\" .content=${this.description}></st-markdown>\n ${this.href\n ? html`\n <a\n class=\"link\"\n part=\"link\"\n href=${this.href}\n target=${external ? '_blank' : '_self'}\n rel=${external ? 'noopener noreferrer' : nothing}\n >\n ${this.actionLabel} <span>&rarr;</span>\n </a>\n `\n : nothing}\n </div>\n </st-card>\n `;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,SAAS,cAAAA,aAAY,OAAAC,MAAK,QAAAC,OAAM,WAAAC,gBAAe;AAC/C,SAAS,iBAAAC,gBAAe,YAAAC,iBAAgB;;;ACDxC,SAAS,YAAY,KAAK,MAAM,eAAe;AAC/C,SAAS,eAAe,gBAAgB;AACxC,OAAO;AAeA,IAAM,cAAN,cAA0B,WAAW;AAAA,EAArC;AAAA;AAqFL,gBAAO;AAGP,iBAAQ;AAIR,uBAAc;AAGd,gBAAO;AAGP,uBAAc;AAGd,oBAAW;AAAA;AAAA,EAEX,SAAS;AACP,UAAM,WAAW,KAAK,KAAK,WAAW,MAAM;AAC5C,WAAO;AAAA,oDACyC,KAAK,QAAQ;AAAA;AAAA,YAErD,KAAK,OACH,wDAAwD,KAAK,IAAI,2BACjE,OAAO;AAAA,2CACsB,KAAK,KAAK;AAAA,yEACoB,KAAK,WAAW;AAAA,YAC7E,KAAK,OACH;AAAA;AAAA;AAAA;AAAA,yBAIW,KAAK,IAAI;AAAA,2BACP,WAAW,WAAW,OAAO;AAAA,wBAChC,WAAW,wBAAwB,OAAO;AAAA;AAAA,oBAE9C,KAAK,W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AAAA,GApEf,gBAqEX;AAGA;AAAA,EADCA,UAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GAvE/B,gBAwEX;AAIA;AAAA,EADCA,UAAS,EAAE,WAAW,MAAM,CAAC;AAAA,GA3EnB,gBA4EX;AA5EW,kBAAN;AAAA,EADNC,eAAc,qBAAqB;AAAA,GACvB;","names":["LitElement","css","html","nothing","customElement","property","LitElement","nothing","html","css","property","customElement"]}
@@ -1,3 +1,6 @@
1
+ import {
2
+ renderMarkdown
3
+ } from "./chunk-UAIUBPDN.js";
1
4
  import {
2
5
  reducedMotionStyles,
3
6
  sectionHeaderStyles,
@@ -16,6 +19,7 @@ import {
16
19
  // src/items-accordion/ItemsAccordion.ts
17
20
  import { LitElement, css, html, nothing } from "lit";
18
21
  import { customElement, property, state } from "lit/decorators.js";
22
+ import { unsafeHTML } from "lit/directives/unsafe-html.js";
19
23
  import "iconify-icon";
20
24
  var ItemsAccordion = class extends LitElement {
21
25
  constructor() {
@@ -24,8 +28,14 @@ var ItemsAccordion = class extends LitElement {
24
28
  this.subtitle = "";
25
29
  this.items = [];
26
30
  this.allowMultiple = false;
31
+ this.openFirst = false;
27
32
  this.openIds = /* @__PURE__ */ new Set();
28
33
  }
34
+ willUpdate(changed) {
35
+ if (this.openFirst && (changed.has("items") || changed.has("openFirst")) && this.openIds.size === 0 && this.items.length) {
36
+ this.openIds = /* @__PURE__ */ new Set([this.items[0].id]);
37
+ }
38
+ }
29
39
  toggle(id) {
30
40
  const wasOpen = this.openIds.has(id);
31
41
  const next = new Set(this.allowMultiple ? this.openIds : []);
@@ -65,7 +75,7 @@ var ItemsAccordion = class extends LitElement {
65
75
  </button>
66
76
  <div class="content" id="content-${item.id}" part="content" role="region" ?inert=${!open}>
67
77
  <div class="content-clip">
68
- <div class="content-inner">${item.content}</div>
78
+ <div class="content-inner">${unsafeHTML(renderMarkdown(item.content))}</div>
69
79
  </div>
70
80
  </div>
71
81
  </div>
@@ -180,6 +190,24 @@ ItemsAccordion.styles = css`
180
190
  line-height: 1.6;
181
191
  }
182
192
 
193
+ .content-inner > :first-child {
194
+ margin-top: 0;
195
+ }
196
+
197
+ .content-inner > :last-child {
198
+ margin-bottom: 0;
199
+ }
200
+
201
+ .content-inner p {
202
+ margin: 0 0 var(--st-space-12);
203
+ }
204
+
205
+ .content-inner a {
206
+ color: inherit;
207
+ text-decoration: underline;
208
+ text-underline-offset: 3px;
209
+ }
210
+
183
211
  @media (max-width: 768px) {
184
212
  :host {
185
213
  padding: var(--st-items-accordion-padding, var(--st-space-48) var(--st-space-20)) !important;
@@ -204,6 +232,9 @@ __decorateClass([
204
232
  __decorateClass([
205
233
  property({ type: Boolean, attribute: "allow-multiple" })
206
234
  ], ItemsAccordion.prototype, "allowMultiple", 2);
235
+ __decorateClass([
236
+ property({ type: Boolean, attribute: "open-first" })
237
+ ], ItemsAccordion.prototype, "openFirst", 2);
207
238
  __decorateClass([
208
239
  state()
209
240
  ], ItemsAccordion.prototype, "openIds", 2);
@@ -214,4 +245,4 @@ ItemsAccordion = __decorateClass([
214
245
  export {
215
246
  ItemsAccordion
216
247
  };
217
- //# sourceMappingURL=chunk-ALI26WOB.js.map
248
+ //# sourceMappingURL=chunk-EE6PAN3B.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/items-accordion/ItemsAccordion.ts"],"sourcesContent":["import { LitElement, css, html, nothing } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js';\nimport 'iconify-icon';\n\nimport { buttonResetStyles, controlBaseStyles, fontFamilyStyles } from '../shared/styles';\nimport { renderMarkdown } from '../shared/markdown';\nimport {\n reducedMotionStyles,\n sectionHeaderStyles,\n sectionSubtitleStyles,\n sectionTitleStyles,\n} from '../shared/section-styles';\nimport type { AccordionToggleEventDetail } from './ItemsAccordionEvents';\n\nexport interface AccordionItem {\n id: string;\n title: string;\n /** Markdown (plain text works too). */\n content: string;\n}\n\n/**\n * A vertical list of collapsible title/content rows; one open at a time unless `allow-multiple`.\n * Each row's `content` is Markdown, sanitized. `open-first` starts with the first row open.\n *\n * @cssprop --st-items-accordion-padding - Overrides the block's padding.\n */\n@customElement('st-items-accordion')\nexport class ItemsAccordion extends LitElement {\n static styles = css`\n ${controlBaseStyles}\n\n :host {\n display: block;\n /* !important: a page-level reset (e.g. Tailwind Preflight) otherwise zeroes a shadow host's\n padding; override with --st-items-accordion-padding instead. */\n padding: var(--st-items-accordion-padding, var(--st-cms-section-padding) var(--st-space-24)) !important;\n background: var(--st-color-page);\n ${fontFamilyStyles}\n }\n\n .container {\n max-width: 800px;\n margin: 0 auto;\n }\n\n .header {\n ${sectionHeaderStyles}\n }\n\n .title {\n ${sectionTitleStyles}\n font-size: var(--st-text-2xl);\n margin-bottom: var(--st-space-12);\n }\n\n .subtitle {\n ${sectionSubtitleStyles}\n font-size: var(--st-text-base);\n margin: 0;\n }\n\n .list {\n display: flex;\n flex-direction: column;\n gap: var(--st-space-16);\n }\n\n .item {\n border: 1px solid var(--st-color-border);\n border-radius: var(--st-radius-lg);\n background: var(--st-color-surface);\n overflow: hidden;\n transition:\n border-color 0.2s ease,\n box-shadow 0.2s ease;\n }\n\n .item.open {\n border-color: var(--st-color-border-strong);\n box-shadow: 0 4px 6px -1px var(--st-shadow-color-sm);\n }\n\n .trigger {\n ${buttonResetStyles}\n width: 100%;\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: var(--st-space-24);\n text-align: left;\n font-size: var(--st-text-lg);\n font-weight: var(--st-font-weight-semibold);\n color: var(--st-color-text-strong);\n }\n\n .trigger:hover {\n background: var(--st-color-hover);\n }\n\n .chevron {\n flex-shrink: 0;\n margin-left: var(--st-space-16);\n font-size: 24px;\n color: var(--st-color-text-faint);\n transition: transform 0.3s ease;\n }\n\n .open .chevron {\n transform: rotate(180deg);\n }\n\n .content {\n display: grid;\n grid-template-rows: 0fr;\n transition: grid-template-rows 0.3s ease;\n }\n\n .open .content {\n grid-template-rows: 1fr;\n }\n\n .content-clip {\n overflow: hidden;\n min-height: 0;\n }\n\n .content-inner {\n padding: 0 var(--st-space-24) var(--st-space-24);\n color: var(--st-color-text);\n line-height: 1.6;\n }\n\n .content-inner > :first-child {\n margin-top: 0;\n }\n\n .content-inner > :last-child {\n margin-bottom: 0;\n }\n\n .content-inner p {\n margin: 0 0 var(--st-space-12);\n }\n\n .content-inner a {\n color: inherit;\n text-decoration: underline;\n text-underline-offset: 3px;\n }\n\n @media (max-width: 768px) {\n :host {\n padding: var(--st-items-accordion-padding, var(--st-space-48) var(--st-space-20)) !important;\n }\n\n .title {\n font-size: var(--st-text-xl);\n }\n }\n\n ${reducedMotionStyles}\n `;\n\n @property({ type: String })\n title = '';\n\n @property({ type: String })\n subtitle = '';\n\n @property({ attribute: false })\n items: AccordionItem[] = [];\n\n @property({ type: Boolean, attribute: 'allow-multiple' })\n allowMultiple = false;\n\n /** Starts with the first row open. Applies when `items` or this flag changes while nothing is open. */\n @property({ type: Boolean, attribute: 'open-first' })\n openFirst = false;\n\n @state() private openIds = new Set<string>();\n\n protected willUpdate(changed: Map<string, unknown>): void {\n if (this.openFirst && (changed.has('items') || changed.has('openFirst')) && this.openIds.size === 0 && this.items.length) {\n this.openIds = new Set([this.items[0].id]);\n }\n }\n\n private toggle(id: string) {\n const wasOpen = this.openIds.has(id);\n const next = new Set(this.allowMultiple ? this.openIds : []);\n if (wasOpen) next.delete(id);\n else next.add(id);\n this.openIds = next;\n this.dispatchEvent(\n new CustomEvent<AccordionToggleEventDetail>('accordion-toggle', {\n detail: { id, open: !wasOpen },\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n render() {\n return html`\n <div class=\"container\" part=\"container\">\n ${this.title || this.subtitle\n ? html`<div class=\"header\" part=\"header\">\n ${this.title ? html`<h2 class=\"title\" part=\"title\">${this.title}</h2>` : nothing}\n ${this.subtitle ? html`<p class=\"subtitle\" part=\"subtitle\">${this.subtitle}</p>` : nothing}\n </div>`\n : nothing}\n <div class=\"list\" part=\"list\">\n ${this.items.map((item) => {\n const open = this.openIds.has(item.id);\n return html`\n <div class=\"item ${open ? 'open' : ''}\" part=\"item\">\n <button\n class=\"trigger\"\n part=\"trigger\"\n type=\"button\"\n aria-expanded=${open ? 'true' : 'false'}\n aria-controls=\"content-${item.id}\"\n @click=${() => this.toggle(item.id)}\n >\n <span>${item.title}</span>\n <iconify-icon class=\"chevron\" icon=\"mdi:chevron-down\"></iconify-icon>\n </button>\n <div class=\"content\" id=\"content-${item.id}\" part=\"content\" role=\"region\" ?inert=${!open}>\n <div class=\"content-clip\">\n <div class=\"content-inner\">${unsafeHTML(renderMarkdown(item.content))}</div>\n </div>\n </div>\n </div>\n `;\n })}\n </div>\n </div>\n `;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,SAAS,YAAY,KAAK,MAAM,eAAe;AAC/C,SAAS,eAAe,UAAU,aAAa;AAC/C,SAAS,kBAAkB;AAC3B,OAAO;AA0BA,IAAM,iBAAN,cAA6B,WAAW;AAAA,EAAxC;AAAA;AAyIL,iBAAQ;AAGR,oBAAW;AAGX,iBAAyB,CAAC;AAG1B,yBAAgB;AAIhB,qBAAY;AAEH,SAAQ,UAAU,oBAAI,IAAY;AAAA;AAAA,EAEjC,WAAW,SAAqC;AACxD,QAAI,KAAK,cAAc,QAAQ,IAAI,OAAO,KAAK,QAAQ,IAAI,WAAW,MAAM,KAAK,QAAQ,SAAS,KAAK,KAAK,MAAM,QAAQ;AACxH,WAAK,UAAU,oBAAI,IAAI,CAAC,KAAK,MAAM,CAAC,EAAE,EAAE,CAAC;AAAA,IAC3C;AAAA,EACF;AAAA,EAEQ,OAAO,IAAY;AACzB,UAAM,UAAU,KAAK,QAAQ,IAAI,EAAE;AACnC,UAAM,OAAO,IAAI,IAAI,KAAK,gBAAgB,KAAK,UAAU,CAAC,CAAC;AAC3D,QAAI,QAAS,MAAK,OAAO,EAAE;AAAA,QACtB,MAAK,IAAI,EAAE;AAChB,SAAK,UAAU;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AA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QA2BrB,iBAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MA6EnB,mBAAmB;AAAA;AAIvB;AAAA,EADC,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GAxIf,eAyIX;AAGA;AAAA,EADC,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GA3If,eA4IX;AAGA;AAAA,EADC,SAAS,EAAE,WAAW,MAAM,CAAC;AAAA,GA9InB,eA+IX;AAGA;AAAA,EADC,SAAS,EAAE,MAAM,SAAS,WAAW,iBAAiB,CAAC;AAAA,GAjJ7C,eAkJX;AAIA;AAAA,EADC,SAAS,EAAE,MAAM,SAAS,WAAW,aAAa,CAAC;AAAA,GArJzC,eAsJX;AAEiB;AAAA,EAAhB,MAAM;AAAA,GAxJI,eAwJM;AAxJN,iBAAN;AAAA,EADN,cAAc,oBAAoB;AAAA,GACtB;","names":[]}
@@ -0,0 +1,107 @@
1
+ import {
2
+ fontFamilyStyles
3
+ } from "./chunk-KMU6ABQF.js";
4
+ import {
5
+ __decorateClass
6
+ } from "./chunk-EUXUH3YW.js";
7
+
8
+ // src/tooltip/Tooltip.ts
9
+ import { LitElement, css, html } from "lit";
10
+ import { customElement, property } from "lit/decorators.js";
11
+ var HOVER_DELAY_MS = 300;
12
+ var Tooltip = class extends LitElement {
13
+ constructor() {
14
+ super(...arguments);
15
+ this.text = "";
16
+ this.onPointerEnter = () => {
17
+ this.cancel();
18
+ this.timer = window.setTimeout(this.show, HOVER_DELAY_MS);
19
+ };
20
+ this.show = () => {
21
+ this.cancel();
22
+ if (!this.bubble || !this.text) return;
23
+ const box = this.getBoundingClientRect();
24
+ this.bubble.style.left = `${box.left + box.width / 2}px`;
25
+ this.bubble.style.top = `${box.top}px`;
26
+ this.bubble.setAttribute("data-open", "");
27
+ };
28
+ this.hide = () => {
29
+ this.cancel();
30
+ this.bubble?.removeAttribute("data-open");
31
+ };
32
+ }
33
+ connectedCallback() {
34
+ super.connectedCallback();
35
+ this.addEventListener("pointerenter", this.onPointerEnter);
36
+ this.addEventListener("pointerleave", this.hide);
37
+ this.addEventListener("focusin", this.show);
38
+ this.addEventListener("focusout", this.hide);
39
+ }
40
+ disconnectedCallback() {
41
+ super.disconnectedCallback();
42
+ this.removeEventListener("pointerenter", this.onPointerEnter);
43
+ this.removeEventListener("pointerleave", this.hide);
44
+ this.removeEventListener("focusin", this.show);
45
+ this.removeEventListener("focusout", this.hide);
46
+ this.cancel();
47
+ }
48
+ firstUpdated() {
49
+ this.bubble = this.renderRoot.querySelector(".bubble") ?? void 0;
50
+ }
51
+ cancel() {
52
+ if (this.timer !== void 0) window.clearTimeout(this.timer);
53
+ this.timer = void 0;
54
+ }
55
+ render() {
56
+ return html`<slot></slot><span class="bubble" part="bubble" aria-hidden="true">${this.text}</span>`;
57
+ }
58
+ };
59
+ Tooltip.styles = css`
60
+ ${fontFamilyStyles}
61
+
62
+ :host {
63
+ display: inline-flex;
64
+ }
65
+
66
+ .bubble {
67
+ position: fixed;
68
+ z-index: 1000;
69
+ left: 0;
70
+ top: 0;
71
+ transform: translate(-50%, calc(-100% - 6px));
72
+ padding: var(--st-space-4) var(--st-space-8);
73
+ border-radius: var(--st-radius-xs);
74
+ background: var(--st-color-text-strong);
75
+ color: var(--st-color-on-solid);
76
+ font-size: var(--st-text-xs);
77
+ font-weight: var(--st-font-weight-medium);
78
+ line-height: 1.3;
79
+ white-space: nowrap;
80
+ pointer-events: none;
81
+ opacity: 0;
82
+ visibility: hidden;
83
+ transition: opacity 0.12s ease;
84
+ }
85
+
86
+ .bubble[data-open] {
87
+ opacity: 1;
88
+ visibility: visible;
89
+ }
90
+
91
+ @media (prefers-reduced-motion: reduce) {
92
+ .bubble {
93
+ transition: none;
94
+ }
95
+ }
96
+ `;
97
+ __decorateClass([
98
+ property({ type: String })
99
+ ], Tooltip.prototype, "text", 2);
100
+ Tooltip = __decorateClass([
101
+ customElement("st-tooltip")
102
+ ], Tooltip);
103
+
104
+ export {
105
+ Tooltip
106
+ };
107
+ //# sourceMappingURL=chunk-FML6AG2V.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/tooltip/Tooltip.ts"],"sourcesContent":["import { LitElement, css, html } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n\nimport { fontFamilyStyles } from '../shared/styles';\n\n/** How long a pointer must rest on the control before its label shows. Keyboard focus shows it at once. */\nconst HOVER_DELAY_MS = 300;\n\n/**\n * A small label that shows above a control: after a short rest on hover, and at once on keyboard focus.\n * Wrap the control (a button or an icon button) in it and pass the same words as its accessible name in\n * `text`. The control is still the thing that's announced; the bubble is decorative (`aria-hidden`), so the\n * words aren't read twice.\n *\n * The bubble is `position: fixed` and placed from the wrapper's position when it shows, so a clipping\n * ancestor (a card or panel with `overflow: hidden`) can't cut it off. It shows around a control that\n * can't act right now too, as long as that control is focusable or hoverable (use `aria-disabled`, not\n * the native `disabled`, which takes a control out of focus and pointer events).\n */\n@customElement('st-tooltip')\nexport class Tooltip extends LitElement {\n static styles = css`\n ${fontFamilyStyles}\n\n :host {\n display: inline-flex;\n }\n\n .bubble {\n position: fixed;\n z-index: 1000;\n left: 0;\n top: 0;\n transform: translate(-50%, calc(-100% - 6px));\n padding: var(--st-space-4) var(--st-space-8);\n border-radius: var(--st-radius-xs);\n background: var(--st-color-text-strong);\n color: var(--st-color-on-solid);\n font-size: var(--st-text-xs);\n font-weight: var(--st-font-weight-medium);\n line-height: 1.3;\n white-space: nowrap;\n pointer-events: none;\n opacity: 0;\n visibility: hidden;\n transition: opacity 0.12s ease;\n }\n\n .bubble[data-open] {\n opacity: 1;\n visibility: visible;\n }\n\n @media (prefers-reduced-motion: reduce) {\n .bubble {\n transition: none;\n }\n }\n `;\n\n /** The words shown in the bubble: the same words as the control's accessible name, or the reason the\n * control can't act right now. */\n @property({ type: String })\n text = '';\n\n private bubble?: HTMLElement;\n private timer?: number;\n\n connectedCallback() {\n super.connectedCallback();\n this.addEventListener('pointerenter', this.onPointerEnter);\n this.addEventListener('pointerleave', this.hide);\n this.addEventListener('focusin', this.show);\n this.addEventListener('focusout', this.hide);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener('pointerenter', this.onPointerEnter);\n this.removeEventListener('pointerleave', this.hide);\n this.removeEventListener('focusin', this.show);\n this.removeEventListener('focusout', this.hide);\n this.cancel();\n }\n\n firstUpdated() {\n this.bubble = this.renderRoot.querySelector<HTMLElement>('.bubble') ?? undefined;\n }\n\n private onPointerEnter = () => {\n this.cancel();\n this.timer = window.setTimeout(this.show, HOVER_DELAY_MS);\n };\n\n private cancel() {\n if (this.timer !== undefined) window.clearTimeout(this.timer);\n this.timer = undefined;\n }\n\n private show = () => {\n this.cancel();\n if (!this.bubble || !this.text) return;\n const box = this.getBoundingClientRect();\n this.bubble.style.left = `${box.left + box.width / 2}px`;\n this.bubble.style.top = `${box.top}px`;\n this.bubble.setAttribute('data-open', '');\n };\n\n private hide = () => {\n this.cancel();\n this.bubble?.removeAttribute('data-open');\n };\n\n render() {\n return html`<slot></slot><span class=\"bubble\" part=\"bubble\" aria-hidden=\"true\">${this.text}</span>`;\n }\n}\n"],"mappings":";;;;;;;;AAAA,SAAS,YAAY,KAAK,YAAY;AAC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,EACf;AAAA,EAgBA,SAAS;AACP,WAAO,0EAA0E,KAAK,IAAI;AAAA,EAC5F;AACF;AAhGa,QACJ,SAAS;AAAA,MACZ,gBAAgB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAyCpB;AAAA,EADC,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GA1Cf,QA2CX;AA3CW,UAAN;AAAA,EADN,cAAc,YAAY;AAAA,GACd;","names":[]}
@@ -23,12 +23,24 @@ var PromoBanner = class extends LitElement {
23
23
  this.actionLabel = "";
24
24
  this.href = "";
25
25
  this.imageSrc = "";
26
+ this.secondaryActionLabel = "";
27
+ this.secondaryHref = "";
28
+ this.variant = "default";
26
29
  this.inverted = false;
27
30
  this.onAction = () => {
28
31
  this.dispatchEvent(
29
32
  new CustomEvent("action", { detail: { href: this.href }, bubbles: true, composed: true })
30
33
  );
31
34
  };
35
+ this.onSecondaryAction = () => {
36
+ this.dispatchEvent(
37
+ new CustomEvent("action", {
38
+ detail: { href: this.secondaryHref, kind: "secondary" },
39
+ bubbles: true,
40
+ composed: true
41
+ })
42
+ );
43
+ };
32
44
  }
33
45
  willUpdate() {
34
46
  this.style.backgroundImage = this.imageSrc ? `url(${JSON.stringify(this.imageSrc)})` : "";
@@ -39,8 +51,9 @@ var PromoBanner = class extends LitElement {
39
51
  <h2 class="title" part="title">${this.title}</h2>
40
52
  ${this.subtitle ? html`<p class="subtitle" part="subtitle">${this.subtitle}</p>` : nothing}
41
53
  <slot></slot>
42
- ${this.actionLabel ? html`<div class="actions" part="actions">
43
- <button class="cta" part="action" type="button" @click=${this.onAction}>${this.actionLabel}</button>
54
+ ${this.actionLabel || this.secondaryActionLabel ? html`<div class="actions" part="actions">
55
+ ${this.actionLabel ? html`<button class="cta" part="action" type="button" @click=${this.onAction}>${this.actionLabel}</button>` : nothing}
56
+ ${this.secondaryActionLabel ? html`<button class="cta secondary" part="secondary-action" type="button" @click=${this.onSecondaryAction}>${this.secondaryActionLabel}</button>` : nothing}
44
57
  </div>` : nothing}
45
58
  </div>
46
59
  `;
@@ -67,6 +80,17 @@ PromoBanner.styles = css`
67
80
  ${rootFontFamilyStyles}
68
81
  }
69
82
 
83
+ :host([variant='accent']) {
84
+ background-color: var(--st-color-accent);
85
+ color: var(--st-cms-on-dark);
86
+ }
87
+
88
+ :host([variant='accent']) .cta:not(.secondary) {
89
+ background: var(--st-cms-on-dark);
90
+ border-color: transparent;
91
+ color: var(--st-cms-navy);
92
+ }
93
+
70
94
  :host([inverted]) {
71
95
  background-color: var(--st-color-subtle);
72
96
  color: var(--st-color-text-strong);
@@ -96,6 +120,10 @@ PromoBanner.styles = css`
96
120
  }
97
121
 
98
122
  .actions {
123
+ display: flex;
124
+ flex-wrap: wrap;
125
+ justify-content: center;
126
+ gap: var(--st-space-12);
99
127
  margin-top: var(--st-space-16);
100
128
  }
101
129
 
@@ -110,6 +138,11 @@ PromoBanner.styles = css`
110
138
  transform: scale(1.05);
111
139
  }
112
140
 
141
+ .cta:focus-visible {
142
+ outline: var(--st-focus-ring);
143
+ outline-offset: 2px;
144
+ }
145
+
113
146
  @media (max-width: 768px) {
114
147
  :host {
115
148
  width: auto;
@@ -117,7 +150,10 @@ PromoBanner.styles = css`
117
150
  padding: var(--st-promo-banner-padding, 60px var(--st-space-24)) !important;
118
151
  border-radius: var(--st-radius-lg);
119
152
  }
120
- .actions,
153
+ .actions {
154
+ flex-direction: column;
155
+ align-items: stretch;
156
+ }
121
157
  .cta {
122
158
  width: 100%;
123
159
  }
@@ -144,6 +180,15 @@ __decorateClass([
144
180
  __decorateClass([
145
181
  property({ type: String, attribute: "image-src" })
146
182
  ], PromoBanner.prototype, "imageSrc", 2);
183
+ __decorateClass([
184
+ property({ type: String, attribute: "secondary-action-label" })
185
+ ], PromoBanner.prototype, "secondaryActionLabel", 2);
186
+ __decorateClass([
187
+ property({ type: String, attribute: "secondary-href" })
188
+ ], PromoBanner.prototype, "secondaryHref", 2);
189
+ __decorateClass([
190
+ property({ type: String, reflect: true })
191
+ ], PromoBanner.prototype, "variant", 2);
147
192
  __decorateClass([
148
193
  property({ type: Boolean, reflect: true })
149
194
  ], PromoBanner.prototype, "inverted", 2);
@@ -154,4 +199,4 @@ PromoBanner = __decorateClass([
154
199
  export {
155
200
  PromoBanner
156
201
  };
157
- //# sourceMappingURL=chunk-VWS53WY4.js.map
202
+ //# sourceMappingURL=chunk-HMUZON6I.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/promo-banner/PromoBanner.ts"],"sourcesContent":["import { LitElement, css, html, nothing } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n\nimport { buttonResetStyles, controlBaseStyles, rootFontFamilyStyles } from '../shared/styles';\nimport { ctaLinkStyles, sectionSubtitleStyles, sectionTitleStyles } from '../shared/section-styles';\nimport type { HeroActionEventDetail } from '../hero/HeroEvents';\n\n/**\n * Rounded call-to-action banner (title, subtitle, one or two outlined buttons) on a dark panel or a\n * background image. The buttons fire an `action` event\n * (detail `{ href }`, empty unless set; the secondary button adds `kind: 'secondary'`).\n * `onAction`. `variant=\"accent\"` fills the banner with the brand colour.\n *\n * @fires action - Detail `{ href, kind? }`. `kind` is `secondary` for the second button only.\n * @cssprop --st-promo-banner-margin - Overrides the banner's margin.\n * @cssprop --st-promo-banner-padding - Overrides the banner's padding.\n * @csspart action - The primary button.\n * @csspart secondary-action - The second button.\n */\n@customElement('st-promo-banner')\nexport class PromoBanner extends LitElement {\n static styles = css`\n ${controlBaseStyles}\n\n :host {\n display: block;\n box-sizing: border-box;\n width: calc(100% - 48px);\n max-width: var(--st-cms-container-max);\n /* !important: a page-level reset (e.g. Tailwind Preflight) otherwise zeroes a shadow host's\n margin/padding; override with --st-promo-banner-margin/-padding instead. */\n margin: var(--st-promo-banner-margin, var(--st-space-40) auto) !important;\n padding: var(--st-promo-banner-padding, 100px var(--st-space-24)) !important;\n border-radius: var(--st-space-24);\n background-color: var(--st-color-text-strong);\n background-size: cover;\n background-position: center;\n color: var(--st-color-on-solid);\n text-align: center;\n ${rootFontFamilyStyles}\n }\n\n :host([variant='accent']) {\n background-color: var(--st-color-accent);\n color: var(--st-cms-on-dark);\n }\n\n :host([variant='accent']) .cta:not(.secondary) {\n background: var(--st-cms-on-dark);\n border-color: transparent;\n color: var(--st-cms-navy);\n }\n\n :host([inverted]) {\n background-color: var(--st-color-subtle);\n color: var(--st-color-text-strong);\n }\n\n .container {\n max-width: 800px;\n margin: 0 auto;\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: var(--st-space-32);\n }\n\n .title {\n ${sectionTitleStyles}\n color: inherit;\n margin: 0;\n letter-spacing: -0.02em;\n }\n\n .subtitle {\n ${sectionSubtitleStyles}\n color: inherit;\n opacity: 0.8;\n margin: 0;\n }\n\n .actions {\n display: flex;\n flex-wrap: wrap;\n justify-content: center;\n gap: var(--st-space-12);\n margin-top: var(--st-space-16);\n }\n\n .cta {\n ${buttonResetStyles}\n ${ctaLinkStyles}\n border: 1px solid currentColor;\n color: inherit;\n }\n\n .cta:hover {\n transform: scale(1.05);\n }\n\n .cta:focus-visible {\n outline: var(--st-focus-ring);\n outline-offset: 2px;\n }\n\n @media (max-width: 768px) {\n :host {\n width: auto;\n margin: var(--st-promo-banner-margin, var(--st-space-24)) !important;\n padding: var(--st-promo-banner-padding, 60px var(--st-space-24)) !important;\n border-radius: var(--st-radius-lg);\n }\n .actions {\n flex-direction: column;\n align-items: stretch;\n }\n .cta {\n width: 100%;\n }\n }\n\n @media (prefers-reduced-motion: reduce) {\n .cta {\n transition: none;\n }\n }\n `;\n\n @property({ type: String })\n title = '';\n\n @property({ type: String })\n subtitle = '';\n\n @property({ type: String, attribute: 'action-label' })\n actionLabel = '';\n\n @property({ type: String })\n href = '';\n\n @property({ type: String, attribute: 'image-src' })\n imageSrc = '';\n\n /** Label of a second, outlined button next to the first. */\n @property({ type: String, attribute: 'secondary-action-label' })\n secondaryActionLabel = '';\n\n /** Target of the second button, sent in the `action` event detail. */\n @property({ type: String, attribute: 'secondary-href' })\n secondaryHref = '';\n\n /** `default` is the dark panel; `accent` fills the banner with the brand colour and makes the first button white. */\n @property({ type: String, reflect: true })\n variant: 'default' | 'accent' = 'default';\n\n @property({ type: Boolean, reflect: true })\n inverted = false;\n\n protected willUpdate(): void {\n this.style.backgroundImage = this.imageSrc ? `url(${JSON.stringify(this.imageSrc)})` : '';\n }\n\n private onAction = (): void => {\n this.dispatchEvent(\n new CustomEvent<HeroActionEventDetail>('action', { detail: { href: this.href }, bubbles: true, composed: true })\n );\n };\n\n private onSecondaryAction = (): void => {\n this.dispatchEvent(\n new CustomEvent<HeroActionEventDetail>('action', {\n detail: { href: this.secondaryHref, kind: 'secondary' },\n bubbles: true,\n composed: true\n })\n );\n };\n\n render() {\n return html`\n <div class=\"container\" part=\"container\">\n <h2 class=\"title\" part=\"title\">${this.title}</h2>\n ${this.subtitle ? html`<p class=\"subtitle\" part=\"subtitle\">${this.subtitle}</p>` : nothing}\n <slot></slot>\n ${this.actionLabel || this.secondaryActionLabel\n ? html`<div class=\"actions\" part=\"actions\">\n ${this.actionLabel\n ? html`<button class=\"cta\" part=\"action\" type=\"button\" @click=${this.onAction}>${this.actionLabel}</button>`\n : nothing}\n ${this.secondaryActionLabel\n ? html`<button class=\"cta secondary\" part=\"secondary-action\" type=\"button\" @click=${this.onSecondaryAction}>${this.secondaryActionLabel}</button>`\n : nothing}\n </div>`\n : nothing}\n </div>\n `;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AAAA,SAAS,YAAY,KAAK,MAAM,eAAe;AAC/C,SAAS,eAAe,gBAAgB;AAmBjC,IAAM,cAAN,cAA0B,WAAW;AAAA,EAArC;AAAA;AA6GL,iBAAQ;AAGR,oBAAW;AAGX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@@ MegaMenuFeature.styles = css3`
555
555
  color: inherit;
556
556
  }
557
557
 
558
+ /* tip: a light-blue card with dark text, like a tip panel on a page. */
559
+ :host([variant='tip']) .card {
560
+ gap: 0.5rem;
561
+ padding: 1.25rem;
562
+ border-radius: var(--st-radius-md);
563
+ border: 1px solid var(--st-color-accent-border);
564
+ background: var(--st-color-accent-subtle);
565
+ color: var(--st-color-text);
566
+ transition: border-color 0.2s ease;
567
+ }
568
+
569
+ :host([variant='tip']) .card:hover {
570
+ border-color: var(--st-color-accent-muted);
571
+ }
572
+
573
+ :host([variant='tip']) .title {
574
+ font-size: var(--st-text-lg);
575
+ font-weight: var(--st-font-weight-semibold);
576
+ color: var(--st-color-text-strong);
577
+ }
578
+
579
+ :host([variant='tip']) .eyebrow,
580
+ :host([variant='tip']) .cta {
581
+ color: var(--st-color-accent-text);
582
+ }
583
+
558
584
  @media (prefers-reduced-motion: reduce) {
559
585
  .image,
560
586
  :host([variant='overlay']) .card {
@@ -604,4 +630,4 @@ export {
604
630
  MegaMenuColumn,
605
631
  MegaMenuFeature
606
632
  };
607
- //# sourceMappingURL=chunk-G3CF7MBO.js.map
633
+ //# sourceMappingURL=chunk-J6EO4R73.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/mega-menu/MegaMenu.ts","../src/mega-menu/MegaMenuColumn.ts","../src/mega-menu/MegaMenuFeature.ts"],"sourcesContent":["import { LitElement, css, html, nothing } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\n\nimport { controlBaseStyles, fontFamilyStyles } from '../shared/styles';\n\n/**\n * The rich layout of a mega-menu panel, after okta.com: an optional intro column on the left (a\n * large `heading`, a `description` and, under a divider, quick links in `slot=\"intro\"`), then the\n * link columns side by side (`st-mega-menu-column`s in the default slot), then an optional\n * featured column on the right (`featured-heading` over the `st-mega-menu-feature` cards in\n * `slot=\"featured\"`). Slot it into an `st-dropdown` with `mega` set.\n *\n * The layout follows the width it is given, not the viewport (a container query): side by side\n * when there is room; intro and featured column above/below two link columns on a medium panel;\n * everything stacked in the narrow drill-down panel `st-header` shows on a phone (where the intro\n * heading is left out — the drill-down already shows the section's name).\n *\n * @slot - The link columns (`st-mega-menu-column`s, or any blocks).\n * @slot intro - Quick links under the intro text, e.g. `st-menu-item`s with an icon.\n * @slot featured - Promo cards (`st-mega-menu-feature`s), stacked.\n * @csspart inner - The grid holding every area.\n * @csspart intro - The intro column.\n * @csspart columns - The grid holding the link columns.\n * @csspart featured - The featured column.\n */\n@customElement('st-mega-menu')\nexport class MegaMenu extends LitElement {\n static styles = css`\n ${controlBaseStyles}\n\n :host {\n display: block;\n container-type: inline-size;\n ${fontFamilyStyles}\n }\n\n .inner {\n display: grid;\n gap: 3rem;\n padding: 3rem 3.5rem;\n box-sizing: border-box;\n }\n\n .columns {\n display: grid;\n grid-template-columns: repeat(var(--st-mega-menu-columns, 3), minmax(0, 1fr));\n gap: 3rem;\n align-items: stretch;\n }\n\n .intro,\n .featured {\n display: flex;\n flex-direction: column;\n min-width: 0;\n }\n\n .intro-heading {\n margin: 0 0 1rem;\n font-size: 2rem;\n font-weight: 400;\n line-height: 1.15;\n color: var(--st-color-text-strong);\n }\n\n .intro-description {\n margin: 0;\n font-size: 1rem;\n line-height: 1.55;\n color: var(--st-color-text);\n }\n\n .intro-links {\n display: flex;\n flex-direction: column;\n gap: 2px;\n margin-top: 2.5rem;\n padding-top: 2rem;\n border-top: 1px solid var(--st-color-border);\n }\n\n .intro-links.no-text {\n margin-top: 0;\n padding-top: 0;\n border-top: 0;\n }\n\n .featured-heading {\n margin: 0 0 1rem;\n font-size: 1.125rem;\n font-weight: 500;\n line-height: 1.35;\n color: var(--st-color-text-strong);\n }\n\n .featured-items {\n display: flex;\n flex-direction: column;\n gap: 0.75rem;\n }\n\n [hidden] {\n display: none !important;\n }\n\n /* Medium panel: intro on top, two link columns, featured cards side by side underneath. */\n @container (max-width: 960px) {\n .inner {\n grid-template-columns: minmax(0, 1fr) !important;\n gap: 2rem;\n padding: 2rem;\n }\n\n .columns {\n grid-template-columns: repeat(var(--st-mega-menu-columns-md, 2), minmax(0, 1fr));\n gap: 2rem;\n }\n\n .intro-links {\n margin-top: 1.5rem;\n padding-top: 1.5rem;\n }\n\n .featured-items {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));\n }\n }\n\n /* Narrow panel (the phone drill-down): everything stacked. */\n @container (max-width: 560px) {\n .inner {\n gap: 1.75rem;\n padding: 0.5rem 0 1.5rem;\n }\n\n .columns {\n grid-template-columns: minmax(0, 1fr);\n gap: 1.75rem;\n }\n\n .intro-heading {\n display: none;\n }\n }\n `;\n\n /** Large title of the intro column. */\n @property({ type: String })\n heading = '';\n\n /** Text under the intro title. */\n @property({ type: String })\n description = '';\n\n /** Heading over the featured cards. */\n @property({ type: String, attribute: 'featured-heading' })\n featuredHeading = '';\n\n /** Number of link columns side by side at full width. `0` (the default) uses one per slotted column. */\n @property({ type: Number })\n columns = 0;\n\n @state() private columnCount = 1;\n @state() private hasIntroLinks = false;\n @state() private hasFeatured = false;\n\n private onColumnsSlotChange = (event: Event): void => {\n this.columnCount = Math.max(1, (event.target as HTMLSlotElement).assignedElements({ flatten: true }).length);\n };\n\n private onIntroSlotChange = (event: Event): void => {\n this.hasIntroLinks = (event.target as HTMLSlotElement).assignedElements({ flatten: true }).length > 0;\n };\n\n private onFeaturedSlotChange = (event: Event): void => {\n this.hasFeatured = (event.target as HTMLSlotElement).assignedElements({ flatten: true }).length > 0;\n };\n\n render() {\n const columns = Math.min(6, Math.max(1, Math.round(this.columns) || this.columnCount));\n const hasIntroText = !!(this.heading || this.description);\n const hasIntro = hasIntroText || this.hasIntroLinks;\n const hasFeatured = this.hasFeatured || !!this.featuredHeading;\n // Every column — intro, each link column, featured — gets the same share of the width.\n const tracks = [hasIntro ? 'minmax(0, 1fr)' : '', `minmax(0, ${columns}fr)`, hasFeatured ? 'minmax(0, 1fr)' : '']\n .filter(Boolean)\n .join(' ');\n return html`\n <div\n part=\"inner\"\n class=\"inner\"\n style=\"grid-template-columns:${tracks};--st-mega-menu-columns:${columns};--st-mega-menu-columns-md:${Math.min(2, columns)}\"\n >\n <div part=\"intro\" class=\"intro\" ?hidden=${!hasIntro}>\n ${this.heading ? html`<p part=\"heading\" class=\"intro-heading\">${this.heading}</p>` : nothing}\n ${this.description ? html`<p part=\"description\" class=\"intro-description\">${this.description}</p>` : nothing}\n <div part=\"intro-links\" class=\"intro-links ${hasIntroText ? '' : 'no-text'}\" ?hidden=${!this.hasIntroLinks}>\n <slot name=\"intro\" @slotchange=${this.onIntroSlotChange}></slot>\n </div>\n </div>\n <div part=\"columns\" class=\"columns\"><slot @slotchange=${this.onColumnsSlotChange}></slot></div>\n <div part=\"featured\" class=\"featured\" ?hidden=${!hasFeatured}>\n ${this.featuredHeading ? html`<p part=\"featured-heading\" class=\"featured-heading\">${this.featuredHeading}</p>` : nothing}\n <div class=\"featured-items\"><slot name=\"featured\" @slotchange=${this.onFeaturedSlotChange}></slot></div>\n </div>\n </div>\n `;\n }\n}\n","import { LitElement, css, html, nothing } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n\nimport { arrowUpRightIcon } from '../shared/icons';\nimport { controlBaseStyles, fontFamilyStyles } from '../shared/styles';\nimport type { MegaMenuSelectEventDetail } from './MegaMenuEvents';\n\n/**\n * One column (or one group within a column) of an `st-mega-menu`: a heading, an optional line of\n * description, then its links stacked — usually `st-menu-item`s with `variant=\"link\"`. Nest\n * columns to stack several headed groups in one column, as okta.com does.\n *\n * `variant=\"card\"` puts the column on a tinted rounded tile and `variant=\"accent\"` on a solid\n * accent tile with light text; both suit a row of equal columns without intro or featured area.\n * `cta-label` + `cta-href` add a pill button at the bottom of the column.\n *\n * The heading (when `href` is set) and the button fire a *cancelable* `mega-menu-select` event\n * (detail: `{ href }`) before navigating; a host doing client-side routing calls\n * `event.preventDefault()` on it.\n *\n * @slot - The column's links, or nested `st-mega-menu-column` groups.\n * @fires mega-menu-select - The heading link or the button was clicked (cancelable; detail `{ href }`).\n * @csspart heading - The heading text or link.\n * @csspart description - The line under the heading.\n * @csspart items - The box holding the links.\n * @csspart cta - The pill button.\n * @cssprop --st-mega-menu-column-padding - Overrides the padding of a `card`/`accent` column.\n */\n@customElement('st-mega-menu-column')\nexport class MegaMenuColumn extends LitElement {\n static styles = css`\n ${controlBaseStyles}\n\n :host {\n display: flex;\n flex-direction: column;\n min-width: 0;\n box-sizing: border-box;\n ${fontFamilyStyles}\n }\n\n :host([variant='card']),\n :host([variant='accent']) {\n /* !important: a page-level reset (e.g. Tailwind Preflight) otherwise zeroes a shadow host's\n padding; override with --st-mega-menu-column-padding instead. */\n padding: var(--st-mega-menu-column-padding, 2rem 1.75rem 1.75rem) !important;\n border-radius: 20px;\n background: color-mix(in oklch, var(--st-color-text-strong) 5%, var(--st-color-surface));\n }\n\n :host([variant='accent']) {\n background: var(--st-color-accent);\n color: var(--st-color-on-solid);\n /* Read by the st-menu-item links inside. */\n --st-nav-color: var(--st-color-on-solid);\n --st-nav-hover-bg: transparent;\n }\n\n .heading {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n margin: 0 0 0.75rem;\n font-size: 1.125rem;\n font-weight: 500;\n line-height: 1.35;\n color: var(--st-color-text-strong);\n text-decoration: none;\n }\n\n :host([variant='card']) .heading,\n :host([variant='accent']) .heading {\n font-size: 1.375rem;\n }\n\n :host([variant='accent']) .heading {\n color: inherit;\n }\n\n a.heading:hover,\n a.heading:focus-visible {\n text-decoration: underline;\n text-underline-offset: 4px;\n }\n\n .description {\n margin: -0.25rem 0 0.75rem;\n font-size: 0.875rem;\n line-height: 1.5;\n color: var(--st-color-text-muted);\n }\n\n :host([variant='accent']) .description {\n color: inherit;\n opacity: 0.85;\n }\n\n .items {\n display: flex;\n flex-direction: column;\n gap: 2px;\n }\n\n /* Nested groups stack with room between them (!important for the same page-reset reason). */\n ::slotted(st-mega-menu-column:not(:first-child)) {\n margin-top: 2rem !important;\n }\n\n .cta {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 6px;\n padding: 0.875rem 1.5rem;\n border-radius: 9999px;\n background: var(--st-color-surface);\n color: var(--st-color-text-strong);\n font-size: 1rem;\n font-weight: 500;\n text-align: center;\n text-decoration: none;\n transition: box-shadow 0.2s ease;\n }\n\n .cta-spacer {\n flex: 1;\n min-height: 1.75rem;\n }\n\n .cta:hover,\n .cta:focus-visible {\n box-shadow: 0 0 0 2px currentColor;\n }\n\n @media (prefers-reduced-motion: reduce) {\n .cta {\n transition: none;\n }\n }\n `;\n\n @property({ type: String })\n heading = '';\n\n /** Makes the heading a link (e.g. to the section's overview page). */\n @property({ type: String })\n href = '';\n\n @property({ type: String })\n description = '';\n\n /** `plain` (default), `card` (tinted tile) or `accent` (solid accent tile, light text). */\n @property({ type: String, reflect: true })\n variant: 'plain' | 'card' | 'accent' = 'plain';\n\n /** Text of a pill button at the bottom of the column; needs `cta-href`. */\n @property({ type: String, attribute: 'cta-label' })\n ctaLabel = '';\n\n @property({ type: String, attribute: 'cta-href' })\n ctaHref = '';\n\n private select(event: MouseEvent, href: string): void {\n if (href.startsWith('http')) return;\n const selectEvent = new CustomEvent<MegaMenuSelectEventDetail>('mega-menu-select', {\n detail: { href },\n bubbles: true,\n composed: true,\n cancelable: true\n });\n this.dispatchEvent(selectEvent);\n if (selectEvent.defaultPrevented) event.preventDefault();\n }\n\n private renderHeading() {\n if (!this.heading) return nothing;\n return this.href\n ? html`<a part=\"heading\" class=\"heading\" href=${this.href} @click=${(event: MouseEvent) => this.select(event, this.href)}\n >${this.heading}</a\n >`\n : html`<p part=\"heading\" class=\"heading\">${this.heading}</p>`;\n }\n\n private renderCta() {\n if (!this.ctaLabel || !this.ctaHref) return nothing;\n const external = this.ctaHref.startsWith('http');\n return html`\n <span class=\"cta-spacer\"></span>\n <a\n part=\"cta\"\n class=\"cta\"\n href=${this.ctaHref}\n target=${external ? '_blank' : '_self'}\n rel=${external ? 'noopener noreferrer' : nothing}\n @click=${(event: MouseEvent) => this.select(event, this.ctaHref)}\n >${this.ctaLabel} ${external ? arrowUpRightIcon(14) : nothing}</a\n >\n `;\n }\n\n render() {\n return html`\n ${this.renderHeading()}\n ${this.description ? html`<p part=\"description\" class=\"description\">${this.description}</p>` : nothing}\n <div part=\"items\" class=\"items\" role=\"group\" aria-label=${this.heading || nothing}><slot></slot></div>\n ${this.renderCta()}\n `;\n }\n}\n","import { LitElement, css, html, nothing } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n\nimport { controlBaseStyles, fontFamilyStyles } from '../shared/styles';\nimport type { MegaMenuSelectEventDetail } from './MegaMenuEvents';\n\n/**\n * A promo card for the featured column of an `st-mega-menu` (`slot=\"featured\"`). The whole card\n * is one link. Two looks, after okta.com:\n *\n * - `story` (default): a rounded image on top, then the description and an underlined\n * call-to-action line — a customer story or announcement.\n * - `overlay`: a tile with light text over `image-url` (darkened), or over an accent gradient when\n * there is no image — an optional `logo-url` top left, the title and description at the bottom.\n *\n * An `http(s)` `href` opens in a new tab unless `target` says otherwise. Any other `href` fires a\n * *cancelable* `mega-menu-select` event (detail: `{ href }`) first; a host doing client-side\n * routing calls `event.preventDefault()` on it.\n *\n * @fires mega-menu-select - The card was clicked (cancelable; detail `{ href }`).\n * @csspart card - The card link.\n * @csspart image - The image (`story`).\n * @csspart logo - The logo (`overlay`).\n * @csspart eyebrow - The small label above the title.\n * @csspart title - The title.\n * @csspart description - The description.\n * @csspart cta - The call-to-action line.\n * @cssprop --st-mega-menu-feature-from - Start colour of the `overlay` gradient (default: the accent colour).\n * @cssprop --st-mega-menu-feature-to - End colour of the `overlay` gradient.\n */\n@customElement('st-mega-menu-feature')\nexport class MegaMenuFeature extends LitElement {\n /** `focus()` on the element focuses its link, so `st-dropdown` can arrow-key to it. */\n static shadowRootOptions = { ...LitElement.shadowRootOptions, delegatesFocus: true };\n\n static styles = css`\n ${controlBaseStyles}\n\n :host {\n display: block;\n ${fontFamilyStyles}\n }\n\n .card {\n display: flex;\n flex-direction: column;\n gap: 0.75rem;\n box-sizing: border-box;\n color: var(--st-color-text-strong);\n text-decoration: none;\n }\n\n .image {\n display: block;\n width: 100%;\n aspect-ratio: 9 / 8;\n object-fit: cover;\n border-radius: 20px;\n transition: transform 0.3s ease;\n }\n\n .card:hover .image {\n transform: scale(1.015);\n }\n\n .eyebrow {\n font-size: 0.75rem;\n font-weight: 600;\n letter-spacing: 0.06em;\n text-transform: uppercase;\n color: var(--st-color-accent-text);\n }\n\n .title {\n margin: 0;\n font-size: 1.125rem;\n font-weight: 500;\n line-height: 1.3;\n }\n\n .description {\n margin: 0;\n font-size: 0.9375rem;\n line-height: 1.5;\n }\n\n .cta {\n align-self: flex-start;\n margin-top: 0.75rem;\n font-size: 0.9375rem;\n font-weight: 500;\n text-decoration: underline;\n text-underline-offset: 5px;\n text-decoration-thickness: 1px;\n }\n\n .card:hover .cta,\n .card:focus-visible .cta {\n text-decoration-thickness: 2px;\n }\n\n /* overlay */\n :host([variant='overlay']) .card {\n justify-content: flex-end;\n gap: 0.5rem;\n min-height: 15rem;\n padding: 1.75rem;\n border-radius: 20px;\n color: #fff;\n background-color: var(--st-color-accent);\n background-image:\n linear-gradient(to top, rgb(0 0 0 / 0.55), rgb(0 0 0 / 0.05)),\n var(--st-mega-menu-feature-image, linear-gradient(160deg, var(--st-mega-menu-feature-from, var(--st-color-accent)), var(--st-mega-menu-feature-to, oklch(0.25 0.12 280))));\n background-size: cover;\n background-position: center;\n transition: transform 0.2s ease;\n }\n\n :host([variant='overlay']) .card:hover {\n transform: translateY(-2px);\n }\n\n :host([variant='overlay']) .logo {\n height: 2.25rem;\n width: auto;\n max-width: 70%;\n margin-bottom: auto;\n align-self: flex-start;\n object-fit: contain;\n }\n\n :host([variant='overlay']) .title {\n font-size: 1.75rem;\n font-weight: 400;\n }\n\n :host([variant='overlay']) .eyebrow,\n :host([variant='overlay']) .cta {\n color: inherit;\n }\n\n @media (prefers-reduced-motion: reduce) {\n .image,\n :host([variant='overlay']) .card {\n transition: none;\n }\n }\n `;\n\n /** `story` (default) or `overlay` — see the element description. */\n @property({ type: String, reflect: true })\n variant: 'story' | 'overlay' = 'story';\n\n @property({ type: String })\n title = '';\n\n @property({ type: String })\n description = '';\n\n /** Small label above the title, e.g. \"New\" or \"Report\". */\n @property({ type: String })\n eyebrow = '';\n\n @property({ type: String })\n href = '';\n\n /** `target` for the link. Defaults to `_blank` for an `http(s)` `href`, `_self` otherwise. */\n @property({ type: String })\n target = '';\n\n /** Image on top (`story`) or behind the text (`overlay`). */\n @property({ type: String, attribute: 'image-url' })\n imageUrl = '';\n\n @property({ type: String, attribute: 'image-alt' })\n imageAlt = '';\n\n /** Logo at the top of an `overlay` card. */\n @property({ type: String, attribute: 'logo-url' })\n logoUrl = '';\n\n @property({ type: String, attribute: 'logo-alt' })\n logoAlt = '';\n\n /** Call-to-action text at the bottom of the card; empty hides it. */\n @property({ type: String, attribute: 'cta-label' })\n ctaLabel = '';\n\n private get isExternal(): boolean {\n return this.href.startsWith('http');\n }\n\n private onClick = (event: MouseEvent): void => {\n if (this.isExternal) return;\n const selectEvent = new CustomEvent<MegaMenuSelectEventDetail>('mega-menu-select', {\n detail: { href: this.href },\n bubbles: true,\n composed: true,\n cancelable: true\n });\n this.dispatchEvent(selectEvent);\n if (selectEvent.defaultPrevented) event.preventDefault();\n };\n\n render() {\n const target = this.target || (this.isExternal ? '_blank' : '_self');\n const overlay = this.variant === 'overlay';\n const style = overlay && this.imageUrl ? `--st-mega-menu-feature-image:url(${JSON.stringify(this.imageUrl)})` : '';\n return html`\n <a\n part=\"card\"\n class=\"card\"\n style=${style}\n href=${this.href || nothing}\n target=${target}\n rel=${target === '_blank' ? 'noopener noreferrer' : nothing}\n @click=${this.onClick}\n >\n ${overlay && this.logoUrl ? html`<img part=\"logo\" class=\"logo\" src=${this.logoUrl} alt=${this.logoAlt} />` : nothing}\n ${!overlay && this.imageUrl\n ? html`<img part=\"image\" class=\"image\" src=${this.imageUrl} alt=${this.imageAlt} loading=\"lazy\" />`\n : nothing}\n ${this.eyebrow ? html`<span part=\"eyebrow\" class=\"eyebrow\">${this.eyebrow}</span>` : nothing}\n ${this.title ? html`<p part=\"title\" class=\"title\">${this.title}</p>` : nothing}\n ${this.description ? html`<p part=\"description\" class=\"description\">${this.description}</p>` : nothing}\n ${this.ctaLabel ? html`<span part=\"cta\" class=\"cta\">${this.ctaLabel}</span>` : nothing}\n </a>\n `;\n }\n}\n"],"mappings":";;;;;;;;;;;;AAAA,SAAS,YAAY,KAAK,MAAM,eAAe;AAC/C,SAAS,eAAe,UAAU,aAAa;AAyBxC,IAAM,WAAN,cAAuB,WAAW;AAAA,EAAlC;AAAA;AA2HL,mBAAU;AAIV,uBAAc;AAId,2BAAkB;AAIlB,mBAAU;AAED,SAAQ,cAAc;AACtB,SAAQ,gBAAgB;AACxB,SAAQ,cAAc;AAE/B,SAAQ,sBAAsB,CAAC,UAAuB;AACpD,WAAK,cAAc,KAAK,IAAI,GAAI,MAAM,OAA2B,iBAAiB,EAAE,SAAS,KAAK,CAAC,EAAE,MAAM;AAAA,IAC7G;AAEA,SAAQ,oBAAoB,CAAC,UAAuB;AAClD,WAAK,gBAAiB,MAAM,OAA2B,iBAAiB,EAAE,SAAS,KAAK,CAAC,EAAE,SAAS;AAAA,IACtG;AAEA,SAAQ,uBAAuB,CAAC,UAAuB;AACrD,WAAK,cAAe,MAAM,OAA2B,iBAAiB,EAAE,SAAS,KAAK,CAAC,EAAE,SAAS;AAAA,IACpG;AAAA;AAAA,EAEA,SAAS;AACP,UAAM,UAAU,KAAK,IAAI,GAAG,KAAK,IAAI,GAAG,KAAK,MAAM,KAAK,OAAO,KAAK,KAAK,WAAW,CAAC;AACrF,UAAM,eAAe,CAAC,EAAE,KAAK,WAAW,KAAK;AAC7C,UAAM,WAAW,gBAAgB,KAAK;AACtC,UAAM,cAAc,KAAK,eAAe,CAAC,CAAC,KAAK;AAE/C,UAAM,SAAS,CAAC,WAAW,mBAAmB,IAAI,aAAa,OAAO,OAAO,cAAc,mBAAmB,EAAE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W,WAAW,CAAC;AAAA,GAtJtC,gBAuJX;AAIA;AAAA,EADCA,UAAS,EAAE,MAAM,QAAQ,WAAW,YAAY,CAAC;AAAA,GA1JvC,gBA2JX;AA3JW,kBAAN;AAAA,EADNC,eAAc,sBAAsB;AAAA,GACxB;","names":["LitElement","css","html","nothing","customElement","property","LitElement","nothing","html","css","property","customElement","LitElement","css","html","nothing","customElement","property","LitElement","html","nothing","css","property","customElement"]}
1
+ {"version":3,"sources":["../src/mega-menu/MegaMenu.ts","../src/mega-menu/MegaMenuColumn.ts","../src/mega-menu/MegaMenuFeature.ts"],"sourcesContent":["import { LitElement, css, html, nothing } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\n\nimport { controlBaseStyles, fontFamilyStyles } from '../shared/styles';\n\n/**\n * The rich layout of a mega-menu panel, after okta.com: an optional intro column on the left (a\n * large `heading`, a `description` and, under a divider, quick links in `slot=\"intro\"`), then the\n * link columns side by side (`st-mega-menu-column`s in the default slot), then an optional\n * featured column on the right (`featured-heading` over the `st-mega-menu-feature` cards in\n * `slot=\"featured\"`). Slot it into an `st-dropdown` with `mega` set.\n *\n * The layout follows the width it is given, not the viewport (a container query): side by side\n * when there is room; intro and featured column above/below two link columns on a medium panel;\n * everything stacked in the narrow drill-down panel `st-header` shows on a phone (where the intro\n * heading is left out — the drill-down already shows the section's name).\n *\n * @slot - The link columns (`st-mega-menu-column`s, or any blocks).\n * @slot intro - Quick links under the intro text, e.g. `st-menu-item`s with an icon.\n * @slot featured - Promo cards (`st-mega-menu-feature`s), stacked.\n * @csspart inner - The grid holding every area.\n * @csspart intro - The intro column.\n * @csspart columns - The grid holding the link columns.\n * @csspart featured - The featured column.\n */\n@customElement('st-mega-menu')\nexport class MegaMenu extends LitElement {\n static styles = css`\n ${controlBaseStyles}\n\n :host {\n display: block;\n container-type: inline-size;\n ${fontFamilyStyles}\n }\n\n .inner {\n display: grid;\n gap: 3rem;\n padding: 3rem 3.5rem;\n box-sizing: border-box;\n }\n\n .columns {\n display: grid;\n grid-template-columns: repeat(var(--st-mega-menu-columns, 3), minmax(0, 1fr));\n gap: 3rem;\n align-items: stretch;\n }\n\n .intro,\n .featured {\n display: flex;\n flex-direction: column;\n min-width: 0;\n }\n\n .intro-heading {\n margin: 0 0 1rem;\n font-size: 2rem;\n font-weight: 400;\n line-height: 1.15;\n color: var(--st-color-text-strong);\n }\n\n .intro-description {\n margin: 0;\n font-size: 1rem;\n line-height: 1.55;\n color: var(--st-color-text);\n }\n\n .intro-links {\n display: flex;\n flex-direction: column;\n gap: 2px;\n margin-top: 2.5rem;\n padding-top: 2rem;\n border-top: 1px solid var(--st-color-border);\n }\n\n .intro-links.no-text {\n margin-top: 0;\n padding-top: 0;\n border-top: 0;\n }\n\n .featured-heading {\n margin: 0 0 1rem;\n font-size: 1.125rem;\n font-weight: 500;\n line-height: 1.35;\n color: var(--st-color-text-strong);\n }\n\n .featured-items {\n display: flex;\n flex-direction: column;\n gap: 0.75rem;\n }\n\n [hidden] {\n display: none !important;\n }\n\n /* Medium panel: intro on top, two link columns, featured cards side by side underneath. */\n @container (max-width: 960px) {\n .inner {\n grid-template-columns: minmax(0, 1fr) !important;\n gap: 2rem;\n padding: 2rem;\n }\n\n .columns {\n grid-template-columns: repeat(var(--st-mega-menu-columns-md, 2), minmax(0, 1fr));\n gap: 2rem;\n }\n\n .intro-links {\n margin-top: 1.5rem;\n padding-top: 1.5rem;\n }\n\n .featured-items {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));\n }\n }\n\n /* Narrow panel (the phone drill-down): everything stacked. */\n @container (max-width: 560px) {\n .inner {\n gap: 1.75rem;\n padding: 0.5rem 0 1.5rem;\n }\n\n .columns {\n grid-template-columns: minmax(0, 1fr);\n gap: 1.75rem;\n }\n\n .intro-heading {\n display: none;\n }\n }\n `;\n\n /** Large title of the intro column. */\n @property({ type: String })\n heading = '';\n\n /** Text under the intro title. */\n @property({ type: String })\n description = '';\n\n /** Heading over the featured cards. */\n @property({ type: String, attribute: 'featured-heading' })\n featuredHeading = '';\n\n /** Number of link columns side by side at full width. `0` (the default) uses one per slotted column. */\n @property({ type: Number })\n columns = 0;\n\n @state() private columnCount = 1;\n @state() private hasIntroLinks = false;\n @state() private hasFeatured = false;\n\n private onColumnsSlotChange = (event: Event): void => {\n this.columnCount = Math.max(1, (event.target as HTMLSlotElement).assignedElements({ flatten: true }).length);\n };\n\n private onIntroSlotChange = (event: Event): void => {\n this.hasIntroLinks = (event.target as HTMLSlotElement).assignedElements({ flatten: true }).length > 0;\n };\n\n private onFeaturedSlotChange = (event: Event): void => {\n this.hasFeatured = (event.target as HTMLSlotElement).assignedElements({ flatten: true }).length > 0;\n };\n\n render() {\n const columns = Math.min(6, Math.max(1, Math.round(this.columns) || this.columnCount));\n const hasIntroText = !!(this.heading || this.description);\n const hasIntro = hasIntroText || this.hasIntroLinks;\n const hasFeatured = this.hasFeatured || !!this.featuredHeading;\n // Every column — intro, each link column, featured — gets the same share of the width.\n const tracks = [hasIntro ? 'minmax(0, 1fr)' : '', `minmax(0, ${columns}fr)`, hasFeatured ? 'minmax(0, 1fr)' : '']\n .filter(Boolean)\n .join(' ');\n return html`\n <div\n part=\"inner\"\n class=\"inner\"\n style=\"grid-template-columns:${tracks};--st-mega-menu-columns:${columns};--st-mega-menu-columns-md:${Math.min(2, columns)}\"\n >\n <div part=\"intro\" class=\"intro\" ?hidden=${!hasIntro}>\n ${this.heading ? html`<p part=\"heading\" class=\"intro-heading\">${this.heading}</p>` : nothing}\n ${this.description ? html`<p part=\"description\" class=\"intro-description\">${this.description}</p>` : nothing}\n <div part=\"intro-links\" class=\"intro-links ${hasIntroText ? '' : 'no-text'}\" ?hidden=${!this.hasIntroLinks}>\n <slot name=\"intro\" @slotchange=${this.onIntroSlotChange}></slot>\n </div>\n </div>\n <div part=\"columns\" class=\"columns\"><slot @slotchange=${this.onColumnsSlotChange}></slot></div>\n <div part=\"featured\" class=\"featured\" ?hidden=${!hasFeatured}>\n ${this.featuredHeading ? html`<p part=\"featured-heading\" class=\"featured-heading\">${this.featuredHeading}</p>` : nothing}\n <div class=\"featured-items\"><slot name=\"featured\" @slotchange=${this.onFeaturedSlotChange}></slot></div>\n </div>\n </div>\n `;\n }\n}\n","import { LitElement, css, html, nothing } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n\nimport { arrowUpRightIcon } from '../shared/icons';\nimport { controlBaseStyles, fontFamilyStyles } from '../shared/styles';\nimport type { MegaMenuSelectEventDetail } from './MegaMenuEvents';\n\n/**\n * One column (or one group within a column) of an `st-mega-menu`: a heading, an optional line of\n * description, then its links stacked — usually `st-menu-item`s with `variant=\"link\"`. Nest\n * columns to stack several headed groups in one column, as okta.com does.\n *\n * `variant=\"card\"` puts the column on a tinted rounded tile and `variant=\"accent\"` on a solid\n * accent tile with light text; both suit a row of equal columns without intro or featured area.\n * `cta-label` + `cta-href` add a pill button at the bottom of the column.\n *\n * The heading (when `href` is set) and the button fire a *cancelable* `mega-menu-select` event\n * (detail: `{ href }`) before navigating; a host doing client-side routing calls\n * `event.preventDefault()` on it.\n *\n * @slot - The column's links, or nested `st-mega-menu-column` groups.\n * @fires mega-menu-select - The heading link or the button was clicked (cancelable; detail `{ href }`).\n * @csspart heading - The heading text or link.\n * @csspart description - The line under the heading.\n * @csspart items - The box holding the links.\n * @csspart cta - The pill button.\n * @cssprop --st-mega-menu-column-padding - Overrides the padding of a `card`/`accent` column.\n */\n@customElement('st-mega-menu-column')\nexport class MegaMenuColumn extends LitElement {\n static styles = css`\n ${controlBaseStyles}\n\n :host {\n display: flex;\n flex-direction: column;\n min-width: 0;\n box-sizing: border-box;\n ${fontFamilyStyles}\n }\n\n :host([variant='card']),\n :host([variant='accent']) {\n /* !important: a page-level reset (e.g. Tailwind Preflight) otherwise zeroes a shadow host's\n padding; override with --st-mega-menu-column-padding instead. */\n padding: var(--st-mega-menu-column-padding, 2rem 1.75rem 1.75rem) !important;\n border-radius: 20px;\n background: color-mix(in oklch, var(--st-color-text-strong) 5%, var(--st-color-surface));\n }\n\n :host([variant='accent']) {\n background: var(--st-color-accent);\n color: var(--st-color-on-solid);\n /* Read by the st-menu-item links inside. */\n --st-nav-color: var(--st-color-on-solid);\n --st-nav-hover-bg: transparent;\n }\n\n .heading {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n margin: 0 0 0.75rem;\n font-size: 1.125rem;\n font-weight: 500;\n line-height: 1.35;\n color: var(--st-color-text-strong);\n text-decoration: none;\n }\n\n :host([variant='card']) .heading,\n :host([variant='accent']) .heading {\n font-size: 1.375rem;\n }\n\n :host([variant='accent']) .heading {\n color: inherit;\n }\n\n a.heading:hover,\n a.heading:focus-visible {\n text-decoration: underline;\n text-underline-offset: 4px;\n }\n\n .description {\n margin: -0.25rem 0 0.75rem;\n font-size: 0.875rem;\n line-height: 1.5;\n color: var(--st-color-text-muted);\n }\n\n :host([variant='accent']) .description {\n color: inherit;\n opacity: 0.85;\n }\n\n .items {\n display: flex;\n flex-direction: column;\n gap: 2px;\n }\n\n /* Nested groups stack with room between them (!important for the same page-reset reason). */\n ::slotted(st-mega-menu-column:not(:first-child)) {\n margin-top: 2rem !important;\n }\n\n .cta {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 6px;\n padding: 0.875rem 1.5rem;\n border-radius: 9999px;\n background: var(--st-color-surface);\n color: var(--st-color-text-strong);\n font-size: 1rem;\n font-weight: 500;\n text-align: center;\n text-decoration: none;\n transition: box-shadow 0.2s ease;\n }\n\n .cta-spacer {\n flex: 1;\n min-height: 1.75rem;\n }\n\n .cta:hover,\n .cta:focus-visible {\n box-shadow: 0 0 0 2px currentColor;\n }\n\n @media (prefers-reduced-motion: reduce) {\n .cta {\n transition: none;\n }\n }\n `;\n\n @property({ type: String })\n heading = '';\n\n /** Makes the heading a link (e.g. to the section's overview page). */\n @property({ type: String })\n href = '';\n\n @property({ type: String })\n description = '';\n\n /** `plain` (default), `card` (tinted tile) or `accent` (solid accent tile, light text). */\n @property({ type: String, reflect: true })\n variant: 'plain' | 'card' | 'accent' = 'plain';\n\n /** Text of a pill button at the bottom of the column; needs `cta-href`. */\n @property({ type: String, attribute: 'cta-label' })\n ctaLabel = '';\n\n @property({ type: String, attribute: 'cta-href' })\n ctaHref = '';\n\n private select(event: MouseEvent, href: string): void {\n if (href.startsWith('http')) return;\n const selectEvent = new CustomEvent<MegaMenuSelectEventDetail>('mega-menu-select', {\n detail: { href },\n bubbles: true,\n composed: true,\n cancelable: true\n });\n this.dispatchEvent(selectEvent);\n if (selectEvent.defaultPrevented) event.preventDefault();\n }\n\n private renderHeading() {\n if (!this.heading) return nothing;\n return this.href\n ? html`<a part=\"heading\" class=\"heading\" href=${this.href} @click=${(event: MouseEvent) => this.select(event, this.href)}\n >${this.heading}</a\n >`\n : html`<p part=\"heading\" class=\"heading\">${this.heading}</p>`;\n }\n\n private renderCta() {\n if (!this.ctaLabel || !this.ctaHref) return nothing;\n const external = this.ctaHref.startsWith('http');\n return html`\n <span class=\"cta-spacer\"></span>\n <a\n part=\"cta\"\n class=\"cta\"\n href=${this.ctaHref}\n target=${external ? '_blank' : '_self'}\n rel=${external ? 'noopener noreferrer' : nothing}\n @click=${(event: MouseEvent) => this.select(event, this.ctaHref)}\n >${this.ctaLabel} ${external ? arrowUpRightIcon(14) : nothing}</a\n >\n `;\n }\n\n render() {\n return html`\n ${this.renderHeading()}\n ${this.description ? html`<p part=\"description\" class=\"description\">${this.description}</p>` : nothing}\n <div part=\"items\" class=\"items\" role=\"group\" aria-label=${this.heading || nothing}><slot></slot></div>\n ${this.renderCta()}\n `;\n }\n}\n","import { LitElement, css, html, nothing } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n\nimport { controlBaseStyles, fontFamilyStyles } from '../shared/styles';\nimport type { MegaMenuSelectEventDetail } from './MegaMenuEvents';\n\n/**\n * A promo card for the featured column of an `st-mega-menu` (`slot=\"featured\"`). The whole card\n * is one link. Two looks, after okta.com:\n *\n * - `story` (default): a rounded image on top, then the description and an underlined\n * call-to-action line — a customer story or announcement.\n * - `overlay`: a tile with light text over `image-url` (darkened), or over an accent gradient when\n * there is no image — an optional `logo-url` top left, the title and description at the bottom.\n *\n * An `http(s)` `href` opens in a new tab unless `target` says otherwise. Any other `href` fires a\n * *cancelable* `mega-menu-select` event (detail: `{ href }`) first; a host doing client-side\n * routing calls `event.preventDefault()` on it.\n *\n * @fires mega-menu-select - The card was clicked (cancelable; detail `{ href }`).\n * @csspart card - The card link.\n * @csspart image - The image (`story`).\n * @csspart logo - The logo (`overlay`).\n * @csspart eyebrow - The small label above the title.\n * @csspart title - The title.\n * @csspart description - The description.\n * @csspart cta - The call-to-action line.\n * @cssprop --st-mega-menu-feature-from - Start colour of the `overlay` gradient (default: the accent colour).\n * @cssprop --st-mega-menu-feature-to - End colour of the `overlay` gradient.\n */\n@customElement('st-mega-menu-feature')\nexport class MegaMenuFeature extends LitElement {\n /** `focus()` on the element focuses its link, so `st-dropdown` can arrow-key to it. */\n static shadowRootOptions = { ...LitElement.shadowRootOptions, delegatesFocus: true };\n\n static styles = css`\n ${controlBaseStyles}\n\n :host {\n display: block;\n ${fontFamilyStyles}\n }\n\n .card {\n display: flex;\n flex-direction: column;\n gap: 0.75rem;\n box-sizing: border-box;\n color: var(--st-color-text-strong);\n text-decoration: none;\n }\n\n .image {\n display: block;\n width: 100%;\n aspect-ratio: 9 / 8;\n object-fit: cover;\n border-radius: 20px;\n transition: transform 0.3s ease;\n }\n\n .card:hover .image {\n transform: scale(1.015);\n }\n\n .eyebrow {\n font-size: 0.75rem;\n font-weight: 600;\n letter-spacing: 0.06em;\n text-transform: uppercase;\n color: var(--st-color-accent-text);\n }\n\n .title {\n margin: 0;\n font-size: 1.125rem;\n font-weight: 500;\n line-height: 1.3;\n }\n\n .description {\n margin: 0;\n font-size: 0.9375rem;\n line-height: 1.5;\n }\n\n .cta {\n align-self: flex-start;\n margin-top: 0.75rem;\n font-size: 0.9375rem;\n font-weight: 500;\n text-decoration: underline;\n text-underline-offset: 5px;\n text-decoration-thickness: 1px;\n }\n\n .card:hover .cta,\n .card:focus-visible .cta {\n text-decoration-thickness: 2px;\n }\n\n /* overlay */\n :host([variant='overlay']) .card {\n justify-content: flex-end;\n gap: 0.5rem;\n min-height: 15rem;\n padding: 1.75rem;\n border-radius: 20px;\n color: #fff;\n background-color: var(--st-color-accent);\n background-image:\n linear-gradient(to top, rgb(0 0 0 / 0.55), rgb(0 0 0 / 0.05)),\n var(--st-mega-menu-feature-image, linear-gradient(160deg, var(--st-mega-menu-feature-from, var(--st-color-accent)), var(--st-mega-menu-feature-to, oklch(0.25 0.12 280))));\n background-size: cover;\n background-position: center;\n transition: transform 0.2s ease;\n }\n\n :host([variant='overlay']) .card:hover {\n transform: translateY(-2px);\n }\n\n :host([variant='overlay']) .logo {\n height: 2.25rem;\n width: auto;\n max-width: 70%;\n margin-bottom: auto;\n align-self: flex-start;\n object-fit: contain;\n }\n\n :host([variant='overlay']) .title {\n font-size: 1.75rem;\n font-weight: 400;\n }\n\n :host([variant='overlay']) .eyebrow,\n :host([variant='overlay']) .cta {\n color: inherit;\n }\n\n /* tip: a light-blue card with dark text, like a tip panel on a page. */\n :host([variant='tip']) .card {\n gap: 0.5rem;\n padding: 1.25rem;\n border-radius: var(--st-radius-md);\n border: 1px solid var(--st-color-accent-border);\n background: var(--st-color-accent-subtle);\n color: var(--st-color-text);\n transition: border-color 0.2s ease;\n }\n\n :host([variant='tip']) .card:hover {\n border-color: var(--st-color-accent-muted);\n }\n\n :host([variant='tip']) .title {\n font-size: var(--st-text-lg);\n font-weight: var(--st-font-weight-semibold);\n color: var(--st-color-text-strong);\n }\n\n :host([variant='tip']) .eyebrow,\n :host([variant='tip']) .cta {\n color: var(--st-color-accent-text);\n }\n\n @media (prefers-reduced-motion: reduce) {\n .image,\n :host([variant='overlay']) .card {\n transition: none;\n }\n }\n `;\n\n /** `story` (default), `overlay` (dark, over an image or gradient) or `tip` (light blue, for a hint). */\n @property({ type: String, reflect: true })\n variant: 'story' | 'overlay' | 'tip' = 'story';\n\n @property({ type: String })\n title = '';\n\n @property({ type: String })\n description = '';\n\n /** Small label above the title, e.g. \"New\" or \"Report\". */\n @property({ type: String })\n eyebrow = '';\n\n @property({ type: String })\n href = '';\n\n /** `target` for the link. Defaults to `_blank` for an `http(s)` `href`, `_self` otherwise. */\n @property({ type: String })\n target = '';\n\n /** Image on top (`story`) or behind the text (`overlay`). */\n @property({ type: String, attribute: 'image-url' })\n imageUrl = '';\n\n @property({ type: String, attribute: 'image-alt' })\n imageAlt = '';\n\n /** Logo at the top of an `overlay` card. */\n @property({ type: String, attribute: 'logo-url' })\n logoUrl = '';\n\n @property({ type: String, attribute: 'logo-alt' })\n logoAlt = '';\n\n /** Call-to-action text at the bottom of the card; empty hides it. */\n @property({ type: String, attribute: 'cta-label' })\n ctaLabel = '';\n\n private get isExternal(): boolean {\n return this.href.startsWith('http');\n }\n\n private onClick = (event: MouseEvent): void => {\n if (this.isExternal) return;\n const selectEvent = new CustomEvent<MegaMenuSelectEventDetail>('mega-menu-select', {\n detail: { href: this.href },\n bubbles: true,\n composed: true,\n cancelable: true\n });\n this.dispatchEvent(selectEvent);\n if (selectEvent.defaultPrevented) event.preventDefault();\n };\n\n render() {\n const target = this.target || (this.isExternal ? '_blank' : '_self');\n const overlay = this.variant === 'overlay';\n const style = overlay && this.imageUrl ? `--st-mega-menu-feature-image:url(${JSON.stringify(this.imageUrl)})` : '';\n return html`\n <a\n part=\"card\"\n class=\"card\"\n style=${style}\n href=${this.href || nothing}\n target=${target}\n rel=${target === '_blank' ? 'noopener noreferrer' : nothing}\n @click=${this.onClick}\n >\n ${overlay && this.logoUrl ? html`<img part=\"logo\" class=\"logo\" src=${this.logoUrl} alt=${this.logoAlt} />` : nothing}\n ${!overlay && this.imageUrl\n ? html`<img part=\"image\" class=\"image\" src=${this.imageUrl} alt=${this.imageAlt} loading=\"lazy\" />`\n : nothing}\n ${this.eyebrow ? html`<span part=\"eyebrow\" class=\"eyebrow\">${this.eyebrow}</span>` : nothing}\n ${this.title ? html`<p part=\"title\" class=\"title\">${this.title}</p>` : nothing}\n ${this.description ? html`<p part=\"description\" class=\"description\">${this.description}</p>` : nothing}\n ${this.ctaLabel ? html`<span part=\"cta\" class=\"cta\">${this.ctaLabel}</span>` : nothing}\n </a>\n `;\n }\n}\n"],"mappings":";;;;;;;;;;;;AAAA,SAAS,YAAY,KAAK,MAAM,eAAe;AAC/C,SAAS,eAAe,UAAU,aAAa;AAyBxC,IAAM,WAAN,cAAuB,WAAW;AAAA,EAAlC;AAAA;AA2HL,mBAAU;AAIV,uBAAc;AAId,2BAAkB;AAIlB,mBAAU;AAED,SAAQ,cAAc;AACtB,SAAQ,gBAAgB;AACxB,SAAQ,cAAc;AAE/B,SAAQ,sBAAsB,CAAC,UAAuB;AACpD,WAAK,cAAc,KAAK,IAAI,GAAI,MAAM,OAA2B,iBAAiB,EAAE,SAAS,KAAK,CAAC,EAAE,MAAM;AAAA,IAC7G;AAEA,SAAQ,oBAAoB,CAAC,UAAuB;AAClD,WAAK,gBAAiB,MAAM,OAA2B,iBAAiB,EAAE,SAAS,KAAK,CAAC,EAAE,SAAS;AAAA,IACtG;AAEA,SAAQ,uBAAuB,CAAC,UAAuB;AACrD,WAAK,cAAe,MAAM,OAA2B,iBAAiB,EAAE,SAAS,KAAK,CAAC,EAAE,SAAS;AAAA,IACpG;AAAA;AAAA,EAEA,SAAS;AACP,UAAM,UAAU,KAAK,IAAI,GAAG,KAAK,IAAI,GAAG,KAAK,MAAM,KAAK,OAAO,KAAK,KAAK,WAAW,CAAC;AACrF,UAAM,eAAe,CAAC,EAAE,KAAK,WAAW,KAAK;AAC7C,UAAM,WAAW,gBAAgB,KAAK;AACtC,UAAM,cAAc,KAAK,eAAe,CAAC,CAAC,KAAK;AAE/C,UAAM,SAAS,CAAC,WAAW,mBAAmB,IAAI,aAAa,OAAO,OAAO,cAAc,mBAAmB,EAAE,EAC7G,OAAO,OAAO,EACd,KAAK,GAAG;AACX,WAAO;AAAA;AAAA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M,QAAQ,WAAW,WAAW,CAAC;AAAA,GA7KtC,gBA8KX;AAGA;AAAA,EADCA,UAAS,EAAE,MAAM,QAAQ,WAAW,WAAW,CAAC;AAAA,GAhLtC,gBAiLX;AAIA;AAAA,EADCA,UAAS,EAAE,MAAM,QAAQ,WAAW,YAAY,CAAC;AAAA,GApLvC,gBAqLX;AArLW,kBAAN;AAAA,EADNC,eAAc,sBAAsB;AAAA,GACxB;","names":["LitElement","css","html","nothing","customElement","property","LitElement","nothing","html","css","property","customElement","LitElement","css","html","nothing","customElement","property","LitElement","html","nothing","css","property","customElement"]}