@ghchinoy/litflow 0.4.0 → 0.4.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ghchinoy/litflow",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "xyflow core integrated with Lit WebComponents",
5
5
  "homepage": "https://litflow.dev",
6
6
  "license": "MIT",
package/src/lit-node.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { LitElement, html } from 'lit';
1
+ import { LitElement, html, css } from 'lit';
2
2
  import { customElement, property } from 'lit/decorators.js';
3
3
  import { SignalWatcher } from '@lit-labs/signals';
4
4
 
@@ -6,6 +6,30 @@ type Constructor<T> = new (...args: any[]) => T;
6
6
 
7
7
  @customElement('lit-node')
8
8
  export class LitNode extends (SignalWatcher as <T extends Constructor<LitElement>>(base: T) => T)(LitElement) {
9
+ static styles = css`
10
+ :host {
11
+ display: block;
12
+ }
13
+ .content-wrapper {
14
+ padding: 12px;
15
+ display: flex;
16
+ flex-direction: column;
17
+ gap: 4px;
18
+ pointer-events: none;
19
+ }
20
+ .headline {
21
+ font-size: var(--md-sys-typescale-title-small-size);
22
+ font-weight: var(--md-sys-typescale-title-small-weight);
23
+ color: var(--md-sys-color-on-surface);
24
+ font-family: var(--md-sys-typescale-title-small-font);
25
+ }
26
+ .supporting-text {
27
+ font-size: var(--md-sys-typescale-body-medium-size);
28
+ color: var(--md-sys-color-on-surface-variant);
29
+ font-family: var(--md-sys-typescale-body-medium-font);
30
+ }
31
+ `;
32
+
9
33
  createRenderRoot() {
10
34
  return this;
11
35
  }
@@ -33,11 +57,11 @@ export class LitNode extends (SignalWatcher as <T extends Constructor<LitElement
33
57
 
34
58
  render() {
35
59
  return html`
36
- <div class="content-wrapper" style="padding: 12px; display: flex; flex-direction: column; gap: 4px; pointer-events: none;">
37
- <div class="headline" style="font-size: var(--md-sys-typescale-title-small-size); font-weight: var(--md-sys-typescale-title-small-weight); color: var(--md-sys-color-on-surface); font-family: var(--md-sys-typescale-title-small-font);">
60
+ <div class="content-wrapper">
61
+ <div class="headline">
38
62
  <slot name="headline">${this.label}</slot>
39
63
  </div>
40
- <div class="supporting-text" style="font-size: var(--md-sys-typescale-body-medium-size); color: var(--md-sys-color-on-surface-variant); font-family: var(--md-sys-typescale-body-medium-font);">
64
+ <div class="supporting-text">
41
65
  <slot name="supporting-text"></slot>
42
66
  </div>
43
67
  <slot></slot>