@sankhyatronics/sankhya-cms 0.0.0-stage → 0.0.9
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/LICENSE +21 -0
- package/README.md +34 -3
- package/custom-elements.json +4008 -0
- package/dist/bento-grid/index.d.ts +27 -0
- package/dist/bento-grid/index.js +10 -0
- package/dist/bento-grid/index.js.map +1 -0
- package/dist/card/index.d.ts +20 -0
- package/dist/card/index.js +9 -0
- package/dist/card/index.js.map +1 -0
- package/dist/carousel/index.d.ts +44 -0
- package/dist/carousel/index.js +10 -0
- package/dist/carousel/index.js.map +1 -0
- package/dist/chunk-23IHTBAB.js +557 -0
- package/dist/chunk-23IHTBAB.js.map +1 -0
- package/dist/chunk-2VZFHTBC.js +203 -0
- package/dist/chunk-2VZFHTBC.js.map +1 -0
- package/dist/chunk-3ERKQNZT.js +155 -0
- package/dist/chunk-3ERKQNZT.js.map +1 -0
- package/dist/chunk-3JU3R22O.js +193 -0
- package/dist/chunk-3JU3R22O.js.map +1 -0
- package/dist/chunk-3TCP25JG.js +347 -0
- package/dist/chunk-3TCP25JG.js.map +1 -0
- package/dist/chunk-3VE6VFJ4.js +87 -0
- package/dist/chunk-3VE6VFJ4.js.map +1 -0
- package/dist/chunk-4HKSA5UT.js +312 -0
- package/dist/chunk-4HKSA5UT.js.map +1 -0
- package/dist/chunk-5REZSZCK.js +266 -0
- package/dist/chunk-5REZSZCK.js.map +1 -0
- package/dist/chunk-5UFRGZWG.js +268 -0
- package/dist/chunk-5UFRGZWG.js.map +1 -0
- package/dist/chunk-74MILER4.js +215 -0
- package/dist/chunk-74MILER4.js.map +1 -0
- package/dist/chunk-7PSYCTEN.js +118 -0
- package/dist/chunk-7PSYCTEN.js.map +1 -0
- package/dist/chunk-E52WO7R7.js +279 -0
- package/dist/chunk-E52WO7R7.js.map +1 -0
- package/dist/chunk-EUXUH3YW.js +15 -0
- package/dist/chunk-EUXUH3YW.js.map +1 -0
- package/dist/chunk-IMACP7HN.js +156 -0
- package/dist/chunk-IMACP7HN.js.map +1 -0
- package/dist/chunk-LHU23TF6.js +273 -0
- package/dist/chunk-LHU23TF6.js.map +1 -0
- package/dist/chunk-OEX5FDMR.js +250 -0
- package/dist/chunk-OEX5FDMR.js.map +1 -0
- package/dist/chunk-RHAOQ6K4.js +138 -0
- package/dist/chunk-RHAOQ6K4.js.map +1 -0
- package/dist/chunk-RMIJVTFS.js +397 -0
- package/dist/chunk-RMIJVTFS.js.map +1 -0
- package/dist/chunk-TIU73O7I.js +221 -0
- package/dist/chunk-TIU73O7I.js.map +1 -0
- package/dist/chunk-USNFT4DU.js +125 -0
- package/dist/chunk-USNFT4DU.js.map +1 -0
- package/dist/chunk-VYON56QO.js +90 -0
- package/dist/chunk-VYON56QO.js.map +1 -0
- package/dist/chunk-WCO7JAIK.js +195 -0
- package/dist/chunk-WCO7JAIK.js.map +1 -0
- package/dist/chunk-XHBC23TV.js +254 -0
- package/dist/chunk-XHBC23TV.js.map +1 -0
- package/dist/chunk-XXPBFHWR.js +70 -0
- package/dist/chunk-XXPBFHWR.js.map +1 -0
- package/dist/chunk-YYK4GQUW.js +299 -0
- package/dist/chunk-YYK4GQUW.js.map +1 -0
- package/dist/cms-theme.css +15 -0
- package/dist/content-block/index.d.ts +25 -0
- package/dist/content-block/index.js +11 -0
- package/dist/content-block/index.js.map +1 -0
- package/dist/cookie-consent/index.d.ts +33 -0
- package/dist/cookie-consent/index.js +9 -0
- package/dist/cookie-consent/index.js.map +1 -0
- package/dist/dropdown/index.d.ts +89 -0
- package/dist/dropdown/index.js +9 -0
- package/dist/dropdown/index.js.map +1 -0
- package/dist/feature-split/index.d.ts +38 -0
- package/dist/feature-split/index.js +11 -0
- package/dist/feature-split/index.js.map +1 -0
- package/dist/features-section/index.d.ts +50 -0
- package/dist/features-section/index.js +14 -0
- package/dist/features-section/index.js.map +1 -0
- package/dist/footer/index.d.ts +64 -0
- package/dist/footer/index.js +9 -0
- package/dist/footer/index.js.map +1 -0
- package/dist/header/index.d.ts +112 -0
- package/dist/header/index.js +10 -0
- package/dist/header/index.js.map +1 -0
- package/dist/hero/index.d.ts +32 -0
- package/dist/hero/index.js +10 -0
- package/dist/hero/index.js.map +1 -0
- package/dist/icon-button/index.d.ts +23 -0
- package/dist/icon-button/index.js +9 -0
- package/dist/icon-button/index.js.map +1 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.js +93 -0
- package/dist/index.js.map +1 -0
- package/dist/items-accordion/index.d.ts +31 -0
- package/dist/items-accordion/index.js +10 -0
- package/dist/items-accordion/index.js.map +1 -0
- package/dist/markdown/index.d.ts +33 -0
- package/dist/markdown/index.js +9 -0
- package/dist/markdown/index.js.map +1 -0
- package/dist/menu-grid/index.d.ts +21 -0
- package/dist/menu-grid/index.js +9 -0
- package/dist/menu-grid/index.js.map +1 -0
- package/dist/menu-grid-item/index.d.ts +53 -0
- package/dist/menu-grid-item/index.js +9 -0
- package/dist/menu-grid-item/index.js.map +1 -0
- package/dist/menu-item/index.d.ts +50 -0
- package/dist/menu-item/index.js +9 -0
- package/dist/menu-item/index.js.map +1 -0
- package/dist/promo-banner/index.d.ts +22 -0
- package/dist/promo-banner/index.js +10 -0
- package/dist/promo-banner/index.js.map +1 -0
- package/dist/schema/index.d.ts +72 -0
- package/dist/schema/index.js +75 -0
- package/dist/schema/index.js.map +1 -0
- package/dist/select/index.d.ts +77 -0
- package/dist/select/index.js +10 -0
- package/dist/select/index.js.map +1 -0
- package/dist/shared/icons.d.ts +77 -0
- package/dist/shared/icons.js +64 -0
- package/dist/shared/icons.js.map +1 -0
- package/dist/shared/styles.d.ts +90 -0
- package/dist/shared/styles.js +48 -0
- package/dist/shared/styles.js.map +1 -0
- package/dist/stats/index.d.ts +17 -0
- package/dist/stats/index.js +9 -0
- package/dist/stats/index.js.map +1 -0
- package/dist/testimonials/index.d.ts +25 -0
- package/dist/testimonials/index.js +10 -0
- package/dist/testimonials/index.js.map +1 -0
- package/dist/theme.css +292 -0
- package/dist/themes.css +65 -0
- package/dist/theming/index.d.ts +28 -0
- package/dist/theming/index.js +53 -0
- package/dist/theming/index.js.map +1 -0
- package/package.json +160 -3
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
import {
|
|
2
|
+
controlBaseStyles,
|
|
3
|
+
fontFamilyStyles
|
|
4
|
+
} from "./chunk-RHAOQ6K4.js";
|
|
5
|
+
import {
|
|
6
|
+
__decorateClass
|
|
7
|
+
} from "./chunk-EUXUH3YW.js";
|
|
8
|
+
|
|
9
|
+
// src/menu-grid-item/MenuGridItem.ts
|
|
10
|
+
import { LitElement, css, html, nothing } from "lit";
|
|
11
|
+
import { customElement, property, state } from "lit/decorators.js";
|
|
12
|
+
var MenuGridItem = class extends LitElement {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments);
|
|
15
|
+
this.title = "";
|
|
16
|
+
this.description = "";
|
|
17
|
+
this.href = "";
|
|
18
|
+
this.badge = "";
|
|
19
|
+
this.compact = false;
|
|
20
|
+
this.showDescription = true;
|
|
21
|
+
this.hasIcon = false;
|
|
22
|
+
this.pending = true;
|
|
23
|
+
this.onIconSlotChange = (event) => {
|
|
24
|
+
this.hasIcon = event.target.assignedNodes({ flatten: true }).length > 0;
|
|
25
|
+
};
|
|
26
|
+
this.onClick = (event) => {
|
|
27
|
+
if (this.isExternal) return;
|
|
28
|
+
const selectEvent = new CustomEvent("menu-grid-item-select", {
|
|
29
|
+
detail: { href: this.href },
|
|
30
|
+
bubbles: true,
|
|
31
|
+
composed: true,
|
|
32
|
+
cancelable: true
|
|
33
|
+
});
|
|
34
|
+
this.dispatchEvent(selectEvent);
|
|
35
|
+
if (selectEvent.defaultPrevented) event.preventDefault();
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
connectedCallback() {
|
|
39
|
+
super.connectedCallback();
|
|
40
|
+
if (typeof IntersectionObserver === "undefined") {
|
|
41
|
+
this.pending = false;
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
this.observer = new IntersectionObserver((entries) => {
|
|
45
|
+
if (entries.some((entry) => entry.isIntersecting)) {
|
|
46
|
+
this.pending = false;
|
|
47
|
+
this.observer?.disconnect();
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
this.observer.observe(this);
|
|
51
|
+
}
|
|
52
|
+
disconnectedCallback() {
|
|
53
|
+
this.observer?.disconnect();
|
|
54
|
+
super.disconnectedCallback();
|
|
55
|
+
}
|
|
56
|
+
get isExternal() {
|
|
57
|
+
return this.href.startsWith("http");
|
|
58
|
+
}
|
|
59
|
+
render() {
|
|
60
|
+
const iconOnly = this.hasIcon && !this.title;
|
|
61
|
+
return html`
|
|
62
|
+
<div class="menu-grid-item ${this.compact ? "compact" : "regular"} ${this.pending ? "pending" : ""}" part="item">
|
|
63
|
+
<a
|
|
64
|
+
part="link"
|
|
65
|
+
class="menu-grid-link"
|
|
66
|
+
href=${this.href}
|
|
67
|
+
target=${this.isExternal ? "_blank" : "_self"}
|
|
68
|
+
rel=${this.isExternal ? "noopener noreferrer" : nothing}
|
|
69
|
+
@click=${this.onClick}
|
|
70
|
+
>
|
|
71
|
+
${this.badge ? html`<span part="badge" class="menu-grid-badge">${this.badge}</span>` : nothing}
|
|
72
|
+
<span class="menu-grid-header ${iconOnly ? "icon-only" : ""}" part="header">
|
|
73
|
+
<span class="menu-grid-icon" part="icon" ?hidden=${!this.hasIcon}><slot name="icon" @slotchange=${this.onIconSlotChange}></slot></span>
|
|
74
|
+
${this.title ? html`<span part="title" class="menu-grid-title">${this.title}</span>` : nothing}
|
|
75
|
+
</span>
|
|
76
|
+
${this.description && this.showDescription ? html`<span part="description" class="menu-grid-description">${this.description}</span>` : nothing}
|
|
77
|
+
</a>
|
|
78
|
+
</div>
|
|
79
|
+
`;
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
/** `focus()` on the element focuses its link, so `st-dropdown` can arrow-key between items. */
|
|
83
|
+
MenuGridItem.shadowRootOptions = { ...LitElement.shadowRootOptions, delegatesFocus: true };
|
|
84
|
+
MenuGridItem.styles = css`
|
|
85
|
+
${controlBaseStyles}
|
|
86
|
+
|
|
87
|
+
:host {
|
|
88
|
+
display: block;
|
|
89
|
+
${fontFamilyStyles}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
@keyframes st-menu-grid-badge-pop {
|
|
93
|
+
from {
|
|
94
|
+
transform: scale(0);
|
|
95
|
+
}
|
|
96
|
+
70% {
|
|
97
|
+
transform: scale(1.12);
|
|
98
|
+
}
|
|
99
|
+
to {
|
|
100
|
+
transform: scale(1);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.menu-grid-item {
|
|
105
|
+
display: flex;
|
|
106
|
+
flex-direction: column;
|
|
107
|
+
border-radius: 8px;
|
|
108
|
+
position: relative;
|
|
109
|
+
overflow: hidden;
|
|
110
|
+
color: var(--st-color-text);
|
|
111
|
+
transition:
|
|
112
|
+
opacity 0.4s ease-out,
|
|
113
|
+
transform 0.2s ease,
|
|
114
|
+
background-color 0.2s ease;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.menu-grid-item.pending {
|
|
118
|
+
opacity: 0;
|
|
119
|
+
transform: translateY(20px);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.menu-grid-item.regular {
|
|
123
|
+
padding: 16px;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.menu-grid-item.compact {
|
|
127
|
+
padding: 12px;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/* Keyboard focus gets the same treatment as hover. */
|
|
131
|
+
.menu-grid-item:hover,
|
|
132
|
+
.menu-grid-item:has(.menu-grid-link:focus-visible) {
|
|
133
|
+
background: var(--st-color-hover);
|
|
134
|
+
transform: scale(1.02);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.menu-grid-item:active {
|
|
138
|
+
transform: scale(0.98);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.menu-grid-link {
|
|
142
|
+
display: flex;
|
|
143
|
+
flex-direction: column;
|
|
144
|
+
text-decoration: none;
|
|
145
|
+
color: inherit;
|
|
146
|
+
width: 100%;
|
|
147
|
+
height: 100%;
|
|
148
|
+
gap: 8px;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.menu-grid-badge {
|
|
152
|
+
position: absolute;
|
|
153
|
+
top: 2px;
|
|
154
|
+
right: 8px;
|
|
155
|
+
font-size: 0.5rem;
|
|
156
|
+
padding: 2px 8px;
|
|
157
|
+
border-radius: 9999px;
|
|
158
|
+
font-weight: 500;
|
|
159
|
+
z-index: 1;
|
|
160
|
+
background-color: var(--st-color-text-strong);
|
|
161
|
+
color: var(--st-color-on-solid);
|
|
162
|
+
animation: st-menu-grid-badge-pop 0.35s ease-out;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.menu-grid-header {
|
|
166
|
+
display: flex;
|
|
167
|
+
align-items: center;
|
|
168
|
+
gap: 12px;
|
|
169
|
+
width: 100%;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.menu-grid-icon {
|
|
173
|
+
display: flex;
|
|
174
|
+
align-items: center;
|
|
175
|
+
justify-content: center;
|
|
176
|
+
width: 32px;
|
|
177
|
+
height: 32px;
|
|
178
|
+
border-radius: 6px;
|
|
179
|
+
transition:
|
|
180
|
+
background-color 0.2s ease,
|
|
181
|
+
transform 0.2s ease;
|
|
182
|
+
flex-shrink: 0;
|
|
183
|
+
padding: 0;
|
|
184
|
+
margin-bottom: 0;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.menu-grid-icon:hover {
|
|
188
|
+
transform: rotate(5deg) scale(1.1);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.menu-grid-icon[hidden] {
|
|
192
|
+
display: none;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.menu-grid-icon ::slotted(*) {
|
|
196
|
+
width: 18px;
|
|
197
|
+
height: 18px;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.menu-grid-title {
|
|
201
|
+
font-size: 0.875rem;
|
|
202
|
+
font-weight: 500;
|
|
203
|
+
color: var(--st-color-text-strong);
|
|
204
|
+
transition: color 0.2s ease;
|
|
205
|
+
flex: 1;
|
|
206
|
+
min-width: 0;
|
|
207
|
+
overflow: hidden;
|
|
208
|
+
text-overflow: ellipsis;
|
|
209
|
+
white-space: nowrap;
|
|
210
|
+
margin-bottom: 0;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.menu-grid-description {
|
|
214
|
+
font-size: 0.75rem;
|
|
215
|
+
color: var(--st-color-text-muted);
|
|
216
|
+
display: -webkit-box;
|
|
217
|
+
-webkit-box-orient: vertical;
|
|
218
|
+
overflow: hidden;
|
|
219
|
+
line-height: 1.4;
|
|
220
|
+
transition: color 0.2s ease;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.menu-grid-item.compact .menu-grid-header {
|
|
224
|
+
gap: 8px;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.menu-grid-item.compact .menu-grid-icon {
|
|
228
|
+
width: 24px;
|
|
229
|
+
height: 24px;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
.menu-grid-item.compact .menu-grid-icon ::slotted(*) {
|
|
233
|
+
width: 14px;
|
|
234
|
+
height: 14px;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.menu-grid-item.compact .menu-grid-title {
|
|
238
|
+
font-size: 0.75rem;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.menu-grid-item.compact .menu-grid-description {
|
|
242
|
+
font-size: 0.75rem;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.menu-grid-header.icon-only {
|
|
246
|
+
justify-content: center;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
@media (max-width: 480px) {
|
|
250
|
+
.menu-grid-header {
|
|
251
|
+
gap: 8px;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
.menu-grid-icon {
|
|
255
|
+
width: 28px;
|
|
256
|
+
height: 28px;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
.menu-grid-icon ::slotted(*) {
|
|
260
|
+
width: 16px;
|
|
261
|
+
height: 16px;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
@media (prefers-reduced-motion: reduce) {
|
|
266
|
+
.menu-grid-item,
|
|
267
|
+
.menu-grid-icon {
|
|
268
|
+
transition: none;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
.menu-grid-item.pending {
|
|
272
|
+
opacity: 1;
|
|
273
|
+
transform: none;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
.menu-grid-badge {
|
|
277
|
+
animation: none;
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
`;
|
|
281
|
+
__decorateClass([
|
|
282
|
+
property({ type: String })
|
|
283
|
+
], MenuGridItem.prototype, "title", 2);
|
|
284
|
+
__decorateClass([
|
|
285
|
+
property({ type: String })
|
|
286
|
+
], MenuGridItem.prototype, "description", 2);
|
|
287
|
+
__decorateClass([
|
|
288
|
+
property({ type: String })
|
|
289
|
+
], MenuGridItem.prototype, "href", 2);
|
|
290
|
+
__decorateClass([
|
|
291
|
+
property({ type: String })
|
|
292
|
+
], MenuGridItem.prototype, "badge", 2);
|
|
293
|
+
__decorateClass([
|
|
294
|
+
property({ type: Boolean, reflect: true })
|
|
295
|
+
], MenuGridItem.prototype, "compact", 2);
|
|
296
|
+
__decorateClass([
|
|
297
|
+
property({ type: Boolean, attribute: "show-description" })
|
|
298
|
+
], MenuGridItem.prototype, "showDescription", 2);
|
|
299
|
+
__decorateClass([
|
|
300
|
+
state()
|
|
301
|
+
], MenuGridItem.prototype, "hasIcon", 2);
|
|
302
|
+
__decorateClass([
|
|
303
|
+
state()
|
|
304
|
+
], MenuGridItem.prototype, "pending", 2);
|
|
305
|
+
MenuGridItem = __decorateClass([
|
|
306
|
+
customElement("st-menu-grid-item")
|
|
307
|
+
], MenuGridItem);
|
|
308
|
+
|
|
309
|
+
export {
|
|
310
|
+
MenuGridItem
|
|
311
|
+
};
|
|
312
|
+
//# sourceMappingURL=chunk-4HKSA5UT.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/menu-grid-item/MenuGridItem.ts"],"sourcesContent":["import { LitElement, css, html, nothing } from 'lit';\r\nimport { customElement, property, state } from 'lit/decorators.js';\r\n\r\nimport { controlBaseStyles, fontFamilyStyles } from '../shared/styles';\r\nimport type { MenuGridItemSelectEventDetail } from './MenuGridItemEvents';\r\n\r\n/**\r\n * One entry in an `st-menu-grid` — icon (via `slot=\"icon\"`) + title on one line, an optional\r\n * description below, and an optional corner badge (\"New\", \"Popular\", ...). A 1:1 port of\r\n * `SankhyaUI`'s React `MenuGridItem` (`SankhyaCMS/SankhyaUI/src/components/Menu`): same markup and\r\n * CSS, with its `motion` effects redone in CSS — fades up the first time it scrolls into view,\r\n * scales to 1.02 on hover / 0.98 while pressed, the icon tilts on hover, the badge pops in.\r\n * Colors come from the suite theme rather than per-item utility classes.\r\n *\r\n * An `http(s)` `href` opens in a new tab, like the source. Any other `href` fires a *cancelable*\r\n * `menu-grid-item-select` event (detail: `{ href }`) first: a host doing client-side routing calls\r\n * `event.preventDefault()` on it, which also cancels the anchor's own navigation (the source used\r\n * react-router's `Link` here; the suite apps have no router).\r\n */\r\n@customElement('st-menu-grid-item')\r\nexport class MenuGridItem extends LitElement {\r\n /** `focus()` on the element focuses its link, so `st-dropdown` can arrow-key between items. */\r\n static shadowRootOptions = { ...LitElement.shadowRootOptions, delegatesFocus: true };\r\n\r\n static styles = css`\r\n ${controlBaseStyles}\r\n\r\n :host {\r\n display: block;\r\n ${fontFamilyStyles}\r\n }\r\n\r\n @keyframes st-menu-grid-badge-pop {\r\n from {\r\n transform: scale(0);\r\n }\r\n 70% {\r\n transform: scale(1.12);\r\n }\r\n to {\r\n transform: scale(1);\r\n }\r\n }\r\n\r\n .menu-grid-item {\r\n display: flex;\r\n flex-direction: column;\r\n border-radius: 8px;\r\n position: relative;\r\n overflow: hidden;\r\n color: var(--st-color-text);\r\n transition:\r\n opacity 0.4s ease-out,\r\n transform 0.2s ease,\r\n background-color 0.2s ease;\r\n }\r\n\r\n .menu-grid-item.pending {\r\n opacity: 0;\r\n transform: translateY(20px);\r\n }\r\n\r\n .menu-grid-item.regular {\r\n padding: 16px;\r\n }\r\n\r\n .menu-grid-item.compact {\r\n padding: 12px;\r\n }\r\n\r\n /* Keyboard focus gets the same treatment as hover. */\r\n .menu-grid-item:hover,\r\n .menu-grid-item:has(.menu-grid-link:focus-visible) {\r\n background: var(--st-color-hover);\r\n transform: scale(1.02);\r\n }\r\n\r\n .menu-grid-item:active {\r\n transform: scale(0.98);\r\n }\r\n\r\n .menu-grid-link {\r\n display: flex;\r\n flex-direction: column;\r\n text-decoration: none;\r\n color: inherit;\r\n width: 100%;\r\n height: 100%;\r\n gap: 8px;\r\n }\r\n\r\n .menu-grid-badge {\r\n position: absolute;\r\n top: 2px;\r\n right: 8px;\r\n font-size: 0.5rem;\r\n padding: 2px 8px;\r\n border-radius: 9999px;\r\n font-weight: 500;\r\n z-index: 1;\r\n background-color: var(--st-color-text-strong);\r\n color: var(--st-color-on-solid);\r\n animation: st-menu-grid-badge-pop 0.35s ease-out;\r\n }\r\n\r\n .menu-grid-header {\r\n display: flex;\r\n align-items: center;\r\n gap: 12px;\r\n width: 100%;\r\n }\r\n\r\n .menu-grid-icon {\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n width: 32px;\r\n height: 32px;\r\n border-radius: 6px;\r\n transition:\r\n background-color 0.2s ease,\r\n transform 0.2s ease;\r\n flex-shrink: 0;\r\n padding: 0;\r\n margin-bottom: 0;\r\n }\r\n\r\n .menu-grid-icon:hover {\r\n transform: rotate(5deg) scale(1.1);\r\n }\r\n\r\n .menu-grid-icon[hidden] {\r\n display: none;\r\n }\r\n\r\n .menu-grid-icon ::slotted(*) {\r\n width: 18px;\r\n height: 18px;\r\n }\r\n\r\n .menu-grid-title {\r\n font-size: 0.875rem;\r\n font-weight: 500;\r\n color: var(--st-color-text-strong);\r\n transition: color 0.2s ease;\r\n flex: 1;\r\n min-width: 0;\r\n overflow: hidden;\r\n text-overflow: ellipsis;\r\n white-space: nowrap;\r\n margin-bottom: 0;\r\n }\r\n\r\n .menu-grid-description {\r\n font-size: 0.75rem;\r\n color: var(--st-color-text-muted);\r\n display: -webkit-box;\r\n -webkit-box-orient: vertical;\r\n overflow: hidden;\r\n line-height: 1.4;\r\n transition: color 0.2s ease;\r\n }\r\n\r\n .menu-grid-item.compact .menu-grid-header {\r\n gap: 8px;\r\n }\r\n\r\n .menu-grid-item.compact .menu-grid-icon {\r\n width: 24px;\r\n height: 24px;\r\n }\r\n\r\n .menu-grid-item.compact .menu-grid-icon ::slotted(*) {\r\n width: 14px;\r\n height: 14px;\r\n }\r\n\r\n .menu-grid-item.compact .menu-grid-title {\r\n font-size: 0.75rem;\r\n }\r\n\r\n .menu-grid-item.compact .menu-grid-description {\r\n font-size: 0.75rem;\r\n }\r\n\r\n .menu-grid-header.icon-only {\r\n justify-content: center;\r\n }\r\n\r\n @media (max-width: 480px) {\r\n .menu-grid-header {\r\n gap: 8px;\r\n }\r\n\r\n .menu-grid-icon {\r\n width: 28px;\r\n height: 28px;\r\n }\r\n\r\n .menu-grid-icon ::slotted(*) {\r\n width: 16px;\r\n height: 16px;\r\n }\r\n }\r\n\r\n @media (prefers-reduced-motion: reduce) {\r\n .menu-grid-item,\r\n .menu-grid-icon {\r\n transition: none;\r\n }\r\n\r\n .menu-grid-item.pending {\r\n opacity: 1;\r\n transform: none;\r\n }\r\n\r\n .menu-grid-badge {\r\n animation: 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 description = '';\r\n\r\n @property({ type: String })\r\n href = '';\r\n\r\n /** Small corner label, e.g. \"New\"/\"Beta\" — omit for none. */\r\n @property({ type: String })\r\n badge = '';\r\n\r\n @property({ type: Boolean, reflect: true })\r\n compact = false;\r\n\r\n /** Suppresses the description even when `description` is set (source: `showDescription`, default `true`). */\r\n @property({ type: Boolean, attribute: 'show-description' })\r\n showDescription = true;\r\n\r\n /** Whether `slot=\"icon\"` has content, so an omitted icon leaves no empty box. */\r\n @state() private hasIcon = false;\r\n\r\n /** True until the item first scrolls into view (the source's `whileInView ... once`). */\r\n @state() private pending = true;\r\n\r\n private observer?: IntersectionObserver;\r\n\r\n connectedCallback(): void {\r\n super.connectedCallback();\r\n if (typeof IntersectionObserver === 'undefined') {\r\n this.pending = false;\r\n return;\r\n }\r\n this.observer = new IntersectionObserver((entries) => {\r\n if (entries.some((entry) => entry.isIntersecting)) {\r\n this.pending = false;\r\n this.observer?.disconnect();\r\n }\r\n });\r\n this.observer.observe(this);\r\n }\r\n\r\n disconnectedCallback(): void {\r\n this.observer?.disconnect();\r\n super.disconnectedCallback();\r\n }\r\n\r\n private onIconSlotChange = (event: Event): void => {\r\n this.hasIcon = (event.target as HTMLSlotElement).assignedNodes({ flatten: true }).length > 0;\r\n };\r\n\r\n private get isExternal(): boolean {\r\n return this.href.startsWith('http');\r\n }\r\n\r\n private onClick = (event: MouseEvent): void => {\r\n if (this.isExternal) return;\r\n const selectEvent = new CustomEvent<MenuGridItemSelectEventDetail>('menu-grid-item-select', {\r\n detail: { href: this.href },\r\n bubbles: true,\r\n composed: true,\r\n cancelable: true\r\n });\r\n this.dispatchEvent(selectEvent);\r\n if (selectEvent.defaultPrevented) event.preventDefault();\r\n };\r\n\r\n render() {\r\n const iconOnly = this.hasIcon && !this.title;\r\n return html`\r\n <div class=\"menu-grid-item ${this.compact ? 'compact' : 'regular'} ${this.pending ? 'pending' : ''}\" part=\"item\">\r\n <a\r\n part=\"link\"\r\n class=\"menu-grid-link\"\r\n href=${this.href}\r\n target=${this.isExternal ? '_blank' : '_self'}\r\n rel=${this.isExternal ? 'noopener noreferrer' : nothing}\r\n @click=${this.onClick}\r\n >\r\n ${this.badge ? html`<span part=\"badge\" class=\"menu-grid-badge\">${this.badge}</span>` : nothing}\r\n <span class=\"menu-grid-header ${iconOnly ? 'icon-only' : ''}\" part=\"header\">\r\n <span class=\"menu-grid-icon\" part=\"icon\" ?hidden=${!this.hasIcon}><slot name=\"icon\" @slotchange=${this.onIconSlotChange}></slot></span>\r\n ${this.title ? html`<span part=\"title\" class=\"menu-grid-title\">${this.title}</span>` : nothing}\r\n </span>\r\n ${this.description && this.showDescription\r\n ? html`<span part=\"description\" class=\"menu-grid-description\">${this.description}</span>`\r\n : nothing}\r\n </a>\r\n </div>\r\n `;\r\n }\r\n}\r\n"],"mappings":";;;;;;;;;AAAA,SAAS,YAAY,KAAK,MAAM,eAAe;AAC/C,SAAS,eAAe,UAAU,aAAa;AAmBxC,IAAM,eAAN,cAA2B,WAAW;AAAA,EAAtC;AAAA;AA2ML,iBAAQ;AAGR,uBAAc;AAGd,gBAAO;AAIP,iBAAQ;AAGR,mBAAU;AAIV,2BAAkB;AAGT,SAAQ,UAAU;AAGlB,SAAQ,UAAU;AAwB3B,SAAQ,mBAAmB,CAAC,UAAuB;AACjD,WAAK,UAAW,MAAM,OAA2B,cAAc,EAAE,SAAS,KAAK,CAAC,EAAE,SAAS;AAAA,IAC7F;AAMA,SAAQ,UAAU,CAAC,UAA4B;AAC7C,UAAI,KAAK,WAAY;AACrB,YAAM,cAAc,IAAI,YAA2C,yBAAyB;AAAA,QAC1F,QAAQ,EAAE,MAAM,KAAK,KAAK;AAAA,QAC1B,SAAS;AAAA,QACT,UAAU;AAAA,QACV,YAAY;AAAA,MACd,CAAC;AACD,WAAK,cAAc,WAAW;AAC9B,UAAI,YAAY,iBAAkB,OAAM,eAAe;AAAA,IACzD;AAAA;AAAA,EAtCA,oBAA0B;AACxB,UAAM,kBAAkB;AACxB,QAAI,OAAO,yBAAyB,aAAa;AAC/C,WAAK,UAAU;AACf;AAAA,IACF;AACA,SAAK,WAAW,IAAI,qBAAqB,CAAC,YAAY;AACpD,UAAI,QAAQ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AAAA,GApNf,aAqNX;AAGA;AAAA,EADC,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GAvN/B,aAwNX;AAIA;AAAA,EADC,SAAS,EAAE,MAAM,SAAS,WAAW,mBAAmB,CAAC;AAAA,GA3N/C,aA4NX;AAGiB;AAAA,EAAhB,MAAM;AAAA,GA/NI,aA+NM;AAGA;AAAA,EAAhB,MAAM;AAAA,GAlOI,aAkOM;AAlON,eAAN;AAAA,EADN,cAAc,mBAAmB;AAAA,GACrB;","names":[]}
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cardTitleStyles,
|
|
3
|
+
iconTileStyles,
|
|
4
|
+
reducedMotionStyles,
|
|
5
|
+
sectionTitleStyles
|
|
6
|
+
} from "./chunk-3VE6VFJ4.js";
|
|
7
|
+
import {
|
|
8
|
+
controlBaseStyles,
|
|
9
|
+
ctaButtonStyles,
|
|
10
|
+
fontFamilyStyles
|
|
11
|
+
} from "./chunk-RHAOQ6K4.js";
|
|
12
|
+
import {
|
|
13
|
+
__decorateClass
|
|
14
|
+
} from "./chunk-EUXUH3YW.js";
|
|
15
|
+
|
|
16
|
+
// src/feature-split/FeatureSplit.ts
|
|
17
|
+
import { LitElement, css, html, nothing } from "lit";
|
|
18
|
+
import { customElement, property } from "lit/decorators.js";
|
|
19
|
+
import "iconify-icon";
|
|
20
|
+
var FeatureSplit = class extends LitElement {
|
|
21
|
+
constructor() {
|
|
22
|
+
super(...arguments);
|
|
23
|
+
this.inverted = false;
|
|
24
|
+
this.title = "";
|
|
25
|
+
this.subtitle = "";
|
|
26
|
+
this.items = [];
|
|
27
|
+
this.imageSrc = "";
|
|
28
|
+
this.imageAlt = "";
|
|
29
|
+
this.imagePosition = "right";
|
|
30
|
+
this.actionLabel = "";
|
|
31
|
+
this.href = "";
|
|
32
|
+
}
|
|
33
|
+
onAction() {
|
|
34
|
+
const event = new CustomEvent("feature-split-action", {
|
|
35
|
+
detail: { href: this.href },
|
|
36
|
+
bubbles: true,
|
|
37
|
+
composed: true,
|
|
38
|
+
cancelable: true
|
|
39
|
+
});
|
|
40
|
+
if (this.dispatchEvent(event)) window.location.href = this.href;
|
|
41
|
+
}
|
|
42
|
+
render() {
|
|
43
|
+
return html`
|
|
44
|
+
<div class="container" part="container">
|
|
45
|
+
<div class="content" part="content">
|
|
46
|
+
<h2 class="title" part="title">${this.title}</h2>
|
|
47
|
+
${this.subtitle ? html`<div class="subtitle" part="subtitle"><st-markdown .content=${this.subtitle}></st-markdown></div>` : nothing}
|
|
48
|
+
${this.items.length > 0 ? html`<div class="list" part="list">
|
|
49
|
+
${this.items.map(
|
|
50
|
+
(item) => html`
|
|
51
|
+
<div class="item" part="item">
|
|
52
|
+
${item.icon ? html`<div class="icon" part="icon"><iconify-icon icon=${item.icon}></iconify-icon></div>` : nothing}
|
|
53
|
+
<div>
|
|
54
|
+
<h3 class="item-title" part="item-title">${item.title}</h3>
|
|
55
|
+
<div class="item-description" part="item-description">
|
|
56
|
+
<st-markdown .content=${item.description}></st-markdown>
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
`
|
|
61
|
+
)}
|
|
62
|
+
</div>` : nothing}
|
|
63
|
+
${this.actionLabel && this.href ? html`<button class="action" part="action" type="button" @click=${this.onAction}>${this.actionLabel}</button>` : nothing}
|
|
64
|
+
</div>
|
|
65
|
+
<div class="image-wrapper" part="image-wrapper">
|
|
66
|
+
<img class="image" part="image" src=${this.imageSrc} alt=${this.imageAlt || this.title} />
|
|
67
|
+
</div>
|
|
68
|
+
</div>
|
|
69
|
+
`;
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
FeatureSplit.styles = css`
|
|
73
|
+
${controlBaseStyles}
|
|
74
|
+
|
|
75
|
+
:host {
|
|
76
|
+
display: block;
|
|
77
|
+
padding: var(--st-space-24);
|
|
78
|
+
background: var(--st-color-page);
|
|
79
|
+
${fontFamilyStyles}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
:host([inverted]) {
|
|
83
|
+
background: var(--st-color-text-strong);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.container {
|
|
87
|
+
max-width: var(--st-cms-container-max);
|
|
88
|
+
margin: 0 auto;
|
|
89
|
+
display: grid;
|
|
90
|
+
grid-template-columns: 1fr 1fr;
|
|
91
|
+
gap: var(--st-space-48);
|
|
92
|
+
align-items: center;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
:host([image-position='left']) .container {
|
|
96
|
+
direction: rtl;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
:host([image-position='left']) .content {
|
|
100
|
+
direction: ltr;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
:host([image-position='top']) .container {
|
|
104
|
+
grid-template-columns: 1fr;
|
|
105
|
+
text-align: center;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
:host([image-position='top']) .content {
|
|
109
|
+
align-items: center;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
:host([image-position='top']) .image-wrapper {
|
|
113
|
+
order: -1;
|
|
114
|
+
max-width: 800px;
|
|
115
|
+
margin: 0 auto;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.content {
|
|
119
|
+
display: flex;
|
|
120
|
+
flex-direction: column;
|
|
121
|
+
gap: var(--st-space-32);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.title {
|
|
125
|
+
${sectionTitleStyles}
|
|
126
|
+
margin: 0;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.subtitle {
|
|
130
|
+
color: var(--st-color-text-muted);
|
|
131
|
+
font-size: var(--st-text-base);
|
|
132
|
+
line-height: 1.6;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.list {
|
|
136
|
+
display: flex;
|
|
137
|
+
flex-direction: column;
|
|
138
|
+
gap: var(--st-space-24);
|
|
139
|
+
margin-top: var(--st-space-16);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.item {
|
|
143
|
+
display: flex;
|
|
144
|
+
gap: var(--st-space-16);
|
|
145
|
+
align-items: flex-start;
|
|
146
|
+
text-align: left;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.icon {
|
|
150
|
+
${iconTileStyles}
|
|
151
|
+
width: var(--st-space-48);
|
|
152
|
+
height: var(--st-space-48);
|
|
153
|
+
font-size: 24px;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.item-title {
|
|
157
|
+
${cardTitleStyles}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.item-description {
|
|
161
|
+
color: var(--st-color-text-muted);
|
|
162
|
+
font-size: var(--st-text-sm);
|
|
163
|
+
line-height: 1.5;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.action {
|
|
167
|
+
${ctaButtonStyles}
|
|
168
|
+
justify-self: start;
|
|
169
|
+
padding: var(--st-space-16);
|
|
170
|
+
border-radius: var(--st-radius-lg);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.image-wrapper {
|
|
174
|
+
width: 100%;
|
|
175
|
+
height: 100%;
|
|
176
|
+
min-height: 400px;
|
|
177
|
+
border-radius: var(--st-space-24);
|
|
178
|
+
overflow: hidden;
|
|
179
|
+
box-shadow: 0 20px 40px -12px var(--st-shadow-color-md);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.image {
|
|
183
|
+
width: 100%;
|
|
184
|
+
height: 100%;
|
|
185
|
+
object-fit: cover;
|
|
186
|
+
transition: transform 0.5s ease;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.image:hover {
|
|
190
|
+
transform: scale(1.02);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
:host([inverted]) .title,
|
|
194
|
+
:host([inverted]) .item-title {
|
|
195
|
+
color: var(--st-color-on-solid);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
:host([inverted]) .subtitle,
|
|
199
|
+
:host([inverted]) .item-description {
|
|
200
|
+
color: var(--st-color-border);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
:host([inverted]) .icon {
|
|
204
|
+
background: var(--st-color-text);
|
|
205
|
+
color: var(--st-color-border);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
@media (max-width: 1024px) {
|
|
209
|
+
.container {
|
|
210
|
+
gap: var(--st-space-40);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
@media (max-width: 768px) {
|
|
215
|
+
:host {
|
|
216
|
+
padding: var(--st-space-48) var(--st-space-24);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.container {
|
|
220
|
+
grid-template-columns: 1fr;
|
|
221
|
+
direction: ltr !important;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.image-wrapper {
|
|
225
|
+
min-height: 300px;
|
|
226
|
+
order: -1;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
${reducedMotionStyles}
|
|
231
|
+
`;
|
|
232
|
+
__decorateClass([
|
|
233
|
+
property({ type: Boolean, reflect: true })
|
|
234
|
+
], FeatureSplit.prototype, "inverted", 2);
|
|
235
|
+
__decorateClass([
|
|
236
|
+
property({ type: String })
|
|
237
|
+
], FeatureSplit.prototype, "title", 2);
|
|
238
|
+
__decorateClass([
|
|
239
|
+
property({ type: String })
|
|
240
|
+
], FeatureSplit.prototype, "subtitle", 2);
|
|
241
|
+
__decorateClass([
|
|
242
|
+
property({ attribute: false })
|
|
243
|
+
], FeatureSplit.prototype, "items", 2);
|
|
244
|
+
__decorateClass([
|
|
245
|
+
property({ type: String, attribute: "image-src" })
|
|
246
|
+
], FeatureSplit.prototype, "imageSrc", 2);
|
|
247
|
+
__decorateClass([
|
|
248
|
+
property({ type: String, attribute: "image-alt" })
|
|
249
|
+
], FeatureSplit.prototype, "imageAlt", 2);
|
|
250
|
+
__decorateClass([
|
|
251
|
+
property({ type: String, attribute: "image-position", reflect: true })
|
|
252
|
+
], FeatureSplit.prototype, "imagePosition", 2);
|
|
253
|
+
__decorateClass([
|
|
254
|
+
property({ type: String, attribute: "action-label" })
|
|
255
|
+
], FeatureSplit.prototype, "actionLabel", 2);
|
|
256
|
+
__decorateClass([
|
|
257
|
+
property({ type: String })
|
|
258
|
+
], FeatureSplit.prototype, "href", 2);
|
|
259
|
+
FeatureSplit = __decorateClass([
|
|
260
|
+
customElement("st-feature-split")
|
|
261
|
+
], FeatureSplit);
|
|
262
|
+
|
|
263
|
+
export {
|
|
264
|
+
FeatureSplit
|
|
265
|
+
};
|
|
266
|
+
//# sourceMappingURL=chunk-5REZSZCK.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/feature-split/FeatureSplit.ts"],"sourcesContent":["import { LitElement, css, html, nothing } from 'lit';\r\nimport { customElement, property } from 'lit/decorators.js';\r\nimport 'iconify-icon';\r\n\r\nimport { controlBaseStyles, ctaButtonStyles, fontFamilyStyles } from '../shared/styles';\r\nimport '../markdown';\r\nimport {\r\n cardTitleStyles,\r\n iconTileStyles,\r\n reducedMotionStyles,\r\n sectionTitleStyles,\r\n} from '../shared/section-styles';\r\nimport type { FeatureSplitActionEventDetail } from './FeatureSplitEvents';\r\n\r\nexport interface FeatureSplitItem {\r\n /** Iconify icon name, e.g. `mdi:check`. */\r\n icon?: string;\r\n title: string;\r\n /** Markdown. */\r\n description: string;\r\n}\r\n\r\nexport type FeatureSplitImagePosition = 'left' | 'right' | 'top';\r\n\r\n/** A title/markdown-subtitle/feature-list block beside (or under) an image. */\r\n@customElement('st-feature-split')\r\nexport class FeatureSplit extends LitElement {\r\n static styles = css`\r\n ${controlBaseStyles}\r\n\r\n :host {\r\n display: block;\r\n padding: var(--st-space-24);\r\n background: var(--st-color-page);\r\n ${fontFamilyStyles}\r\n }\r\n\r\n :host([inverted]) {\r\n background: var(--st-color-text-strong);\r\n }\r\n\r\n .container {\r\n max-width: var(--st-cms-container-max);\r\n margin: 0 auto;\r\n display: grid;\r\n grid-template-columns: 1fr 1fr;\r\n gap: var(--st-space-48);\r\n align-items: center;\r\n }\r\n\r\n :host([image-position='left']) .container {\r\n direction: rtl;\r\n }\r\n\r\n :host([image-position='left']) .content {\r\n direction: ltr;\r\n }\r\n\r\n :host([image-position='top']) .container {\r\n grid-template-columns: 1fr;\r\n text-align: center;\r\n }\r\n\r\n :host([image-position='top']) .content {\r\n align-items: center;\r\n }\r\n\r\n :host([image-position='top']) .image-wrapper {\r\n order: -1;\r\n max-width: 800px;\r\n margin: 0 auto;\r\n }\r\n\r\n .content {\r\n display: flex;\r\n flex-direction: column;\r\n gap: var(--st-space-32);\r\n }\r\n\r\n .title {\r\n ${sectionTitleStyles}\r\n margin: 0;\r\n }\r\n\r\n .subtitle {\r\n color: var(--st-color-text-muted);\r\n font-size: var(--st-text-base);\r\n line-height: 1.6;\r\n }\r\n\r\n .list {\r\n display: flex;\r\n flex-direction: column;\r\n gap: var(--st-space-24);\r\n margin-top: var(--st-space-16);\r\n }\r\n\r\n .item {\r\n display: flex;\r\n gap: var(--st-space-16);\r\n align-items: flex-start;\r\n text-align: left;\r\n }\r\n\r\n .icon {\r\n ${iconTileStyles}\r\n width: var(--st-space-48);\r\n height: var(--st-space-48);\r\n font-size: 24px;\r\n }\r\n\r\n .item-title {\r\n ${cardTitleStyles}\r\n }\r\n\r\n .item-description {\r\n color: var(--st-color-text-muted);\r\n font-size: var(--st-text-sm);\r\n line-height: 1.5;\r\n }\r\n\r\n .action {\r\n ${ctaButtonStyles}\r\n justify-self: start;\r\n padding: var(--st-space-16);\r\n border-radius: var(--st-radius-lg);\r\n }\r\n\r\n .image-wrapper {\r\n width: 100%;\r\n height: 100%;\r\n min-height: 400px;\r\n border-radius: var(--st-space-24);\r\n overflow: hidden;\r\n box-shadow: 0 20px 40px -12px var(--st-shadow-color-md);\r\n }\r\n\r\n .image {\r\n width: 100%;\r\n height: 100%;\r\n object-fit: cover;\r\n transition: transform 0.5s ease;\r\n }\r\n\r\n .image:hover {\r\n transform: scale(1.02);\r\n }\r\n\r\n :host([inverted]) .title,\r\n :host([inverted]) .item-title {\r\n color: var(--st-color-on-solid);\r\n }\r\n\r\n :host([inverted]) .subtitle,\r\n :host([inverted]) .item-description {\r\n color: var(--st-color-border);\r\n }\r\n\r\n :host([inverted]) .icon {\r\n background: var(--st-color-text);\r\n color: var(--st-color-border);\r\n }\r\n\r\n @media (max-width: 1024px) {\r\n .container {\r\n gap: var(--st-space-40);\r\n }\r\n }\r\n\r\n @media (max-width: 768px) {\r\n :host {\r\n padding: var(--st-space-48) var(--st-space-24);\r\n }\r\n\r\n .container {\r\n grid-template-columns: 1fr;\r\n direction: ltr !important;\r\n }\r\n\r\n .image-wrapper {\r\n min-height: 300px;\r\n order: -1;\r\n }\r\n }\r\n\r\n ${reducedMotionStyles}\r\n `;\r\n\r\n @property({ type: Boolean, reflect: true })\r\n inverted = false;\r\n\r\n @property({ type: String })\r\n title = '';\r\n\r\n /** Markdown. */\r\n @property({ type: String })\r\n subtitle = '';\r\n\r\n @property({ attribute: false })\r\n items: FeatureSplitItem[] = [];\r\n\r\n @property({ type: String, attribute: 'image-src' })\r\n imageSrc = '';\r\n\r\n @property({ type: String, attribute: 'image-alt' })\r\n imageAlt = '';\r\n\r\n @property({ type: String, attribute: 'image-position', reflect: true })\r\n imagePosition: FeatureSplitImagePosition = 'right';\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 private onAction() {\r\n const event = new CustomEvent<FeatureSplitActionEventDetail>('feature-split-action', {\r\n detail: { href: this.href },\r\n bubbles: true,\r\n composed: true,\r\n cancelable: true,\r\n });\r\n if (this.dispatchEvent(event)) window.location.href = this.href;\r\n }\r\n\r\n render() {\r\n return html`\r\n <div class=\"container\" part=\"container\">\r\n <div class=\"content\" part=\"content\">\r\n <h2 class=\"title\" part=\"title\">${this.title}</h2>\r\n ${this.subtitle\r\n ? html`<div class=\"subtitle\" part=\"subtitle\"><st-markdown .content=${this.subtitle}></st-markdown></div>`\r\n : nothing}\r\n ${this.items.length > 0\r\n ? html`<div class=\"list\" part=\"list\">\r\n ${this.items.map(\r\n (item) => html`\r\n <div class=\"item\" part=\"item\">\r\n ${item.icon\r\n ? html`<div class=\"icon\" part=\"icon\"><iconify-icon icon=${item.icon}></iconify-icon></div>`\r\n : nothing}\r\n <div>\r\n <h3 class=\"item-title\" part=\"item-title\">${item.title}</h3>\r\n <div class=\"item-description\" part=\"item-description\">\r\n <st-markdown .content=${item.description}></st-markdown>\r\n </div>\r\n </div>\r\n </div>\r\n `,\r\n )}\r\n </div>`\r\n : nothing}\r\n ${this.actionLabel && this.href\r\n ? html`<button class=\"action\" part=\"action\" type=\"button\" @click=${this.onAction}>${this.actionLabel}</button>`\r\n : nothing}\r\n </div>\r\n <div class=\"image-wrapper\" part=\"image-wrapper\">\r\n <img class=\"image\" part=\"image\" src=${this.imageSrc} alt=${this.imageAlt || this.title} />\r\n </div>\r\n </div>\r\n `;\r\n }\r\n}\r\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,SAAS,YAAY,KAAK,MAAM,eAAe;AAC/C,SAAS,eAAe,gBAAgB;AACxC,OAAO;AAwBA,IAAM,eAAN,cAA2B,WAAW;AAAA,EAAtC;AAAA;AAmKL,oBAAW;AAGX,iBAAQ;AAIR,oBAAW;AAGX,iBAA4B,CAAC;AAG7B,oBAAW;AAGX,oBAAW;AAGX,yBAA2C;AAG3C,uBAAc;AAGd,gBAAO;AAAA;AAAA,EAEC,WAAW;AACjB,UAAM,QAAQ,IAAI,YAA2C,wBAAwB;AAAA,MACnF,QAAQ,EAAE,MAAM,KAAK,KAAK;AAAA,MAC1B,SAAS;AAAA,MACT,UAAU;AAAA,MACV,YAAY;AAAA,IACd,CAAC;AACD,QAAI,KAAK,cAAc,KAAK,EAAG,QAAO,SAAS,OAAO,KAAK;AAAA,EAC7D;AAAA,EAEA,SAAS;AACP,WAAO;AAAA;AAAA;AAAA,2CAGgC,KA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