@fluid-topics/ft-chip 1.3.45 → 1.3.46

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.
@@ -17,7 +17,7 @@ export declare class FtdsChip extends FtdsBase implements FtdsChipProperties {
17
17
  private renderAction;
18
18
  private resolveButtonSize;
19
19
  private getLabel;
20
- get textContent(): string;
20
+ getTextContent(): string;
21
21
  private onSlotchange;
22
22
  private dispatchRemoveEvent;
23
23
  private typographyVariant;
@@ -4,11 +4,11 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
4
4
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
- import { html, nothing, } from "lit";
7
+ import { html, nothing } from "lit";
8
8
  import { property, query } from "lit/decorators.js";
9
9
  import { classMap } from "lit/directives/class-map.js";
10
10
  import { DesignSystemFamily, FtdsBase } from "@fluid-topics/ft-wc-utils";
11
- import { FtTypography, FtTypographyVariants } from "@fluid-topics/ft-typography";
11
+ import { FtdsTypography, FtdsTypographyVariants } from "@fluid-topics/ft-typography";
12
12
  import { FtIcon, FtIcons, FtIconVariants } from "@fluid-topics/ft-icon";
13
13
  import { designSystemStyle } from "./ftds-chip.styles";
14
14
  import { DesignSystemSize } from "@fluid-topics/design-system-variables";
@@ -31,27 +31,27 @@ class FtdsChip extends FtdsBase {
31
31
  "ftds-chip": true,
32
32
  "ftds-chip--with-action": this.removable || this.withAction,
33
33
  "ftds-chip--with-icon": !!this.icon,
34
- ...this.getDesignSystemBaseClasses()
34
+ ...this.getDesignSystemBaseClasses(),
35
35
  };
36
36
  return html `
37
37
  <div class="${classMap(classes)}"
38
38
  aria-label="${this.getLabel()}"
39
39
  part="chip">
40
40
  ${this.renderIcon()}
41
- <ft-typography variant=${this.typographyVariant()} element="span" class="ftds-chip--label" part="label">
41
+ <ftds-typography variant="${this.typographyVariant()}" element="span" class="ftds-chip--label" part="label">
42
42
  <slot @slotchange=${this.onSlotchange}></slot>
43
- </ft-typography>
43
+ </ftds-typography>
44
44
  ${this.renderAction()}
45
45
  </div>
46
46
  `;
47
47
  }
48
48
  renderIcon() {
49
- return this.icon ?
50
- html `
51
- <div class="ftds-chip--icon-container" part="icon-container">
52
- <ft-icon .variant=${FtIconVariants.fluid_topics} .value="${this.icon}" part="icon"></ft-icon>
53
- </div>
54
- ` : nothing;
49
+ return this.icon
50
+ ? html `
51
+ <div class="ftds-chip--icon-container" part="icon-container">
52
+ <ft-icon .variant=${FtIconVariants.fluid_topics} .value=${this.icon} part="icon"></ft-icon>
53
+ </div>
54
+ ` : nothing;
55
55
  }
56
56
  renderAction() {
57
57
  if (this.removable) {
@@ -59,10 +59,10 @@ class FtdsChip extends FtdsBase {
59
59
  <ftds-button round
60
60
  class="ftds-chip--remove-button"
61
61
  @click=${this.dispatchRemoveEvent}
62
- icon=${FtIcons.X_MARK}
63
- label=${this.removeButtonLabel}
64
- family=${DesignSystemFamily.neutral}
65
- size=${this.resolveButtonSize()}
62
+ icon="${FtIcons.X_MARK}"
63
+ label="${this.removeButtonLabel}"
64
+ family="${DesignSystemFamily.neutral}"
65
+ size="${this.resolveButtonSize()}"
66
66
  part="icon-button"
67
67
  ></ftds-button>
68
68
  `;
@@ -75,17 +75,16 @@ class FtdsChip extends FtdsBase {
75
75
  switch (this.size) {
76
76
  case DesignSystemSize.large:
77
77
  return DesignSystemSize.medium;
78
- case DesignSystemSize.medium:
79
- case DesignSystemSize.small:
78
+ default:
80
79
  return DesignSystemSize.small;
81
80
  }
82
81
  }
83
82
  getLabel() {
84
- return this.label || this.textContent;
83
+ return this.label || this.getTextContent();
85
84
  }
86
- get textContent() {
85
+ getTextContent() {
87
86
  var _a, _b;
88
- return (_b = (_a = this.slottedContent) === null || _a === void 0 ? void 0 : _a.assignedNodes().map(n => n.textContent).join("").trim()) !== null && _b !== void 0 ? _b : "";
87
+ return (_b = (_a = this.slottedContent) === null || _a === void 0 ? void 0 : _a.assignedNodes().map((n) => n.textContent).join("").trim()) !== null && _b !== void 0 ? _b : "";
89
88
  }
90
89
  onSlotchange() {
91
90
  this.requestUpdate();
@@ -96,15 +95,14 @@ class FtdsChip extends FtdsBase {
96
95
  typographyVariant() {
97
96
  switch (this.size) {
98
97
  case DesignSystemSize.large:
99
- return FtTypographyVariants.body2medium;
100
- case DesignSystemSize.medium:
101
- case DesignSystemSize.small:
102
- return FtTypographyVariants.caption1medium;
98
+ return FtdsTypographyVariants.body2medium;
99
+ default:
100
+ return FtdsTypographyVariants.caption1medium;
103
101
  }
104
102
  }
105
103
  }
106
104
  FtdsChip.elementDefinitions = {
107
- "ft-typography": FtTypography,
105
+ "ftds-typography": FtdsTypography,
108
106
  "ft-icon": FtIcon,
109
107
  "ftds-button": FtdsButton,
110
108
  };
@@ -125,6 +123,6 @@ __decorate([
125
123
  property()
126
124
  ], FtdsChip.prototype, "icon", void 0);
127
125
  __decorate([
128
- query("ft-typography slot")
126
+ query("ftds-typography slot")
129
127
  ], FtdsChip.prototype, "slottedContent", void 0);
130
128
  export { FtdsChip };
@@ -24,7 +24,7 @@ export const designSystemStyle = [
24
24
  flex: none;
25
25
  }
26
26
 
27
- .ftds-chip ft-typography {
27
+ .ftds-chip ftds-typography {
28
28
  display: flex; /* For typo alignment in the chip */
29
29
  }
30
30
 
@@ -51,7 +51,7 @@ export const designSystemStyle = [
51
51
  padding-right: ${chip.smallButtonRightPadding};
52
52
  }
53
53
 
54
- .ftds--size-small ft-typography {
54
+ .ftds--size-small ftds-typography {
55
55
  overflow: visible;
56
56
  padding: 0 2px;
57
57
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-topics/ft-chip",
3
- "version": "1.3.45",
3
+ "version": "1.3.46",
4
4
  "description": "A generic Fluid Topics chip",
5
5
  "keywords": [
6
6
  "Lit"
@@ -20,11 +20,11 @@
20
20
  },
21
21
  "dependencies": {
22
22
  "@fluid-topics/design-system-variables": "2.53.1",
23
- "@fluid-topics/ft-icon": "1.3.45",
24
- "@fluid-topics/ft-ripple": "1.3.45",
25
- "@fluid-topics/ft-typography": "1.3.45",
26
- "@fluid-topics/ft-wc-utils": "1.3.45",
23
+ "@fluid-topics/ft-icon": "1.3.46",
24
+ "@fluid-topics/ft-ripple": "1.3.46",
25
+ "@fluid-topics/ft-typography": "1.3.46",
26
+ "@fluid-topics/ft-wc-utils": "1.3.46",
27
27
  "lit": "3.1.0"
28
28
  },
29
- "gitHead": "3fd3d1375535575f012653afcbcb81dc3c25b7c7"
29
+ "gitHead": "d6cf25d6ed0dead8c7aff4f94a493c35d12f1392"
30
30
  }