@florid-kit/components 3.0.1 → 3.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/icons/icons.d.ts +8 -2
- package/assets/icons/occ-gen/occ-address.d.ts +5 -0
- package/assets/icons/occ-gen/occ-autorep.d.ts +5 -0
- package/assets/icons/occ-gen/occ-back.d.ts +5 -0
- package/assets/icons/occ-gen/occ-bag-filled.d.ts +5 -0
- package/assets/icons/occ-gen/occ-bag-outlined.d.ts +5 -0
- package/assets/icons/occ-gen/occ-bag-strike.d.ts +5 -0
- package/assets/icons/occ-gen/occ-bottle.d.ts +5 -0
- package/assets/icons/occ-gen/occ-briefcase.d.ts +5 -0
- package/assets/icons/occ-gen/occ-burger.d.ts +5 -0
- package/assets/icons/occ-gen/occ-card.d.ts +5 -0
- package/assets/icons/occ-gen/occ-career.d.ts +5 -0
- package/assets/icons/occ-gen/occ-check-filled.d.ts +5 -0
- package/assets/icons/occ-gen/occ-check-outlined.d.ts +5 -0
- package/assets/icons/occ-gen/occ-chevron-bottom.d.ts +5 -0
- package/assets/icons/occ-gen/occ-chevron-double.d.ts +5 -0
- package/assets/icons/occ-gen/occ-chevron-left.d.ts +5 -0
- package/assets/icons/occ-gen/occ-chevron-right.d.ts +5 -0
- package/assets/icons/occ-gen/occ-chevron-top.d.ts +5 -0
- package/assets/icons/occ-gen/occ-close-filled.d.ts +5 -0
- package/assets/icons/occ-gen/occ-close-outlined.d.ts +5 -0
- package/assets/icons/occ-gen/occ-cream-tube.d.ts +5 -0
- package/assets/icons/occ-gen/occ-cream.d.ts +5 -0
- package/assets/icons/occ-gen/occ-eye-hide.d.ts +5 -0
- package/assets/icons/occ-gen/occ-eye-show.d.ts +5 -0
- package/assets/icons/occ-gen/occ-gear-outline.d.ts +5 -0
- package/assets/icons/occ-gen/occ-gear.d.ts +5 -0
- package/assets/icons/occ-gen/occ-geoloc.d.ts +5 -0
- package/assets/icons/occ-gen/occ-gift.d.ts +5 -0
- package/assets/icons/occ-gen/occ-group.d.ts +5 -0
- package/assets/icons/occ-gen/occ-hand-shake.d.ts +5 -0
- package/assets/icons/occ-gen/occ-info.d.ts +5 -0
- package/assets/icons/occ-gen/occ-loaders.d.ts +4 -0
- package/assets/icons/occ-gen/occ-location.d.ts +5 -0
- package/assets/icons/occ-gen/occ-mail.d.ts +5 -0
- package/assets/icons/occ-gen/occ-message.d.ts +5 -0
- package/assets/icons/occ-gen/occ-minus.d.ts +5 -0
- package/assets/icons/occ-gen/occ-order-sent.d.ts +5 -0
- package/assets/icons/occ-gen/occ-order.d.ts +5 -0
- package/assets/icons/occ-gen/occ-padlock.d.ts +5 -0
- package/assets/icons/occ-gen/occ-pause.d.ts +5 -0
- package/assets/icons/occ-gen/occ-play.d.ts +5 -0
- package/assets/icons/occ-gen/occ-plus.d.ts +5 -0
- package/assets/icons/occ-gen/occ-product.d.ts +5 -0
- package/assets/icons/occ-gen/occ-profil-filled.d.ts +5 -0
- package/assets/icons/occ-gen/occ-profil-outlined.d.ts +5 -0
- package/assets/icons/occ-gen/occ-refill.d.ts +5 -0
- package/assets/icons/occ-gen/occ-refine.d.ts +5 -0
- package/assets/icons/occ-gen/occ-reward-card.d.ts +5 -0
- package/assets/icons/occ-gen/occ-samples.d.ts +5 -0
- package/assets/icons/occ-gen/occ-search.d.ts +5 -0
- package/assets/icons/occ-gen/occ-star-0.d.ts +5 -0
- package/assets/icons/occ-gen/occ-star-100.d.ts +5 -0
- package/assets/icons/occ-gen/occ-star-25.d.ts +5 -0
- package/assets/icons/occ-gen/occ-star-50.d.ts +5 -0
- package/assets/icons/occ-gen/occ-star-75.d.ts +5 -0
- package/assets/icons/occ-gen/occ-store.d.ts +5 -0
- package/assets/icons/occ-gen/occ-trash.d.ts +5 -0
- package/assets/icons/occ-gen/occ-triangle-down.d.ts +5 -0
- package/assets/icons/occ-gen/occ-triangle-up.d.ts +5 -0
- package/assets/icons/occ-gen/occ-warning-stroke.d.ts +5 -0
- package/assets/icons/occ-gen/occ-warning.d.ts +5 -0
- package/assets/icons/occ-gen/occ-wishlist-filled.d.ts +5 -0
- package/assets/icons/occ-gen/occ-wishlist-outlined.d.ts +5 -0
- package/components/button.mjs +2 -2
- package/components/chip.mjs +1 -1
- package/components/dropdown-variant.mjs +8 -8
- package/components/dropdown.mjs +6 -6
- package/components/filter-chip.mjs +1 -1
- package/components/icon-button.mjs +65 -45
- package/components/rating.d.ts +3 -0
- package/components/rating.mjs +43 -36
- package/components/side-panel.mjs +50 -48
- package/components/toast.mjs +1 -1
- package/components/wishlist-button.d.ts +2 -0
- package/components/wishlist-button.mjs +19 -15
- package/icons/occ-address.mjs +20 -0
- package/icons/occ-autorep.mjs +26 -0
- package/icons/occ-back.mjs +17 -0
- package/icons/occ-bag-filled.mjs +17 -0
- package/icons/occ-bag-outlined.mjs +17 -0
- package/icons/occ-bag-strike.mjs +26 -0
- package/icons/occ-bottle.mjs +20 -0
- package/icons/occ-briefcase.mjs +17 -0
- package/icons/occ-burger.mjs +23 -0
- package/icons/occ-card.mjs +23 -0
- package/icons/occ-career.mjs +43 -0
- package/icons/occ-check-filled.mjs +17 -0
- package/icons/occ-check-outlined.mjs +17 -0
- package/icons/occ-chevron-bottom.mjs +17 -0
- package/icons/occ-chevron-double.mjs +20 -0
- package/icons/occ-chevron-left.mjs +17 -0
- package/icons/occ-chevron-right.mjs +17 -0
- package/icons/occ-chevron-top.mjs +17 -0
- package/icons/occ-close-filled.mjs +17 -0
- package/icons/occ-close-outlined.mjs +17 -0
- package/icons/occ-cream-tube.mjs +23 -0
- package/icons/occ-cream.mjs +23 -0
- package/icons/occ-eye-hide.mjs +17 -0
- package/icons/occ-eye-show.mjs +20 -0
- package/icons/occ-gear-outline.mjs +22 -0
- package/icons/occ-gear.mjs +22 -0
- package/icons/occ-geoloc.mjs +17 -0
- package/icons/occ-gift.mjs +17 -0
- package/icons/occ-group.mjs +20 -0
- package/icons/occ-hand-shake.mjs +57 -0
- package/icons/occ-info.mjs +17 -0
- package/icons/occ-location.mjs +20 -0
- package/icons/occ-mail.mjs +17 -0
- package/icons/occ-message.mjs +38 -0
- package/icons/occ-minus.mjs +17 -0
- package/icons/occ-order-sent.mjs +26 -0
- package/icons/occ-order.mjs +20 -0
- package/icons/occ-padlock.mjs +20 -0
- package/icons/occ-pause.mjs +20 -0
- package/icons/occ-play.mjs +17 -0
- package/icons/occ-plus.mjs +17 -0
- package/icons/occ-product.mjs +21 -0
- package/icons/occ-profil-filled.mjs +20 -0
- package/icons/occ-profil-outlined.mjs +20 -0
- package/icons/occ-refill.mjs +20 -0
- package/icons/occ-refine.mjs +20 -0
- package/icons/occ-reward-card.mjs +20 -0
- package/icons/occ-samples.mjs +26 -0
- package/icons/occ-search.mjs +17 -0
- package/icons/occ-star-0.mjs +17 -0
- package/icons/occ-star-100.mjs +17 -0
- package/icons/occ-star-25.mjs +17 -0
- package/icons/occ-star-50.mjs +17 -0
- package/icons/occ-star-75.mjs +17 -0
- package/icons/occ-store.mjs +17 -0
- package/icons/occ-trash.mjs +23 -0
- package/icons/occ-triangle-down.mjs +17 -0
- package/icons/occ-triangle-up.mjs +17 -0
- package/icons/occ-warning-stroke.mjs +23 -0
- package/icons/occ-warning.mjs +17 -0
- package/icons/occ-wishlist-filled.mjs +17 -0
- package/icons/occ-wishlist-outlined.mjs +17 -0
- package/{icons-BZ0oOFaE.mjs → icons-registry.mjs} +116 -58
- package/index.mjs +0 -3
- package/package.json +1 -1
- package/{svg-utils-wXxOZLnu.mjs → svg-utils-DOL__czZ.mjs} +1 -1
- package/icons-occ.mjs +0 -834
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { i as u, m as
|
|
2
|
-
import { n
|
|
3
|
-
import { o as
|
|
4
|
-
import {
|
|
5
|
-
import { c as
|
|
6
|
-
import { f
|
|
7
|
-
var $ = Object.defineProperty,
|
|
8
|
-
for (var
|
|
9
|
-
(h = t[l]) && (
|
|
10
|
-
return
|
|
1
|
+
import { i as u, m as p, E as g, x as a, a as d, t as v } from "../performance-mixin-D7YmSeqN.mjs";
|
|
2
|
+
import { n } from "../property-S_Y9cb04.mjs";
|
|
3
|
+
import { o as m } from "../if-defined-j0wE2gL4.mjs";
|
|
4
|
+
import { r as b, o as y } from "../icons-registry.mjs";
|
|
5
|
+
import { c as x } from "../svg-utils-DOL__czZ.mjs";
|
|
6
|
+
import { f, i as w, s as k } from "../css-C8WrrxT-.mjs";
|
|
7
|
+
var $ = Object.defineProperty, S = Object.getOwnPropertyDescriptor, i = (t, s, e, c) => {
|
|
8
|
+
for (var r = c > 1 ? void 0 : c ? S(s, e) : s, l = t.length - 1, h; l >= 0; l--)
|
|
9
|
+
(h = t[l]) && (r = (c ? h(s, e, r) : h(r)) || r);
|
|
10
|
+
return c && r && $(s, e, r), r;
|
|
11
11
|
};
|
|
12
|
-
const
|
|
13
|
-
let o = class extends
|
|
12
|
+
const z = (t) => t.startsWith("occ-");
|
|
13
|
+
let o = class extends p(d) {
|
|
14
14
|
constructor() {
|
|
15
15
|
super(...arguments), this.bgstyle = "background-light", this.size = "medium", this.status = "empty", this.type = "button", this.strokewidth = "1", this.icon = "", this.disabled = !1, this.highlight = !1, this.showSrLabel = !1, this.srLabel = "";
|
|
16
16
|
}
|
|
@@ -20,17 +20,18 @@ let o = class extends g(p) {
|
|
|
20
20
|
}
|
|
21
21
|
_syncOccSubscription() {
|
|
22
22
|
const t = this.icon;
|
|
23
|
-
if (!t || !
|
|
23
|
+
if (!t || !z(t)) {
|
|
24
24
|
this._clearOccSubscription();
|
|
25
25
|
return;
|
|
26
26
|
}
|
|
27
|
-
const { svg: s } =
|
|
27
|
+
const { svg: s } = b(t, { size: this.size, bgstyle: this.bgstyle });
|
|
28
28
|
if (s) {
|
|
29
29
|
this._clearOccSubscription();
|
|
30
30
|
return;
|
|
31
31
|
}
|
|
32
|
-
this._unsubOcc || (this._unsubOcc =
|
|
33
|
-
this.
|
|
32
|
+
this._unsubOcc || (this._unsubOcc = y(() => {
|
|
33
|
+
const { svg: e } = b(t, { size: this.size, bgstyle: this.bgstyle });
|
|
34
|
+
e && (this._clearOccSubscription(), this.requestUpdate());
|
|
34
35
|
}));
|
|
35
36
|
}
|
|
36
37
|
connectedCallback() {
|
|
@@ -44,10 +45,10 @@ let o = class extends g(p) {
|
|
|
44
45
|
}
|
|
45
46
|
render() {
|
|
46
47
|
if (!this.icon)
|
|
47
|
-
return
|
|
48
|
-
const t =
|
|
49
|
-
if (!t) return
|
|
50
|
-
const s = `icon-${this.icon}`, e = this.showSrLabel ? a`<span class="sr-only">${this.srLabel}</span>` : null,
|
|
48
|
+
return g;
|
|
49
|
+
const t = x(this.icon, this.size, this.bgstyle);
|
|
50
|
+
if (!t) return g;
|
|
51
|
+
const s = `icon-${this.icon}`, e = this.showSrLabel ? a`<span class="sr-only">${this.srLabel}</span>` : null, c = this.showSrLabel ? "" : "icon";
|
|
51
52
|
return a`
|
|
52
53
|
${this.type === "span" ? a`
|
|
53
54
|
<span part="icon-button" class="icon icon-button ${this.size} ${this.bgstyle} ${this.status} ${s} ${this.highlight ? "highlight" : ""}" ?disabled="${this.disabled}">
|
|
@@ -56,8 +57,8 @@ let o = class extends g(p) {
|
|
|
56
57
|
` : a`
|
|
57
58
|
<button
|
|
58
59
|
type="button"
|
|
59
|
-
aria-label=${
|
|
60
|
-
aria-describedby=${this.getAttribute("aria-describedby") ||
|
|
60
|
+
aria-label=${m(c)}
|
|
61
|
+
aria-describedby=${this.getAttribute("aria-describedby") || g}
|
|
61
62
|
part="icon-button"
|
|
62
63
|
class="icon-button ${this.size} ${this.bgstyle} ${this.status} ${s} ${this.highlight ? "highlight" : ""}"
|
|
63
64
|
?disabled="${this.disabled}"
|
|
@@ -77,6 +78,25 @@ o.styles = u`
|
|
|
77
78
|
outline: none !important;
|
|
78
79
|
}
|
|
79
80
|
|
|
81
|
+
/*
|
|
82
|
+
* Reserve the host's footprint while the (code-split) SVG loads, so the
|
|
83
|
+
* host doesn't collapse to 0×0 and shift surrounding content (CLS).
|
|
84
|
+
* Values mirror the rendered .icon-button sizes below.
|
|
85
|
+
*/
|
|
86
|
+
:host([size="xsmall"]) { min-width: 20px; min-height: 20px; }
|
|
87
|
+
:host([size="small"]) { min-width: 32px; min-height: 32px; }
|
|
88
|
+
:host([size="medium"]) { min-width: 40px; min-height: 40px; }
|
|
89
|
+
:host([size="large"]) { min-width: 40px; min-height: 40px; }
|
|
90
|
+
|
|
91
|
+
:host([bgstyle="none-light"][size="xsmall"]),
|
|
92
|
+
:host([bgstyle="none-contrast"][size="xsmall"]) { min-width: 8px; min-height: 8px; }
|
|
93
|
+
:host([bgstyle="none-light"][size="small"]),
|
|
94
|
+
:host([bgstyle="none-contrast"][size="small"]) { min-width: 12px; min-height: 12px; }
|
|
95
|
+
:host([bgstyle="none-light"][size="medium"]),
|
|
96
|
+
:host([bgstyle="none-contrast"][size="medium"]) { min-width: 16px; min-height: 16px; }
|
|
97
|
+
:host([bgstyle="none-light"][size="large"]),
|
|
98
|
+
:host([bgstyle="none-contrast"][size="large"]) { min-width: 24px; min-height: 24px; }
|
|
99
|
+
|
|
80
100
|
.icon-button {
|
|
81
101
|
display: flex;
|
|
82
102
|
justify-content: center;
|
|
@@ -275,7 +295,7 @@ o.styles = u`
|
|
|
275
295
|
}
|
|
276
296
|
|
|
277
297
|
.icon-button:focus-visible {
|
|
278
|
-
${
|
|
298
|
+
${f}
|
|
279
299
|
}
|
|
280
300
|
|
|
281
301
|
:host(.go-to-top) .icon-button:focus-visible {
|
|
@@ -302,38 +322,38 @@ o.styles = u`
|
|
|
302
322
|
${k}
|
|
303
323
|
}
|
|
304
324
|
`;
|
|
305
|
-
|
|
306
|
-
|
|
325
|
+
i([
|
|
326
|
+
n({ type: String, reflect: !0 })
|
|
307
327
|
], o.prototype, "bgstyle", 2);
|
|
308
|
-
|
|
309
|
-
|
|
328
|
+
i([
|
|
329
|
+
n({ type: String, reflect: !0 })
|
|
310
330
|
], o.prototype, "size", 2);
|
|
311
|
-
|
|
312
|
-
|
|
331
|
+
i([
|
|
332
|
+
n({ type: String, reflect: !0 })
|
|
313
333
|
], o.prototype, "status", 2);
|
|
314
|
-
|
|
315
|
-
|
|
334
|
+
i([
|
|
335
|
+
n({ type: String, reflect: !0 })
|
|
316
336
|
], o.prototype, "type", 2);
|
|
317
|
-
|
|
318
|
-
|
|
337
|
+
i([
|
|
338
|
+
n({ type: String })
|
|
319
339
|
], o.prototype, "strokewidth", 2);
|
|
320
|
-
|
|
321
|
-
|
|
340
|
+
i([
|
|
341
|
+
n({ type: String })
|
|
322
342
|
], o.prototype, "icon", 2);
|
|
323
|
-
|
|
324
|
-
|
|
343
|
+
i([
|
|
344
|
+
n({ type: Boolean, reflect: !0 })
|
|
325
345
|
], o.prototype, "disabled", 2);
|
|
326
|
-
|
|
327
|
-
|
|
346
|
+
i([
|
|
347
|
+
n({ type: Boolean, reflect: !0 })
|
|
328
348
|
], o.prototype, "highlight", 2);
|
|
329
|
-
|
|
330
|
-
|
|
349
|
+
i([
|
|
350
|
+
n({ type: Boolean })
|
|
331
351
|
], o.prototype, "showSrLabel", 2);
|
|
332
|
-
|
|
333
|
-
|
|
352
|
+
i([
|
|
353
|
+
n({ type: String })
|
|
334
354
|
], o.prototype, "srLabel", 2);
|
|
335
|
-
o =
|
|
336
|
-
|
|
355
|
+
o = i([
|
|
356
|
+
v("o-icon-button")
|
|
337
357
|
], o);
|
|
338
358
|
export {
|
|
339
359
|
o as OccitaneIconButton
|
package/components/rating.d.ts
CHANGED
|
@@ -5,6 +5,9 @@ export declare class OccitaneRating extends OccitaneRating_base {
|
|
|
5
5
|
rating: number;
|
|
6
6
|
reviewCount?: string;
|
|
7
7
|
href?: string;
|
|
8
|
+
private _unsubOcc?;
|
|
9
|
+
connectedCallback(): void;
|
|
10
|
+
disconnectedCallback(): void;
|
|
8
11
|
static styles: import('lit').CSSResult;
|
|
9
12
|
private getStarKeys;
|
|
10
13
|
protected render(): import('lit').TemplateResult<1>;
|
package/components/rating.mjs
CHANGED
|
@@ -1,44 +1,51 @@
|
|
|
1
|
-
import { i as f, m as
|
|
2
|
-
import { n as
|
|
3
|
-
import { o as
|
|
4
|
-
import {
|
|
1
|
+
import { i as f, m as u, a as g, x as c, t as h } from "../performance-mixin-D7YmSeqN.mjs";
|
|
2
|
+
import { n as p } from "../property-S_Y9cb04.mjs";
|
|
3
|
+
import { o as v } from "../unsafe-svg-C3uTocNg.mjs";
|
|
4
|
+
import { o as m, r as d } from "../icons-registry.mjs";
|
|
5
5
|
import "./link.mjs";
|
|
6
|
-
var y = Object.defineProperty,
|
|
7
|
-
for (var
|
|
8
|
-
(l =
|
|
9
|
-
return
|
|
6
|
+
var y = Object.defineProperty, b = Object.getOwnPropertyDescriptor, i = (t, e, r, s) => {
|
|
7
|
+
for (var n = s > 1 ? void 0 : s ? b(e, r) : e, o = t.length - 1, l; o >= 0; o--)
|
|
8
|
+
(l = t[o]) && (n = (s ? l(e, r, n) : l(n)) || n);
|
|
9
|
+
return s && n && y(e, r, n), n;
|
|
10
10
|
};
|
|
11
|
-
let
|
|
11
|
+
let a = class extends u(g) {
|
|
12
12
|
constructor() {
|
|
13
13
|
super(...arguments), this.rating = 0;
|
|
14
14
|
}
|
|
15
|
+
connectedCallback() {
|
|
16
|
+
super.connectedCallback(), this._unsubOcc = m(() => this.requestUpdate());
|
|
17
|
+
}
|
|
18
|
+
disconnectedCallback() {
|
|
19
|
+
var t;
|
|
20
|
+
(t = this._unsubOcc) == null || t.call(this), super.disconnectedCallback();
|
|
21
|
+
}
|
|
15
22
|
getStarKeys() {
|
|
16
|
-
const
|
|
17
|
-
for (let
|
|
18
|
-
const
|
|
19
|
-
let
|
|
20
|
-
|
|
23
|
+
const t = [];
|
|
24
|
+
for (let e = 0; e < 5; e++) {
|
|
25
|
+
const r = this.rating - e;
|
|
26
|
+
let s;
|
|
27
|
+
r >= 1 ? s = 100 : r <= 0 ? s = 0 : s = Math.round(r * 100 / 25) * 25, t.push(`occ-star-${s}`);
|
|
21
28
|
}
|
|
22
|
-
return
|
|
29
|
+
return t;
|
|
23
30
|
}
|
|
24
31
|
render() {
|
|
25
|
-
const
|
|
26
|
-
return
|
|
32
|
+
const t = this.getStarKeys();
|
|
33
|
+
return c`
|
|
27
34
|
<div class="rating">
|
|
28
35
|
<div class="stars">
|
|
29
|
-
${
|
|
30
|
-
(
|
|
31
|
-
const { svg:
|
|
32
|
-
return
|
|
36
|
+
${t.map(
|
|
37
|
+
(e) => {
|
|
38
|
+
const { svg: r } = d(e, { size: "small", bgstyle: "none-contrast" });
|
|
39
|
+
return c`<span class="star">${v(r)}</span>`;
|
|
33
40
|
}
|
|
34
41
|
)}
|
|
35
42
|
</div>
|
|
36
|
-
${this.reviewCount != null && this.href != null ?
|
|
43
|
+
${this.reviewCount != null && this.href != null ? c`<o-link template="review" href="${this.href}">${this.reviewCount}</o-link>` : null}
|
|
37
44
|
</div>
|
|
38
45
|
`;
|
|
39
46
|
}
|
|
40
47
|
};
|
|
41
|
-
|
|
48
|
+
a.styles = f`
|
|
42
49
|
.rating {
|
|
43
50
|
display: flex;
|
|
44
51
|
align-items: center;
|
|
@@ -64,18 +71,18 @@ n.styles = f`
|
|
|
64
71
|
}
|
|
65
72
|
|
|
66
73
|
`;
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
],
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
],
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
],
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
],
|
|
74
|
+
i([
|
|
75
|
+
p({ type: Number })
|
|
76
|
+
], a.prototype, "rating", 2);
|
|
77
|
+
i([
|
|
78
|
+
p({ type: String })
|
|
79
|
+
], a.prototype, "reviewCount", 2);
|
|
80
|
+
i([
|
|
81
|
+
p({ type: String })
|
|
82
|
+
], a.prototype, "href", 2);
|
|
83
|
+
a = i([
|
|
84
|
+
h("o-rating")
|
|
85
|
+
], a);
|
|
79
86
|
export {
|
|
80
|
-
|
|
87
|
+
a as OccitaneRating
|
|
81
88
|
};
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { E as p, i as
|
|
1
|
+
import { E as p, i as C, a as w, m as S, x as h, t as B } from "../performance-mixin-D7YmSeqN.mjs";
|
|
2
2
|
import { n as r } from "../property-S_Y9cb04.mjs";
|
|
3
3
|
import { f as x } from "../css-C8WrrxT-.mjs";
|
|
4
|
-
import { i as
|
|
5
|
-
import { o as
|
|
6
|
-
import { g as
|
|
7
|
-
import { o as
|
|
4
|
+
import { i as E, m as P } from "../element-internals-Dw7LndlH.mjs";
|
|
5
|
+
import { e as $, o as _, a as I } from "../icons-registry.mjs";
|
|
6
|
+
import { g as F } from "../svg-utils-DOL__czZ.mjs";
|
|
7
|
+
import { o as z } from "../unsafe-svg-C3uTocNg.mjs";
|
|
8
8
|
import "./icon-button.mjs";
|
|
9
|
-
import { i as
|
|
10
|
-
import { f as
|
|
9
|
+
import { i as O, t as L, e as R } from "../directive-oAbCiebi.mjs";
|
|
10
|
+
import { f as q } from "../directive-helpers-BHuwIghp.mjs";
|
|
11
11
|
/**
|
|
12
12
|
* @license
|
|
13
13
|
* Copyright 2023 Google LLC
|
|
14
14
|
* SPDX-License-Identifier: Apache-2.0
|
|
15
15
|
*/
|
|
16
|
-
function
|
|
16
|
+
function T(e) {
|
|
17
17
|
e.addInitializer((t) => {
|
|
18
18
|
const o = t;
|
|
19
19
|
o.addEventListener("click", async (i) => {
|
|
20
|
-
const { type: n, [
|
|
20
|
+
const { type: n, [E]: s } = o, { form: a } = s;
|
|
21
21
|
if (!(!a || n === "button") && (await new Promise((b) => {
|
|
22
22
|
setTimeout(b);
|
|
23
23
|
}), !i.defaultPrevented)) {
|
|
@@ -57,39 +57,39 @@ const y = (e, t) => {
|
|
|
57
57
|
if ((t = e._$AM) === void 0) break;
|
|
58
58
|
o = t._$AN, o.delete(e), e = t;
|
|
59
59
|
} while ((o == null ? void 0 : o.size) === 0);
|
|
60
|
-
},
|
|
60
|
+
}, D = (e) => {
|
|
61
61
|
for (let t; t = e._$AM; e = t) {
|
|
62
62
|
let o = t._$AN;
|
|
63
63
|
if (o === void 0) t._$AN = o = /* @__PURE__ */ new Set();
|
|
64
64
|
else if (o.has(e)) break;
|
|
65
|
-
o.add(e),
|
|
65
|
+
o.add(e), j(t);
|
|
66
66
|
}
|
|
67
67
|
};
|
|
68
|
-
function
|
|
69
|
-
this._$AN !== void 0 ? (m(this), this._$AM = e,
|
|
68
|
+
function H(e) {
|
|
69
|
+
this._$AN !== void 0 ? (m(this), this._$AM = e, D(this)) : this._$AM = e;
|
|
70
70
|
}
|
|
71
|
-
function
|
|
71
|
+
function M(e, t = !1, o = 0) {
|
|
72
72
|
const i = this._$AH, n = this._$AN;
|
|
73
73
|
if (n !== void 0 && n.size !== 0) if (t) if (Array.isArray(i)) for (let s = o; s < i.length; s++) y(i[s], !1), m(i[s]);
|
|
74
74
|
else i != null && (y(i, !1), m(i));
|
|
75
75
|
else y(this, e);
|
|
76
76
|
}
|
|
77
|
-
const
|
|
78
|
-
e.type == L.CHILD && (e._$AP ?? (e._$AP =
|
|
77
|
+
const j = (e) => {
|
|
78
|
+
e.type == L.CHILD && (e._$AP ?? (e._$AP = M), e._$AQ ?? (e._$AQ = H));
|
|
79
79
|
};
|
|
80
|
-
class
|
|
80
|
+
class K extends O {
|
|
81
81
|
constructor() {
|
|
82
82
|
super(...arguments), this._$AN = void 0;
|
|
83
83
|
}
|
|
84
84
|
_$AT(t, o, i) {
|
|
85
|
-
super._$AT(t, o, i),
|
|
85
|
+
super._$AT(t, o, i), D(this), this.isConnected = t._$AU;
|
|
86
86
|
}
|
|
87
87
|
_$AO(t, o = !0) {
|
|
88
88
|
var i, n;
|
|
89
89
|
t !== this.isConnected && (this.isConnected = t, t ? (i = this.reconnected) == null || i.call(this) : (n = this.disconnected) == null || n.call(this)), o && (y(this, t), m(this));
|
|
90
90
|
}
|
|
91
91
|
setValue(t) {
|
|
92
|
-
if (
|
|
92
|
+
if (q(this._$Ct)) this._$Ct._$AI(t, this);
|
|
93
93
|
else {
|
|
94
94
|
const o = [...this._$Ct._$AH];
|
|
95
95
|
o[this._$Ci] = t, this._$Ct._$AI(o, this, 0);
|
|
@@ -100,7 +100,7 @@ class j extends z {
|
|
|
100
100
|
reconnected() {
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
|
-
class
|
|
103
|
+
class N extends K {
|
|
104
104
|
constructor() {
|
|
105
105
|
super(...arguments), this.prevData = {};
|
|
106
106
|
}
|
|
@@ -127,7 +127,7 @@ class K extends j {
|
|
|
127
127
|
(!t || !(n in t) && i[n] === o[n]) && (i[n] = void 0);
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
|
-
class
|
|
130
|
+
class V extends N {
|
|
131
131
|
constructor() {
|
|
132
132
|
super(...arguments), this.eventData = {};
|
|
133
133
|
}
|
|
@@ -171,7 +171,7 @@ class N extends K {
|
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
173
|
}
|
|
174
|
-
class
|
|
174
|
+
class X extends V {
|
|
175
175
|
apply(t) {
|
|
176
176
|
if (!t)
|
|
177
177
|
return;
|
|
@@ -220,13 +220,13 @@ class V extends N {
|
|
|
220
220
|
}
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
|
-
const
|
|
224
|
-
var
|
|
225
|
-
for (var n = i > 1 ? void 0 : i ?
|
|
223
|
+
const k = R(X);
|
|
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, s = e.length - 1, a; s >= 0; s--)
|
|
226
226
|
(a = e[s]) && (n = (i ? a(t, o, n) : a(n)) || n);
|
|
227
|
-
return i && n &&
|
|
227
|
+
return i && n && U(t, o, n), n;
|
|
228
228
|
};
|
|
229
|
-
let l = class extends
|
|
229
|
+
let l = class extends S(w) {
|
|
230
230
|
constructor() {
|
|
231
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
232
|
var o, i;
|
|
@@ -330,8 +330,8 @@ let l = class extends C(w) {
|
|
|
330
330
|
}
|
|
331
331
|
}
|
|
332
332
|
if (document.querySelector("#refineandsortpopin")) {
|
|
333
|
-
const a = t.querySelector(".close-btn"), b = a ? this.resolveFocusable(a) : null, f = t.querySelector(".js-clear-refinements"), v = f ? this.resolveFocusable(f) : null, g = (
|
|
334
|
-
e.preventDefault(), e.stopPropagation(),
|
|
333
|
+
const a = t.querySelector(".close-btn"), b = a ? this.resolveFocusable(a) : null, f = t.querySelector(".js-clear-refinements"), v = f ? this.resolveFocusable(f) : null, g = (A) => {
|
|
334
|
+
e.preventDefault(), e.stopPropagation(), A.focus();
|
|
335
335
|
};
|
|
336
336
|
if (b && v) {
|
|
337
337
|
if (!e.shiftKey && o === v) return g(b);
|
|
@@ -465,7 +465,7 @@ let l = class extends C(w) {
|
|
|
465
465
|
.variant=${this.firstButtonVariant}
|
|
466
466
|
@click=${this.handleFirstClick}
|
|
467
467
|
@keydown=${this.handleFirstClick}
|
|
468
|
-
${
|
|
468
|
+
${k(this.firstButtonProps)}
|
|
469
469
|
>
|
|
470
470
|
${this.firstButtonLabel}
|
|
471
471
|
</o-button>
|
|
@@ -475,7 +475,7 @@ let l = class extends C(w) {
|
|
|
475
475
|
.variant=${this.secondButtonVariant}
|
|
476
476
|
@click=${this.handleSecondClick}
|
|
477
477
|
@keydown=${this.handleSecondClick}
|
|
478
|
-
${
|
|
478
|
+
${k(this.secondButtonProps)}
|
|
479
479
|
>
|
|
480
480
|
${this.secondButtonLabel}
|
|
481
481
|
</o-button>
|
|
@@ -516,7 +516,7 @@ let l = class extends C(w) {
|
|
|
516
516
|
`;
|
|
517
517
|
}
|
|
518
518
|
};
|
|
519
|
-
l.styles =
|
|
519
|
+
l.styles = C`
|
|
520
520
|
:host {
|
|
521
521
|
--z-overlay: 99;
|
|
522
522
|
--z-panel: 100;
|
|
@@ -842,15 +842,15 @@ c([
|
|
|
842
842
|
r({ type: Boolean })
|
|
843
843
|
], l.prototype, "isHidingDetail", 2);
|
|
844
844
|
l = c([
|
|
845
|
-
|
|
845
|
+
B("o-side-panel")
|
|
846
846
|
], l);
|
|
847
|
-
var
|
|
848
|
-
for (var n = i > 1 ? void 0 : i ?
|
|
847
|
+
var G = Object.defineProperty, Q = Object.getOwnPropertyDescriptor, u = (e, t, o, i) => {
|
|
848
|
+
for (var n = i > 1 ? void 0 : i ? Q(t, o) : t, s = e.length - 1, a; s >= 0; s--)
|
|
849
849
|
(a = e[s]) && (n = (i ? a(t, o, n) : a(n)) || n);
|
|
850
|
-
return i && n &&
|
|
850
|
+
return i && n && G(t, o, n), n;
|
|
851
851
|
};
|
|
852
|
-
const
|
|
853
|
-
let d = class extends
|
|
852
|
+
const J = S(P(w)), lt = ["primary", "secondary", "ghost", "tertiary"];
|
|
853
|
+
let d = class extends J {
|
|
854
854
|
constructor() {
|
|
855
855
|
super(...arguments), this.type = "submit", this.value = "", this.variant = "primary", this.text = "", this.textsecond = "", this.fullwidth = !1, this.disabled = !1, this.startIconModel = "", this.endIconModel = "", this.startIcon = !1, this.endIcon = !1, this.panelTarget = "", this.href = "", this.target = "", this.underlined = !1, this.withbadge = !1, this.hideRoleButton = !1, this.describedBy = null, this.ariaExpanded = null;
|
|
856
856
|
}
|
|
@@ -861,7 +861,7 @@ let d = class extends Q {
|
|
|
861
861
|
this.setAttribute("name", e);
|
|
862
862
|
}
|
|
863
863
|
get form() {
|
|
864
|
-
return this[
|
|
864
|
+
return this[E].form;
|
|
865
865
|
}
|
|
866
866
|
handleClick(e) {
|
|
867
867
|
if (!(e instanceof KeyboardEvent && !["Enter", " "].includes(e.key)) && this.panelTarget) {
|
|
@@ -873,8 +873,10 @@ let d = class extends Q {
|
|
|
873
873
|
return this.href ? this.renderLink() : this.renderButton();
|
|
874
874
|
}
|
|
875
875
|
connectedCallback() {
|
|
876
|
-
var
|
|
877
|
-
super.connectedCallback()
|
|
876
|
+
var o, i;
|
|
877
|
+
super.connectedCallback();
|
|
878
|
+
const e = (o = this.startIconModel) == null ? void 0 : o.startsWith("occ-"), t = (i = this.endIconModel) == null ? void 0 : i.startsWith("occ-");
|
|
879
|
+
(e || t) && (e && $(this.startIconModel), t && $(this.endIconModel), this._unsubOcc = _(() => this.requestUpdate()));
|
|
878
880
|
}
|
|
879
881
|
disconnectedCallback() {
|
|
880
882
|
var e;
|
|
@@ -883,10 +885,10 @@ let d = class extends Q {
|
|
|
883
885
|
renderIcon(e) {
|
|
884
886
|
const t = e === "start" ? this.startIconModel : this.endIconModel;
|
|
885
887
|
if (!t) return p;
|
|
886
|
-
const o =
|
|
888
|
+
const o = I[t] ?? "";
|
|
887
889
|
if (!o) return p;
|
|
888
|
-
const i =
|
|
889
|
-
return h`<span class="${e === "start" ? "icon-start" : "icon-end"}">${
|
|
890
|
+
const i = F(o);
|
|
891
|
+
return h`<span class="${e === "start" ? "icon-start" : "icon-end"}">${z(i)}</span>`;
|
|
890
892
|
}
|
|
891
893
|
renderButton() {
|
|
892
894
|
const e = this.text || this.textsecond;
|
|
@@ -926,9 +928,9 @@ let d = class extends Q {
|
|
|
926
928
|
`;
|
|
927
929
|
}
|
|
928
930
|
};
|
|
929
|
-
|
|
931
|
+
T(d);
|
|
930
932
|
d.formAssociated = !0;
|
|
931
|
-
d.styles =
|
|
933
|
+
d.styles = C`
|
|
932
934
|
:host {
|
|
933
935
|
--button-border: transparent;
|
|
934
936
|
--badge-outer-width: 19px;
|
|
@@ -1197,10 +1199,10 @@ u([
|
|
|
1197
1199
|
r({ reflect: !0, attribute: "expanded" })
|
|
1198
1200
|
], d.prototype, "ariaExpanded", 2);
|
|
1199
1201
|
d = u([
|
|
1200
|
-
|
|
1202
|
+
B("o-button")
|
|
1201
1203
|
], d);
|
|
1202
1204
|
export {
|
|
1203
1205
|
d as O,
|
|
1204
1206
|
l as OccitaneSidePanel,
|
|
1205
|
-
|
|
1207
|
+
lt as v
|
|
1206
1208
|
};
|
package/components/toast.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { i as f, m as p, a as u, x as m, t as d } from "../performance-mixin-D7Y
|
|
|
2
2
|
import { n as a } from "../property-S_Y9cb04.mjs";
|
|
3
3
|
import { o as v } from "../unsafe-svg-C3uTocNg.mjs";
|
|
4
4
|
import "./icon-button.mjs";
|
|
5
|
-
import { t as g } from "../icons-
|
|
5
|
+
import { t as g } from "../icons-registry.mjs";
|
|
6
6
|
var y = Object.defineProperty, x = Object.getOwnPropertyDescriptor, o = (t, i, r, s) => {
|
|
7
7
|
for (var n = s > 1 ? void 0 : s ? x(i, r) : i, l = t.length - 1, c; l >= 0; l--)
|
|
8
8
|
(c = t[l]) && (n = (s ? c(i, r, n) : c(n)) || n);
|
|
@@ -9,7 +9,9 @@ export declare class OccitaneWishlistButton extends OccitaneWishlistButton_base
|
|
|
9
9
|
bgstyle: string;
|
|
10
10
|
ariaDescribedBy: string;
|
|
11
11
|
label: string;
|
|
12
|
+
private _unsubOcc?;
|
|
12
13
|
connectedCallback(): void;
|
|
14
|
+
disconnectedCallback(): void;
|
|
13
15
|
protected firstUpdated(): void;
|
|
14
16
|
private handleKeydown;
|
|
15
17
|
private toggleStatus;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { i as
|
|
1
|
+
import { i as d, m as p, a as b, x as h, t as f } from "../performance-mixin-D7YmSeqN.mjs";
|
|
2
2
|
import { n as r } from "../property-S_Y9cb04.mjs";
|
|
3
3
|
import { o as g } from "../unsafe-svg-C3uTocNg.mjs";
|
|
4
|
-
import {
|
|
5
|
-
import { g as
|
|
6
|
-
import { f as
|
|
7
|
-
var
|
|
8
|
-
for (var e = n > 1 ? void 0 : n ?
|
|
4
|
+
import { e as u, o as y, a as v } from "../icons-registry.mjs";
|
|
5
|
+
import { g as w } from "../svg-utils-DOL__czZ.mjs";
|
|
6
|
+
import { f as m, s as S } from "../css-C8WrrxT-.mjs";
|
|
7
|
+
var O = Object.defineProperty, x = Object.getOwnPropertyDescriptor, o = (t, i, a, n) => {
|
|
8
|
+
for (var e = n > 1 ? void 0 : n ? x(i, a) : i, l = t.length - 1, c; l >= 0; l--)
|
|
9
9
|
(c = t[l]) && (e = (n ? c(i, a, e) : c(e)) || e);
|
|
10
|
-
return n && e &&
|
|
10
|
+
return n && e && O(i, a, e), e;
|
|
11
11
|
};
|
|
12
|
-
let s = class extends p(
|
|
12
|
+
let s = class extends p(b) {
|
|
13
13
|
constructor() {
|
|
14
14
|
super(...arguments), this.status = "empty", this.icon = "occ-wishlist-outlined", this.bgstyle = "none-contrast", this.ariaDescribedBy = "a-product-name", this.label = "Add to wishlist", this.toggleStatus = () => {
|
|
15
15
|
this.status = this.status === "empty" ? "filled" : "empty", this.icon = this.status === "filled" ? "occ-wishlist-filled" : "occ-wishlist-outlined", this.bgstyle = this.status === "filled" ? "none-contrast" : "none-light", this.setAttribute("aria-pressed", String(this.status === "filled")), this.dispatchEvent(new CustomEvent("wishlist-toggle", {
|
|
@@ -20,7 +20,11 @@ let s = class extends p(d) {
|
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
22
|
connectedCallback() {
|
|
23
|
-
super.connectedCallback(), this.setAttribute("role", "button"), this.setAttribute("aria-pressed", String(this.status === "filled"));
|
|
23
|
+
super.connectedCallback(), this.setAttribute("role", "button"), this.setAttribute("aria-pressed", String(this.status === "filled")), u("occ-wishlist-outlined"), u("occ-wishlist-filled"), this._unsubOcc = y(() => this.requestUpdate());
|
|
24
|
+
}
|
|
25
|
+
disconnectedCallback() {
|
|
26
|
+
var t;
|
|
27
|
+
(t = this._unsubOcc) == null || t.call(this), super.disconnectedCallback();
|
|
24
28
|
}
|
|
25
29
|
firstUpdated() {
|
|
26
30
|
this.addEventListener("click", this.toggleStatus), this.addEventListener("keydown", this.handleKeydown);
|
|
@@ -29,9 +33,9 @@ let s = class extends p(d) {
|
|
|
29
33
|
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), this.toggleStatus());
|
|
30
34
|
}
|
|
31
35
|
render() {
|
|
32
|
-
const t =
|
|
36
|
+
const t = v[this.icon] ?? "";
|
|
33
37
|
if (!t) return h``;
|
|
34
|
-
const i =
|
|
38
|
+
const i = w(t);
|
|
35
39
|
return h`
|
|
36
40
|
<button type="button" aria-describedby="${this.ariaDescribedBy}" class="wishlist-button">
|
|
37
41
|
<span class="sr-only">${this.label}</span>
|
|
@@ -49,7 +53,7 @@ let s = class extends p(d) {
|
|
|
49
53
|
this.label = t, this.requestUpdate();
|
|
50
54
|
}
|
|
51
55
|
};
|
|
52
|
-
s.styles =
|
|
56
|
+
s.styles = d`
|
|
53
57
|
:host {
|
|
54
58
|
display: inline-flex;
|
|
55
59
|
justify-content: center;
|
|
@@ -79,7 +83,7 @@ s.styles = u`
|
|
|
79
83
|
}
|
|
80
84
|
|
|
81
85
|
.wishlist-button:focus-visible {
|
|
82
|
-
${
|
|
86
|
+
${m};
|
|
83
87
|
}
|
|
84
88
|
|
|
85
89
|
.wishlist-button:hover svg path {
|
|
@@ -97,7 +101,7 @@ s.styles = u`
|
|
|
97
101
|
}
|
|
98
102
|
|
|
99
103
|
.sr-only {
|
|
100
|
-
${
|
|
104
|
+
${S}
|
|
101
105
|
}
|
|
102
106
|
|
|
103
107
|
:host([icon="occ-wishlist-outlined"][bgstyle="none-contrast"]) .wishlist-button svg path {
|
|
@@ -125,7 +129,7 @@ o([
|
|
|
125
129
|
r({ type: String, reflect: !0 })
|
|
126
130
|
], s.prototype, "label", 2);
|
|
127
131
|
s = o([
|
|
128
|
-
|
|
132
|
+
f("o-wishlist-button")
|
|
129
133
|
], s);
|
|
130
134
|
export {
|
|
131
135
|
s as OccitaneWishlistButton
|