@terreno/ui 0.0.17 → 0.1.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 (48) hide show
  1. package/dist/Button.js +1 -1
  2. package/dist/Button.js.map +1 -1
  3. package/dist/Common.d.ts +1 -1
  4. package/dist/Hyperlink.js +2 -2
  5. package/dist/Hyperlink.js.map +1 -1
  6. package/dist/Page.js +2 -1
  7. package/dist/Page.js.map +1 -1
  8. package/dist/TerrenoProvider.js +1 -1
  9. package/dist/TerrenoProvider.js.map +1 -1
  10. package/dist/Text.js +3 -0
  11. package/dist/Text.js.map +1 -1
  12. package/dist/Theme.js +27 -27
  13. package/dist/Theme.js.map +1 -1
  14. package/dist/Toast.js +7 -5
  15. package/dist/Toast.js.map +1 -1
  16. package/dist/ToastNotifications.d.ts +144 -0
  17. package/dist/ToastNotifications.js +387 -0
  18. package/dist/ToastNotifications.js.map +1 -0
  19. package/dist/UserInactivity.js +2 -2
  20. package/dist/UserInactivity.js.map +1 -1
  21. package/dist/index.d.ts +1 -0
  22. package/dist/index.js.map +1 -1
  23. package/package.json +8 -7
  24. package/src/Button.tsx +1 -1
  25. package/src/Common.ts +1 -2
  26. package/src/Hyperlink.tsx +2 -10
  27. package/src/Page.tsx +3 -2
  28. package/src/TerrenoProvider.tsx +1 -1
  29. package/src/Text.tsx +3 -0
  30. package/src/Theme.tsx +33 -27
  31. package/src/Toast.tsx +7 -5
  32. package/src/ToastNotifications.test.tsx +645 -0
  33. package/src/ToastNotifications.tsx +746 -0
  34. package/src/UserInactivity.tsx +2 -2
  35. package/src/__snapshots__/Button.test.tsx.snap +12 -12
  36. package/src/__snapshots__/DecimalRangeActionSheet.test.tsx.snap +2 -2
  37. package/src/__snapshots__/ErrorPage.test.tsx.snap +1 -1
  38. package/src/__snapshots__/Field.test.tsx.snap +138 -138
  39. package/src/__snapshots__/HeightActionSheet.test.tsx.snap +2 -2
  40. package/src/__snapshots__/InfoModalIcon.test.tsx.snap +4 -4
  41. package/src/__snapshots__/Modal.test.tsx.snap +3 -3
  42. package/src/__snapshots__/NumberPickerActionSheet.test.tsx.snap +2 -2
  43. package/src/__snapshots__/Page.test.tsx.snap +1 -1
  44. package/src/__snapshots__/PhoneNumberField.test.tsx.snap +17 -17
  45. package/src/bunSetup.ts +23 -0
  46. package/src/index.tsx +2 -0
  47. package/src/table/__snapshots__/TableDate.test.tsx.snap +4 -4
  48. package/src/table/__snapshots__/TableRow.test.tsx.snap +64 -64
package/src/bunSetup.ts CHANGED
@@ -432,6 +432,29 @@ if (typeof globalThis.expo === "undefined") {
432
432
  } as any;
433
433
  }
434
434
 
435
+ // Mock expo-router
436
+ mock.module("expo-router", () => ({
437
+ Link: ({children, ...props}: any) => React.createElement("Link", props, children),
438
+ router: {
439
+ back: mock(() => {}),
440
+ canGoBack: mock(() => true),
441
+ navigate: mock(() => {}),
442
+ push: mock(() => {}),
443
+ replace: mock(() => {}),
444
+ },
445
+ Stack: ({children, ...props}: any) => React.createElement("Stack", props, children),
446
+ Tabs: ({children, ...props}: any) => React.createElement("Tabs", props, children),
447
+ useLocalSearchParams: mock(() => ({})),
448
+ useRouter: mock(() => ({
449
+ back: mock(() => {}),
450
+ canGoBack: mock(() => true),
451
+ navigate: mock(() => {}),
452
+ push: mock(() => {}),
453
+ replace: mock(() => {}),
454
+ })),
455
+ useSegments: mock(() => []),
456
+ }));
457
+
435
458
  // Mock @react-native-async-storage/async-storage
436
459
  mock.module("@react-native-async-storage/async-storage", () => ({
437
460
  clear: mock(() => Promise.resolve()),
package/src/index.tsx CHANGED
@@ -1,3 +1,5 @@
1
+ // Re-export React Native style types for use in consumer projects
2
+ export type {StyleProp, ViewStyle} from "react-native";
1
3
  export * from "./Accordion";
2
4
  export * from "./ActionSheet";
3
5
  export * from "./AddressField";
@@ -30,11 +30,11 @@ exports[`TableDate renders correctly with Date object 1`] = `
30
30
  }
31
31
  `;
32
32
 
33
- exports[`TableDate renders annotated date with relative time 1`] = `
33
+ exports[`TableDate renders date in MM/dd/yyyy format by default 1`] = `
34
34
  {
35
35
  "$$typeof": Symbol(react.test.json),
36
36
  "children": [
37
- "12/31/2023 (-7 Mo -17 Day)",
37
+ "03/25/2024",
38
38
  ],
39
39
  "props": {
40
40
  "style": {
@@ -45,11 +45,11 @@ exports[`TableDate renders annotated date with relative time 1`] = `
45
45
  }
46
46
  `;
47
47
 
48
- exports[`TableDate renders date in MM/dd/yyyy format by default 1`] = `
48
+ exports[`TableDate renders annotated date with relative time 1`] = `
49
49
  {
50
50
  "$$typeof": Symbol(react.test.json),
51
51
  "children": [
52
- "03/25/2024",
52
+ "12/31/2023 (-7 Mo -17 Day)",
53
53
  ],
54
54
  "props": {
55
55
  "style": {
@@ -846,7 +846,7 @@ exports[`TableRow renders with drawer contents 1`] = `
846
846
  }
847
847
  `;
848
848
 
849
- exports[`TableRow renders with custom color 1`] = `
849
+ exports[`TableRow renders drawer with expand button 1`] = `
850
850
  {
851
851
  "$$typeof": Symbol(react.test.json),
852
852
  "children": [
@@ -865,6 +865,38 @@ exports[`TableRow renders with custom color 1`] = `
865
865
  {
866
866
  "$$typeof": Symbol(react.test.json),
867
867
  "children": [
868
+ {
869
+ "$$typeof": Symbol(react.test.json),
870
+ "children": [
871
+ {
872
+ "$$typeof": Symbol(react.test.json),
873
+ "children": null,
874
+ "props": {
875
+ "onPointerEnter": [Function: AsyncFunction],
876
+ "onPointerLeave": [Function: AsyncFunction],
877
+ "style": {
878
+ "width": 32,
879
+ },
880
+ "testID": undefined,
881
+ },
882
+ "type": "View",
883
+ },
884
+ ],
885
+ "props": {
886
+ "onPointerEnter": [Function: AsyncFunction],
887
+ "onPointerLeave": [Function: AsyncFunction],
888
+ "style": {
889
+ "justifyContent": "center",
890
+ "marginRight": 8,
891
+ "paddingBottom": 16,
892
+ "paddingLeft": 12,
893
+ "paddingRight": 12,
894
+ "paddingTop": 16,
895
+ },
896
+ "testID": undefined,
897
+ },
898
+ "type": "View",
899
+ },
868
900
  {
869
901
  "$$typeof": Symbol(react.test.json),
870
902
  "children": [
@@ -874,10 +906,10 @@ exports[`TableRow renders with custom color 1`] = `
874
906
  {
875
907
  "$$typeof": Symbol(react.test.json),
876
908
  "children": [
877
- "Column",
909
+ "Name",
878
910
  ],
879
911
  "props": {
880
- "aria-label": "Table title: Column",
912
+ "aria-label": "Table title: Name",
881
913
  "aria-role": "header",
882
914
  "ellipsizeMode": "tail",
883
915
  "numberOfLines": 3,
@@ -981,13 +1013,31 @@ exports[`TableRow renders with custom color 1`] = `
981
1013
  {
982
1014
  "$$typeof": Symbol(react.test.json),
983
1015
  "children": [
1016
+ {
1017
+ "$$typeof": Symbol(react.test.json),
1018
+ "children": null,
1019
+ "props": {
1020
+ "onPointerEnter": [Function: AsyncFunction],
1021
+ "onPointerLeave": [Function: AsyncFunction],
1022
+ "style": {
1023
+ "justifyContent": "center",
1024
+ "marginRight": 8,
1025
+ "paddingBottom": 16,
1026
+ "paddingLeft": 12,
1027
+ "paddingRight": 12,
1028
+ "paddingTop": 16,
1029
+ },
1030
+ "testID": undefined,
1031
+ },
1032
+ "type": "View",
1033
+ },
984
1034
  {
985
1035
  "$$typeof": Symbol(react.test.json),
986
1036
  "children": [
987
1037
  {
988
1038
  "$$typeof": Symbol(react.test.json),
989
1039
  "children": [
990
- "Light row",
1040
+ "Click to expand",
991
1041
  ],
992
1042
  "props": {
993
1043
  "style": {
@@ -1058,7 +1108,7 @@ exports[`TableRow renders with custom color 1`] = `
1058
1108
  "flex": 1,
1059
1109
  "maxHeight": undefined,
1060
1110
  "maxWidth": "100%",
1061
- "width": 108,
1111
+ "width": 164,
1062
1112
  },
1063
1113
  },
1064
1114
  "type": "ScrollView",
@@ -1068,7 +1118,7 @@ exports[`TableRow renders with custom color 1`] = `
1068
1118
  "horizontal": true,
1069
1119
  "style": {
1070
1120
  "maxWidth": "100%",
1071
- "width": 108,
1121
+ "width": 164,
1072
1122
  },
1073
1123
  },
1074
1124
  "type": "ScrollView",
@@ -1085,7 +1135,7 @@ exports[`TableRow renders with custom color 1`] = `
1085
1135
  "style": {
1086
1136
  "position": "relative",
1087
1137
  },
1088
- "width": 108,
1138
+ "width": 164,
1089
1139
  },
1090
1140
  "testID": undefined,
1091
1141
  },
@@ -1093,7 +1143,7 @@ exports[`TableRow renders with custom color 1`] = `
1093
1143
  }
1094
1144
  `;
1095
1145
 
1096
- exports[`TableRow renders drawer with expand button 1`] = `
1146
+ exports[`TableRow renders with custom color 1`] = `
1097
1147
  {
1098
1148
  "$$typeof": Symbol(react.test.json),
1099
1149
  "children": [
@@ -1112,38 +1162,6 @@ exports[`TableRow renders drawer with expand button 1`] = `
1112
1162
  {
1113
1163
  "$$typeof": Symbol(react.test.json),
1114
1164
  "children": [
1115
- {
1116
- "$$typeof": Symbol(react.test.json),
1117
- "children": [
1118
- {
1119
- "$$typeof": Symbol(react.test.json),
1120
- "children": null,
1121
- "props": {
1122
- "onPointerEnter": [Function: AsyncFunction],
1123
- "onPointerLeave": [Function: AsyncFunction],
1124
- "style": {
1125
- "width": 32,
1126
- },
1127
- "testID": undefined,
1128
- },
1129
- "type": "View",
1130
- },
1131
- ],
1132
- "props": {
1133
- "onPointerEnter": [Function: AsyncFunction],
1134
- "onPointerLeave": [Function: AsyncFunction],
1135
- "style": {
1136
- "justifyContent": "center",
1137
- "marginRight": 8,
1138
- "paddingBottom": 16,
1139
- "paddingLeft": 12,
1140
- "paddingRight": 12,
1141
- "paddingTop": 16,
1142
- },
1143
- "testID": undefined,
1144
- },
1145
- "type": "View",
1146
- },
1147
1165
  {
1148
1166
  "$$typeof": Symbol(react.test.json),
1149
1167
  "children": [
@@ -1153,10 +1171,10 @@ exports[`TableRow renders drawer with expand button 1`] = `
1153
1171
  {
1154
1172
  "$$typeof": Symbol(react.test.json),
1155
1173
  "children": [
1156
- "Name",
1174
+ "Column",
1157
1175
  ],
1158
1176
  "props": {
1159
- "aria-label": "Table title: Name",
1177
+ "aria-label": "Table title: Column",
1160
1178
  "aria-role": "header",
1161
1179
  "ellipsizeMode": "tail",
1162
1180
  "numberOfLines": 3,
@@ -1260,31 +1278,13 @@ exports[`TableRow renders drawer with expand button 1`] = `
1260
1278
  {
1261
1279
  "$$typeof": Symbol(react.test.json),
1262
1280
  "children": [
1263
- {
1264
- "$$typeof": Symbol(react.test.json),
1265
- "children": null,
1266
- "props": {
1267
- "onPointerEnter": [Function: AsyncFunction],
1268
- "onPointerLeave": [Function: AsyncFunction],
1269
- "style": {
1270
- "justifyContent": "center",
1271
- "marginRight": 8,
1272
- "paddingBottom": 16,
1273
- "paddingLeft": 12,
1274
- "paddingRight": 12,
1275
- "paddingTop": 16,
1276
- },
1277
- "testID": undefined,
1278
- },
1279
- "type": "View",
1280
- },
1281
1281
  {
1282
1282
  "$$typeof": Symbol(react.test.json),
1283
1283
  "children": [
1284
1284
  {
1285
1285
  "$$typeof": Symbol(react.test.json),
1286
1286
  "children": [
1287
- "Click to expand",
1287
+ "Light row",
1288
1288
  ],
1289
1289
  "props": {
1290
1290
  "style": {
@@ -1355,7 +1355,7 @@ exports[`TableRow renders drawer with expand button 1`] = `
1355
1355
  "flex": 1,
1356
1356
  "maxHeight": undefined,
1357
1357
  "maxWidth": "100%",
1358
- "width": 164,
1358
+ "width": 108,
1359
1359
  },
1360
1360
  },
1361
1361
  "type": "ScrollView",
@@ -1365,7 +1365,7 @@ exports[`TableRow renders drawer with expand button 1`] = `
1365
1365
  "horizontal": true,
1366
1366
  "style": {
1367
1367
  "maxWidth": "100%",
1368
- "width": 164,
1368
+ "width": 108,
1369
1369
  },
1370
1370
  },
1371
1371
  "type": "ScrollView",
@@ -1382,7 +1382,7 @@ exports[`TableRow renders drawer with expand button 1`] = `
1382
1382
  "style": {
1383
1383
  "position": "relative",
1384
1384
  },
1385
- "width": 164,
1385
+ "width": 108,
1386
1386
  },
1387
1387
  "testID": undefined,
1388
1388
  },