@florid-kit/components 2.6.10 → 2.6.11

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.
Files changed (64) hide show
  1. package/assets/icons/icons.d.ts +66 -12
  2. package/components/button.d.ts +0 -3
  3. package/components/dropdown-variant.d.ts +0 -1
  4. package/components/dropdown.d.ts +0 -1
  5. package/components/icon-button.d.ts +0 -5
  6. package/components/wishlist-button.d.ts +0 -2
  7. package/index.js +5742 -0
  8. package/index.mjs +9700 -41
  9. package/package.json +2 -20
  10. package/assets/icons/icons-occ.d.ts +0 -315
  11. package/components/accordion-group.mjs +0 -61
  12. package/components/accordion.mjs +0 -185
  13. package/components/arch-image.mjs +0 -135
  14. package/components/badge.mjs +0 -75
  15. package/components/breadcrumb.mjs +0 -83
  16. package/components/breadcrumbs.mjs +0 -35
  17. package/components/button.mjs +0 -10
  18. package/components/checkbox.mjs +0 -188
  19. package/components/chip.mjs +0 -158
  20. package/components/chipset.mjs +0 -44
  21. package/components/dots.mjs +0 -60
  22. package/components/dropdown-variant.mjs +0 -445
  23. package/components/dropdown.mjs +0 -302
  24. package/components/feedback-message.mjs +0 -136
  25. package/components/filter-chip.mjs +0 -214
  26. package/components/footer-simplify.mjs +0 -178
  27. package/components/header-simplify.mjs +0 -234
  28. package/components/icon-button.mjs +0 -345
  29. package/components/input.mjs +0 -294
  30. package/components/link.mjs +0 -172
  31. package/components/mediumtile.mjs +0 -307
  32. package/components/minitile.mjs +0 -231
  33. package/components/option-tile-group.mjs +0 -105
  34. package/components/option-tile.mjs +0 -413
  35. package/components/popin.mjs +0 -412
  36. package/components/radio.mjs +0 -165
  37. package/components/rating.mjs +0 -84
  38. package/components/reassurance.mjs +0 -163
  39. package/components/search-input-dropdown.mjs +0 -314
  40. package/components/search-input.mjs +0 -107
  41. package/components/side-panel.mjs +0 -1197
  42. package/components/tab.mjs +0 -140
  43. package/components/tablist.mjs +0 -44
  44. package/components/tag.mjs +0 -86
  45. package/components/textarea.mjs +0 -269
  46. package/components/thumbnail-navigation.mjs +0 -232
  47. package/components/toast.mjs +0 -190
  48. package/components/tooltip.mjs +0 -125
  49. package/components/wishlist-button.mjs +0 -137
  50. package/css-r3TDS8Ma.mjs +0 -37
  51. package/directive-helpers-CjGdYF2i.mjs +0 -11
  52. package/directive-oAbCiebi.mjs +0 -27
  53. package/element-internals-Dw7LndlH.mjs +0 -19
  54. package/icons-occ-DW--7nRr.mjs +0 -834
  55. package/if-defined-BaFqfNKT.mjs +0 -10
  56. package/live-BPnRJXAq.mjs +0 -30
  57. package/loader.d.ts +0 -3
  58. package/loader.mjs +0 -82
  59. package/logo-CEgaTL93.mjs +0 -4
  60. package/performance-mixin-vBVz5Iib.mjs +0 -774
  61. package/property-8EkRXcYy.mjs +0 -36
  62. package/query-NJDNu0-P.mjs +0 -25
  63. package/state-BvkYxy1c.mjs +0 -12
  64. package/unsafe-svg-Dtdj_vMx.mjs +0 -216
@@ -1,232 +0,0 @@
1
- import { i as u, m as h, a as p, x as d, t as b } from "../performance-mixin-vBVz5Iib.mjs";
2
- import { n as c } from "../property-8EkRXcYy.mjs";
3
- import { r as m } from "../state-BvkYxy1c.mjs";
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;
9
- };
10
- let r = class extends h(p) {
11
- constructor() {
12
- super(...arguments), this.thumbnails = [], this.activeIndex = 0, this.disabledIndexes = [], this.maxWidth = "100%", this.altressource = "visual", this.focusedIndex = 0, this.playerIconTemplate = d`
13
- <o-icon-button
14
- icon="playerv"
15
- size="xsmall"
16
- bgstyle="background-light"
17
- type="span"
18
- status="filled"
19
- strokewidth="0"
20
- ></o-icon-button>
21
- `;
22
- }
23
- get lastIndex() {
24
- return Math.max(0, this.thumbnails.length - 1);
25
- }
26
- handleKeyDown(t) {
27
- t.key === "ArrowRight" ? (t.preventDefault(), this.focusNext()) : t.key === "ArrowLeft" ? (t.preventDefault(), this.focusPrevious()) : t.key === "Enter" || t.key === " " ? (t.preventDefault(), this.selectThumbnail(this.focusedIndex)) : t.key === "Tab" && (!t.shiftKey && this.focusedIndex === this.lastIndex && this.dispatchEvent(new CustomEvent("thumb-exit", {
28
- detail: { from: "last", direction: "forward" },
29
- bubbles: !0,
30
- composed: !0
31
- })), t.shiftKey && this.focusedIndex === 0 && this.dispatchEvent(new CustomEvent("thumb-exit", {
32
- detail: { from: "first", direction: "backward" },
33
- bubbles: !0,
34
- composed: !0
35
- })));
36
- }
37
- focusNext() {
38
- let t = this.focusedIndex + 1;
39
- for (; this.disabledIndexes.includes(t) && t < this.thumbnails.length; )
40
- t++;
41
- t < this.thumbnails.length && (this.focusedIndex = t, this.focusThumbnail(t));
42
- }
43
- focusPrevious() {
44
- let t = this.focusedIndex - 1;
45
- for (; this.disabledIndexes.includes(t) && t >= 0; )
46
- t--;
47
- t >= 0 && (this.focusedIndex = t, this.focusThumbnail(t));
48
- }
49
- focusThumbnail(t) {
50
- const e = this.renderRoot.querySelector(`[data-index="${t}"]`);
51
- e == null || e.focus();
52
- }
53
- selectThumbnail(t) {
54
- this.disabledIndexes.includes(t) || (this.activeIndex = t, this.swiperInstance && typeof this.swiperInstance.slideTo == "function" && this.swiperInstance.slideTo(t), this.dispatchEvent(new CustomEvent("thumbnail-select", { detail: { index: t } })));
55
- }
56
- onFocus(t) {
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();
61
- }
62
- 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", {
65
- detail: { from: "last", direction: "unspecified" },
66
- bubbles: !0,
67
- composed: !0
68
- })) : o === 0 && this.dispatchEvent(new CustomEvent("thumb-exit", {
69
- detail: { from: "first", direction: "unspecified" },
70
- bubbles: !0,
71
- composed: !0
72
- })));
73
- }
74
- render() {
75
- return d`
76
- <ul class="scroll-container" style="max-width: ${this.maxWidth};">
77
- ${this.thumbnails.map((t, e) => {
78
- const o = this.disabledIndexes.includes(e), i = this.activeIndex === e, s = t.type === "video", l = s ? `video ${e}` : `${this.altressource} ${e + 1}`;
79
- return d`
80
- <li class="thumb-wrapper">
81
- <button
82
- class="thumb"
83
- data-index="${e}"
84
- ?disabled=${o}
85
- aria-current=${i ? "true" : "false"}
86
- @click=${() => this.selectThumbnail(e)}
87
- @keydown=${this.handleKeyDown}
88
- @focus=${(n) => this.onFocus(n)}
89
- @focusout=${(n) => this.onFocusOut(n)}
90
- >
91
- <img alt="${l}" src="${t.src}" />
92
- </button>
93
- ${s ? d`<div class="play-icon-wrapper">${this.playerIconTemplate}</div>` : null}
94
- </li>
95
- `;
96
- })}
97
- </ul>
98
- `;
99
- }
100
- };
101
- r.styles = u`
102
- :host {
103
- display: flex;
104
- gap: 5px;
105
- }
106
-
107
- .thumb-wrapper {
108
- position: relative;
109
- display: inline-block;
110
- }
111
-
112
- .thumb {
113
- width: 56px;
114
- height: 70px;
115
- background-size: cover;
116
- background-position: center;
117
- border: 1px solid var(--color-border-secondary);
118
- opacity: 1;
119
- cursor: pointer;
120
- outline: none;
121
- transition: outline 0.2s, opacity 0.2s;
122
- padding: 0;
123
- margin: 0;
124
- box-sizing: content-box;
125
- position: relative;
126
-
127
- img {
128
- width: 100%;
129
- height: auto;
130
- max-width: 100%;
131
- border: 1px solid var(--color-container-bg-white);
132
- box-sizing: border-box;
133
- }
134
- }
135
-
136
- .thumb[aria-selected="true"]::before,
137
- .a--tabfocus::before {
138
- content: "";
139
- position: absolute;
140
- top: 0;
141
- left: 0;
142
- right: 0;
143
- bottom: 0;
144
- border: 1px solid var(--color-border-primary);
145
- pointer-events: none;
146
- z-index: 1;
147
- }
148
-
149
- .thumb[disabled] {
150
- border: 1px solid var(--color-border-disabled, #eee);
151
- opacity: 0.4;
152
- pointer-events: none;
153
- }
154
-
155
- .thumb:focus-visible {
156
- border: 1px solid var(--color-border-primary) !important;
157
- }
158
-
159
- .play-icon-wrapper {
160
- position: absolute;
161
- left: 50%;
162
- top: 50%;
163
- transform: translate(-50%, -50%);
164
- pointer-events: none;
165
- }
166
-
167
- .scroll-container {
168
- display: flex;
169
- gap: 8px;
170
- margin: 0;
171
- padding: 0;
172
- overflow-x: auto;
173
- padding-bottom: 4px;
174
- scrollbar-width: thin;
175
- scrollbar-color: var(--color-border-normal, #ccc) transparent;
176
- }
177
-
178
- .scroll-container::-webkit-scrollbar {
179
- height: 2px;
180
- }
181
-
182
- .scroll-container::-webkit-scrollbar-track {
183
- background: transparent;
184
- }
185
-
186
- .scroll-container::-webkit-scrollbar-thumb {
187
- background-color: var(--color-neutral-grey);
188
- border-radius: 3px;
189
- }
190
-
191
- ::slotted(.scroll-container) {
192
- scrollbar-width: none;
193
- }
194
-
195
- ::slotted(.scroll-container)::-webkit-scrollbar {
196
- height: 2px;
197
- background: transparent;
198
- }
199
-
200
- ::slotted(.scroll-container)::-webkit-scrollbar-button {
201
- display: none;
202
- height: 0;
203
- width: 0;
204
- }
205
- `;
206
- a([
207
- c({ type: Array })
208
- ], r.prototype, "thumbnails", 2);
209
- a([
210
- c({ type: Number })
211
- ], r.prototype, "activeIndex", 2);
212
- a([
213
- c({ type: Array })
214
- ], r.prototype, "disabledIndexes", 2);
215
- a([
216
- c({ type: String })
217
- ], r.prototype, "maxWidth", 2);
218
- a([
219
- c({ type: String })
220
- ], r.prototype, "altressource", 2);
221
- a([
222
- c({ type: Object })
223
- ], r.prototype, "swiperInstance", 2);
224
- a([
225
- m()
226
- ], r.prototype, "focusedIndex", 2);
227
- r = a([
228
- b("thumbnail-navigation")
229
- ], r);
230
- export {
231
- r as ThumbnailNavigation
232
- };
@@ -1,190 +0,0 @@
1
- import { i as f, m as p, a as u, x as m, t as d } from "../performance-mixin-vBVz5Iib.mjs";
2
- import { n as a } from "../property-8EkRXcYy.mjs";
3
- import { t as v, a as g } from "../unsafe-svg-Dtdj_vMx.mjs";
4
- import "./icon-button.mjs";
5
- var y = Object.defineProperty, x = Object.getOwnPropertyDescriptor, o = (t, i, r, s) => {
6
- for (var n = s > 1 ? void 0 : s ? x(i, r) : i, l = t.length - 1, c; l >= 0; l--)
7
- (c = t[l]) && (n = (s ? c(i, r, n) : c(n)) || n);
8
- return s && n && y(i, r, n), n;
9
- };
10
- let e = class extends p(u) {
11
- constructor() {
12
- super(...arguments), this.icon = "info", this.text = "Sample text", this.verticalanchor = "top", this.horizontalanchor = "right", this.verticaloffset = 24, this.horizontaloffset = 24, this.animationduration = 500, this.animationaxis = "horizontal", this.animated = !0, this.lifeduration = 5e3, this.multiline = !1;
13
- }
14
- attributeChangedCallback(t, i, r) {
15
- super.attributeChangedCallback(t, i, r), t == "verticaloffset" && this.style.setProperty("--vertical-offset", r + "px"), t == "horizontaloffset" && this.style.setProperty("--horizontal-offset", r + "px"), t == "animationduration" && this.style.setProperty("--animation-duration", r + "ms");
16
- }
17
- /**
18
- * Animate closing toast
19
- */
20
- selfCloseAfterDelay() {
21
- var t = this;
22
- setTimeout(function() {
23
- t.animated = !0, t.selfClose();
24
- }, this.lifeduration);
25
- }
26
- /**
27
- *
28
- */
29
- selfClose() {
30
- var t = this;
31
- setTimeout(function() {
32
- t.remove();
33
- }, this.animationduration + 200);
34
- }
35
- connectedCallback() {
36
- var t = this;
37
- super.connectedCallback(), setTimeout(() => {
38
- t.animated = !1, this.selfCloseAfterDelay();
39
- }, 600);
40
- }
41
- firstUpdated() {
42
- var s, n;
43
- var t = this;
44
- const i = (s = this.renderRoot) == null ? void 0 : s.querySelector("o-icon-button"), r = (n = this.renderRoot) == null ? void 0 : n.querySelector(".o-toast-text");
45
- if (r != null) {
46
- const l = window.getComputedStyle(r), c = parseInt(l.getPropertyValue("line-height").replace("px", "")), h = parseInt(l.getPropertyValue("height").replace("px", ""));
47
- !isNaN(c) && !isNaN(h) && h > c && (this.multiline = !0);
48
- }
49
- i != null && i.addEventListener("click", function() {
50
- t.remove();
51
- });
52
- }
53
- render() {
54
- const i = v[this.icon].replace("<svg", '<svg aria-hidden="true" focusable="false" part="svg"').replace(/<path\b/g, '<path part="icon-path"').replace(/<g\b/g, '<g part="icon-group"').replace(/<circle\b/g, '<circle part="icon-circle"');
55
- return m`
56
- <div class="o-toast">
57
- <div class="o-toast-icon">
58
- ${g(i)}
59
- </div>
60
- <div class="o-toast-text">
61
- ${this.text}
62
- </div>
63
- <div class="o-toast-close">
64
- <o-icon-button
65
- size="xsmall"
66
- icon="occ-close-outlined"
67
- >
68
- </o-icon-button>
69
- </div>
70
- </div>
71
- `;
72
- }
73
- };
74
- e.styles = f`
75
- :host {
76
- --vertical-offset: 24px;
77
- --horizontal-offset: 24px;
78
- --animation-duration: 500ms;
79
- position: fixed;
80
- z-index: 105;
81
- transition: all var(--animation-duration) ease-in-out;
82
- }
83
-
84
- :host([verticalanchor="top"]) {
85
- top: var(--vertical-offset);
86
- }
87
-
88
- :host([verticalanchor="bottom"]) {
89
- bottom: var(--vertical-offset);
90
- }
91
-
92
- :host([horizontalanchor="right"]) {
93
- right: var(--horizontal-offset);
94
- }
95
-
96
- :host([horizontalanchor="center"]) {
97
- left: 50%;
98
- transform: translateX(-50%);
99
- }
100
-
101
- :host([horizontalanchor="left"]) {
102
- left: var(--horizontal-offset);
103
- }
104
-
105
- :host([animated][animationaxis="horizontal"][horizontalanchor="right"]) {
106
- right: -100%;
107
- }
108
-
109
- :host([animated][animationaxis="horizontal"][horizontalanchor="left"]) {
110
- left: -100%;
111
- }
112
-
113
- :host([animated][animationaxis="vertical"][verticalanchor="top"]) {
114
- top: -100%;
115
- }
116
-
117
- :host([animated][animationaxis="vertical"][verticalanchor="bottom"]) {
118
- bottom: -100%;
119
- }
120
-
121
- :host([multiline]) .o-toast-close {
122
- align-self: flex-start;
123
- }
124
-
125
- :host([multiline]) .o-toast-icon {
126
- align-self: flex-start;
127
- line-height: 2.8rem;
128
- }
129
-
130
- .o-toast {
131
- background: #fffefe;
132
- padding: var(--spacing-l);
133
- border-radius: var(--radius-m);
134
- display: flex;
135
- width: fit-content;
136
- align-items: center;
137
- box-shadow: 0 2px 10px 0 rgba(0, 0, 0, 0.12);
138
- }
139
-
140
- .o-toast-text {
141
- color: var(--color-content-body);
142
- padding: 0 12px;
143
- width: max-content;
144
- line-height: 20px;
145
- max-width: 65vw;
146
- }
147
-
148
- .o-toast-icon {
149
- height: 16px;
150
- }
151
- `;
152
- o([
153
- a({ type: String, reflect: !0 })
154
- ], e.prototype, "icon", 2);
155
- o([
156
- a({ type: String, reflect: !0 })
157
- ], e.prototype, "text", 2);
158
- o([
159
- a({ type: String, reflect: !0 })
160
- ], e.prototype, "verticalanchor", 2);
161
- o([
162
- a({ type: String, reflect: !0 })
163
- ], e.prototype, "horizontalanchor", 2);
164
- o([
165
- a({ type: Number, reflect: !0 })
166
- ], e.prototype, "verticaloffset", 2);
167
- o([
168
- a({ type: Number, reflect: !0 })
169
- ], e.prototype, "horizontaloffset", 2);
170
- o([
171
- a({ type: Number, reflect: !0 })
172
- ], e.prototype, "animationduration", 2);
173
- o([
174
- a({ type: String, reflect: !0 })
175
- ], e.prototype, "animationaxis", 2);
176
- o([
177
- a({ type: Boolean, reflect: !0 })
178
- ], e.prototype, "animated", 2);
179
- o([
180
- a({ type: Number, reflect: !0 })
181
- ], e.prototype, "lifeduration", 2);
182
- o([
183
- a({ type: Boolean, reflect: !0 })
184
- ], e.prototype, "multiline", 2);
185
- e = o([
186
- d("o-toast")
187
- ], e);
188
- export {
189
- e as OccitaneToast
190
- };
@@ -1,125 +0,0 @@
1
- import { i as c, m as x, a as h, x as f, t as d } from "../performance-mixin-vBVz5Iib.mjs";
2
- import { n as s } from "../property-8EkRXcYy.mjs";
3
- var b = Object.defineProperty, g = Object.getOwnPropertyDescriptor, a = (n, e, p, r) => {
4
- for (var t = r > 1 ? void 0 : r ? g(e, p) : e, i = n.length - 1, l; i >= 0; i--)
5
- (l = n[i]) && (t = (r ? l(e, p, t) : l(t)) || t);
6
- return r && t && b(e, p, t), t;
7
- };
8
- let o = class extends x(h) {
9
- constructor() {
10
- super(...arguments), this.type = "top", this.text = "";
11
- }
12
- render() {
13
- return f`
14
- <div class="tooltip">
15
- <span class="tooltiptext">${this.text}</span>
16
- <slot></slot>
17
- </div>
18
- `;
19
- }
20
- };
21
- o.styles = c`
22
- .tooltip {
23
- position: relative;
24
- display: inline-block;
25
- backdrop-filter: blur(4px);
26
- }
27
-
28
- /* Tooltip text */
29
- .tooltip .tooltiptext {
30
- visibility: hidden;
31
- background-color: var(--color-alpha-dark-strongest);
32
- color: var(--color-content-body-inverse);
33
- font-family: var(--font-family-loccitane-sans);
34
- font-size: var(--font-size-100);
35
- font-weight: var(--font-weight-400);
36
- text-align: center;
37
- padding: 8px;
38
- border-radius: 6px;
39
- min-width: 120px;
40
- max-width: 500px;
41
- position: absolute;
42
- z-index: 1;
43
- }
44
-
45
- .tooltip:hover .tooltiptext {
46
- visibility: visible;
47
- }
48
-
49
- :host([type="right"]) .tooltip .tooltiptext {
50
- top: -5px;
51
- left: 105%;
52
- }
53
-
54
- :host([type="left"]) .tooltip .tooltiptext {
55
- top: -5px;
56
- right: 105%;
57
- }
58
-
59
- :host([type="top"]) .tooltip .tooltiptext {
60
- width: 120px;
61
- bottom: 100%;
62
- left: 50%;
63
- margin-left: -60px;
64
- }
65
-
66
- :host([type="bottom"]) .tooltip .tooltiptext {
67
- width: 120px;
68
- top: 100%;
69
- left: 50%;
70
- margin-left: -60px;
71
- }
72
-
73
- /* Styles communs à tous les types */
74
- .tooltip .tooltiptext::after {
75
- content: " ";
76
- position: absolute;
77
- border-width: 5px;
78
- border-style: solid;
79
- }
80
-
81
- /* Flèche en haut (tooltip en bas) */
82
- :host([type="top"]) .tooltip .tooltiptext::after {
83
- top: 100%;
84
- left: 50%;
85
- margin-left: -5px;
86
- border-color: var(--color-alpha-dark-strongest) transparent transparent transparent;
87
- }
88
-
89
- /* Flèche en bas (tooltip en haut) */
90
- :host([type="bottom"]) .tooltip .tooltiptext::after {
91
- bottom: 100%;
92
- left: 50%;
93
- margin-left: -5px;
94
- border-color: transparent transparent var(--color-alpha-dark-strongest) transparent;
95
- }
96
-
97
- /* Flèche à gauche (tooltip à droite) */
98
- :host([type="left"]) .tooltip .tooltiptext::after {
99
- top: 50%;
100
- left: 100%;
101
- margin-top: -5px;
102
- border-color: transparent transparent transparent var(--color-alpha-dark-strongest);
103
- }
104
-
105
- /* Flèche à droite (tooltip à gauche) */
106
- :host([type="right"]) .tooltip .tooltiptext::after {
107
- top: 50%;
108
- right: 100%;
109
- margin-top: -5px;
110
- border-color: transparent var(--color-alpha-dark-strongest) transparent transparent;
111
- }
112
-
113
- `;
114
- a([
115
- s({ type: String, reflect: !0 })
116
- ], o.prototype, "type", 2);
117
- a([
118
- s({ type: String, reflect: !0 })
119
- ], o.prototype, "text", 2);
120
- o = a([
121
- d("o-tooltip")
122
- ], o);
123
- export {
124
- o as OccitaneTooltip
125
- };
@@ -1,137 +0,0 @@
1
- import { i as u, m as d, a as p, x as h, t as b } from "../performance-mixin-vBVz5Iib.mjs";
2
- import { n as r } from "../property-8EkRXcYy.mjs";
3
- import { o as g, i as y, a as f } from "../unsafe-svg-Dtdj_vMx.mjs";
4
- import { f as v, s as w } from "../css-r3TDS8Ma.mjs";
5
- var m = Object.defineProperty, S = Object.getOwnPropertyDescriptor, o = (t, i, a, n) => {
6
- for (var e = n > 1 ? void 0 : n ? S(i, a) : i, l = t.length - 1, c; l >= 0; l--)
7
- (c = t[l]) && (e = (n ? c(i, a, e) : c(e)) || e);
8
- return n && e && m(i, a, e), e;
9
- };
10
- let s = class extends d(p) {
11
- constructor() {
12
- 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 = () => {
13
- 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", {
14
- detail: { status: this.status },
15
- bubbles: !0,
16
- composed: !0
17
- }));
18
- };
19
- }
20
- connectedCallback() {
21
- super.connectedCallback(), this.setAttribute("role", "button"), this.setAttribute("aria-pressed", String(this.status === "filled")), this._unsubOcc = g(() => this.requestUpdate());
22
- }
23
- disconnectedCallback() {
24
- var t;
25
- (t = this._unsubOcc) == null || t.call(this), super.disconnectedCallback();
26
- }
27
- firstUpdated() {
28
- this.addEventListener("click", this.toggleStatus), this.addEventListener("keydown", this.handleKeydown);
29
- }
30
- handleKeydown(t) {
31
- (t.key === "Enter" || t.key === " ") && (t.preventDefault(), this.toggleStatus());
32
- }
33
- render() {
34
- const t = y[this.icon] ?? "";
35
- if (!t) return h``;
36
- const i = t.replace(
37
- "<svg",
38
- '<svg aria-hidden="true" focusable="false" part="svg"'
39
- );
40
- return h`
41
- <button type="button" aria-describedby="${this.ariaDescribedBy}" class="wishlist-button">
42
- <span class="sr-only">${this.label}</span>
43
- ${f(i)}
44
- </button>
45
- `;
46
- }
47
- setStatus(t) {
48
- this.status = t, this.setAttribute("aria-pressed", String(this.status === "filled")), this.requestUpdate();
49
- }
50
- setAriaDescribedBy(t) {
51
- this.ariaDescribedBy = t, this.requestUpdate();
52
- }
53
- setLabel(t) {
54
- this.label = t, this.requestUpdate();
55
- }
56
- };
57
- s.styles = u`
58
- :host {
59
- display: inline-flex;
60
- justify-content: center;
61
- align-items: center;
62
- outline: none !important;
63
- }
64
-
65
- .wishlist-button {
66
- display: flex;
67
- justify-content: center;
68
- align-items: center;
69
- width: 40px;
70
- height: 40px;
71
- border: transparent;
72
- border-radius: var(--radius-full);
73
- background-color: var(--color-alpha-light-strong);
74
- position: relative;
75
- cursor: pointer;
76
- }
77
-
78
- .wishlist-button:hover {
79
- background-color: var(--color-alpha-light-stronger);
80
- }
81
-
82
- .wishlist-button:active {
83
- background-color: var(--color-alpha-light-strongest);
84
- }
85
-
86
- .wishlist-button:focus-visible {
87
- ${v};
88
- }
89
-
90
- .wishlist-button:hover svg path {
91
- fill: var(--color-content-action-secondary);
92
- }
93
-
94
- :host([status="filled"]) .wishlist-button svg path {
95
- fill: var(--color-content-action-secondary);
96
- }
97
-
98
- @media (hover: hover) and (pointer: fine) {
99
- :host([status="empty"]) .wishlist-button:hover svg path {
100
- fill: var(--color-content-action-secondary);
101
- }
102
- }
103
-
104
- .sr-only {
105
- ${w}
106
- }
107
-
108
- :host([icon="occ-wishlist-outlined"][bgstyle="none-contrast"]) .wishlist-button svg path {
109
- fill: var(--color-content-action-secondary);
110
- }
111
-
112
- :host([icon="occ-wishlist-filled"][bgstyle="none-contrast"]) .wishlist-button svg path {
113
- fill: var(--color-content-action-secondary);
114
- stroke: var(--color-content-action-secondary);
115
- }
116
- `;
117
- o([
118
- r({ type: String, reflect: !0 })
119
- ], s.prototype, "status", 2);
120
- o([
121
- r({ type: String, reflect: !0 })
122
- ], s.prototype, "icon", 2);
123
- o([
124
- r({ type: String, reflect: !0 })
125
- ], s.prototype, "bgstyle", 2);
126
- o([
127
- r({ type: String, reflect: !0 })
128
- ], s.prototype, "ariaDescribedBy", 2);
129
- o([
130
- r({ type: String, reflect: !0 })
131
- ], s.prototype, "label", 2);
132
- s = o([
133
- b("o-wishlist-button")
134
- ], s);
135
- export {
136
- s as OccitaneWishlistButton
137
- };