@fluid-topics/ft-card 0.3.11 → 0.3.13

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.
@@ -0,0 +1,12 @@
1
+ export declare const FtCardCssVariables: {
2
+ padding: import("@fluid-topics/ft-wc-utils").FtCssVariable;
3
+ colorPrimary: import("@fluid-topics/ft-wc-utils").FtCssVariable;
4
+ colorSurface: import("@fluid-topics/ft-wc-utils").FtCssVariable;
5
+ colorOnSurfaceMedium: import("@fluid-topics/ft-wc-utils").FtCssVariable;
6
+ colorOnSurfaceHigh: import("@fluid-topics/ft-wc-utils").FtCssVariable;
7
+ borderRadiusM: import("@fluid-topics/ft-wc-utils").FtCssVariable;
8
+ elevation02: import("@fluid-topics/ft-wc-utils").FtCssVariable;
9
+ elevation04: import("@fluid-topics/ft-wc-utils").FtCssVariable;
10
+ };
11
+ export declare const styles: import("lit").CSSResult;
12
+ //# sourceMappingURL=ft-card.css.d.ts.map
@@ -0,0 +1,70 @@
1
+ import { css, } from "lit";
2
+ import { designSystemVariables, FtCssVariableFactory } from "@fluid-topics/ft-wc-utils";
3
+ export const FtCardCssVariables = {
4
+ padding: FtCssVariableFactory.create("--ft-card-padding", "SIZE", "12px"),
5
+ colorPrimary: FtCssVariableFactory.external(designSystemVariables.colorPrimary, "Design system"),
6
+ colorSurface: FtCssVariableFactory.external(designSystemVariables.colorSurface, "Design system"),
7
+ colorOnSurfaceMedium: FtCssVariableFactory.external(designSystemVariables.colorOnSurfaceMedium, "Design system"),
8
+ colorOnSurfaceHigh: FtCssVariableFactory.external(designSystemVariables.colorOnSurfaceHigh, "Design system"),
9
+ borderRadiusM: FtCssVariableFactory.external(designSystemVariables.borderRadiusM, "Design system"),
10
+ elevation02: FtCssVariableFactory.external(designSystemVariables.elevation02, "Design system"),
11
+ elevation04: FtCssVariableFactory.external(designSystemVariables.elevation04, "Design system"),
12
+ };
13
+ // language=CSS
14
+ export const styles = css `
15
+ :host {
16
+ display: block;
17
+ }
18
+
19
+ #container {
20
+ padding: ${FtCardCssVariables.padding};
21
+ border-radius: ${FtCardCssVariables.borderRadiusM};
22
+ box-shadow: ${FtCardCssVariables.elevation02};
23
+ position: relative;
24
+ width: 100%;
25
+ height: 100%;
26
+ display: block;
27
+ box-sizing: border-box;
28
+ background-color: ${FtCardCssVariables.colorSurface};
29
+ transition: box-shadow 0.2s linear, color 0.2s linear;
30
+ }
31
+
32
+ #container:hover {
33
+ box-shadow: ${FtCardCssVariables.elevation04};
34
+ }
35
+
36
+ #container.selected {
37
+ outline: solid 2px ${FtCardCssVariables.colorPrimary};
38
+ box-shadow: ${FtCardCssVariables.elevation04};
39
+ }
40
+
41
+ #header:not([hidden]) {
42
+ display: flex;
43
+ margin-bottom: 8px;
44
+ }
45
+
46
+ #header-content {
47
+ margin-left: 4px;
48
+ }
49
+
50
+ .title {
51
+ text-overflow: ellipsis;
52
+ overflow: hidden;
53
+ color: ${FtCardCssVariables.colorOnSurfaceHigh};
54
+ }
55
+
56
+ #content {
57
+ opacity: 1;
58
+ font-size: 15px;
59
+ height: 100%;
60
+ color: ${FtCardCssVariables.colorOnSurfaceMedium};
61
+ }
62
+
63
+ #action {
64
+ position: absolute;
65
+ top: 0;
66
+ right: 0;
67
+ color: ${FtCardCssVariables.colorOnSurfaceHigh};
68
+ }
69
+ `;
70
+ //# sourceMappingURL=ft-card.css.js.map
@@ -1,21 +1,8 @@
1
1
  import { ElementDefinitionsMap, FtLitElement } from "@fluid-topics/ft-wc-utils";
2
- export interface FtCardProperties {
3
- title: string;
4
- selected: boolean;
5
- }
6
- export declare const FtCardCssVariables: {
7
- padding: import("@fluid-topics/ft-wc-utils").FtCssVariable;
8
- colorPrimary: import("@fluid-topics/ft-wc-utils").FtCssVariable;
9
- colorSurface: import("@fluid-topics/ft-wc-utils").FtCssVariable;
10
- colorOnSurfaceMedium: import("@fluid-topics/ft-wc-utils").FtCssVariable;
11
- colorOnSurfaceHigh: import("@fluid-topics/ft-wc-utils").FtCssVariable;
12
- borderRadiusM: import("@fluid-topics/ft-wc-utils").FtCssVariable;
13
- elevation02: import("@fluid-topics/ft-wc-utils").FtCssVariable;
14
- elevation04: import("@fluid-topics/ft-wc-utils").FtCssVariable;
15
- };
2
+ import { FtCardProperties } from "./ft-card.properties";
16
3
  export declare class FtCard extends FtLitElement implements FtCardProperties {
17
4
  static elementDefinitions: ElementDefinitionsMap;
18
- static get styles(): import("lit").CSSResult;
5
+ static styles: import("lit").CSSResult;
19
6
  title: string;
20
7
  selected: boolean;
21
8
  protected render(): import("lit-html").TemplateResult<1>;
package/build/ft-card.js CHANGED
@@ -4,87 +4,18 @@ 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 { css, html, } from "lit";
7
+ import { html, } from "lit";
8
8
  import { property } from "lit/decorators.js";
9
- import { FtCssVariableFactory, FtLitElement } from "@fluid-topics/ft-wc-utils";
9
+ import { FtLitElement } from "@fluid-topics/ft-wc-utils";
10
10
  import { FtRipple } from "@fluid-topics/ft-ripple";
11
- import { designSystemVariables } from "@fluid-topics/ft-wc-utils/build/designSystemVariables";
12
11
  import { FtTypography } from "@fluid-topics/ft-typography";
13
- export const FtCardCssVariables = {
14
- padding: FtCssVariableFactory.create("--ft-card-padding", "SIZE", "12px"),
15
- colorPrimary: FtCssVariableFactory.external(designSystemVariables.colorPrimary, "Design system"),
16
- colorSurface: FtCssVariableFactory.external(designSystemVariables.colorSurface, "Design system"),
17
- colorOnSurfaceMedium: FtCssVariableFactory.external(designSystemVariables.colorOnSurfaceMedium, "Design system"),
18
- colorOnSurfaceHigh: FtCssVariableFactory.external(designSystemVariables.colorOnSurfaceHigh, "Design system"),
19
- borderRadiusM: FtCssVariableFactory.external(designSystemVariables.borderRadiusM, "Design system"),
20
- elevation02: FtCssVariableFactory.external(designSystemVariables.elevation02, "Design system"),
21
- elevation04: FtCssVariableFactory.external(designSystemVariables.elevation04, "Design system"),
22
- };
12
+ import { styles } from "./ft-card.css";
23
13
  export class FtCard extends FtLitElement {
24
14
  constructor() {
25
15
  super(...arguments);
26
16
  this.title = "";
27
17
  this.selected = false;
28
18
  }
29
- static get styles() {
30
- // language=CSS
31
- return css `
32
- :host {
33
- display: block;
34
- }
35
-
36
- #container {
37
- padding: ${FtCardCssVariables.padding};
38
- border-radius: ${FtCardCssVariables.borderRadiusM};
39
- box-shadow: ${FtCardCssVariables.elevation02};
40
- position: relative;
41
- width: 100%;
42
- height: 100%;
43
- display: block;
44
- box-sizing: border-box;
45
- background-color: ${FtCardCssVariables.colorSurface};
46
- transition: box-shadow 0.2s linear, color 0.2s linear;
47
- }
48
-
49
- #container:hover {
50
- box-shadow: ${FtCardCssVariables.elevation04};
51
- }
52
-
53
- #container.selected {
54
- outline: solid 2px ${FtCardCssVariables.colorPrimary};
55
- box-shadow: ${FtCardCssVariables.elevation04};
56
- }
57
-
58
- #header:not([hidden]) {
59
- display: flex;
60
- margin-bottom: 8px;
61
- }
62
-
63
- #header-content {
64
- margin-left: 4px;
65
- }
66
-
67
- .title {
68
- text-overflow: ellipsis;
69
- overflow: hidden;
70
- color: ${FtCardCssVariables.colorOnSurfaceHigh};
71
- }
72
-
73
- #content {
74
- opacity: 1;
75
- font-size: 15px;
76
- height: 100%;
77
- color: ${FtCardCssVariables.colorOnSurfaceMedium};
78
- }
79
-
80
- #action {
81
- position: absolute;
82
- top: 0;
83
- right: 0;
84
- color: ${FtCardCssVariables.colorOnSurfaceHigh};
85
- }
86
- `;
87
- }
88
19
  render() {
89
20
  return html `
90
21
  <div id="container" part="container" class=${this.selected ? "selected" : ""}>
@@ -109,6 +40,7 @@ FtCard.elementDefinitions = {
109
40
  "ft-ripple": FtRipple,
110
41
  "ft-typography": FtTypography,
111
42
  };
43
+ FtCard.styles = styles;
112
44
  __decorate([
113
45
  property()
114
46
  ], FtCard.prototype, "title", void 0);