@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.
- package/README.md +214 -0
- package/all.d.ts +10 -0
- package/all.js +20 -0
- package/content/briefing-block.d.ts +36 -0
- package/content/briefing-block.js +281 -0
- package/content/empty-state.d.ts +24 -0
- package/content/empty-state.js +187 -0
- package/content/index.d.ts +5 -0
- package/content/index.js +5 -0
- package/content/numbered-insight.d.ts +30 -0
- package/content/numbered-insight.js +242 -0
- package/dashboard/index.d.ts +5 -0
- package/dashboard/index.js +5 -0
- package/dashboard/page-header.d.ts +29 -0
- package/dashboard/page-header.js +218 -0
- package/dashboard/section-panel.d.ts +41 -0
- package/dashboard/section-panel.js +393 -0
- package/data/index.d.ts +5 -0
- package/data/index.js +4 -0
- package/data/key-value.d.ts +27 -0
- package/data/key-value.js +165 -0
- package/data/market-table.d.ts +40 -0
- package/data/market-table.js +270 -0
- package/feed/activity-item.d.ts +35 -0
- package/feed/activity-item.js +278 -0
- package/feed/feed-item.d.ts +32 -0
- package/feed/feed-item.js +260 -0
- package/feed/headline-item.d.ts +27 -0
- package/feed/headline-item.js +187 -0
- package/feed/index.d.ts +6 -0
- package/feed/index.js +6 -0
- package/feed/social-post.d.ts +31 -0
- package/feed/social-post.js +268 -0
- package/media/avatar-row.d.ts +31 -0
- package/media/avatar-row.js +164 -0
- package/media/index.d.ts +7 -0
- package/media/index.js +5 -0
- package/media/media-grid.d.ts +32 -0
- package/media/media-grid.js +199 -0
- package/metrics/index.d.ts +6 -0
- package/metrics/index.js +6 -0
- package/metrics/progress-bar.d.ts +31 -0
- package/metrics/progress-bar.js +212 -0
- package/metrics/risk-gauge.d.ts +31 -0
- package/metrics/risk-gauge.js +289 -0
- package/metrics/score-item.d.ts +33 -0
- package/metrics/score-item.js +253 -0
- package/metrics/stat-card.d.ts +29 -0
- package/metrics/stat-card.js +230 -0
- package/package.json +61 -0
|
@@ -0,0 +1,187 @@
|
|
|
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
|
+
.container {
|
|
45
|
+
display: flex;
|
|
46
|
+
flex-direction: column;
|
|
47
|
+
align-items: center;
|
|
48
|
+
justify-content: center;
|
|
49
|
+
text-align: center;
|
|
50
|
+
gap: var(--space-3);
|
|
51
|
+
padding: var(--space-10) var(--space-6);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.icon-wrapper {
|
|
55
|
+
--icon-size: 2.5rem;
|
|
56
|
+
--icon-color: var(--text-3);
|
|
57
|
+
opacity: 0.5;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.text {
|
|
61
|
+
display: flex;
|
|
62
|
+
flex-direction: column;
|
|
63
|
+
gap: var(--space-1);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.heading {
|
|
67
|
+
font-family: var(--font-sans);
|
|
68
|
+
font-size: var(--text-sm);
|
|
69
|
+
font-weight: var(--font-weight-medium);
|
|
70
|
+
letter-spacing: var(--letter-spacing-wide);
|
|
71
|
+
line-height: var(--line-height-snug);
|
|
72
|
+
color: var(--text-1);
|
|
73
|
+
margin: 0;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.description {
|
|
77
|
+
font-family: var(--font-sans);
|
|
78
|
+
font-size: var(--text-xs);
|
|
79
|
+
letter-spacing: var(--letter-spacing-wide);
|
|
80
|
+
line-height: var(--line-height-normal);
|
|
81
|
+
color: var(--text-3);
|
|
82
|
+
margin: 0;
|
|
83
|
+
max-width: 28rem;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.actions {
|
|
87
|
+
display: flex;
|
|
88
|
+
align-items: center;
|
|
89
|
+
gap: var(--space-2);
|
|
90
|
+
padding-top: var(--space-1);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.actions[hidden] {
|
|
94
|
+
display: none;
|
|
95
|
+
}
|
|
96
|
+
`;
|
|
97
|
+
/**
|
|
98
|
+
* `<dui-empty-state>` — A centered placeholder for no-data panels.
|
|
99
|
+
*
|
|
100
|
+
* Use inside section panels, tables, or lists when there's nothing to display.
|
|
101
|
+
* Shows an optional icon, heading, description, and action slot for a primary CTA.
|
|
102
|
+
*
|
|
103
|
+
* @slot icon - Custom icon content (overrides the default empty-box icon).
|
|
104
|
+
* @slot actions - Primary call-to-action button(s).
|
|
105
|
+
* @csspart container - The outer centered container.
|
|
106
|
+
* @csspart heading - The heading text.
|
|
107
|
+
* @csspart description - The description text.
|
|
108
|
+
*/
|
|
109
|
+
let DuiEmptyState = (() => {
|
|
110
|
+
let _classSuper = LitElement;
|
|
111
|
+
let _heading_decorators;
|
|
112
|
+
let _heading_initializers = [];
|
|
113
|
+
let _heading_extraInitializers = [];
|
|
114
|
+
let _description_decorators;
|
|
115
|
+
let _description_initializers = [];
|
|
116
|
+
let _description_extraInitializers = [];
|
|
117
|
+
return class DuiEmptyState extends _classSuper {
|
|
118
|
+
static {
|
|
119
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
120
|
+
_heading_decorators = [property()];
|
|
121
|
+
_description_decorators = [property()];
|
|
122
|
+
__esDecorate(this, null, _heading_decorators, { kind: "accessor", name: "heading", static: false, private: false, access: { has: obj => "heading" in obj, get: obj => obj.heading, set: (obj, value) => { obj.heading = value; } }, metadata: _metadata }, _heading_initializers, _heading_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
|
+
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
125
|
+
}
|
|
126
|
+
static tagName = "dui-empty-state";
|
|
127
|
+
static styles = [base, styles];
|
|
128
|
+
#heading_accessor_storage = __runInitializers(this, _heading_initializers, "");
|
|
129
|
+
/** Primary heading text (e.g. "No events yet"). */
|
|
130
|
+
get heading() { return this.#heading_accessor_storage; }
|
|
131
|
+
set heading(value) { this.#heading_accessor_storage = value; }
|
|
132
|
+
#description_accessor_storage = (__runInitializers(this, _heading_extraInitializers), __runInitializers(this, _description_initializers, ""));
|
|
133
|
+
/** Supporting description text. */
|
|
134
|
+
get description() { return this.#description_accessor_storage; }
|
|
135
|
+
set description(value) { this.#description_accessor_storage = value; }
|
|
136
|
+
/** Toggle hidden on slot wrapper when slotted content changes. */
|
|
137
|
+
#onSlotChange(e) {
|
|
138
|
+
const slot = e.target;
|
|
139
|
+
slot.parentElement.hidden = slot.assignedElements().length === 0;
|
|
140
|
+
}
|
|
141
|
+
/** Track whether an icon has been slotted. */
|
|
142
|
+
#hasIconSlot = (__runInitializers(this, _description_extraInitializers), false);
|
|
143
|
+
#onIconSlotChange(e) {
|
|
144
|
+
const slot = e.target;
|
|
145
|
+
this.#hasIconSlot = slot.assignedElements().length > 0;
|
|
146
|
+
this.requestUpdate();
|
|
147
|
+
}
|
|
148
|
+
render() {
|
|
149
|
+
// Default icon: an inbox/package box
|
|
150
|
+
const defaultIcon = html `
|
|
151
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
|
|
152
|
+
<path d="M20 7.5c0-1-2.5-3-5-3s-5 2-5 3"/>
|
|
153
|
+
<path d="M20 7.5v9l-5 3.5-5-3.5v-9"/>
|
|
154
|
+
<path d="M10 7.5 15 11l5-3.5"/>
|
|
155
|
+
<path d="M15 11v7"/>
|
|
156
|
+
<rect x="2" y="2" width="6" height="6" rx="1"/>
|
|
157
|
+
<path d="M2 10v10c0 .6.4 1 1 1h4c.6 0 1-.4 1-1V10"/>
|
|
158
|
+
</svg>`;
|
|
159
|
+
return html `
|
|
160
|
+
<div class="container" part="container">
|
|
161
|
+
<div class="icon-wrapper">
|
|
162
|
+
<dui-icon>
|
|
163
|
+
<slot name="icon" @slotchange=${this.#onIconSlotChange}>
|
|
164
|
+
${!this.#hasIconSlot ? defaultIcon : nothing}
|
|
165
|
+
</slot>
|
|
166
|
+
</dui-icon>
|
|
167
|
+
</div>
|
|
168
|
+
|
|
169
|
+
<div class="text">
|
|
170
|
+
${this.heading
|
|
171
|
+
? html `<p class="heading" part="heading">${this.heading}</p>`
|
|
172
|
+
: nothing}
|
|
173
|
+
${this.description
|
|
174
|
+
? html `<p class="description" part="description">${this.description}</p>`
|
|
175
|
+
: nothing}
|
|
176
|
+
</div>
|
|
177
|
+
|
|
178
|
+
<div class="actions" hidden>
|
|
179
|
+
<slot name="actions" @slotchange=${this.#onSlotChange}></slot>
|
|
180
|
+
</div>
|
|
181
|
+
</div>
|
|
182
|
+
`;
|
|
183
|
+
}
|
|
184
|
+
};
|
|
185
|
+
})();
|
|
186
|
+
export { DuiEmptyState };
|
|
187
|
+
customElements.define(DuiEmptyState.tagName, DuiEmptyState);
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { DuiBriefingBlock } from "./briefing-block.js";
|
|
2
|
+
import { DuiEmptyState } from "./empty-state.js";
|
|
3
|
+
import { DuiNumberedInsight } from "./numbered-insight.js";
|
|
4
|
+
export { DuiBriefingBlock, DuiEmptyState, DuiNumberedInsight };
|
|
5
|
+
export declare const contentFamily: (typeof DuiBriefingBlock | typeof DuiEmptyState | typeof DuiNumberedInsight)[];
|
package/content/index.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { DuiBriefingBlock } from "./briefing-block.js";
|
|
2
|
+
import { DuiEmptyState } from "./empty-state.js";
|
|
3
|
+
import { DuiNumberedInsight } from "./numbered-insight.js";
|
|
4
|
+
export { DuiBriefingBlock, DuiEmptyState, DuiNumberedInsight };
|
|
5
|
+
export const contentFamily = [DuiBriefingBlock, DuiEmptyState, DuiNumberedInsight];
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { LitElement, type TemplateResult } from "lit";
|
|
2
|
+
import "@deepfuture/dui-components/badge";
|
|
3
|
+
/**
|
|
4
|
+
* `<dui-numbered-insight>` — An ordinal-numbered insight with title, badges, and description.
|
|
5
|
+
*
|
|
6
|
+
* Use for ranked findings, prioritized recommendations, or numbered takeaways
|
|
7
|
+
* in analysis panels. The ordinal number renders in a tinted circle for emphasis.
|
|
8
|
+
*
|
|
9
|
+
* @slot actions - Optional action buttons or links.
|
|
10
|
+
* @csspart article - The outer container.
|
|
11
|
+
* @csspart ordinal - The numbered circle.
|
|
12
|
+
* @csspart title - The insight title.
|
|
13
|
+
* @csspart description - The description text.
|
|
14
|
+
*/
|
|
15
|
+
export declare class DuiNumberedInsight extends LitElement {
|
|
16
|
+
#private;
|
|
17
|
+
static tagName: "dui-numbered-insight";
|
|
18
|
+
static styles: import("lit").CSSResult[];
|
|
19
|
+
/** Ordinal number (e.g. 1, 2, 3). */
|
|
20
|
+
accessor ordinal: number;
|
|
21
|
+
/** Primary insight title. */
|
|
22
|
+
accessor title: string;
|
|
23
|
+
/** Category label — renders as a neutral badge. */
|
|
24
|
+
accessor category: string;
|
|
25
|
+
/** Severity level — maps to badge variant (critical | high | medium | low). */
|
|
26
|
+
accessor severity: string;
|
|
27
|
+
/** Descriptive body text. */
|
|
28
|
+
accessor description: string;
|
|
29
|
+
render(): TemplateResult;
|
|
30
|
+
}
|
|
@@ -0,0 +1,242 @@
|
|
|
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/badge";
|
|
39
|
+
/** Severity → badge variant + appearance mapping. */
|
|
40
|
+
const SEVERITY_MAP = {
|
|
41
|
+
critical: { variant: "danger", appearance: "filled" },
|
|
42
|
+
high: { variant: "danger", appearance: "ghost" },
|
|
43
|
+
medium: { variant: "primary", appearance: "ghost" },
|
|
44
|
+
low: { variant: "neutral", appearance: "ghost" },
|
|
45
|
+
};
|
|
46
|
+
const styles = css `
|
|
47
|
+
:host {
|
|
48
|
+
display: block;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
article {
|
|
52
|
+
display: flex;
|
|
53
|
+
gap: var(--space-3);
|
|
54
|
+
padding: var(--space-3);
|
|
55
|
+
border: var(--border-width-thin) solid var(--border);
|
|
56
|
+
border-radius: var(--radius-md);
|
|
57
|
+
background: var(--surface-1);
|
|
58
|
+
transition: background var(--duration-fast) ease;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
article:hover {
|
|
62
|
+
background: var(--surface-2);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.ordinal {
|
|
66
|
+
display: flex;
|
|
67
|
+
align-items: center;
|
|
68
|
+
justify-content: center;
|
|
69
|
+
flex-shrink: 0;
|
|
70
|
+
width: var(--space-7);
|
|
71
|
+
height: var(--space-7);
|
|
72
|
+
border-radius: var(--radius-full);
|
|
73
|
+
background: var(--accent-subtle);
|
|
74
|
+
font-family: var(--font-sans);
|
|
75
|
+
font-size: var(--text-sm);
|
|
76
|
+
font-weight: var(--font-weight-semibold);
|
|
77
|
+
color: var(--accent-text);
|
|
78
|
+
line-height: var(--line-height-none);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.content {
|
|
82
|
+
display: flex;
|
|
83
|
+
flex-direction: column;
|
|
84
|
+
gap: var(--space-1);
|
|
85
|
+
flex: 1;
|
|
86
|
+
min-width: 0;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.title-row {
|
|
90
|
+
display: flex;
|
|
91
|
+
align-items: center;
|
|
92
|
+
gap: var(--space-2);
|
|
93
|
+
min-width: 0;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.title {
|
|
97
|
+
font-family: var(--font-sans);
|
|
98
|
+
font-size: var(--text-sm);
|
|
99
|
+
font-weight: var(--font-weight-semibold);
|
|
100
|
+
letter-spacing: var(--letter-spacing-wide);
|
|
101
|
+
line-height: var(--line-height-snug);
|
|
102
|
+
color: var(--foreground);
|
|
103
|
+
flex: 1;
|
|
104
|
+
min-width: 0;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.badges {
|
|
108
|
+
display: flex;
|
|
109
|
+
align-items: center;
|
|
110
|
+
gap: var(--space-1_5);
|
|
111
|
+
flex-shrink: 0;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.description {
|
|
115
|
+
font-family: var(--font-sans);
|
|
116
|
+
font-size: var(--text-sm);
|
|
117
|
+
letter-spacing: var(--letter-spacing-wide);
|
|
118
|
+
line-height: var(--line-height-relaxed);
|
|
119
|
+
color: var(--text-2);
|
|
120
|
+
margin: 0;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.actions {
|
|
124
|
+
display: flex;
|
|
125
|
+
align-items: center;
|
|
126
|
+
gap: var(--space-2);
|
|
127
|
+
padding-top: var(--space-1);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.actions[hidden] {
|
|
131
|
+
display: none;
|
|
132
|
+
}
|
|
133
|
+
`;
|
|
134
|
+
/**
|
|
135
|
+
* `<dui-numbered-insight>` — An ordinal-numbered insight with title, badges, and description.
|
|
136
|
+
*
|
|
137
|
+
* Use for ranked findings, prioritized recommendations, or numbered takeaways
|
|
138
|
+
* in analysis panels. The ordinal number renders in a tinted circle for emphasis.
|
|
139
|
+
*
|
|
140
|
+
* @slot actions - Optional action buttons or links.
|
|
141
|
+
* @csspart article - The outer container.
|
|
142
|
+
* @csspart ordinal - The numbered circle.
|
|
143
|
+
* @csspart title - The insight title.
|
|
144
|
+
* @csspart description - The description text.
|
|
145
|
+
*/
|
|
146
|
+
let DuiNumberedInsight = (() => {
|
|
147
|
+
let _classSuper = LitElement;
|
|
148
|
+
let _ordinal_decorators;
|
|
149
|
+
let _ordinal_initializers = [];
|
|
150
|
+
let _ordinal_extraInitializers = [];
|
|
151
|
+
let _title_decorators;
|
|
152
|
+
let _title_initializers = [];
|
|
153
|
+
let _title_extraInitializers = [];
|
|
154
|
+
let _category_decorators;
|
|
155
|
+
let _category_initializers = [];
|
|
156
|
+
let _category_extraInitializers = [];
|
|
157
|
+
let _severity_decorators;
|
|
158
|
+
let _severity_initializers = [];
|
|
159
|
+
let _severity_extraInitializers = [];
|
|
160
|
+
let _description_decorators;
|
|
161
|
+
let _description_initializers = [];
|
|
162
|
+
let _description_extraInitializers = [];
|
|
163
|
+
return class DuiNumberedInsight extends _classSuper {
|
|
164
|
+
static {
|
|
165
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
166
|
+
_ordinal_decorators = [property({ type: Number })];
|
|
167
|
+
_title_decorators = [property()];
|
|
168
|
+
_category_decorators = [property()];
|
|
169
|
+
_severity_decorators = [property()];
|
|
170
|
+
_description_decorators = [property()];
|
|
171
|
+
__esDecorate(this, null, _ordinal_decorators, { kind: "accessor", name: "ordinal", static: false, private: false, access: { has: obj => "ordinal" in obj, get: obj => obj.ordinal, set: (obj, value) => { obj.ordinal = value; } }, metadata: _metadata }, _ordinal_initializers, _ordinal_extraInitializers);
|
|
172
|
+
__esDecorate(this, null, _title_decorators, { kind: "accessor", name: "title", static: false, private: false, access: { has: obj => "title" in obj, get: obj => obj.title, set: (obj, value) => { obj.title = value; } }, metadata: _metadata }, _title_initializers, _title_extraInitializers);
|
|
173
|
+
__esDecorate(this, null, _category_decorators, { kind: "accessor", name: "category", static: false, private: false, access: { has: obj => "category" in obj, get: obj => obj.category, set: (obj, value) => { obj.category = value; } }, metadata: _metadata }, _category_initializers, _category_extraInitializers);
|
|
174
|
+
__esDecorate(this, null, _severity_decorators, { kind: "accessor", name: "severity", static: false, private: false, access: { has: obj => "severity" in obj, get: obj => obj.severity, set: (obj, value) => { obj.severity = value; } }, metadata: _metadata }, _severity_initializers, _severity_extraInitializers);
|
|
175
|
+
__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);
|
|
176
|
+
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
177
|
+
}
|
|
178
|
+
static tagName = "dui-numbered-insight";
|
|
179
|
+
static styles = [base, styles];
|
|
180
|
+
#ordinal_accessor_storage = __runInitializers(this, _ordinal_initializers, 1);
|
|
181
|
+
/** Ordinal number (e.g. 1, 2, 3). */
|
|
182
|
+
get ordinal() { return this.#ordinal_accessor_storage; }
|
|
183
|
+
set ordinal(value) { this.#ordinal_accessor_storage = value; }
|
|
184
|
+
#title_accessor_storage = (__runInitializers(this, _ordinal_extraInitializers), __runInitializers(this, _title_initializers, ""));
|
|
185
|
+
/** Primary insight title. */
|
|
186
|
+
get title() { return this.#title_accessor_storage; }
|
|
187
|
+
set title(value) { this.#title_accessor_storage = value; }
|
|
188
|
+
#category_accessor_storage = (__runInitializers(this, _title_extraInitializers), __runInitializers(this, _category_initializers, ""));
|
|
189
|
+
/** Category label — renders as a neutral badge. */
|
|
190
|
+
get category() { return this.#category_accessor_storage; }
|
|
191
|
+
set category(value) { this.#category_accessor_storage = value; }
|
|
192
|
+
#severity_accessor_storage = (__runInitializers(this, _category_extraInitializers), __runInitializers(this, _severity_initializers, ""));
|
|
193
|
+
/** Severity level — maps to badge variant (critical | high | medium | low). */
|
|
194
|
+
get severity() { return this.#severity_accessor_storage; }
|
|
195
|
+
set severity(value) { this.#severity_accessor_storage = value; }
|
|
196
|
+
#description_accessor_storage = (__runInitializers(this, _severity_extraInitializers), __runInitializers(this, _description_initializers, ""));
|
|
197
|
+
/** Descriptive body text. */
|
|
198
|
+
get description() { return this.#description_accessor_storage; }
|
|
199
|
+
set description(value) { this.#description_accessor_storage = value; }
|
|
200
|
+
/** Toggle hidden on slot wrapper when slotted content changes. */
|
|
201
|
+
#onSlotChange(e) {
|
|
202
|
+
const slot = e.target;
|
|
203
|
+
slot.parentElement.hidden = slot.assignedElements().length === 0;
|
|
204
|
+
}
|
|
205
|
+
render() {
|
|
206
|
+
const sev = SEVERITY_MAP[this.severity.toLowerCase()];
|
|
207
|
+
return html `
|
|
208
|
+
<article part="article">
|
|
209
|
+
<span class="ordinal" part="ordinal">${this.ordinal}</span>
|
|
210
|
+
|
|
211
|
+
<div class="content">
|
|
212
|
+
<div class="title-row">
|
|
213
|
+
<span class="title" part="title">${this.title}</span>
|
|
214
|
+
<div class="badges">
|
|
215
|
+
${this.category
|
|
216
|
+
? html `<dui-badge appearance="soft">${this.category}</dui-badge>`
|
|
217
|
+
: nothing}
|
|
218
|
+
${sev
|
|
219
|
+
? html `<dui-badge variant=${sev.variant} appearance=${sev.appearance}>${this.severity}</dui-badge>`
|
|
220
|
+
: nothing}
|
|
221
|
+
</div>
|
|
222
|
+
</div>
|
|
223
|
+
|
|
224
|
+
${this.description
|
|
225
|
+
? html `<p class="description" part="description">${this.description}</p>`
|
|
226
|
+
: nothing}
|
|
227
|
+
|
|
228
|
+
<div class="actions" hidden>
|
|
229
|
+
<slot name="actions" @slotchange=${this.#onSlotChange}></slot>
|
|
230
|
+
</div>
|
|
231
|
+
</div>
|
|
232
|
+
</article>
|
|
233
|
+
`;
|
|
234
|
+
}
|
|
235
|
+
constructor() {
|
|
236
|
+
super(...arguments);
|
|
237
|
+
__runInitializers(this, _description_extraInitializers);
|
|
238
|
+
}
|
|
239
|
+
};
|
|
240
|
+
})();
|
|
241
|
+
export { DuiNumberedInsight };
|
|
242
|
+
customElements.define(DuiNumberedInsight.tagName, DuiNumberedInsight);
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { LitElement, type TemplateResult } from "lit";
|
|
2
|
+
import "@deepfuture/dui-components/separator";
|
|
3
|
+
/**
|
|
4
|
+
* `<dui-page-header>` — Full-width top bar for dashboard pages.
|
|
5
|
+
*
|
|
6
|
+
* Renders an optional breadcrumb trail, a title, an optional subtitle,
|
|
7
|
+
* and trailing action buttons. A separator is rendered at the bottom.
|
|
8
|
+
*
|
|
9
|
+
* The `breadcrumbs` prop accepts a comma-separated string. The last segment
|
|
10
|
+
* is rendered as the current page; preceding segments render as links.
|
|
11
|
+
*
|
|
12
|
+
* @slot actions - Trailing action buttons or controls.
|
|
13
|
+
* @csspart header - The outer `<header>` container.
|
|
14
|
+
* @csspart breadcrumb - The breadcrumb navigation.
|
|
15
|
+
* @csspart title - The page title.
|
|
16
|
+
* @csspart subtitle - The subtitle paragraph.
|
|
17
|
+
*/
|
|
18
|
+
export declare class DuiPageHeader extends LitElement {
|
|
19
|
+
#private;
|
|
20
|
+
static tagName: "dui-page-header";
|
|
21
|
+
static styles: import("lit").CSSResult[];
|
|
22
|
+
/** Page title displayed prominently. */
|
|
23
|
+
accessor title: string;
|
|
24
|
+
/** Supporting text below the title. */
|
|
25
|
+
accessor subtitle: string;
|
|
26
|
+
/** Comma-separated breadcrumb trail (e.g. "Home, Settings, Profile"). */
|
|
27
|
+
accessor breadcrumbs: string;
|
|
28
|
+
render(): TemplateResult;
|
|
29
|
+
}
|