@hero-design/rn 8.30.3 → 8.30.4
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/es/index.js +70 -169
- package/lib/index.js +70 -169
- package/package.json +5 -5
- package/src/components/Carousel/__tests__/__snapshots__/index.spec.tsx.snap +3 -33
- package/src/components/Carousel/index.tsx +18 -5
- package/src/components/FAB/ActionGroup/__tests__/__snapshots__/index.spec.tsx.snap +818 -981
- package/src/components/FAB/ActionGroup/__tests__/index.spec.tsx +11 -4
- package/src/components/FAB/ActionGroup/index.tsx +98 -142
- package/src/components/FAB/AnimatedFABIcon.tsx +5 -3
- package/src/components/FAB/FAB.tsx +28 -112
- package/src/components/FAB/__tests__/__snapshots__/index.spec.tsx.snap +9 -27
- package/src/components/FAB/__tests__/index.spec.tsx +2 -22
- package/src/components/Skeleton/__tests__/__snapshots__/index.spec.tsx.snap +14 -14
- package/src/components/Skeleton/index.tsx +3 -7
- package/src/types.ts +0 -4
- package/testUtils/setup.tsx +0 -2
- package/types/components/FAB/ActionGroup/StyledActionGroup.d.ts +1 -1
- package/types/components/FAB/ActionGroup/index.d.ts +1 -7
- package/types/components/FAB/FAB.d.ts +2 -8
- package/types/components/FAB/index.d.ts +2 -3
- package/types/types.d.ts +1 -3
|
@@ -57,13 +57,13 @@ exports[`Skeleton renders correctly by default 1`] = `
|
|
|
57
57
|
}
|
|
58
58
|
style={
|
|
59
59
|
Object {
|
|
60
|
-
"height":
|
|
60
|
+
"height": "100%",
|
|
61
61
|
"transform": Array [
|
|
62
62
|
Object {
|
|
63
63
|
"translateX": -0,
|
|
64
64
|
},
|
|
65
65
|
],
|
|
66
|
-
"width":
|
|
66
|
+
"width": "100%",
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
/>
|
|
@@ -128,13 +128,13 @@ exports[`Skeleton renders correctly when intent is dark and variant is circular
|
|
|
128
128
|
}
|
|
129
129
|
style={
|
|
130
130
|
Object {
|
|
131
|
-
"height":
|
|
131
|
+
"height": "100%",
|
|
132
132
|
"transform": Array [
|
|
133
133
|
Object {
|
|
134
134
|
"translateX": -0,
|
|
135
135
|
},
|
|
136
136
|
],
|
|
137
|
-
"width":
|
|
137
|
+
"width": "100%",
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
140
|
/>
|
|
@@ -199,13 +199,13 @@ exports[`Skeleton renders correctly when intent is dark and variant is rectangul
|
|
|
199
199
|
}
|
|
200
200
|
style={
|
|
201
201
|
Object {
|
|
202
|
-
"height":
|
|
202
|
+
"height": "100%",
|
|
203
203
|
"transform": Array [
|
|
204
204
|
Object {
|
|
205
205
|
"translateX": -0,
|
|
206
206
|
},
|
|
207
207
|
],
|
|
208
|
-
"width":
|
|
208
|
+
"width": "100%",
|
|
209
209
|
}
|
|
210
210
|
}
|
|
211
211
|
/>
|
|
@@ -270,13 +270,13 @@ exports[`Skeleton renders correctly when intent is dark and variant is rounded 1
|
|
|
270
270
|
}
|
|
271
271
|
style={
|
|
272
272
|
Object {
|
|
273
|
-
"height":
|
|
273
|
+
"height": "100%",
|
|
274
274
|
"transform": Array [
|
|
275
275
|
Object {
|
|
276
276
|
"translateX": -0,
|
|
277
277
|
},
|
|
278
278
|
],
|
|
279
|
-
"width":
|
|
279
|
+
"width": "100%",
|
|
280
280
|
}
|
|
281
281
|
}
|
|
282
282
|
/>
|
|
@@ -341,13 +341,13 @@ exports[`Skeleton renders correctly when intent is light and variant is circular
|
|
|
341
341
|
}
|
|
342
342
|
style={
|
|
343
343
|
Object {
|
|
344
|
-
"height":
|
|
344
|
+
"height": "100%",
|
|
345
345
|
"transform": Array [
|
|
346
346
|
Object {
|
|
347
347
|
"translateX": -0,
|
|
348
348
|
},
|
|
349
349
|
],
|
|
350
|
-
"width":
|
|
350
|
+
"width": "100%",
|
|
351
351
|
}
|
|
352
352
|
}
|
|
353
353
|
/>
|
|
@@ -412,13 +412,13 @@ exports[`Skeleton renders correctly when intent is light and variant is rectangu
|
|
|
412
412
|
}
|
|
413
413
|
style={
|
|
414
414
|
Object {
|
|
415
|
-
"height":
|
|
415
|
+
"height": "100%",
|
|
416
416
|
"transform": Array [
|
|
417
417
|
Object {
|
|
418
418
|
"translateX": -0,
|
|
419
419
|
},
|
|
420
420
|
],
|
|
421
|
-
"width":
|
|
421
|
+
"width": "100%",
|
|
422
422
|
}
|
|
423
423
|
}
|
|
424
424
|
/>
|
|
@@ -483,13 +483,13 @@ exports[`Skeleton renders correctly when intent is light and variant is rounded
|
|
|
483
483
|
}
|
|
484
484
|
style={
|
|
485
485
|
Object {
|
|
486
|
-
"height":
|
|
486
|
+
"height": "100%",
|
|
487
487
|
"transform": Array [
|
|
488
488
|
Object {
|
|
489
489
|
"translateX": -0,
|
|
490
490
|
},
|
|
491
491
|
],
|
|
492
|
-
"width":
|
|
492
|
+
"width": "100%",
|
|
493
493
|
}
|
|
494
494
|
}
|
|
495
495
|
/>
|
|
@@ -69,9 +69,6 @@ const Skeleton = ({
|
|
|
69
69
|
const [containerWidth, setContainerWidth] = useState(
|
|
70
70
|
Number(StyleSheet.flatten(style)?.width) || 0
|
|
71
71
|
);
|
|
72
|
-
const [containerHeight, setContainerHeight] = useState(
|
|
73
|
-
Number(StyleSheet.flatten(style)?.height) || 0
|
|
74
|
-
);
|
|
75
72
|
|
|
76
73
|
const [shouldStartAnimation, setShouldStartAnimation] = useState(false);
|
|
77
74
|
|
|
@@ -96,8 +93,7 @@ const Skeleton = ({
|
|
|
96
93
|
});
|
|
97
94
|
|
|
98
95
|
const onContainerLayout = useCallback((e: LayoutChangeEvent) => {
|
|
99
|
-
const { width
|
|
100
|
-
setContainerHeight(height);
|
|
96
|
+
const { width } = e.nativeEvent.layout;
|
|
101
97
|
setContainerWidth(width);
|
|
102
98
|
|
|
103
99
|
if (!shouldStartAnimation) {
|
|
@@ -120,8 +116,8 @@ const Skeleton = ({
|
|
|
120
116
|
start={gradientPositions.start}
|
|
121
117
|
end={gradientPositions.end}
|
|
122
118
|
style={{
|
|
123
|
-
width:
|
|
124
|
-
height:
|
|
119
|
+
width: '100%',
|
|
120
|
+
height: '100%',
|
|
125
121
|
transform: [{ translateX }],
|
|
126
122
|
}}
|
|
127
123
|
colors={colors}
|
package/src/types.ts
CHANGED
|
@@ -15,8 +15,6 @@ import type {
|
|
|
15
15
|
import { SwipeableProps } from './components/Swipeable';
|
|
16
16
|
import { TextProps } from './components/Typography/Text';
|
|
17
17
|
import { CardCarouselHandles } from './components/Carousel/CardCarousel';
|
|
18
|
-
import { FABHandles } from './components/FAB/FAB';
|
|
19
|
-
import { ActionGroupHandles } from './components/FAB/ActionGroup';
|
|
20
18
|
|
|
21
19
|
export type {
|
|
22
20
|
BottomNavigationTabType,
|
|
@@ -34,6 +32,4 @@ export type {
|
|
|
34
32
|
TextInputHandles,
|
|
35
33
|
Theme,
|
|
36
34
|
CardCarouselHandles,
|
|
37
|
-
FABHandles,
|
|
38
|
-
ActionGroupHandles,
|
|
39
35
|
};
|
package/testUtils/setup.tsx
CHANGED
|
@@ -11,7 +11,6 @@ jest.mock('react-native', () => {
|
|
|
11
11
|
const RN = jest.requireActual('react-native');
|
|
12
12
|
|
|
13
13
|
const mockedAnimatedFunctions = {
|
|
14
|
-
setImmediate: () => jest.fn(),
|
|
15
14
|
start: () => jest.fn(),
|
|
16
15
|
stop: () => jest.fn(),
|
|
17
16
|
_isUsingNativeDriver: () => jest.fn(),
|
|
@@ -20,7 +19,6 @@ jest.mock('react-native', () => {
|
|
|
20
19
|
|
|
21
20
|
RN.Animated.timing = () => mockedAnimatedFunctions;
|
|
22
21
|
RN.Animated.spring = () => mockedAnimatedFunctions;
|
|
23
|
-
RN.Animated.stagger = () => mockedAnimatedFunctions;
|
|
24
22
|
|
|
25
23
|
return RN;
|
|
26
24
|
});
|
|
@@ -14,7 +14,7 @@ declare const StyledActionGroupContainer: import("@emotion/native").StyledCompon
|
|
|
14
14
|
theme?: import("@emotion/react").Theme | undefined;
|
|
15
15
|
as?: import("react").ElementType<any> | undefined;
|
|
16
16
|
}, {}, {}>;
|
|
17
|
-
declare const StyledFAB: import("@emotion/native").StyledComponent<import("../FAB").FABProps &
|
|
17
|
+
declare const StyledFAB: import("@emotion/native").StyledComponent<import("../FAB").FABProps & {
|
|
18
18
|
theme?: import("@emotion/react").Theme | undefined;
|
|
19
19
|
as?: import("react").ElementType<any> | undefined;
|
|
20
20
|
}, {}, {}>;
|
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import type { StyleProp, ViewStyle } from 'react-native';
|
|
3
2
|
import type { IconName } from '../../Icon';
|
|
4
3
|
import type { ActionItemProps } from './ActionItem';
|
|
5
|
-
export declare type ActionGroupHandles = {
|
|
6
|
-
showFAB: () => void;
|
|
7
|
-
collapseFAB: () => void;
|
|
8
|
-
hideFAB: () => void;
|
|
9
|
-
};
|
|
10
4
|
export interface ActionGroupProps {
|
|
11
5
|
/**
|
|
12
6
|
* Title of the action group header.
|
|
@@ -41,5 +35,5 @@ export interface ActionGroupProps {
|
|
|
41
35
|
*/
|
|
42
36
|
testID?: string;
|
|
43
37
|
}
|
|
44
|
-
declare const ActionGroup:
|
|
38
|
+
declare const ActionGroup: ({ headerTitle, onPress, active, style, items, testID, fabTitle, fabIcon, }: ActionGroupProps) => JSX.Element;
|
|
45
39
|
export default ActionGroup;
|
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { StyleProp, ViewStyle } from 'react-native';
|
|
1
|
+
import type { StyleProp, ViewStyle } from 'react-native';
|
|
3
2
|
import type { IconName } from '../Icon';
|
|
4
|
-
export declare type FABHandles = {
|
|
5
|
-
show: () => void;
|
|
6
|
-
collapse: () => void;
|
|
7
|
-
hide: () => void;
|
|
8
|
-
};
|
|
9
3
|
export interface FABProps {
|
|
10
4
|
/**
|
|
11
5
|
* Name of the Icon.
|
|
@@ -36,5 +30,5 @@ export interface FABProps {
|
|
|
36
30
|
*/
|
|
37
31
|
testID?: string;
|
|
38
32
|
}
|
|
39
|
-
declare const FAB:
|
|
33
|
+
declare const FAB: ({ onPress, title, icon, animated, testID, active, style, }: FABProps) => JSX.Element;
|
|
40
34
|
export default FAB;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
ActionGroup: import("react").ForwardRefExoticComponent<import("./ActionGroup").ActionGroupProps & import("react").RefAttributes<import("./ActionGroup").ActionGroupHandles>>;
|
|
1
|
+
declare const _default: (({ onPress, title, icon, animated, testID, active, style, }: import("./FAB").FABProps) => JSX.Element) & {
|
|
2
|
+
ActionGroup: ({ headerTitle, onPress, active, style, items, testID, fabTitle, fabIcon, }: import("./ActionGroup").ActionGroupProps) => JSX.Element;
|
|
4
3
|
};
|
|
5
4
|
export default _default;
|
package/types/types.d.ts
CHANGED
|
@@ -9,6 +9,4 @@ import type { ListRenderOptionInfo, SectionListRenderOptionInfo } from './compon
|
|
|
9
9
|
import { SwipeableProps } from './components/Swipeable';
|
|
10
10
|
import { TextProps } from './components/Typography/Text';
|
|
11
11
|
import { CardCarouselHandles } from './components/Carousel/CardCarousel';
|
|
12
|
-
|
|
13
|
-
import { ActionGroupHandles } from './components/FAB/ActionGroup';
|
|
14
|
-
export type { BottomNavigationTabType, IconName, SingleSelectProps, MultiSelectProps, ListRenderOptionInfo, SectionListRenderOptionInfo, SwipeableProps, RichTextEditorProps, RichTextEditorRef, TabType, TextInputProps, TextProps, TextInputHandles, Theme, CardCarouselHandles, FABHandles, ActionGroupHandles, };
|
|
12
|
+
export type { BottomNavigationTabType, IconName, SingleSelectProps, MultiSelectProps, ListRenderOptionInfo, SectionListRenderOptionInfo, SwipeableProps, RichTextEditorProps, RichTextEditorRef, TabType, TextInputProps, TextProps, TextInputHandles, Theme, CardCarouselHandles, };
|