@florid-kit/components 3.2.0 → 3.2.1
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 +4 -0
- package/components/icon-button.mjs +57 -32
- package/index.mjs +1 -1
- package/loader.mjs +1 -1
- package/package.json +1 -1
|
@@ -23,12 +23,16 @@ export declare class OccitaneIconButton extends OccitaneIconButton_base {
|
|
|
23
23
|
pressed: boolean | undefined;
|
|
24
24
|
showSrLabel: boolean;
|
|
25
25
|
srLabel: string;
|
|
26
|
+
url: string;
|
|
27
|
+
urlTitle: string;
|
|
28
|
+
preventDefault: boolean;
|
|
26
29
|
private _unsubOcc?;
|
|
27
30
|
private _clearOccSubscription;
|
|
28
31
|
private _syncOccSubscription;
|
|
29
32
|
connectedCallback(): void;
|
|
30
33
|
disconnectedCallback(): void;
|
|
31
34
|
protected updated(changedProperties: Map<string, unknown>): void;
|
|
35
|
+
protected handleLinkClick(ev: Event): void;
|
|
32
36
|
protected render(): typeof nothing | import('lit').TemplateResult<1>;
|
|
33
37
|
}
|
|
34
38
|
declare global {
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { i as p, m as d, E as
|
|
1
|
+
import { i as p, m as d, E as a, x as l, a as v, t as y } from "../performance-mixin-D7YmSeqN.mjs";
|
|
2
2
|
import { n } from "../property-S_Y9cb04.mjs";
|
|
3
|
-
import { o as
|
|
4
|
-
import { r as
|
|
5
|
-
import { c as
|
|
6
|
-
import { f, i as w, s as k } from "../css-C8WrrxT-.mjs";
|
|
7
|
-
var $ = Object.defineProperty, S = Object.getOwnPropertyDescriptor, i = (t,
|
|
8
|
-
for (var
|
|
9
|
-
(
|
|
10
|
-
return c &&
|
|
3
|
+
import { o as u } from "../if-defined-j0wE2gL4.mjs";
|
|
4
|
+
import { r as g, o as m } from "../icons-registry.mjs";
|
|
5
|
+
import { c as f } from "../svg-utils-DOL__czZ.mjs";
|
|
6
|
+
import { f as x, i as w, s as k } from "../css-C8WrrxT-.mjs";
|
|
7
|
+
var $ = Object.defineProperty, S = Object.getOwnPropertyDescriptor, i = (t, e, r, c) => {
|
|
8
|
+
for (var s = c > 1 ? void 0 : c ? S(e, r) : e, h = t.length - 1, b; h >= 0; h--)
|
|
9
|
+
(b = t[h]) && (s = (c ? b(e, r, s) : b(s)) || s);
|
|
10
|
+
return c && s && $(e, r, s), s;
|
|
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 = "";
|
|
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.preventDefault = !1;
|
|
16
16
|
}
|
|
17
17
|
_clearOccSubscription() {
|
|
18
18
|
var t;
|
|
@@ -24,14 +24,14 @@ let o = class extends d(v) {
|
|
|
24
24
|
this._clearOccSubscription();
|
|
25
25
|
return;
|
|
26
26
|
}
|
|
27
|
-
const { svg:
|
|
28
|
-
if (
|
|
27
|
+
const { svg: e } = g(t, { size: this.size, bgstyle: this.bgstyle });
|
|
28
|
+
if (e) {
|
|
29
29
|
this._clearOccSubscription();
|
|
30
30
|
return;
|
|
31
31
|
}
|
|
32
|
-
this._unsubOcc || (this._unsubOcc =
|
|
33
|
-
const { svg:
|
|
34
|
-
|
|
32
|
+
this._unsubOcc || (this._unsubOcc = m(() => {
|
|
33
|
+
const { svg: r } = g(t, { size: this.size, bgstyle: this.bgstyle });
|
|
34
|
+
r && (this._clearOccSubscription(), this.requestUpdate());
|
|
35
35
|
}));
|
|
36
36
|
}
|
|
37
37
|
connectedCallback() {
|
|
@@ -43,32 +43,48 @@ let o = class extends d(v) {
|
|
|
43
43
|
updated(t) {
|
|
44
44
|
super.updated(t), this.style.setProperty("--icon-stroke-width", this.strokewidth), t.has("icon") && this._syncOccSubscription();
|
|
45
45
|
}
|
|
46
|
+
handleLinkClick(t) {
|
|
47
|
+
this.preventDefault && this.url && this.url.startsWith("#") && t.preventDefault();
|
|
48
|
+
}
|
|
46
49
|
render() {
|
|
47
50
|
if (!this.icon)
|
|
48
|
-
return
|
|
49
|
-
const t =
|
|
50
|
-
if (!t) return
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
<
|
|
51
|
+
return a;
|
|
52
|
+
const t = f(this.icon, this.size, this.bgstyle);
|
|
53
|
+
if (!t) return a;
|
|
54
|
+
const e = `icon-${this.icon}`, r = this.showSrLabel ? l`<span class="sr-only">${this.srLabel}</span>` : null, c = this.showSrLabel ? "" : "icon";
|
|
55
|
+
let s = l``;
|
|
56
|
+
return this.url && this.url.length > 0 ? s = l`
|
|
57
|
+
<a
|
|
58
|
+
href=${this.url}
|
|
59
|
+
aria-label=${u(c) || a}
|
|
60
|
+
aria-describedby=${this.getAttribute("aria-describedby") || a}
|
|
61
|
+
?disabled="${this.disabled}"
|
|
62
|
+
title=${this.urlTitle || a}
|
|
63
|
+
@click=${this.handleLinkClick}
|
|
64
|
+
>
|
|
65
|
+
<span part="icon-button" class="icon icon-button ${this.size} ${this.bgstyle} ${this.status} ${e} ${this.highlight ? "highlight" : ""}" ?disabled="${this.disabled}">
|
|
66
|
+
${t}
|
|
67
|
+
</span>
|
|
68
|
+
${r}
|
|
69
|
+
</a>
|
|
70
|
+
` : s = this.type === "span" ? l`
|
|
71
|
+
<span part="icon-button" class="icon icon-button ${this.size} ${this.bgstyle} ${this.status} ${e} ${this.highlight ? "highlight" : ""}" ?disabled="${this.disabled}">
|
|
55
72
|
${t}
|
|
56
73
|
</span>
|
|
57
|
-
` :
|
|
74
|
+
` : l`
|
|
58
75
|
<button
|
|
59
76
|
type="button"
|
|
60
|
-
aria-label=${
|
|
61
|
-
aria-pressed=${
|
|
62
|
-
aria-describedby=${this.getAttribute("aria-describedby") ||
|
|
77
|
+
aria-label=${u(c)}
|
|
78
|
+
aria-pressed=${u(this.pressed === void 0 ? void 0 : String(this.pressed))}
|
|
79
|
+
aria-describedby=${this.getAttribute("aria-describedby") || a}
|
|
63
80
|
part="icon-button"
|
|
64
|
-
class="icon-button ${this.size} ${this.bgstyle} ${this.status} ${
|
|
81
|
+
class="icon-button ${this.size} ${this.bgstyle} ${this.status} ${e} ${this.highlight ? "highlight" : ""}"
|
|
65
82
|
?disabled="${this.disabled}"
|
|
66
83
|
>
|
|
67
84
|
${t}
|
|
68
|
-
${
|
|
85
|
+
${r}
|
|
69
86
|
</button>
|
|
70
|
-
|
|
71
|
-
`;
|
|
87
|
+
`, s;
|
|
72
88
|
}
|
|
73
89
|
};
|
|
74
90
|
o.styles = p`
|
|
@@ -301,7 +317,7 @@ o.styles = p`
|
|
|
301
317
|
|
|
302
318
|
.icon-button:focus-visible,
|
|
303
319
|
:host(.a--tabfocus) .icon-button {
|
|
304
|
-
${
|
|
320
|
+
${x}
|
|
305
321
|
}
|
|
306
322
|
|
|
307
323
|
:host(.go-to-top) .icon-button:focus-visible {
|
|
@@ -361,8 +377,17 @@ i([
|
|
|
361
377
|
i([
|
|
362
378
|
n({ type: String })
|
|
363
379
|
], o.prototype, "srLabel", 2);
|
|
380
|
+
i([
|
|
381
|
+
n({ type: String, reflect: !0 })
|
|
382
|
+
], o.prototype, "url", 2);
|
|
383
|
+
i([
|
|
384
|
+
n({ type: String })
|
|
385
|
+
], o.prototype, "urlTitle", 2);
|
|
386
|
+
i([
|
|
387
|
+
n({ type: Boolean, reflect: !0, attribute: "prevent-default" })
|
|
388
|
+
], o.prototype, "preventDefault", 2);
|
|
364
389
|
o = i([
|
|
365
|
-
|
|
390
|
+
y("o-icon-button")
|
|
366
391
|
], o);
|
|
367
392
|
export {
|
|
368
393
|
o as OccitaneIconButton
|
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.1";
|
|
8
8
|
const i = {
|
|
9
9
|
"o-accordion": () => import("./components/accordion.mjs"),
|
|
10
10
|
"o-accordion-group": () => import("./components/accordion-group.mjs"),
|