@hero-design/rn 8.36.2 → 8.37.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/es/index.js +54 -90
- package/lib/index.js +54 -90
- package/package.json +7 -7
- package/src/components/Carousel/StyledCardCarousel.tsx +1 -1
- package/src/components/Carousel/__tests__/__snapshots__/CardCarousel.spec.tsx.snap +8 -8
- package/src/components/Checkbox/StyledCheckbox.tsx +7 -14
- package/src/components/Checkbox/__tests__/StyledCheckbox.spec.tsx +8 -12
- package/src/components/Checkbox/__tests__/__snapshots__/StyledCheckbox.spec.tsx.snap +4 -88
- package/src/components/Checkbox/__tests__/__snapshots__/index.spec.tsx.snap +12 -324
- package/src/components/Checkbox/__tests__/index.spec.tsx +7 -12
- package/src/components/Checkbox/index.tsx +7 -1
- package/src/components/Drawer/__tests__/__snapshots__/index.spec.tsx.snap +3 -3
- package/src/components/Drawer/index.tsx +3 -3
- package/src/components/FAB/ActionGroup/StyledActionGroup.tsx +4 -15
- package/src/components/FAB/ActionGroup/__tests__/__snapshots__/index.spec.tsx.snap +18 -48
- package/src/components/FAB/ActionGroup/__tests__/index.spec.tsx +36 -29
- package/src/components/FAB/ActionGroup/index.tsx +18 -29
- package/src/components/FAB/StyledFAB.tsx +1 -1
- package/src/components/FAB/__tests__/__snapshots__/StyledFAB.spec.tsx.snap +4 -4
- package/src/components/FAB/__tests__/__snapshots__/index.spec.tsx.snap +6 -6
- package/src/components/List/StyledListItem.tsx +5 -5
- package/src/components/List/__tests__/__snapshots__/StyledListItem.spec.tsx.snap +6 -6
- package/src/components/TextInput/__tests__/StyledTextInput.spec.tsx +2 -2
- package/src/components/TextInput/__tests__/__snapshots__/StyledTextInput.spec.tsx.snap +5 -14
- package/src/components/Toast/StyledToast.tsx +1 -1
- package/src/components/Toast/__tests__/__snapshots__/Toast.spec.tsx.snap +7 -7
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +20 -23
- package/src/theme/components/cardCarousel.ts +5 -5
- package/src/theme/components/fab.ts +5 -11
- package/src/theme/components/list.ts +7 -4
- package/src/theme/components/toast.ts +5 -5
- package/src/theme/global/shadows.ts +3 -3
- package/types/components/Checkbox/StyledCheckbox.d.ts +0 -1
- package/types/components/Checkbox/index.d.ts +1 -0
- package/types/components/FAB/ActionGroup/StyledActionGroup.d.ts +2 -7
- package/types/components/FAB/ActionGroup/index.d.ts +5 -0
- package/types/theme/components/cardCarousel.d.ts +1 -1
- package/types/theme/components/fab.d.ts +1 -7
- package/types/theme/components/list.d.ts +9 -6
- package/types/theme/components/toast.d.ts +1 -1
package/lib/index.js
CHANGED
|
@@ -1700,10 +1700,10 @@ var getShadows = function getShadows(systemPalette) {
|
|
|
1700
1700
|
width: 0,
|
|
1701
1701
|
height: 2
|
|
1702
1702
|
},
|
|
1703
|
-
shadowColor: systemPalette.
|
|
1704
|
-
shadowOpacity:
|
|
1703
|
+
shadowColor: systemPalette.primaryOutline,
|
|
1704
|
+
shadowOpacity: 0.12,
|
|
1705
1705
|
shadowRadius: 4,
|
|
1706
|
-
elevation:
|
|
1706
|
+
elevation: 3
|
|
1707
1707
|
}
|
|
1708
1708
|
};
|
|
1709
1709
|
};
|
|
@@ -2126,17 +2126,14 @@ var getCardCarouselTheme = function getCardCarouselTheme(theme) {
|
|
|
2126
2126
|
contentContainerPaddingHorizontal: theme.space.large
|
|
2127
2127
|
};
|
|
2128
2128
|
var colors = {
|
|
2129
|
-
shadow: theme.colors.primaryOutline,
|
|
2130
2129
|
carouselItemBackground: theme.colors.defaultSurface
|
|
2131
2130
|
};
|
|
2132
2131
|
var shadows = {
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
radius: theme.radii.medium,
|
|
2139
|
-
elevation: 4
|
|
2132
|
+
color: theme.shadows["default"].shadowColor,
|
|
2133
|
+
offset: theme.shadows["default"].shadowOffset,
|
|
2134
|
+
opacity: theme.shadows["default"].shadowOpacity,
|
|
2135
|
+
radius: theme.shadows["default"].shadowRadius,
|
|
2136
|
+
elevation: theme.shadows["default"].elevation
|
|
2140
2137
|
};
|
|
2141
2138
|
var radii = {
|
|
2142
2139
|
card: theme.radii.medium
|
|
@@ -2338,13 +2335,11 @@ var getFABTheme = function getFABTheme(theme) {
|
|
|
2338
2335
|
buttonPressedBackground: theme.colors.pressedSurface,
|
|
2339
2336
|
buttonActiveBackground: theme.colors.pressedSurface,
|
|
2340
2337
|
icon: theme.colors.onPrimary,
|
|
2341
|
-
headerText: theme.colors.onDefaultGlobalSurface,
|
|
2342
2338
|
actionItemBackground: theme.colors.secondary,
|
|
2343
2339
|
actionItemPressedBackground: theme.colors.pressedSurface,
|
|
2344
2340
|
backdropBackground: theme.colors.overlayGlobalSurface,
|
|
2345
2341
|
titleText: theme.colors.onPrimary,
|
|
2346
|
-
actionItemText: theme.colors.onPrimary
|
|
2347
|
-
shadow: theme.colors.primaryOutline
|
|
2342
|
+
actionItemText: theme.colors.onPrimary
|
|
2348
2343
|
};
|
|
2349
2344
|
var sizes = {
|
|
2350
2345
|
width: theme.sizes.xxxxxlarge,
|
|
@@ -2353,29 +2348,24 @@ var getFABTheme = function getFABTheme(theme) {
|
|
|
2353
2348
|
iconContainerHeight: theme.sizes.large
|
|
2354
2349
|
};
|
|
2355
2350
|
var fonts = {
|
|
2356
|
-
header: theme.fonts.neutral.semiBold,
|
|
2357
2351
|
actionItemText: theme.fonts.neutral.regular,
|
|
2358
2352
|
title: theme.fonts.neutral.semiBold
|
|
2359
2353
|
};
|
|
2360
2354
|
var fontSizes = {
|
|
2361
|
-
header: theme.fontSizes.xxxlarge,
|
|
2362
2355
|
actionItemText: theme.fontSizes.large,
|
|
2363
2356
|
title: theme.fontSizes.large
|
|
2364
2357
|
};
|
|
2365
2358
|
var lineHeights = {
|
|
2366
|
-
header: theme.lineHeights.xxxlarge,
|
|
2367
2359
|
actionItemText: theme.lineHeights.medium,
|
|
2368
2360
|
title: theme.lineHeights.large,
|
|
2369
2361
|
icon: theme.lineHeights.large
|
|
2370
2362
|
};
|
|
2371
2363
|
var shadows = {
|
|
2372
|
-
offset:
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
radius: theme.radii.medium,
|
|
2378
|
-
elevation: 2
|
|
2364
|
+
offset: theme.shadows["default"].shadowOffset,
|
|
2365
|
+
opacity: theme.shadows["default"].shadowOpacity,
|
|
2366
|
+
radius: theme.shadows["default"].shadowRadius,
|
|
2367
|
+
elevation: theme.shadows["default"].elevation,
|
|
2368
|
+
color: theme.shadows["default"].shadowColor
|
|
2379
2369
|
};
|
|
2380
2370
|
var space = {
|
|
2381
2371
|
actionItemPadding: theme.space.smallMedium,
|
|
@@ -2384,8 +2374,6 @@ var getFABTheme = function getFABTheme(theme) {
|
|
|
2384
2374
|
actionItemTextPaddingLeft: theme.space.xsmall,
|
|
2385
2375
|
buttonMarginTop: theme.space.large,
|
|
2386
2376
|
buttonMarginRight: theme.space.large,
|
|
2387
|
-
headerTextMarginRight: theme.space.large,
|
|
2388
|
-
headerTextMarginBottom: theme.space.large,
|
|
2389
2377
|
containerPadding: theme.space.large - theme.space.xsmall,
|
|
2390
2378
|
titleMarginHorizontal: theme.space.small
|
|
2391
2379
|
};
|
|
@@ -2460,20 +2448,23 @@ var getListTheme = function getListTheme(theme) {
|
|
|
2460
2448
|
var radii = {
|
|
2461
2449
|
item: theme.radii.medium,
|
|
2462
2450
|
basicItem: theme.radii.base,
|
|
2463
|
-
cardShadow: theme.radii.base,
|
|
2464
2451
|
leadingStatus: theme.radii.rounded
|
|
2465
2452
|
};
|
|
2466
2453
|
var shadows = {
|
|
2467
|
-
|
|
2468
|
-
|
|
2454
|
+
card: {
|
|
2455
|
+
offset: theme.shadows["default"].shadowOffset,
|
|
2456
|
+
elevation: theme.shadows["default"].elevation,
|
|
2457
|
+
color: theme.shadows["default"].shadowColor,
|
|
2458
|
+
radius: theme.shadows["default"].shadowRadius,
|
|
2459
|
+
opacity: theme.shadows["default"].shadowOpacity
|
|
2460
|
+
}
|
|
2469
2461
|
};
|
|
2470
2462
|
var widths = {
|
|
2471
2463
|
leadingStatus: 8
|
|
2472
2464
|
};
|
|
2473
2465
|
var opacity = {
|
|
2474
2466
|
disabled: 0.38,
|
|
2475
|
-
enabled: 1
|
|
2476
|
-
cardShadow: theme.shadows["default"].shadowOpacity
|
|
2467
|
+
enabled: 1
|
|
2477
2468
|
};
|
|
2478
2469
|
return {
|
|
2479
2470
|
colors: colors,
|
|
@@ -3077,8 +3068,7 @@ var getToastTheme = function getToastTheme(theme) {
|
|
|
3077
3068
|
info: theme.colors.info,
|
|
3078
3069
|
notification: theme.colors.defaultGlobalSurface,
|
|
3079
3070
|
snackbar: theme.colors.darkGlobalSurface,
|
|
3080
|
-
divider: theme.colors.secondaryOutline
|
|
3081
|
-
shadow: theme.colors.primaryOutline
|
|
3071
|
+
divider: theme.colors.secondaryOutline
|
|
3082
3072
|
};
|
|
3083
3073
|
var sizes = {
|
|
3084
3074
|
height: theme.sizes.xxxlarge
|
|
@@ -3098,13 +3088,11 @@ var getToastTheme = function getToastTheme(theme) {
|
|
|
3098
3088
|
base: theme.borderWidths.base
|
|
3099
3089
|
};
|
|
3100
3090
|
var shadows = {
|
|
3101
|
-
offset:
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
radius: 4,
|
|
3107
|
-
elevation: 4
|
|
3091
|
+
offset: theme.shadows["default"].shadowOffset,
|
|
3092
|
+
opacity: theme.shadows["default"].shadowOpacity,
|
|
3093
|
+
radius: theme.shadows["default"].shadowRadius,
|
|
3094
|
+
elevation: theme.shadows["default"].elevation,
|
|
3095
|
+
color: theme.shadows["default"].shadowColor
|
|
3108
3096
|
};
|
|
3109
3097
|
return {
|
|
3110
3098
|
colors: colors,
|
|
@@ -7881,7 +7869,7 @@ var Divider = function Divider(_ref) {
|
|
|
7881
7869
|
}));
|
|
7882
7870
|
};
|
|
7883
7871
|
|
|
7884
|
-
var AnimatedPressable$
|
|
7872
|
+
var AnimatedPressable$2 = reactNative.Animated.createAnimatedComponent(reactNative.Pressable);
|
|
7885
7873
|
var AnimatedSafeAreaView = reactNative.Animated.createAnimatedComponent(reactNative.SafeAreaView);
|
|
7886
7874
|
var StyledWrapper$9 = index$c(reactNative.View)(_objectSpread2(_objectSpread2({}, reactNative.StyleSheet.absoluteFillObject), {}, {
|
|
7887
7875
|
flexDirection: 'column-reverse'
|
|
@@ -7907,7 +7895,7 @@ var StyledBottomSheet = index$c(AnimatedSafeAreaView)(function (_ref) {
|
|
|
7907
7895
|
maxHeight: '94%'
|
|
7908
7896
|
};
|
|
7909
7897
|
});
|
|
7910
|
-
var StyledBackdrop$2 = index$c(AnimatedPressable$
|
|
7898
|
+
var StyledBackdrop$2 = index$c(AnimatedPressable$2)(function (_ref2) {
|
|
7911
7899
|
var theme = _ref2.theme;
|
|
7912
7900
|
return _objectSpread2(_objectSpread2({}, reactNative.StyleSheet.absoluteFillObject), {}, {
|
|
7913
7901
|
backgroundColor: theme.__hd__.bottomSheet.colors.backdrop,
|
|
@@ -11736,7 +11724,7 @@ var StyledShadow = index$c(reactNative.View)(function (_ref3) {
|
|
|
11736
11724
|
var theme = _ref3.theme;
|
|
11737
11725
|
return {
|
|
11738
11726
|
borderRadius: theme.__hd__.cardCarousel.radii.card,
|
|
11739
|
-
shadowColor: theme.__hd__.cardCarousel.
|
|
11727
|
+
shadowColor: theme.__hd__.cardCarousel.shadows.color,
|
|
11740
11728
|
shadowOffset: theme.__hd__.cardCarousel.shadows.offset,
|
|
11741
11729
|
shadowRadius: theme.__hd__.cardCarousel.shadows.radius,
|
|
11742
11730
|
shadowOpacity: theme.__hd__.cardCarousel.shadows.opacity,
|
|
@@ -12037,17 +12025,14 @@ var index$a = Object.assign(Carousel, {
|
|
|
12037
12025
|
|
|
12038
12026
|
var StyledWrapper$7 = index$c(reactNative.TouchableOpacity)(function (_ref) {
|
|
12039
12027
|
var theme = _ref.theme,
|
|
12040
|
-
themeWithBorder = _ref.themeWithBorder,
|
|
12041
12028
|
themeState = _ref.themeState;
|
|
12042
|
-
|
|
12029
|
+
return {
|
|
12030
|
+
flexDirection: 'row',
|
|
12043
12031
|
borderRadius: theme.__hd__.checkbox.radii.wrapper,
|
|
12044
12032
|
borderWidth: theme.__hd__.checkbox.borderWidths.wrapper,
|
|
12045
12033
|
padding: theme.__hd__.checkbox.space.wrapperPadding,
|
|
12046
12034
|
borderColor: theme.__hd__.checkbox.colors.borders[themeState]
|
|
12047
12035
|
};
|
|
12048
|
-
return _objectSpread2({
|
|
12049
|
-
flexDirection: 'row'
|
|
12050
|
-
}, themeWithBorder && borderStyle);
|
|
12051
12036
|
});
|
|
12052
12037
|
var StyledDescription$1 = index$c(Typography.Body)(function (_ref2) {
|
|
12053
12038
|
var theme = _ref2.theme;
|
|
@@ -12107,6 +12092,7 @@ var Checkbox = function Checkbox(_ref2) {
|
|
|
12107
12092
|
testID = _ref2.testID,
|
|
12108
12093
|
_ref2$readonly = _ref2.readonly,
|
|
12109
12094
|
readonly = _ref2$readonly === void 0 ? false : _ref2$readonly;
|
|
12095
|
+
useDeprecation("Checkbox's withBorder prop will be removed in the next major release, all checkboxes will have border by default. Please remove it.", withBorder === true);
|
|
12110
12096
|
var themeState = getThemeState({
|
|
12111
12097
|
disabled: disabled,
|
|
12112
12098
|
readonly: readonly
|
|
@@ -12114,7 +12100,6 @@ var Checkbox = function Checkbox(_ref2) {
|
|
|
12114
12100
|
return /*#__PURE__*/React__default["default"].createElement(StyledWrapper$7, {
|
|
12115
12101
|
onPress: onPress,
|
|
12116
12102
|
disabled: disabled || readonly,
|
|
12117
|
-
themeWithBorder: withBorder,
|
|
12118
12103
|
themeState: themeState,
|
|
12119
12104
|
style: style,
|
|
12120
12105
|
testID: testID
|
|
@@ -12801,7 +12786,7 @@ var DatePicker = function DatePicker(_ref) {
|
|
|
12801
12786
|
return /*#__PURE__*/React__default["default"].createElement(DatePickerAndroid, props);
|
|
12802
12787
|
};
|
|
12803
12788
|
|
|
12804
|
-
var AnimatedPressable = reactNative.Animated.createAnimatedComponent(reactNative.Pressable);
|
|
12789
|
+
var AnimatedPressable$1 = reactNative.Animated.createAnimatedComponent(reactNative.Pressable);
|
|
12805
12790
|
var StyledContainer$3 = index$c(reactNative.View)(function (_ref) {
|
|
12806
12791
|
var theme = _ref.theme,
|
|
12807
12792
|
enableShadow = _ref.enableShadow;
|
|
@@ -12829,7 +12814,7 @@ var StyledDragableContainer = index$c(reactNative.View)(function (_ref2) {
|
|
|
12829
12814
|
flexDirection: 'column-reverse'
|
|
12830
12815
|
});
|
|
12831
12816
|
});
|
|
12832
|
-
var StyledBackdrop$1 = index$c(AnimatedPressable)(function (_ref3) {
|
|
12817
|
+
var StyledBackdrop$1 = index$c(AnimatedPressable$1)(function (_ref3) {
|
|
12833
12818
|
var theme = _ref3.theme;
|
|
12834
12819
|
return _objectSpread2(_objectSpread2({}, reactNative.StyleSheet.absoluteFillObject), {}, {
|
|
12835
12820
|
backgroundColor: theme.__hd__.drawer.colors.backdrop
|
|
@@ -13037,7 +13022,7 @@ var Drawer = function Drawer(_ref) {
|
|
|
13037
13022
|
onDismiss = _ref.onDismiss,
|
|
13038
13023
|
testID = _ref.testID;
|
|
13039
13024
|
var animatedValue = React.useRef(new reactNative.Animated.Value(visible ? 1 : 0)).current;
|
|
13040
|
-
var _useState = React.useState(
|
|
13025
|
+
var _useState = React.useState(reactNative.Dimensions.get('window').height),
|
|
13041
13026
|
_useState2 = _slicedToArray(_useState, 2),
|
|
13042
13027
|
height = _useState2[0],
|
|
13043
13028
|
setHeight = _useState2[1];
|
|
@@ -13376,7 +13361,7 @@ var StyledFAB$1 = index$c(reactNative.TouchableHighlight)(function (_ref) {
|
|
|
13376
13361
|
padding: theme.__hd__.fab.space.containerPadding,
|
|
13377
13362
|
flexDirection: 'row',
|
|
13378
13363
|
elevation: theme.__hd__.fab.shadows.elevation,
|
|
13379
|
-
shadowColor: theme.__hd__.fab.
|
|
13364
|
+
shadowColor: theme.__hd__.fab.shadows.color,
|
|
13380
13365
|
shadowOffset: theme.__hd__.fab.shadows.offset,
|
|
13381
13366
|
shadowRadius: theme.__hd__.fab.shadows.radius,
|
|
13382
13367
|
shadowOpacity: theme.__hd__.fab.shadows.opacity
|
|
@@ -13655,7 +13640,8 @@ var StyledFAB = index$c(FAB)(function (_ref) {
|
|
|
13655
13640
|
alignSelf: 'flex-end'
|
|
13656
13641
|
};
|
|
13657
13642
|
});
|
|
13658
|
-
var
|
|
13643
|
+
var AnimatedPressable = reactNative.Animated.createAnimatedComponent(reactNative.Pressable);
|
|
13644
|
+
var StyledBackdrop = index$c(AnimatedPressable)(function (_ref2) {
|
|
13659
13645
|
var theme = _ref2.theme;
|
|
13660
13646
|
return {
|
|
13661
13647
|
position: 'absolute',
|
|
@@ -13667,15 +13653,6 @@ var StyledBackdrop = index$c(reactNative.Animated.View)(function (_ref2) {
|
|
|
13667
13653
|
backgroundColor: theme.__hd__.fab.colors.backdropBackground
|
|
13668
13654
|
};
|
|
13669
13655
|
});
|
|
13670
|
-
var StyledHeaderText = index$c(Typography.Title)(function (_ref3) {
|
|
13671
|
-
var theme = _ref3.theme;
|
|
13672
|
-
return {
|
|
13673
|
-
color: theme.__hd__.fab.colors.headerText,
|
|
13674
|
-
marginRight: theme.__hd__.fab.space.headerTextMarginRight,
|
|
13675
|
-
marginBottom: theme.__hd__.fab.space.headerTextMarginBottom,
|
|
13676
|
-
textAlign: 'right'
|
|
13677
|
-
};
|
|
13678
|
-
});
|
|
13679
13656
|
|
|
13680
13657
|
var ActionGroup = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
13681
13658
|
var headerTitle = _ref.headerTitle,
|
|
@@ -13685,15 +13662,12 @@ var ActionGroup = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
13685
13662
|
items = _ref.items,
|
|
13686
13663
|
testID = _ref.testID,
|
|
13687
13664
|
fabTitle = _ref.fabTitle,
|
|
13665
|
+
onBackdropPress = _ref.onBackdropPress,
|
|
13688
13666
|
_ref$fabIcon = _ref.fabIcon,
|
|
13689
13667
|
fabIcon = _ref$fabIcon === void 0 ? 'add' : _ref$fabIcon;
|
|
13668
|
+
useDeprecation("FAB.ActionGroup's headerTitle prop will be removed in the next major release. Please remove it.", headerTitle !== undefined);
|
|
13690
13669
|
var fabRef = React.useRef(null);
|
|
13691
13670
|
var tranlateXAnimation = React.useRef(new reactNative.Animated.Value(active ? 1 : 0));
|
|
13692
|
-
var titleTranslateYValue = React__default["default"].useRef(new reactNative.Animated.Value(0));
|
|
13693
|
-
var titleTranslateY = titleTranslateYValue.current.interpolate({
|
|
13694
|
-
inputRange: [0, 1],
|
|
13695
|
-
outputRange: [50, 0]
|
|
13696
|
-
});
|
|
13697
13671
|
React__default["default"].useImperativeHandle(ref, function () {
|
|
13698
13672
|
return {
|
|
13699
13673
|
showFAB: function showFAB() {
|
|
@@ -13711,13 +13685,10 @@ var ActionGroup = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
13711
13685
|
};
|
|
13712
13686
|
}, [fabRef]);
|
|
13713
13687
|
React__default["default"].useEffect(function () {
|
|
13714
|
-
reactNative.Animated.
|
|
13715
|
-
toValue: active ? 1 : 0,
|
|
13716
|
-
useNativeDriver: reactNative.Platform.OS !== 'web'
|
|
13717
|
-
}), reactNative.Animated.spring(titleTranslateYValue.current, {
|
|
13688
|
+
reactNative.Animated.spring(tranlateXAnimation.current, {
|
|
13718
13689
|
toValue: active ? 1 : 0,
|
|
13719
13690
|
useNativeDriver: reactNative.Platform.OS !== 'web'
|
|
13720
|
-
})
|
|
13691
|
+
}).start();
|
|
13721
13692
|
}, [active]);
|
|
13722
13693
|
var interpolatedActionGroupOpacityAnimation = tranlateXAnimation.current.interpolate({
|
|
13723
13694
|
inputRange: [0, 1],
|
|
@@ -13753,22 +13724,15 @@ var ActionGroup = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
13753
13724
|
testID: testID,
|
|
13754
13725
|
style: [style]
|
|
13755
13726
|
}, /*#__PURE__*/React__default["default"].createElement(StyledBackdrop, {
|
|
13756
|
-
testID: "back-drop"
|
|
13727
|
+
testID: "back-drop",
|
|
13728
|
+
onPress: onBackdropPress
|
|
13757
13729
|
}), /*#__PURE__*/React__default["default"].createElement(StyledActionGroupContainer, {
|
|
13758
13730
|
testID: "action-group",
|
|
13731
|
+
pointerEvents: "box-none",
|
|
13759
13732
|
style: {
|
|
13760
13733
|
opacity: interpolatedActionGroupOpacityAnimation
|
|
13761
13734
|
}
|
|
13762
|
-
},
|
|
13763
|
-
style: {
|
|
13764
|
-
transform: [{
|
|
13765
|
-
translateY: titleTranslateY
|
|
13766
|
-
}]
|
|
13767
|
-
}
|
|
13768
|
-
}, /*#__PURE__*/React__default["default"].createElement(StyledHeaderText, {
|
|
13769
|
-
testID: "header-text",
|
|
13770
|
-
level: "h4"
|
|
13771
|
-
}, headerTitle)), /*#__PURE__*/React__default["default"].createElement(Box, {
|
|
13735
|
+
}, /*#__PURE__*/React__default["default"].createElement(Box, {
|
|
13772
13736
|
style: [style, {
|
|
13773
13737
|
paddingBottom: 0
|
|
13774
13738
|
}]
|
|
@@ -13813,11 +13777,11 @@ var StyledListItemContainer$1 = index$c(reactNative.TouchableHighlight)(function
|
|
|
13813
13777
|
case 'card':
|
|
13814
13778
|
return _objectSpread2(_objectSpread2({}, sharedStyles), {}, {
|
|
13815
13779
|
alignItems: 'center',
|
|
13816
|
-
shadowColor: theme.
|
|
13817
|
-
shadowRadius: theme.__hd__.list.
|
|
13818
|
-
shadowOffset: theme.__hd__.list.shadows.
|
|
13819
|
-
shadowOpacity: theme.__hd__.list.opacity
|
|
13820
|
-
elevation: theme.__hd__.list.shadows.
|
|
13780
|
+
shadowColor: theme.__hd__.list.shadows.card.color,
|
|
13781
|
+
shadowRadius: theme.__hd__.list.shadows.card.radius,
|
|
13782
|
+
shadowOffset: theme.__hd__.list.shadows.card.offset,
|
|
13783
|
+
shadowOpacity: theme.__hd__.list.shadows.card.opacity,
|
|
13784
|
+
elevation: theme.__hd__.list.shadows.card.elevation
|
|
13821
13785
|
});
|
|
13822
13786
|
default:
|
|
13823
13787
|
return sharedStyles;
|
|
@@ -16917,7 +16881,7 @@ var Container = index$c(reactNative.Animated.View)(function (_ref2) {
|
|
|
16917
16881
|
backgroundColor: theme.__hd__.toast.colors[themeIntent],
|
|
16918
16882
|
minHeight: theme.__hd__.toast.sizes.height,
|
|
16919
16883
|
flexDirection: 'row',
|
|
16920
|
-
shadowColor: theme.__hd__.toast.
|
|
16884
|
+
shadowColor: theme.__hd__.toast.shadows.color,
|
|
16921
16885
|
shadowOffset: theme.__hd__.toast.shadows.offset,
|
|
16922
16886
|
shadowRadius: theme.__hd__.toast.shadows.radius,
|
|
16923
16887
|
shadowOpacity: theme.__hd__.toast.shadows.opacity,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hero-design/rn",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.37.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -21,14 +21,14 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@emotion/native": "^11.9.3",
|
|
23
23
|
"@emotion/react": "^11.9.3",
|
|
24
|
-
"@hero-design/colors": "8.
|
|
24
|
+
"@hero-design/colors": "8.37.0",
|
|
25
25
|
"date-fns": "^2.16.1",
|
|
26
26
|
"events": "^3.2.0",
|
|
27
27
|
"hero-editor": "^1.9.21",
|
|
28
28
|
"nanoid": "^4.0.2"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
|
-
"@hero-design/react-native-month-year-picker": "^8.
|
|
31
|
+
"@hero-design/react-native-month-year-picker": "^8.37.0",
|
|
32
32
|
"@react-native-community/datetimepicker": "^3.5.2",
|
|
33
33
|
"@react-native-community/slider": "4.1.12",
|
|
34
34
|
"react": "18.0.0",
|
|
@@ -48,8 +48,8 @@
|
|
|
48
48
|
"@babel/preset-typescript": "^7.17.12",
|
|
49
49
|
"@babel/runtime": "^7.18.9",
|
|
50
50
|
"@emotion/jest": "^11.9.3",
|
|
51
|
-
"@hero-design/eslint-plugin": "8.
|
|
52
|
-
"@hero-design/react-native-month-year-picker": "^8.
|
|
51
|
+
"@hero-design/eslint-plugin": "8.37.0",
|
|
52
|
+
"@hero-design/react-native-month-year-picker": "^8.37.0",
|
|
53
53
|
"@react-native-community/datetimepicker": "^3.5.2",
|
|
54
54
|
"@react-native-community/slider": "4.1.12",
|
|
55
55
|
"@rollup/plugin-babel": "^5.3.1",
|
|
@@ -65,10 +65,10 @@
|
|
|
65
65
|
"@types/react-native": "^0.67.7",
|
|
66
66
|
"@types/react-native-vector-icons": "^6.4.10",
|
|
67
67
|
"babel-plugin-inline-import": "^3.0.0",
|
|
68
|
-
"eslint-config-hd": "8.
|
|
68
|
+
"eslint-config-hd": "8.37.0",
|
|
69
69
|
"eslint-plugin-import": "^2.27.5",
|
|
70
70
|
"jest": "^27.3.1",
|
|
71
|
-
"prettier-config-hd": "8.
|
|
71
|
+
"prettier-config-hd": "8.37.0",
|
|
72
72
|
"react": "18.0.0",
|
|
73
73
|
"react-native": "0.69.7",
|
|
74
74
|
"react-native-gesture-handler": "~2.5.0",
|
|
@@ -19,7 +19,7 @@ const StyledCard = styled(Card)<CardProps>(({ theme }) => ({
|
|
|
19
19
|
}));
|
|
20
20
|
const StyledShadow = styled(View)<ViewProps>(({ theme }) => ({
|
|
21
21
|
borderRadius: theme.__hd__.cardCarousel.radii.card,
|
|
22
|
-
shadowColor: theme.__hd__.cardCarousel.
|
|
22
|
+
shadowColor: theme.__hd__.cardCarousel.shadows.color,
|
|
23
23
|
shadowOffset: theme.__hd__.cardCarousel.shadows.offset,
|
|
24
24
|
shadowRadius: theme.__hd__.cardCarousel.shadows.radius,
|
|
25
25
|
shadowOpacity: theme.__hd__.cardCarousel.shadows.opacity,
|
|
@@ -104,7 +104,7 @@ exports[`CardCarousel android should render correctly on iOS 1`] = `
|
|
|
104
104
|
Array [
|
|
105
105
|
Object {
|
|
106
106
|
"borderRadius": 8,
|
|
107
|
-
"elevation":
|
|
107
|
+
"elevation": 3,
|
|
108
108
|
"flex": 1,
|
|
109
109
|
"shadowColor": "#001f23",
|
|
110
110
|
"shadowOffset": Object {
|
|
@@ -112,7 +112,7 @@ exports[`CardCarousel android should render correctly on iOS 1`] = `
|
|
|
112
112
|
"width": 0,
|
|
113
113
|
},
|
|
114
114
|
"shadowOpacity": 0.12,
|
|
115
|
-
"shadowRadius":
|
|
115
|
+
"shadowRadius": 4,
|
|
116
116
|
},
|
|
117
117
|
undefined,
|
|
118
118
|
]
|
|
@@ -187,7 +187,7 @@ exports[`CardCarousel android should render correctly on iOS 1`] = `
|
|
|
187
187
|
Array [
|
|
188
188
|
Object {
|
|
189
189
|
"borderRadius": 8,
|
|
190
|
-
"elevation":
|
|
190
|
+
"elevation": 3,
|
|
191
191
|
"flex": 1,
|
|
192
192
|
"shadowColor": "#001f23",
|
|
193
193
|
"shadowOffset": Object {
|
|
@@ -195,7 +195,7 @@ exports[`CardCarousel android should render correctly on iOS 1`] = `
|
|
|
195
195
|
"width": 0,
|
|
196
196
|
},
|
|
197
197
|
"shadowOpacity": 0.12,
|
|
198
|
-
"shadowRadius":
|
|
198
|
+
"shadowRadius": 4,
|
|
199
199
|
},
|
|
200
200
|
undefined,
|
|
201
201
|
]
|
|
@@ -399,7 +399,7 @@ exports[`CardCarousel ios should render correctly on iOS 1`] = `
|
|
|
399
399
|
Array [
|
|
400
400
|
Object {
|
|
401
401
|
"borderRadius": 8,
|
|
402
|
-
"elevation":
|
|
402
|
+
"elevation": 3,
|
|
403
403
|
"flex": 1,
|
|
404
404
|
"shadowColor": "#001f23",
|
|
405
405
|
"shadowOffset": Object {
|
|
@@ -407,7 +407,7 @@ exports[`CardCarousel ios should render correctly on iOS 1`] = `
|
|
|
407
407
|
"width": 0,
|
|
408
408
|
},
|
|
409
409
|
"shadowOpacity": 0.12,
|
|
410
|
-
"shadowRadius":
|
|
410
|
+
"shadowRadius": 4,
|
|
411
411
|
},
|
|
412
412
|
undefined,
|
|
413
413
|
]
|
|
@@ -482,7 +482,7 @@ exports[`CardCarousel ios should render correctly on iOS 1`] = `
|
|
|
482
482
|
Array [
|
|
483
483
|
Object {
|
|
484
484
|
"borderRadius": 8,
|
|
485
|
-
"elevation":
|
|
485
|
+
"elevation": 3,
|
|
486
486
|
"flex": 1,
|
|
487
487
|
"shadowColor": "#001f23",
|
|
488
488
|
"shadowOffset": Object {
|
|
@@ -490,7 +490,7 @@ exports[`CardCarousel ios should render correctly on iOS 1`] = `
|
|
|
490
490
|
"width": 0,
|
|
491
491
|
},
|
|
492
492
|
"shadowOpacity": 0.12,
|
|
493
|
-
"shadowRadius":
|
|
493
|
+
"shadowRadius": 4,
|
|
494
494
|
},
|
|
495
495
|
undefined,
|
|
496
496
|
]
|
|
@@ -6,21 +6,14 @@ import Typography from '../Typography';
|
|
|
6
6
|
type CheckboxThemeState = 'default' | 'disabled' | 'readonly';
|
|
7
7
|
|
|
8
8
|
export const StyledWrapper = styled(TouchableOpacity)<{
|
|
9
|
-
themeWithBorder: boolean;
|
|
10
9
|
themeState: CheckboxThemeState;
|
|
11
|
-
}>(({ theme,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
return {
|
|
20
|
-
flexDirection: 'row',
|
|
21
|
-
...(themeWithBorder && borderStyle),
|
|
22
|
-
};
|
|
23
|
-
});
|
|
10
|
+
}>(({ theme, themeState }) => ({
|
|
11
|
+
flexDirection: 'row',
|
|
12
|
+
borderRadius: theme.__hd__.checkbox.radii.wrapper,
|
|
13
|
+
borderWidth: theme.__hd__.checkbox.borderWidths.wrapper,
|
|
14
|
+
padding: theme.__hd__.checkbox.space.wrapperPadding,
|
|
15
|
+
borderColor: theme.__hd__.checkbox.colors.borders[themeState],
|
|
16
|
+
}));
|
|
24
17
|
|
|
25
18
|
export const StyledDescription = styled(Typography.Body)(({ theme }) => ({
|
|
26
19
|
paddingRight: theme.__hd__.checkbox.space.iconDescriptionPadding,
|
|
@@ -5,21 +5,17 @@ import { getThemeState } from '..';
|
|
|
5
5
|
|
|
6
6
|
describe('StyledWrapper', () => {
|
|
7
7
|
it.each`
|
|
8
|
-
|
|
9
|
-
${false}
|
|
10
|
-
${true}
|
|
11
|
-
${false}
|
|
12
|
-
${true}
|
|
13
|
-
${false} | ${false} | ${true}
|
|
14
|
-
${true} | ${false} | ${true}
|
|
15
|
-
${false} | ${true} | ${true}
|
|
16
|
-
${true} | ${true} | ${true}
|
|
8
|
+
disabled | readonly
|
|
9
|
+
${false} | ${false}
|
|
10
|
+
${true} | ${false}
|
|
11
|
+
${false} | ${true}
|
|
12
|
+
${true} | ${true}
|
|
17
13
|
`(
|
|
18
|
-
'renders correctly when disabled is $disabled,
|
|
19
|
-
({ disabled,
|
|
14
|
+
'renders correctly when disabled is $disabled, readonly is $readonly',
|
|
15
|
+
({ disabled, readonly }) => {
|
|
20
16
|
const themeState = getThemeState({ disabled, readonly });
|
|
21
17
|
const { toJSON } = renderWithTheme(
|
|
22
|
-
<StyledWrapper themeState={themeState}
|
|
18
|
+
<StyledWrapper themeState={themeState} />
|
|
23
19
|
);
|
|
24
20
|
|
|
25
21
|
expect(toJSON()).toMatchSnapshot();
|
|
@@ -68,49 +68,7 @@ exports[`StyledCheckbox renders correctly when disabled is true and readonly is
|
|
|
68
68
|
/>
|
|
69
69
|
`;
|
|
70
70
|
|
|
71
|
-
exports[`StyledWrapper renders correctly when disabled is false,
|
|
72
|
-
<View
|
|
73
|
-
accessible={true}
|
|
74
|
-
collapsable={false}
|
|
75
|
-
focusable={false}
|
|
76
|
-
onClick={[Function]}
|
|
77
|
-
onResponderGrant={[Function]}
|
|
78
|
-
onResponderMove={[Function]}
|
|
79
|
-
onResponderRelease={[Function]}
|
|
80
|
-
onResponderTerminate={[Function]}
|
|
81
|
-
onResponderTerminationRequest={[Function]}
|
|
82
|
-
onStartShouldSetResponder={[Function]}
|
|
83
|
-
style={
|
|
84
|
-
Object {
|
|
85
|
-
"flexDirection": "row",
|
|
86
|
-
"opacity": 1,
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
/>
|
|
90
|
-
`;
|
|
91
|
-
|
|
92
|
-
exports[`StyledWrapper renders correctly when disabled is false, withBorder is false 2`] = `
|
|
93
|
-
<View
|
|
94
|
-
accessible={true}
|
|
95
|
-
collapsable={false}
|
|
96
|
-
focusable={false}
|
|
97
|
-
onClick={[Function]}
|
|
98
|
-
onResponderGrant={[Function]}
|
|
99
|
-
onResponderMove={[Function]}
|
|
100
|
-
onResponderRelease={[Function]}
|
|
101
|
-
onResponderTerminate={[Function]}
|
|
102
|
-
onResponderTerminationRequest={[Function]}
|
|
103
|
-
onStartShouldSetResponder={[Function]}
|
|
104
|
-
style={
|
|
105
|
-
Object {
|
|
106
|
-
"flexDirection": "row",
|
|
107
|
-
"opacity": 1,
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
/>
|
|
111
|
-
`;
|
|
112
|
-
|
|
113
|
-
exports[`StyledWrapper renders correctly when disabled is false, withBorder is true 1`] = `
|
|
71
|
+
exports[`StyledWrapper renders correctly when disabled is false, readonly is false 1`] = `
|
|
114
72
|
<View
|
|
115
73
|
accessible={true}
|
|
116
74
|
collapsable={false}
|
|
@@ -135,7 +93,7 @@ exports[`StyledWrapper renders correctly when disabled is false, withBorder is t
|
|
|
135
93
|
/>
|
|
136
94
|
`;
|
|
137
95
|
|
|
138
|
-
exports[`StyledWrapper renders correctly when disabled is false,
|
|
96
|
+
exports[`StyledWrapper renders correctly when disabled is false, readonly is true 1`] = `
|
|
139
97
|
<View
|
|
140
98
|
accessible={true}
|
|
141
99
|
collapsable={false}
|
|
@@ -160,49 +118,7 @@ exports[`StyledWrapper renders correctly when disabled is false, withBorder is t
|
|
|
160
118
|
/>
|
|
161
119
|
`;
|
|
162
120
|
|
|
163
|
-
exports[`StyledWrapper renders correctly when disabled is true,
|
|
164
|
-
<View
|
|
165
|
-
accessible={true}
|
|
166
|
-
collapsable={false}
|
|
167
|
-
focusable={false}
|
|
168
|
-
onClick={[Function]}
|
|
169
|
-
onResponderGrant={[Function]}
|
|
170
|
-
onResponderMove={[Function]}
|
|
171
|
-
onResponderRelease={[Function]}
|
|
172
|
-
onResponderTerminate={[Function]}
|
|
173
|
-
onResponderTerminationRequest={[Function]}
|
|
174
|
-
onStartShouldSetResponder={[Function]}
|
|
175
|
-
style={
|
|
176
|
-
Object {
|
|
177
|
-
"flexDirection": "row",
|
|
178
|
-
"opacity": 1,
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
/>
|
|
182
|
-
`;
|
|
183
|
-
|
|
184
|
-
exports[`StyledWrapper renders correctly when disabled is true, withBorder is false 2`] = `
|
|
185
|
-
<View
|
|
186
|
-
accessible={true}
|
|
187
|
-
collapsable={false}
|
|
188
|
-
focusable={false}
|
|
189
|
-
onClick={[Function]}
|
|
190
|
-
onResponderGrant={[Function]}
|
|
191
|
-
onResponderMove={[Function]}
|
|
192
|
-
onResponderRelease={[Function]}
|
|
193
|
-
onResponderTerminate={[Function]}
|
|
194
|
-
onResponderTerminationRequest={[Function]}
|
|
195
|
-
onStartShouldSetResponder={[Function]}
|
|
196
|
-
style={
|
|
197
|
-
Object {
|
|
198
|
-
"flexDirection": "row",
|
|
199
|
-
"opacity": 1,
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
/>
|
|
203
|
-
`;
|
|
204
|
-
|
|
205
|
-
exports[`StyledWrapper renders correctly when disabled is true, withBorder is true 1`] = `
|
|
121
|
+
exports[`StyledWrapper renders correctly when disabled is true, readonly is false 1`] = `
|
|
206
122
|
<View
|
|
207
123
|
accessible={true}
|
|
208
124
|
collapsable={false}
|
|
@@ -227,7 +143,7 @@ exports[`StyledWrapper renders correctly when disabled is true, withBorder is tr
|
|
|
227
143
|
/>
|
|
228
144
|
`;
|
|
229
145
|
|
|
230
|
-
exports[`StyledWrapper renders correctly when disabled is true,
|
|
146
|
+
exports[`StyledWrapper renders correctly when disabled is true, readonly is true 1`] = `
|
|
231
147
|
<View
|
|
232
148
|
accessible={true}
|
|
233
149
|
collapsable={false}
|