@fluid-topics/ft-chip 0.1.16 → 0.2.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/build/ft-chip.js CHANGED
@@ -7,10 +7,10 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  import { css, html, } from "lit";
8
8
  import { property, query } from "lit/decorators.js";
9
9
  import { classMap } from "lit/directives/class-map.js";
10
- import { customElement, designSystemVariables, FtCssVariable, FtLitElement, isSafari, noTextSelect, setVariable } from "@fluid-topics/ft-wc-utils";
10
+ import { designSystemVariables, FtCssVariable, FtLitElement, isSafari, noTextSelect, setVariable } from "@fluid-topics/ft-wc-utils";
11
11
  import { FtRipple, FtRippleCssVariables } from "@fluid-topics/ft-ripple";
12
12
  import { FtTypography, FtTypographyBody2CssVariables } from "@fluid-topics/ft-typography";
13
- import { Icon } from "@material/mwc-icon";
13
+ import { FtIcon, FtIconCssVariables } from "@fluid-topics/ft-icon";
14
14
  const chipColor = FtCssVariable.extend("--ft-chip-color", designSystemVariables.colorOnSurface);
15
15
  export const FtChipCssVariables = {
16
16
  backgroundColor: FtCssVariable.extend("--ft-chip-background-color", designSystemVariables.colorSurface),
@@ -38,7 +38,7 @@ export class IconClickEvent extends CustomEvent {
38
38
  super("icon-click");
39
39
  }
40
40
  }
41
- let FtChip = class FtChip extends FtLitElement {
41
+ export class FtChip extends FtLitElement {
42
42
  constructor() {
43
43
  super(...arguments);
44
44
  this.highlighted = false;
@@ -52,7 +52,7 @@ let FtChip = class FtChip extends FtLitElement {
52
52
  this.icon = undefined;
53
53
  this.trailingIcon = false;
54
54
  }
55
- getStyles() {
55
+ static get styles() {
56
56
  //language=css
57
57
  return [
58
58
  noTextSelect,
@@ -60,6 +60,7 @@ let FtChip = class FtChip extends FtLitElement {
60
60
  :host {
61
61
  display: inline-block;
62
62
  max-width: 100%;
63
+ pointer-events: none;
63
64
  }
64
65
 
65
66
  .ft-chip {
@@ -70,14 +71,15 @@ let FtChip = class FtChip extends FtLitElement {
70
71
  width: 100%;
71
72
  overflow: hidden;
72
73
  box-sizing: border-box;
74
+ pointer-events: auto;
73
75
 
74
76
  --ft-chip-internal-font-size: ${FtChipCssVariables.fontSize};
75
77
  --ft-chip-internal-line-height: max(20px, calc(var(--ft-chip-internal-font-size) + 2px));
76
- --mdc-icon-size: ${FtChipCssVariables.iconSize};
78
+ ${setVariable(FtIconCssVariables.size, FtChipCssVariables.iconSize)};
77
79
  --ft-chip-internal-vertical-padding: ${FtChipCssVariables.verticalPadding};
78
80
  --ft-chip-internal-horizontal-padding: ${FtChipCssVariables.horizontalPadding};
79
81
  --ft-chip-internal-icon-padding: 3px;
80
- --ft-chip-internal-content-height: max(var(--ft-chip-internal-line-height), var(--mdc-icon-size));
82
+ --ft-chip-internal-content-height: max(var(--ft-chip-internal-line-height), ${FtChipCssVariables.iconSize});
81
83
 
82
84
  border: 1px solid ${FtChipCssVariables.colorOutline};
83
85
  color: ${FtChipCssVariables.color};
@@ -179,7 +181,7 @@ let FtChip = class FtChip extends FtLitElement {
179
181
  `
180
182
  ];
181
183
  }
182
- getTemplate() {
184
+ render() {
183
185
  const classes = {
184
186
  "ft-chip": true,
185
187
  "ft-chip--highlighted": this.highlighted,
@@ -217,7 +219,7 @@ let FtChip = class FtChip extends FtLitElement {
217
219
  @click=${this.onIconClick}
218
220
  @keyup=${this.onIconKeyUp}>
219
221
  <ft-ripple ?disabled=${!this.interactionsOnIcon}></ft-ripple>
220
- <mwc-icon>${this.internalIcon}</mwc-icon>
222
+ <ft-icon variant="material">${this.internalIcon}</ft-icon>
221
223
  </div>
222
224
  `;
223
225
  }
@@ -254,11 +256,11 @@ let FtChip = class FtChip extends FtLitElement {
254
256
  get internalIcon() {
255
257
  return this.icon || (this.removable ? "cancel" : undefined);
256
258
  }
257
- };
259
+ }
258
260
  FtChip.elementDefinitions = {
259
261
  "ft-ripple": FtRipple,
260
262
  "ft-typography": FtTypography,
261
- "mwc-icon": Icon,
263
+ "ft-icon": FtIcon,
262
264
  };
263
265
  __decorate([
264
266
  property({ type: Boolean })
@@ -293,8 +295,4 @@ __decorate([
293
295
  __decorate([
294
296
  query("ft-typography slot")
295
297
  ], FtChip.prototype, "slottedContent", void 0);
296
- FtChip = __decorate([
297
- customElement("ft-chip")
298
- ], FtChip);
299
- export { FtChip };
300
298
  //# sourceMappingURL=ft-chip.js.map