@deepfuture/dui-templates 1.0.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.
Files changed (50) hide show
  1. package/README.md +214 -0
  2. package/all.d.ts +10 -0
  3. package/all.js +20 -0
  4. package/content/briefing-block.d.ts +36 -0
  5. package/content/briefing-block.js +281 -0
  6. package/content/empty-state.d.ts +24 -0
  7. package/content/empty-state.js +187 -0
  8. package/content/index.d.ts +5 -0
  9. package/content/index.js +5 -0
  10. package/content/numbered-insight.d.ts +30 -0
  11. package/content/numbered-insight.js +242 -0
  12. package/dashboard/index.d.ts +5 -0
  13. package/dashboard/index.js +5 -0
  14. package/dashboard/page-header.d.ts +29 -0
  15. package/dashboard/page-header.js +218 -0
  16. package/dashboard/section-panel.d.ts +41 -0
  17. package/dashboard/section-panel.js +393 -0
  18. package/data/index.d.ts +5 -0
  19. package/data/index.js +4 -0
  20. package/data/key-value.d.ts +27 -0
  21. package/data/key-value.js +165 -0
  22. package/data/market-table.d.ts +40 -0
  23. package/data/market-table.js +270 -0
  24. package/feed/activity-item.d.ts +35 -0
  25. package/feed/activity-item.js +278 -0
  26. package/feed/feed-item.d.ts +32 -0
  27. package/feed/feed-item.js +260 -0
  28. package/feed/headline-item.d.ts +27 -0
  29. package/feed/headline-item.js +187 -0
  30. package/feed/index.d.ts +6 -0
  31. package/feed/index.js +6 -0
  32. package/feed/social-post.d.ts +31 -0
  33. package/feed/social-post.js +268 -0
  34. package/media/avatar-row.d.ts +31 -0
  35. package/media/avatar-row.js +164 -0
  36. package/media/index.d.ts +7 -0
  37. package/media/index.js +5 -0
  38. package/media/media-grid.d.ts +32 -0
  39. package/media/media-grid.js +199 -0
  40. package/metrics/index.d.ts +6 -0
  41. package/metrics/index.js +6 -0
  42. package/metrics/progress-bar.d.ts +31 -0
  43. package/metrics/progress-bar.js +212 -0
  44. package/metrics/risk-gauge.d.ts +31 -0
  45. package/metrics/risk-gauge.js +289 -0
  46. package/metrics/score-item.d.ts +33 -0
  47. package/metrics/score-item.js +253 -0
  48. package/metrics/stat-card.d.ts +29 -0
  49. package/metrics/stat-card.js +230 -0
  50. package/package.json +61 -0
@@ -0,0 +1,27 @@
1
+ import { LitElement, type TemplateResult } from "lit";
2
+ /**
3
+ * `<dui-key-value>` — A label–value pair for metadata display.
4
+ *
5
+ * Renders a muted label and a prominent value. Supports two layouts:
6
+ * `stacked` (default — label above value) and `inline` (label left, value right).
7
+ *
8
+ * Compose inside `<dui-key-value-group>` for grid layouts.
9
+ *
10
+ * @csspart pair - The outer container.
11
+ * @csspart label - The label text.
12
+ * @csspart value - The value text.
13
+ * @csspart description - The description text.
14
+ */
15
+ export declare class DuiKeyValue extends LitElement {
16
+ static tagName: "dui-key-value";
17
+ static styles: import("lit").CSSResult[];
18
+ /** The label text (e.g. "Status", "Region", "Created"). */
19
+ accessor label: string;
20
+ /** The value text (e.g. "Active", "North America", "Jan 15, 2025"). */
21
+ accessor value: string;
22
+ /** Optional supporting description below the value. */
23
+ accessor description: string;
24
+ /** Layout mode: "stacked" (label above value) or "inline" (side by side). */
25
+ accessor layout: "stacked" | "inline";
26
+ render(): TemplateResult;
27
+ }
@@ -0,0 +1,165 @@
1
+ var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
2
+ function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
3
+ var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
4
+ var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
5
+ var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
6
+ var _, done = false;
7
+ for (var i = decorators.length - 1; i >= 0; i--) {
8
+ var context = {};
9
+ for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
10
+ for (var p in contextIn.access) context.access[p] = contextIn.access[p];
11
+ context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
12
+ var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
13
+ if (kind === "accessor") {
14
+ if (result === void 0) continue;
15
+ if (result === null || typeof result !== "object") throw new TypeError("Object expected");
16
+ if (_ = accept(result.get)) descriptor.get = _;
17
+ if (_ = accept(result.set)) descriptor.set = _;
18
+ if (_ = accept(result.init)) initializers.unshift(_);
19
+ }
20
+ else if (_ = accept(result)) {
21
+ if (kind === "field") initializers.unshift(_);
22
+ else descriptor[key] = _;
23
+ }
24
+ }
25
+ if (target) Object.defineProperty(target, contextIn.name, descriptor);
26
+ done = true;
27
+ };
28
+ var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
29
+ var useValue = arguments.length > 2;
30
+ for (var i = 0; i < initializers.length; i++) {
31
+ value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
32
+ }
33
+ return useValue ? value : void 0;
34
+ };
35
+ import { css, html, LitElement, nothing } from "lit";
36
+ import { property } from "lit/decorators.js";
37
+ import { base } from "@deepfuture/dui-core/base";
38
+ const styles = css `
39
+ :host {
40
+ display: block;
41
+ }
42
+
43
+ .pair {
44
+ display: flex;
45
+ flex-direction: column;
46
+ gap: var(--space-0_5);
47
+ }
48
+
49
+ :host([layout="inline"]) .pair {
50
+ flex-direction: row;
51
+ align-items: baseline;
52
+ justify-content: space-between;
53
+ gap: var(--space-3);
54
+ }
55
+
56
+ .label {
57
+ font-family: var(--font-sans);
58
+ font-size: var(--text-xs);
59
+ font-weight: var(--font-weight-medium);
60
+ letter-spacing: var(--letter-spacing-wide);
61
+ line-height: var(--line-height-normal);
62
+ color: var(--text-2);
63
+ }
64
+
65
+ .value {
66
+ font-family: var(--font-sans);
67
+ font-size: var(--text-sm);
68
+ font-weight: var(--font-weight-medium);
69
+ letter-spacing: var(--letter-spacing-wide);
70
+ line-height: var(--line-height-snug);
71
+ color: var(--foreground);
72
+ }
73
+
74
+ :host([layout="inline"]) .value {
75
+ text-align: end;
76
+ }
77
+
78
+ .description {
79
+ font-family: var(--font-sans);
80
+ font-size: var(--text-xs);
81
+ letter-spacing: var(--letter-spacing-wide);
82
+ line-height: var(--line-height-normal);
83
+ color: var(--text-3);
84
+ margin: 0;
85
+ }
86
+ `;
87
+ /**
88
+ * `<dui-key-value>` — A label–value pair for metadata display.
89
+ *
90
+ * Renders a muted label and a prominent value. Supports two layouts:
91
+ * `stacked` (default — label above value) and `inline` (label left, value right).
92
+ *
93
+ * Compose inside `<dui-key-value-group>` for grid layouts.
94
+ *
95
+ * @csspart pair - The outer container.
96
+ * @csspart label - The label text.
97
+ * @csspart value - The value text.
98
+ * @csspart description - The description text.
99
+ */
100
+ let DuiKeyValue = (() => {
101
+ let _classSuper = LitElement;
102
+ let _label_decorators;
103
+ let _label_initializers = [];
104
+ let _label_extraInitializers = [];
105
+ let _value_decorators;
106
+ let _value_initializers = [];
107
+ let _value_extraInitializers = [];
108
+ let _description_decorators;
109
+ let _description_initializers = [];
110
+ let _description_extraInitializers = [];
111
+ let _layout_decorators;
112
+ let _layout_initializers = [];
113
+ let _layout_extraInitializers = [];
114
+ return class DuiKeyValue extends _classSuper {
115
+ static {
116
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
117
+ _label_decorators = [property()];
118
+ _value_decorators = [property()];
119
+ _description_decorators = [property()];
120
+ _layout_decorators = [property({ reflect: true })];
121
+ __esDecorate(this, null, _label_decorators, { kind: "accessor", name: "label", static: false, private: false, access: { has: obj => "label" in obj, get: obj => obj.label, set: (obj, value) => { obj.label = value; } }, metadata: _metadata }, _label_initializers, _label_extraInitializers);
122
+ __esDecorate(this, null, _value_decorators, { kind: "accessor", name: "value", static: false, private: false, access: { has: obj => "value" in obj, get: obj => obj.value, set: (obj, value) => { obj.value = value; } }, metadata: _metadata }, _value_initializers, _value_extraInitializers);
123
+ __esDecorate(this, null, _description_decorators, { kind: "accessor", name: "description", static: false, private: false, access: { has: obj => "description" in obj, get: obj => obj.description, set: (obj, value) => { obj.description = value; } }, metadata: _metadata }, _description_initializers, _description_extraInitializers);
124
+ __esDecorate(this, null, _layout_decorators, { kind: "accessor", name: "layout", static: false, private: false, access: { has: obj => "layout" in obj, get: obj => obj.layout, set: (obj, value) => { obj.layout = value; } }, metadata: _metadata }, _layout_initializers, _layout_extraInitializers);
125
+ if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
126
+ }
127
+ static tagName = "dui-key-value";
128
+ static styles = [base, styles];
129
+ #label_accessor_storage = __runInitializers(this, _label_initializers, "");
130
+ /** The label text (e.g. "Status", "Region", "Created"). */
131
+ get label() { return this.#label_accessor_storage; }
132
+ set label(value) { this.#label_accessor_storage = value; }
133
+ #value_accessor_storage = (__runInitializers(this, _label_extraInitializers), __runInitializers(this, _value_initializers, ""));
134
+ /** The value text (e.g. "Active", "North America", "Jan 15, 2025"). */
135
+ get value() { return this.#value_accessor_storage; }
136
+ set value(value) { this.#value_accessor_storage = value; }
137
+ #description_accessor_storage = (__runInitializers(this, _value_extraInitializers), __runInitializers(this, _description_initializers, ""));
138
+ /** Optional supporting description below the value. */
139
+ get description() { return this.#description_accessor_storage; }
140
+ set description(value) { this.#description_accessor_storage = value; }
141
+ #layout_accessor_storage = (__runInitializers(this, _description_extraInitializers), __runInitializers(this, _layout_initializers, "stacked"));
142
+ /** Layout mode: "stacked" (label above value) or "inline" (side by side). */
143
+ get layout() { return this.#layout_accessor_storage; }
144
+ set layout(value) { this.#layout_accessor_storage = value; }
145
+ render() {
146
+ return html `
147
+ <div class="pair" part="pair">
148
+ <span class="label" part="label">${this.label}</span>
149
+ <span class="value" part="value">
150
+ <slot>${this.value}</slot>
151
+ </span>
152
+ </div>
153
+ ${this.description
154
+ ? html `<p class="description" part="description">${this.description}</p>`
155
+ : nothing}
156
+ `;
157
+ }
158
+ constructor() {
159
+ super(...arguments);
160
+ __runInitializers(this, _layout_extraInitializers);
161
+ }
162
+ };
163
+ })();
164
+ export { DuiKeyValue };
165
+ customElements.define(DuiKeyValue.tagName, DuiKeyValue);
@@ -0,0 +1,40 @@
1
+ import { LitElement, type TemplateResult } from "lit";
2
+ import "@deepfuture/dui-components/icon";
3
+ /** A single row in the market table. */
4
+ export interface MarketRow {
5
+ /** Ticker symbol (e.g. "AAPL", "BTC"). */
6
+ symbol: string;
7
+ /** Full name (e.g. "Apple Inc."). Optional. */
8
+ name?: string;
9
+ /** Current price. */
10
+ price: number;
11
+ /** Absolute change (positive or negative). */
12
+ change: number;
13
+ /** Percentage change (positive or negative). */
14
+ changePercent: number;
15
+ }
16
+ /**
17
+ * `<dui-market-table>` — A compact financial ticker table.
18
+ *
19
+ * Renders rows of symbols with prices, absolute change, and percentage change.
20
+ * Positive changes are colored with the accent token; negative with destructive.
21
+ * Each row includes a directional arrow indicator.
22
+ *
23
+ * @csspart table - The `<table>` element.
24
+ * @csspart thead - The `<thead>` element.
25
+ * @csspart tbody - The `<tbody>` element.
26
+ */
27
+ export declare class DuiMarketTable extends LitElement {
28
+ #private;
29
+ static tagName: "dui-market-table";
30
+ static styles: import("lit").CSSResult[];
31
+ /** Array of market data rows. */
32
+ accessor data: MarketRow[];
33
+ /** Number of decimal places for prices. */
34
+ accessor pricePrecision: number;
35
+ /** Currency symbol prepended to prices. */
36
+ accessor currencySymbol: string;
37
+ /** Text shown when data is empty. */
38
+ accessor emptyText: string;
39
+ render(): TemplateResult;
40
+ }
@@ -0,0 +1,270 @@
1
+ var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
2
+ function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
3
+ var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
4
+ var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
5
+ var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
6
+ var _, done = false;
7
+ for (var i = decorators.length - 1; i >= 0; i--) {
8
+ var context = {};
9
+ for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
10
+ for (var p in contextIn.access) context.access[p] = contextIn.access[p];
11
+ context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
12
+ var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
13
+ if (kind === "accessor") {
14
+ if (result === void 0) continue;
15
+ if (result === null || typeof result !== "object") throw new TypeError("Object expected");
16
+ if (_ = accept(result.get)) descriptor.get = _;
17
+ if (_ = accept(result.set)) descriptor.set = _;
18
+ if (_ = accept(result.init)) initializers.unshift(_);
19
+ }
20
+ else if (_ = accept(result)) {
21
+ if (kind === "field") initializers.unshift(_);
22
+ else descriptor[key] = _;
23
+ }
24
+ }
25
+ if (target) Object.defineProperty(target, contextIn.name, descriptor);
26
+ done = true;
27
+ };
28
+ var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
29
+ var useValue = arguments.length > 2;
30
+ for (var i = 0; i < initializers.length; i++) {
31
+ value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
32
+ }
33
+ return useValue ? value : void 0;
34
+ };
35
+ import { css, html, LitElement, nothing } from "lit";
36
+ import { property } from "lit/decorators.js";
37
+ import { base } from "@deepfuture/dui-core/base";
38
+ import "@deepfuture/dui-components/icon";
39
+ const styles = css `
40
+ :host {
41
+ display: block;
42
+ }
43
+
44
+ table {
45
+ width: 100%;
46
+ border-collapse: collapse;
47
+ font-family: var(--font-sans);
48
+ font-size: var(--text-sm);
49
+ letter-spacing: var(--letter-spacing-wide);
50
+ }
51
+
52
+ thead th {
53
+ padding: var(--space-2) var(--space-3);
54
+ font-size: var(--text-xs);
55
+ font-weight: var(--font-weight-medium);
56
+ color: var(--text-3);
57
+ text-align: left;
58
+ border-bottom: var(--border-width-thin) solid var(--border);
59
+ white-space: nowrap;
60
+ }
61
+
62
+ thead th.align-end {
63
+ text-align: right;
64
+ }
65
+
66
+ tbody tr {
67
+ transition: background var(--duration-fast) ease;
68
+ }
69
+
70
+ tbody tr:hover {
71
+ background: var(--surface-2);
72
+ }
73
+
74
+ tbody td {
75
+ padding: var(--space-2) var(--space-3);
76
+ border-bottom: var(--border-width-thin) solid var(--border);
77
+ line-height: var(--line-height-snug);
78
+ white-space: nowrap;
79
+ }
80
+
81
+ tbody tr:last-child td {
82
+ border-bottom: none;
83
+ }
84
+
85
+ .symbol {
86
+ font-weight: var(--font-weight-semibold);
87
+ color: var(--foreground);
88
+ }
89
+
90
+ .name {
91
+ color: var(--text-2);
92
+ font-size: var(--text-xs);
93
+ margin-left: var(--space-1);
94
+ }
95
+
96
+ .price {
97
+ text-align: right;
98
+ font-variant-numeric: tabular-nums;
99
+ color: var(--foreground);
100
+ }
101
+
102
+ .change {
103
+ text-align: right;
104
+ font-variant-numeric: tabular-nums;
105
+ }
106
+
107
+ .pct {
108
+ text-align: right;
109
+ font-variant-numeric: tabular-nums;
110
+ font-weight: var(--font-weight-medium);
111
+ }
112
+
113
+ .positive {
114
+ color: var(--accent-text);
115
+ }
116
+
117
+ .negative {
118
+ color: var(--destructive-text);
119
+ }
120
+
121
+ .neutral {
122
+ color: var(--text-3);
123
+ }
124
+
125
+ .arrow {
126
+ display: inline-flex;
127
+ align-items: center;
128
+ vertical-align: middle;
129
+ margin-right: var(--space-0_5);
130
+ }
131
+
132
+ .empty {
133
+ padding: var(--space-6) var(--space-4);
134
+ text-align: center;
135
+ color: var(--text-3);
136
+ font-size: var(--text-sm);
137
+ }
138
+ `;
139
+ /**
140
+ * `<dui-market-table>` — A compact financial ticker table.
141
+ *
142
+ * Renders rows of symbols with prices, absolute change, and percentage change.
143
+ * Positive changes are colored with the accent token; negative with destructive.
144
+ * Each row includes a directional arrow indicator.
145
+ *
146
+ * @csspart table - The `<table>` element.
147
+ * @csspart thead - The `<thead>` element.
148
+ * @csspart tbody - The `<tbody>` element.
149
+ */
150
+ let DuiMarketTable = (() => {
151
+ let _classSuper = LitElement;
152
+ let _data_decorators;
153
+ let _data_initializers = [];
154
+ let _data_extraInitializers = [];
155
+ let _pricePrecision_decorators;
156
+ let _pricePrecision_initializers = [];
157
+ let _pricePrecision_extraInitializers = [];
158
+ let _currencySymbol_decorators;
159
+ let _currencySymbol_initializers = [];
160
+ let _currencySymbol_extraInitializers = [];
161
+ let _emptyText_decorators;
162
+ let _emptyText_initializers = [];
163
+ let _emptyText_extraInitializers = [];
164
+ return class DuiMarketTable extends _classSuper {
165
+ static {
166
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
167
+ _data_decorators = [property({ type: Array })];
168
+ _pricePrecision_decorators = [property({ type: Number, attribute: "price-precision" })];
169
+ _currencySymbol_decorators = [property({ attribute: "currency-symbol" })];
170
+ _emptyText_decorators = [property({ attribute: "empty-text" })];
171
+ __esDecorate(this, null, _data_decorators, { kind: "accessor", name: "data", static: false, private: false, access: { has: obj => "data" in obj, get: obj => obj.data, set: (obj, value) => { obj.data = value; } }, metadata: _metadata }, _data_initializers, _data_extraInitializers);
172
+ __esDecorate(this, null, _pricePrecision_decorators, { kind: "accessor", name: "pricePrecision", static: false, private: false, access: { has: obj => "pricePrecision" in obj, get: obj => obj.pricePrecision, set: (obj, value) => { obj.pricePrecision = value; } }, metadata: _metadata }, _pricePrecision_initializers, _pricePrecision_extraInitializers);
173
+ __esDecorate(this, null, _currencySymbol_decorators, { kind: "accessor", name: "currencySymbol", static: false, private: false, access: { has: obj => "currencySymbol" in obj, get: obj => obj.currencySymbol, set: (obj, value) => { obj.currencySymbol = value; } }, metadata: _metadata }, _currencySymbol_initializers, _currencySymbol_extraInitializers);
174
+ __esDecorate(this, null, _emptyText_decorators, { kind: "accessor", name: "emptyText", static: false, private: false, access: { has: obj => "emptyText" in obj, get: obj => obj.emptyText, set: (obj, value) => { obj.emptyText = value; } }, metadata: _metadata }, _emptyText_initializers, _emptyText_extraInitializers);
175
+ if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
176
+ }
177
+ static tagName = "dui-market-table";
178
+ static styles = [base, styles];
179
+ #data_accessor_storage = __runInitializers(this, _data_initializers, []);
180
+ /** Array of market data rows. */
181
+ get data() { return this.#data_accessor_storage; }
182
+ set data(value) { this.#data_accessor_storage = value; }
183
+ #pricePrecision_accessor_storage = (__runInitializers(this, _data_extraInitializers), __runInitializers(this, _pricePrecision_initializers, 2));
184
+ /** Number of decimal places for prices. */
185
+ get pricePrecision() { return this.#pricePrecision_accessor_storage; }
186
+ set pricePrecision(value) { this.#pricePrecision_accessor_storage = value; }
187
+ #currencySymbol_accessor_storage = (__runInitializers(this, _pricePrecision_extraInitializers), __runInitializers(this, _currencySymbol_initializers, "$"));
188
+ /** Currency symbol prepended to prices. */
189
+ get currencySymbol() { return this.#currencySymbol_accessor_storage; }
190
+ set currencySymbol(value) { this.#currencySymbol_accessor_storage = value; }
191
+ #emptyText_accessor_storage = (__runInitializers(this, _currencySymbol_extraInitializers), __runInitializers(this, _emptyText_initializers, "No market data"));
192
+ /** Text shown when data is empty. */
193
+ get emptyText() { return this.#emptyText_accessor_storage; }
194
+ set emptyText(value) { this.#emptyText_accessor_storage = value; }
195
+ #formatPrice(price) {
196
+ return `${this.currencySymbol}${price.toFixed(this.pricePrecision)}`;
197
+ }
198
+ #formatChange(change) {
199
+ const sign = change > 0 ? "+" : "";
200
+ return `${sign}${change.toFixed(this.pricePrecision)}`;
201
+ }
202
+ #formatPercent(pct) {
203
+ const sign = pct > 0 ? "+" : "";
204
+ return `${sign}${pct.toFixed(2)}%`;
205
+ }
206
+ #changeClass(value) {
207
+ if (value > 0)
208
+ return "positive";
209
+ if (value < 0)
210
+ return "negative";
211
+ return "neutral";
212
+ }
213
+ #renderArrow(change) {
214
+ if (change === 0)
215
+ return nothing;
216
+ const path = change > 0
217
+ ? "M12 19V5M5 12l7-7 7 7" // up arrow
218
+ : "M12 5v14M19 12l-7 7-7-7"; // down arrow
219
+ return html `
220
+ <span class="arrow">
221
+ <svg width="12" height="12" viewBox="0 0 24 24" fill="none"
222
+ stroke="currentColor" stroke-width="2.5" stroke-linecap="round"
223
+ stroke-linejoin="round"><path d="${path}"/></svg>
224
+ </span>
225
+ `;
226
+ }
227
+ render() {
228
+ if (this.data.length === 0) {
229
+ return html `<div class="empty">${this.emptyText}</div>`;
230
+ }
231
+ return html `
232
+ <table part="table">
233
+ <thead part="thead">
234
+ <tr>
235
+ <th>Symbol</th>
236
+ <th class="align-end">Price</th>
237
+ <th class="align-end">Change</th>
238
+ <th class="align-end">%</th>
239
+ </tr>
240
+ </thead>
241
+ <tbody part="tbody">
242
+ ${this.data.map(row => {
243
+ const cls = this.#changeClass(row.change);
244
+ return html `
245
+ <tr>
246
+ <td>
247
+ <span class="symbol">${row.symbol}</span>${row.name
248
+ ? html `<span class="name">${row.name}</span>`
249
+ : nothing}
250
+ </td>
251
+ <td class="price">${this.#formatPrice(row.price)}</td>
252
+ <td class="change ${cls}">
253
+ ${this.#renderArrow(row.change)}${this.#formatChange(row.change)}
254
+ </td>
255
+ <td class="pct ${cls}">${this.#formatPercent(row.changePercent)}</td>
256
+ </tr>
257
+ `;
258
+ })}
259
+ </tbody>
260
+ </table>
261
+ `;
262
+ }
263
+ constructor() {
264
+ super(...arguments);
265
+ __runInitializers(this, _emptyText_extraInitializers);
266
+ }
267
+ };
268
+ })();
269
+ export { DuiMarketTable };
270
+ customElements.define(DuiMarketTable.tagName, DuiMarketTable);
@@ -0,0 +1,35 @@
1
+ import { LitElement, type TemplateResult } from "lit";
2
+ import "@deepfuture/dui-components/badge";
3
+ /**
4
+ * `<dui-activity-item>` — A timestamped event in a vertical timeline.
5
+ *
6
+ * Renders a timeline dot + connecting line on the left, with a title,
7
+ * timestamp, optional description, and optional status badge on the right.
8
+ * The dot is a pseudo-element of the header row so it always aligns with
9
+ * the title text. Stack multiple activity-items to form a timeline. Set
10
+ * `last` on the final item to hide the trailing line.
11
+ *
12
+ * @slot actions - Optional action buttons or links.
13
+ * @csspart article - The outer container.
14
+ * @csspart title - The event title.
15
+ * @csspart timestamp - The timestamp text.
16
+ * @csspart description - The description paragraph.
17
+ */
18
+ export declare class DuiActivityItem extends LitElement {
19
+ #private;
20
+ static tagName: "dui-activity-item";
21
+ static styles: import("lit").CSSResult[];
22
+ /** Event title. */
23
+ accessor title: string;
24
+ /** Display timestamp (e.g. "2 min ago", "14:23 UTC"). */
25
+ accessor timestamp: string;
26
+ /** Optional description text. */
27
+ accessor description: string;
28
+ /** Status — determines dot color (success | error | warning | info | pending). */
29
+ accessor status: string;
30
+ /** Optional status label — renders as a badge next to the title. */
31
+ accessor statusLabel: string;
32
+ /** Mark as the last item to hide the trailing timeline line. */
33
+ accessor last: boolean;
34
+ render(): TemplateResult;
35
+ }