@florid-kit/components 3.2.4 → 3.2.6
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/components/link.mjs +44 -45
- package/components/mediumtile.d.ts +2 -0
- package/components/mediumtile.mjs +80 -29
- package/index.mjs +1 -1
- package/loader.mjs +1 -1
- package/package.json +1 -1
package/components/link.mjs
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { i as h, m as f, a as d, x as s, t as v } from "../performance-mixin-D7YmSeqN.mjs";
|
|
2
2
|
import { n } from "../property-S_Y9cb04.mjs";
|
|
3
|
-
import { o as
|
|
3
|
+
import { o as u } from "../if-defined-j0wE2gL4.mjs";
|
|
4
|
+
import { f as g } from "../css-C8WrrxT-.mjs";
|
|
4
5
|
import "./icon-button.mjs";
|
|
5
|
-
var
|
|
6
|
-
for (var o = a > 1 ? void 0 : a ?
|
|
6
|
+
var m = Object.defineProperty, y = Object.getOwnPropertyDescriptor, t = (i, r, l, a) => {
|
|
7
|
+
for (var o = a > 1 ? void 0 : a ? y(r, l) : r, c = i.length - 1, p; c >= 0; c--)
|
|
7
8
|
(p = i[c]) && (o = (a ? p(r, l, o) : p(o)) || o);
|
|
8
|
-
return a && o &&
|
|
9
|
+
return a && o && m(r, l, o), o;
|
|
9
10
|
};
|
|
10
|
-
let
|
|
11
|
+
let e = class extends f(d) {
|
|
11
12
|
constructor() {
|
|
12
13
|
super(...arguments), this.href = "", this.target = "", this.template = "standard", this.inverse = !1, this.endIcon = !1, this.reverseEndIcon = !1, this.startIcon = !1, this.iconSize = "xsmall", this.disabled = !1;
|
|
13
14
|
}
|
|
@@ -52,7 +53,7 @@ let t = class extends f(d) {
|
|
|
52
53
|
<a
|
|
53
54
|
class="link-wrapper"
|
|
54
55
|
href="${this.href}"
|
|
55
|
-
target="${
|
|
56
|
+
target="${u(this.target || void 0)}"
|
|
56
57
|
@click="${this._handleClick}"
|
|
57
58
|
>
|
|
58
59
|
${r}
|
|
@@ -60,12 +61,13 @@ let t = class extends f(d) {
|
|
|
60
61
|
` : s`<span class="link-wrapper">${r}</span>`;
|
|
61
62
|
}
|
|
62
63
|
};
|
|
63
|
-
|
|
64
|
+
e.styles = h`
|
|
64
65
|
:host {
|
|
65
66
|
cursor: pointer;
|
|
66
67
|
}
|
|
67
68
|
|
|
68
69
|
:host([template="standard"]) .link-wrapper {
|
|
70
|
+
--link-underline-offset: 7px;
|
|
69
71
|
color: var(--color-content-action-secondary);
|
|
70
72
|
font-size: var(--font-size-200);
|
|
71
73
|
font-weight: var(--font-weight-400);
|
|
@@ -75,6 +77,7 @@ t.styles = h`
|
|
|
75
77
|
}
|
|
76
78
|
|
|
77
79
|
:host([template="discret"]) .link-wrapper {
|
|
80
|
+
--link-underline-offset: 4px;
|
|
78
81
|
color: var(--color-content-action-secondary);
|
|
79
82
|
font-size: var(--font-size-150);
|
|
80
83
|
font-weight: var(--font-weight-400);
|
|
@@ -84,6 +87,7 @@ t.styles = h`
|
|
|
84
87
|
}
|
|
85
88
|
|
|
86
89
|
:host([template="review"]) .link-wrapper {
|
|
90
|
+
--link-underline-offset: 3px;
|
|
87
91
|
color: var(--color-content-action-secondary);
|
|
88
92
|
font-size: var(--font-size-100);
|
|
89
93
|
font-weight: var(--font-weight-500);
|
|
@@ -126,28 +130,23 @@ t.styles = h`
|
|
|
126
130
|
color: inherit;
|
|
127
131
|
}
|
|
128
132
|
|
|
129
|
-
.link-
|
|
130
|
-
|
|
131
|
-
display: inline-block;
|
|
133
|
+
.link-wrapper:focus-visible {
|
|
134
|
+
${g};
|
|
132
135
|
}
|
|
133
136
|
|
|
134
|
-
.link-text
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
background-color: currentColor;
|
|
143
|
-
transition: opacity 0.3s ease, height 0.3s ease;
|
|
144
|
-
pointer-events: none;
|
|
137
|
+
.link-text {
|
|
138
|
+
display: inline;
|
|
139
|
+
text-decoration: underline;
|
|
140
|
+
text-decoration-thickness: 1px;
|
|
141
|
+
text-underline-offset: var(--link-underline-offset, 7px);
|
|
142
|
+
text-decoration-skip-ink: none;
|
|
143
|
+
text-decoration-color: currentColor;
|
|
144
|
+
transition: text-decoration-color 0.3s ease;
|
|
145
145
|
}
|
|
146
146
|
|
|
147
147
|
@media (hover: hover) and (pointer: fine) {
|
|
148
|
-
:host .link-wrapper:hover .link-text
|
|
149
|
-
|
|
150
|
-
height: 1px;
|
|
148
|
+
:host .link-wrapper:hover .link-text {
|
|
149
|
+
text-decoration-color: transparent;
|
|
151
150
|
}
|
|
152
151
|
|
|
153
152
|
:host([endIcon]) .link-wrapper:hover .link-end-icon {
|
|
@@ -164,36 +163,36 @@ t.styles = h`
|
|
|
164
163
|
}
|
|
165
164
|
}
|
|
166
165
|
`;
|
|
167
|
-
|
|
166
|
+
t([
|
|
168
167
|
n({ type: String })
|
|
169
|
-
],
|
|
170
|
-
|
|
168
|
+
], e.prototype, "href", 2);
|
|
169
|
+
t([
|
|
171
170
|
n({ type: String })
|
|
172
|
-
],
|
|
173
|
-
|
|
171
|
+
], e.prototype, "target", 2);
|
|
172
|
+
t([
|
|
174
173
|
n({ type: String, reflect: !0 })
|
|
175
|
-
],
|
|
176
|
-
|
|
174
|
+
], e.prototype, "template", 2);
|
|
175
|
+
t([
|
|
177
176
|
n({ type: Boolean, reflect: !0 })
|
|
178
|
-
],
|
|
179
|
-
|
|
177
|
+
], e.prototype, "inverse", 2);
|
|
178
|
+
t([
|
|
180
179
|
n({ type: Boolean, reflect: !0 })
|
|
181
|
-
],
|
|
182
|
-
|
|
180
|
+
], e.prototype, "endIcon", 2);
|
|
181
|
+
t([
|
|
183
182
|
n({ type: Boolean, reflect: !0 })
|
|
184
|
-
],
|
|
185
|
-
|
|
183
|
+
], e.prototype, "reverseEndIcon", 2);
|
|
184
|
+
t([
|
|
186
185
|
n({ type: Boolean, reflect: !0 })
|
|
187
|
-
],
|
|
188
|
-
|
|
186
|
+
], e.prototype, "startIcon", 2);
|
|
187
|
+
t([
|
|
189
188
|
n({ type: String })
|
|
190
|
-
],
|
|
191
|
-
|
|
189
|
+
], e.prototype, "iconSize", 2);
|
|
190
|
+
t([
|
|
192
191
|
n({ type: Boolean, reflect: !0 })
|
|
193
|
-
],
|
|
194
|
-
|
|
192
|
+
], e.prototype, "disabled", 2);
|
|
193
|
+
e = t([
|
|
195
194
|
v("o-link")
|
|
196
|
-
],
|
|
195
|
+
], e);
|
|
197
196
|
export {
|
|
198
|
-
|
|
197
|
+
e as OccitaneLink
|
|
199
198
|
};
|
|
@@ -22,6 +22,8 @@ export declare class MediumTile extends MediumTile_base {
|
|
|
22
22
|
onClickIcon?: () => void;
|
|
23
23
|
private onClick;
|
|
24
24
|
private onClickIcons;
|
|
25
|
+
get iconLabel(): string;
|
|
26
|
+
get tileLabel(): string;
|
|
25
27
|
get icons(): "" | import('lit').TemplateResult<1>;
|
|
26
28
|
static styles: import('lit').CSSResult;
|
|
27
29
|
render(): import('lit').TemplateResult<1>;
|
|
@@ -1,63 +1,84 @@
|
|
|
1
|
-
import { i as
|
|
1
|
+
import { i as h, m as f, a as d, x as a, t as g } from "../performance-mixin-D7YmSeqN.mjs";
|
|
2
2
|
import { n as i } from "../property-S_Y9cb04.mjs";
|
|
3
3
|
import "./icon-button.mjs";
|
|
4
4
|
import "./tag.mjs";
|
|
5
|
-
var
|
|
6
|
-
for (var
|
|
7
|
-
(p =
|
|
8
|
-
return s &&
|
|
5
|
+
var u = Object.defineProperty, v = Object.getOwnPropertyDescriptor, e = (n, o, l, s) => {
|
|
6
|
+
for (var r = s > 1 ? void 0 : s ? v(o, l) : o, c = n.length - 1, p; c >= 0; c--)
|
|
7
|
+
(p = n[c]) && (r = (s ? p(o, l, r) : p(r)) || r);
|
|
8
|
+
return s && r && u(o, l, r), r;
|
|
9
9
|
};
|
|
10
|
-
let t = class extends
|
|
10
|
+
let t = class extends f(d) {
|
|
11
11
|
constructor() {
|
|
12
12
|
super(...arguments), this.type = "cart | notifyme", this.titleProduct = "", this.descriptionProduct = "", this.volume = "", this.perLiter = "", this.mainPrice = "", this.salesPercentage = "", this.oldPrice = "", this.imageUrl = "https://placehold.co/112x140", this.outOfStock = !1, this.outOfStockText = "Out of stock", this.altImage = "", this.fullwidth = !1, this.current = !1, this.hideIcon = !1, this.tagText = "";
|
|
13
13
|
}
|
|
14
|
-
onClick(
|
|
15
|
-
var l, s,
|
|
16
|
-
const o =
|
|
17
|
-
(l = o == null ? void 0 : o.classList) != null && l.contains("add-to-bag") || (s = o == null ? void 0 : o.classList) != null && s.contains("js-availability-notify-details-routine") || ((
|
|
14
|
+
onClick(n) {
|
|
15
|
+
var l, s, r;
|
|
16
|
+
const o = n.target;
|
|
17
|
+
(l = o == null ? void 0 : o.classList) != null && l.contains("add-to-bag") || (s = o == null ? void 0 : o.classList) != null && s.contains("js-availability-notify-details-routine") || ((r = this.onClickTile) == null || r.call(this), this.dispatchEvent(
|
|
18
18
|
new CustomEvent("tile-click", { bubbles: !0, composed: !0 })
|
|
19
19
|
));
|
|
20
20
|
}
|
|
21
21
|
onClickIcons() {
|
|
22
|
-
var
|
|
23
|
-
(
|
|
22
|
+
var n;
|
|
23
|
+
(n = this.onClickIcon) == null || n.call(this), this.dispatchEvent(
|
|
24
24
|
new CustomEvent("tile-icon-click", { bubbles: !0, composed: !0 })
|
|
25
25
|
);
|
|
26
26
|
}
|
|
27
|
+
// Accessible name for the add-to-bag / notify-me button, same shape as minitile's.
|
|
28
|
+
get iconLabel() {
|
|
29
|
+
const n = window.Resources || {};
|
|
30
|
+
return [this.type === "notifyme" ? n.NOSTOCK : n.ADD_TO_CART, this.titleProduct, this.volume].filter(Boolean).join(" - ");
|
|
31
|
+
}
|
|
32
|
+
// Accessible name for the tile action, same shape as minitile's title.
|
|
33
|
+
get tileLabel() {
|
|
34
|
+
return [
|
|
35
|
+
(window.Resources || {}).VIEW_PRODUCT,
|
|
36
|
+
this.titleProduct,
|
|
37
|
+
this.volume,
|
|
38
|
+
this.mainPrice
|
|
39
|
+
].filter(Boolean).join(" - ");
|
|
40
|
+
}
|
|
27
41
|
get icons() {
|
|
28
|
-
return this.hideIcon ? "" :
|
|
42
|
+
return this.hideIcon ? "" : a`
|
|
29
43
|
<o-icon-button
|
|
30
44
|
@click=${this.onClickIcons}
|
|
31
45
|
icon=${this.type === "notifyme" ? "notifyme" : "cart"}
|
|
32
46
|
size="small"
|
|
33
47
|
bgstyle="background-contrast"
|
|
34
|
-
type="
|
|
48
|
+
type="button"
|
|
35
49
|
status="empty"
|
|
36
50
|
strokewidth="0"
|
|
37
51
|
class=${this.type === "notifyme" ? "js-availability-notify-details-routine" : "add-to-bag"}
|
|
52
|
+
title="${this.iconLabel}"
|
|
53
|
+
srlabel="${this.iconLabel}"
|
|
54
|
+
?showsrlabel=${!0}
|
|
38
55
|
></o-icon-button>
|
|
39
56
|
`;
|
|
40
57
|
}
|
|
41
58
|
render() {
|
|
42
|
-
return
|
|
43
|
-
<
|
|
44
|
-
type="button"
|
|
59
|
+
return a`
|
|
60
|
+
<div
|
|
45
61
|
class="tile fullpointer ${this.fullwidth ? "fullwidth" : ""} ${this.current ? "current" : ""}"
|
|
46
|
-
@click=${this.onClick}
|
|
47
62
|
>
|
|
48
|
-
|
|
63
|
+
<button
|
|
64
|
+
type="button"
|
|
65
|
+
class="tile-action"
|
|
66
|
+
@click=${this.onClick}
|
|
67
|
+
title="${this.tileLabel}"
|
|
68
|
+
></button>
|
|
69
|
+
${this.imageUrl ? a`<img src="${this.imageUrl}" alt="${this.altImage || ""}" />` : ""}
|
|
49
70
|
<div class="info">
|
|
50
|
-
${this.tagText ?
|
|
51
|
-
${this.outOfStock ?
|
|
71
|
+
${this.tagText ? a`<o-tag bgstyle="background-emphasis">${this.tagText}</o-tag>` : ""}
|
|
72
|
+
${this.outOfStock ? a`<o-tag type="nostock" role="status" aria-live="polite"
|
|
52
73
|
>${this.outOfStockText}</o-tag
|
|
53
74
|
>` : ""}
|
|
54
75
|
<div class="title-volume">
|
|
55
|
-
${this.titleProduct ?
|
|
56
|
-
${this.volume ?
|
|
76
|
+
${this.titleProduct ? a`<div class="title">${this.titleProduct}</div>` : ""}
|
|
77
|
+
${this.volume ? a`<span class="volume-info">${this.volume}</span>` : ""}
|
|
57
78
|
</div>
|
|
58
|
-
${this.descriptionProduct ?
|
|
79
|
+
${this.descriptionProduct ? a`<div class="description">${this.descriptionProduct}</div>` : ""}
|
|
59
80
|
<div class="details">
|
|
60
|
-
${this.salesPercentage && this.oldPrice ?
|
|
81
|
+
${this.salesPercentage && this.oldPrice ? a`<div class="discount-info">
|
|
61
82
|
<o-tag bgstyle="background-emphasis"
|
|
62
83
|
>${this.salesPercentage}</o-tag
|
|
63
84
|
>
|
|
@@ -65,24 +86,25 @@ let t = class extends h(d) {
|
|
|
65
86
|
</div>` : ""}
|
|
66
87
|
<div class="price-details">
|
|
67
88
|
<div class="price-info">
|
|
68
|
-
${this.mainPrice ?
|
|
69
|
-
${this.perLiter ?
|
|
89
|
+
${this.mainPrice ? a`<span class="main-price">${this.mainPrice}</span>` : ""}
|
|
90
|
+
${this.perLiter ? a`<span class="per-liter">${this.perLiter}</span>` : ""}
|
|
70
91
|
</div>
|
|
71
92
|
${this.icons}
|
|
72
93
|
</div>
|
|
73
94
|
</div>
|
|
74
95
|
</div>
|
|
75
|
-
</
|
|
96
|
+
</div>
|
|
76
97
|
`;
|
|
77
98
|
}
|
|
78
99
|
};
|
|
79
|
-
t.styles =
|
|
100
|
+
t.styles = h`
|
|
80
101
|
:host {
|
|
81
102
|
display: block;
|
|
82
103
|
max-width: 100%;
|
|
83
104
|
}
|
|
84
105
|
|
|
85
106
|
.tile {
|
|
107
|
+
position: relative;
|
|
86
108
|
display: flex;
|
|
87
109
|
column-gap: var(--spacing-l);
|
|
88
110
|
align-items: flex-start;
|
|
@@ -244,6 +266,35 @@ t.styles = f`
|
|
|
244
266
|
.fullpointer {
|
|
245
267
|
cursor: pointer;
|
|
246
268
|
}
|
|
269
|
+
|
|
270
|
+
/*
|
|
271
|
+
* The tile action used to be a <button> wrapping the whole tile, which made
|
|
272
|
+
* the add-to-bag button a nested interactive element: invalid HTML, and
|
|
273
|
+
* unreachable by keyboard. It is now a transparent overlay sibling, so the
|
|
274
|
+
* whole tile stays clickable while the CTA gets its own tab stop.
|
|
275
|
+
*/
|
|
276
|
+
.tile-action {
|
|
277
|
+
position: absolute;
|
|
278
|
+
inset: 0;
|
|
279
|
+
width: 100%;
|
|
280
|
+
height: 100%;
|
|
281
|
+
margin: 0;
|
|
282
|
+
padding: 0;
|
|
283
|
+
border: 0 none;
|
|
284
|
+
background: none;
|
|
285
|
+
appearance: none;
|
|
286
|
+
-webkit-appearance: none;
|
|
287
|
+
cursor: pointer;
|
|
288
|
+
border-radius: inherit;
|
|
289
|
+
font: inherit;
|
|
290
|
+
color: inherit;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
/* Keep the CTA above the overlay so pointer events still reach it. */
|
|
294
|
+
.info o-icon-button {
|
|
295
|
+
position: relative;
|
|
296
|
+
z-index: 1;
|
|
297
|
+
}
|
|
247
298
|
`;
|
|
248
299
|
e([
|
|
249
300
|
i({ type: String })
|
package/index.mjs
CHANGED
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.2.
|
|
7
|
+
globalThis.__FLORID_KIT__ = "3.2.6";
|
|
8
8
|
const i = {
|
|
9
9
|
"o-accordion": () => import("./components/accordion.mjs"),
|
|
10
10
|
"o-accordion-group": () => import("./components/accordion-group.mjs"),
|