@florid-kit/components 3.1.7 → 3.1.8

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.
@@ -14,6 +14,7 @@ export declare class OccitaneWishlistButton extends OccitaneWishlistButton_base
14
14
  disconnectedCallback(): void;
15
15
  protected firstUpdated(): void;
16
16
  private handleKeydown;
17
+ private applyStatus;
17
18
  private toggleStatus;
18
19
  protected render(): import('lit').TemplateResult<1>;
19
20
  setStatus(status: Status): void;
@@ -1,18 +1,18 @@
1
- import { i as d, m as p, a as b, x as h, t as f } from "../performance-mixin-D7YmSeqN.mjs";
1
+ import { i as p, m as d, a as b, x as h, t as y } from "../performance-mixin-D7YmSeqN.mjs";
2
2
  import { n as r } from "../property-S_Y9cb04.mjs";
3
- import { o as g } from "../unsafe-svg-BipL_msF.mjs";
4
- import { e as u, o as y, a as v } from "../icons-registry.mjs";
3
+ import { o as f } from "../unsafe-svg-BipL_msF.mjs";
4
+ import { e as u, o as g, a as v } from "../icons-registry.mjs";
5
5
  import { g as w } from "../svg-utils-DOL__czZ.mjs";
6
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
- (c = t[l]) && (e = (n ? c(i, a, e) : c(e)) || e);
10
- return n && e && O(i, a, e), e;
7
+ var O = Object.defineProperty, x = Object.getOwnPropertyDescriptor, o = (t, i, l, n) => {
8
+ for (var e = n > 1 ? void 0 : n ? x(i, l) : i, a = t.length - 1, c; a >= 0; a--)
9
+ (c = t[a]) && (e = (n ? c(i, l, e) : c(e)) || e);
10
+ return n && e && O(i, l, e), e;
11
11
  };
12
- let s = class extends p(b) {
12
+ let s = class extends d(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
- 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", {
15
+ this.applyStatus(this.status === "empty" ? "filled" : "empty"), this.dispatchEvent(new CustomEvent("wishlist-toggle", {
16
16
  detail: { status: this.status },
17
17
  bubbles: !0,
18
18
  composed: !0
@@ -20,7 +20,7 @@ let s = class extends p(b) {
20
20
  };
21
21
  }
22
22
  connectedCallback() {
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());
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 = g(() => this.requestUpdate());
24
24
  }
25
25
  disconnectedCallback() {
26
26
  var t;
@@ -32,6 +32,9 @@ let s = class extends p(b) {
32
32
  handleKeydown(t) {
33
33
  (t.key === "Enter" || t.key === " ") && (t.preventDefault(), this.toggleStatus());
34
34
  }
35
+ applyStatus(t) {
36
+ this.status = t, this.icon = t === "filled" ? "occ-wishlist-filled" : "occ-wishlist-outlined", this.bgstyle = t === "filled" ? "none-contrast" : "none-light", this.setAttribute("aria-pressed", String(t === "filled"));
37
+ }
35
38
  render() {
36
39
  const t = v[this.icon] ?? "";
37
40
  if (!t) return h``;
@@ -39,12 +42,12 @@ let s = class extends p(b) {
39
42
  return h`
40
43
  <button type="button" aria-describedby="${this.ariaDescribedBy}" class="wishlist-button">
41
44
  <span class="sr-only">${this.label}</span>
42
- ${g(i)}
45
+ ${f(i)}
43
46
  </button>
44
47
  `;
45
48
  }
46
49
  setStatus(t) {
47
- this.status = t, this.setAttribute("aria-pressed", String(this.status === "filled")), this.requestUpdate();
50
+ this.applyStatus(t);
48
51
  }
49
52
  setAriaDescribedBy(t) {
50
53
  this.ariaDescribedBy = t, this.requestUpdate();
@@ -53,7 +56,7 @@ let s = class extends p(b) {
53
56
  this.label = t, this.requestUpdate();
54
57
  }
55
58
  };
56
- s.styles = d`
59
+ s.styles = p`
57
60
  :host {
58
61
  display: inline-flex;
59
62
  justify-content: center;
@@ -129,7 +132,7 @@ o([
129
132
  r({ type: String, reflect: !0 })
130
133
  ], s.prototype, "label", 2);
131
134
  s = o([
132
- f("o-wishlist-button")
135
+ y("o-wishlist-button")
133
136
  ], s);
134
137
  export {
135
138
  s as OccitaneWishlistButton
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.7";
40
+ globalThis.__FLORID_KIT__ = "3.1.8";
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.7";
7
+ globalThis.__FLORID_KIT__ = "3.1.8";
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.7",
3
+ "version": "3.1.8",
4
4
  "main": "index.js",
5
5
  "module": "index.mjs",
6
6
  "typings": "index.d.ts",