@florid-kit/components 3.2.22 → 3.2.24
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/icon-button.d.ts +1 -0
- package/components/icon-button.mjs +18 -15
- package/components/thumbnail-navigation.mjs +75 -56
- package/index.mjs +1 -1
- package/loader.mjs +1 -1
- package/package.json +1 -1
|
@@ -30,6 +30,7 @@ export declare class OccitaneIconButton extends OccitaneIconButton_base {
|
|
|
30
30
|
* button so its accessible name comes only from the sr-only label.
|
|
31
31
|
*/
|
|
32
32
|
noAriaLabel: boolean;
|
|
33
|
+
ariaLabel: string | null;
|
|
33
34
|
preventDefault: boolean;
|
|
34
35
|
private _unsubOcc?;
|
|
35
36
|
private _clearOccSubscription;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { i as p, m as d, E as
|
|
1
|
+
import { i as p, m as d, E as c, x as l, a as v, t as y } from "../performance-mixin-D7YmSeqN.mjs";
|
|
2
2
|
import { n } from "../property-S_Y9cb04.mjs";
|
|
3
3
|
import { o as u } from "../if-defined-j0wE2gL4.mjs";
|
|
4
4
|
import { r as g, o as m } from "../icons-registry.mjs";
|
|
5
5
|
import { c as f } from "../svg-utils-DOL__czZ.mjs";
|
|
6
6
|
import { f as x, i as w, s as k } from "../css-C8WrrxT-.mjs";
|
|
7
|
-
var $ = Object.defineProperty, S = Object.getOwnPropertyDescriptor, i = (t, s, r,
|
|
8
|
-
for (var e =
|
|
9
|
-
(b = t[h]) && (e = (
|
|
10
|
-
return
|
|
7
|
+
var $ = Object.defineProperty, S = Object.getOwnPropertyDescriptor, i = (t, s, r, a) => {
|
|
8
|
+
for (var e = a > 1 ? void 0 : a ? S(s, r) : s, h = t.length - 1, b; h >= 0; h--)
|
|
9
|
+
(b = t[h]) && (e = (a ? b(s, r, e) : b(e)) || e);
|
|
10
|
+
return a && e && $(s, r, e), e;
|
|
11
11
|
};
|
|
12
12
|
const z = (t) => t.startsWith("occ-");
|
|
13
13
|
let o = class extends d(v) {
|
|
14
14
|
constructor() {
|
|
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.pressed = void 0, this.showSrLabel = !1, this.srLabel = "", this.url = "", this.urlTitle = "", this.noAriaLabel = !1, this.preventDefault = !1;
|
|
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.pressed = void 0, this.showSrLabel = !1, this.srLabel = "", this.url = "", this.urlTitle = "", this.noAriaLabel = !1, this.ariaLabel = null, this.preventDefault = !1;
|
|
16
16
|
}
|
|
17
17
|
_clearOccSubscription() {
|
|
18
18
|
var t;
|
|
@@ -48,18 +48,18 @@ let o = class extends d(v) {
|
|
|
48
48
|
}
|
|
49
49
|
render() {
|
|
50
50
|
if (!this.icon)
|
|
51
|
-
return
|
|
51
|
+
return c;
|
|
52
52
|
const t = f(this.icon, this.size, this.bgstyle);
|
|
53
|
-
if (!t) return
|
|
54
|
-
const s = `icon-${this.icon}`, r = this.showSrLabel ? l`<span class="sr-only">${this.srLabel}</span>` : null,
|
|
53
|
+
if (!t) return c;
|
|
54
|
+
const s = `icon-${this.icon}`, r = this.showSrLabel ? l`<span class="sr-only">${this.srLabel}</span>` : null, a = this.showSrLabel ? this.noAriaLabel ? void 0 : this.ariaLabel : this.ariaLabel || void 0;
|
|
55
55
|
let e = l``;
|
|
56
56
|
return this.url && this.url.length > 0 ? e = l`
|
|
57
57
|
<a
|
|
58
58
|
href=${this.url}
|
|
59
|
-
aria-label=${u(
|
|
60
|
-
aria-describedby=${this.getAttribute("aria-describedby") ||
|
|
59
|
+
aria-label=${u(a)}
|
|
60
|
+
aria-describedby=${this.getAttribute("aria-describedby") || c}
|
|
61
61
|
?disabled="${this.disabled}"
|
|
62
|
-
title=${this.urlTitle ||
|
|
62
|
+
title=${this.urlTitle || c}
|
|
63
63
|
@click=${this.handleLinkClick}
|
|
64
64
|
>
|
|
65
65
|
<span part="icon-button" class="icon icon-button ${this.size} ${this.bgstyle} ${this.status} ${s} ${this.highlight ? "highlight" : ""}" ?disabled="${this.disabled}">
|
|
@@ -74,10 +74,10 @@ let o = class extends d(v) {
|
|
|
74
74
|
` : l`
|
|
75
75
|
<button
|
|
76
76
|
type="button"
|
|
77
|
-
title=${this.urlTitle ||
|
|
78
|
-
aria-label=${u(
|
|
77
|
+
title=${this.urlTitle || c}
|
|
78
|
+
aria-label=${u(a)}
|
|
79
79
|
aria-pressed=${u(this.pressed === void 0 ? void 0 : String(this.pressed))}
|
|
80
|
-
aria-describedby=${this.getAttribute("aria-describedby") ||
|
|
80
|
+
aria-describedby=${this.getAttribute("aria-describedby") || c}
|
|
81
81
|
part="icon-button"
|
|
82
82
|
class="icon-button ${this.size} ${this.bgstyle} ${this.status} ${s} ${this.highlight ? "highlight" : ""}"
|
|
83
83
|
?disabled="${this.disabled}"
|
|
@@ -394,6 +394,9 @@ i([
|
|
|
394
394
|
i([
|
|
395
395
|
n({ type: Boolean, attribute: "no-aria-label" })
|
|
396
396
|
], o.prototype, "noAriaLabel", 2);
|
|
397
|
+
i([
|
|
398
|
+
n({ type: String, reflect: !0, attribute: "aria-label" })
|
|
399
|
+
], o.prototype, "ariaLabel", 2);
|
|
397
400
|
i([
|
|
398
401
|
n({ type: Boolean, reflect: !0, attribute: "prevent-default" })
|
|
399
402
|
], o.prototype, "preventDefault", 2);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { i as u, m as h, a as
|
|
2
|
-
import { n as
|
|
1
|
+
import { i as u, m as h, a as b, x as d, t as p } from "../performance-mixin-D7YmSeqN.mjs";
|
|
2
|
+
import { n as l } from "../property-S_Y9cb04.mjs";
|
|
3
3
|
import { r as m } from "../state-DjMxXomO.mjs";
|
|
4
4
|
import "./icon-button.mjs";
|
|
5
|
-
var f = Object.defineProperty,
|
|
6
|
-
for (var
|
|
7
|
-
(
|
|
8
|
-
return
|
|
5
|
+
var f = Object.defineProperty, v = Object.getOwnPropertyDescriptor, n = (t, e, o, s) => {
|
|
6
|
+
for (var r = s > 1 ? void 0 : s ? v(e, o) : e, c = t.length - 1, a; c >= 0; c--)
|
|
7
|
+
(a = t[c]) && (r = (s ? a(e, o, r) : a(r)) || r);
|
|
8
|
+
return s && r && f(e, o, r), r;
|
|
9
9
|
};
|
|
10
|
-
let
|
|
10
|
+
let i = class extends h(b) {
|
|
11
11
|
constructor() {
|
|
12
12
|
super(...arguments), this.thumbnails = [], this.activeIndex = 0, this.disabledIndexes = [], this.maxWidth = "100%", this.altressource = "visual", this.focusedIndex = 0, this.playerIconTemplate = d`
|
|
13
13
|
<o-icon-button
|
|
@@ -55,13 +55,11 @@ let r = class extends h(p) {
|
|
|
55
55
|
}
|
|
56
56
|
onFocus(t) {
|
|
57
57
|
const e = t.currentTarget, o = Number(e.dataset.index);
|
|
58
|
-
this.focusedIndex = o
|
|
59
|
-
s.classList.remove("a--tabfocus");
|
|
60
|
-
}), e.classList.add("a--tabfocus"), this.requestUpdate();
|
|
58
|
+
this.focusedIndex = o;
|
|
61
59
|
}
|
|
62
60
|
onFocusOut(t) {
|
|
63
|
-
const e = t.currentTarget, o = Number(e.dataset.index),
|
|
64
|
-
(!
|
|
61
|
+
const e = t.currentTarget, o = Number(e.dataset.index), s = t.relatedTarget;
|
|
62
|
+
(!s || this.shadowRoot && !this.shadowRoot.contains(s)) && (o === this.lastIndex ? this.dispatchEvent(new CustomEvent("thumb-exit", {
|
|
65
63
|
detail: { from: "last", direction: "unspecified" },
|
|
66
64
|
bubbles: !0,
|
|
67
65
|
composed: !0
|
|
@@ -75,22 +73,22 @@ let r = class extends h(p) {
|
|
|
75
73
|
return d`
|
|
76
74
|
<ul class="scroll-container" style="max-width: ${this.maxWidth};">
|
|
77
75
|
${this.thumbnails.map((t, e) => {
|
|
78
|
-
const o = this.disabledIndexes.includes(e),
|
|
76
|
+
const o = this.disabledIndexes.includes(e), s = this.activeIndex === e, r = t.type === "video", c = t.alt || (r ? `video ${e}` : `${this.altressource} ${e + 1}`);
|
|
79
77
|
return d`
|
|
80
78
|
<li class="thumb-wrapper">
|
|
81
79
|
<button
|
|
82
80
|
class="thumb"
|
|
83
81
|
data-index="${e}"
|
|
84
82
|
?disabled=${o}
|
|
85
|
-
aria-current=${
|
|
83
|
+
aria-current=${s ? "true" : "false"}
|
|
86
84
|
@click=${() => this.selectThumbnail(e)}
|
|
87
85
|
@keydown=${this.handleKeyDown}
|
|
88
|
-
@focus=${(
|
|
89
|
-
@focusout=${(
|
|
86
|
+
@focus=${(a) => this.onFocus(a)}
|
|
87
|
+
@focusout=${(a) => this.onFocusOut(a)}
|
|
90
88
|
>
|
|
91
|
-
<img alt="${
|
|
89
|
+
<img alt="${c}" src="${t.src}" />
|
|
92
90
|
</button>
|
|
93
|
-
${
|
|
91
|
+
${r ? d`<div class="play-icon-wrapper">${this.playerIconTemplate}</div>` : null}
|
|
94
92
|
</li>
|
|
95
93
|
`;
|
|
96
94
|
})}
|
|
@@ -98,7 +96,7 @@ let r = class extends h(p) {
|
|
|
98
96
|
`;
|
|
99
97
|
}
|
|
100
98
|
};
|
|
101
|
-
|
|
99
|
+
i.styles = u`
|
|
102
100
|
:host {
|
|
103
101
|
display: flex;
|
|
104
102
|
gap: 5px;
|
|
@@ -112,33 +110,54 @@ r.styles = u`
|
|
|
112
110
|
.thumb {
|
|
113
111
|
width: 56px;
|
|
114
112
|
height: 70px;
|
|
115
|
-
background
|
|
116
|
-
|
|
117
|
-
|
|
113
|
+
background: var(--thumb-border);
|
|
114
|
+
--thumb-border: var(--color-alpha-dark-light);
|
|
115
|
+
--thumb-border-width: 0.5px;
|
|
116
|
+
border: none;
|
|
118
117
|
opacity: 1;
|
|
119
118
|
cursor: pointer;
|
|
120
119
|
outline: none;
|
|
121
|
-
transition:
|
|
122
|
-
padding:
|
|
120
|
+
transition: opacity 0.2s;
|
|
121
|
+
padding: var(--thumb-border-width);
|
|
123
122
|
margin: 0;
|
|
124
123
|
box-sizing: content-box;
|
|
125
124
|
position: relative;
|
|
126
125
|
|
|
127
126
|
img {
|
|
127
|
+
display: block;
|
|
128
128
|
width: 100%;
|
|
129
|
-
height:
|
|
130
|
-
|
|
131
|
-
|
|
129
|
+
height: 100%;
|
|
130
|
+
object-fit: cover;
|
|
131
|
+
background: linear-gradient(to bottom, #f9f5f0, #f7f2ea);
|
|
132
|
+
border: 1px solid var(--color-border-light);
|
|
132
133
|
box-sizing: border-box;
|
|
133
134
|
}
|
|
134
135
|
}
|
|
135
136
|
|
|
136
137
|
.thumb[aria-current="true"] {
|
|
137
|
-
|
|
138
|
+
--thumb-border: var(--color-container-action-primary-default);
|
|
139
|
+
--thumb-border-width: 1px;
|
|
138
140
|
}
|
|
139
141
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
+
@media (hover: hover) {
|
|
143
|
+
.thumb:hover {
|
|
144
|
+
--thumb-border: var(--color-alpha-dark-medium);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.thumb[aria-current="true"]:hover {
|
|
148
|
+
--thumb-border: var(--color-container-action-primary-hover);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.thumb:active {
|
|
153
|
+
--thumb-border: var(--color-alpha-dark-strong);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.thumb[aria-current="true"]:active {
|
|
157
|
+
--thumb-border: var(--color-container-action-primary-pressed);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.thumb:focus-visible::before {
|
|
142
161
|
content: "";
|
|
143
162
|
position: absolute;
|
|
144
163
|
top: 0;
|
|
@@ -151,13 +170,13 @@ r.styles = u`
|
|
|
151
170
|
}
|
|
152
171
|
|
|
153
172
|
.thumb[disabled] {
|
|
154
|
-
border:
|
|
173
|
+
--thumb-border: var(--color-border-disabled, #eee);
|
|
155
174
|
opacity: 0.4;
|
|
156
175
|
pointer-events: none;
|
|
157
176
|
}
|
|
158
177
|
|
|
159
178
|
.thumb:focus-visible {
|
|
160
|
-
border:
|
|
179
|
+
--thumb-border: var(--color-border-primary) !important;
|
|
161
180
|
}
|
|
162
181
|
|
|
163
182
|
.play-icon-wrapper {
|
|
@@ -207,30 +226,30 @@ r.styles = u`
|
|
|
207
226
|
width: 0;
|
|
208
227
|
}
|
|
209
228
|
`;
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
],
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
],
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
],
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
],
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
],
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
],
|
|
228
|
-
|
|
229
|
+
n([
|
|
230
|
+
l({ type: Array })
|
|
231
|
+
], i.prototype, "thumbnails", 2);
|
|
232
|
+
n([
|
|
233
|
+
l({ type: Number })
|
|
234
|
+
], i.prototype, "activeIndex", 2);
|
|
235
|
+
n([
|
|
236
|
+
l({ type: Array })
|
|
237
|
+
], i.prototype, "disabledIndexes", 2);
|
|
238
|
+
n([
|
|
239
|
+
l({ type: String })
|
|
240
|
+
], i.prototype, "maxWidth", 2);
|
|
241
|
+
n([
|
|
242
|
+
l({ type: String })
|
|
243
|
+
], i.prototype, "altressource", 2);
|
|
244
|
+
n([
|
|
245
|
+
l({ type: Object })
|
|
246
|
+
], i.prototype, "swiperInstance", 2);
|
|
247
|
+
n([
|
|
229
248
|
m()
|
|
230
|
-
],
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
],
|
|
249
|
+
], i.prototype, "focusedIndex", 2);
|
|
250
|
+
i = n([
|
|
251
|
+
p("thumbnail-navigation")
|
|
252
|
+
], i);
|
|
234
253
|
export {
|
|
235
|
-
|
|
254
|
+
i as ThumbnailNavigation
|
|
236
255
|
};
|
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.24";
|
|
8
8
|
const i = {
|
|
9
9
|
"o-accordion": () => import("./components/accordion.mjs"),
|
|
10
10
|
"o-accordion-group": () => import("./components/accordion-group.mjs"),
|