@hero-design/rn 8.30.3 → 8.31.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 +116 -176
- package/lib/index.js +116 -176
- 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/components/Typography/Caption/StyledCaption.tsx +19 -0
- package/src/components/Typography/Caption/__tests__/StyledCaption.spec.tsx +39 -0
- package/src/components/Typography/Caption/__tests__/__snapshots__/StyledCaption.spec.tsx.snap +211 -0
- package/src/components/Typography/Caption/__tests__/__snapshots__/index.spec.tsx.snap +287 -0
- package/src/components/Typography/Caption/__tests__/index.spec.tsx +46 -0
- package/src/components/Typography/Caption/index.tsx +61 -0
- package/src/components/Typography/index.tsx +3 -0
- package/src/components/Typography/types.ts +18 -0
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +2 -0
- package/src/theme/components/typography.ts +2 -0
- package/src/types.ts +0 -4
- package/src/utils/helpers.ts +4 -1
- package/testUtils/setup.tsx +0 -2
- package/types/components/Accordion/AccordionItem.d.ts +1 -1
- package/types/components/Accordion/StyledAccordion.d.ts +1 -1
- package/types/components/Avatar/StyledAvatar.d.ts +2 -2
- package/types/components/Badge/StyledBadge.d.ts +2 -2
- package/types/components/BottomNavigation/index.d.ts +1 -1
- package/types/components/BottomSheet/BottomSheetContext.d.ts +1 -1
- package/types/components/Box/config.d.ts +2 -2
- package/types/components/Box/types.d.ts +3 -3
- package/types/components/Button/LoadingIndicator/StyledLoadingIndicator.d.ts +1 -1
- package/types/components/Button/LoadingIndicator/index.d.ts +1 -1
- package/types/components/Button/StyledButton.d.ts +2 -2
- package/types/components/Carousel/CardCarousel.d.ts +1 -1
- package/types/components/Carousel/types.d.ts +2 -2
- package/types/components/Divider/StyledDivider.d.ts +1 -1
- package/types/components/Drawer/DragableDrawer/helpers.d.ts +1 -1
- package/types/components/Empty/StyledEmpty.d.ts +1 -1
- package/types/components/Error/StyledError.d.ts +1 -1
- package/types/components/FAB/ActionGroup/StyledActionGroup.d.ts +1 -1
- package/types/components/FAB/ActionGroup/index.d.ts +1 -7
- package/types/components/FAB/AnimatedFABIcon.d.ts +1 -1
- package/types/components/FAB/FAB.d.ts +2 -8
- package/types/components/FAB/index.d.ts +2 -3
- package/types/components/Icon/AnimatedIcon.d.ts +1 -1
- package/types/components/Icon/HeroIcon/index.d.ts +2 -2
- package/types/components/Icon/index.d.ts +1 -1
- package/types/components/List/StyledListItem.d.ts +2 -2
- package/types/components/PinInput/StyledPinInput.d.ts +1 -1
- package/types/components/Progress/types.d.ts +1 -1
- package/types/components/Radio/types.d.ts +1 -1
- package/types/components/RefreshControl/index.d.ts +1 -1
- package/types/components/RichTextEditor/RichTextEditor.d.ts +1 -1
- package/types/components/RichTextEditor/types.d.ts +1 -1
- package/types/components/Select/BaseOptionList.d.ts +1 -1
- package/types/components/Select/MultiSelect/OptionList.d.ts +1 -1
- package/types/components/Select/SingleSelect/OptionList.d.ts +1 -1
- package/types/components/Select/helpers.d.ts +1 -1
- package/types/components/Select/types.d.ts +6 -6
- package/types/components/Skeleton/StyledSkeleton.d.ts +2 -2
- package/types/components/Success/StyledSuccess.d.ts +1 -1
- package/types/components/Swipeable/StyledSwipeable.d.ts +1 -1
- package/types/components/Swipeable/index.d.ts +2 -2
- package/types/components/Switch/SelectorSwitch/index.d.ts +3 -3
- package/types/components/Switch/StyledSwitch.d.ts +1 -1
- package/types/components/Tabs/TabWithBadge.d.ts +3 -3
- package/types/components/Tabs/index.d.ts +2 -2
- package/types/components/Tag/StyledTag.d.ts +2 -2
- package/types/components/TextInput/StyledTextInput.d.ts +2 -2
- package/types/components/TextInput/index.d.ts +1 -1
- package/types/components/Toast/ToastContext.d.ts +2 -2
- package/types/components/Toast/ToastProvider.d.ts +1 -1
- package/types/components/Toast/types.d.ts +2 -2
- package/types/components/Typography/Caption/StyledCaption.d.ts +13 -0
- package/types/components/Typography/Caption/index.d.ts +26 -0
- package/types/components/Typography/index.d.ts +2 -0
- package/types/components/Typography/types.d.ts +6 -0
- package/types/theme/ThemeSwitcher.d.ts +1 -1
- package/types/theme/components/typography.d.ts +2 -0
- package/types/theme/getTheme.d.ts +1 -1
- package/types/theme/global/colors/types.d.ts +3 -3
- package/types/theme/global/index.d.ts +1 -1
- package/types/theme/global/scale.d.ts +1 -1
- package/types/theme/global/typography.d.ts +1 -1
- package/types/types.d.ts +1 -3
- package/types/utils/helpers.d.ts +1 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -4,5 +4,5 @@ $ rollup -c
|
|
|
4
4
|
[1msrc/index.ts[22m → [1mlib/index.js, es/index.js[22m...[39m
|
|
5
5
|
[1m[33m(!) Plugin replace: @rollup/plugin-replace: 'preventAssignment' currently defaults to false. It is recommended to set this option to `true`, as the next major version will default this option to `true`.[39m[22m
|
|
6
6
|
[1m[33m(!) Plugin node-resolve: preferring built-in module 'events' over local alternative at '/root/hero-design/node_modules/events/events.js', pass 'preferBuiltins: false' to disable this behavior or 'preferBuiltins: true' to disable this warning[39m[22m
|
|
7
|
-
[32mcreated [1mlib/index.js, es/index.js[22m in [
|
|
7
|
+
[32mcreated [1mlib/index.js, es/index.js[22m in [1m22.7s[22m[39m
|
|
8
8
|
$ tsc --noEmit false --emitDeclarationOnly --project tsconfig.prod.json
|
package/es/index.js
CHANGED
|
@@ -3118,7 +3118,8 @@ var getTypographyTheme = function getTypographyTheme(theme) {
|
|
|
3118
3118
|
xxxxlarge: theme.fontSizes.xxxxlarge,
|
|
3119
3119
|
xxxxxlarge: theme.fontSizes.xxxxxlarge,
|
|
3120
3120
|
'6xlarge': theme.fontSizes['6xlarge'],
|
|
3121
|
-
'7xlarge': theme.fontSizes['7xlarge']
|
|
3121
|
+
'7xlarge': theme.fontSizes['7xlarge'],
|
|
3122
|
+
caption: theme.fontSizes.small
|
|
3122
3123
|
};
|
|
3123
3124
|
var lineHeights = {
|
|
3124
3125
|
xsmall: theme.lineHeights.xsmall,
|
|
@@ -3130,7 +3131,8 @@ var getTypographyTheme = function getTypographyTheme(theme) {
|
|
|
3130
3131
|
xxxxlarge: theme.lineHeights.xxxxlarge,
|
|
3131
3132
|
xxxxxlarge: theme.lineHeights.xxxxxlarge,
|
|
3132
3133
|
'6xlarge': theme.lineHeights['6xlarge'],
|
|
3133
|
-
'7xlarge': theme.lineHeights['7xlarge']
|
|
3134
|
+
'7xlarge': theme.lineHeights['7xlarge'],
|
|
3135
|
+
caption: theme.lineHeights.small
|
|
3134
3136
|
};
|
|
3135
3137
|
return {
|
|
3136
3138
|
colors: colors,
|
|
@@ -6190,7 +6192,7 @@ var Spacer$1 = index$a(View)(function (_ref3) {
|
|
|
6190
6192
|
};
|
|
6191
6193
|
});
|
|
6192
6194
|
|
|
6193
|
-
var FONTWEIGHT_MAP = {
|
|
6195
|
+
var FONTWEIGHT_MAP$1 = {
|
|
6194
6196
|
light: 'light',
|
|
6195
6197
|
regular: 'regular',
|
|
6196
6198
|
'semi-bold': 'semiBold'
|
|
@@ -6207,12 +6209,12 @@ var StyledText$3 = index$a(Text$1)(function (_ref) {
|
|
|
6207
6209
|
letterSpacing: theme.__hd__.typography.fontSizes[themeFontSize] * 0.03
|
|
6208
6210
|
};
|
|
6209
6211
|
return _objectSpread2(_objectSpread2({}, sizeStyles), {}, {
|
|
6210
|
-
fontFamily: theme.__hd__.typography.fonts[themeTypeface][FONTWEIGHT_MAP[themeFontWeight]],
|
|
6212
|
+
fontFamily: theme.__hd__.typography.fonts[themeTypeface][FONTWEIGHT_MAP$1[themeFontWeight]],
|
|
6211
6213
|
color: theme.__hd__.typography.colors[themeIntent]
|
|
6212
6214
|
});
|
|
6213
6215
|
});
|
|
6214
6216
|
|
|
6215
|
-
var _excluded$
|
|
6217
|
+
var _excluded$v = ["children", "fontSize", "fontWeight", "intent", "typeface", "allowFontScaling"];
|
|
6216
6218
|
var Text = function Text(_ref) {
|
|
6217
6219
|
var children = _ref.children,
|
|
6218
6220
|
_ref$fontSize = _ref.fontSize,
|
|
@@ -6225,7 +6227,7 @@ var Text = function Text(_ref) {
|
|
|
6225
6227
|
typeface = _ref$typeface === void 0 ? 'neutral' : _ref$typeface,
|
|
6226
6228
|
_ref$allowFontScaling = _ref.allowFontScaling,
|
|
6227
6229
|
allowFontScaling = _ref$allowFontScaling === void 0 ? false : _ref$allowFontScaling,
|
|
6228
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$
|
|
6230
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$v);
|
|
6229
6231
|
return /*#__PURE__*/React.createElement(StyledText$3, _extends$1({}, nativeProps, {
|
|
6230
6232
|
themeFontSize: fontSize,
|
|
6231
6233
|
themeFontWeight: fontWeight,
|
|
@@ -6235,8 +6237,45 @@ var Text = function Text(_ref) {
|
|
|
6235
6237
|
}), children);
|
|
6236
6238
|
};
|
|
6237
6239
|
|
|
6240
|
+
var FONTWEIGHT_MAP = {
|
|
6241
|
+
light: 'light',
|
|
6242
|
+
regular: 'regular',
|
|
6243
|
+
'semi-bold': 'semiBold'
|
|
6244
|
+
};
|
|
6245
|
+
|
|
6246
|
+
var StyledCaption = index$a(Text$1)(function (_ref) {
|
|
6247
|
+
var themeFontWeight = _ref.themeFontWeight,
|
|
6248
|
+
themeIntent = _ref.themeIntent,
|
|
6249
|
+
theme = _ref.theme;
|
|
6250
|
+
return {
|
|
6251
|
+
fontSize: theme.__hd__.typography.fontSizes.caption,
|
|
6252
|
+
lineHeight: theme.__hd__.typography.lineHeights.caption,
|
|
6253
|
+
letterSpacing: theme.__hd__.typography.fontSizes.caption * (themeFontWeight === 'regular' ? 0.04 : 0.02),
|
|
6254
|
+
color: theme.__hd__.typography.colors[themeIntent],
|
|
6255
|
+
fontFamily: theme.__hd__.typography.fonts.neutral[FONTWEIGHT_MAP[themeFontWeight]]
|
|
6256
|
+
};
|
|
6257
|
+
});
|
|
6258
|
+
|
|
6259
|
+
var _excluded$u = ["children", "fontWeight", "intent", "allowFontScaling"];
|
|
6260
|
+
var Caption = function Caption(_ref) {
|
|
6261
|
+
var children = _ref.children,
|
|
6262
|
+
_ref$fontWeight = _ref.fontWeight,
|
|
6263
|
+
fontWeight = _ref$fontWeight === void 0 ? 'regular' : _ref$fontWeight,
|
|
6264
|
+
_ref$intent = _ref.intent,
|
|
6265
|
+
intent = _ref$intent === void 0 ? 'body' : _ref$intent,
|
|
6266
|
+
_ref$allowFontScaling = _ref.allowFontScaling,
|
|
6267
|
+
allowFontScaling = _ref$allowFontScaling === void 0 ? false : _ref$allowFontScaling,
|
|
6268
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$u);
|
|
6269
|
+
return /*#__PURE__*/React.createElement(StyledCaption, _extends$1({}, nativeProps, {
|
|
6270
|
+
themeFontWeight: fontWeight,
|
|
6271
|
+
themeIntent: intent,
|
|
6272
|
+
allowFontScaling: allowFontScaling
|
|
6273
|
+
}), children);
|
|
6274
|
+
};
|
|
6275
|
+
|
|
6238
6276
|
var Typography = {
|
|
6239
|
-
Text: Text
|
|
6277
|
+
Text: Text,
|
|
6278
|
+
Caption: Caption
|
|
6240
6279
|
};
|
|
6241
6280
|
|
|
6242
6281
|
// 🔴 DO NOT EDIT — This file is generated automatically.
|
|
@@ -11558,12 +11597,18 @@ var Carousel = function Carousel(_ref) {
|
|
|
11558
11597
|
clearTimeout(handle);
|
|
11559
11598
|
};
|
|
11560
11599
|
}, [currentSlideIndex, carouselRef]);
|
|
11561
|
-
var
|
|
11562
|
-
|
|
11563
|
-
|
|
11564
|
-
var
|
|
11600
|
+
var handleMomentumScrollEnd = function handleMomentumScrollEnd(event) {
|
|
11601
|
+
// Calculate the current index based on the scroll position and container width
|
|
11602
|
+
var containerWidth = event.nativeEvent.layoutMeasurement.width;
|
|
11603
|
+
var scrollPosition = event.nativeEvent.contentOffset.x;
|
|
11604
|
+
/**
|
|
11605
|
+
* By rounding down, we ensure that any partial visibility of the next item does not affect the index value
|
|
11606
|
+
* This helps maintain consistent behavior and aligns with the desired functionality of considering the left-most visible item as the current item.
|
|
11607
|
+
*/
|
|
11608
|
+
var index = Math.floor(scrollPosition / containerWidth);
|
|
11609
|
+
// Call the callback function with the current index
|
|
11565
11610
|
internalOnItemIndexChange(index);
|
|
11566
|
-
}
|
|
11611
|
+
};
|
|
11567
11612
|
var viewConfig = useRef({
|
|
11568
11613
|
viewAreaCoveragePercentThreshold: 50
|
|
11569
11614
|
}).current;
|
|
@@ -11580,7 +11625,7 @@ var Carousel = function Carousel(_ref) {
|
|
|
11580
11625
|
pagingEnabled: true,
|
|
11581
11626
|
bounces: false,
|
|
11582
11627
|
data: items,
|
|
11583
|
-
|
|
11628
|
+
onMomentumScrollEnd: handleMomentumScrollEnd,
|
|
11584
11629
|
viewabilityConfig: viewConfig,
|
|
11585
11630
|
scrollEventThrottle: 32,
|
|
11586
11631
|
ref: carouselRef,
|
|
@@ -11593,8 +11638,8 @@ var Carousel = function Carousel(_ref) {
|
|
|
11593
11638
|
}], {
|
|
11594
11639
|
useNativeDriver: false
|
|
11595
11640
|
}),
|
|
11596
|
-
renderItem: function renderItem(
|
|
11597
|
-
var item =
|
|
11641
|
+
renderItem: function renderItem(_ref2) {
|
|
11642
|
+
var item = _ref2.item;
|
|
11598
11643
|
if (!item) return null;
|
|
11599
11644
|
var image = item.image,
|
|
11600
11645
|
heading = item.heading,
|
|
@@ -12974,9 +13019,11 @@ var AnimatedFABIcon = function AnimatedFABIcon(_ref) {
|
|
|
12974
13019
|
iconProps = _objectWithoutProperties(_ref, _excluded$c);
|
|
12975
13020
|
var rotateAnimation = useRef(new Animated.Value(active ? 1 : 0));
|
|
12976
13021
|
useEffect(function () {
|
|
12977
|
-
var animation = Animated.
|
|
13022
|
+
var animation = Animated.timing(rotateAnimation.current, {
|
|
12978
13023
|
toValue: active ? 1 : 0,
|
|
12979
|
-
useNativeDriver: Platform.OS === 'ios' || Platform.OS === 'android'
|
|
13024
|
+
useNativeDriver: Platform.OS === 'ios' || Platform.OS === 'android',
|
|
13025
|
+
easing: Easing.inOut(Easing.ease),
|
|
13026
|
+
duration: 300
|
|
12980
13027
|
});
|
|
12981
13028
|
animation.start();
|
|
12982
13029
|
return function () {
|
|
@@ -12998,11 +13045,6 @@ var AnimatedFABIcon = function AnimatedFABIcon(_ref) {
|
|
|
12998
13045
|
}, iconProps)));
|
|
12999
13046
|
};
|
|
13000
13047
|
|
|
13001
|
-
if (Platform.OS === 'android') {
|
|
13002
|
-
if (UIManager.setLayoutAnimationEnabledExperimental) {
|
|
13003
|
-
UIManager.setLayoutAnimationEnabledExperimental(true);
|
|
13004
|
-
}
|
|
13005
|
-
}
|
|
13006
13048
|
var IconOnlyContent = function IconOnlyContent(_ref) {
|
|
13007
13049
|
var icon = _ref.icon,
|
|
13008
13050
|
animated = _ref.animated,
|
|
@@ -13028,19 +13070,7 @@ var IconWithTextContent = function IconWithTextContent(_ref2) {
|
|
|
13028
13070
|
testID: "styled-fab-icon"
|
|
13029
13071
|
})), /*#__PURE__*/React.createElement(StyledFABText, null, title));
|
|
13030
13072
|
};
|
|
13031
|
-
var
|
|
13032
|
-
create: {
|
|
13033
|
-
type: 'easeInEaseOut',
|
|
13034
|
-
property: 'opacity'
|
|
13035
|
-
},
|
|
13036
|
-
update: {
|
|
13037
|
-
type: 'spring',
|
|
13038
|
-
springDamping: 1
|
|
13039
|
-
},
|
|
13040
|
-
duration: 400
|
|
13041
|
-
};
|
|
13042
|
-
var FAB = /*#__PURE__*/forwardRef(function (_ref3, ref) {
|
|
13043
|
-
var _StyleSheet$flatten, _StyleSheet$flatten2;
|
|
13073
|
+
var FAB = function FAB(_ref3) {
|
|
13044
13074
|
var onPress = _ref3.onPress,
|
|
13045
13075
|
title = _ref3.title,
|
|
13046
13076
|
icon = _ref3.icon,
|
|
@@ -13048,75 +13078,22 @@ var FAB = /*#__PURE__*/forwardRef(function (_ref3, ref) {
|
|
|
13048
13078
|
testID = _ref3.testID,
|
|
13049
13079
|
active = _ref3.active,
|
|
13050
13080
|
style = _ref3.style;
|
|
13081
|
+
var isIconOnly = !title;
|
|
13051
13082
|
var theme = useTheme();
|
|
13052
|
-
|
|
13053
|
-
hideTitle: false,
|
|
13054
|
-
hideButton: false
|
|
13055
|
-
}),
|
|
13056
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
13057
|
-
displayState = _React$useState2[0],
|
|
13058
|
-
setDisplayState = _React$useState2[1];
|
|
13059
|
-
var _React$useState3 = React.useState(false),
|
|
13060
|
-
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
13061
|
-
canAnimate = _React$useState4[0],
|
|
13062
|
-
setCanAnimate = _React$useState4[1];
|
|
13063
|
-
var isIconOnly = displayState.hideTitle || active || !title;
|
|
13064
|
-
useImperativeHandle(ref, function () {
|
|
13065
|
-
return {
|
|
13066
|
-
show: function show() {
|
|
13067
|
-
setDisplayState({
|
|
13068
|
-
hideButton: false,
|
|
13069
|
-
hideTitle: false
|
|
13070
|
-
});
|
|
13071
|
-
},
|
|
13072
|
-
collapse: function collapse() {
|
|
13073
|
-
setDisplayState({
|
|
13074
|
-
hideButton: false,
|
|
13075
|
-
hideTitle: true
|
|
13076
|
-
});
|
|
13077
|
-
},
|
|
13078
|
-
hide: function hide() {
|
|
13079
|
-
setDisplayState(function (previousState) {
|
|
13080
|
-
return _objectSpread2(_objectSpread2({}, previousState), {}, {
|
|
13081
|
-
hideButton: true
|
|
13082
|
-
});
|
|
13083
|
-
});
|
|
13084
|
-
}
|
|
13085
|
-
};
|
|
13086
|
-
}, [displayState]);
|
|
13087
|
-
useEffect(function () {
|
|
13088
|
-
if (canAnimate) {
|
|
13089
|
-
LayoutAnimation.configureNext(defaultAnimation);
|
|
13090
|
-
}
|
|
13091
|
-
}, [isIconOnly]);
|
|
13092
|
-
useEffect(function () {
|
|
13093
|
-
if (canAnimate) {
|
|
13094
|
-
LayoutAnimation.configureNext(defaultAnimation);
|
|
13095
|
-
}
|
|
13096
|
-
}, [displayState.hideButton]);
|
|
13097
|
-
var marginBottom = Number((_StyleSheet$flatten = StyleSheet$1.flatten(style)) === null || _StyleSheet$flatten === void 0 ? void 0 : _StyleSheet$flatten.marginBottom) || 0;
|
|
13098
|
-
return /*#__PURE__*/React.createElement(StyledFAB$1
|
|
13099
|
-
/** Add a small timeout before executing animation to prevent flakiness on android */, {
|
|
13100
|
-
onLayout: function onLayout() {
|
|
13101
|
-
return setTimeout(function () {
|
|
13102
|
-
return setCanAnimate(true);
|
|
13103
|
-
}, 200);
|
|
13104
|
-
},
|
|
13083
|
+
return /*#__PURE__*/React.createElement(StyledFAB$1, {
|
|
13105
13084
|
underlayColor: theme.__hd__.fab.colors.buttonPressedBackground,
|
|
13106
13085
|
onPress: onPress,
|
|
13107
|
-
style:
|
|
13108
|
-
bottom: displayState.hideButton ? -(marginBottom + theme.__hd__.fab.sizes.height * 2) : (_StyleSheet$flatten2 = StyleSheet$1.flatten(style)) === null || _StyleSheet$flatten2 === void 0 ? void 0 : _StyleSheet$flatten2.bottom
|
|
13109
|
-
}],
|
|
13086
|
+
style: style,
|
|
13110
13087
|
testID: testID
|
|
13111
13088
|
}, isIconOnly ? /*#__PURE__*/React.createElement(IconOnlyContent, {
|
|
13112
13089
|
animated: animated,
|
|
13113
13090
|
active: active,
|
|
13114
|
-
icon:
|
|
13091
|
+
icon: icon
|
|
13115
13092
|
}) : /*#__PURE__*/React.createElement(IconWithTextContent, {
|
|
13116
13093
|
icon: icon,
|
|
13117
13094
|
title: title
|
|
13118
13095
|
}));
|
|
13119
|
-
}
|
|
13096
|
+
};
|
|
13120
13097
|
|
|
13121
13098
|
var StyledActionItem = index$a(TouchableHighlight)(function (_ref) {
|
|
13122
13099
|
var theme = _ref.theme;
|
|
@@ -13213,55 +13190,40 @@ var StyledHeaderText = index$a(Typography.Text)(function (_ref3) {
|
|
|
13213
13190
|
};
|
|
13214
13191
|
});
|
|
13215
13192
|
|
|
13216
|
-
var
|
|
13217
|
-
var
|
|
13218
|
-
|
|
13219
|
-
|
|
13220
|
-
style
|
|
13221
|
-
|
|
13222
|
-
|
|
13223
|
-
|
|
13224
|
-
|
|
13225
|
-
|
|
13226
|
-
|
|
13193
|
+
var ActionItemsListComponent = function ActionItemsListComponent(_ref) {
|
|
13194
|
+
var style = _ref.style,
|
|
13195
|
+
items = _ref.items;
|
|
13196
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
13197
|
+
style: style
|
|
13198
|
+
}, items === null || items === void 0 ? void 0 : items.map(function (itemProp) {
|
|
13199
|
+
return /*#__PURE__*/React.createElement(ActionItem, _extends$1({
|
|
13200
|
+
key: itemProp.key || "".concat(itemProp.icon, "_").concat(itemProp.title)
|
|
13201
|
+
}, itemProp));
|
|
13202
|
+
}));
|
|
13203
|
+
};
|
|
13204
|
+
var ActionGroup = function ActionGroup(_ref2) {
|
|
13205
|
+
var headerTitle = _ref2.headerTitle,
|
|
13206
|
+
onPress = _ref2.onPress,
|
|
13207
|
+
active = _ref2.active,
|
|
13208
|
+
style = _ref2.style,
|
|
13209
|
+
items = _ref2.items,
|
|
13210
|
+
testID = _ref2.testID,
|
|
13211
|
+
fabTitle = _ref2.fabTitle,
|
|
13212
|
+
_ref2$fabIcon = _ref2.fabIcon,
|
|
13213
|
+
fabIcon = _ref2$fabIcon === void 0 ? 'add' : _ref2$fabIcon;
|
|
13227
13214
|
var tranlateXAnimation = useRef(new Animated.Value(active ? 1 : 0));
|
|
13228
|
-
var animatedValues = useRef((items === null || items === void 0 ? void 0 : items.map(function () {
|
|
13229
|
-
return new Animated.Value(0);
|
|
13230
|
-
})) || []).current;
|
|
13231
|
-
var translateYAnimations = animatedValues === null || animatedValues === void 0 ? void 0 : animatedValues.map(function (value) {
|
|
13232
|
-
return value.interpolate({
|
|
13233
|
-
inputRange: [0, 1],
|
|
13234
|
-
outputRange: active ? [100, 0] : [40, 0]
|
|
13235
|
-
});
|
|
13236
|
-
});
|
|
13237
|
-
useImperativeHandle(ref, function () {
|
|
13238
|
-
return {
|
|
13239
|
-
showFAB: function showFAB() {
|
|
13240
|
-
var _fabRef$current;
|
|
13241
|
-
return (_fabRef$current = fabRef.current) === null || _fabRef$current === void 0 ? void 0 : _fabRef$current.show();
|
|
13242
|
-
},
|
|
13243
|
-
collapseFAB: function collapseFAB() {
|
|
13244
|
-
var _fabRef$current2;
|
|
13245
|
-
return (_fabRef$current2 = fabRef.current) === null || _fabRef$current2 === void 0 ? void 0 : _fabRef$current2.collapse();
|
|
13246
|
-
},
|
|
13247
|
-
hideFAB: function hideFAB() {
|
|
13248
|
-
var _fabRef$current3;
|
|
13249
|
-
return (_fabRef$current3 = fabRef.current) === null || _fabRef$current3 === void 0 ? void 0 : _fabRef$current3.hide();
|
|
13250
|
-
}
|
|
13251
|
-
};
|
|
13252
|
-
}, [fabRef]);
|
|
13253
13215
|
useEffect(function () {
|
|
13254
|
-
Animated.
|
|
13216
|
+
var animation = Animated.timing(tranlateXAnimation.current, {
|
|
13255
13217
|
toValue: active ? 1 : 0,
|
|
13256
|
-
useNativeDriver: Platform.OS
|
|
13257
|
-
|
|
13258
|
-
|
|
13259
|
-
|
|
13260
|
-
|
|
13261
|
-
|
|
13262
|
-
|
|
13263
|
-
|
|
13264
|
-
}
|
|
13218
|
+
useNativeDriver: Platform.OS === 'ios' || Platform.OS === 'android',
|
|
13219
|
+
easing: Easing.inOut(Easing.cubic)
|
|
13220
|
+
});
|
|
13221
|
+
animation.start();
|
|
13222
|
+
}, [active]);
|
|
13223
|
+
var interpolatedTranlateXAnimation = tranlateXAnimation.current.interpolate({
|
|
13224
|
+
inputRange: [0, 1],
|
|
13225
|
+
outputRange: [400, 0]
|
|
13226
|
+
});
|
|
13265
13227
|
var interpolatedBackdropOpacityAnimation = tranlateXAnimation.current.interpolate({
|
|
13266
13228
|
inputRange: [0, 1],
|
|
13267
13229
|
outputRange: [0, 0.4]
|
|
@@ -13284,39 +13246,24 @@ var ActionGroup = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
13284
13246
|
pointerEvents: active ? 'auto' : 'none',
|
|
13285
13247
|
testID: "action-group",
|
|
13286
13248
|
style: {
|
|
13287
|
-
opacity: interpolatedActionGroupOpacityAnimation
|
|
13288
|
-
}
|
|
13289
|
-
}, !!headerTitle && /*#__PURE__*/React.createElement(Animated.View, {
|
|
13290
|
-
style: {
|
|
13249
|
+
opacity: interpolatedActionGroupOpacityAnimation,
|
|
13291
13250
|
transform: [{
|
|
13292
|
-
|
|
13251
|
+
translateX: interpolatedTranlateXAnimation
|
|
13293
13252
|
}]
|
|
13294
13253
|
}
|
|
13295
|
-
}, /*#__PURE__*/React.createElement(StyledHeaderText, {
|
|
13254
|
+
}, !!headerTitle && /*#__PURE__*/React.createElement(StyledHeaderText, {
|
|
13296
13255
|
testID: "header-text"
|
|
13297
|
-
}, headerTitle)
|
|
13298
|
-
|
|
13299
|
-
|
|
13300
|
-
}]
|
|
13301
|
-
}, items === null || items === void 0 ? void 0 : items.map(function (itemProp, index) {
|
|
13302
|
-
return /*#__PURE__*/React.createElement(Animated.View, {
|
|
13303
|
-
key: itemProp.key || "".concat(itemProp.icon, "_").concat(itemProp.title),
|
|
13304
|
-
style: {
|
|
13305
|
-
transform: [{
|
|
13306
|
-
translateY: translateYAnimations[index]
|
|
13307
|
-
}]
|
|
13308
|
-
}
|
|
13309
|
-
}, /*#__PURE__*/React.createElement(ActionItem, itemProp));
|
|
13310
|
-
}))), /*#__PURE__*/React.createElement(StyledFAB, {
|
|
13256
|
+
}, headerTitle), /*#__PURE__*/React.createElement(ActionItemsListComponent, {
|
|
13257
|
+
items: items
|
|
13258
|
+
})), /*#__PURE__*/React.createElement(StyledFAB, {
|
|
13311
13259
|
testID: "fab",
|
|
13312
13260
|
icon: fabIcon,
|
|
13313
13261
|
onPress: onPress,
|
|
13314
13262
|
animated: true,
|
|
13315
13263
|
active: active,
|
|
13316
|
-
title: fabTitle
|
|
13317
|
-
ref: fabRef
|
|
13264
|
+
title: fabTitle
|
|
13318
13265
|
}));
|
|
13319
|
-
}
|
|
13266
|
+
};
|
|
13320
13267
|
|
|
13321
13268
|
var index$6 = Object.assign(FAB, {
|
|
13322
13269
|
ActionGroup: ActionGroup
|
|
@@ -14999,7 +14946,7 @@ var getGradientColors = function getGradientColors(theme, intent) {
|
|
|
14999
14946
|
}
|
|
15000
14947
|
};
|
|
15001
14948
|
var Skeleton = function Skeleton(_ref) {
|
|
15002
|
-
var _StyleSheet$flatten
|
|
14949
|
+
var _StyleSheet$flatten;
|
|
15003
14950
|
var _ref$intent = _ref.intent,
|
|
15004
14951
|
intent = _ref$intent === void 0 ? 'light' : _ref$intent,
|
|
15005
14952
|
_ref$variant = _ref.variant,
|
|
@@ -15015,14 +14962,10 @@ var Skeleton = function Skeleton(_ref) {
|
|
|
15015
14962
|
_useState2 = _slicedToArray(_useState, 2),
|
|
15016
14963
|
containerWidth = _useState2[0],
|
|
15017
14964
|
setContainerWidth = _useState2[1];
|
|
15018
|
-
var _useState3 = useState(
|
|
14965
|
+
var _useState3 = useState(false),
|
|
15019
14966
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
15020
|
-
|
|
15021
|
-
|
|
15022
|
-
var _useState5 = useState(false),
|
|
15023
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
15024
|
-
shouldStartAnimation = _useState6[0],
|
|
15025
|
-
setShouldStartAnimation = _useState6[1];
|
|
14967
|
+
shouldStartAnimation = _useState4[0],
|
|
14968
|
+
setShouldStartAnimation = _useState4[1];
|
|
15026
14969
|
var animatedValue = useRef(new Animated.Value(0)).current;
|
|
15027
14970
|
useEffect(function () {
|
|
15028
14971
|
if (shouldStartAnimation) {
|
|
@@ -15039,10 +14982,7 @@ var Skeleton = function Skeleton(_ref) {
|
|
|
15039
14982
|
outputRange: [-containerWidth, containerWidth]
|
|
15040
14983
|
});
|
|
15041
14984
|
var onContainerLayout = useCallback(function (e) {
|
|
15042
|
-
var
|
|
15043
|
-
width = _e$nativeEvent$layout.width,
|
|
15044
|
-
height = _e$nativeEvent$layout.height;
|
|
15045
|
-
setContainerHeight(height);
|
|
14985
|
+
var width = e.nativeEvent.layout.width;
|
|
15046
14986
|
setContainerWidth(width);
|
|
15047
14987
|
if (!shouldStartAnimation) {
|
|
15048
14988
|
setShouldStartAnimation(true);
|
|
@@ -15060,8 +15000,8 @@ var Skeleton = function Skeleton(_ref) {
|
|
|
15060
15000
|
start: gradientPositions.start,
|
|
15061
15001
|
end: gradientPositions.end,
|
|
15062
15002
|
style: {
|
|
15063
|
-
width:
|
|
15064
|
-
height:
|
|
15003
|
+
width: '100%',
|
|
15004
|
+
height: '100%',
|
|
15065
15005
|
transform: [{
|
|
15066
15006
|
translateX: translateX
|
|
15067
15007
|
}]
|