agnosticui-core 2.0.0-alpha.13 → 2.0.0-alpha.15

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.
@@ -2,6 +2,7 @@ import { LitElement } from 'lit';
2
2
 
3
3
  export type CardVariant = 'success' | 'info' | 'error' | 'warning' | 'monochrome' | '';
4
4
  export type CardRounded = 'sm' | 'md' | 'lg' | '';
5
+ export type CardMediaPosition = 'top' | 'bottom';
5
6
  export interface CardProps {
6
7
  stacked?: boolean;
7
8
  shadow?: boolean;
@@ -9,6 +10,10 @@ export interface CardProps {
9
10
  /** Border radius size. Use 'sm', 'md', 'lg' or true (defaults to 'md') */
10
11
  rounded?: CardRounded | boolean;
11
12
  variant?: CardVariant;
13
+ /** Enables the media slot for edge-to-edge image/video rendering */
14
+ hasMedia?: boolean;
15
+ /** Whether media renders above or below the header/content/footer */
16
+ mediaPosition?: CardMediaPosition;
12
17
  }
13
18
  export declare class AgCard extends LitElement implements CardProps {
14
19
  stacked: boolean;
@@ -16,6 +21,8 @@ export declare class AgCard extends LitElement implements CardProps {
16
21
  animated: boolean;
17
22
  rounded: CardRounded;
18
23
  variant: CardVariant;
24
+ hasMedia: boolean;
25
+ mediaPosition: CardMediaPosition;
19
26
  private _hasHeaderSlotContent;
20
27
  private _hasFooterSlotContent;
21
28
  constructor();
@@ -1 +1 @@
1
- {"version":3,"file":"_Card.d.ts","sourceRoot":"","sources":["../../../../src/components/Card/core/_Card.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAI5C,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,YAAY,GAAG,EAAE,CAAC;AACvF,MAAM,MAAM,WAAW,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,EAAE,CAAC;AAkBlD,MAAM,WAAW,SAAS;IACxB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB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EAAE,iBAAiB,CAAC;CACnC;AAED,qBAAa,MAAO,SAAQ,UAAW,YAAW,SAAS;IACL,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;IACJ,OAAO,EAAE,WAAW,CAAC;IACpC,OAAO,EAAE,WAAW,CAAC;IACI,QAAQ,EAAE,OAAO,CAAC;IACd,aAAa,EAAE,iBAAiB,CAAC;IAEjH,OAAO,CAAC,qBAAqB,CAAS;IACtC,OAAO,CAAC,qBAAqB,CAAS;;IAatC;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAahB,YAAY;IAUrB,MAAM,CAAC,MAAM,0BAqKX;IAEF,MAAM;CA4BP"}
@@ -1,51 +1,61 @@
1
- import { LitElement as g, css as p, html as v } from "lit";
2
- import { n as d } from "../../../property-CemaeiRl.js";
3
- import { hasSlotContent as n } from "../../../utils/slot.js";
4
- var m = Object.defineProperty, s = (t, a, r, i) => {
5
- for (var e = void 0, c = t.length - 1, h; c >= 0; c--)
6
- (h = t[c]) && (e = h(a, r, e) || e);
7
- return e && m(a, r, e), e;
1
+ import { LitElement as p, css as u, nothing as g, html as l } from "lit";
2
+ import { n as o } from "../../../property-CemaeiRl.js";
3
+ import { hasSlotContent as i } from "../../../utils/slot.js";
4
+ var v = Object.defineProperty, d = (a, e, t, n) => {
5
+ for (var s = void 0, c = a.length - 1, m; c >= 0; c--)
6
+ (m = a[c]) && (s = m(e, t, s) || s);
7
+ return s && v(e, t, s), s;
8
8
  };
9
- const u = {
10
- fromAttribute(t) {
11
- return t === "" || t === "true" ? "md" : t === "false" || t === null ? "" : t || "";
9
+ const b = {
10
+ fromAttribute(a) {
11
+ return a === "" || a === "true" ? "md" : a === "false" || a === null ? "" : a || "";
12
12
  },
13
- toAttribute(t) {
14
- return typeof t == "boolean" ? t ? "md" : null : t || null;
13
+ toAttribute(a) {
14
+ return typeof a == "boolean" ? a ? "md" : null : a || null;
15
15
  }
16
- }, l = class l extends g {
16
+ }, h = class h extends p {
17
17
  constructor() {
18
- super(), this._hasHeaderSlotContent = !1, this._hasFooterSlotContent = !1, this.stacked = !1, this.shadow = !1, this.animated = !1, this.rounded = "", this.variant = "";
18
+ super(), this._hasHeaderSlotContent = !1, this._hasFooterSlotContent = !1, this.stacked = !1, this.shadow = !1, this.animated = !1, this.rounded = "", this.variant = "", this.hasMedia = !1, this.mediaPosition = "top";
19
19
  }
20
20
  /**
21
21
  * Handle slot changes to detect if header/footer are empty
22
22
  */
23
- _handleSlotChange(a) {
24
- const r = a.target, i = r.name;
25
- i === "header" ? this._hasHeaderSlotContent = n(r) : i === "footer" && (this._hasFooterSlotContent = n(r)), this.requestUpdate();
23
+ _handleSlotChange(e) {
24
+ const t = e.target, n = t.name;
25
+ n === "header" ? this._hasHeaderSlotContent = i(t) : n === "footer" && (this._hasFooterSlotContent = i(t)), this.requestUpdate();
26
26
  }
27
27
  firstUpdated() {
28
- const a = this.shadowRoot?.querySelector('slot[name="header"]'), r = this.shadowRoot?.querySelector('slot[name="footer"]');
29
- this._hasHeaderSlotContent = n(a), this._hasFooterSlotContent = n(r), this.requestUpdate();
28
+ const e = this.shadowRoot?.querySelector('slot[name="header"]'), t = this.shadowRoot?.querySelector('slot[name="footer"]');
29
+ this._hasHeaderSlotContent = i(e), this._hasFooterSlotContent = i(t), this.requestUpdate();
30
30
  }
31
31
  render() {
32
- const a = this._hasHeaderSlotContent ? "card-header" : "card-header empty", r = this._hasFooterSlotContent ? "card-footer" : "card-footer empty";
33
- return v`
32
+ const e = this._hasHeaderSlotContent ? "card-header" : "card-header empty", t = this._hasFooterSlotContent ? "card-footer" : "card-footer empty";
33
+ return l`
34
34
  <div class="card-wrapper" part="ag-card-wrapper">
35
- <div class="${a}" part="ag-card-header">
35
+ ${this.hasMedia && this.mediaPosition === "top" ? l`
36
+ <div class="card-media card-media--top" part="ag-card-media">
37
+ <slot name="media"></slot>
38
+ </div>` : g}
39
+
40
+ <div class="${e}" part="ag-card-header">
36
41
  <slot name="header" @slotchange=${this._handleSlotChange}></slot>
37
42
  </div>
38
43
  <div class="card-content" part="ag-card-content">
39
44
  <slot></slot>
40
45
  </div>
41
- <div class="${r}" part="ag-card-footer">
46
+ <div class="${t}" part="ag-card-footer">
42
47
  <slot name="footer" @slotchange=${this._handleSlotChange}></slot>
43
48
  </div>
49
+
50
+ ${this.hasMedia && this.mediaPosition === "bottom" ? l`
51
+ <div class="card-media card-media--bottom" part="ag-card-media">
52
+ <slot name="media"></slot>
53
+ </div>` : g}
44
54
  </div>
45
55
  `;
46
56
  }
47
57
  };
48
- l.styles = p`
58
+ h.styles = u`
49
59
  :host {
50
60
  display: block;
51
61
  position: relative;
@@ -179,23 +189,60 @@ l.styles = p`
179
189
  position: relative;
180
190
  z-index: 2;
181
191
  }
192
+
193
+ /* ── Media slot ─────────────────────────────────────────────────── */
194
+
195
+ /* Clip image corners to the card's border-radius for non-shadow cards */
196
+ :host([has-media]) {
197
+ overflow: hidden;
198
+ }
199
+
200
+ .card-media {
201
+ overflow: hidden; /* belt-and-suspenders for non-rounded cards */
202
+ line-height: 0; /* collapses inline whitespace below slotted img */
203
+ }
204
+
205
+ /* Top media: clip only the card's top two corners */
206
+ :host([rounded="sm"]) .card-media--top { border-radius: var(--ag-radius-sm) var(--ag-radius-sm) 0 0; }
207
+ :host([rounded="md"]) .card-media--top { border-radius: var(--ag-radius-md) var(--ag-radius-md) 0 0; }
208
+ :host([rounded="lg"]) .card-media--top { border-radius: var(--ag-radius-lg) var(--ag-radius-lg) 0 0; }
209
+
210
+ /* Bottom media: clip only the card's bottom two corners */
211
+ :host([rounded="sm"]) .card-media--bottom { border-radius: 0 0 var(--ag-radius-sm) var(--ag-radius-sm); }
212
+ :host([rounded="md"]) .card-media--bottom { border-radius: 0 0 var(--ag-radius-md) var(--ag-radius-md); }
213
+ :host([rounded="lg"]) .card-media--bottom { border-radius: 0 0 var(--ag-radius-lg) var(--ag-radius-lg); }
214
+
215
+ /* Sensible defaults for slotted media elements */
216
+ .card-media ::slotted(img),
217
+ .card-media ::slotted(video) {
218
+ display: block;
219
+ width: 100%;
220
+ height: auto;
221
+ object-fit: cover;
222
+ }
182
223
  `;
183
- let o = l;
184
- s([
185
- d({ type: Boolean, reflect: !0 })
186
- ], o.prototype, "stacked");
187
- s([
188
- d({ type: Boolean, reflect: !0 })
189
- ], o.prototype, "shadow");
190
- s([
191
- d({ type: Boolean, reflect: !0 })
192
- ], o.prototype, "animated");
193
- s([
194
- d({ converter: u, reflect: !0 })
195
- ], o.prototype, "rounded");
196
- s([
197
- d({ type: String, reflect: !0 })
198
- ], o.prototype, "variant");
224
+ let r = h;
225
+ d([
226
+ o({ type: Boolean, reflect: !0 })
227
+ ], r.prototype, "stacked");
228
+ d([
229
+ o({ type: Boolean, reflect: !0 })
230
+ ], r.prototype, "shadow");
231
+ d([
232
+ o({ type: Boolean, reflect: !0 })
233
+ ], r.prototype, "animated");
234
+ d([
235
+ o({ converter: b, reflect: !0 })
236
+ ], r.prototype, "rounded");
237
+ d([
238
+ o({ type: String, reflect: !0 })
239
+ ], r.prototype, "variant");
240
+ d([
241
+ o({ type: Boolean, reflect: !0, attribute: "has-media" })
242
+ ], r.prototype, "hasMedia");
243
+ d([
244
+ o({ type: String, reflect: !0, attribute: "media-position" })
245
+ ], r.prototype, "mediaPosition");
199
246
  export {
200
- o as AgCard
247
+ r as AgCard
201
248
  };
@@ -1,7 +1,7 @@
1
- import { defineComponent as o, ref as n, onMounted as d, createElementBlock as r, openBlock as s, mergeProps as l, renderSlot as a } from "vue";
1
+ import { defineComponent as t, ref as d, onMounted as n, createElementBlock as s, openBlock as i, mergeProps as r, renderSlot as a } from "vue";
2
2
  import "../core/Card.js";
3
- import { _ as i } from "../../../_plugin-vue_export-helper-CHgC5LLL.js";
4
- const u = o({
3
+ import { _ as l } from "../../../_plugin-vue_export-helper-CHgC5LLL.js";
4
+ const m = t({
5
5
  name: "VueCard",
6
6
  props: {
7
7
  stacked: {
@@ -23,37 +23,50 @@ const u = o({
23
23
  variant: {
24
24
  type: String,
25
25
  default: ""
26
+ },
27
+ hasMedia: {
28
+ type: Boolean,
29
+ default: !1
30
+ },
31
+ mediaPosition: {
32
+ type: String,
33
+ default: "top"
26
34
  }
27
35
  },
28
36
  setup(e) {
29
- const t = n(null);
30
- return d(async () => {
37
+ const o = d(null);
38
+ return n(async () => {
31
39
  await customElements.whenDefined("ag-card");
32
40
  }), {
33
- agComponent: t,
41
+ agComponent: o,
34
42
  stacked: e.stacked,
35
43
  shadow: e.shadow,
36
44
  animated: e.animated,
37
45
  rounded: e.rounded,
38
- variant: e.variant
46
+ variant: e.variant,
47
+ hasMedia: e.hasMedia,
48
+ mediaPosition: e.mediaPosition
39
49
  };
40
50
  }
41
- }), f = [".stacked", ".shadow", ".animated", "rounded", "variant"];
42
- function m(e, t, c, p, h, k) {
43
- return s(), r("ag-card", l({
51
+ }), f = [".stacked", ".shadow", ".animated", "rounded", "variant", ".hasMedia", ".mediaPosition"];
52
+ function u(e, o, h, p, c, $) {
53
+ return i(), s("ag-card", r({
44
54
  ref: "agComponent",
45
55
  ".stacked": e.stacked,
46
56
  ".shadow": e.shadow,
47
57
  ".animated": e.animated,
48
58
  rounded: e.rounded,
49
- variant: e.variant
59
+ variant: e.variant,
60
+ ".hasMedia": e.hasMedia,
61
+ ".mediaPosition": e.mediaPosition
50
62
  }, e.$attrs), [
63
+ a(e.$slots, "media", { slot: "media" }),
51
64
  a(e.$slots, "header", { slot: "header" }),
52
65
  a(e.$slots, "default"),
53
66
  a(e.$slots, "footer", { slot: "footer" })
54
67
  ], 48, f);
55
68
  }
56
- const v = /* @__PURE__ */ i(u, [["render", m]]);
69
+ const y = /* @__PURE__ */ l(m, [["render", u]]);
57
70
  export {
58
- v as default
71
+ y as default
59
72
  };
@@ -1,5 +1,5 @@
1
1
  import { PropType } from 'vue';
2
- import { CardProps, CardVariant, CardRounded } from '../core/Card';
2
+ import { CardProps, CardVariant, CardRounded, CardMediaPosition } from '../core/Card';
3
3
 
4
4
  declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
5
5
  stacked: {
@@ -22,6 +22,14 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
22
22
  type: PropType<CardVariant>;
23
23
  default: CardVariant;
24
24
  };
25
+ hasMedia: {
26
+ type: BooleanConstructor;
27
+ default: boolean;
28
+ };
29
+ mediaPosition: {
30
+ type: PropType<CardMediaPosition>;
31
+ default: CardMediaPosition;
32
+ };
25
33
  }>, {
26
34
  agComponent: import('vue').Ref<(HTMLElement & CardProps) | null, (HTMLElement & CardProps) | null>;
27
35
  stacked: boolean;
@@ -29,6 +37,8 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
29
37
  animated: boolean;
30
38
  rounded: boolean | CardRounded;
31
39
  variant: CardVariant;
40
+ hasMedia: boolean;
41
+ mediaPosition: CardMediaPosition;
32
42
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
33
43
  stacked: {
34
44
  type: BooleanConstructor;
@@ -50,12 +60,22 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
50
60
  type: PropType<CardVariant>;
51
61
  default: CardVariant;
52
62
  };
63
+ hasMedia: {
64
+ type: BooleanConstructor;
65
+ default: boolean;
66
+ };
67
+ mediaPosition: {
68
+ type: PropType<CardMediaPosition>;
69
+ default: CardMediaPosition;
70
+ };
53
71
  }>> & Readonly<{}>, {
54
72
  variant: CardVariant;
55
73
  rounded: boolean | CardRounded;
56
74
  shadow: boolean;
57
75
  stacked: boolean;
58
76
  animated: boolean;
77
+ hasMedia: boolean;
78
+ mediaPosition: CardMediaPosition;
59
79
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
60
80
  export default _default;
61
81
  //# sourceMappingURL=VueCard.vue.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"VueCard.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Card/vue/VueCard.vue"],"names":[],"mappings":"AAqBA;AAEA,OAAO,EAAmC,KAAK,QAAQ,EAAE,MAAM,KAAK,CAAC;AACrE,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACxE,OAAO,cAAc,CAAC;;;;;;;;;;;;;;;cAkBW,QAAQ,CAAC,WAAW,GAAG,OAAO,CAAC;iBAC3C,WAAW;;;cAGV,QAAQ,CAAC,WAAW,CAAC;iBACtB,WAAW;;;;;;;;;;;;;;;;;;;;;;;cALC,QAAQ,CAAC,WAAW,GAAG,OAAO,CAAC;iBAC3C,WAAW;;;cAGV,QAAQ,CAAC,WAAW,CAAC;iBACtB,WAAW;;;;;;;;;AArBhC,wBA6CG"}
1
+ {"version":3,"file":"VueCard.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Card/vue/VueCard.vue"],"names":[],"mappings":"AA2BA;AAEA,OAAO,EAAmC,KAAK,QAAQ,EAAE,MAAM,KAAK,CAAC;AACrE,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAC3F,OAAO,cAAc,CAAC;;;;;;;;;;;;;;;cAkBW,QAAQ,CAAC,WAAW,GAAG,OAAO,CAAC;iBAC3C,WAAW;;;cAGV,QAAQ,CAAC,WAAW,CAAC;iBACtB,WAAW;;;;;;;cAOV,QAAQ,CAAC,iBAAiB,CAAC;iBACzB,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;cAbR,QAAQ,CAAC,WAAW,GAAG,OAAO,CAAC;iBAC3C,WAAW;;;cAGV,QAAQ,CAAC,WAAW,CAAC;iBACtB,WAAW;;;;;;;cAOV,QAAQ,CAAC,iBAAiB,CAAC;iBACzB,iBAAiB;;;;;;;;;;;AA7BzC,wBAuDG"}
@@ -96,7 +96,6 @@ export declare class Pagination extends LitElement implements PaginationProps {
96
96
  onPageChange?: (event: PageChangeEvent) => void;
97
97
  constructor();
98
98
  get _pages(): PageArrayItem[];
99
- updated(changedProperties: Map<string, unknown>): void;
100
99
  private _generatePages;
101
100
  private _getPaddedArray;
102
101
  private _generatePagingPaddedByOne;
@@ -1 +1 @@
1
- {"version":3,"file":"_Pagination.d.ts","sourceRoot":"","sources":["../../../../src/components/Pagination/core/_Pagination.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAG5C,MAAM,MAAM,gBAAgB,GAAG,CAAC,GAAG,CAAC,CAAC;AACrC,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,GAAG,EAAE,CAAC;AAChE,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC;AAClC,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,aAAa,CAAC;AAEnD;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,aAAa,EAAE,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,WAAW,CAAC,qBAAqB,CAAC,CAAC;AAEjE;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B;;OAEG;IACH,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,mBA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,gBAAgB,EAAE,gBAAgB,CAAC;IAGnC,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC;;IAmBxD,IAAI,MAAM,IAAI,aAAa,EAAE,CAE5B;IAED,OAAO,CAAC,cAAc;IAWtB,OAAO,CAAC,eAAe;IAkBvB,OAAO,CAAC,0BAA0B;IAkBlC,OAAO,CAAC,0BAA0B;IA4BlC,OAAO,CAAC,iBAAiB;IAsCzB,OAAO,CAAC,gBAAgB;IAaxB,MAAM,CAAC,MAAM,0BA6GX;IAEF,MAAM;CAsIP"}
@@ -17,14 +17,6 @@ const u = class u extends b {
17
17
  get _pages() {
18
18
  return this._generatePages();
19
19
  }
20
- updated(t) {
21
- (t.has("current") || t.has("totalPages") || t.has("offset")) && this.updateComplete.then(() => {
22
- const i = this.shadowRoot?.querySelector(
23
- `button[data-page="${this.current}"]`
24
- );
25
- i && i.focus();
26
- });
27
- }
28
20
  _generatePages() {
29
21
  return this.totalPages <= 1 ? [1] : this.offset === 1 ? this._generatePagingPaddedByOne(this.current, this.totalPages) : this._generatePagingPaddedByTwo(this.current, this.totalPages);
30
22
  }
@@ -66,7 +58,12 @@ const u = class u extends b {
66
58
  bubbles: !0,
67
59
  composed: !0
68
60
  });
69
- this.dispatchEvent(e), this.onPageChange && this.onPageChange(e);
61
+ this.dispatchEvent(e), this.onPageChange && this.onPageChange(e), this.updateComplete.then(() => {
62
+ const a = this.shadowRoot?.querySelector(
63
+ `button[data-page="${this.current}"]`
64
+ );
65
+ a && a.focus();
66
+ });
70
67
  }
71
68
  _getJustifyClass() {
72
69
  switch (this.justify) {
@@ -140,7 +140,7 @@ c.styles = [
140
140
  /* Base styling */
141
141
  padding: var(--ag-space-2) var(--ag-space-8) var(--ag-space-2) var(--ag-space-3);
142
142
  -moz-padding-start: calc(var(--ag-space-3) - 3px);
143
- font-size: var(--ag-font-size-base);
143
+ font-size: var(--ag-font-size-sm);
144
144
  font-weight: 400;
145
145
  line-height: 1.5;
146
146
  font-family: inherit;
@@ -190,7 +190,7 @@ c.styles = [
190
190
  padding-block-start: var(--ag-space-1);
191
191
  padding-block-end: var(--ag-space-1);
192
192
  padding-inline-start: var(--ag-space-2);
193
- font-size: var(--ag-font-size-small);
193
+ font-size: var(--ag-font-size-sm);
194
194
  }
195
195
 
196
196
  /* Large size variant */
@@ -151,18 +151,18 @@
151
151
  --ag-background-primary-inverted: #1f2328;
152
152
  --ag-background-secondary: #f3f4f6;
153
153
  --ag-background-secondary-inverted: #111827;
154
- --ag-background-tertiary: #e5e7eb;
155
- --ag-background-disabled: #f3f4f6;
156
- --ag-primary-background: #ddf4ff;
157
- --ag-primary-text: #0550ae;
158
- --ag-success-background: #dafbe1;
159
- --ag-success-text: #116329;
160
- --ag-info-background: #f3f4f6;
161
- --ag-info-text: #4b5563;
162
- --ag-warning-background: #fff8c5;
163
- --ag-warning-text: #7d4e00;
164
- --ag-danger-background: #ffebe9;
165
- --ag-danger-text: #a40e26;
154
+ --ag-background-tertiary: #e5e7eb; /** Used by: Button default bg; also secondary button hover bg */
155
+ --ag-background-disabled: #f3f4f6; /** Used by: Button, Input, Checkbox, Radio, Select disabled states */
156
+ --ag-primary-background: #ddf4ff; /** Used by: Alert primary variant bg, Button faint variant bg */
157
+ --ag-primary-text: #0550ae; /** Used by: Alert primary text, Button bordered/outlined text + border */
158
+ --ag-success-background: #dafbe1; /** Used by: Alert success variant bg, Badge success variant bg */
159
+ --ag-success-text: #116329; /** Used by: Alert success variant text, Badge success variant text */
160
+ --ag-info-background: #f3f4f6; /** Used by: Alert info variant bg, Badge info variant bg */
161
+ --ag-info-text: #4b5563; /** Used by: Alert info variant text, Badge info variant text */
162
+ --ag-warning-background: #fff8c5; /** Used by: Alert warning variant bg, Badge warning variant bg */
163
+ --ag-warning-text: #7d4e00; /** Used by: Alert warning variant text, Badge warning variant text */
164
+ --ag-danger-background: #ffebe9; /** Used by: Alert danger variant bg, Badge danger variant bg */
165
+ --ag-danger-text: #a40e26; /** Used by: Alert danger variant text, Badge danger variant text */
166
166
  --ag-primary-fg: #ffffff;
167
167
  --ag-success-fg: #ffffff;
168
168
  --ag-warning-fg: #111827;
@@ -171,7 +171,7 @@
171
171
  --ag-border-subtle: #d1d5db;
172
172
  --ag-primary: #0550ae;
173
173
  --ag-primary-rgb: 5, 80, 174;
174
- --ag-primary-border: #d1d5db;
174
+ --ag-primary-border: #d1d5db; /** Used by: Button bordered variant border */
175
175
  --ag-primary-dark: #0a3069;
176
176
  --ag-secondary: #6b7280;
177
177
  --ag-secondary-dark: #4b5563;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agnosticui-core",
3
- "version": "2.0.0-alpha.13",
3
+ "version": "2.0.0-alpha.15",
4
4
  "author": "AgnosticUI",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -1,9 +1,10 @@
1
- import { LitElement, html, css } from 'lit';
1
+ import { LitElement, html, css, nothing } from 'lit';
2
2
  import { property } from 'lit/decorators.js';
3
3
  import { hasSlotContent } from '../../../utils/slot';
4
4
 
5
5
  export type CardVariant = 'success' | 'info' | 'error' | 'warning' | 'monochrome' | '';
6
6
  export type CardRounded = 'sm' | 'md' | 'lg' | '';
7
+ export type CardMediaPosition = 'top' | 'bottom';
7
8
 
8
9
  /**
9
10
  * Converter for rounded prop: accepts boolean (true -> 'md') or string values
@@ -28,6 +29,10 @@ export interface CardProps {
28
29
  /** Border radius size. Use 'sm', 'md', 'lg' or true (defaults to 'md') */
29
30
  rounded?: CardRounded | boolean;
30
31
  variant?: CardVariant;
32
+ /** Enables the media slot for edge-to-edge image/video rendering */
33
+ hasMedia?: boolean;
34
+ /** Whether media renders above or below the header/content/footer */
35
+ mediaPosition?: CardMediaPosition;
31
36
  }
32
37
 
33
38
  export class AgCard extends LitElement implements CardProps {
@@ -36,6 +41,8 @@ export class AgCard extends LitElement implements CardProps {
36
41
  @property({ type: Boolean, reflect: true }) declare animated: boolean;
37
42
  @property({ converter: roundedConverter, reflect: true }) declare rounded: CardRounded;
38
43
  @property({ type: String, reflect: true }) declare variant: CardVariant;
44
+ @property({ type: Boolean, reflect: true, attribute: 'has-media' }) declare hasMedia: boolean;
45
+ @property({ type: String, reflect: true, attribute: 'media-position' }) declare mediaPosition: CardMediaPosition;
39
46
 
40
47
  private _hasHeaderSlotContent = false;
41
48
  private _hasFooterSlotContent = false;
@@ -47,6 +54,8 @@ export class AgCard extends LitElement implements CardProps {
47
54
  this.animated = false;
48
55
  this.rounded = '';
49
56
  this.variant = '';
57
+ this.hasMedia = false;
58
+ this.mediaPosition = 'top';
50
59
  }
51
60
 
52
61
  /**
@@ -209,6 +218,37 @@ export class AgCard extends LitElement implements CardProps {
209
218
  position: relative;
210
219
  z-index: 2;
211
220
  }
221
+
222
+ /* ── Media slot ─────────────────────────────────────────────────── */
223
+
224
+ /* Clip image corners to the card's border-radius for non-shadow cards */
225
+ :host([has-media]) {
226
+ overflow: hidden;
227
+ }
228
+
229
+ .card-media {
230
+ overflow: hidden; /* belt-and-suspenders for non-rounded cards */
231
+ line-height: 0; /* collapses inline whitespace below slotted img */
232
+ }
233
+
234
+ /* Top media: clip only the card's top two corners */
235
+ :host([rounded="sm"]) .card-media--top { border-radius: var(--ag-radius-sm) var(--ag-radius-sm) 0 0; }
236
+ :host([rounded="md"]) .card-media--top { border-radius: var(--ag-radius-md) var(--ag-radius-md) 0 0; }
237
+ :host([rounded="lg"]) .card-media--top { border-radius: var(--ag-radius-lg) var(--ag-radius-lg) 0 0; }
238
+
239
+ /* Bottom media: clip only the card's bottom two corners */
240
+ :host([rounded="sm"]) .card-media--bottom { border-radius: 0 0 var(--ag-radius-sm) var(--ag-radius-sm); }
241
+ :host([rounded="md"]) .card-media--bottom { border-radius: 0 0 var(--ag-radius-md) var(--ag-radius-md); }
242
+ :host([rounded="lg"]) .card-media--bottom { border-radius: 0 0 var(--ag-radius-lg) var(--ag-radius-lg); }
243
+
244
+ /* Sensible defaults for slotted media elements */
245
+ .card-media ::slotted(img),
246
+ .card-media ::slotted(video) {
247
+ display: block;
248
+ width: 100%;
249
+ height: auto;
250
+ object-fit: cover;
251
+ }
212
252
  `;
213
253
 
214
254
  render() {
@@ -217,6 +257,11 @@ export class AgCard extends LitElement implements CardProps {
217
257
 
218
258
  return html`
219
259
  <div class="card-wrapper" part="ag-card-wrapper">
260
+ ${this.hasMedia && this.mediaPosition === 'top' ? html`
261
+ <div class="card-media card-media--top" part="ag-card-media">
262
+ <slot name="media"></slot>
263
+ </div>` : nothing}
264
+
220
265
  <div class="${headerClass}" part="ag-card-header">
221
266
  <slot name="header" @slotchange=${this._handleSlotChange}></slot>
222
267
  </div>
@@ -226,6 +271,11 @@ export class AgCard extends LitElement implements CardProps {
226
271
  <div class="${footerClass}" part="ag-card-footer">
227
272
  <slot name="footer" @slotchange=${this._handleSlotChange}></slot>
228
273
  </div>
274
+
275
+ ${this.hasMedia && this.mediaPosition === 'bottom' ? html`
276
+ <div class="card-media card-media--bottom" part="ag-card-media">
277
+ <slot name="media"></slot>
278
+ </div>` : nothing}
229
279
  </div>
230
280
  `;
231
281
  }
@@ -6,8 +6,14 @@
6
6
  .animated="animated"
7
7
  :rounded="rounded"
8
8
  :variant="variant"
9
+ .hasMedia="hasMedia"
10
+ .mediaPosition="mediaPosition"
9
11
  v-bind="$attrs"
10
12
  >
13
+ <slot
14
+ name="media"
15
+ slot="media"
16
+ />
11
17
  <slot
12
18
  name="header"
13
19
  slot="header"
@@ -22,7 +28,7 @@
22
28
 
23
29
  <script lang="ts">
24
30
  import { defineComponent, onMounted, ref, type PropType } from "vue";
25
- import type { CardProps, CardVariant, CardRounded } from "../core/Card";
31
+ import type { CardProps, CardVariant, CardRounded, CardMediaPosition } from "../core/Card";
26
32
  import "../core/Card"; // Registers the ag-card web component
27
33
 
28
34
  export default defineComponent({
@@ -48,6 +54,14 @@ export default defineComponent({
48
54
  type: String as PropType<CardVariant>,
49
55
  default: "" as CardVariant,
50
56
  },
57
+ hasMedia: {
58
+ type: Boolean,
59
+ default: false,
60
+ },
61
+ mediaPosition: {
62
+ type: String as PropType<CardMediaPosition>,
63
+ default: "top" as CardMediaPosition,
64
+ },
51
65
  },
52
66
  setup(props) {
53
67
  const agComponent = ref<(HTMLElement & CardProps) | null>(null);
@@ -68,6 +82,8 @@ export default defineComponent({
68
82
  animated: props.animated,
69
83
  rounded: props.rounded,
70
84
  variant: props.variant,
85
+ hasMedia: props.hasMedia,
86
+ mediaPosition: props.mediaPosition,
71
87
  };
72
88
  },
73
89
  });
@@ -139,24 +139,6 @@ export class Pagination extends LitElement implements PaginationProps {
139
139
  return this._generatePages();
140
140
  }
141
141
 
142
- updated(changedProperties: Map<string, unknown>) {
143
- if (
144
- changedProperties.has('current') ||
145
- changedProperties.has('totalPages') ||
146
- changedProperties.has('offset')
147
- ) {
148
- // Focus current page button after update using querySelector
149
- this.updateComplete.then(() => {
150
- const currentButton = this.shadowRoot?.querySelector(
151
- `button[data-page="${this.current}"]`
152
- ) as HTMLButtonElement;
153
- if (currentButton) {
154
- currentButton.focus();
155
- }
156
- });
157
- }
158
- }
159
-
160
142
  private _generatePages(): PageArrayItem[] {
161
143
  if (this.totalPages <= 1) {
162
144
  return [1];
@@ -258,6 +240,16 @@ export class Pagination extends LitElement implements PaginationProps {
258
240
  if (this.onPageChange) {
259
241
  this.onPageChange(pageChangeEvent);
260
242
  }
243
+
244
+ // Focus the new current page button after re-render (only when user clicked)
245
+ this.updateComplete.then(() => {
246
+ const currentButton = this.shadowRoot?.querySelector(
247
+ `button[data-page="${this.current}"]`
248
+ ) as HTMLButtonElement;
249
+ if (currentButton) {
250
+ currentButton.focus();
251
+ }
252
+ });
261
253
  }
262
254
 
263
255
  private _getJustifyClass(): string {
@@ -162,7 +162,7 @@ export class Select extends LitElement implements SelectProps {
162
162
  /* Base styling */
163
163
  padding: var(--ag-space-2) var(--ag-space-8) var(--ag-space-2) var(--ag-space-3);
164
164
  -moz-padding-start: calc(var(--ag-space-3) - 3px);
165
- font-size: var(--ag-font-size-base);
165
+ font-size: var(--ag-font-size-sm);
166
166
  font-weight: 400;
167
167
  line-height: 1.5;
168
168
  font-family: inherit;
@@ -212,7 +212,7 @@ export class Select extends LitElement implements SelectProps {
212
212
  padding-block-start: var(--ag-space-1);
213
213
  padding-block-end: var(--ag-space-1);
214
214
  padding-inline-start: var(--ag-space-2);
215
- font-size: var(--ag-font-size-small);
215
+ font-size: var(--ag-font-size-sm);
216
216
  }
217
217
 
218
218
  /* Large size variant */
@@ -151,18 +151,18 @@
151
151
  --ag-background-primary-inverted: #1f2328;
152
152
  --ag-background-secondary: #f3f4f6;
153
153
  --ag-background-secondary-inverted: #111827;
154
- --ag-background-tertiary: #e5e7eb;
155
- --ag-background-disabled: #f3f4f6;
156
- --ag-primary-background: #ddf4ff;
157
- --ag-primary-text: #0550ae;
158
- --ag-success-background: #dafbe1;
159
- --ag-success-text: #116329;
160
- --ag-info-background: #f3f4f6;
161
- --ag-info-text: #4b5563;
162
- --ag-warning-background: #fff8c5;
163
- --ag-warning-text: #7d4e00;
164
- --ag-danger-background: #ffebe9;
165
- --ag-danger-text: #a40e26;
154
+ --ag-background-tertiary: #e5e7eb; /** Used by: Button default bg; also secondary button hover bg */
155
+ --ag-background-disabled: #f3f4f6; /** Used by: Button, Input, Checkbox, Radio, Select disabled states */
156
+ --ag-primary-background: #ddf4ff; /** Used by: Alert primary variant bg, Button faint variant bg */
157
+ --ag-primary-text: #0550ae; /** Used by: Alert primary text, Button bordered/outlined text + border */
158
+ --ag-success-background: #dafbe1; /** Used by: Alert success variant bg, Badge success variant bg */
159
+ --ag-success-text: #116329; /** Used by: Alert success variant text, Badge success variant text */
160
+ --ag-info-background: #f3f4f6; /** Used by: Alert info variant bg, Badge info variant bg */
161
+ --ag-info-text: #4b5563; /** Used by: Alert info variant text, Badge info variant text */
162
+ --ag-warning-background: #fff8c5; /** Used by: Alert warning variant bg, Badge warning variant bg */
163
+ --ag-warning-text: #7d4e00; /** Used by: Alert warning variant text, Badge warning variant text */
164
+ --ag-danger-background: #ffebe9; /** Used by: Alert danger variant bg, Badge danger variant bg */
165
+ --ag-danger-text: #a40e26; /** Used by: Alert danger variant text, Badge danger variant text */
166
166
  --ag-primary-fg: #ffffff;
167
167
  --ag-success-fg: #ffffff;
168
168
  --ag-warning-fg: #111827;
@@ -171,7 +171,7 @@
171
171
  --ag-border-subtle: #d1d5db;
172
172
  --ag-primary: #0550ae;
173
173
  --ag-primary-rgb: 5, 80, 174;
174
- --ag-primary-border: #d1d5db;
174
+ --ag-primary-border: #d1d5db; /** Used by: Button bordered variant border */
175
175
  --ag-primary-dark: #0a3069;
176
176
  --ag-secondary: #6b7280;
177
177
  --ag-secondary-dark: #4b5563;