@terreno/ui 0.13.3 → 0.14.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 (140) hide show
  1. package/dist/ActionSheet.d.ts +4 -4
  2. package/dist/ActionSheet.js.map +1 -1
  3. package/dist/Avatar.js +1 -1
  4. package/dist/Avatar.js.map +1 -1
  5. package/dist/Banner.js.map +1 -1
  6. package/dist/Box.js +2 -0
  7. package/dist/Box.js.map +1 -1
  8. package/dist/Button.d.ts +2 -2
  9. package/dist/Button.js +35 -23
  10. package/dist/Button.js.map +1 -1
  11. package/dist/Common.d.ts +8 -2
  12. package/dist/Common.js.map +1 -1
  13. package/dist/ConsentFormScreen.js +1 -1
  14. package/dist/ConsentFormScreen.js.map +1 -1
  15. package/dist/ConsentNavigator.d.ts +1 -1
  16. package/dist/ConsentNavigator.js +2 -1
  17. package/dist/ConsentNavigator.js.map +1 -1
  18. package/dist/CustomSelectField.js +3 -1
  19. package/dist/CustomSelectField.js.map +1 -1
  20. package/dist/DataTable.js +1 -1
  21. package/dist/DataTable.js.map +1 -1
  22. package/dist/DateTimeActionSheet.js +2 -1
  23. package/dist/DateTimeActionSheet.js.map +1 -1
  24. package/dist/DateTimeField.js +3 -2
  25. package/dist/DateTimeField.js.map +1 -1
  26. package/dist/DateUtilities.js.map +1 -1
  27. package/dist/HeightField.js.map +1 -1
  28. package/dist/Hyperlink.js +19 -9
  29. package/dist/Hyperlink.js.map +1 -1
  30. package/dist/IconButton.js.map +1 -1
  31. package/dist/ImageBackground.d.ts +2 -5
  32. package/dist/ImageBackground.js +1 -1
  33. package/dist/ImageBackground.js.map +1 -1
  34. package/dist/ModalSheet.d.ts +3 -2
  35. package/dist/ModalSheet.js +1 -1
  36. package/dist/ModalSheet.js.map +1 -1
  37. package/dist/OfflineBanner.d.ts +21 -0
  38. package/dist/OfflineBanner.js +25 -0
  39. package/dist/OfflineBanner.js.map +1 -0
  40. package/dist/OpenAPIContext.js +1 -1
  41. package/dist/OpenAPIContext.js.map +1 -1
  42. package/dist/Page.js +1 -0
  43. package/dist/Page.js.map +1 -1
  44. package/dist/Pagination.js.map +1 -1
  45. package/dist/Permissions.js +3 -0
  46. package/dist/Permissions.js.map +1 -1
  47. package/dist/PickerSelect.js +7 -4
  48. package/dist/PickerSelect.js.map +1 -1
  49. package/dist/SelectField.js +1 -1
  50. package/dist/SelectField.js.map +1 -1
  51. package/dist/SplitPage.js +7 -2
  52. package/dist/SplitPage.js.map +1 -1
  53. package/dist/SplitPage.native.js +4 -1
  54. package/dist/SplitPage.native.js.map +1 -1
  55. package/dist/TapToEdit.js +10 -11
  56. package/dist/TapToEdit.js.map +1 -1
  57. package/dist/Toast.js.map +1 -1
  58. package/dist/ToastNotifications.js.map +1 -1
  59. package/dist/Unifier.d.ts +2 -2
  60. package/dist/Unifier.js +1 -1
  61. package/dist/Unifier.js.map +1 -1
  62. package/dist/Utilities.d.ts +8 -4
  63. package/dist/Utilities.js +1 -1
  64. package/dist/Utilities.js.map +1 -1
  65. package/dist/index.d.ts +1 -0
  66. package/dist/index.js +1 -0
  67. package/dist/index.js.map +1 -1
  68. package/package.json +2 -1
  69. package/src/ActionSheet.test.tsx +1 -0
  70. package/src/ActionSheet.tsx +6 -4
  71. package/src/Avatar.tsx +9 -2
  72. package/src/Badge.test.tsx +1 -0
  73. package/src/Banner.tsx +1 -1
  74. package/src/Box.test.tsx +1 -0
  75. package/src/Box.tsx +10 -6
  76. package/src/Button.test.tsx +35 -0
  77. package/src/Button.tsx +65 -34
  78. package/src/Common.ts +32 -15
  79. package/src/ConsentFormScreen.test.tsx +102 -0
  80. package/src/ConsentFormScreen.tsx +9 -3
  81. package/src/ConsentNavigator.test.tsx +1 -0
  82. package/src/ConsentNavigator.tsx +5 -3
  83. package/src/CustomSelectField.tsx +3 -1
  84. package/src/DataTable.test.tsx +1 -0
  85. package/src/DataTable.tsx +1 -1
  86. package/src/DateTimeActionSheet.tsx +7 -3
  87. package/src/DateTimeField.test.tsx +1 -0
  88. package/src/DateTimeField.tsx +3 -2
  89. package/src/DateUtilities.test.ts +111 -0
  90. package/src/DateUtilities.tsx +6 -6
  91. package/src/DecimalRangeActionSheet.test.tsx +28 -0
  92. package/src/ErrorBoundary.test.tsx +1 -0
  93. package/src/HeightField.tsx +2 -1
  94. package/src/Hyperlink.tsx +83 -52
  95. package/src/IconButton.tsx +1 -1
  96. package/src/ImageBackground.tsx +5 -6
  97. package/src/ModalSheet.test.tsx +1 -5
  98. package/src/ModalSheet.tsx +15 -6
  99. package/src/NumberField.test.tsx +14 -0
  100. package/src/OfflineBanner.test.tsx +70 -0
  101. package/src/OfflineBanner.tsx +54 -0
  102. package/src/OpenAPIContext.tsx +3 -2
  103. package/src/Page.tsx +1 -0
  104. package/src/Pagination.tsx +1 -1
  105. package/src/Permissions.ts +3 -0
  106. package/src/PickerSelect.tsx +17 -14
  107. package/src/SelectBadge.test.tsx +1 -0
  108. package/src/SelectField.tsx +1 -1
  109. package/src/Signature.test.tsx +1 -0
  110. package/src/SplitPage.native.tsx +2 -0
  111. package/src/SplitPage.tsx +6 -1
  112. package/src/TapToEdit.test.tsx +17 -0
  113. package/src/TapToEdit.tsx +11 -11
  114. package/src/Toast.tsx +1 -1
  115. package/src/ToastNotifications.tsx +1 -4
  116. package/src/Tooltip.test.tsx +0 -7
  117. package/src/Unifier.ts +6 -5
  118. package/src/Utilities.tsx +9 -6
  119. package/src/__snapshots__/AddressField.test.tsx.snap +3 -1
  120. package/src/__snapshots__/Button.test.tsx.snap +92 -50
  121. package/src/__snapshots__/CustomSelectField.test.tsx.snap +21 -7
  122. package/src/__snapshots__/DecimalRangeActionSheet.test.tsx.snap +14 -8
  123. package/src/__snapshots__/ErrorPage.test.tsx.snap +7 -4
  124. package/src/__snapshots__/Field.test.tsx.snap +18 -6
  125. package/src/__snapshots__/HeightActionSheet.test.tsx.snap +14 -8
  126. package/src/__snapshots__/HeightField.test.tsx.snap +35 -20
  127. package/src/__snapshots__/InfoModalIcon.test.tsx.snap +28 -16
  128. package/src/__snapshots__/Modal.test.tsx.snap +19 -10
  129. package/src/__snapshots__/ModalSheet.test.tsx.snap +0 -1
  130. package/src/__snapshots__/NumberPickerActionSheet.test.tsx.snap +14 -8
  131. package/src/__snapshots__/Page.test.tsx.snap +7 -4
  132. package/src/__snapshots__/SelectField.test.tsx.snap +18 -6
  133. package/src/__snapshots__/TerrenoProvider.test.tsx.snap +0 -2
  134. package/src/__snapshots__/TimezonePicker.test.tsx.snap +18 -6
  135. package/src/bunSetup.ts +25 -2
  136. package/src/index.tsx +1 -0
  137. package/src/login/__snapshots__/LoginScreen.test.tsx.snap +15 -6
  138. package/src/signUp/__snapshots__/SignUpScreen.test.tsx.snap +10 -4
  139. package/src/table/__snapshots__/TableBadge.test.tsx.snap +3 -1
  140. package/src/types/react-native-swiper-flatlist.d.ts +1 -0
@@ -322,7 +322,9 @@ exports[`TimezonePicker renders correctly with default props 1`] = `
322
322
  },
323
323
  ],
324
324
  "props": {
325
- "style": undefined,
325
+ "style": {
326
+ "width": "100%",
327
+ },
326
328
  "testID": undefined,
327
329
  },
328
330
  "type": "View",
@@ -636,7 +638,9 @@ exports[`TimezonePicker hides title when hideTitle is true 1`] = `
636
638
  },
637
639
  ],
638
640
  "props": {
639
- "style": undefined,
641
+ "style": {
642
+ "width": "100%",
643
+ },
640
644
  "testID": undefined,
641
645
  },
642
646
  "type": "View",
@@ -965,7 +969,9 @@ exports[`TimezonePicker renders with selected timezone 1`] = `
965
969
  },
966
970
  ],
967
971
  "props": {
968
- "style": undefined,
972
+ "style": {
973
+ "width": "100%",
974
+ },
969
975
  "testID": undefined,
970
976
  },
971
977
  "type": "View",
@@ -1294,7 +1300,9 @@ exports[`TimezonePicker renders USA timezones by default 1`] = `
1294
1300
  },
1295
1301
  ],
1296
1302
  "props": {
1297
- "style": undefined,
1303
+ "style": {
1304
+ "width": "100%",
1305
+ },
1298
1306
  "testID": undefined,
1299
1307
  },
1300
1308
  "type": "View",
@@ -1623,7 +1631,9 @@ exports[`TimezonePicker renders with short timezone labels 1`] = `
1623
1631
  },
1624
1632
  ],
1625
1633
  "props": {
1626
- "style": undefined,
1634
+ "style": {
1635
+ "width": "100%",
1636
+ },
1627
1637
  "testID": undefined,
1628
1638
  },
1629
1639
  "type": "View",
@@ -1952,7 +1962,9 @@ exports[`TimezonePicker calls onChange when timezone is selected 1`] = `
1952
1962
  },
1953
1963
  ],
1954
1964
  "props": {
1955
- "style": undefined,
1965
+ "style": {
1966
+ "width": "100%",
1967
+ },
1956
1968
  "testID": undefined,
1957
1969
  },
1958
1970
  "type": "View",
package/src/bunSetup.ts CHANGED
@@ -6,6 +6,10 @@ type MockComponentProps = Record<string, unknown> & {
6
6
  style?: unknown;
7
7
  testID?: string;
8
8
  };
9
+ type MockPresstoPressableProps = MockComponentProps & {
10
+ enabled?: boolean;
11
+ onPress?: (...args: unknown[]) => unknown;
12
+ };
9
13
  type MockStyleValue = unknown;
10
14
  type MockAnimation = {
11
15
  start?: (callback?: (result: {finished: boolean}) => void) => void;
@@ -447,6 +451,25 @@ mock.module("react-native", () => {
447
451
  };
448
452
  });
449
453
 
454
+ const createMockPresstoPressable = (name: string): React.FC<MockPresstoPressableProps> => {
455
+ return ({children, enabled = true, onPress, ...props}) =>
456
+ React.createElement(
457
+ name,
458
+ {
459
+ ...props,
460
+ disabled: !enabled,
461
+ onPress: enabled ? onPress : undefined,
462
+ },
463
+ children
464
+ );
465
+ };
466
+
467
+ mock.module("pressto", () => ({
468
+ PressableOpacity: createMockPresstoPressable("PressableOpacity"),
469
+ PressableScale: createMockPresstoPressable("PressableScale"),
470
+ PressableWithoutFeedback: createMockPresstoPressable("PressableWithoutFeedback"),
471
+ }));
472
+
450
473
  // Initialize globalThis.expo early for expo-modules-core
451
474
  if (typeof globalThis.expo === "undefined") {
452
475
  const EventEmitterClass = class EventEmitter {
@@ -547,9 +570,9 @@ mock.module("react-signature-canvas", () => {
547
570
  // mock used by Tooltip.test.tsx so the two don't disagree.
548
571
  mock.module("react-native-portalize", () => ({
549
572
  Host: ({children}: MockComponentProps) =>
550
- React.createElement("View", {style: undefined, testID: "portal-host"}, children),
573
+ React.createElement("View", {testID: "portal-host"}, children),
551
574
  Portal: ({children}: MockComponentProps) =>
552
- React.createElement("View", {style: undefined, testID: "portal"}, children),
575
+ React.createElement("View", {testID: "portal"}, children),
553
576
  }));
554
577
 
555
578
  // Mock IconButton component
package/src/index.tsx CHANGED
@@ -58,6 +58,7 @@ export * from "./ModalSheet";
58
58
  export * from "./MultiselectField";
59
59
  export * from "./NumberField";
60
60
  export * from "./NumberPickerActionSheet";
61
+ export * from "./OfflineBanner";
61
62
  export * from "./OpenAPIContext";
62
63
  export * from "./Page";
63
64
  export * from "./Pagination";
@@ -354,8 +354,11 @@ exports[`LoginScreen renders correctly with all props 1`] = `
354
354
  ],
355
355
  "props": {
356
356
  "accessibilityHint": "Press to perform action",
357
- "aria-label": "Log In",
358
- "aria-role": "button",
357
+ "accessibilityLabel": "Log In",
358
+ "accessibilityRole": "button",
359
+ "accessibilityState": {
360
+ "disabled": true,
361
+ },
359
362
  "disabled": true,
360
363
  "onPress": [Function: debounced],
361
364
  "style": {
@@ -433,8 +436,11 @@ exports[`LoginScreen renders correctly with all props 1`] = `
433
436
  ],
434
437
  "props": {
435
438
  "accessibilityHint": "Press to perform action",
436
- "aria-label": "Forgot password?",
437
- "aria-role": "button",
439
+ "accessibilityLabel": "Forgot password?",
440
+ "accessibilityRole": "button",
441
+ "accessibilityState": {
442
+ "disabled": true,
443
+ },
438
444
  "disabled": true,
439
445
  "onPress": [Function: debounced],
440
446
  "style": {
@@ -513,8 +519,11 @@ exports[`LoginScreen renders correctly with all props 1`] = `
513
519
  ],
514
520
  "props": {
515
521
  "accessibilityHint": "Press to perform action",
516
- "aria-label": "Need an account? Sign Up",
517
- "aria-role": "button",
522
+ "accessibilityLabel": "Need an account? Sign Up",
523
+ "accessibilityRole": "button",
524
+ "accessibilityState": {
525
+ "disabled": true,
526
+ },
518
527
  "disabled": true,
519
528
  "onPress": [Function: debounced],
520
529
  "style": {
@@ -669,8 +669,11 @@ exports[`SignUpScreen renders correctly with all props 1`] = `
669
669
  ],
670
670
  "props": {
671
671
  "accessibilityHint": "Press to perform action",
672
- "aria-label": "Sign Up",
673
- "aria-role": "button",
672
+ "accessibilityLabel": "Sign Up",
673
+ "accessibilityRole": "button",
674
+ "accessibilityState": {
675
+ "disabled": true,
676
+ },
674
677
  "disabled": true,
675
678
  "onPress": [Function: debounced],
676
679
  "style": {
@@ -748,8 +751,11 @@ exports[`SignUpScreen renders correctly with all props 1`] = `
748
751
  ],
749
752
  "props": {
750
753
  "accessibilityHint": "Press to perform action",
751
- "aria-label": "Already have an account? Log in",
752
- "aria-role": "button",
754
+ "accessibilityLabel": "Already have an account? Log in",
755
+ "accessibilityRole": "button",
756
+ "accessibilityState": {
757
+ "disabled": true,
758
+ },
753
759
  "disabled": true,
754
760
  "onPress": [Function: debounced],
755
761
  "style": {
@@ -691,7 +691,9 @@ exports[`TableBadge renders select field when editing 1`] = `
691
691
  },
692
692
  ],
693
693
  "props": {
694
- "style": undefined,
694
+ "style": {
695
+ "width": "100%",
696
+ },
695
697
  "testID": undefined,
696
698
  },
697
699
  "type": "View",
@@ -41,6 +41,7 @@ declare module "react-native-swiper-flatlist" {
41
41
  }
42
42
 
43
43
  export const SwiperFlatList: React.ForwardRefExoticComponent<
44
+ // biome-ignore lint/suspicious/noExplicitAny: declaration must use any for the generic to allow consumers to specify their data type without explicit type args
44
45
  SwiperFlatListProps<any> & React.RefAttributes<SwiperFlatListRefProps>
45
46
  >;
46
47