@sybilion/uilib 1.3.99 → 1.3.101
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/dist/esm/components/ui/AnalysesSelector/AnalysesSelector.js +61 -14
- package/dist/esm/components/ui/AnalysesSelector/AnalysesSelector.styl.js +2 -2
- package/dist/esm/components/ui/AnalysesSelector/SelectInlineRenamer.js +102 -0
- package/dist/esm/components/ui/Banner/Banner.js +11 -0
- package/dist/esm/components/ui/Banner/Banner.styl.js +7 -0
- package/dist/esm/components/ui/Chart/Chart.js +9 -5
- package/dist/esm/components/ui/Chart/chartForecastVisualization.constants.js +23 -0
- package/dist/esm/components/ui/Chart/components/ConfidenceBands.js +9 -0
- package/dist/esm/components/ui/Chart/components/CustomChartLegend/CustomChartLegend.js +2 -2
- package/dist/esm/components/ui/Chart/components/ForecastBoundaries.js +32 -0
- package/dist/esm/components/ui/Chart/components/ForecastLine.js +24 -0
- package/dist/esm/components/ui/Chart/components/HistoricalLine.js +24 -0
- package/dist/esm/components/ui/Chart/hooks/useChartAnimation.js +17 -0
- package/dist/esm/components/ui/Chart/hooks/useChartColors.js +12 -0
- package/dist/esm/components/ui/Chart/hooks/useLegendState.js +30 -0
- package/dist/esm/components/ui/Chart/tools/formatters.js +19 -3
- package/dist/esm/components/ui/ChartAreaInteractive/ChartAreaInteractive.helpers.js +1 -10
- package/dist/esm/components/ui/Select/Select.js +3 -3
- package/dist/esm/components/widgets/DriverCard/DriverCard.js +6 -6
- package/dist/esm/components/widgets/DriverCard/DriverPerformanceChart.js +9 -5
- package/dist/esm/components/widgets/DriversComparisonChart/DriversComparisonChart.styl.js +1 -1
- package/dist/esm/components/widgets/PerformanceChart/PerformanceChart.styl.js +1 -1
- package/dist/esm/index.js +11 -1
- package/dist/esm/types/src/components/ui/AnalysesSelector/AnalysesSelector.d.ts +1 -1
- package/dist/esm/types/src/components/ui/AnalysesSelector/AnalysesSelector.types.d.ts +7 -1
- package/dist/esm/types/src/components/ui/AnalysesSelector/SelectInlineRenamer.d.ts +12 -0
- package/dist/esm/types/src/components/ui/Banner/Banner.d.ts +2 -0
- package/dist/esm/types/src/components/ui/Banner/Banner.types.d.ts +10 -0
- package/dist/esm/types/src/components/ui/Banner/index.d.ts +2 -0
- package/dist/esm/types/src/components/ui/Chart/Chart.d.ts +9 -0
- package/dist/esm/types/src/components/ui/Chart/components/index.d.ts +1 -1
- package/dist/esm/types/src/components/ui/Chart/tools/formatters.d.ts +3 -1
- package/dist/esm/types/src/components/ui/ChartAreaInteractive/index.d.ts +1 -1
- package/dist/esm/types/src/components/ui/Select/Select.d.ts +1 -1
- package/dist/esm/types/src/components/ui/Select/Select.types.d.ts +1 -0
- package/dist/esm/types/src/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/components/ui/AnalysesSelector/AnalysesSelector.styl +62 -1
- package/src/components/ui/AnalysesSelector/AnalysesSelector.styl.d.ts +8 -0
- package/src/components/ui/AnalysesSelector/AnalysesSelector.tsx +136 -27
- package/src/components/ui/AnalysesSelector/AnalysesSelector.types.ts +7 -2
- package/src/components/ui/AnalysesSelector/SelectInlineRenamer.tsx +191 -0
- package/src/components/ui/Banner/Banner.styl +28 -0
- package/src/components/ui/Banner/Banner.styl.d.ts +9 -0
- package/src/components/ui/Banner/Banner.tsx +32 -0
- package/src/components/ui/Banner/Banner.types.ts +8 -0
- package/src/components/ui/Banner/index.ts +2 -0
- package/src/components/ui/Chart/Chart.tsx +16 -0
- package/src/components/ui/Chart/components/CustomChartLegend/CustomChartLegend.tsx +2 -3
- package/src/components/ui/Chart/components/index.ts +5 -1
- package/src/components/ui/Chart/tools/formatters.ts +20 -2
- package/src/components/ui/ChartAreaInteractive/index.ts +15 -1
- package/src/components/ui/Select/Select.tsx +13 -5
- package/src/components/ui/Select/Select.types.ts +1 -0
- package/src/components/widgets/DriverCard/DriverCard.tsx +7 -8
- package/src/components/widgets/DriversComparisonChart/DriversComparisonChart.styl +0 -1
- package/src/components/widgets/PerformanceChart/PerformanceChart.styl +1 -1
- package/src/index.ts +1 -0
|
@@ -6,22 +6,26 @@ import '../../ui/Chart/components/BaseChartWrapper.js';
|
|
|
6
6
|
import { ChartContainer } from '../../ui/Chart/components/ChartContainer.js';
|
|
7
7
|
import '../../ui/Chart/Chart.context.js';
|
|
8
8
|
import '../../ui/Chart/Chart.styl.js';
|
|
9
|
-
import '@phosphor-icons/react';
|
|
10
|
-
import '@radix-ui/react-select';
|
|
11
|
-
import 'lucide-react';
|
|
12
|
-
import '../../ui/Select/Select.styl.js';
|
|
13
9
|
import '../../ui/AnalysisLineIcon/AnalysisLineIcon.styl.js';
|
|
14
10
|
import '@radix-ui/react-slot';
|
|
15
11
|
import '../../ui/Badge/Badge.styl.js';
|
|
16
12
|
import '../../ui/LabelWithId/LabelWithId.styl.js';
|
|
17
|
-
import '
|
|
13
|
+
import '@radix-ui/react-select';
|
|
14
|
+
import 'lucide-react';
|
|
15
|
+
import '../../ui/Select/Select.styl.js';
|
|
18
16
|
import '../../ui/TextShimmer/TextShimmer.js';
|
|
17
|
+
import '@phosphor-icons/react';
|
|
18
|
+
import '../../ui/AnalysesSelector/AnalysesSelector.styl.js';
|
|
19
|
+
import '../../ui/Button/Button.styl.js';
|
|
20
|
+
import '../../ui/Input/Input.js';
|
|
21
|
+
import '../../ui/Tooltip/Tooltip.js';
|
|
19
22
|
import '../../ui/Chart/components/CustomChartLegend/CustomChartLegend.styl.js';
|
|
20
23
|
import '../../ui/ChartAreaInteractive/ChartLines.js';
|
|
21
24
|
import '../../ui/Skeleton/Skeleton.styl.js';
|
|
22
25
|
import 'lightweight-charts';
|
|
23
26
|
import '../../ui/Chart/lightweight/LightweightForecastChart.styl.js';
|
|
24
27
|
import { ChartEmptyState } from '../../ui/Chart/components/ChartEmptyState/ChartEmptyState.js';
|
|
28
|
+
import '../../ui/Chart/components/QuantileBands.js';
|
|
25
29
|
import S from './DriverPerformanceChart.styl.js';
|
|
26
30
|
import { generateDriverChartData } from './driverPerformanceChartData.js';
|
|
27
31
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import styleInject from 'style-inject';
|
|
2
2
|
|
|
3
|
-
var css_248z = "@media (max-width:768px){:root{--page-x-padding:var(--p-6);--page-y-padding:var(--p-6)}}.DriversComparisonChart_root__GLnlF{display:flex;flex-direction:column;gap:var(--p-4);width:100%}.DriversComparisonChart_chartShell__0AzAz{position:relative;width:100%}.DriversComparisonChart_chartShellLoading__wTLod .DriversComparisonChart_chartSlot__WKe6N{opacity:.3;pointer-events:none}.DriversComparisonChart_chartShellLoading__wTLod .recharts-line-dots{display:none}.DriversComparisonChart_chartSlot__WKe6N{width:100%}.DriversComparisonChart_loadingLayer__HlEmA{inset:0;pointer-events:none;position:absolute;z-index:10}.DriversComparisonChart_loadingMessage__Li3S7{color:var(--foreground);display:block;left:0;position:absolute;text-align:center;top:calc(50% - 4em);width:100%;z-index:1}.DriversComparisonChart_loadingText__0y3Ms{backdrop-filter:blur(10px);border-radius:var(--p-4);box-shadow:0 0 0 2px var(--page-color);color:var(--foreground);font-size:16px;font-weight:500;padding:0 var(--p-3)}.DriversComparisonChart_chartWithOverlay__SMToK{position:relative;width:100%}.DriversComparisonChart_chartInteractiveLayer__0aquh{transition:opacity .2s ease-out;width:100%}.DriversComparisonChart_chartInteractiveDimmed__us1dv{opacity:.3;pointer-events:none}.DriversComparisonChart_chartInteractiveDimmed__us1dv .recharts-line-dots{display:none}.DriversComparisonChart_chartEmptyOverlay__eXqzk{align-items:center;display:flex;inset:0;justify-content:center;padding:var(--p-4);pointer-events:none;position:absolute;z-index:6}.DriversComparisonChart_chartEmptyBlurb__Tjy9E{max-width:42rem;padding:0 var(--p-3)}.DriversComparisonChart_seriesEmptyWrap__RyRs5{display:flex;justify-content:center;padding:var(--p-8) var(--p-4)}.DriversComparisonChart_seriesSection__yrf4I{width:100%}.DriversComparisonChart_seriesTableWrapper__oredC{margin:0 calc(var(--page-x-padding)*-1);position:relative}.DriversComparisonChart_seriesTableContainer__dhfXK{overflow-x:auto;position:relative;width:100%}.DriversComparisonChart_seriesScrollbar__2jgk6{bottom:calc(var(--p-7)*-1 + 2px)!important}.DriversComparisonChart_seriesTable__NybPR{max-width:100%;table-layout:auto;width:100%}.DriversComparisonChart_seriesTable__NybPR tr{cursor:pointer;position:relative}.DriversComparisonChart_seriesTable__NybPR td:not(:first-child),.DriversComparisonChart_seriesTable__NybPR th:not(:first-child){text-align:right}.DriversComparisonChart_seriesColSeries__--0mj{text-align:left;vertical-align:middle}.DriversComparisonChart_rowHidden__Fwhna{opacity:.4}.DriversComparisonChart_colorSwatch__o3ZVr{border-radius:2px;display:inline-flex;flex-shrink:0;height:10px;margin-right:var(--p-2);width:10px}.DriversComparisonChart_seriesLabel__Aidof{display:-webkit-box;-webkit-line-clamp:3;max-width:60vw;min-width:0
|
|
3
|
+
var css_248z = "@media (max-width:768px){:root{--page-x-padding:var(--p-6);--page-y-padding:var(--p-6)}}.DriversComparisonChart_root__GLnlF{display:flex;flex-direction:column;gap:var(--p-4);width:100%}.DriversComparisonChart_chartShell__0AzAz{position:relative;width:100%}.DriversComparisonChart_chartShellLoading__wTLod .DriversComparisonChart_chartSlot__WKe6N{opacity:.3;pointer-events:none}.DriversComparisonChart_chartShellLoading__wTLod .recharts-line-dots{display:none}.DriversComparisonChart_chartSlot__WKe6N{width:100%}.DriversComparisonChart_loadingLayer__HlEmA{inset:0;pointer-events:none;position:absolute;z-index:10}.DriversComparisonChart_loadingMessage__Li3S7{color:var(--foreground);display:block;left:0;position:absolute;text-align:center;top:calc(50% - 4em);width:100%;z-index:1}.DriversComparisonChart_loadingText__0y3Ms{backdrop-filter:blur(10px);border-radius:var(--p-4);box-shadow:0 0 0 2px var(--page-color);color:var(--foreground);font-size:16px;font-weight:500;padding:0 var(--p-3)}.DriversComparisonChart_chartWithOverlay__SMToK{position:relative;width:100%}.DriversComparisonChart_chartInteractiveLayer__0aquh{transition:opacity .2s ease-out;width:100%}.DriversComparisonChart_chartInteractiveDimmed__us1dv{opacity:.3;pointer-events:none}.DriversComparisonChart_chartInteractiveDimmed__us1dv .recharts-line-dots{display:none}.DriversComparisonChart_chartEmptyOverlay__eXqzk{align-items:center;display:flex;inset:0;justify-content:center;padding:var(--p-4);pointer-events:none;position:absolute;z-index:6}.DriversComparisonChart_chartEmptyBlurb__Tjy9E{max-width:42rem;padding:0 var(--p-3)}.DriversComparisonChart_seriesEmptyWrap__RyRs5{display:flex;justify-content:center;padding:var(--p-8) var(--p-4)}.DriversComparisonChart_seriesSection__yrf4I{width:100%}.DriversComparisonChart_seriesTableWrapper__oredC{margin:0 calc(var(--page-x-padding)*-1);position:relative}.DriversComparisonChart_seriesTableContainer__dhfXK{overflow-x:auto;position:relative;width:100%}.DriversComparisonChart_seriesScrollbar__2jgk6{bottom:calc(var(--p-7)*-1 + 2px)!important}.DriversComparisonChart_seriesTable__NybPR{max-width:100%;table-layout:auto;width:100%}.DriversComparisonChart_seriesTable__NybPR tr{cursor:pointer;position:relative}.DriversComparisonChart_seriesTable__NybPR td:not(:first-child),.DriversComparisonChart_seriesTable__NybPR th:not(:first-child){text-align:right}.DriversComparisonChart_seriesColSeries__--0mj{text-align:left;vertical-align:middle}.DriversComparisonChart_rowHidden__Fwhna{opacity:.4}.DriversComparisonChart_colorSwatch__o3ZVr{border-radius:2px;display:inline-flex;flex-shrink:0;height:10px;margin-right:var(--p-2);width:10px}.DriversComparisonChart_seriesLabel__Aidof{display:-webkit-box;-webkit-line-clamp:3;max-width:60vw;min-width:0;-webkit-box-orient:vertical;white-space:break-spaces}.DriversComparisonChart_chartContainer__1eM-O{margin-left:calc(var(--page-x-padding)*-1 + 26px);max-width:calc(100% + 60px);transition:opacity .3s ease-out;width:calc(100% + 60px)}.DriversComparisonChart_chartContainer__1eM-O .recharts-yAxis-tick-labels{display:none}@media (max-width:768px){.DriversComparisonChart_chartContainer__1eM-O{margin-left:calc(var(--page-x-padding)*-1 + 10px);width:calc(100% + 30px)}}";
|
|
4
4
|
var S = {"root":"DriversComparisonChart_root__GLnlF","chartShell":"DriversComparisonChart_chartShell__0AzAz","chartShellLoading":"DriversComparisonChart_chartShellLoading__wTLod","chartSlot":"DriversComparisonChart_chartSlot__WKe6N","loadingLayer":"DriversComparisonChart_loadingLayer__HlEmA","loadingMessage":"DriversComparisonChart_loadingMessage__Li3S7","loadingText":"DriversComparisonChart_loadingText__0y3Ms","chartWithOverlay":"DriversComparisonChart_chartWithOverlay__SMToK","chartInteractiveLayer":"DriversComparisonChart_chartInteractiveLayer__0aquh","chartInteractiveDimmed":"DriversComparisonChart_chartInteractiveDimmed__us1dv","chartEmptyOverlay":"DriversComparisonChart_chartEmptyOverlay__eXqzk","chartEmptyBlurb":"DriversComparisonChart_chartEmptyBlurb__Tjy9E","seriesEmptyWrap":"DriversComparisonChart_seriesEmptyWrap__RyRs5","seriesSection":"DriversComparisonChart_seriesSection__yrf4I","seriesTableWrapper":"DriversComparisonChart_seriesTableWrapper__oredC","seriesTableContainer":"DriversComparisonChart_seriesTableContainer__dhfXK","seriesScrollbar":"DriversComparisonChart_seriesScrollbar__2jgk6","seriesTable":"DriversComparisonChart_seriesTable__NybPR","seriesColSeries":"DriversComparisonChart_seriesColSeries__--0mj","rowHidden":"DriversComparisonChart_rowHidden__Fwhna","colorSwatch":"DriversComparisonChart_colorSwatch__o3ZVr","seriesLabel":"DriversComparisonChart_seriesLabel__Aidof","chartContainer":"DriversComparisonChart_chartContainer__1eM-O"};
|
|
5
5
|
styleInject(css_248z);
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import styleInject from 'style-inject';
|
|
2
2
|
|
|
3
|
-
var css_248z = "@media (max-width:768px){:root{--page-x-padding:var(--p-6);--page-y-padding:var(--p-6)}}.PerformanceChart_root__sda5D{transition:opacity .3s ease-out}.PerformanceChart_root__sda5D,.PerformanceChart_viewTabs__5aHg1{display:flex;flex:1;flex-direction:column;min-height:0;width:100%}.PerformanceChart_toolbarRow__SwRJc{align-items:center;display:flex;flex-direction:row;flex-wrap:wrap;gap:var(--p-4);margin-bottom:var(--p-4);width:100%}.PerformanceChart_toolBarRight__ODMr4{align-items:center;display:flex;flex-grow:1;gap:var(--p-4);justify-content:flex-end}.PerformanceChart_viewTabsList__fNv-x{align-items:center;background-color:transparent;display:inline-flex;flex-shrink:0;flex-wrap:wrap;gap:var(--p-2);margin-bottom:0}.PerformanceChart_perHorizonChartWrap__j15JS{min-height:var(--chart-height);position:relative;width:100%}.PerformanceChart_perHorizonChartWrapLoading__1ZGCz .PerformanceChart_chartContainer__qXeA8{opacity:.3;pointer-events:none}.PerformanceChart_perHorizonChartWrapLoading__1ZGCz .recharts-line-dots{display:none}.PerformanceChart_performanceLoadingLayer__GmfFi{inset:0;pointer-events:none;position:absolute;z-index:10}.PerformanceChart_chartEmptyOverlay__zrZ5M{align-items:center;display:flex;inset:0;justify-content:center;padding:var(--p-6);pointer-events:none;position:absolute;z-index:11}.PerformanceChart_chartEmptyOverlay__zrZ5M a{pointer-events:auto}.PerformanceChart_performanceLoadingText__Jwxg3{color:var(--foreground);font-size:16px;font-weight:500}.PerformanceChart_loading__sCsV8{opacity:.5}.PerformanceChart_loaded__a-dM9{opacity:1}.PerformanceChart_chartContainer__qXeA8{margin-left:calc(var(--page-x-padding)*-1 + 26px);max-width:calc(100% + 60px);transition:opacity .3s ease-out;width:calc(100% + 60px)}.PerformanceChart_chartContainer__qXeA8 [data-slot=skeleton]{filter:opacity(.6);height:100%!important;position:relative;width:100%!important}.PerformanceChart_loaded__a-dM9 .PerformanceChart_chartContainer__qXeA8 [data-slot=skeleton]{opacity:0}.PerformanceChart_chartContainer__qXeA8 svg{overflow:visible}@media (max-width:768px){.PerformanceChart_chartContainer__qXeA8{margin-left:calc(var(--page-x-padding)*-1 + 10px);max-width:calc(100% + 30px);width:calc(100% + 30px)}}.PerformanceChart_isEmpty__Xutg2 .PerformanceChart_chartContainer__qXeA8{opacity:.3;pointer-events:none}.PerformanceChart_isEmpty__Xutg2 .recharts-line-dots{display:none}.PerformanceChart_tableSection__tTV55{--side-margin:calc(var(--page-x-padding)*-1);display:flex;flex-direction:column;gap:var(--p-4);margin:var(--p-6) var(--side-margin) 0 var(--side-margin)}.PerformanceChart_tableWrapper__3uB5y{position:relative}.PerformanceChart_tableContainer__PyPUV{overflow-x:auto;position:relative;width:100%}.PerformanceChart_table__8GI8O{background:var(--card);border-radius:14px;box-shadow:inset 0 0 0 1px var(--border)}.PerformanceChart_table__8GI8O td:first-child,.PerformanceChart_table__8GI8O th:first-child{padding-left:var(--p-10)!important}.PerformanceChart_table__8GI8O td:last-child,.PerformanceChart_table__8GI8O th:last-child{padding-right:0!important}.PerformanceChart_tableCustomDataFooterRow__011Jx td{border-top:1px solid var(--border);text-align:center;vertical-align:middle}.PerformanceChart_tableCustomDataFooterCell__zeEFL:first-child:last-child{padding:0!important;text-align:center}.PerformanceChart_tableCustomDataFooterCell__zeEFL:first-child:last-child button{border-radius:0;height:
|
|
3
|
+
var css_248z = "@media (max-width:768px){:root{--page-x-padding:var(--p-6);--page-y-padding:var(--p-6)}}.PerformanceChart_root__sda5D{transition:opacity .3s ease-out}.PerformanceChart_root__sda5D,.PerformanceChart_viewTabs__5aHg1{display:flex;flex:1;flex-direction:column;min-height:0;width:100%}.PerformanceChart_toolbarRow__SwRJc{align-items:center;display:flex;flex-direction:row;flex-wrap:wrap;gap:var(--p-4);margin-bottom:var(--p-4);width:100%}.PerformanceChart_toolBarRight__ODMr4{align-items:center;display:flex;flex-grow:1;gap:var(--p-4);justify-content:flex-end}.PerformanceChart_viewTabsList__fNv-x{align-items:center;background-color:transparent;display:inline-flex;flex-shrink:0;flex-wrap:wrap;gap:var(--p-2);margin-bottom:0}.PerformanceChart_perHorizonChartWrap__j15JS{min-height:var(--chart-height);position:relative;width:100%}.PerformanceChart_perHorizonChartWrapLoading__1ZGCz .PerformanceChart_chartContainer__qXeA8{opacity:.3;pointer-events:none}.PerformanceChart_perHorizonChartWrapLoading__1ZGCz .recharts-line-dots{display:none}.PerformanceChart_performanceLoadingLayer__GmfFi{inset:0;pointer-events:none;position:absolute;z-index:10}.PerformanceChart_chartEmptyOverlay__zrZ5M{align-items:center;display:flex;inset:0;justify-content:center;padding:var(--p-6);pointer-events:none;position:absolute;z-index:11}.PerformanceChart_chartEmptyOverlay__zrZ5M a{pointer-events:auto}.PerformanceChart_performanceLoadingText__Jwxg3{color:var(--foreground);font-size:16px;font-weight:500}.PerformanceChart_loading__sCsV8{opacity:.5}.PerformanceChart_loaded__a-dM9{opacity:1}.PerformanceChart_chartContainer__qXeA8{margin-left:calc(var(--page-x-padding)*-1 + 26px);max-width:calc(100% + 60px);transition:opacity .3s ease-out;width:calc(100% + 60px)}.PerformanceChart_chartContainer__qXeA8 [data-slot=skeleton]{filter:opacity(.6);height:100%!important;position:relative;width:100%!important}.PerformanceChart_loaded__a-dM9 .PerformanceChart_chartContainer__qXeA8 [data-slot=skeleton]{opacity:0}.PerformanceChart_chartContainer__qXeA8 svg{overflow:visible}@media (max-width:768px){.PerformanceChart_chartContainer__qXeA8{margin-left:calc(var(--page-x-padding)*-1 + 10px);max-width:calc(100% + 30px);width:calc(100% + 30px)}}.PerformanceChart_isEmpty__Xutg2 .PerformanceChart_chartContainer__qXeA8{opacity:.3;pointer-events:none}.PerformanceChart_isEmpty__Xutg2 .recharts-line-dots{display:none}.PerformanceChart_tableSection__tTV55{--side-margin:calc(var(--page-x-padding)*-1);display:flex;flex-direction:column;gap:var(--p-4);margin:var(--p-6) var(--side-margin) 0 var(--side-margin)}.PerformanceChart_tableWrapper__3uB5y{position:relative}.PerformanceChart_tableContainer__PyPUV{overflow-x:auto;position:relative;width:100%}.PerformanceChart_table__8GI8O{background:var(--card);border-radius:14px;box-shadow:inset 0 0 0 1px var(--border)}.PerformanceChart_table__8GI8O td:first-child,.PerformanceChart_table__8GI8O th:first-child{padding-left:var(--p-10)!important}.PerformanceChart_table__8GI8O td:last-child,.PerformanceChart_table__8GI8O th:last-child{padding-right:0!important}.PerformanceChart_tableCustomDataFooterRow__011Jx td{border-top:1px solid var(--border);text-align:center;vertical-align:middle}.PerformanceChart_tableCustomDataFooterCell__zeEFL:first-child:last-child{padding:0!important;text-align:center}.PerformanceChart_tableCustomDataFooterCell__zeEFL:first-child:last-child button{border-radius:0;height:var(--p-12);width:calc(100% - 2px)}.PerformanceChart_scrollbar__f3WD9{bottom:calc(var(--p-7)*-1 + 2px)!important}.PerformanceChart_forecastCell__vItmM{align-items:center;display:flex;gap:8px}.PerformanceChart_editCustomPerformanceButton__jmzox{margin:-12px 0 -8px}.PerformanceChart_colorCircle__-uXyr{border-radius:10px;flex-shrink:0;height:20px;margin-left:-10px;width:5px}.PerformanceChart_emptyState__UCpW4{color:var(--muted-foreground);display:block;left:0;padding:var(--p-4) var(--p-10);position:absolute;text-align:center;top:calc(50% - 4em);width:100%;z-index:1}.PerformanceChart_performanceLoadingLayer__GmfFi .PerformanceChart_emptyState__UCpW4{color:var(--foreground)}.PerformanceChart_emptyState__UCpW4 a{padding:0 var(--p-1);text-decoration:underline}.PerformanceChart_emptyState__UCpW4 a:hover{color:var(--sb-cyan-400)}";
|
|
4
4
|
var S = {"root":"PerformanceChart_root__sda5D","viewTabs":"PerformanceChart_viewTabs__5aHg1","toolbarRow":"PerformanceChart_toolbarRow__SwRJc","toolBarRight":"PerformanceChart_toolBarRight__ODMr4","viewTabsList":"PerformanceChart_viewTabsList__fNv-x","perHorizonChartWrap":"PerformanceChart_perHorizonChartWrap__j15JS","perHorizonChartWrapLoading":"PerformanceChart_perHorizonChartWrapLoading__1ZGCz","chartContainer":"PerformanceChart_chartContainer__qXeA8","performanceLoadingLayer":"PerformanceChart_performanceLoadingLayer__GmfFi","chartEmptyOverlay":"PerformanceChart_chartEmptyOverlay__zrZ5M","performanceLoadingText":"PerformanceChart_performanceLoadingText__Jwxg3","loading":"PerformanceChart_loading__sCsV8","loaded":"PerformanceChart_loaded__a-dM9","isEmpty":"PerformanceChart_isEmpty__Xutg2","tableSection":"PerformanceChart_tableSection__tTV55","tableWrapper":"PerformanceChart_tableWrapper__3uB5y","tableContainer":"PerformanceChart_tableContainer__PyPUV","table":"PerformanceChart_table__8GI8O","tableCustomDataFooterRow":"PerformanceChart_tableCustomDataFooterRow__011Jx","tableCustomDataFooterCell":"PerformanceChart_tableCustomDataFooterCell__zeEFL","scrollbar":"PerformanceChart_scrollbar__f3WD9","forecastCell":"PerformanceChart_forecastCell__vItmM","editCustomPerformanceButton":"PerformanceChart_editCustomPerformanceButton__jmzox","colorCircle":"PerformanceChart_colorCircle__-uXyr","emptyState":"PerformanceChart_emptyState__UCpW4"};
|
|
5
5
|
styleInject(css_248z);
|
|
6
6
|
|
package/dist/esm/index.js
CHANGED
|
@@ -15,6 +15,7 @@ export { AppHeaderHost, AppHeaderPortal } from './components/ui/AppHeader/AppHea
|
|
|
15
15
|
export { PAGE_HEADER_ACTIONS_ID, PAGE_HEADER_ID } from './components/ui/AppHeader/appChromeAnchors.js';
|
|
16
16
|
export { Avatar, AvatarFallback, AvatarImage } from './components/ui/Avatar/Avatar.js';
|
|
17
17
|
export { Badge } from './components/ui/Badge/Badge.js';
|
|
18
|
+
export { Banner } from './components/ui/Banner/Banner.js';
|
|
18
19
|
export { Chip } from './components/ui/Chip/Chip.js';
|
|
19
20
|
export { Kicker } from './components/ui/Kicker/Kicker.js';
|
|
20
21
|
export { PullQuote } from './components/ui/PullQuote/PullQuote.js';
|
|
@@ -25,7 +26,7 @@ export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader,
|
|
|
25
26
|
export { ChartLegend, ChartTooltip } from './components/ui/Chart/Chart.js';
|
|
26
27
|
export { THEMES } from './components/ui/Chart/Chart.types.js';
|
|
27
28
|
export { ChartAreaInteractive, chartConfig } from './components/ui/ChartAreaInteractive/ChartAreaInteractive.js';
|
|
28
|
-
export { DRAG_TIME_RANGE_PREFIX, encodeDragTimeRange, filterDataForTimeRange, findPinPositionForDate,
|
|
29
|
+
export { DRAG_TIME_RANGE_PREFIX, encodeDragTimeRange, filterDataForTimeRange, findPinPositionForDate, isAnalysisDone, isAnalysisFailed, isAnalysisNotFailed, isTimeRangePreset, longDateFormatter, parseDragTimeRange, shortDateFormatter } from './components/ui/ChartAreaInteractive/ChartAreaInteractive.helpers.js';
|
|
29
30
|
export { ChartLines, FORECAST_COLORS_MAP, FORECAST_LINE_COLORS, getForecastColor, getForecastQuantileBandColor, resolveQuantileBandFillForForecastLine } from './components/ui/ChartAreaInteractive/ChartLines.js';
|
|
30
31
|
export { DonutChart } from './components/ui/DonutChart/DonutChart.js';
|
|
31
32
|
export { BarChart } from './components/ui/BarChart/BarChart.js';
|
|
@@ -133,6 +134,15 @@ export { ChartLegendItem } from './components/ui/Chart/components/ChartLegendIte
|
|
|
133
134
|
export { CustomChartLegend } from './components/ui/Chart/components/CustomChartLegend/CustomChartLegend.js';
|
|
134
135
|
export { LightweightForecastChart } from './components/ui/Chart/lightweight/LightweightForecastChart.js';
|
|
135
136
|
export { ChartEmptyState } from './components/ui/Chart/components/ChartEmptyState/ChartEmptyState.js';
|
|
137
|
+
export { ConfidenceBands } from './components/ui/Chart/components/ConfidenceBands.js';
|
|
138
|
+
export { ForecastBoundaries } from './components/ui/Chart/components/ForecastBoundaries.js';
|
|
139
|
+
export { ForecastLine } from './components/ui/Chart/components/ForecastLine.js';
|
|
140
|
+
export { HistoricalLine } from './components/ui/Chart/components/HistoricalLine.js';
|
|
141
|
+
export { DEFAULT_QUANTILE_BAND_COLOR, QuantileBands } from './components/ui/Chart/components/QuantileBands.js';
|
|
142
|
+
export { formatCompactAxisNumber, formatDate, formatNumber } from './components/ui/Chart/tools/formatters.js';
|
|
143
|
+
export { useChartAnimation } from './components/ui/Chart/hooks/useChartAnimation.js';
|
|
144
|
+
export { useChartColors } from './components/ui/Chart/hooks/useChartColors.js';
|
|
145
|
+
export { useLegendState } from './components/ui/Chart/hooks/useLegendState.js';
|
|
136
146
|
export { ChartContainer, ChartStyle } from './components/ui/Chart/components/ChartContainer.js';
|
|
137
147
|
export { ChartTooltipContent } from './components/ui/Chart/components/ChartTooltipContent.js';
|
|
138
148
|
export { ChartLegendContent } from './components/ui/Chart/components/ChartLegendContent.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { AnalysesSelectorProps } from './AnalysesSelector.types';
|
|
2
|
-
export declare function AnalysesSelector({ items, selectedIds, onItemToggle, inlineMode, placeholder, disabled, size, variant, darker, className, triggerProps, onFailedItemClick, showHistorical, enableToggleHidden, maxVisibleItems, preventDeselection, hiddenSeries: hiddenSeriesProp, onToggleSeries, isAnalysisInProgress: isAnalysisInProgressProp, }: AnalysesSelectorProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare function AnalysesSelector({ items, selectedIds, onItemToggle, inlineMode, placeholder, disabled, size, variant, darker, className, triggerProps, onFailedItemClick, showHistorical, enableToggleHidden, maxVisibleItems, preventDeselection, hiddenSeries: hiddenSeriesProp, onToggleSeries, isAnalysisInProgress: isAnalysisInProgressProp, rename, }: AnalysesSelectorProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -16,7 +16,7 @@ export interface AnalysesSelectorProps {
|
|
|
16
16
|
inlineMode?: boolean;
|
|
17
17
|
placeholder?: string;
|
|
18
18
|
disabled?: boolean;
|
|
19
|
-
size?: '
|
|
19
|
+
size?: SelectTriggerProps['size'];
|
|
20
20
|
variant?: 'default' | 'clear';
|
|
21
21
|
darker?: boolean;
|
|
22
22
|
className?: string;
|
|
@@ -35,4 +35,10 @@ export interface AnalysesSelectorProps {
|
|
|
35
35
|
onToggleSeries?: (analysisId: number | string) => void;
|
|
36
36
|
/** Override default pending/running/cancelling detection for labels. */
|
|
37
37
|
isAnalysisInProgress?: (status?: string) => boolean;
|
|
38
|
+
rename?: {
|
|
39
|
+
value: string;
|
|
40
|
+
onChange: (value: string) => void | Promise<void>;
|
|
41
|
+
/** Only show Renamer when selected item id is in this set */
|
|
42
|
+
renameableItemIds: Set<number>;
|
|
43
|
+
};
|
|
38
44
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type SelectInlineRenamerProps = {
|
|
2
|
+
value: string;
|
|
3
|
+
/** Shown in trigger when not editing; defaults to `value`. */
|
|
4
|
+
displayLabel?: string;
|
|
5
|
+
onChange: (value: string) => void | Promise<void>;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
className?: string;
|
|
8
|
+
isRenaming: boolean;
|
|
9
|
+
onEnterRenaming: () => void;
|
|
10
|
+
};
|
|
11
|
+
export declare function SelectInlineRenamer({ value, displayLabel, onChange, onEnterRenaming, disabled, className, isRenaming, }: SelectInlineRenamerProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -12,3 +12,12 @@ export { CustomChartLegend } from './components/CustomChartLegend/CustomChartLeg
|
|
|
12
12
|
export { ChartContainer, ChartTooltip, ChartTooltipContent, ChartLegend, ChartLegendContent, ChartStyle, BaseChartWrapper, type BaseChartWrapperProps, };
|
|
13
13
|
export { LightweightForecastChart, type LightweightForecastChartProps, } from './lightweight/LightweightForecastChart';
|
|
14
14
|
export { ChartEmptyState, type ChartEmptyStateProps, type ChartEmptyStatusTone, } from './components/ChartEmptyState/ChartEmptyState';
|
|
15
|
+
export { ConfidenceBands } from './components/ConfidenceBands';
|
|
16
|
+
export { ForecastBoundaries } from './components/ForecastBoundaries';
|
|
17
|
+
export { ForecastLine } from './components/ForecastLine';
|
|
18
|
+
export { HistoricalLine } from './components/HistoricalLine';
|
|
19
|
+
export { DEFAULT_QUANTILE_BAND_COLOR, QuantileBands, } from './components/QuantileBands';
|
|
20
|
+
export { formatCompactAxisNumber, formatDate, formatNumber, } from './tools/formatters';
|
|
21
|
+
export { useChartAnimation } from './hooks/useChartAnimation';
|
|
22
|
+
export { useChartColors } from './hooks/useChartColors';
|
|
23
|
+
export { useLegendState } from './hooks/useLegendState';
|
|
@@ -5,7 +5,7 @@ export { ChartGrid } from './ChartGrid';
|
|
|
5
5
|
export { ChartLegendContent } from './ChartLegendContent';
|
|
6
6
|
export { ChartTooltipContent } from './ChartTooltipContent';
|
|
7
7
|
export { ForecastLine } from './ForecastLine';
|
|
8
|
-
export { formatDate, formatNumber } from '../tools/formatters';
|
|
8
|
+
export { formatCompactAxisNumber, formatDate, formatNumber, } from '../tools/formatters';
|
|
9
9
|
export { HistoricalLine } from './HistoricalLine';
|
|
10
10
|
export { useChartAnimation } from '../hooks/useChartAnimation';
|
|
11
11
|
export { useChartColors } from '../hooks/useChartColors';
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Format number for display (with k/m abbreviations)
|
|
2
|
+
* Format number for display (with k/m/b abbreviations)
|
|
3
3
|
*/
|
|
4
4
|
export declare const formatNumber: (value: number) => string;
|
|
5
|
+
/** Shorter Y-axis style labels (integer B/M/K) for tight layouts. */
|
|
6
|
+
export declare const formatCompactAxisNumber: (value: number) => string;
|
|
5
7
|
/**
|
|
6
8
|
* Format Y-axis number with smart rounding based on magnitude
|
|
7
9
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from './ChartAreaInteractive';
|
|
2
|
-
export
|
|
2
|
+
export { DRAG_TIME_RANGE_PREFIX, encodeDragTimeRange, filterDataForTimeRange, findPinPositionForDate, isAnalysisDone, isAnalysisFailed, isAnalysisNotFailed, isTimeRangePreset, longDateFormatter, parseDragTimeRange, shortDateFormatter, type FilterDataForTimeRangeOptions, type TimeRangePreset, } from './ChartAreaInteractive.helpers';
|
|
3
3
|
export * from './ChartAreaInteractive.types';
|
|
4
4
|
export * from './ChartLines';
|
|
5
5
|
export type { OverlayMode } from './ChartAreaInteractive.types';
|
|
@@ -4,7 +4,7 @@ declare function Select({ variant, ...props }: SelectProps & {
|
|
|
4
4
|
}): import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
declare function SelectGroup({ ...props }: SelectGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
declare function SelectValue({ ...props }: SelectValueProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
declare function SelectTrigger({ className, size, variant, darker, children, hideChevron, ...props }: SelectTriggerProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare function SelectTrigger({ className, size, variant, darker, children, hideChevron, asChild, ...props }: SelectTriggerProps): import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
declare function SelectContent({ className, children, position, ...props }: SelectContentProps): import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
declare function SelectItem({ className, children, selected, ...props }: SelectItemProps): import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
declare function SelectSeparator({ className, ...props }: SelectSeparatorProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -6,6 +6,7 @@ export interface SelectTriggerProps extends React.ComponentProps<typeof SelectPr
|
|
|
6
6
|
className?: string;
|
|
7
7
|
children?: React.ReactNode;
|
|
8
8
|
hideChevron?: boolean;
|
|
9
|
+
asChild?: boolean;
|
|
9
10
|
}
|
|
10
11
|
export type SelectProps = React.ComponentProps<typeof SelectPrimitive.Root>;
|
|
11
12
|
export type SelectGroupProps = React.ComponentProps<typeof SelectPrimitive.Group>;
|
|
@@ -13,6 +13,7 @@ export * from './components/ui/AnalysisLineIcon';
|
|
|
13
13
|
export * from './components/ui/AppHeader';
|
|
14
14
|
export * from './components/ui/Avatar';
|
|
15
15
|
export * from './components/ui/Badge';
|
|
16
|
+
export * from './components/ui/Banner';
|
|
16
17
|
export * from './components/ui/Chip';
|
|
17
18
|
export * from './components/ui/Kicker';
|
|
18
19
|
export * from './components/ui/PullQuote';
|
package/package.json
CHANGED
|
@@ -5,6 +5,28 @@
|
|
|
5
5
|
flex-wrap wrap
|
|
6
6
|
// margin-left calc(var(--p-2) * -1)
|
|
7
7
|
|
|
8
|
+
.selectTriggerRenamer
|
|
9
|
+
min-width 0
|
|
10
|
+
|
|
11
|
+
.selectInlineRenamer
|
|
12
|
+
display flex
|
|
13
|
+
align-items center
|
|
14
|
+
min-width 0
|
|
15
|
+
|
|
16
|
+
.selectInlineRenamerInput
|
|
17
|
+
padding 0 var(--p-2)
|
|
18
|
+
margin-left calc(var(--p-2) * -1)
|
|
19
|
+
max-width calc(100% - var(--p-4)) !important
|
|
20
|
+
border-radius var(--p-2)
|
|
21
|
+
|
|
22
|
+
.renamerEditButton
|
|
23
|
+
opacity 0.5
|
|
24
|
+
flex-shrink 0
|
|
25
|
+
transition opacity 0.2s ease-out
|
|
26
|
+
|
|
27
|
+
.selectInlineRenamer:hover &
|
|
28
|
+
opacity 1
|
|
29
|
+
|
|
8
30
|
.variant-default.single
|
|
9
31
|
background-color var(--background)
|
|
10
32
|
border-radius var(--p-4)
|
|
@@ -33,6 +55,10 @@
|
|
|
33
55
|
&.dimmed
|
|
34
56
|
opacity 0.5
|
|
35
57
|
|
|
58
|
+
.itemBadge
|
|
59
|
+
margin-top -2px
|
|
60
|
+
margin-bottom -2px
|
|
61
|
+
|
|
36
62
|
.icon
|
|
37
63
|
width 16px
|
|
38
64
|
height 16px
|
|
@@ -69,24 +95,59 @@
|
|
|
69
95
|
object-fit contain
|
|
70
96
|
|
|
71
97
|
.label
|
|
72
|
-
flex
|
|
98
|
+
flex 1 1 auto
|
|
99
|
+
min-width 0
|
|
73
100
|
font-size var(--text-xs)
|
|
74
101
|
white-space nowrap
|
|
102
|
+
overflow hidden
|
|
103
|
+
text-overflow ellipsis
|
|
75
104
|
|
|
76
105
|
.selectItemContent
|
|
77
106
|
display flex
|
|
107
|
+
flex-direction row
|
|
108
|
+
flex-wrap nowrap
|
|
78
109
|
align-items center
|
|
79
110
|
gap var(--p-2)
|
|
80
111
|
width 100%
|
|
112
|
+
min-width 0
|
|
113
|
+
flex 1
|
|
81
114
|
|
|
82
115
|
.selectTrigger
|
|
83
116
|
min-width auto
|
|
84
117
|
height auto
|
|
85
118
|
font-size var(--text-xs)
|
|
86
119
|
|
|
120
|
+
.selectTriggerRenaming
|
|
121
|
+
width 100% !important
|
|
122
|
+
max-width 100% !important
|
|
123
|
+
|
|
124
|
+
.selectTriggerContent
|
|
125
|
+
flex 1
|
|
126
|
+
width 100%
|
|
127
|
+
min-width 0
|
|
128
|
+
|
|
129
|
+
.selectTriggerRenamer
|
|
130
|
+
min-width 0
|
|
131
|
+
|
|
87
132
|
.selectTriggerLabelWithId
|
|
88
133
|
display flex
|
|
89
134
|
|
|
135
|
+
.selectTriggerContent
|
|
136
|
+
display flex
|
|
137
|
+
align-items center
|
|
138
|
+
gap var(--p-2)
|
|
139
|
+
min-width 0
|
|
140
|
+
min-height var(--p-9)
|
|
141
|
+
|
|
142
|
+
> :last-child
|
|
143
|
+
flex-shrink 0
|
|
144
|
+
min-width 0
|
|
145
|
+
max-width 100%
|
|
146
|
+
|
|
147
|
+
.selectTriggerRenamerDisabled
|
|
148
|
+
button
|
|
149
|
+
pointer-events none
|
|
150
|
+
|
|
90
151
|
.itemLabelWithId
|
|
91
152
|
flex-grow 1
|
|
92
153
|
min-width 0
|
|
@@ -8,12 +8,20 @@ interface CssExports {
|
|
|
8
8
|
'iconImage': string;
|
|
9
9
|
'iconWrapper': string;
|
|
10
10
|
'item': string;
|
|
11
|
+
'itemBadge': string;
|
|
11
12
|
'itemLabelWithId': string;
|
|
12
13
|
'label': string;
|
|
14
|
+
'renamerEditButton': string;
|
|
13
15
|
'root': string;
|
|
16
|
+
'selectInlineRenamer': string;
|
|
17
|
+
'selectInlineRenamerInput': string;
|
|
14
18
|
'selectItemContent': string;
|
|
15
19
|
'selectTrigger': string;
|
|
20
|
+
'selectTriggerContent': string;
|
|
16
21
|
'selectTriggerLabelWithId': string;
|
|
22
|
+
'selectTriggerRenamer': string;
|
|
23
|
+
'selectTriggerRenamerDisabled': string;
|
|
24
|
+
'selectTriggerRenaming': string;
|
|
17
25
|
'single': string;
|
|
18
26
|
'variant-default': string;
|
|
19
27
|
}
|
|
@@ -1,8 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import cn from 'classnames';
|
|
2
|
+
import {
|
|
3
|
+
type KeyboardEvent,
|
|
4
|
+
useEffect,
|
|
5
|
+
useMemo,
|
|
6
|
+
useRef,
|
|
7
|
+
useState,
|
|
8
|
+
} from 'react';
|
|
9
|
+
|
|
10
|
+
import { AnalysisLineIcon } from '#uilib/components/ui/AnalysisLineIcon';
|
|
11
|
+
import { Badge } from '#uilib/components/ui/Badge';
|
|
12
|
+
import { Button } from '#uilib/components/ui/Button';
|
|
13
|
+
import { LabelWithId } from '#uilib/components/ui/LabelWithId';
|
|
6
14
|
import {
|
|
7
15
|
Select,
|
|
8
16
|
SelectContent,
|
|
@@ -10,16 +18,16 @@ import {
|
|
|
10
18
|
SelectTrigger,
|
|
11
19
|
SelectValue,
|
|
12
20
|
} from '#uilib/components/ui/Select';
|
|
13
|
-
import { useEffect, useMemo, useRef } from 'react';
|
|
14
|
-
|
|
15
|
-
import { AnalysisLineIcon } from '#uilib/components/ui/AnalysisLineIcon';
|
|
16
|
-
import { Badge } from '#uilib/components/ui/Badge';
|
|
17
|
-
import { Button } from '#uilib/components/ui/Button';
|
|
18
|
-
import { LabelWithId } from '#uilib/components/ui/LabelWithId';
|
|
19
|
-
import S from './AnalysesSelector.styl';
|
|
20
21
|
import { TextShimmer } from '#uilib/components/ui/TextShimmer/TextShimmer';
|
|
21
|
-
import cn from 'classnames';
|
|
22
22
|
import { getLatestByUpdatedAt } from '#uilib/utils/analysisDate';
|
|
23
|
+
import { EyeClosedIcon, EyeIcon } from '@phosphor-icons/react';
|
|
24
|
+
|
|
25
|
+
import S from './AnalysesSelector.styl';
|
|
26
|
+
import type {
|
|
27
|
+
AnalysesSelectorItem,
|
|
28
|
+
AnalysesSelectorProps,
|
|
29
|
+
} from './AnalysesSelector.types';
|
|
30
|
+
import { SelectInlineRenamer } from './SelectInlineRenamer';
|
|
23
31
|
|
|
24
32
|
const isFailed = (item: AnalysesSelectorItem) =>
|
|
25
33
|
item.status?.toLowerCase() === 'fail';
|
|
@@ -29,12 +37,25 @@ const isDashedIcon = (item: AnalysesSelectorItem) => item.id !== -1;
|
|
|
29
37
|
const defaultIsAnalysisInProgress = (status?: string) =>
|
|
30
38
|
['pending', 'running', 'cancelling'].includes(status?.toLowerCase() ?? '');
|
|
31
39
|
|
|
40
|
+
const shouldBlockSelectKeydownWhileRenaming = (e: KeyboardEvent) => {
|
|
41
|
+
if (!(e.target instanceof HTMLInputElement)) {
|
|
42
|
+
return true;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
e.key === 'ArrowUp' ||
|
|
47
|
+
e.key === 'ArrowDown' ||
|
|
48
|
+
e.key === ' ' ||
|
|
49
|
+
e.key === 'Enter'
|
|
50
|
+
);
|
|
51
|
+
};
|
|
52
|
+
|
|
32
53
|
function renderItemContent(item: AnalysesSelectorItem) {
|
|
33
54
|
const failed = isFailed(item);
|
|
34
55
|
|
|
35
56
|
if (failed) {
|
|
36
57
|
return (
|
|
37
|
-
<Badge variant="red"
|
|
58
|
+
<Badge variant="red" className={S.itemBadge}>
|
|
38
59
|
failed
|
|
39
60
|
</Badge>
|
|
40
61
|
);
|
|
@@ -91,6 +112,7 @@ export function AnalysesSelector({
|
|
|
91
112
|
hiddenSeries: hiddenSeriesProp = new Set(),
|
|
92
113
|
onToggleSeries = () => {},
|
|
93
114
|
isAnalysisInProgress: isAnalysisInProgressProp = defaultIsAnalysisInProgress,
|
|
115
|
+
rename,
|
|
94
116
|
}: AnalysesSelectorProps) {
|
|
95
117
|
const historicalAutoSelectedRef = useRef(false);
|
|
96
118
|
const hiddenSeries = hiddenSeriesProp;
|
|
@@ -215,6 +237,22 @@ export function AnalysesSelector({
|
|
|
215
237
|
}
|
|
216
238
|
}, [showHistorical, selectedIds, onItemToggle]);
|
|
217
239
|
|
|
240
|
+
const selectedItem = items.find(item => selectedSet.has(item.id)) ?? items[0];
|
|
241
|
+
const selectedId = selectedItem?.id;
|
|
242
|
+
|
|
243
|
+
const [isRenaming, setIsRenaming] = useState(false);
|
|
244
|
+
const [selectOpen, setSelectOpen] = useState(false);
|
|
245
|
+
|
|
246
|
+
useEffect(() => {
|
|
247
|
+
setIsRenaming(false);
|
|
248
|
+
}, [selectedId, rename?.value]);
|
|
249
|
+
|
|
250
|
+
useEffect(() => {
|
|
251
|
+
if (isRenaming) {
|
|
252
|
+
setSelectOpen(false);
|
|
253
|
+
}
|
|
254
|
+
}, [isRenaming]);
|
|
255
|
+
|
|
218
256
|
const handleSelectValue = (value: string) => {
|
|
219
257
|
if (!value) return;
|
|
220
258
|
const id = /^-?\d+$/.test(value) ? parseInt(value, 10) : value;
|
|
@@ -337,9 +375,48 @@ export function AnalysesSelector({
|
|
|
337
375
|
|
|
338
376
|
if (items.length === 0) return null;
|
|
339
377
|
|
|
340
|
-
const selectedId =
|
|
341
|
-
items.find(item => selectedSet.has(item.id))?.id ?? items[0]?.id;
|
|
342
378
|
const selectValue = selectedId != null ? String(selectedId) : '';
|
|
379
|
+
const showRenamer =
|
|
380
|
+
rename && selectedItem && rename.renameableItemIds.has(selectedItem.id);
|
|
381
|
+
const singleItemSelect = items.length < 2;
|
|
382
|
+
|
|
383
|
+
const { className: triggerClassName, ...restTriggerProps } =
|
|
384
|
+
triggerProps ?? {};
|
|
385
|
+
|
|
386
|
+
const triggerStyle = {
|
|
387
|
+
minWidth: 'auto',
|
|
388
|
+
height: 'auto',
|
|
389
|
+
fontSize: 'var(--text-xs)',
|
|
390
|
+
pointerEvents:
|
|
391
|
+
singleItemSelect && !showRenamer ? ('none' as const) : undefined,
|
|
392
|
+
};
|
|
393
|
+
|
|
394
|
+
const triggerClassNameMerged = cn(
|
|
395
|
+
S.selectTrigger,
|
|
396
|
+
isRenaming && S.selectTriggerRenaming,
|
|
397
|
+
triggerClassName,
|
|
398
|
+
);
|
|
399
|
+
|
|
400
|
+
const renamerTriggerContent = showRenamer ? (
|
|
401
|
+
<div
|
|
402
|
+
className={cn(
|
|
403
|
+
S.selectTriggerContent,
|
|
404
|
+
disabled && S.selectTriggerRenamerDisabled,
|
|
405
|
+
)}
|
|
406
|
+
>
|
|
407
|
+
{renderItemContent(selectedItem)}
|
|
408
|
+
{renderIcon(selectedItem.icon)}
|
|
409
|
+
<SelectInlineRenamer
|
|
410
|
+
value={rename.value}
|
|
411
|
+
displayLabel={selectedItem.label}
|
|
412
|
+
onChange={rename.onChange}
|
|
413
|
+
disabled={disabled}
|
|
414
|
+
className={S.selectTriggerRenamer}
|
|
415
|
+
isRenaming={isRenaming}
|
|
416
|
+
onEnterRenaming={() => setIsRenaming(prev => !prev)}
|
|
417
|
+
/>
|
|
418
|
+
</div>
|
|
419
|
+
) : null;
|
|
343
420
|
|
|
344
421
|
return (
|
|
345
422
|
<div className={cn(S.root, className)}>
|
|
@@ -347,29 +424,61 @@ export function AnalysesSelector({
|
|
|
347
424
|
value={selectValue}
|
|
348
425
|
onValueChange={handleSelectValue}
|
|
349
426
|
disabled={disabled}
|
|
427
|
+
open={isRenaming || singleItemSelect ? false : selectOpen}
|
|
428
|
+
onOpenChange={open => {
|
|
429
|
+
if (!isRenaming && !singleItemSelect) {
|
|
430
|
+
setSelectOpen(open);
|
|
431
|
+
}
|
|
432
|
+
}}
|
|
350
433
|
>
|
|
351
434
|
<SelectTrigger
|
|
435
|
+
asChild={showRenamer}
|
|
352
436
|
size={size}
|
|
353
437
|
variant={variant}
|
|
354
438
|
darker={darker}
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
439
|
+
hideChevron={singleItemSelect}
|
|
440
|
+
{...restTriggerProps}
|
|
441
|
+
{...(showRenamer
|
|
442
|
+
? {}
|
|
443
|
+
: {
|
|
444
|
+
style: triggerStyle,
|
|
445
|
+
className: triggerClassNameMerged,
|
|
446
|
+
onKeyDown: (e: KeyboardEvent) => {
|
|
447
|
+
if (isRenaming && shouldBlockSelectKeydownWhileRenaming(e)) {
|
|
448
|
+
e.preventDefault();
|
|
449
|
+
e.stopPropagation();
|
|
450
|
+
}
|
|
451
|
+
},
|
|
452
|
+
})}
|
|
364
453
|
>
|
|
365
|
-
|
|
454
|
+
{showRenamer ? (
|
|
455
|
+
<div
|
|
456
|
+
className={triggerClassNameMerged}
|
|
457
|
+
style={triggerStyle}
|
|
458
|
+
onKeyDown={e => {
|
|
459
|
+
if (isRenaming && shouldBlockSelectKeydownWhileRenaming(e)) {
|
|
460
|
+
e.preventDefault();
|
|
461
|
+
e.stopPropagation();
|
|
462
|
+
}
|
|
463
|
+
}}
|
|
464
|
+
>
|
|
465
|
+
{renamerTriggerContent}
|
|
466
|
+
</div>
|
|
467
|
+
) : (
|
|
468
|
+
<LabelWithId
|
|
469
|
+
className={S.selectTriggerLabelWithId}
|
|
470
|
+
id={selectValue}
|
|
471
|
+
label={<SelectValue placeholder={selectPlaceholder} />}
|
|
472
|
+
/>
|
|
473
|
+
)}
|
|
366
474
|
</SelectTrigger>
|
|
367
475
|
<SelectContent>
|
|
368
476
|
{items.map(item => (
|
|
369
477
|
<SelectItem
|
|
370
478
|
key={item.id}
|
|
371
479
|
value={String(item.id)}
|
|
372
|
-
selected={
|
|
480
|
+
selected={selectedSet.has(item.id)}
|
|
481
|
+
textValue={item.label}
|
|
373
482
|
>
|
|
374
483
|
{renderSelectItem(item)}
|
|
375
484
|
</SelectItem>
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
|
|
3
2
|
import { SelectTriggerProps } from '#uilib/components/ui/Select/Select.types';
|
|
4
3
|
|
|
5
4
|
export interface AnalysesSelectorItem {
|
|
@@ -19,7 +18,7 @@ export interface AnalysesSelectorProps {
|
|
|
19
18
|
inlineMode?: boolean;
|
|
20
19
|
placeholder?: string;
|
|
21
20
|
disabled?: boolean;
|
|
22
|
-
size?: '
|
|
21
|
+
size?: SelectTriggerProps['size'];
|
|
23
22
|
variant?: 'default' | 'clear';
|
|
24
23
|
darker?: boolean;
|
|
25
24
|
className?: string;
|
|
@@ -38,4 +37,10 @@ export interface AnalysesSelectorProps {
|
|
|
38
37
|
onToggleSeries?: (analysisId: number | string) => void;
|
|
39
38
|
/** Override default pending/running/cancelling detection for labels. */
|
|
40
39
|
isAnalysisInProgress?: (status?: string) => boolean;
|
|
40
|
+
rename?: {
|
|
41
|
+
value: string;
|
|
42
|
+
onChange: (value: string) => void | Promise<void>;
|
|
43
|
+
/** Only show Renamer when selected item id is in this set */
|
|
44
|
+
renameableItemIds: Set<number>;
|
|
45
|
+
};
|
|
41
46
|
}
|