@florid-kit/components 3.2.23 → 3.2.25

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.
@@ -7,6 +7,7 @@ export declare class OccitaneDropdownVariant extends OccitaneDropdownVariant_bas
7
7
  value: string;
8
8
  label?: string;
9
9
  imgurl?: string;
10
+ imgalt?: string;
10
11
  url?: string;
11
12
  disabled?: boolean;
12
13
  additionaltext?: string;
@@ -17,6 +18,8 @@ export declare class OccitaneDropdownVariant extends OccitaneDropdownVariant_bas
17
18
  additionaltext: string;
18
19
  disabled: boolean;
19
20
  width: string;
21
+ buttonLabel: string;
22
+ describedBy: undefined;
20
23
  open: boolean;
21
24
  activeIndex: number;
22
25
  menuWidth: string;
@@ -32,8 +35,10 @@ export declare class OccitaneDropdownVariant extends OccitaneDropdownVariant_bas
32
35
  connectedCallback(): void;
33
36
  disconnectedCallback(): void;
34
37
  _handleOutsideClick: (e: MouseEvent) => void;
38
+ private _handleListFocusOut;
35
39
  private _startObserveVisibleItems;
36
40
  private _stopObserveVisibleItems;
41
+ close(): void;
37
42
  toggle(): void;
38
43
  _focusActiveOption(): void;
39
44
  selectOption(option: {
@@ -1,22 +1,29 @@
1
- import { i as m, m as y, a as w, x as p, t as x } from "../performance-mixin-D7YmSeqN.mjs";
2
- import { n as c } from "../property-S_Y9cb04.mjs";
1
+ import { i as m, m as y, a as w, x as h, t as x } from "../performance-mixin-D7YmSeqN.mjs";
2
+ import { n as l } from "../property-S_Y9cb04.mjs";
3
3
  import { r as f } from "../state-DjMxXomO.mjs";
4
- import { e as _, o as k, a as $ } from "../icons-registry.mjs";
4
+ import { e as _, o as $, a as k } from "../icons-registry.mjs";
5
5
  import { o as I } from "../unsafe-svg-BipL_msF.mjs";
6
- import { o as l } from "../if-defined-j0wE2gL4.mjs";
7
- var O = Object.defineProperty, C = Object.getOwnPropertyDescriptor, r = (e, i, o, t) => {
8
- for (var n = t > 1 ? void 0 : t ? C(i, o) : i, s = e.length - 1, d; s >= 0; s--)
9
- (d = e[s]) && (n = (t ? d(i, o, n) : d(n)) || n);
10
- return t && n && O(i, o, n), n;
6
+ import { o as a } from "../if-defined-j0wE2gL4.mjs";
7
+ import { s as O } from "../css-C8WrrxT-.mjs";
8
+ var S = Object.defineProperty, C = Object.getOwnPropertyDescriptor, s = (t, i, n, e) => {
9
+ for (var o = e > 1 ? void 0 : e ? C(i, n) : i, d = t.length - 1, c; d >= 0; d--)
10
+ (c = t[d]) && (o = (e ? c(i, n, o) : c(o)) || o);
11
+ return e && o && S(i, n, o), o;
11
12
  };
12
- let a = class extends y(w) {
13
+ let r = class extends y(w) {
13
14
  constructor() {
14
- super(...arguments), this.options = [], this.value = "", this.name = "", this.additionaltext = "+X variant(s)", this.disabled = !1, this.width = "100%", this.open = !1, this.activeIndex = -1, this.menuWidth = "", this._sent = /* @__PURE__ */ new Set(), this._pendingByKey = /* @__PURE__ */ new Map(), this._handleOutsideClick = (e) => {
15
- this.contains(e.target) || (this.open = !1, this.activeIndex = -1, this._stopObserveVisibleItems());
15
+ super(...arguments), this.options = [], this.value = "", this.name = "", this.additionaltext = "+X variant(s)", this.disabled = !1, this.width = "100%", this.buttonLabel = "", this.describedBy = void 0, this.open = !1, this.activeIndex = -1, this.menuWidth = "", this._sent = /* @__PURE__ */ new Set(), this._pendingByKey = /* @__PURE__ */ new Map(), this._handleOutsideClick = (t) => {
16
+ this.contains(t.target) || (this.open = !1, this.activeIndex = -1, this._stopObserveVisibleItems());
17
+ }, this._handleListFocusOut = (t) => {
18
+ var o;
19
+ const i = t.relatedTarget;
20
+ if (!i) return;
21
+ const n = t.currentTarget, e = (o = this.renderRoot) == null ? void 0 : o.querySelector("button");
22
+ n.contains(i) || e != null && e.contains(i) || (this.open = !1, this.activeIndex = -1, this._stopObserveVisibleItems());
16
23
  };
17
24
  }
18
- _getKey(e, i, o) {
19
- return (i == null ? void 0 : i.productId) ?? e.value ?? String(o);
25
+ _getKey(t, i, n) {
26
+ return (i == null ? void 0 : i.productId) ?? t.value ?? String(n);
20
27
  }
21
28
  _scheduleFlush() {
22
29
  this._flushTimer || (this._flushTimer = window.setTimeout(() => {
@@ -25,31 +32,31 @@ let a = class extends y(w) {
25
32
  }
26
33
  _flushPending() {
27
34
  if (!this.open || this._pendingByKey.size === 0) return;
28
- const e = Array.from(this._pendingByKey.values());
35
+ const t = Array.from(this._pendingByKey.values());
29
36
  this._pendingByKey.clear(), this.dispatchEvent(
30
37
  new CustomEvent("event-tracking", {
31
38
  detail: {
32
- products: e
39
+ products: t
33
40
  },
34
41
  bubbles: !0,
35
42
  composed: !0
36
43
  })
37
44
  );
38
45
  }
39
- _emitTrackingEvent(e, i) {
40
- const o = e == null ? void 0 : e.dataproduct;
41
- if (!o) return;
42
- let t;
46
+ _emitTrackingEvent(t, i) {
47
+ const n = t == null ? void 0 : t.dataproduct;
48
+ if (!n) return;
49
+ let e;
43
50
  try {
44
- t = JSON.parse(o);
45
- } catch (n) {
46
- console.warn("Invalid dataproduct JSON:", o, n);
51
+ e = JSON.parse(n);
52
+ } catch (o) {
53
+ console.warn("Invalid dataproduct JSON:", n, o);
47
54
  return;
48
55
  }
49
56
  this.dispatchEvent(
50
57
  new CustomEvent("event-tracking", {
51
58
  detail: {
52
- product: t
59
+ product: e
53
60
  },
54
61
  bubbles: !0,
55
62
  composed: !0
@@ -57,26 +64,26 @@ let a = class extends y(w) {
57
64
  );
58
65
  }
59
66
  connectedCallback() {
60
- super.connectedCallback(), document.addEventListener("click", this._handleOutsideClick), _("occ-check-outlined"), this._unsubOcc = k(() => this.requestUpdate());
67
+ super.connectedCallback(), document.addEventListener("click", this._handleOutsideClick), _("occ-check-outlined"), this._unsubOcc = $(() => this.requestUpdate());
61
68
  }
62
69
  disconnectedCallback() {
63
- var e;
64
- document.removeEventListener("click", this._handleOutsideClick), (e = this._unsubOcc) == null || e.call(this), super.disconnectedCallback();
70
+ var t;
71
+ document.removeEventListener("click", this._handleOutsideClick), (t = this._unsubOcc) == null || t.call(this), super.disconnectedCallback();
65
72
  }
66
73
  _startObserveVisibleItems() {
67
74
  var i;
68
75
  this._stopObserveVisibleItems();
69
- const e = (i = this.renderRoot) == null ? void 0 : i.querySelector("#dropdown-listbox");
70
- e && (this._io = new IntersectionObserver(
71
- (o) => {
76
+ const t = (i = this.renderRoot) == null ? void 0 : i.querySelector("#dropdown-listbox");
77
+ t && (this._io = new IntersectionObserver(
78
+ (n) => {
72
79
  if (this.open)
73
- for (const t of o) {
74
- if (!t.isIntersecting) continue;
75
- const n = t.target, s = n.dataset.index;
76
- if (!s) continue;
77
- const d = Number(s), h = this.options[d];
78
- if (!h || h.disabled) continue;
79
- const u = h.dataproduct ?? n.dataset.product;
80
+ for (const e of n) {
81
+ if (!e.isIntersecting) continue;
82
+ const o = e.target, d = o.dataset.index;
83
+ if (!d) continue;
84
+ const c = Number(d), p = this.options[c];
85
+ if (!p || p.disabled) continue;
86
+ const u = p.dataproduct ?? o.dataset.product;
80
87
  if (!u) continue;
81
88
  let v;
82
89
  try {
@@ -85,28 +92,31 @@ let a = class extends y(w) {
85
92
  console.warn("Invalid dataproduct JSON:", u, g);
86
93
  continue;
87
94
  }
88
- const b = this._getKey(h, v, d);
95
+ const b = this._getKey(p, v, c);
89
96
  this._sent.has(b) || (this._sent.add(b), this._pendingByKey.set(b, v), this._scheduleFlush());
90
97
  }
91
98
  },
92
99
  {
93
- root: e,
100
+ root: t,
94
101
  threshold: 0.75
95
102
  }
96
- ), e.querySelectorAll("li[role='option']").forEach((o) => {
97
- var t;
98
- return (t = this._io) == null ? void 0 : t.observe(o);
103
+ ), t.querySelectorAll("li[role='option']").forEach((n) => {
104
+ var e;
105
+ return (e = this._io) == null ? void 0 : e.observe(n);
99
106
  }));
100
107
  }
101
108
  _stopObserveVisibleItems() {
102
- var e;
103
- this._flushPending(), this._flushTimer && (clearTimeout(this._flushTimer), this._flushTimer = void 0), (e = this._io) == null || e.disconnect(), this._io = void 0;
109
+ var t;
110
+ this._flushPending(), this._flushTimer && (clearTimeout(this._flushTimer), this._flushTimer = void 0), (t = this._io) == null || t.disconnect(), this._io = void 0;
111
+ }
112
+ close() {
113
+ this.open && this.toggle();
104
114
  }
105
115
  toggle() {
106
- var e;
116
+ var t;
107
117
  if (!this.disabled) {
108
118
  if (this.open = !this.open, this.activeIndex = this.open ? this.options.findIndex((i) => i.value === this.value) : -1, this.open && this.width === "auto") {
109
- const i = (e = this.renderRoot) == null ? void 0 : e.querySelector("button");
119
+ const i = (t = this.renderRoot) == null ? void 0 : t.querySelector("button");
110
120
  i && (this.menuWidth = `${i.getBoundingClientRect().width}px`);
111
121
  }
112
122
  this.open ? this.updateComplete.then(() => {
@@ -116,41 +126,45 @@ let a = class extends y(w) {
116
126
  }
117
127
  _focusActiveOption() {
118
128
  var i;
119
- const e = (i = this.renderRoot) == null ? void 0 : i.querySelector(`#option-${this.activeIndex}`);
120
- e == null || e.focus();
129
+ const t = (i = this.renderRoot) == null ? void 0 : i.querySelector(`#option-${this.activeIndex}`);
130
+ t == null || t.focus();
121
131
  }
122
- selectOption(e) {
123
- this.value = e.value, this.dispatchEvent(new CustomEvent("change", {
124
- detail: { value: this.value, url: e.url }
132
+ selectOption(t) {
133
+ this.value = t.value, this.dispatchEvent(new CustomEvent("change", {
134
+ detail: { value: this.value, url: t.url }
125
135
  })), this.open = !1, this.activeIndex = -1;
126
136
  }
127
- handleKeydown(e) {
137
+ handleKeydown(t) {
128
138
  if (this.disabled) {
129
- e.preventDefault();
139
+ t.preventDefault();
130
140
  return;
131
141
  }
132
142
  if (!this.open) {
133
- (e.key === "ArrowDown" || e.key === "ArrowUp") && (e.preventDefault(), this.open = !0, this.activeIndex = this.options.findIndex((i) => i.value === this.value), this.updateComplete.then(() => this._focusActiveOption()));
143
+ (t.key === "ArrowDown" || t.key === "ArrowUp") && (t.preventDefault(), this.open = !0, this.activeIndex = this.options.findIndex((i) => i.value === this.value), this.updateComplete.then(() => this._focusActiveOption()));
144
+ return;
145
+ }
146
+ if (t.key === "Tab" && t.shiftKey) {
147
+ this.open = !1, this.activeIndex = -1, this._stopObserveVisibleItems();
134
148
  return;
135
149
  }
136
- switch (e.key) {
150
+ switch (t.key) {
137
151
  case "ArrowDown":
138
- e.preventDefault(), this.activeIndex = (this.activeIndex + 1) % this.options.length, this.updateComplete.then(() => this._focusActiveOption());
152
+ t.preventDefault(), this.activeIndex = (this.activeIndex + 1) % this.options.length, this.updateComplete.then(() => this._focusActiveOption());
139
153
  break;
140
154
  case "ArrowUp":
141
- e.preventDefault(), this.activeIndex = (this.activeIndex - 1 + this.options.length) % this.options.length, this.updateComplete.then(() => this._focusActiveOption());
155
+ t.preventDefault(), this.activeIndex = (this.activeIndex - 1 + this.options.length) % this.options.length, this.updateComplete.then(() => this._focusActiveOption());
142
156
  break;
143
157
  case "Home":
144
- e.preventDefault(), this.activeIndex = 0, this.updateComplete.then(() => this._focusActiveOption());
158
+ t.preventDefault(), this.activeIndex = 0, this.updateComplete.then(() => this._focusActiveOption());
145
159
  break;
146
160
  case "End":
147
- e.preventDefault(), this.activeIndex = this.options.length - 1, this.updateComplete.then(() => this._focusActiveOption());
161
+ t.preventDefault(), this.activeIndex = this.options.length - 1, this.updateComplete.then(() => this._focusActiveOption());
148
162
  break;
149
163
  case "Enter":
150
- e.preventDefault(), this.activeIndex >= 0 && this.selectOption(this.options[this.activeIndex]);
164
+ t.preventDefault(), this.activeIndex >= 0 && this.selectOption(this.options[this.activeIndex]);
151
165
  break;
152
166
  case "Escape":
153
- e.preventDefault(), this.open = !1, this.activeIndex = -1;
167
+ t.preventDefault(), this.open = !1, this.activeIndex = -1;
154
168
  break;
155
169
  }
156
170
  }
@@ -158,31 +172,32 @@ let a = class extends y(w) {
158
172
  this.options.length > 0 && (this.options.some((i) => i.value === this.value) || (this.value = this.options[0].value));
159
173
  }
160
174
  render() {
161
- const e = $["occ-check-outlined"] ?? "", i = e ? e.replace(
175
+ const t = k["occ-check-outlined"] ?? "", i = t ? t.replace(
162
176
  "<svg",
163
177
  '<svg aria-hidden="true" focusable="false" part="svg"'
164
- ) : "", o = this.options.find((t) => t.value === this.value);
165
- return p`
178
+ ) : "", n = this.options.find((e) => e.value === this.value);
179
+ return h`
166
180
  <button
167
- role="combobox"
168
- aria-haspopup="listbox"
169
181
  aria-controls="dropdown-listbox"
170
182
  aria-expanded="${this.open}"
171
183
  aria-disabled="${this.disabled ? "true" : "false"}"
172
- aria-labelledby="dropdown-label"
184
+ aria-labelledby="dropdown-label dropdown-addtext"
185
+ aria-describedby="${a(this.describedBy)}"
173
186
  @click=${this.toggle}
174
187
  @keydown=${this.handleKeydown}
175
188
  style=${`width: ${this.width};`}
176
189
  ?disabled=${this.disabled}
177
190
  class="btn-dropdown"
178
191
  >
179
- <img alt="${l(o == null ? void 0 : o.label)}" src="${l(o == null ? void 0 : o.imgurl)}" />
192
+ <img alt="${(n == null ? void 0 : n.imgalt) || ""}" src="${a(n == null ? void 0 : n.imgurl)}" />
180
193
  <span id="dropdown-label" class="label">
181
- ${o ? o.label : "Select an option"}
194
+ ${n ? h`
195
+ <span id="button-label" class="sr-only">${this.buttonLabel}: </span> ${n.label}
196
+ ` : h`<span id="button-label">${this.buttonLabel}</span>`}
182
197
  </span>
183
- <div class="right">
198
+ <div id="dropdown-addtext" class="right">
184
199
  <span class="additional-text">${this.additionaltext}</span>
185
- <span class="arrow">
200
+ <span class="arrow" aria-hidden="true">
186
201
  <o-icon-button
187
202
  icon="${this.open ? "occ-triangle-up" : "occ-triangle-down"}"
188
203
  size="medium"
@@ -193,35 +208,33 @@ let a = class extends y(w) {
193
208
  </div>
194
209
  </button>
195
210
 
196
- ${this.open ? p`
211
+ ${this.open ? h`
197
212
  <ul
198
213
  id="dropdown-listbox"
199
- role="listbox"
200
- aria-activedescendant="${this.activeIndex >= 0 ? "option-" + this.activeIndex : ""}"
201
214
  style=${`width: ${this.width};`}
215
+ @focusout=${this._handleListFocusOut}
202
216
  >
203
217
  ${this.options.map(
204
- (t, n) => p`
218
+ (e, o) => h`
205
219
  <li
206
- id="option-${n}"
207
- role="option"
208
- data-index="${n}"
209
- data-product="${l(t.dataproduct)}"
210
- aria-selected="${t.value === this.value}"
211
- aria-disabled="${t.disabled ? "true" : "false"}"
212
- tabindex="${n === this.activeIndex ? "0" : "-1"}"
213
- class="${n === this.activeIndex ? "active" : ""} ${t.disabled ? "disabled" : ""}"
214
- @click=${(s) => {
215
- this._emitTrackingEvent(t, n), this.selectOption(t);
220
+ id="option-${o}"
221
+ data-index="${o}"
222
+ data-product="${a(e.dataproduct)}"
223
+ class="${o === this.activeIndex ? "active" : ""} ${e.disabled ? "disabled" : ""}"
224
+ @click=${(d) => {
225
+ this._emitTrackingEvent(e, o), this.selectOption(e);
216
226
  }}
217
227
  >
218
228
 
219
- <a href="${l(t.url)}">
220
- <img alt="${l(t.label)}" src="${l(t.imgurl)}" />
221
- <span class="label">${t.label}</span>
222
- <div class="right">
223
- <span class="additional-text">${l(t.additionaltext)}</span>
224
- ${t.value === this.value && !t.additionaltext ? p`
229
+ <a href="${a(e.url)}" aria-current="${a(o === this.activeIndex ? "page" : void 0)}"
230
+ aria-describedby="button-label" tabindex="${a(o === this.activeIndex ? "-1" : void 0)}"
231
+ aria-labelledby="label-${o} label-addtext-${o}"
232
+ >
233
+ <img alt="${e.imgalt || ""}" src="${a(e.imgurl)}" />
234
+ <span class="label" id="label-${o}">${e.label}</span>
235
+ <div class="right" id="label-addtext-${o}">
236
+ <span class="additional-text">${a(e.additionaltext)}</span>
237
+ ${e.value === this.value && !e.additionaltext ? h`
225
238
  <span class="check">${I(i)}</span>` : null}
226
239
  </div>
227
240
  </a>
@@ -234,7 +247,7 @@ let a = class extends y(w) {
234
247
  `;
235
248
  }
236
249
  };
237
- a.styles = m`
250
+ r.styles = m`
238
251
  :host {
239
252
  display: inline-block;
240
253
  position: relative;
@@ -410,37 +423,47 @@ a.styles = m`
410
423
  input[type="hidden"] {
411
424
  display: none;
412
425
  }
426
+
427
+ .sr-only {
428
+ ${O}
429
+ }
413
430
  `;
414
- r([
415
- c({ type: Array, reflect: !0 })
416
- ], a.prototype, "options", 2);
417
- r([
418
- c({ type: String, reflect: !0 })
419
- ], a.prototype, "value", 2);
420
- r([
421
- c({ type: String, reflect: !0 })
422
- ], a.prototype, "name", 2);
423
- r([
424
- c({ type: String, reflect: !0 })
425
- ], a.prototype, "additionaltext", 2);
426
- r([
427
- c({ type: Boolean, reflect: !0 })
428
- ], a.prototype, "disabled", 2);
429
- r([
430
- c({ type: String, reflect: !0 })
431
- ], a.prototype, "width", 2);
432
- r([
431
+ s([
432
+ l({ type: Array, reflect: !0 })
433
+ ], r.prototype, "options", 2);
434
+ s([
435
+ l({ type: String, reflect: !0 })
436
+ ], r.prototype, "value", 2);
437
+ s([
438
+ l({ type: String, reflect: !0 })
439
+ ], r.prototype, "name", 2);
440
+ s([
441
+ l({ type: String, reflect: !0 })
442
+ ], r.prototype, "additionaltext", 2);
443
+ s([
444
+ l({ type: Boolean, reflect: !0 })
445
+ ], r.prototype, "disabled", 2);
446
+ s([
447
+ l({ type: String, reflect: !0 })
448
+ ], r.prototype, "width", 2);
449
+ s([
450
+ l({ type: String, reflect: !0, attribute: "button-label" })
451
+ ], r.prototype, "buttonLabel", 2);
452
+ s([
453
+ l({ type: String, reflect: !0, attribute: "describedby" })
454
+ ], r.prototype, "describedBy", 2);
455
+ s([
433
456
  f()
434
- ], a.prototype, "open", 2);
435
- r([
457
+ ], r.prototype, "open", 2);
458
+ s([
436
459
  f()
437
- ], a.prototype, "activeIndex", 2);
438
- r([
460
+ ], r.prototype, "activeIndex", 2);
461
+ s([
439
462
  f()
440
- ], a.prototype, "menuWidth", 2);
441
- a = r([
463
+ ], r.prototype, "menuWidth", 2);
464
+ r = s([
442
465
  x("o-dropdown-variant")
443
- ], a);
466
+ ], r);
444
467
  export {
445
- a as OccitaneDropdownVariant
468
+ r as OccitaneDropdownVariant
446
469
  };
@@ -1,13 +1,13 @@
1
- import { i as u, m as h, a as p, x as d, t as b } from "../performance-mixin-D7YmSeqN.mjs";
2
- import { n as c } from "../property-S_Y9cb04.mjs";
1
+ import { i as u, m as h, a as b, x as d, t as p } from "../performance-mixin-D7YmSeqN.mjs";
2
+ import { n as l } from "../property-S_Y9cb04.mjs";
3
3
  import { r as m } from "../state-DjMxXomO.mjs";
4
4
  import "./icon-button.mjs";
5
- var f = Object.defineProperty, x = Object.getOwnPropertyDescriptor, a = (t, e, o, i) => {
6
- for (var s = i > 1 ? void 0 : i ? x(e, o) : e, l = t.length - 1, n; l >= 0; l--)
7
- (n = t[l]) && (s = (i ? n(e, o, s) : n(s)) || s);
8
- return i && s && f(e, o, s), s;
5
+ var f = Object.defineProperty, v = Object.getOwnPropertyDescriptor, n = (t, e, o, s) => {
6
+ for (var r = s > 1 ? void 0 : s ? v(e, o) : e, c = t.length - 1, a; c >= 0; c--)
7
+ (a = t[c]) && (r = (s ? a(e, o, r) : a(r)) || r);
8
+ return s && r && f(e, o, r), r;
9
9
  };
10
- let r = class extends h(p) {
10
+ let i = class extends h(b) {
11
11
  constructor() {
12
12
  super(...arguments), this.thumbnails = [], this.activeIndex = 0, this.disabledIndexes = [], this.maxWidth = "100%", this.altressource = "visual", this.focusedIndex = 0, this.playerIconTemplate = d`
13
13
  <o-icon-button
@@ -55,13 +55,11 @@ let r = class extends h(p) {
55
55
  }
56
56
  onFocus(t) {
57
57
  const e = t.currentTarget, o = Number(e.dataset.index);
58
- this.focusedIndex = o, this.renderRoot.querySelectorAll(".thumb").forEach((s) => {
59
- s.classList.remove("a--tabfocus");
60
- }), e.classList.add("a--tabfocus"), this.requestUpdate();
58
+ this.focusedIndex = o;
61
59
  }
62
60
  onFocusOut(t) {
63
- const e = t.currentTarget, o = Number(e.dataset.index), i = t.relatedTarget;
64
- (!i || this.shadowRoot && !this.shadowRoot.contains(i)) && (this.renderRoot.querySelectorAll(".thumb").forEach((n) => n.classList.remove("a--tabfocus")), o === this.lastIndex ? this.dispatchEvent(new CustomEvent("thumb-exit", {
61
+ const e = t.currentTarget, o = Number(e.dataset.index), s = t.relatedTarget;
62
+ (!s || this.shadowRoot && !this.shadowRoot.contains(s)) && (o === this.lastIndex ? this.dispatchEvent(new CustomEvent("thumb-exit", {
65
63
  detail: { from: "last", direction: "unspecified" },
66
64
  bubbles: !0,
67
65
  composed: !0
@@ -75,22 +73,22 @@ let r = class extends h(p) {
75
73
  return d`
76
74
  <ul class="scroll-container" style="max-width: ${this.maxWidth};">
77
75
  ${this.thumbnails.map((t, e) => {
78
- const o = this.disabledIndexes.includes(e), i = this.activeIndex === e, s = t.type === "video", l = t.alt || (s ? `video ${e}` : `${this.altressource} ${e + 1}`);
76
+ const o = this.disabledIndexes.includes(e), s = this.activeIndex === e, r = t.type === "video", c = t.alt || (r ? `video ${e}` : `${this.altressource} ${e + 1}`);
79
77
  return d`
80
78
  <li class="thumb-wrapper">
81
79
  <button
82
80
  class="thumb"
83
81
  data-index="${e}"
84
82
  ?disabled=${o}
85
- aria-current=${i ? "true" : "false"}
83
+ aria-current=${s ? "true" : "false"}
86
84
  @click=${() => this.selectThumbnail(e)}
87
85
  @keydown=${this.handleKeyDown}
88
- @focus=${(n) => this.onFocus(n)}
89
- @focusout=${(n) => this.onFocusOut(n)}
86
+ @focus=${(a) => this.onFocus(a)}
87
+ @focusout=${(a) => this.onFocusOut(a)}
90
88
  >
91
- <img alt="${l}" src="${t.src}" />
89
+ <img alt="${c}" src="${t.src}" />
92
90
  </button>
93
- ${s ? d`<div class="play-icon-wrapper">${this.playerIconTemplate}</div>` : null}
91
+ ${r ? d`<div class="play-icon-wrapper">${this.playerIconTemplate}</div>` : null}
94
92
  </li>
95
93
  `;
96
94
  })}
@@ -98,7 +96,7 @@ let r = class extends h(p) {
98
96
  `;
99
97
  }
100
98
  };
101
- r.styles = u`
99
+ i.styles = u`
102
100
  :host {
103
101
  display: flex;
104
102
  gap: 5px;
@@ -112,33 +110,54 @@ r.styles = u`
112
110
  .thumb {
113
111
  width: 56px;
114
112
  height: 70px;
115
- background-size: cover;
116
- background-position: center;
117
- border: 1px solid var(--color-border-secondary);
113
+ background: var(--thumb-border);
114
+ --thumb-border: var(--color-alpha-dark-light);
115
+ --thumb-border-width: 0.5px;
116
+ border: none;
118
117
  opacity: 1;
119
118
  cursor: pointer;
120
119
  outline: none;
121
- transition: outline 0.2s, opacity 0.2s;
122
- padding: 0;
120
+ transition: opacity 0.2s;
121
+ padding: var(--thumb-border-width);
123
122
  margin: 0;
124
123
  box-sizing: content-box;
125
124
  position: relative;
126
125
 
127
126
  img {
127
+ display: block;
128
128
  width: 100%;
129
- height: auto;
130
- max-width: 100%;
131
- border: 1px solid var(--color-container-bg-white);
129
+ height: 100%;
130
+ object-fit: cover;
131
+ background: linear-gradient(to bottom, #f9f5f0, #f7f2ea);
132
+ border: 1px solid var(--color-border-light);
132
133
  box-sizing: border-box;
133
134
  }
134
135
  }
135
136
 
136
137
  .thumb[aria-current="true"] {
137
- box-shadow: 0 0 0px 2px var(--color-border-secondary);
138
+ --thumb-border: var(--color-container-action-primary-default);
139
+ --thumb-border-width: 1px;
138
140
  }
139
141
 
140
- .thumb[aria-selected="true"]::before,
141
- .a--tabfocus::before {
142
+ @media (hover: hover) {
143
+ .thumb:hover {
144
+ --thumb-border: var(--color-alpha-dark-medium);
145
+ }
146
+
147
+ .thumb[aria-current="true"]:hover {
148
+ --thumb-border: var(--color-container-action-primary-hover);
149
+ }
150
+ }
151
+
152
+ .thumb:active {
153
+ --thumb-border: var(--color-alpha-dark-strong);
154
+ }
155
+
156
+ .thumb[aria-current="true"]:active {
157
+ --thumb-border: var(--color-container-action-primary-pressed);
158
+ }
159
+
160
+ .thumb:focus-visible::before {
142
161
  content: "";
143
162
  position: absolute;
144
163
  top: 0;
@@ -151,13 +170,13 @@ r.styles = u`
151
170
  }
152
171
 
153
172
  .thumb[disabled] {
154
- border: 1px solid var(--color-border-disabled, #eee);
173
+ --thumb-border: var(--color-border-disabled, #eee);
155
174
  opacity: 0.4;
156
175
  pointer-events: none;
157
176
  }
158
177
 
159
178
  .thumb:focus-visible {
160
- border: 1px solid var(--color-border-primary) !important;
179
+ --thumb-border: var(--color-border-primary) !important;
161
180
  }
162
181
 
163
182
  .play-icon-wrapper {
@@ -207,30 +226,30 @@ r.styles = u`
207
226
  width: 0;
208
227
  }
209
228
  `;
210
- a([
211
- c({ type: Array })
212
- ], r.prototype, "thumbnails", 2);
213
- a([
214
- c({ type: Number })
215
- ], r.prototype, "activeIndex", 2);
216
- a([
217
- c({ type: Array })
218
- ], r.prototype, "disabledIndexes", 2);
219
- a([
220
- c({ type: String })
221
- ], r.prototype, "maxWidth", 2);
222
- a([
223
- c({ type: String })
224
- ], r.prototype, "altressource", 2);
225
- a([
226
- c({ type: Object })
227
- ], r.prototype, "swiperInstance", 2);
228
- a([
229
+ n([
230
+ l({ type: Array })
231
+ ], i.prototype, "thumbnails", 2);
232
+ n([
233
+ l({ type: Number })
234
+ ], i.prototype, "activeIndex", 2);
235
+ n([
236
+ l({ type: Array })
237
+ ], i.prototype, "disabledIndexes", 2);
238
+ n([
239
+ l({ type: String })
240
+ ], i.prototype, "maxWidth", 2);
241
+ n([
242
+ l({ type: String })
243
+ ], i.prototype, "altressource", 2);
244
+ n([
245
+ l({ type: Object })
246
+ ], i.prototype, "swiperInstance", 2);
247
+ n([
229
248
  m()
230
- ], r.prototype, "focusedIndex", 2);
231
- r = a([
232
- b("thumbnail-navigation")
233
- ], r);
249
+ ], i.prototype, "focusedIndex", 2);
250
+ i = n([
251
+ p("thumbnail-navigation")
252
+ ], i);
234
253
  export {
235
- r as ThumbnailNavigation
254
+ i as ThumbnailNavigation
236
255
  };
package/index.mjs CHANGED
@@ -38,4 +38,4 @@ import "./components/search-input.mjs";
38
38
  import "./components/search-input-dropdown.mjs";
39
39
  import "./components/option-tile.mjs";
40
40
  import "./components/option-tile-group.mjs";
41
- globalThis.__FLORID_KIT__ = "3.2.23";
41
+ globalThis.__FLORID_KIT__ = "3.2.25";
package/loader.mjs CHANGED
@@ -4,7 +4,7 @@ import "./components/link.mjs";
4
4
  import "./components/header-simplify.mjs";
5
5
  import "./components/breadcrumb.mjs";
6
6
  import "./components/breadcrumbs.mjs";
7
- globalThis.__FLORID_KIT__ = "3.2.23";
7
+ globalThis.__FLORID_KIT__ = "3.2.25";
8
8
  const i = {
9
9
  "o-accordion": () => import("./components/accordion.mjs"),
10
10
  "o-accordion-group": () => import("./components/accordion-group.mjs"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@florid-kit/components",
3
- "version": "3.2.23",
3
+ "version": "3.2.25",
4
4
  "main": "index.js",
5
5
  "module": "index.mjs",
6
6
  "typings": "index.d.ts",