@getflip/swirl-components 0.432.0 → 0.433.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.
- package/components.json +1 -1
- package/dist/cjs/floating-ui.dom-C8bqk2dV.js +1624 -0
- package/dist/cjs/swirl-autocomplete.cjs.entry.js +4 -4
- package/dist/cjs/swirl-menu.cjs.entry.js +4 -4
- package/dist/cjs/swirl-popover_2.cjs.entry.js +6 -6
- package/dist/cjs/swirl-skeleton-box.cjs.entry.js +1 -1
- package/dist/cjs/swirl-tooltip.cjs.entry.js +10 -10
- package/dist/collection/components/swirl-skeleton-box/swirl-skeleton-box.css +1 -2
- package/dist/collection/components/swirl-tooltip/swirl-tooltip.js +3 -3
- package/dist/components/assets/pdfjs/pdf.worker.min.mjs +1 -1
- package/dist/components/floating-ui.dom.js +1617 -0
- package/dist/components/swirl-autocomplete.js +4 -4
- package/dist/components/swirl-menu.js +4 -4
- package/dist/components/swirl-popover2.js +6 -6
- package/dist/components/swirl-skeleton-box2.js +1 -1
- package/dist/components/swirl-tooltip2.js +10 -10
- package/dist/esm/floating-ui.dom-CLsTbQHn.js +1617 -0
- package/dist/esm/swirl-autocomplete.entry.js +4 -4
- package/dist/esm/swirl-menu.entry.js +4 -4
- package/dist/esm/swirl-popover_2.entry.js +6 -6
- package/dist/esm/swirl-skeleton-box.entry.js +1 -1
- package/dist/esm/swirl-tooltip.entry.js +10 -10
- package/dist/swirl-components/p-13d33aa2.entry.js +1 -0
- package/dist/swirl-components/{p-f53180cb.entry.js → p-322f18d4.entry.js} +1 -1
- package/dist/swirl-components/p-52737e44.entry.js +1 -0
- package/dist/swirl-components/{p-35461505.entry.js → p-8d0be9c3.entry.js} +1 -1
- package/dist/swirl-components/p-CLsTbQHn.js +1 -0
- package/dist/swirl-components/{p-85371da0.entry.js → p-c8c1b0b2.entry.js} +1 -1
- package/dist/swirl-components/swirl-components.esm.js +1 -1
- package/package.json +2 -2
- package/dist/cjs/floating-ui.dom.browser.min-PA1q-Uql.js +0 -12
- package/dist/components/floating-ui.dom.browser.min.js +0 -5
- package/dist/esm/floating-ui.dom.browser.min-BtsCuEVE.js +0 -5
- package/dist/swirl-components/p-5c638e8c.entry.js +0 -1
- package/dist/swirl-components/p-BtsCuEVE.js +0 -1
- package/dist/swirl-components/p-de985b44.entry.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import {
|
|
2
|
+
import { a as autoUpdate, c as computePosition, o as offset } from './floating-ui.dom.js';
|
|
3
3
|
import { c as classNames } from './index2.js';
|
|
4
4
|
import { d as debounce } from './utils.js';
|
|
5
5
|
import { d as defineCustomElement$h } from './swirl-icon-cancel2.js';
|
|
@@ -166,7 +166,7 @@ const SwirlAutocomplete$1 = /*@__PURE__*/ proxyCustomElement(class SwirlAutocomp
|
|
|
166
166
|
if (this.disableAutoUpdate) {
|
|
167
167
|
this.disableAutoUpdate();
|
|
168
168
|
}
|
|
169
|
-
this.disableAutoUpdate =
|
|
169
|
+
this.disableAutoUpdate = autoUpdate(this.inputEl, this.listboxContainerEl, this.reposition.bind(this), { animationFrame: true });
|
|
170
170
|
this.listboxContainerEl.scrollTop = 0;
|
|
171
171
|
this.updateSuggestions(this.inputEl.querySelector("input").value);
|
|
172
172
|
});
|
|
@@ -175,8 +175,8 @@ const SwirlAutocomplete$1 = /*@__PURE__*/ proxyCustomElement(class SwirlAutocomp
|
|
|
175
175
|
if (!Boolean(this.listboxContainerEl)) {
|
|
176
176
|
return;
|
|
177
177
|
}
|
|
178
|
-
this.position = await
|
|
179
|
-
middleware: [
|
|
178
|
+
this.position = await computePosition(this.inputEl, this.listboxContainerEl, {
|
|
179
|
+
middleware: [offset({ crossAxis: -16, mainAxis: 16 })],
|
|
180
180
|
placement: "bottom-start",
|
|
181
181
|
strategy: "fixed",
|
|
182
182
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import {
|
|
2
|
+
import { c as computePosition, a as autoUpdate, o as offset, s as shift, f as flip } from './floating-ui.dom.js';
|
|
3
3
|
import { c as classNames } from './index2.js';
|
|
4
4
|
import { q as querySelectorAllDeep, l as closestPassShadow, m as parentsPassShadow, i as isMobileViewport, k as getActiveElement } from './utils.js';
|
|
5
5
|
import { d as defineCustomElement$3 } from './swirl-button2.js';
|
|
@@ -60,10 +60,10 @@ const SwirlMenu$1 = /*@__PURE__*/ proxyCustomElement(class SwirlMenu extends HTM
|
|
|
60
60
|
return;
|
|
61
61
|
}
|
|
62
62
|
requestAnimationFrame(async () => {
|
|
63
|
-
this.position = await
|
|
63
|
+
this.position = await computePosition(trigger, this.menuContainer, {
|
|
64
64
|
placement: "right-start",
|
|
65
65
|
strategy: "fixed",
|
|
66
|
-
middleware: [
|
|
66
|
+
middleware: [offset({ mainAxis: -10, crossAxis: 0 }), shift(), flip()],
|
|
67
67
|
});
|
|
68
68
|
});
|
|
69
69
|
};
|
|
@@ -131,7 +131,7 @@ const SwirlMenu$1 = /*@__PURE__*/ proxyCustomElement(class SwirlMenu extends HTM
|
|
|
131
131
|
if (this.disableAutoUpdate) {
|
|
132
132
|
this.disableAutoUpdate();
|
|
133
133
|
}
|
|
134
|
-
this.disableAutoUpdate =
|
|
134
|
+
this.disableAutoUpdate = autoUpdate(this.el.parentElement, this.menuContainer, this.reposition);
|
|
135
135
|
}
|
|
136
136
|
watchValue() {
|
|
137
137
|
this.updateActiveItem();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import {
|
|
2
|
+
import { c as computePosition, a as autoUpdate, s as shift, o as offset, f as flip } from './floating-ui.dom.js';
|
|
3
3
|
import { d as disableBodyScroll, e as enableBodyScroll } from './bodyScrollLock.esm.js';
|
|
4
4
|
import { c as classNames } from './index2.js';
|
|
5
5
|
import { i as isMobileViewport, t as getPixelsFromRemToken, k as getActiveElement, q as querySelectorAllDeep } from './utils.js';
|
|
@@ -51,16 +51,16 @@ const SwirlPopover = /*@__PURE__*/ proxyCustomElement(class SwirlPopover extends
|
|
|
51
51
|
? { mainAxis: this.offset, crossAxis: 0 }
|
|
52
52
|
: { mainAxis: this.offset[0], crossAxis: this.offset[1] };
|
|
53
53
|
const shiftPaddingX = getPixelsFromRemToken("--s-space-16");
|
|
54
|
-
const shiftWithPadding =
|
|
54
|
+
const shiftWithPadding = shift({
|
|
55
55
|
padding: {
|
|
56
56
|
left: shiftPaddingX,
|
|
57
57
|
right: shiftPaddingX,
|
|
58
58
|
},
|
|
59
59
|
});
|
|
60
60
|
const middleware = this.enableFlip
|
|
61
|
-
? [
|
|
62
|
-
: [
|
|
63
|
-
this.position = await
|
|
61
|
+
? [offset(offsetOptions), shiftWithPadding, flip()]
|
|
62
|
+
: [offset(offsetOptions), shiftWithPadding];
|
|
63
|
+
this.position = await computePosition(this.triggerEl, this.contentContainer, {
|
|
64
64
|
middleware,
|
|
65
65
|
placement: this.placement,
|
|
66
66
|
strategy: "fixed",
|
|
@@ -186,7 +186,7 @@ const SwirlPopover = /*@__PURE__*/ proxyCustomElement(class SwirlPopover extends
|
|
|
186
186
|
if (this.disableAutoUpdate) {
|
|
187
187
|
this.disableAutoUpdate();
|
|
188
188
|
}
|
|
189
|
-
this.disableAutoUpdate =
|
|
189
|
+
this.disableAutoUpdate = autoUpdate(this.triggerEl, this.contentContainer, () => this.reposition());
|
|
190
190
|
this.scrollContainer.scrollTop = 0;
|
|
191
191
|
this.lockBodyScroll();
|
|
192
192
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
2
|
import { c as classNames } from './index2.js';
|
|
3
3
|
|
|
4
|
-
const swirlSkeletonBoxCss = ":host{display:block}:host *{box-sizing:border-box}.skeleton-box{position:relative;overflow:hidden;min-height:var(--s-font-size-sm);background-color:var(--s-surface-raised-hovered)}.skeleton-box:
|
|
4
|
+
const swirlSkeletonBoxCss = ":host{display:block}:host *{box-sizing:border-box}.skeleton-box{position:relative;overflow:hidden;min-height:var(--s-font-size-sm);background-color:var(--s-surface-raised-hovered)}.skeleton-box:after{position:relative;display:block;width:100%;height:100%;background-image:linear-gradient(\n 90deg,\n rgba(255, 255, 255, 0) 0,\n rgba(255, 255, 255, 0) 12%,\n var(--s-surface-raised-default) 50%,\n rgba(255, 255, 255, 0) 88%,\n rgba(255, 255, 255, 0) 100%\n );content:\"\";transform:translateX(-100%);animation:skeleton-box-shimmer 3s infinite}@keyframes skeleton-box-shimmer{100%{transform:translateX(100%)}}.skeleton-box--static:before{display:none}.skeleton-box--border-radius-pill{border-radius:100rem}.skeleton-box--border-radius-none{border-radius:0}";
|
|
5
5
|
|
|
6
6
|
const SwirlSkeletonBox = /*@__PURE__*/ proxyCustomElement(class SwirlSkeletonBox extends HTMLElement {
|
|
7
7
|
constructor() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import {
|
|
2
|
+
import { b as arrow, c as computePosition, o as offset, s as shift, f as flip, a as autoUpdate } from './floating-ui.dom.js';
|
|
3
3
|
import { c as classNames } from './index2.js';
|
|
4
4
|
import { t as getPixelsFromRemToken } from './utils.js';
|
|
5
5
|
|
|
@@ -39,10 +39,10 @@ const SwirlTooltip = /*@__PURE__*/ proxyCustomElement(class SwirlTooltip extends
|
|
|
39
39
|
return;
|
|
40
40
|
}
|
|
41
41
|
const middleware = [
|
|
42
|
-
...this.options.middleware.filter((middleware) => middleware.name !== "arrow"),
|
|
43
|
-
|
|
42
|
+
...this.options.middleware.filter((middleware) => middleware && middleware.name !== "arrow"),
|
|
43
|
+
arrow({ element: this.arrowElement, padding: 12 }),
|
|
44
44
|
];
|
|
45
|
-
this.actualPosition = await
|
|
45
|
+
this.actualPosition = await computePosition(referenceElement, this.popperEl, { ...this.options, middleware });
|
|
46
46
|
const arrowX = this.actualPosition.middlewareData.arrow?.x;
|
|
47
47
|
const arrowY = this.actualPosition.middlewareData.arrow?.y;
|
|
48
48
|
this.arrowStyles = {
|
|
@@ -68,8 +68,8 @@ const SwirlTooltip = /*@__PURE__*/ proxyCustomElement(class SwirlTooltip extends
|
|
|
68
68
|
const shiftPaddingX = getPixelsFromRemToken("--s-space-16");
|
|
69
69
|
this.options = {
|
|
70
70
|
middleware: [
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
offset(margin),
|
|
72
|
+
shift({
|
|
73
73
|
padding: {
|
|
74
74
|
top: shiftPaddingY,
|
|
75
75
|
bottom: shiftPaddingY,
|
|
@@ -77,7 +77,7 @@ const SwirlTooltip = /*@__PURE__*/ proxyCustomElement(class SwirlTooltip extends
|
|
|
77
77
|
right: shiftPaddingX,
|
|
78
78
|
},
|
|
79
79
|
}),
|
|
80
|
-
|
|
80
|
+
flip(),
|
|
81
81
|
],
|
|
82
82
|
placement: this.position,
|
|
83
83
|
strategy: this.positioning,
|
|
@@ -126,7 +126,7 @@ const SwirlTooltip = /*@__PURE__*/ proxyCustomElement(class SwirlTooltip extends
|
|
|
126
126
|
return;
|
|
127
127
|
}
|
|
128
128
|
this.reposition();
|
|
129
|
-
this.disableAutoUpdate =
|
|
129
|
+
this.disableAutoUpdate = autoUpdate(referenceElement, this.popperEl, this.reposition.bind(this));
|
|
130
130
|
});
|
|
131
131
|
}
|
|
132
132
|
async hide() {
|
|
@@ -142,7 +142,7 @@ const SwirlTooltip = /*@__PURE__*/ proxyCustomElement(class SwirlTooltip extends
|
|
|
142
142
|
"tooltip--active": this.active,
|
|
143
143
|
"tooltip--visible": this.visible,
|
|
144
144
|
});
|
|
145
|
-
return (h(Host, { key: '
|
|
145
|
+
return (h(Host, { key: 'e5a7884c4f3f45294efc913baa4767a937afd07d', onKeydown: this.onKeydown }, h("span", { key: '9952c41dc93f61aa103e87f4384e17c271c9a600', class: className }, h("span", { key: '7fcef15d2b640e8cb685fae4275321c0776c0f20', class: "tooltip__reference", "aria-describedby": "tooltip", onFocusout: this.onFocusOut, onClick: this.hide, onFocusin: this.onFocusIn }, h("slot", { key: '7b975f73546287509b4b04b6c14e304c976e291b' })), h("span", { key: 'a385f4ab99e66b5164b1151fffed552a61718da9', class: "tooltip__popper", ref: (el) => (this.popperEl = el), style: {
|
|
146
146
|
top: Boolean(this.actualPosition)
|
|
147
147
|
? `${this.actualPosition?.y}px`
|
|
148
148
|
: "",
|
|
@@ -151,7 +151,7 @@ const SwirlTooltip = /*@__PURE__*/ proxyCustomElement(class SwirlTooltip extends
|
|
|
151
151
|
: "",
|
|
152
152
|
position: this.positioning,
|
|
153
153
|
maxWidth: this.maxWidth,
|
|
154
|
-
} }, this.visible && (h("span", { key: '
|
|
154
|
+
} }, this.visible && (h("span", { key: '7792c9acbe8745684b460789492aafc71e9e75c7', class: "tooltip__bubble", id: "tooltip", part: "tooltip__bubble", role: "tooltip" }, h("span", { key: 'd4c6edd15ff7a8bb22932fccc9a2d555ccde11c0', class: "tooltip__content", innerHTML: this.content }))), h("span", { key: '117ba01694bfb6a78db345392a7de85977d2ba03', class: "tooltip__arrow", ref: (el) => (this.arrowElement = el), style: {
|
|
155
155
|
...this.arrowStyles,
|
|
156
156
|
visibility: this.visible ? "visible" : "hidden",
|
|
157
157
|
} })))));
|