@mintplayer/web-components 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/card/index.mjs ADDED
@@ -0,0 +1,454 @@
1
+ import { html as b, unsafeCSS as m } from "lit";
2
+ b`<!-- Light-DOM family — children stay where the consumer puts them.
3
+ This file exists so codegen-wc emits a \`styles\` constant from the sibling
4
+ .scss; the \`template\` export is intentionally unused (mp-card injects the
5
+ compiled CSS into document.head once on first connection). -->`;
6
+ const p = m(`.card {
7
+ --bs-card-spacer-y: 1rem;
8
+ --bs-card-spacer-x: 1rem;
9
+ --bs-card-title-spacer-y: 0.5rem;
10
+ --bs-card-title-color: ;
11
+ --bs-card-subtitle-color: ;
12
+ --bs-card-border-width: var(--bs-border-width);
13
+ --bs-card-border-color: var(--bs-border-color-translucent);
14
+ --bs-card-border-radius: var(--bs-border-radius);
15
+ --bs-card-box-shadow: ;
16
+ --bs-card-inner-border-radius: calc(var(--bs-border-radius) - (var(--bs-border-width)));
17
+ --bs-card-cap-padding-y: 0.5rem;
18
+ --bs-card-cap-padding-x: 1rem;
19
+ --bs-card-cap-bg: rgba(var(--bs-body-color-rgb), 0.03);
20
+ --bs-card-cap-color: ;
21
+ --bs-card-height: ;
22
+ --bs-card-color: ;
23
+ --bs-card-bg: var(--bs-body-bg);
24
+ --bs-card-img-overlay-padding: 1rem;
25
+ --bs-card-group-margin: 0.75rem;
26
+ position: relative;
27
+ display: flex;
28
+ flex-direction: column;
29
+ min-width: 0;
30
+ height: var(--bs-card-height);
31
+ color: var(--bs-body-color);
32
+ word-wrap: break-word;
33
+ background-color: var(--bs-card-bg);
34
+ background-clip: border-box;
35
+ border: var(--bs-card-border-width) solid var(--bs-card-border-color);
36
+ border-radius: var(--bs-card-border-radius);
37
+ }
38
+ .card > hr {
39
+ margin-right: 0;
40
+ margin-left: 0;
41
+ }
42
+ .card > .list-group {
43
+ border-top: inherit;
44
+ border-bottom: inherit;
45
+ }
46
+ .card > .list-group:first-child {
47
+ border-top-width: 0;
48
+ border-top-left-radius: var(--bs-card-inner-border-radius);
49
+ border-top-right-radius: var(--bs-card-inner-border-radius);
50
+ }
51
+ .card > .list-group:last-child {
52
+ border-bottom-width: 0;
53
+ border-bottom-right-radius: var(--bs-card-inner-border-radius);
54
+ border-bottom-left-radius: var(--bs-card-inner-border-radius);
55
+ }
56
+ .card > .card-header + .list-group,
57
+ .card > .list-group + .card-footer {
58
+ border-top: 0;
59
+ }
60
+
61
+ .card-body {
62
+ flex: 1 1 auto;
63
+ padding: var(--bs-card-spacer-y) var(--bs-card-spacer-x);
64
+ color: var(--bs-card-color);
65
+ }
66
+
67
+ .card-title {
68
+ margin-bottom: var(--bs-card-title-spacer-y);
69
+ color: var(--bs-card-title-color);
70
+ }
71
+
72
+ .card-subtitle {
73
+ margin-top: calc(-0.5 * var(--bs-card-title-spacer-y));
74
+ margin-bottom: 0;
75
+ color: var(--bs-card-subtitle-color);
76
+ }
77
+
78
+ .card-text:last-child {
79
+ margin-bottom: 0;
80
+ }
81
+
82
+ .card-link + .card-link {
83
+ margin-left: var(--bs-card-spacer-x);
84
+ }
85
+
86
+ .card-header {
87
+ padding: var(--bs-card-cap-padding-y) var(--bs-card-cap-padding-x);
88
+ margin-bottom: 0;
89
+ color: var(--bs-card-cap-color);
90
+ background-color: var(--bs-card-cap-bg);
91
+ border-bottom: var(--bs-card-border-width) solid var(--bs-card-border-color);
92
+ }
93
+ .card-header:first-child {
94
+ border-radius: var(--bs-card-inner-border-radius) var(--bs-card-inner-border-radius) 0 0;
95
+ }
96
+
97
+ .card-footer {
98
+ padding: var(--bs-card-cap-padding-y) var(--bs-card-cap-padding-x);
99
+ color: var(--bs-card-cap-color);
100
+ background-color: var(--bs-card-cap-bg);
101
+ border-top: var(--bs-card-border-width) solid var(--bs-card-border-color);
102
+ }
103
+ .card-footer:last-child {
104
+ border-radius: 0 0 var(--bs-card-inner-border-radius) var(--bs-card-inner-border-radius);
105
+ }
106
+
107
+ .card-header-tabs {
108
+ margin-right: calc(-0.5 * var(--bs-card-cap-padding-x));
109
+ margin-bottom: calc(-1 * var(--bs-card-cap-padding-y));
110
+ margin-left: calc(-0.5 * var(--bs-card-cap-padding-x));
111
+ border-bottom: 0;
112
+ }
113
+ .card-header-tabs .nav-link.active {
114
+ background-color: var(--bs-card-bg);
115
+ border-bottom-color: var(--bs-card-bg);
116
+ }
117
+
118
+ .card-header-pills {
119
+ margin-right: calc(-0.5 * var(--bs-card-cap-padding-x));
120
+ margin-left: calc(-0.5 * var(--bs-card-cap-padding-x));
121
+ }
122
+
123
+ .card-img-overlay {
124
+ position: absolute;
125
+ top: 0;
126
+ right: 0;
127
+ bottom: 0;
128
+ left: 0;
129
+ padding: var(--bs-card-img-overlay-padding);
130
+ border-radius: var(--bs-card-inner-border-radius);
131
+ }
132
+
133
+ .card-img,
134
+ .card-img-top,
135
+ .card-img-bottom {
136
+ width: 100%;
137
+ }
138
+
139
+ .card-img,
140
+ .card-img-top {
141
+ border-top-left-radius: var(--bs-card-inner-border-radius);
142
+ border-top-right-radius: var(--bs-card-inner-border-radius);
143
+ }
144
+
145
+ .card-img,
146
+ .card-img-bottom {
147
+ border-bottom-right-radius: var(--bs-card-inner-border-radius);
148
+ border-bottom-left-radius: var(--bs-card-inner-border-radius);
149
+ }
150
+
151
+ .card-group > .card {
152
+ margin-bottom: var(--bs-card-group-margin);
153
+ }
154
+ @media (min-width: 576px) {
155
+ .card-group {
156
+ display: flex;
157
+ flex-flow: row wrap;
158
+ }
159
+ .card-group > .card {
160
+ flex: 1 0 0;
161
+ margin-bottom: 0;
162
+ }
163
+ .card-group > .card + .card {
164
+ margin-left: 0;
165
+ border-left: 0;
166
+ }
167
+ .card-group > .card:not(:last-child) {
168
+ border-top-right-radius: 0;
169
+ border-bottom-right-radius: 0;
170
+ }
171
+ .card-group > .card:not(:last-child) > .card-img-top,
172
+ .card-group > .card:not(:last-child) > .card-header {
173
+ border-top-right-radius: 0;
174
+ }
175
+ .card-group > .card:not(:last-child) > .card-img-bottom,
176
+ .card-group > .card:not(:last-child) > .card-footer {
177
+ border-bottom-right-radius: 0;
178
+ }
179
+ .card-group > .card:not(:first-child) {
180
+ border-top-left-radius: 0;
181
+ border-bottom-left-radius: 0;
182
+ }
183
+ .card-group > .card:not(:first-child) > .card-img-top,
184
+ .card-group > .card:not(:first-child) > .card-header {
185
+ border-top-left-radius: 0;
186
+ }
187
+ .card-group > .card:not(:first-child) > .card-img-bottom,
188
+ .card-group > .card:not(:first-child) > .card-footer {
189
+ border-bottom-left-radius: 0;
190
+ }
191
+ }
192
+
193
+ mp-card,
194
+ mp-card-header,
195
+ mp-card-body,
196
+ mp-card-footer,
197
+ mp-card-img,
198
+ mp-card-group,
199
+ bs-card,
200
+ bs-card-header,
201
+ bs-card-body,
202
+ bs-card-footer,
203
+ bs-card-img,
204
+ bs-card-group {
205
+ display: block;
206
+ }
207
+
208
+ mp-card-title,
209
+ mp-card-subtitle,
210
+ mp-card-text,
211
+ bs-card-title,
212
+ bs-card-subtitle,
213
+ bs-card-text {
214
+ display: block;
215
+ }
216
+
217
+ mp-card-link,
218
+ bs-card-link {
219
+ display: inline;
220
+ }
221
+
222
+ mp-card-img.card-img-top,
223
+ mp-card-img.card-img-bottom,
224
+ mp-card-img.card-img,
225
+ bs-card-img.card-img-top,
226
+ bs-card-img.card-img-bottom,
227
+ bs-card-img.card-img {
228
+ overflow: hidden;
229
+ }
230
+
231
+ mp-card-link + mp-card-link > .card-link,
232
+ bs-card-link + bs-card-link > .card-link {
233
+ margin-left: var(--bs-card-spacer-x);
234
+ }
235
+
236
+ .text-bg-body {
237
+ color: var(--bs-body-color);
238
+ background-color: var(--bs-body-bg);
239
+ }
240
+
241
+ .text-bg-white {
242
+ color: #000;
243
+ background-color: #fff;
244
+ }
245
+
246
+ .text-bg-transparent {
247
+ color: inherit;
248
+ background-color: transparent;
249
+ }`), u = [
250
+ "primary",
251
+ "secondary",
252
+ "success",
253
+ "danger",
254
+ "warning",
255
+ "info",
256
+ "light",
257
+ "dark",
258
+ "body",
259
+ "white",
260
+ "transparent"
261
+ ];
262
+ function l(t) {
263
+ return t != null && u.includes(t);
264
+ }
265
+ function s(t, r) {
266
+ const e = Array.from(t.classList);
267
+ for (const a of e)
268
+ a.startsWith(r) && t.classList.remove(a);
269
+ }
270
+ function g(t, r, e) {
271
+ s(t, "text-bg-"), s(t, "border-"), t.classList.remove("border", "bg-transparent"), l(r) && (e ? t.classList.add("border", `border-${r}`, "bg-transparent") : t.classList.add(`text-bg-${r}`));
272
+ }
273
+ function o(t, r) {
274
+ s(t, "text-bg-"), l(r) && t.classList.add(`text-bg-${r}`);
275
+ }
276
+ function h(t, r) {
277
+ const e = t.querySelector("nav, ul, .nav");
278
+ e && (e.classList.remove("card-header-tabs", "card-header-pills"), r === "tabs" ? e.classList.add("card-header-tabs") : r === "pills" && e.classList.add("card-header-pills"));
279
+ }
280
+ function f(t) {
281
+ return t instanceof Element ? t.tagName === "NAV" || t.tagName === "UL" || t.classList.contains("nav") : !1;
282
+ }
283
+ class v extends HTMLElement {
284
+ static get observedAttributes() {
285
+ return ["color", "outline"];
286
+ }
287
+ connectedCallback() {
288
+ y(), this.classList.add("card"), this.applyColor();
289
+ }
290
+ attributeChangedCallback(r, e, a) {
291
+ (r === "color" || r === "outline") && this.applyColor();
292
+ }
293
+ applyColor() {
294
+ const r = this.getAttribute("color"), e = this.hasAttribute("outline") && this.getAttribute("outline") !== "false";
295
+ g(this, r, e);
296
+ }
297
+ }
298
+ let i = !1;
299
+ function y() {
300
+ if (i || typeof document > "u") return;
301
+ i = !0;
302
+ const t = document.createElement("style");
303
+ t.setAttribute("data-mp-card", ""), t.textContent = String(p), document.head.appendChild(t);
304
+ }
305
+ typeof customElements < "u" && !customElements.get("mp-card") && customElements.define("mp-card", v);
306
+ class C extends HTMLElement {
307
+ connectedCallback() {
308
+ this.classList.add("card-body");
309
+ }
310
+ }
311
+ typeof customElements < "u" && !customElements.get("mp-card-body") && customElements.define("mp-card-body", C);
312
+ class E extends HTMLElement {
313
+ static get observedAttributes() {
314
+ return ["color"];
315
+ }
316
+ connectedCallback() {
317
+ this.classList.add("card-footer"), o(this, this.getAttribute("color"));
318
+ }
319
+ attributeChangedCallback(r, e, a) {
320
+ r === "color" && o(this, this.getAttribute("color"));
321
+ }
322
+ }
323
+ typeof customElements < "u" && !customElements.get("mp-card-footer") && customElements.define("mp-card-footer", E);
324
+ class x extends HTMLElement {
325
+ connectedCallback() {
326
+ this.classList.add("card-group");
327
+ }
328
+ }
329
+ typeof customElements < "u" && !customElements.get("mp-card-group") && customElements.define("mp-card-group", x);
330
+ class k extends HTMLElement {
331
+ constructor() {
332
+ super(...arguments), this.mutationObserver = null;
333
+ }
334
+ static get observedAttributes() {
335
+ return ["color", "nav-style"];
336
+ }
337
+ connectedCallback() {
338
+ this.classList.add("card-header"), this.applyColor(), this.applyNavStyle(), this.mutationObserver = new MutationObserver((r) => {
339
+ r.some(
340
+ (a) => [...Array.from(a.addedNodes), ...Array.from(a.removedNodes)].some(f)
341
+ ) && this.applyNavStyle();
342
+ }), this.mutationObserver.observe(this, { childList: !0, subtree: !1 });
343
+ }
344
+ disconnectedCallback() {
345
+ this.mutationObserver?.disconnect(), this.mutationObserver = null;
346
+ }
347
+ attributeChangedCallback(r, e, a) {
348
+ r === "color" && this.applyColor(), r === "nav-style" && this.applyNavStyle();
349
+ }
350
+ applyColor() {
351
+ o(this, this.getAttribute("color"));
352
+ }
353
+ applyNavStyle() {
354
+ const r = this.getAttribute("nav-style");
355
+ h(this, r === "tabs" || r === "pills" ? r : null);
356
+ }
357
+ }
358
+ typeof customElements < "u" && !customElements.get("mp-card-header") && customElements.define("mp-card-header", k);
359
+ class L extends HTMLElement {
360
+ constructor() {
361
+ super(...arguments), this.imgEl = null;
362
+ }
363
+ static get observedAttributes() {
364
+ return ["src", "alt", "position"];
365
+ }
366
+ connectedCallback() {
367
+ if (this.imgEl) return;
368
+ const r = this.getAttribute("position") ?? "top", e = r === "top" ? "card-img-top" : r === "bottom" ? "card-img-bottom" : "card-img";
369
+ this.classList.add(e);
370
+ const a = document.createElement("img");
371
+ if (a.className = e, this.applyImgAttrs(a), this.imgEl = a, r === "overlay") {
372
+ const c = [];
373
+ for (; this.firstChild; ) c.push(this.removeChild(this.firstChild));
374
+ const d = document.createElement("div");
375
+ d.className = "card-img-overlay";
376
+ for (const n of c) d.appendChild(n);
377
+ this.appendChild(a), this.appendChild(d);
378
+ } else r === "bottom" ? this.appendChild(a) : this.insertBefore(a, this.firstChild);
379
+ }
380
+ attributeChangedCallback(r, e, a) {
381
+ this.imgEl && ((r === "src" || r === "alt") && this.applyImgAttrs(this.imgEl), r === "position" && console.warn(
382
+ "[mp-card-img] `position` is set at connect time and cannot be changed afterwards. Recreate the element to switch positions."
383
+ ));
384
+ }
385
+ applyImgAttrs(r) {
386
+ const e = this.getAttribute("src");
387
+ e === null ? r.removeAttribute("src") : r.setAttribute("src", e);
388
+ const a = this.getAttribute("alt");
389
+ a === null ? r.removeAttribute("alt") : r.setAttribute("alt", a);
390
+ }
391
+ }
392
+ typeof customElements < "u" && !customElements.get("mp-card-img") && customElements.define("mp-card-img", L);
393
+ class A extends HTMLElement {
394
+ constructor() {
395
+ super(...arguments), this.anchor = null;
396
+ }
397
+ static get observedAttributes() {
398
+ return ["href"];
399
+ }
400
+ connectedCallback() {
401
+ if (this.anchor) return;
402
+ const r = document.createElement("a");
403
+ for (r.className = "card-link"; this.firstChild; )
404
+ r.appendChild(this.firstChild);
405
+ this.appendChild(r), this.anchor = r, this.applyHref();
406
+ }
407
+ attributeChangedCallback(r, e, a) {
408
+ r === "href" && this.applyHref();
409
+ }
410
+ applyHref() {
411
+ if (!this.anchor) return;
412
+ const r = this.getAttribute("href");
413
+ r === null ? this.anchor.removeAttribute("href") : this.anchor.setAttribute("href", r);
414
+ }
415
+ }
416
+ typeof customElements < "u" && !customElements.get("mp-card-link") && customElements.define("mp-card-link", A);
417
+ class w extends HTMLElement {
418
+ connectedCallback() {
419
+ this.classList.add("card-subtitle");
420
+ }
421
+ }
422
+ typeof customElements < "u" && !customElements.get("mp-card-subtitle") && customElements.define("mp-card-subtitle", w);
423
+ class M extends HTMLElement {
424
+ connectedCallback() {
425
+ this.classList.add("card-text");
426
+ }
427
+ }
428
+ typeof customElements < "u" && !customElements.get("mp-card-text") && customElements.define("mp-card-text", M);
429
+ class N extends HTMLElement {
430
+ connectedCallback() {
431
+ this.classList.add("card-title");
432
+ }
433
+ }
434
+ typeof customElements < "u" && !customElements.get("mp-card-title") && customElements.define("mp-card-title", N);
435
+ export {
436
+ u as COLOR_NAMES,
437
+ C as MpCardBodyElement,
438
+ v as MpCardElement,
439
+ E as MpCardFooterElement,
440
+ x as MpCardGroupElement,
441
+ k as MpCardHeaderElement,
442
+ L as MpCardImgElement,
443
+ A as MpCardLinkElement,
444
+ w as MpCardSubtitleElement,
445
+ M as MpCardTextElement,
446
+ N as MpCardTitleElement,
447
+ g as applyCardColorClasses,
448
+ h as applyHeaderNavStyle,
449
+ o as applyTextBgClass,
450
+ s as clearPrefixedClasses,
451
+ y as ensureCardStylesInjected,
452
+ l as isCardColorName,
453
+ f as isNavTargetNode
454
+ };
@@ -0,0 +1,40 @@
1
+ export declare const COLOR_NAMES: readonly ["primary", "secondary", "success", "danger", "warning", "info", "light", "dark", "body", "white", "transparent"];
2
+ export type CardColorName = (typeof COLOR_NAMES)[number];
3
+ export declare function isCardColorName(value: string | null | undefined): value is CardColorName;
4
+ /**
5
+ * Remove every class on `el` whose name starts with `prefix` (e.g.
6
+ * `text-bg-`, `border-`). Used to clear a previous colour selection before
7
+ * applying the new one.
8
+ */
9
+ export declare function clearPrefixedClasses(el: HTMLElement, prefix: string): void;
10
+ /**
11
+ * Apply the card root's colour contract to an element: `text-bg-<name>` for
12
+ * the filled variant, or `border border-<name> bg-transparent` for outline.
13
+ * Used by both `mp-card` and the Angular `bs-card` wrapper so both layers
14
+ * stay byte-identical without each duplicating the bootstrap-utility logic.
15
+ */
16
+ export declare function applyCardColorClasses(el: HTMLElement, color: string | null, outline: boolean): void;
17
+ /**
18
+ * Apply the `text-bg-<name>` background to `el`, clearing any prior value.
19
+ * Used by the header / footer Bootstrap-classed regions, which don't have an
20
+ * outline mode upstream.
21
+ */
22
+ export declare function applyTextBgClass(el: HTMLElement, color: string | null): void;
23
+ /**
24
+ * Apply `card-header-tabs` or `card-header-pills` to the first slotted
25
+ * `nav` / `ul` / `.nav` inside `host`. The header element observes child
26
+ * changes and re-invokes this on mutation, so a nav inserted lazily (e.g.
27
+ * via an Angular `@if`) still receives the right class.
28
+ *
29
+ * The `.nav` selector covers Bootstrap's `<div class="nav">` and
30
+ * `<span class="nav">` forms, where the tag is incidental and the `nav`
31
+ * class carries the semantics.
32
+ */
33
+ export declare function applyHeaderNavStyle(host: HTMLElement, style: 'tabs' | 'pills' | null): void;
34
+ /**
35
+ * True if any of `nodes` is an Element that would qualify as a slotted
36
+ * nav target (`nav` / `ul` tag, or anything carrying the `nav` class).
37
+ * Used by the header's MutationObserver to skip the full re-walk when the
38
+ * mutation only touches non-nav content.
39
+ */
40
+ export declare function isNavTargetNode(node: Node): boolean;
@@ -0,0 +1,13 @@
1
+ export * from './mp-card.element';
2
+ export * from './mp-card-body.element';
3
+ export * from './mp-card-footer.element';
4
+ export * from './mp-card-group.element';
5
+ export * from './mp-card-header.element';
6
+ export * from './mp-card-img.element';
7
+ export * from './mp-card-link.element';
8
+ export * from './mp-card-subtitle.element';
9
+ export * from './mp-card-text.element';
10
+ export * from './mp-card-title.element';
11
+ export * from './card-classes';
12
+ export * from './types/card-image-position';
13
+ export * from './types/card-header-nav-style';
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Card body. Pure structural wrapper — adds `card-body` to itself so
3
+ * Bootstrap's body padding / flex layout apply.
4
+ */
5
+ export declare class MpCardBodyElement extends HTMLElement {
6
+ connectedCallback(): void;
7
+ }
8
+ declare global {
9
+ interface HTMLElementTagNameMap {
10
+ 'mp-card-body': MpCardBodyElement;
11
+ }
12
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Card footer. Mirrors `mp-card-header`'s colour handling; no nav-style
3
+ * variant exists at this position upstream in Bootstrap.
4
+ */
5
+ export declare class MpCardFooterElement extends HTMLElement {
6
+ static get observedAttributes(): string[];
7
+ connectedCallback(): void;
8
+ attributeChangedCallback(name: string, _old: string | null, _next: string | null): void;
9
+ }
10
+ declare global {
11
+ interface HTMLElementTagNameMap {
12
+ 'mp-card-footer': MpCardFooterElement;
13
+ }
14
+ }
@@ -0,0 +1,9 @@
1
+ /** Card group — Bootstrap's connected-card layout primitive. */
2
+ export declare class MpCardGroupElement extends HTMLElement {
3
+ connectedCallback(): void;
4
+ }
5
+ declare global {
6
+ interface HTMLElementTagNameMap {
7
+ 'mp-card-group': MpCardGroupElement;
8
+ }
9
+ }
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Card header. Slotted content stays in light DOM; this element only adds
3
+ * Bootstrap classes to itself and (when `nav-style` is set) to a nested
4
+ * `nav` or `ul` so `card-header-tabs` / `card-header-pills` styling applies.
5
+ *
6
+ * Attributes:
7
+ * - `color` — Bootstrap colour name, maps to `text-bg-<name>`.
8
+ * - `nav-style` — `'tabs'` or `'pills'`. Adds the matching `card-header-*`
9
+ * class to the first slotted `nav` / `ul`.
10
+ */
11
+ export declare class MpCardHeaderElement extends HTMLElement {
12
+ static get observedAttributes(): string[];
13
+ private mutationObserver;
14
+ connectedCallback(): void;
15
+ disconnectedCallback(): void;
16
+ attributeChangedCallback(name: string, _old: string | null, _next: string | null): void;
17
+ private applyColor;
18
+ private applyNavStyle;
19
+ }
20
+ declare global {
21
+ interface HTMLElementTagNameMap {
22
+ 'mp-card-header': MpCardHeaderElement;
23
+ }
24
+ }
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Card image. Switches between three Bootstrap positions:
3
+ * - `position="top"` → host gets `card-img-top`, inner `<img>` too
4
+ * - `position="bottom"` → host gets `card-img-bottom`, inner `<img>` too
5
+ * - `position="overlay"` → host gets `card-img`, inner `<img>` too, AND
6
+ * slotted children get wrapped in `<div class="card-img-overlay">`
7
+ *
8
+ * The class is duplicated on both host and inner img so that Bootstrap's
9
+ * `.card-group > .card > .card-img-top` corner-rounding selector matches
10
+ * (host is the direct child of `.card`) AND `.card-img-top { width: 100% }`
11
+ * sizes the actual `<img>` element. Pair with `overflow: hidden` on the
12
+ * host in `mp-card.element.scss` so the host's border-radius clips the img.
13
+ *
14
+ * Position is read once on connection — changes after first render are not
15
+ * supported. `src` and `alt` are reactive.
16
+ */
17
+ export declare class MpCardImgElement extends HTMLElement {
18
+ static get observedAttributes(): string[];
19
+ private imgEl;
20
+ connectedCallback(): void;
21
+ attributeChangedCallback(name: string, _old: string | null, _next: string | null): void;
22
+ private applyImgAttrs;
23
+ }
24
+ declare global {
25
+ interface HTMLElementTagNameMap {
26
+ 'mp-card-img': MpCardImgElement;
27
+ }
28
+ }
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Card link — wraps slotted text content in an `<a class="card-link">`.
3
+ *
4
+ * The actual `<a>` is the styled element (Bootstrap targets `.card-link`).
5
+ * Bootstrap's adjacency rule `.card-link + .card-link { margin-left: ... }`
6
+ * does not match across wrapper boundaries; we compensate with a sibling
7
+ * selector on `mp-card-link + mp-card-link > .card-link` in
8
+ * `mp-card.element.scss`.
9
+ *
10
+ * Attributes:
11
+ * - `href` — forwarded to the inner `<a>`.
12
+ */
13
+ export declare class MpCardLinkElement extends HTMLElement {
14
+ static get observedAttributes(): string[];
15
+ private anchor;
16
+ connectedCallback(): void;
17
+ attributeChangedCallback(name: string, _old: string | null, _next: string | null): void;
18
+ private applyHref;
19
+ }
20
+ declare global {
21
+ interface HTMLElementTagNameMap {
22
+ 'mp-card-link': MpCardLinkElement;
23
+ }
24
+ }
@@ -0,0 +1,9 @@
1
+ /** Card subtitle — adds `card-subtitle`. */
2
+ export declare class MpCardSubtitleElement extends HTMLElement {
3
+ connectedCallback(): void;
4
+ }
5
+ declare global {
6
+ interface HTMLElementTagNameMap {
7
+ 'mp-card-subtitle': MpCardSubtitleElement;
8
+ }
9
+ }
@@ -0,0 +1,9 @@
1
+ /** Card text — adds `card-text` for Bootstrap's last-child margin reset. */
2
+ export declare class MpCardTextElement extends HTMLElement {
3
+ connectedCallback(): void;
4
+ }
5
+ declare global {
6
+ interface HTMLElementTagNameMap {
7
+ 'mp-card-text': MpCardTextElement;
8
+ }
9
+ }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Card title — adds `card-title` for Bootstrap's title spacing/colour vars.
3
+ * Render as a heading in the consuming app if heading semantics matter; the
4
+ * WC stays element-agnostic to avoid forcing an h-level.
5
+ */
6
+ export declare class MpCardTitleElement extends HTMLElement {
7
+ connectedCallback(): void;
8
+ }
9
+ declare global {
10
+ interface HTMLElementTagNameMap {
11
+ 'mp-card-title': MpCardTitleElement;
12
+ }
13
+ }