@terreno/ui 57.8.0 → 57.10.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.
- package/README.md +2 -0
- package/dist/AreaChart.d.ts +1 -1
- package/dist/AreaChart.d.ts.map +1 -1
- package/dist/AreaChart.js +70 -22
- package/dist/AreaChart.js.map +1 -1
- package/dist/BarChart.d.ts.map +1 -1
- package/dist/BarChart.js +55 -13
- package/dist/BarChart.js.map +1 -1
- package/dist/Button.d.ts.map +1 -1
- package/dist/Button.js +19 -4
- package/dist/Button.js.map +1 -1
- package/dist/ChartCard.d.ts +5 -0
- package/dist/ChartCard.d.ts.map +1 -0
- package/dist/ChartCard.js +18 -0
- package/dist/ChartCard.js.map +1 -0
- package/dist/Common.d.ts +147 -6
- package/dist/Common.d.ts.map +1 -1
- package/dist/Common.js.map +1 -1
- package/dist/DashboardGrid.d.ts +6 -2
- package/dist/DashboardGrid.d.ts.map +1 -1
- package/dist/DashboardGrid.js +43 -10
- package/dist/DashboardGrid.js.map +1 -1
- package/dist/DateTimeField.d.ts.map +1 -1
- package/dist/DateTimeField.js +90 -17
- package/dist/DateTimeField.js.map +1 -1
- package/dist/DonutChart.d.ts.map +1 -1
- package/dist/DonutChart.js +20 -10
- package/dist/DonutChart.js.map +1 -1
- package/dist/DropdownMenuItem.d.ts +16 -0
- package/dist/DropdownMenuItem.d.ts.map +1 -0
- package/dist/DropdownMenuItem.js +11 -0
- package/dist/DropdownMenuItem.js.map +1 -0
- package/dist/FilePickerButton.d.ts +15 -1
- package/dist/FilePickerButton.d.ts.map +1 -1
- package/dist/FilePickerButton.js +90 -13
- package/dist/FilePickerButton.js.map +1 -1
- package/dist/GPTChat.d.ts +57 -1
- package/dist/GPTChat.d.ts.map +1 -1
- package/dist/GPTChat.js +301 -20
- package/dist/GPTChat.js.map +1 -1
- package/dist/HtmlFrame.d.ts +11 -0
- package/dist/HtmlFrame.d.ts.map +1 -0
- package/dist/HtmlFrame.js +29 -0
- package/dist/HtmlFrame.js.map +1 -0
- package/dist/LineChart.d.ts +1 -1
- package/dist/LineChart.d.ts.map +1 -1
- package/dist/LineChart.js +62 -21
- package/dist/LineChart.js.map +1 -1
- package/dist/Scorecard.d.ts +5 -0
- package/dist/Scorecard.d.ts.map +1 -0
- package/dist/Scorecard.js +11 -0
- package/dist/Scorecard.js.map +1 -0
- package/dist/SparklineChart.d.ts +5 -0
- package/dist/SparklineChart.d.ts.map +1 -0
- package/dist/SparklineChart.js +35 -0
- package/dist/SparklineChart.js.map +1 -0
- package/dist/Text.d.ts +1 -1
- package/dist/Text.d.ts.map +1 -1
- package/dist/Text.js +2 -2
- package/dist/Text.js.map +1 -1
- package/dist/TextField.d.ts.map +1 -1
- package/dist/TextField.js +12 -4
- package/dist/TextField.js.map +1 -1
- package/dist/ToastNotifications.d.ts.map +1 -1
- package/dist/ToastNotifications.js +29 -6
- package/dist/ToastNotifications.js.map +1 -1
- package/dist/WebDropdownMenu.d.ts +2 -1
- package/dist/WebDropdownMenu.d.ts.map +1 -1
- package/dist/WebDropdownMenu.js +2 -6
- package/dist/WebDropdownMenu.js.map +1 -1
- package/dist/asks/AskCard.d.ts +34 -0
- package/dist/asks/AskCard.d.ts.map +1 -0
- package/dist/asks/AskCard.js +91 -0
- package/dist/asks/AskCard.js.map +1 -0
- package/dist/asks/AskChoice.d.ts +11 -0
- package/dist/asks/AskChoice.d.ts.map +1 -0
- package/dist/asks/AskChoice.js +146 -0
- package/dist/asks/AskChoice.js.map +1 -0
- package/dist/asks/AskConfirm.d.ts +15 -0
- package/dist/asks/AskConfirm.d.ts.map +1 -0
- package/dist/asks/AskConfirm.js +17 -0
- package/dist/asks/AskConfirm.js.map +1 -0
- package/dist/asks/AskFiles.d.ts +18 -0
- package/dist/asks/AskFiles.d.ts.map +1 -0
- package/dist/asks/AskFiles.js +149 -0
- package/dist/asks/AskFiles.js.map +1 -0
- package/dist/asks/AskForm.d.ts +27 -0
- package/dist/asks/AskForm.d.ts.map +1 -0
- package/dist/asks/AskForm.js +146 -0
- package/dist/asks/AskForm.js.map +1 -0
- package/dist/asks/AskMarkdown.d.ts +25 -0
- package/dist/asks/AskMarkdown.d.ts.map +1 -0
- package/dist/asks/AskMarkdown.js +73 -0
- package/dist/asks/AskMarkdown.js.map +1 -0
- package/dist/asks/SimpleAskCard.d.ts +23 -0
- package/dist/asks/SimpleAskCard.d.ts.map +1 -0
- package/dist/asks/SimpleAskCard.js +32 -0
- package/dist/asks/SimpleAskCard.js.map +1 -0
- package/dist/asks/askControls.d.ts +33 -0
- package/dist/asks/askControls.d.ts.map +1 -0
- package/dist/asks/askControls.js +30 -0
- package/dist/asks/askControls.js.map +1 -0
- package/dist/asks/askFileRefs.d.ts +26 -0
- package/dist/asks/askFileRefs.d.ts.map +1 -0
- package/dist/asks/askFileRefs.js +75 -0
- package/dist/asks/askFileRefs.js.map +1 -0
- package/dist/asks/askFormDraft.d.ts +60 -0
- package/dist/asks/askFormDraft.d.ts.map +1 -0
- package/dist/asks/askFormDraft.js +224 -0
- package/dist/asks/askFormDraft.js.map +1 -0
- package/dist/asks/askSummary.d.ts +10 -0
- package/dist/asks/askSummary.d.ts.map +1 -0
- package/dist/asks/askSummary.js +138 -0
- package/dist/asks/askSummary.js.map +1 -0
- package/dist/asks/askTypes.d.ts +21 -0
- package/dist/asks/askTypes.d.ts.map +1 -0
- package/dist/asks/askTypes.js +2 -0
- package/dist/asks/askTypes.js.map +1 -0
- package/dist/asks/simpleCardButtonVariants.d.ts +5 -0
- package/dist/asks/simpleCardButtonVariants.d.ts.map +1 -0
- package/dist/asks/simpleCardButtonVariants.js +8 -0
- package/dist/asks/simpleCardButtonVariants.js.map +1 -0
- package/dist/blocks/BlocksError.d.ts +8 -0
- package/dist/blocks/BlocksError.d.ts.map +1 -0
- package/dist/blocks/BlocksError.js +14 -0
- package/dist/blocks/BlocksError.js.map +1 -0
- package/dist/blocks/BlocksView.d.ts +10 -0
- package/dist/blocks/BlocksView.d.ts.map +1 -0
- package/dist/blocks/BlocksView.js +90 -0
- package/dist/blocks/BlocksView.js.map +1 -0
- package/dist/blocks/blockRenderers.d.ts +25 -0
- package/dist/blocks/blockRenderers.d.ts.map +1 -0
- package/dist/blocks/blockRenderers.js +136 -0
- package/dist/blocks/blockRenderers.js.map +1 -0
- package/dist/blocks/datasetToPoints.d.ts +22 -0
- package/dist/blocks/datasetToPoints.d.ts.map +1 -0
- package/dist/blocks/datasetToPoints.js +28 -0
- package/dist/blocks/datasetToPoints.js.map +1 -0
- package/dist/blocks/useBlockSelections.d.ts +6 -0
- package/dist/blocks/useBlockSelections.d.ts.map +1 -0
- package/dist/blocks/useBlockSelections.js +10 -0
- package/dist/blocks/useBlockSelections.js.map +1 -0
- package/dist/blocks/useResolvedDatasets.d.ts +18 -0
- package/dist/blocks/useResolvedDatasets.d.ts.map +1 -0
- package/dist/blocks/useResolvedDatasets.js +59 -0
- package/dist/blocks/useResolvedDatasets.js.map +1 -0
- package/dist/blocks/useResolvedImages.d.ts +15 -0
- package/dist/blocks/useResolvedImages.d.ts.map +1 -0
- package/dist/blocks/useResolvedImages.js +66 -0
- package/dist/blocks/useResolvedImages.js.map +1 -0
- package/dist/charts/ChartFacadeContainer.d.ts +10 -0
- package/dist/charts/ChartFacadeContainer.d.ts.map +1 -0
- package/dist/charts/ChartFacadeContainer.js +10 -0
- package/dist/charts/ChartFacadeContainer.js.map +1 -0
- package/dist/charts/ChartFrame.d.ts +4 -0
- package/dist/charts/ChartFrame.d.ts.map +1 -1
- package/dist/charts/ChartFrame.js +4 -2
- package/dist/charts/ChartFrame.js.map +1 -1
- package/dist/charts/layout.d.ts +9 -2
- package/dist/charts/layout.d.ts.map +1 -1
- package/dist/charts/layout.js +28 -6
- package/dist/charts/layout.js.map +1 -1
- package/dist/charts/scales.d.ts +3 -1
- package/dist/charts/scales.d.ts.map +1 -1
- package/dist/charts/scales.js +7 -7
- package/dist/charts/scales.js.map +1 -1
- package/dist/charts/series.d.ts +15 -0
- package/dist/charts/series.d.ts.map +1 -0
- package/dist/charts/series.js +19 -0
- package/dist/charts/series.js.map +1 -0
- package/dist/charts/types/chartTypes.d.ts +7 -0
- package/dist/charts/types/chartTypes.d.ts.map +1 -1
- package/dist/dashboardGridLayout.d.ts +6 -0
- package/dist/dashboardGridLayout.d.ts.map +1 -1
- package/dist/dashboardGridLayout.js +19 -3
- package/dist/dashboardGridLayout.js.map +1 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/lazyBoundaries/heavyOptionalExports.d.ts +15 -0
- package/dist/lazyBoundaries/heavyOptionalExports.d.ts.map +1 -1
- package/dist/lazyBoundaries/heavyOptionalExports.js +10 -0
- package/dist/lazyBoundaries/heavyOptionalExports.js.map +1 -1
- package/dist/resolveDocumentBodyPortalTarget.d.ts +7 -0
- package/dist/resolveDocumentBodyPortalTarget.d.ts.map +1 -0
- package/dist/resolveDocumentBodyPortalTarget.js +12 -0
- package/dist/resolveDocumentBodyPortalTarget.js.map +1 -0
- package/package.json +2 -1
- package/src/AIRequestExplorer.test.tsx +2 -2
- package/src/AreaChart.test.tsx +81 -0
- package/src/AreaChart.tsx +171 -62
- package/src/BarChart.test.tsx +119 -0
- package/src/BarChart.tsx +94 -20
- package/src/Button.test.tsx +72 -0
- package/src/Button.tsx +34 -4
- package/src/ChartCard.test.tsx +79 -0
- package/src/ChartCard.tsx +80 -0
- package/src/Common.ts +136 -2
- package/src/DashboardGrid.test.tsx +98 -1
- package/src/DashboardGrid.tsx +71 -20
- package/src/DateTimeField.test.tsx +185 -2
- package/src/DateTimeField.tsx +106 -16
- package/src/DonutChart.test.tsx +78 -10
- package/src/DonutChart.tsx +87 -14
- package/src/DropdownMenuItem.tsx +48 -0
- package/src/FilePickerButton.test.tsx +116 -9
- package/src/FilePickerButton.tsx +177 -23
- package/src/GPTChat.test.tsx +891 -8
- package/src/GPTChat.tsx +713 -45
- package/src/HtmlFrame.tsx +60 -0
- package/src/LineChart.test.tsx +109 -10
- package/src/LineChart.tsx +154 -58
- package/src/Scorecard.test.tsx +65 -0
- package/src/Scorecard.tsx +45 -0
- package/src/SparklineChart.test.tsx +69 -0
- package/src/SparklineChart.tsx +85 -0
- package/src/Text.test.tsx +22 -0
- package/src/Text.tsx +10 -1
- package/src/TextField.test.tsx +16 -0
- package/src/TextField.tsx +13 -3
- package/src/ToastNotifications.tsx +33 -6
- package/src/ToastNotifications.webModal.test.tsx +285 -0
- package/src/WebDropdownMenu.tsx +3 -7
- package/src/asks/AskCard.test.tsx +1428 -0
- package/src/asks/AskCard.tsx +240 -0
- package/src/asks/AskChoice.tsx +368 -0
- package/src/asks/AskConfirm.tsx +42 -0
- package/src/asks/AskFiles.test.tsx +347 -0
- package/src/asks/AskFiles.tsx +246 -0
- package/src/asks/AskForm.tsx +334 -0
- package/src/asks/AskMarkdown.tsx +176 -0
- package/src/asks/SimpleAskCard.test.tsx +253 -0
- package/src/asks/SimpleAskCard.tsx +82 -0
- package/src/asks/askControls.tsx +98 -0
- package/src/asks/askFileRefs.test.ts +155 -0
- package/src/asks/askFileRefs.ts +98 -0
- package/src/asks/askFormDraft.test.ts +347 -0
- package/src/asks/askFormDraft.ts +309 -0
- package/src/asks/askSummary.test.ts +255 -0
- package/src/asks/askSummary.ts +160 -0
- package/src/asks/askTypes.ts +25 -0
- package/src/asks/asksUseTerrenoComponents.test.ts +55 -0
- package/src/asks/simpleCardButtonVariants.ts +14 -0
- package/src/blocks/BlocksError.tsx +28 -0
- package/src/blocks/BlocksView.test.tsx +607 -0
- package/src/blocks/BlocksView.tsx +125 -0
- package/src/blocks/blockRenderers.tsx +288 -0
- package/src/blocks/datasetToPoints.test.ts +31 -0
- package/src/blocks/datasetToPoints.ts +48 -0
- package/src/blocks/useBlockSelections.ts +13 -0
- package/src/blocks/useResolvedDatasets.ts +78 -0
- package/src/blocks/useResolvedImages.ts +81 -0
- package/src/bunSetup.ts +1 -0
- package/src/charts/ChartFacadeContainer.tsx +35 -0
- package/src/charts/ChartFrame.tsx +39 -1
- package/src/charts/layout.test.ts +22 -1
- package/src/charts/layout.ts +37 -4
- package/src/charts/scales.test.ts +33 -0
- package/src/charts/scales.ts +10 -6
- package/src/charts/series.ts +43 -0
- package/src/charts/types/chartTypes.ts +8 -0
- package/src/dashboardGridLayout.test.ts +59 -1
- package/src/dashboardGridLayout.ts +30 -3
- package/src/index.tsx +13 -0
- package/src/isolated/HtmlFrame.isolated.tsx +54 -0
- package/src/lazyBoundaries/heavyOptionalExports.test.tsx +2 -0
- package/src/lazyBoundaries/heavyOptionalExports.tsx +35 -0
- package/src/resolveDocumentBodyPortalTarget.ts +11 -0
|
@@ -2,7 +2,10 @@ import type { AIRequestExplorer as AIRequestExplorerComponent } from "../AIReque
|
|
|
2
2
|
import type { AiSuggestionBox as AiSuggestionBoxComponent } from "../AiSuggestionBox";
|
|
3
3
|
import type { AreaChart as AreaChartComponent } from "../AreaChart";
|
|
4
4
|
import type { AttachmentPreview as AttachmentPreviewComponent } from "../AttachmentPreview";
|
|
5
|
+
import type { AskCard as AskCardComponent } from "../asks/AskCard";
|
|
5
6
|
import type { BarChart as BarChartComponent } from "../BarChart";
|
|
7
|
+
import type { BlocksView as BlocksViewComponent } from "../blocks/BlocksView";
|
|
8
|
+
import type { ChartCard as ChartCardComponent } from "../ChartCard";
|
|
6
9
|
import type { ConflictSheet as ConflictSheetComponent } from "../ConflictSheet";
|
|
7
10
|
import type { ConsentFormScreen as ConsentFormScreenComponent } from "../ConsentFormScreen";
|
|
8
11
|
import type { ConsentNavigator as ConsentNavigatorComponent } from "../ConsentNavigator";
|
|
@@ -14,13 +17,18 @@ import type { GPTMemoryModal as GPTMemoryModalComponent } from "../GPTMemoryModa
|
|
|
14
17
|
import type { LineChart as LineChartComponent } from "../LineChart";
|
|
15
18
|
import type { MarkdownEditor as MarkdownEditorComponent } from "../MarkdownEditor";
|
|
16
19
|
import type { MarkdownEditorField as MarkdownEditorFieldComponent } from "../MarkdownEditorField";
|
|
20
|
+
import type { Scorecard as ScorecardComponent } from "../Scorecard";
|
|
21
|
+
import type { SparklineChart as SparklineChartComponent } from "../SparklineChart";
|
|
17
22
|
import type { UpgradeRequiredScreen as UpgradeRequiredScreenComponent } from "../UpgradeRequiredScreen";
|
|
18
23
|
export declare const heavyOptionalModuleFactories: {
|
|
19
24
|
readonly AIRequestExplorer: () => Promise<typeof import("../AIRequestExplorer")>;
|
|
20
25
|
readonly AiSuggestionBox: () => Promise<typeof import("../AiSuggestionBox")>;
|
|
21
26
|
readonly AreaChart: () => Promise<typeof import("../AreaChart")>;
|
|
27
|
+
readonly AskCard: () => Promise<typeof import("../asks/AskCard")>;
|
|
22
28
|
readonly AttachmentPreview: () => Promise<typeof import("../AttachmentPreview")>;
|
|
23
29
|
readonly BarChart: () => Promise<typeof import("../BarChart")>;
|
|
30
|
+
readonly BlocksView: () => Promise<typeof import("../blocks/BlocksView")>;
|
|
31
|
+
readonly ChartCard: () => Promise<typeof import("../ChartCard")>;
|
|
24
32
|
readonly ConflictSheet: () => Promise<typeof import("../ConflictSheet")>;
|
|
25
33
|
readonly ConsentFormScreen: () => Promise<typeof import("../ConsentFormScreen")>;
|
|
26
34
|
readonly ConsentNavigator: () => Promise<typeof import("../ConsentNavigator")>;
|
|
@@ -32,13 +40,18 @@ export declare const heavyOptionalModuleFactories: {
|
|
|
32
40
|
readonly LineChart: () => Promise<typeof import("../LineChart")>;
|
|
33
41
|
readonly MarkdownEditor: () => Promise<typeof import("../MarkdownEditor")>;
|
|
34
42
|
readonly MarkdownEditorField: () => Promise<typeof import("../MarkdownEditorField")>;
|
|
43
|
+
readonly Scorecard: () => Promise<typeof import("../Scorecard")>;
|
|
44
|
+
readonly SparklineChart: () => Promise<typeof import("../SparklineChart")>;
|
|
35
45
|
readonly UpgradeRequiredScreen: () => Promise<typeof import("../UpgradeRequiredScreen")>;
|
|
36
46
|
};
|
|
37
47
|
export declare const AIRequestExplorer: typeof AIRequestExplorerComponent;
|
|
38
48
|
export declare const AreaChart: typeof AreaChartComponent;
|
|
39
49
|
export declare const AiSuggestionBox: typeof AiSuggestionBoxComponent;
|
|
50
|
+
export declare const AskCard: typeof AskCardComponent;
|
|
40
51
|
export declare const AttachmentPreview: typeof AttachmentPreviewComponent;
|
|
41
52
|
export declare const BarChart: typeof BarChartComponent;
|
|
53
|
+
export declare const BlocksView: typeof BlocksViewComponent;
|
|
54
|
+
export declare const ChartCard: typeof ChartCardComponent;
|
|
42
55
|
export declare const ConflictSheet: typeof ConflictSheetComponent;
|
|
43
56
|
export declare const ConsentFormScreen: typeof ConsentFormScreenComponent;
|
|
44
57
|
export declare const ConsentNavigator: typeof ConsentNavigatorComponent;
|
|
@@ -50,5 +63,7 @@ export declare const LineChart: typeof LineChartComponent;
|
|
|
50
63
|
export declare const GPTMemoryModal: typeof GPTMemoryModalComponent;
|
|
51
64
|
export declare const MarkdownEditor: typeof MarkdownEditorComponent;
|
|
52
65
|
export declare const MarkdownEditorField: typeof MarkdownEditorFieldComponent;
|
|
66
|
+
export declare const Scorecard: typeof ScorecardComponent;
|
|
67
|
+
export declare const SparklineChart: typeof SparklineChartComponent;
|
|
53
68
|
export declare const UpgradeRequiredScreen: typeof UpgradeRequiredScreenComponent;
|
|
54
69
|
//# sourceMappingURL=heavyOptionalExports.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"heavyOptionalExports.d.ts","sourceRoot":"","sources":["../../src/lazyBoundaries/heavyOptionalExports.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,iBAAiB,IAAI,0BAA0B,EAAC,MAAM,sBAAsB,CAAC;AAC1F,OAAO,KAAK,EAAC,eAAe,IAAI,wBAAwB,EAAC,MAAM,oBAAoB,CAAC;AACpF,OAAO,KAAK,EAAC,SAAS,IAAI,kBAAkB,EAAC,MAAM,cAAc,CAAC;AAClE,OAAO,KAAK,EAAC,iBAAiB,IAAI,0BAA0B,EAAC,MAAM,sBAAsB,CAA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,CAAC;AAE1C,eAAO,MAAM,cAAc,EAGX,OAAO,uBAAuB,CAAC;AAE/C,eAAO,MAAM,qBAAqB,EAGlB,OAAO,8BAA8B,CAAC"}
|
|
@@ -4,8 +4,11 @@ export const heavyOptionalModuleFactories = {
|
|
|
4
4
|
AIRequestExplorer: () => import("../AIRequestExplorer"),
|
|
5
5
|
AiSuggestionBox: () => import("../AiSuggestionBox"),
|
|
6
6
|
AreaChart: () => import("../AreaChart"),
|
|
7
|
+
AskCard: () => import("../asks/AskCard"),
|
|
7
8
|
AttachmentPreview: () => import("../AttachmentPreview"),
|
|
8
9
|
BarChart: () => import("../BarChart"),
|
|
10
|
+
BlocksView: () => import("../blocks/BlocksView"),
|
|
11
|
+
ChartCard: () => import("../ChartCard"),
|
|
9
12
|
ConflictSheet: () => import("../ConflictSheet"),
|
|
10
13
|
ConsentFormScreen: () => import("../ConsentFormScreen"),
|
|
11
14
|
ConsentNavigator: () => import("../ConsentNavigator"),
|
|
@@ -17,6 +20,8 @@ export const heavyOptionalModuleFactories = {
|
|
|
17
20
|
LineChart: () => import("../LineChart"),
|
|
18
21
|
MarkdownEditor: () => import("../MarkdownEditor"),
|
|
19
22
|
MarkdownEditorField: () => import("../MarkdownEditorField"),
|
|
23
|
+
Scorecard: () => import("../Scorecard"),
|
|
24
|
+
SparklineChart: () => import("../SparklineChart"),
|
|
20
25
|
UpgradeRequiredScreen: () => import("../UpgradeRequiredScreen"),
|
|
21
26
|
};
|
|
22
27
|
const EMOJI_SELECTOR_DEFAULT_PROPS = {
|
|
@@ -32,8 +37,11 @@ const EMOJI_SELECTOR_DEFAULT_PROPS = {
|
|
|
32
37
|
export const AIRequestExplorer = createLazyNamedExport(heavyOptionalModuleFactories.AIRequestExplorer, "AIRequestExplorer");
|
|
33
38
|
export const AreaChart = createLazyNamedExport(heavyOptionalModuleFactories.AreaChart, "AreaChart");
|
|
34
39
|
export const AiSuggestionBox = createLazyNamedExport(heavyOptionalModuleFactories.AiSuggestionBox, "AiSuggestionBox");
|
|
40
|
+
export const AskCard = createLazyNamedExport(heavyOptionalModuleFactories.AskCard, "AskCard");
|
|
35
41
|
export const AttachmentPreview = createLazyNamedExport(heavyOptionalModuleFactories.AttachmentPreview, "AttachmentPreview");
|
|
36
42
|
export const BarChart = createLazyNamedExport(heavyOptionalModuleFactories.BarChart, "BarChart");
|
|
43
|
+
export const BlocksView = createLazyNamedExport(heavyOptionalModuleFactories.BlocksView, "BlocksView");
|
|
44
|
+
export const ChartCard = createLazyNamedExport(heavyOptionalModuleFactories.ChartCard, "ChartCard");
|
|
37
45
|
export const ConflictSheet = createLazyNamedExport(heavyOptionalModuleFactories.ConflictSheet, "ConflictSheet");
|
|
38
46
|
export const ConsentFormScreen = createLazyNamedExport(heavyOptionalModuleFactories.ConsentFormScreen, "ConsentFormScreen");
|
|
39
47
|
export const ConsentNavigator = createLazyNamedExport(heavyOptionalModuleFactories.ConsentNavigator, "ConsentNavigator");
|
|
@@ -47,5 +55,7 @@ export const LineChart = createLazyNamedExport(heavyOptionalModuleFactories.Line
|
|
|
47
55
|
export const GPTMemoryModal = createLazyNamedExport(heavyOptionalModuleFactories.GPTMemoryModal, "GPTMemoryModal");
|
|
48
56
|
export const MarkdownEditor = createLazyNamedExport(heavyOptionalModuleFactories.MarkdownEditor, "MarkdownEditor");
|
|
49
57
|
export const MarkdownEditorField = createLazyNamedExport(heavyOptionalModuleFactories.MarkdownEditorField, "MarkdownEditorField");
|
|
58
|
+
export const Scorecard = createLazyNamedExport(heavyOptionalModuleFactories.Scorecard, "Scorecard");
|
|
59
|
+
export const SparklineChart = createLazyNamedExport(heavyOptionalModuleFactories.SparklineChart, "SparklineChart");
|
|
50
60
|
export const UpgradeRequiredScreen = createLazyNamedExport(heavyOptionalModuleFactories.UpgradeRequiredScreen, "UpgradeRequiredScreen");
|
|
51
61
|
//# sourceMappingURL=heavyOptionalExports.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"heavyOptionalExports.js","sourceRoot":"","sources":["../../src/lazyBoundaries/heavyOptionalExports.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"heavyOptionalExports.js","sourceRoot":"","sources":["../../src/lazyBoundaries/heavyOptionalExports.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAC,UAAU,EAAC,MAAM,oBAAoB,CAAC;AAS9C,OAAO,EAAC,yBAAyB,EAAE,qBAAqB,EAAC,MAAM,6BAA6B,CAAC;AAE7F,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC1C,iBAAiB,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,sBAAsB,CAAC;IACvD,eAAe,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,oBAAoB,CAAC;IACnD,SAAS,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,cAAc,CAAC;IACvC,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,iBAAiB,CAAC;IACxC,iBAAiB,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,sBAAsB,CAAC;IACvD,QAAQ,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,aAAa,CAAC;IACrC,UAAU,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,sBAAsB,CAAC;IAChD,SAAS,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,cAAc,CAAC;IACvC,aAAa,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,kBAAkB,CAAC;IAC/C,iBAAiB,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,sBAAsB,CAAC;IACvD,gBAAgB,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,qBAAqB,CAAC;IACrD,UAAU,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,eAAe,CAAC;IACzC,aAAa,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,kBAAkB,CAAC;IAC/C,aAAa,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,kBAAkB,CAAC;IAC/C,OAAO,EAAE,GAAG,EAAE,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C,MAAM,CAAC,MAAM,cAAc,GAAG,qBAAqB,CACjD,4BAA4B,CAAC,cAAc,EAC3C,gBAAgB,CAC4B,CAAC;AAE/C,MAAM,CAAC,MAAM,mBAAmB,GAAG,qBAAqB,CACtD,4BAA4B,CAAC,mBAAmB,EAChD,qBAAqB,CAC4B,CAAC;AAEpD,MAAM,CAAC,MAAM,SAAS,GAAG,qBAAqB,CAC5C,4BAA4B,CAAC,SAAS,EACtC,WAAW,CAC4B,CAAC;AAE1C,MAAM,CAAC,MAAM,cAAc,GAAG,qBAAqB,CACjD,4BAA4B,CAAC,cAAc,EAC3C,gBAAgB,CAC4B,CAAC;AAE/C,MAAM,CAAC,MAAM,qBAAqB,GAAG,qBAAqB,CACxD,4BAA4B,CAAC,qBAAqB,EAClD,uBAAuB,CAC4B,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DOM node web overlays attach to so they escape ancestor stacking contexts.
|
|
3
|
+
* Returns null when there is no document, or when `document.body` is not an element,
|
|
4
|
+
* so callers render inline instead of calling `createPortal`.
|
|
5
|
+
*/
|
|
6
|
+
export declare const resolveDocumentBodyPortalTarget: () => HTMLElement | null;
|
|
7
|
+
//# sourceMappingURL=resolveDocumentBodyPortalTarget.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveDocumentBodyPortalTarget.d.ts","sourceRoot":"","sources":["../src/resolveDocumentBodyPortalTarget.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,+BAA+B,QAAO,WAAW,GAAG,IAKhE,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DOM node web overlays attach to so they escape ancestor stacking contexts.
|
|
3
|
+
* Returns null when there is no document, or when `document.body` is not an element,
|
|
4
|
+
* so callers render inline instead of calling `createPortal`.
|
|
5
|
+
*/
|
|
6
|
+
export const resolveDocumentBodyPortalTarget = () => {
|
|
7
|
+
if (typeof document === "undefined" || typeof HTMLElement === "undefined") {
|
|
8
|
+
return null;
|
|
9
|
+
}
|
|
10
|
+
return document.body instanceof HTMLElement ? document.body : null;
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=resolveDocumentBodyPortalTarget.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveDocumentBodyPortalTarget.js","sourceRoot":"","sources":["../src/resolveDocumentBodyPortalTarget.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAG,GAAuB,EAAE;IACtE,IAAI,OAAO,QAAQ,KAAK,WAAW,IAAI,OAAO,WAAW,KAAK,WAAW,EAAE,CAAC;QAC1E,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,QAAQ,CAAC,IAAI,YAAY,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;AACrE,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
"@react-native-picker/picker": "2.11.4",
|
|
27
27
|
"@react-navigation/native": "^7.1.8",
|
|
28
28
|
"@shopify/react-native-skia": "2.6.5",
|
|
29
|
+
"@terreno/blocks": "57.10.1",
|
|
29
30
|
"d3-scale": "^4.0.2",
|
|
30
31
|
"d3-shape": "^3.2.0",
|
|
31
32
|
"emoji-datasource": "^16.0.0",
|
|
@@ -162,7 +163,7 @@
|
|
|
162
163
|
"test:coverage": "TZ=America/New_York bun run ../scripts/check-coverage.ts",
|
|
163
164
|
"types": "bun typedoc"
|
|
164
165
|
},
|
|
165
|
-
"version": "57.
|
|
166
|
+
"version": "57.10.1",
|
|
166
167
|
"bugs": {
|
|
167
168
|
"url": "https://github.com/TerrenoLabs/terreno/issues"
|
|
168
169
|
},
|
|
@@ -6,7 +6,7 @@ import {AIRequestExplorer, type AIRequestExplorerData} from "./AIRequestExplorer
|
|
|
6
6
|
import {renderWithTheme} from "./test-utils";
|
|
7
7
|
|
|
8
8
|
const fullRequest: AIRequestExplorerData = {
|
|
9
|
-
aiModel: "gemini-
|
|
9
|
+
aiModel: "gemini-3.8-flash",
|
|
10
10
|
created: "2024-06-15T14:30:45.000Z",
|
|
11
11
|
error: "A warning",
|
|
12
12
|
prompt: "Summarize this request",
|
|
@@ -38,7 +38,7 @@ describe("AIRequestExplorer", () => {
|
|
|
38
38
|
);
|
|
39
39
|
|
|
40
40
|
expect(getByText("Jane Example")).toBeTruthy();
|
|
41
|
-
expect(getByText("gemini-
|
|
41
|
+
expect(getByText("gemini-3.8-flash")).toBeTruthy();
|
|
42
42
|
expect(getByText("Summarize this request")).toBeTruthy();
|
|
43
43
|
expect(getByText("Summary response")).toBeTruthy();
|
|
44
44
|
expect(getByText("42")).toBeTruthy();
|
package/src/AreaChart.test.tsx
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {describe, expect, it} from "bun:test";
|
|
2
2
|
import {act, fireEvent} from "@testing-library/react-native";
|
|
3
|
+
import {assert} from "chai";
|
|
3
4
|
|
|
4
5
|
import {AreaChart} from "./AreaChart";
|
|
5
6
|
import {renderWithTheme} from "./test-utils";
|
|
@@ -10,7 +11,87 @@ const POINTS = [
|
|
|
10
11
|
{label: "C", value: 100},
|
|
11
12
|
];
|
|
12
13
|
|
|
14
|
+
const SERIES = [
|
|
15
|
+
{data: POINTS, id: "current", label: "Current"},
|
|
16
|
+
{
|
|
17
|
+
data: POINTS.map((point) => ({...point, value: point.value / 2})),
|
|
18
|
+
id: "previous",
|
|
19
|
+
label: "Previous",
|
|
20
|
+
},
|
|
21
|
+
];
|
|
22
|
+
|
|
13
23
|
describe("AreaChart", () => {
|
|
24
|
+
it("applies explicit tick truncation and chart-card title", () => {
|
|
25
|
+
const densePoints = Array.from({length: 10}, (_, index) => ({
|
|
26
|
+
label: `Week ${index + 1}`,
|
|
27
|
+
value: index + 1,
|
|
28
|
+
}));
|
|
29
|
+
const {getByTestId, getByText} = renderWithTheme(
|
|
30
|
+
<AreaChart
|
|
31
|
+
data={densePoints}
|
|
32
|
+
periodLabel="Quarter to date"
|
|
33
|
+
testID="chart"
|
|
34
|
+
title="Revenue"
|
|
35
|
+
xTickPolicy="truncate"
|
|
36
|
+
/>
|
|
37
|
+
);
|
|
38
|
+
const tickStyle = getByTestId("chart.xtick.0").props.style;
|
|
39
|
+
const tickStyles = Array.isArray(tickStyle) ? tickStyle : [tickStyle];
|
|
40
|
+
|
|
41
|
+
assert.isFalse(tickStyles.some((style) => Array.isArray(style?.transform)));
|
|
42
|
+
assert.exists(getByText("Revenue"));
|
|
43
|
+
assert.exists(getByText("Quarter to date"));
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it("renders an area, line, and legend for each named series", () => {
|
|
47
|
+
const {getByTestId, getByText} = renderWithTheme(
|
|
48
|
+
<AreaChart data={[]} series={SERIES} testID="chart" />
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
for (let index = 0; index < SERIES.length; index += 1) {
|
|
52
|
+
assert.exists(getByTestId(`chart.series.${index}.area`));
|
|
53
|
+
assert.exists(getByTestId(`chart.series.${index}.path`));
|
|
54
|
+
assert.exists(getByTestId(`chart.series.${index}.marker.0`));
|
|
55
|
+
assert.exists(getByTestId(`chart.series.${index}.point.1-clickable`));
|
|
56
|
+
assert.exists(getByTestId(`chart.legend.${index}`));
|
|
57
|
+
assert.exists(getByText(SERIES[index]?.label ?? ""));
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
it("renders a dotted comparison path on the shared scale", () => {
|
|
62
|
+
const {getByTestId} = renderWithTheme(
|
|
63
|
+
<AreaChart comparisonData={POINTS} data={POINTS} testID="chart" />
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
assert.isString(getByTestId("chart.comparison").props.strokeDasharray);
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
it("identifies the active series in a multi-series tooltip", async (): Promise<void> => {
|
|
70
|
+
const {getByTestId, getByText} = renderWithTheme(
|
|
71
|
+
<AreaChart data={[]} series={SERIES} testID="chart" />
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
await act(async () => {
|
|
75
|
+
fireEvent.press(getByTestId("chart.series.1.point.1-clickable"));
|
|
76
|
+
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
assert.exists(getByText("Previous — B: 25"));
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
it("uses resolved comparison and empty-series data for its empty state", () => {
|
|
83
|
+
const comparisonOnly = renderWithTheme(
|
|
84
|
+
<AreaChart comparisonData={POINTS} data={[]} testID="comparison-chart" />
|
|
85
|
+
);
|
|
86
|
+
assert.exists(comparisonOnly.getByTestId("comparison-chart.comparison"));
|
|
87
|
+
assert.notExists(comparisonOnly.queryByText("No data"));
|
|
88
|
+
|
|
89
|
+
const allEmpty = renderWithTheme(
|
|
90
|
+
<AreaChart data={POINTS} series={[{data: [], id: "empty", label: "Empty"}]} />
|
|
91
|
+
);
|
|
92
|
+
assert.exists(allEmpty.getByText("No data"));
|
|
93
|
+
});
|
|
94
|
+
|
|
14
95
|
it("renders one mark testID per point", () => {
|
|
15
96
|
const {getByTestId, queryByTestId} = renderWithTheme(
|
|
16
97
|
<AreaChart data={POINTS} testID="chart" />
|
package/src/AreaChart.tsx
CHANGED
|
@@ -4,17 +4,21 @@ import {Circle, Path, Svg, Line as SvgLine} from "react-native-svg";
|
|
|
4
4
|
|
|
5
5
|
import {Box} from "./Box";
|
|
6
6
|
import type {AreaChartProps, LayoutChangeEvent} from "./Common";
|
|
7
|
+
import {ChartFacadeContainer} from "./charts/ChartFacadeContainer";
|
|
7
8
|
import {ChartFrame} from "./charts/ChartFrame";
|
|
8
9
|
import {
|
|
10
|
+
CHART_ROTATED_X_AXIS_HEIGHT,
|
|
9
11
|
CHART_X_AXIS_HEIGHT,
|
|
10
12
|
getChartAxisWidth,
|
|
11
13
|
getChartPlot,
|
|
12
14
|
getPlotHeight,
|
|
13
15
|
getXTickStyle,
|
|
14
16
|
getYTickStyle,
|
|
17
|
+
shouldRotateChartXTicks,
|
|
15
18
|
} from "./charts/layout";
|
|
16
19
|
import {getAreaPath, getLinePath} from "./charts/paths";
|
|
17
20
|
import {createCartesianScales, getYTickValues} from "./charts/scales";
|
|
21
|
+
import {getAllSeriesPoints, getAxisPoints, resolveChartSeries} from "./charts/series";
|
|
18
22
|
import {getChartPaint} from "./charts/theme";
|
|
19
23
|
import type {ChartPoint} from "./charts/types/chartTypes";
|
|
20
24
|
import {Text} from "./Text";
|
|
@@ -28,27 +32,41 @@ const MARK_HIT_SIZE = 24;
|
|
|
28
32
|
const formatChartTooltip = ({
|
|
29
33
|
formatValue,
|
|
30
34
|
point,
|
|
35
|
+
seriesLabel,
|
|
31
36
|
}: {
|
|
32
37
|
formatValue: (value: number) => string;
|
|
33
38
|
point: ChartPoint;
|
|
39
|
+
seriesLabel?: string;
|
|
34
40
|
}): string => {
|
|
35
|
-
|
|
41
|
+
const prefix = seriesLabel ? `${seriesLabel} — ` : "";
|
|
42
|
+
return `${prefix}${point.label}: ${formatValue(point.value)}`;
|
|
36
43
|
};
|
|
37
44
|
|
|
45
|
+
interface ActivePoint {
|
|
46
|
+
pointIndex: number;
|
|
47
|
+
seriesIndex: number;
|
|
48
|
+
}
|
|
49
|
+
|
|
38
50
|
export const AreaChart: FC<AreaChartProps> = ({
|
|
39
51
|
accessibilityLabel,
|
|
52
|
+
comparisonData = [],
|
|
40
53
|
data,
|
|
41
54
|
emptyText = "No data",
|
|
42
55
|
formatValue = String,
|
|
43
56
|
height = DEFAULT_HEIGHT,
|
|
44
57
|
legendLabel,
|
|
45
58
|
loading = false,
|
|
59
|
+
onPeriodPress,
|
|
60
|
+
periodLabel,
|
|
61
|
+
series,
|
|
46
62
|
testID,
|
|
63
|
+
title,
|
|
64
|
+
xTickPolicy = "auto",
|
|
47
65
|
}) => {
|
|
48
66
|
const {theme} = useTheme();
|
|
49
67
|
const paint = getChartPaint(theme);
|
|
50
68
|
const [chartWidth, setChartWidth] = useState(DEFAULT_WIDTH);
|
|
51
|
-
const [
|
|
69
|
+
const [activePoint, setActivePoint] = useState<ActivePoint | undefined>(undefined);
|
|
52
70
|
|
|
53
71
|
const handleLayout = useCallback((event: LayoutChangeEvent): void => {
|
|
54
72
|
const nextWidth = event.nativeEvent.layout.width;
|
|
@@ -57,30 +75,59 @@ export const AreaChart: FC<AreaChartProps> = ({
|
|
|
57
75
|
}
|
|
58
76
|
}, []);
|
|
59
77
|
|
|
60
|
-
const handleMarkPress = useCallback((pointIndex: number): void => {
|
|
61
|
-
|
|
78
|
+
const handleMarkPress = useCallback((seriesIndex: number, pointIndex: number): void => {
|
|
79
|
+
setActivePoint({pointIndex, seriesIndex});
|
|
62
80
|
}, []);
|
|
63
81
|
|
|
82
|
+
const resolvedSeries = resolveChartSeries({data, legendLabel, series});
|
|
83
|
+
const allPoints = getAllSeriesPoints({comparisonData, series: resolvedSeries});
|
|
84
|
+
const axisPoints = getAxisPoints({comparisonData, series: resolvedSeries});
|
|
85
|
+
const coloredSeries = resolvedSeries.map((entry, index) => ({
|
|
86
|
+
...entry,
|
|
87
|
+
color: entry.color ?? paint.slices[index % paint.slices.length] ?? paint.series,
|
|
88
|
+
}));
|
|
64
89
|
const axisWidth = getChartAxisWidth(chartWidth);
|
|
65
|
-
const
|
|
90
|
+
const legendItems =
|
|
91
|
+
series && series.length > 0
|
|
92
|
+
? coloredSeries.map((entry) => ({color: entry.color, label: entry.label}))
|
|
93
|
+
: undefined;
|
|
94
|
+
const isXTickRotated = shouldRotateChartXTicks({
|
|
95
|
+
labelCount: axisPoints.length,
|
|
96
|
+
policy: xTickPolicy,
|
|
97
|
+
});
|
|
98
|
+
const xAxisHeight = isXTickRotated ? CHART_ROTATED_X_AXIS_HEIGHT : CHART_X_AXIS_HEIGHT;
|
|
99
|
+
const plotHeight = getPlotHeight({
|
|
100
|
+
hasLegend: Boolean(legendLabel) || Boolean(legendItems?.length),
|
|
101
|
+
height,
|
|
102
|
+
xAxisHeight,
|
|
103
|
+
});
|
|
66
104
|
const plot = getChartPlot({chartWidth, height: plotHeight});
|
|
67
105
|
const plotWidth = chartWidth - axisWidth;
|
|
68
|
-
const scales = createCartesianScales({
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
const
|
|
74
|
-
|
|
106
|
+
const scales = createCartesianScales({
|
|
107
|
+
plot,
|
|
108
|
+
points: allPoints,
|
|
109
|
+
xLabels: axisPoints.map((point) => point.label),
|
|
110
|
+
});
|
|
111
|
+
const comparisonPath = getLinePath({points: comparisonData, scales});
|
|
112
|
+
const yTicks = getYTickValues(allPoints);
|
|
113
|
+
const activeSeries = activePoint ? coloredSeries[activePoint.seriesIndex] : undefined;
|
|
114
|
+
const selectedPoint = activePoint ? activeSeries?.data[activePoint.pointIndex] : undefined;
|
|
115
|
+
const tooltipText = selectedPoint
|
|
116
|
+
? formatChartTooltip({
|
|
117
|
+
formatValue,
|
|
118
|
+
point: selectedPoint,
|
|
119
|
+
seriesLabel: series && series.length > 0 ? activeSeries?.label : undefined,
|
|
120
|
+
})
|
|
75
121
|
: undefined;
|
|
76
122
|
const summaryLabel =
|
|
77
123
|
accessibilityLabel ?? (legendLabel ? `${legendLabel} area chart` : "Area chart");
|
|
78
124
|
|
|
79
|
-
|
|
125
|
+
const chart = (
|
|
80
126
|
<ChartFrame
|
|
81
127
|
accessibilityLabel={summaryLabel}
|
|
82
128
|
emptyText={emptyText}
|
|
83
|
-
isEmpty={
|
|
129
|
+
isEmpty={allPoints.length === 0}
|
|
130
|
+
legendItems={legendItems}
|
|
84
131
|
legendLabel={legendLabel}
|
|
85
132
|
loading={loading}
|
|
86
133
|
testID={testID}
|
|
@@ -116,69 +163,120 @@ export const AreaChart: FC<AreaChartProps> = ({
|
|
|
116
163
|
/>
|
|
117
164
|
);
|
|
118
165
|
})}
|
|
119
|
-
{
|
|
120
|
-
<Path
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
cy={scales.y(point.value)}
|
|
129
|
-
fill={paint.series}
|
|
130
|
-
key={`dot-${point.label}`}
|
|
131
|
-
r={4}
|
|
166
|
+
{comparisonPath ? (
|
|
167
|
+
<Path
|
|
168
|
+
d={comparisonPath}
|
|
169
|
+
fill="none"
|
|
170
|
+
opacity={0.6}
|
|
171
|
+
stroke={paint.series}
|
|
172
|
+
strokeDasharray="4 4"
|
|
173
|
+
strokeWidth={2}
|
|
174
|
+
testID={resolveTestID(testID, "comparison")}
|
|
132
175
|
/>
|
|
133
|
-
)
|
|
176
|
+
) : null}
|
|
177
|
+
{coloredSeries.flatMap((entry, seriesIndex) => {
|
|
178
|
+
const areaPath = getAreaPath({
|
|
179
|
+
baselineY: scales.y(0),
|
|
180
|
+
points: entry.data,
|
|
181
|
+
scales,
|
|
182
|
+
});
|
|
183
|
+
const linePath = getLinePath({points: entry.data, scales});
|
|
184
|
+
return [
|
|
185
|
+
areaPath ? (
|
|
186
|
+
<Path
|
|
187
|
+
d={areaPath}
|
|
188
|
+
fill={entry.color}
|
|
189
|
+
fillOpacity={0.2}
|
|
190
|
+
key={`area-${entry.id}`}
|
|
191
|
+
stroke="none"
|
|
192
|
+
testID={resolveTestID(testID, `series.${seriesIndex}.area`)}
|
|
193
|
+
/>
|
|
194
|
+
) : null,
|
|
195
|
+
linePath ? (
|
|
196
|
+
<Path
|
|
197
|
+
d={linePath}
|
|
198
|
+
fill="none"
|
|
199
|
+
key={`line-${entry.id}`}
|
|
200
|
+
stroke={entry.color}
|
|
201
|
+
strokeDasharray={entry.stroke === "dotted" ? "4 4" : undefined}
|
|
202
|
+
strokeWidth={2}
|
|
203
|
+
testID={resolveTestID(testID, `series.${seriesIndex}.path`)}
|
|
204
|
+
/>
|
|
205
|
+
) : null,
|
|
206
|
+
];
|
|
207
|
+
})}
|
|
208
|
+
{coloredSeries.flatMap((entry, seriesIndex) =>
|
|
209
|
+
entry.data.map((point, pointIndex) => (
|
|
210
|
+
<Circle
|
|
211
|
+
cx={scales.xCenter(point.label)}
|
|
212
|
+
cy={scales.y(point.value)}
|
|
213
|
+
fill={entry.color}
|
|
214
|
+
key={`dot-${entry.id}-${point.label}`}
|
|
215
|
+
r={4}
|
|
216
|
+
testID={resolveTestID(testID, `series.${seriesIndex}.marker.${pointIndex}`)}
|
|
217
|
+
/>
|
|
218
|
+
))
|
|
219
|
+
)}
|
|
134
220
|
</Svg>
|
|
135
|
-
{
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
221
|
+
{coloredSeries.flatMap((entry, seriesIndex) =>
|
|
222
|
+
entry.data.map((point, pointIndex) => {
|
|
223
|
+
const onPress = (): void => {
|
|
224
|
+
handleMarkPress(seriesIndex, pointIndex);
|
|
225
|
+
};
|
|
226
|
+
const markTestID =
|
|
227
|
+
series && series.length > 0
|
|
228
|
+
? `series.${seriesIndex}.point.${pointIndex}`
|
|
229
|
+
: `point.${pointIndex}`;
|
|
230
|
+
return (
|
|
231
|
+
<Box
|
|
232
|
+
accessibilityHint={`Show value for ${point.label}`}
|
|
233
|
+
accessibilityLabel={
|
|
234
|
+
series && series.length > 0
|
|
235
|
+
? `${entry.label} — ${point.label}: ${formatValue(point.value)}`
|
|
236
|
+
: `${point.label}: ${formatValue(point.value)}`
|
|
237
|
+
}
|
|
238
|
+
dangerouslySetInlineStyle={{
|
|
239
|
+
__style: {
|
|
240
|
+
height: MARK_HIT_SIZE,
|
|
241
|
+
left: scales.xCenter(point.label) - MARK_HIT_SIZE / 2,
|
|
242
|
+
position: "absolute",
|
|
243
|
+
top: scales.y(point.value) - MARK_HIT_SIZE / 2,
|
|
244
|
+
width: MARK_HIT_SIZE,
|
|
245
|
+
},
|
|
246
|
+
}}
|
|
247
|
+
key={`mark-${entry.id}-${point.label}`}
|
|
248
|
+
onClick={onPress}
|
|
249
|
+
onHoverStart={onPress}
|
|
250
|
+
testID={resolveTestID(testID, markTestID)}
|
|
251
|
+
/>
|
|
252
|
+
);
|
|
253
|
+
})
|
|
254
|
+
)}
|
|
159
255
|
</Box>
|
|
160
256
|
</Box>
|
|
161
257
|
<Box direction="row">
|
|
162
258
|
<Box width={axisWidth} />
|
|
163
|
-
<Box
|
|
164
|
-
|
|
165
|
-
height={CHART_X_AXIS_HEIGHT}
|
|
166
|
-
minWidth={0}
|
|
167
|
-
overflow="hidden"
|
|
168
|
-
position="relative"
|
|
169
|
-
>
|
|
170
|
-
{data.map((point, index) => (
|
|
259
|
+
<Box flex="grow" height={xAxisHeight} minWidth={0} overflow="hidden" position="relative">
|
|
260
|
+
{axisPoints.map((point, index) => (
|
|
171
261
|
<Box
|
|
172
262
|
dangerouslySetInlineStyle={{
|
|
173
263
|
__style: getXTickStyle({
|
|
174
264
|
bandwidth: scales.bandwidth,
|
|
265
|
+
isRotated: isXTickRotated,
|
|
175
266
|
xCenter: scales.xCenter(point.label),
|
|
176
267
|
}),
|
|
177
268
|
}}
|
|
178
269
|
key={`xtick-${point.label}`}
|
|
179
270
|
testID={resolveTestID(testID, `xtick.${index}`)}
|
|
180
271
|
>
|
|
181
|
-
<Text
|
|
272
|
+
<Text
|
|
273
|
+
align="center"
|
|
274
|
+
color="secondaryDark"
|
|
275
|
+
numberOfLines={1}
|
|
276
|
+
size="sm"
|
|
277
|
+
skipLinking
|
|
278
|
+
truncate={!isXTickRotated}
|
|
279
|
+
>
|
|
182
280
|
{point.label}
|
|
183
281
|
</Text>
|
|
184
282
|
</Box>
|
|
@@ -188,7 +286,18 @@ export const AreaChart: FC<AreaChartProps> = ({
|
|
|
188
286
|
</Box>
|
|
189
287
|
</ChartFrame>
|
|
190
288
|
);
|
|
289
|
+
|
|
290
|
+
return (
|
|
291
|
+
<ChartFacadeContainer
|
|
292
|
+
onPeriodPress={onPeriodPress}
|
|
293
|
+
periodLabel={periodLabel}
|
|
294
|
+
testID={testID}
|
|
295
|
+
title={title}
|
|
296
|
+
>
|
|
297
|
+
{chart}
|
|
298
|
+
</ChartFacadeContainer>
|
|
299
|
+
);
|
|
191
300
|
};
|
|
192
301
|
|
|
193
302
|
export type {AreaChartProps} from "./Common";
|
|
194
|
-
export type {ChartPoint} from "./charts/types/chartTypes";
|
|
303
|
+
export type {ChartPoint, ChartSeries} from "./charts/types/chartTypes";
|