@florid-kit/components 3.1.12 → 3.1.14

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.
@@ -71,7 +71,7 @@ t.styles = p`
71
71
  align-items: center;
72
72
  justify-content: space-between;
73
73
  gap: var(--spacing-m);
74
- padding: var(--spacing-l) 0;
74
+ padding: var(--spacing-2-xl) 0;
75
75
  background: none;
76
76
  border: 0;
77
77
  cursor: pointer;
@@ -62,7 +62,7 @@ export declare class OccitaneSidePanel extends OccitaneSidePanel_base {
62
62
  private isUnavailableElement;
63
63
  private getFocusableElements;
64
64
  openPanel(): void;
65
- closePanel(): void;
65
+ closePanel(e?: Event): void;
66
66
  private handleClosePanel;
67
67
  private handleFirstClick;
68
68
  private handleSecondClick;
@@ -13,15 +13,15 @@ import { f as T } from "../directive-helpers-BHuwIghp.mjs";
13
13
  * Copyright 2023 Google LLC
14
14
  * SPDX-License-Identifier: Apache-2.0
15
15
  */
16
- function q(t) {
17
- t.addInitializer((e) => {
18
- const o = e;
19
- o.addEventListener("click", async (n) => {
20
- const { type: i, [B]: r } = o, { form: l } = r;
21
- if (!(!l || i === "button") && (await new Promise((b) => {
16
+ function q(e) {
17
+ e.addInitializer((t) => {
18
+ const o = t;
19
+ o.addEventListener("click", async (i) => {
20
+ const { type: n, [B]: r } = o, { form: l } = r;
21
+ if (!(!l || n === "button") && (await new Promise((b) => {
22
22
  setTimeout(b);
23
- }), !n.defaultPrevented)) {
24
- if (i === "reset") {
23
+ }), !i.defaultPrevented)) {
24
+ if (n === "reset") {
25
25
  l.reset();
26
26
  return;
27
27
  }
@@ -45,54 +45,54 @@ function q(t) {
45
45
  * Copyright 2017 Google LLC
46
46
  * SPDX-License-Identifier: BSD-3-Clause
47
47
  */
48
- const v = (t, e) => {
49
- var n;
50
- const o = t._$AN;
48
+ const v = (e, t) => {
49
+ var i;
50
+ const o = e._$AN;
51
51
  if (o === void 0) return !1;
52
- for (const i of o) (n = i._$AO) == null || n.call(i, e, !1), v(i, e);
52
+ for (const n of o) (i = n._$AO) == null || i.call(n, t, !1), v(n, t);
53
53
  return !0;
54
- }, y = (t) => {
55
- let e, o;
54
+ }, y = (e) => {
55
+ let t, o;
56
56
  do {
57
- if ((e = t._$AM) === void 0) break;
58
- o = e._$AN, o.delete(t), t = e;
57
+ if ((t = e._$AM) === void 0) break;
58
+ o = t._$AN, o.delete(e), e = t;
59
59
  } while ((o == null ? void 0 : o.size) === 0);
60
- }, D = (t) => {
61
- for (let e; e = t._$AM; t = e) {
62
- let o = e._$AN;
63
- if (o === void 0) e._$AN = o = /* @__PURE__ */ new Set();
64
- else if (o.has(t)) break;
65
- o.add(t), K(e);
60
+ }, D = (e) => {
61
+ for (let t; t = e._$AM; e = t) {
62
+ let o = t._$AN;
63
+ if (o === void 0) t._$AN = o = /* @__PURE__ */ new Set();
64
+ else if (o.has(e)) break;
65
+ o.add(e), K(t);
66
66
  }
67
67
  };
68
- function H(t) {
69
- this._$AN !== void 0 ? (y(this), this._$AM = t, D(this)) : this._$AM = t;
68
+ function H(e) {
69
+ this._$AN !== void 0 ? (y(this), this._$AM = e, D(this)) : this._$AM = e;
70
70
  }
71
- function M(t, e = !1, o = 0) {
72
- const n = this._$AH, i = this._$AN;
73
- if (i !== void 0 && i.size !== 0) if (e) if (Array.isArray(n)) for (let r = o; r < n.length; r++) v(n[r], !1), y(n[r]);
74
- else n != null && (v(n, !1), y(n));
75
- else v(this, t);
71
+ function M(e, t = !1, o = 0) {
72
+ const i = this._$AH, n = this._$AN;
73
+ if (n !== void 0 && n.size !== 0) if (t) if (Array.isArray(i)) for (let r = o; r < i.length; r++) v(i[r], !1), y(i[r]);
74
+ else i != null && (v(i, !1), y(i));
75
+ else v(this, e);
76
76
  }
77
- const K = (t) => {
78
- t.type == O.CHILD && (t._$AP ?? (t._$AP = M), t._$AQ ?? (t._$AQ = H));
77
+ const K = (e) => {
78
+ e.type == O.CHILD && (e._$AP ?? (e._$AP = M), e._$AQ ?? (e._$AQ = H));
79
79
  };
80
80
  class j extends L {
81
81
  constructor() {
82
82
  super(...arguments), this._$AN = void 0;
83
83
  }
84
- _$AT(e, o, n) {
85
- super._$AT(e, o, n), D(this), this.isConnected = e._$AU;
84
+ _$AT(t, o, i) {
85
+ super._$AT(t, o, i), D(this), this.isConnected = t._$AU;
86
86
  }
87
- _$AO(e, o = !0) {
88
- var n, i;
89
- e !== this.isConnected && (this.isConnected = e, e ? (n = this.reconnected) == null || n.call(this) : (i = this.disconnected) == null || i.call(this)), o && (v(this, e), y(this));
87
+ _$AO(t, o = !0) {
88
+ var i, n;
89
+ t !== this.isConnected && (this.isConnected = t, t ? (i = this.reconnected) == null || i.call(this) : (n = this.disconnected) == null || n.call(this)), o && (v(this, t), y(this));
90
90
  }
91
- setValue(e) {
92
- if (T(this._$Ct)) this._$Ct._$AI(e, this);
91
+ setValue(t) {
92
+ if (T(this._$Ct)) this._$Ct._$AI(t, this);
93
93
  else {
94
94
  const o = [...this._$Ct._$AH];
95
- o[this._$Ci] = e, this._$Ct._$AI(o, this, 0);
95
+ o[this._$Ci] = t, this._$Ct._$AI(o, this, 0);
96
96
  }
97
97
  }
98
98
  disconnected() {
@@ -104,244 +104,244 @@ class N extends j {
104
104
  constructor() {
105
105
  super(...arguments), this.prevData = {};
106
106
  }
107
- render(e) {
107
+ render(t) {
108
108
  return p;
109
109
  }
110
- update(e, [o]) {
111
- var n;
112
- this.element !== e.element && (this.element = e.element), this.host = ((n = e.options) === null || n === void 0 ? void 0 : n.host) || this.element, this.apply(o), this.groom(o), this.prevData = { ...o };
110
+ update(t, [o]) {
111
+ var i;
112
+ this.element !== t.element && (this.element = t.element), this.host = ((i = t.options) === null || i === void 0 ? void 0 : i.host) || this.element, this.apply(o), this.groom(o), this.prevData = { ...o };
113
113
  }
114
- apply(e) {
115
- if (!e)
114
+ apply(t) {
115
+ if (!t)
116
116
  return;
117
- const { prevData: o, element: n } = this;
118
- for (const i in e) {
119
- const r = e[i];
120
- r !== o[i] && (n[i] = r);
117
+ const { prevData: o, element: i } = this;
118
+ for (const n in t) {
119
+ const r = t[n];
120
+ r !== o[n] && (i[n] = r);
121
121
  }
122
122
  }
123
- groom(e) {
124
- const { prevData: o, element: n } = this;
123
+ groom(t) {
124
+ const { prevData: o, element: i } = this;
125
125
  if (o)
126
- for (const i in o)
127
- (!e || !(i in e) && n[i] === o[i]) && (n[i] = void 0);
126
+ for (const n in o)
127
+ (!t || !(n in t) && i[n] === o[n]) && (i[n] = void 0);
128
128
  }
129
129
  }
130
130
  class V extends N {
131
131
  constructor() {
132
132
  super(...arguments), this.eventData = {};
133
133
  }
134
- apply(e) {
135
- if (e)
136
- for (const o in e) {
137
- const n = e[o];
138
- n !== this.eventData[o] && this.applyEvent(o, n);
134
+ apply(t) {
135
+ if (t)
136
+ for (const o in t) {
137
+ const i = t[o];
138
+ i !== this.eventData[o] && this.applyEvent(o, i);
139
139
  }
140
140
  }
141
- applyEvent(e, o) {
142
- const { prevData: n, element: i } = this;
143
- this.eventData[e] = o, n[e] && i.removeEventListener(e, this, o), i.addEventListener(e, this, o);
141
+ applyEvent(t, o) {
142
+ const { prevData: i, element: n } = this;
143
+ this.eventData[t] = o, i[t] && n.removeEventListener(t, this, o), n.addEventListener(t, this, o);
144
144
  }
145
- groom(e) {
146
- const { prevData: o, element: n } = this;
145
+ groom(t) {
146
+ const { prevData: o, element: i } = this;
147
147
  if (o)
148
- for (const i in o)
149
- (!e || !(i in e) && n[i] === o[i]) && this.groomEvent(i, o[i]);
148
+ for (const n in o)
149
+ (!t || !(n in t) && i[n] === o[n]) && this.groomEvent(n, o[n]);
150
150
  }
151
- groomEvent(e, o) {
152
- const { element: n } = this;
153
- delete this.eventData[e], n.removeEventListener(e, this, o);
151
+ groomEvent(t, o) {
152
+ const { element: i } = this;
153
+ delete this.eventData[t], i.removeEventListener(t, this, o);
154
154
  }
155
- handleEvent(e) {
156
- const o = this.eventData[e.type];
157
- typeof o == "function" ? o.call(this.host, e) : o.handleEvent(e);
155
+ handleEvent(t) {
156
+ const o = this.eventData[t.type];
157
+ typeof o == "function" ? o.call(this.host, t) : o.handleEvent(t);
158
158
  }
159
159
  disconnected() {
160
- const { eventData: e, element: o } = this;
161
- for (const n in e) {
162
- const i = n.slice(1), r = e[n];
163
- o.removeEventListener(i, this, r);
160
+ const { eventData: t, element: o } = this;
161
+ for (const i in t) {
162
+ const n = i.slice(1), r = t[i];
163
+ o.removeEventListener(n, this, r);
164
164
  }
165
165
  }
166
166
  reconnected() {
167
- const { eventData: e, element: o } = this;
168
- for (const n in e) {
169
- const i = n.slice(1), r = e[n];
170
- o.addEventListener(i, this, r);
167
+ const { eventData: t, element: o } = this;
168
+ for (const i in t) {
169
+ const n = i.slice(1), r = t[i];
170
+ o.addEventListener(n, this, r);
171
171
  }
172
172
  }
173
173
  }
174
174
  class X extends V {
175
- apply(e) {
176
- if (!e)
175
+ apply(t) {
176
+ if (!t)
177
177
  return;
178
- const { prevData: o, element: n } = this;
179
- for (const i in e) {
180
- const r = e[i];
181
- if (r === o[i])
178
+ const { prevData: o, element: i } = this;
179
+ for (const n in t) {
180
+ const r = t[n];
181
+ if (r === o[n])
182
182
  continue;
183
- const l = i.slice(1);
184
- switch (i[0]) {
183
+ const l = n.slice(1);
184
+ switch (n[0]) {
185
185
  case "@":
186
186
  this.eventData[l] = r, this.applyEvent(l, r);
187
187
  break;
188
188
  case ".":
189
- n[l] = r;
189
+ i[l] = r;
190
190
  break;
191
191
  case "?":
192
- r ? n.setAttribute(l, "") : n.removeAttribute(l);
192
+ r ? i.setAttribute(l, "") : i.removeAttribute(l);
193
193
  break;
194
194
  default:
195
- r != null ? n.setAttribute(i, String(r)) : n.removeAttribute(i);
195
+ r != null ? i.setAttribute(n, String(r)) : i.removeAttribute(n);
196
196
  break;
197
197
  }
198
198
  }
199
199
  }
200
- groom(e) {
201
- const { prevData: o, element: n } = this;
200
+ groom(t) {
201
+ const { prevData: o, element: i } = this;
202
202
  if (o)
203
- for (const i in o) {
204
- const r = i.slice(1);
205
- if (!e || !(i in e) && n[r] === o[i])
206
- switch (i[0]) {
203
+ for (const n in o) {
204
+ const r = n.slice(1);
205
+ if (!t || !(n in t) && i[r] === o[n])
206
+ switch (n[0]) {
207
207
  case "@":
208
- this.groomEvent(r, o[i]);
208
+ this.groomEvent(r, o[n]);
209
209
  break;
210
210
  case ".":
211
- n[r] = void 0;
211
+ i[r] = void 0;
212
212
  break;
213
213
  case "?":
214
- n.removeAttribute(r);
214
+ i.removeAttribute(r);
215
215
  break;
216
216
  default:
217
- n.removeAttribute(i);
217
+ i.removeAttribute(n);
218
218
  break;
219
219
  }
220
220
  }
221
221
  }
222
222
  }
223
223
  const k = R(X);
224
- var U = Object.defineProperty, W = Object.getOwnPropertyDescriptor, c = (t, e, o, n) => {
225
- for (var i = n > 1 ? void 0 : n ? W(e, o) : e, r = t.length - 1, l; r >= 0; r--)
226
- (l = t[r]) && (i = (n ? l(e, o, i) : l(i)) || i);
227
- return n && i && U(e, o, i), i;
224
+ var U = Object.defineProperty, W = Object.getOwnPropertyDescriptor, c = (e, t, o, i) => {
225
+ for (var n = i > 1 ? void 0 : i ? W(t, o) : t, r = e.length - 1, l; r >= 0; r--)
226
+ (l = e[r]) && (n = (i ? l(t, o, n) : l(n)) || n);
227
+ return i && n && U(t, o, n), n;
228
228
  };
229
229
  let a = class extends S(w) {
230
230
  constructor() {
231
- super(...arguments), this.open = !1, this.showHeader = !0, this.showFooter = !1, this.showHeaderStartIcon = !1, this.headerTitle = "", this.headerTitleClassName = "panel-title", this.labelDialog = "", this.labelAriaDialogPanel = "", this.addToBagProductCount = "", this.closeButtonLabel = "Close the modal", this.goBackButtonLabel = "Go back to", this.firstButtonLabel = "Close", this.firstButtonVariant = "primary", this.firstButtonProps = {}, this.onFirstButtonClickClose = !1, this.secondButtonLabel = "", this.secondButtonVariant = "secondary", this.secondButtonProps = {}, this.onSecondButtonClickClose = !1, this.stickyFooter = !1, this.disablePortal = !1, this.zIndex = 99, this.initialized = !1, this.showDetail = !1, this.isHidingDetail = !1, this.previousFocusedElement = null, this.previousFocusedSelector = null, this._hideTimeout = null, this._onOpenDetail = async (t) => {
232
- var o, n;
233
- const e = ((o = t.detail) == null ? void 0 : o.origin) ?? document.activeElement;
234
- if (this._detailOriginEl = e, this._detailOriginClass = (e == null ? void 0 : e.className) ?? "", this.showDetail = !0, this.showHeaderStartIcon = !0, await this.updateComplete, this._detailOriginClass) {
235
- const i = (n = this.shadowRoot) == null ? void 0 : n.querySelector(".detail-view");
236
- i && i.setAttribute("fromelement", this._detailOriginClass);
231
+ super(...arguments), this.open = !1, this.showHeader = !0, this.showFooter = !1, this.showHeaderStartIcon = !1, this.headerTitle = "", this.headerTitleClassName = "panel-title", this.labelDialog = "", this.labelAriaDialogPanel = "", this.addToBagProductCount = "", this.closeButtonLabel = "Close the modal", this.goBackButtonLabel = "Go back to", this.firstButtonLabel = "Close", this.firstButtonVariant = "primary", this.firstButtonProps = {}, this.onFirstButtonClickClose = !1, this.secondButtonLabel = "", this.secondButtonVariant = "secondary", this.secondButtonProps = {}, this.onSecondButtonClickClose = !1, this.stickyFooter = !1, this.disablePortal = !1, this.zIndex = 99, this.initialized = !1, this.showDetail = !1, this.isHidingDetail = !1, this.previousFocusedElement = null, this.previousFocusedSelector = null, this._hideTimeout = null, this._onOpenDetail = async (e) => {
232
+ var o, i;
233
+ const t = ((o = e.detail) == null ? void 0 : o.origin) ?? document.activeElement;
234
+ if (this._detailOriginEl = t, this._detailOriginClass = (t == null ? void 0 : t.className) ?? "", this.showDetail = !0, this.showHeaderStartIcon = !0, await this.updateComplete, this._detailOriginClass) {
235
+ const n = (i = this.shadowRoot) == null ? void 0 : i.querySelector(".detail-view");
236
+ n && n.setAttribute("fromelement", this._detailOriginClass);
237
237
  }
238
238
  await this.focusDetailReturnBtn();
239
- }, this._detailOriginEl = null, this._detailOriginClass = "", this.handleKeyDown = (t) => {
240
- this.open && (t.key === "Escape" ? this.closePanel() : t.key === "Tab" && this.trapFocus(t));
241
- }, this.handleClosePanel = (t) => {
242
- if (t instanceof KeyboardEvent && t.key !== "Enter" && t.key !== " ")
239
+ }, this._detailOriginEl = null, this._detailOriginClass = "", this.handleKeyDown = (e) => {
240
+ this.open && (e.key === "Escape" ? this.closePanel(e) : e.key === "Tab" && this.trapFocus(e));
241
+ }, this.handleClosePanel = (e) => {
242
+ if (e instanceof KeyboardEvent && e.key !== "Enter" && e.key !== " ")
243
243
  return;
244
- t.preventDefault(), t.stopPropagation();
245
- const e = t.currentTarget, o = (e == null ? void 0 : e.getAttribute("data-role")) === "back";
244
+ e.preventDefault(), e.type === "keydown" && e.stopPropagation();
245
+ const t = e.currentTarget, o = (t == null ? void 0 : t.getAttribute("data-role")) === "back";
246
246
  if (this.showDetail && o) {
247
247
  this.isHidingDetail = !0;
248
- const n = this.renderRoot.querySelector(".content"), i = async () => {
248
+ const i = this.renderRoot.querySelector(".content"), n = async () => {
249
249
  this.showDetail = !1, this.isHidingDetail = !1, this.showHeaderStartIcon = !1, await this.updateComplete, this._restoreFocusToOrigin();
250
250
  };
251
- if (n) {
251
+ if (i) {
252
252
  this.showHeaderStartIcon = !1;
253
253
  const r = () => {
254
- this.showDetail = !1, this.isHidingDetail = !1, n.removeEventListener("animationend", r), i();
254
+ this.showDetail = !1, this.isHidingDetail = !1, i.removeEventListener("animationend", r), n();
255
255
  };
256
- n.addEventListener("animationend", r);
256
+ i.addEventListener("animationend", r);
257
257
  } else
258
258
  this.showDetail = !1, this.isHidingDetail = !1, this.showHeaderStartIcon = !1;
259
259
  return;
260
260
  }
261
- this.closePanel();
261
+ this.closePanel(e);
262
262
  };
263
263
  }
264
264
  focusFirstInPanel() {
265
- var e, o, n;
266
- (n = this.getFocusableElements().filter((i) => !!i && !i.hasAttribute("disabled"))[0] ?? ((e = this.shadowRoot) == null ? void 0 : e.querySelector(".close-btn")) ?? ((o = this.shadowRoot) == null ? void 0 : o.querySelector(".panel"))) == null || n.focus({ preventScroll: !0 });
265
+ var t, o, i;
266
+ (i = this.getFocusableElements().filter((n) => !!n && !n.hasAttribute("disabled"))[0] ?? ((t = this.shadowRoot) == null ? void 0 : t.querySelector(".close-btn")) ?? ((o = this.shadowRoot) == null ? void 0 : o.querySelector(".panel"))) == null || i.focus({ preventScroll: !0 });
267
267
  }
268
- resolveFocusable(t) {
268
+ resolveFocusable(e) {
269
269
  var o;
270
- const e = t.tagName.toLowerCase();
271
- return e === "o-icon-button" || e === "o-button" ? ((o = t.shadowRoot) == null ? void 0 : o.querySelector("button, .button")) ?? t : t;
270
+ const t = e.tagName.toLowerCase();
271
+ return t === "o-icon-button" || t === "o-button" ? ((o = e.shadowRoot) == null ? void 0 : o.querySelector("button, .button")) ?? e : e;
272
272
  }
273
273
  connectedCallback() {
274
274
  super.connectedCallback(), !this.disablePortal && this.parentElement !== document.body && document.body.appendChild(this), this.addEventListener("keydown", this.handleKeyDown), this.updateComplete.then(() => {
275
275
  this.initialized = !0;
276
- }), this.addEventListener("open-detail", this._onOpenDetail), this.addEventListener("focusin", (t) => {
277
- t.composedPath()[0] === this && this.focusFirstInPanel();
276
+ }), this.addEventListener("open-detail", this._onOpenDetail), this.addEventListener("focusin", (e) => {
277
+ e.composedPath()[0] === this && this.focusFirstInPanel();
278
278
  });
279
279
  }
280
280
  disconnectedCallback() {
281
281
  document.body.style.overflow = "", document.body.removeAttribute("data-side-panel"), this.removeEventListener("keydown", this.handleKeyDown), super.disconnectedCallback(), this.removeEventListener("open-detail", this._onOpenDetail);
282
282
  }
283
283
  async focusDetailReturnBtn() {
284
- var i, r, l, b, f;
284
+ var n, r, l, b, f;
285
285
  await this.updateComplete;
286
- const t = this.getDeepActiveElement(document);
287
- if (t && t !== document.body)
286
+ const e = this.getDeepActiveElement(document);
287
+ if (e && e !== document.body)
288
288
  try {
289
- t.blur();
289
+ e.blur();
290
290
  } catch {
291
291
  }
292
292
  await new Promise(requestAnimationFrame);
293
- const e = (i = this.shadowRoot) == null ? void 0 : i.querySelector(".detail-view .return-btn");
294
- if (!e) return;
295
- e.updateComplete && await e.updateComplete, (b = (l = ((r = e.shadowRoot) == null ? void 0 : r.querySelector("button")) ?? e) == null ? void 0 : l.focus) == null || b.call(l, { preventScroll: !0 });
296
- const n = (f = this.shadowRoot) == null ? void 0 : f.querySelector('.panel[role="dialog"]');
297
- n && n.setAttribute("aria-label", this.labelAriaDialogPanel || "panel-title");
293
+ const t = (n = this.shadowRoot) == null ? void 0 : n.querySelector(".detail-view .return-btn");
294
+ if (!t) return;
295
+ t.updateComplete && await t.updateComplete, (b = (l = ((r = t.shadowRoot) == null ? void 0 : r.querySelector("button")) ?? t) == null ? void 0 : l.focus) == null || b.call(l, { preventScroll: !0 });
296
+ const i = (f = this.shadowRoot) == null ? void 0 : f.querySelector('.panel[role="dialog"]');
297
+ i && i.setAttribute("aria-label", this.labelAriaDialogPanel || "panel-title");
298
298
  }
299
299
  _restoreFocusToOrigin() {
300
- var e, o;
301
- const t = this._detailOriginEl;
302
- !t || !document.contains(t) || ((o = (e = document.activeElement) == null ? void 0 : e.blur) == null || o.call(e), requestAnimationFrame(() => {
303
- var i;
304
- t.classList.add("a--tabfocus"), (((i = t.shadowRoot) == null ? void 0 : i.querySelector('button, .button, [tabindex]:not([tabindex="-1"])')) ?? null ?? t).focus({ preventScroll: !0 });
300
+ var t, o;
301
+ const e = this._detailOriginEl;
302
+ !e || !document.contains(e) || ((o = (t = document.activeElement) == null ? void 0 : t.blur) == null || o.call(t), requestAnimationFrame(() => {
303
+ var n;
304
+ e.classList.add("a--tabfocus"), (((n = e.shadowRoot) == null ? void 0 : n.querySelector('button, .button, [tabindex]:not([tabindex="-1"])')) ?? null ?? e).focus({ preventScroll: !0 });
305
305
  }));
306
306
  }
307
- getDeepActiveElement(t = this.shadowRoot) {
308
- let e = t.activeElement;
309
- for (; e && e.shadowRoot && e.shadowRoot.activeElement; )
310
- e = e.shadowRoot.activeElement;
311
- return e;
307
+ getDeepActiveElement(e = this.shadowRoot) {
308
+ let t = e.activeElement;
309
+ for (; t && t.shadowRoot && t.shadowRoot.activeElement; )
310
+ t = t.shadowRoot.activeElement;
311
+ return t;
312
312
  }
313
- wrapFocus(t, e, o) {
313
+ wrapFocus(e, t, o) {
314
314
  var r;
315
315
  if (!o.length) {
316
- t.preventDefault(), t.stopPropagation(), (r = this.renderRoot.querySelector(".panel")) == null || r.focus({ preventScroll: !0 });
316
+ e.preventDefault(), e.stopPropagation(), (r = this.renderRoot.querySelector(".panel")) == null || r.focus({ preventScroll: !0 });
317
317
  return;
318
318
  }
319
- const n = o[0], i = o[o.length - 1];
320
- !e || !o.includes(e) ? (t.preventDefault(), t.stopPropagation(), (t.shiftKey ? i : n).focus({ preventScroll: !0 })) : !t.shiftKey && e === i ? (t.preventDefault(), t.stopPropagation(), n.focus({ preventScroll: !0 })) : t.shiftKey && e === n && (t.preventDefault(), t.stopPropagation(), i.focus({ preventScroll: !0 }));
319
+ const i = o[0], n = o[o.length - 1];
320
+ !t || !o.includes(t) ? (e.preventDefault(), e.stopPropagation(), (e.shiftKey ? n : i).focus({ preventScroll: !0 })) : !e.shiftKey && t === n ? (e.preventDefault(), e.stopPropagation(), i.focus({ preventScroll: !0 })) : e.shiftKey && t === i && (e.preventDefault(), e.stopPropagation(), n.focus({ preventScroll: !0 }));
321
321
  }
322
- trapFocus(t) {
323
- if (t.key !== "Tab") return;
324
- const e = this.shadowRoot;
325
- if (!e) return;
322
+ trapFocus(e) {
323
+ if (e.key !== "Tab") return;
324
+ const t = this.shadowRoot;
325
+ if (!t) return;
326
326
  const o = this.getFocusableElements();
327
- t.target && t.target.closest("o-side-panel") && !o.includes(t.target) && o.splice(1, 0, t.target);
328
- const n = t.composedPath()[0] ?? this.getDeepActiveElement(document);
327
+ e.target && e.target.closest("o-side-panel") && !o.includes(e.target) && o.splice(1, 0, e.target);
328
+ const i = e.composedPath()[0] ?? this.getDeepActiveElement(document);
329
329
  if (this.showDetail) {
330
- this.wrapFocus(t, n, o);
330
+ this.wrapFocus(e, i, o);
331
331
  return;
332
332
  }
333
333
  if (document.querySelector("#refineandsortpopin")) {
334
- const l = e.querySelector(".close-btn"), b = l ? this.resolveFocusable(l) : null, f = e.querySelector(".js-clear-refinements"), m = f ? this.resolveFocusable(f) : null, x = (P) => {
335
- t.preventDefault(), t.stopPropagation(), P.focus();
334
+ const l = t.querySelector(".close-btn"), b = l ? this.resolveFocusable(l) : null, f = t.querySelector(".js-clear-refinements"), m = f ? this.resolveFocusable(f) : null, x = (P) => {
335
+ e.preventDefault(), e.stopPropagation(), P.focus();
336
336
  };
337
337
  if (b && m) {
338
- if (!t.shiftKey && n === m) return x(b);
339
- if (t.shiftKey && n === b) return x(m);
338
+ if (!e.shiftKey && i === m) return x(b);
339
+ if (e.shiftKey && i === b) return x(m);
340
340
  }
341
341
  }
342
342
  const r = this.renderRoot.querySelector(".close-btn");
343
- if (!t.shiftKey && r && r.contains(n)) {
344
- t.preventDefault();
343
+ if (!e.shiftKey && r && r.contains(i)) {
344
+ e.preventDefault();
345
345
  const l = this.renderRoot.querySelector(
346
346
  ".o-whats-inside--content p"
347
347
  );
@@ -350,83 +350,83 @@ let a = class extends S(w) {
350
350
  return;
351
351
  }
352
352
  }
353
- this.wrapFocus(t, n, o);
353
+ this.wrapFocus(e, i, o);
354
354
  }
355
- isUnavailableElement(t) {
356
- if (!(t instanceof HTMLElement)) return !1;
357
- if (t.disabled || t.hasAttribute("disabled") || t.getAttribute("tabindex") === "-1" || t.closest("[hidden], [inert], [aria-hidden='true']")) return !0;
358
- const e = t.ownerDocument.defaultView, o = e == null ? void 0 : e.getComputedStyle(t);
355
+ isUnavailableElement(e) {
356
+ if (!(e instanceof HTMLElement)) return !1;
357
+ if (e.disabled || e.hasAttribute("disabled") || e.getAttribute("tabindex") === "-1" || e.closest("[hidden], [inert], [aria-hidden='true']")) return !0;
358
+ const t = e.ownerDocument.defaultView, o = t == null ? void 0 : t.getComputedStyle(e);
359
359
  return (o == null ? void 0 : o.display) === "none" || (o == null ? void 0 : o.visibility) === "hidden" || (o == null ? void 0 : o.visibility) === "collapse";
360
360
  }
361
361
  getFocusableElements() {
362
- const t = this.showDetail ? this.renderRoot.querySelector(".detail-view") : this.renderRoot.querySelector(".panel");
363
- if (!t) return [];
364
- const e = (r) => this.isUnavailableElement(r) ? !1 : r.matches(a.focusablesSelector), o = [], n = /* @__PURE__ */ new Set(), i = (r) => {
365
- if (n.has(r) || (n.add(r), r instanceof HTMLElement && r.closest("[hidden], [inert], [aria-hidden='true']"))) return;
366
- if (e(r)) {
362
+ const e = this.showDetail ? this.renderRoot.querySelector(".detail-view") : this.renderRoot.querySelector(".panel");
363
+ if (!e) return [];
364
+ const t = (r) => this.isUnavailableElement(r) ? !1 : r.matches(a.focusablesSelector), o = [], i = /* @__PURE__ */ new Set(), n = (r) => {
365
+ if (i.has(r) || (i.add(r), r instanceof HTMLElement && r.closest("[hidden], [inert], [aria-hidden='true']"))) return;
366
+ if (t(r)) {
367
367
  const f = this.resolveFocusable(r);
368
368
  f && !this.isUnavailableElement(f) && o.push(f);
369
369
  }
370
370
  const l = r.tagName.toLowerCase();
371
371
  if (l === "o-icon-button" || l === "o-button") return;
372
372
  if (r instanceof HTMLSlotElement) {
373
- r.assignedElements({ flatten: !0 }).forEach(i);
373
+ r.assignedElements({ flatten: !0 }).forEach(n);
374
374
  return;
375
375
  }
376
376
  const b = r.shadowRoot;
377
- b && Array.from(b.children).forEach(i), Array.from(r.children).forEach(i);
377
+ b && Array.from(b.children).forEach(n), Array.from(r.children).forEach(n);
378
378
  };
379
- return i(t), o;
379
+ return n(e), o;
380
380
  }
381
381
  openPanel() {
382
- var e;
383
- this.removeAttribute("hidden"), this.getBoundingClientRect(), this.previousFocusedElement = document.activeElement, this.previousFocusedSelector = (e = this.previousFocusedElement) == null ? void 0 : e.getAttribute("paneltarget"), this.open = !0, document.body.style.overflow = "hidden", document.body.setAttribute("data-side-panel", "open");
384
- const t = this.renderRoot.querySelector(".panel");
385
- t && t.setAttribute("aria-modal", "true"), this.updateComplete.then(async () => {
386
- var o, n;
382
+ var t;
383
+ this.removeAttribute("hidden"), this.getBoundingClientRect(), this.previousFocusedElement = document.activeElement, this.previousFocusedSelector = (t = this.previousFocusedElement) == null ? void 0 : t.getAttribute("paneltarget"), this.open = !0, document.body.style.overflow = "hidden", document.body.setAttribute("data-side-panel", "open");
384
+ const e = this.renderRoot.querySelector(".panel");
385
+ e && e.setAttribute("aria-modal", "true"), this.updateComplete.then(async () => {
386
+ var o, i;
387
387
  if (this.showHeader) {
388
- const i = (o = this.shadowRoot) == null ? void 0 : o.querySelector(".panel .close-btn");
389
- i != null && i.updateComplete && await i.updateComplete;
390
- const r = this.resolveFocusable(i);
391
- (n = r == null ? void 0 : r.focus) == null || n.call(r, { preventScroll: !0 });
388
+ const n = (o = this.shadowRoot) == null ? void 0 : o.querySelector(".panel .close-btn");
389
+ n != null && n.updateComplete && await n.updateComplete;
390
+ const r = this.resolveFocusable(n);
391
+ (i = r == null ? void 0 : r.focus) == null || i.call(r, { preventScroll: !0 });
392
392
  } else
393
393
  this.focusFirstInPanel();
394
394
  }), this.dispatchEvent(
395
395
  new CustomEvent("open", { bubbles: !0, composed: !0 })
396
396
  );
397
397
  }
398
- closePanel() {
399
- var o, n, i;
398
+ closePanel(e) {
399
+ var i, n, r;
400
400
  this.open = !1, this.showDetail = !1, document.body.style.overflow = "", document.body.removeAttribute("data-side-panel");
401
401
  let t = this.previousFocusedElement;
402
- t != null && t.isConnected || (t = document.querySelector(`[paneltarget="${this.previousFocusedSelector}"]`)), (t == null ? void 0 : t.tagName.toLowerCase()) === "o-button" ? (i = (n = (o = t.shadowRoot) == null ? void 0 : o.querySelector(".button")) == null ? void 0 : n.focus) == null || i.call(n) : t == null || t.focus();
403
- const e = this.renderRoot.querySelector(".panel");
404
- e && e.removeAttribute("aria-modal"), this.dispatchEvent(
405
- new CustomEvent("close", { bubbles: !0, composed: !0 })
402
+ t != null && t.isConnected || (t = document.querySelector(`[paneltarget="${this.previousFocusedSelector}"]`)), (t == null ? void 0 : t.tagName.toLowerCase()) === "o-button" ? (r = (n = (i = t.shadowRoot) == null ? void 0 : i.querySelector(".button")) == null ? void 0 : n.focus) == null || r.call(n) : t == null || t.focus();
403
+ const o = this.renderRoot.querySelector(".panel");
404
+ o && o.removeAttribute("aria-modal"), this.dispatchEvent(
405
+ new CustomEvent("close", { bubbles: !0, composed: !0, detail: { event: e } })
406
406
  );
407
407
  }
408
- handleFirstClick(t) {
409
- t instanceof KeyboardEvent && t.key !== "Enter" && t.key !== " " || (t.preventDefault(), t.stopPropagation(), this.onFirstButtonClickClose && this.closePanel(), this.dispatchEvent(
408
+ handleFirstClick(e) {
409
+ e instanceof KeyboardEvent && e.key !== "Enter" && e.key !== " " || (e.preventDefault(), e.stopPropagation(), this.onFirstButtonClickClose && this.closePanel(e), this.dispatchEvent(
410
410
  new CustomEvent("firstbuttonclick", {
411
411
  bubbles: !0,
412
412
  composed: !0,
413
413
  cancelable: !0,
414
414
  detail: {
415
415
  button: "first",
416
- target: t.target
416
+ target: e.target
417
417
  }
418
418
  })
419
419
  ));
420
420
  }
421
- handleSecondClick(t) {
422
- t instanceof KeyboardEvent && t.key !== "Enter" && t.key !== " " || (t.preventDefault(), t.stopPropagation(), this.onSecondButtonClickClose && this.closePanel(), this.dispatchEvent(
421
+ handleSecondClick(e) {
422
+ e instanceof KeyboardEvent && e.key !== "Enter" && e.key !== " " || (e.preventDefault(), e.stopPropagation(), this.onSecondButtonClickClose && this.closePanel(e), this.dispatchEvent(
423
423
  new CustomEvent("secondbuttonclick", {
424
424
  bubbles: !0,
425
425
  composed: !0,
426
426
  cancelable: !0,
427
427
  detail: {
428
428
  button: "second",
429
- target: t.target
429
+ target: e.target
430
430
  }
431
431
  })
432
432
  ));
@@ -437,7 +437,7 @@ let a = class extends S(w) {
437
437
  }, 500);
438
438
  }
439
439
  render() {
440
- const t = this.showHeader ? h`
440
+ const e = this.showHeader ? h`
441
441
  <div tabindex="-1" part="header" class="header ${this.showDetail ? "detail-view-header" : ""}">
442
442
  ${this.showHeaderStartIcon ? h`
443
443
  <o-icon-button
@@ -470,7 +470,7 @@ let a = class extends S(w) {
470
470
  aria-describedby="panel-title"
471
471
  ></o-icon-button>
472
472
  </div>
473
- ` : null, e = this.showFooter ? h`
473
+ ` : null, t = this.showFooter ? h`
474
474
  <div class="footer" part="footer">
475
475
  ${this.firstButtonVariant && this.firstButtonLabel ? h`
476
476
  <o-button
@@ -505,13 +505,13 @@ let a = class extends S(w) {
505
505
  tabindex="-1"
506
506
  >
507
507
  <div role="document">
508
- ${t}
508
+ ${e}
509
509
 
510
510
  <div part="content" class="content ${this.isHidingDetail ? "slide-out-right" : ""} ${this.showDetail ? "with-detail" : ""}">
511
511
 
512
512
  ${this.showDetail ? h`
513
513
  <div class="detail-view">
514
- ${t}
514
+ ${e}
515
515
  <div class="detail-content">
516
516
  <div class="detail-scroller">
517
517
  <slot name="detail"></slot>
@@ -521,9 +521,9 @@ let a = class extends S(w) {
521
521
  ` : h`<slot></slot>`}
522
522
  </div>
523
523
 
524
- ${this.stickyFooter ? null : e}
524
+ ${this.stickyFooter ? null : t}
525
525
  </div>
526
- ${this.stickyFooter ? e : null}
526
+ ${this.stickyFooter ? t : null}
527
527
  </div>
528
528
  `;
529
529
  }
@@ -856,10 +856,10 @@ c([
856
856
  a = c([
857
857
  E("o-side-panel")
858
858
  ], a);
859
- var G = Object.defineProperty, Q = Object.getOwnPropertyDescriptor, u = (t, e, o, n) => {
860
- for (var i = n > 1 ? void 0 : n ? Q(e, o) : e, r = t.length - 1, l; r >= 0; r--)
861
- (l = t[r]) && (i = (n ? l(e, o, i) : l(i)) || i);
862
- return n && i && G(e, o, i), i;
859
+ var G = Object.defineProperty, Q = Object.getOwnPropertyDescriptor, u = (e, t, o, i) => {
860
+ for (var n = i > 1 ? void 0 : i ? Q(t, o) : t, r = e.length - 1, l; r >= 0; r--)
861
+ (l = e[r]) && (n = (i ? l(t, o, n) : l(n)) || n);
862
+ return i && n && G(t, o, n), n;
863
863
  };
864
864
  const J = S(A(w)), lt = ["primary", "secondary", "ghost", "tertiary", "link"];
865
865
  let d = class extends J {
@@ -869,46 +869,46 @@ let d = class extends J {
869
869
  get name() {
870
870
  return this.getAttribute("name") ?? "";
871
871
  }
872
- set name(t) {
873
- this.setAttribute("name", t);
872
+ set name(e) {
873
+ this.setAttribute("name", e);
874
874
  }
875
875
  get form() {
876
876
  return this[B].form;
877
877
  }
878
- handleClick(t) {
879
- if (!(t instanceof KeyboardEvent && !["Enter", " "].includes(t.key)) && this.panelTarget) {
880
- const e = document.getElementById(this.panelTarget);
881
- e instanceof a && (e != null && e.openPanel) && typeof e.openPanel == "function" ? (t.preventDefault(), e.openPanel()) : console.warn(`[o-button] No side panel with id="${this.panelTarget}" found or it does not have an openPanel method.`);
878
+ handleClick(e) {
879
+ if (!(e instanceof KeyboardEvent && !["Enter", " "].includes(e.key)) && this.panelTarget) {
880
+ const t = document.getElementById(this.panelTarget);
881
+ t instanceof a && (t != null && t.openPanel) && typeof t.openPanel == "function" ? (e.preventDefault(), t.openPanel()) : console.warn(`[o-button] No side panel with id="${this.panelTarget}" found or it does not have an openPanel method.`);
882
882
  }
883
883
  }
884
884
  render() {
885
885
  return this.href ? this.renderLink() : this.renderButton();
886
886
  }
887
887
  connectedCallback() {
888
- var o, n;
888
+ var o, i;
889
889
  super.connectedCallback();
890
- const t = (o = this.startIconModel) == null ? void 0 : o.startsWith("occ-"), e = (n = this.endIconModel) == null ? void 0 : n.startsWith("occ-");
891
- (t || e) && (t && $(this.startIconModel), e && $(this.endIconModel), this._unsubOcc = _(() => this.requestUpdate()));
890
+ const e = (o = this.startIconModel) == null ? void 0 : o.startsWith("occ-"), t = (i = this.endIconModel) == null ? void 0 : i.startsWith("occ-");
891
+ (e || t) && (e && $(this.startIconModel), t && $(this.endIconModel), this._unsubOcc = _(() => this.requestUpdate()));
892
892
  }
893
893
  disconnectedCallback() {
894
- var t;
895
- (t = this._unsubOcc) == null || t.call(this), super.disconnectedCallback();
894
+ var e;
895
+ (e = this._unsubOcc) == null || e.call(this), super.disconnectedCallback();
896
896
  }
897
- renderIcon(t) {
898
- const e = t === "start" ? this.startIconModel : this.endIconModel;
899
- if (!e) return p;
900
- const o = I[e] ?? "";
897
+ renderIcon(e) {
898
+ const t = e === "start" ? this.startIconModel : this.endIconModel;
899
+ if (!t) return p;
900
+ const o = I[t] ?? "";
901
901
  if (!o) return p;
902
- const n = F(o);
903
- return h`<span class="${t === "start" ? "icon-start" : "icon-end"}">${z(n)}</span>`;
902
+ const i = F(o);
903
+ return h`<span class="${e === "start" ? "icon-start" : "icon-end"}">${z(i)}</span>`;
904
904
  }
905
905
  renderButton() {
906
- const t = this.text || this.textsecond;
906
+ const e = this.text || this.textsecond;
907
907
  return h`
908
908
  <button type=${this.type} class="button" ?disabled=${this.disabled} @click=${this.handleClick} @keydown=${this.handleClick}
909
909
  aria-describedby=${this.describedBy || p} aria-expanded=${this.ariaExpanded || p} >
910
910
  ${this.startIcon ? this.renderIcon("start") : p}
911
- ${t ? h`
911
+ ${e ? h`
912
912
  ${this.text ? h`<span class="text">${this.text}</span>` : p}
913
913
  ${this.textsecond ? h`<span class="text">${this.textsecond}</span>` : p}
914
914
  ${this.withbadge ? h`<slot></slot>` : p}
@@ -918,7 +918,7 @@ let d = class extends J {
918
918
  `;
919
919
  }
920
920
  renderLink() {
921
- const t = this.text || this.textsecond;
921
+ const e = this.text || this.textsecond;
922
922
  return h`
923
923
  <a
924
924
  href=${this.href}
@@ -931,7 +931,7 @@ let d = class extends J {
931
931
  aria-describedby=${this.describedBy || p}
932
932
  >
933
933
  ${this.startIcon ? this.renderIcon("start") : p}
934
- ${t ? h`
934
+ ${e ? h`
935
935
  ${this.text ? h`<span>${this.text}</span>` : p}
936
936
  ${this.textsecond ? h`<span>${this.textsecond}</span>` : p}
937
937
  ` : h`<slot></slot>`}
package/index.mjs CHANGED
@@ -37,4 +37,4 @@ import "./components/search-input.mjs";
37
37
  import "./components/search-input-dropdown.mjs";
38
38
  import "./components/option-tile.mjs";
39
39
  import "./components/option-tile-group.mjs";
40
- globalThis.__FLORID_KIT__ = "3.1.12";
40
+ globalThis.__FLORID_KIT__ = "3.1.14";
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.1.12";
7
+ globalThis.__FLORID_KIT__ = "3.1.14";
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.1.12",
3
+ "version": "3.1.14",
4
4
  "main": "index.js",
5
5
  "module": "index.mjs",
6
6
  "typings": "index.d.ts",