@terreno/ui 0.26.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.
Files changed (63) hide show
  1. package/dist/ActionSheet.js.map +1 -1
  2. package/dist/Box.js +2 -0
  3. package/dist/Box.js.map +1 -1
  4. package/dist/Common.js.map +1 -1
  5. package/dist/ConsentNavigator.js.map +1 -1
  6. package/dist/DateTimeField.js +1 -0
  7. package/dist/DateTimeField.js.map +1 -1
  8. package/dist/EmailField.js +1 -1
  9. package/dist/EmailField.js.map +1 -1
  10. package/dist/Modal.js +7 -2
  11. package/dist/Modal.js.map +1 -1
  12. package/dist/Page.js +1 -0
  13. package/dist/Page.js.map +1 -1
  14. package/dist/SplitPage.js +3 -0
  15. package/dist/SplitPage.js.map +1 -1
  16. package/dist/SplitPage.native.js +2 -0
  17. package/dist/SplitPage.native.js.map +1 -1
  18. package/dist/TapToEdit.js +1 -0
  19. package/dist/TapToEdit.js.map +1 -1
  20. package/dist/ToastNotifications.js.map +1 -1
  21. package/dist/Unifier.js.map +1 -1
  22. package/dist/useSubmitConsent.d.ts +1 -1
  23. package/dist/useSubmitConsent.js +1 -1
  24. package/dist/useSubmitConsent.js.map +1 -1
  25. package/package.json +2 -2
  26. package/src/ActionSheet.test.tsx +1 -0
  27. package/src/ActionSheet.tsx +2 -0
  28. package/src/Box.test.tsx +56 -0
  29. package/src/Box.tsx +4 -0
  30. package/src/Button.test.tsx +34 -0
  31. package/src/Common.ts +23 -0
  32. package/src/ConsentNavigator.test.tsx +1 -0
  33. package/src/ConsentNavigator.tsx +1 -0
  34. package/src/DataTable.test.tsx +1 -0
  35. package/src/DateTimeField.test.tsx +1 -0
  36. package/src/DateTimeField.tsx +1 -0
  37. package/src/EmailField.tsx +1 -1
  38. package/src/Modal.test.tsx +261 -66
  39. package/src/Modal.tsx +7 -2
  40. package/src/ModalSheet.test.tsx +7 -6
  41. package/src/Page.tsx +1 -0
  42. package/src/PickerSelect.test.tsx +1 -0
  43. package/src/SelectBadge.test.tsx +1 -2
  44. package/src/SplitPage.native.tsx +2 -0
  45. package/src/SplitPage.test.tsx +6 -4
  46. package/src/SplitPage.tsx +3 -0
  47. package/src/TapToEdit.test.tsx +1 -0
  48. package/src/TapToEdit.tsx +2 -0
  49. package/src/Text.test.tsx +29 -0
  50. package/src/TextField.test.tsx +57 -1
  51. package/src/ToastNotifications.test.tsx +1 -0
  52. package/src/ToastNotifications.tsx +1 -0
  53. package/src/Tooltip.test.tsx +1 -1
  54. package/src/Unifier.ts +1 -0
  55. package/src/UpgradeRequiredScreen.test.tsx +40 -0
  56. package/src/UserInactivity.test.tsx +44 -1
  57. package/src/__snapshots__/DataTable.test.tsx.snap +0 -148
  58. package/src/__snapshots__/InfoModalIcon.test.tsx.snap +255 -1088
  59. package/src/__snapshots__/Modal.test.tsx.snap +950 -1108
  60. package/src/bunSetup.ts +24 -0
  61. package/src/types/react-native-swiper-flatlist.d.ts +1 -0
  62. package/src/useSubmitConsent.test.ts +2 -1
  63. package/src/useSubmitConsent.ts +2 -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),
@@ -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
- expect(response).toEqual({success: true});
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", () => {
@@ -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
- return submitMutation(body).unwrap();
91
+ const submit = async (body: SubmitConsentBody): Promise<void> => {
92
+ await submitMutation(body).unwrap();
93
93
  };
94
94
 
95
95
  return {error, isSubmitting, submit};