@sankhyatronics/sankhya-cms 0.1.3 → 0.1.4
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 +2160 -1301
- 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-TH5NZXA7.js → chunk-KHPJ5FAJ.js} +80 -4
- package/dist/chunk-KHPJ5FAJ.js.map +1 -0
- package/dist/chunk-MLF6L3KM.js +605 -0
- package/dist/chunk-MLF6L3KM.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-5DNVCMOO.js → chunk-S4ARRDAI.js} +2 -2
- package/dist/{chunk-5UFRGZWG.js → chunk-TLHG33MM.js} +2 -2
- package/dist/dropdown/index.d.ts +30 -2
- package/dist/dropdown/index.js +2 -1
- package/dist/header/index.js +2 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +36 -28
- package/dist/mega-menu/index.d.ts +141 -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/schema/index.d.ts +3 -0
- package/dist/schema/index.js +3 -0
- package/dist/schema/index.js.map +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/testimonials/index.js +2 -2
- package/package.json +25 -21
- package/LICENSE +0 -21
- package/dist/chunk-3TCP25JG.js.map +0 -1
- package/dist/chunk-FWIG6GEZ.js.map +0 -1
- package/dist/chunk-PKTRYUGP.js.map +0 -1
- package/dist/chunk-TH5NZXA7.js.map +0 -1
- /package/dist/{chunk-5DNVCMOO.js.map → chunk-S4ARRDAI.js.map} +0 -0
- /package/dist/{chunk-5UFRGZWG.js.map → chunk-TLHG33MM.js.map} +0 -0
|
@@ -0,0 +1,605 @@
|
|
|
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
|
+
padding: 2rem 1.75rem 1.75rem;
|
|
276
|
+
border-radius: 20px;
|
|
277
|
+
background: color-mix(in oklch, var(--st-color-text-strong) 5%, var(--st-color-surface));
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
:host([variant='accent']) {
|
|
281
|
+
background: var(--st-color-accent);
|
|
282
|
+
color: var(--st-color-on-solid);
|
|
283
|
+
/* Read by the st-menu-item links inside. */
|
|
284
|
+
--st-nav-color: var(--st-color-on-solid);
|
|
285
|
+
--st-nav-hover-bg: transparent;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
.heading {
|
|
289
|
+
display: inline-flex;
|
|
290
|
+
align-items: center;
|
|
291
|
+
gap: 6px;
|
|
292
|
+
margin: 0 0 0.75rem;
|
|
293
|
+
font-size: 1.125rem;
|
|
294
|
+
font-weight: 500;
|
|
295
|
+
line-height: 1.35;
|
|
296
|
+
color: var(--st-color-text-strong);
|
|
297
|
+
text-decoration: none;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
:host([variant='card']) .heading,
|
|
301
|
+
:host([variant='accent']) .heading {
|
|
302
|
+
font-size: 1.375rem;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
:host([variant='accent']) .heading {
|
|
306
|
+
color: inherit;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
a.heading:hover,
|
|
310
|
+
a.heading:focus-visible {
|
|
311
|
+
text-decoration: underline;
|
|
312
|
+
text-underline-offset: 4px;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
.description {
|
|
316
|
+
margin: -0.25rem 0 0.75rem;
|
|
317
|
+
font-size: 0.875rem;
|
|
318
|
+
line-height: 1.5;
|
|
319
|
+
color: var(--st-color-text-muted);
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
:host([variant='accent']) .description {
|
|
323
|
+
color: inherit;
|
|
324
|
+
opacity: 0.85;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
.items {
|
|
328
|
+
display: flex;
|
|
329
|
+
flex-direction: column;
|
|
330
|
+
gap: 2px;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
/* Nested groups stack with room between them. */
|
|
334
|
+
::slotted(st-mega-menu-column:not(:first-child)) {
|
|
335
|
+
margin-top: 2rem;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
.cta {
|
|
339
|
+
display: inline-flex;
|
|
340
|
+
align-items: center;
|
|
341
|
+
justify-content: center;
|
|
342
|
+
gap: 6px;
|
|
343
|
+
padding: 0.875rem 1.5rem;
|
|
344
|
+
border-radius: 9999px;
|
|
345
|
+
background: var(--st-color-surface);
|
|
346
|
+
color: var(--st-color-text-strong);
|
|
347
|
+
font-size: 1rem;
|
|
348
|
+
font-weight: 500;
|
|
349
|
+
text-align: center;
|
|
350
|
+
text-decoration: none;
|
|
351
|
+
transition: box-shadow 0.2s ease;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
.cta-spacer {
|
|
355
|
+
flex: 1;
|
|
356
|
+
min-height: 1.75rem;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
.cta:hover,
|
|
360
|
+
.cta:focus-visible {
|
|
361
|
+
box-shadow: 0 0 0 2px currentColor;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
@media (prefers-reduced-motion: reduce) {
|
|
365
|
+
.cta {
|
|
366
|
+
transition: none;
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
`;
|
|
370
|
+
__decorateClass([
|
|
371
|
+
property2({ type: String })
|
|
372
|
+
], MegaMenuColumn.prototype, "heading", 2);
|
|
373
|
+
__decorateClass([
|
|
374
|
+
property2({ type: String })
|
|
375
|
+
], MegaMenuColumn.prototype, "href", 2);
|
|
376
|
+
__decorateClass([
|
|
377
|
+
property2({ type: String })
|
|
378
|
+
], MegaMenuColumn.prototype, "description", 2);
|
|
379
|
+
__decorateClass([
|
|
380
|
+
property2({ type: String, reflect: true })
|
|
381
|
+
], MegaMenuColumn.prototype, "variant", 2);
|
|
382
|
+
__decorateClass([
|
|
383
|
+
property2({ type: String, attribute: "cta-label" })
|
|
384
|
+
], MegaMenuColumn.prototype, "ctaLabel", 2);
|
|
385
|
+
__decorateClass([
|
|
386
|
+
property2({ type: String, attribute: "cta-href" })
|
|
387
|
+
], MegaMenuColumn.prototype, "ctaHref", 2);
|
|
388
|
+
MegaMenuColumn = __decorateClass([
|
|
389
|
+
customElement2("st-mega-menu-column")
|
|
390
|
+
], MegaMenuColumn);
|
|
391
|
+
|
|
392
|
+
// src/mega-menu/MegaMenuFeature.ts
|
|
393
|
+
import { LitElement as LitElement3, css as css3, html as html3, nothing as nothing3 } from "lit";
|
|
394
|
+
import { customElement as customElement3, property as property3 } from "lit/decorators.js";
|
|
395
|
+
var MegaMenuFeature = class extends LitElement3 {
|
|
396
|
+
constructor() {
|
|
397
|
+
super(...arguments);
|
|
398
|
+
this.variant = "story";
|
|
399
|
+
this.title = "";
|
|
400
|
+
this.description = "";
|
|
401
|
+
this.eyebrow = "";
|
|
402
|
+
this.href = "";
|
|
403
|
+
this.target = "";
|
|
404
|
+
this.imageUrl = "";
|
|
405
|
+
this.imageAlt = "";
|
|
406
|
+
this.logoUrl = "";
|
|
407
|
+
this.logoAlt = "";
|
|
408
|
+
this.ctaLabel = "";
|
|
409
|
+
this.onClick = (event) => {
|
|
410
|
+
if (this.isExternal) return;
|
|
411
|
+
const selectEvent = new CustomEvent("mega-menu-select", {
|
|
412
|
+
detail: { href: this.href },
|
|
413
|
+
bubbles: true,
|
|
414
|
+
composed: true,
|
|
415
|
+
cancelable: true
|
|
416
|
+
});
|
|
417
|
+
this.dispatchEvent(selectEvent);
|
|
418
|
+
if (selectEvent.defaultPrevented) event.preventDefault();
|
|
419
|
+
};
|
|
420
|
+
}
|
|
421
|
+
get isExternal() {
|
|
422
|
+
return this.href.startsWith("http");
|
|
423
|
+
}
|
|
424
|
+
render() {
|
|
425
|
+
const target = this.target || (this.isExternal ? "_blank" : "_self");
|
|
426
|
+
const overlay = this.variant === "overlay";
|
|
427
|
+
const style = overlay && this.imageUrl ? `--st-mega-menu-feature-image:url(${JSON.stringify(this.imageUrl)})` : "";
|
|
428
|
+
return html3`
|
|
429
|
+
<a
|
|
430
|
+
part="card"
|
|
431
|
+
class="card"
|
|
432
|
+
style=${style}
|
|
433
|
+
href=${this.href || nothing3}
|
|
434
|
+
target=${target}
|
|
435
|
+
rel=${target === "_blank" ? "noopener noreferrer" : nothing3}
|
|
436
|
+
@click=${this.onClick}
|
|
437
|
+
>
|
|
438
|
+
${overlay && this.logoUrl ? html3`<img part="logo" class="logo" src=${this.logoUrl} alt=${this.logoAlt} />` : nothing3}
|
|
439
|
+
${!overlay && this.imageUrl ? html3`<img part="image" class="image" src=${this.imageUrl} alt=${this.imageAlt} loading="lazy" />` : nothing3}
|
|
440
|
+
${this.eyebrow ? html3`<span part="eyebrow" class="eyebrow">${this.eyebrow}</span>` : nothing3}
|
|
441
|
+
${this.title ? html3`<p part="title" class="title">${this.title}</p>` : nothing3}
|
|
442
|
+
${this.description ? html3`<p part="description" class="description">${this.description}</p>` : nothing3}
|
|
443
|
+
${this.ctaLabel ? html3`<span part="cta" class="cta">${this.ctaLabel}</span>` : nothing3}
|
|
444
|
+
</a>
|
|
445
|
+
`;
|
|
446
|
+
}
|
|
447
|
+
};
|
|
448
|
+
/** `focus()` on the element focuses its link, so `st-dropdown` can arrow-key to it. */
|
|
449
|
+
MegaMenuFeature.shadowRootOptions = { ...LitElement3.shadowRootOptions, delegatesFocus: true };
|
|
450
|
+
MegaMenuFeature.styles = css3`
|
|
451
|
+
${controlBaseStyles}
|
|
452
|
+
|
|
453
|
+
:host {
|
|
454
|
+
display: block;
|
|
455
|
+
${fontFamilyStyles}
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
.card {
|
|
459
|
+
display: flex;
|
|
460
|
+
flex-direction: column;
|
|
461
|
+
gap: 0.75rem;
|
|
462
|
+
box-sizing: border-box;
|
|
463
|
+
color: var(--st-color-text-strong);
|
|
464
|
+
text-decoration: none;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
.image {
|
|
468
|
+
display: block;
|
|
469
|
+
width: 100%;
|
|
470
|
+
aspect-ratio: 9 / 8;
|
|
471
|
+
object-fit: cover;
|
|
472
|
+
border-radius: 20px;
|
|
473
|
+
transition: transform 0.3s ease;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
.card:hover .image {
|
|
477
|
+
transform: scale(1.015);
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
.eyebrow {
|
|
481
|
+
font-size: 0.75rem;
|
|
482
|
+
font-weight: 600;
|
|
483
|
+
letter-spacing: 0.06em;
|
|
484
|
+
text-transform: uppercase;
|
|
485
|
+
color: var(--st-color-accent-text);
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
.title {
|
|
489
|
+
margin: 0;
|
|
490
|
+
font-size: 1.125rem;
|
|
491
|
+
font-weight: 500;
|
|
492
|
+
line-height: 1.3;
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
.description {
|
|
496
|
+
margin: 0;
|
|
497
|
+
font-size: 0.9375rem;
|
|
498
|
+
line-height: 1.5;
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
.cta {
|
|
502
|
+
align-self: flex-start;
|
|
503
|
+
margin-top: 0.75rem;
|
|
504
|
+
font-size: 0.9375rem;
|
|
505
|
+
font-weight: 500;
|
|
506
|
+
text-decoration: underline;
|
|
507
|
+
text-underline-offset: 5px;
|
|
508
|
+
text-decoration-thickness: 1px;
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
.card:hover .cta,
|
|
512
|
+
.card:focus-visible .cta {
|
|
513
|
+
text-decoration-thickness: 2px;
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
/* overlay */
|
|
517
|
+
:host([variant='overlay']) .card {
|
|
518
|
+
justify-content: flex-end;
|
|
519
|
+
gap: 0.5rem;
|
|
520
|
+
min-height: 15rem;
|
|
521
|
+
padding: 1.75rem;
|
|
522
|
+
border-radius: 20px;
|
|
523
|
+
color: #fff;
|
|
524
|
+
background-color: var(--st-color-accent);
|
|
525
|
+
background-image:
|
|
526
|
+
linear-gradient(to top, rgb(0 0 0 / 0.55), rgb(0 0 0 / 0.05)),
|
|
527
|
+
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))));
|
|
528
|
+
background-size: cover;
|
|
529
|
+
background-position: center;
|
|
530
|
+
transition: transform 0.2s ease;
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
:host([variant='overlay']) .card:hover {
|
|
534
|
+
transform: translateY(-2px);
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
:host([variant='overlay']) .logo {
|
|
538
|
+
height: 2.25rem;
|
|
539
|
+
width: auto;
|
|
540
|
+
max-width: 70%;
|
|
541
|
+
margin-bottom: auto;
|
|
542
|
+
align-self: flex-start;
|
|
543
|
+
object-fit: contain;
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
:host([variant='overlay']) .title {
|
|
547
|
+
font-size: 1.75rem;
|
|
548
|
+
font-weight: 400;
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
:host([variant='overlay']) .eyebrow,
|
|
552
|
+
:host([variant='overlay']) .cta {
|
|
553
|
+
color: inherit;
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
@media (prefers-reduced-motion: reduce) {
|
|
557
|
+
.image,
|
|
558
|
+
:host([variant='overlay']) .card {
|
|
559
|
+
transition: none;
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
`;
|
|
563
|
+
__decorateClass([
|
|
564
|
+
property3({ type: String, reflect: true })
|
|
565
|
+
], MegaMenuFeature.prototype, "variant", 2);
|
|
566
|
+
__decorateClass([
|
|
567
|
+
property3({ type: String })
|
|
568
|
+
], MegaMenuFeature.prototype, "title", 2);
|
|
569
|
+
__decorateClass([
|
|
570
|
+
property3({ type: String })
|
|
571
|
+
], MegaMenuFeature.prototype, "description", 2);
|
|
572
|
+
__decorateClass([
|
|
573
|
+
property3({ type: String })
|
|
574
|
+
], MegaMenuFeature.prototype, "eyebrow", 2);
|
|
575
|
+
__decorateClass([
|
|
576
|
+
property3({ type: String })
|
|
577
|
+
], MegaMenuFeature.prototype, "href", 2);
|
|
578
|
+
__decorateClass([
|
|
579
|
+
property3({ type: String })
|
|
580
|
+
], MegaMenuFeature.prototype, "target", 2);
|
|
581
|
+
__decorateClass([
|
|
582
|
+
property3({ type: String, attribute: "image-url" })
|
|
583
|
+
], MegaMenuFeature.prototype, "imageUrl", 2);
|
|
584
|
+
__decorateClass([
|
|
585
|
+
property3({ type: String, attribute: "image-alt" })
|
|
586
|
+
], MegaMenuFeature.prototype, "imageAlt", 2);
|
|
587
|
+
__decorateClass([
|
|
588
|
+
property3({ type: String, attribute: "logo-url" })
|
|
589
|
+
], MegaMenuFeature.prototype, "logoUrl", 2);
|
|
590
|
+
__decorateClass([
|
|
591
|
+
property3({ type: String, attribute: "logo-alt" })
|
|
592
|
+
], MegaMenuFeature.prototype, "logoAlt", 2);
|
|
593
|
+
__decorateClass([
|
|
594
|
+
property3({ type: String, attribute: "cta-label" })
|
|
595
|
+
], MegaMenuFeature.prototype, "ctaLabel", 2);
|
|
596
|
+
MegaMenuFeature = __decorateClass([
|
|
597
|
+
customElement3("st-mega-menu-feature")
|
|
598
|
+
], MegaMenuFeature);
|
|
599
|
+
|
|
600
|
+
export {
|
|
601
|
+
MegaMenu,
|
|
602
|
+
MegaMenuColumn,
|
|
603
|
+
MegaMenuFeature
|
|
604
|
+
};
|
|
605
|
+
//# sourceMappingURL=chunk-MLF6L3KM.js.map
|
|
@@ -0,0 +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 */\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 padding: 2rem 1.75rem 1.75rem;\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. */\n ::slotted(st-mega-menu-column:not(:first-child)) {\n margin-top: 2rem;\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,aA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,EAAE,MAAM,QAAQ,WAAW,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"]}
|
|
@@ -75,6 +75,13 @@ function chevronIcon(direction, size = 14) {
|
|
|
75
75
|
</svg>
|
|
76
76
|
`;
|
|
77
77
|
}
|
|
78
|
+
function arrowUpRightIcon(size = 12) {
|
|
79
|
+
return html`
|
|
80
|
+
<svg width=${size} height=${size} viewBox="0 0 24 24" fill="none" aria-hidden="true">
|
|
81
|
+
<path d="M7 17L17 7M8 7h9v9" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round" />
|
|
82
|
+
</svg>
|
|
83
|
+
`;
|
|
84
|
+
}
|
|
78
85
|
function plusIcon(size = 13) {
|
|
79
86
|
return html`
|
|
80
87
|
<svg width=${size} height=${size} viewBox="0 0 24 24" fill="none" aria-hidden="true">
|
|
@@ -321,6 +328,7 @@ export {
|
|
|
321
328
|
historyIcon,
|
|
322
329
|
trashIcon,
|
|
323
330
|
chevronIcon,
|
|
331
|
+
arrowUpRightIcon,
|
|
324
332
|
plusIcon,
|
|
325
333
|
cardsViewIcon,
|
|
326
334
|
checkIcon,
|
|
@@ -344,4 +352,4 @@ export {
|
|
|
344
352
|
gearIcon,
|
|
345
353
|
paletteIcon
|
|
346
354
|
};
|
|
347
|
-
//# sourceMappingURL=chunk-
|
|
355
|
+
//# sourceMappingURL=chunk-PB7ZPPLP.js.map
|