ferns-ui 1.10.0 → 1.11.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 (69) hide show
  1. package/dist/Accordion.js +1 -1
  2. package/dist/Accordion.js.map +1 -1
  3. package/dist/Accordion.test.d.ts +1 -0
  4. package/dist/Accordion.test.js +71 -0
  5. package/dist/Accordion.test.js.map +1 -0
  6. package/dist/AddressField.test.d.ts +1 -0
  7. package/dist/AddressField.test.js +65 -0
  8. package/dist/AddressField.test.js.map +1 -0
  9. package/dist/Avatar.js +2 -2
  10. package/dist/Avatar.js.map +1 -1
  11. package/dist/Avatar.test.d.ts +1 -0
  12. package/dist/Avatar.test.js +131 -0
  13. package/dist/Avatar.test.js.map +1 -0
  14. package/dist/Badge.d.ts +1 -1
  15. package/dist/Badge.js +3 -3
  16. package/dist/Badge.js.map +1 -1
  17. package/dist/Badge.test.d.ts +1 -0
  18. package/dist/Badge.test.js +76 -0
  19. package/dist/Badge.test.js.map +1 -0
  20. package/dist/Box.test.d.ts +1 -0
  21. package/dist/Box.test.js +528 -0
  22. package/dist/Box.test.js.map +1 -0
  23. package/dist/Common.d.ts +100 -1
  24. package/dist/Common.js.map +1 -1
  25. package/dist/DateTimeField.js +15 -2
  26. package/dist/DateTimeField.js.map +1 -1
  27. package/dist/InfoModalIcon.js +1 -1
  28. package/dist/InfoModalIcon.js.map +1 -1
  29. package/dist/Slider.d.ts +3 -0
  30. package/dist/Slider.js +94 -0
  31. package/dist/Slider.js.map +1 -0
  32. package/dist/Text.js +2 -0
  33. package/dist/Text.js.map +1 -1
  34. package/dist/TextField.test.js +9 -9
  35. package/dist/TextField.test.js.map +1 -1
  36. package/dist/Tooltip.js +2 -0
  37. package/dist/Tooltip.js.map +1 -1
  38. package/dist/index.d.ts +1 -0
  39. package/dist/index.js +1 -0
  40. package/dist/index.js.map +1 -1
  41. package/dist/setupTests.js +40 -2
  42. package/dist/setupTests.js.map +1 -1
  43. package/dist/test-utils.js.map +1 -1
  44. package/package.json +2 -1
  45. package/src/Accordion.test.tsx +104 -0
  46. package/src/Accordion.tsx +1 -0
  47. package/src/AddressField.test.tsx +89 -0
  48. package/src/Avatar.test.tsx +163 -0
  49. package/src/Avatar.tsx +2 -0
  50. package/src/Badge.test.tsx +116 -0
  51. package/src/Badge.tsx +3 -1
  52. package/src/Box.test.tsx +665 -0
  53. package/src/Common.ts +114 -1
  54. package/src/DateTimeField.tsx +15 -2
  55. package/src/InfoModalIcon.tsx +1 -0
  56. package/src/Slider.tsx +205 -0
  57. package/src/Text.tsx +2 -0
  58. package/src/TextField.test.tsx +59 -71
  59. package/src/Tooltip.tsx +2 -0
  60. package/src/__snapshots__/Accordion.test.tsx.snap +120 -0
  61. package/src/__snapshots__/AddressField.test.tsx.snap +464 -0
  62. package/src/__snapshots__/Avatar.test.tsx.snap +78 -0
  63. package/src/__snapshots__/Badge.test.tsx.snap +44 -0
  64. package/src/__snapshots__/Box.test.tsx.snap +159 -0
  65. package/src/__snapshots__/TextArea.test.tsx.snap +12 -0
  66. package/src/__snapshots__/TextField.test.tsx.snap +38 -1
  67. package/src/index.tsx +1 -0
  68. package/src/setupTests.ts +45 -2
  69. package/src/test-utils.tsx +1 -0
@@ -0,0 +1,159 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`Box snapshots should match snapshot with border and rounding 1`] = `
4
+ <View
5
+ onPointerEnter={[Function]}
6
+ onPointerLeave={[Function]}
7
+ style={
8
+ {
9
+ "backgroundColor": "#0E9DCD",
10
+ "borderColor": "#CDCDCD",
11
+ "borderRadius": 4,
12
+ "borderWidth": 1,
13
+ "boxShadow": "2px 2px 2px rgba(153, 153, 153, 1.0)",
14
+ }
15
+ }
16
+ />
17
+ `;
18
+
19
+ exports[`Box snapshots should match snapshot with clickable props 1`] = `
20
+ <View
21
+ accessibilityHint="Tap to trigger action"
22
+ accessibilityLabel="Click me"
23
+ accessibilityState={
24
+ {
25
+ "busy": undefined,
26
+ "checked": undefined,
27
+ "disabled": undefined,
28
+ "expanded": undefined,
29
+ "selected": undefined,
30
+ }
31
+ }
32
+ accessibilityValue={
33
+ {
34
+ "max": undefined,
35
+ "min": undefined,
36
+ "now": undefined,
37
+ "text": undefined,
38
+ }
39
+ }
40
+ accessible={true}
41
+ aria-role="button"
42
+ collapsable={false}
43
+ focusable={true}
44
+ onBlur={[Function]}
45
+ onClick={[Function]}
46
+ onFocus={[Function]}
47
+ onPointerEnter={[Function]}
48
+ onPointerLeave={[Function]}
49
+ onResponderGrant={[Function]}
50
+ onResponderMove={[Function]}
51
+ onResponderRelease={[Function]}
52
+ onResponderTerminate={[Function]}
53
+ onResponderTerminationRequest={[Function]}
54
+ onStartShouldSetResponder={[Function]}
55
+ style={
56
+ {
57
+ "accessibilityHint": "Tap to trigger action",
58
+ "accessibilityLabel": "Click me",
59
+ }
60
+ }
61
+ />
62
+ `;
63
+
64
+ exports[`Box snapshots should match snapshot with default props 1`] = `
65
+ <View
66
+ onPointerEnter={[Function]}
67
+ onPointerLeave={[Function]}
68
+ style={{}}
69
+ />
70
+ `;
71
+
72
+ exports[`Box snapshots should match snapshot with keyboard avoidance 1`] = `
73
+ <View
74
+ onLayout={[Function]}
75
+ style={
76
+ [
77
+ {
78
+ "display": "flex",
79
+ "flex": 1,
80
+ },
81
+ {
82
+ "paddingBottom": 0,
83
+ },
84
+ ]
85
+ }
86
+ >
87
+ <RCTSafeAreaView
88
+ style={
89
+ {
90
+ "display": "flex",
91
+ "flex": 1,
92
+ }
93
+ }
94
+ >
95
+ <View
96
+ onPointerEnter={[Function]}
97
+ onPointerLeave={[Function]}
98
+ style={
99
+ {
100
+ "avoidKeyboard": true,
101
+ }
102
+ }
103
+ />
104
+ </RCTSafeAreaView>
105
+ </View>
106
+ `;
107
+
108
+ exports[`Box snapshots should match snapshot with layout props 1`] = `
109
+ <View
110
+ onPointerEnter={[Function]}
111
+ onPointerLeave={[Function]}
112
+ style={
113
+ {
114
+ "alignItems": "center",
115
+ "display": "flex",
116
+ "flexDirection": "column",
117
+ "flexGrow": 1,
118
+ "flexShrink": 1,
119
+ "justifyContent": "center",
120
+ "margin": 8,
121
+ "padding": 16,
122
+ }
123
+ }
124
+ />
125
+ `;
126
+
127
+ exports[`Box snapshots should match snapshot with scroll enabled 1`] = `
128
+ <RCTScrollView
129
+ contentContainerStyle={
130
+ {
131
+ "alignContent": undefined,
132
+ "alignItems": undefined,
133
+ "justifyContent": undefined,
134
+ }
135
+ }
136
+ horizontal={false}
137
+ keyboardShouldPersistTaps="handled"
138
+ nestedScrollEnabled={true}
139
+ onScroll={[Function]}
140
+ scrollEventThrottle={50}
141
+ style={
142
+ {
143
+ "scroll": true,
144
+ }
145
+ }
146
+ >
147
+ <View>
148
+ <View
149
+ onPointerEnter={[Function]}
150
+ onPointerLeave={[Function]}
151
+ style={
152
+ {
153
+ "scroll": true,
154
+ }
155
+ }
156
+ />
157
+ </View>
158
+ </RCTScrollView>
159
+ `;
@@ -271,6 +271,18 @@ exports[`TextArea snapshots should match snapshot with error state 1`] = `
271
271
  }
272
272
  }
273
273
  >
274
+ <View
275
+ brand={false}
276
+ color="#BD1111"
277
+ duotone={false}
278
+ light={false}
279
+ name="triangle-exclamation"
280
+ regular={false}
281
+ sharp={false}
282
+ size={12}
283
+ solid={true}
284
+ thin={false}
285
+ />
274
286
  <View
275
287
  style={
276
288
  {
@@ -107,6 +107,18 @@ exports[`TextField snapshots should match snapshot with all props 1`] = `
107
107
  }
108
108
  }
109
109
  >
110
+ <View
111
+ brand={false}
112
+ color="#BD1111"
113
+ duotone={false}
114
+ light={false}
115
+ name="triangle-exclamation"
116
+ regular={false}
117
+ sharp={false}
118
+ size={12}
119
+ solid={true}
120
+ thin={false}
121
+ />
110
122
  <View
111
123
  style={
112
124
  {
@@ -211,7 +223,20 @@ exports[`TextField snapshots should match snapshot with all props 1`] = `
211
223
  onResponderTerminate={[Function]}
212
224
  onResponderTerminationRequest={[Function]}
213
225
  onStartShouldSetResponder={[Function]}
214
- />
226
+ >
227
+ <View
228
+ brand={false}
229
+ color="#1C1C1C"
230
+ duotone={false}
231
+ light={false}
232
+ name="check"
233
+ regular={false}
234
+ sharp={false}
235
+ size={16}
236
+ solid={true}
237
+ thin={false}
238
+ />
239
+ </View>
215
240
  </View>
216
241
  <View
217
242
  style={
@@ -329,6 +354,18 @@ exports[`TextField snapshots should match snapshot with error state 1`] = `
329
354
  }
330
355
  }
331
356
  >
357
+ <View
358
+ brand={false}
359
+ color="#BD1111"
360
+ duotone={false}
361
+ light={false}
362
+ name="triangle-exclamation"
363
+ regular={false}
364
+ sharp={false}
365
+ size={12}
366
+ solid={true}
367
+ thin={false}
368
+ />
332
369
  <View
333
370
  style={
334
371
  {
package/src/index.tsx CHANGED
@@ -56,6 +56,7 @@ export * from "./SelectField";
56
56
  export * from "./SideDrawer";
57
57
  export * from "./Signature";
58
58
  export * from "./SignatureField";
59
+ export * from "./Slider";
59
60
  export * from "./Spinner";
60
61
  export * from "./SplitPage";
61
62
  export * from "./table/Table";
package/src/setupTests.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  process.env.TZ = "America/New_York";
2
+ process.env.EXPO_OS = "ios";
2
3
 
3
4
  // Create mocks for libraries that cause issues with testing
4
5
  jest.mock("@react-native-async-storage/async-storage", () => ({
@@ -22,10 +23,19 @@ jest.mock("./IconButton", () => ({
22
23
  IconButton: jest.fn().mockImplementation(() => null),
23
24
  }));
24
25
 
25
- jest.mock("./Icon", () => ({
26
- Icon: jest.fn().mockImplementation(() => null),
26
+ jest.mock("expo-font", () => ({
27
+ isLoaded: jest.fn().mockImplementation(() => true),
28
+ loadNativeFonts: jest.fn().mockImplementation(() => Promise.resolve()),
29
+ loadAsync: jest.fn().mockImplementation(() => Promise.resolve()),
27
30
  }));
28
31
 
32
+ // jest.mock("./Icon", () => ({
33
+ // Icon: ({name}: {name: string}) => ({
34
+ // props: {testID: name},
35
+ // type: "View",
36
+ // }),
37
+ // }));
38
+
29
39
  // Mock DateTimeActionSheet
30
40
  jest.mock("./DateTimeActionSheet", () => ({
31
41
  DateTimeActionSheet: jest.fn().mockImplementation(() => null),
@@ -36,6 +46,39 @@ jest.mock("./MediaQuery", () => ({
36
46
  isMobileDevice: jest.fn().mockReturnValue(false),
37
47
  }));
38
48
 
49
+ // Mock @expo/vector-icons/FontAwesome6
50
+ // interface IconProps {
51
+ // name: string;
52
+ // [key: string]: unknown;
53
+ // }
54
+
55
+ // jest.mock("@expo/vector-icons/FontAwesome6", () => ({
56
+ // __esModule: true,
57
+ // default: jest.fn(({name, ...props}: IconProps) =>
58
+ // React.createElement(View, {testID: name, ...props})
59
+ // ),
60
+ // }));
61
+
62
+ // Mock expo-image-manipulator
63
+ jest.mock("expo-image-manipulator", () => ({
64
+ ImageManipulator: {
65
+ manipulateAsync: jest.fn(),
66
+ },
67
+ SaveFormat: {
68
+ PNG: "png",
69
+ JPEG: "jpeg",
70
+ },
71
+ }));
72
+
73
+ // Mock expo-image-picker
74
+ jest.mock("expo-image-picker", () => ({
75
+ launchImageLibraryAsync: jest.fn(),
76
+ requestMediaLibraryPermissionsAsync: jest.fn(),
77
+ MediaTypeOptions: {
78
+ Images: "images",
79
+ },
80
+ }));
81
+
39
82
  // Make sure we can test date/time functionality
40
83
  global.Date.now = jest.fn(() => new Date("2023-05-15T10:30:00.000Z").getTime());
41
84
 
@@ -1,5 +1,6 @@
1
1
  import {render} from "@testing-library/react-native";
2
2
  import React from "react";
3
+
3
4
  import {ThemeProvider} from "./Theme";
4
5
 
5
6
  export const renderWithTheme = (ui: React.ReactElement) => {