@getflip/swirl-components 0.29.0 → 0.30.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.
Files changed (55) hide show
  1. package/components.json +92 -4
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/swirl-card.cjs.entry.js +10 -7
  4. package/dist/cjs/swirl-carousel-slide.cjs.entry.js +8 -2
  5. package/dist/cjs/swirl-carousel.cjs.entry.js +15 -2
  6. package/dist/cjs/swirl-components.cjs.js +1 -1
  7. package/dist/cjs/swirl-file-viewer_7.cjs.entry.js +8 -5
  8. package/dist/cjs/swirl-heading.cjs.entry.js +12 -2
  9. package/dist/cjs/swirl-text.cjs.entry.js +11 -2
  10. package/dist/collection/components/swirl-card/swirl-card.css +1 -1
  11. package/dist/collection/components/swirl-card/swirl-card.js +26 -6
  12. package/dist/collection/components/swirl-carousel/swirl-carousel.css +37 -23
  13. package/dist/collection/components/swirl-carousel/swirl-carousel.js +29 -2
  14. package/dist/collection/components/swirl-carousel/swirl-carousel.stories.js +55 -21
  15. package/dist/collection/components/swirl-carousel-slide/swirl-carousel-slide.css +6 -0
  16. package/dist/collection/components/swirl-carousel-slide/swirl-carousel-slide.js +44 -3
  17. package/dist/collection/components/swirl-file-viewer/viewers/swirl-file-viewer-pdf/swirl-file-viewer-pdf.js +8 -5
  18. package/dist/collection/components/swirl-heading/swirl-heading.js +29 -2
  19. package/dist/collection/components/swirl-text/swirl-text.css +1 -0
  20. package/dist/collection/components/swirl-text/swirl-text.js +27 -1
  21. package/dist/components/swirl-card.js +11 -7
  22. package/dist/components/swirl-carousel-slide.js +11 -3
  23. package/dist/components/swirl-carousel.js +18 -4
  24. package/dist/components/swirl-file-viewer-pdf2.js +8 -5
  25. package/dist/components/swirl-heading2.js +13 -2
  26. package/dist/components/swirl-text2.js +12 -2
  27. package/dist/esm/loader.js +1 -1
  28. package/dist/esm/swirl-card.entry.js +10 -7
  29. package/dist/esm/swirl-carousel-slide.entry.js +8 -2
  30. package/dist/esm/swirl-carousel.entry.js +15 -2
  31. package/dist/esm/swirl-components.js +1 -1
  32. package/dist/esm/swirl-file-viewer_7.entry.js +8 -5
  33. package/dist/esm/swirl-heading.entry.js +12 -2
  34. package/dist/esm/swirl-text.entry.js +11 -2
  35. package/dist/swirl-components/p-0dc2557e.entry.js +1 -0
  36. package/dist/swirl-components/p-0f186daa.entry.js +1 -0
  37. package/dist/swirl-components/{p-b2e1964a.entry.js → p-9b0a9699.entry.js} +1 -1
  38. package/dist/swirl-components/p-b3662c86.entry.js +1 -0
  39. package/dist/swirl-components/p-bb84c103.entry.js +1 -0
  40. package/dist/swirl-components/p-d587d50b.entry.js +1 -0
  41. package/dist/swirl-components/swirl-components.css +1 -1
  42. package/dist/swirl-components/swirl-components.esm.js +1 -1
  43. package/dist/types/components/swirl-card/swirl-card.d.ts +1 -0
  44. package/dist/types/components/swirl-carousel/swirl-carousel.d.ts +4 -0
  45. package/dist/types/components/swirl-carousel-slide/swirl-carousel-slide.d.ts +3 -1
  46. package/dist/types/components/swirl-heading/swirl-heading.d.ts +1 -0
  47. package/dist/types/components/swirl-text/swirl-text.d.ts +1 -0
  48. package/dist/types/components.d.ts +12 -2
  49. package/package.json +1 -1
  50. package/vscode-data.json +20 -0
  51. package/dist/swirl-components/p-30b14b47.entry.js +0 -1
  52. package/dist/swirl-components/p-5799d38b.entry.js +0 -1
  53. package/dist/swirl-components/p-6d170215.entry.js +0 -1
  54. package/dist/swirl-components/p-846b1755.entry.js +0 -1
  55. package/dist/swirl-components/p-98f78231.entry.js +0 -1
@@ -1,13 +1,19 @@
1
1
  import { h, Host } from "@stencil/core";
2
+ import classnames from "classnames";
2
3
  /**
3
4
  * slot - The slide contents
4
5
  */
5
6
  export class SwirlCarouselSlide {
6
7
  constructor() {
7
8
  this.label = undefined;
9
+ this.minHeight = undefined;
10
+ this.width = "15.5rem";
8
11
  }
9
12
  render() {
10
- return (h(Host, { "aria-roledescription": "slide", "aria-label": this.label, class: "carousel-slide", role: "group", tabIndex: 0 }, h("slot", null)));
13
+ const className = classnames("carousel-slide", {
14
+ "carousel-slide--has-min-height": Boolean(this.minHeight),
15
+ });
16
+ return (h(Host, { "aria-roledescription": "slide", "aria-label": this.label, class: className, role: "group", style: { flexBasis: this.width, minHeight: this.minHeight }, tabIndex: 0 }, h("slot", null)));
11
17
  }
12
18
  static get is() { return "swirl-carousel-slide"; }
13
19
  static get encapsulation() { return "shadow"; }
@@ -31,14 +37,49 @@ export class SwirlCarouselSlide {
31
37
  "resolved": "string",
32
38
  "references": {}
33
39
  },
34
- "required": true,
35
- "optional": false,
40
+ "required": false,
41
+ "optional": true,
36
42
  "docs": {
37
43
  "tags": [],
38
44
  "text": ""
39
45
  },
40
46
  "attribute": "label",
41
47
  "reflect": false
48
+ },
49
+ "minHeight": {
50
+ "type": "string",
51
+ "mutable": false,
52
+ "complexType": {
53
+ "original": "string",
54
+ "resolved": "string",
55
+ "references": {}
56
+ },
57
+ "required": false,
58
+ "optional": true,
59
+ "docs": {
60
+ "tags": [],
61
+ "text": ""
62
+ },
63
+ "attribute": "min-height",
64
+ "reflect": false
65
+ },
66
+ "width": {
67
+ "type": "string",
68
+ "mutable": false,
69
+ "complexType": {
70
+ "original": "string",
71
+ "resolved": "string",
72
+ "references": {}
73
+ },
74
+ "required": false,
75
+ "optional": true,
76
+ "docs": {
77
+ "tags": [],
78
+ "text": ""
79
+ },
80
+ "attribute": "width",
81
+ "reflect": false,
82
+ "defaultValue": "\"15.5rem\""
42
83
  }
43
84
  };
44
85
  }
@@ -192,11 +192,14 @@ export class SwirlFileViewerPdf {
192
192
  transform,
193
193
  viewport: viewport,
194
194
  };
195
- await page.render(renderContext).promise;
196
- page.cleanup();
197
- textContainer.innerHTML = "";
198
- this.renderTextLayer(page, textContainer);
199
- this.renderingPageNumbers = this.renderingPageNumbers.filter((pageNumber) => pageNumber !== page.pageNumber);
195
+ try {
196
+ await page.render(renderContext).promise;
197
+ page.cleanup();
198
+ textContainer.innerHTML = "";
199
+ this.renderTextLayer(page, textContainer).catch();
200
+ this.renderingPageNumbers = this.renderingPageNumbers.filter((pageNumber) => pageNumber !== page.pageNumber);
201
+ }
202
+ catch (e) { }
200
203
  }
201
204
  destroyPage(page) {
202
205
  const container = this.el.shadowRoot.querySelector(`[data-page-number="${page.pageNumber}"]`);
@@ -8,6 +8,7 @@ export class SwirlHeading {
8
8
  this.balance = true;
9
9
  this.headingId = undefined;
10
10
  this.level = 1;
11
+ this.lines = undefined;
11
12
  this.text = undefined;
12
13
  this.truncate = undefined;
13
14
  }
@@ -18,17 +19,26 @@ export class SwirlHeading {
18
19
  this.rebalance();
19
20
  }
20
21
  rebalance() {
21
- if (!this.balance || !Boolean(this.headingEl)) {
22
+ if (!this.balance || !Boolean(this.headingEl) || Boolean(this.lines)) {
22
23
  return;
23
24
  }
24
25
  balanceText(this.headingEl);
25
26
  }
26
27
  render() {
27
28
  const Tag = this.as || `h${this.level}`;
29
+ const styles = Boolean(this.lines)
30
+ ? {
31
+ display: "-webkit-box",
32
+ overflow: "hidden",
33
+ "-webkit-line-clamp": String(this.lines),
34
+ "-webkit-box-orient": "vertical",
35
+ whiteSpace: "normal",
36
+ }
37
+ : undefined;
28
38
  const className = classnames("heading", `heading--align-${this.align}`, `heading--level-${this.level}`, {
29
39
  "heading--truncate": this.truncate,
30
40
  });
31
- return (h(Host, null, h(Tag, { class: className, id: this.headingId, ref: (el) => (this.headingEl = el) }, this.text)));
41
+ return (h(Host, null, h(Tag, { class: className, id: this.headingId, ref: (el) => (this.headingEl = el), style: styles }, this.text)));
32
42
  }
33
43
  static get is() { return "swirl-heading"; }
34
44
  static get encapsulation() { return "scoped"; }
@@ -147,6 +157,23 @@ export class SwirlHeading {
147
157
  "reflect": false,
148
158
  "defaultValue": "1"
149
159
  },
160
+ "lines": {
161
+ "type": "number",
162
+ "mutable": false,
163
+ "complexType": {
164
+ "original": "number",
165
+ "resolved": "number",
166
+ "references": {}
167
+ },
168
+ "required": false,
169
+ "optional": true,
170
+ "docs": {
171
+ "tags": [],
172
+ "text": ""
173
+ },
174
+ "attribute": "lines",
175
+ "reflect": false
176
+ },
150
177
  "text": {
151
178
  "type": "string",
152
179
  "mutable": false,
@@ -8,6 +8,7 @@
8
8
  }
9
9
 
10
10
  .text {
11
+ overflow: hidden;
11
12
  margin: 0;
12
13
  padding: 0;
13
14
  }
@@ -8,6 +8,7 @@ export class SwirlText {
8
8
  this.balance = undefined;
9
9
  this.color = "default";
10
10
  this.fontStyle = "normal";
11
+ this.lines = undefined;
11
12
  this.size = "base";
12
13
  this.truncate = undefined;
13
14
  this.weight = "normal";
@@ -26,8 +27,16 @@ export class SwirlText {
26
27
  }
27
28
  render() {
28
29
  const Tag = this.as;
30
+ const styles = Boolean(this.lines)
31
+ ? {
32
+ display: "-webkit-box",
33
+ "-webkit-line-clamp": String(this.lines),
34
+ "-webkit-box-orient": "vertical",
35
+ whiteSpace: "normal",
36
+ }
37
+ : undefined;
29
38
  const className = classnames("text", `text--align-${this.align}`, `text--color-${this.color}`, `text--font-style-${this.fontStyle}`, `text--size-${this.size}`, `text--weight-${this.weight}`, { "text--truncate": this.truncate });
30
- return (h(Host, null, h(Tag, { class: className, ref: (el) => (this.textEl = el) }, h("slot", null))));
39
+ return (h(Host, null, h(Tag, { class: className, ref: (el) => (this.textEl = el), style: styles }, h("slot", null))));
31
40
  }
32
41
  static get is() { return "swirl-text"; }
33
42
  static get encapsulation() { return "scoped"; }
@@ -147,6 +156,23 @@ export class SwirlText {
147
156
  "reflect": false,
148
157
  "defaultValue": "\"normal\""
149
158
  },
159
+ "lines": {
160
+ "type": "number",
161
+ "mutable": false,
162
+ "complexType": {
163
+ "original": "number",
164
+ "resolved": "number",
165
+ "references": {}
166
+ },
167
+ "required": false,
168
+ "optional": true,
169
+ "docs": {
170
+ "tags": [],
171
+ "text": ""
172
+ },
173
+ "attribute": "lines",
174
+ "reflect": false
175
+ },
150
176
  "size": {
151
177
  "type": "string",
152
178
  "mutable": false,
@@ -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 swirlCardCss = ":host{display:block}:host *{box-sizing:border-box}.card{display:block;overflow:hidden;width:100%;margin:0;padding:0;border:var(--s-border-width-default) solid var(--s-border-default);border-radius:var(--s-border-radius-base);color:var(--s-text-default);background-color:var(--s-surface-default);font:inherit;text-decoration:none}a.card,button.card,.card--interactive{cursor:pointer}a.card:hover,button.card:hover,.card--interactive:hover{background-color:var(--s-surface-hovered)}a.card:active,button.card:active,.card--interactive:active{background-color:var(--s-surface-pressed)}a.card:focus:not(:focus-visible),button.card:focus:not(:focus-visible),.card--interactive:focus:not(:focus-visible){outline:none}a.card:focus-visible,button.card:focus-visible,.card--interactive:focus-visible{outline-color:var(--s-focus-default);outline-offset:var(--s-space-4)}.card--elevated{border-color:transparent;box-shadow:0 0.75rem 2rem rgba(25, 26, 28, 0.12),\n 0 0.25rem 0.75rem rgba(25, 26, 28, 0.08)}.card--highlighted{border-width:0.1875rem;border-color:var(--s-border-highlight)}:not(.card--has-image) .card__image{overflow:hidden;height:0}.content-section{padding:0 var(--s-space-16)}.card__image ::slotted(img){display:inline-flex;width:100%;max-height:100%;-o-object-fit:cover;object-fit:cover}.card__body{display:flex;padding:var(--s-space-12) var(--s-space-16) var(--s-space-16);flex-direction:column;gap:var(--s-space-16)}";
4
+ const swirlCardCss = ":host{display:block}:host *{box-sizing:border-box}.card{display:block;overflow:hidden;width:100%;margin:0;padding:0;border:var(--s-border-width-default) solid var(--s-border-default);border-radius:var(--s-border-radius-base);color:var(--s-text-default);background-color:var(--s-surface-default);font:inherit;text-decoration:none}a.card,button.card,.card--interactive{cursor:pointer}a.card:hover,button.card:hover,.card--interactive:hover{background-color:var(--s-surface-hovered)}a.card:active,button.card:active,.card--interactive:active{background-color:var(--s-surface-pressed)}a.card:focus:not(:focus-visible),button.card:focus:not(:focus-visible),.card--interactive:focus:not(:focus-visible){outline:none}a.card:focus-visible,button.card:focus-visible,.card--interactive:focus-visible{outline-color:var(--s-focus-default);outline-offset:var(--s-space-4)}.card--elevated{border-color:transparent;box-shadow:0 0.75rem 1rem rgba(25, 26, 28, 0.12),\n 0 0.25rem 0.75rem rgba(25, 26, 28, 0.08)}.card--highlighted{border-width:0.1875rem;border-color:var(--s-border-highlight)}:not(.card--has-image) .card__image{overflow:hidden;height:0}.content-section{padding:0 var(--s-space-16)}.card__image ::slotted(img){display:inline-flex;width:100%;max-height:100%;-o-object-fit:cover;object-fit:cover}.card__body{display:flex;padding:var(--s-space-12) var(--s-space-16) var(--s-space-16);flex-direction:column;gap:var(--s-space-16)}";
5
5
 
6
6
  const swirlCardBorderRadiusTokens = ["xs", "sm", "base", "l", "xl"];
7
7
  const SwirlCard$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
@@ -12,6 +12,7 @@ const SwirlCard$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
12
12
  this.as = "div";
13
13
  this.borderRadius = "base";
14
14
  this.elevated = undefined;
15
+ this.height = undefined;
15
16
  this.highlighted = undefined;
16
17
  this.href = undefined;
17
18
  this.imageAspectRatio = undefined;
@@ -22,19 +23,21 @@ const SwirlCard$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
22
23
  render() {
23
24
  const Tag = Boolean(this.href) ? "a" : this.as;
24
25
  const hasImage = Boolean(this.el.querySelector('[slot="image"]'));
26
+ const styles = {
27
+ borderRadius: swirlCardBorderRadiusTokens.includes(this.borderRadius)
28
+ ? `var(--s-border-radius-${this.borderRadius})`
29
+ : this.borderRadius,
30
+ height: this.height,
31
+ };
25
32
  const className = classnames("card", {
26
33
  "card--elevated": this.elevated,
27
34
  "card--has-image": hasImage,
28
35
  "card--highlighted": this.highlighted,
29
36
  "card--interactive": this.interactive || this.href,
30
37
  });
31
- return (h(Host, null, h(Tag, { "aria-label": this.swirlAriaLabel, class: className, href: this.href, rel: Boolean(this.href) && this.linkTarget === "_blank"
38
+ return (h(Host, { styles: { height: this.height } }, h(Tag, { "aria-label": this.swirlAriaLabel, class: className, href: this.href, rel: Boolean(this.href) && this.linkTarget === "_blank"
32
39
  ? "noreferrer"
33
- : undefined, style: {
34
- borderRadius: swirlCardBorderRadiusTokens.includes(this.borderRadius)
35
- ? `var(--s-border-radius-${this.borderRadius})`
36
- : this.borderRadius,
37
- }, target: this.linkTarget }, h("div", { class: "card__image", style: { aspectRatio: this.imageAspectRatio } }, h("slot", { name: "image" })), h("div", { class: "card__body" }, h("div", { class: "card__content" }, h("slot", { name: "content" }))))));
40
+ : undefined, style: styles, target: this.linkTarget }, h("div", { class: "card__image", style: { aspectRatio: this.imageAspectRatio } }, h("slot", { name: "image" })), h("div", { class: "card__body" }, h("div", { class: "card__content" }, h("slot", { name: "content" }))))));
38
41
  }
39
42
  get el() { return this; }
40
43
  static get style() { return swirlCardCss; }
@@ -42,6 +45,7 @@ const SwirlCard$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
42
45
  "as": [1],
43
46
  "borderRadius": [1, "border-radius"],
44
47
  "elevated": [4],
48
+ "height": [1],
45
49
  "highlighted": [4],
46
50
  "href": [1],
47
51
  "imageAspectRatio": [1, "image-aspect-ratio"],
@@ -1,6 +1,7 @@
1
1
  import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
2
+ import { c as classnames } from './index2.js';
2
3
 
3
- const swirlCarouselSlideCss = ":host{display:block;padding-left:var(--s-space-16)}:host *{box-sizing:border-box}:host ::slotted(*){width:100%}";
4
+ const swirlCarouselSlideCss = ":host{display:block;min-width:0;padding-left:var(--s-space-16)}:host(.carousel-slide--has-min-height) ::slotted(*){height:100%}:host *{box-sizing:border-box}:host ::slotted(*){width:100%;min-height:100%}";
4
5
 
5
6
  const SwirlCarouselSlide$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
6
7
  constructor() {
@@ -8,13 +9,20 @@ const SwirlCarouselSlide$1 = /*@__PURE__*/ proxyCustomElement(class extends HTML
8
9
  this.__registerHost();
9
10
  this.__attachShadow();
10
11
  this.label = undefined;
12
+ this.minHeight = undefined;
13
+ this.width = "15.5rem";
11
14
  }
12
15
  render() {
13
- return (h(Host, { "aria-roledescription": "slide", "aria-label": this.label, class: "carousel-slide", role: "group", tabIndex: 0 }, h("slot", null)));
16
+ const className = classnames("carousel-slide", {
17
+ "carousel-slide--has-min-height": Boolean(this.minHeight),
18
+ });
19
+ return (h(Host, { "aria-roledescription": "slide", "aria-label": this.label, class: className, role: "group", style: { flexBasis: this.width, minHeight: this.minHeight }, tabIndex: 0 }, h("slot", null)));
14
20
  }
15
21
  static get style() { return swirlCarouselSlideCss; }
16
22
  }, [1, "swirl-carousel-slide", {
17
- "label": [1]
23
+ "label": [1],
24
+ "minHeight": [1, "min-height"],
25
+ "width": [1]
18
26
  }]);
19
27
  function defineCustomElement$1() {
20
28
  if (typeof customElements === "undefined") {
@@ -1,7 +1,7 @@
1
1
  import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
2
2
  import { d as defineCustomElement$2 } from './swirl-button2.js';
3
3
 
4
- const swirlCarouselCss = ":host{position:relative;display:block;overflow:hidden;width:100%}:host(:hover) .carousel__previous-slide-button{pointer-events:auto;opacity:1}:host(:hover) .carousel__next-slide-button{pointer-events:auto;opacity:1}:host *{box-sizing:border-box}.carousel__slides{position:relative;display:flex;overflow-x:auto;width:100%;padding-right:var(--s-space-16);scrollbar-width:none;scroll-snap-type:x mandatory;scroll-behavior:smooth}.carousel__slides::-webkit-scrollbar{display:none}.carousel__slides ::slotted(*){flex-basis:80%;flex-grow:0;flex-shrink:0;scroll-snap-align:start}@media (min-width: 768px){.carousel__slides ::slotted(*){flex-basis:45%}}@media (min-width: 992px){.carousel__slides ::slotted(*){flex-basis:30%}}@media (min-width: 1440px){.carousel__slides ::slotted(*){flex-basis:20%}}.carousel__previous-slide-button{position:absolute;z-index:1;top:50%;left:var(--s-space-20);transition:opacity 0.2s;transform:translateY(-50%);pointer-events:none;opacity:0}.carousel__next-slide-button{position:absolute;z-index:1;top:50%;right:var(--s-space-20);transition:opacity 0.2s;transform:translateY(-50%);pointer-events:none;opacity:0}";
4
+ const swirlCarouselCss = ":host{position:relative;display:block;overflow:hidden;width:100%}:host(:hover) .carousel__previous-slide-button{pointer-events:auto;opacity:1}:host(:hover) .carousel__next-slide-button{pointer-events:auto;opacity:1}:host *{box-sizing:border-box}.carousel{position:relative;overflow:hidden;width:100%}.carousel:before{position:absolute;z-index:1;top:0;left:0;width:var(--s-space-20);height:100%;background:linear-gradient(\n to right,\n rgba(var(--swirl-carousel-gradient), 1),\n rgba(var(--swirl-carousel-gradient), 0)\n );content:\"\"}.carousel:after{position:absolute;z-index:1;top:0;right:0;width:var(--s-space-20);height:100%;background:linear-gradient(\n to left,\n rgba(var(--swirl-carousel-gradient), 1),\n rgba(var(--swirl-carousel-gradient), 0)\n );content:\"\"}.carousel__slides{position:relative;display:flex;overflow-x:auto;width:100%;padding:var(--s-space-24) var(--s-space-16);scrollbar-width:none;scroll-snap-type:x mandatory;scroll-behavior:smooth}.carousel__slides::-webkit-scrollbar{display:none}.carousel__slides ::slotted(*){flex-grow:0;flex-shrink:0;scroll-snap-align:start}.carousel__previous-slide-button{position:absolute;z-index:1;top:50%;left:var(--s-space-20);transition:opacity 0.2s;transform:translateY(-50%);pointer-events:none;opacity:0}.carousel__next-slide-button{position:absolute;z-index:1;top:50%;right:var(--s-space-20);transition:opacity 0.2s;transform:translateY(-50%);pointer-events:none;opacity:0}";
5
5
 
6
6
  const SwirlCarousel$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
7
7
  constructor() {
@@ -18,6 +18,19 @@ const SwirlCarousel$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
18
18
  this.nextSlideButtonLabel = "Next slide";
19
19
  this.previousSlideButtonLabel = "Previous slide";
20
20
  this.loopAround = false;
21
+ this.isScrollable = undefined;
22
+ }
23
+ onWindowResize() {
24
+ this.checkScrollStatus();
25
+ }
26
+ componentDidLoad() {
27
+ queueMicrotask(() => {
28
+ this.checkScrollStatus();
29
+ });
30
+ }
31
+ checkScrollStatus() {
32
+ this.isScrollable =
33
+ this.slidesContainer.scrollWidth > this.slidesContainer.offsetWidth;
21
34
  }
22
35
  previousSlide() {
23
36
  const slides = this.getSlides();
@@ -51,7 +64,7 @@ const SwirlCarousel$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
51
64
  return inInView;
52
65
  }
53
66
  render() {
54
- return (h(Host, { "aria-label": this.label, "aria-roledescription": "carousel", class: "carousel", role: "group" }, h("swirl-button", { class: "carousel__previous-slide-button", hideLabel: true, icon: "<swirl-icon-arrow-left></swirl-icon-arrow-left>", label: this.previousSlideButtonLabel, onClick: this.onPreviousSlideButtonClick, pill: true, variant: "flat" }), h("swirl-button", { class: "carousel__next-slide-button", hideLabel: true, icon: "<swirl-icon-arrow-right></swirl-icon-arrow-right>", label: this.nextSlideButtonLabel, onClick: this.onNextSlideButtonClick, pill: true, variant: "flat" }), h("div", { "aria-live": "polite", class: "carousel__slides", ref: (el) => (this.slidesContainer = el) }, h("slot", null))));
67
+ return (h(Host, { "aria-label": this.label, "aria-roledescription": "carousel", role: "group" }, h("div", { class: "carousel" }, this.isScrollable && (h("swirl-button", { class: "carousel__previous-slide-button", hideLabel: true, icon: "<swirl-icon-arrow-left></swirl-icon-arrow-left>", label: this.previousSlideButtonLabel, onClick: this.onPreviousSlideButtonClick, pill: true, variant: "flat" })), this.isScrollable && (h("swirl-button", { class: "carousel__next-slide-button", hideLabel: true, icon: "<swirl-icon-arrow-right></swirl-icon-arrow-right>", label: this.nextSlideButtonLabel, onClick: this.onNextSlideButtonClick, pill: true, variant: "flat" })), h("div", { "aria-live": "polite", class: "carousel__slides", ref: (el) => (this.slidesContainer = el) }, h("slot", null)))));
55
68
  }
56
69
  get el() { return this; }
57
70
  static get style() { return swirlCarouselCss; }
@@ -59,8 +72,9 @@ const SwirlCarousel$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
59
72
  "label": [1],
60
73
  "nextSlideButtonLabel": [1, "next-slide-button-label"],
61
74
  "previousSlideButtonLabel": [1, "previous-slide-button-label"],
62
- "loopAround": [4, "loop-around"]
63
- }]);
75
+ "loopAround": [4, "loop-around"],
76
+ "isScrollable": [32]
77
+ }, [[9, "resize", "onWindowResize"]]]);
64
78
  function defineCustomElement$1() {
65
79
  if (typeof customElements === "undefined") {
66
80
  return;
@@ -29703,11 +29703,14 @@ const SwirlFileViewerPdf = /*@__PURE__*/ proxyCustomElement(class extends HTMLEl
29703
29703
  transform,
29704
29704
  viewport: viewport,
29705
29705
  };
29706
- await page.render(renderContext).promise;
29707
- page.cleanup();
29708
- textContainer.innerHTML = "";
29709
- this.renderTextLayer(page, textContainer);
29710
- this.renderingPageNumbers = this.renderingPageNumbers.filter((pageNumber) => pageNumber !== page.pageNumber);
29706
+ try {
29707
+ await page.render(renderContext).promise;
29708
+ page.cleanup();
29709
+ textContainer.innerHTML = "";
29710
+ this.renderTextLayer(page, textContainer).catch();
29711
+ this.renderingPageNumbers = this.renderingPageNumbers.filter((pageNumber) => pageNumber !== page.pageNumber);
29712
+ }
29713
+ catch (e) { }
29711
29714
  }
29712
29715
  destroyPage(page) {
29713
29716
  const container = this.el.shadowRoot.querySelector(`[data-page-number="${page.pageNumber}"]`);
@@ -13,6 +13,7 @@ const SwirlHeading = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
13
13
  this.balance = true;
14
14
  this.headingId = undefined;
15
15
  this.level = 1;
16
+ this.lines = undefined;
16
17
  this.text = undefined;
17
18
  this.truncate = undefined;
18
19
  }
@@ -23,17 +24,26 @@ const SwirlHeading = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
23
24
  this.rebalance();
24
25
  }
25
26
  rebalance() {
26
- if (!this.balance || !Boolean(this.headingEl)) {
27
+ if (!this.balance || !Boolean(this.headingEl) || Boolean(this.lines)) {
27
28
  return;
28
29
  }
29
30
  balancetext(this.headingEl);
30
31
  }
31
32
  render() {
32
33
  const Tag = this.as || `h${this.level}`;
34
+ const styles = Boolean(this.lines)
35
+ ? {
36
+ display: "-webkit-box",
37
+ overflow: "hidden",
38
+ "-webkit-line-clamp": String(this.lines),
39
+ "-webkit-box-orient": "vertical",
40
+ whiteSpace: "normal",
41
+ }
42
+ : undefined;
33
43
  const className = classnames("heading", `heading--align-${this.align}`, `heading--level-${this.level}`, {
34
44
  "heading--truncate": this.truncate,
35
45
  });
36
- return (h(Host, null, h(Tag, { class: className, id: this.headingId, ref: (el) => (this.headingEl = el) }, this.text)));
46
+ return (h(Host, null, h(Tag, { class: className, id: this.headingId, ref: (el) => (this.headingEl = el), style: styles }, this.text)));
37
47
  }
38
48
  static get style() { return swirlHeadingCss; }
39
49
  }, [2, "swirl-heading", {
@@ -42,6 +52,7 @@ const SwirlHeading = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
42
52
  "balance": [4],
43
53
  "headingId": [1, "heading-id"],
44
54
  "level": [2],
55
+ "lines": [2],
45
56
  "text": [1],
46
57
  "truncate": [4]
47
58
  }, [[9, "resize", "onWindowResize"]]]);
@@ -2,7 +2,7 @@ import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal
2
2
  import { c as classnames } from './index2.js';
3
3
  import { b as balancetext } from './balancetext.js';
4
4
 
5
- const swirlTextCss = ".sc-swirl-text-h{display:block;max-width:100%}.sc-swirl-text-h *.sc-swirl-text{box-sizing:border-box}.text.sc-swirl-text{margin:0;padding:0}.text--align-start.sc-swirl-text{text-align:start}.text--align-center.sc-swirl-text{text-align:center}.text--align-end.sc-swirl-text{text-align:end}.text--color-default.sc-swirl-text{color:var(--s-text-default)}.text--color-subdued.sc-swirl-text{color:var(--s-text-subdued)}.text--color-critical.sc-swirl-text{color:var(--s-text-critical)}.text--color-success.sc-swirl-text{color:var(--s-text-success)}.text--color-warning.sc-swirl-text{color:var(--s-text-warning)}.text--size-sm.sc-swirl-text{font-size:var(--s-font-size-sm);line-height:var(--s-line-height-sm)}.text--size-base.sc-swirl-text{font-size:var(--s-font-size-base);line-height:var(--s-line-height-base)}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.text--size-base.sc-swirl-text{font-size:var(--s-font-size-sm);line-height:var(--s-line-height-sm)}}.text--size-lg.sc-swirl-text{font-size:var(--s-font-size-lg);line-height:var(--s-line-height-lg)}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.text--size-lg.sc-swirl-text{font-size:var(--s-font-size-base);line-height:var(--s-line-height-base)}}.text--weight-normal.sc-swirl-text{font-weight:var(--s-font-weight-normal)}.text--weight-medium.sc-swirl-text{font-weight:var(--s-font-weight-medium)}.text--weight-semibold.sc-swirl-text{font-weight:var(--s-font-weight-semibold)}.text--weight-bold.sc-swirl-text{font-weight:var(--s-font-weight-bold)}.text--font-style-normal.sc-swirl-text{font-style:normal}.text--font-style-italic.sc-swirl-text{font-style:italic}.text--truncate.sc-swirl-text{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}";
5
+ const swirlTextCss = ".sc-swirl-text-h{display:block;max-width:100%}.sc-swirl-text-h *.sc-swirl-text{box-sizing:border-box}.text.sc-swirl-text{overflow:hidden;margin:0;padding:0}.text--align-start.sc-swirl-text{text-align:start}.text--align-center.sc-swirl-text{text-align:center}.text--align-end.sc-swirl-text{text-align:end}.text--color-default.sc-swirl-text{color:var(--s-text-default)}.text--color-subdued.sc-swirl-text{color:var(--s-text-subdued)}.text--color-critical.sc-swirl-text{color:var(--s-text-critical)}.text--color-success.sc-swirl-text{color:var(--s-text-success)}.text--color-warning.sc-swirl-text{color:var(--s-text-warning)}.text--size-sm.sc-swirl-text{font-size:var(--s-font-size-sm);line-height:var(--s-line-height-sm)}.text--size-base.sc-swirl-text{font-size:var(--s-font-size-base);line-height:var(--s-line-height-base)}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.text--size-base.sc-swirl-text{font-size:var(--s-font-size-sm);line-height:var(--s-line-height-sm)}}.text--size-lg.sc-swirl-text{font-size:var(--s-font-size-lg);line-height:var(--s-line-height-lg)}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.text--size-lg.sc-swirl-text{font-size:var(--s-font-size-base);line-height:var(--s-line-height-base)}}.text--weight-normal.sc-swirl-text{font-weight:var(--s-font-weight-normal)}.text--weight-medium.sc-swirl-text{font-weight:var(--s-font-weight-medium)}.text--weight-semibold.sc-swirl-text{font-weight:var(--s-font-weight-semibold)}.text--weight-bold.sc-swirl-text{font-weight:var(--s-font-weight-bold)}.text--font-style-normal.sc-swirl-text{font-style:normal}.text--font-style-italic.sc-swirl-text{font-style:italic}.text--truncate.sc-swirl-text{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}";
6
6
 
7
7
  const SwirlText = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
8
8
  constructor() {
@@ -13,6 +13,7 @@ const SwirlText = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
13
13
  this.balance = undefined;
14
14
  this.color = "default";
15
15
  this.fontStyle = "normal";
16
+ this.lines = undefined;
16
17
  this.size = "base";
17
18
  this.truncate = undefined;
18
19
  this.weight = "normal";
@@ -31,8 +32,16 @@ const SwirlText = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
31
32
  }
32
33
  render() {
33
34
  const Tag = this.as;
35
+ const styles = Boolean(this.lines)
36
+ ? {
37
+ display: "-webkit-box",
38
+ "-webkit-line-clamp": String(this.lines),
39
+ "-webkit-box-orient": "vertical",
40
+ whiteSpace: "normal",
41
+ }
42
+ : undefined;
34
43
  const className = classnames("text", `text--align-${this.align}`, `text--color-${this.color}`, `text--font-style-${this.fontStyle}`, `text--size-${this.size}`, `text--weight-${this.weight}`, { "text--truncate": this.truncate });
35
- return (h(Host, null, h(Tag, { class: className, ref: (el) => (this.textEl = el) }, h("slot", null))));
44
+ return (h(Host, null, h(Tag, { class: className, ref: (el) => (this.textEl = el), style: styles }, h("slot", null))));
36
45
  }
37
46
  get el() { return this; }
38
47
  static get style() { return swirlTextCss; }
@@ -42,6 +51,7 @@ const SwirlText = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
42
51
  "balance": [4],
43
52
  "color": [1],
44
53
  "fontStyle": [1, "font-style"],
54
+ "lines": [2],
45
55
  "size": [1],
46
56
  "truncate": [4],
47
57
  "weight": [1]