@florid-kit/components 2.6.18 → 3.0.0

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 (69) hide show
  1. package/assets/icons/icons-occ.d.ts +315 -0
  2. package/assets/icons/icons.d.ts +12 -84
  3. package/assets/icons/svg-utils.d.ts +13 -0
  4. package/behaviors/performance-mixin.d.ts +0 -23
  5. package/behaviors/performance-reporter.d.ts +1 -0
  6. package/components/accordion-group.mjs +61 -0
  7. package/components/accordion.mjs +185 -0
  8. package/components/arch-image.mjs +135 -0
  9. package/components/badge.mjs +75 -0
  10. package/components/breadcrumb.mjs +83 -0
  11. package/components/breadcrumbs.mjs +35 -0
  12. package/components/button.d.ts +3 -0
  13. package/components/button.mjs +12 -0
  14. package/components/checkbox.mjs +188 -0
  15. package/components/chip.mjs +158 -0
  16. package/components/chipset.mjs +44 -0
  17. package/components/dots.mjs +60 -0
  18. package/components/dropdown-variant.d.ts +1 -0
  19. package/components/dropdown-variant.mjs +446 -0
  20. package/components/dropdown.d.ts +1 -0
  21. package/components/dropdown.mjs +303 -0
  22. package/components/feedback-message.mjs +136 -0
  23. package/components/filter-chip.mjs +215 -0
  24. package/components/footer-simplify.mjs +178 -0
  25. package/components/header-simplify.mjs +234 -0
  26. package/components/icon-button.d.ts +5 -0
  27. package/components/icon-button.mjs +340 -0
  28. package/components/input.mjs +298 -0
  29. package/components/link.mjs +172 -0
  30. package/components/mediumtile.mjs +307 -0
  31. package/components/minitile.mjs +234 -0
  32. package/components/option-tile-group.mjs +105 -0
  33. package/components/option-tile.mjs +413 -0
  34. package/components/popin.mjs +412 -0
  35. package/components/radio.mjs +165 -0
  36. package/components/rating.mjs +81 -0
  37. package/components/reassurance.mjs +163 -0
  38. package/components/search-input-dropdown.mjs +314 -0
  39. package/components/search-input.mjs +107 -0
  40. package/components/side-panel.mjs +1206 -0
  41. package/components/tab.mjs +140 -0
  42. package/components/tablist.mjs +44 -0
  43. package/components/tag.mjs +86 -0
  44. package/components/textarea.mjs +269 -0
  45. package/components/thumbnail-navigation.mjs +232 -0
  46. package/components/toast.mjs +191 -0
  47. package/components/tooltip.mjs +125 -0
  48. package/components/wishlist-button.mjs +132 -0
  49. package/css-C8WrrxT-.mjs +41 -0
  50. package/directive-helpers-BHuwIghp.mjs +11 -0
  51. package/directive-oAbCiebi.mjs +27 -0
  52. package/element-internals-Dw7LndlH.mjs +19 -0
  53. package/icons-Pdn_6YtT.mjs +104 -0
  54. package/icons-occ.mjs +834 -0
  55. package/if-defined-j0wE2gL4.mjs +10 -0
  56. package/index.mjs +41 -9719
  57. package/live-C_TUoYRm.mjs +30 -0
  58. package/loader.d.ts +3 -0
  59. package/loader.mjs +78 -0
  60. package/logo-CEgaTL93.mjs +4 -0
  61. package/package.json +19 -1
  62. package/performance-mixin-D7YmSeqN.mjs +628 -0
  63. package/performance-reporter-B7ZOqnDk.mjs +89 -0
  64. package/property-S_Y9cb04.mjs +36 -0
  65. package/query-NJDNu0-P.mjs +25 -0
  66. package/state-DjMxXomO.mjs +12 -0
  67. package/svg-utils-CRDBD8ES.mjs +47 -0
  68. package/unsafe-svg-C3uTocNg.mjs +34 -0
  69. package/index.js +0 -5755
@@ -0,0 +1,232 @@
1
+ import { i as u, m as h, a as p, x as d, t as b } from "../performance-mixin-D7YmSeqN.mjs";
2
+ import { n as c } from "../property-S_Y9cb04.mjs";
3
+ import { r as m } from "../state-DjMxXomO.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
+ };
@@ -0,0 +1,191 @@
1
+ import { i as f, m as p, a as u, x as m, t as d } from "../performance-mixin-D7YmSeqN.mjs";
2
+ import { n as a } from "../property-S_Y9cb04.mjs";
3
+ import { o as v } from "../unsafe-svg-C3uTocNg.mjs";
4
+ import "./icon-button.mjs";
5
+ import { t as g } from "../icons-Pdn_6YtT.mjs";
6
+ var y = Object.defineProperty, x = Object.getOwnPropertyDescriptor, o = (t, i, r, s) => {
7
+ for (var n = s > 1 ? void 0 : s ? x(i, r) : i, l = t.length - 1, c; l >= 0; l--)
8
+ (c = t[l]) && (n = (s ? c(i, r, n) : c(n)) || n);
9
+ return s && n && y(i, r, n), n;
10
+ };
11
+ let e = class extends p(u) {
12
+ constructor() {
13
+ 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;
14
+ }
15
+ attributeChangedCallback(t, i, r) {
16
+ 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");
17
+ }
18
+ /**
19
+ * Animate closing toast
20
+ */
21
+ selfCloseAfterDelay() {
22
+ var t = this;
23
+ setTimeout(function() {
24
+ t.animated = !0, t.selfClose();
25
+ }, this.lifeduration);
26
+ }
27
+ /**
28
+ *
29
+ */
30
+ selfClose() {
31
+ var t = this;
32
+ setTimeout(function() {
33
+ t.remove();
34
+ }, this.animationduration + 200);
35
+ }
36
+ connectedCallback() {
37
+ var t = this;
38
+ super.connectedCallback(), setTimeout(() => {
39
+ t.animated = !1, this.selfCloseAfterDelay();
40
+ }, 600);
41
+ }
42
+ firstUpdated() {
43
+ var s, n;
44
+ var t = this;
45
+ 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");
46
+ if (r != null) {
47
+ const l = window.getComputedStyle(r), c = parseInt(l.getPropertyValue("line-height").replace("px", "")), h = parseInt(l.getPropertyValue("height").replace("px", ""));
48
+ !isNaN(c) && !isNaN(h) && h > c && (this.multiline = !0);
49
+ }
50
+ i != null && i.addEventListener("click", function() {
51
+ t.remove();
52
+ });
53
+ }
54
+ render() {
55
+ const i = g[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"');
56
+ return m`
57
+ <div class="o-toast">
58
+ <div class="o-toast-icon">
59
+ ${v(i)}
60
+ </div>
61
+ <div class="o-toast-text">
62
+ ${this.text}
63
+ </div>
64
+ <div class="o-toast-close">
65
+ <o-icon-button
66
+ size="xsmall"
67
+ icon="occ-close-outlined"
68
+ >
69
+ </o-icon-button>
70
+ </div>
71
+ </div>
72
+ `;
73
+ }
74
+ };
75
+ e.styles = f`
76
+ :host {
77
+ --vertical-offset: 24px;
78
+ --horizontal-offset: 24px;
79
+ --animation-duration: 500ms;
80
+ position: fixed;
81
+ z-index: 105;
82
+ transition: all var(--animation-duration) ease-in-out;
83
+ }
84
+
85
+ :host([verticalanchor="top"]) {
86
+ top: var(--vertical-offset);
87
+ }
88
+
89
+ :host([verticalanchor="bottom"]) {
90
+ bottom: var(--vertical-offset);
91
+ }
92
+
93
+ :host([horizontalanchor="right"]) {
94
+ right: var(--horizontal-offset);
95
+ }
96
+
97
+ :host([horizontalanchor="center"]) {
98
+ left: 50%;
99
+ transform: translateX(-50%);
100
+ }
101
+
102
+ :host([horizontalanchor="left"]) {
103
+ left: var(--horizontal-offset);
104
+ }
105
+
106
+ :host([animated][animationaxis="horizontal"][horizontalanchor="right"]) {
107
+ right: -100%;
108
+ }
109
+
110
+ :host([animated][animationaxis="horizontal"][horizontalanchor="left"]) {
111
+ left: -100%;
112
+ }
113
+
114
+ :host([animated][animationaxis="vertical"][verticalanchor="top"]) {
115
+ top: -100%;
116
+ }
117
+
118
+ :host([animated][animationaxis="vertical"][verticalanchor="bottom"]) {
119
+ bottom: -100%;
120
+ }
121
+
122
+ :host([multiline]) .o-toast-close {
123
+ align-self: flex-start;
124
+ }
125
+
126
+ :host([multiline]) .o-toast-icon {
127
+ align-self: flex-start;
128
+ line-height: 2.8rem;
129
+ }
130
+
131
+ .o-toast {
132
+ background: #fffefe;
133
+ padding: var(--spacing-l);
134
+ border-radius: var(--radius-m);
135
+ display: flex;
136
+ width: fit-content;
137
+ align-items: center;
138
+ box-shadow: 0 2px 10px 0 rgba(0, 0, 0, 0.12);
139
+ }
140
+
141
+ .o-toast-text {
142
+ color: var(--color-content-body);
143
+ padding: 0 12px;
144
+ width: max-content;
145
+ line-height: 20px;
146
+ max-width: 65vw;
147
+ }
148
+
149
+ .o-toast-icon {
150
+ height: 16px;
151
+ }
152
+ `;
153
+ o([
154
+ a({ type: String, reflect: !0 })
155
+ ], e.prototype, "icon", 2);
156
+ o([
157
+ a({ type: String, reflect: !0 })
158
+ ], e.prototype, "text", 2);
159
+ o([
160
+ a({ type: String, reflect: !0 })
161
+ ], e.prototype, "verticalanchor", 2);
162
+ o([
163
+ a({ type: String, reflect: !0 })
164
+ ], e.prototype, "horizontalanchor", 2);
165
+ o([
166
+ a({ type: Number, reflect: !0 })
167
+ ], e.prototype, "verticaloffset", 2);
168
+ o([
169
+ a({ type: Number, reflect: !0 })
170
+ ], e.prototype, "horizontaloffset", 2);
171
+ o([
172
+ a({ type: Number, reflect: !0 })
173
+ ], e.prototype, "animationduration", 2);
174
+ o([
175
+ a({ type: String, reflect: !0 })
176
+ ], e.prototype, "animationaxis", 2);
177
+ o([
178
+ a({ type: Boolean, reflect: !0 })
179
+ ], e.prototype, "animated", 2);
180
+ o([
181
+ a({ type: Number, reflect: !0 })
182
+ ], e.prototype, "lifeduration", 2);
183
+ o([
184
+ a({ type: Boolean, reflect: !0 })
185
+ ], e.prototype, "multiline", 2);
186
+ e = o([
187
+ d("o-toast")
188
+ ], e);
189
+ export {
190
+ e as OccitaneToast
191
+ };
@@ -0,0 +1,125 @@
1
+ import { i as c, m as x, a as h, x as f, t as d } from "../performance-mixin-D7YmSeqN.mjs";
2
+ import { n as s } from "../property-S_Y9cb04.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
+ };
@@ -0,0 +1,132 @@
1
+ import { i as u, m as p, a as d, x as h, t as b } from "../performance-mixin-D7YmSeqN.mjs";
2
+ import { n as r } from "../property-S_Y9cb04.mjs";
3
+ import { o as g } from "../unsafe-svg-C3uTocNg.mjs";
4
+ import { i as y } from "../icons-Pdn_6YtT.mjs";
5
+ import { g as f } from "../svg-utils-CRDBD8ES.mjs";
6
+ import { f as v, s as w } from "../css-C8WrrxT-.mjs";
7
+ var m = Object.defineProperty, S = Object.getOwnPropertyDescriptor, o = (t, i, a, n) => {
8
+ for (var e = n > 1 ? void 0 : n ? S(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 && m(i, a, e), e;
11
+ };
12
+ let s = class extends p(d) {
13
+ constructor() {
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", {
16
+ detail: { status: this.status },
17
+ bubbles: !0,
18
+ composed: !0
19
+ }));
20
+ };
21
+ }
22
+ connectedCallback() {
23
+ super.connectedCallback(), this.setAttribute("role", "button"), this.setAttribute("aria-pressed", String(this.status === "filled"));
24
+ }
25
+ firstUpdated() {
26
+ this.addEventListener("click", this.toggleStatus), this.addEventListener("keydown", this.handleKeydown);
27
+ }
28
+ handleKeydown(t) {
29
+ (t.key === "Enter" || t.key === " ") && (t.preventDefault(), this.toggleStatus());
30
+ }
31
+ render() {
32
+ const t = y[this.icon] ?? "";
33
+ if (!t) return h``;
34
+ const i = f(t);
35
+ return h`
36
+ <button type="button" aria-describedby="${this.ariaDescribedBy}" class="wishlist-button">
37
+ <span class="sr-only">${this.label}</span>
38
+ ${g(i)}
39
+ </button>
40
+ `;
41
+ }
42
+ setStatus(t) {
43
+ this.status = t, this.setAttribute("aria-pressed", String(this.status === "filled")), this.requestUpdate();
44
+ }
45
+ setAriaDescribedBy(t) {
46
+ this.ariaDescribedBy = t, this.requestUpdate();
47
+ }
48
+ setLabel(t) {
49
+ this.label = t, this.requestUpdate();
50
+ }
51
+ };
52
+ s.styles = u`
53
+ :host {
54
+ display: inline-flex;
55
+ justify-content: center;
56
+ align-items: center;
57
+ outline: none !important;
58
+ }
59
+
60
+ .wishlist-button {
61
+ display: flex;
62
+ justify-content: center;
63
+ align-items: center;
64
+ width: var(--wishlist-button-size, 32px);
65
+ height: var(--wishlist-button-size, 32px);
66
+ border: transparent;
67
+ border-radius: var(--radius-full);
68
+ background-color: var(--color-alpha-light-strong);
69
+ position: relative;
70
+ cursor: pointer;
71
+ }
72
+
73
+ .wishlist-button:hover {
74
+ background-color: var(--color-alpha-light-stronger);
75
+ }
76
+
77
+ .wishlist-button:active {
78
+ background-color: var(--color-alpha-light-strongest);
79
+ }
80
+
81
+ .wishlist-button:focus-visible {
82
+ ${v};
83
+ }
84
+
85
+ .wishlist-button:hover svg path {
86
+ fill: var(--color-content-action-secondary);
87
+ }
88
+
89
+ :host([status="filled"]) .wishlist-button svg path {
90
+ fill: var(--color-content-action-secondary);
91
+ }
92
+
93
+ @media (hover: hover) and (pointer: fine) {
94
+ :host([status="empty"]) .wishlist-button:hover svg path {
95
+ fill: var(--color-content-action-secondary);
96
+ }
97
+ }
98
+
99
+ .sr-only {
100
+ ${w}
101
+ }
102
+
103
+ :host([icon="occ-wishlist-outlined"][bgstyle="none-contrast"]) .wishlist-button svg path {
104
+ fill: var(--color-content-action-secondary);
105
+ }
106
+
107
+ :host([icon="occ-wishlist-filled"][bgstyle="none-contrast"]) .wishlist-button svg path {
108
+ fill: var(--color-content-action-secondary);
109
+ stroke: var(--color-content-action-secondary);
110
+ }
111
+ `;
112
+ o([
113
+ r({ type: String, reflect: !0 })
114
+ ], s.prototype, "status", 2);
115
+ o([
116
+ r({ type: String, reflect: !0 })
117
+ ], s.prototype, "icon", 2);
118
+ o([
119
+ r({ type: String, reflect: !0 })
120
+ ], s.prototype, "bgstyle", 2);
121
+ o([
122
+ r({ type: String, reflect: !0 })
123
+ ], s.prototype, "ariaDescribedBy", 2);
124
+ o([
125
+ r({ type: String, reflect: !0 })
126
+ ], s.prototype, "label", 2);
127
+ s = o([
128
+ b("o-wishlist-button")
129
+ ], s);
130
+ export {
131
+ s as OccitaneWishlistButton
132
+ };