@aceshooting/lyra-ui 0.1.5 → 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 +17 -8
- package/custom-elements.json +4869 -3389
- package/dist/components/chart/bar-chart.stories.d.ts +5 -0
- package/dist/components/chart/bar-chart.stories.js +20 -0
- package/dist/components/chart/box-plot.stories.d.ts +5 -0
- package/dist/components/chart/box-plot.stories.js +29 -0
- package/dist/components/chart/bubble-chart.stories.d.ts +5 -0
- package/dist/components/chart/bubble-chart.stories.js +26 -0
- package/dist/components/chart/doughnut-chart.stories.d.ts +5 -0
- package/dist/components/chart/doughnut-chart.stories.js +26 -0
- package/dist/components/chart/histogram.stories.d.ts +5 -0
- package/dist/components/chart/histogram.stories.js +17 -0
- package/dist/components/chart/line-chart.stories.d.ts +5 -0
- package/dist/components/chart/line-chart.stories.js +24 -0
- package/dist/components/chart/pie-chart.stories.d.ts +5 -0
- package/dist/components/chart/pie-chart.stories.js +26 -0
- package/dist/components/chart/polar-area-chart.stories.d.ts +5 -0
- package/dist/components/chart/polar-area-chart.stories.js +20 -0
- package/dist/components/chart/radar-chart.stories.d.ts +5 -0
- package/dist/components/chart/radar-chart.stories.js +20 -0
- package/dist/components/chart/scatter-chart.stories.d.ts +5 -0
- package/dist/components/chart/scatter-chart.stories.js +31 -0
- package/dist/components/combobox/combobox.d.ts +26 -1
- package/dist/components/combobox/combobox.js +147 -31
- package/dist/components/combobox/combobox.styles.js +21 -0
- package/dist/components/combobox/option.d.ts +4 -0
- package/dist/components/combobox/option.js +10 -0
- package/dist/components/date-picker/calendar-core.d.ts +6 -2
- package/dist/components/date-picker/calendar-core.js +23 -4
- package/dist/components/date-picker/date-input.d.ts +1 -0
- package/dist/components/date-picker/date-input.js +19 -2
- package/dist/components/date-picker/date-picker.js +4 -2
- package/dist/components/date-picker/date-picker.styles.js +5 -1
- package/dist/components/empty/empty.stories.d.ts +5 -0
- package/dist/components/empty/empty.stories.js +14 -0
- package/dist/components/export-button/export-button.js +7 -2
- package/dist/components/export-button/export-button.stories.d.ts +6 -0
- package/dist/components/export-button/export-button.stories.js +32 -0
- package/dist/components/file-input/file-input.stories.d.ts +5 -0
- package/dist/components/file-input/file-input.stories.js +10 -0
- package/dist/components/flag/flag.js +12 -2
- package/dist/components/gauge/gauge.js +8 -4
- package/dist/components/gauge/gauge.stories.d.ts +6 -0
- package/dist/components/gauge/gauge.stories.js +13 -0
- package/dist/components/graph/graph.stories.d.ts +5 -0
- package/dist/components/graph/graph.stories.js +30 -0
- package/dist/components/heatmap/heatmap.stories.d.ts +5 -0
- package/dist/components/heatmap/heatmap.stories.js +24 -0
- package/dist/components/map/map.d.ts +6 -0
- package/dist/components/map/map.js +69 -9
- package/dist/components/map/map.stories.d.ts +5 -0
- package/dist/components/map/map.stories.js +40 -0
- package/dist/components/playback/playback.stories.d.ts +5 -0
- package/dist/components/playback/playback.stories.js +10 -0
- package/dist/components/skeleton/skeleton.stories.d.ts +5 -0
- package/dist/components/skeleton/skeleton.stories.js +16 -0
- package/dist/components/split/split.d.ts +1 -0
- package/dist/components/split/split.js +25 -4
- package/dist/components/split/split.stories.d.ts +5 -0
- package/dist/components/split/split.stories.js +16 -0
- package/dist/components/table/table.stories.d.ts +6 -0
- package/dist/components/table/table.stories.js +22 -0
- package/dist/components/time-range/time-range.stories.d.ts +6 -0
- package/dist/components/time-range/time-range.stories.js +13 -0
- package/dist/components/toast/toast-item.d.ts +1 -0
- package/dist/components/toast/toast-item.js +16 -1
- package/dist/components/tree/tree.stories.d.ts +5 -0
- package/dist/components/tree/tree.stories.js +22 -0
- package/dist/components/widget/widget.d.ts +40 -0
- package/dist/components/widget/widget.js +159 -0
- package/dist/components/widget/widget.stories.d.ts +6 -0
- package/dist/components/widget/widget.stories.js +31 -0
- package/dist/components/widget/widget.styles.d.ts +1 -0
- package/dist/components/widget/widget.styles.js +90 -0
- package/dist/internal/icons.d.ts +2 -0
- package/dist/internal/icons.js +9 -0
- package/dist/internal/scroll-lock.d.ts +7 -0
- package/dist/internal/scroll-lock.js +25 -0
- package/dist/internal/tokens.styles.js +5 -0
- package/dist/lyra.d.ts +5 -0
- package/dist/lyra.js +2 -0
- package/llms.txt +3 -0
- package/package.json +3 -3
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
const meta = {
|
|
3
|
+
title: 'Charts/Bar',
|
|
4
|
+
component: 'lyra-bar-chart',
|
|
5
|
+
tags: ['autodocs'],
|
|
6
|
+
};
|
|
7
|
+
export default meta;
|
|
8
|
+
export const Default = {
|
|
9
|
+
render: () => {
|
|
10
|
+
const series = [{ label: 'Revenue', data: [12, 19, 14, 22] }];
|
|
11
|
+
return html `
|
|
12
|
+
<lyra-bar-chart
|
|
13
|
+
height="16rem"
|
|
14
|
+
style="width: 22rem"
|
|
15
|
+
.labels=${['Q1', 'Q2', 'Q3', 'Q4']}
|
|
16
|
+
.datasets=${series}
|
|
17
|
+
></lyra-bar-chart>
|
|
18
|
+
`;
|
|
19
|
+
},
|
|
20
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
const meta = {
|
|
3
|
+
title: 'Charts/BoxPlot',
|
|
4
|
+
component: 'lyra-box-plot',
|
|
5
|
+
tags: ['autodocs'],
|
|
6
|
+
};
|
|
7
|
+
export default meta;
|
|
8
|
+
export const Default = {
|
|
9
|
+
render: () => {
|
|
10
|
+
const boxes = [
|
|
11
|
+
{
|
|
12
|
+
label: 'Loss',
|
|
13
|
+
data: [
|
|
14
|
+
{ min: 1, q1: 2, median: 3, q3: 4, max: 5 },
|
|
15
|
+
{ min: 2, q1: 3, median: 4, q3: 5, max: 6 },
|
|
16
|
+
{ min: 1.5, q1: 2.5, median: 3.5, q3: 4.5, max: 6.5 },
|
|
17
|
+
],
|
|
18
|
+
},
|
|
19
|
+
];
|
|
20
|
+
return html `
|
|
21
|
+
<lyra-box-plot
|
|
22
|
+
height="16rem"
|
|
23
|
+
style="width: 22rem"
|
|
24
|
+
.labels=${['K=2', 'K=3', 'K=4']}
|
|
25
|
+
.boxes=${boxes}
|
|
26
|
+
></lyra-box-plot>
|
|
27
|
+
`;
|
|
28
|
+
},
|
|
29
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
const meta = {
|
|
3
|
+
title: 'Charts/Bubble',
|
|
4
|
+
component: 'lyra-bubble-chart',
|
|
5
|
+
tags: ['autodocs'],
|
|
6
|
+
};
|
|
7
|
+
export default meta;
|
|
8
|
+
export const Default = {
|
|
9
|
+
render: () => {
|
|
10
|
+
const bubblePoints = [
|
|
11
|
+
{ x: 10, y: 20, r: 8 },
|
|
12
|
+
{ x: 15, y: 10, r: 12 },
|
|
13
|
+
{ x: 20, y: 30, r: 6 },
|
|
14
|
+
];
|
|
15
|
+
const series = [
|
|
16
|
+
{ label: 'Clusters', points: bubblePoints },
|
|
17
|
+
];
|
|
18
|
+
return html `
|
|
19
|
+
<lyra-bubble-chart
|
|
20
|
+
height="16rem"
|
|
21
|
+
style="width: 22rem"
|
|
22
|
+
.datasets=${series}
|
|
23
|
+
></lyra-bubble-chart>
|
|
24
|
+
`;
|
|
25
|
+
},
|
|
26
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
const meta = {
|
|
3
|
+
title: 'Charts/Doughnut',
|
|
4
|
+
component: 'lyra-doughnut-chart',
|
|
5
|
+
tags: ['autodocs'],
|
|
6
|
+
};
|
|
7
|
+
export default meta;
|
|
8
|
+
export const Default = {
|
|
9
|
+
render: () => {
|
|
10
|
+
const series = [
|
|
11
|
+
{
|
|
12
|
+
label: 'Browsers',
|
|
13
|
+
data: [58, 18, 15, 9],
|
|
14
|
+
color: ['#5b8def', '#f7b955', '#59c19a', '#b6b8c3'],
|
|
15
|
+
},
|
|
16
|
+
];
|
|
17
|
+
return html `
|
|
18
|
+
<lyra-doughnut-chart
|
|
19
|
+
height="16rem"
|
|
20
|
+
style="width: 16rem"
|
|
21
|
+
.labels=${['Chrome', 'Firefox', 'Safari', 'Other']}
|
|
22
|
+
.datasets=${series}
|
|
23
|
+
></lyra-doughnut-chart>
|
|
24
|
+
`;
|
|
25
|
+
},
|
|
26
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
const meta = {
|
|
3
|
+
title: 'Charts/Histogram',
|
|
4
|
+
component: 'lyra-histogram',
|
|
5
|
+
tags: ['autodocs'],
|
|
6
|
+
};
|
|
7
|
+
export default meta;
|
|
8
|
+
export const Default = {
|
|
9
|
+
render: () => html `
|
|
10
|
+
<lyra-histogram
|
|
11
|
+
bins="6"
|
|
12
|
+
height="16rem"
|
|
13
|
+
style="width: 22rem"
|
|
14
|
+
.values=${[2, 4, 4, 5, 6, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 15]}
|
|
15
|
+
></lyra-histogram>
|
|
16
|
+
`,
|
|
17
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
const meta = {
|
|
3
|
+
title: 'Charts/Line',
|
|
4
|
+
component: 'lyra-line-chart',
|
|
5
|
+
tags: ['autodocs'],
|
|
6
|
+
};
|
|
7
|
+
export default meta;
|
|
8
|
+
export const Default = {
|
|
9
|
+
render: () => {
|
|
10
|
+
const series = [
|
|
11
|
+
{ label: 'Sessions', data: [4, 7, 6, 9, 12], fill: true },
|
|
12
|
+
{ label: 'Errors', data: [1, 2, 1, 0, 3], color: '#e5484d' },
|
|
13
|
+
];
|
|
14
|
+
return html `
|
|
15
|
+
<lyra-line-chart
|
|
16
|
+
height="16rem"
|
|
17
|
+
style="width: 22rem"
|
|
18
|
+
legend
|
|
19
|
+
.labels=${['Jan', 'Feb', 'Mar', 'Apr', 'May']}
|
|
20
|
+
.datasets=${series}
|
|
21
|
+
></lyra-line-chart>
|
|
22
|
+
`;
|
|
23
|
+
},
|
|
24
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
const meta = {
|
|
3
|
+
title: 'Charts/Pie',
|
|
4
|
+
component: 'lyra-pie-chart',
|
|
5
|
+
tags: ['autodocs'],
|
|
6
|
+
};
|
|
7
|
+
export default meta;
|
|
8
|
+
export const Default = {
|
|
9
|
+
render: () => {
|
|
10
|
+
const series = [
|
|
11
|
+
{
|
|
12
|
+
label: 'Browsers',
|
|
13
|
+
data: [58, 18, 15, 9],
|
|
14
|
+
color: ['#5b8def', '#f7b955', '#59c19a', '#b6b8c3'],
|
|
15
|
+
},
|
|
16
|
+
];
|
|
17
|
+
return html `
|
|
18
|
+
<lyra-pie-chart
|
|
19
|
+
height="16rem"
|
|
20
|
+
style="width: 16rem"
|
|
21
|
+
.labels=${['Chrome', 'Firefox', 'Safari', 'Other']}
|
|
22
|
+
.datasets=${series}
|
|
23
|
+
></lyra-pie-chart>
|
|
24
|
+
`;
|
|
25
|
+
},
|
|
26
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
const meta = {
|
|
3
|
+
title: 'Charts/PolarArea',
|
|
4
|
+
component: 'lyra-polar-area-chart',
|
|
5
|
+
tags: ['autodocs'],
|
|
6
|
+
};
|
|
7
|
+
export default meta;
|
|
8
|
+
export const Default = {
|
|
9
|
+
render: () => {
|
|
10
|
+
const series = [{ label: 'Revenue', data: [12, 19, 14, 22] }];
|
|
11
|
+
return html `
|
|
12
|
+
<lyra-polar-area-chart
|
|
13
|
+
height="16rem"
|
|
14
|
+
style="width: 18rem"
|
|
15
|
+
.labels=${['Q1', 'Q2', 'Q3', 'Q4']}
|
|
16
|
+
.datasets=${series}
|
|
17
|
+
></lyra-polar-area-chart>
|
|
18
|
+
`;
|
|
19
|
+
},
|
|
20
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
const meta = {
|
|
3
|
+
title: 'Charts/Radar',
|
|
4
|
+
component: 'lyra-radar-chart',
|
|
5
|
+
tags: ['autodocs'],
|
|
6
|
+
};
|
|
7
|
+
export default meta;
|
|
8
|
+
export const Default = {
|
|
9
|
+
render: () => {
|
|
10
|
+
const series = [{ label: 'Model A', data: [80, 90, 70, 85, 75] }];
|
|
11
|
+
return html `
|
|
12
|
+
<lyra-radar-chart
|
|
13
|
+
height="16rem"
|
|
14
|
+
style="width: 22rem"
|
|
15
|
+
.labels=${['Speed', 'Reliability', 'Comfort', 'Safety', 'Efficiency']}
|
|
16
|
+
.datasets=${series}
|
|
17
|
+
></lyra-radar-chart>
|
|
18
|
+
`;
|
|
19
|
+
},
|
|
20
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
const meta = {
|
|
3
|
+
title: 'Charts/Scatter',
|
|
4
|
+
component: 'lyra-scatter-chart',
|
|
5
|
+
tags: ['autodocs'],
|
|
6
|
+
};
|
|
7
|
+
export default meta;
|
|
8
|
+
export const Default = {
|
|
9
|
+
render: () => {
|
|
10
|
+
const series = [
|
|
11
|
+
{
|
|
12
|
+
label: 'Samples',
|
|
13
|
+
points: [
|
|
14
|
+
{ x: 10, y: 20 },
|
|
15
|
+
{ x: 15, y: 10 },
|
|
16
|
+
{ x: 20, y: 30 },
|
|
17
|
+
{ x: 25, y: 15 },
|
|
18
|
+
],
|
|
19
|
+
},
|
|
20
|
+
];
|
|
21
|
+
return html `
|
|
22
|
+
<lyra-scatter-chart
|
|
23
|
+
height="16rem"
|
|
24
|
+
style="width: 22rem"
|
|
25
|
+
x-label="X"
|
|
26
|
+
y-label="Y"
|
|
27
|
+
.datasets=${series}
|
|
28
|
+
></lyra-scatter-chart>
|
|
29
|
+
`;
|
|
30
|
+
},
|
|
31
|
+
};
|
|
@@ -3,6 +3,15 @@ import { LyraElement } from '../../internal/lyra-element.js';
|
|
|
3
3
|
import { LyraOption } from './option.js';
|
|
4
4
|
import './option.js';
|
|
5
5
|
export type OptionFilter = (option: LyraOption, query: string) => boolean;
|
|
6
|
+
export interface ComboboxSourceRow {
|
|
7
|
+
value: string;
|
|
8
|
+
label: string;
|
|
9
|
+
sub?: string;
|
|
10
|
+
dotColor?: string;
|
|
11
|
+
group?: string;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export type ComboboxSource = (query: string) => Promise<ComboboxSourceRow[]>;
|
|
6
15
|
/**
|
|
7
16
|
* `<lyra-combobox>` — a filterable single/multi select that combines a text
|
|
8
17
|
* input with a listbox. Mirrors the core `<wa-combobox>` API under `lyra-`.
|
|
@@ -51,6 +60,8 @@ export declare class LyraCombobox extends LyraElement {
|
|
|
51
60
|
maxOptionsVisible: number;
|
|
52
61
|
emptyText: string;
|
|
53
62
|
filter: OptionFilter | null;
|
|
63
|
+
source: ComboboxSource | null;
|
|
64
|
+
maxRender: number;
|
|
54
65
|
private query;
|
|
55
66
|
private activeIndex;
|
|
56
67
|
private options;
|
|
@@ -58,8 +69,15 @@ export declare class LyraCombobox extends LyraElement {
|
|
|
58
69
|
private hasHintSlot;
|
|
59
70
|
private hasErrorSlot;
|
|
60
71
|
private hasLabelSlot;
|
|
72
|
+
private loading;
|
|
73
|
+
private asyncRows;
|
|
74
|
+
private sourceTimer?;
|
|
75
|
+
private sourceToken;
|
|
76
|
+
private _selectedLabelCache;
|
|
77
|
+
private _rowsByValue;
|
|
61
78
|
private internals;
|
|
62
79
|
private listId;
|
|
80
|
+
private inputId;
|
|
63
81
|
private cleanup?;
|
|
64
82
|
private _selected;
|
|
65
83
|
private _defaultSelected;
|
|
@@ -80,22 +98,29 @@ export declare class LyraCombobox extends LyraElement {
|
|
|
80
98
|
private collectOptions;
|
|
81
99
|
private reflectSelected;
|
|
82
100
|
private labelFor;
|
|
101
|
+
/** The current row set in a source-agnostic shape, before capping. */
|
|
102
|
+
private get effectiveRows();
|
|
103
|
+
/** `effectiveRows` capped to `maxRender`, always keeping the current selection visible. */
|
|
104
|
+
private get renderedRows();
|
|
83
105
|
private get filtered();
|
|
84
106
|
private get displayValue();
|
|
85
107
|
private show;
|
|
86
108
|
private hide;
|
|
87
109
|
private onDocPointer;
|
|
88
110
|
protected updated(changed: PropertyValues): void;
|
|
89
|
-
private
|
|
111
|
+
private pickRow;
|
|
90
112
|
private removeValue;
|
|
91
113
|
private clear;
|
|
92
114
|
private onInput;
|
|
115
|
+
private runSource;
|
|
93
116
|
private onInputBlur;
|
|
94
117
|
private onHintSlotChange;
|
|
95
118
|
private onErrorSlotChange;
|
|
96
119
|
private onLabelSlotChange;
|
|
97
120
|
private onKeyDown;
|
|
98
121
|
private onComboMouseDown;
|
|
122
|
+
private onListboxMouseDown;
|
|
123
|
+
private onListboxClick;
|
|
99
124
|
private renderRows;
|
|
100
125
|
render(): TemplateResult;
|
|
101
126
|
}
|