@hero-design/rn 0.0.0-integrate-basic-table-20251229041814 → 0.0.0-integrate-basic-table-20251229143430
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 +3 -3
- package/CHANGELOG.md +3 -1
- package/es/index.js +205 -66
- package/lib/index.js +205 -66
- package/package.json +1 -1
- package/src/components/Progress/SegmentedBar/StyledSegmentedBar.tsx +29 -0
- package/src/components/Progress/SegmentedBar/__tests__/index.spec.tsx +42 -0
- package/src/components/Progress/SegmentedBar/__tests__/utils.spec.tsx +24 -0
- package/src/components/Progress/SegmentedBar/constants.ts +6 -0
- package/src/components/Progress/SegmentedBar/hooks/validation.ts +27 -0
- package/src/components/Progress/SegmentedBar/index.tsx +120 -0
- package/src/components/Progress/SegmentedBar/types.ts +45 -0
- package/src/components/Progress/SegmentedBar/utils.ts +16 -0
- package/src/components/Progress/index.tsx +2 -0
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +2 -0
- package/src/theme/components/progress.ts +2 -0
- package/src/types.ts +2 -0
- package/src/utils/helpers.ts +6 -0
- package/types/components/Progress/SegmentedBar/StyledSegmentedBar.d.ts +16 -0
- package/types/components/Progress/SegmentedBar/constants.d.ts +5 -0
- package/types/components/Progress/SegmentedBar/hooks/validation.d.ts +4 -0
- package/types/components/Progress/SegmentedBar/index.d.ts +4 -0
- package/types/components/Progress/SegmentedBar/types.d.ts +39 -0
- package/types/components/Progress/SegmentedBar/utils.d.ts +2 -0
- package/types/components/Progress/index.d.ts +1 -0
- package/types/theme/components/progress.d.ts +2 -0
- package/types/types.d.ts +2 -1
- package/types/utils/helpers.d.ts +1 -0
package/lib/index.js
CHANGED
|
@@ -6547,7 +6547,8 @@ var getProgressTheme = function getProgressTheme(theme) {
|
|
|
6547
6547
|
complete: theme.colors.primary,
|
|
6548
6548
|
incomplete: theme.colors.archivedSurface,
|
|
6549
6549
|
current: theme.colors.decorativePrimarySurface
|
|
6550
|
-
}
|
|
6550
|
+
},
|
|
6551
|
+
segmentedRemainderBackground: theme.colors.archivedSurface
|
|
6551
6552
|
};
|
|
6552
6553
|
var sizes = {
|
|
6553
6554
|
circleDiameter: theme.sizes['6xlarge'],
|
|
@@ -6559,7 +6560,8 @@ var getProgressTheme = function getProgressTheme(theme) {
|
|
|
6559
6560
|
"default": theme.radii.rounded
|
|
6560
6561
|
};
|
|
6561
6562
|
var space = {
|
|
6562
|
-
stepGap: theme.space.xsmall
|
|
6563
|
+
stepGap: theme.space.xsmall,
|
|
6564
|
+
segmentedHeaderMarginBottom: theme.space.small
|
|
6563
6565
|
};
|
|
6564
6566
|
return {
|
|
6565
6567
|
colors: colors,
|
|
@@ -6873,6 +6875,11 @@ var transformKebabCaseToCamelCase = function transformKebabCaseToCamelCase(strin
|
|
|
6873
6875
|
return /[a-z]/.test(_char4) ? _char4.toUpperCase() : _char4;
|
|
6874
6876
|
});
|
|
6875
6877
|
};
|
|
6878
|
+
function assert(condition, message) {
|
|
6879
|
+
if (!condition) {
|
|
6880
|
+
throw new Error(message);
|
|
6881
|
+
}
|
|
6882
|
+
}
|
|
6876
6883
|
|
|
6877
6884
|
var getSliderTheme = function getSliderTheme(theme) {
|
|
6878
6885
|
var colors = {
|
|
@@ -8062,7 +8069,7 @@ var StyledText$4 = index$c(reactNative.Text)(function (_ref) {
|
|
|
8062
8069
|
});
|
|
8063
8070
|
});
|
|
8064
8071
|
|
|
8065
|
-
var _excluded$
|
|
8072
|
+
var _excluded$O = ["children", "fontSize", "fontWeight", "intent", "typeface", "allowFontScaling"];
|
|
8066
8073
|
/**
|
|
8067
8074
|
* @deprecated Typography.Text is deprecated and will be removed in the next major release, please refer to https://design.employmenthero.com/mobile/Components/typography for the appropriate alternatives.
|
|
8068
8075
|
*/
|
|
@@ -8078,7 +8085,7 @@ var Text = function Text(_ref) {
|
|
|
8078
8085
|
typeface = _ref$typeface === void 0 ? 'neutral' : _ref$typeface,
|
|
8079
8086
|
_ref$allowFontScaling = _ref.allowFontScaling,
|
|
8080
8087
|
allowFontScaling = _ref$allowFontScaling === void 0 ? false : _ref$allowFontScaling,
|
|
8081
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$
|
|
8088
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$O);
|
|
8082
8089
|
useDeprecation('Typography.Text is deprecated and will be removed in the next major release, please refer to https://design.employmenthero.com/mobile/Components/typography for the appropriate alternatives.');
|
|
8083
8090
|
return /*#__PURE__*/React__namespace.default.createElement(StyledText$4, _extends$1({}, nativeProps, {
|
|
8084
8091
|
themeFontSize: fontSize,
|
|
@@ -8111,7 +8118,7 @@ var StyledCaption = index$c(reactNative.Text)(function (_ref) {
|
|
|
8111
8118
|
};
|
|
8112
8119
|
});
|
|
8113
8120
|
|
|
8114
|
-
var _excluded$
|
|
8121
|
+
var _excluded$N = ["children", "fontWeight", "intent", "allowFontScaling", "fontStyle"];
|
|
8115
8122
|
var Caption = function Caption(_ref) {
|
|
8116
8123
|
var children = _ref.children,
|
|
8117
8124
|
_ref$fontWeight = _ref.fontWeight,
|
|
@@ -8122,7 +8129,7 @@ var Caption = function Caption(_ref) {
|
|
|
8122
8129
|
allowFontScaling = _ref$allowFontScaling === void 0 ? false : _ref$allowFontScaling,
|
|
8123
8130
|
_ref$fontStyle = _ref.fontStyle,
|
|
8124
8131
|
fontStyle = _ref$fontStyle === void 0 ? 'normal' : _ref$fontStyle,
|
|
8125
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$
|
|
8132
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$N);
|
|
8126
8133
|
return /*#__PURE__*/React__namespace.default.createElement(StyledCaption, _extends$1({}, nativeProps, {
|
|
8127
8134
|
themeFontWeight: fontWeight,
|
|
8128
8135
|
themeIntent: intent,
|
|
@@ -8147,7 +8154,7 @@ var StyledLabel$1 = index$c(reactNative.Text)(function (_ref) {
|
|
|
8147
8154
|
};
|
|
8148
8155
|
});
|
|
8149
8156
|
|
|
8150
|
-
var _excluded$
|
|
8157
|
+
var _excluded$M = ["children", "intent", "allowFontScaling", "fontStyle"];
|
|
8151
8158
|
var Label = function Label(_ref) {
|
|
8152
8159
|
var children = _ref.children,
|
|
8153
8160
|
_ref$intent = _ref.intent,
|
|
@@ -8156,7 +8163,7 @@ var Label = function Label(_ref) {
|
|
|
8156
8163
|
allowFontScaling = _ref$allowFontScaling === void 0 ? false : _ref$allowFontScaling,
|
|
8157
8164
|
_ref$fontStyle = _ref.fontStyle,
|
|
8158
8165
|
fontStyle = _ref$fontStyle === void 0 ? 'normal' : _ref$fontStyle,
|
|
8159
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$
|
|
8166
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$M);
|
|
8160
8167
|
return /*#__PURE__*/React__namespace.default.createElement(StyledLabel$1, _extends$1({}, nativeProps, {
|
|
8161
8168
|
themeIntent: intent,
|
|
8162
8169
|
themeIsItalic: fontStyle === 'italic',
|
|
@@ -8179,7 +8186,7 @@ var StyledTitle$1 = index$c(reactNative.Text)(function (_ref) {
|
|
|
8179
8186
|
};
|
|
8180
8187
|
});
|
|
8181
8188
|
|
|
8182
|
-
var _excluded$
|
|
8189
|
+
var _excluded$L = ["children", "intent", "allowFontScaling", "level", "typeface", "fontStyle"];
|
|
8183
8190
|
var Title = function Title(_ref) {
|
|
8184
8191
|
var children = _ref.children,
|
|
8185
8192
|
_ref$intent = _ref.intent,
|
|
@@ -8192,7 +8199,7 @@ var Title = function Title(_ref) {
|
|
|
8192
8199
|
typeface = _ref$typeface === void 0 ? 'neutral' : _ref$typeface,
|
|
8193
8200
|
_ref$fontStyle = _ref.fontStyle,
|
|
8194
8201
|
fontStyle = _ref$fontStyle === void 0 ? 'normal' : _ref$fontStyle,
|
|
8195
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$
|
|
8202
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$L);
|
|
8196
8203
|
return /*#__PURE__*/React__namespace.default.createElement(StyledTitle$1, _extends$1({}, nativeProps, {
|
|
8197
8204
|
themeLevel: level,
|
|
8198
8205
|
themeTypeface: typeface,
|
|
@@ -8231,7 +8238,7 @@ var StyledBody$2 = index$c(reactNative.Text)(function (_ref) {
|
|
|
8231
8238
|
};
|
|
8232
8239
|
});
|
|
8233
8240
|
|
|
8234
|
-
var _excluded$
|
|
8241
|
+
var _excluded$K = ["children", "intent", "allowFontScaling", "typeface", "variant", "fontStyle"];
|
|
8235
8242
|
var Body = function Body(_ref) {
|
|
8236
8243
|
var children = _ref.children,
|
|
8237
8244
|
_ref$intent = _ref.intent,
|
|
@@ -8244,7 +8251,7 @@ var Body = function Body(_ref) {
|
|
|
8244
8251
|
variant = _ref$variant === void 0 ? 'regular' : _ref$variant,
|
|
8245
8252
|
_ref$fontStyle = _ref.fontStyle,
|
|
8246
8253
|
fontStyle = _ref$fontStyle === void 0 ? 'normal' : _ref$fontStyle,
|
|
8247
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$
|
|
8254
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$K);
|
|
8248
8255
|
return /*#__PURE__*/React__namespace.default.createElement(StyledBody$2, _extends$1({}, nativeProps, {
|
|
8249
8256
|
themeTypeface: typeface,
|
|
8250
8257
|
themeIntent: intent,
|
|
@@ -8861,10 +8868,10 @@ var StyledHeroIcon = index$c(HeroIcon)(function (_ref) {
|
|
|
8861
8868
|
};
|
|
8862
8869
|
});
|
|
8863
8870
|
|
|
8864
|
-
var _excluded$
|
|
8871
|
+
var _excluded$J = ["style"];
|
|
8865
8872
|
var AnimatedIcon = function AnimatedIcon(_ref) {
|
|
8866
8873
|
var style = _ref.style,
|
|
8867
|
-
otherProps = _objectWithoutProperties(_ref, _excluded$
|
|
8874
|
+
otherProps = _objectWithoutProperties(_ref, _excluded$J);
|
|
8868
8875
|
var rotateAnimation = React.useRef(new reactNative.Animated.Value(0));
|
|
8869
8876
|
React.useEffect(function () {
|
|
8870
8877
|
var animation = reactNative.Animated.loop(reactNative.Animated.timing(rotateAnimation.current, {
|
|
@@ -8969,7 +8976,7 @@ var AccordionItem = function AccordionItem(_ref) {
|
|
|
8969
8976
|
}, content));
|
|
8970
8977
|
};
|
|
8971
8978
|
|
|
8972
|
-
var _excluded$
|
|
8979
|
+
var _excluded$I = ["key"];
|
|
8973
8980
|
var Accordion = function Accordion(_ref) {
|
|
8974
8981
|
var items = _ref.items,
|
|
8975
8982
|
activeItemKey = _ref.activeItemKey,
|
|
@@ -8992,7 +8999,7 @@ var Accordion = function Accordion(_ref) {
|
|
|
8992
8999
|
accessible: accessible
|
|
8993
9000
|
}, items.map(function (_ref2, index) {
|
|
8994
9001
|
var key = _ref2.key,
|
|
8995
|
-
props = _objectWithoutProperties(_ref2, _excluded$
|
|
9002
|
+
props = _objectWithoutProperties(_ref2, _excluded$I);
|
|
8996
9003
|
var open = _activeItemKey === key;
|
|
8997
9004
|
return /*#__PURE__*/React__namespace.default.createElement(React__namespace.default.Fragment, {
|
|
8998
9005
|
key: key
|
|
@@ -9828,7 +9835,7 @@ var borderWidths = {
|
|
|
9828
9835
|
var config = _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, colors), space), radii), borderWidths);
|
|
9829
9836
|
var flexPropsKey = ['alignContent', 'alignItems', 'alignSelf', 'display', 'flex', 'flexBasis', 'flexDirection', 'flexGrow', 'flexShrink', 'flexWrap', 'justifyContent'];
|
|
9830
9837
|
|
|
9831
|
-
var _excluded$
|
|
9838
|
+
var _excluded$H = ["theme"];
|
|
9832
9839
|
var getThemeValue = function getThemeValue(theme, key, props) {
|
|
9833
9840
|
var propConfig = config[key];
|
|
9834
9841
|
var propValue = props[key];
|
|
@@ -9855,18 +9862,18 @@ var mapStylePropToThemeValue = function mapStylePropToThemeValue(theme, props) {
|
|
|
9855
9862
|
var configKeys = Object.keys(config);
|
|
9856
9863
|
var StyledBox = index$c(reactNative.View)(function (_ref5) {
|
|
9857
9864
|
var theme = _ref5.theme,
|
|
9858
|
-
otherProps = _objectWithoutProperties(_ref5, _excluded$
|
|
9865
|
+
otherProps = _objectWithoutProperties(_ref5, _excluded$H);
|
|
9859
9866
|
var styleProps = pick(configKeys, otherProps);
|
|
9860
9867
|
var flexProps = pick(_toConsumableArray(flexPropsKey), otherProps);
|
|
9861
9868
|
return _objectSpread2(_objectSpread2({}, mapStylePropToThemeValue(theme, styleProps)), flexProps);
|
|
9862
9869
|
});
|
|
9863
9870
|
|
|
9864
|
-
var _excluded$
|
|
9871
|
+
var _excluded$G = ["children", "style", "testID"];
|
|
9865
9872
|
var Box = function Box(_ref) {
|
|
9866
9873
|
var children = _ref.children,
|
|
9867
9874
|
style = _ref.style,
|
|
9868
9875
|
testID = _ref.testID,
|
|
9869
|
-
otherProps = _objectWithoutProperties(_ref, _excluded$
|
|
9876
|
+
otherProps = _objectWithoutProperties(_ref, _excluded$G);
|
|
9870
9877
|
return /*#__PURE__*/React__namespace.default.createElement(StyledBox, _extends$1({}, otherProps, {
|
|
9871
9878
|
style: style,
|
|
9872
9879
|
testID: testID
|
|
@@ -10133,7 +10140,7 @@ var StyledIcon$4 = index$c(Icon)(function (_ref6) {
|
|
|
10133
10140
|
};
|
|
10134
10141
|
});
|
|
10135
10142
|
|
|
10136
|
-
var _excluded$
|
|
10143
|
+
var _excluded$F = ["children", "visible", "intent", "style", "testID"];
|
|
10137
10144
|
var Status$1 = function Status(_ref) {
|
|
10138
10145
|
var children = _ref.children,
|
|
10139
10146
|
_ref$visible = _ref.visible,
|
|
@@ -10142,7 +10149,7 @@ var Status$1 = function Status(_ref) {
|
|
|
10142
10149
|
intent = _ref$intent === void 0 ? 'danger' : _ref$intent,
|
|
10143
10150
|
style = _ref.style,
|
|
10144
10151
|
testID = _ref.testID,
|
|
10145
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$
|
|
10152
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$F);
|
|
10146
10153
|
var _React$useRef = React__namespace.default.useRef(new reactNative.Animated.Value(visible ? 1 : 0)),
|
|
10147
10154
|
opacity = _React$useRef.current;
|
|
10148
10155
|
var isFirstRendering = React__namespace.default.useRef(true);
|
|
@@ -10178,7 +10185,7 @@ var Status$1 = function Status(_ref) {
|
|
|
10178
10185
|
|
|
10179
10186
|
var DEFAULT_MAX_NUMBER = 99;
|
|
10180
10187
|
|
|
10181
|
-
var _excluded$
|
|
10188
|
+
var _excluded$E = ["children", "visible", "style", "max", "testID", "content"];
|
|
10182
10189
|
var Status = function Status(_ref) {
|
|
10183
10190
|
var children = _ref.children,
|
|
10184
10191
|
_ref$visible = _ref.visible,
|
|
@@ -10188,7 +10195,7 @@ var Status = function Status(_ref) {
|
|
|
10188
10195
|
max = _ref$max === void 0 ? DEFAULT_MAX_NUMBER : _ref$max,
|
|
10189
10196
|
testID = _ref.testID,
|
|
10190
10197
|
originalContent = _ref.content,
|
|
10191
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$
|
|
10198
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$E);
|
|
10192
10199
|
var content = React.useMemo(function () {
|
|
10193
10200
|
return originalContent > max ? "".concat(max, "+") : String(originalContent);
|
|
10194
10201
|
}, [originalContent, max]);
|
|
@@ -10200,7 +10207,7 @@ var Status = function Status(_ref) {
|
|
|
10200
10207
|
}, /*#__PURE__*/React__namespace.default.createElement(StyledCountText, null, content)));
|
|
10201
10208
|
};
|
|
10202
10209
|
|
|
10203
|
-
var _excluded$
|
|
10210
|
+
var _excluded$D = ["content", "visible", "max", "intent", "style", "testID", "size", "variant", "icon"];
|
|
10204
10211
|
var getPaddingState = function getPaddingState(content) {
|
|
10205
10212
|
return content.length > 1 ? 'wideContent' : 'narrowContent';
|
|
10206
10213
|
};
|
|
@@ -10219,7 +10226,7 @@ var Badge = function Badge(_ref) {
|
|
|
10219
10226
|
_ref$variant = _ref.variant,
|
|
10220
10227
|
variant = _ref$variant === void 0 ? 'filled' : _ref$variant,
|
|
10221
10228
|
icon = _ref.icon,
|
|
10222
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$
|
|
10229
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$D);
|
|
10223
10230
|
var _React$useRef = React__namespace.default.useRef(new reactNative.Animated.Value(visible ? 1 : 0)),
|
|
10224
10231
|
opacity = _React$useRef.current;
|
|
10225
10232
|
var isFirstRendering = React__namespace.default.useRef(true);
|
|
@@ -10318,7 +10325,7 @@ var StyledBottomBarText = index$c(Typography.Label)(function (_ref3) {
|
|
|
10318
10325
|
};
|
|
10319
10326
|
});
|
|
10320
10327
|
|
|
10321
|
-
var _excluded$
|
|
10328
|
+
var _excluded$C = ["onTabPress", "renderActiveTabOnly", "selectedTabKey", "tabs"];
|
|
10322
10329
|
var getInactiveIcon = function getInactiveIcon(icon) {
|
|
10323
10330
|
var inactiveIcon = "".concat(icon, "-outlined");
|
|
10324
10331
|
return isHeroIcon(inactiveIcon) ? inactiveIcon : icon;
|
|
@@ -10329,7 +10336,7 @@ var BottomNavigation = function BottomNavigation(_ref) {
|
|
|
10329
10336
|
renderActiveTabOnly = _ref$renderActiveTabO === void 0 ? false : _ref$renderActiveTabO,
|
|
10330
10337
|
selectedTabKey = _ref.selectedTabKey,
|
|
10331
10338
|
tabs = _ref.tabs,
|
|
10332
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$
|
|
10339
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$C);
|
|
10333
10340
|
var insets = reactNativeSafeAreaContext.useSafeAreaInsets();
|
|
10334
10341
|
/**
|
|
10335
10342
|
* List of loaded tabs, tabs will be loaded when navigated to.
|
|
@@ -10414,13 +10421,13 @@ var StyledDivider = index$c(reactNative.View)(function (_ref) {
|
|
|
10414
10421
|
}, horizontalMargin), verticalMargin);
|
|
10415
10422
|
});
|
|
10416
10423
|
|
|
10417
|
-
var _excluded$
|
|
10424
|
+
var _excluded$B = ["marginHorizontal", "marginVertical", "style", "testID"];
|
|
10418
10425
|
var Divider = function Divider(_ref) {
|
|
10419
10426
|
var marginHorizontal = _ref.marginHorizontal,
|
|
10420
10427
|
marginVertical = _ref.marginVertical,
|
|
10421
10428
|
style = _ref.style,
|
|
10422
10429
|
testID = _ref.testID,
|
|
10423
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$
|
|
10430
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$B);
|
|
10424
10431
|
return /*#__PURE__*/React__namespace.default.createElement(StyledDivider, _extends$1({}, nativeProps, {
|
|
10425
10432
|
themeMarginHorizontal: marginHorizontal,
|
|
10426
10433
|
themeMarginVertical: marginVertical,
|
|
@@ -10481,7 +10488,7 @@ var StyledHeaderWrapper = index$c(reactNative.View)(function (_ref5) {
|
|
|
10481
10488
|
paddingHorizontal: theme.__hd__.bottomSheet.space.headerWrapperHorizontalPadding
|
|
10482
10489
|
};
|
|
10483
10490
|
});
|
|
10484
|
-
var StyledHeader = index$c(reactNative.View)({
|
|
10491
|
+
var StyledHeader$1 = index$c(reactNative.View)({
|
|
10485
10492
|
flex: 1,
|
|
10486
10493
|
justifyContent: 'center'
|
|
10487
10494
|
});
|
|
@@ -10550,7 +10557,7 @@ var StyledLoadingDot = index$c(reactNative.View)(function (_ref) {
|
|
|
10550
10557
|
}, themeStyling());
|
|
10551
10558
|
});
|
|
10552
10559
|
|
|
10553
|
-
var _excluded$
|
|
10560
|
+
var _excluded$A = ["count", "size", "testID", "themeVariant"];
|
|
10554
10561
|
var AnimatedLoadingIndicatorWrapper = reactNative.Animated.createAnimatedComponent(StyledLoadingIndicatorWrapper);
|
|
10555
10562
|
var AnimatedLoadingDot = reactNative.Animated.createAnimatedComponent(StyledLoadingDot);
|
|
10556
10563
|
var renderDotComponent = function renderDotComponent(_ref) {
|
|
@@ -10582,7 +10589,7 @@ var LoadingIndicator = function LoadingIndicator(_ref2) {
|
|
|
10582
10589
|
size = _ref2$size === void 0 ? 12 : _ref2$size,
|
|
10583
10590
|
testID = _ref2.testID,
|
|
10584
10591
|
themeVariant = _ref2.themeVariant,
|
|
10585
|
-
nativeProps = _objectWithoutProperties(_ref2, _excluded$
|
|
10592
|
+
nativeProps = _objectWithoutProperties(_ref2, _excluded$A);
|
|
10586
10593
|
var progressAnimation = React.useRef(new reactNative.Animated.Value(0));
|
|
10587
10594
|
React.useEffect(function () {
|
|
10588
10595
|
var animation = reactNative.Animated.loop(reactNative.Animated.timing(progressAnimation.current, {
|
|
@@ -11191,7 +11198,7 @@ var Header = function Header(_ref) {
|
|
|
11191
11198
|
_ref$variant = _ref.variant,
|
|
11192
11199
|
variant = _ref$variant === void 0 ? 'fixed' : _ref$variant;
|
|
11193
11200
|
var theme = useTheme();
|
|
11194
|
-
return /*#__PURE__*/React__namespace.default.createElement(React__namespace.default.Fragment, null, /*#__PURE__*/React__namespace.default.createElement(StyledHeaderWrapper, null, typeof content === 'string' ? /*#__PURE__*/React__namespace.default.createElement(StyledHeader, null, /*#__PURE__*/React__namespace.default.createElement(Typography.Body, {
|
|
11201
|
+
return /*#__PURE__*/React__namespace.default.createElement(React__namespace.default.Fragment, null, /*#__PURE__*/React__namespace.default.createElement(StyledHeaderWrapper, null, typeof content === 'string' ? /*#__PURE__*/React__namespace.default.createElement(StyledHeader$1, null, /*#__PURE__*/React__namespace.default.createElement(Typography.Body, {
|
|
11195
11202
|
variant: "regular-bold"
|
|
11196
11203
|
}, content)) : /*#__PURE__*/React__namespace.default.createElement(reactNative.View, {
|
|
11197
11204
|
style: {
|
|
@@ -11214,11 +11221,11 @@ var Header = function Header(_ref) {
|
|
|
11214
11221
|
}))) : null), showDivider ? /*#__PURE__*/React__namespace.default.createElement(Divider, null) : null);
|
|
11215
11222
|
};
|
|
11216
11223
|
|
|
11217
|
-
var _excluded$
|
|
11224
|
+
var _excluded$z = ["scrollEventThrottle"];
|
|
11218
11225
|
var BottomSheetScrollView = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
11219
11226
|
var _ref$scrollEventThrot = _ref.scrollEventThrottle,
|
|
11220
11227
|
scrollEventThrottle = _ref$scrollEventThrot === void 0 ? 100 : _ref$scrollEventThrot,
|
|
11221
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
11228
|
+
props = _objectWithoutProperties(_ref, _excluded$z);
|
|
11222
11229
|
var _useContext = React.useContext(BottomSheetContext),
|
|
11223
11230
|
setInternalShowDivider = _useContext.setInternalShowDivider;
|
|
11224
11231
|
var onScrollBeginDrag = React.useCallback(function (e) {
|
|
@@ -14346,12 +14353,12 @@ var Indicator = index$c(reactNative.View)(function (_ref3) {
|
|
|
14346
14353
|
};
|
|
14347
14354
|
});
|
|
14348
14355
|
|
|
14349
|
-
var _excluded$
|
|
14356
|
+
var _excluded$y = ["intent", "children"];
|
|
14350
14357
|
var DataCard = function DataCard(_ref) {
|
|
14351
14358
|
var _ref$intent = _ref.intent,
|
|
14352
14359
|
intent = _ref$intent === void 0 ? 'info' : _ref$intent,
|
|
14353
14360
|
children = _ref.children,
|
|
14354
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$
|
|
14361
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$y);
|
|
14355
14362
|
return /*#__PURE__*/React__namespace.default.createElement(StyledDataCard, nativeProps, /*#__PURE__*/React__namespace.default.createElement(Indicator, {
|
|
14356
14363
|
themeIntent: intent,
|
|
14357
14364
|
testID: "data-card-indicator"
|
|
@@ -14370,13 +14377,13 @@ var StyledCard$1 = index$c(reactNative.View)(function (_ref) {
|
|
|
14370
14377
|
});
|
|
14371
14378
|
});
|
|
14372
14379
|
|
|
14373
|
-
var _excluded$
|
|
14380
|
+
var _excluded$x = ["intent", "children", "variant"];
|
|
14374
14381
|
var Card = function Card(_ref) {
|
|
14375
14382
|
var intent = _ref.intent,
|
|
14376
14383
|
children = _ref.children,
|
|
14377
14384
|
_ref$variant = _ref.variant,
|
|
14378
14385
|
variant = _ref$variant === void 0 ? 'basic' : _ref$variant,
|
|
14379
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$
|
|
14386
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$x);
|
|
14380
14387
|
return /*#__PURE__*/React__namespace.default.createElement(StyledCard$1, _extends$1({}, nativeProps, {
|
|
14381
14388
|
themeIntent: intent,
|
|
14382
14389
|
themeVariant: variant
|
|
@@ -14643,7 +14650,7 @@ var CardCarousel = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
14643
14650
|
});
|
|
14644
14651
|
CardCarousel.displayName = 'CardCarousel';
|
|
14645
14652
|
|
|
14646
|
-
var _excluded$
|
|
14653
|
+
var _excluded$w = ["rounded", "size", "testID", "style"];
|
|
14647
14654
|
/**
|
|
14648
14655
|
* @deprecated Image component will soon be deprecated. Please use `Image` from `react-native` instead.
|
|
14649
14656
|
*/
|
|
@@ -14654,7 +14661,7 @@ var Image = function Image(_ref) {
|
|
|
14654
14661
|
size = _ref$size === void 0 ? '6xlarge' : _ref$size,
|
|
14655
14662
|
testID = _ref.testID,
|
|
14656
14663
|
style = _ref.style,
|
|
14657
|
-
imageNativeProps = _objectWithoutProperties(_ref, _excluded$
|
|
14664
|
+
imageNativeProps = _objectWithoutProperties(_ref, _excluded$w);
|
|
14658
14665
|
useDeprecation('Image component will soon be deprecated. Please use `Image` from `react-native` instead.');
|
|
14659
14666
|
var theme = useTheme();
|
|
14660
14667
|
var imageSize = theme.__hd__.image.sizes[size];
|
|
@@ -14789,7 +14796,7 @@ var CarouselItem = function CarouselItem(_ref) {
|
|
|
14789
14796
|
}, heading), !!body && /*#__PURE__*/React__namespace.default.createElement(Typography.Body, null, body)));
|
|
14790
14797
|
};
|
|
14791
14798
|
|
|
14792
|
-
var _excluded$
|
|
14799
|
+
var _excluded$v = ["items", "onItemIndexChange", "renderActions", "selectedItemIndex", "style", "shouldShowPagination", "testID", "pageControlPosition"];
|
|
14793
14800
|
function useStateFromProp(initialValue) {
|
|
14794
14801
|
var _useState = React.useState(initialValue),
|
|
14795
14802
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -14816,7 +14823,7 @@ var Carousel = function Carousel(_ref) {
|
|
|
14816
14823
|
testID = _ref.testID,
|
|
14817
14824
|
_ref$pageControlPosit = _ref.pageControlPosition,
|
|
14818
14825
|
pageControlPosition = _ref$pageControlPosit === void 0 ? 'top' : _ref$pageControlPosit,
|
|
14819
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$
|
|
14826
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$v);
|
|
14820
14827
|
useDeprecation("shouldShowPagination prop has been deprecated", shouldShowPagination !== noop$1);
|
|
14821
14828
|
useDeprecation("The use of 'pageControlPosition == bottom' has been deprecated", pageControlPosition === 'bottom');
|
|
14822
14829
|
var theme = useTheme();
|
|
@@ -20087,7 +20094,7 @@ var StyledChipIcon = index$c(Icon)(function (_ref2) {
|
|
|
20087
20094
|
};
|
|
20088
20095
|
});
|
|
20089
20096
|
|
|
20090
|
-
var _excluded$
|
|
20097
|
+
var _excluded$u = ["label", "variant", "selected", "icon", "onPress", "showSelectedIcon", "accessible"];
|
|
20091
20098
|
var getChipLabel = function getChipLabel(label) {
|
|
20092
20099
|
if (typeof label === 'string') {
|
|
20093
20100
|
return /*#__PURE__*/React__namespace.default.createElement(Typography.Body, {
|
|
@@ -20121,7 +20128,7 @@ var Chip = function Chip(_ref) {
|
|
|
20121
20128
|
_ref$showSelectedIcon = _ref.showSelectedIcon,
|
|
20122
20129
|
showSelectedIcon = _ref$showSelectedIcon === void 0 ? true : _ref$showSelectedIcon,
|
|
20123
20130
|
accessible = _ref.accessible,
|
|
20124
|
-
otherProps = _objectWithoutProperties(_ref, _excluded$
|
|
20131
|
+
otherProps = _objectWithoutProperties(_ref, _excluded$u);
|
|
20125
20132
|
useDeprecation('Chip variant `outlined` and `filled` are deprecated.', variant === 'outlined' || variant === 'filled');
|
|
20126
20133
|
var renamedVariant = getChipVariant(variant);
|
|
20127
20134
|
var shouldShowSelectedIcon = (renamedVariant === 'selection' || renamedVariant === 'compact-outlined') && selected && showSelectedIcon;
|
|
@@ -20474,7 +20481,7 @@ var StyledErrorAndMaxLengthContainer = index$c(reactNative.View)(function (_ref1
|
|
|
20474
20481
|
};
|
|
20475
20482
|
});
|
|
20476
20483
|
|
|
20477
|
-
var _excluded$
|
|
20484
|
+
var _excluded$t = ["label", "prefix", "suffix", "style", "textStyle", "testID", "accessibilityLabelledBy", "error", "required", "editable", "disabled", "loading", "maxLength", "hideCharacterCount", "helpText", "value", "defaultValue", "renderInputValue", "allowFontScaling", "variant"];
|
|
20478
20485
|
var getState$3 = function getState(_ref) {
|
|
20479
20486
|
var disabled = _ref.disabled,
|
|
20480
20487
|
error = _ref.error,
|
|
@@ -20593,7 +20600,7 @@ var TextInput = /*#__PURE__*/React.forwardRef(function (_ref8, ref) {
|
|
|
20593
20600
|
allowFontScaling = _ref8$allowFontScalin === void 0 ? false : _ref8$allowFontScalin,
|
|
20594
20601
|
_ref8$variant = _ref8.variant,
|
|
20595
20602
|
variant = _ref8$variant === void 0 ? 'text' : _ref8$variant,
|
|
20596
|
-
nativeProps = _objectWithoutProperties(_ref8, _excluded$
|
|
20603
|
+
nativeProps = _objectWithoutProperties(_ref8, _excluded$t);
|
|
20597
20604
|
var displayText = getDisplayText(value, defaultValue);
|
|
20598
20605
|
var isEmptyValue = displayText.length === 0;
|
|
20599
20606
|
var _React$useState = React__namespace.default.useState({
|
|
@@ -21372,13 +21379,13 @@ var DatePickerIOS = function DatePickerIOS(_ref) {
|
|
|
21372
21379
|
}));
|
|
21373
21380
|
};
|
|
21374
21381
|
|
|
21375
|
-
var _excluded$
|
|
21382
|
+
var _excluded$s = ["variant", "TextInputComponent"];
|
|
21376
21383
|
var DatePicker = function DatePicker(_ref) {
|
|
21377
21384
|
var _ref$variant = _ref.variant,
|
|
21378
21385
|
variant = _ref$variant === void 0 ? 'default' : _ref$variant,
|
|
21379
21386
|
_ref$TextInputCompone = _ref.TextInputComponent,
|
|
21380
21387
|
TextInputComponent = _ref$TextInputCompone === void 0 ? TextInput : _ref$TextInputCompone,
|
|
21381
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
21388
|
+
props = _objectWithoutProperties(_ref, _excluded$s);
|
|
21382
21389
|
if (variant === 'calendar') {
|
|
21383
21390
|
return /*#__PURE__*/React__namespace.default.createElement(DatePickerCalendar, _extends$1({}, props, {
|
|
21384
21391
|
TextInputComponent: TextInputComponent
|
|
@@ -23444,7 +23451,7 @@ var StyledErrorDescription = index$c(Typography.Body)(function (_ref10) {
|
|
|
23444
23451
|
};
|
|
23445
23452
|
});
|
|
23446
23453
|
|
|
23447
|
-
var _excluded$
|
|
23454
|
+
var _excluded$r = ["variant", "title", "description", "image", "testID", "ctaText", "onCtaPress", "secondaryCtaText", "onSecondaryCtaPress", "icon"],
|
|
23448
23455
|
_excluded2 = ["visible", "variant", "title", "description", "image", "testID", "ctaText", "onCtaPress", "secondaryCtaText", "onSecondaryCtaPress"];
|
|
23449
23456
|
var renderImage$1 = function renderImage(image) {
|
|
23450
23457
|
if (/*#__PURE__*/React.isValidElement(image)) {
|
|
@@ -23485,7 +23492,7 @@ var ErrorPage = function ErrorPage(_ref2) {
|
|
|
23485
23492
|
secondaryCtaText = _ref2.secondaryCtaText,
|
|
23486
23493
|
onSecondaryCtaPress = _ref2.onSecondaryCtaPress,
|
|
23487
23494
|
icon = _ref2.icon,
|
|
23488
|
-
nativeProps = _objectWithoutProperties(_ref2, _excluded$
|
|
23495
|
+
nativeProps = _objectWithoutProperties(_ref2, _excluded$r);
|
|
23489
23496
|
var showCta = ctaText && onCtaPress !== undefined;
|
|
23490
23497
|
var showSecondaryCta = secondaryCtaText && onSecondaryCtaPress !== undefined;
|
|
23491
23498
|
var showButtonContainer = showCta || showSecondaryCta;
|
|
@@ -23711,13 +23718,13 @@ var ActionItem = function ActionItem(_ref) {
|
|
|
23711
23718
|
})), /*#__PURE__*/React__namespace.default.createElement(StyledActionItemText, null, title))));
|
|
23712
23719
|
};
|
|
23713
23720
|
|
|
23714
|
-
var _excluded$
|
|
23721
|
+
var _excluded$q = ["active"];
|
|
23715
23722
|
var AnimatedIcons = reactNative.Animated.createAnimatedComponent(/*#__PURE__*/React__namespace.default.forwardRef(function (props, _) {
|
|
23716
23723
|
return /*#__PURE__*/React__namespace.default.createElement(StyledFABIcon, props);
|
|
23717
23724
|
}));
|
|
23718
23725
|
var AnimatedFABIcon = function AnimatedFABIcon(_ref) {
|
|
23719
23726
|
var active = _ref.active,
|
|
23720
|
-
iconProps = _objectWithoutProperties(_ref, _excluded$
|
|
23727
|
+
iconProps = _objectWithoutProperties(_ref, _excluded$q);
|
|
23721
23728
|
var rotateAnimation = React.useRef(new reactNative.Animated.Value(active ? 1 : 0));
|
|
23722
23729
|
React.useEffect(function () {
|
|
23723
23730
|
var animation = reactNative.Animated.spring(rotateAnimation.current, {
|
|
@@ -24075,11 +24082,11 @@ var StyledFAB = index$c(FAB$1)(function (_ref) {
|
|
|
24075
24082
|
};
|
|
24076
24083
|
});
|
|
24077
24084
|
|
|
24078
|
-
var _excluded$
|
|
24085
|
+
var _excluded$p = ["fabConfig", "onCancel"];
|
|
24079
24086
|
var Pair = function Pair(_ref) {
|
|
24080
24087
|
var fabConfig = _ref.fabConfig,
|
|
24081
24088
|
onCancel = _ref.onCancel,
|
|
24082
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
24089
|
+
props = _objectWithoutProperties(_ref, _excluded$p);
|
|
24083
24090
|
var icon = fabConfig.icon,
|
|
24084
24091
|
title = fabConfig.title,
|
|
24085
24092
|
onPress = fabConfig.onPress,
|
|
@@ -24809,11 +24816,11 @@ var StyledFocusIcon = index$c(Icon)(function (_ref7) {
|
|
|
24809
24816
|
};
|
|
24810
24817
|
});
|
|
24811
24818
|
|
|
24812
|
-
var _excluded$
|
|
24819
|
+
var _excluded$o = ["style", "testID"];
|
|
24813
24820
|
var MapPinFocussed = function MapPinFocussed(_ref) {
|
|
24814
24821
|
var style = _ref.style,
|
|
24815
24822
|
testID = _ref.testID,
|
|
24816
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$
|
|
24823
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$o);
|
|
24817
24824
|
return /*#__PURE__*/React__namespace.default.createElement(StyledContainer$3, _extends$1({}, nativeProps, {
|
|
24818
24825
|
style: style,
|
|
24819
24826
|
testID: testID
|
|
@@ -24823,7 +24830,7 @@ var MapPinFocussed = function MapPinFocussed(_ref) {
|
|
|
24823
24830
|
}));
|
|
24824
24831
|
};
|
|
24825
24832
|
|
|
24826
|
-
var _excluded$
|
|
24833
|
+
var _excluded$n = ["style", "testID", "state", "image", "icon"];
|
|
24827
24834
|
var getBadgeIconName = function getBadgeIconName(state) {
|
|
24828
24835
|
var iconMap = {
|
|
24829
24836
|
idle: undefined,
|
|
@@ -24839,7 +24846,7 @@ var MapPin = function MapPin(_ref) {
|
|
|
24839
24846
|
state = _ref$state === void 0 ? 'idle' : _ref$state,
|
|
24840
24847
|
image = _ref.image,
|
|
24841
24848
|
icon = _ref.icon,
|
|
24842
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$
|
|
24849
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$n);
|
|
24843
24850
|
var badgeIcon = getBadgeIconName(state);
|
|
24844
24851
|
return /*#__PURE__*/React__namespace.default.createElement(StyledContainer$3, _extends$1({}, nativeProps, {
|
|
24845
24852
|
style: style,
|
|
@@ -25160,7 +25167,7 @@ var THEME_INTENT_MAP = {
|
|
|
25160
25167
|
'archived-inverted': 'archivedInverted'
|
|
25161
25168
|
};
|
|
25162
25169
|
|
|
25163
|
-
var _excluded$
|
|
25170
|
+
var _excluded$m = ["value", "renderValue", "intent", "style", "testID"];
|
|
25164
25171
|
var defaultRenderValue = function defaultRenderValue(value) {
|
|
25165
25172
|
return "".concat(value, "%");
|
|
25166
25173
|
};
|
|
@@ -25173,7 +25180,7 @@ var ProgressCircle = function ProgressCircle(_ref) {
|
|
|
25173
25180
|
intent = _ref$intent === void 0 ? 'primary' : _ref$intent,
|
|
25174
25181
|
style = _ref.style,
|
|
25175
25182
|
testID = _ref.testID,
|
|
25176
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$
|
|
25183
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$m);
|
|
25177
25184
|
var theme = useTheme$1();
|
|
25178
25185
|
var size = theme.__hd__.progress.sizes.circleDiameter;
|
|
25179
25186
|
var strokeWidth = theme.__hd__.progress.sizes.circleCompletenessHeight;
|
|
@@ -25243,14 +25250,14 @@ var StyledInner = index$c(reactNative.Animated.View)(function (_ref2) {
|
|
|
25243
25250
|
};
|
|
25244
25251
|
});
|
|
25245
25252
|
|
|
25246
|
-
var _excluded$
|
|
25253
|
+
var _excluded$l = ["value", "intent", "style", "testID"];
|
|
25247
25254
|
var ProgressBar = function ProgressBar(_ref) {
|
|
25248
25255
|
var value = _ref.value,
|
|
25249
25256
|
_ref$intent = _ref.intent,
|
|
25250
25257
|
intent = _ref$intent === void 0 ? 'primary' : _ref$intent,
|
|
25251
25258
|
style = _ref.style,
|
|
25252
25259
|
testID = _ref.testID,
|
|
25253
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$
|
|
25260
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$l);
|
|
25254
25261
|
var _useState = React.useState(0),
|
|
25255
25262
|
_useState2 = _slicedToArray(_useState, 2),
|
|
25256
25263
|
width = _useState2[0],
|
|
@@ -25340,7 +25347,7 @@ var StyledSingleStep = index$c(Box)(function (_ref3) {
|
|
|
25340
25347
|
};
|
|
25341
25348
|
});
|
|
25342
25349
|
|
|
25343
|
-
var _excluded$
|
|
25350
|
+
var _excluded$k = ["steps", "current", "onLayout"];
|
|
25344
25351
|
var getStepState = function getStepState(current, index) {
|
|
25345
25352
|
if (index < current) {
|
|
25346
25353
|
return 'complete';
|
|
@@ -25354,7 +25361,7 @@ var ProgressStep = function ProgressStep(_ref) {
|
|
|
25354
25361
|
var steps = _ref.steps,
|
|
25355
25362
|
current = _ref.current,
|
|
25356
25363
|
onLayout = _ref.onLayout,
|
|
25357
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
25364
|
+
props = _objectWithoutProperties(_ref, _excluded$k);
|
|
25358
25365
|
var theme = useTheme$1();
|
|
25359
25366
|
var _React$useState = React__namespace.default.useState(0),
|
|
25360
25367
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
@@ -25389,9 +25396,141 @@ var ProgressStep = function ProgressStep(_ref) {
|
|
|
25389
25396
|
}));
|
|
25390
25397
|
};
|
|
25391
25398
|
|
|
25399
|
+
var MIN_PROGRESS_VALUE = 0;
|
|
25400
|
+
var MAX_PROGRESS_VALUE = 100;
|
|
25401
|
+
var SEGMENTED_BAR_ERRORS = {
|
|
25402
|
+
negativeValue: '[Progress.SegmentedBar] value:$value is less than 0'
|
|
25403
|
+
};
|
|
25404
|
+
|
|
25405
|
+
var useValidateSegmentedBarData = function useValidateSegmentedBarData(_ref) {
|
|
25406
|
+
var values = _ref.values,
|
|
25407
|
+
dataLength = _ref.dataLength;
|
|
25408
|
+
var _React$useMemo = React__namespace.default.useMemo(function () {
|
|
25409
|
+
var foundNegativeValue = values.find(function (value) {
|
|
25410
|
+
return value < 0;
|
|
25411
|
+
});
|
|
25412
|
+
return {
|
|
25413
|
+
hasNegativeValue: foundNegativeValue !== undefined,
|
|
25414
|
+
negativeValue: foundNegativeValue
|
|
25415
|
+
};
|
|
25416
|
+
}, [dataLength, values]),
|
|
25417
|
+
hasNegativeValue = _React$useMemo.hasNegativeValue,
|
|
25418
|
+
negativeValue = _React$useMemo.negativeValue;
|
|
25419
|
+
assert(!hasNegativeValue, SEGMENTED_BAR_ERRORS.negativeValue.replace('$value', String(negativeValue)));
|
|
25420
|
+
};
|
|
25421
|
+
|
|
25422
|
+
var StyledHeader = index$c(Box)(function (_ref) {
|
|
25423
|
+
var theme = _ref.theme;
|
|
25424
|
+
return {
|
|
25425
|
+
flexDirection: 'row',
|
|
25426
|
+
justifyContent: 'space-between',
|
|
25427
|
+
alignItems: 'baseline',
|
|
25428
|
+
marginBottom: theme.__hd__.progress.space.segmentedHeaderMarginBottom
|
|
25429
|
+
};
|
|
25430
|
+
});
|
|
25431
|
+
var StyledTrack = index$c(Box)(function (_ref2) {
|
|
25432
|
+
var theme = _ref2.theme;
|
|
25433
|
+
return {
|
|
25434
|
+
width: '100%',
|
|
25435
|
+
height: theme.__hd__.progress.sizes.barHeight,
|
|
25436
|
+
borderRadius: theme.__hd__.progress.radii["default"],
|
|
25437
|
+
overflow: 'hidden',
|
|
25438
|
+
flexDirection: 'row'
|
|
25439
|
+
};
|
|
25440
|
+
});
|
|
25441
|
+
var StyledSegment = index$c(Box)(function (_ref3) {
|
|
25442
|
+
var themeColor = _ref3.themeColor,
|
|
25443
|
+
themeWidthPercent = _ref3.themeWidthPercent;
|
|
25444
|
+
return {
|
|
25445
|
+
backgroundColor: themeColor,
|
|
25446
|
+
flexGrow: 0,
|
|
25447
|
+
flexShrink: 0,
|
|
25448
|
+
width: "".concat(themeWidthPercent, "%")
|
|
25449
|
+
};
|
|
25450
|
+
});
|
|
25451
|
+
|
|
25452
|
+
var getTextComponent = function getTextComponent(content, textElement) {
|
|
25453
|
+
if (!content) {
|
|
25454
|
+
return null;
|
|
25455
|
+
}
|
|
25456
|
+
if (typeof content === 'string' || typeof content === 'number') {
|
|
25457
|
+
return textElement;
|
|
25458
|
+
}
|
|
25459
|
+
return content;
|
|
25460
|
+
};
|
|
25461
|
+
|
|
25462
|
+
var _excluded$j = ["data", "headerConfig", "style", "testID"];
|
|
25463
|
+
var ProgressSegmentedBar = function ProgressSegmentedBar(_ref) {
|
|
25464
|
+
var data = _ref.data,
|
|
25465
|
+
headerConfig = _ref.headerConfig,
|
|
25466
|
+
style = _ref.style,
|
|
25467
|
+
testID = _ref.testID,
|
|
25468
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$j);
|
|
25469
|
+
var values = React__namespace.default.useMemo(function () {
|
|
25470
|
+
return data.map(function (s) {
|
|
25471
|
+
return s.data;
|
|
25472
|
+
});
|
|
25473
|
+
}, [data]);
|
|
25474
|
+
useValidateSegmentedBarData({
|
|
25475
|
+
dataLength: data.length,
|
|
25476
|
+
values: values
|
|
25477
|
+
});
|
|
25478
|
+
var theme = useTheme$1();
|
|
25479
|
+
var totalPercent = React__namespace.default.useMemo(function () {
|
|
25480
|
+
return values.reduce(function (acc, value) {
|
|
25481
|
+
return acc + value;
|
|
25482
|
+
}, 0);
|
|
25483
|
+
}, [values]);
|
|
25484
|
+
var ariaValueMax = totalPercent > MAX_PROGRESS_VALUE ? totalPercent : MAX_PROGRESS_VALUE;
|
|
25485
|
+
var remainderPercent = React__namespace.default.useMemo(function () {
|
|
25486
|
+
return totalPercent >= MAX_PROGRESS_VALUE ? 0 : MAX_PROGRESS_VALUE - totalPercent;
|
|
25487
|
+
}, [totalPercent]);
|
|
25488
|
+
// Mock colors
|
|
25489
|
+
var segmentColors = [theme.colors.primary, theme.colors.success, theme.colors.warning, theme.colors.error, theme.colors.info, theme.colors.archived];
|
|
25490
|
+
var headerRight = React__namespace.default.useMemo(function () {
|
|
25491
|
+
return getTextComponent(headerConfig === null || headerConfig === void 0 ? void 0 : headerConfig.right, /*#__PURE__*/React__namespace.default.createElement(Typography.Caption, {
|
|
25492
|
+
intent: "muted"
|
|
25493
|
+
}, headerConfig === null || headerConfig === void 0 ? void 0 : headerConfig.right));
|
|
25494
|
+
}, [headerConfig === null || headerConfig === void 0 ? void 0 : headerConfig.right]);
|
|
25495
|
+
var showHeader = Boolean((headerConfig === null || headerConfig === void 0 ? void 0 : headerConfig.left) || headerRight);
|
|
25496
|
+
return /*#__PURE__*/React__namespace.default.createElement(Box, _extends$1({}, nativeProps, {
|
|
25497
|
+
style: style,
|
|
25498
|
+
testID: testID
|
|
25499
|
+
}), showHeader ? /*#__PURE__*/React__namespace.default.createElement(StyledHeader, {
|
|
25500
|
+
testID: testID ? "".concat(testID, "-header") : undefined
|
|
25501
|
+
}, headerConfig !== null && headerConfig !== void 0 && headerConfig.left ? /*#__PURE__*/React__namespace.default.createElement(Typography.Body, {
|
|
25502
|
+
variant: "regular-bold",
|
|
25503
|
+
testID: testID ? "".concat(testID, "-header-left") : undefined
|
|
25504
|
+
}, headerConfig.left) : null, headerRight ? /*#__PURE__*/React__namespace.default.createElement(Box, {
|
|
25505
|
+
testID: testID ? "".concat(testID, "-header-right") : undefined
|
|
25506
|
+
}, headerRight) : null) : null, /*#__PURE__*/React__namespace.default.createElement(StyledTrack, {
|
|
25507
|
+
testID: testID ? "".concat(testID, "-track") : undefined,
|
|
25508
|
+
accessibilityRole: "progressbar",
|
|
25509
|
+
accessibilityValue: {
|
|
25510
|
+
min: MIN_PROGRESS_VALUE,
|
|
25511
|
+
max: ariaValueMax,
|
|
25512
|
+
now: totalPercent
|
|
25513
|
+
}
|
|
25514
|
+
}, data.map(function (s, index) {
|
|
25515
|
+
var segmentColor = segmentColors[index % segmentColors.length];
|
|
25516
|
+
return /*#__PURE__*/React__namespace.default.createElement(StyledSegment, {
|
|
25517
|
+
key: "".concat(s.label, "-").concat(segmentColor),
|
|
25518
|
+
themeColor: segmentColor,
|
|
25519
|
+
themeWidthPercent: s.data,
|
|
25520
|
+
testID: testID ? "".concat(testID, "-segment-").concat(s.label) : undefined
|
|
25521
|
+
});
|
|
25522
|
+
}), remainderPercent > 0 ? /*#__PURE__*/React__namespace.default.createElement(StyledSegment, {
|
|
25523
|
+
key: "remainder",
|
|
25524
|
+
themeColor: theme.__hd__.progress.colors.segmentedRemainderBackground,
|
|
25525
|
+
themeWidthPercent: remainderPercent,
|
|
25526
|
+
testID: testID ? "".concat(testID, "-segment-remainder") : undefined
|
|
25527
|
+
}) : null));
|
|
25528
|
+
};
|
|
25529
|
+
|
|
25392
25530
|
var Progress = {
|
|
25393
25531
|
Circle: ProgressCircle,
|
|
25394
25532
|
Bar: ProgressBar,
|
|
25533
|
+
SegmentedBar: ProgressSegmentedBar,
|
|
25395
25534
|
Step: ProgressStep
|
|
25396
25535
|
};
|
|
25397
25536
|
|