@hero-design/rn 8.59.0 → 8.60.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.
- package/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +6 -0
- package/es/index.js +183 -102
- package/lib/index.js +183 -102
- package/package.json +1 -1
- package/src/components/AnimatedScroller/AnimatedFAB.tsx +99 -49
- package/src/components/AnimatedScroller/AnimatedScrollable.tsx +18 -3
- package/src/components/AnimatedScroller/__tests__/ScrollablesWithFAB.spec.tsx +30 -9
- package/src/components/AnimatedScroller/__tests__/__snapshots__/ScrollablesWithFAB.spec.tsx.snap +474 -447
- package/src/components/FAB/ActionGroup/ActionItem.tsx +3 -1
- package/src/components/FAB/ActionGroup/__tests__/__snapshots__/index.spec.tsx.snap +216 -211
- package/src/components/FAB/ActionGroup/index.tsx +34 -28
- package/src/components/FAB/FAB.tsx +102 -41
- package/src/components/FAB/StyledFAB.tsx +10 -8
- package/src/components/FAB/__tests__/__snapshots__/StyledFAB.spec.tsx.snap +34 -38
- package/src/components/FAB/__tests__/__snapshots__/index.spec.tsx.snap +191 -170
- package/types/components/AnimatedScroller/AnimatedFAB.d.ts +3 -1
- package/types/components/AnimatedScroller/AnimatedScrollable.d.ts +1 -1
- package/types/components/FAB/StyledFAB.d.ts +4 -6
|
@@ -28,58 +28,65 @@ exports[`FAB when animated is false renders StyledFABIcon 1`] = `
|
|
|
28
28
|
onResponderTerminationRequest={[Function]}
|
|
29
29
|
onStartShouldSetResponder={[Function]}
|
|
30
30
|
style={
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
"shadowOpacity": 0.12,
|
|
47
|
-
"shadowRadius": 4,
|
|
31
|
+
{
|
|
32
|
+
"alignItems": "center",
|
|
33
|
+
"alignSelf": "flex-start",
|
|
34
|
+
"backgroundColor": "#001f23",
|
|
35
|
+
"borderRadius": 999,
|
|
36
|
+
"bottom": undefined,
|
|
37
|
+
"elevation": 3,
|
|
38
|
+
"flexDirection": "row",
|
|
39
|
+
"height": 64,
|
|
40
|
+
"justifyContent": "center",
|
|
41
|
+
"padding": 20,
|
|
42
|
+
"shadowColor": "#001f23",
|
|
43
|
+
"shadowOffset": {
|
|
44
|
+
"height": 2,
|
|
45
|
+
"width": 0,
|
|
48
46
|
},
|
|
49
|
-
|
|
47
|
+
"shadowOpacity": 0.12,
|
|
48
|
+
"shadowRadius": 4,
|
|
49
|
+
"transform": [
|
|
50
50
|
{
|
|
51
|
-
"
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
"bottom": undefined,
|
|
51
|
+
"translateY": 0,
|
|
55
52
|
},
|
|
56
53
|
],
|
|
57
|
-
|
|
54
|
+
}
|
|
58
55
|
}
|
|
59
56
|
>
|
|
60
|
-
<
|
|
61
|
-
|
|
57
|
+
<View
|
|
58
|
+
collapsable={false}
|
|
62
59
|
style={
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
60
|
+
{
|
|
61
|
+
"flexDirection": "row",
|
|
62
|
+
"opacity": 1,
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
>
|
|
66
|
+
<HeroIcon
|
|
67
|
+
name="add"
|
|
68
|
+
style={
|
|
68
69
|
[
|
|
69
70
|
{
|
|
70
|
-
"color": "#
|
|
71
|
-
"
|
|
72
|
-
"textAlign": "center",
|
|
73
|
-
"textAlignVertical": "center",
|
|
71
|
+
"color": "#001f23",
|
|
72
|
+
"fontSize": 24,
|
|
74
73
|
},
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
74
|
+
[
|
|
75
|
+
{
|
|
76
|
+
"color": "#ffffff",
|
|
77
|
+
"lineHeight": 24,
|
|
78
|
+
"textAlign": "center",
|
|
79
|
+
"textAlignVertical": "center",
|
|
80
|
+
},
|
|
81
|
+
undefined,
|
|
82
|
+
],
|
|
83
|
+
]
|
|
84
|
+
}
|
|
85
|
+
testID="styled-fab-icon"
|
|
86
|
+
themeIntent="text"
|
|
87
|
+
themeSize="medium"
|
|
88
|
+
/>
|
|
89
|
+
</View>
|
|
83
90
|
</View>
|
|
84
91
|
<View
|
|
85
92
|
pointerEvents="box-none"
|
|
@@ -132,86 +139,93 @@ exports[`FAB when animated is true renders animatedFABIcon 1`] = `
|
|
|
132
139
|
onResponderTerminationRequest={[Function]}
|
|
133
140
|
onStartShouldSetResponder={[Function]}
|
|
134
141
|
style={
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
"shadowOpacity": 0.12,
|
|
151
|
-
"shadowRadius": 4,
|
|
142
|
+
{
|
|
143
|
+
"alignItems": "center",
|
|
144
|
+
"alignSelf": "flex-start",
|
|
145
|
+
"backgroundColor": "#001f23",
|
|
146
|
+
"borderRadius": 999,
|
|
147
|
+
"bottom": undefined,
|
|
148
|
+
"elevation": 3,
|
|
149
|
+
"flexDirection": "row",
|
|
150
|
+
"height": 64,
|
|
151
|
+
"justifyContent": "center",
|
|
152
|
+
"padding": 20,
|
|
153
|
+
"shadowColor": "#001f23",
|
|
154
|
+
"shadowOffset": {
|
|
155
|
+
"height": 2,
|
|
156
|
+
"width": 0,
|
|
152
157
|
},
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
},
|
|
158
|
+
"shadowOpacity": 0.12,
|
|
159
|
+
"shadowRadius": 4,
|
|
160
|
+
"transform": [
|
|
157
161
|
{
|
|
158
|
-
"
|
|
162
|
+
"translateY": 0,
|
|
159
163
|
},
|
|
160
164
|
],
|
|
161
|
-
|
|
165
|
+
}
|
|
162
166
|
}
|
|
163
167
|
>
|
|
164
168
|
<View
|
|
169
|
+
collapsable={false}
|
|
165
170
|
style={
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
"alignItems": "center",
|
|
171
|
-
"height": 24,
|
|
172
|
-
"justifyContent": "center",
|
|
173
|
-
"width": 24,
|
|
174
|
-
},
|
|
175
|
-
undefined,
|
|
176
|
-
],
|
|
177
|
-
]
|
|
171
|
+
{
|
|
172
|
+
"flexDirection": "row",
|
|
173
|
+
"opacity": 1,
|
|
174
|
+
}
|
|
178
175
|
}
|
|
179
176
|
>
|
|
180
177
|
<View
|
|
181
|
-
collapsable={false}
|
|
182
178
|
style={
|
|
183
|
-
|
|
184
|
-
|
|
179
|
+
[
|
|
180
|
+
{},
|
|
181
|
+
[
|
|
185
182
|
{
|
|
186
|
-
"
|
|
183
|
+
"alignItems": "center",
|
|
184
|
+
"height": 24,
|
|
185
|
+
"justifyContent": "center",
|
|
186
|
+
"width": 24,
|
|
187
187
|
},
|
|
188
|
+
undefined,
|
|
188
189
|
],
|
|
189
|
-
|
|
190
|
+
]
|
|
190
191
|
}
|
|
191
192
|
>
|
|
192
|
-
<
|
|
193
|
-
|
|
193
|
+
<View
|
|
194
|
+
collapsable={false}
|
|
194
195
|
style={
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
"color": "#001f23",
|
|
198
|
-
"fontSize": 16,
|
|
199
|
-
},
|
|
200
|
-
[
|
|
196
|
+
{
|
|
197
|
+
"transform": [
|
|
201
198
|
{
|
|
202
|
-
"
|
|
203
|
-
"lineHeight": 24,
|
|
204
|
-
"textAlign": "center",
|
|
205
|
-
"textAlignVertical": "center",
|
|
199
|
+
"rotate": "0deg",
|
|
206
200
|
},
|
|
207
|
-
{},
|
|
208
201
|
],
|
|
209
|
-
|
|
202
|
+
}
|
|
210
203
|
}
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
204
|
+
>
|
|
205
|
+
<HeroIcon
|
|
206
|
+
name="add"
|
|
207
|
+
style={
|
|
208
|
+
[
|
|
209
|
+
{
|
|
210
|
+
"color": "#001f23",
|
|
211
|
+
"fontSize": 16,
|
|
212
|
+
},
|
|
213
|
+
[
|
|
214
|
+
{
|
|
215
|
+
"color": "#ffffff",
|
|
216
|
+
"lineHeight": 24,
|
|
217
|
+
"textAlign": "center",
|
|
218
|
+
"textAlignVertical": "center",
|
|
219
|
+
},
|
|
220
|
+
{},
|
|
221
|
+
],
|
|
222
|
+
]
|
|
223
|
+
}
|
|
224
|
+
testID="animated-fab-icon"
|
|
225
|
+
themeIntent="text"
|
|
226
|
+
themeSize="xsmall"
|
|
227
|
+
/>
|
|
228
|
+
</View>
|
|
215
229
|
</View>
|
|
216
230
|
</View>
|
|
217
231
|
</View>
|
|
@@ -266,63 +280,96 @@ exports[`FAB when title has value renders correctly 1`] = `
|
|
|
266
280
|
onResponderTerminationRequest={[Function]}
|
|
267
281
|
onStartShouldSetResponder={[Function]}
|
|
268
282
|
style={
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
"shadowOpacity": 0.12,
|
|
285
|
-
"shadowRadius": 4,
|
|
283
|
+
{
|
|
284
|
+
"alignItems": "center",
|
|
285
|
+
"alignSelf": "flex-start",
|
|
286
|
+
"backgroundColor": "#001f23",
|
|
287
|
+
"borderRadius": 999,
|
|
288
|
+
"bottom": undefined,
|
|
289
|
+
"elevation": 3,
|
|
290
|
+
"flexDirection": "row",
|
|
291
|
+
"height": 64,
|
|
292
|
+
"justifyContent": "center",
|
|
293
|
+
"padding": 20,
|
|
294
|
+
"shadowColor": "#001f23",
|
|
295
|
+
"shadowOffset": {
|
|
296
|
+
"height": 2,
|
|
297
|
+
"width": 0,
|
|
286
298
|
},
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
},
|
|
299
|
+
"shadowOpacity": 0.12,
|
|
300
|
+
"shadowRadius": 4,
|
|
301
|
+
"transform": [
|
|
291
302
|
{
|
|
292
|
-
"
|
|
303
|
+
"translateY": 0,
|
|
293
304
|
},
|
|
294
305
|
],
|
|
295
|
-
|
|
306
|
+
}
|
|
296
307
|
}
|
|
297
308
|
>
|
|
298
309
|
<View
|
|
310
|
+
collapsable={false}
|
|
299
311
|
style={
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
"alignItems": "center",
|
|
305
|
-
"height": 24,
|
|
306
|
-
"justifyContent": "center",
|
|
307
|
-
"width": 24,
|
|
308
|
-
},
|
|
309
|
-
undefined,
|
|
310
|
-
],
|
|
311
|
-
]
|
|
312
|
+
{
|
|
313
|
+
"flexDirection": "row",
|
|
314
|
+
"opacity": 1,
|
|
315
|
+
}
|
|
312
316
|
}
|
|
313
317
|
>
|
|
314
|
-
<
|
|
315
|
-
|
|
318
|
+
<View
|
|
319
|
+
style={
|
|
320
|
+
[
|
|
321
|
+
{},
|
|
322
|
+
[
|
|
323
|
+
{
|
|
324
|
+
"alignItems": "center",
|
|
325
|
+
"height": 24,
|
|
326
|
+
"justifyContent": "center",
|
|
327
|
+
"width": 24,
|
|
328
|
+
},
|
|
329
|
+
undefined,
|
|
330
|
+
],
|
|
331
|
+
]
|
|
332
|
+
}
|
|
333
|
+
>
|
|
334
|
+
<HeroIcon
|
|
335
|
+
name="pencil"
|
|
336
|
+
style={
|
|
337
|
+
[
|
|
338
|
+
{
|
|
339
|
+
"color": "#001f23",
|
|
340
|
+
"fontSize": 16,
|
|
341
|
+
},
|
|
342
|
+
[
|
|
343
|
+
{
|
|
344
|
+
"color": "#ffffff",
|
|
345
|
+
"lineHeight": 24,
|
|
346
|
+
"textAlign": "center",
|
|
347
|
+
"textAlignVertical": "center",
|
|
348
|
+
},
|
|
349
|
+
undefined,
|
|
350
|
+
],
|
|
351
|
+
]
|
|
352
|
+
}
|
|
353
|
+
testID="styled-fab-icon"
|
|
354
|
+
themeIntent="text"
|
|
355
|
+
themeSize="xsmall"
|
|
356
|
+
/>
|
|
357
|
+
</View>
|
|
358
|
+
<Text
|
|
359
|
+
allowFontScaling={false}
|
|
316
360
|
style={
|
|
317
361
|
[
|
|
318
362
|
{
|
|
319
363
|
"color": "#001f23",
|
|
364
|
+
"fontFamily": "BeVietnamPro-Regular",
|
|
320
365
|
"fontSize": 16,
|
|
366
|
+
"letterSpacing": 0.48,
|
|
367
|
+
"lineHeight": 24,
|
|
321
368
|
},
|
|
322
369
|
[
|
|
323
370
|
{
|
|
324
371
|
"color": "#ffffff",
|
|
325
|
-
"
|
|
372
|
+
"marginHorizontal": 8,
|
|
326
373
|
"textAlign": "center",
|
|
327
374
|
"textAlignVertical": "center",
|
|
328
375
|
},
|
|
@@ -330,39 +377,13 @@ exports[`FAB when title has value renders correctly 1`] = `
|
|
|
330
377
|
],
|
|
331
378
|
]
|
|
332
379
|
}
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
380
|
+
themeIntent="body"
|
|
381
|
+
themeTypeface="neutral"
|
|
382
|
+
themeVariant="regular"
|
|
383
|
+
>
|
|
384
|
+
Shout out
|
|
385
|
+
</Text>
|
|
337
386
|
</View>
|
|
338
|
-
<Text
|
|
339
|
-
allowFontScaling={false}
|
|
340
|
-
style={
|
|
341
|
-
[
|
|
342
|
-
{
|
|
343
|
-
"color": "#001f23",
|
|
344
|
-
"fontFamily": "BeVietnamPro-Regular",
|
|
345
|
-
"fontSize": 16,
|
|
346
|
-
"letterSpacing": 0.48,
|
|
347
|
-
"lineHeight": 24,
|
|
348
|
-
},
|
|
349
|
-
[
|
|
350
|
-
{
|
|
351
|
-
"color": "#ffffff",
|
|
352
|
-
"marginHorizontal": 8,
|
|
353
|
-
"textAlign": "center",
|
|
354
|
-
"textAlignVertical": "center",
|
|
355
|
-
},
|
|
356
|
-
undefined,
|
|
357
|
-
],
|
|
358
|
-
]
|
|
359
|
-
}
|
|
360
|
-
themeIntent="body"
|
|
361
|
-
themeTypeface="neutral"
|
|
362
|
-
themeVariant="regular"
|
|
363
|
-
>
|
|
364
|
-
Shout out
|
|
365
|
-
</Text>
|
|
366
387
|
</View>
|
|
367
388
|
<View
|
|
368
389
|
pointerEvents="box-none"
|
|
@@ -5,6 +5,8 @@ import { FABProps } from '../FAB/FAB';
|
|
|
5
5
|
interface AnimatedFABProps {
|
|
6
6
|
fabProps: FABProps | ActionGroupProps;
|
|
7
7
|
contentOffsetY: Animated.Value;
|
|
8
|
+
contentHeight: Animated.Value;
|
|
9
|
+
layoutHeight: Animated.Value;
|
|
8
10
|
}
|
|
9
|
-
declare const AnimatedFAB: ({ fabProps, contentOffsetY }: AnimatedFABProps) => React.JSX.Element;
|
|
11
|
+
declare const AnimatedFAB: ({ fabProps, contentOffsetY, contentHeight, layoutHeight, }: AnimatedFABProps) => React.JSX.Element;
|
|
10
12
|
export default AnimatedFAB;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { FlatListProps, ScrollViewProps as RnScrollViewProps, SectionListProps } from 'react-native';
|
|
3
|
-
import { FABProps } from '../FAB/FAB';
|
|
4
3
|
import { ActionGroupProps } from '../FAB/ActionGroup';
|
|
4
|
+
import { FABProps } from '../FAB/FAB';
|
|
5
5
|
export interface AnimatedScrollerProps<T> {
|
|
6
6
|
/**
|
|
7
7
|
* Scroll component, it can be ScrollView, FlatList or SectionList.
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type { TextProps
|
|
3
|
-
import { TouchableHighlight } from 'react-native';
|
|
2
|
+
import type { TextProps } from 'react-native';
|
|
3
|
+
import { Animated, TouchableHighlight } from 'react-native';
|
|
4
4
|
import type { IconProps } from '../Icon';
|
|
5
|
-
declare const StyledFAB: import("@emotion/native").StyledComponent<TouchableHighlightProps & {
|
|
5
|
+
declare const StyledFAB: import("@emotion/native").StyledComponent<Animated.AnimatedProps<import("react-native").TouchableHighlightProps & import("react").RefAttributes<TouchableHighlight>> & {
|
|
6
6
|
theme?: import("@emotion/react").Theme | undefined;
|
|
7
7
|
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
8
8
|
} & {
|
|
9
9
|
themeActive?: boolean | undefined;
|
|
10
|
-
}, {}, {
|
|
11
|
-
ref?: import("react").Ref<TouchableHighlight> | undefined;
|
|
12
|
-
}>;
|
|
10
|
+
}, {}, {}>;
|
|
13
11
|
declare const StyledFABIcon: import("@emotion/native").StyledComponent<IconProps & {
|
|
14
12
|
theme?: import("@emotion/react").Theme | undefined;
|
|
15
13
|
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|