@aquera/nile-visualization 2.9.20 → 2.9.22
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 +8 -0
- package/dist/src/index.d.ts +8 -2
- package/dist/src/index.js +3 -0
- package/dist/src/internal/types/chart-config.type.d.ts +3 -1
- package/dist/src/internal/types/chart-list-config.type.d.ts +25 -0
- package/dist/src/internal/types/chart-list-config.type.js +2 -0
- package/dist/src/internal/types/chart-master-detail-config.type.d.ts +38 -0
- package/dist/src/internal/types/chart-master-detail-config.type.js +2 -0
- package/dist/src/internal/types/chart-message-config.type.d.ts +9 -0
- package/dist/src/internal/types/chart-message-config.type.js +2 -0
- package/dist/src/internal/types/index.d.ts +1 -0
- package/dist/src/internal/types/primitive-chart-config.type.d.ts +2 -1
- package/dist/src/nile-chart/index.d.ts +2 -2
- package/dist/src/nile-chart/nile-chart-config.d.ts +45 -1
- package/dist/src/nile-chart/nile-chart-skeleton.js +1 -1
- package/dist/src/nile-chart/nile-chart.css.js +1 -0
- package/dist/src/nile-chart/nile-chart.d.ts +9 -0
- package/dist/src/nile-chart/nile-chart.js +99 -1
- package/dist/src/nile-chart-list/index.d.ts +2 -0
- package/dist/src/nile-chart-list/index.js +2 -0
- package/dist/src/nile-chart-list/nile-chart-list.css.d.ts +12 -0
- package/dist/src/nile-chart-list/nile-chart-list.css.js +126 -0
- package/dist/src/nile-chart-list/nile-chart-list.d.ts +60 -0
- package/dist/src/nile-chart-list/nile-chart-list.js +187 -0
- package/dist/src/nile-chart-message/index.d.ts +2 -0
- package/dist/src/nile-chart-message/index.js +2 -0
- package/dist/src/nile-chart-message/nile-chart-message.css.d.ts +12 -0
- package/dist/src/nile-chart-message/nile-chart-message.css.js +108 -0
- package/dist/src/nile-chart-message/nile-chart-message.d.ts +35 -0
- package/dist/src/nile-chart-message/nile-chart-message.js +116 -0
- package/dist/src/nile-master-detail-chart/index.d.ts +2 -0
- package/dist/src/nile-master-detail-chart/index.js +2 -0
- package/dist/src/nile-master-detail-chart/nile-master-detail-chart.css.d.ts +1 -0
- package/dist/src/nile-master-detail-chart/nile-master-detail-chart.css.js +95 -0
- package/dist/src/nile-master-detail-chart/nile-master-detail-chart.d.ts +93 -0
- package/dist/src/nile-master-detail-chart/nile-master-detail-chart.js +604 -0
- package/package.json +6 -3
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Aquera Inc 2026
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the BSD-3-Clause license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import { css } from 'lit';
|
|
8
|
+
/**
|
|
9
|
+
* Chart List CSS
|
|
10
|
+
*/
|
|
11
|
+
export const styles = css `
|
|
12
|
+
:host {
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
-webkit-font-smoothing: var(--nile-webkit-font-smoothing, var(--ng-webkit-font-smoothing));
|
|
16
|
+
-moz-osx-font-smoothing: var(--nile-moz-osx-font-smoothing, var(--ng-moz-osx-font-smoothing));
|
|
17
|
+
text-rendering: var(--nile-text-rendering, var(--ng-text-rendering));
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.list {
|
|
21
|
+
list-style: none;
|
|
22
|
+
margin: var(--nile-spacing-none, var(--ng-spacing-none));
|
|
23
|
+
padding: var(--nile-spacing-none, var(--ng-spacing-none));
|
|
24
|
+
display: flex;
|
|
25
|
+
flex-direction: column;
|
|
26
|
+
gap: var(--nile-spacing-md, var(--ng-spacing-md));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.item {
|
|
30
|
+
display: flex;
|
|
31
|
+
align-items: flex-start;
|
|
32
|
+
gap: var(--nile-spacing-md, var(--ng-spacing-md));
|
|
33
|
+
padding: var(--nile-spacing-sm, var(--ng-spacing-sm))
|
|
34
|
+
var(--nile-spacing-md, var(--ng-spacing-md));
|
|
35
|
+
border-radius: var(--nile-radius-radius-md, var(--ng-radius-md));
|
|
36
|
+
cursor: pointer;
|
|
37
|
+
color: var(--nile-colors-dark-900, var(--ng-colors-fg-primary-900));
|
|
38
|
+
transition: background-color
|
|
39
|
+
var(--nile-transition-duration-default, var(--ng-transition-duration-fast))
|
|
40
|
+
ease;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.item:hover {
|
|
44
|
+
background-color: var(
|
|
45
|
+
--nile-colors-neutral-100,
|
|
46
|
+
var(--ng-colors-bg-secondary)
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.item--disabled {
|
|
51
|
+
cursor: not-allowed;
|
|
52
|
+
opacity: var(--nile-opacity-50, var(--ng-opacity-50));
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.item--disabled:hover {
|
|
56
|
+
background-color: transparent;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.item__content {
|
|
60
|
+
display: flex;
|
|
61
|
+
flex-direction: column;
|
|
62
|
+
min-width: var(--nile-width-none, var(--ng-width-0));
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.item__label {
|
|
66
|
+
font-weight: var(--nile-font-weight-medium, var(--ng-font-weight-medium));
|
|
67
|
+
line-height: var(--nile-line-height-small, var(--ng-line-height-text-sm));
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.item__sub-label {
|
|
71
|
+
font-size: var(--nile-type-scale-2, var(--ng-font-size-text-xs));
|
|
72
|
+
line-height: var(--nile-line-height-xsmall, var(--ng-line-height-text-xs));
|
|
73
|
+
color: var(--nile-colors-dark-900, var(--ng-colors-fg-secondary-700));
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.item__description {
|
|
77
|
+
font-size: var(--nile-type-scale-2, var(--ng-font-size-text-xs));
|
|
78
|
+
line-height: var(--nile-line-height-xsmall, var(--ng-line-height-text-xs));
|
|
79
|
+
color: var(--nile-colors-dark-900, var(--ng-colors-fg-secondary-700));
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.marker {
|
|
83
|
+
flex: 0 0 auto;
|
|
84
|
+
display: inline-flex;
|
|
85
|
+
align-items: center;
|
|
86
|
+
justify-content: center;
|
|
87
|
+
min-height: var(--nile-line-height-small, var(--ng-line-height-text-sm));
|
|
88
|
+
line-height: var(--nile-line-height-small, var(--ng-line-height-text-sm));
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/* Bullet/number variants rely on the native <ul>/<ol> list markers */
|
|
92
|
+
.list--bullet,
|
|
93
|
+
.list--number {
|
|
94
|
+
padding-inline-start: var(--nile-spacing-xl, var(--ng-spacing-xl));
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.list--bullet .item,
|
|
98
|
+
.list--number .item {
|
|
99
|
+
display: list-item;
|
|
100
|
+
list-style-position: outside;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.list--bullet .item {
|
|
104
|
+
list-style-type: disc;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.list--number .item {
|
|
108
|
+
list-style-type: decimal;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.list--bullet .item::marker,
|
|
112
|
+
.list--number .item::marker {
|
|
113
|
+
color: var(--nile-colors-dark-900, var(--ng-colors-fg-primary-900));
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.list--bullet .item::marker {
|
|
117
|
+
font-size: var(--nile-type-scale-5, var(--ng-font-size-text-lg));
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.list--number .item::marker {
|
|
121
|
+
font-size: var(--nile-type-scale-3, var(--ng-font-size-text-sm));
|
|
122
|
+
font-variant-numeric: tabular-nums;
|
|
123
|
+
}
|
|
124
|
+
`;
|
|
125
|
+
export default [styles];
|
|
126
|
+
//# sourceMappingURL=nile-chart-list.css.js.map
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Aquera Inc 2026
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the BSD-3-Clause license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import { CSSResultArray, TemplateResult } from 'lit';
|
|
8
|
+
import NileElement from '../internal/nile-element.js';
|
|
9
|
+
export type ChartListVariant = 'plain' | 'bullet' | 'number' | 'icon' | 'checkbox';
|
|
10
|
+
export interface ChartListItem {
|
|
11
|
+
label: string;
|
|
12
|
+
subLabel?: string;
|
|
13
|
+
description?: string;
|
|
14
|
+
iconName?: string;
|
|
15
|
+
checked?: boolean;
|
|
16
|
+
value?: string;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
color?: string;
|
|
19
|
+
allowHtml?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface ChartListMarker {
|
|
22
|
+
size?: number;
|
|
23
|
+
color?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface ChartListConfig {
|
|
26
|
+
list: {
|
|
27
|
+
variant?: ChartListVariant;
|
|
28
|
+
items: ChartListItem[];
|
|
29
|
+
iconName?: string;
|
|
30
|
+
iconSize?: number;
|
|
31
|
+
marker?: ChartListMarker;
|
|
32
|
+
markerSize?: number;
|
|
33
|
+
markerColor?: string;
|
|
34
|
+
allowHtml?: boolean;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export declare class NileChartList extends NileElement {
|
|
38
|
+
static get styles(): CSSResultArray;
|
|
39
|
+
variant: ChartListVariant;
|
|
40
|
+
items: ChartListItem[];
|
|
41
|
+
iconName: string;
|
|
42
|
+
iconSize: number;
|
|
43
|
+
markerSize?: number;
|
|
44
|
+
markerColor?: string;
|
|
45
|
+
allowHtml: boolean;
|
|
46
|
+
set config(value: ChartListConfig | undefined);
|
|
47
|
+
private handleSlotClick;
|
|
48
|
+
private handleItemClick;
|
|
49
|
+
private handleCheckboxChange;
|
|
50
|
+
private renderMarker;
|
|
51
|
+
private renderContent;
|
|
52
|
+
private renderItem;
|
|
53
|
+
render(): TemplateResult;
|
|
54
|
+
}
|
|
55
|
+
export default NileChartList;
|
|
56
|
+
declare global {
|
|
57
|
+
interface HTMLElementTagNameMap {
|
|
58
|
+
'nile-chart-list': NileChartList;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Aquera Inc 2026
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the BSD-3-Clause license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import { __decorate } from "tslib";
|
|
8
|
+
import { html, nothing, } from 'lit';
|
|
9
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
10
|
+
import { unsafeHTML } from 'lit/directives/unsafe-html.js';
|
|
11
|
+
import { styles } from './nile-chart-list.css';
|
|
12
|
+
import NileElement from '../internal/nile-element.js';
|
|
13
|
+
let NileChartList = class NileChartList extends NileElement {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments);
|
|
16
|
+
this.variant = 'plain';
|
|
17
|
+
this.items = [];
|
|
18
|
+
this.iconName = '';
|
|
19
|
+
this.iconSize = 16;
|
|
20
|
+
this.allowHtml = false;
|
|
21
|
+
}
|
|
22
|
+
static get styles() {
|
|
23
|
+
return [styles];
|
|
24
|
+
}
|
|
25
|
+
set config(value) {
|
|
26
|
+
const list = value?.list;
|
|
27
|
+
if (!list)
|
|
28
|
+
return;
|
|
29
|
+
if (list.variant !== undefined)
|
|
30
|
+
this.variant = list.variant;
|
|
31
|
+
if (list.items !== undefined)
|
|
32
|
+
this.items = list.items;
|
|
33
|
+
if (list.iconName !== undefined)
|
|
34
|
+
this.iconName = list.iconName;
|
|
35
|
+
if (list.iconSize !== undefined)
|
|
36
|
+
this.iconSize = list.iconSize;
|
|
37
|
+
const size = list.marker?.size ?? list.markerSize;
|
|
38
|
+
const color = list.marker?.color ?? list.markerColor;
|
|
39
|
+
if (size !== undefined)
|
|
40
|
+
this.markerSize = size;
|
|
41
|
+
if (color !== undefined)
|
|
42
|
+
this.markerColor = color;
|
|
43
|
+
if (list.allowHtml !== undefined)
|
|
44
|
+
this.allowHtml = list.allowHtml;
|
|
45
|
+
}
|
|
46
|
+
handleSlotClick(e) {
|
|
47
|
+
const path = e.composedPath();
|
|
48
|
+
const listItem = path.find((n) => n?.tagName?.toLowerCase() === 'nile-list-item');
|
|
49
|
+
if (!listItem)
|
|
50
|
+
return;
|
|
51
|
+
const value = listItem.getAttribute('heading') ||
|
|
52
|
+
listItem.innerText ||
|
|
53
|
+
'';
|
|
54
|
+
this.emit('nile-click', { value });
|
|
55
|
+
}
|
|
56
|
+
handleItemClick(item, index) {
|
|
57
|
+
if (item.disabled)
|
|
58
|
+
return;
|
|
59
|
+
if (this.variant === 'checkbox')
|
|
60
|
+
return;
|
|
61
|
+
this.emit('nile-click', {
|
|
62
|
+
value: item.value ?? item.label,
|
|
63
|
+
label: item.label,
|
|
64
|
+
index,
|
|
65
|
+
checked: item.checked,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
handleCheckboxChange(item, index, e) {
|
|
69
|
+
if (item.disabled)
|
|
70
|
+
return;
|
|
71
|
+
item.checked = Boolean(e.detail?.checked ?? e.target?.checked);
|
|
72
|
+
this.requestUpdate();
|
|
73
|
+
this.emit('nile-change', {
|
|
74
|
+
value: item.value ?? item.label,
|
|
75
|
+
label: item.label,
|
|
76
|
+
index,
|
|
77
|
+
checked: item.checked,
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
renderMarker(item, index) {
|
|
81
|
+
const color = item.color ?? this.markerColor;
|
|
82
|
+
switch (this.variant) {
|
|
83
|
+
case 'bullet':
|
|
84
|
+
return html `${nothing}`;
|
|
85
|
+
case 'number':
|
|
86
|
+
return html `${nothing}`;
|
|
87
|
+
case 'icon':
|
|
88
|
+
return html `<nile-glyph
|
|
89
|
+
class="marker marker--icon"
|
|
90
|
+
part="marker"
|
|
91
|
+
name="${item.iconName || this.iconName}"
|
|
92
|
+
size="${this.markerSize ?? this.iconSize}"
|
|
93
|
+
color="${color || nothing}"
|
|
94
|
+
method="stroke"
|
|
95
|
+
></nile-glyph>`;
|
|
96
|
+
case 'checkbox':
|
|
97
|
+
return html `<nile-checkbox
|
|
98
|
+
class="marker marker--checkbox"
|
|
99
|
+
part="marker"
|
|
100
|
+
?checked="${item.checked}"
|
|
101
|
+
?disabled="${item.disabled}"
|
|
102
|
+
@nile-change="${(e) => this.handleCheckboxChange(item, index, e)}"
|
|
103
|
+
></nile-checkbox>`;
|
|
104
|
+
case 'plain':
|
|
105
|
+
default:
|
|
106
|
+
return html `${nothing}`;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
renderContent(value, item) {
|
|
110
|
+
return (item.allowHtml ?? this.allowHtml) ? unsafeHTML(value) : value;
|
|
111
|
+
}
|
|
112
|
+
renderItem(item, index) {
|
|
113
|
+
return html `
|
|
114
|
+
<li
|
|
115
|
+
class="item ${item.disabled ? 'item--disabled' : ''}"
|
|
116
|
+
part="item"
|
|
117
|
+
@click="${() => this.handleItemClick(item, index)}"
|
|
118
|
+
>
|
|
119
|
+
${this.renderMarker(item, index)}
|
|
120
|
+
<span class="item__content" part="item-content">
|
|
121
|
+
<span class="item__label" part="label"
|
|
122
|
+
>${this.renderContent(item.label, item)}</span
|
|
123
|
+
>
|
|
124
|
+
${item.subLabel
|
|
125
|
+
? html `<span class="item__sub-label" part="sub-label"
|
|
126
|
+
>${this.renderContent(item.subLabel, item)}</span
|
|
127
|
+
>`
|
|
128
|
+
: nothing}
|
|
129
|
+
${item.description
|
|
130
|
+
? html `<span class="item__description" part="description"
|
|
131
|
+
>${this.renderContent(item.description, item)}</span
|
|
132
|
+
>`
|
|
133
|
+
: nothing}
|
|
134
|
+
</span>
|
|
135
|
+
</li>
|
|
136
|
+
`;
|
|
137
|
+
}
|
|
138
|
+
render() {
|
|
139
|
+
if (this.items && this.items.length > 0) {
|
|
140
|
+
const items = this.items.map((item, index) => this.renderItem(item, index));
|
|
141
|
+
return this.variant === 'number'
|
|
142
|
+
? html `
|
|
143
|
+
<ol class="list list--${this.variant}" part="list">
|
|
144
|
+
${items}
|
|
145
|
+
</ol>
|
|
146
|
+
`
|
|
147
|
+
: html `
|
|
148
|
+
<ul class="list list--${this.variant}" part="list" role="list">
|
|
149
|
+
${items}
|
|
150
|
+
</ul>
|
|
151
|
+
`;
|
|
152
|
+
}
|
|
153
|
+
return html `
|
|
154
|
+
<slot @click="${this.handleSlotClick}"> </slot>
|
|
155
|
+
`;
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
__decorate([
|
|
159
|
+
property({ type: String, reflect: true })
|
|
160
|
+
], NileChartList.prototype, "variant", void 0);
|
|
161
|
+
__decorate([
|
|
162
|
+
property({ attribute: false })
|
|
163
|
+
], NileChartList.prototype, "items", void 0);
|
|
164
|
+
__decorate([
|
|
165
|
+
property({ type: String, attribute: true })
|
|
166
|
+
], NileChartList.prototype, "iconName", void 0);
|
|
167
|
+
__decorate([
|
|
168
|
+
property({ type: Number, attribute: true })
|
|
169
|
+
], NileChartList.prototype, "iconSize", void 0);
|
|
170
|
+
__decorate([
|
|
171
|
+
property({ type: Number, attribute: true })
|
|
172
|
+
], NileChartList.prototype, "markerSize", void 0);
|
|
173
|
+
__decorate([
|
|
174
|
+
property({ type: String, attribute: true })
|
|
175
|
+
], NileChartList.prototype, "markerColor", void 0);
|
|
176
|
+
__decorate([
|
|
177
|
+
property({ type: Boolean, attribute: true, reflect: true })
|
|
178
|
+
], NileChartList.prototype, "allowHtml", void 0);
|
|
179
|
+
__decorate([
|
|
180
|
+
property({ attribute: false })
|
|
181
|
+
], NileChartList.prototype, "config", null);
|
|
182
|
+
NileChartList = __decorate([
|
|
183
|
+
customElement('nile-chart-list')
|
|
184
|
+
], NileChartList);
|
|
185
|
+
export { NileChartList };
|
|
186
|
+
export default NileChartList;
|
|
187
|
+
//# sourceMappingURL=nile-chart-list.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Aquera Inc 2026
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the BSD-3-Clause license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* ChartMessage CSS
|
|
9
|
+
*/
|
|
10
|
+
export declare const styles: import("lit").CSSResult;
|
|
11
|
+
declare const _default: import("lit").CSSResult[];
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Aquera Inc 2026
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the BSD-3-Clause license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import { css } from 'lit';
|
|
8
|
+
/**
|
|
9
|
+
* ChartMessage CSS
|
|
10
|
+
*/
|
|
11
|
+
export const styles = css `
|
|
12
|
+
:host {
|
|
13
|
+
display: block;
|
|
14
|
+
width: 100%;
|
|
15
|
+
box-sizing: border-box;
|
|
16
|
+
min-width: var(--nile-sizes-width-xxs, var(--ng-width-80));
|
|
17
|
+
-webkit-font-smoothing: var(--nile-webkit-font-smoothing, var(--ng-webkit-font-smoothing));
|
|
18
|
+
-moz-osx-font-smoothing: var(--nile-moz-osx-font-smoothing, var(--ng-moz-osx-font-smoothing));
|
|
19
|
+
text-rendering: var(--nile-text-rendering, var(--ng-text-rendering));
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.parent__wrapper {
|
|
23
|
+
width: auto;
|
|
24
|
+
display: flex;
|
|
25
|
+
gap: var(--nile-spacing-lg, var(--ng-spacing-xl));
|
|
26
|
+
box-sizing: border-box;
|
|
27
|
+
padding: var(--nile-type-scale-4, var(--ng-spacing-xl));
|
|
28
|
+
word-wrap: break-word;
|
|
29
|
+
align-items: center;
|
|
30
|
+
border: var(--nile-border-width-1, var(--ng-border-width-1)) solid var(--nile-colors-dark-200, var(--ng-colors-border-secondary-alt));
|
|
31
|
+
border-radius: var(--nile-radius-lg, var(--ng-radius-xl));
|
|
32
|
+
box-shadow: var(--nile-box-shadow-none, var(--ng-shadow-none));
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.section--primary {
|
|
36
|
+
background-color: var(--nile-colors-neutral-100, var(--ng-componentcolors-utility-gray-100));
|
|
37
|
+
border-color: var(--nile-colors-neutral-500, var(--ng-componentcolors-utility-gray-500));
|
|
38
|
+
}
|
|
39
|
+
.section--primary .section__heading,
|
|
40
|
+
.section--primary .section__description {
|
|
41
|
+
color: var(--nile-colors-neutral-700, var(--ng-componentcolors-utility-gray-700));
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.section--success {
|
|
45
|
+
background-color: var(--nile-colors-green-100, var(--ng-componentcolors-utility-success-100));
|
|
46
|
+
border-color: var(--nile-colors-green-500, var(--ng-componentcolors-utility-success-500));
|
|
47
|
+
}
|
|
48
|
+
.section--success .section__heading,
|
|
49
|
+
.section--success .section__description {
|
|
50
|
+
color: var(--nile-colors-green-700, var(--ng-componentcolors-utility-success-700));
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.section--warning {
|
|
54
|
+
background-color: var(--nile-colors-yellow-100, var(--ng-componentcolors-utility-warning-100));
|
|
55
|
+
border-color: var(--nile-colors-yellow-500, var(--ng-componentcolors-utility-warning-500));
|
|
56
|
+
}
|
|
57
|
+
.section--warning .section__heading,
|
|
58
|
+
.section--warning .section__description {
|
|
59
|
+
color: var(--nile-colors-yellow-700, var(--ng-componentcolors-utility-warning-700));
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.section--error {
|
|
63
|
+
background-color: var(--nile-colors-red-100, var(--ng-componentcolors-utility-orange-dark-100));
|
|
64
|
+
border-color: var(--nile-colors-red-500, var(--ng-componentcolors-utility-orange-dark-500));
|
|
65
|
+
}
|
|
66
|
+
.section--error .section__heading,
|
|
67
|
+
.section--error .section__description {
|
|
68
|
+
color: var(--nile-colors-red-700, var(--ng-componentcolors-utility-orange-dark-700));
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.section--info {
|
|
72
|
+
background-color: var(--nile-colors-blue-100, var(--ng-componentcolors-utility-blue-light-100));
|
|
73
|
+
border-color: var(--nile-colors-blue-500, var(--ng-componentcolors-utility-blue-light-500));
|
|
74
|
+
}
|
|
75
|
+
.section--info .section__heading,
|
|
76
|
+
.section--info .section__description {
|
|
77
|
+
color: var(--nile-colors-blue-700, var(--ng-componentcolors-utility-blue-light-700));
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.left__wrapper {
|
|
81
|
+
align-self: start;
|
|
82
|
+
height: auto;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.right__wrapper {
|
|
86
|
+
display: flex;
|
|
87
|
+
flex-direction: column;
|
|
88
|
+
justify-content: flex-start;
|
|
89
|
+
width: 100%;
|
|
90
|
+
gap: var(--nile-spacing-lg, var(--ng-spacing-lg));
|
|
91
|
+
color: var(--nile-colors-dark-900, var(--ng-colors-fg-primary-900));
|
|
92
|
+
font-family: var(--nile-font-family-sans-serif, var(--ng-font-family-body));
|
|
93
|
+
font-size: var(--nile-type-scale-3, var(--ng-font-size-text-sm));
|
|
94
|
+
font-style: normal;
|
|
95
|
+
line-height: var(--nile-line-height-small, var(--ng-line-height-text-sm));
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.section__heading {
|
|
99
|
+
font-weight: var(--nile-font-weight-medium, var(--ng-font-weight-semibold));
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.section__description {
|
|
103
|
+
font-weight: var(--nile-font-weight-regular, var(--ng-font-weight-regular));
|
|
104
|
+
color: var(--nile-colors-dark-900, var(--ng-colors-fg-secondary-700));
|
|
105
|
+
}
|
|
106
|
+
`;
|
|
107
|
+
export default [styles];
|
|
108
|
+
//# sourceMappingURL=nile-chart-message.css.js.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { CSSResultArray, TemplateResult } from 'lit';
|
|
2
|
+
import NileElement from '../internal/nile-element.js';
|
|
3
|
+
export type StatusLightVariant = 'positive' | 'negative' | 'notice' | 'informative' | 'neutral';
|
|
4
|
+
export interface StatusLightConfig {
|
|
5
|
+
pulse?: boolean;
|
|
6
|
+
size?: 'small' | 'medium' | 'large';
|
|
7
|
+
variant?: StatusLightVariant;
|
|
8
|
+
}
|
|
9
|
+
export type ChartMessageVariant = 'primary' | 'success' | 'warning' | 'error' | 'info';
|
|
10
|
+
export interface ChartMessageConfig {
|
|
11
|
+
message: {
|
|
12
|
+
variant?: ChartMessageVariant;
|
|
13
|
+
heading?: string;
|
|
14
|
+
description?: string;
|
|
15
|
+
statusLight?: boolean;
|
|
16
|
+
statusLightConfig?: StatusLightConfig;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export declare class NileChartMessage extends NileElement {
|
|
20
|
+
static get styles(): CSSResultArray;
|
|
21
|
+
heading: string;
|
|
22
|
+
description: string;
|
|
23
|
+
variant: ChartMessageVariant;
|
|
24
|
+
statusLight: boolean;
|
|
25
|
+
statusLightConfig: StatusLightConfig;
|
|
26
|
+
set config(value: ChartMessageConfig | undefined);
|
|
27
|
+
statusVariantMap: Record<NileChartMessage['variant'], 'positive' | 'negative' | 'notice' | 'informative' | 'neutral'>;
|
|
28
|
+
render(): TemplateResult;
|
|
29
|
+
}
|
|
30
|
+
export default NileChartMessage;
|
|
31
|
+
declare global {
|
|
32
|
+
interface HTMLElementTagNameMap {
|
|
33
|
+
'nile-chart-message': NileChartMessage;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { html, } from 'lit';
|
|
3
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
4
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
5
|
+
import { styles } from './nile-chart-message.css.js';
|
|
6
|
+
import NileElement from '../internal/nile-element.js';
|
|
7
|
+
let NileChartMessage = class NileChartMessage extends NileElement {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
this.heading = '';
|
|
11
|
+
this.description = '';
|
|
12
|
+
this.variant = 'primary';
|
|
13
|
+
this.statusLight = false;
|
|
14
|
+
this.statusLightConfig = {};
|
|
15
|
+
this.statusVariantMap = {
|
|
16
|
+
primary: 'neutral',
|
|
17
|
+
success: 'positive',
|
|
18
|
+
warning: 'notice',
|
|
19
|
+
error: 'negative',
|
|
20
|
+
info: 'informative',
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
static get styles() {
|
|
24
|
+
return [styles];
|
|
25
|
+
}
|
|
26
|
+
set config(value) {
|
|
27
|
+
const message = value?.message;
|
|
28
|
+
if (!message)
|
|
29
|
+
return;
|
|
30
|
+
if (message.variant !== undefined)
|
|
31
|
+
this.variant = message.variant;
|
|
32
|
+
if (message.heading !== undefined)
|
|
33
|
+
this.heading = message.heading;
|
|
34
|
+
if (message.description !== undefined)
|
|
35
|
+
this.description = message.description;
|
|
36
|
+
if (message.statusLight !== undefined)
|
|
37
|
+
this.statusLight = message.statusLight;
|
|
38
|
+
if (message.statusLightConfig !== undefined)
|
|
39
|
+
this.statusLightConfig = message.statusLightConfig;
|
|
40
|
+
}
|
|
41
|
+
render() {
|
|
42
|
+
const cfg = this.statusLightConfig ?? {};
|
|
43
|
+
const showStatusLight = this.statusLight;
|
|
44
|
+
const pulse = cfg.pulse ?? false;
|
|
45
|
+
const size = cfg.size ?? 'large';
|
|
46
|
+
const statusVariant = cfg.variant ?? this.statusVariantMap[this.variant] ?? 'neutral';
|
|
47
|
+
const isAlert = this.variant === 'error';
|
|
48
|
+
const role = isAlert ? 'alert' : 'status';
|
|
49
|
+
const ariaLive = isAlert ? 'assertive' : 'polite';
|
|
50
|
+
return html `
|
|
51
|
+
<div
|
|
52
|
+
part="parent__wrapper"
|
|
53
|
+
role=${role}
|
|
54
|
+
aria-live=${ariaLive}
|
|
55
|
+
aria-atomic="true"
|
|
56
|
+
class=${classMap({
|
|
57
|
+
parent__wrapper: true,
|
|
58
|
+
'section--primary': this.variant === 'primary',
|
|
59
|
+
'section--success': this.variant === 'success',
|
|
60
|
+
'section--warning': this.variant === 'warning',
|
|
61
|
+
'section--error': this.variant === 'error',
|
|
62
|
+
'section--info': this.variant === 'info',
|
|
63
|
+
})}
|
|
64
|
+
>
|
|
65
|
+
${showStatusLight
|
|
66
|
+
? html `<div class="left__wrapper" part="icon__wrapper">
|
|
67
|
+
<nile-status-light
|
|
68
|
+
variant="${statusVariant}"
|
|
69
|
+
size="${size}"
|
|
70
|
+
?pulse=${pulse}
|
|
71
|
+
></nile-status-light>
|
|
72
|
+
</div>`
|
|
73
|
+
: null}
|
|
74
|
+
<div class="right__wrapper" part="content__wrapper">
|
|
75
|
+
${this.heading
|
|
76
|
+
? html `<div part="section__heading" class="section__heading">
|
|
77
|
+
${this.heading}
|
|
78
|
+
</div>`
|
|
79
|
+
: null}
|
|
80
|
+
${this.description
|
|
81
|
+
? html `<div
|
|
82
|
+
part="section__description"
|
|
83
|
+
class="section__description"
|
|
84
|
+
>
|
|
85
|
+
${this.description}
|
|
86
|
+
</div>`
|
|
87
|
+
: null}
|
|
88
|
+
</div>
|
|
89
|
+
</div>
|
|
90
|
+
`;
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
__decorate([
|
|
94
|
+
property({ type: String, attribute: true })
|
|
95
|
+
], NileChartMessage.prototype, "heading", void 0);
|
|
96
|
+
__decorate([
|
|
97
|
+
property({ type: String, attribute: true })
|
|
98
|
+
], NileChartMessage.prototype, "description", void 0);
|
|
99
|
+
__decorate([
|
|
100
|
+
property({ type: String, attribute: true })
|
|
101
|
+
], NileChartMessage.prototype, "variant", void 0);
|
|
102
|
+
__decorate([
|
|
103
|
+
property({ type: Boolean, attribute: true })
|
|
104
|
+
], NileChartMessage.prototype, "statusLight", void 0);
|
|
105
|
+
__decorate([
|
|
106
|
+
property({ attribute: false })
|
|
107
|
+
], NileChartMessage.prototype, "statusLightConfig", void 0);
|
|
108
|
+
__decorate([
|
|
109
|
+
property({ attribute: false })
|
|
110
|
+
], NileChartMessage.prototype, "config", null);
|
|
111
|
+
NileChartMessage = __decorate([
|
|
112
|
+
customElement('nile-chart-message')
|
|
113
|
+
], NileChartMessage);
|
|
114
|
+
export { NileChartMessage };
|
|
115
|
+
export default NileChartMessage;
|
|
116
|
+
//# sourceMappingURL=nile-chart-message.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const styles: import("lit").CSSResult;
|