@getflip/swirl-components 0.172.1 → 0.173.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.
@@ -15,6 +15,7 @@ export class SwirlText {
15
15
  this.truncate = undefined;
16
16
  this.truncateDirection = "end";
17
17
  this.weight = "normal";
18
+ this.whiteSpace = "normal";
18
19
  }
19
20
  componentDidRender() {
20
21
  this.rebalance();
@@ -47,7 +48,10 @@ export class SwirlText {
47
48
  const className = classnames("text", `text--align-${this.align}`, `text--color-${this.color}`, `text--font-family-${this.fontFamily}`, `text--font-style-${this.fontStyle}`, `text--size-${this.size}`, `text--truncate-direction-${this.truncateDirection}`, `text--weight-${this.weight}`, {
48
49
  "text--truncate": this.truncate && (!Boolean(this.lines) || this.lines === 1),
49
50
  });
50
- return (h(Host, null, h(Tag, { class: className, ref: (el) => (this.textEl = el) }, h("slot", null))));
51
+ const styles = {
52
+ whiteSpace: this.whiteSpace,
53
+ };
54
+ return (h(Host, null, h(Tag, { class: className, ref: (el) => (this.textEl = el), style: styles }, h("slot", null))));
51
55
  }
52
56
  static get is() { return "swirl-text"; }
53
57
  static get encapsulation() { return "scoped"; }
@@ -292,6 +296,29 @@ export class SwirlText {
292
296
  "attribute": "weight",
293
297
  "reflect": false,
294
298
  "defaultValue": "\"normal\""
299
+ },
300
+ "whiteSpace": {
301
+ "type": "string",
302
+ "mutable": false,
303
+ "complexType": {
304
+ "original": "SwirlTextWhiteSpace",
305
+ "resolved": "\"break-spaces\" | \"normal\" | \"nowrap\" | \"pre\" | \"pre-line\" | \"pre-wrap\"",
306
+ "references": {
307
+ "SwirlTextWhiteSpace": {
308
+ "location": "local",
309
+ "path": "/home/runner/work/swirl/swirl/packages/swirl-components/src/components/swirl-text/swirl-text.tsx"
310
+ }
311
+ }
312
+ },
313
+ "required": false,
314
+ "optional": true,
315
+ "docs": {
316
+ "tags": [],
317
+ "text": ""
318
+ },
319
+ "attribute": "white-space",
320
+ "reflect": false,
321
+ "defaultValue": "\"normal\""
295
322
  }
296
323
  };
297
324
  }
@@ -16,7 +16,7 @@ describe("swirl-text", () => {
16
16
  });
17
17
  expect(page.root).toEqualHtml(`
18
18
  <swirl-text align="center" color="critical" font-style="italic" size="lg" weight="medium">
19
- <p class="text text--align-center text--color-critical text--font-family-text text--font-style-italic text--size-lg text--truncate-direction-end text--weight-medium">
19
+ <p class="text text--align-center text--color-critical text--font-family-text text--font-style-italic text--size-lg text--truncate-direction-end text--weight-medium" style="white-space: normal;">
20
20
  Est, odio dis scelerisque risus sagittis lorem rhoncus. Vivamus tristique habitant vitae cursus nisl. Sed adipiscing proin suspendisse aliquam maecenas faucibus mauris purus. Tortor ut habitant erat adipiscing nulla pretium, cursus tortor. Amet viverra et platea lacus, nec molestie tincidunt.
21
21
  </p>
22
22
  </swirl-text>
@@ -37,7 +37,7 @@ describe("swirl-text", () => {
37
37
  });
38
38
  expect(page.root).toEqualHtml(`
39
39
  <swirl-text as="span">
40
- <span class="text text--align-start text--color-default text--font-family-text text--font-style-normal text--size-base text--truncate-direction-end text--weight-normal">
40
+ <span class="text text--align-start text--color-default text--font-family-text text--font-style-normal text--size-base text--truncate-direction-end text--weight-normal" style="white-space: normal;">
41
41
  Est, odio dis scelerisque risus sagittis lorem rhoncus. Vivamus tristique habitant vitae cursus nisl. Sed adipiscing proin suspendisse aliquam maecenas faucibus mauris purus. Tortor ut habitant erat adipiscing nulla pretium, cursus tortor. Amet viverra et platea lacus, nec molestie tincidunt.
42
42
  </span>
43
43
  </swirl-text>