@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.
Files changed (201) hide show
  1. package/.ai/guidelines/core.md +1 -1
  2. package/README.md +17 -8
  3. package/dist/ActionSheet.d.ts +3 -3
  4. package/dist/ActionSheet.js +2 -2
  5. package/dist/ActionSheet.js.map +1 -1
  6. package/dist/Box.d.ts +1 -1
  7. package/dist/Box.js +219 -177
  8. package/dist/Box.js.map +1 -1
  9. package/dist/Button.js +101 -34
  10. package/dist/Button.js.map +1 -1
  11. package/dist/Common.d.ts +119 -9
  12. package/dist/Common.js.map +1 -1
  13. package/dist/ConsentFormScreen.js +46 -12
  14. package/dist/ConsentFormScreen.js.map +1 -1
  15. package/dist/ConsentNavigator.d.ts +5 -1
  16. package/dist/ConsentNavigator.js.map +1 -1
  17. package/dist/DataTable.d.ts +2 -2
  18. package/dist/DataTable.js +203 -44
  19. package/dist/DataTable.js.map +1 -1
  20. package/dist/DataTableHeaderInfoMarkdown.d.ts +6 -0
  21. package/dist/DataTableHeaderInfoMarkdown.js +7 -0
  22. package/dist/DataTableHeaderInfoMarkdown.js.map +1 -0
  23. package/dist/EmojiSelector.d.ts +2 -46
  24. package/dist/EmojiSelector.js +46 -56
  25. package/dist/EmojiSelector.js.map +1 -1
  26. package/dist/GPTChat.js +1 -1
  27. package/dist/GPTChat.js.map +1 -1
  28. package/dist/Heading.d.ts +5 -2
  29. package/dist/Heading.js +6 -8
  30. package/dist/Heading.js.map +1 -1
  31. package/dist/Hyperlink.js.map +1 -1
  32. package/dist/Icon.d.ts +1 -2
  33. package/dist/Icon.js +4 -1
  34. package/dist/Icon.js.map +1 -1
  35. package/dist/MarkdownView.d.ts +6 -3
  36. package/dist/MarkdownView.js +45 -43
  37. package/dist/MarkdownView.js.map +1 -1
  38. package/dist/MediaQuery.d.ts +5 -3
  39. package/dist/MediaQuery.js +9 -40
  40. package/dist/MediaQuery.js.map +1 -1
  41. package/dist/OpenAPIContext.js +7 -6
  42. package/dist/OpenAPIContext.js.map +1 -1
  43. package/dist/Page.js +7 -1
  44. package/dist/Page.js.map +1 -1
  45. package/dist/PickerSelect.js +8 -1
  46. package/dist/PickerSelect.js.map +1 -1
  47. package/dist/Popover.d.ts +12 -0
  48. package/dist/Popover.js +37 -0
  49. package/dist/Popover.js.map +1 -0
  50. package/dist/PortalHost.js +10 -1
  51. package/dist/PortalHost.js.map +1 -1
  52. package/dist/ResponsiveBreakpoint.d.ts +65 -0
  53. package/dist/ResponsiveBreakpoint.js +111 -0
  54. package/dist/ResponsiveBreakpoint.js.map +1 -0
  55. package/dist/SplitPage.d.ts +2 -2
  56. package/dist/SplitPage.js +7 -12
  57. package/dist/SplitPage.js.map +1 -1
  58. package/dist/SplitPage.native.d.ts +2 -2
  59. package/dist/SplitPage.native.js +1 -6
  60. package/dist/SplitPage.native.js.map +1 -1
  61. package/dist/TapToEdit.js +12 -10
  62. package/dist/TapToEdit.js.map +1 -1
  63. package/dist/TerrenoFontProvider.d.ts +7 -0
  64. package/dist/TerrenoFontProvider.js +27 -0
  65. package/dist/TerrenoFontProvider.js.map +1 -0
  66. package/dist/TerrenoProvider.js +4 -2
  67. package/dist/TerrenoProvider.js.map +1 -1
  68. package/dist/Text.d.ts +5 -2
  69. package/dist/Text.js +6 -11
  70. package/dist/Text.js.map +1 -1
  71. package/dist/TextFieldNumberActionSheet.js +9 -2
  72. package/dist/TextFieldNumberActionSheet.js.map +1 -1
  73. package/dist/Theme.js +10 -8
  74. package/dist/Theme.js.map +1 -1
  75. package/dist/ToastNotifications.d.ts +4 -2
  76. package/dist/ToastNotifications.js.map +1 -1
  77. package/dist/Tooltip.d.ts +4 -3
  78. package/dist/Tooltip.js +14 -3
  79. package/dist/Tooltip.js.map +1 -1
  80. package/dist/Unifier.d.ts +26 -1
  81. package/dist/Unifier.js.map +1 -1
  82. package/dist/WebAddressAutocomplete.js +6 -1
  83. package/dist/WebAddressAutocomplete.js.map +1 -1
  84. package/dist/emojiCategories.d.ts +46 -0
  85. package/dist/emojiCategories.js +47 -0
  86. package/dist/emojiCategories.js.map +1 -0
  87. package/dist/index.d.ts +13 -13
  88. package/dist/index.js +2 -13
  89. package/dist/index.js.map +1 -1
  90. package/dist/lazyBoundaries/createLazyComponentExport.d.ts +6 -0
  91. package/dist/lazyBoundaries/createLazyComponentExport.js +35 -0
  92. package/dist/lazyBoundaries/createLazyComponentExport.js.map +1 -0
  93. package/dist/lazyBoundaries/heavyOptionalExports.d.ts +41 -0
  94. package/dist/lazyBoundaries/heavyOptionalExports.js +43 -0
  95. package/dist/lazyBoundaries/heavyOptionalExports.js.map +1 -0
  96. package/dist/login/LoginScreen.d.ts +1 -0
  97. package/dist/login/LoginScreen.js +4 -2
  98. package/dist/login/LoginScreen.js.map +1 -1
  99. package/dist/login/loginTypes.d.ts +2 -0
  100. package/package.json +40 -1
  101. package/src/AIRequestExplorer.test.tsx +141 -0
  102. package/src/ActionSheet.tsx +9 -7
  103. package/src/AttachmentPreview.test.tsx +80 -0
  104. package/src/Box.test.tsx +97 -10
  105. package/src/Box.tsx +263 -200
  106. package/src/Button.test.tsx +207 -0
  107. package/src/Button.tsx +146 -48
  108. package/src/Common.ts +124 -25
  109. package/src/ConsentFormScreen.markdownGate.test.tsx +129 -0
  110. package/src/ConsentFormScreen.test.tsx +145 -8
  111. package/src/ConsentFormScreen.tsx +74 -25
  112. package/src/ConsentNavigator.tsx +13 -5
  113. package/src/DataTable.tsx +418 -147
  114. package/src/DataTableHeaderInfoMarkdown.test.tsx +21 -0
  115. package/src/DataTableHeaderInfoMarkdown.tsx +17 -0
  116. package/src/DataTableVirtualizationRegression.test.tsx +266 -0
  117. package/src/DateTimeField.test.tsx +54 -0
  118. package/src/EmojiSelector.test.tsx +33 -42
  119. package/src/EmojiSelector.tsx +60 -57
  120. package/src/FilePickerButton.test.tsx +167 -0
  121. package/src/FilterAccordion.test.tsx +37 -0
  122. package/src/FilterBoolean.test.tsx +96 -0
  123. package/src/FilterSelectMenu.test.tsx +23 -0
  124. package/src/GPTChat.test.tsx +696 -0
  125. package/src/GPTChat.tsx +2 -2
  126. package/src/GPTMemoryModal.test.tsx +67 -0
  127. package/src/Heading.tsx +8 -14
  128. package/src/HeightActionSheet.test.tsx +6 -9
  129. package/src/Hyperlink.tsx +5 -18
  130. package/src/Icon.tsx +6 -2
  131. package/src/MarkdownEditor.test.tsx +134 -0
  132. package/src/MarkdownEditorField.test.tsx +124 -0
  133. package/src/MarkdownView.test.tsx +55 -11
  134. package/src/MarkdownView.tsx +149 -150
  135. package/src/MediaQuery.ts +30 -34
  136. package/src/OpenAPIContext.tsx +36 -29
  137. package/src/OpenAPIRenderRegression.test.tsx +200 -0
  138. package/src/P0RenderRegression.test.tsx +214 -0
  139. package/src/P1RenderRegression.test.tsx +141 -0
  140. package/src/P2ButtonRenderRegression.test.tsx +158 -0
  141. package/src/Page.test.tsx +13 -0
  142. package/src/Page.tsx +25 -5
  143. package/src/PickerSelect.test.tsx +38 -0
  144. package/src/PickerSelect.tsx +7 -0
  145. package/src/Popover.test.tsx +151 -0
  146. package/src/Popover.tsx +211 -0
  147. package/src/PortalHost.tsx +12 -6
  148. package/src/ResponsiveBreakpoint.test.tsx +184 -0
  149. package/src/ResponsiveBreakpoint.tsx +195 -0
  150. package/src/RootImportRegression.test.tsx +62 -0
  151. package/src/SplitPage.native.tsx +5 -9
  152. package/src/SplitPage.tsx +16 -19
  153. package/src/TapToEdit.test.tsx +45 -0
  154. package/src/TapToEdit.tsx +23 -18
  155. package/src/TerrenoFontProvider.test.tsx +38 -0
  156. package/src/TerrenoFontProvider.tsx +50 -0
  157. package/src/TerrenoProvider.tsx +6 -1
  158. package/src/Text.tsx +8 -21
  159. package/src/TextFieldNumberActionSheet.test.tsx +100 -0
  160. package/src/TextFieldNumberActionSheet.tsx +11 -2
  161. package/src/Theme.test.tsx +27 -0
  162. package/src/Theme.tsx +15 -10
  163. package/src/Toast.tsx +1 -1
  164. package/src/ToastNotifications.tsx +4 -4
  165. package/src/Tooltip.test.tsx +64 -0
  166. package/src/Tooltip.tsx +18 -4
  167. package/src/Unifier.ts +26 -3
  168. package/src/WebAddressAutocomplete.tsx +6 -2
  169. package/src/__snapshots__/ActionSheet.test.tsx.snap +0 -36
  170. package/src/__snapshots__/AddressField.test.tsx.snap +1 -0
  171. package/src/__snapshots__/AttachmentPreview.test.tsx.snap +225 -0
  172. package/src/__snapshots__/CustomSelectField.test.tsx.snap +7 -0
  173. package/src/__snapshots__/DataTable.test.tsx.snap +793 -250
  174. package/src/__snapshots__/DecimalRangeActionSheet.test.tsx.snap +0 -8
  175. package/src/__snapshots__/EmojiSelector.test.tsx.snap +35555 -30
  176. package/src/__snapshots__/Field.test.tsx.snap +7 -0
  177. package/src/__snapshots__/FilterSelectMenu.test.tsx.snap +1 -0
  178. package/src/__snapshots__/HeightActionSheet.test.tsx.snap +0 -8
  179. package/src/__snapshots__/HeightField.test.tsx.snap +0 -20
  180. package/src/__snapshots__/NumberPickerActionSheet.test.tsx.snap +0 -8
  181. package/src/__snapshots__/Page.test.tsx.snap +13 -1
  182. package/src/__snapshots__/PickerSelect.test.tsx.snap +7 -0
  183. package/src/__snapshots__/SelectField.test.tsx.snap +6 -0
  184. package/src/__snapshots__/TimezonePicker.test.tsx.snap +6 -0
  185. package/src/benchmarks/importGraph.test.ts +71 -0
  186. package/src/benchmarks/importGraph.ts +136 -0
  187. package/src/benchmarks/importTiming.test.ts +42 -0
  188. package/src/benchmarks/importTiming.ts +86 -0
  189. package/src/bunSetup.ts +174 -32
  190. package/src/emojiCategories.test.ts +23 -0
  191. package/src/emojiCategories.ts +46 -0
  192. package/src/index.tsx +27 -13
  193. package/src/lazyBoundaries/createLazyComponentExport.test.tsx +104 -0
  194. package/src/lazyBoundaries/createLazyComponentExport.tsx +63 -0
  195. package/src/lazyBoundaries/heavyOptionalExports.test.tsx +33 -0
  196. package/src/lazyBoundaries/heavyOptionalExports.tsx +106 -0
  197. package/src/login/LoginScreen.test.tsx +9 -2
  198. package/src/login/LoginScreen.tsx +6 -2
  199. package/src/login/loginTypes.ts +2 -0
  200. package/src/table/TableDate.test.tsx +35 -1
  201. package/src/table/__snapshots__/TableBadge.test.tsx.snap +1 -0
@@ -1200,6 +1200,7 @@ exports[`Field renders time field 1`] = `
1200
1200
  "flex": 1,
1201
1201
  "fontFamily": "text",
1202
1202
  "fontSize": 16,
1203
+ "minWidth": 0,
1203
1204
  "paddingRight": 8,
1204
1205
  },
1205
1206
  "testID": "text_input",
@@ -1492,6 +1493,7 @@ exports[`Field renders time field 1`] = `
1492
1493
  "flex": 1,
1493
1494
  "fontFamily": "text",
1494
1495
  "fontSize": 16,
1496
+ "minWidth": 0,
1495
1497
  "paddingRight": 8,
1496
1498
  },
1497
1499
  "testID": "text_input",
@@ -2408,6 +2410,7 @@ exports[`Field renders datetime field 1`] = `
2408
2410
  "flex": 1,
2409
2411
  "fontFamily": "text",
2410
2412
  "fontSize": 16,
2413
+ "minWidth": 0,
2411
2414
  "paddingRight": 8,
2412
2415
  },
2413
2416
  "testID": "text_input",
@@ -2700,6 +2703,7 @@ exports[`Field renders datetime field 1`] = `
2700
2703
  "flex": 1,
2701
2704
  "fontFamily": "text",
2702
2705
  "fontSize": 16,
2706
+ "minWidth": 0,
2703
2707
  "paddingRight": 8,
2704
2708
  },
2705
2709
  "testID": "text_input",
@@ -3262,6 +3266,7 @@ exports[`Field renders select field 1`] = `
3262
3266
  "flex": 1,
3263
3267
  "fontFamily": "text",
3264
3268
  "fontSize": 16,
3269
+ "minWidth": 0,
3265
3270
  "paddingRight": 8,
3266
3271
  },
3267
3272
  "testID": "text_input",
@@ -4192,6 +4197,7 @@ exports[`Field renders address field 1`] = `
4192
4197
  "flex": 1,
4193
4198
  "fontFamily": "text",
4194
4199
  "fontSize": 16,
4200
+ "minWidth": 0,
4195
4201
  "paddingRight": 8,
4196
4202
  },
4197
4203
  "testID": "text_input",
@@ -6596,6 +6602,7 @@ exports[`Field renders customSelect field 1`] = `
6596
6602
  "flex": 1,
6597
6603
  "fontFamily": "text",
6598
6604
  "fontSize": 16,
6605
+ "minWidth": 0,
6599
6606
  "paddingRight": 8,
6600
6607
  },
6601
6608
  "testID": "text_input",
@@ -71,6 +71,7 @@ exports[`FilterSelectMenu renders correctly with default props 1`] = `
71
71
  "style": {
72
72
  "color": "#1C1C1C",
73
73
  "flex": 1,
74
+ "minWidth": 0,
74
75
  },
75
76
  "testID": "text_input",
76
77
  "value": "Please select an option.",
@@ -618,12 +618,8 @@ exports[`HeightActionSheet renders correctly 1`] = `
618
618
  "keyboardShouldPersistTaps": undefined,
619
619
  "onMomentumScrollBegin": [Function: AsyncFunction],
620
620
  "onMomentumScrollEnd": [Function: AsyncFunction],
621
- "onScroll": [Function],
622
621
  "onScrollBeginDrag": [Function: AsyncFunction],
623
622
  "onTouchEnd": [Function],
624
- "ref": {
625
- "current": null,
626
- },
627
623
  "scrollEnabled": false,
628
624
  "scrollEventThrottle": 5,
629
625
  "scrollsToTop": false,
@@ -1313,12 +1309,8 @@ exports[`HeightActionSheet renders with different height value 1`] = `
1313
1309
  "keyboardShouldPersistTaps": undefined,
1314
1310
  "onMomentumScrollBegin": [Function: AsyncFunction],
1315
1311
  "onMomentumScrollEnd": [Function: AsyncFunction],
1316
- "onScroll": [Function],
1317
1312
  "onScrollBeginDrag": [Function: AsyncFunction],
1318
1313
  "onTouchEnd": [Function],
1319
- "ref": {
1320
- "current": null,
1321
- },
1322
1314
  "scrollEnabled": false,
1323
1315
  "scrollEventThrottle": 5,
1324
1316
  "scrollsToTop": false,
@@ -679,12 +679,8 @@ exports[`HeightField snapshots should match snapshot with default props 1`] = `
679
679
  "keyboardShouldPersistTaps": undefined,
680
680
  "onMomentumScrollBegin": [Function: AsyncFunction],
681
681
  "onMomentumScrollEnd": [Function: AsyncFunction],
682
- "onScroll": [Function],
683
682
  "onScrollBeginDrag": [Function: AsyncFunction],
684
683
  "onTouchEnd": [Function],
685
- "ref": {
686
- "current": null,
687
- },
688
684
  "scrollEnabled": false,
689
685
  "scrollEventThrottle": 5,
690
686
  "scrollsToTop": false,
@@ -1445,12 +1441,8 @@ exports[`HeightField snapshots should match snapshot with value 1`] = `
1445
1441
  "keyboardShouldPersistTaps": undefined,
1446
1442
  "onMomentumScrollBegin": [Function: AsyncFunction],
1447
1443
  "onMomentumScrollEnd": [Function: AsyncFunction],
1448
- "onScroll": [Function],
1449
1444
  "onScrollBeginDrag": [Function: AsyncFunction],
1450
1445
  "onTouchEnd": [Function],
1451
- "ref": {
1452
- "current": null,
1453
- },
1454
1446
  "scrollEnabled": false,
1455
1447
  "scrollEventThrottle": 5,
1456
1448
  "scrollsToTop": false,
@@ -2311,12 +2303,8 @@ exports[`HeightField snapshots should match snapshot with all props 1`] = `
2311
2303
  "keyboardShouldPersistTaps": undefined,
2312
2304
  "onMomentumScrollBegin": [Function: AsyncFunction],
2313
2305
  "onMomentumScrollEnd": [Function: AsyncFunction],
2314
- "onScroll": [Function],
2315
2306
  "onScrollBeginDrag": [Function: AsyncFunction],
2316
2307
  "onTouchEnd": [Function],
2317
- "ref": {
2318
- "current": null,
2319
- },
2320
2308
  "scrollEnabled": false,
2321
2309
  "scrollEventThrottle": 5,
2322
2310
  "scrollsToTop": false,
@@ -3109,12 +3097,8 @@ exports[`HeightField snapshots should match snapshot when disabled 1`] = `
3109
3097
  "keyboardShouldPersistTaps": undefined,
3110
3098
  "onMomentumScrollBegin": [Function: AsyncFunction],
3111
3099
  "onMomentumScrollEnd": [Function: AsyncFunction],
3112
- "onScroll": [Function],
3113
3100
  "onScrollBeginDrag": [Function: AsyncFunction],
3114
3101
  "onTouchEnd": [Function],
3115
- "ref": {
3116
- "current": null,
3117
- },
3118
3102
  "scrollEnabled": false,
3119
3103
  "scrollEventThrottle": 5,
3120
3104
  "scrollsToTop": false,
@@ -3946,12 +3930,8 @@ exports[`HeightField snapshots should match snapshot with error state 1`] = `
3946
3930
  "keyboardShouldPersistTaps": undefined,
3947
3931
  "onMomentumScrollBegin": [Function: AsyncFunction],
3948
3932
  "onMomentumScrollEnd": [Function: AsyncFunction],
3949
- "onScroll": [Function],
3950
3933
  "onScrollBeginDrag": [Function: AsyncFunction],
3951
3934
  "onTouchEnd": [Function],
3952
- "ref": {
3953
- "current": null,
3954
- },
3955
3935
  "scrollEnabled": false,
3956
3936
  "scrollEventThrottle": 5,
3957
3937
  "scrollsToTop": false,
@@ -1256,12 +1256,8 @@ exports[`NumberPickerActionSheet renders correctly 1`] = `
1256
1256
  "keyboardShouldPersistTaps": undefined,
1257
1257
  "onMomentumScrollBegin": [Function: AsyncFunction],
1258
1258
  "onMomentumScrollEnd": [Function: AsyncFunction],
1259
- "onScroll": [Function],
1260
1259
  "onScrollBeginDrag": [Function: AsyncFunction],
1261
1260
  "onTouchEnd": [Function],
1262
- "ref": {
1263
- "current": null,
1264
- },
1265
1261
  "scrollEnabled": false,
1266
1262
  "scrollEventThrottle": 5,
1267
1263
  "scrollsToTop": false,
@@ -5289,12 +5285,8 @@ exports[`NumberPickerActionSheet renders with different range 1`] = `
5289
5285
  "keyboardShouldPersistTaps": undefined,
5290
5286
  "onMomentumScrollBegin": [Function: AsyncFunction],
5291
5287
  "onMomentumScrollEnd": [Function: AsyncFunction],
5292
- "onScroll": [Function],
5293
5288
  "onScrollBeginDrag": [Function: AsyncFunction],
5294
5289
  "onTouchEnd": [Function],
5295
- "ref": {
5296
- "current": null,
5297
- },
5298
5290
  "scrollEnabled": false,
5299
5291
  "scrollEventThrottle": 5,
5300
5292
  "scrollsToTop": false,
@@ -159,6 +159,7 @@ exports[`Page renders with title 1`] = `
159
159
  "flexGrow": 1,
160
160
  "flexShrink": 1,
161
161
  "justifyContent": "center",
162
+ "pointerEvents": "box-none",
162
163
  },
163
164
  "testID": undefined,
164
165
  },
@@ -172,6 +173,7 @@ exports[`Page renders with title 1`] = `
172
173
  "display": "flex",
173
174
  "flex": undefined,
174
175
  "flexDirection": "row",
176
+ "position": "relative",
175
177
  "width": "100%",
176
178
  },
177
179
  "testID": undefined,
@@ -312,7 +314,7 @@ exports[`Page renders with back button 1`] = `
312
314
  ],
313
315
  "props": {
314
316
  "accessibilityHint": "Navigate back",
315
- "accessibilityLabel": "",
317
+ "accessibilityLabel": "Back",
316
318
  "onPress": [Function],
317
319
  "testID": "icon-button-chevron-left",
318
320
  },
@@ -328,7 +330,11 @@ exports[`Page renders with back button 1`] = `
328
330
  "flexDirection": "row",
329
331
  "justifyContent": "center",
330
332
  "paddingBottom": 12,
333
+ "paddingLeft": 16,
334
+ "paddingRight": 16,
331
335
  "paddingTop": 12,
336
+ "position": "relative",
337
+ "zIndex": 1,
332
338
  },
333
339
  "testID": undefined,
334
340
  },
@@ -365,6 +371,7 @@ exports[`Page renders with back button 1`] = `
365
371
  "flexGrow": 1,
366
372
  "flexShrink": 1,
367
373
  "justifyContent": "center",
374
+ "pointerEvents": "box-none",
368
375
  },
369
376
  "testID": undefined,
370
377
  },
@@ -378,6 +385,7 @@ exports[`Page renders with back button 1`] = `
378
385
  "display": "flex",
379
386
  "flex": undefined,
380
387
  "flexDirection": "row",
388
+ "position": "relative",
381
389
  "width": "100%",
382
390
  },
383
391
  "testID": undefined,
@@ -571,6 +579,7 @@ exports[`Page renders with close button 1`] = `
571
579
  "flexGrow": 1,
572
580
  "flexShrink": 1,
573
581
  "justifyContent": "center",
582
+ "pointerEvents": "box-none",
574
583
  },
575
584
  "testID": undefined,
576
585
  },
@@ -584,6 +593,7 @@ exports[`Page renders with close button 1`] = `
584
593
  "display": "flex",
585
594
  "flex": undefined,
586
595
  "flexDirection": "row",
596
+ "position": "relative",
587
597
  "width": "100%",
588
598
  },
589
599
  "testID": undefined,
@@ -736,6 +746,7 @@ exports[`Page renders with right button 1`] = `
736
746
  "flexGrow": 1,
737
747
  "flexShrink": 1,
738
748
  "justifyContent": "center",
749
+ "pointerEvents": "box-none",
739
750
  },
740
751
  "testID": undefined,
741
752
  },
@@ -837,6 +848,7 @@ exports[`Page renders with right button 1`] = `
837
848
  "display": "flex",
838
849
  "flex": undefined,
839
850
  "flexDirection": "row",
851
+ "position": "relative",
840
852
  "width": "100%",
841
853
  },
842
854
  "testID": undefined,
@@ -19,6 +19,7 @@ exports[`PickerSelect renders correctly with default props 1`] = `
19
19
  "style": {
20
20
  "color": "#1C1C1C",
21
21
  "flex": 1,
22
+ "minWidth": 0,
22
23
  },
23
24
  "testID": "text_input",
24
25
  "value": "Select an option",
@@ -287,6 +288,7 @@ exports[`PickerSelect renders with selected value 1`] = `
287
288
  "style": {
288
289
  "color": "#1C1C1C",
289
290
  "flex": 1,
291
+ "minWidth": 0,
290
292
  },
291
293
  "testID": "text_input",
292
294
  "value": "Option 2",
@@ -555,6 +557,7 @@ exports[`PickerSelect renders disabled state 1`] = `
555
557
  "style": {
556
558
  "color": "#686868",
557
559
  "flex": 1,
560
+ "minWidth": 0,
558
561
  },
559
562
  "testID": "text_input",
560
563
  "value": "Select an option",
@@ -825,6 +828,7 @@ exports[`PickerSelect renders without placeholder when placeholder is empty obje
825
828
  "style": {
826
829
  "color": "#1C1C1C",
827
830
  "flex": 1,
831
+ "minWidth": 0,
828
832
  },
829
833
  "testID": "text_input",
830
834
  "value": "Option 1",
@@ -1083,6 +1087,7 @@ exports[`PickerSelect matches items by itemKey 1`] = `
1083
1087
  "style": {
1084
1088
  "color": "#1C1C1C",
1085
1089
  "flex": 1,
1090
+ "minWidth": 0,
1086
1091
  },
1087
1092
  "testID": "text_input",
1088
1093
  "value": "Option 2",
@@ -1341,6 +1346,7 @@ exports[`PickerSelect renders custom InputAccessoryView 1`] = `
1341
1346
  "style": {
1342
1347
  "color": "#1C1C1C",
1343
1348
  "flex": 1,
1349
+ "minWidth": 0,
1344
1350
  },
1345
1351
  "testID": "text_input",
1346
1352
  "value": "Select an option",
@@ -1530,6 +1536,7 @@ exports[`PickerSelect passes textInputProps to TextInput 1`] = `
1530
1536
  "style": {
1531
1537
  "color": "#1C1C1C",
1532
1538
  "flex": 1,
1539
+ "minWidth": 0,
1533
1540
  },
1534
1541
  "testID": "text_input",
1535
1542
  "value": "Option 1",
@@ -25,6 +25,7 @@ exports[`SelectField renders correctly with default props 1`] = `
25
25
  "flex": 1,
26
26
  "fontFamily": "text",
27
27
  "fontSize": 16,
28
+ "minWidth": 0,
28
29
  "paddingRight": 8,
29
30
  },
30
31
  "testID": "text_input",
@@ -393,6 +394,7 @@ exports[`SelectField renders with title 1`] = `
393
394
  "flex": 1,
394
395
  "fontFamily": "text",
395
396
  "fontSize": 16,
397
+ "minWidth": 0,
396
398
  "paddingRight": 8,
397
399
  },
398
400
  "testID": "text_input",
@@ -746,6 +748,7 @@ exports[`SelectField renders with selected value 1`] = `
746
748
  "flex": 1,
747
749
  "fontFamily": "text",
748
750
  "fontSize": 16,
751
+ "minWidth": 0,
749
752
  "paddingRight": 8,
750
753
  },
751
754
  "testID": "text_input",
@@ -1099,6 +1102,7 @@ exports[`SelectField renders with custom placeholder 1`] = `
1099
1102
  "flex": 1,
1100
1103
  "fontFamily": "text",
1101
1104
  "fontSize": 16,
1105
+ "minWidth": 0,
1102
1106
  "paddingRight": 8,
1103
1107
  },
1104
1108
  "testID": "text_input",
@@ -1452,6 +1456,7 @@ exports[`SelectField renders disabled state 1`] = `
1452
1456
  "flex": 1,
1453
1457
  "fontFamily": "text",
1454
1458
  "fontSize": 16,
1459
+ "minWidth": 0,
1455
1460
  "paddingRight": 8,
1456
1461
  },
1457
1462
  "testID": "text_input",
@@ -1807,6 +1812,7 @@ exports[`SelectField renders with requireValue (no clear option) 1`] = `
1807
1812
  "flex": 1,
1808
1813
  "fontFamily": "text",
1809
1814
  "fontSize": 16,
1815
+ "minWidth": 0,
1810
1816
  "paddingRight": 8,
1811
1817
  },
1812
1818
  "testID": "text_input",
@@ -40,6 +40,7 @@ exports[`TimezonePicker renders correctly with default props 1`] = `
40
40
  "flex": 1,
41
41
  "fontFamily": "text",
42
42
  "fontSize": 16,
43
+ "minWidth": 0,
43
44
  "paddingRight": 8,
44
45
  },
45
46
  "testID": "text_input",
@@ -545,6 +546,7 @@ exports[`TimezonePicker hides title when hideTitle is true 1`] = `
545
546
  "flex": 1,
546
547
  "fontFamily": "text",
547
548
  "fontSize": 16,
549
+ "minWidth": 0,
548
550
  "paddingRight": 8,
549
551
  },
550
552
  "testID": "text_input",
@@ -1065,6 +1067,7 @@ exports[`TimezonePicker renders with selected timezone 1`] = `
1065
1067
  "flex": 1,
1066
1068
  "fontFamily": "text",
1067
1069
  "fontSize": 16,
1070
+ "minWidth": 0,
1068
1071
  "paddingRight": 8,
1069
1072
  },
1070
1073
  "testID": "text_input",
@@ -1585,6 +1588,7 @@ exports[`TimezonePicker renders USA timezones by default 1`] = `
1585
1588
  "flex": 1,
1586
1589
  "fontFamily": "text",
1587
1590
  "fontSize": 16,
1591
+ "minWidth": 0,
1588
1592
  "paddingRight": 8,
1589
1593
  },
1590
1594
  "testID": "text_input",
@@ -2105,6 +2109,7 @@ exports[`TimezonePicker renders with short timezone labels 1`] = `
2105
2109
  "flex": 1,
2106
2110
  "fontFamily": "text",
2107
2111
  "fontSize": 16,
2112
+ "minWidth": 0,
2108
2113
  "paddingRight": 8,
2109
2114
  },
2110
2115
  "testID": "text_input",
@@ -2625,6 +2630,7 @@ exports[`TimezonePicker calls onChange when timezone is selected 1`] = `
2625
2630
  "flex": 1,
2626
2631
  "fontFamily": "text",
2627
2632
  "fontSize": 16,
2633
+ "minWidth": 0,
2628
2634
  "paddingRight": 8,
2629
2635
  },
2630
2636
  "testID": "text_input",
@@ -0,0 +1,71 @@
1
+ import {describe, expect, it} from "bun:test";
2
+ import {mkdirSync, unlinkSync, writeFileSync} from "node:fs";
3
+ import {tmpdir} from "node:os";
4
+ import {join, resolve} from "node:path";
5
+
6
+ import {diffImportGraphs, measureImportGraph, resolvePackageEntry} from "./importGraph";
7
+
8
+ describe("importGraph", () => {
9
+ it("resolves the root package entry", () => {
10
+ expect(resolvePackageEntry("@terreno/ui")).toContain("index.tsx");
11
+ });
12
+
13
+ it("resolves a component subpath entry", () => {
14
+ expect(resolvePackageEntry("@terreno/ui/Button")).toContain("Button.tsx");
15
+ });
16
+
17
+ it("resolves a TypeScript subpath entry", () => {
18
+ expect(resolvePackageEntry("@terreno/ui/emojiCategories")).toContain("emojiCategories.ts");
19
+ });
20
+
21
+ it("rejects unsupported import paths", () => {
22
+ expect(() => resolvePackageEntry("@terreno/not-ui")).toThrow(/Unsupported import path/);
23
+ });
24
+
25
+ it("measures a bounded import graph for Button", () => {
26
+ const graph = measureImportGraph(resolvePackageEntry("@terreno/ui/Button"));
27
+
28
+ expect(graph.moduleCount).toBeGreaterThan(0);
29
+ expect(graph.outputBytes).toBeGreaterThan(0);
30
+ expect(graph.modulePaths).toContain(resolvePackageEntry("@terreno/ui/Button"));
31
+ });
32
+
33
+ it("returns modules present only in the baseline graph", () => {
34
+ expect(
35
+ diffImportGraphs({
36
+ baselinePaths: ["src/Button.tsx", "src/Box.tsx"],
37
+ comparisonPaths: ["src/Button.tsx"],
38
+ })
39
+ ).toEqual(["src/Box.tsx"]);
40
+ });
41
+
42
+ it("ignores missing relative imports", () => {
43
+ const tmp = join(tmpdir(), `import-graph-missing-${Date.now()}.ts`);
44
+ writeFileSync(tmp, 'import {missing} from "./definitely-missing-mod";\nexport const ok = 1;\n');
45
+ try {
46
+ const graph = measureImportGraph(tmp);
47
+ expect(graph.moduleCount).toBe(1);
48
+ expect(graph.modulePaths).toEqual([tmp]);
49
+ } finally {
50
+ unlinkSync(tmp);
51
+ }
52
+ });
53
+
54
+ it("skips unreadable entry files", () => {
55
+ const graph = measureImportGraph(import.meta.dir);
56
+ expect(graph.moduleCount).toBe(1);
57
+ expect(graph.entryFile).toBe(import.meta.dir);
58
+ });
59
+
60
+ it("resolves a dist-only subpath", () => {
61
+ const distRoot = resolve(import.meta.dir, "../../dist");
62
+ mkdirSync(distRoot, {recursive: true});
63
+ const distFile = join(distRoot, "newFileCoverageStub.js");
64
+ writeFileSync(distFile, "export const stub = true;\n");
65
+ try {
66
+ expect(resolvePackageEntry("@terreno/ui/newFileCoverageStub")).toBe(distFile);
67
+ } finally {
68
+ unlinkSync(distFile);
69
+ }
70
+ });
71
+ });
@@ -0,0 +1,136 @@
1
+ import {existsSync, readFileSync, statSync} from "node:fs";
2
+ import {dirname, join, resolve} from "node:path";
3
+
4
+ const SRC_ROOT = resolve(import.meta.dir, "..");
5
+ const DIST_ROOT = resolve(import.meta.dir, "../../dist");
6
+
7
+ const SOURCE_EXTENSIONS = [".tsx", ".ts", ".jsx", ".js"];
8
+
9
+ const resolveRelativeModule = (fromFile: string, specifier: string): string | null => {
10
+ if (!specifier.startsWith(".")) {
11
+ return null;
12
+ }
13
+
14
+ const basePath = resolve(dirname(fromFile), specifier);
15
+ const candidates = [
16
+ basePath,
17
+ ...SOURCE_EXTENSIONS.map((extension) => `${basePath}${extension}`),
18
+ ...SOURCE_EXTENSIONS.map((extension) => join(basePath, `index${extension}`)),
19
+ ];
20
+
21
+ for (const candidate of candidates) {
22
+ if (existsSync(candidate)) {
23
+ return candidate;
24
+ }
25
+ }
26
+
27
+ return null;
28
+ };
29
+
30
+ const collectSpecifiers = (source: string): string[] => {
31
+ const specifiers: string[] = [];
32
+ const patterns = [
33
+ /^\s*import\s+(?!type\b)[\s\S]*?\sfrom\s+["']([^"']+)["']/gm,
34
+ /^\s*export\s+\*\s+from\s+["']([^"']+)["']/gm,
35
+ /^\s*export\s+\{[^}]+\}\s+from\s+["']([^"']+)["']/gm,
36
+ /^\s*export\s+\{default\s+as\s+\w+\}\s+from\s+["']([^"']+)["']/gm,
37
+ ];
38
+
39
+ for (const pattern of patterns) {
40
+ for (const match of source.matchAll(pattern)) {
41
+ const specifier = match[1];
42
+ if (specifier) {
43
+ specifiers.push(specifier);
44
+ }
45
+ }
46
+ }
47
+
48
+ return specifiers;
49
+ };
50
+
51
+ const walkModuleGraph = ({entryFile, visited}: {entryFile: string; visited: Set<string>}): void => {
52
+ if (visited.has(entryFile)) {
53
+ return;
54
+ }
55
+
56
+ visited.add(entryFile);
57
+
58
+ let source = "";
59
+ try {
60
+ source = readFileSync(entryFile, "utf8");
61
+ } catch {
62
+ return;
63
+ }
64
+
65
+ for (const specifier of collectSpecifiers(source)) {
66
+ const resolved = resolveRelativeModule(entryFile, specifier);
67
+ if (resolved) {
68
+ walkModuleGraph({entryFile: resolved, visited});
69
+ }
70
+ }
71
+ };
72
+
73
+ export interface ImportGraphMeasurement {
74
+ entryFile: string;
75
+ moduleCount: number;
76
+ modulePaths: string[];
77
+ outputBytes: number;
78
+ }
79
+
80
+ export const measureImportGraph = (entryFile: string): ImportGraphMeasurement => {
81
+ const visited = new Set<string>();
82
+ walkModuleGraph({entryFile, visited});
83
+
84
+ const modulePaths = [...visited].sort();
85
+ const outputBytes = modulePaths.reduce((total, modulePath) => {
86
+ try {
87
+ return total + statSync(modulePath).size;
88
+ } catch {
89
+ return total;
90
+ }
91
+ }, 0);
92
+
93
+ return {
94
+ entryFile,
95
+ moduleCount: modulePaths.length,
96
+ modulePaths,
97
+ outputBytes,
98
+ };
99
+ };
100
+
101
+ export const resolvePackageEntry = (importPath: string): string => {
102
+ if (importPath === "@terreno/ui") {
103
+ return join(SRC_ROOT, "index.tsx");
104
+ }
105
+
106
+ if (importPath.startsWith("@terreno/ui/")) {
107
+ const moduleName = importPath.slice("@terreno/ui/".length);
108
+ const srcCandidate = join(SRC_ROOT, `${moduleName}.tsx`);
109
+ if (existsSync(srcCandidate)) {
110
+ return srcCandidate;
111
+ }
112
+
113
+ const tsCandidate = join(SRC_ROOT, `${moduleName}.ts`);
114
+ if (existsSync(tsCandidate)) {
115
+ return tsCandidate;
116
+ }
117
+
118
+ const distCandidate = join(DIST_ROOT, `${moduleName}.js`);
119
+ if (existsSync(distCandidate)) {
120
+ return distCandidate;
121
+ }
122
+ }
123
+
124
+ throw new Error(`Unsupported import path for graph measurement: ${importPath}`);
125
+ };
126
+
127
+ export const diffImportGraphs = ({
128
+ baselinePaths,
129
+ comparisonPaths,
130
+ }: {
131
+ baselinePaths: string[];
132
+ comparisonPaths: string[];
133
+ }): string[] => {
134
+ const comparisonSet = new Set(comparisonPaths);
135
+ return baselinePaths.filter((modulePath) => !comparisonSet.has(modulePath));
136
+ };
@@ -0,0 +1,42 @@
1
+ import {describe, expect, it} from "bun:test";
2
+ import {existsSync, readdirSync} from "node:fs";
3
+ import {resolve} from "node:path";
4
+
5
+ import {compareBenchmarkSamples, measureFreshImportTiming} from "./importTiming";
6
+
7
+ const UI_PACKAGE_ROOT = resolve(import.meta.dir, "../..");
8
+ const leftoverProbePath = resolve(UI_PACKAGE_ROOT, "src/benchmarks/.fresh-import-probe.ts");
9
+
10
+ describe("importTiming", () => {
11
+ it("sorts benchmark samples for median timing", () => {
12
+ expect(compareBenchmarkSamples(2, 1)).toBe(1);
13
+ });
14
+
15
+ it("throws when the fresh import probe fails", () => {
16
+ expect(() =>
17
+ measureFreshImportTiming({
18
+ importPath: "../__definitely-missing-module__",
19
+ sampleCount: 1,
20
+ warmupCount: 0,
21
+ })
22
+ ).toThrow(/Fresh import probe failed/);
23
+ });
24
+
25
+ it("measures fresh-process import timing for a small subpath", () => {
26
+ const timing = measureFreshImportTiming({
27
+ importPath: "../Button",
28
+ sampleCount: 1,
29
+ warmupCount: 1,
30
+ });
31
+
32
+ expect(timing.importPath).toBe("../Button");
33
+ expect(timing.samplesMs).toHaveLength(1);
34
+ expect(timing.elapsedMs).toBeGreaterThan(0);
35
+ expect(existsSync(leftoverProbePath)).toBe(false);
36
+ expect(
37
+ readdirSync(resolve(UI_PACKAGE_ROOT, "src/benchmarks")).some((name) =>
38
+ name.includes("fresh-import-probe")
39
+ )
40
+ ).toBe(false);
41
+ }, 120_000);
42
+ });