@hero-design/rn 8.130.1 → 8.130.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.
- package/CHANGELOG.md +6 -0
- package/README.md +11 -8
- package/es/index.js +9 -6
- package/jest.config.js +1 -1
- package/lib/index.js +9 -7
- package/package.json +1 -3
- package/rollup.config.mjs +0 -1
- package/src/components/Skeleton/index.tsx +16 -15
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @hero-design/rn
|
|
2
2
|
|
|
3
|
+
## 8.130.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#5111](https://github.com/Thinkei/hero-design/pull/5111) [`5c7a1ca03f77cf8a1113ce74b95d3bb3949bbe3a`](https://github.com/Thinkei/hero-design/commit/5c7a1ca03f77cf8a1113ce74b95d3bb3949bbe3a) Thanks [@haudao-eh](https://github.com/haudao-eh)! - Migrate Skeleton shimmer gradient from react-native-linear-gradient to expo-linear-gradient
|
|
8
|
+
|
|
3
9
|
## 8.130.1
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -18,8 +18,8 @@ yarn add @hero-design/react-native-month-year-picker@^8.43.2
|
|
|
18
18
|
yarn add @ptomasroos/react-native-multi-slider@^2.2.2
|
|
19
19
|
yarn add @react-native-community/datetimepicker@^3.5.2
|
|
20
20
|
yarn add @react-native-community/slider@^4.5.1
|
|
21
|
+
yarn add "expo-linear-gradient@>=14.0.0"
|
|
21
22
|
yarn add react-native-gesture-handler@~2.20.2
|
|
22
|
-
yarn add react-native-linear-gradient@^2.8.3
|
|
23
23
|
yarn add react-native-pager-view@^6.7.0
|
|
24
24
|
yarn add react-native-safe-area-context@^4.7.0
|
|
25
25
|
yarn add react-native-svg@^15.11.2
|
|
@@ -28,6 +28,7 @@ yarn add react-native-webview@^13.10.2
|
|
|
28
28
|
```
|
|
29
29
|
|
|
30
30
|
**Requirements:**
|
|
31
|
+
|
|
31
32
|
- React 18.3.1
|
|
32
33
|
- React Native 0.77.3
|
|
33
34
|
- Node.js >= 20.0.0 (20.x or 22.x supported)
|
|
@@ -44,11 +45,17 @@ Wrap your application with `HeroDesignProvider` to enable theming, localization,
|
|
|
44
45
|
|
|
45
46
|
```tsx
|
|
46
47
|
import React from 'react';
|
|
47
|
-
import {
|
|
48
|
+
import {
|
|
49
|
+
HeroDesignProvider,
|
|
50
|
+
getTheme,
|
|
51
|
+
Button,
|
|
52
|
+
Card,
|
|
53
|
+
Typography,
|
|
54
|
+
} from '@hero-design/rn';
|
|
48
55
|
|
|
49
56
|
function App() {
|
|
50
57
|
const theme = getTheme();
|
|
51
|
-
|
|
58
|
+
|
|
52
59
|
return (
|
|
53
60
|
<HeroDesignProvider theme={theme}>
|
|
54
61
|
<Card>
|
|
@@ -72,11 +79,7 @@ For product-specific themes, use `ThemeSwitcher` which provides a predefined the
|
|
|
72
79
|
import { ThemeSwitcher } from '@hero-design/rn';
|
|
73
80
|
|
|
74
81
|
function App() {
|
|
75
|
-
return
|
|
76
|
-
<ThemeSwitcher name="ehWork">
|
|
77
|
-
{/* Your app */}
|
|
78
|
-
</ThemeSwitcher>
|
|
79
|
-
);
|
|
82
|
+
return <ThemeSwitcher name="ehWork">{/* Your app */}</ThemeSwitcher>;
|
|
80
83
|
}
|
|
81
84
|
```
|
|
82
85
|
|
package/es/index.js
CHANGED
|
@@ -12,7 +12,6 @@ import DateTimePicker from '@react-native-community/datetimepicker';
|
|
|
12
12
|
import RnSlider from '@react-native-community/slider';
|
|
13
13
|
import MultiSlider from '@ptomasroos/react-native-multi-slider';
|
|
14
14
|
import { RectButton, GestureHandlerRootView, Swipeable as Swipeable$1 } from 'react-native-gesture-handler';
|
|
15
|
-
import LinearGradient$1 from 'react-native-linear-gradient';
|
|
16
15
|
import PagerView from 'react-native-pager-view';
|
|
17
16
|
import { EventEmitter } from 'events';
|
|
18
17
|
import { WebView } from 'react-native-webview';
|
|
@@ -27530,7 +27529,6 @@ var StyledGradientContainer = index$c(Box)(function (_ref2) {
|
|
|
27530
27529
|
});
|
|
27531
27530
|
|
|
27532
27531
|
var _excluded$b = ["intent", "variant", "style", "onLayout"];
|
|
27533
|
-
var AnimatedLinearGradient = Animated.createAnimatedComponent(LinearGradient$1);
|
|
27534
27532
|
var gradientPositions = {
|
|
27535
27533
|
start: {
|
|
27536
27534
|
x: 0,
|
|
@@ -27604,18 +27602,23 @@ var Skeleton = function Skeleton(_ref) {
|
|
|
27604
27602
|
onLayout: onContainerLayout
|
|
27605
27603
|
}, props), /*#__PURE__*/React__default.createElement(StyledGradientContainer, {
|
|
27606
27604
|
themeVariant: variant
|
|
27607
|
-
}, /*#__PURE__*/React__default.createElement(
|
|
27608
|
-
start: gradientPositions.start,
|
|
27609
|
-
end: gradientPositions.end,
|
|
27605
|
+
}, /*#__PURE__*/React__default.createElement(Animated.View, {
|
|
27610
27606
|
style: {
|
|
27611
27607
|
width: '100%',
|
|
27612
27608
|
height: '100%',
|
|
27613
27609
|
transform: [{
|
|
27614
27610
|
translateX: translateX
|
|
27615
27611
|
}]
|
|
27612
|
+
}
|
|
27613
|
+
}, /*#__PURE__*/React__default.createElement(LinearGradient, {
|
|
27614
|
+
start: gradientPositions.start,
|
|
27615
|
+
end: gradientPositions.end,
|
|
27616
|
+
style: {
|
|
27617
|
+
width: '100%',
|
|
27618
|
+
height: '100%'
|
|
27616
27619
|
},
|
|
27617
27620
|
colors: colors
|
|
27618
|
-
})));
|
|
27621
|
+
}))));
|
|
27619
27622
|
};
|
|
27620
27623
|
|
|
27621
27624
|
var StyledSuccessContainer = index$c(View)(function (_ref) {
|
package/jest.config.js
CHANGED
|
@@ -19,6 +19,6 @@ module.exports = {
|
|
|
19
19
|
roots: ['<rootDir>/src'],
|
|
20
20
|
snapshotSerializers: ['@emotion/jest/serializer'],
|
|
21
21
|
transformIgnorePatterns: [
|
|
22
|
-
'node_modules/(?!((jest-)?@react-native|@emotion/.*|react-native|react-native-
|
|
22
|
+
'node_modules/(?!((jest-)?@react-native|@emotion/.*|react-native|react-native-pager-view|@react-native-community|@react-native-masked-view|expo-linear-gradient|nanoid|d3|d3-.*|internmap|delaunator|robust-predicates)/)',
|
|
23
23
|
],
|
|
24
24
|
};
|
package/lib/index.js
CHANGED
|
@@ -12,7 +12,6 @@ var DateTimePicker = require('@react-native-community/datetimepicker');
|
|
|
12
12
|
var RnSlider = require('@react-native-community/slider');
|
|
13
13
|
var MultiSlider = require('@ptomasroos/react-native-multi-slider');
|
|
14
14
|
var reactNativeGestureHandler = require('react-native-gesture-handler');
|
|
15
|
-
var LinearGradient = require('react-native-linear-gradient');
|
|
16
15
|
var PagerView = require('react-native-pager-view');
|
|
17
16
|
var events = require('events');
|
|
18
17
|
var reactNativeWebview = require('react-native-webview');
|
|
@@ -44,7 +43,6 @@ var Svg__default = /*#__PURE__*/_interopDefaultCompat(Svg);
|
|
|
44
43
|
var DateTimePicker__default = /*#__PURE__*/_interopDefaultCompat(DateTimePicker);
|
|
45
44
|
var RnSlider__default = /*#__PURE__*/_interopDefaultCompat(RnSlider);
|
|
46
45
|
var MultiSlider__default = /*#__PURE__*/_interopDefaultCompat(MultiSlider);
|
|
47
|
-
var LinearGradient__default = /*#__PURE__*/_interopDefaultCompat(LinearGradient);
|
|
48
46
|
var PagerView__default = /*#__PURE__*/_interopDefaultCompat(PagerView);
|
|
49
47
|
|
|
50
48
|
function _arrayLikeToArray(r, a) {
|
|
@@ -27560,7 +27558,6 @@ var StyledGradientContainer = index$c(Box)(function (_ref2) {
|
|
|
27560
27558
|
});
|
|
27561
27559
|
|
|
27562
27560
|
var _excluded$b = ["intent", "variant", "style", "onLayout"];
|
|
27563
|
-
var AnimatedLinearGradient = reactNative.Animated.createAnimatedComponent(LinearGradient__default.default);
|
|
27564
27561
|
var gradientPositions = {
|
|
27565
27562
|
start: {
|
|
27566
27563
|
x: 0,
|
|
@@ -27634,18 +27631,23 @@ var Skeleton = function Skeleton(_ref) {
|
|
|
27634
27631
|
onLayout: onContainerLayout
|
|
27635
27632
|
}, props), /*#__PURE__*/React__namespace.default.createElement(StyledGradientContainer, {
|
|
27636
27633
|
themeVariant: variant
|
|
27637
|
-
}, /*#__PURE__*/React__namespace.default.createElement(
|
|
27638
|
-
start: gradientPositions.start,
|
|
27639
|
-
end: gradientPositions.end,
|
|
27634
|
+
}, /*#__PURE__*/React__namespace.default.createElement(reactNative.Animated.View, {
|
|
27640
27635
|
style: {
|
|
27641
27636
|
width: '100%',
|
|
27642
27637
|
height: '100%',
|
|
27643
27638
|
transform: [{
|
|
27644
27639
|
translateX: translateX
|
|
27645
27640
|
}]
|
|
27641
|
+
}
|
|
27642
|
+
}, /*#__PURE__*/React__namespace.default.createElement(expoLinearGradient.LinearGradient, {
|
|
27643
|
+
start: gradientPositions.start,
|
|
27644
|
+
end: gradientPositions.end,
|
|
27645
|
+
style: {
|
|
27646
|
+
width: '100%',
|
|
27647
|
+
height: '100%'
|
|
27646
27648
|
},
|
|
27647
27649
|
colors: colors
|
|
27648
|
-
})));
|
|
27650
|
+
}))));
|
|
27649
27651
|
};
|
|
27650
27652
|
|
|
27651
27653
|
var StyledSuccessContainer = index$c(reactNative.View)(function (_ref) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hero-design/rn",
|
|
3
|
-
"version": "8.130.
|
|
3
|
+
"version": "8.130.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -45,7 +45,6 @@
|
|
|
45
45
|
"react": "19.1.0",
|
|
46
46
|
"react-native": "0.81.5",
|
|
47
47
|
"react-native-gesture-handler": "~2.28.0",
|
|
48
|
-
"react-native-linear-gradient": "^2.8.3",
|
|
49
48
|
"react-native-pager-view": "^6.7.0",
|
|
50
49
|
"react-native-safe-area-context": "~5.6.0",
|
|
51
50
|
"react-native-svg": "^15.11.2",
|
|
@@ -100,7 +99,6 @@
|
|
|
100
99
|
"react-dom": "19.1.0",
|
|
101
100
|
"react-native": "0.81.5",
|
|
102
101
|
"react-native-gesture-handler": "~2.28.0",
|
|
103
|
-
"react-native-linear-gradient": "2.8.3",
|
|
104
102
|
"react-native-pager-view": "6.9.1",
|
|
105
103
|
"react-native-safe-area-context": "~5.6.0",
|
|
106
104
|
"react-native-svg": "15.12.1",
|
package/rollup.config.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import LinearGradient from '
|
|
1
|
+
import { LinearGradient } from 'expo-linear-gradient';
|
|
2
2
|
import React, {
|
|
3
3
|
useEffect,
|
|
4
4
|
useMemo,
|
|
@@ -6,7 +6,7 @@ import React, {
|
|
|
6
6
|
useCallback,
|
|
7
7
|
useRef,
|
|
8
8
|
} from 'react';
|
|
9
|
-
import type { LayoutChangeEvent, ViewProps } from 'react-native';
|
|
9
|
+
import type { ColorValue, LayoutChangeEvent, ViewProps } from 'react-native';
|
|
10
10
|
import { Animated, Easing, Platform, StyleSheet } from 'react-native';
|
|
11
11
|
import type { Theme } from '../../theme';
|
|
12
12
|
import { useTheme } from '../../theme';
|
|
@@ -23,14 +23,15 @@ interface SkeletonProps extends ViewProps {
|
|
|
23
23
|
variant?: 'circular' | 'rectangular' | 'rounded';
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
const AnimatedLinearGradient = Animated.createAnimatedComponent(LinearGradient);
|
|
27
|
-
|
|
28
26
|
const gradientPositions = {
|
|
29
27
|
start: { x: 0, y: 0 },
|
|
30
28
|
end: { x: 1, y: 0 },
|
|
31
29
|
};
|
|
32
30
|
|
|
33
|
-
const getGradientColors = (
|
|
31
|
+
const getGradientColors = (
|
|
32
|
+
theme: Theme,
|
|
33
|
+
intent: 'light' | 'dark'
|
|
34
|
+
): [ColorValue, ColorValue, ColorValue] => {
|
|
34
35
|
switch (intent) {
|
|
35
36
|
case 'light': {
|
|
36
37
|
return [
|
|
@@ -107,16 +108,16 @@ const Skeleton = ({
|
|
|
107
108
|
{...props}
|
|
108
109
|
>
|
|
109
110
|
<StyledGradientContainer themeVariant={variant}>
|
|
110
|
-
<
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
111
|
+
<Animated.View
|
|
112
|
+
style={{ width: '100%', height: '100%', transform: [{ translateX }] }}
|
|
113
|
+
>
|
|
114
|
+
<LinearGradient
|
|
115
|
+
start={gradientPositions.start}
|
|
116
|
+
end={gradientPositions.end}
|
|
117
|
+
style={{ width: '100%', height: '100%' }}
|
|
118
|
+
colors={colors}
|
|
119
|
+
/>
|
|
120
|
+
</Animated.View>
|
|
120
121
|
</StyledGradientContainer>
|
|
121
122
|
</StyledContainer>
|
|
122
123
|
);
|