@hero-design/rn 8.12.5 → 8.14.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 +9 -9
- package/es/index.js +279 -36
- package/lib/index.js +279 -35
- package/package.json +5 -5
- package/src/components/Error/StyledError.tsx +86 -0
- package/src/components/Error/__tests__/__snapshots__/index.spec.tsx.snap +349 -0
- package/src/components/Error/__tests__/index.spec.tsx +67 -0
- package/src/components/Error/index.tsx +223 -0
- package/src/index.ts +2 -0
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +30 -0
- package/src/theme/components/error.ts +40 -0
- package/src/theme/getTheme.ts +3 -0
- package/types/components/Error/StyledError.d.ts +54 -0
- package/types/components/Error/index.d.ts +55 -0
- package/types/index.d.ts +2 -1
- package/types/theme/components/error.d.ts +32 -0
- package/types/theme/getTheme.d.ts +2 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
[
|
|
2
|
-
[
|
|
3
|
-
[
|
|
4
|
-
[
|
|
5
|
-
[
|
|
6
|
-
[
|
|
7
|
-
[
|
|
8
|
-
[
|
|
9
|
-
[
|
|
1
|
+
[32m@hero-design/rn:build[0m: cache hit, replaying output [2m03d15f462ba189d6[0m
|
|
2
|
+
[32m@hero-design/rn:build: [0m$ yarn build:js && yarn build:types
|
|
3
|
+
[32m@hero-design/rn:build: [0m$ rollup -c
|
|
4
|
+
[32m@hero-design/rn:build: [0m[36m
|
|
5
|
+
[32m@hero-design/rn:build: [0m[1msrc/index.ts[22m → [1mlib/index.js, es/index.js[22m...[39m
|
|
6
|
+
[32m@hero-design/rn:build: [0m[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
|
|
7
|
+
[32m@hero-design/rn:build: [0m[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
|
|
8
|
+
[32m@hero-design/rn:build: [0m[32mcreated [1mlib/index.js, es/index.js[22m in [1m26.9s[22m[39m
|
|
9
|
+
[32m@hero-design/rn:build: [0m$ tsc --noEmit false --emitDeclarationOnly --project tsconfig.prod.json
|
package/es/index.js
CHANGED
|
@@ -2164,6 +2164,44 @@ var getEmptyTheme = function getEmptyTheme(theme) {
|
|
|
2164
2164
|
};
|
|
2165
2165
|
};
|
|
2166
2166
|
|
|
2167
|
+
var getErrorTheme = function getErrorTheme(theme) {
|
|
2168
|
+
var space = {
|
|
2169
|
+
titleMarginBottom: theme.space.small,
|
|
2170
|
+
imageMarginBottom: theme.space.xlarge,
|
|
2171
|
+
wrapperPadding: theme.space.large,
|
|
2172
|
+
button: {
|
|
2173
|
+
wrapperHorizontalPadding: theme.space.medium,
|
|
2174
|
+
wrapperVerticalPadding: theme.space.xxxlarge,
|
|
2175
|
+
margin: theme.space.medium,
|
|
2176
|
+
padding: theme.space.medium
|
|
2177
|
+
}
|
|
2178
|
+
};
|
|
2179
|
+
var sizes = {
|
|
2180
|
+
image: theme.sizes['19xlarge']
|
|
2181
|
+
};
|
|
2182
|
+
var colors = {
|
|
2183
|
+
title: theme.colors.onDefaultGlobalSurface,
|
|
2184
|
+
description: theme.colors.mutedOnDefaultGlobalSurface,
|
|
2185
|
+
fullScreenBackground: theme.colors.decorativePrimarySurface,
|
|
2186
|
+
inPageBackground: theme.colors.neutralGlobalSurface
|
|
2187
|
+
};
|
|
2188
|
+
var fontSizes = {
|
|
2189
|
+
title: theme.fontSizes.xxxlarge,
|
|
2190
|
+
description: theme.fontSizes.xlarge
|
|
2191
|
+
};
|
|
2192
|
+
var fonts = {
|
|
2193
|
+
title: theme.fonts.playful.semiBold,
|
|
2194
|
+
description: theme.fonts.playful.regular
|
|
2195
|
+
};
|
|
2196
|
+
return {
|
|
2197
|
+
fontSizes: fontSizes,
|
|
2198
|
+
colors: colors,
|
|
2199
|
+
sizes: sizes,
|
|
2200
|
+
space: space,
|
|
2201
|
+
fonts: fonts
|
|
2202
|
+
};
|
|
2203
|
+
};
|
|
2204
|
+
|
|
2167
2205
|
var getFABTheme = function getFABTheme(theme) {
|
|
2168
2206
|
var colors = {
|
|
2169
2207
|
buttonBackground: theme.colors.primary,
|
|
@@ -2944,6 +2982,7 @@ var getTheme$1 = function getTheme() {
|
|
|
2944
2982
|
divider: getDividerTheme(globalTheme),
|
|
2945
2983
|
drawer: getDrawerTheme(globalTheme),
|
|
2946
2984
|
empty: getEmptyTheme(globalTheme),
|
|
2985
|
+
error: getErrorTheme(globalTheme),
|
|
2947
2986
|
fab: getFABTheme(globalTheme),
|
|
2948
2987
|
icon: getIconTheme(globalTheme),
|
|
2949
2988
|
image: getImageTheme(globalTheme),
|
|
@@ -5978,7 +6017,7 @@ var StyledText$3 = index$a(Text$1)(function (_ref) {
|
|
|
5978
6017
|
});
|
|
5979
6018
|
});
|
|
5980
6019
|
|
|
5981
|
-
var _excluded$
|
|
6020
|
+
var _excluded$q = ["children", "fontSize", "fontWeight", "intent", "typeface", "allowFontScaling"];
|
|
5982
6021
|
var Text = function Text(_ref) {
|
|
5983
6022
|
var children = _ref.children,
|
|
5984
6023
|
_ref$fontSize = _ref.fontSize,
|
|
@@ -5991,7 +6030,7 @@ var Text = function Text(_ref) {
|
|
|
5991
6030
|
typeface = _ref$typeface === void 0 ? 'neutral' : _ref$typeface,
|
|
5992
6031
|
_ref$allowFontScaling = _ref.allowFontScaling,
|
|
5993
6032
|
allowFontScaling = _ref$allowFontScaling === void 0 ? false : _ref$allowFontScaling,
|
|
5994
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$
|
|
6033
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$q);
|
|
5995
6034
|
return /*#__PURE__*/React.createElement(StyledText$3, _extends$1({}, nativeProps, {
|
|
5996
6035
|
themeFontSize: fontSize,
|
|
5997
6036
|
themeFontWeight: fontWeight,
|
|
@@ -6498,10 +6537,10 @@ var StyledHeroIcon = index$a(HeroIcon)(function (_ref) {
|
|
|
6498
6537
|
};
|
|
6499
6538
|
});
|
|
6500
6539
|
|
|
6501
|
-
var _excluded$
|
|
6540
|
+
var _excluded$p = ["style"];
|
|
6502
6541
|
var AnimatedIcon = function AnimatedIcon(_ref) {
|
|
6503
6542
|
var style = _ref.style,
|
|
6504
|
-
otherProps = _objectWithoutProperties(_ref, _excluded$
|
|
6543
|
+
otherProps = _objectWithoutProperties(_ref, _excluded$p);
|
|
6505
6544
|
var rotateAnimation = useRef(new Animated.Value(0));
|
|
6506
6545
|
useEffect(function () {
|
|
6507
6546
|
var animation = Animated.loop(Animated.timing(rotateAnimation.current, {
|
|
@@ -6607,7 +6646,7 @@ var AccordionItem = function AccordionItem(_ref) {
|
|
|
6607
6646
|
}, content));
|
|
6608
6647
|
};
|
|
6609
6648
|
|
|
6610
|
-
var _excluded$
|
|
6649
|
+
var _excluded$o = ["key"];
|
|
6611
6650
|
var Accordion = function Accordion(_ref) {
|
|
6612
6651
|
var items = _ref.items,
|
|
6613
6652
|
activeItemKey = _ref.activeItemKey,
|
|
@@ -6628,7 +6667,7 @@ var Accordion = function Accordion(_ref) {
|
|
|
6628
6667
|
testID: testID
|
|
6629
6668
|
}, items.map(function (_ref2, index) {
|
|
6630
6669
|
var key = _ref2.key,
|
|
6631
|
-
props = _objectWithoutProperties(_ref2, _excluded$
|
|
6670
|
+
props = _objectWithoutProperties(_ref2, _excluded$o);
|
|
6632
6671
|
var open = _activeItemKey === key;
|
|
6633
6672
|
return /*#__PURE__*/React.createElement(React.Fragment, {
|
|
6634
6673
|
key: key
|
|
@@ -7014,7 +7053,7 @@ var StyledStatus = index$a(Animated.View)(function (_ref3) {
|
|
|
7014
7053
|
};
|
|
7015
7054
|
});
|
|
7016
7055
|
|
|
7017
|
-
var _excluded$
|
|
7056
|
+
var _excluded$n = ["children", "visible", "intent", "style", "testID"];
|
|
7018
7057
|
var Status = function Status(_ref) {
|
|
7019
7058
|
var children = _ref.children,
|
|
7020
7059
|
_ref$visible = _ref.visible,
|
|
@@ -7023,7 +7062,7 @@ var Status = function Status(_ref) {
|
|
|
7023
7062
|
intent = _ref$intent === void 0 ? 'danger' : _ref$intent,
|
|
7024
7063
|
style = _ref.style,
|
|
7025
7064
|
testID = _ref.testID,
|
|
7026
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$
|
|
7065
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$n);
|
|
7027
7066
|
var _React$useRef = React.useRef(new Animated.Value(visible ? 1 : 0)),
|
|
7028
7067
|
opacity = _React$useRef.current;
|
|
7029
7068
|
var isFirstRendering = React.useRef(true);
|
|
@@ -7056,7 +7095,7 @@ var Status = function Status(_ref) {
|
|
|
7056
7095
|
}));
|
|
7057
7096
|
};
|
|
7058
7097
|
|
|
7059
|
-
var _excluded$
|
|
7098
|
+
var _excluded$m = ["content", "visible", "max", "intent", "style", "testID"];
|
|
7060
7099
|
var DEFAULT_MAX_NUMBER = 99;
|
|
7061
7100
|
var getPaddingState = function getPaddingState(content) {
|
|
7062
7101
|
return content.length > 1 ? 'wideContent' : 'narrowContent';
|
|
@@ -7071,7 +7110,7 @@ var Badge = function Badge(_ref) {
|
|
|
7071
7110
|
intent = _ref$intent === void 0 ? 'danger' : _ref$intent,
|
|
7072
7111
|
style = _ref.style,
|
|
7073
7112
|
testID = _ref.testID,
|
|
7074
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$
|
|
7113
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$m);
|
|
7075
7114
|
var _React$useRef = React.useRef(new Animated.Value(visible ? 1 : 0)),
|
|
7076
7115
|
opacity = _React$useRef.current;
|
|
7077
7116
|
var isFirstRendering = React.useRef(true);
|
|
@@ -7175,7 +7214,7 @@ function omit(keys, obj) {
|
|
|
7175
7214
|
return result;
|
|
7176
7215
|
}
|
|
7177
7216
|
|
|
7178
|
-
var _excluded$
|
|
7217
|
+
var _excluded$l = ["onTabPress", "renderActiveTabOnly", "selectedTabKey", "tabs"];
|
|
7179
7218
|
var getInactiveIcon = function getInactiveIcon(icon) {
|
|
7180
7219
|
var inactiveIcon = "".concat(icon, "-outlined");
|
|
7181
7220
|
return isHeroIcon(inactiveIcon) ? inactiveIcon : icon;
|
|
@@ -7186,7 +7225,7 @@ var BottomNavigation = function BottomNavigation(_ref) {
|
|
|
7186
7225
|
renderActiveTabOnly = _ref$renderActiveTabO === void 0 ? false : _ref$renderActiveTabO,
|
|
7187
7226
|
selectedTabKey = _ref.selectedTabKey,
|
|
7188
7227
|
tabs = _ref.tabs,
|
|
7189
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$
|
|
7228
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$l);
|
|
7190
7229
|
var insets = useSafeAreaInsets();
|
|
7191
7230
|
/**
|
|
7192
7231
|
* List of loaded tabs, tabs will be loaded when navigated to.
|
|
@@ -7273,13 +7312,13 @@ var StyledDivider = index$a(View)(function (_ref) {
|
|
|
7273
7312
|
}, horizontalMargin), verticalMargin);
|
|
7274
7313
|
});
|
|
7275
7314
|
|
|
7276
|
-
var _excluded$
|
|
7315
|
+
var _excluded$k = ["marginHorizontal", "marginVertical", "style", "testID"];
|
|
7277
7316
|
var Divider = function Divider(_ref) {
|
|
7278
7317
|
var marginHorizontal = _ref.marginHorizontal,
|
|
7279
7318
|
marginVertical = _ref.marginVertical,
|
|
7280
7319
|
style = _ref.style,
|
|
7281
7320
|
testID = _ref.testID,
|
|
7282
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$
|
|
7321
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$k);
|
|
7283
7322
|
return /*#__PURE__*/React.createElement(StyledDivider, _extends$1({}, nativeProps, {
|
|
7284
7323
|
themeMarginHorizontal: marginHorizontal,
|
|
7285
7324
|
themeMarginVertical: marginVertical,
|
|
@@ -7409,7 +7448,7 @@ var StyledLoadingDot = index$a(View)(function (_ref2) {
|
|
|
7409
7448
|
}, themeStyling());
|
|
7410
7449
|
});
|
|
7411
7450
|
|
|
7412
|
-
var _excluded$
|
|
7451
|
+
var _excluded$j = ["count", "size", "testID", "themeVariant"];
|
|
7413
7452
|
var AnimatedLoadingIndicatorWrapper = Animated.createAnimatedComponent(StyledLoadingIndicatorWrapper);
|
|
7414
7453
|
var AnimatedLoadingDot = Animated.createAnimatedComponent(StyledLoadingDot);
|
|
7415
7454
|
var renderDotComponent = function renderDotComponent(_ref) {
|
|
@@ -7441,7 +7480,7 @@ var LoadingIndicator = function LoadingIndicator(_ref2) {
|
|
|
7441
7480
|
size = _ref2$size === void 0 ? 12 : _ref2$size,
|
|
7442
7481
|
testID = _ref2.testID,
|
|
7443
7482
|
themeVariant = _ref2.themeVariant,
|
|
7444
|
-
nativeProps = _objectWithoutProperties(_ref2, _excluded$
|
|
7483
|
+
nativeProps = _objectWithoutProperties(_ref2, _excluded$j);
|
|
7445
7484
|
var progressAnimation = useRef(new Animated.Value(0));
|
|
7446
7485
|
useEffect(function () {
|
|
7447
7486
|
var animation = Animated.loop(Animated.timing(progressAnimation.current, {
|
|
@@ -7871,11 +7910,11 @@ var Header = function Header(_ref) {
|
|
|
7871
7910
|
})) : null), showDivider ? /*#__PURE__*/React.createElement(Divider, null) : null);
|
|
7872
7911
|
};
|
|
7873
7912
|
|
|
7874
|
-
var _excluded$
|
|
7913
|
+
var _excluded$i = ["scrollEventThrottle"];
|
|
7875
7914
|
var BottomSheetScrollView = function BottomSheetScrollView(_ref) {
|
|
7876
7915
|
var _ref$scrollEventThrot = _ref.scrollEventThrottle,
|
|
7877
7916
|
scrollEventThrottle = _ref$scrollEventThrot === void 0 ? 100 : _ref$scrollEventThrot,
|
|
7878
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
7917
|
+
props = _objectWithoutProperties(_ref, _excluded$i);
|
|
7879
7918
|
var _useContext = useContext(BottomSheetContext),
|
|
7880
7919
|
setInternalShowDivider = _useContext.setInternalShowDivider;
|
|
7881
7920
|
var onScrollBeginDrag = useCallback(function (e) {
|
|
@@ -8190,7 +8229,7 @@ var borderWidths = {
|
|
|
8190
8229
|
var config = _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, colors), space), radii), borderWidths);
|
|
8191
8230
|
var flexPropsKey = ['alignContent', 'alignItems', 'alignSelf', 'display', 'flex', 'flexBasis', 'flexDirection', 'flexGrow', 'flexShrink', 'flexWrap', 'justifyContent'];
|
|
8192
8231
|
|
|
8193
|
-
var _excluded$
|
|
8232
|
+
var _excluded$h = ["theme"];
|
|
8194
8233
|
var getThemeValue = function getThemeValue(theme, key, props) {
|
|
8195
8234
|
var propConfig = config[key];
|
|
8196
8235
|
var propValue = props[key];
|
|
@@ -8217,18 +8256,18 @@ var mapStylePropToThemeValue = function mapStylePropToThemeValue(theme, props) {
|
|
|
8217
8256
|
var configKeys = Object.keys(config);
|
|
8218
8257
|
var StyledBox = index$a(View)(function (_ref5) {
|
|
8219
8258
|
var theme = _ref5.theme,
|
|
8220
|
-
otherProps = _objectWithoutProperties(_ref5, _excluded$
|
|
8259
|
+
otherProps = _objectWithoutProperties(_ref5, _excluded$h);
|
|
8221
8260
|
var styleProps = pick(configKeys, otherProps);
|
|
8222
8261
|
var flexProps = pick(_toConsumableArray(flexPropsKey), otherProps);
|
|
8223
8262
|
return _objectSpread2(_objectSpread2({}, mapStylePropToThemeValue(theme, styleProps)), flexProps);
|
|
8224
8263
|
});
|
|
8225
8264
|
|
|
8226
|
-
var _excluded$
|
|
8265
|
+
var _excluded$g = ["children", "style", "testID"];
|
|
8227
8266
|
var Box = function Box(_ref) {
|
|
8228
8267
|
var children = _ref.children,
|
|
8229
8268
|
style = _ref.style,
|
|
8230
8269
|
testID = _ref.testID,
|
|
8231
|
-
otherProps = _objectWithoutProperties(_ref, _excluded$
|
|
8270
|
+
otherProps = _objectWithoutProperties(_ref, _excluded$g);
|
|
8232
8271
|
return /*#__PURE__*/React.createElement(StyledBox, _extends$1({}, otherProps, {
|
|
8233
8272
|
style: style,
|
|
8234
8273
|
testID: testID
|
|
@@ -10793,7 +10832,7 @@ var Calendar = function Calendar(_ref) {
|
|
|
10793
10832
|
})));
|
|
10794
10833
|
};
|
|
10795
10834
|
|
|
10796
|
-
var _excluded$
|
|
10835
|
+
var _excluded$f = ["rounded", "size", "testID", "style"];
|
|
10797
10836
|
var Image = function Image(_ref) {
|
|
10798
10837
|
var _ref$rounded = _ref.rounded,
|
|
10799
10838
|
rounded = _ref$rounded === void 0 ? false : _ref$rounded,
|
|
@@ -10801,7 +10840,7 @@ var Image = function Image(_ref) {
|
|
|
10801
10840
|
size = _ref$size === void 0 ? '6xlarge' : _ref$size,
|
|
10802
10841
|
testID = _ref.testID,
|
|
10803
10842
|
style = _ref.style,
|
|
10804
|
-
imageNativeProps = _objectWithoutProperties(_ref, _excluded$
|
|
10843
|
+
imageNativeProps = _objectWithoutProperties(_ref, _excluded$f);
|
|
10805
10844
|
var theme = useTheme();
|
|
10806
10845
|
var imageSize = theme.__hd__.image.sizes[size];
|
|
10807
10846
|
return /*#__PURE__*/React.createElement(Image$1, _extends$1({
|
|
@@ -10994,12 +11033,12 @@ var Indicator = index$a(View)(function (_ref2) {
|
|
|
10994
11033
|
};
|
|
10995
11034
|
});
|
|
10996
11035
|
|
|
10997
|
-
var _excluded$
|
|
11036
|
+
var _excluded$e = ["intent", "children"];
|
|
10998
11037
|
var DataCard = function DataCard(_ref) {
|
|
10999
11038
|
var _ref$intent = _ref.intent,
|
|
11000
11039
|
intent = _ref$intent === void 0 ? 'info' : _ref$intent,
|
|
11001
11040
|
children = _ref.children,
|
|
11002
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$
|
|
11041
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$e);
|
|
11003
11042
|
return /*#__PURE__*/React.createElement(StyledDataCard, nativeProps, /*#__PURE__*/React.createElement(Indicator, {
|
|
11004
11043
|
themeIntent: intent,
|
|
11005
11044
|
testID: "data-card-indicator"
|
|
@@ -11017,11 +11056,11 @@ var StyledCard$1 = index$a(View)(function (_ref) {
|
|
|
11017
11056
|
});
|
|
11018
11057
|
});
|
|
11019
11058
|
|
|
11020
|
-
var _excluded$
|
|
11059
|
+
var _excluded$d = ["intent", "children"];
|
|
11021
11060
|
var Card = function Card(_ref) {
|
|
11022
11061
|
var intent = _ref.intent,
|
|
11023
11062
|
children = _ref.children,
|
|
11024
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$
|
|
11063
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$d);
|
|
11025
11064
|
return /*#__PURE__*/React.createElement(StyledCard$1, _extends$1({}, nativeProps, {
|
|
11026
11065
|
themeIntent: intent
|
|
11027
11066
|
}), children);
|
|
@@ -11209,7 +11248,7 @@ var CardCarousel = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
11209
11248
|
}));
|
|
11210
11249
|
});
|
|
11211
11250
|
|
|
11212
|
-
var _excluded$
|
|
11251
|
+
var _excluded$c = ["items", "onItemIndexChange", "renderActions", "selectedItemIndex", "style", "shouldShowPagination"];
|
|
11213
11252
|
function useStateFromProp(initialValue) {
|
|
11214
11253
|
var _useState = useState(initialValue),
|
|
11215
11254
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -11231,7 +11270,7 @@ var Carousel = function Carousel(_ref) {
|
|
|
11231
11270
|
shouldShowPagination = _ref$shouldShowPagina === void 0 ? function () {
|
|
11232
11271
|
return true;
|
|
11233
11272
|
} : _ref$shouldShowPagina,
|
|
11234
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$
|
|
11273
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$c);
|
|
11235
11274
|
var carouselRef = useRef(null);
|
|
11236
11275
|
var _useStateFromProp = useStateFromProp(selectedItemIndex),
|
|
11237
11276
|
_useStateFromProp2 = _slicedToArray(_useStateFromProp, 2),
|
|
@@ -11451,7 +11490,7 @@ var StyledAsteriskLabelInsideTextInput = index$a(Typography.Text)(function (_ref
|
|
|
11451
11490
|
fontSize: theme.__hd__.textInput.fontSizes.asteriskLabel
|
|
11452
11491
|
};
|
|
11453
11492
|
});
|
|
11454
|
-
var StyledErrorContainer$
|
|
11493
|
+
var StyledErrorContainer$2 = index$a(View)(function (_ref7) {
|
|
11455
11494
|
var theme = _ref7.theme;
|
|
11456
11495
|
return {
|
|
11457
11496
|
marginRight: theme.__hd__.textInput.space.errorContainerMarginRight,
|
|
@@ -11543,7 +11582,7 @@ var StyledErrorAndMaxLengthContainer = index$a(View)(function () {
|
|
|
11543
11582
|
};
|
|
11544
11583
|
});
|
|
11545
11584
|
|
|
11546
|
-
var _excluded$
|
|
11585
|
+
var _excluded$b = ["label", "prefix", "suffix", "style", "textStyle", "testID", "accessibilityLabelledBy", "error", "required", "editable", "disabled", "loading", "maxLength", "helpText", "value", "defaultValue", "renderInputValue", "allowFontScaling"];
|
|
11547
11586
|
var getVariant$1 = function getVariant(_ref) {
|
|
11548
11587
|
var disabled = _ref.disabled,
|
|
11549
11588
|
error = _ref.error,
|
|
@@ -11591,7 +11630,7 @@ var TextInput = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
11591
11630
|
renderInputValue = _ref2.renderInputValue,
|
|
11592
11631
|
_ref2$allowFontScalin = _ref2.allowFontScaling,
|
|
11593
11632
|
allowFontScaling = _ref2$allowFontScalin === void 0 ? false : _ref2$allowFontScalin,
|
|
11594
|
-
nativeProps = _objectWithoutProperties(_ref2, _excluded$
|
|
11633
|
+
nativeProps = _objectWithoutProperties(_ref2, _excluded$b);
|
|
11595
11634
|
var displayText = (_ref3 = value !== undefined ? value : defaultValue) !== null && _ref3 !== void 0 ? _ref3 : '';
|
|
11596
11635
|
var isEmptyValue = displayText.length === 0;
|
|
11597
11636
|
var actualSuffix = loading ? 'loading' : suffix;
|
|
@@ -11754,7 +11793,7 @@ var TextInput = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
11754
11793
|
icon: actualSuffix,
|
|
11755
11794
|
spin: actualSuffix === 'loading',
|
|
11756
11795
|
size: "xsmall"
|
|
11757
|
-
}) : suffix), /*#__PURE__*/React.createElement(StyledErrorAndHelpTextContainer, null, /*#__PURE__*/React.createElement(StyledErrorAndMaxLengthContainer, null, error ? /*#__PURE__*/React.createElement(StyledErrorContainer$
|
|
11796
|
+
}) : suffix), /*#__PURE__*/React.createElement(StyledErrorAndHelpTextContainer, null, /*#__PURE__*/React.createElement(StyledErrorAndMaxLengthContainer, null, error ? /*#__PURE__*/React.createElement(StyledErrorContainer$2, null, /*#__PURE__*/React.createElement(Icon, {
|
|
11758
11797
|
testID: "input-error-icon",
|
|
11759
11798
|
icon: "circle-info",
|
|
11760
11799
|
size: "xsmall",
|
|
@@ -12262,6 +12301,210 @@ var Empty = function Empty(_ref) {
|
|
|
12262
12301
|
}, description));
|
|
12263
12302
|
};
|
|
12264
12303
|
|
|
12304
|
+
var StyledErrorModal = index$a(Modal)({
|
|
12305
|
+
height: '100%',
|
|
12306
|
+
width: '100%'
|
|
12307
|
+
});
|
|
12308
|
+
var StyledErrorContainer$1 = index$a(View)(function (_ref) {
|
|
12309
|
+
var theme = _ref.theme,
|
|
12310
|
+
themeVariant = _ref.themeVariant;
|
|
12311
|
+
return {
|
|
12312
|
+
display: 'flex',
|
|
12313
|
+
flex: 1,
|
|
12314
|
+
flexDirection: 'column',
|
|
12315
|
+
backgroundColor: themeVariant === 'in-page' ? theme.__hd__.error.colors.inPageBackground : theme.__hd__.error.colors.fullScreenBackground
|
|
12316
|
+
};
|
|
12317
|
+
});
|
|
12318
|
+
var StyledErrorContent = index$a(View)(function (_ref2) {
|
|
12319
|
+
var theme = _ref2.theme;
|
|
12320
|
+
return {
|
|
12321
|
+
display: 'flex',
|
|
12322
|
+
flex: 1,
|
|
12323
|
+
flexDirection: 'column',
|
|
12324
|
+
justifyContent: 'center',
|
|
12325
|
+
alignItems: 'center',
|
|
12326
|
+
padding: theme.__hd__.error.space.wrapperPadding
|
|
12327
|
+
};
|
|
12328
|
+
});
|
|
12329
|
+
var StyledErrorButtonContainer = index$a(View)(function (_ref3) {
|
|
12330
|
+
var theme = _ref3.theme;
|
|
12331
|
+
return {
|
|
12332
|
+
display: 'flex',
|
|
12333
|
+
flexDirection: 'column',
|
|
12334
|
+
justifyContent: 'center',
|
|
12335
|
+
alignItems: 'center',
|
|
12336
|
+
paddingHorizontal: theme.__hd__.error.space.button.wrapperHorizontalPadding,
|
|
12337
|
+
paddingVertical: theme.__hd__.error.space.button.wrapperVerticalPadding
|
|
12338
|
+
};
|
|
12339
|
+
});
|
|
12340
|
+
var StyledErrorButtonPrimary = index$a(CompoundButton)(function (_ref4) {
|
|
12341
|
+
var theme = _ref4.theme;
|
|
12342
|
+
return {
|
|
12343
|
+
padding: theme.__hd__.error.space.button.padding
|
|
12344
|
+
};
|
|
12345
|
+
});
|
|
12346
|
+
var StyledErrorButtonSecondary = index$a(CompoundButton)(function (_ref5) {
|
|
12347
|
+
var theme = _ref5.theme;
|
|
12348
|
+
return {
|
|
12349
|
+
marginTop: theme.__hd__.error.space.button.margin,
|
|
12350
|
+
padding: theme.__hd__.error.space.button.padding
|
|
12351
|
+
};
|
|
12352
|
+
});
|
|
12353
|
+
var StyledErrorImage = index$a(Image)(function (_ref6) {
|
|
12354
|
+
var theme = _ref6.theme;
|
|
12355
|
+
return {
|
|
12356
|
+
marginBottom: theme.__hd__.error.space.imageMarginBottom,
|
|
12357
|
+
width: theme.__hd__.error.sizes.image,
|
|
12358
|
+
height: theme.__hd__.error.sizes.image,
|
|
12359
|
+
resizeMode: 'contain'
|
|
12360
|
+
};
|
|
12361
|
+
});
|
|
12362
|
+
var StyledErrorTitle = index$a(Typography.Text)(function (_ref7) {
|
|
12363
|
+
var theme = _ref7.theme;
|
|
12364
|
+
return {
|
|
12365
|
+
fontFamily: theme.__hd__.error.fonts.title,
|
|
12366
|
+
fontSize: theme.__hd__.error.fontSizes.title,
|
|
12367
|
+
textAlign: 'center',
|
|
12368
|
+
marginBottom: theme.__hd__.error.space.titleMarginBottom,
|
|
12369
|
+
color: theme.__hd__.error.colors.title
|
|
12370
|
+
};
|
|
12371
|
+
});
|
|
12372
|
+
var StyledErrorDescription = index$a(Typography.Text)(function (_ref8) {
|
|
12373
|
+
var theme = _ref8.theme;
|
|
12374
|
+
return {
|
|
12375
|
+
fontFamily: theme.__hd__.error.fonts.description,
|
|
12376
|
+
fontSize: theme.__hd__.error.fontSizes.description,
|
|
12377
|
+
textAlign: 'center',
|
|
12378
|
+
color: theme.__hd__.error.colors.description
|
|
12379
|
+
};
|
|
12380
|
+
});
|
|
12381
|
+
|
|
12382
|
+
var _excluded$a = ["variant", "title", "description", "image", "testID", "ctaText", "onCtaPress", "secondaryCtaText", "onSecondaryCtaPress"],
|
|
12383
|
+
_excluded2 = ["visible", "variant", "title", "description", "image", "testID", "ctaText", "onCtaPress", "secondaryCtaText", "onSecondaryCtaPress"];
|
|
12384
|
+
var ErrorPage = function ErrorPage(_ref) {
|
|
12385
|
+
var _ref$variant = _ref.variant,
|
|
12386
|
+
variant = _ref$variant === void 0 ? 'in-page' : _ref$variant,
|
|
12387
|
+
title = _ref.title,
|
|
12388
|
+
description = _ref.description,
|
|
12389
|
+
image = _ref.image,
|
|
12390
|
+
testID = _ref.testID,
|
|
12391
|
+
ctaText = _ref.ctaText,
|
|
12392
|
+
onCtaPress = _ref.onCtaPress,
|
|
12393
|
+
secondaryCtaText = _ref.secondaryCtaText,
|
|
12394
|
+
onSecondaryCtaPress = _ref.onSecondaryCtaPress,
|
|
12395
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$a);
|
|
12396
|
+
var showCta = ctaText && onCtaPress !== undefined;
|
|
12397
|
+
var showSecondaryCta = secondaryCtaText && onSecondaryCtaPress !== undefined;
|
|
12398
|
+
var showButtonContainer = showCta || showSecondaryCta;
|
|
12399
|
+
return /*#__PURE__*/React.createElement(StyledErrorContainer$1, {
|
|
12400
|
+
testID: testID,
|
|
12401
|
+
themeVariant: variant
|
|
12402
|
+
}, /*#__PURE__*/React.createElement(StyledErrorContent, nativeProps, image && /*#__PURE__*/React.createElement(StyledErrorImage, {
|
|
12403
|
+
source: typeof image === 'string' ? {
|
|
12404
|
+
uri: image
|
|
12405
|
+
} : image,
|
|
12406
|
+
testID: "error-image"
|
|
12407
|
+
}), /*#__PURE__*/React.createElement(StyledErrorTitle, null, title), description && /*#__PURE__*/React.createElement(StyledErrorDescription, null, description)), showButtonContainer && /*#__PURE__*/React.createElement(StyledErrorButtonContainer, null, showCta && /*#__PURE__*/React.createElement(StyledErrorButtonPrimary, {
|
|
12408
|
+
variant: "filled",
|
|
12409
|
+
text: ctaText,
|
|
12410
|
+
onPress: onCtaPress
|
|
12411
|
+
}), showSecondaryCta && /*#__PURE__*/React.createElement(StyledErrorButtonSecondary, {
|
|
12412
|
+
variant: "text",
|
|
12413
|
+
text: secondaryCtaText,
|
|
12414
|
+
onPress: onSecondaryCtaPress
|
|
12415
|
+
})));
|
|
12416
|
+
};
|
|
12417
|
+
/**
|
|
12418
|
+
* Renders error page
|
|
12419
|
+
*
|
|
12420
|
+
* @param {ErrorProps}
|
|
12421
|
+
* @return {*} {ReactElement}
|
|
12422
|
+
*/
|
|
12423
|
+
var Error$1 = function Error(_ref2) {
|
|
12424
|
+
var _ref2$visible = _ref2.visible,
|
|
12425
|
+
visible = _ref2$visible === void 0 ? true : _ref2$visible,
|
|
12426
|
+
_ref2$variant = _ref2.variant,
|
|
12427
|
+
variant = _ref2$variant === void 0 ? 'in-page' : _ref2$variant,
|
|
12428
|
+
title = _ref2.title,
|
|
12429
|
+
description = _ref2.description,
|
|
12430
|
+
image = _ref2.image,
|
|
12431
|
+
testID = _ref2.testID,
|
|
12432
|
+
ctaText = _ref2.ctaText,
|
|
12433
|
+
onCtaPress = _ref2.onCtaPress,
|
|
12434
|
+
secondaryCtaText = _ref2.secondaryCtaText,
|
|
12435
|
+
onSecondaryCtaPress = _ref2.onSecondaryCtaPress,
|
|
12436
|
+
nativeProps = _objectWithoutProperties(_ref2, _excluded2);
|
|
12437
|
+
useDeprecation("Visible prop is deprecated. Use conditional rendering instead", visible);
|
|
12438
|
+
var _useState = useState(visible),
|
|
12439
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
12440
|
+
isVisible = _useState2[0],
|
|
12441
|
+
setIsVisible = _useState2[1];
|
|
12442
|
+
var _useState3 = useState(null),
|
|
12443
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
12444
|
+
ctaPressed = _useState4[0],
|
|
12445
|
+
setCtaPressed = _useState4[1];
|
|
12446
|
+
var onCloseModal = useCallback(function () {
|
|
12447
|
+
if (ctaPressed === 'cta' && onCtaPress) {
|
|
12448
|
+
onCtaPress();
|
|
12449
|
+
}
|
|
12450
|
+
if (ctaPressed === 'secondaryCta' && onSecondaryCtaPress) {
|
|
12451
|
+
onSecondaryCtaPress();
|
|
12452
|
+
}
|
|
12453
|
+
setCtaPressed(null);
|
|
12454
|
+
}, [ctaPressed, onCtaPress, onSecondaryCtaPress]);
|
|
12455
|
+
useEffect(function () {
|
|
12456
|
+
setIsVisible(visible);
|
|
12457
|
+
}, [visible]);
|
|
12458
|
+
// These useEffect lines prevents race condition error when callback contains navigation logic
|
|
12459
|
+
useEffect(function () {
|
|
12460
|
+
if (ctaPressed) {
|
|
12461
|
+
setIsVisible(false);
|
|
12462
|
+
}
|
|
12463
|
+
}, [ctaPressed]);
|
|
12464
|
+
useEffect(function () {
|
|
12465
|
+
if (!isVisible) {
|
|
12466
|
+
onCloseModal();
|
|
12467
|
+
}
|
|
12468
|
+
}, [isVisible, onCloseModal]);
|
|
12469
|
+
if (variant === 'full-screen') {
|
|
12470
|
+
return /*#__PURE__*/React.createElement(StyledErrorModal, {
|
|
12471
|
+
visible: isVisible,
|
|
12472
|
+
onRequestClose: function onRequestClose() {
|
|
12473
|
+
return setIsVisible(false);
|
|
12474
|
+
},
|
|
12475
|
+
onDismiss: function onDismiss() {
|
|
12476
|
+
return setIsVisible(false);
|
|
12477
|
+
},
|
|
12478
|
+
animationType: "slide"
|
|
12479
|
+
}, /*#__PURE__*/React.createElement(ErrorPage, _extends$1({
|
|
12480
|
+
variant: variant,
|
|
12481
|
+
title: title,
|
|
12482
|
+
description: description,
|
|
12483
|
+
image: image,
|
|
12484
|
+
testID: testID,
|
|
12485
|
+
ctaText: ctaText,
|
|
12486
|
+
onCtaPress: onCtaPress && function () {
|
|
12487
|
+
setCtaPressed('cta');
|
|
12488
|
+
},
|
|
12489
|
+
secondaryCtaText: secondaryCtaText,
|
|
12490
|
+
onSecondaryCtaPress: onSecondaryCtaPress && function () {
|
|
12491
|
+
setCtaPressed('secondaryCta');
|
|
12492
|
+
}
|
|
12493
|
+
}, nativeProps)));
|
|
12494
|
+
}
|
|
12495
|
+
return /*#__PURE__*/React.createElement(ErrorPage, _extends$1({
|
|
12496
|
+
variant: variant,
|
|
12497
|
+
title: title,
|
|
12498
|
+
description: description,
|
|
12499
|
+
image: image,
|
|
12500
|
+
testID: testID,
|
|
12501
|
+
ctaText: ctaText,
|
|
12502
|
+
onCtaPress: onCtaPress,
|
|
12503
|
+
secondaryCtaText: secondaryCtaText,
|
|
12504
|
+
onSecondaryCtaPress: onSecondaryCtaPress
|
|
12505
|
+
}, nativeProps));
|
|
12506
|
+
};
|
|
12507
|
+
|
|
12265
12508
|
var StyledFABContainer = index$a(TouchableHighlight)(function (_ref) {
|
|
12266
12509
|
var theme = _ref.theme;
|
|
12267
12510
|
return {
|
|
@@ -31802,7 +32045,7 @@ var RichTextEditor = function RichTextEditor(_ref) {
|
|
|
31802
32045
|
hideKeyboardAccessoryView: true,
|
|
31803
32046
|
keyboardDisplayRequiresUserAction: false,
|
|
31804
32047
|
height: webviewHeight
|
|
31805
|
-
})))), /*#__PURE__*/React.createElement(StyledErrorAndHelpTextContainer, null, /*#__PURE__*/React.createElement(StyledErrorAndMaxLengthContainer, null, error ? /*#__PURE__*/React.createElement(StyledErrorContainer$
|
|
32048
|
+
})))), /*#__PURE__*/React.createElement(StyledErrorAndHelpTextContainer, null, /*#__PURE__*/React.createElement(StyledErrorAndMaxLengthContainer, null, error ? /*#__PURE__*/React.createElement(StyledErrorContainer$2, null, /*#__PURE__*/React.createElement(Icon, {
|
|
31806
32049
|
testID: "input-error-icon",
|
|
31807
32050
|
icon: "circle-info",
|
|
31808
32051
|
size: "xsmall",
|
|
@@ -31822,4 +32065,4 @@ var index = Object.assign(RichTextEditor$1, {
|
|
|
31822
32065
|
Toolbar: EditorToolbar
|
|
31823
32066
|
});
|
|
31824
32067
|
|
|
31825
|
-
export { Accordion, Alert, Attachment, index$9 as Avatar, Badge$1 as Badge, BottomNavigation, BottomSheet$1 as BottomSheet, Box, CompoundButton as Button, Calendar, Card$1 as Card, index$8 as Carousel, Checkbox, Collapse, ContentNavigator, DatePicker, Divider, index$7 as Drawer, Empty, index$6 as FAB, Icon, Image, List, PageControl, PinInput, Progress, CompoundRadio as Radio, RefreshControl, index as RichTextEditor, SectionHeading, index$4 as Select, Slider, Spinner, index$5 as Swipeable, index$3 as Switch, index$2 as Tabs, Tag, TextInput, ThemeProvider, ThemeSwitcher, TimePicker, Toast, index$1 as Toolbar, Typography, eBensSystemPalette, getTheme$1 as getTheme, jobsSystemPalette, scale, swagDarkSystemPalette, swagSystemPalette, defaultTheme as theme, useAvatarColors, useTheme, walletSystemPalette, withTheme, workSystemPalette };
|
|
32068
|
+
export { Accordion, Alert, Attachment, index$9 as Avatar, Badge$1 as Badge, BottomNavigation, BottomSheet$1 as BottomSheet, Box, CompoundButton as Button, Calendar, Card$1 as Card, index$8 as Carousel, Checkbox, Collapse, ContentNavigator, DatePicker, Divider, index$7 as Drawer, Empty, Error$1 as Error, index$6 as FAB, Icon, Image, List, PageControl, PinInput, Progress, CompoundRadio as Radio, RefreshControl, index as RichTextEditor, SectionHeading, index$4 as Select, Slider, Spinner, index$5 as Swipeable, index$3 as Switch, index$2 as Tabs, Tag, TextInput, ThemeProvider, ThemeSwitcher, TimePicker, Toast, index$1 as Toolbar, Typography, eBensSystemPalette, getTheme$1 as getTheme, jobsSystemPalette, scale, swagDarkSystemPalette, swagSystemPalette, defaultTheme as theme, useAvatarColors, useTheme, walletSystemPalette, withTheme, workSystemPalette };
|