@terreno/ui 57.2.0 → 57.3.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/.ai/guidelines/core.md +1 -1
- package/README.md +17 -8
- package/dist/ActionSheet.d.ts +3 -3
- package/dist/ActionSheet.js +2 -2
- package/dist/ActionSheet.js.map +1 -1
- package/dist/Box.d.ts +1 -1
- package/dist/Box.js +219 -177
- package/dist/Box.js.map +1 -1
- package/dist/Button.js +101 -34
- package/dist/Button.js.map +1 -1
- package/dist/Common.d.ts +119 -9
- package/dist/Common.js.map +1 -1
- package/dist/ConsentFormScreen.js +46 -12
- package/dist/ConsentFormScreen.js.map +1 -1
- package/dist/ConsentNavigator.d.ts +5 -1
- package/dist/ConsentNavigator.js.map +1 -1
- package/dist/DataTable.d.ts +2 -2
- package/dist/DataTable.js +203 -44
- package/dist/DataTable.js.map +1 -1
- package/dist/DataTableHeaderInfoMarkdown.d.ts +6 -0
- package/dist/DataTableHeaderInfoMarkdown.js +7 -0
- package/dist/DataTableHeaderInfoMarkdown.js.map +1 -0
- package/dist/EmojiSelector.d.ts +2 -46
- package/dist/EmojiSelector.js +46 -56
- package/dist/EmojiSelector.js.map +1 -1
- package/dist/GPTChat.js +1 -1
- package/dist/GPTChat.js.map +1 -1
- package/dist/Heading.d.ts +5 -2
- package/dist/Heading.js +6 -8
- package/dist/Heading.js.map +1 -1
- package/dist/Hyperlink.js.map +1 -1
- package/dist/Icon.d.ts +1 -2
- package/dist/Icon.js +4 -1
- package/dist/Icon.js.map +1 -1
- package/dist/MarkdownView.d.ts +6 -3
- package/dist/MarkdownView.js +45 -43
- package/dist/MarkdownView.js.map +1 -1
- package/dist/MediaQuery.d.ts +5 -3
- package/dist/MediaQuery.js +9 -40
- package/dist/MediaQuery.js.map +1 -1
- package/dist/OpenAPIContext.js +7 -6
- package/dist/OpenAPIContext.js.map +1 -1
- package/dist/Page.js +7 -1
- package/dist/Page.js.map +1 -1
- package/dist/PickerSelect.js +8 -1
- package/dist/PickerSelect.js.map +1 -1
- package/dist/Popover.d.ts +12 -0
- package/dist/Popover.js +37 -0
- package/dist/Popover.js.map +1 -0
- package/dist/PortalHost.js +10 -1
- package/dist/PortalHost.js.map +1 -1
- package/dist/ResponsiveBreakpoint.d.ts +65 -0
- package/dist/ResponsiveBreakpoint.js +111 -0
- package/dist/ResponsiveBreakpoint.js.map +1 -0
- package/dist/SplitPage.d.ts +2 -2
- package/dist/SplitPage.js +7 -12
- package/dist/SplitPage.js.map +1 -1
- package/dist/SplitPage.native.d.ts +2 -2
- package/dist/SplitPage.native.js +1 -6
- package/dist/SplitPage.native.js.map +1 -1
- package/dist/TapToEdit.js +12 -10
- package/dist/TapToEdit.js.map +1 -1
- package/dist/TerrenoFontProvider.d.ts +7 -0
- package/dist/TerrenoFontProvider.js +27 -0
- package/dist/TerrenoFontProvider.js.map +1 -0
- package/dist/TerrenoProvider.js +4 -2
- package/dist/TerrenoProvider.js.map +1 -1
- package/dist/Text.d.ts +5 -2
- package/dist/Text.js +6 -11
- package/dist/Text.js.map +1 -1
- package/dist/TextFieldNumberActionSheet.js +9 -2
- package/dist/TextFieldNumberActionSheet.js.map +1 -1
- package/dist/Theme.js +10 -8
- package/dist/Theme.js.map +1 -1
- package/dist/ToastNotifications.d.ts +4 -2
- package/dist/ToastNotifications.js.map +1 -1
- package/dist/Tooltip.d.ts +4 -3
- package/dist/Tooltip.js +14 -3
- package/dist/Tooltip.js.map +1 -1
- package/dist/Unifier.d.ts +26 -1
- package/dist/Unifier.js.map +1 -1
- package/dist/WebAddressAutocomplete.js +6 -1
- package/dist/WebAddressAutocomplete.js.map +1 -1
- package/dist/emojiCategories.d.ts +46 -0
- package/dist/emojiCategories.js +47 -0
- package/dist/emojiCategories.js.map +1 -0
- package/dist/index.d.ts +13 -13
- package/dist/index.js +2 -13
- package/dist/index.js.map +1 -1
- package/dist/lazyBoundaries/createLazyComponentExport.d.ts +6 -0
- package/dist/lazyBoundaries/createLazyComponentExport.js +35 -0
- package/dist/lazyBoundaries/createLazyComponentExport.js.map +1 -0
- package/dist/lazyBoundaries/heavyOptionalExports.d.ts +41 -0
- package/dist/lazyBoundaries/heavyOptionalExports.js +43 -0
- package/dist/lazyBoundaries/heavyOptionalExports.js.map +1 -0
- package/dist/login/LoginScreen.d.ts +1 -0
- package/dist/login/LoginScreen.js +4 -2
- package/dist/login/LoginScreen.js.map +1 -1
- package/dist/login/loginTypes.d.ts +2 -0
- package/package.json +40 -1
- package/src/AIRequestExplorer.test.tsx +141 -0
- package/src/ActionSheet.tsx +9 -7
- package/src/AttachmentPreview.test.tsx +80 -0
- package/src/Box.test.tsx +97 -10
- package/src/Box.tsx +263 -200
- package/src/Button.test.tsx +207 -0
- package/src/Button.tsx +146 -48
- package/src/Common.ts +124 -25
- package/src/ConsentFormScreen.markdownGate.test.tsx +129 -0
- package/src/ConsentFormScreen.test.tsx +145 -8
- package/src/ConsentFormScreen.tsx +74 -25
- package/src/ConsentNavigator.tsx +13 -5
- package/src/DataTable.tsx +418 -147
- package/src/DataTableHeaderInfoMarkdown.test.tsx +21 -0
- package/src/DataTableHeaderInfoMarkdown.tsx +17 -0
- package/src/DataTableVirtualizationRegression.test.tsx +266 -0
- package/src/DateTimeField.test.tsx +54 -0
- package/src/EmojiSelector.test.tsx +33 -42
- package/src/EmojiSelector.tsx +60 -57
- package/src/FilePickerButton.test.tsx +167 -0
- package/src/FilterAccordion.test.tsx +37 -0
- package/src/FilterBoolean.test.tsx +96 -0
- package/src/FilterSelectMenu.test.tsx +23 -0
- package/src/GPTChat.test.tsx +696 -0
- package/src/GPTChat.tsx +2 -2
- package/src/GPTMemoryModal.test.tsx +67 -0
- package/src/Heading.tsx +8 -14
- package/src/HeightActionSheet.test.tsx +6 -9
- package/src/Hyperlink.tsx +5 -18
- package/src/Icon.tsx +6 -2
- package/src/MarkdownEditor.test.tsx +134 -0
- package/src/MarkdownEditorField.test.tsx +124 -0
- package/src/MarkdownView.test.tsx +55 -11
- package/src/MarkdownView.tsx +149 -150
- package/src/MediaQuery.ts +30 -34
- package/src/OpenAPIContext.tsx +36 -29
- package/src/OpenAPIRenderRegression.test.tsx +200 -0
- package/src/P0RenderRegression.test.tsx +214 -0
- package/src/P1RenderRegression.test.tsx +141 -0
- package/src/P2ButtonRenderRegression.test.tsx +158 -0
- package/src/Page.test.tsx +13 -0
- package/src/Page.tsx +25 -5
- package/src/PickerSelect.test.tsx +38 -0
- package/src/PickerSelect.tsx +7 -0
- package/src/Popover.test.tsx +151 -0
- package/src/Popover.tsx +211 -0
- package/src/PortalHost.tsx +12 -6
- package/src/ResponsiveBreakpoint.test.tsx +184 -0
- package/src/ResponsiveBreakpoint.tsx +195 -0
- package/src/RootImportRegression.test.tsx +62 -0
- package/src/SplitPage.native.tsx +5 -9
- package/src/SplitPage.tsx +16 -19
- package/src/TapToEdit.test.tsx +45 -0
- package/src/TapToEdit.tsx +23 -18
- package/src/TerrenoFontProvider.test.tsx +38 -0
- package/src/TerrenoFontProvider.tsx +50 -0
- package/src/TerrenoProvider.tsx +6 -1
- package/src/Text.tsx +8 -21
- package/src/TextFieldNumberActionSheet.test.tsx +100 -0
- package/src/TextFieldNumberActionSheet.tsx +11 -2
- package/src/Theme.test.tsx +27 -0
- package/src/Theme.tsx +15 -10
- package/src/Toast.tsx +1 -1
- package/src/ToastNotifications.tsx +4 -4
- package/src/Tooltip.test.tsx +64 -0
- package/src/Tooltip.tsx +18 -4
- package/src/Unifier.ts +26 -3
- package/src/WebAddressAutocomplete.tsx +6 -2
- package/src/__snapshots__/ActionSheet.test.tsx.snap +0 -36
- package/src/__snapshots__/AddressField.test.tsx.snap +1 -0
- package/src/__snapshots__/AttachmentPreview.test.tsx.snap +225 -0
- package/src/__snapshots__/CustomSelectField.test.tsx.snap +7 -0
- package/src/__snapshots__/DataTable.test.tsx.snap +793 -250
- package/src/__snapshots__/DecimalRangeActionSheet.test.tsx.snap +0 -8
- package/src/__snapshots__/EmojiSelector.test.tsx.snap +35555 -30
- package/src/__snapshots__/Field.test.tsx.snap +7 -0
- package/src/__snapshots__/FilterSelectMenu.test.tsx.snap +1 -0
- package/src/__snapshots__/HeightActionSheet.test.tsx.snap +0 -8
- package/src/__snapshots__/HeightField.test.tsx.snap +0 -20
- package/src/__snapshots__/NumberPickerActionSheet.test.tsx.snap +0 -8
- package/src/__snapshots__/Page.test.tsx.snap +13 -1
- package/src/__snapshots__/PickerSelect.test.tsx.snap +7 -0
- package/src/__snapshots__/SelectField.test.tsx.snap +6 -0
- package/src/__snapshots__/TimezonePicker.test.tsx.snap +6 -0
- package/src/benchmarks/importGraph.test.ts +71 -0
- package/src/benchmarks/importGraph.ts +136 -0
- package/src/benchmarks/importTiming.test.ts +42 -0
- package/src/benchmarks/importTiming.ts +86 -0
- package/src/bunSetup.ts +174 -32
- package/src/emojiCategories.test.ts +23 -0
- package/src/emojiCategories.ts +46 -0
- package/src/index.tsx +27 -13
- package/src/lazyBoundaries/createLazyComponentExport.test.tsx +104 -0
- package/src/lazyBoundaries/createLazyComponentExport.tsx +63 -0
- package/src/lazyBoundaries/heavyOptionalExports.test.tsx +33 -0
- package/src/lazyBoundaries/heavyOptionalExports.tsx +106 -0
- package/src/login/LoginScreen.test.tsx +9 -2
- package/src/login/LoginScreen.tsx +6 -2
- package/src/login/loginTypes.ts +2 -0
- package/src/table/TableDate.test.tsx +35 -1
- package/src/table/__snapshots__/TableBadge.test.tsx.snap +1 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { lazy, Suspense } from "react";
|
|
3
|
+
import { Spinner } from "../Spinner";
|
|
4
|
+
const isLazyComponent = (value) => {
|
|
5
|
+
return typeof value === "function";
|
|
6
|
+
};
|
|
7
|
+
const resolveLazyComponentModule = async (factory) => {
|
|
8
|
+
const moduleNamespace = await factory();
|
|
9
|
+
if (moduleNamespace &&
|
|
10
|
+
typeof moduleNamespace === "object" &&
|
|
11
|
+
"default" in moduleNamespace &&
|
|
12
|
+
isLazyComponent(moduleNamespace.default)) {
|
|
13
|
+
return { default: moduleNamespace.default };
|
|
14
|
+
}
|
|
15
|
+
throw new Error("Lazy component factory must resolve to { default: Component }");
|
|
16
|
+
};
|
|
17
|
+
export const createLazyComponentExport = (factory, staticProperties) => {
|
|
18
|
+
const LazyComponent = lazy(() => resolveLazyComponentModule(factory));
|
|
19
|
+
const LazyExport = (props) => (_jsx(Suspense, { fallback: _jsx(Spinner, {}), children: _jsx(LazyComponent, Object.assign({}, props)) }));
|
|
20
|
+
if (staticProperties) {
|
|
21
|
+
Object.assign(LazyExport, staticProperties);
|
|
22
|
+
}
|
|
23
|
+
return LazyExport;
|
|
24
|
+
};
|
|
25
|
+
export const createLazyNamedExport = (factory, exportName) => {
|
|
26
|
+
return createLazyComponentExport(async () => {
|
|
27
|
+
const moduleNamespace = (await factory());
|
|
28
|
+
const component = moduleNamespace[exportName];
|
|
29
|
+
if (!isLazyComponent(component)) {
|
|
30
|
+
throw new Error(`Lazy export "${exportName}" was not found`);
|
|
31
|
+
}
|
|
32
|
+
return { default: component };
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=createLazyComponentExport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createLazyComponentExport.js","sourceRoot":"","sources":["../../src/lazyBoundaries/createLazyComponentExport.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAqB,IAAI,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AAEhE,OAAO,EAAC,OAAO,EAAC,MAAM,YAAY,CAAC;AAMnC,MAAM,eAAe,GAAG,CAAC,KAAc,EAA0B,EAAE;IACjE,OAAO,OAAO,KAAK,KAAK,UAAU,CAAC;AACrC,CAAC,CAAC;AAEF,MAAM,0BAA0B,GAAG,KAAK,EACtC,OAA+B,EACD,EAAE;IAChC,MAAM,eAAe,GAAG,MAAM,OAAO,EAAE,CAAC;IAExC,IACE,eAAe;QACf,OAAO,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
import type { AIRequestExplorer as AIRequestExplorerComponent } from "../AIRequestExplorer";
|
|
2
|
+
import type { AiSuggestionBox as AiSuggestionBoxComponent } from "../AiSuggestionBox";
|
|
3
|
+
import type { AttachmentPreview as AttachmentPreviewComponent } from "../AttachmentPreview";
|
|
4
|
+
import type { ConflictSheet as ConflictSheetComponent } from "../ConflictSheet";
|
|
5
|
+
import type { ConsentFormScreen as ConsentFormScreenComponent } from "../ConsentFormScreen";
|
|
6
|
+
import type { ConsentNavigator as ConsentNavigatorComponent } from "../ConsentNavigator";
|
|
7
|
+
import type { DraggableList as DraggableListComponent } from "../DraggableList";
|
|
8
|
+
import type EmojiSelectorComponent from "../EmojiSelector";
|
|
9
|
+
import type { GPTChat as GPTChatComponent } from "../GPTChat";
|
|
10
|
+
import type { GPTMemoryModal as GPTMemoryModalComponent } from "../GPTMemoryModal";
|
|
11
|
+
import type { MarkdownEditor as MarkdownEditorComponent } from "../MarkdownEditor";
|
|
12
|
+
import type { MarkdownEditorField as MarkdownEditorFieldComponent } from "../MarkdownEditorField";
|
|
13
|
+
import type { UpgradeRequiredScreen as UpgradeRequiredScreenComponent } from "../UpgradeRequiredScreen";
|
|
14
|
+
export declare const heavyOptionalModuleFactories: {
|
|
15
|
+
readonly AIRequestExplorer: () => Promise<typeof import("../AIRequestExplorer")>;
|
|
16
|
+
readonly AiSuggestionBox: () => Promise<typeof import("../AiSuggestionBox")>;
|
|
17
|
+
readonly AttachmentPreview: () => Promise<typeof import("../AttachmentPreview")>;
|
|
18
|
+
readonly ConflictSheet: () => Promise<typeof import("../ConflictSheet")>;
|
|
19
|
+
readonly ConsentFormScreen: () => Promise<typeof import("../ConsentFormScreen")>;
|
|
20
|
+
readonly ConsentNavigator: () => Promise<typeof import("../ConsentNavigator")>;
|
|
21
|
+
readonly DraggableList: () => Promise<typeof import("../DraggableList")>;
|
|
22
|
+
readonly EmojiSelector: () => Promise<typeof import("../EmojiSelector")>;
|
|
23
|
+
readonly GPTChat: () => Promise<typeof import("../GPTChat")>;
|
|
24
|
+
readonly GPTMemoryModal: () => Promise<typeof import("../GPTMemoryModal")>;
|
|
25
|
+
readonly MarkdownEditor: () => Promise<typeof import("../MarkdownEditor")>;
|
|
26
|
+
readonly MarkdownEditorField: () => Promise<typeof import("../MarkdownEditorField")>;
|
|
27
|
+
readonly UpgradeRequiredScreen: () => Promise<typeof import("../UpgradeRequiredScreen")>;
|
|
28
|
+
};
|
|
29
|
+
export declare const AIRequestExplorer: typeof AIRequestExplorerComponent;
|
|
30
|
+
export declare const AiSuggestionBox: typeof AiSuggestionBoxComponent;
|
|
31
|
+
export declare const AttachmentPreview: typeof AttachmentPreviewComponent;
|
|
32
|
+
export declare const ConflictSheet: typeof ConflictSheetComponent;
|
|
33
|
+
export declare const ConsentFormScreen: typeof ConsentFormScreenComponent;
|
|
34
|
+
export declare const ConsentNavigator: typeof ConsentNavigatorComponent;
|
|
35
|
+
export declare const DraggableList: typeof DraggableListComponent;
|
|
36
|
+
export declare const EmojiSelector: typeof EmojiSelectorComponent;
|
|
37
|
+
export declare const GPTChat: typeof GPTChatComponent;
|
|
38
|
+
export declare const GPTMemoryModal: typeof GPTMemoryModalComponent;
|
|
39
|
+
export declare const MarkdownEditor: typeof MarkdownEditorComponent;
|
|
40
|
+
export declare const MarkdownEditorField: typeof MarkdownEditorFieldComponent;
|
|
41
|
+
export declare const UpgradeRequiredScreen: typeof UpgradeRequiredScreenComponent;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Categories } from "../emojiCategories";
|
|
2
|
+
import { createLazyComponentExport, createLazyNamedExport } from "./createLazyComponentExport";
|
|
3
|
+
export const heavyOptionalModuleFactories = {
|
|
4
|
+
AIRequestExplorer: () => import("../AIRequestExplorer"),
|
|
5
|
+
AiSuggestionBox: () => import("../AiSuggestionBox"),
|
|
6
|
+
AttachmentPreview: () => import("../AttachmentPreview"),
|
|
7
|
+
ConflictSheet: () => import("../ConflictSheet"),
|
|
8
|
+
ConsentFormScreen: () => import("../ConsentFormScreen"),
|
|
9
|
+
ConsentNavigator: () => import("../ConsentNavigator"),
|
|
10
|
+
DraggableList: () => import("../DraggableList"),
|
|
11
|
+
EmojiSelector: () => import("../EmojiSelector"),
|
|
12
|
+
GPTChat: () => import("../GPTChat"),
|
|
13
|
+
GPTMemoryModal: () => import("../GPTMemoryModal"),
|
|
14
|
+
MarkdownEditor: () => import("../MarkdownEditor"),
|
|
15
|
+
MarkdownEditorField: () => import("../MarkdownEditorField"),
|
|
16
|
+
UpgradeRequiredScreen: () => import("../UpgradeRequiredScreen"),
|
|
17
|
+
};
|
|
18
|
+
const EMOJI_SELECTOR_DEFAULT_PROPS = {
|
|
19
|
+
category: Categories.all,
|
|
20
|
+
columns: 6,
|
|
21
|
+
placeholder: "Search...",
|
|
22
|
+
showHistory: false,
|
|
23
|
+
showSearchBar: true,
|
|
24
|
+
showSectionTitles: true,
|
|
25
|
+
showTabs: true,
|
|
26
|
+
theme: "#007AFF",
|
|
27
|
+
};
|
|
28
|
+
export const AIRequestExplorer = createLazyNamedExport(heavyOptionalModuleFactories.AIRequestExplorer, "AIRequestExplorer");
|
|
29
|
+
export const AiSuggestionBox = createLazyNamedExport(heavyOptionalModuleFactories.AiSuggestionBox, "AiSuggestionBox");
|
|
30
|
+
export const AttachmentPreview = createLazyNamedExport(heavyOptionalModuleFactories.AttachmentPreview, "AttachmentPreview");
|
|
31
|
+
export const ConflictSheet = createLazyNamedExport(heavyOptionalModuleFactories.ConflictSheet, "ConflictSheet");
|
|
32
|
+
export const ConsentFormScreen = createLazyNamedExport(heavyOptionalModuleFactories.ConsentFormScreen, "ConsentFormScreen");
|
|
33
|
+
export const ConsentNavigator = createLazyNamedExport(heavyOptionalModuleFactories.ConsentNavigator, "ConsentNavigator");
|
|
34
|
+
export const DraggableList = createLazyNamedExport(heavyOptionalModuleFactories.DraggableList, "DraggableList");
|
|
35
|
+
export const EmojiSelector = createLazyComponentExport(heavyOptionalModuleFactories.EmojiSelector, {
|
|
36
|
+
defaultProps: EMOJI_SELECTOR_DEFAULT_PROPS,
|
|
37
|
+
});
|
|
38
|
+
export const GPTChat = createLazyNamedExport(heavyOptionalModuleFactories.GPTChat, "GPTChat");
|
|
39
|
+
export const GPTMemoryModal = createLazyNamedExport(heavyOptionalModuleFactories.GPTMemoryModal, "GPTMemoryModal");
|
|
40
|
+
export const MarkdownEditor = createLazyNamedExport(heavyOptionalModuleFactories.MarkdownEditor, "MarkdownEditor");
|
|
41
|
+
export const MarkdownEditorField = createLazyNamedExport(heavyOptionalModuleFactories.MarkdownEditorField, "MarkdownEditorField");
|
|
42
|
+
export const UpgradeRequiredScreen = createLazyNamedExport(heavyOptionalModuleFactories.UpgradeRequiredScreen, "UpgradeRequiredScreen");
|
|
43
|
+
//# sourceMappingURL=heavyOptionalExports.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"heavyOptionalExports.js","sourceRoot":"","sources":["../../src/lazyBoundaries/heavyOptionalExports.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAC,UAAU,EAAC,MAAM,oBAAoB,CAAC;AAM9C,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,iBAAiB,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,sBAAsB,CAAC;IACvD,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,aAAa,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,kBAAkB,CAAC;IA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,kBAAkB,CAC4B,CAAC;AAEjD,MAAM,CAAC,MAAM,aAAa,GAAG,qBAAqB,CAChD,4BAA4B,CAAC,aAAa,EAC1C,eAAe,CAC4B,CAAC;AAE9C,MAAM,CAAC,MAAM,aAAa,GAAG,yBAAyB,CAAC,4BAA4B,CAAC,aAAa,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,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,qBAAqB,GAAG,qBAAqB,CACxD,4BAA4B,CAAC,qBAAqB,EAClD,uBAAuB,CAC4B,CAAC"}
|
|
@@ -19,6 +19,7 @@ import type { LoginScreenProps } from "./loginTypes";
|
|
|
19
19
|
* ]}
|
|
20
20
|
* onSignUpPress={() => router.push("/signup")}
|
|
21
21
|
* onForgotPasswordPress={() => router.push("/forgot-password")}
|
|
22
|
+
// or onForgotPassword={() => router.push("/forgot-password")}
|
|
22
23
|
* />
|
|
23
24
|
* ```
|
|
24
25
|
*/
|
|
@@ -26,10 +26,11 @@ import { TextField } from "../TextField";
|
|
|
26
26
|
* ]}
|
|
27
27
|
* onSignUpPress={() => router.push("/signup")}
|
|
28
28
|
* onForgotPasswordPress={() => router.push("/forgot-password")}
|
|
29
|
+
// or onForgotPassword={() => router.push("/forgot-password")}
|
|
29
30
|
* />
|
|
30
31
|
* ```
|
|
31
32
|
*/
|
|
32
|
-
export const LoginScreen = ({ fields, onSubmit, oauthProviders, logo, title = "Welcome Back", loading = false, error, signUpLinkText = "Need an account? Sign Up", onSignUpPress, forgotPasswordText = "Forgot password?", onForgotPasswordPress, testID = "login-screen", }) => {
|
|
33
|
+
export const LoginScreen = ({ fields, onSubmit, oauthProviders, logo, title = "Welcome Back", loading = false, error, signUpLinkText = "Need an account? Sign Up", onSignUpPress, forgotPasswordText = "Forgot password?", onForgotPasswordPress, onForgotPassword, testID = "login-screen", }) => {
|
|
33
34
|
const [formValues, setFormValues] = useState(() => {
|
|
34
35
|
const initial = {};
|
|
35
36
|
for (const field of fields) {
|
|
@@ -37,6 +38,7 @@ export const LoginScreen = ({ fields, onSubmit, oauthProviders, logo, title = "W
|
|
|
37
38
|
}
|
|
38
39
|
return initial;
|
|
39
40
|
});
|
|
41
|
+
const onForgotPasswordAction = onForgotPasswordPress !== null && onForgotPasswordPress !== void 0 ? onForgotPasswordPress : onForgotPassword;
|
|
40
42
|
const handleFieldChange = useCallback((fieldName, value) => {
|
|
41
43
|
setFormValues((prev) => (Object.assign(Object.assign({}, prev), { [fieldName]: value })));
|
|
42
44
|
}, []);
|
|
@@ -50,6 +52,6 @@ export const LoginScreen = ({ fields, onSubmit, oauthProviders, logo, title = "W
|
|
|
50
52
|
return (_jsx(Page, { navigation: undefined, children: _jsxs(Box, { alignItems: "center", alignSelf: "center", flex: "grow", justifyContent: "center", maxWidth: 400, padding: 4, testID: testID, width: "100%", children: [Boolean(logo) && _jsx(Box, { marginBottom: 6, children: logo }), _jsx(Box, { marginBottom: 8, children: _jsx(Heading, { testID: `${testID}-title`, children: title }) }), _jsxs(Box, { gap: 4, width: "100%", children: [fields.map((field) => {
|
|
51
53
|
var _a;
|
|
52
54
|
return (_jsx(TextField, { autoComplete: field.autoComplete, disabled: loading, id: `${testID}-${field.name}-input`, onChange: (value) => handleFieldChange(field.name, value), placeholder: (_a = field.placeholder) !== null && _a !== void 0 ? _a : field.label, testID: `${testID}-${field.name}-input`, title: field.label, type: field.type === "email" ? "email" : field.type === "password" ? "password" : "text", value: formValues[field.name] }, field.name));
|
|
53
|
-
}), Boolean(error) && (_jsx(Text, { color: "error", testID: `${testID}-error`, children: error })), _jsx(Box, { marginTop: 4, children: _jsx(Button, { disabled: isSubmitDisabled, fullWidth: true, loading: loading, onClick: handleSubmit, testID: `${testID}-submit-button`, text: "Log In" }) }), Boolean(
|
|
55
|
+
}), Boolean(error) && (_jsx(Text, { color: "error", testID: `${testID}-error`, children: error })), _jsx(Box, { marginTop: 4, children: _jsx(Button, { disabled: isSubmitDisabled, fullWidth: true, loading: loading, onClick: handleSubmit, testID: `${testID}-submit-button`, text: "Log In" }) }), Boolean(onForgotPasswordAction) && (_jsx(Box, { alignItems: "center", marginTop: 2, children: _jsx(Button, { disabled: loading, onClick: onForgotPasswordAction, testID: `${testID}-forgot-password`, text: forgotPasswordText, variant: "muted" }) })), Boolean(onSignUpPress) && (_jsx(Box, { marginTop: 2, children: _jsx(Button, { disabled: loading, fullWidth: true, onClick: onSignUpPress, testID: `${testID}-signup-link`, text: signUpLinkText, variant: "outline" }) })), Boolean(oauthProviders && oauthProviders.length > 0) && (_jsx(OAuthButtons, { disabled: loading, providers: oauthProviders, testID: `${testID}-oauth` }))] })] }) }));
|
|
54
56
|
};
|
|
55
57
|
//# sourceMappingURL=LoginScreen.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoginScreen.js","sourceRoot":"","sources":["../../src/login/LoginScreen.tsx"],"names":[],"mappings":";AACA,OAAO,EAAC,WAAW,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AAE5C,OAAO,EAAC,GAAG,EAAC,MAAM,QAAQ,CAAC;AAC3B,OAAO,EAAC,MAAM,EAAC,MAAM,WAAW,CAAC;AACjC,OAAO,EAAC,OAAO,EAAC,MAAM,YAAY,CAAC;AACnC,OAAO,EAAC,IAAI,EAAC,MAAM,SAAS,CAAC;AAC7B,OAAO,EAAC,YA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Q,GACb,GACE,EAEL,OAAO,CAAC,sBAAsB,CAAC,IAAI,CAClC,KAAC,GAAG,IAAC,UAAU,EAAC,QAAQ,EAAC,SAAS,EAAE,CAAC,YACnC,KAAC,MAAM,IACL,QAAQ,EAAE,OAAO,EACjB,OAAO,EAAE,sBAAuB,EAChC,MAAM,EAAE,GAAG,MAAM,kBAAkB,EACnC,IAAI,EAAE,kBAAmB,EACzB,OAAO,EAAC,OAAO,GACf,GACE,CACP,EAEA,OAAO,CAAC,aAAa,CAAC,IAAI,CACzB,KAAC,GAAG,IAAC,SAAS,EAAE,CAAC,YACf,KAAC,MAAM,IACL,QAAQ,EAAE,OAAO,EACjB,SAAS,QACT,OAAO,EAAE,aAAc,EACvB,MAAM,EAAE,GAAG,MAAM,cAAc,EAC/B,IAAI,EAAE,cAAe,EACrB,OAAO,EAAC,SAAS,GACjB,GACE,CACP,EAEA,OAAO,CAAC,cAAc,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,CACvD,KAAC,YAAY,IACX,QAAQ,EAAE,OAAO,EACjB,SAAS,EAAE,cAAe,EAC1B,MAAM,EAAE,GAAG,MAAM,QAAQ,GACzB,CACH,IACG,IACF,GACD,CACR,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -43,6 +43,8 @@ export interface LoginScreenProps {
|
|
|
43
43
|
forgotPasswordText?: string;
|
|
44
44
|
/** Callback triggered when the forgot password link is pressed. */
|
|
45
45
|
onForgotPasswordPress?: () => void;
|
|
46
|
+
/** Alias for `onForgotPasswordPress`. */
|
|
47
|
+
onForgotPassword?: () => void;
|
|
46
48
|
/** Test ID for the root element. */
|
|
47
49
|
testID?: string;
|
|
48
50
|
}
|
package/package.json
CHANGED
|
@@ -77,6 +77,7 @@
|
|
|
77
77
|
"react-native-webview": "13.16.1",
|
|
78
78
|
"react-time-picker": "^8.0.2"
|
|
79
79
|
},
|
|
80
|
+
"description": "React Native UI component library for iOS, Android, and web — part of Terreno, the batteries-included TypeScript framework for universal apps.",
|
|
80
81
|
"devDependencies": {
|
|
81
82
|
"@biomejs/biome": "^2.3.6",
|
|
82
83
|
"@expo/config-plugins": "~57.0.8",
|
|
@@ -102,6 +103,22 @@
|
|
|
102
103
|
"typedoc": "^0.28.17",
|
|
103
104
|
"typescript": "~6.0.3"
|
|
104
105
|
},
|
|
106
|
+
"exports": {
|
|
107
|
+
".": {
|
|
108
|
+
"default": "./dist/index.js",
|
|
109
|
+
"types": "./dist/index.d.ts"
|
|
110
|
+
},
|
|
111
|
+
"./dist/*": {
|
|
112
|
+
"default": "./dist/*.js",
|
|
113
|
+
"types": "./dist/*.d.ts"
|
|
114
|
+
},
|
|
115
|
+
"./*": {
|
|
116
|
+
"default": "./dist/*.js",
|
|
117
|
+
"types": "./dist/*.d.ts"
|
|
118
|
+
},
|
|
119
|
+
"./package.json": "./package.json",
|
|
120
|
+
"./src/*": "./src/*"
|
|
121
|
+
},
|
|
105
122
|
"files": [
|
|
106
123
|
"LICENSE",
|
|
107
124
|
"dist/**/*",
|
|
@@ -143,11 +160,33 @@
|
|
|
143
160
|
"lint:fix": "biome check --write .",
|
|
144
161
|
"lint:unsafefix": "biome check --write --unsafe .",
|
|
145
162
|
"local": "tsc-watch --onSuccess \"cp -a dist/* ../flourish/node_modules/@terreno/ui/dist\"",
|
|
163
|
+
"performance:p0": "RUN_UI_P0_BENCHMARK=1 bun test --preload ./src/bunSetup.ts ./benchmarks/P0RenderPerformance.test.tsx",
|
|
164
|
+
"performance:p0:openapi": "bun run compile && RUN_UI_P0_OPENAPI_BENCHMARK=1 bun test --preload ./src/bunSetup.ts ./benchmarks/P0OpenAPIPerformance.test.tsx",
|
|
165
|
+
"performance:p1": "bun run compile && RUN_UI_P1_BENCHMARK=1 bun test --preload ./src/bunSetup.ts ./benchmarks/P1RenderPerformance.test.tsx",
|
|
166
|
+
"performance:datatable-virtual": "bun run compile && RUN_UI_DATATABLE_VIRTUAL_BENCHMARK=1 bun test --preload ./src/bunSetup.ts ./benchmarks/DataTableVirtualizationPerformance.test.tsx",
|
|
167
|
+
"performance:imports": "bun run compile && RUN_UI_IMPORT_BENCHMARK=1 bun test --preload ./src/bunSetup.ts ./benchmarks/RootImportBenchmark.test.tsx",
|
|
168
|
+
"performance:p2:button": "bun run compile && RUN_UI_P2_BUTTON_BENCHMARK=1 bun test --preload ./src/bunSetup.ts ./benchmarks/P2ButtonPerformance.test.tsx",
|
|
169
|
+
"performance:p2:responsive-box": "bun run compile && RUN_UI_P2_RESPONSIVE_BOX_BENCHMARK=1 bun test --preload ./src/bunSetup.ts ./benchmarks/P2ResponsiveBoxPerformance.test.tsx",
|
|
146
170
|
"test": "TZ=America/New_York bun test --watch",
|
|
147
171
|
"test:agent": "AGENT=1 TZ=America/New_York bun test --only-failures",
|
|
148
172
|
"test:ci": "TZ=America/New_York bun test",
|
|
149
173
|
"test:coverage": "TZ=America/New_York bun run ../scripts/check-coverage.ts",
|
|
150
174
|
"types": "bun typedoc"
|
|
151
175
|
},
|
|
152
|
-
"version": "57.
|
|
176
|
+
"version": "57.3.0",
|
|
177
|
+
"bugs": {
|
|
178
|
+
"url": "https://github.com/FlourishHealth/terreno/issues"
|
|
179
|
+
},
|
|
180
|
+
"homepage": "https://github.com/FlourishHealth/terreno#readme",
|
|
181
|
+
"repository": {
|
|
182
|
+
"type": "git",
|
|
183
|
+
"url": "git+ssh://git@github.com/FlourishHealth/terreno.git"
|
|
184
|
+
},
|
|
185
|
+
"keywords": [
|
|
186
|
+
"react-native",
|
|
187
|
+
"expo",
|
|
188
|
+
"ui",
|
|
189
|
+
"universal-apps",
|
|
190
|
+
"terreno"
|
|
191
|
+
]
|
|
153
192
|
}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import {describe, expect, it, mock} from "bun:test";
|
|
2
|
+
import {fireEvent} from "@testing-library/react-native";
|
|
3
|
+
import {DateTime} from "luxon";
|
|
4
|
+
|
|
5
|
+
import {AIRequestExplorer, type AIRequestExplorerData} from "./AIRequestExplorer";
|
|
6
|
+
import {renderWithTheme} from "./test-utils";
|
|
7
|
+
|
|
8
|
+
const fullRequest: AIRequestExplorerData = {
|
|
9
|
+
aiModel: "gemini-2.5-flash",
|
|
10
|
+
created: "2024-06-15T14:30:45.000Z",
|
|
11
|
+
error: "A warning",
|
|
12
|
+
prompt: "Summarize this request",
|
|
13
|
+
requestType: "summarization",
|
|
14
|
+
response: "Summary response",
|
|
15
|
+
responseTime: 123,
|
|
16
|
+
tokensUsed: 42,
|
|
17
|
+
user: {email: "jane@example.com", name: "Jane Example"},
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const defaultProps = {
|
|
21
|
+
data: [fullRequest],
|
|
22
|
+
onPageChange: mock((_page: number) => {}),
|
|
23
|
+
page: 1,
|
|
24
|
+
totalCount: 1,
|
|
25
|
+
totalPages: 1,
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
describe("AIRequestExplorer", () => {
|
|
29
|
+
it("renders request rows and formats complete and fallback data", () => {
|
|
30
|
+
const fallbackRequest = {
|
|
31
|
+
aiModel: "fallback-model",
|
|
32
|
+
created: "",
|
|
33
|
+
requestType: "general",
|
|
34
|
+
user: {email: "fallback@example.com"},
|
|
35
|
+
} as unknown as AIRequestExplorerData;
|
|
36
|
+
const {getAllByText, getByText} = renderWithTheme(
|
|
37
|
+
<AIRequestExplorer {...defaultProps} data={[fullRequest, fallbackRequest]} />
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
expect(getByText("Jane Example")).toBeTruthy();
|
|
41
|
+
expect(getByText("gemini-2.5-flash")).toBeTruthy();
|
|
42
|
+
expect(getByText("Summarize this request")).toBeTruthy();
|
|
43
|
+
expect(getByText("Summary response")).toBeTruthy();
|
|
44
|
+
expect(getByText("42")).toBeTruthy();
|
|
45
|
+
expect(getByText("123ms")).toBeTruthy();
|
|
46
|
+
expect(
|
|
47
|
+
getByText(
|
|
48
|
+
DateTime.fromISO(fullRequest.created).toLocaleString(DateTime.DATETIME_SHORT_WITH_SECONDS)
|
|
49
|
+
)
|
|
50
|
+
).toBeTruthy();
|
|
51
|
+
expect(getByText("A warning")).toBeTruthy();
|
|
52
|
+
expect(getByText("fallback@example.com")).toBeTruthy();
|
|
53
|
+
expect(getAllByText("-").length).toBeGreaterThanOrEqual(1);
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
it("falls back to a dash when the user and values are missing", () => {
|
|
57
|
+
const fallbackRequest = {
|
|
58
|
+
aiModel: "fallback-model",
|
|
59
|
+
created: "",
|
|
60
|
+
requestType: "general",
|
|
61
|
+
} as unknown as AIRequestExplorerData;
|
|
62
|
+
const {getAllByText} = renderWithTheme(
|
|
63
|
+
<AIRequestExplorer {...defaultProps} data={[fallbackRequest]} />
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
expect(getAllByText("-").length).toBeGreaterThanOrEqual(6);
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
it("renders the loading branch instead of the table", () => {
|
|
70
|
+
const {queryByText} = renderWithTheme(
|
|
71
|
+
<AIRequestExplorer {...defaultProps} data={[fullRequest]} isLoading />
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
expect(queryByText("Summarize this request")).toBeNull();
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
it("renders optional filters and fires their callbacks", () => {
|
|
78
|
+
const onEndDateChange = mock((_date: string) => {});
|
|
79
|
+
const onRequestTypeFilterChange = mock((_types: string[]) => {});
|
|
80
|
+
const onStartDateChange = mock((_date: string) => {});
|
|
81
|
+
const {getAllByPlaceholderText, getByLabelText, getByText} = renderWithTheme(
|
|
82
|
+
<AIRequestExplorer
|
|
83
|
+
{...defaultProps}
|
|
84
|
+
endDate=""
|
|
85
|
+
onEndDateChange={onEndDateChange}
|
|
86
|
+
onRequestTypeFilterChange={onRequestTypeFilterChange}
|
|
87
|
+
onStartDateChange={onStartDateChange}
|
|
88
|
+
requestTypeFilter={[]}
|
|
89
|
+
startDate=""
|
|
90
|
+
/>
|
|
91
|
+
);
|
|
92
|
+
|
|
93
|
+
expect(getByText("Request Type")).toBeTruthy();
|
|
94
|
+
expect(getByText("Start Date")).toBeTruthy();
|
|
95
|
+
expect(getByText("End Date")).toBeTruthy();
|
|
96
|
+
|
|
97
|
+
fireEvent.press(getByLabelText("General"));
|
|
98
|
+
expect(onRequestTypeFilterChange).toHaveBeenCalledWith(["general"]);
|
|
99
|
+
|
|
100
|
+
const monthInputs = getAllByPlaceholderText("MM");
|
|
101
|
+
const dayInputs = getAllByPlaceholderText("DD");
|
|
102
|
+
const yearInputs = getAllByPlaceholderText("YYYY");
|
|
103
|
+
const hourInputs = getAllByPlaceholderText("hh");
|
|
104
|
+
const minuteInputs = getAllByPlaceholderText("mm");
|
|
105
|
+
fireEvent.changeText(monthInputs[0], "01");
|
|
106
|
+
fireEvent.changeText(dayInputs[0], "02");
|
|
107
|
+
fireEvent.changeText(yearInputs[0], "2024");
|
|
108
|
+
fireEvent.changeText(hourInputs[0], "03");
|
|
109
|
+
fireEvent.changeText(minuteInputs[0], "04");
|
|
110
|
+
expect(onStartDateChange).toHaveBeenCalled();
|
|
111
|
+
|
|
112
|
+
fireEvent.changeText(monthInputs[1], "03");
|
|
113
|
+
fireEvent.changeText(dayInputs[1], "04");
|
|
114
|
+
fireEvent.changeText(yearInputs[1], "2024");
|
|
115
|
+
fireEvent.changeText(hourInputs[1], "05");
|
|
116
|
+
fireEvent.changeText(minuteInputs[1], "06");
|
|
117
|
+
expect(onEndDateChange).toHaveBeenCalled();
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
it("omits filters when callbacks are not provided", () => {
|
|
121
|
+
const {queryByText} = renderWithTheme(<AIRequestExplorer {...defaultProps} />);
|
|
122
|
+
|
|
123
|
+
expect(queryByText("Request Type")).toBeNull();
|
|
124
|
+
expect(queryByText("Start Date")).toBeNull();
|
|
125
|
+
expect(queryByText("End Date")).toBeNull();
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
it("renders pagination only for multiple pages and changes page", () => {
|
|
129
|
+
const onPageChange = mock((_page: number) => {});
|
|
130
|
+
const {getByHintText} = renderWithTheme(
|
|
131
|
+
<AIRequestExplorer {...defaultProps} onPageChange={onPageChange} totalPages={3} />
|
|
132
|
+
);
|
|
133
|
+
|
|
134
|
+
expect(getByHintText("Click to go to page 2")).toBeTruthy();
|
|
135
|
+
fireEvent.press(getByHintText("Click to go to page 2"));
|
|
136
|
+
expect(onPageChange).toHaveBeenCalledWith(2);
|
|
137
|
+
|
|
138
|
+
const singlePage = renderWithTheme(<AIRequestExplorer {...defaultProps} />);
|
|
139
|
+
expect(singlePage.queryByHintText("Click to go to page 1")).toBeNull();
|
|
140
|
+
});
|
|
141
|
+
});
|
package/src/ActionSheet.tsx
CHANGED
|
@@ -56,6 +56,11 @@ export const styles = StyleSheet.create({
|
|
|
56
56
|
},
|
|
57
57
|
});
|
|
58
58
|
|
|
59
|
+
/** FlatList's underlying scroll view, reachable only through internal fields. */
|
|
60
|
+
interface FlatListWithScrollRef {
|
|
61
|
+
_listRef: {_scrollRef: {scrollTo: (options: {animated: boolean; x: number; y: number}) => void}};
|
|
62
|
+
}
|
|
63
|
+
|
|
59
64
|
export const getDeviceHeight = (statusBarTranslucent: boolean | undefined): number => {
|
|
60
65
|
const height = Dimensions.get("window").height;
|
|
61
66
|
|
|
@@ -168,13 +173,9 @@ export class ActionSheet extends Component<Props, State, unknown> {
|
|
|
168
173
|
|
|
169
174
|
deviceLayoutCalled = false;
|
|
170
175
|
|
|
171
|
-
|
|
172
|
-
// biome-ignore lint/suspicious/noExplicitAny: FlatList ref is accessed via internal _listRef._scrollRef which is not part of the public type
|
|
173
|
-
scrollViewRef: React.RefObject<any>;
|
|
176
|
+
scrollViewRef: React.RefObject<FlatList<string> | null>;
|
|
174
177
|
|
|
175
|
-
|
|
176
|
-
// biome-ignore lint/suspicious/noExplicitAny: SafeAreaView ref is passed to findNodeHandle and accessed via untyped React Native internals
|
|
177
|
-
safeAreaViewRef: React.RefObject<any>;
|
|
178
|
+
safeAreaViewRef: React.RefObject<View | null>;
|
|
178
179
|
|
|
179
180
|
transformValue: Animated.Value;
|
|
180
181
|
|
|
@@ -495,7 +496,8 @@ export class ActionSheet extends Component<Props, State, unknown> {
|
|
|
495
496
|
_scrollTo = (y: number, animated = true) => {
|
|
496
497
|
this.scrollAnimationEndValue = y;
|
|
497
498
|
this.prevScroll = y;
|
|
498
|
-
this.scrollViewRef.current
|
|
499
|
+
const list = this.scrollViewRef.current as FlatListWithScrollRef | null;
|
|
500
|
+
list?._listRef._scrollRef.scrollTo({
|
|
499
501
|
animated,
|
|
500
502
|
x: 0,
|
|
501
503
|
y: this.scrollAnimationEndValue,
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import {describe, expect, it, mock} from "bun:test";
|
|
2
|
+
import {fireEvent} from "@testing-library/react-native";
|
|
3
|
+
|
|
4
|
+
import {AttachmentPreview} from "./AttachmentPreview";
|
|
5
|
+
import type {SelectedFile} from "./FilePickerButton";
|
|
6
|
+
import {renderWithTheme} from "./test-utils";
|
|
7
|
+
|
|
8
|
+
const imageFile: SelectedFile = {
|
|
9
|
+
mimeType: "image/png",
|
|
10
|
+
name: "photo.png",
|
|
11
|
+
uri: "file:///tmp/photo.png",
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const docFile: SelectedFile = {
|
|
15
|
+
mimeType: "application/pdf",
|
|
16
|
+
name: "report.pdf",
|
|
17
|
+
uri: "file:///tmp/report.pdf",
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
describe("AttachmentPreview", () => {
|
|
21
|
+
it("returns null when there are no attachments", () => {
|
|
22
|
+
const {queryByTestId} = renderWithTheme(
|
|
23
|
+
<AttachmentPreview attachments={[]} onRemove={() => {}} />
|
|
24
|
+
);
|
|
25
|
+
expect(queryByTestId("attachment-preview")).toBeNull();
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it("renders with the default testID", () => {
|
|
29
|
+
const {getByTestId} = renderWithTheme(
|
|
30
|
+
<AttachmentPreview attachments={[docFile]} onRemove={() => {}} />
|
|
31
|
+
);
|
|
32
|
+
expect(getByTestId("attachment-preview")).toBeTruthy();
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
it("renders with a custom testID", () => {
|
|
36
|
+
const {getByTestId} = renderWithTheme(
|
|
37
|
+
<AttachmentPreview attachments={[docFile]} onRemove={() => {}} testID="my-preview" />
|
|
38
|
+
);
|
|
39
|
+
expect(getByTestId("my-preview")).toBeTruthy();
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
it("renders the attachment name", () => {
|
|
43
|
+
const {getByText} = renderWithTheme(
|
|
44
|
+
<AttachmentPreview attachments={[docFile]} onRemove={() => {}} />
|
|
45
|
+
);
|
|
46
|
+
expect(getByText("report.pdf")).toBeTruthy();
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
it("renders an image preview for image mime types", () => {
|
|
50
|
+
const {toJSON} = renderWithTheme(
|
|
51
|
+
<AttachmentPreview attachments={[imageFile]} onRemove={() => {}} />
|
|
52
|
+
);
|
|
53
|
+
expect(toJSON()).toMatchSnapshot();
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
it("renders a file icon for non-image mime types", () => {
|
|
57
|
+
const {toJSON} = renderWithTheme(
|
|
58
|
+
<AttachmentPreview attachments={[docFile]} onRemove={() => {}} />
|
|
59
|
+
);
|
|
60
|
+
expect(toJSON()).toMatchSnapshot();
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
it("renders multiple attachments", () => {
|
|
64
|
+
const {getByText} = renderWithTheme(
|
|
65
|
+
<AttachmentPreview attachments={[imageFile, docFile]} onRemove={() => {}} />
|
|
66
|
+
);
|
|
67
|
+
expect(getByText("photo.png")).toBeTruthy();
|
|
68
|
+
expect(getByText("report.pdf")).toBeTruthy();
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
it("calls onRemove with the attachment index when dismissed", () => {
|
|
72
|
+
const onRemove = mock(() => {});
|
|
73
|
+
const {getByLabelText} = renderWithTheme(
|
|
74
|
+
<AttachmentPreview attachments={[imageFile, docFile]} onRemove={onRemove} />
|
|
75
|
+
);
|
|
76
|
+
fireEvent.press(getByLabelText("Remove report.pdf"));
|
|
77
|
+
expect(onRemove).toHaveBeenCalledTimes(1);
|
|
78
|
+
expect(onRemove).toHaveBeenCalledWith(1);
|
|
79
|
+
});
|
|
80
|
+
});
|