@sankhyatronics/sankhya-cms 0.1.3 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +2255 -1328
- package/dist/bento-grid/index.d.ts +5 -1
- package/dist/bento-grid/index.js +1 -1
- package/dist/{chunk-OEX5FDMR.js → chunk-2JGWWXEI.js} +4 -2
- package/dist/chunk-2JGWWXEI.js.map +1 -0
- package/dist/{chunk-PKTRYUGP.js → chunk-5KHI36M5.js} +7 -2
- package/dist/chunk-5KHI36M5.js.map +1 -0
- package/dist/{chunk-FWIG6GEZ.js → chunk-5MTPMXAQ.js} +171 -5
- package/dist/chunk-5MTPMXAQ.js.map +1 -0
- package/dist/{chunk-USNFT4DU.js → chunk-6H262SG6.js} +8 -6
- package/dist/chunk-6H262SG6.js.map +1 -0
- package/dist/{chunk-E52WO7R7.js → chunk-BQTDFQ4V.js} +5 -3
- package/dist/chunk-BQTDFQ4V.js.map +1 -0
- package/dist/{chunk-74MILER4.js → chunk-EMVHNAID.js} +5 -3
- package/dist/chunk-EMVHNAID.js.map +1 -0
- package/dist/{chunk-3ERKQNZT.js → chunk-HGJT24UG.js} +7 -5
- package/dist/chunk-HGJT24UG.js.map +1 -0
- package/dist/chunk-HGTC3LCW.js +607 -0
- package/dist/chunk-HGTC3LCW.js.map +1 -0
- package/dist/{chunk-5DNVCMOO.js → chunk-IDBEZY2O.js} +8 -6
- package/dist/chunk-IDBEZY2O.js.map +1 -0
- package/dist/{chunk-TH5NZXA7.js → chunk-KHPJ5FAJ.js} +80 -4
- package/dist/chunk-KHPJ5FAJ.js.map +1 -0
- package/dist/{chunk-2VZFHTBC.js → chunk-MW43OS47.js} +5 -3
- package/dist/chunk-MW43OS47.js.map +1 -0
- package/dist/{chunk-N63TVWK3.js → chunk-NN3OCPDV.js} +23 -19
- package/dist/chunk-NN3OCPDV.js.map +1 -0
- package/dist/{chunk-3TCP25JG.js → chunk-PB7ZPPLP.js} +9 -1
- package/dist/chunk-PB7ZPPLP.js.map +1 -0
- package/dist/{chunk-5UFRGZWG.js → chunk-TLHG33MM.js} +2 -2
- package/dist/{chunk-IMACP7HN.js → chunk-UVNBZD7R.js} +5 -3
- package/dist/chunk-UVNBZD7R.js.map +1 -0
- package/dist/{chunk-5REZSZCK.js → chunk-VRRBMOUP.js} +5 -3
- package/dist/chunk-VRRBMOUP.js.map +1 -0
- package/dist/cms-theme.css +11 -0
- package/dist/content-block/index.d.ts +2 -0
- package/dist/content-block/index.js +1 -1
- package/dist/cookie-consent/index.d.ts +2 -0
- package/dist/cookie-consent/index.js +1 -1
- package/dist/dropdown/index.d.ts +30 -2
- package/dist/dropdown/index.js +2 -1
- package/dist/feature-split/index.d.ts +5 -1
- package/dist/feature-split/index.js +1 -1
- package/dist/features-section/index.d.ts +2 -0
- package/dist/features-section/index.js +1 -1
- package/dist/header/index.js +2 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +42 -34
- package/dist/items-accordion/index.d.ts +5 -1
- package/dist/items-accordion/index.js +1 -1
- package/dist/mega-menu/index.d.ts +142 -0
- package/dist/mega-menu/index.js +14 -0
- package/dist/mega-menu/index.js.map +1 -0
- package/dist/menu-item/index.d.ts +3 -0
- package/dist/menu-item/index.js +2 -1
- package/dist/promo-banner/index.d.ts +3 -0
- package/dist/promo-banner/index.js +1 -1
- package/dist/schema/index.d.ts +3 -0
- package/dist/schema/index.js +3 -0
- package/dist/schema/index.js.map +1 -1
- package/dist/section/index.d.ts +1 -0
- package/dist/section/index.js +1 -1
- package/dist/select/index.js +2 -2
- package/dist/shared/icons.d.ts +3 -1
- package/dist/shared/icons.js +3 -1
- package/dist/stats/index.d.ts +6 -1
- package/dist/stats/index.js +1 -1
- package/dist/testimonials/index.d.ts +1 -0
- package/dist/testimonials/index.js +2 -2
- package/package.json +18 -23
- package/LICENSE +0 -21
- package/dist/chunk-2VZFHTBC.js.map +0 -1
- package/dist/chunk-3ERKQNZT.js.map +0 -1
- package/dist/chunk-3TCP25JG.js.map +0 -1
- package/dist/chunk-5DNVCMOO.js.map +0 -1
- package/dist/chunk-5REZSZCK.js.map +0 -1
- package/dist/chunk-74MILER4.js.map +0 -1
- package/dist/chunk-E52WO7R7.js.map +0 -1
- package/dist/chunk-FWIG6GEZ.js.map +0 -1
- package/dist/chunk-IMACP7HN.js.map +0 -1
- package/dist/chunk-N63TVWK3.js.map +0 -1
- package/dist/chunk-OEX5FDMR.js.map +0 -1
- package/dist/chunk-PKTRYUGP.js.map +0 -1
- package/dist/chunk-TH5NZXA7.js.map +0 -1
- package/dist/chunk-USNFT4DU.js.map +0 -1
- /package/dist/{chunk-5UFRGZWG.js.map → chunk-TLHG33MM.js.map} +0 -0
|
@@ -81,7 +81,9 @@ ItemsAccordion.styles = css`
|
|
|
81
81
|
|
|
82
82
|
:host {
|
|
83
83
|
display: block;
|
|
84
|
-
|
|
84
|
+
/* !important: a page-level reset (e.g. Tailwind Preflight) otherwise zeroes a shadow host's
|
|
85
|
+
padding; override with --st-items-accordion-padding instead. */
|
|
86
|
+
padding: var(--st-items-accordion-padding, var(--st-cms-section-padding) var(--st-space-24)) !important;
|
|
85
87
|
background: var(--st-color-page);
|
|
86
88
|
${fontFamilyStyles}
|
|
87
89
|
}
|
|
@@ -180,7 +182,7 @@ ItemsAccordion.styles = css`
|
|
|
180
182
|
|
|
181
183
|
@media (max-width: 768px) {
|
|
182
184
|
:host {
|
|
183
|
-
padding: var(--st-space-48) var(--st-space-20);
|
|
185
|
+
padding: var(--st-items-accordion-padding, var(--st-space-48) var(--st-space-20)) !important;
|
|
184
186
|
}
|
|
185
187
|
|
|
186
188
|
.title {
|
|
@@ -212,4 +214,4 @@ ItemsAccordion = __decorateClass([
|
|
|
212
214
|
export {
|
|
213
215
|
ItemsAccordion
|
|
214
216
|
};
|
|
215
|
-
//# sourceMappingURL=chunk-
|
|
217
|
+
//# sourceMappingURL=chunk-EMVHNAID.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/items-accordion/ItemsAccordion.ts"],"sourcesContent":["import { LitElement, css, html, nothing } from 'lit';\r\nimport { customElement, property, state } from 'lit/decorators.js';\r\nimport 'iconify-icon';\r\n\r\nimport { buttonResetStyles, controlBaseStyles, fontFamilyStyles } from '../shared/styles';\r\nimport {\r\n reducedMotionStyles,\r\n sectionHeaderStyles,\r\n sectionSubtitleStyles,\r\n sectionTitleStyles,\r\n} from '../shared/section-styles';\r\nimport type { AccordionToggleEventDetail } from './ItemsAccordionEvents';\r\n\r\nexport interface AccordionItem {\r\n id: string;\r\n title: string;\r\n content: string;\r\n}\r\n\r\n/**\r\n * A vertical list of collapsible title/content rows; one open at a time unless `allow-multiple`.\r\n *\r\n * @cssprop --st-items-accordion-padding - Overrides the block's padding.\r\n */\r\n@customElement('st-items-accordion')\r\nexport class ItemsAccordion extends LitElement {\r\n static styles = css`\r\n ${controlBaseStyles}\r\n\r\n :host {\r\n display: block;\r\n /* !important: a page-level reset (e.g. Tailwind Preflight) otherwise zeroes a shadow host's\r\n padding; override with --st-items-accordion-padding instead. */\r\n padding: var(--st-items-accordion-padding, var(--st-cms-section-padding) var(--st-space-24)) !important;\r\n background: var(--st-color-page);\r\n ${fontFamilyStyles}\r\n }\r\n\r\n .container {\r\n max-width: 800px;\r\n margin: 0 auto;\r\n }\r\n\r\n .header {\r\n ${sectionHeaderStyles}\r\n }\r\n\r\n .title {\r\n ${sectionTitleStyles}\r\n font-size: var(--st-text-2xl);\r\n margin-bottom: var(--st-space-12);\r\n }\r\n\r\n .subtitle {\r\n ${sectionSubtitleStyles}\r\n font-size: var(--st-text-base);\r\n margin: 0;\r\n }\r\n\r\n .list {\r\n display: flex;\r\n flex-direction: column;\r\n gap: var(--st-space-16);\r\n }\r\n\r\n .item {\r\n border: 1px solid var(--st-color-border);\r\n border-radius: var(--st-radius-lg);\r\n background: var(--st-color-surface);\r\n overflow: hidden;\r\n transition:\r\n border-color 0.2s ease,\r\n box-shadow 0.2s ease;\r\n }\r\n\r\n .item.open {\r\n border-color: var(--st-color-border-strong);\r\n box-shadow: 0 4px 6px -1px var(--st-shadow-color-sm);\r\n }\r\n\r\n .trigger {\r\n ${buttonResetStyles}\r\n width: 100%;\r\n display: flex;\r\n justify-content: space-between;\r\n align-items: center;\r\n padding: var(--st-space-24);\r\n text-align: left;\r\n font-size: var(--st-text-lg);\r\n font-weight: var(--st-font-weight-semibold);\r\n color: var(--st-color-text-strong);\r\n }\r\n\r\n .trigger:hover {\r\n background: var(--st-color-hover);\r\n }\r\n\r\n .chevron {\r\n flex-shrink: 0;\r\n margin-left: var(--st-space-16);\r\n font-size: 24px;\r\n color: var(--st-color-text-faint);\r\n transition: transform 0.3s ease;\r\n }\r\n\r\n .open .chevron {\r\n transform: rotate(180deg);\r\n }\r\n\r\n .content {\r\n display: grid;\r\n grid-template-rows: 0fr;\r\n transition: grid-template-rows 0.3s ease;\r\n }\r\n\r\n .open .content {\r\n grid-template-rows: 1fr;\r\n }\r\n\r\n .content-clip {\r\n overflow: hidden;\r\n min-height: 0;\r\n }\r\n\r\n .content-inner {\r\n padding: 0 var(--st-space-24) var(--st-space-24);\r\n color: var(--st-color-text);\r\n line-height: 1.6;\r\n }\r\n\r\n @media (max-width: 768px) {\r\n :host {\r\n padding: var(--st-items-accordion-padding, var(--st-space-48) var(--st-space-20)) !important;\r\n }\r\n\r\n .title {\r\n font-size: var(--st-text-xl);\r\n }\r\n }\r\n\r\n ${reducedMotionStyles}\r\n `;\r\n\r\n @property({ type: String })\r\n title = '';\r\n\r\n @property({ type: String })\r\n subtitle = '';\r\n\r\n @property({ attribute: false })\r\n items: AccordionItem[] = [];\r\n\r\n @property({ type: Boolean, attribute: 'allow-multiple' })\r\n allowMultiple = false;\r\n\r\n @state() private openIds = new Set<string>();\r\n\r\n private toggle(id: string) {\r\n const wasOpen = this.openIds.has(id);\r\n const next = new Set(this.allowMultiple ? this.openIds : []);\r\n if (wasOpen) next.delete(id);\r\n else next.add(id);\r\n this.openIds = next;\r\n this.dispatchEvent(\r\n new CustomEvent<AccordionToggleEventDetail>('accordion-toggle', {\r\n detail: { id, open: !wasOpen },\r\n bubbles: true,\r\n composed: true,\r\n }),\r\n );\r\n }\r\n\r\n render() {\r\n return html`\r\n <div class=\"container\" part=\"container\">\r\n ${this.title || this.subtitle\r\n ? html`<div class=\"header\" part=\"header\">\r\n ${this.title ? html`<h2 class=\"title\" part=\"title\">${this.title}</h2>` : nothing}\r\n ${this.subtitle ? html`<p class=\"subtitle\" part=\"subtitle\">${this.subtitle}</p>` : nothing}\r\n </div>`\r\n : nothing}\r\n <div class=\"list\" part=\"list\">\r\n ${this.items.map((item) => {\r\n const open = this.openIds.has(item.id);\r\n return html`\r\n <div class=\"item ${open ? 'open' : ''}\" part=\"item\">\r\n <button\r\n class=\"trigger\"\r\n part=\"trigger\"\r\n type=\"button\"\r\n aria-expanded=${open ? 'true' : 'false'}\r\n aria-controls=\"content-${item.id}\"\r\n @click=${() => this.toggle(item.id)}\r\n >\r\n <span>${item.title}</span>\r\n <iconify-icon class=\"chevron\" icon=\"mdi:chevron-down\"></iconify-icon>\r\n </button>\r\n <div class=\"content\" id=\"content-${item.id}\" part=\"content\" role=\"region\" ?inert=${!open}>\r\n <div class=\"content-clip\">\r\n <div class=\"content-inner\">${item.content}</div>\r\n </div>\r\n </div>\r\n </div>\r\n `;\r\n })}\r\n </div>\r\n </div>\r\n `;\r\n }\r\n}\r\n"],"mappings":"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","names":[]}
|
|
@@ -54,8 +54,10 @@ PromoBanner.styles = css`
|
|
|
54
54
|
box-sizing: border-box;
|
|
55
55
|
width: calc(100% - 48px);
|
|
56
56
|
max-width: var(--st-cms-container-max);
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
/* !important: a page-level reset (e.g. Tailwind Preflight) otherwise zeroes a shadow host's
|
|
58
|
+
margin/padding; override with --st-promo-banner-margin/-padding instead. */
|
|
59
|
+
margin: var(--st-promo-banner-margin, var(--st-space-40) auto) !important;
|
|
60
|
+
padding: var(--st-promo-banner-padding, 100px var(--st-space-24)) !important;
|
|
59
61
|
border-radius: var(--st-space-24);
|
|
60
62
|
background-color: var(--st-color-text-strong);
|
|
61
63
|
background-size: cover;
|
|
@@ -111,8 +113,8 @@ PromoBanner.styles = css`
|
|
|
111
113
|
@media (max-width: 768px) {
|
|
112
114
|
:host {
|
|
113
115
|
width: auto;
|
|
114
|
-
margin: var(--st-space-24);
|
|
115
|
-
padding: 60px var(--st-space-24);
|
|
116
|
+
margin: var(--st-promo-banner-margin, var(--st-space-24)) !important;
|
|
117
|
+
padding: var(--st-promo-banner-padding, 60px var(--st-space-24)) !important;
|
|
116
118
|
border-radius: var(--st-radius-lg);
|
|
117
119
|
}
|
|
118
120
|
.actions,
|
|
@@ -152,4 +154,4 @@ PromoBanner = __decorateClass([
|
|
|
152
154
|
export {
|
|
153
155
|
PromoBanner
|
|
154
156
|
};
|
|
155
|
-
//# sourceMappingURL=chunk-
|
|
157
|
+
//# sourceMappingURL=chunk-HGJT24UG.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/promo-banner/PromoBanner.ts"],"sourcesContent":["import { LitElement, css, html, nothing } from 'lit';\r\nimport { customElement, property } from 'lit/decorators.js';\r\n\r\nimport { buttonResetStyles, controlBaseStyles, rootFontFamilyStyles } from '../shared/styles';\r\nimport { ctaLinkStyles, sectionSubtitleStyles, sectionTitleStyles } from '../shared/section-styles';\r\nimport type { HeroActionEventDetail } from '../hero/HeroEvents';\r\n\r\n/**\r\n * Rounded call-to-action banner (title, subtitle, one outlined button) on a dark panel or a\r\n * background image. Port of `SankhyaUI`'s React `PromoBanner`; the button fires an `action` event\r\n * (detail `{ href }`, empty unless set) in place of `onAction`.\r\n *\r\n * @cssprop --st-promo-banner-margin - Overrides the banner's margin.\r\n * @cssprop --st-promo-banner-padding - Overrides the banner's padding.\r\n */\r\n@customElement('st-promo-banner')\r\nexport class PromoBanner extends LitElement {\r\n static styles = css`\r\n ${controlBaseStyles}\r\n\r\n :host {\r\n display: block;\r\n box-sizing: border-box;\r\n width: calc(100% - 48px);\r\n max-width: var(--st-cms-container-max);\r\n /* !important: a page-level reset (e.g. Tailwind Preflight) otherwise zeroes a shadow host's\r\n margin/padding; override with --st-promo-banner-margin/-padding instead. */\r\n margin: var(--st-promo-banner-margin, var(--st-space-40) auto) !important;\r\n padding: var(--st-promo-banner-padding, 100px var(--st-space-24)) !important;\r\n border-radius: var(--st-space-24);\r\n background-color: var(--st-color-text-strong);\r\n background-size: cover;\r\n background-position: center;\r\n color: var(--st-color-on-solid);\r\n text-align: center;\r\n ${rootFontFamilyStyles}\r\n }\r\n\r\n :host([inverted]) {\r\n background-color: var(--st-color-subtle);\r\n color: var(--st-color-text-strong);\r\n }\r\n\r\n .container {\r\n max-width: 800px;\r\n margin: 0 auto;\r\n display: flex;\r\n flex-direction: column;\r\n align-items: center;\r\n gap: var(--st-space-32);\r\n }\r\n\r\n .title {\r\n ${sectionTitleStyles}\r\n color: inherit;\r\n margin: 0;\r\n letter-spacing: -0.02em;\r\n }\r\n\r\n .subtitle {\r\n ${sectionSubtitleStyles}\r\n color: inherit;\r\n opacity: 0.8;\r\n margin: 0;\r\n }\r\n\r\n .actions {\r\n margin-top: var(--st-space-16);\r\n }\r\n\r\n .cta {\r\n ${buttonResetStyles}\r\n ${ctaLinkStyles}\r\n border: 1px solid currentColor;\r\n color: inherit;\r\n }\r\n\r\n .cta:hover {\r\n transform: scale(1.05);\r\n }\r\n\r\n @media (max-width: 768px) {\r\n :host {\r\n width: auto;\r\n margin: var(--st-promo-banner-margin, var(--st-space-24)) !important;\r\n padding: var(--st-promo-banner-padding, 60px var(--st-space-24)) !important;\r\n border-radius: var(--st-radius-lg);\r\n }\r\n .actions,\r\n .cta {\r\n width: 100%;\r\n }\r\n }\r\n\r\n @media (prefers-reduced-motion: reduce) {\r\n .cta {\r\n transition: none;\r\n }\r\n }\r\n `;\r\n\r\n @property({ type: String })\r\n title = '';\r\n\r\n @property({ type: String })\r\n subtitle = '';\r\n\r\n @property({ type: String, attribute: 'action-label' })\r\n actionLabel = '';\r\n\r\n @property({ type: String })\r\n href = '';\r\n\r\n @property({ type: String, attribute: 'image-src' })\r\n imageSrc = '';\r\n\r\n @property({ type: Boolean, reflect: true })\r\n inverted = false;\r\n\r\n protected willUpdate(): void {\r\n this.style.backgroundImage = this.imageSrc ? `url(${JSON.stringify(this.imageSrc)})` : '';\r\n }\r\n\r\n private onAction = (): void => {\r\n this.dispatchEvent(\r\n new CustomEvent<HeroActionEventDetail>('action', { detail: { href: this.href }, bubbles: true, composed: true })\r\n );\r\n };\r\n\r\n render() {\r\n return html`\r\n <div class=\"container\" part=\"container\">\r\n <h2 class=\"title\" part=\"title\">${this.title}</h2>\r\n ${this.subtitle ? html`<p class=\"subtitle\" part=\"subtitle\">${this.subtitle}</p>` : nothing}\r\n <slot></slot>\r\n ${this.actionLabel\r\n ? html`<div class=\"actions\" part=\"actions\">\r\n <button class=\"cta\" part=\"action\" type=\"button\" @click=${this.onAction}>${this.actionLabel}</button>\r\n </div>`\r\n : nothing}\r\n </div>\r\n `;\r\n }\r\n}\r\n"],"mappings":";;;;;;;;;;;;;;;AAAA,SAAS,YAAY,KAAK,MAAM,eAAe;AAC/C,SAAS,eAAe,gBAAgB;AAejC,IAAM,cAAN,cAA0B,WAAW;AAAA,EAArC;AAAA;AAsFL,iBAAQ;AAGR,oBAAW;AAGX,uBAAc;AAGd,gBAAO;AAGP,oBAAW;AAGX,oBAAW;AAMX,SAAQ,WAAW,MAAY;AAC7B,WAAK;AAAA,QACH,IAAI,YAAmC,UAAU,EAAE,QAAQ,EAAE,MAAM,KAAK,KAAK,GAAG,SAAS,MAAM,UAAU,KAAK,CAAC;AAAA,MACjH;AAAA,IACF;AAAA;AAAA,EARU,aAAmB;AAC3B,SAAK,MAAM,kBAAkB,KAAK,WAAW,OAAO,KAAK,UAAU,KAAK,QAAQ,CAAC,MAAM;AAAA,EACzF;AAAA,EAQA,SAAS;AACP,WAAO;AAAA;AAAA,yCAE8B,KAAK,KAAK;AAAA,UACzC,KAAK,WAAW,2CAA2C,KAAK,QAAQ,SAAS,OAAO;AAAA;AAAA,UAExF,KAAK,cACH;AAAA,uEAC2D,KAAK,QAAQ,IAAI,KAAK,WAAW;AAAA,sBAE5F,OAAO;AAAA;AAAA;AAAA,EAGjB;AACF;AA/Ha,YACJ,SAAS;AAAA,MACZ,iBAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAiBf,oBAAoB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAkBpB,kBAAkB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAOlB,qBAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAWrB,iBAAiB;AAAA,QACjB,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;AA8BnB;AAAA,EADC,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GArFf,YAsFX;AAGA;AAAA,EADC,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GAxFf,YAyFX;AAGA;AAAA,EADC,SAAS,EAAE,MAAM,QAAQ,WAAW,eAAe,CAAC;AAAA,GA3F1C,YA4FX;AAGA;AAAA,EADC,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GA9Ff,YA+FX;AAGA;AAAA,EADC,SAAS,EAAE,MAAM,QAAQ,WAAW,YAAY,CAAC;AAAA,GAjGvC,YAkGX;AAGA;AAAA,EADC,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GApG/B,YAqGX;AArGW,cAAN;AAAA,EADN,cAAc,iBAAiB;AAAA,GACnB;","names":[]}
|
|
@@ -0,0 +1,607 @@
|
|
|
1
|
+
import {
|
|
2
|
+
arrowUpRightIcon
|
|
3
|
+
} from "./chunk-PB7ZPPLP.js";
|
|
4
|
+
import {
|
|
5
|
+
controlBaseStyles,
|
|
6
|
+
fontFamilyStyles
|
|
7
|
+
} from "./chunk-RHAOQ6K4.js";
|
|
8
|
+
import {
|
|
9
|
+
__decorateClass
|
|
10
|
+
} from "./chunk-EUXUH3YW.js";
|
|
11
|
+
|
|
12
|
+
// src/mega-menu/MegaMenu.ts
|
|
13
|
+
import { LitElement, css, html, nothing } from "lit";
|
|
14
|
+
import { customElement, property, state } from "lit/decorators.js";
|
|
15
|
+
var MegaMenu = class extends LitElement {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(...arguments);
|
|
18
|
+
this.heading = "";
|
|
19
|
+
this.description = "";
|
|
20
|
+
this.featuredHeading = "";
|
|
21
|
+
this.columns = 0;
|
|
22
|
+
this.columnCount = 1;
|
|
23
|
+
this.hasIntroLinks = false;
|
|
24
|
+
this.hasFeatured = false;
|
|
25
|
+
this.onColumnsSlotChange = (event) => {
|
|
26
|
+
this.columnCount = Math.max(1, event.target.assignedElements({ flatten: true }).length);
|
|
27
|
+
};
|
|
28
|
+
this.onIntroSlotChange = (event) => {
|
|
29
|
+
this.hasIntroLinks = event.target.assignedElements({ flatten: true }).length > 0;
|
|
30
|
+
};
|
|
31
|
+
this.onFeaturedSlotChange = (event) => {
|
|
32
|
+
this.hasFeatured = event.target.assignedElements({ flatten: true }).length > 0;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
render() {
|
|
36
|
+
const columns = Math.min(6, Math.max(1, Math.round(this.columns) || this.columnCount));
|
|
37
|
+
const hasIntroText = !!(this.heading || this.description);
|
|
38
|
+
const hasIntro = hasIntroText || this.hasIntroLinks;
|
|
39
|
+
const hasFeatured = this.hasFeatured || !!this.featuredHeading;
|
|
40
|
+
const tracks = [hasIntro ? "minmax(0, 1fr)" : "", `minmax(0, ${columns}fr)`, hasFeatured ? "minmax(0, 1fr)" : ""].filter(Boolean).join(" ");
|
|
41
|
+
return html`
|
|
42
|
+
<div
|
|
43
|
+
part="inner"
|
|
44
|
+
class="inner"
|
|
45
|
+
style="grid-template-columns:${tracks};--st-mega-menu-columns:${columns};--st-mega-menu-columns-md:${Math.min(2, columns)}"
|
|
46
|
+
>
|
|
47
|
+
<div part="intro" class="intro" ?hidden=${!hasIntro}>
|
|
48
|
+
${this.heading ? html`<p part="heading" class="intro-heading">${this.heading}</p>` : nothing}
|
|
49
|
+
${this.description ? html`<p part="description" class="intro-description">${this.description}</p>` : nothing}
|
|
50
|
+
<div part="intro-links" class="intro-links ${hasIntroText ? "" : "no-text"}" ?hidden=${!this.hasIntroLinks}>
|
|
51
|
+
<slot name="intro" @slotchange=${this.onIntroSlotChange}></slot>
|
|
52
|
+
</div>
|
|
53
|
+
</div>
|
|
54
|
+
<div part="columns" class="columns"><slot @slotchange=${this.onColumnsSlotChange}></slot></div>
|
|
55
|
+
<div part="featured" class="featured" ?hidden=${!hasFeatured}>
|
|
56
|
+
${this.featuredHeading ? html`<p part="featured-heading" class="featured-heading">${this.featuredHeading}</p>` : nothing}
|
|
57
|
+
<div class="featured-items"><slot name="featured" @slotchange=${this.onFeaturedSlotChange}></slot></div>
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
`;
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
MegaMenu.styles = css`
|
|
64
|
+
${controlBaseStyles}
|
|
65
|
+
|
|
66
|
+
:host {
|
|
67
|
+
display: block;
|
|
68
|
+
container-type: inline-size;
|
|
69
|
+
${fontFamilyStyles}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.inner {
|
|
73
|
+
display: grid;
|
|
74
|
+
gap: 3rem;
|
|
75
|
+
padding: 3rem 3.5rem;
|
|
76
|
+
box-sizing: border-box;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.columns {
|
|
80
|
+
display: grid;
|
|
81
|
+
grid-template-columns: repeat(var(--st-mega-menu-columns, 3), minmax(0, 1fr));
|
|
82
|
+
gap: 3rem;
|
|
83
|
+
align-items: stretch;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.intro,
|
|
87
|
+
.featured {
|
|
88
|
+
display: flex;
|
|
89
|
+
flex-direction: column;
|
|
90
|
+
min-width: 0;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.intro-heading {
|
|
94
|
+
margin: 0 0 1rem;
|
|
95
|
+
font-size: 2rem;
|
|
96
|
+
font-weight: 400;
|
|
97
|
+
line-height: 1.15;
|
|
98
|
+
color: var(--st-color-text-strong);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.intro-description {
|
|
102
|
+
margin: 0;
|
|
103
|
+
font-size: 1rem;
|
|
104
|
+
line-height: 1.55;
|
|
105
|
+
color: var(--st-color-text);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.intro-links {
|
|
109
|
+
display: flex;
|
|
110
|
+
flex-direction: column;
|
|
111
|
+
gap: 2px;
|
|
112
|
+
margin-top: 2.5rem;
|
|
113
|
+
padding-top: 2rem;
|
|
114
|
+
border-top: 1px solid var(--st-color-border);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.intro-links.no-text {
|
|
118
|
+
margin-top: 0;
|
|
119
|
+
padding-top: 0;
|
|
120
|
+
border-top: 0;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.featured-heading {
|
|
124
|
+
margin: 0 0 1rem;
|
|
125
|
+
font-size: 1.125rem;
|
|
126
|
+
font-weight: 500;
|
|
127
|
+
line-height: 1.35;
|
|
128
|
+
color: var(--st-color-text-strong);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.featured-items {
|
|
132
|
+
display: flex;
|
|
133
|
+
flex-direction: column;
|
|
134
|
+
gap: 0.75rem;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
[hidden] {
|
|
138
|
+
display: none !important;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/* Medium panel: intro on top, two link columns, featured cards side by side underneath. */
|
|
142
|
+
@container (max-width: 960px) {
|
|
143
|
+
.inner {
|
|
144
|
+
grid-template-columns: minmax(0, 1fr) !important;
|
|
145
|
+
gap: 2rem;
|
|
146
|
+
padding: 2rem;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.columns {
|
|
150
|
+
grid-template-columns: repeat(var(--st-mega-menu-columns-md, 2), minmax(0, 1fr));
|
|
151
|
+
gap: 2rem;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.intro-links {
|
|
155
|
+
margin-top: 1.5rem;
|
|
156
|
+
padding-top: 1.5rem;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.featured-items {
|
|
160
|
+
display: grid;
|
|
161
|
+
grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/* Narrow panel (the phone drill-down): everything stacked. */
|
|
166
|
+
@container (max-width: 560px) {
|
|
167
|
+
.inner {
|
|
168
|
+
gap: 1.75rem;
|
|
169
|
+
padding: 0.5rem 0 1.5rem;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.columns {
|
|
173
|
+
grid-template-columns: minmax(0, 1fr);
|
|
174
|
+
gap: 1.75rem;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.intro-heading {
|
|
178
|
+
display: none;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
`;
|
|
182
|
+
__decorateClass([
|
|
183
|
+
property({ type: String })
|
|
184
|
+
], MegaMenu.prototype, "heading", 2);
|
|
185
|
+
__decorateClass([
|
|
186
|
+
property({ type: String })
|
|
187
|
+
], MegaMenu.prototype, "description", 2);
|
|
188
|
+
__decorateClass([
|
|
189
|
+
property({ type: String, attribute: "featured-heading" })
|
|
190
|
+
], MegaMenu.prototype, "featuredHeading", 2);
|
|
191
|
+
__decorateClass([
|
|
192
|
+
property({ type: Number })
|
|
193
|
+
], MegaMenu.prototype, "columns", 2);
|
|
194
|
+
__decorateClass([
|
|
195
|
+
state()
|
|
196
|
+
], MegaMenu.prototype, "columnCount", 2);
|
|
197
|
+
__decorateClass([
|
|
198
|
+
state()
|
|
199
|
+
], MegaMenu.prototype, "hasIntroLinks", 2);
|
|
200
|
+
__decorateClass([
|
|
201
|
+
state()
|
|
202
|
+
], MegaMenu.prototype, "hasFeatured", 2);
|
|
203
|
+
MegaMenu = __decorateClass([
|
|
204
|
+
customElement("st-mega-menu")
|
|
205
|
+
], MegaMenu);
|
|
206
|
+
|
|
207
|
+
// src/mega-menu/MegaMenuColumn.ts
|
|
208
|
+
import { LitElement as LitElement2, css as css2, html as html2, nothing as nothing2 } from "lit";
|
|
209
|
+
import { customElement as customElement2, property as property2 } from "lit/decorators.js";
|
|
210
|
+
var MegaMenuColumn = class extends LitElement2 {
|
|
211
|
+
constructor() {
|
|
212
|
+
super(...arguments);
|
|
213
|
+
this.heading = "";
|
|
214
|
+
this.href = "";
|
|
215
|
+
this.description = "";
|
|
216
|
+
this.variant = "plain";
|
|
217
|
+
this.ctaLabel = "";
|
|
218
|
+
this.ctaHref = "";
|
|
219
|
+
}
|
|
220
|
+
select(event, href) {
|
|
221
|
+
if (href.startsWith("http")) return;
|
|
222
|
+
const selectEvent = new CustomEvent("mega-menu-select", {
|
|
223
|
+
detail: { href },
|
|
224
|
+
bubbles: true,
|
|
225
|
+
composed: true,
|
|
226
|
+
cancelable: true
|
|
227
|
+
});
|
|
228
|
+
this.dispatchEvent(selectEvent);
|
|
229
|
+
if (selectEvent.defaultPrevented) event.preventDefault();
|
|
230
|
+
}
|
|
231
|
+
renderHeading() {
|
|
232
|
+
if (!this.heading) return nothing2;
|
|
233
|
+
return this.href ? html2`<a part="heading" class="heading" href=${this.href} @click=${(event) => this.select(event, this.href)}
|
|
234
|
+
>${this.heading}</a
|
|
235
|
+
>` : html2`<p part="heading" class="heading">${this.heading}</p>`;
|
|
236
|
+
}
|
|
237
|
+
renderCta() {
|
|
238
|
+
if (!this.ctaLabel || !this.ctaHref) return nothing2;
|
|
239
|
+
const external = this.ctaHref.startsWith("http");
|
|
240
|
+
return html2`
|
|
241
|
+
<span class="cta-spacer"></span>
|
|
242
|
+
<a
|
|
243
|
+
part="cta"
|
|
244
|
+
class="cta"
|
|
245
|
+
href=${this.ctaHref}
|
|
246
|
+
target=${external ? "_blank" : "_self"}
|
|
247
|
+
rel=${external ? "noopener noreferrer" : nothing2}
|
|
248
|
+
@click=${(event) => this.select(event, this.ctaHref)}
|
|
249
|
+
>${this.ctaLabel} ${external ? arrowUpRightIcon(14) : nothing2}</a
|
|
250
|
+
>
|
|
251
|
+
`;
|
|
252
|
+
}
|
|
253
|
+
render() {
|
|
254
|
+
return html2`
|
|
255
|
+
${this.renderHeading()}
|
|
256
|
+
${this.description ? html2`<p part="description" class="description">${this.description}</p>` : nothing2}
|
|
257
|
+
<div part="items" class="items" role="group" aria-label=${this.heading || nothing2}><slot></slot></div>
|
|
258
|
+
${this.renderCta()}
|
|
259
|
+
`;
|
|
260
|
+
}
|
|
261
|
+
};
|
|
262
|
+
MegaMenuColumn.styles = css2`
|
|
263
|
+
${controlBaseStyles}
|
|
264
|
+
|
|
265
|
+
:host {
|
|
266
|
+
display: flex;
|
|
267
|
+
flex-direction: column;
|
|
268
|
+
min-width: 0;
|
|
269
|
+
box-sizing: border-box;
|
|
270
|
+
${fontFamilyStyles}
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
:host([variant='card']),
|
|
274
|
+
:host([variant='accent']) {
|
|
275
|
+
/* !important: a page-level reset (e.g. Tailwind Preflight) otherwise zeroes a shadow host's
|
|
276
|
+
padding; override with --st-mega-menu-column-padding instead. */
|
|
277
|
+
padding: var(--st-mega-menu-column-padding, 2rem 1.75rem 1.75rem) !important;
|
|
278
|
+
border-radius: 20px;
|
|
279
|
+
background: color-mix(in oklch, var(--st-color-text-strong) 5%, var(--st-color-surface));
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
:host([variant='accent']) {
|
|
283
|
+
background: var(--st-color-accent);
|
|
284
|
+
color: var(--st-color-on-solid);
|
|
285
|
+
/* Read by the st-menu-item links inside. */
|
|
286
|
+
--st-nav-color: var(--st-color-on-solid);
|
|
287
|
+
--st-nav-hover-bg: transparent;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
.heading {
|
|
291
|
+
display: inline-flex;
|
|
292
|
+
align-items: center;
|
|
293
|
+
gap: 6px;
|
|
294
|
+
margin: 0 0 0.75rem;
|
|
295
|
+
font-size: 1.125rem;
|
|
296
|
+
font-weight: 500;
|
|
297
|
+
line-height: 1.35;
|
|
298
|
+
color: var(--st-color-text-strong);
|
|
299
|
+
text-decoration: none;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
:host([variant='card']) .heading,
|
|
303
|
+
:host([variant='accent']) .heading {
|
|
304
|
+
font-size: 1.375rem;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
:host([variant='accent']) .heading {
|
|
308
|
+
color: inherit;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
a.heading:hover,
|
|
312
|
+
a.heading:focus-visible {
|
|
313
|
+
text-decoration: underline;
|
|
314
|
+
text-underline-offset: 4px;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
.description {
|
|
318
|
+
margin: -0.25rem 0 0.75rem;
|
|
319
|
+
font-size: 0.875rem;
|
|
320
|
+
line-height: 1.5;
|
|
321
|
+
color: var(--st-color-text-muted);
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
:host([variant='accent']) .description {
|
|
325
|
+
color: inherit;
|
|
326
|
+
opacity: 0.85;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
.items {
|
|
330
|
+
display: flex;
|
|
331
|
+
flex-direction: column;
|
|
332
|
+
gap: 2px;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
/* Nested groups stack with room between them (!important for the same page-reset reason). */
|
|
336
|
+
::slotted(st-mega-menu-column:not(:first-child)) {
|
|
337
|
+
margin-top: 2rem !important;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
.cta {
|
|
341
|
+
display: inline-flex;
|
|
342
|
+
align-items: center;
|
|
343
|
+
justify-content: center;
|
|
344
|
+
gap: 6px;
|
|
345
|
+
padding: 0.875rem 1.5rem;
|
|
346
|
+
border-radius: 9999px;
|
|
347
|
+
background: var(--st-color-surface);
|
|
348
|
+
color: var(--st-color-text-strong);
|
|
349
|
+
font-size: 1rem;
|
|
350
|
+
font-weight: 500;
|
|
351
|
+
text-align: center;
|
|
352
|
+
text-decoration: none;
|
|
353
|
+
transition: box-shadow 0.2s ease;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
.cta-spacer {
|
|
357
|
+
flex: 1;
|
|
358
|
+
min-height: 1.75rem;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
.cta:hover,
|
|
362
|
+
.cta:focus-visible {
|
|
363
|
+
box-shadow: 0 0 0 2px currentColor;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
@media (prefers-reduced-motion: reduce) {
|
|
367
|
+
.cta {
|
|
368
|
+
transition: none;
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
`;
|
|
372
|
+
__decorateClass([
|
|
373
|
+
property2({ type: String })
|
|
374
|
+
], MegaMenuColumn.prototype, "heading", 2);
|
|
375
|
+
__decorateClass([
|
|
376
|
+
property2({ type: String })
|
|
377
|
+
], MegaMenuColumn.prototype, "href", 2);
|
|
378
|
+
__decorateClass([
|
|
379
|
+
property2({ type: String })
|
|
380
|
+
], MegaMenuColumn.prototype, "description", 2);
|
|
381
|
+
__decorateClass([
|
|
382
|
+
property2({ type: String, reflect: true })
|
|
383
|
+
], MegaMenuColumn.prototype, "variant", 2);
|
|
384
|
+
__decorateClass([
|
|
385
|
+
property2({ type: String, attribute: "cta-label" })
|
|
386
|
+
], MegaMenuColumn.prototype, "ctaLabel", 2);
|
|
387
|
+
__decorateClass([
|
|
388
|
+
property2({ type: String, attribute: "cta-href" })
|
|
389
|
+
], MegaMenuColumn.prototype, "ctaHref", 2);
|
|
390
|
+
MegaMenuColumn = __decorateClass([
|
|
391
|
+
customElement2("st-mega-menu-column")
|
|
392
|
+
], MegaMenuColumn);
|
|
393
|
+
|
|
394
|
+
// src/mega-menu/MegaMenuFeature.ts
|
|
395
|
+
import { LitElement as LitElement3, css as css3, html as html3, nothing as nothing3 } from "lit";
|
|
396
|
+
import { customElement as customElement3, property as property3 } from "lit/decorators.js";
|
|
397
|
+
var MegaMenuFeature = class extends LitElement3 {
|
|
398
|
+
constructor() {
|
|
399
|
+
super(...arguments);
|
|
400
|
+
this.variant = "story";
|
|
401
|
+
this.title = "";
|
|
402
|
+
this.description = "";
|
|
403
|
+
this.eyebrow = "";
|
|
404
|
+
this.href = "";
|
|
405
|
+
this.target = "";
|
|
406
|
+
this.imageUrl = "";
|
|
407
|
+
this.imageAlt = "";
|
|
408
|
+
this.logoUrl = "";
|
|
409
|
+
this.logoAlt = "";
|
|
410
|
+
this.ctaLabel = "";
|
|
411
|
+
this.onClick = (event) => {
|
|
412
|
+
if (this.isExternal) return;
|
|
413
|
+
const selectEvent = new CustomEvent("mega-menu-select", {
|
|
414
|
+
detail: { href: this.href },
|
|
415
|
+
bubbles: true,
|
|
416
|
+
composed: true,
|
|
417
|
+
cancelable: true
|
|
418
|
+
});
|
|
419
|
+
this.dispatchEvent(selectEvent);
|
|
420
|
+
if (selectEvent.defaultPrevented) event.preventDefault();
|
|
421
|
+
};
|
|
422
|
+
}
|
|
423
|
+
get isExternal() {
|
|
424
|
+
return this.href.startsWith("http");
|
|
425
|
+
}
|
|
426
|
+
render() {
|
|
427
|
+
const target = this.target || (this.isExternal ? "_blank" : "_self");
|
|
428
|
+
const overlay = this.variant === "overlay";
|
|
429
|
+
const style = overlay && this.imageUrl ? `--st-mega-menu-feature-image:url(${JSON.stringify(this.imageUrl)})` : "";
|
|
430
|
+
return html3`
|
|
431
|
+
<a
|
|
432
|
+
part="card"
|
|
433
|
+
class="card"
|
|
434
|
+
style=${style}
|
|
435
|
+
href=${this.href || nothing3}
|
|
436
|
+
target=${target}
|
|
437
|
+
rel=${target === "_blank" ? "noopener noreferrer" : nothing3}
|
|
438
|
+
@click=${this.onClick}
|
|
439
|
+
>
|
|
440
|
+
${overlay && this.logoUrl ? html3`<img part="logo" class="logo" src=${this.logoUrl} alt=${this.logoAlt} />` : nothing3}
|
|
441
|
+
${!overlay && this.imageUrl ? html3`<img part="image" class="image" src=${this.imageUrl} alt=${this.imageAlt} loading="lazy" />` : nothing3}
|
|
442
|
+
${this.eyebrow ? html3`<span part="eyebrow" class="eyebrow">${this.eyebrow}</span>` : nothing3}
|
|
443
|
+
${this.title ? html3`<p part="title" class="title">${this.title}</p>` : nothing3}
|
|
444
|
+
${this.description ? html3`<p part="description" class="description">${this.description}</p>` : nothing3}
|
|
445
|
+
${this.ctaLabel ? html3`<span part="cta" class="cta">${this.ctaLabel}</span>` : nothing3}
|
|
446
|
+
</a>
|
|
447
|
+
`;
|
|
448
|
+
}
|
|
449
|
+
};
|
|
450
|
+
/** `focus()` on the element focuses its link, so `st-dropdown` can arrow-key to it. */
|
|
451
|
+
MegaMenuFeature.shadowRootOptions = { ...LitElement3.shadowRootOptions, delegatesFocus: true };
|
|
452
|
+
MegaMenuFeature.styles = css3`
|
|
453
|
+
${controlBaseStyles}
|
|
454
|
+
|
|
455
|
+
:host {
|
|
456
|
+
display: block;
|
|
457
|
+
${fontFamilyStyles}
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
.card {
|
|
461
|
+
display: flex;
|
|
462
|
+
flex-direction: column;
|
|
463
|
+
gap: 0.75rem;
|
|
464
|
+
box-sizing: border-box;
|
|
465
|
+
color: var(--st-color-text-strong);
|
|
466
|
+
text-decoration: none;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
.image {
|
|
470
|
+
display: block;
|
|
471
|
+
width: 100%;
|
|
472
|
+
aspect-ratio: 9 / 8;
|
|
473
|
+
object-fit: cover;
|
|
474
|
+
border-radius: 20px;
|
|
475
|
+
transition: transform 0.3s ease;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
.card:hover .image {
|
|
479
|
+
transform: scale(1.015);
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
.eyebrow {
|
|
483
|
+
font-size: 0.75rem;
|
|
484
|
+
font-weight: 600;
|
|
485
|
+
letter-spacing: 0.06em;
|
|
486
|
+
text-transform: uppercase;
|
|
487
|
+
color: var(--st-color-accent-text);
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
.title {
|
|
491
|
+
margin: 0;
|
|
492
|
+
font-size: 1.125rem;
|
|
493
|
+
font-weight: 500;
|
|
494
|
+
line-height: 1.3;
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
.description {
|
|
498
|
+
margin: 0;
|
|
499
|
+
font-size: 0.9375rem;
|
|
500
|
+
line-height: 1.5;
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
.cta {
|
|
504
|
+
align-self: flex-start;
|
|
505
|
+
margin-top: 0.75rem;
|
|
506
|
+
font-size: 0.9375rem;
|
|
507
|
+
font-weight: 500;
|
|
508
|
+
text-decoration: underline;
|
|
509
|
+
text-underline-offset: 5px;
|
|
510
|
+
text-decoration-thickness: 1px;
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
.card:hover .cta,
|
|
514
|
+
.card:focus-visible .cta {
|
|
515
|
+
text-decoration-thickness: 2px;
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
/* overlay */
|
|
519
|
+
:host([variant='overlay']) .card {
|
|
520
|
+
justify-content: flex-end;
|
|
521
|
+
gap: 0.5rem;
|
|
522
|
+
min-height: 15rem;
|
|
523
|
+
padding: 1.75rem;
|
|
524
|
+
border-radius: 20px;
|
|
525
|
+
color: #fff;
|
|
526
|
+
background-color: var(--st-color-accent);
|
|
527
|
+
background-image:
|
|
528
|
+
linear-gradient(to top, rgb(0 0 0 / 0.55), rgb(0 0 0 / 0.05)),
|
|
529
|
+
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))));
|
|
530
|
+
background-size: cover;
|
|
531
|
+
background-position: center;
|
|
532
|
+
transition: transform 0.2s ease;
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
:host([variant='overlay']) .card:hover {
|
|
536
|
+
transform: translateY(-2px);
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
:host([variant='overlay']) .logo {
|
|
540
|
+
height: 2.25rem;
|
|
541
|
+
width: auto;
|
|
542
|
+
max-width: 70%;
|
|
543
|
+
margin-bottom: auto;
|
|
544
|
+
align-self: flex-start;
|
|
545
|
+
object-fit: contain;
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
:host([variant='overlay']) .title {
|
|
549
|
+
font-size: 1.75rem;
|
|
550
|
+
font-weight: 400;
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
:host([variant='overlay']) .eyebrow,
|
|
554
|
+
:host([variant='overlay']) .cta {
|
|
555
|
+
color: inherit;
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
@media (prefers-reduced-motion: reduce) {
|
|
559
|
+
.image,
|
|
560
|
+
:host([variant='overlay']) .card {
|
|
561
|
+
transition: none;
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
`;
|
|
565
|
+
__decorateClass([
|
|
566
|
+
property3({ type: String, reflect: true })
|
|
567
|
+
], MegaMenuFeature.prototype, "variant", 2);
|
|
568
|
+
__decorateClass([
|
|
569
|
+
property3({ type: String })
|
|
570
|
+
], MegaMenuFeature.prototype, "title", 2);
|
|
571
|
+
__decorateClass([
|
|
572
|
+
property3({ type: String })
|
|
573
|
+
], MegaMenuFeature.prototype, "description", 2);
|
|
574
|
+
__decorateClass([
|
|
575
|
+
property3({ type: String })
|
|
576
|
+
], MegaMenuFeature.prototype, "eyebrow", 2);
|
|
577
|
+
__decorateClass([
|
|
578
|
+
property3({ type: String })
|
|
579
|
+
], MegaMenuFeature.prototype, "href", 2);
|
|
580
|
+
__decorateClass([
|
|
581
|
+
property3({ type: String })
|
|
582
|
+
], MegaMenuFeature.prototype, "target", 2);
|
|
583
|
+
__decorateClass([
|
|
584
|
+
property3({ type: String, attribute: "image-url" })
|
|
585
|
+
], MegaMenuFeature.prototype, "imageUrl", 2);
|
|
586
|
+
__decorateClass([
|
|
587
|
+
property3({ type: String, attribute: "image-alt" })
|
|
588
|
+
], MegaMenuFeature.prototype, "imageAlt", 2);
|
|
589
|
+
__decorateClass([
|
|
590
|
+
property3({ type: String, attribute: "logo-url" })
|
|
591
|
+
], MegaMenuFeature.prototype, "logoUrl", 2);
|
|
592
|
+
__decorateClass([
|
|
593
|
+
property3({ type: String, attribute: "logo-alt" })
|
|
594
|
+
], MegaMenuFeature.prototype, "logoAlt", 2);
|
|
595
|
+
__decorateClass([
|
|
596
|
+
property3({ type: String, attribute: "cta-label" })
|
|
597
|
+
], MegaMenuFeature.prototype, "ctaLabel", 2);
|
|
598
|
+
MegaMenuFeature = __decorateClass([
|
|
599
|
+
customElement3("st-mega-menu-feature")
|
|
600
|
+
], MegaMenuFeature);
|
|
601
|
+
|
|
602
|
+
export {
|
|
603
|
+
MegaMenu,
|
|
604
|
+
MegaMenuColumn,
|
|
605
|
+
MegaMenuFeature
|
|
606
|
+
};
|
|
607
|
+
//# sourceMappingURL=chunk-HGTC3LCW.js.map
|