@sybilion/uilib 1.2.26 → 1.3.1

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 (137) hide show
  1. package/dist/esm/components/ui/Chart/Chart.js +5 -0
  2. package/dist/esm/components/ui/Chart/components/BaseChartWrapper.js +7 -32
  3. package/dist/esm/components/ui/Chart/components/ChartEmptyState/ChartEmptyState.js +21 -0
  4. package/dist/esm/components/ui/Chart/components/ChartEmptyState/ChartEmptyState.styl.js +7 -0
  5. package/dist/esm/components/ui/Chart/lightweight/LightweightForecastChart.js +460 -0
  6. package/dist/esm/components/ui/Chart/lightweight/LightweightForecastChart.styl.js +7 -0
  7. package/dist/esm/components/ui/Chart/lightweight/chartTime.js +16 -0
  8. package/dist/esm/components/ui/Chart/lightweight/lightweightForecastChart.helpers.js +114 -0
  9. package/dist/esm/components/ui/Chart/lightweight/quantileBandCustomSeries.js +147 -0
  10. package/dist/esm/components/ui/Chart/quantileBandConeChartData.js +131 -0
  11. package/dist/esm/components/ui/Chart/tools/chartPlotGeometry.js +65 -0
  12. package/dist/esm/components/ui/ChartAreaInteractive/ChartAreaInteractive.helpers.js +37 -1
  13. package/dist/esm/components/ui/ChartAreaInteractive/ChartAreaInteractive.js +5 -2
  14. package/dist/esm/components/ui/ChartAreaInteractive/TimeRangeBrushLayer.js +205 -0
  15. package/dist/esm/components/ui/ChartAreaInteractive/TimeRangeBrushLayer.styl.js +7 -0
  16. package/dist/esm/components/ui/ChartAreaInteractive/TimeRangeBrushLayout.helpers.js +37 -0
  17. package/dist/esm/components/ui/ChartAreaInteractive/overlays/IntervalsOverlay/IntervalsOverlay.hooks.js +1 -0
  18. package/dist/esm/components/ui/ChartAreaInteractive/overlays/PinOverlay/PinOverlay.js +7 -60
  19. package/dist/esm/components/ui/ChartAreaInteractive/overlays/PinOverlay/PinOverlay.styl.js +2 -2
  20. package/dist/esm/components/ui/ChartAreaInteractive/overlays/ThresholdsOverlay/ThresholdsOverlay.hooks.js +1 -0
  21. package/dist/esm/components/ui/ChartAreaInteractive/overlays/useChartYRange.js +2 -4
  22. package/dist/esm/components/ui/ChartAreaInteractive/overlays/useQuantileBands.js +4 -102
  23. package/dist/esm/components/ui/TimeRangeControls/TimeRangeControls.js +7 -2
  24. package/dist/esm/components/ui/WorldMap/WorldMap.js +11 -0
  25. package/dist/esm/components/ui/WorldMap/WorldMap.styl.js +7 -0
  26. package/dist/esm/components/widgets/DriverCard/DriverCard.js +89 -0
  27. package/dist/esm/components/widgets/DriverCard/DriverCard.styl.js +7 -0
  28. package/dist/esm/components/widgets/DriverCard/DriverPerformanceChart.js +83 -0
  29. package/dist/esm/components/widgets/DriverCard/DriverPerformanceChart.styl.js +7 -0
  30. package/dist/esm/components/widgets/DriverCard/driverPerformanceChartData.js +50 -0
  31. package/dist/esm/components/widgets/DriverMap/DriverMap.js +2 -2
  32. package/dist/esm/components/widgets/DriverMap/DriverMap.styl.js +2 -2
  33. package/dist/esm/index.js +4 -2
  34. package/dist/esm/types/src/components/ui/Chart/Chart.d.ts +2 -0
  35. package/dist/esm/types/src/components/ui/Chart/components/BaseChartWrapper.d.ts +2 -1
  36. package/dist/esm/types/src/components/ui/Chart/components/ChartEmptyState/ChartEmptyState.d.ts +14 -0
  37. package/dist/esm/types/src/components/ui/Chart/lightweight/LightweightForecastChart.d.ts +26 -0
  38. package/dist/esm/types/src/components/ui/Chart/lightweight/chartTime.d.ts +5 -0
  39. package/dist/esm/types/src/components/ui/Chart/lightweight/lightweightForecastChart.helpers.d.ts +13 -0
  40. package/dist/esm/types/src/components/ui/Chart/lightweight/quantileBandCustomSeries.d.ts +24 -0
  41. package/dist/esm/types/src/components/ui/Chart/quantileBandConeChartData.d.ts +7 -0
  42. package/dist/esm/types/src/components/ui/Chart/tools/chartPlotGeometry.d.ts +30 -0
  43. package/dist/esm/types/src/components/ui/ChartAreaInteractive/ChartAreaInteractive.d.ts +1 -1
  44. package/dist/esm/types/src/components/ui/ChartAreaInteractive/ChartAreaInteractive.helpers.d.ts +11 -2
  45. package/dist/esm/types/src/components/ui/ChartAreaInteractive/ChartAreaInteractive.types.d.ts +2 -2
  46. package/dist/esm/types/src/components/ui/ChartAreaInteractive/TimeRangeBrushLayer.d.ts +15 -0
  47. package/dist/esm/types/src/components/ui/ChartAreaInteractive/TimeRangeBrushLayout.helpers.d.ts +14 -0
  48. package/dist/esm/types/src/components/ui/ChartAreaInteractive/overlays/PinOverlay/PinOverlay.d.ts +1 -1
  49. package/dist/esm/types/src/components/ui/Page/PageColumns/PageColumns.d.ts +1 -1
  50. package/dist/esm/types/src/components/ui/TimeRangeControls/TimeRangeControls.d.ts +5 -7
  51. package/dist/esm/types/src/components/ui/WorldMap/WorldMap.d.ts +4 -0
  52. package/dist/esm/types/src/components/ui/WorldMap/index.d.ts +2 -0
  53. package/dist/esm/types/src/components/widgets/DriverCard/DriverCard.d.ts +9 -0
  54. package/dist/esm/types/src/components/widgets/DriverCard/DriverPerformanceChart.d.ts +5 -0
  55. package/dist/esm/types/src/components/widgets/DriverCard/driverPerformanceChartData.d.ts +7 -0
  56. package/dist/esm/types/src/components/widgets/DriverCard/index.d.ts +1 -0
  57. package/dist/esm/types/src/components/widgets/DriverMap/index.d.ts +0 -2
  58. package/dist/esm/types/src/docs/pages/LightweightChartPage.d.ts +1 -0
  59. package/dist/esm/types/src/docs/pages/PageColumnsPage.d.ts +1 -0
  60. package/dist/esm/types/src/docs/pages/WorldMapPage.d.ts +1 -0
  61. package/dist/esm/types/src/index.d.ts +2 -0
  62. package/package.json +3 -2
  63. package/src/components/ui/Chart/Chart.tsx +9 -0
  64. package/src/components/ui/Chart/components/BaseChartWrapper.tsx +8 -41
  65. package/src/components/ui/Chart/components/ChartEmptyState/ChartEmptyState.styl +60 -0
  66. package/src/components/ui/Chart/components/ChartEmptyState/ChartEmptyState.styl.d.ts +15 -0
  67. package/src/components/ui/Chart/components/ChartEmptyState/ChartEmptyState.tsx +66 -0
  68. package/src/components/ui/Chart/lightweight/LightweightForecastChart.styl +25 -0
  69. package/src/components/ui/Chart/lightweight/LightweightForecastChart.styl.d.ts +11 -0
  70. package/src/components/ui/Chart/lightweight/LightweightForecastChart.tsx +721 -0
  71. package/src/components/ui/Chart/lightweight/chartTime.ts +18 -0
  72. package/src/components/ui/Chart/lightweight/lightweightForecastChart.helpers.ts +141 -0
  73. package/src/components/ui/Chart/lightweight/quantileBandCustomSeries.ts +215 -0
  74. package/src/components/ui/Chart/quantileBandConeChartData.ts +171 -0
  75. package/src/components/ui/Chart/tools/chartPlotGeometry.ts +89 -0
  76. package/src/components/ui/ChartAreaInteractive/ChartAreaInteractive.helpers.ts +44 -2
  77. package/src/components/ui/ChartAreaInteractive/ChartAreaInteractive.tsx +14 -1
  78. package/src/components/ui/ChartAreaInteractive/ChartAreaInteractive.types.ts +2 -3
  79. package/src/components/ui/ChartAreaInteractive/TimeRangeBrushLayer.styl +21 -0
  80. package/src/components/{widgets/DriverMap/LoadingSpinner/LoadingSpinner.styl.d.ts → ui/ChartAreaInteractive/TimeRangeBrushLayer.styl.d.ts} +3 -3
  81. package/src/components/ui/ChartAreaInteractive/TimeRangeBrushLayer.tsx +285 -0
  82. package/src/components/ui/ChartAreaInteractive/TimeRangeBrushLayout.helpers.ts +55 -0
  83. package/src/components/ui/ChartAreaInteractive/overlays/IntervalsOverlay/IntervalsOverlay.hooks.ts +1 -0
  84. package/src/components/ui/ChartAreaInteractive/overlays/PinOverlay/PinOverlay.styl +2 -7
  85. package/src/components/ui/ChartAreaInteractive/overlays/PinOverlay/PinOverlay.styl.d.ts +0 -1
  86. package/src/components/ui/ChartAreaInteractive/overlays/PinOverlay/PinOverlay.tsx +7 -71
  87. package/src/components/ui/ChartAreaInteractive/overlays/ThresholdsOverlay/ThresholdsOverlay.hooks.ts +1 -0
  88. package/src/components/ui/ChartAreaInteractive/overlays/useChartYRange.ts +2 -3
  89. package/src/components/ui/ChartAreaInteractive/overlays/useQuantileBands.ts +5 -131
  90. package/src/components/ui/Page/PageColumns/PageColumns.tsx +1 -1
  91. package/src/components/ui/TimeRangeControls/TimeRangeControls.tsx +16 -17
  92. package/src/components/{widgets/DriverMap/MapBackground/MapBackground.styl → ui/WorldMap/WorldMap.styl} +1 -3
  93. package/src/components/{widgets/DriverMap/MapBackground/MapBackground.styl.d.ts → ui/WorldMap/WorldMap.styl.d.ts} +1 -1
  94. package/src/components/ui/WorldMap/WorldMap.tsx +22 -0
  95. package/src/components/ui/WorldMap/index.ts +2 -0
  96. package/src/components/widgets/DriverCard/DriverCard.styl +169 -0
  97. package/src/components/widgets/DriverCard/DriverCard.styl.d.ts +40 -0
  98. package/src/components/widgets/DriverCard/DriverCard.tsx +219 -0
  99. package/src/components/widgets/DriverCard/DriverPerformanceChart.styl +43 -0
  100. package/src/components/widgets/DriverCard/DriverPerformanceChart.styl.d.ts +13 -0
  101. package/src/components/widgets/DriverCard/DriverPerformanceChart.tsx +150 -0
  102. package/src/components/widgets/DriverCard/driverPerformanceChartData.ts +64 -0
  103. package/src/components/widgets/DriverCard/index.ts +1 -0
  104. package/src/components/widgets/DriverMap/DriverIcon/DriverIcon.tsx +0 -2
  105. package/src/components/widgets/DriverMap/DriverMap.styl +6 -1
  106. package/src/components/widgets/DriverMap/DriverMap.styl.d.ts +1 -0
  107. package/src/components/widgets/DriverMap/DriverMap.tsx +2 -4
  108. package/src/components/widgets/DriverMap/driverCategoryIcon.tsx +0 -2
  109. package/src/components/widgets/DriverMap/index.ts +0 -2
  110. package/src/declarations.d.ts +2 -0
  111. package/src/docs/config/webpack.config.js +26 -3
  112. package/src/docs/index.tsx +1 -1
  113. package/src/docs/pages/ChartAreaInteractivePage.tsx +2 -3
  114. package/src/docs/pages/DriverMapPage.tsx +214 -60
  115. package/src/docs/pages/LightweightChartPage.styl +18 -0
  116. package/src/docs/pages/LightweightChartPage.styl.d.ts +10 -0
  117. package/src/docs/pages/LightweightChartPage.tsx +195 -0
  118. package/src/docs/pages/PageColumnsPage.tsx +92 -0
  119. package/src/docs/pages/TimeRangeControlsPage.tsx +2 -3
  120. package/src/docs/pages/WorldMapPage.styl +14 -0
  121. package/src/docs/pages/WorldMapPage.styl.d.ts +8 -0
  122. package/src/docs/pages/WorldMapPage.tsx +26 -0
  123. package/src/docs/registry.ts +19 -1
  124. package/src/index.ts +2 -0
  125. package/dist/esm/components/widgets/DriverMap/LoadingSpinner/LoadingSpinner.js +0 -8
  126. package/dist/esm/components/widgets/DriverMap/LoadingSpinner/LoadingSpinner.styl.js +0 -7
  127. package/dist/esm/components/widgets/DriverMap/MapBackground/MapBackground.js +0 -10
  128. package/dist/esm/components/widgets/DriverMap/MapBackground/MapBackground.styl.js +0 -7
  129. package/dist/esm/types/src/components/widgets/DriverMap/LoadingSpinner/LoadingSpinner.d.ts +0 -1
  130. package/dist/esm/types/src/components/widgets/DriverMap/MapBackground/MapBackground.d.ts +0 -1
  131. package/src/components/widgets/DriverMap/LoadingSpinner/LoadingSpinner.styl +0 -24
  132. package/src/components/widgets/DriverMap/LoadingSpinner/LoadingSpinner.tsx +0 -11
  133. package/src/components/widgets/DriverMap/MapBackground/MapBackground.tsx +0 -18
  134. /package/dist/esm/components/{widgets/DriverMap/MapBackground → ui/WorldMap}/map.svg.js +0 -0
  135. /package/src/components/{widgets/DriverMap/MapBackground → ui/WorldMap}/map.svg +0 -0
  136. /package/src/components/{widgets/DriverMap/MapBackground → ui/WorldMap}/mapAspect.mixin.styl +0 -0
  137. /package/src/components/{widgets/DriverMap/MapBackground → ui/WorldMap}/mapAspect.mixin.styl.d.ts +0 -0
@@ -0,0 +1,5 @@
1
+ import type { DriverData } from '../DriverMap/driverMapGeography';
2
+ export interface DriverPerformanceChartProps {
3
+ driver: DriverData;
4
+ }
5
+ export declare function DriverPerformanceChart({ driver, }: DriverPerformanceChartProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import type { DriverData } from '../DriverMap/driverMapGeography';
2
+ export type DriverPerformanceChartPoint = {
3
+ date: Date;
4
+ value: number;
5
+ };
6
+ /** Last non-null points from `normalized_series`, or deterministic fallback sample. */
7
+ export declare function generateDriverChartData(driver: DriverData, precision?: number): DriverPerformanceChartPoint[];
@@ -0,0 +1 @@
1
+ export { DriverCard, type DriverCardProps } from './DriverCard';
@@ -3,6 +3,4 @@ export type { DriverData } from './driverMapGeography';
3
3
  export { getCategoryIcon } from './driverCategoryIcon';
4
4
  export { getDriverImportance, getHighestImportanceDriver, } from './driverMapSelection';
5
5
  export { geographicCoordinates, geographicToSVG, getContinentFromRegion, getPreciseCoordinates, getResponsiveCoordinates, svgToPercentage, } from './driverMapGeography';
6
- export { MapBackground } from './MapBackground/MapBackground';
7
- export { LoadingSpinner } from './LoadingSpinner/LoadingSpinner';
8
6
  export type { BadgeSize } from './DriverIcon/DriverIcon';
@@ -0,0 +1 @@
1
+ export default function LightweightChartPage(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export default function PageColumnsPage(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export default function WorldMapPage(): import("react/jsx-runtime").JSX.Element;
@@ -58,8 +58,10 @@ export * from './components/ui/Toggle';
58
58
  export * from './components/ui/ToggleGroup';
59
59
  export * from './components/ui/Tooltip';
60
60
  export * from './components/ui/VimeoEmbed';
61
+ export * from './components/ui/WorldMap';
61
62
  export * from './components/ui/WorkspaceAppSwitcher';
62
63
  export * from './components/widgets/SidebarDatasetsItemsGrouped';
64
+ export * from './components/widgets/DriverCard';
63
65
  export * from './components/widgets/DriverMap';
64
66
  export * from './components/widgets/SybilionAppHeader';
65
67
  export * from './components/widgets/SybilionAuthLayout';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sybilion/uilib",
3
- "version": "1.2.26",
3
+ "version": "1.3.1",
4
4
  "description": "Sybilion Design System — React UI components (Webpack + Stylus)",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -100,6 +100,7 @@
100
100
  "@radix-ui/react-tooltip": "^1.2.8",
101
101
  "@vimeo/player": "^2.29.3",
102
102
  "classnames": "^2.3.2",
103
+ "lightweight-charts": "^5.0.9",
103
104
  "lucide-react": "^0.546.0",
104
105
  "motion": "^12.23.12",
105
106
  "recharts": "^3.2.1",
@@ -130,7 +131,7 @@
130
131
  },
131
132
  "devDependencies": {
132
133
  "@auth0/auth0-react": "^2.3.1",
133
- "@sybilion/platform-sdk": "file:../sdk",
134
+ "@sybilion/platform-sdk": "file:../platform-sdk",
134
135
  "@babel/core": "^7.20.12",
135
136
  "@babel/preset-typescript": "^7.21.0",
136
137
  "@homecode/ui": "^4.30.6",
@@ -21,3 +21,12 @@ export {
21
21
  ChartStyle,
22
22
  BaseChartWrapper,
23
23
  };
24
+ export {
25
+ LightweightForecastChart,
26
+ type LightweightForecastChartProps,
27
+ } from './lightweight/LightweightForecastChart';
28
+ export {
29
+ ChartEmptyState,
30
+ type ChartEmptyStateProps,
31
+ type ChartEmptyStatusTone,
32
+ } from './components/ChartEmptyState/ChartEmptyState';
@@ -9,15 +9,7 @@ import {
9
9
  useState,
10
10
  } from 'react';
11
11
 
12
- import {
13
- ChartConfig,
14
- ChartContainer,
15
- ChartTooltip,
16
- ChartTooltipContent,
17
- CustomChartLegend,
18
- } from '#uilib/components/ui/Chart/Chart';
19
12
  import type { QuantileBandConfig } from '#uilib/components/ui/Chart/chartForecastVisualization.types';
20
- import { QuantileBands } from '#uilib/components/ui/Chart/components/QuantileBands';
21
13
  import { ChartDataPoint } from '#uilib/components/ui/ChartAreaInteractive/ChartAreaInteractive.types';
22
14
  import {
23
15
  ChartLines,
@@ -26,47 +18,22 @@ import {
26
18
  } from '#uilib/components/ui/ChartAreaInteractive/ChartLines';
27
19
  import { Skeleton } from '#uilib/components/ui/Skeleton';
28
20
  import { chartRenderQueue } from '#uilib/utils/chartRenderQueue';
29
- import { ComposedChart, LineChart } from 'recharts';
21
+ import { ComposedChart, LineChart, Tooltip as ChartTooltip } from 'recharts';
22
+
23
+ import type { ChartConfig } from '../Chart.types';
24
+ import { ChartContainer } from './ChartContainer';
25
+ import { ChartTooltipContent } from './ChartTooltipContent';
26
+ import { CustomChartLegend } from './CustomChartLegend/CustomChartLegend';
27
+ import { QuantileBands } from './QuantileBands';
30
28
  import { LegendPayload } from 'recharts/types/component/DefaultLegendContent';
31
29
 
30
+ import { getPlotViewBox, resolveChartMargin } from '../tools/chartPlotGeometry';
32
31
  import { formatDate } from '../tools/formatters';
33
32
  import S from './BaseChartWrapper.styl';
34
33
  import { ChartAxes } from './ChartAxes';
35
34
  import { ChartGrid } from './ChartGrid';
36
35
  import { LegendSvg } from './LegendSvg/LegendSvg';
37
36
 
38
- type ChartMargin = { top: number; right: number; bottom: number; left: number };
39
-
40
- const DEFAULT_CHART_MARGIN: ChartMargin = {
41
- top: 5,
42
- right: 5,
43
- bottom: 5,
44
- left: 5,
45
- };
46
-
47
- function resolveChartMargin(
48
- margin: Partial<ChartMargin> | undefined,
49
- ): ChartMargin {
50
- return {
51
- top: margin?.top ?? DEFAULT_CHART_MARGIN.top,
52
- right: margin?.right ?? DEFAULT_CHART_MARGIN.right,
53
- bottom: margin?.bottom ?? DEFAULT_CHART_MARGIN.bottom,
54
- left: margin?.left ?? DEFAULT_CHART_MARGIN.left,
55
- };
56
- }
57
-
58
- /** Plot box inside `.recharts-wrapper`, same convention as Recharts cartesian viewBox. */
59
- function getPlotViewBox(wrapper: HTMLElement, m: ChartMargin) {
60
- const w = wrapper.clientWidth;
61
- const h = wrapper.clientHeight;
62
- return {
63
- x: m.left,
64
- y: m.top,
65
- width: Math.max(0, w - m.left - m.right),
66
- height: Math.max(0, h - m.top - m.bottom),
67
- };
68
- }
69
-
70
37
  function clampTooltipTranslate(args: {
71
38
  coordinate: { x: number; y: number };
72
39
  viewBox: { x: number; y: number; width: number; height: number };
@@ -0,0 +1,60 @@
1
+ @import '../../../../../lib/theme.styl'
2
+
3
+ .root
4
+ display flex
5
+ flex-direction column
6
+ gap var(--p-1)
7
+ max-width 42rem
8
+ padding 0 var(--p-3)
9
+
10
+ border-radius var(--p-4)
11
+ backdrop-filter blur(4px)
12
+ box-shadow 0 0 0 2px var(--page-color)
13
+ pointer-events auto
14
+
15
+ .rootPanel
16
+ width 100%
17
+ min-height var(--chart-height)
18
+ justify-content center
19
+ padding var(--p-6)
20
+ border-radius var(--radius-md)
21
+ background var(--muted) / 0.35
22
+
23
+ .rootInline
24
+ width fit-content
25
+ max-width 100%
26
+
27
+ .rootAlignCenter
28
+ align-items center
29
+ text-align center
30
+
31
+ .rootAlignStart
32
+ align-items flex-start
33
+ text-align left
34
+
35
+ .hint
36
+ font-size 14px
37
+ line-height 1.5
38
+ font-weight 400
39
+ color var(--muted-foreground)
40
+ margin 0
41
+
42
+ a
43
+ color var(--sb-cyan-400)
44
+ text-decoration underline
45
+ font-weight 500
46
+
47
+ &:hover
48
+ opacity 0.9
49
+
50
+ .status
51
+ font-size 14px
52
+ line-height 1.5
53
+ font-weight 400
54
+ margin 0
55
+
56
+ .statusMuted
57
+ color var(--muted-foreground)
58
+
59
+ .statusDestructive
60
+ color var(--destructive)
@@ -0,0 +1,15 @@
1
+ // This file is automatically generated.
2
+ // Please do not change this file!
3
+ interface CssExports {
4
+ 'hint': string;
5
+ 'root': string;
6
+ 'rootAlignCenter': string;
7
+ 'rootAlignStart': string;
8
+ 'rootInline': string;
9
+ 'rootPanel': string;
10
+ 'status': string;
11
+ 'statusDestructive': string;
12
+ 'statusMuted': string;
13
+ }
14
+ export const cssExports: CssExports;
15
+ export default cssExports;
@@ -0,0 +1,66 @@
1
+ import cn from 'classnames';
2
+ import { ReactNode } from 'react';
3
+
4
+ import S from './ChartEmptyState.styl';
5
+
6
+ export type ChartEmptyStatusTone = 'muted' | 'destructive';
7
+
8
+ export interface ChartEmptyStateProps {
9
+ className?: string;
10
+ /** Primary guidance (muted). */
11
+ hint?: ReactNode;
12
+ /** Status / technical detail. */
13
+ status?: ReactNode;
14
+ statusTone?: ChartEmptyStatusTone;
15
+ /** `panel`: chart-sized block with light fill. `inline`: text only (e.g. above chart). */
16
+ variant?: 'panel' | 'inline';
17
+ align?: 'center' | 'start';
18
+ }
19
+
20
+ function isNonEmpty(node: ReactNode): boolean {
21
+ if (node == null || node === false) return false;
22
+ if (typeof node === 'string') return node.trim().length > 0;
23
+ return true;
24
+ }
25
+
26
+ export function ChartEmptyState({
27
+ className,
28
+ hint,
29
+ status,
30
+ statusTone = 'muted',
31
+ variant = 'panel',
32
+ align = 'center',
33
+ }: ChartEmptyStateProps) {
34
+ const hasHint = isNonEmpty(hint);
35
+ const hasStatus = isNonEmpty(status);
36
+
37
+ if (!hasHint && !hasStatus) {
38
+ return null;
39
+ }
40
+
41
+ return (
42
+ <div
43
+ className={cn(
44
+ S.root,
45
+ variant === 'panel' && S.rootPanel,
46
+ variant === 'inline' && S.rootInline,
47
+ align === 'start' && S.rootAlignStart,
48
+ align === 'center' && S.rootAlignCenter,
49
+ className,
50
+ )}
51
+ >
52
+ {hasHint && <div className={S.hint}>{hint}</div>}
53
+ {hasStatus && (
54
+ <div
55
+ className={cn(
56
+ S.status,
57
+ statusTone === 'destructive' && S.statusDestructive,
58
+ statusTone === 'muted' && S.statusMuted,
59
+ )}
60
+ >
61
+ {status}
62
+ </div>
63
+ )}
64
+ </div>
65
+ );
66
+ }
@@ -0,0 +1,25 @@
1
+ .root
2
+ display flex
3
+ flex-direction column
4
+ gap 12px
5
+ width 100%
6
+
7
+ .shell
8
+ position relative
9
+ width 100%
10
+
11
+ .host
12
+ display block
13
+ width 100%
14
+ box-sizing border-box
15
+
16
+ :global(#tv-attr-logo)
17
+ display none
18
+
19
+ .tooltipMove
20
+ position absolute
21
+ z-index 5
22
+ pointer-events none
23
+
24
+ .footer
25
+ width 100%
@@ -0,0 +1,11 @@
1
+ // This file is automatically generated.
2
+ // Please do not change this file!
3
+ interface CssExports {
4
+ 'footer': string;
5
+ 'host': string;
6
+ 'root': string;
7
+ 'shell': string;
8
+ 'tooltipMove': string;
9
+ }
10
+ export const cssExports: CssExports;
11
+ export default cssExports;