ferns-ui 1.16.1 → 2.0.0-beta.2

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 (184) hide show
  1. package/dist/Accordion.js +2 -7
  2. package/dist/Accordion.js.map +1 -1
  3. package/dist/ActionSheet.js +11 -14
  4. package/dist/ActionSheet.js.map +1 -1
  5. package/dist/AddressField.js +1 -1
  6. package/dist/AddressField.js.map +1 -1
  7. package/dist/Badge.js +1 -1
  8. package/dist/Badge.js.map +1 -1
  9. package/dist/Banner.js +1 -1
  10. package/dist/Banner.js.map +1 -1
  11. package/dist/Box.js +3 -3
  12. package/dist/Box.js.map +1 -1
  13. package/dist/Button.js +1 -0
  14. package/dist/Button.js.map +1 -1
  15. package/dist/CheckBox.js.map +1 -1
  16. package/dist/Common.d.ts +9 -13
  17. package/dist/Common.js.map +1 -1
  18. package/dist/DataTable.js +2 -1
  19. package/dist/DataTable.js.map +1 -1
  20. package/dist/DateTimeField.js +22 -22
  21. package/dist/DateTimeField.js.map +1 -1
  22. package/dist/EmailField.js +37 -17
  23. package/dist/EmailField.js.map +1 -1
  24. package/dist/ErrorBoundary.d.ts +1 -1
  25. package/dist/FernsProvider.js +1 -1
  26. package/dist/FernsProvider.js.map +1 -1
  27. package/dist/Heading.js +1 -3
  28. package/dist/Heading.js.map +1 -1
  29. package/dist/Hyperlink.js +1 -1
  30. package/dist/Hyperlink.js.map +1 -1
  31. package/dist/IconButton.js +1 -1
  32. package/dist/IconButton.js.map +1 -1
  33. package/dist/Image.js.map +1 -1
  34. package/dist/MobileAddressAutoComplete.js +1 -1
  35. package/dist/MobileAddressAutoComplete.js.map +1 -1
  36. package/dist/Modal.d.ts +1 -1
  37. package/dist/Modal.js +15 -35
  38. package/dist/Modal.js.map +1 -1
  39. package/dist/ModalSheet.d.ts +1 -1
  40. package/dist/ModalSheet.js +1 -1
  41. package/dist/ModalSheet.js.map +1 -1
  42. package/dist/NumberField.js +4 -10
  43. package/dist/NumberField.js.map +1 -1
  44. package/dist/NumberPickerActionSheet.d.ts +3 -1
  45. package/dist/NumberPickerActionSheet.js +3 -0
  46. package/dist/NumberPickerActionSheet.js.map +1 -1
  47. package/dist/Page.js +1 -1
  48. package/dist/Page.js.map +1 -1
  49. package/dist/Pagination.js +2 -2
  50. package/dist/Pagination.js.map +1 -1
  51. package/dist/Permissions.d.ts +1 -1
  52. package/dist/Permissions.js +2 -2
  53. package/dist/Permissions.js.map +1 -1
  54. package/dist/PickerSelect.js +1 -1
  55. package/dist/PickerSelect.js.map +1 -1
  56. package/dist/SectionDivider.js +1 -1
  57. package/dist/SectionDivider.js.map +1 -1
  58. package/dist/SegmentedControl.js.map +1 -1
  59. package/dist/Signature.native.js +2 -2
  60. package/dist/Signature.native.js.map +1 -1
  61. package/dist/SignatureField.js +2 -2
  62. package/dist/SignatureField.js.map +1 -1
  63. package/dist/Slider.js +3 -3
  64. package/dist/Slider.js.map +1 -1
  65. package/dist/SplitPage.js +7 -7
  66. package/dist/SplitPage.js.map +1 -1
  67. package/dist/SplitPage.native.js +6 -4
  68. package/dist/SplitPage.native.js.map +1 -1
  69. package/dist/TapToEdit.js +3 -3
  70. package/dist/TapToEdit.js.map +1 -1
  71. package/dist/Text.js +1 -1
  72. package/dist/Text.js.map +1 -1
  73. package/dist/TextFieldNumberActionSheet.d.ts +4 -2
  74. package/dist/TextFieldNumberActionSheet.js +4 -1
  75. package/dist/TextFieldNumberActionSheet.js.map +1 -1
  76. package/dist/Tooltip.js +21 -39
  77. package/dist/Tooltip.js.map +1 -1
  78. package/dist/Unifier.d.ts +1 -0
  79. package/dist/Unifier.js.map +1 -1
  80. package/dist/Utilities.d.ts +1 -1
  81. package/dist/Utilities.js +3 -2
  82. package/dist/Utilities.js.map +1 -1
  83. package/dist/WebAddressAutocomplete.js +1 -2
  84. package/dist/WebAddressAutocomplete.js.map +1 -1
  85. package/dist/index.d.ts +10 -10
  86. package/dist/index.js +9 -10
  87. package/dist/index.js.map +1 -1
  88. package/dist/jestSetup.d.ts +0 -0
  89. package/dist/jestSetup.js +21 -0
  90. package/dist/jestSetup.js.map +1 -0
  91. package/dist/setupTests.js +22 -0
  92. package/dist/setupTests.js.map +1 -1
  93. package/dist/table/Table.js +15 -14
  94. package/dist/table/Table.js.map +1 -1
  95. package/dist/table/TableHeaderCell.js +2 -2
  96. package/dist/table/TableHeaderCell.js.map +1 -1
  97. package/dist/test-utils.d.ts +4 -1
  98. package/dist/useStoredState.js +2 -4
  99. package/dist/useStoredState.js.map +1 -1
  100. package/package.json +106 -43
  101. package/src/Accordion.tsx +1 -7
  102. package/src/ActionSheet.tsx +22 -26
  103. package/src/AddressField.tsx +1 -1
  104. package/src/Avatar.test.tsx +0 -2
  105. package/src/Badge.tsx +1 -1
  106. package/src/Banner.tsx +1 -1
  107. package/src/Box.test.tsx +70 -71
  108. package/src/Box.tsx +9 -21
  109. package/src/Button.tsx +1 -0
  110. package/src/CheckBox.tsx +1 -7
  111. package/src/Common.ts +21 -14
  112. package/src/DataTable.tsx +4 -3
  113. package/src/DateTimeField.tsx +22 -22
  114. package/src/EmailField.tsx +42 -22
  115. package/src/FernsProvider.tsx +4 -1
  116. package/src/Heading.tsx +1 -3
  117. package/src/Hyperlink.tsx +2 -2
  118. package/src/IconButton.tsx +2 -2
  119. package/src/Image.tsx +0 -1
  120. package/src/MobileAddressAutoComplete.tsx +1 -1
  121. package/src/Modal.tsx +21 -58
  122. package/src/ModalSheet.tsx +1 -1
  123. package/src/NumberField.tsx +4 -10
  124. package/src/NumberPickerActionSheet.tsx +5 -1
  125. package/src/Page.tsx +1 -1
  126. package/src/Pagination.tsx +11 -2
  127. package/src/Permissions.ts +2 -2
  128. package/src/PickerSelect.tsx +1 -1
  129. package/src/SectionDivider.tsx +1 -1
  130. package/src/SegmentedControl.tsx +1 -3
  131. package/src/Signature.native.tsx +2 -2
  132. package/src/SignatureField.tsx +2 -2
  133. package/src/Slider.tsx +17 -10
  134. package/src/SplitPage.native.tsx +4 -2
  135. package/src/SplitPage.tsx +4 -4
  136. package/src/TapToEdit.tsx +7 -3
  137. package/src/Text.tsx +1 -1
  138. package/src/TextArea.test.tsx +43 -27
  139. package/src/TextField.test.tsx +4 -3
  140. package/src/TextFieldNumberActionSheet.tsx +7 -3
  141. package/src/Tooltip.tsx +29 -45
  142. package/src/Unifier.ts +3 -1
  143. package/src/Utilities.tsx +4 -3
  144. package/src/WebAddressAutocomplete.tsx +1 -1
  145. package/src/index.tsx +10 -11
  146. package/src/jestSetup.ts +16 -0
  147. package/src/setupTests.ts +24 -0
  148. package/src/table/Table.tsx +38 -36
  149. package/src/table/TableHeaderCell.tsx +2 -2
  150. package/src/useStoredState.ts +11 -13
  151. package/dist/Accordion.test.d.ts +0 -1
  152. package/dist/Accordion.test.js +0 -71
  153. package/dist/Accordion.test.js.map +0 -1
  154. package/dist/AddressField.test.d.ts +0 -1
  155. package/dist/AddressField.test.js +0 -65
  156. package/dist/AddressField.test.js.map +0 -1
  157. package/dist/Avatar.test.d.ts +0 -1
  158. package/dist/Avatar.test.js +0 -131
  159. package/dist/Avatar.test.js.map +0 -1
  160. package/dist/Badge.test.d.ts +0 -1
  161. package/dist/Badge.test.js +0 -76
  162. package/dist/Badge.test.js.map +0 -1
  163. package/dist/Box.test.d.ts +0 -1
  164. package/dist/Box.test.js +0 -528
  165. package/dist/Box.test.js.map +0 -1
  166. package/dist/DateTimeField.test.d.ts +0 -1
  167. package/dist/DateTimeField.test.js +0 -258
  168. package/dist/DateTimeField.test.js.map +0 -1
  169. package/dist/DateUtilities.test.d.ts +0 -1
  170. package/dist/DateUtilities.test.js +0 -279
  171. package/dist/DateUtilities.test.js.map +0 -1
  172. package/dist/MarkdownView.d.ts +0 -5
  173. package/dist/MarkdownView.js +0 -44
  174. package/dist/MarkdownView.js.map +0 -1
  175. package/dist/TextArea.test.d.ts +0 -1
  176. package/dist/TextArea.test.js +0 -146
  177. package/dist/TextArea.test.js.map +0 -1
  178. package/dist/TextField.test.d.ts +0 -1
  179. package/dist/TextField.test.js +0 -251
  180. package/dist/TextField.test.js.map +0 -1
  181. package/dist/useStoredState.test.d.ts +0 -1
  182. package/dist/useStoredState.test.js +0 -93
  183. package/dist/useStoredState.test.js.map +0 -1
  184. package/src/MarkdownView.tsx +0 -67
package/src/Badge.tsx CHANGED
@@ -77,7 +77,7 @@ export const Badge = ({
77
77
  let badgeValue = value;
78
78
 
79
79
  if (variant === "numberOnly") {
80
- if (!Number.isNaN(Number(value)) && maxValue) {
80
+ if (!isNaN(Number(value)) && maxValue) {
81
81
  const numberValue = Number(value);
82
82
  if (numberValue > maxValue) {
83
83
  badgeValue = `${maxValue}+`;
package/src/Banner.tsx CHANGED
@@ -1,6 +1,6 @@
1
1
  import debounce from "lodash/debounce";
2
2
  import React, {useEffect, useState} from "react";
3
- import {ActivityIndicator, Text as NativeText, Pressable, View} from "react-native";
3
+ import {ActivityIndicator, Pressable, Text as NativeText, View} from "react-native";
4
4
 
5
5
  import {Box} from "./Box";
6
6
  import {BannerProps, IconName, SurfaceTheme} from "./Common";
package/src/Box.test.tsx CHANGED
@@ -38,7 +38,7 @@ describe("Box", () => {
38
38
  const view = root.findByType("View");
39
39
  expect(view.props.style).toMatchObject({
40
40
  flexDirection: "column",
41
- display: "flex",
41
+ display: "flex"
42
42
  });
43
43
  });
44
44
 
@@ -53,7 +53,7 @@ describe("Box", () => {
53
53
  expect(view.props.style).toMatchObject({
54
54
  flexGrow: 1,
55
55
  flexShrink: 1,
56
- display: "flex",
56
+ display: "flex"
57
57
  });
58
58
  });
59
59
 
@@ -62,7 +62,7 @@ describe("Box", () => {
62
62
  const view = root.findByType("View");
63
63
  expect(view.props.style).toMatchObject({
64
64
  flexShrink: 1,
65
- display: "flex",
65
+ display: "flex"
66
66
  });
67
67
  });
68
68
 
@@ -71,7 +71,7 @@ describe("Box", () => {
71
71
  const view = root.findByType("View");
72
72
  expect(view.props.style).toMatchObject({
73
73
  flex: 0,
74
- display: "flex",
74
+ display: "flex"
75
75
  });
76
76
  });
77
77
 
@@ -79,7 +79,7 @@ describe("Box", () => {
79
79
  const {root} = renderWithTheme(<Box justifyContent="center" />);
80
80
  const view = root.findByType("View");
81
81
  expect(view.props.style).toMatchObject({
82
- justifyContent: "center",
82
+ justifyContent: "center"
83
83
  });
84
84
  });
85
85
 
@@ -87,7 +87,7 @@ describe("Box", () => {
87
87
  const {root} = renderWithTheme(<Box alignItems="center" />);
88
88
  const view = root.findByType("View");
89
89
  expect(view.props.style).toMatchObject({
90
- alignItems: "center",
90
+ alignItems: "center"
91
91
  });
92
92
  });
93
93
 
@@ -95,7 +95,7 @@ describe("Box", () => {
95
95
  const {root} = renderWithTheme(<Box alignContent="center" />);
96
96
  const view = root.findByType("View");
97
97
  expect(view.props.style).toMatchObject({
98
- alignContent: "center",
98
+ alignContent: "center"
99
99
  });
100
100
  });
101
101
 
@@ -103,7 +103,7 @@ describe("Box", () => {
103
103
  const {root} = renderWithTheme(<Box alignSelf="center" />);
104
104
  const view = root.findByType("View");
105
105
  expect(view.props.style).toMatchObject({
106
- alignSelf: "center",
106
+ alignSelf: "center"
107
107
  });
108
108
  });
109
109
 
@@ -112,7 +112,7 @@ describe("Box", () => {
112
112
  const view = root.findByType("View");
113
113
  expect(view.props.style).toMatchObject({
114
114
  flexWrap: "wrap",
115
- alignItems: "flex-start",
115
+ alignItems: "flex-start"
116
116
  });
117
117
  });
118
118
 
@@ -120,7 +120,7 @@ describe("Box", () => {
120
120
  const {root} = renderWithTheme(<Box gap={4} />);
121
121
  const view = root.findByType("View");
122
122
  expect(view.props.style).toMatchObject({
123
- gap: 16,
123
+ gap: 16
124
124
  });
125
125
  });
126
126
  });
@@ -130,7 +130,7 @@ describe("Box", () => {
130
130
  const {root} = renderWithTheme(<Box padding={4} />);
131
131
  const view = root.findByType("View");
132
132
  expect(view.props.style).toMatchObject({
133
- padding: 16,
133
+ padding: 16
134
134
  });
135
135
  });
136
136
 
@@ -139,7 +139,7 @@ describe("Box", () => {
139
139
  const view = root.findByType("View");
140
140
  expect(view.props.style).toMatchObject({
141
141
  paddingLeft: 8,
142
- paddingRight: 8,
142
+ paddingRight: 8
143
143
  });
144
144
  });
145
145
 
@@ -148,7 +148,7 @@ describe("Box", () => {
148
148
  const view = root.findByType("View");
149
149
  expect(view.props.style).toMatchObject({
150
150
  paddingTop: 12,
151
- paddingBottom: 12,
151
+ paddingBottom: 12
152
152
  });
153
153
  });
154
154
 
@@ -156,7 +156,7 @@ describe("Box", () => {
156
156
  const {root} = renderWithTheme(<Box margin={4} />);
157
157
  const view = root.findByType("View");
158
158
  expect(view.props.style).toMatchObject({
159
- margin: 16,
159
+ margin: 16
160
160
  });
161
161
  });
162
162
 
@@ -164,7 +164,7 @@ describe("Box", () => {
164
164
  const {root} = renderWithTheme(<Box marginTop={2} />);
165
165
  const view = root.findByType("View");
166
166
  expect(view.props.style).toMatchObject({
167
- marginTop: 8,
167
+ marginTop: 8
168
168
  });
169
169
  });
170
170
 
@@ -172,7 +172,7 @@ describe("Box", () => {
172
172
  const {root} = renderWithTheme(<Box marginBottom={2} />);
173
173
  const view = root.findByType("View");
174
174
  expect(view.props.style).toMatchObject({
175
- marginBottom: 8,
175
+ marginBottom: 8
176
176
  });
177
177
  });
178
178
 
@@ -180,7 +180,7 @@ describe("Box", () => {
180
180
  const {root} = renderWithTheme(<Box marginLeft={2} />);
181
181
  const view = root.findByType("View");
182
182
  expect(view.props.style).toMatchObject({
183
- marginLeft: 8,
183
+ marginLeft: 8
184
184
  });
185
185
  });
186
186
 
@@ -188,7 +188,7 @@ describe("Box", () => {
188
188
  const {root} = renderWithTheme(<Box marginRight={2} />);
189
189
  const view = root.findByType("View");
190
190
  expect(view.props.style).toMatchObject({
191
- marginRight: 8,
191
+ marginRight: 8
192
192
  });
193
193
  });
194
194
  });
@@ -198,7 +198,7 @@ describe("Box", () => {
198
198
  const {root} = renderWithTheme(<Box width={100} />);
199
199
  const view = root.findByType("View");
200
200
  expect(view.props.style).toMatchObject({
201
- width: 100,
201
+ width: 100
202
202
  });
203
203
  });
204
204
 
@@ -206,7 +206,7 @@ describe("Box", () => {
206
206
  const {root} = renderWithTheme(<Box height={100} />);
207
207
  const view = root.findByType("View");
208
208
  expect(view.props.style).toMatchObject({
209
- height: 100,
209
+ height: 100
210
210
  });
211
211
  });
212
212
 
@@ -214,7 +214,7 @@ describe("Box", () => {
214
214
  const {root} = renderWithTheme(<Box width="50%" />);
215
215
  const view = root.findByType("View");
216
216
  expect(view.props.style).toMatchObject({
217
- width: "50%",
217
+ width: "50%"
218
218
  });
219
219
  });
220
220
 
@@ -222,7 +222,7 @@ describe("Box", () => {
222
222
  const {root} = renderWithTheme(<Box height="50%" />);
223
223
  const view = root.findByType("View");
224
224
  expect(view.props.style).toMatchObject({
225
- height: "50%",
225
+ height: "50%"
226
226
  });
227
227
  });
228
228
  });
@@ -232,7 +232,7 @@ describe("Box", () => {
232
232
  const {root} = renderWithTheme(<Box position="absolute" />);
233
233
  const view = root.findByType("View");
234
234
  expect(view.props.style).toMatchObject({
235
- position: "absolute",
235
+ position: "absolute"
236
236
  });
237
237
  });
238
238
 
@@ -240,7 +240,7 @@ describe("Box", () => {
240
240
  const {root} = renderWithTheme(<Box top />);
241
241
  const view = root.findByType("View");
242
242
  expect(view.props.style).toMatchObject({
243
- top: 0,
243
+ top: 0
244
244
  });
245
245
  });
246
246
 
@@ -248,7 +248,7 @@ describe("Box", () => {
248
248
  const {root} = renderWithTheme(<Box bottom />);
249
249
  const view = root.findByType("View");
250
250
  expect(view.props.style).toMatchObject({
251
- bottom: 0,
251
+ bottom: 0
252
252
  });
253
253
  });
254
254
 
@@ -256,7 +256,7 @@ describe("Box", () => {
256
256
  const {root} = renderWithTheme(<Box left />);
257
257
  const view = root.findByType("View");
258
258
  expect(view.props.style).toMatchObject({
259
- left: 0,
259
+ left: 0
260
260
  });
261
261
  });
262
262
 
@@ -264,7 +264,7 @@ describe("Box", () => {
264
264
  const {root} = renderWithTheme(<Box right />);
265
265
  const view = root.findByType("View");
266
266
  expect(view.props.style).toMatchObject({
267
- right: 0,
267
+ right: 0
268
268
  });
269
269
  });
270
270
 
@@ -272,7 +272,7 @@ describe("Box", () => {
272
272
  const {root} = renderWithTheme(<Box zIndex={10} />);
273
273
  const view = root.findByType("View");
274
274
  expect(view.props.style).toMatchObject({
275
- zIndex: 10,
275
+ zIndex: 10
276
276
  });
277
277
  });
278
278
  });
@@ -356,9 +356,7 @@ describe("Box", () => {
356
356
  it("should warn when using circle without dimensions", () => {
357
357
  const consoleSpy = jest.spyOn(console, "warn").mockImplementation();
358
358
  renderWithTheme(<Box rounding="circle" />);
359
- expect(consoleSpy).toHaveBeenCalledWith(
360
- "Cannot use Box rounding='circle' without height or width."
361
- );
359
+ expect(consoleSpy).toHaveBeenCalledWith("Cannot use Box rounding='circle' without height or width.");
362
360
  consoleSpy.mockRestore();
363
361
  });
364
362
  });
@@ -368,7 +366,7 @@ describe("Box", () => {
368
366
  const {root} = renderWithTheme(<Box display="none" />);
369
367
  const view = root.findByType("View");
370
368
  expect(view.props.style).toMatchObject({
371
- display: "none",
369
+ display: "none"
372
370
  });
373
371
  });
374
372
 
@@ -376,7 +374,7 @@ describe("Box", () => {
376
374
  const {root} = renderWithTheme(<Box display="flex" />);
377
375
  const view = root.findByType("View");
378
376
  expect(view.props.style).toMatchObject({
379
- flex: undefined,
377
+ flex: undefined
380
378
  });
381
379
  });
382
380
 
@@ -385,7 +383,7 @@ describe("Box", () => {
385
383
  const view = root.findByType("View");
386
384
  expect(view.props.style).toMatchObject({
387
385
  flex: 0,
388
- flexDirection: "row",
386
+ flexDirection: "row"
389
387
  });
390
388
  });
391
389
  });
@@ -395,7 +393,7 @@ describe("Box", () => {
395
393
  const {root} = renderWithTheme(<Box overflow="scroll" />);
396
394
  const view = root.findByType("View");
397
395
  expect(view.props.style).toMatchObject({
398
- overflow: "scroll",
396
+ overflow: "scroll"
399
397
  });
400
398
  });
401
399
 
@@ -403,7 +401,7 @@ describe("Box", () => {
403
401
  const {root} = renderWithTheme(<Box overflow="scrollY" />);
404
402
  const view = root.findByType("View");
405
403
  expect(view.props.style).toMatchObject({
406
- overflow: "scroll",
404
+ overflow: "scroll"
407
405
  });
408
406
  });
409
407
 
@@ -411,7 +409,7 @@ describe("Box", () => {
411
409
  const {root} = renderWithTheme(<Box overflow="hidden" />);
412
410
  const view = root.findByType("View");
413
411
  expect(view.props.style).toMatchObject({
414
- overflow: "hidden",
412
+ overflow: "hidden"
415
413
  });
416
414
  });
417
415
  });
@@ -428,15 +426,11 @@ describe("Box", () => {
428
426
  it("should render as Pressable when onClick is provided", () => {
429
427
  const mockOnClick = jest.fn();
430
428
  const {root} = renderWithTheme(
431
- <Box
432
- onClick={mockOnClick}
433
- accessibilityLabel="Click me"
434
- accessibilityHint="Tap to trigger action"
435
- >
429
+ <Box onClick={mockOnClick} accessibilityLabel="Click me" accessibilityHint="Tap to trigger action">
436
430
  <Text>Clickable content</Text>
437
431
  </Box>
438
432
  );
439
-
433
+
440
434
  expect(root).toBeTruthy();
441
435
  // Just verify the component renders without error when onClick is provided
442
436
  });
@@ -444,33 +438,33 @@ describe("Box", () => {
444
438
  it("should call onClick when pressed", async () => {
445
439
  const mockOnClick = jest.fn();
446
440
  const {getByTestId} = renderWithTheme(
447
- <Box
448
- onClick={mockOnClick}
441
+ <Box
442
+ onClick={mockOnClick}
449
443
  testID="clickable-box"
450
- accessibilityLabel="Click me"
444
+ accessibilityLabel="Click me"
451
445
  accessibilityHint="Tap to trigger action"
452
446
  />
453
447
  );
454
-
448
+
455
449
  const pressable = getByTestId("clickable-box-clickable");
456
450
  await act(async () => {
457
451
  fireEvent.press(pressable);
458
452
  });
459
-
453
+
460
454
  expect(mockOnClick).toHaveBeenCalledTimes(1);
461
455
  });
462
456
 
463
457
  it("should apply accessibility props to Pressable", () => {
464
458
  const mockOnClick = jest.fn();
465
459
  const {getByTestId} = renderWithTheme(
466
- <Box
460
+ <Box
467
461
  onClick={mockOnClick}
468
462
  testID="accessible-box"
469
463
  accessibilityLabel="Click me"
470
464
  accessibilityHint="Tap to trigger action"
471
465
  />
472
466
  );
473
-
467
+
474
468
  const pressable = getByTestId("accessible-box-clickable");
475
469
  expect(pressable).toBeTruthy();
476
470
  // Basic check that accessibility props are being applied
@@ -519,24 +513,26 @@ describe("Box", () => {
519
513
  const {getByTestId} = renderWithTheme(
520
514
  <Box onHoverStart={mockOnHoverStart} testID="hover-box" />
521
515
  );
522
-
516
+
523
517
  const view = getByTestId("hover-box");
524
518
  await act(async () => {
525
519
  fireEvent(view, "pointerEnter");
526
520
  });
527
-
521
+
528
522
  expect(mockOnHoverStart).toHaveBeenCalledTimes(1);
529
523
  });
530
524
 
531
525
  it("should call onHoverEnd", async () => {
532
526
  const mockOnHoverEnd = jest.fn();
533
- const {getByTestId} = renderWithTheme(<Box onHoverEnd={mockOnHoverEnd} testID="hover-box" />);
534
-
527
+ const {getByTestId} = renderWithTheme(
528
+ <Box onHoverEnd={mockOnHoverEnd} testID="hover-box" />
529
+ );
530
+
535
531
  const view = getByTestId("hover-box");
536
532
  await act(async () => {
537
533
  fireEvent(view, "pointerLeave");
538
534
  });
539
-
535
+
540
536
  expect(mockOnHoverEnd).toHaveBeenCalledTimes(1);
541
537
  });
542
538
  });
@@ -545,7 +541,7 @@ describe("Box", () => {
545
541
  it("should expose scrollToEnd method", () => {
546
542
  const ref = React.createRef<any>();
547
543
  renderWithTheme(<Box ref={ref} scroll />);
548
-
544
+
549
545
  expect(ref.current).toBeTruthy();
550
546
  expect(typeof ref.current.scrollToEnd).toBe("function");
551
547
  });
@@ -553,7 +549,7 @@ describe("Box", () => {
553
549
  it("should expose scrollTo method", () => {
554
550
  const ref = React.createRef<any>();
555
551
  renderWithTheme(<Box ref={ref} scroll />);
556
-
552
+
557
553
  expect(ref.current).toBeTruthy();
558
554
  expect(typeof ref.current.scrollTo).toBe("function");
559
555
  });
@@ -562,11 +558,11 @@ describe("Box", () => {
562
558
  describe("dangerous inline styles", () => {
563
559
  it("should apply dangerouslySetInlineStyle", () => {
564
560
  const {root} = renderWithTheme(
565
- <Box dangerouslySetInlineStyle={{__style: {backgroundColor: "red"}}} />
561
+ <Box dangerouslySetInlineStyle={{ __style: { backgroundColor: "red" } }} />
566
562
  );
567
563
  const view = root.findByType("View");
568
564
  expect(view.props.style).toMatchObject({
569
- backgroundColor: "red",
565
+ backgroundColor: "red"
570
566
  });
571
567
  });
572
568
  });
@@ -575,9 +571,7 @@ describe("Box", () => {
575
571
  it("should warn when using wrap and alignItems together", () => {
576
572
  const consoleSpy = jest.spyOn(console, "warn").mockImplementation();
577
573
  renderWithTheme(<Box wrap alignItems="center" />);
578
- expect(consoleSpy).toHaveBeenCalledWith(
579
- "React Native doesn't support wrap and alignItems together."
580
- );
574
+ expect(consoleSpy).toHaveBeenCalledWith("React Native doesn't support wrap and alignItems together.");
581
575
  consoleSpy.mockRestore();
582
576
  });
583
577
  });
@@ -610,7 +604,7 @@ describe("Box", () => {
610
604
  expect(view.props.style).toMatchObject({
611
605
  padding: 0,
612
606
  margin: 0,
613
- gap: 0,
607
+ gap: 0
614
608
  });
615
609
  });
616
610
  });
@@ -623,11 +617,11 @@ describe("Box", () => {
623
617
 
624
618
  it("should match snapshot with layout props", () => {
625
619
  const component = renderWithTheme(
626
- <Box
627
- direction="column"
628
- flex="grow"
629
- justifyContent="center"
630
- alignItems="center"
620
+ <Box
621
+ direction="column"
622
+ flex="grow"
623
+ justifyContent="center"
624
+ alignItems="center"
631
625
  padding={4}
632
626
  margin={2}
633
627
  />
@@ -637,7 +631,7 @@ describe("Box", () => {
637
631
 
638
632
  it("should match snapshot with clickable props", () => {
639
633
  const component = renderWithTheme(
640
- <Box
634
+ <Box
641
635
  onClick={jest.fn()}
642
636
  accessibilityLabel="Click me"
643
637
  accessibilityHint="Tap to trigger action"
@@ -658,9 +652,14 @@ describe("Box", () => {
658
652
 
659
653
  it("should match snapshot with border and rounding", () => {
660
654
  const component = renderWithTheme(
661
- <Box border="default" rounding="md" color="primary" shadow />
655
+ <Box
656
+ border="default"
657
+ rounding="md"
658
+ color="primary"
659
+ shadow
660
+ />
662
661
  );
663
662
  expect(component.toJSON()).toMatchSnapshot();
664
663
  });
665
664
  });
666
- });
665
+ });
package/src/Box.tsx CHANGED
@@ -58,7 +58,7 @@ const isValidPercentage = (value: string): boolean => {
58
58
  };
59
59
 
60
60
  const isValidWidthHeight = (value: number | string): boolean => {
61
- return typeof value === "number" || !Number.isNaN(Number(value)) || isValidPercentage(value);
61
+ return typeof value === 'number' || !isNaN(Number(value)) || isValidPercentage(value);
62
62
  };
63
63
 
64
64
  // eslint-disable-next-line react/display-name
@@ -153,12 +153,10 @@ export const Box = React.forwardRef((props: BoxProps, ref) => {
153
153
  gap: (value) => ({gap: getSpacing(value)}),
154
154
  height: (value) => {
155
155
  if (!isValidWidthHeight(value)) {
156
- console.warn(
157
- `Box: height prop must be a number or percentage string (e.g., "50%"), received: ${value}`
158
- );
156
+ console.warn(`Box: height prop must be a number or percentage string (e.g., "50%"), received: ${value}`);
159
157
  return {};
160
158
  }
161
- if (props.border && !Number.isNaN(Number(value))) {
159
+ if (props.border && !isNaN(Number(value))) {
162
160
  return {height: Number(value) + 2 * 2};
163
161
  } else {
164
162
  return {height: value};
@@ -212,12 +210,10 @@ export const Box = React.forwardRef((props: BoxProps, ref) => {
212
210
  top: (top) => ({top: top ? 0 : undefined}),
213
211
  width: (value) => {
214
212
  if (!isValidWidthHeight(value)) {
215
- console.warn(
216
- `Box: width prop must be a number or percentage string (e.g., "50%"), received: ${value}`
217
- );
213
+ console.warn(`Box: width prop must be a number or percentage string (e.g., "50%"), received: ${value}`);
218
214
  return {};
219
215
  }
220
- if (props.border && !Number.isNaN(Number(value))) {
216
+ if (props.border && !isNaN(Number(value))) {
221
217
  return {width: Number(value) + 2 * 2};
222
218
  } else {
223
219
  return {width: value};
@@ -225,36 +221,28 @@ export const Box = React.forwardRef((props: BoxProps, ref) => {
225
221
  },
226
222
  maxHeight: (value) => {
227
223
  if (!isValidWidthHeight(value)) {
228
- console.warn(
229
- `Box: maxHeight prop must be a number or percentage string (e.g., "50%"), received: ${value}`
230
- );
224
+ console.warn(`Box: maxHeight prop must be a number or percentage string (e.g., "50%"), received: ${value}`);
231
225
  return {};
232
226
  }
233
227
  return {maxHeight: value};
234
228
  },
235
229
  maxWidth: (value) => {
236
230
  if (!isValidWidthHeight(value)) {
237
- console.warn(
238
- `Box: maxWidth prop must be a number or percentage string (e.g., "50%"), received: ${value}`
239
- );
231
+ console.warn(`Box: maxWidth prop must be a number or percentage string (e.g., "50%"), received: ${value}`);
240
232
  return {};
241
233
  }
242
234
  return {maxWidth: value};
243
235
  },
244
236
  minHeight: (value) => {
245
237
  if (!isValidWidthHeight(value)) {
246
- console.warn(
247
- `Box: minHeight prop must be a number or percentage string (e.g., "50%"), received: ${value}`
248
- );
238
+ console.warn(`Box: minHeight prop must be a number or percentage string (e.g., "50%"), received: ${value}`);
249
239
  return {};
250
240
  }
251
241
  return {minHeight: value};
252
242
  },
253
243
  minWidth: (value) => {
254
244
  if (!isValidWidthHeight(value)) {
255
- console.warn(
256
- `Box: minWidth prop must be a number or percentage string (e.g., "50%"), received: ${value}`
257
- );
245
+ console.warn(`Box: minWidth prop must be a number or percentage string (e.g., "50%"), received: ${value}`);
258
246
  return {};
259
247
  }
260
248
  return {minWidth: value};
package/src/Button.tsx CHANGED
@@ -116,6 +116,7 @@ const ButtonComponent: FC<ButtonProps> = ({
116
116
  testID={testID}
117
117
  onPress={debounce(
118
118
  async () => {
119
+ // TODO: Allow for a click outside of the confirmation modal to close it.
119
120
  await Unifier.utils.haptic();
120
121
  setLoading(true);
121
122
 
package/src/CheckBox.tsx CHANGED
@@ -32,13 +32,7 @@ export const CheckBox: FC<CheckBoxProps> = ({selected, size = "md", bgColor = "d
32
32
  }}
33
33
  >
34
34
  {selected ? (
35
- <FontAwesome6
36
- color={theme.surface.base}
37
- name="check"
38
- size={px[size].icon}
39
- solid
40
- selectable={undefined}
41
- />
35
+ <FontAwesome6 color={theme.surface.base} name="check" size={px[size].icon} solid selectable={undefined}/>
42
36
  ) : null}
43
37
  </View>
44
38
  );
package/src/Common.ts CHANGED
@@ -64,11 +64,6 @@ export interface AccordionProps extends InfoModalIconProps {
64
64
  * The title of the accordion.
65
65
  */
66
66
  title: string;
67
-
68
- /**
69
- * * Callback fired when the accordion is toggled.
70
- * */
71
- onToggle?: (isCollapse: boolean) => void;
72
67
  }
73
68
 
74
69
  export interface BaseProfile {
@@ -308,6 +303,18 @@ export type TextColor = keyof TextTheme;
308
303
  export type SurfaceColor = keyof SurfaceTheme;
309
304
  export type BorderColor = keyof BorderTheme;
310
305
  export type StatusColor = keyof StatusTheme;
306
+ // TODO: Remove ButtonColor. Buttons no longer have colors, only types (called style in Figma)
307
+ export type ButtonColor =
308
+ | "blue"
309
+ | "gray"
310
+ | "red"
311
+ // | "transparent"
312
+ | "white"
313
+ | "primary"
314
+ | "secondary"
315
+ | "accent"
316
+ | "tertiary"
317
+ | string;
311
318
 
312
319
  // TODO: we may want/need to expand icon color options from just text colors.
313
320
  export type IconColor = TextColor;
@@ -425,11 +432,11 @@ export const iconSizeToNumber = (size?: IconSize) => {
425
432
 
426
433
  export type TextSize = "sm" | "md" | "lg" | "xl" | "2xl";
427
434
 
428
- export interface ValueMappingItem {
435
+ export type ValueMappingItem = {
429
436
  value: number;
430
437
  label: string;
431
438
  size?: IconSize;
432
- }
439
+ };
433
440
 
434
441
  export type IconPrefix = "far" | "fas";
435
442
 
@@ -731,7 +738,7 @@ export interface HeadingProps {
731
738
  children?: React.ReactNode;
732
739
  color?: TextColor;
733
740
  overflow?: "normal" | "breakWord"; // default "breakWord"
734
- size?: "sm" | "md" | "lg" | "xl" | "2xl"; // default "sm"
741
+ size?: "sm" | "md" | "lg" | "xl"; // default "sm"
735
742
  truncate?: boolean; // default false
736
743
  testID?: string;
737
744
  }
@@ -763,6 +770,11 @@ export interface ImageProps {
763
770
  style?: any;
764
771
  }
765
772
 
773
+ export interface SearchButtonProps {
774
+ color: ButtonColor;
775
+ onClick: () => void;
776
+ }
777
+
766
778
  export interface BackButtonInterface {
767
779
  onBack: () => void;
768
780
  }
@@ -1774,11 +1786,6 @@ export interface ModalProps {
1774
1786
  * The content of the modal.
1775
1787
  */
1776
1788
  children?: React.ReactElement;
1777
- /**
1778
- * If true, the modal will be closed when the background is clicked.
1779
- * @default false
1780
- */
1781
- persistOnBackgroundClick?: boolean;
1782
1789
  /**
1783
1790
  * If true, the primary button will be disabled.
1784
1791
  * @default false
@@ -2132,7 +2139,7 @@ export interface TableContextType {
2132
2139
  }
2133
2140
 
2134
2141
  export interface TableContextProviderProps extends TableContextType {
2135
- children: React.ReactNode;
2142
+ children: React.ReactElement;
2136
2143
  }
2137
2144
 
2138
2145
  export interface TextProps {