@flux-ui/statistics 3.0.0-next.67 → 3.0.0-next.69

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (165) hide show
  1. package/README.md +1 -1
  2. package/dist/component/FluxStatisticsAreaChart.vue.d.ts +11 -4
  3. package/dist/component/FluxStatisticsBarChart.vue.d.ts +11 -4
  4. package/dist/component/FluxStatisticsBase.vue.d.ts +1 -0
  5. package/dist/component/FluxStatisticsBoxPlotChart.vue.d.ts +15 -0
  6. package/dist/component/FluxStatisticsBubbleChart.vue.d.ts +14 -0
  7. package/dist/component/FluxStatisticsCandlestickChart.vue.d.ts +15 -0
  8. package/dist/component/FluxStatisticsChart.vue.d.ts +7 -5
  9. package/dist/component/FluxStatisticsChartPane.vue.d.ts +1 -0
  10. package/dist/component/FluxStatisticsComparison.vue.d.ts +16 -0
  11. package/dist/component/FluxStatisticsDonutChart.vue.d.ts +8 -4
  12. package/dist/component/FluxStatisticsEmpty.vue.d.ts +19 -0
  13. package/dist/component/FluxStatisticsHeatmapChart.vue.d.ts +15 -0
  14. package/dist/component/FluxStatisticsLegendItem.vue.d.ts +1 -0
  15. package/dist/component/FluxStatisticsLegendScope.vue.d.ts +13 -0
  16. package/dist/component/FluxStatisticsLineChart.vue.d.ts +11 -4
  17. package/dist/component/FluxStatisticsMixedChart.vue.d.ts +17 -0
  18. package/dist/component/FluxStatisticsPercentageBar.vue.d.ts +8 -0
  19. package/dist/component/FluxStatisticsPieChart.vue.d.ts +8 -4
  20. package/dist/component/FluxStatisticsPolarAreaChart.vue.d.ts +14 -0
  21. package/dist/component/FluxStatisticsRadarChart.vue.d.ts +12 -0
  22. package/dist/component/FluxStatisticsRadialBar.vue.d.ts +11 -0
  23. package/dist/component/FluxStatisticsScatterChart.vue.d.ts +14 -0
  24. package/dist/component/FluxStatisticsSparkline.vue.d.ts +13 -0
  25. package/dist/component/FluxStatisticsTreemapChart.vue.d.ts +11 -0
  26. package/dist/component/index.d.ts +15 -0
  27. package/dist/composable/index.d.ts +12 -0
  28. package/dist/composable/useChartBaseSetup.d.ts +8 -0
  29. package/dist/composable/useChartHoverSync.d.ts +9 -0
  30. package/dist/composable/useChartLegend.d.ts +14 -0
  31. package/dist/composable/useChartSeriesSetup.d.ts +23 -0
  32. package/dist/composable/useChartSlicesSetup.d.ts +14 -0
  33. package/dist/composable/useECharts.d.ts +9 -0
  34. package/dist/echarts.d.ts +1 -0
  35. package/dist/index.css +262 -34
  36. package/dist/index.d.ts +5 -2
  37. package/dist/index.js +9176 -6895
  38. package/dist/index.js.map +1 -1
  39. package/dist/util/colors.d.ts +4 -0
  40. package/dist/util/icons.d.ts +2 -0
  41. package/dist/util/index.d.ts +6 -0
  42. package/dist/util/options/buildBaseOptions.d.ts +2 -0
  43. package/dist/util/options/buildCartesianBaseOptions.d.ts +13 -0
  44. package/dist/util/options/buildCircularBaseOptions.d.ts +2 -0
  45. package/dist/util/options/cartesian/buildAreaChartOptions.d.ts +17 -0
  46. package/dist/util/options/cartesian/buildBarChartOptions.d.ts +17 -0
  47. package/dist/util/options/cartesian/buildBoxPlotChartOptions.d.ts +16 -0
  48. package/dist/util/options/cartesian/buildBubbleChartOptions.d.ts +15 -0
  49. package/dist/util/options/cartesian/buildCandlestickChartOptions.d.ts +17 -0
  50. package/dist/util/options/cartesian/buildHeatmapChartOptions.d.ts +15 -0
  51. package/dist/util/options/cartesian/buildLineChartOptions.d.ts +17 -0
  52. package/dist/util/options/cartesian/buildMixedChartOptions.d.ts +17 -0
  53. package/dist/util/options/cartesian/buildScatterChartOptions.d.ts +15 -0
  54. package/dist/util/options/cartesian/index.d.ts +18 -0
  55. package/dist/util/options/circular/buildDonutChartOptions.d.ts +15 -0
  56. package/dist/util/options/circular/buildGaugeChartOptions.d.ts +14 -0
  57. package/dist/util/options/circular/buildPieChartOptions.d.ts +15 -0
  58. package/dist/util/options/circular/buildPolarAreaChartOptions.d.ts +15 -0
  59. package/dist/util/options/circular/buildRadarChartOptions.d.ts +13 -0
  60. package/dist/util/options/circular/buildTreemapChartOptions.d.ts +12 -0
  61. package/dist/util/options/circular/index.d.ts +12 -0
  62. package/dist/util/options/index.d.ts +6 -0
  63. package/dist/util/series/chartColors.d.ts +3 -0
  64. package/dist/util/series/converters.d.ts +17 -0
  65. package/dist/util/series/defaults.d.ts +15 -0
  66. package/dist/util/series/index.d.ts +4 -0
  67. package/dist/util/series/labels.d.ts +5 -0
  68. package/dist/util/sparkline.d.ts +7 -0
  69. package/dist/util/tooltips/buildBoxPlotTooltip.d.ts +22 -0
  70. package/dist/util/tooltips/buildCartesianTooltip.d.ts +10 -0
  71. package/dist/util/tooltips/buildGaugeTooltip.d.ts +14 -0
  72. package/dist/util/tooltips/buildHeatmapTooltip.d.ts +17 -0
  73. package/dist/util/tooltips/buildRadarTooltip.d.ts +11 -0
  74. package/dist/util/tooltips/buildSharedItemTooltip.d.ts +10 -0
  75. package/dist/util/tooltips/buildTreemapTooltip.d.ts +12 -0
  76. package/dist/util/tooltips/index.d.ts +15 -0
  77. package/dist/util/tooltips/render.d.ts +4 -0
  78. package/dist/util/tooltips/types.d.ts +24 -0
  79. package/package.json +14 -15
  80. package/src/component/FluxStatisticsAreaChart.vue +36 -43
  81. package/src/component/FluxStatisticsBarChart.vue +36 -35
  82. package/src/component/FluxStatisticsBase.vue +14 -1
  83. package/src/component/FluxStatisticsBoxPlotChart.vue +49 -0
  84. package/src/component/FluxStatisticsBubbleChart.vue +46 -0
  85. package/src/component/FluxStatisticsCandlestickChart.vue +50 -0
  86. package/src/component/FluxStatisticsChart.vue +19 -169
  87. package/src/component/FluxStatisticsChartPane.vue +22 -11
  88. package/src/component/FluxStatisticsComparison.vue +113 -0
  89. package/src/component/FluxStatisticsDonutChart.vue +31 -19
  90. package/src/component/FluxStatisticsEmpty.vue +44 -0
  91. package/src/component/FluxStatisticsHeatmapChart.vue +47 -0
  92. package/src/component/FluxStatisticsLegend.vue +33 -1
  93. package/src/component/FluxStatisticsLegendItem.vue +3 -1
  94. package/src/component/FluxStatisticsLegendScope.vue +16 -0
  95. package/src/component/FluxStatisticsLineChart.vue +36 -43
  96. package/src/component/FluxStatisticsMixedChart.vue +52 -0
  97. package/src/component/FluxStatisticsPercentageBar.vue +90 -0
  98. package/src/component/FluxStatisticsPieChart.vue +31 -19
  99. package/src/component/FluxStatisticsPolarAreaChart.vue +44 -0
  100. package/src/component/FluxStatisticsRadarChart.vue +40 -0
  101. package/src/component/FluxStatisticsRadialBar.vue +39 -0
  102. package/src/component/FluxStatisticsScatterChart.vue +46 -0
  103. package/src/component/FluxStatisticsSparkline.vue +67 -0
  104. package/src/component/FluxStatisticsTreemapChart.vue +35 -0
  105. package/src/component/index.ts +15 -0
  106. package/src/composable/index.ts +12 -0
  107. package/src/composable/useChartBaseSetup.ts +16 -0
  108. package/src/composable/useChartHoverSync.ts +92 -0
  109. package/src/composable/useChartLegend.ts +23 -0
  110. package/src/composable/useChartSeriesSetup.ts +75 -0
  111. package/src/composable/useChartSlicesSetup.ts +58 -0
  112. package/src/composable/useECharts.ts +55 -0
  113. package/src/css/Base.module.scss +28 -1
  114. package/src/css/Chart.module.scss +59 -30
  115. package/src/css/ChartPane.module.scss +20 -12
  116. package/src/css/Comparison.module.scss +52 -0
  117. package/src/css/Empty.module.scss +39 -0
  118. package/src/css/Grid.module.scss +1 -0
  119. package/src/css/Legend.module.scss +22 -4
  120. package/src/css/Meter.module.scss +1 -0
  121. package/src/css/Metric.module.scss +6 -0
  122. package/src/css/PercentageBar.module.scss +36 -0
  123. package/src/css/Sparkline.module.scss +13 -0
  124. package/src/echarts.ts +47 -0
  125. package/src/index.ts +7 -3
  126. package/src/util/colors.ts +86 -0
  127. package/src/util/icons.ts +20 -0
  128. package/src/util/index.ts +6 -0
  129. package/src/util/options/buildBaseOptions.ts +31 -0
  130. package/src/util/options/buildCartesianBaseOptions.ts +67 -0
  131. package/src/util/options/buildCircularBaseOptions.ts +10 -0
  132. package/src/util/options/cartesian/buildAreaChartOptions.ts +44 -0
  133. package/src/util/options/cartesian/buildBarChartOptions.ts +44 -0
  134. package/src/util/options/cartesian/buildBoxPlotChartOptions.ts +63 -0
  135. package/src/util/options/cartesian/buildBubbleChartOptions.ts +48 -0
  136. package/src/util/options/cartesian/buildCandlestickChartOptions.ts +77 -0
  137. package/src/util/options/cartesian/buildHeatmapChartOptions.ts +72 -0
  138. package/src/util/options/cartesian/buildLineChartOptions.ts +44 -0
  139. package/src/util/options/cartesian/buildMixedChartOptions.ts +44 -0
  140. package/src/util/options/cartesian/buildScatterChartOptions.ts +48 -0
  141. package/src/util/options/cartesian/index.ts +18 -0
  142. package/src/util/options/circular/buildDonutChartOptions.ts +31 -0
  143. package/src/util/options/circular/buildGaugeChartOptions.ts +45 -0
  144. package/src/util/options/circular/buildPieChartOptions.ts +31 -0
  145. package/src/util/options/circular/buildPolarAreaChartOptions.ts +31 -0
  146. package/src/util/options/circular/buildRadarChartOptions.ts +52 -0
  147. package/src/util/options/circular/buildTreemapChartOptions.ts +28 -0
  148. package/src/util/options/circular/index.ts +12 -0
  149. package/src/util/options/index.ts +6 -0
  150. package/src/util/series/chartColors.ts +20 -0
  151. package/src/util/series/converters.ts +318 -0
  152. package/src/util/series/defaults.ts +210 -0
  153. package/src/util/series/index.ts +4 -0
  154. package/src/util/series/labels.ts +30 -0
  155. package/src/util/sparkline.ts +67 -0
  156. package/src/util/tooltips/buildBoxPlotTooltip.ts +66 -0
  157. package/src/util/tooltips/buildCartesianTooltip.ts +44 -0
  158. package/src/util/tooltips/buildGaugeTooltip.ts +49 -0
  159. package/src/util/tooltips/buildHeatmapTooltip.ts +57 -0
  160. package/src/util/tooltips/buildRadarTooltip.ts +53 -0
  161. package/src/util/tooltips/buildSharedItemTooltip.ts +38 -0
  162. package/src/util/tooltips/buildTreemapTooltip.ts +49 -0
  163. package/src/util/tooltips/index.ts +15 -0
  164. package/src/util/tooltips/render.ts +66 -0
  165. package/src/util/tooltips/types.ts +29 -0
package/dist/index.css CHANGED
@@ -22,20 +22,10 @@
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 {
27
+
28
+ .statistics-chart-tooltip {
39
29
  background: rgb(from var(--surface) r g b/0.975);
40
30
  background-clip: padding-box;
41
31
  backdrop-filter: blur(3px) saturate(180%);
@@ -43,13 +33,6 @@
43
33
  border-radius: var(--radius-double);
44
34
  box-shadow: var(--shadow-lg);
45
35
  color: var(--foreground);
46
- contain: paint;
47
- }
48
-
49
- .statistics-chart-element {
50
- position: absolute;
51
- display: block;
52
- inset: 0;
53
36
  }
54
37
 
55
38
  .statistics-chart-tooltip-title {
@@ -75,15 +58,64 @@
75
58
  border-radius: 6px;
76
59
  }
77
60
 
61
+ .statistics-chart-tooltip-series-icon {
62
+ display: flex;
63
+ height: 14px;
64
+ width: 14px;
65
+ color: var(--danger-600);
66
+ align-items: center;
67
+ justify-content: center;
68
+ }
69
+ .statistics-chart-tooltip-series-icon > svg {
70
+ height: 100%;
71
+ width: 100%;
72
+ }
73
+
78
74
  .statistics-chart-tooltip-series-name {
75
+ color: var(--foreground-secondary);
79
76
  font-size: 14px;
80
77
  font-weight: 700;
78
+ transition: color 0.15s ease-out;
81
79
  }
82
80
 
83
81
  .statistics-chart-tooltip-series-value {
82
+ color: var(--foreground-secondary);
84
83
  font-size: 14px;
85
84
  font-weight: 500;
86
85
  text-align: right;
86
+ transition: color 0.15s ease-out;
87
+ }
88
+
89
+ .statistics-chart-tooltip-series-name.is-active,
90
+ .statistics-chart-tooltip-series-value.is-active {
91
+ color: var(--foreground-prominent);
92
+ }
93
+
94
+ .statistics-chart-tooltip-section {
95
+ padding: 12px 18px;
96
+ transition: opacity 0.15s ease-out;
97
+ }
98
+ .statistics-chart-tooltip-section + .statistics-chart-tooltip-section {
99
+ border-top: 1px solid var(--surface-stroke);
100
+ }
101
+
102
+ .statistics-chart-tooltip-section.is-dimmed {
103
+ opacity: 0.55;
104
+ }
105
+
106
+ .statistics-chart-tooltip-section-title {
107
+ color: var(--foreground-prominent);
108
+ font-size: 14px;
109
+ font-weight: 700;
110
+ line-height: 1;
111
+ margin-bottom: 9px;
112
+ }
113
+
114
+ .statistics-chart-tooltip-section-body {
115
+ display: grid;
116
+ align-items: center;
117
+ gap: 6px 15px;
118
+ grid-template-columns: repeat(3, auto);
87
119
  }.statistics-base {
88
120
  display: flex;
89
121
  height: 100%;
@@ -103,6 +135,7 @@
103
135
  .statistics-base-header {
104
136
  display: flex;
105
137
  padding: 18px 18px 0;
138
+ gap: 9px;
106
139
  align-items: flex-start;
107
140
  }
108
141
 
@@ -114,10 +147,30 @@
114
147
  word-break: break-word;
115
148
  }
116
149
 
150
+ .statistics-base-header-icon,
151
+ .statistics-base-header-info {
152
+ font-size: 20px;
153
+ line-height: 24px;
154
+ }
155
+
156
+ .statistics-base-header-info {
157
+ margin-left: auto;
158
+ color: var(--foreground-secondary);
159
+ cursor: help;
160
+ scale: 0.75;
161
+ transition: color 0.2s var(--swift-out);
162
+ }
163
+ .statistics-base-header-info:hover {
164
+ color: var(--foreground-prominent);
165
+ }
166
+
167
+ .statistics-base-header-info + .statistics-base-header-icon {
168
+ margin-left: 6px;
169
+ }
170
+
117
171
  .statistics-base-header-icon {
118
172
  margin-left: auto;
119
173
  color: var(--primary-600);
120
- font-size: 20px;
121
174
  }
122
175
 
123
176
  .statistics-base-small .statistics-base-header-title {
@@ -126,6 +179,11 @@
126
179
  line-height: 18px;
127
180
  }
128
181
 
182
+ .statistics-base-small .statistics-base-header-info {
183
+ font-size: 14px;
184
+ line-height: 18px;
185
+ }
186
+
129
187
  .statistics-base-small .statistics-base-header-icon {
130
188
  font-size: 18px;
131
189
  }.statistics-change {
@@ -165,35 +223,95 @@
165
223
  font-weight: 500;
166
224
  }.statistics-chart-pane {
167
225
  --aspect-ratio: unset;
226
+ container: chart-pane/inline-size;
168
227
  max-width: 100%;
169
- aspect-ratio: var(--aspect-ratio);
228
+ contain: paint;
170
229
  }
171
230
 
172
231
  .statistics-chart-pane-body {
173
232
  display: grid;
233
+ align-content: start;
174
234
  flex-grow: 1;
175
235
  grid-template-columns: 1fr;
176
236
  grid-template-rows: 1fr;
177
237
  }
238
+ .statistics-chart-pane-body .statistics-chart-pane-container {
239
+ height: calc(100cqw / var(--aspect-ratio, 1));
240
+ }
178
241
  .statistics-chart-pane-body:has(.statistics-legend) {
179
- grid-template-columns: 1fr 1fr;
242
+ align-items: center;
243
+ grid-template-columns: 0.4fr 0.6fr;
244
+ }
245
+ @container chart-pane (max-width: 390px) {
246
+ .statistics-chart-pane-body:has(.statistics-legend) {
247
+ align-items: stretch;
248
+ grid-template-columns: 1fr;
249
+ grid-template-rows: auto auto;
250
+ }
251
+ }
252
+ .statistics-chart-pane-body:has(.statistics-legend) .statistics-chart-pane-container {
253
+ height: calc(40cqw / var(--aspect-ratio, 1));
180
254
  }
181
255
 
182
256
  .statistics-chart-pane-container {
183
257
  position: relative;
184
258
  display: block;
185
- }
186
- .statistics-chart-pane-container:first-child svg {
187
- border-top-left-radius: var(--radius);
188
- border-top-right-radius: var(--radius);
189
- }
190
- .statistics-chart-pane-container:last-child svg {
191
- border-bottom-left-radius: var(--radius);
192
- border-bottom-right-radius: var(--radius);
259
+ align-self: center;
193
260
  }
194
261
 
195
262
  .pane-header + .statistics-chart-pane-container {
196
263
  margin-top: 18px;
264
+ }.statistics-comparison {
265
+ display: grid;
266
+ margin-top: 18px;
267
+ gap: 12px;
268
+ grid-template-columns: 1fr auto 1fr;
269
+ align-items: center;
270
+ }
271
+
272
+ .statistics-comparison-divider {
273
+ width: 1px;
274
+ height: 36px;
275
+ background: var(--stroke);
276
+ }
277
+
278
+ .statistics-comparison-item {
279
+ display: flex;
280
+ flex-flow: column;
281
+ gap: 3px;
282
+ }
283
+
284
+ .statistics-comparison-item-label {
285
+ color: var(--foreground-secondary);
286
+ font-size: 13px;
287
+ font-weight: 500;
288
+ }
289
+
290
+ .statistics-comparison-item-value {
291
+ color: var(--foreground-prominent);
292
+ font-size: 21px;
293
+ font-weight: 800;
294
+ line-height: 28px;
295
+ }
296
+
297
+ .statistics-comparison-item-value-muted {
298
+ color: var(--foreground-secondary);
299
+ font-size: 18px;
300
+ font-weight: 600;
301
+ line-height: 28px;
302
+ }
303
+
304
+ .statistics-comparison-bottom {
305
+ display: flex;
306
+ margin-top: 9px;
307
+ align-items: center;
308
+ gap: 9px;
309
+ line-height: 18px;
310
+ }
311
+
312
+ .statistics-comparison-footer {
313
+ color: var(--foreground-secondary);
314
+ font-size: 14px;
197
315
  }.statistics-base-content .statistics-stackable + .statistics-stackable {
198
316
  margin-top: 18px;
199
317
  }.details-table {
@@ -235,6 +353,44 @@
235
353
  .details-table-title {
236
354
  font-size: 15px;
237
355
  font-weight: 600;
356
+ }.statistics-empty {
357
+ display: flex;
358
+ width: 100%;
359
+ height: 100%;
360
+ padding: 24px 18px;
361
+ flex-flow: column;
362
+ align-items: center;
363
+ justify-content: center;
364
+ text-align: center;
365
+ gap: 9px;
366
+ }
367
+
368
+ .statistics-empty-icon {
369
+ color: var(--foreground-secondary);
370
+ font-size: 32px;
371
+ opacity: 0.5;
372
+ }
373
+
374
+ .statistics-empty-title {
375
+ color: var(--foreground-prominent);
376
+ font-size: 16px;
377
+ font-weight: 700;
378
+ line-height: 24px;
379
+ }
380
+
381
+ .statistics-empty-description {
382
+ max-width: 320px;
383
+ color: var(--foreground-secondary);
384
+ font-size: 14px;
385
+ font-weight: 400;
386
+ line-height: 20px;
387
+ }
388
+
389
+ .statistics-empty-actions {
390
+ display: flex;
391
+ margin-top: 9px;
392
+ align-items: center;
393
+ gap: 9px;
238
394
  }.statistics-grid {
239
395
  --columns: 1;
240
396
  --gap: 18px;
@@ -244,6 +400,7 @@
244
400
 
245
401
  .statistics-grid-content {
246
402
  display: grid;
403
+ align-items: start;
247
404
  gap: var(--gap);
248
405
  grid-template-columns: repeat(var(--columns), 1fr);
249
406
  }
@@ -293,22 +450,35 @@
293
450
  }.statistics-legend {
294
451
  display: flex;
295
452
  min-width: 0;
296
- padding: 15px 18px 15px;
297
- align-self: center;
453
+ padding: 0 9px;
298
454
  flex-flow: column;
299
455
  flex-grow: 1;
456
+ gap: 3px;
457
+ user-select: none;
458
+ }
459
+
460
+ .statistics-chart-pane-body .statistics-legend {
461
+ padding: 9px 36px 9px 18px;
300
462
  }
301
463
 
302
464
  .statistics-legend-item {
303
465
  --color: var(--primary-600);
466
+ position: relative;
304
467
  display: flex;
305
- padding: 6px 0;
468
+ padding: 6px;
469
+ margin: 0 -9px;
306
470
  align-items: flex-start;
307
471
  flex-flow: row nowrap;
308
472
  gap: 9px;
309
473
  font-size: 14px;
310
474
  line-height: 20px;
311
475
  white-space: nowrap;
476
+ border-radius: var(--radius-half);
477
+ transition: background 120ms var(--swift-out);
478
+ }
479
+
480
+ .statistics-legend-item.is-hovered {
481
+ background: var(--surface-active);
312
482
  }
313
483
 
314
484
  .statistics-legend-item-color {
@@ -336,7 +506,12 @@
336
506
  text-align: right;
337
507
  }
338
508
 
339
- .statistics-legend-item + .statistics-legend-item {
509
+ .statistics-legend-item + .statistics-legend-item::before {
510
+ position: absolute;
511
+ top: -2px;
512
+ left: 0;
513
+ right: 0;
514
+ content: "";
340
515
  border-top: 1px dashed var(--surface-stroke);
341
516
  }.statistics-meter {
342
517
  --color: var(--primary-600);
@@ -354,6 +529,7 @@
354
529
  height: 6px;
355
530
  background: var(--gray-100);
356
531
  border-radius: var(--radius);
532
+ contain: paint;
357
533
  }
358
534
 
359
535
  .statistics-meter-bar-value {
@@ -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,51 @@
492
673
 
493
674
  .statistics-metric-value + .statistics-metric-content {
494
675
  margin-top: 15px;
676
+ }.statistics-percentage-bar {
677
+ display: flex;
678
+ flex-flow: column;
679
+ gap: 12px;
680
+ }
681
+
682
+ .statistics-percentage-bar-track {
683
+ display: flex;
684
+ flex-flow: row nowrap;
685
+ gap: 3px;
686
+ }
687
+
688
+ .statistics-percentage-bar-segment {
689
+ height: 12px;
690
+ border-radius: calc(var(--radius) / 3);
691
+ transition: var(--transition-default);
692
+ transition-property: height, margin, flex-grow, opacity;
693
+ }
694
+
695
+ .statistics-percentage-bar-segment:hover,
696
+ .statistics-percentage-bar-segment.is-hovered {
697
+ height: 16px;
698
+ margin-top: -2px;
699
+ margin-bottom: -2px;
700
+ }
701
+
702
+ .statistics-percentage-bar-track.is-hover-active .statistics-percentage-bar-segment:not(.is-hovered):not(:hover) {
703
+ opacity: 0.5;
704
+ }
705
+
706
+ .statistics-percentage-bar-tooltip {
707
+ display: flex;
708
+ align-items: center;
709
+ flex-flow: row nowrap;
710
+ gap: 9px;
711
+ }.statistics-sparkline {
712
+ position: relative;
713
+ display: block;
714
+ width: 100%;
715
+ height: 40px;
716
+ min-width: 60px;
717
+ }
718
+
719
+ .statistics-sparkline-chart {
720
+ position: absolute;
721
+ display: block;
722
+ inset: 0;
495
723
  }/*$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 declare const CHART_COLORS: string[];
3
- export declare const CHART_COLORFUL_COLORS: string[];
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[];