@terreno/ui 57.9.0 → 57.11.0
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/LICENSE +1 -0
- package/README.md +2 -0
- package/dist/Button.d.ts.map +1 -1
- package/dist/Button.js +20 -5
- package/dist/Button.js.map +1 -1
- package/dist/Common.d.ts +74 -1
- package/dist/Common.d.ts.map +1 -1
- package/dist/Common.js.map +1 -1
- package/dist/DataTable.js +1 -1
- package/dist/DataTable.js.map +1 -1
- package/dist/DateTimeActionSheet.js +1 -1
- package/dist/DateTimeActionSheet.js.map +1 -1
- package/dist/DateTimeField.d.ts.map +1 -1
- package/dist/DateTimeField.js +91 -18
- package/dist/DateTimeField.js.map +1 -1
- package/dist/FilePickerButton.d.ts +15 -1
- package/dist/FilePickerButton.d.ts.map +1 -1
- package/dist/FilePickerButton.js +26 -9
- 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 +199 -7
- 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/SplitPage.d.ts +2 -2
- package/dist/SplitPage.d.ts.map +1 -1
- package/dist/SplitPage.js +17 -5
- package/dist/SplitPage.js.map +1 -1
- 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/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/index.d.ts +6 -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 +6 -0
- package/dist/lazyBoundaries/heavyOptionalExports.d.ts.map +1 -1
- package/dist/lazyBoundaries/heavyOptionalExports.js +4 -0
- package/dist/lazyBoundaries/heavyOptionalExports.js.map +1 -1
- package/dist/table/TableHeaderCell.js +1 -1
- package/dist/table/TableHeaderCell.js.map +1 -1
- package/package.json +2 -1
- package/src/Button.test.tsx +101 -0
- package/src/Button.tsx +35 -5
- package/src/Common.ts +73 -0
- package/src/DataTable.tsx +1 -1
- package/src/DateTimeActionSheet.tsx +1 -1
- package/src/DateTimeField.test.tsx +185 -2
- package/src/DateTimeField.tsx +107 -17
- package/src/DonutChart.test.tsx +5 -10
- package/src/FilePickerButton.test.tsx +56 -3
- package/src/FilePickerButton.tsx +83 -17
- package/src/GPTChat.test.tsx +758 -2
- package/src/GPTChat.tsx +517 -7
- package/src/HtmlFrame.tsx +60 -0
- package/src/LineChart.test.tsx +5 -10
- package/src/SplitPage.test.tsx +55 -0
- package/src/SplitPage.tsx +13 -7
- package/src/Text.test.tsx +22 -0
- package/src/Text.tsx +10 -1
- package/src/__snapshots__/Button.test.tsx.snap +1 -1
- package/src/__snapshots__/SplitPage.test.tsx.snap +14 -0
- 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 +0 -6
- package/src/index.tsx +7 -0
- package/src/isolated/HtmlFrame.isolated.tsx +54 -0
- package/src/lazyBoundaries/heavyOptionalExports.test.tsx +2 -0
- package/src/lazyBoundaries/heavyOptionalExports.tsx +14 -0
- package/src/table/TableHeaderCell.tsx +1 -1
|
@@ -2,7 +2,9 @@ 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";
|
|
6
8
|
import type { ChartCard as ChartCardComponent } from "../ChartCard";
|
|
7
9
|
import type { ConflictSheet as ConflictSheetComponent } from "../ConflictSheet";
|
|
8
10
|
import type { ConsentFormScreen as ConsentFormScreenComponent } from "../ConsentFormScreen";
|
|
@@ -22,8 +24,10 @@ export declare const heavyOptionalModuleFactories: {
|
|
|
22
24
|
readonly AIRequestExplorer: () => Promise<typeof import("../AIRequestExplorer")>;
|
|
23
25
|
readonly AiSuggestionBox: () => Promise<typeof import("../AiSuggestionBox")>;
|
|
24
26
|
readonly AreaChart: () => Promise<typeof import("../AreaChart")>;
|
|
27
|
+
readonly AskCard: () => Promise<typeof import("../asks/AskCard")>;
|
|
25
28
|
readonly AttachmentPreview: () => Promise<typeof import("../AttachmentPreview")>;
|
|
26
29
|
readonly BarChart: () => Promise<typeof import("../BarChart")>;
|
|
30
|
+
readonly BlocksView: () => Promise<typeof import("../blocks/BlocksView")>;
|
|
27
31
|
readonly ChartCard: () => Promise<typeof import("../ChartCard")>;
|
|
28
32
|
readonly ConflictSheet: () => Promise<typeof import("../ConflictSheet")>;
|
|
29
33
|
readonly ConsentFormScreen: () => Promise<typeof import("../ConsentFormScreen")>;
|
|
@@ -43,8 +47,10 @@ export declare const heavyOptionalModuleFactories: {
|
|
|
43
47
|
export declare const AIRequestExplorer: typeof AIRequestExplorerComponent;
|
|
44
48
|
export declare const AreaChart: typeof AreaChartComponent;
|
|
45
49
|
export declare const AiSuggestionBox: typeof AiSuggestionBoxComponent;
|
|
50
|
+
export declare const AskCard: typeof AskCardComponent;
|
|
46
51
|
export declare const AttachmentPreview: typeof AttachmentPreviewComponent;
|
|
47
52
|
export declare const BarChart: typeof BarChartComponent;
|
|
53
|
+
export declare const BlocksView: typeof BlocksViewComponent;
|
|
48
54
|
export declare const ChartCard: typeof ChartCardComponent;
|
|
49
55
|
export declare const ConflictSheet: typeof ConflictSheetComponent;
|
|
50
56
|
export declare const ConsentFormScreen: typeof ConsentFormScreenComponent;
|
|
@@ -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,CAAC;AAC1F,OAAO,KAAK,EAAC,Q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,EAGX,OAAO,uBAAuB,CAAC;AAE/C,eAAO,MAAM,cAAc,EAGX,OAAO,uBAAuB,CAAC;AAE/C,eAAO,MAAM,mBAAmB,EAGhB,OAAO,4BAA4B,CAAC;AAEpD,eAAO,MAAM,SAAS,EAGN,OAAO,kBAAkB,CAAC;AAE1C,eAAO,MAAM,cAAc,EAGX,OAAO,uBAAuB,CAAC;AAE/C,eAAO,MAAM,qBAAqB,EAGlB,OAAO,8BAA8B,CAAC"}
|
|
@@ -4,8 +4,10 @@ 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"),
|
|
9
11
|
ChartCard: () => import("../ChartCard"),
|
|
10
12
|
ConflictSheet: () => import("../ConflictSheet"),
|
|
11
13
|
ConsentFormScreen: () => import("../ConsentFormScreen"),
|
|
@@ -35,8 +37,10 @@ const EMOJI_SELECTOR_DEFAULT_PROPS = {
|
|
|
35
37
|
export const AIRequestExplorer = createLazyNamedExport(heavyOptionalModuleFactories.AIRequestExplorer, "AIRequestExplorer");
|
|
36
38
|
export const AreaChart = createLazyNamedExport(heavyOptionalModuleFactories.AreaChart, "AreaChart");
|
|
37
39
|
export const AiSuggestionBox = createLazyNamedExport(heavyOptionalModuleFactories.AiSuggestionBox, "AiSuggestionBox");
|
|
40
|
+
export const AskCard = createLazyNamedExport(heavyOptionalModuleFactories.AskCard, "AskCard");
|
|
38
41
|
export const AttachmentPreview = createLazyNamedExport(heavyOptionalModuleFactories.AttachmentPreview, "AttachmentPreview");
|
|
39
42
|
export const BarChart = createLazyNamedExport(heavyOptionalModuleFactories.BarChart, "BarChart");
|
|
43
|
+
export const BlocksView = createLazyNamedExport(heavyOptionalModuleFactories.BlocksView, "BlocksView");
|
|
40
44
|
export const ChartCard = createLazyNamedExport(heavyOptionalModuleFactories.ChartCard, "ChartCard");
|
|
41
45
|
export const ConflictSheet = createLazyNamedExport(heavyOptionalModuleFactories.ConflictSheet, "ConflictSheet");
|
|
42
46
|
export const ConsentFormScreen = createLazyNamedExport(heavyOptionalModuleFactories.ConsentFormScreen, "ConsentFormScreen");
|
|
@@ -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,kBAAk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a,EAAE;IACjG,YAAY,EAAE,4BAA4B;CAC3C,CAA6C,CAAC;AAE/C,MAAM,CAAC,MAAM,OAAO,GAAG,qBAAqB,CAC1C,4BAA4B,CAAC,OAAO,EACpC,SAAS,CAC4B,CAAC;AAExC,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,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"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
// TableHeaderCell.tsx
|
|
3
|
-
import
|
|
3
|
+
import FontAwesome6 from "@expo/vector-icons/FontAwesome6";
|
|
4
4
|
import { useCallback } from "react";
|
|
5
5
|
import { Box } from "../Box";
|
|
6
6
|
import { useTheme } from "../Theme";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableHeaderCell.js","sourceRoot":"","sources":["../../src/table/TableHeaderCell.tsx"],"names":[],"mappings":";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AAI,EAC7D,OAAO,CAAC,IAAI,CAAC,IAAI,CAChB,KAAC,GAAG,IAAC,SAAS,EAAC,KAAK,EAAC,QAAQ,EAAE,CAAC,YAE9B,KAAC,GAAG,IACF,UAAU,EAAC,QAAQ,EACnB,KAAK,EAAC,SAAS,EACf,MAAM,EAAE,EAAE,EACV,cAAc,EAAC,QAAQ,EACvB,QAAQ,EAAC,SAAS,EAClB,KAAK,EAAE,EAAE,YAET,KAAC,YAAY,IACX,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,QAAQ,EAC1B,IAAI,EAAE,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,UAAU,EAChD,UAAU,EAAE,SAAS,EACrB,IAAI,EAAE,EAAE,EACR,KAAK,SACL,GACE,GACF,CACP,IACG,CACP,CAAC;AACJ,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.11.0",
|
|
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.11.0",
|
|
166
167
|
"bugs": {
|
|
167
168
|
"url": "https://github.com/TerrenoLabs/terreno/issues"
|
|
168
169
|
},
|
package/src/Button.test.tsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {describe, expect, it, mock, spyOn} from "bun:test";
|
|
2
2
|
import {act, fireEvent, render, waitFor} from "@testing-library/react-native";
|
|
3
3
|
import {assert} from "chai";
|
|
4
|
+
import type {ReactTestInstance} from "react-test-renderer";
|
|
4
5
|
|
|
5
6
|
import {Button} from "./Button";
|
|
6
7
|
import type {ButtonProps} from "./Common";
|
|
@@ -31,6 +32,22 @@ interface CancelablePress {
|
|
|
31
32
|
cancel: () => void;
|
|
32
33
|
}
|
|
33
34
|
|
|
35
|
+
const LONG_LABEL = "Go team 🎉🎉🎉🎉🎉…";
|
|
36
|
+
|
|
37
|
+
const hostParentOf = (node: ReactTestInstance | null): ReactTestInstance | null => {
|
|
38
|
+
let parent = node?.parent ?? null;
|
|
39
|
+
while (parent && typeof parent.type !== "string") {
|
|
40
|
+
parent = parent.parent;
|
|
41
|
+
}
|
|
42
|
+
return parent;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
/** The label and the icon and spinner rows around it, innermost first. */
|
|
46
|
+
const labelAndRows = (label: ReactTestInstance): (ReactTestInstance | null)[] => {
|
|
47
|
+
const iconRow = hostParentOf(label);
|
|
48
|
+
return [label, iconRow, hostParentOf(iconRow)];
|
|
49
|
+
};
|
|
50
|
+
|
|
34
51
|
describe("Button", () => {
|
|
35
52
|
it("renders correctly with default props", () => {
|
|
36
53
|
const {toJSON} = renderWithTheme(<Button onClick={() => {}} text="Click me" />);
|
|
@@ -49,6 +66,61 @@ describe("Button", () => {
|
|
|
49
66
|
expect(getByTestId("test-button")).toBeTruthy();
|
|
50
67
|
});
|
|
51
68
|
|
|
69
|
+
it("keeps a long label on one line by default", () => {
|
|
70
|
+
const {getByTestId, getByText} = renderWithTheme(
|
|
71
|
+
<Button onClick={() => {}} size="sm" testID="one-line" text={LONG_LABEL} />
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
const [label, iconRow, spinnerRow] = labelAndRows(getByText(LONG_LABEL));
|
|
75
|
+
for (const node of [label, iconRow, spinnerRow]) {
|
|
76
|
+
expect(node?.props.style).not.toHaveProperty("flexShrink");
|
|
77
|
+
}
|
|
78
|
+
expect(label?.props.style).not.toHaveProperty("textAlign");
|
|
79
|
+
const style = getByTestId("one-line").props.style;
|
|
80
|
+
expect(style).toMatchObject({height: 28, paddingVertical: 0});
|
|
81
|
+
expect(style).not.toHaveProperty("maxWidth");
|
|
82
|
+
expect(style).not.toHaveProperty("minHeight");
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
it("fits its container and wraps a long label onto centered lines with wrapText", () => {
|
|
86
|
+
const {getByTestId, getByText} = renderWithTheme(
|
|
87
|
+
<Button onClick={() => {}} testID="wrapping" text={LONG_LABEL} wrapText />
|
|
88
|
+
);
|
|
89
|
+
|
|
90
|
+
const [label, iconRow, spinnerRow] = labelAndRows(getByText(LONG_LABEL));
|
|
91
|
+
expect(label?.props.style).toMatchObject({flexShrink: 1, textAlign: "center"});
|
|
92
|
+
for (const row of [iconRow, spinnerRow]) {
|
|
93
|
+
expect(row?.props.style).toMatchObject({flexShrink: 1});
|
|
94
|
+
}
|
|
95
|
+
const style = getByTestId("wrapping").props.style;
|
|
96
|
+
expect(style).toMatchObject({maxWidth: "100%", paddingVertical: 8});
|
|
97
|
+
expect(style.height).toBeUndefined();
|
|
98
|
+
expect(style).not.toHaveProperty("minHeight");
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
for (const {paddingVertical, variant} of [
|
|
102
|
+
{paddingVertical: 4, variant: "primary"},
|
|
103
|
+
{paddingVertical: 2, variant: "outline"},
|
|
104
|
+
] as const) {
|
|
105
|
+
it(`grows a sm ${variant} button from 28px instead of clipping a wrapped label`, () => {
|
|
106
|
+
const {getByTestId, getByText} = renderWithTheme(
|
|
107
|
+
<Button
|
|
108
|
+
onClick={() => {}}
|
|
109
|
+
size="sm"
|
|
110
|
+
testID="sm-wrap"
|
|
111
|
+
text={LONG_LABEL}
|
|
112
|
+
variant={variant}
|
|
113
|
+
wrapText
|
|
114
|
+
/>
|
|
115
|
+
);
|
|
116
|
+
|
|
117
|
+
const style = getByTestId("sm-wrap").props.style;
|
|
118
|
+
expect(style.height).toBeUndefined();
|
|
119
|
+
expect(style).toMatchObject({maxWidth: "100%", minHeight: 28, paddingVertical});
|
|
120
|
+
expect(getByText(LONG_LABEL).props.style).toMatchObject({flexShrink: 1, fontSize: 14});
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
|
|
52
124
|
it("supports an accessible name distinct from visible text", () => {
|
|
53
125
|
const {getByTestId} = renderWithTheme(
|
|
54
126
|
<Button accessibilityLabel="Filter Name" onClick={() => {}} testID="filter-button" text="" />
|
|
@@ -122,6 +194,35 @@ describe("Button", () => {
|
|
|
122
194
|
expect(getByTestId("outline-active").props.style.borderWidth).toBeUndefined();
|
|
123
195
|
});
|
|
124
196
|
|
|
197
|
+
for (const size of ["default", "sm"] as const) {
|
|
198
|
+
it(`renders ${size} outline button with the same outer box as solid buttons`, () => {
|
|
199
|
+
const {getByTestId} = renderWithTheme(
|
|
200
|
+
<>
|
|
201
|
+
<Button onClick={() => {}} size={size} testID="solid" text="Solid" />
|
|
202
|
+
<Button
|
|
203
|
+
onClick={() => {}}
|
|
204
|
+
size={size}
|
|
205
|
+
testID="outline"
|
|
206
|
+
text="Outline"
|
|
207
|
+
variant="outline"
|
|
208
|
+
/>
|
|
209
|
+
</>
|
|
210
|
+
);
|
|
211
|
+
const outerBox = (style: Record<string, number | undefined>): Record<string, number> => {
|
|
212
|
+
const border = style.borderWidth ?? 0;
|
|
213
|
+
return {
|
|
214
|
+
height: style.height ?? 0,
|
|
215
|
+
horizontal: (style.paddingHorizontal ?? 0) + border,
|
|
216
|
+
vertical: style.height === undefined ? (style.paddingVertical ?? 0) + border : 0,
|
|
217
|
+
};
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
expect(outerBox(getByTestId("outline").props.style)).toEqual(
|
|
221
|
+
outerBox(getByTestId("solid").props.style)
|
|
222
|
+
);
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
|
|
125
226
|
it("keeps disabled styling when state is active", () => {
|
|
126
227
|
const {getByTestId} = renderWithTheme(
|
|
127
228
|
<Button
|
package/src/Button.tsx
CHANGED
|
@@ -8,7 +8,15 @@ import {
|
|
|
8
8
|
} from "pressto";
|
|
9
9
|
import type React from "react";
|
|
10
10
|
import {lazy, memo, Suspense, useCallback, useEffect, useMemo, useRef, useState} from "react";
|
|
11
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
ActivityIndicator,
|
|
13
|
+
Pressable,
|
|
14
|
+
type PressableProps,
|
|
15
|
+
Text,
|
|
16
|
+
type TextStyle,
|
|
17
|
+
View,
|
|
18
|
+
type ViewStyle,
|
|
19
|
+
} from "react-native";
|
|
12
20
|
|
|
13
21
|
import {Box} from "./Box";
|
|
14
22
|
import type {ButtonPressAnimation, ButtonProps} from "./Common";
|
|
@@ -95,6 +103,7 @@ const ButtonVisual: React.FC<ButtonVisualProps> = ({
|
|
|
95
103
|
text,
|
|
96
104
|
variant = "primary",
|
|
97
105
|
withConfirmation = false,
|
|
106
|
+
wrapText = false,
|
|
98
107
|
}) => {
|
|
99
108
|
const {theme} = useTheme();
|
|
100
109
|
const CustomIcon = useCustomIcon(iconName);
|
|
@@ -157,6 +166,20 @@ const ButtonVisual: React.FC<ButtonVisualProps> = ({
|
|
|
157
166
|
isPressDisabled ? Pressable : PRESSABLE_BY_ANIMATION[pressAnimation]
|
|
158
167
|
) as React.ComponentType<ButtonPressableProps>;
|
|
159
168
|
const pressableInteractionProps = isPressDisabled ? {disabled: true} : {enabled: true};
|
|
169
|
+
// `maxWidth` lets a button in a row fit the row instead of its one-line label. The fixed `sm`
|
|
170
|
+
// height would clip a wrapped second line, so a wrapping `sm` button grows from 28px instead.
|
|
171
|
+
const wrapBoxStyle: ViewStyle | undefined = wrapText
|
|
172
|
+
? {
|
|
173
|
+
maxWidth: "100%",
|
|
174
|
+
...(size === "sm"
|
|
175
|
+
? {height: undefined, minHeight: 28, paddingVertical: 4 - (borderWidth ?? 0)}
|
|
176
|
+
: undefined),
|
|
177
|
+
}
|
|
178
|
+
: undefined;
|
|
179
|
+
const wrapRowStyle: ViewStyle | undefined = wrapText ? {flexShrink: 1} : undefined;
|
|
180
|
+
const wrapLabelStyle: TextStyle | undefined = wrapText
|
|
181
|
+
? {flexShrink: 1, textAlign: "center"}
|
|
182
|
+
: undefined;
|
|
160
183
|
|
|
161
184
|
return (
|
|
162
185
|
<PressableComponent
|
|
@@ -178,14 +201,17 @@ const ButtonVisual: React.FC<ButtonVisualProps> = ({
|
|
|
178
201
|
flexDirection: "column",
|
|
179
202
|
height: size === "sm" ? 28 : undefined,
|
|
180
203
|
justifyContent: "center",
|
|
181
|
-
paddingHorizontal: size === "sm" ? 16 : 20,
|
|
204
|
+
paddingHorizontal: (size === "sm" ? 16 : 20) - (borderWidth ?? 0),
|
|
182
205
|
paddingVertical: size === "sm" ? 0 : 8 - (borderWidth ?? 0),
|
|
183
206
|
width: fullWidth ? "100%" : "auto",
|
|
207
|
+
...wrapBoxStyle,
|
|
184
208
|
}}
|
|
185
209
|
testID={testID}
|
|
186
210
|
>
|
|
187
|
-
<View style={{flexDirection: "row"}}>
|
|
188
|
-
<View
|
|
211
|
+
<View style={{flexDirection: "row", ...wrapRowStyle}}>
|
|
212
|
+
<View
|
|
213
|
+
style={{flexDirection: iconPosition === "left" ? "row" : "row-reverse", ...wrapRowStyle}}
|
|
214
|
+
>
|
|
189
215
|
{Boolean(iconName) && (
|
|
190
216
|
<View
|
|
191
217
|
style={{
|
|
@@ -201,7 +227,11 @@ const ButtonVisual: React.FC<ButtonVisualProps> = ({
|
|
|
201
227
|
)}
|
|
202
228
|
</View>
|
|
203
229
|
)}
|
|
204
|
-
<Text
|
|
230
|
+
<Text
|
|
231
|
+
style={{color, fontSize: size === "sm" ? 14 : 16, fontWeight: "700", ...wrapLabelStyle}}
|
|
232
|
+
>
|
|
233
|
+
{text}
|
|
234
|
+
</Text>
|
|
205
235
|
</View>
|
|
206
236
|
{isLoading && (
|
|
207
237
|
<Box marginLeft={2}>
|
package/src/Common.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import type {Block, BlockAction, BlocksDocument, InlineDataset} from "@terreno/blocks";
|
|
1
2
|
import type {CountryCode} from "libphonenumber-js";
|
|
2
3
|
import type React from "react";
|
|
3
4
|
import type {FC, ReactElement, ReactNode} from "react";
|
|
4
5
|
import type {
|
|
5
6
|
ImageStyle,
|
|
6
7
|
ListRenderItemInfo,
|
|
8
|
+
Text as NativeText,
|
|
7
9
|
ScrollView,
|
|
8
10
|
StyleProp,
|
|
9
11
|
TextInput,
|
|
@@ -1022,10 +1024,22 @@ export interface NumberRangeFieldProps extends BaseFieldProps, HelperTextProps,
|
|
|
1022
1024
|
max: number;
|
|
1023
1025
|
}
|
|
1024
1026
|
|
|
1027
|
+
/**
|
|
1028
|
+
* What the typed parts of a {@link DateTimeFieldProps | DateTimeField} hold: nothing, an unfinished
|
|
1029
|
+
* or invalid entry, or a complete value.
|
|
1030
|
+
*/
|
|
1031
|
+
export type DateTimeEntryStatus = "empty" | "invalid" | "valid";
|
|
1032
|
+
|
|
1025
1033
|
export interface DateTimeFieldProps extends BaseFieldProps, HelperTextProps, ErrorTextProps {
|
|
1026
1034
|
type: "date" | "datetime" | "time";
|
|
1027
1035
|
value?: string; // ISO string always
|
|
1028
1036
|
onChange: (date: string) => void;
|
|
1037
|
+
/**
|
|
1038
|
+
* Called after each typed change and picker selection with what the field now holds.
|
|
1039
|
+
* `onChange` only fires for complete values, so use this to refuse an unfinished entry
|
|
1040
|
+
* (such as "0 / 5 / 026") or to notice the user cleared the field.
|
|
1041
|
+
*/
|
|
1042
|
+
onEntryStatusChange?: (status: DateTimeEntryStatus) => void;
|
|
1029
1043
|
onTimezoneChange?: (timezone: string) => void;
|
|
1030
1044
|
dateFormat?: string;
|
|
1031
1045
|
pickerType?: "default" | "compact" | "inline" | "spinner";
|
|
@@ -1107,6 +1121,15 @@ export interface HeadingProps extends WithTestID {
|
|
|
1107
1121
|
truncate?: boolean; // default false
|
|
1108
1122
|
}
|
|
1109
1123
|
|
|
1124
|
+
export interface HtmlFrameProps {
|
|
1125
|
+
/** Frame height. `sm` is 240px, `md` is 400px, and `lg` is 640px. */
|
|
1126
|
+
height?: "lg" | "md" | "sm";
|
|
1127
|
+
/** Sanitized HTML. The frame prepends a Content-Security-Policy meta tag. */
|
|
1128
|
+
html: string;
|
|
1129
|
+
/** Accessible name for the frame. Defaults to Agent-generated preview. */
|
|
1130
|
+
title?: string;
|
|
1131
|
+
}
|
|
1132
|
+
|
|
1110
1133
|
export interface MetaProps {
|
|
1111
1134
|
itemProp?: string;
|
|
1112
1135
|
content?: string;
|
|
@@ -1257,6 +1280,12 @@ export interface SplitPageProps<TItem extends SplitPageListItem = SplitPageListI
|
|
|
1257
1280
|
* When omitted, that button is not rendered.
|
|
1258
1281
|
*/
|
|
1259
1282
|
narrowViewportListButtonLabel?: string;
|
|
1283
|
+
/**
|
|
1284
|
+
* Web only. The native SplitPage ignores this prop.
|
|
1285
|
+
* Border radius applied to each detail child column container. The list column is excluded.
|
|
1286
|
+
* Uses the same rounding scale as `Box` (`md` is 4px). Defaults to `md` when omitted.
|
|
1287
|
+
*/
|
|
1288
|
+
childColumnRounding?: Rounding;
|
|
1260
1289
|
}
|
|
1261
1290
|
|
|
1262
1291
|
export type PermissionKind =
|
|
@@ -1984,6 +2013,36 @@ export type BannerProps =
|
|
|
1984
2013
|
| (BannerPropsBase & {buttonOnClick?: undefined})
|
|
1985
2014
|
| (BannerPropsBase & {buttonOnClick: () => void | Promise<void>} & BannerButtonProps);
|
|
1986
2015
|
|
|
2016
|
+
export interface BlocksViewProps extends WithTestID {
|
|
2017
|
+
/** When true, an `html` block renders in a sandboxed frame. Otherwise it stays a placeholder. */
|
|
2018
|
+
allowHtml?: boolean;
|
|
2019
|
+
/** A whole-reply YAML or JSON string, or a document that already parsed. */
|
|
2020
|
+
document: string | BlocksDocument;
|
|
2021
|
+
/** Names the host will run. A callback outside this list is disabled. Omit to leave callbacks enabled. */
|
|
2022
|
+
hostActions?: readonly string[];
|
|
2023
|
+
/** Hostnames allowed on https image sources. Empty rejects every https image. */
|
|
2024
|
+
imageHosts?: readonly string[];
|
|
2025
|
+
/** Called for reply, open, select, and callback. Select also updates the target chart locally. */
|
|
2026
|
+
onAction?: (event: {action: BlockAction; blockId: string; elementId: string}) => void;
|
|
2027
|
+
/** Block ids replaced in place. The key is the original block id. */
|
|
2028
|
+
overrides?: Record<string, Block>;
|
|
2029
|
+
/** Element ids whose buttons show a loading state. */
|
|
2030
|
+
pendingElementIds?: readonly string[];
|
|
2031
|
+
/** Loads a `ref` dataset. Inline datasets do not call this. */
|
|
2032
|
+
resolveDataset?: (ref: {
|
|
2033
|
+
grain?: "day" | "hour" | "month" | "week";
|
|
2034
|
+
id: string;
|
|
2035
|
+
limit?: number;
|
|
2036
|
+
}) => Promise<InlineDataset | undefined>;
|
|
2037
|
+
/**
|
|
2038
|
+
* Turns a `file:` image id into a URL. Until it resolves, the image is omitted and the alt
|
|
2039
|
+
* text stays. Data and https sources do not call this.
|
|
2040
|
+
*/
|
|
2041
|
+
resolveImage?: (fileId: string) => Promise<string | undefined>;
|
|
2042
|
+
/** While a reply is still streaming, `html` stays a placeholder. */
|
|
2043
|
+
streaming?: boolean;
|
|
2044
|
+
}
|
|
2045
|
+
|
|
1987
2046
|
export interface BodyProps {
|
|
1988
2047
|
scroll?: boolean;
|
|
1989
2048
|
loading?: boolean;
|
|
@@ -2077,6 +2136,13 @@ export interface ButtonProps extends WithTestID {
|
|
|
2077
2136
|
* If true, a confirmation modal will be shown before the onClick action.
|
|
2078
2137
|
*/
|
|
2079
2138
|
withConfirmation?: boolean;
|
|
2139
|
+
/**
|
|
2140
|
+
* If true, the button is never wider than its container, and a label that does not fit wraps
|
|
2141
|
+
* onto centered lines while the button grows taller. A small button grows from its 28px height.
|
|
2142
|
+
* If false, the label stays on one line.
|
|
2143
|
+
* @default false
|
|
2144
|
+
*/
|
|
2145
|
+
wrapText?: boolean;
|
|
2080
2146
|
/**
|
|
2081
2147
|
* The function to call when the button is clicked.
|
|
2082
2148
|
*/
|
|
@@ -3030,6 +3096,8 @@ export interface TableContextProviderProps extends TableContextType {
|
|
|
3030
3096
|
}
|
|
3031
3097
|
|
|
3032
3098
|
export interface TextProps extends WithTestID {
|
|
3099
|
+
/** `"header"` marks the text as a heading, so screen readers announce it and can jump to it. */
|
|
3100
|
+
accessibilityRole?: "header";
|
|
3033
3101
|
align?: "left" | "right" | "center" | "justify"; // default "left"
|
|
3034
3102
|
children?: React.ReactNode;
|
|
3035
3103
|
bold?: boolean; // default false
|
|
@@ -3039,6 +3107,11 @@ export interface TextProps extends WithTestID {
|
|
|
3039
3107
|
truncate?: boolean; // default false
|
|
3040
3108
|
underline?: boolean;
|
|
3041
3109
|
numberOfLines?: number;
|
|
3110
|
+
/**
|
|
3111
|
+
* The native text, for example to move screen reader focus to it with
|
|
3112
|
+
* `AccessibilityInfo.setAccessibilityFocus`.
|
|
3113
|
+
*/
|
|
3114
|
+
ref?: React.Ref<NativeText>;
|
|
3042
3115
|
skipLinking?: boolean;
|
|
3043
3116
|
}
|
|
3044
3117
|
|
package/src/DataTable.tsx
CHANGED