@fluid-topics/ft-notice 1.3.28 → 1.3.30

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.
@@ -1,8 +1,13 @@
1
- import { FtNoticeProperties } from "./ft-notice.properties";
2
- import { FtBaseNotice } from "./ft-base-notice";
1
+ import { FtNoticeFamily, FtNoticeProperties } from "./ft-notice.properties";
3
2
  import { FtTypographyVariants } from "@fluid-topics/ft-typography";
4
- export declare class FtNotice extends FtBaseNotice implements FtNoticeProperties {
3
+ import { ElementDefinitionsMap, FtLitElement } from "@fluid-topics/ft-wc-utils";
4
+ export declare class FtNotice extends FtLitElement implements FtNoticeProperties {
5
+ static elementDefinitions: ElementDefinitionsMap;
5
6
  static styles: import("lit").CSSResult;
7
+ family: FtNoticeFamily;
8
+ dense: boolean;
9
+ icon?: string;
10
+ private iconByFamily;
11
+ protected render(): import("lit-html").TemplateResult<1>;
6
12
  get typographyVariant(): FtTypographyVariants;
7
- get noticeClasses(): Record<string, boolean>;
8
13
  }
@@ -1,13 +1,61 @@
1
- import { FtBaseNotice } from "./ft-base-notice";
2
- import { FtTypographyVariants } from "@fluid-topics/ft-typography";
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
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
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { FtNoticeFamily } from "./ft-notice.properties";
8
+ import { FtTypography, FtTypographyVariants } from "@fluid-topics/ft-typography";
3
9
  import { styles } from "./ft-notice.styles";
4
- class FtNotice extends FtBaseNotice {
5
- get typographyVariant() {
6
- return FtTypographyVariants.body2;
10
+ import { FtLitElement } from "@fluid-topics/ft-wc-utils";
11
+ import { FtIcon, FtIcons } from "@fluid-topics/ft-icon";
12
+ import { property } from "lit/decorators.js";
13
+ import { html } from "lit";
14
+ import { classMap } from "lit/directives/class-map.js";
15
+ class FtNotice extends FtLitElement {
16
+ constructor() {
17
+ super(...arguments);
18
+ this.family = FtNoticeFamily.info;
19
+ this.dense = false;
20
+ this.iconByFamily = {
21
+ [FtNoticeFamily.info]: FtIcons.SQUARE_INFO_SOLID,
22
+ [FtNoticeFamily.warning]: FtIcons.WARNING,
23
+ [FtNoticeFamily.error]: FtIcons.CLOSE_PLAIN,
24
+ [FtNoticeFamily.success]: FtIcons.CHECK_PLAIN,
25
+ };
26
+ }
27
+ render() {
28
+ const classes = {
29
+ [this.family]: true,
30
+ dense: this.dense,
31
+ };
32
+ return html `
33
+ <div class="${classMap(classes)}" part="container">
34
+ <div part="icon">
35
+ <ft-icon value="${this.icon || this.iconByFamily[this.family]}"></ft-icon>
36
+ </div>
37
+ <ft-typography part="label" variant="${this.typographyVariant}">
38
+ <slot></slot>
39
+ </ft-typography>
40
+ </div>
41
+ `;
7
42
  }
8
- get noticeClasses() {
9
- return {};
43
+ get typographyVariant() {
44
+ return this.dense ? FtTypographyVariants.caption : FtTypographyVariants.body2;
10
45
  }
11
46
  }
47
+ FtNotice.elementDefinitions = {
48
+ "ft-icon": FtIcon,
49
+ "ft-typography": FtTypography,
50
+ };
12
51
  FtNotice.styles = styles;
52
+ __decorate([
53
+ property()
54
+ ], FtNotice.prototype, "family", void 0);
55
+ __decorate([
56
+ property({ type: Boolean })
57
+ ], FtNotice.prototype, "dense", void 0);
58
+ __decorate([
59
+ property({ type: String })
60
+ ], FtNotice.prototype, "icon", void 0);
13
61
  export { FtNotice };