@getflip/swirl-components-react 0.1.0 → 0.1.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/dist/{flip-action-list-item.entry.1b728e6a.js → flip-action-list-item.entry.0f7f7d1d.js} +1 -1
- package/dist/{flip-action-list-section.entry.da3e6186.js → flip-action-list-section.entry.e3180209.js} +1 -1
- package/dist/{flip-action-list.entry.400a309a.js → flip-action-list.entry.6281e19f.js} +1 -1
- package/dist/flip-avatar-group.entry.649a0faa.js +19 -0
- package/dist/{flip-avatar.entry.2eb3242e.js → flip-avatar.entry.8261b415.js} +1 -1
- package/dist/flip-badge.entry.d0a48796.js +19 -0
- package/dist/{flip-banner.entry.b3012465.js → flip-banner.entry.f03180a7.js} +1 -1
- package/dist/flip-button-group.entry.e48f9cab.js +15 -0
- package/dist/{flip-button_2.entry.a323451d.js → flip-button.entry.d68ba496.js} +5 -15
- package/dist/{flip-checkbox.entry.2f740fb8.js → flip-checkbox.entry.03f73a8f.js} +9 -9
- package/dist/{flip-chip.entry.e9729ac7.js → flip-chip.entry.232a1cad.js} +1 -1
- package/dist/{flip-description-list-item.entry.c789511e.js → flip-description-list-item.entry.460331a8.js} +1 -1
- package/dist/{flip-description-list.entry.3b158436.js → flip-description-list.entry.489d5885.js} +1 -1
- package/dist/{flip-dialog.entry.f2be9a9c.js → flip-dialog.entry.cbf334d1.js} +1 -1
- package/dist/flip-file-uploader.entry.bbfb166b.js +31 -0
- package/dist/{flip-icon-add-photo.entry.a1003bdf.js → flip-icon-add-photo.entry.b807c3bc.js} +1 -1
- package/dist/{flip-icon-add.entry.7103fbe7.js → flip-icon-add.entry.df6780ff.js} +1 -1
- package/dist/{flip-icon-admin-panel-settings.entry.36a12e47.js → flip-icon-admin-panel-settings.entry.5afd720c.js} +1 -1
- package/dist/{flip-icon-arrow-back.entry.e35ba078.js → flip-icon-arrow-back.entry.43439868.js} +1 -1
- package/dist/{flip-icon-arrow-forward.entry.5138c404.js → flip-icon-arrow-forward.entry.1f80c674.js} +1 -1
- package/dist/{flip-icon-arrow-right-small.entry.d1eeb150.js → flip-icon-arrow-right-small.entry.5bb4f048.js} +1 -1
- package/dist/{flip-icon-attachment.entry.594b602b.js → flip-icon-attachment.entry.e7a4173b.js} +1 -1
- package/dist/{flip-icon-cancel_2.entry.eb8d1a8c.js → flip-icon-cancel_2.entry.99f63020.js} +1 -1
- package/dist/{flip-icon-chat-bubble.entry.f56fcdc4.js → flip-icon-chat-bubble.entry.60ca55cf.js} +1 -1
- package/dist/{flip-icon-check-circle.entry.e4f8169d.js → flip-icon-check-circle.entry.36b7fab2.js} +1 -1
- package/dist/{flip-icon-check-small.entry.308d57d1.js → flip-icon-check-small.entry.26aa4c8e.js} +1 -1
- package/dist/{flip-icon-check-strong.entry.b61365d2.js → flip-icon-check-strong.entry.bf6545d9.js} +1 -1
- package/dist/{flip-icon-check.entry.f2c6b547.js → flip-icon-check.entry.88a7260b.js} +1 -1
- package/dist/{flip-icon-chevron-left.entry.dbe9b291.js → flip-icon-chevron-left.entry.1eab612e.js} +1 -1
- package/dist/{flip-icon-chevron-right.entry.9565c0f1.js → flip-icon-chevron-right.entry.b55b235e.js} +1 -1
- package/dist/{flip-icon-close-small.entry.8bfcf1b1.js → flip-icon-close-small.entry.2c855d87.js} +1 -1
- package/dist/{flip-icon-close.entry.41992748.js → flip-icon-close.entry.8b5754bd.js} +1 -1
- package/dist/flip-icon-cloud-upload.entry.943d15aa.js +15 -0
- package/dist/{flip-icon-comment.entry.2aac2c10.js → flip-icon-comment.entry.966dd929.js} +1 -1
- package/dist/{flip-icon-copy.entry.8e59bf1d.js → flip-icon-copy.entry.a762687c.js} +1 -1
- package/dist/{flip-icon-date-range.entry.c1dd2730.js → flip-icon-date-range.entry.c3029ef5.js} +1 -1
- package/dist/{flip-icon-delete.entry.bc0b61ff.js → flip-icon-delete.entry.9a13cea4.js} +1 -1
- package/dist/{flip-icon-description.entry.e01b2d40.js → flip-icon-description.entry.c16ff02b.js} +1 -1
- package/dist/{flip-icon-download.entry.a512f353.js → flip-icon-download.entry.3b48f816.js} +1 -1
- package/dist/{flip-icon-edit.entry.7e3cd472.js → flip-icon-edit.entry.86590692.js} +1 -1
- package/dist/{flip-icon-emoji-mood.entry.df7b536f.js → flip-icon-emoji-mood.entry.5f75c0e7.js} +1 -1
- package/dist/{flip-icon-emoji-satisfied.entry.e3e5352b.js → flip-icon-emoji-satisfied.entry.a24e9f8b.js} +1 -1
- package/dist/{flip-icon-error.entry.96c3c29b.js → flip-icon-error.entry.0a68ce3b.js} +1 -1
- package/dist/{flip-icon-expand-less.entry.3e970433.js → flip-icon-expand-less.entry.d099c577.js} +1 -1
- package/dist/{flip-icon-expand-more.entry.4c1fa160.js → flip-icon-expand-more.entry.d3b47154.js} +1 -1
- package/dist/{flip-icon-file.entry.3a18cce8.js → flip-icon-file.entry.9edd9ac5.js} +1 -1
- package/dist/{flip-icon-folder-shared.entry.38b22cd2.js → flip-icon-folder-shared.entry.a79740f8.js} +1 -1
- package/dist/{flip-icon-group-assign.entry.a640254f.js → flip-icon-group-assign.entry.ef36d758.js} +1 -1
- package/dist/{flip-icon-groups-custom.entry.d77901cd.js → flip-icon-groups-custom.entry.99781f2b.js} +1 -1
- package/dist/{flip-icon-groups.entry.80196d79.js → flip-icon-groups.entry.33d1e274.js} +1 -1
- package/dist/{flip-icon-image.entry.601bf2ae.js → flip-icon-image.entry.e653564c.js} +1 -1
- package/dist/{flip-icon-info.entry.b480a255.js → flip-icon-info.entry.c0153488.js} +1 -1
- package/dist/{flip-icon-inventory.entry.bb8a5615.js → flip-icon-inventory.entry.394f2024.js} +1 -1
- package/dist/{flip-icon-like.entry.af8b36e2.js → flip-icon-like.entry.db6411bc.js} +1 -1
- package/dist/{flip-icon-link.entry.be72688c.js → flip-icon-link.entry.35fba400.js} +1 -1
- package/dist/{flip-icon-lock.entry.440459fe.js → flip-icon-lock.entry.73ad40b7.js} +1 -1
- package/dist/{flip-icon-logout.entry.dde0bfc8.js → flip-icon-logout.entry.bfdaf585.js} +1 -1
- package/dist/{flip-icon-mail.entry.b57a0093.js → flip-icon-mail.entry.10764728.js} +1 -1
- package/dist/{flip-icon-manage-accounts.entry.11cc3149.js → flip-icon-manage-accounts.entry.13926348.js} +1 -1
- package/dist/{flip-icon-mention.entry.32771810.js → flip-icon-mention.entry.43a08812.js} +1 -1
- package/dist/{flip-icon-message.entry.636088c3.js → flip-icon-message.entry.e45d5f55.js} +1 -1
- package/dist/{flip-icon-more-horizontal.entry.38f14508.js → flip-icon-more-horizontal.entry.175a91a7.js} +1 -1
- package/dist/{flip-icon-more-vertikal.entry.8a4c613a.js → flip-icon-more-vertikal.entry.855f16e5.js} +1 -1
- package/dist/{flip-icon-notifications-active.entry.5658308d.js → flip-icon-notifications-active.entry.0591ff75.js} +1 -1
- package/dist/{flip-icon-notifications-off.entry.8d3b11ff.js → flip-icon-notifications-off.entry.59926148.js} +1 -1
- package/dist/{flip-icon-notifications.entry.91f77dd2.js → flip-icon-notifications.entry.b3b4169c.js} +1 -1
- package/dist/{flip-icon-people-alt.entry.b0b2e20c.js → flip-icon-people-alt.entry.b9304d1e.js} +1 -1
- package/dist/{flip-icon-person-off.entry.e79df0e6.js → flip-icon-person-off.entry.26c00153.js} +1 -1
- package/dist/{flip-icon-person.entry.1bc59e68.js → flip-icon-person.entry.ed4eca20.js} +1 -1
- package/dist/{flip-icon-phone.entry.03e81177.js → flip-icon-phone.entry.add9f8fc.js} +1 -1
- package/dist/{flip-icon-poll.entry.4e059f77.js → flip-icon-poll.entry.37836068.js} +1 -1
- package/dist/{flip-icon-recieved.entry.e3410f9e.js → flip-icon-recieved.entry.850deffd.js} +1 -1
- package/dist/{flip-icon-search-strong.entry.ec0849a6.js → flip-icon-search-strong.entry.fec41c91.js} +1 -1
- package/dist/{flip-icon-send.entry.3f80869c.js → flip-icon-send.entry.e687d6bb.js} +1 -1
- package/dist/{flip-icon-settings.entry.c86a7bca.js → flip-icon-settings.entry.2e503ce9.js} +1 -1
- package/dist/{flip-icon-time-filled.entry.ad86a08f.js → flip-icon-time-filled.entry.27c31492.js} +1 -1
- package/dist/{flip-icon-time-outlined.entry.75a29f76.js → flip-icon-time-outlined.entry.c1a0b4dd.js} +1 -1
- package/dist/{flip-icon-today.entry.ab272990.js → flip-icon-today.entry.4d38a769.js} +1 -1
- package/dist/{flip-icon-user-assign.entry.1f331180.js → flip-icon-user-assign.entry.10daebb0.js} +1 -1
- package/dist/{flip-icon-video-camera.entry.40ea3d7d.js → flip-icon-video-camera.entry.984108e1.js} +1 -1
- package/dist/{flip-icon-visibility-off.entry.ed4db3b5.js → flip-icon-visibility-off.entry.6a6e6a24.js} +1 -1
- package/dist/{flip-icon-visibility.entry.1a7dfd44.js → flip-icon-visibility.entry.0d16fd8e.js} +1 -1
- package/dist/{flip-icon-warning.entry.1c1540b8.js → flip-icon-warning.entry.f8cdae30.js} +1 -1
- package/dist/{flip-spinner.entry.f8f179be.js → flip-inline-error_2.entry.17e93f00.js} +17 -6
- package/dist/{flip-link.entry.fe817ab1.js → flip-link.entry.2f2bd6f0.js} +1 -1
- package/dist/flip-popover.entry.6309d3d5.js +179 -0
- package/dist/{flip-radio-group.entry.187f29ee.js → flip-radio-group.entry.afff6fac.js} +1 -1
- package/dist/{flip-radio.entry.817d976d.js → flip-radio.entry.9f9bc376.js} +1 -1
- package/dist/flip-resource-list-file-item.entry.f74d3bd3.js +19 -0
- package/dist/flip-resource-list-item.entry.96075846.js +40 -0
- package/dist/flip-resource-list.entry.d85444bc.js +49 -0
- package/dist/{flip-search.entry.6717d77a.js → flip-search.entry.52636549.js} +1 -1
- package/dist/{flip-stack.entry.50d88d6f.js → flip-stack.entry.90b930f5.js} +1 -1
- package/dist/{flip-switch.entry.ef96875e.js → flip-switch.entry.6b0e71bc.js} +1 -1
- package/dist/flip-tab.entry.56a0d1cd.js +17 -0
- package/dist/flip-tabs.entry.0c8b74db.js +91 -0
- package/dist/{flip-tag.entry.31a7d0f7.js → flip-tag.entry.202b87db.js} +1 -1
- package/dist/{flip-theme-provider.entry.9c054d33.js → flip-theme-provider.entry.6402a4bc.js} +1 -1
- package/dist/{flip-thumbnail.entry.449e93ef.js → flip-thumbnail.entry.9c3af9fe.js} +1 -1
- package/dist/{flip-toast-provider.entry.59025e1a.js → flip-toast-provider.entry.cbe2040b.js} +1 -1
- package/dist/{flip-toast.entry.78522d59.js → flip-toast.entry.647ec44c.js} +1 -1
- package/dist/flip-tooltip.entry.f43ae208.js +94 -0
- package/dist/{flip-visually-hidden.entry.ae0ff292.js → flip-visually-hidden.entry.70e706df.js} +1 -1
- package/dist/floating-ui.dom.esm-1a4e8b8a.87557233.js +752 -0
- package/dist/main.c9b46168.js +1329 -0
- package/dist/swirl-components-react.js +83 -76
- package/dist/swirl-components-react.umd.cjs +17 -17
- package/package.json +2 -2
- package/dist/flip-avatar-group.entry.71bf1f2a.js +0 -19
- package/dist/flip-badge.entry.ebda6058.js +0 -19
- package/dist/flip-inline-error.entry.38c26d13.js +0 -17
- package/dist/flip-popover.entry.18c5ead6.js +0 -878
- package/dist/flip-tooltip.entry.8b5f35c7.js +0 -102
- package/dist/main.7e7363a7.js +0 -1322
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { r as o, c as r, h as s, H as n, g as b } from "./main.c9b46168.js";
|
|
2
|
+
import { c as l } from "./index-3c78bcaf.2675909b.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import "react-dom";
|
|
5
|
+
const d = ".sc-flip-tabs-h{display:block;width:100%}.sc-flip-tabs-h *.sc-flip-tabs{box-sizing:border-box}.tabs.sc-flip-tabs{width:100%}.tabs__tab-bar.sc-flip-tabs{position:relative;display:flex;width:100%;padding-right:var(--s-space-16);padding-left:var(--s-space-16);justify-content:flex-start;border-bottom:var(--s-border-width-default) solid var(--s-border-default)}@media (--from-tablet){.tabs__tab-bar.sc-flip-tabs{padding-right:0;padding-left:0}}.tabs__tab.sc-flip-tabs{display:block;min-width:0;margin:0;padding:var(--s-space-4) 0;border:none;background-color:transparent;font:inherit;font-weight:var(--s-font-weight-medium);line-height:var(--s-line-height-base);cursor:pointer}.tabs__tab.sc-flip-tabs:focus-visible{outline:none}.tabs__tab.sc-flip-tabs:focus-visible .tabs__tab-label.sc-flip-tabs{border-radius:var(--s-border-radius-s);box-shadow:inset 0 0 0 0.125rem var(--s-focus-default)}.tabs__tab.sc-flip-tabs:not(:first-of-type){padding-left:var(--s-space-8)}.tabs__tab.sc-flip-tabs:not(:last-of-type){padding-right:var(--s-space-8)}.tabs__tab-label.sc-flip-tabs{display:block;overflow:hidden;width:100%;padding:var(--s-space-8) var(--s-space-8);text-align:center;white-space:nowrap;text-overflow:ellipsis}.tabs__tab--active.sc-flip-tabs{color:var(--s-text-highlight)}.tabs__indicator.sc-flip-tabs{position:absolute;bottom:0;left:0;width:0;height:0.125rem;border-radius:0.0625rem;background-color:var(--s-border-highlight);transition:background-color 0.15s, transform 0.15s, width 0.15s;transform:translate3d(0, 0, 0);pointer-events:none}@media (prefers-reduced-motion){.tabs__indicator.sc-flip-tabs{transition:none}}", c = class {
|
|
6
|
+
constructor(t) {
|
|
7
|
+
o(this, t), this.tabActivated = r(this, "tabActivated", 7), this.tabs = [], this.onKeyDown = (i) => {
|
|
8
|
+
i.code === "ArrowLeft" ? (i.preventDefault(), this.activatePreviousTab()) : i.code === "ArrowRight" && (i.preventDefault(), this.activateNextTab());
|
|
9
|
+
}, this.onMouseEnter = (i, a) => {
|
|
10
|
+
if (a.tabId === this.activeTab) {
|
|
11
|
+
this.highlightedTab = void 0;
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
this.highlightedTab = i.target.closest(".tabs__tab") || void 0;
|
|
15
|
+
}, this.onMouseLeave = () => {
|
|
16
|
+
this.highlightedTab = void 0;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
componentWillLoad() {
|
|
20
|
+
this.collectTabs();
|
|
21
|
+
}
|
|
22
|
+
componentDidRender() {
|
|
23
|
+
this.updateIndicatorPosition();
|
|
24
|
+
}
|
|
25
|
+
onWindowResize() {
|
|
26
|
+
this.updateIndicatorPosition();
|
|
27
|
+
}
|
|
28
|
+
async activateTab(t) {
|
|
29
|
+
if (this.activeTab === t)
|
|
30
|
+
return;
|
|
31
|
+
this.activeTab = t, this.tabs.forEach((a) => a.active = !1);
|
|
32
|
+
const i = this.tabs.find((a) => a.tabId === t);
|
|
33
|
+
!Boolean(i) || (this.highlightedTab = void 0, i.active = !0, this.tabActivated.emit(i));
|
|
34
|
+
}
|
|
35
|
+
activateNextTab() {
|
|
36
|
+
const t = this.tabs.findIndex((a) => a.tabId === this.activeTab), i = Math.min(this.tabs.length - 1, t + 1);
|
|
37
|
+
this.activateTab(this.tabs[i].tabId), requestAnimationFrame(() => {
|
|
38
|
+
var a;
|
|
39
|
+
(a = this.el.querySelector(".tabs__tab--active")) === null || a === void 0 || a.focus();
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
activatePreviousTab() {
|
|
43
|
+
const t = this.tabs.findIndex((a) => a.tabId === this.activeTab), i = Math.max(0, t - 1);
|
|
44
|
+
this.activateTab(this.tabs[i].tabId), requestAnimationFrame(() => {
|
|
45
|
+
var a;
|
|
46
|
+
(a = this.el.querySelector(".tabs__tab--active")) === null || a === void 0 || a.focus();
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
collectTabs() {
|
|
50
|
+
if (this.tabs = Array.from(this.el.querySelectorAll("flip-tab")), this.tabs.length === 0)
|
|
51
|
+
return;
|
|
52
|
+
const t = this.tabs.find((i) => i.tabId === this.initialTab);
|
|
53
|
+
this.activateTab(Boolean(t) ? t.tabId : this.tabs[0].tabId);
|
|
54
|
+
}
|
|
55
|
+
updateIndicatorPosition() {
|
|
56
|
+
const t = this.tabs.find((e) => e.tabId === this.activeTab);
|
|
57
|
+
if (!Boolean(t) && !Boolean(this.highlightedTab)) {
|
|
58
|
+
this.indicatorEl.style.width = "", this.indicatorEl.style.transform = "", this.indicatorEl.style.backgroundColor = "";
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
const a = (this.highlightedTab || this.el.querySelector(`#tab-${t.tabId}`)).querySelector(".tabs__tab-label");
|
|
62
|
+
this.indicatorEl.style.width = `${a.getBoundingClientRect().width / 16}rem`, this.indicatorEl.style.transform = `translate3d(${a.offsetLeft / 16}rem, 0, 0)`, this.indicatorEl.style.backgroundColor = Boolean(this.highlightedTab) ? "var(--s-border-default)" : "";
|
|
63
|
+
}
|
|
64
|
+
render() {
|
|
65
|
+
return s(n, null, s("div", { class: "tabs" }, s("div", { "aria-label": this.label, class: "tabs__tab-bar", onKeyDown: this.onKeyDown, role: "tablist" }, this.tabs.map((t) => {
|
|
66
|
+
const i = t.tabId === this.activeTab, a = l("tabs__tab", {
|
|
67
|
+
"tabs__tab--active": i
|
|
68
|
+
});
|
|
69
|
+
return s("button", {
|
|
70
|
+
"aria-controls": t.tabId,
|
|
71
|
+
"aria-selected": i ? "true" : "false",
|
|
72
|
+
class: a,
|
|
73
|
+
id: `tab-${t.tabId}`,
|
|
74
|
+
key: t.tabId,
|
|
75
|
+
onClick: () => this.activateTab(t.tabId),
|
|
76
|
+
onMouseEnter: (e) => this.onMouseEnter(e, t),
|
|
77
|
+
onMouseLeave: this.onMouseLeave,
|
|
78
|
+
role: "tab",
|
|
79
|
+
tabIndex: i ? 0 : -1,
|
|
80
|
+
type: "button"
|
|
81
|
+
}, s("span", { class: "tabs__tab-label" }, t.label));
|
|
82
|
+
}), s("span", { class: "tabs__indicator", ref: (t) => this.indicatorEl = t })), s("slot", null)));
|
|
83
|
+
}
|
|
84
|
+
get el() {
|
|
85
|
+
return b(this);
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
c.style = d;
|
|
89
|
+
export {
|
|
90
|
+
c as flip_tabs
|
|
91
|
+
};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { r as n, h as o, H as l } from "./main.c9b46168.js";
|
|
2
|
+
import { c as r, o as p, s as h, f as d } from "./floating-ui.dom.esm-1a4e8b8a.87557233.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import "react-dom";
|
|
5
|
+
const c = ":host{display:inline-flex}:host *{box-sizing:border-box}.tooltip{display:inline-flex}.tooltip .tooltip__reference{display:inline-flex}.tooltip__popper{position:fixed;z-index:var(--s-z-40);max-width:17.5rem}.tooltip__bubble{position:relative;display:block;padding-top:var(--s-space-8);padding-right:var(--s-space-12);padding-bottom:var(--s-space-8);padding-left:var(--s-space-12);border-radius:var(--s-border-radius-sm);color:var(--s-text-on-status);background-color:var(--s-surface-neutral-default);line-height:var(--s-line-height-base);-webkit-animation:tooltip-fade-in 0.1s;animation:tooltip-fade-in 0.1s;backgrund-color:red}.tooltip__arrow{position:absolute;width:0.5rem;height:0.5rem;background-color:var(--s-surface-neutral-default)}@-webkit-keyframes tooltip-fade-in{from{opacity:0}to{opacity:1}}@keyframes tooltip-fade-in{from{opacity:0}to{opacity:1}}", u = class {
|
|
6
|
+
constructor(e) {
|
|
7
|
+
n(this, e), this.delay = 300, this.position = "top", this.visible = !1, this.onKeydown = (t) => {
|
|
8
|
+
t.code === "Escape" && this.hide();
|
|
9
|
+
}, this.reposition = async () => {
|
|
10
|
+
!Boolean(this.referenceEl) || !Boolean(this.popperEl) || (this.actualPosition = await r(this.referenceEl, this.popperEl, this.options));
|
|
11
|
+
}, this.show = () => {
|
|
12
|
+
this.visible = !0, requestAnimationFrame(() => {
|
|
13
|
+
this.reposition();
|
|
14
|
+
});
|
|
15
|
+
}, this.showWithDelay = () => {
|
|
16
|
+
Boolean(this.showTimeout) && (clearTimeout(this.showTimeout), this.showTimeout = void 0), this.showTimeout = setTimeout(() => {
|
|
17
|
+
this.show();
|
|
18
|
+
}, this.delay);
|
|
19
|
+
}, this.hide = () => {
|
|
20
|
+
Boolean(this.showTimeout) && (clearTimeout(this.showTimeout), this.showTimeout = void 0), this.visible = !1;
|
|
21
|
+
}, this.updateOptions = () => {
|
|
22
|
+
const t = +getComputedStyle(document.documentElement).getPropertyValue("--s-space-12").replace("rem", "") * 16;
|
|
23
|
+
this.options = {
|
|
24
|
+
middleware: [p(t), h(), d()],
|
|
25
|
+
placement: this.position,
|
|
26
|
+
strategy: "fixed"
|
|
27
|
+
};
|
|
28
|
+
}, this.getArrowStyles = () => {
|
|
29
|
+
var t, s, i, a;
|
|
30
|
+
if (((t = this.actualPosition) === null || t === void 0 ? void 0 : t.placement) === "top")
|
|
31
|
+
return {
|
|
32
|
+
top: "100%",
|
|
33
|
+
left: "50%",
|
|
34
|
+
transform: "translate3d(-50%, -50%, 0) rotate(45deg)"
|
|
35
|
+
};
|
|
36
|
+
if (((s = this.actualPosition) === null || s === void 0 ? void 0 : s.placement) === "bottom")
|
|
37
|
+
return {
|
|
38
|
+
bottom: "100%",
|
|
39
|
+
left: "50%",
|
|
40
|
+
transform: "translate3d(-50%, 50%, 0) rotate(45deg)"
|
|
41
|
+
};
|
|
42
|
+
if (((i = this.actualPosition) === null || i === void 0 ? void 0 : i.placement) === "right")
|
|
43
|
+
return {
|
|
44
|
+
top: "50%",
|
|
45
|
+
right: "100%",
|
|
46
|
+
transform: "translate3d(50%, -50%, 0) rotate(45deg)"
|
|
47
|
+
};
|
|
48
|
+
if (((a = this.actualPosition) === null || a === void 0 ? void 0 : a.placement) === "left")
|
|
49
|
+
return {
|
|
50
|
+
top: "50%",
|
|
51
|
+
left: "100%",
|
|
52
|
+
transform: "translate3d(-50%, -50%, 0) rotate(45deg)"
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
watchPosition() {
|
|
57
|
+
this.updateOptions();
|
|
58
|
+
}
|
|
59
|
+
onMouseEnter() {
|
|
60
|
+
this.showWithDelay();
|
|
61
|
+
}
|
|
62
|
+
onMouseLeave() {
|
|
63
|
+
this.hide();
|
|
64
|
+
}
|
|
65
|
+
onWindowResize() {
|
|
66
|
+
this.reposition();
|
|
67
|
+
}
|
|
68
|
+
onWindowScroll() {
|
|
69
|
+
this.reposition();
|
|
70
|
+
}
|
|
71
|
+
componentWillLoad() {
|
|
72
|
+
this.reposition();
|
|
73
|
+
}
|
|
74
|
+
componentDidLoad() {
|
|
75
|
+
this.updateOptions();
|
|
76
|
+
}
|
|
77
|
+
render() {
|
|
78
|
+
var e, t;
|
|
79
|
+
const s = this.getArrowStyles();
|
|
80
|
+
return o(l, { onKeydown: this.onKeydown }, o("span", { class: "tooltip" }, o("span", { class: "tooltip__reference", "aria-describedby": "tooltip", onBlur: this.hide, onClick: this.hide, onFocus: this.show, ref: (i) => this.referenceEl = i, tabIndex: 0 }, o("slot", null)), o("span", { class: "tooltip__popper", ref: (i) => this.popperEl = i, style: {
|
|
81
|
+
top: Boolean(this.actualPosition) ? `${(e = this.actualPosition) === null || e === void 0 ? void 0 : e.y}px` : "",
|
|
82
|
+
left: Boolean(this.actualPosition) ? `${(t = this.actualPosition) === null || t === void 0 ? void 0 : t.x}px` : ""
|
|
83
|
+
} }, this.visible && o("span", { class: "tooltip__bubble", id: "tooltip", role: "tooltip" }, o("span", { class: "tooltip__content", innerHTML: this.content }), o("span", { class: "tooltip__arrow", style: s })))));
|
|
84
|
+
}
|
|
85
|
+
static get watchers() {
|
|
86
|
+
return {
|
|
87
|
+
position: ["watchPosition"]
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
u.style = c;
|
|
92
|
+
export {
|
|
93
|
+
u as flip_tooltip
|
|
94
|
+
};
|
package/dist/{flip-visually-hidden.entry.ae0ff292.js → flip-visually-hidden.entry.70e706df.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r, h as i, H as l } from "./main.
|
|
1
|
+
import { r, h as i, H as l } from "./main.c9b46168.js";
|
|
2
2
|
import "react";
|
|
3
3
|
import "react-dom";
|
|
4
4
|
const t = ":host{position:absolute;display:inline;overflow:hidden;width:1px;height:1px;margin:-1px;padding:0;border:0;white-space:nowrap;word-wrap:normal;clip:rect(0, 0, 0, 0)}", o = class {
|