@terreno/ui 0.25.0 → 0.27.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 -0
- package/dist/ActionSheet.js.map +1 -1
- package/dist/AiSuggestionBox.js +1 -1
- package/dist/AiSuggestionBox.js.map +1 -1
- package/dist/Avatar.js +4 -1
- package/dist/Avatar.js.map +1 -1
- package/dist/BooleanField.js +2 -1
- package/dist/BooleanField.js.map +1 -1
- package/dist/Box.js +2 -0
- package/dist/Box.js.map +1 -1
- package/dist/Common.d.ts +7 -1
- package/dist/Common.js +1 -1
- package/dist/Common.js.map +1 -1
- package/dist/ConsentNavigator.js.map +1 -1
- package/dist/CustomSelectField.js +1 -1
- package/dist/CustomSelectField.js.map +1 -1
- package/dist/DateTimeField.js +4 -1
- package/dist/DateTimeField.js.map +1 -1
- package/dist/EmailField.js +1 -1
- package/dist/EmailField.js.map +1 -1
- package/dist/HeightField.js +3 -1
- package/dist/HeightField.js.map +1 -1
- package/dist/IconButton.js +10 -1
- package/dist/IconButton.js.map +1 -1
- package/dist/MarkdownEditorField.js +3 -1
- package/dist/MarkdownEditorField.js.map +1 -1
- package/dist/Modal.js +7 -2
- package/dist/Modal.js.map +1 -1
- package/dist/MultiselectField.js +2 -1
- package/dist/MultiselectField.js.map +1 -1
- package/dist/Page.js +1 -0
- package/dist/Page.js.map +1 -1
- package/dist/Permissions.d.ts +1 -1
- package/dist/Permissions.js +2 -2
- package/dist/Permissions.js.map +1 -1
- package/dist/SelectField.js +3 -1
- package/dist/SelectField.js.map +1 -1
- package/dist/SplitPage.js +3 -0
- package/dist/SplitPage.js.map +1 -1
- package/dist/SplitPage.native.js +2 -0
- package/dist/SplitPage.native.js.map +1 -1
- package/dist/TapToEdit.js +1 -0
- package/dist/TapToEdit.js.map +1 -1
- package/dist/TextField.js +3 -1
- package/dist/TextField.js.map +1 -1
- package/dist/ToastNotifications.js.map +1 -1
- package/dist/Unifier.js.map +1 -1
- package/dist/index.d.ts +8 -2
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/dist/useSubmitConsent.d.ts +1 -1
- package/dist/useSubmitConsent.js +1 -1
- package/dist/useSubmitConsent.js.map +1 -1
- package/package.json +2 -2
- package/src/ActionSheet.test.tsx +1 -0
- package/src/ActionSheet.tsx +2 -0
- package/src/AiSuggestionBox.tsx +1 -1
- package/src/Avatar.tsx +4 -1
- package/src/Badge.test.tsx +1 -2
- package/src/BooleanField.tsx +2 -1
- package/src/Box.test.tsx +56 -0
- package/src/Box.tsx +4 -0
- package/src/Button.test.tsx +34 -0
- package/src/Common.ts +31 -1
- package/src/ConsentNavigator.test.tsx +1 -0
- package/src/ConsentNavigator.tsx +1 -0
- package/src/CustomSelectField.tsx +1 -1
- package/src/DataTable.test.tsx +1 -0
- package/src/DateTimeField.test.tsx +1 -0
- package/src/DateTimeField.tsx +4 -1
- package/src/EmailField.tsx +1 -1
- package/src/HeightField.tsx +3 -1
- package/src/IconButton.test.tsx +26 -0
- package/src/IconButton.tsx +10 -0
- package/src/MarkdownEditorField.tsx +3 -1
- package/src/Modal.test.tsx +261 -66
- package/src/Modal.tsx +7 -2
- package/src/ModalSheet.test.tsx +7 -6
- package/src/MultiselectField.tsx +2 -1
- package/src/Page.tsx +1 -0
- package/src/Permissions.ts +2 -2
- package/src/PickerSelect.test.tsx +1 -0
- package/src/SelectBadge.test.tsx +1 -2
- package/src/SelectField.tsx +3 -1
- package/src/Signature.test.tsx +52 -0
- package/src/SplitPage.native.tsx +2 -0
- package/src/SplitPage.test.tsx +6 -4
- package/src/SplitPage.tsx +3 -0
- package/src/TapToEdit.test.tsx +1 -0
- package/src/TapToEdit.tsx +2 -0
- package/src/Text.test.tsx +29 -0
- package/src/TextField.test.tsx +57 -1
- package/src/TextField.tsx +3 -1
- package/src/ToastNotifications.test.tsx +1 -0
- package/src/ToastNotifications.tsx +1 -0
- package/src/Tooltip.test.tsx +1 -1
- package/src/Unifier.ts +1 -0
- package/src/UpgradeRequiredScreen.test.tsx +40 -0
- package/src/UserInactivity.test.tsx +44 -1
- package/src/WebDropdownMenu.test.tsx +116 -1
- package/src/__snapshots__/DataTable.test.tsx.snap +0 -148
- package/src/__snapshots__/IconButton.test.tsx.snap +4 -0
- package/src/__snapshots__/InfoModalIcon.test.tsx.snap +255 -1088
- package/src/__snapshots__/Modal.test.tsx.snap +950 -1108
- package/src/bunSetup.ts +24 -0
- package/src/createWebPortal.test.tsx +17 -0
- package/src/index.tsx +18 -2
- package/src/types/react-native-swiper-flatlist.d.ts +1 -0
- package/src/useSubmitConsent.test.ts +2 -1
- package/src/useSubmitConsent.ts +2 -2
- package/dist/fieldElements/index.d.ts +0 -3
- package/dist/fieldElements/index.js +0 -4
- package/dist/fieldElements/index.js.map +0 -1
- package/dist/icons/index.d.ts +0 -5
- package/dist/icons/index.js +0 -6
- package/dist/icons/index.js.map +0 -1
- package/dist/login/index.d.ts +0 -2
- package/dist/login/index.js +0 -2
- package/dist/login/index.js.map +0 -1
- package/dist/signUp/index.d.ts +0 -6
- package/dist/signUp/index.js +0 -6
- package/dist/signUp/index.js.map +0 -1
- package/dist/testing/index.d.ts +0 -2
- package/dist/testing/index.js +0 -3
- package/dist/testing/index.js.map +0 -1
- package/src/fieldElements/index.tsx +0 -3
- package/src/icons/index.ts +0 -5
- package/src/login/index.ts +0 -2
- package/src/signUp/index.ts +0 -13
- package/src/testing/index.ts +0 -2
package/src/bunSetup.ts
CHANGED
|
@@ -614,6 +614,30 @@ mock.module("./DateTimeActionSheet", () => ({
|
|
|
614
614
|
DateTimeActionSheet: mock(() => null),
|
|
615
615
|
}));
|
|
616
616
|
|
|
617
|
+
// Mock react-native-actions-sheet so the native Modal branch is testable. The real component
|
|
618
|
+
// defers rendering until opened via native animation (which react-test-renderer never triggers),
|
|
619
|
+
// so the mock tracks the imperative visibility state instead: it renders its children
|
|
620
|
+
// synchronously when opened via the ref (setModalVisible/show) and renders nothing when closed.
|
|
621
|
+
// This keeps opened content assertable while still letting tests verify the closed/hidden state.
|
|
622
|
+
mock.module("react-native-actions-sheet", () => ({
|
|
623
|
+
__esModule: true,
|
|
624
|
+
default: React.forwardRef(function ActionSheetMock(
|
|
625
|
+
{children}: {children?: React.ReactNode},
|
|
626
|
+
ref: React.Ref<unknown>
|
|
627
|
+
) {
|
|
628
|
+
const [isVisible, setIsVisible] = React.useState(false);
|
|
629
|
+
React.useImperativeHandle(ref, () => ({
|
|
630
|
+
hide: () => setIsVisible(false),
|
|
631
|
+
setModalVisible: (visible?: boolean) => setIsVisible(Boolean(visible)),
|
|
632
|
+
show: () => setIsVisible(true),
|
|
633
|
+
}));
|
|
634
|
+
if (!isVisible) {
|
|
635
|
+
return null;
|
|
636
|
+
}
|
|
637
|
+
return React.createElement("ActionSheetMock", {}, children);
|
|
638
|
+
}),
|
|
639
|
+
}));
|
|
640
|
+
|
|
617
641
|
// Mock MediaQuery
|
|
618
642
|
mock.module("./MediaQuery", () => ({
|
|
619
643
|
isMobileDevice: mock(() => false),
|
|
@@ -1,8 +1,25 @@
|
|
|
1
1
|
import {describe, expect, it} from "bun:test";
|
|
2
|
+
import {assert} from "chai";
|
|
2
3
|
import React from "react";
|
|
3
4
|
|
|
5
|
+
import {createWebPortal} from "./createWebPortal";
|
|
4
6
|
import {createWebPortal as createNativePortal} from "./createWebPortal.native";
|
|
5
7
|
|
|
8
|
+
describe("createWebPortal (web)", () => {
|
|
9
|
+
it("creates a portal targeting the provided container", () => {
|
|
10
|
+
const container = {nodeType: 1} as unknown as Element;
|
|
11
|
+
const children = React.createElement("div", null, "web-content");
|
|
12
|
+
|
|
13
|
+
const portal = createWebPortal({children, container}) as unknown as {
|
|
14
|
+
children: unknown;
|
|
15
|
+
containerInfo: unknown;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
assert.strictEqual(portal.children, children);
|
|
19
|
+
assert.strictEqual(portal.containerInfo, container);
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
|
|
6
23
|
describe("createWebPortal (native)", () => {
|
|
7
24
|
it("returns the children unchanged without creating a portal", () => {
|
|
8
25
|
const container = {nodeType: 1} as unknown as Element;
|
package/src/index.tsx
CHANGED
|
@@ -48,7 +48,8 @@ export * from "./ImageBackground";
|
|
|
48
48
|
export * from "./InfoModalIcon";
|
|
49
49
|
export * from "./InfoTooltipButton";
|
|
50
50
|
export * from "./Link";
|
|
51
|
-
export * from "./login";
|
|
51
|
+
export * from "./login/LoginScreen";
|
|
52
|
+
export type {LoginFieldConfig, LoginScreenProps} from "./login/loginTypes";
|
|
52
53
|
export * from "./MarkdownEditor";
|
|
53
54
|
export * from "./MarkdownEditorField";
|
|
54
55
|
export * from "./MarkdownView";
|
|
@@ -80,7 +81,22 @@ export * from "./Slider";
|
|
|
80
81
|
export * from "./SocialLoginButton";
|
|
81
82
|
export * from "./Spinner";
|
|
82
83
|
export * from "./SplitPage";
|
|
83
|
-
export
|
|
84
|
+
export {OAuthButtons} from "./signUp/OAuthButtons";
|
|
85
|
+
export {PasswordRequirements} from "./signUp/PasswordRequirements";
|
|
86
|
+
export {
|
|
87
|
+
defaultPasswordRequirements,
|
|
88
|
+
simplePasswordRequirements,
|
|
89
|
+
} from "./signUp/passwordPresets";
|
|
90
|
+
export {SignUpScreen} from "./signUp/SignUpScreen";
|
|
91
|
+
export {Swiper} from "./signUp/Swiper";
|
|
92
|
+
export type {
|
|
93
|
+
OAuthProvider,
|
|
94
|
+
OAuthProviderConfig,
|
|
95
|
+
OnboardingPage,
|
|
96
|
+
PasswordRequirement,
|
|
97
|
+
SignUpFieldConfig,
|
|
98
|
+
SignUpScreenProps,
|
|
99
|
+
} from "./signUp/signUpTypes";
|
|
84
100
|
export * from "./TapToEdit";
|
|
85
101
|
export * from "./TerrenoProvider";
|
|
86
102
|
export * from "./Text";
|
|
@@ -41,6 +41,7 @@ declare module "react-native-swiper-flatlist" {
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
export const SwiperFlatList: React.ForwardRefExoticComponent<
|
|
44
|
+
// noExplicitAny: declaration must use any for the generic to allow consumers to specify their data type without explicit type args
|
|
44
45
|
// biome-ignore lint/suspicious/noExplicitAny: declaration must use any for the generic to allow consumers to specify their data type without explicit type args
|
|
45
46
|
SwiperFlatListProps<any> & React.RefAttributes<SwiperFlatListRefProps>
|
|
46
47
|
>;
|
|
@@ -64,7 +64,8 @@ describe("useSubmitConsent", () => {
|
|
|
64
64
|
});
|
|
65
65
|
expect(submitMutation).toHaveBeenCalled();
|
|
66
66
|
expect(unwrap).toHaveBeenCalled();
|
|
67
|
-
|
|
67
|
+
// submit resolves to void; it awaits unwrap() internally and does not surface the payload.
|
|
68
|
+
expect(response).toBeUndefined();
|
|
68
69
|
});
|
|
69
70
|
|
|
70
71
|
it("uses empty baseUrl when none provided", () => {
|
package/src/useSubmitConsent.ts
CHANGED
|
@@ -88,8 +88,8 @@ export const useSubmitConsent = (api: SubmitConsentApi, baseUrl?: string) => {
|
|
|
88
88
|
const [submitMutation, {isLoading: isSubmitting, error}] =
|
|
89
89
|
enhancedApi.useSubmitConsentResponseMutation();
|
|
90
90
|
|
|
91
|
-
const submit = async (body: SubmitConsentBody) => {
|
|
92
|
-
|
|
91
|
+
const submit = async (body: SubmitConsentBody): Promise<void> => {
|
|
92
|
+
await submitMutation(body).unwrap();
|
|
93
93
|
};
|
|
94
94
|
|
|
95
95
|
return {error, isSubmitting, submit};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/fieldElements/index.tsx"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC"}
|
package/dist/icons/index.d.ts
DELETED
package/dist/icons/index.js
DELETED
package/dist/icons/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/icons/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC"}
|
package/dist/login/index.d.ts
DELETED
package/dist/login/index.js
DELETED
package/dist/login/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/login/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC"}
|
package/dist/signUp/index.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { OAuthButtons } from "./OAuthButtons";
|
|
2
|
-
export { PasswordRequirements } from "./PasswordRequirements";
|
|
3
|
-
export { defaultPasswordRequirements, simplePasswordRequirements } from "./passwordPresets";
|
|
4
|
-
export { SignUpScreen } from "./SignUpScreen";
|
|
5
|
-
export { Swiper } from "./Swiper";
|
|
6
|
-
export type { OAuthProvider, OAuthProviderConfig, OnboardingPage, PasswordRequirement, SignUpFieldConfig, SignUpScreenProps, } from "./signUpTypes";
|
package/dist/signUp/index.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { OAuthButtons } from "./OAuthButtons";
|
|
2
|
-
export { PasswordRequirements } from "./PasswordRequirements";
|
|
3
|
-
export { defaultPasswordRequirements, simplePasswordRequirements } from "./passwordPresets";
|
|
4
|
-
export { SignUpScreen } from "./SignUpScreen";
|
|
5
|
-
export { Swiper } from "./Swiper";
|
|
6
|
-
//# sourceMappingURL=index.js.map
|
package/dist/signUp/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/signUp/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAC,oBAAoB,EAAC,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAC,2BAA2B,EAAE,0BAA0B,EAAC,MAAM,mBAAmB,CAAC;AAC1F,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAC,MAAM,EAAC,MAAM,UAAU,CAAC"}
|
package/dist/testing/index.d.ts
DELETED
package/dist/testing/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/testing/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC"}
|
package/src/icons/index.ts
DELETED
package/src/login/index.ts
DELETED
package/src/signUp/index.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export {OAuthButtons} from "./OAuthButtons";
|
|
2
|
-
export {PasswordRequirements} from "./PasswordRequirements";
|
|
3
|
-
export {defaultPasswordRequirements, simplePasswordRequirements} from "./passwordPresets";
|
|
4
|
-
export {SignUpScreen} from "./SignUpScreen";
|
|
5
|
-
export {Swiper} from "./Swiper";
|
|
6
|
-
export type {
|
|
7
|
-
OAuthProvider,
|
|
8
|
-
OAuthProviderConfig,
|
|
9
|
-
OnboardingPage,
|
|
10
|
-
PasswordRequirement,
|
|
11
|
-
SignUpFieldConfig,
|
|
12
|
-
SignUpScreenProps,
|
|
13
|
-
} from "./signUpTypes";
|
package/src/testing/index.ts
DELETED