@getflip/swirl-components 0.84.0 → 0.85.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.
@@ -54,7 +54,9 @@ const Template = (args) => {
54
54
  <swirl-tag label="Active" intent="success"></swirl-tag>
55
55
  </swirl-table-cell>
56
56
  <swirl-table-cell>
57
- <swirl-button hide-label icon="<swirl-icon-more-vertikal></swirl-icon-more-vertikal>" label="Options"></swirl-button>
57
+ <swirl-tooltip position="left" content="Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.">
58
+ <swirl-button label="Test"></swirl-button>
59
+ </swirl-tooltip>
58
60
  </swirl-table-cell>
59
61
  </swirl-table-row>
60
62
  <swirl-table-row-group label="Pending users">
@@ -18,7 +18,7 @@ export class SwirlThumbnail {
18
18
  const className = classnames("thumbnail", `thumbnail--format-${this.format}`, `thumbnail--size-${this.size}`, {
19
19
  "thumbnail--has-progress": this.progress !== undefined,
20
20
  });
21
- return (h(Host, null, h("span", { class: className, role: "group" }, h("img", { alt: this.alt, class: "thumbnail__image", loading: "lazy", src: this.src }), this.progress !== undefined && (h("span", { class: "thumbnail__progress-indicator" }, h("swirl-progress-indicator", { label: this.progressLabel, value: this.progress }))), showRemoveButton && (h("span", { class: "thumbnail__remove-button" }, h("swirl-button", { hideLabel: true, icon: "<swirl-icon-close></swirl-icon-close>", label: this.removeButtonLabel, pill: true, variant: "on-image" }))), showTimestamp && (h("span", { class: "thumbnail__timestamp" }, this.timestamp)))));
21
+ return (h(Host, null, h("span", { class: className, role: "group" }, h("img", { alt: this.alt, class: "thumbnail__image", loading: "lazy", src: this.src }), this.progress !== undefined && (h("span", { class: "thumbnail__progress-indicator" }, h("swirl-progress-indicator", { label: this.progressLabel, value: this.progress }))), showRemoveButton && (h("span", { class: "thumbnail__remove-button" }, h("swirl-button", { hideLabel: true, icon: "<swirl-icon-close></swirl-icon-close>", label: this.removeButtonLabel, onClick: this.remove.emit, pill: true, variant: "on-image" }))), showTimestamp && (h("span", { class: "thumbnail__timestamp" }, this.timestamp)))));
22
22
  }
23
23
  static get is() { return "swirl-thumbnail"; }
24
24
  static get encapsulation() { return "shadow"; }
@@ -203,4 +203,26 @@ export class SwirlThumbnail {
203
203
  }
204
204
  };
205
205
  }
206
+ static get events() {
207
+ return [{
208
+ "method": "remove",
209
+ "name": "remove",
210
+ "bubbles": true,
211
+ "cancelable": true,
212
+ "composed": true,
213
+ "docs": {
214
+ "tags": [],
215
+ "text": ""
216
+ },
217
+ "complexType": {
218
+ "original": "MouseEvent",
219
+ "resolved": "MouseEvent",
220
+ "references": {
221
+ "MouseEvent": {
222
+ "location": "global"
223
+ }
224
+ }
225
+ }
226
+ }];
227
+ }
206
228
  }
@@ -31,7 +31,10 @@
31
31
  color: var(--s-text-on-status);
32
32
  background-color: var(--s-surface-neutral-default);
33
33
  line-height: var(--s-line-height-base);
34
- animation: tooltip-fade-in 0.1s;
34
+ animation: tooltip-fade-in 0.2s;
35
+ animation-delay: 0.1s;
36
+ animation-fill-mode: forwards;
37
+ opacity: 0;
35
38
  }
36
39
 
37
40
  @media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px) {
@@ -1,4 +1,4 @@
1
- import { computePosition, flip, offset, shift, } from "@floating-ui/dom";
1
+ import { autoUpdate, computePosition, flip, offset, shift, } from "@floating-ui/dom";
2
2
  import { h, Host } from "@stencil/core";
3
3
  export class SwirlTooltip {
4
4
  constructor() {
@@ -17,6 +17,7 @@ export class SwirlTooltip {
17
17
  this.visible = true;
18
18
  requestAnimationFrame(() => {
19
19
  this.reposition();
20
+ this.disableAutoUpdate = autoUpdate(this.referenceEl, this.popperEl, this.reposition.bind(this));
20
21
  });
21
22
  };
22
23
  this.showWithDelay = () => {
@@ -34,6 +35,7 @@ export class SwirlTooltip {
34
35
  this.showTimeout = undefined;
35
36
  }
36
37
  this.visible = false;
38
+ this.disableAutoUpdate?.();
37
39
  };
38
40
  this.updateOptions = () => {
39
41
  const margin = +getComputedStyle(document.documentElement)
@@ -22,6 +22,14 @@ const expectedHidden = `
22
22
  <span class="tooltip__popper" style="top: 0px; left: NaNpx;"></span>
23
23
  </span>`;
24
24
  describe("swirl-tooltip", () => {
25
+ beforeAll(() => {
26
+ class ResizeObserver {
27
+ observe() { }
28
+ unobserve() { }
29
+ disconnect() { }
30
+ }
31
+ global.ResizeObserver = ResizeObserver;
32
+ });
25
33
  it("renders the reference", async () => {
26
34
  const page = await newSpecPage({
27
35
  components: [SwirlTooltip],