@flux-ui/statistics 3.0.0-next.66 → 3.0.0-next.68
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 +1 -1
- package/dist/component/FluxStatisticsAreaChart.vue.d.ts +13 -5
- package/dist/component/FluxStatisticsBarChart.vue.d.ts +13 -5
- package/dist/component/FluxStatisticsBase.vue.d.ts +8 -15
- package/dist/component/FluxStatisticsBoxPlotChart.vue.d.ts +15 -0
- package/dist/component/FluxStatisticsBubbleChart.vue.d.ts +14 -0
- package/dist/component/FluxStatisticsCandlestickChart.vue.d.ts +15 -0
- package/dist/component/FluxStatisticsChange.vue.d.ts +2 -1
- package/dist/component/FluxStatisticsChart.vue.d.ts +8 -19
- package/dist/component/FluxStatisticsChartPane.vue.d.ts +9 -17
- package/dist/component/FluxStatisticsComparison.vue.d.ts +16 -0
- package/dist/component/FluxStatisticsDetailsTable.vue.d.ts +6 -13
- package/dist/component/FluxStatisticsDetailsTableRow.vue.d.ts +2 -1
- package/dist/component/FluxStatisticsDonutChart.vue.d.ts +10 -5
- package/dist/component/FluxStatisticsEmpty.vue.d.ts +19 -0
- package/dist/component/FluxStatisticsGrid.vue.d.ts +7 -11
- package/dist/component/FluxStatisticsHeatmapChart.vue.d.ts +15 -0
- package/dist/component/FluxStatisticsKpi.vue.d.ts +2 -1
- package/dist/component/FluxStatisticsLegend.vue.d.ts +7 -11
- package/dist/component/FluxStatisticsLegendItem.vue.d.ts +3 -1
- package/dist/component/FluxStatisticsLineChart.vue.d.ts +13 -5
- package/dist/component/FluxStatisticsMeter.vue.d.ts +2 -1
- package/dist/component/FluxStatisticsMetric.vue.d.ts +6 -13
- package/dist/component/FluxStatisticsMixedChart.vue.d.ts +17 -0
- package/dist/component/FluxStatisticsPieChart.vue.d.ts +10 -5
- package/dist/component/FluxStatisticsPolarAreaChart.vue.d.ts +14 -0
- package/dist/component/FluxStatisticsRadarChart.vue.d.ts +12 -0
- package/dist/component/FluxStatisticsRadialBar.vue.d.ts +11 -0
- package/dist/component/FluxStatisticsScatterChart.vue.d.ts +14 -0
- package/dist/component/FluxStatisticsSparkline.vue.d.ts +13 -0
- package/dist/component/FluxStatisticsTreemapChart.vue.d.ts +11 -0
- package/dist/component/index.d.ts +13 -0
- package/dist/composable/index.d.ts +10 -0
- package/dist/composable/useChartHoverSync.d.ts +9 -0
- package/dist/composable/useChartLegend.d.ts +14 -0
- package/dist/composable/useChartSeriesSetup.d.ts +23 -0
- package/dist/composable/useECharts.d.ts +9 -0
- package/dist/composable/usePieSlicesSetup.d.ts +14 -0
- package/dist/echarts.d.ts +1 -0
- package/dist/index.css +230 -37
- package/dist/index.d.ts +5 -2
- package/dist/index.js +10924 -9047
- package/dist/index.js.map +1 -1
- package/dist/util/baseOptions.d.ts +15 -0
- package/dist/util/colors.d.ts +4 -0
- package/dist/util/convert.d.ts +22 -0
- package/dist/util/defaultOptions.d.ts +76 -0
- package/dist/util/iconSvg.d.ts +2 -0
- package/dist/util/index.d.ts +7 -0
- package/dist/util/seriesDefaults.d.ts +15 -0
- package/dist/util/sparklineOptions.d.ts +7 -0
- package/package.json +14 -15
- package/src/component/FluxStatisticsAreaChart.vue +38 -41
- package/src/component/FluxStatisticsBarChart.vue +38 -33
- package/src/component/FluxStatisticsBase.vue +14 -1
- package/src/component/FluxStatisticsBoxPlotChart.vue +69 -0
- package/src/component/FluxStatisticsBubbleChart.vue +56 -0
- package/src/component/FluxStatisticsCandlestickChart.vue +81 -0
- package/src/component/FluxStatisticsChart.vue +19 -169
- package/src/component/FluxStatisticsChartPane.vue +23 -11
- package/src/component/FluxStatisticsComparison.vue +113 -0
- package/src/component/FluxStatisticsDonutChart.vue +39 -18
- package/src/component/FluxStatisticsEmpty.vue +44 -0
- package/src/component/FluxStatisticsHeatmapChart.vue +80 -0
- package/src/component/FluxStatisticsLegend.vue +33 -1
- package/src/component/FluxStatisticsLegendItem.vue +3 -1
- package/src/component/FluxStatisticsLineChart.vue +38 -41
- package/src/component/FluxStatisticsMixedChart.vue +55 -0
- package/src/component/FluxStatisticsPieChart.vue +39 -18
- package/src/component/FluxStatisticsPolarAreaChart.vue +53 -0
- package/src/component/FluxStatisticsRadarChart.vue +108 -0
- package/src/component/FluxStatisticsRadialBar.vue +48 -0
- package/src/component/FluxStatisticsScatterChart.vue +56 -0
- package/src/component/FluxStatisticsSparkline.vue +67 -0
- package/src/component/FluxStatisticsTreemapChart.vue +39 -0
- package/src/component/index.ts +13 -0
- package/src/composable/index.ts +10 -0
- package/src/composable/useChartHoverSync.ts +92 -0
- package/src/composable/useChartLegend.ts +23 -0
- package/src/composable/useChartSeriesSetup.ts +75 -0
- package/src/composable/useECharts.ts +55 -0
- package/src/composable/usePieSlicesSetup.ts +58 -0
- package/src/css/Base.module.scss +28 -1
- package/src/css/Chart.module.scss +66 -32
- package/src/css/ChartPane.module.scss +24 -9
- package/src/css/Comparison.module.scss +52 -0
- package/src/css/Empty.module.scss +39 -0
- package/src/css/Grid.module.scss +1 -0
- package/src/css/Legend.module.scss +11 -1
- package/src/css/Metric.module.scss +6 -0
- package/src/css/Sparkline.module.scss +13 -0
- package/src/echarts.ts +47 -0
- package/src/index.ts +7 -3
- package/src/util/baseOptions.ts +74 -0
- package/src/util/colors.ts +86 -0
- package/src/util/convert.ts +360 -0
- package/src/util/defaultOptions.ts +398 -0
- package/src/util/iconSvg.ts +20 -0
- package/src/util/index.ts +7 -0
- package/src/util/seriesDefaults.ts +210 -0
- package/src/util/sparklineOptions.ts +67 -0
|
@@ -1,17 +1,30 @@
|
|
|
1
1
|
export { default as FluxStatisticsAreaChart } from './FluxStatisticsAreaChart.vue';
|
|
2
2
|
export { default as FluxStatisticsBarChart } from './FluxStatisticsBarChart.vue';
|
|
3
3
|
export { default as FluxStatisticsBase } from './FluxStatisticsBase.vue';
|
|
4
|
+
export { default as FluxStatisticsBoxPlotChart } from './FluxStatisticsBoxPlotChart.vue';
|
|
5
|
+
export { default as FluxStatisticsBubbleChart } from './FluxStatisticsBubbleChart.vue';
|
|
6
|
+
export { default as FluxStatisticsCandlestickChart } from './FluxStatisticsCandlestickChart.vue';
|
|
4
7
|
export { default as FluxStatisticsChange } from './FluxStatisticsChange.vue';
|
|
5
8
|
export { default as FluxStatisticsChart } from './FluxStatisticsChart.vue';
|
|
6
9
|
export { default as FluxStatisticsChartPane } from './FluxStatisticsChartPane.vue';
|
|
10
|
+
export { default as FluxStatisticsComparison } from './FluxStatisticsComparison.vue';
|
|
7
11
|
export { default as FluxStatisticsDetailsTable } from './FluxStatisticsDetailsTable.vue';
|
|
8
12
|
export { default as FluxStatisticsDetailsTableRow } from './FluxStatisticsDetailsTableRow.vue';
|
|
9
13
|
export { default as FluxStatisticsDonutChart } from './FluxStatisticsDonutChart.vue';
|
|
14
|
+
export { default as FluxStatisticsEmpty } from './FluxStatisticsEmpty.vue';
|
|
10
15
|
export { default as FluxStatisticsGrid } from './FluxStatisticsGrid.vue';
|
|
16
|
+
export { default as FluxStatisticsHeatmapChart } from './FluxStatisticsHeatmapChart.vue';
|
|
11
17
|
export { default as FluxStatisticsLineChart } from './FluxStatisticsLineChart.vue';
|
|
12
18
|
export { default as FluxStatisticsKpi } from './FluxStatisticsKpi.vue';
|
|
13
19
|
export { default as FluxStatisticsLegend } from './FluxStatisticsLegend.vue';
|
|
14
20
|
export { default as FluxStatisticsLegendItem } from './FluxStatisticsLegendItem.vue';
|
|
15
21
|
export { default as FluxStatisticsMeter } from './FluxStatisticsMeter.vue';
|
|
16
22
|
export { default as FluxStatisticsMetric } from './FluxStatisticsMetric.vue';
|
|
23
|
+
export { default as FluxStatisticsMixedChart } from './FluxStatisticsMixedChart.vue';
|
|
17
24
|
export { default as FluxStatisticsPieChart } from './FluxStatisticsPieChart.vue';
|
|
25
|
+
export { default as FluxStatisticsPolarAreaChart } from './FluxStatisticsPolarAreaChart.vue';
|
|
26
|
+
export { default as FluxStatisticsRadarChart } from './FluxStatisticsRadarChart.vue';
|
|
27
|
+
export { default as FluxStatisticsRadialBar } from './FluxStatisticsRadialBar.vue';
|
|
28
|
+
export { default as FluxStatisticsScatterChart } from './FluxStatisticsScatterChart.vue';
|
|
29
|
+
export { default as FluxStatisticsSparkline } from './FluxStatisticsSparkline.vue';
|
|
30
|
+
export { default as FluxStatisticsTreemapChart } from './FluxStatisticsTreemapChart.vue';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type { ChartLegendContext, ChartLegendItem } from './useChartLegend';
|
|
2
|
+
export { createChartLegendContext, FluxStatisticsChartLegendInjectionKey } from './useChartLegend';
|
|
3
|
+
export type { ChartHoverSyncMode, UseChartHoverSyncOptions } from './useChartHoverSync';
|
|
4
|
+
export { useChartHoverSync } from './useChartHoverSync';
|
|
5
|
+
export type { ChartLegendItemBuilder, ChartSeriesShape, UseChartSeriesSetupOptions, UseChartSeriesSetupReturn } from './useChartSeriesSetup';
|
|
6
|
+
export { useChartSeriesSetup } from './useChartSeriesSetup';
|
|
7
|
+
export type { UsePieSlicesSetupReturn } from './usePieSlicesSetup';
|
|
8
|
+
export { usePieSlicesSetup } from './usePieSlicesSetup';
|
|
9
|
+
export type { EChartsInstance, EChartsOption, UseEChartsReturn } from './useECharts';
|
|
10
|
+
export { useECharts } from './useECharts';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { ChartLegendContext } from './useChartLegend';
|
|
3
|
+
import { EChartsInstance } from './useECharts';
|
|
4
|
+
export type ChartHoverSyncMode = 'series' | 'data';
|
|
5
|
+
export interface UseChartHoverSyncOptions {
|
|
6
|
+
readonly mode: ChartHoverSyncMode;
|
|
7
|
+
readonly seriesIndex?: number;
|
|
8
|
+
}
|
|
9
|
+
export declare function useChartHoverSync(chartInstance: Ref<EChartsInstance | null>, legendContext: ChartLegendContext | null, options: UseChartHoverSyncOptions): void;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FluxIconName } from '@flux-ui/types';
|
|
2
|
+
import { InjectionKey, Ref } from 'vue';
|
|
3
|
+
export interface ChartLegendItem {
|
|
4
|
+
readonly color?: string;
|
|
5
|
+
readonly icon?: FluxIconName;
|
|
6
|
+
readonly label: string;
|
|
7
|
+
readonly value?: string | number;
|
|
8
|
+
}
|
|
9
|
+
export interface ChartLegendContext {
|
|
10
|
+
readonly items: Ref<readonly ChartLegendItem[]>;
|
|
11
|
+
readonly hoveredIndex: Ref<number | null>;
|
|
12
|
+
}
|
|
13
|
+
export declare const FluxStatisticsChartLegendInjectionKey: InjectionKey<ChartLegendContext>;
|
|
14
|
+
export declare function createChartLegendContext(): ChartLegendContext;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { FluxIconName, FluxStatisticsChartColor } from '@flux-ui/types';
|
|
2
|
+
import { ComputedRef } from 'vue';
|
|
3
|
+
import { useI18n } from 'vue-i18n';
|
|
4
|
+
import { ChartHoverSyncMode } from './useChartHoverSync';
|
|
5
|
+
import { ChartLegendContext, ChartLegendItem } from './useChartLegend';
|
|
6
|
+
import { EChartsInstance } from './useECharts';
|
|
7
|
+
export interface ChartSeriesShape {
|
|
8
|
+
readonly name?: string;
|
|
9
|
+
readonly icon?: FluxIconName;
|
|
10
|
+
readonly color?: FluxStatisticsChartColor;
|
|
11
|
+
}
|
|
12
|
+
export type ChartLegendItemBuilder<S> = (series: S, color: string, index: number, t: ReturnType<typeof useI18n>['t']) => ChartLegendItem | readonly ChartLegendItem[];
|
|
13
|
+
export interface UseChartSeriesSetupOptions<S extends ChartSeriesShape> {
|
|
14
|
+
readonly mode?: ChartHoverSyncMode;
|
|
15
|
+
readonly getLegendItem?: ChartLegendItemBuilder<S>;
|
|
16
|
+
}
|
|
17
|
+
export interface UseChartSeriesSetupReturn {
|
|
18
|
+
readonly t: ReturnType<typeof useI18n>['t'];
|
|
19
|
+
readonly palette: ComputedRef<readonly string[]>;
|
|
20
|
+
readonly legendContext: ChartLegendContext | null;
|
|
21
|
+
readonly chartInstance: ComputedRef<EChartsInstance | null>;
|
|
22
|
+
}
|
|
23
|
+
export declare function useChartSeriesSetup<S extends ChartSeriesShape>(seriesGetter: () => readonly S[], options?: UseChartSeriesSetupOptions<S>): UseChartSeriesSetupReturn;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { init, EChartsCoreOption } from 'echarts/core';
|
|
2
|
+
import { MaybeRefOrGetter, Ref } from 'vue';
|
|
3
|
+
export type EChartsOption = EChartsCoreOption;
|
|
4
|
+
export type EChartsInstance = ReturnType<typeof init>;
|
|
5
|
+
export interface UseEChartsReturn {
|
|
6
|
+
readonly chartInstance: Ref<EChartsInstance | null>;
|
|
7
|
+
resize(): void;
|
|
8
|
+
}
|
|
9
|
+
export declare function useECharts(target: Ref<HTMLElement | null>, options: MaybeRefOrGetter<EChartsOption>): UseEChartsReturn;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FluxStatisticsChartPieSlice } from '@flux-ui/types';
|
|
2
|
+
import { ComputedRef } from 'vue';
|
|
3
|
+
import { useI18n } from 'vue-i18n';
|
|
4
|
+
import { SharedTooltipItem } from '../util';
|
|
5
|
+
import { ChartLegendContext } from './useChartLegend';
|
|
6
|
+
import { EChartsInstance } from './useECharts';
|
|
7
|
+
export interface UsePieSlicesSetupReturn {
|
|
8
|
+
readonly t: ReturnType<typeof useI18n>['t'];
|
|
9
|
+
readonly palette: ComputedRef<readonly string[]>;
|
|
10
|
+
readonly tooltipItems: ComputedRef<readonly SharedTooltipItem[]>;
|
|
11
|
+
readonly legendContext: ChartLegendContext | null;
|
|
12
|
+
readonly chartInstance: ComputedRef<EChartsInstance | null>;
|
|
13
|
+
}
|
|
14
|
+
export declare function usePieSlicesSetup(slicesGetter: () => readonly FluxStatisticsChartPieSlice[]): UsePieSlicesSetupReturn;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/index.css
CHANGED
|
@@ -22,35 +22,8 @@
|
|
|
22
22
|
inset: 0;
|
|
23
23
|
height: unset;
|
|
24
24
|
width: unset;
|
|
25
|
-
}
|
|
26
|
-
.statistics-chart svg {
|
|
27
|
-
overflow: hidden;
|
|
28
|
-
}
|
|
29
|
-
.statistics-chart {
|
|
30
25
|
--stroke: rgb(from var(--surface-stroke) r g b / .5);
|
|
31
26
|
}
|
|
32
|
-
.statistics-chart .apexcharts-canvas .apexcharts-grid-borders {
|
|
33
|
-
display: none;
|
|
34
|
-
}
|
|
35
|
-
.statistics-chart .apexcharts-canvas .apexcharts-yaxis-texts-g {
|
|
36
|
-
display: none;
|
|
37
|
-
}
|
|
38
|
-
.statistics-chart .apexcharts-canvas .apexcharts-tooltip {
|
|
39
|
-
background: rgb(from var(--surface) r g b/0.975);
|
|
40
|
-
background-clip: padding-box;
|
|
41
|
-
backdrop-filter: blur(3px) saturate(180%);
|
|
42
|
-
border: 1px solid var(--surface-stroke-out-hover);
|
|
43
|
-
border-radius: var(--radius-double);
|
|
44
|
-
box-shadow: var(--shadow-lg);
|
|
45
|
-
color: var(--foreground);
|
|
46
|
-
contain: paint;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.statistics-chart-element {
|
|
50
|
-
position: absolute;
|
|
51
|
-
display: block;
|
|
52
|
-
inset: 0;
|
|
53
|
-
}
|
|
54
27
|
|
|
55
28
|
.statistics-chart-tooltip-title {
|
|
56
29
|
padding: 18px 18px 0;
|
|
@@ -75,15 +48,78 @@
|
|
|
75
48
|
border-radius: 6px;
|
|
76
49
|
}
|
|
77
50
|
|
|
51
|
+
.statistics-chart-tooltip-series-icon {
|
|
52
|
+
display: flex;
|
|
53
|
+
height: 14px;
|
|
54
|
+
width: 14px;
|
|
55
|
+
color: var(--danger-600);
|
|
56
|
+
align-items: center;
|
|
57
|
+
justify-content: center;
|
|
58
|
+
}
|
|
59
|
+
.statistics-chart-tooltip-series-icon > svg {
|
|
60
|
+
height: 100%;
|
|
61
|
+
width: 100%;
|
|
62
|
+
}
|
|
63
|
+
|
|
78
64
|
.statistics-chart-tooltip-series-name {
|
|
65
|
+
color: var(--foreground-secondary);
|
|
79
66
|
font-size: 14px;
|
|
80
67
|
font-weight: 700;
|
|
68
|
+
transition: color 0.15s ease-out;
|
|
81
69
|
}
|
|
82
70
|
|
|
83
71
|
.statistics-chart-tooltip-series-value {
|
|
72
|
+
color: var(--foreground-secondary);
|
|
84
73
|
font-size: 14px;
|
|
85
74
|
font-weight: 500;
|
|
86
75
|
text-align: right;
|
|
76
|
+
transition: color 0.15s ease-out;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.statistics-chart-tooltip-series-name.is-active,
|
|
80
|
+
.statistics-chart-tooltip-series-value.is-active {
|
|
81
|
+
color: var(--foreground-prominent);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.statistics-chart-tooltip-section {
|
|
85
|
+
padding: 12px 18px;
|
|
86
|
+
transition: opacity 0.15s ease-out;
|
|
87
|
+
}
|
|
88
|
+
.statistics-chart-tooltip-section + .statistics-chart-tooltip-section {
|
|
89
|
+
border-top: 1px solid var(--surface-stroke);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.statistics-chart-tooltip-section.is-dimmed {
|
|
93
|
+
opacity: 0.55;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.statistics-chart-tooltip-section-title {
|
|
97
|
+
color: var(--foreground-prominent);
|
|
98
|
+
font-size: 14px;
|
|
99
|
+
font-weight: 700;
|
|
100
|
+
line-height: 1;
|
|
101
|
+
margin-bottom: 9px;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.statistics-chart-tooltip-section-body {
|
|
105
|
+
display: grid;
|
|
106
|
+
align-items: center;
|
|
107
|
+
gap: 6px 15px;
|
|
108
|
+
grid-template-columns: repeat(3, auto);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.flux-statistics-tooltip {
|
|
112
|
+
background: rgb(from var(--surface) r g b/0.975) !important;
|
|
113
|
+
background-clip: padding-box;
|
|
114
|
+
backdrop-filter: blur(3px) saturate(180%);
|
|
115
|
+
border: 1px solid var(--surface-stroke-out-hover) !important;
|
|
116
|
+
border-radius: var(--radius-double) !important;
|
|
117
|
+
box-shadow: var(--shadow-lg) !important;
|
|
118
|
+
color: var(--foreground);
|
|
119
|
+
contain: paint;
|
|
120
|
+
}
|
|
121
|
+
.flux-statistics-tooltip:empty {
|
|
122
|
+
display: none;
|
|
87
123
|
}.statistics-base {
|
|
88
124
|
display: flex;
|
|
89
125
|
height: 100%;
|
|
@@ -103,6 +139,7 @@
|
|
|
103
139
|
.statistics-base-header {
|
|
104
140
|
display: flex;
|
|
105
141
|
padding: 18px 18px 0;
|
|
142
|
+
gap: 9px;
|
|
106
143
|
align-items: flex-start;
|
|
107
144
|
}
|
|
108
145
|
|
|
@@ -114,10 +151,30 @@
|
|
|
114
151
|
word-break: break-word;
|
|
115
152
|
}
|
|
116
153
|
|
|
154
|
+
.statistics-base-header-icon,
|
|
155
|
+
.statistics-base-header-info {
|
|
156
|
+
font-size: 20px;
|
|
157
|
+
line-height: 24px;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.statistics-base-header-info {
|
|
161
|
+
margin-left: auto;
|
|
162
|
+
color: var(--foreground-secondary);
|
|
163
|
+
cursor: help;
|
|
164
|
+
scale: 0.75;
|
|
165
|
+
transition: color 0.2s var(--swift-out);
|
|
166
|
+
}
|
|
167
|
+
.statistics-base-header-info:hover {
|
|
168
|
+
color: var(--foreground-prominent);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.statistics-base-header-info + .statistics-base-header-icon {
|
|
172
|
+
margin-left: 6px;
|
|
173
|
+
}
|
|
174
|
+
|
|
117
175
|
.statistics-base-header-icon {
|
|
118
176
|
margin-left: auto;
|
|
119
177
|
color: var(--primary-600);
|
|
120
|
-
font-size: 20px;
|
|
121
178
|
}
|
|
122
179
|
|
|
123
180
|
.statistics-base-small .statistics-base-header-title {
|
|
@@ -126,6 +183,11 @@
|
|
|
126
183
|
line-height: 18px;
|
|
127
184
|
}
|
|
128
185
|
|
|
186
|
+
.statistics-base-small .statistics-base-header-info {
|
|
187
|
+
font-size: 14px;
|
|
188
|
+
line-height: 18px;
|
|
189
|
+
}
|
|
190
|
+
|
|
129
191
|
.statistics-base-small .statistics-base-header-icon {
|
|
130
192
|
font-size: 18px;
|
|
131
193
|
}.statistics-change {
|
|
@@ -165,35 +227,100 @@
|
|
|
165
227
|
font-weight: 500;
|
|
166
228
|
}.statistics-chart-pane {
|
|
167
229
|
--aspect-ratio: unset;
|
|
230
|
+
container: chart-pane/inline-size;
|
|
168
231
|
max-width: 100%;
|
|
169
|
-
aspect-ratio: var(--aspect-ratio);
|
|
170
232
|
}
|
|
171
233
|
|
|
172
234
|
.statistics-chart-pane-body {
|
|
173
235
|
display: grid;
|
|
236
|
+
align-content: start;
|
|
174
237
|
flex-grow: 1;
|
|
175
238
|
grid-template-columns: 1fr;
|
|
176
239
|
grid-template-rows: 1fr;
|
|
177
240
|
}
|
|
241
|
+
.statistics-chart-pane-body .statistics-chart-pane-container {
|
|
242
|
+
height: calc(100cqw / var(--aspect-ratio, 1));
|
|
243
|
+
}
|
|
178
244
|
.statistics-chart-pane-body:has(.statistics-legend) {
|
|
179
|
-
grid-template-columns:
|
|
245
|
+
grid-template-columns: 0.4fr 0.6fr;
|
|
180
246
|
}
|
|
181
|
-
|
|
182
|
-
.statistics-chart-pane-
|
|
183
|
-
|
|
184
|
-
|
|
247
|
+
@container chart-pane (max-width: 390px) {
|
|
248
|
+
.statistics-chart-pane-body:has(.statistics-legend) {
|
|
249
|
+
grid-template-columns: 1fr;
|
|
250
|
+
grid-template-rows: auto auto;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
.statistics-chart-pane-body:has(.statistics-legend) .statistics-chart-pane-container {
|
|
254
|
+
height: calc(40cqw / var(--aspect-ratio, 1));
|
|
185
255
|
}
|
|
186
|
-
.statistics-chart-pane-
|
|
256
|
+
.statistics-chart-pane-body:first-child canvas {
|
|
187
257
|
border-top-left-radius: var(--radius);
|
|
188
258
|
border-top-right-radius: var(--radius);
|
|
189
259
|
}
|
|
190
|
-
.statistics-chart-pane-
|
|
260
|
+
.statistics-chart-pane-body:last-child canvas {
|
|
191
261
|
border-bottom-left-radius: var(--radius);
|
|
192
262
|
border-bottom-right-radius: var(--radius);
|
|
193
263
|
}
|
|
194
264
|
|
|
265
|
+
.statistics-chart-pane-container {
|
|
266
|
+
position: relative;
|
|
267
|
+
display: block;
|
|
268
|
+
align-self: center;
|
|
269
|
+
}
|
|
270
|
+
|
|
195
271
|
.pane-header + .statistics-chart-pane-container {
|
|
196
272
|
margin-top: 18px;
|
|
273
|
+
}.statistics-comparison {
|
|
274
|
+
display: grid;
|
|
275
|
+
margin-top: 18px;
|
|
276
|
+
gap: 12px;
|
|
277
|
+
grid-template-columns: 1fr auto 1fr;
|
|
278
|
+
align-items: center;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
.statistics-comparison-divider {
|
|
282
|
+
width: 1px;
|
|
283
|
+
height: 36px;
|
|
284
|
+
background: var(--stroke);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
.statistics-comparison-item {
|
|
288
|
+
display: flex;
|
|
289
|
+
flex-flow: column;
|
|
290
|
+
gap: 3px;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
.statistics-comparison-item-label {
|
|
294
|
+
color: var(--foreground-secondary);
|
|
295
|
+
font-size: 13px;
|
|
296
|
+
font-weight: 500;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
.statistics-comparison-item-value {
|
|
300
|
+
color: var(--foreground-prominent);
|
|
301
|
+
font-size: 21px;
|
|
302
|
+
font-weight: 800;
|
|
303
|
+
line-height: 28px;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
.statistics-comparison-item-value-muted {
|
|
307
|
+
color: var(--foreground-secondary);
|
|
308
|
+
font-size: 18px;
|
|
309
|
+
font-weight: 600;
|
|
310
|
+
line-height: 28px;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
.statistics-comparison-bottom {
|
|
314
|
+
display: flex;
|
|
315
|
+
margin-top: 9px;
|
|
316
|
+
align-items: center;
|
|
317
|
+
gap: 9px;
|
|
318
|
+
line-height: 18px;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
.statistics-comparison-footer {
|
|
322
|
+
color: var(--foreground-secondary);
|
|
323
|
+
font-size: 14px;
|
|
197
324
|
}.statistics-base-content .statistics-stackable + .statistics-stackable {
|
|
198
325
|
margin-top: 18px;
|
|
199
326
|
}.details-table {
|
|
@@ -235,6 +362,44 @@
|
|
|
235
362
|
.details-table-title {
|
|
236
363
|
font-size: 15px;
|
|
237
364
|
font-weight: 600;
|
|
365
|
+
}.statistics-empty {
|
|
366
|
+
position: absolute;
|
|
367
|
+
display: flex;
|
|
368
|
+
inset: 0;
|
|
369
|
+
padding: 24px 18px;
|
|
370
|
+
flex-flow: column;
|
|
371
|
+
align-items: center;
|
|
372
|
+
justify-content: center;
|
|
373
|
+
text-align: center;
|
|
374
|
+
gap: 9px;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
.statistics-empty-icon {
|
|
378
|
+
color: var(--foreground-secondary);
|
|
379
|
+
font-size: 32px;
|
|
380
|
+
opacity: 0.5;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
.statistics-empty-title {
|
|
384
|
+
color: var(--foreground-prominent);
|
|
385
|
+
font-size: 16px;
|
|
386
|
+
font-weight: 700;
|
|
387
|
+
line-height: 24px;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
.statistics-empty-description {
|
|
391
|
+
max-width: 320px;
|
|
392
|
+
color: var(--foreground-secondary);
|
|
393
|
+
font-size: 14px;
|
|
394
|
+
font-weight: 400;
|
|
395
|
+
line-height: 20px;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
.statistics-empty-actions {
|
|
399
|
+
display: flex;
|
|
400
|
+
margin-top: 9px;
|
|
401
|
+
align-items: center;
|
|
402
|
+
gap: 9px;
|
|
238
403
|
}.statistics-grid {
|
|
239
404
|
--columns: 1;
|
|
240
405
|
--gap: 18px;
|
|
@@ -244,6 +409,7 @@
|
|
|
244
409
|
|
|
245
410
|
.statistics-grid-content {
|
|
246
411
|
display: grid;
|
|
412
|
+
align-items: start;
|
|
247
413
|
gap: var(--gap);
|
|
248
414
|
grid-template-columns: repeat(var(--columns), 1fr);
|
|
249
415
|
}
|
|
@@ -292,23 +458,33 @@
|
|
|
292
458
|
line-height: 36px;
|
|
293
459
|
}.statistics-legend {
|
|
294
460
|
display: flex;
|
|
461
|
+
max-height: 360px;
|
|
295
462
|
min-width: 0;
|
|
296
463
|
padding: 15px 18px 15px;
|
|
297
464
|
align-self: center;
|
|
298
465
|
flex-flow: column;
|
|
299
466
|
flex-grow: 1;
|
|
467
|
+
overflow: auto;
|
|
468
|
+
user-select: none;
|
|
300
469
|
}
|
|
301
470
|
|
|
302
471
|
.statistics-legend-item {
|
|
303
472
|
--color: var(--primary-600);
|
|
304
473
|
display: flex;
|
|
305
|
-
padding: 6px
|
|
474
|
+
padding: 6px 9px;
|
|
475
|
+
margin: 0 -9px;
|
|
306
476
|
align-items: flex-start;
|
|
307
477
|
flex-flow: row nowrap;
|
|
308
478
|
gap: 9px;
|
|
309
479
|
font-size: 14px;
|
|
310
480
|
line-height: 20px;
|
|
311
481
|
white-space: nowrap;
|
|
482
|
+
border-radius: var(--radius-small);
|
|
483
|
+
transition: background var(--swift-out);
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
.statistics-legend-item.is-hovered {
|
|
487
|
+
background: var(--surface-active);
|
|
312
488
|
}
|
|
313
489
|
|
|
314
490
|
.statistics-legend-item-color {
|
|
@@ -465,6 +641,11 @@
|
|
|
465
641
|
.statistics-metric-content small:not(:first-child) {
|
|
466
642
|
margin-top: 15px;
|
|
467
643
|
}
|
|
644
|
+
.statistics-metric-content [data-sparkline] {
|
|
645
|
+
margin-inline: -18px;
|
|
646
|
+
width: calc(100% + 36px);
|
|
647
|
+
max-width: none;
|
|
648
|
+
}
|
|
468
649
|
|
|
469
650
|
.statistics-metric-footer {
|
|
470
651
|
color: var(--foreground-secondary);
|
|
@@ -492,4 +673,16 @@
|
|
|
492
673
|
|
|
493
674
|
.statistics-metric-value + .statistics-metric-content {
|
|
494
675
|
margin-top: 15px;
|
|
676
|
+
}.statistics-sparkline {
|
|
677
|
+
position: relative;
|
|
678
|
+
display: block;
|
|
679
|
+
width: 100%;
|
|
680
|
+
height: 40px;
|
|
681
|
+
min-width: 60px;
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
.statistics-sparkline-chart {
|
|
685
|
+
position: absolute;
|
|
686
|
+
display: block;
|
|
687
|
+
inset: 0;
|
|
495
688
|
}/*$vite$:1*/
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { FluxStatisticsChartColor } from '@flux-ui/types';
|
|
1
2
|
export * from './component';
|
|
2
|
-
export
|
|
3
|
-
export
|
|
3
|
+
export * from './composable';
|
|
4
|
+
export type { ChartTooltipValueFormatter, SharedTooltipItem, Translator } from './util';
|
|
5
|
+
export declare const CHART_COLORS: readonly FluxStatisticsChartColor[];
|
|
6
|
+
export declare const CHART_COLORFUL_COLORS: readonly FluxStatisticsChartColor[];
|