@hero-design/rn 0.0.0-integrate-basic-table-20251227121342 → 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.
Files changed (28) hide show
  1. package/.turbo/turbo-build.log +3 -3
  2. package/CHANGELOG.md +3 -1
  3. package/es/index.js +205 -66
  4. package/lib/index.js +205 -66
  5. package/package.json +1 -1
  6. package/src/components/Progress/SegmentedBar/StyledSegmentedBar.tsx +29 -0
  7. package/src/components/Progress/SegmentedBar/__tests__/index.spec.tsx +42 -0
  8. package/src/components/Progress/SegmentedBar/__tests__/utils.spec.tsx +24 -0
  9. package/src/components/Progress/SegmentedBar/constants.ts +6 -0
  10. package/src/components/Progress/SegmentedBar/hooks/validation.ts +27 -0
  11. package/src/components/Progress/SegmentedBar/index.tsx +120 -0
  12. package/src/components/Progress/SegmentedBar/types.ts +45 -0
  13. package/src/components/Progress/SegmentedBar/utils.ts +16 -0
  14. package/src/components/Progress/index.tsx +2 -0
  15. package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +2 -0
  16. package/src/theme/components/progress.ts +2 -0
  17. package/src/types.ts +2 -0
  18. package/src/utils/helpers.ts +6 -0
  19. package/types/components/Progress/SegmentedBar/StyledSegmentedBar.d.ts +16 -0
  20. package/types/components/Progress/SegmentedBar/constants.d.ts +5 -0
  21. package/types/components/Progress/SegmentedBar/hooks/validation.d.ts +4 -0
  22. package/types/components/Progress/SegmentedBar/index.d.ts +4 -0
  23. package/types/components/Progress/SegmentedBar/types.d.ts +39 -0
  24. package/types/components/Progress/SegmentedBar/utils.d.ts +2 -0
  25. package/types/components/Progress/index.d.ts +1 -0
  26. package/types/theme/components/progress.d.ts +2 -0
  27. package/types/types.d.ts +2 -1
  28. package/types/utils/helpers.d.ts +1 -0
package/es/index.js CHANGED
@@ -6518,7 +6518,8 @@ var getProgressTheme = function getProgressTheme(theme) {
6518
6518
  complete: theme.colors.primary,
6519
6519
  incomplete: theme.colors.archivedSurface,
6520
6520
  current: theme.colors.decorativePrimarySurface
6521
- }
6521
+ },
6522
+ segmentedRemainderBackground: theme.colors.archivedSurface
6522
6523
  };
6523
6524
  var sizes = {
6524
6525
  circleDiameter: theme.sizes['6xlarge'],
@@ -6530,7 +6531,8 @@ var getProgressTheme = function getProgressTheme(theme) {
6530
6531
  "default": theme.radii.rounded
6531
6532
  };
6532
6533
  var space = {
6533
- stepGap: theme.space.xsmall
6534
+ stepGap: theme.space.xsmall,
6535
+ segmentedHeaderMarginBottom: theme.space.small
6534
6536
  };
6535
6537
  return {
6536
6538
  colors: colors,
@@ -6844,6 +6846,11 @@ var transformKebabCaseToCamelCase = function transformKebabCaseToCamelCase(strin
6844
6846
  return /[a-z]/.test(_char4) ? _char4.toUpperCase() : _char4;
6845
6847
  });
6846
6848
  };
6849
+ function assert(condition, message) {
6850
+ if (!condition) {
6851
+ throw new Error(message);
6852
+ }
6853
+ }
6847
6854
 
6848
6855
  var getSliderTheme = function getSliderTheme(theme) {
6849
6856
  var colors = {
@@ -8033,7 +8040,7 @@ var StyledText$4 = index$c(Text$1)(function (_ref) {
8033
8040
  });
8034
8041
  });
8035
8042
 
8036
- var _excluded$N = ["children", "fontSize", "fontWeight", "intent", "typeface", "allowFontScaling"];
8043
+ var _excluded$O = ["children", "fontSize", "fontWeight", "intent", "typeface", "allowFontScaling"];
8037
8044
  /**
8038
8045
  * @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.
8039
8046
  */
@@ -8049,7 +8056,7 @@ var Text = function Text(_ref) {
8049
8056
  typeface = _ref$typeface === void 0 ? 'neutral' : _ref$typeface,
8050
8057
  _ref$allowFontScaling = _ref.allowFontScaling,
8051
8058
  allowFontScaling = _ref$allowFontScaling === void 0 ? false : _ref$allowFontScaling,
8052
- nativeProps = _objectWithoutProperties(_ref, _excluded$N);
8059
+ nativeProps = _objectWithoutProperties(_ref, _excluded$O);
8053
8060
  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.');
8054
8061
  return /*#__PURE__*/React__default.createElement(StyledText$4, _extends$1({}, nativeProps, {
8055
8062
  themeFontSize: fontSize,
@@ -8082,7 +8089,7 @@ var StyledCaption = index$c(Text$1)(function (_ref) {
8082
8089
  };
8083
8090
  });
8084
8091
 
8085
- var _excluded$M = ["children", "fontWeight", "intent", "allowFontScaling", "fontStyle"];
8092
+ var _excluded$N = ["children", "fontWeight", "intent", "allowFontScaling", "fontStyle"];
8086
8093
  var Caption = function Caption(_ref) {
8087
8094
  var children = _ref.children,
8088
8095
  _ref$fontWeight = _ref.fontWeight,
@@ -8093,7 +8100,7 @@ var Caption = function Caption(_ref) {
8093
8100
  allowFontScaling = _ref$allowFontScaling === void 0 ? false : _ref$allowFontScaling,
8094
8101
  _ref$fontStyle = _ref.fontStyle,
8095
8102
  fontStyle = _ref$fontStyle === void 0 ? 'normal' : _ref$fontStyle,
8096
- nativeProps = _objectWithoutProperties(_ref, _excluded$M);
8103
+ nativeProps = _objectWithoutProperties(_ref, _excluded$N);
8097
8104
  return /*#__PURE__*/React__default.createElement(StyledCaption, _extends$1({}, nativeProps, {
8098
8105
  themeFontWeight: fontWeight,
8099
8106
  themeIntent: intent,
@@ -8118,7 +8125,7 @@ var StyledLabel$1 = index$c(Text$1)(function (_ref) {
8118
8125
  };
8119
8126
  });
8120
8127
 
8121
- var _excluded$L = ["children", "intent", "allowFontScaling", "fontStyle"];
8128
+ var _excluded$M = ["children", "intent", "allowFontScaling", "fontStyle"];
8122
8129
  var Label = function Label(_ref) {
8123
8130
  var children = _ref.children,
8124
8131
  _ref$intent = _ref.intent,
@@ -8127,7 +8134,7 @@ var Label = function Label(_ref) {
8127
8134
  allowFontScaling = _ref$allowFontScaling === void 0 ? false : _ref$allowFontScaling,
8128
8135
  _ref$fontStyle = _ref.fontStyle,
8129
8136
  fontStyle = _ref$fontStyle === void 0 ? 'normal' : _ref$fontStyle,
8130
- nativeProps = _objectWithoutProperties(_ref, _excluded$L);
8137
+ nativeProps = _objectWithoutProperties(_ref, _excluded$M);
8131
8138
  return /*#__PURE__*/React__default.createElement(StyledLabel$1, _extends$1({}, nativeProps, {
8132
8139
  themeIntent: intent,
8133
8140
  themeIsItalic: fontStyle === 'italic',
@@ -8150,7 +8157,7 @@ var StyledTitle$1 = index$c(Text$1)(function (_ref) {
8150
8157
  };
8151
8158
  });
8152
8159
 
8153
- var _excluded$K = ["children", "intent", "allowFontScaling", "level", "typeface", "fontStyle"];
8160
+ var _excluded$L = ["children", "intent", "allowFontScaling", "level", "typeface", "fontStyle"];
8154
8161
  var Title = function Title(_ref) {
8155
8162
  var children = _ref.children,
8156
8163
  _ref$intent = _ref.intent,
@@ -8163,7 +8170,7 @@ var Title = function Title(_ref) {
8163
8170
  typeface = _ref$typeface === void 0 ? 'neutral' : _ref$typeface,
8164
8171
  _ref$fontStyle = _ref.fontStyle,
8165
8172
  fontStyle = _ref$fontStyle === void 0 ? 'normal' : _ref$fontStyle,
8166
- nativeProps = _objectWithoutProperties(_ref, _excluded$K);
8173
+ nativeProps = _objectWithoutProperties(_ref, _excluded$L);
8167
8174
  return /*#__PURE__*/React__default.createElement(StyledTitle$1, _extends$1({}, nativeProps, {
8168
8175
  themeLevel: level,
8169
8176
  themeTypeface: typeface,
@@ -8202,7 +8209,7 @@ var StyledBody$2 = index$c(Text$1)(function (_ref) {
8202
8209
  };
8203
8210
  });
8204
8211
 
8205
- var _excluded$J = ["children", "intent", "allowFontScaling", "typeface", "variant", "fontStyle"];
8212
+ var _excluded$K = ["children", "intent", "allowFontScaling", "typeface", "variant", "fontStyle"];
8206
8213
  var Body = function Body(_ref) {
8207
8214
  var children = _ref.children,
8208
8215
  _ref$intent = _ref.intent,
@@ -8215,7 +8222,7 @@ var Body = function Body(_ref) {
8215
8222
  variant = _ref$variant === void 0 ? 'regular' : _ref$variant,
8216
8223
  _ref$fontStyle = _ref.fontStyle,
8217
8224
  fontStyle = _ref$fontStyle === void 0 ? 'normal' : _ref$fontStyle,
8218
- nativeProps = _objectWithoutProperties(_ref, _excluded$J);
8225
+ nativeProps = _objectWithoutProperties(_ref, _excluded$K);
8219
8226
  return /*#__PURE__*/React__default.createElement(StyledBody$2, _extends$1({}, nativeProps, {
8220
8227
  themeTypeface: typeface,
8221
8228
  themeIntent: intent,
@@ -8832,10 +8839,10 @@ var StyledHeroIcon = index$c(HeroIcon)(function (_ref) {
8832
8839
  };
8833
8840
  });
8834
8841
 
8835
- var _excluded$I = ["style"];
8842
+ var _excluded$J = ["style"];
8836
8843
  var AnimatedIcon = function AnimatedIcon(_ref) {
8837
8844
  var style = _ref.style,
8838
- otherProps = _objectWithoutProperties(_ref, _excluded$I);
8845
+ otherProps = _objectWithoutProperties(_ref, _excluded$J);
8839
8846
  var rotateAnimation = useRef(new Animated.Value(0));
8840
8847
  useEffect(function () {
8841
8848
  var animation = Animated.loop(Animated.timing(rotateAnimation.current, {
@@ -8940,7 +8947,7 @@ var AccordionItem = function AccordionItem(_ref) {
8940
8947
  }, content));
8941
8948
  };
8942
8949
 
8943
- var _excluded$H = ["key"];
8950
+ var _excluded$I = ["key"];
8944
8951
  var Accordion = function Accordion(_ref) {
8945
8952
  var items = _ref.items,
8946
8953
  activeItemKey = _ref.activeItemKey,
@@ -8963,7 +8970,7 @@ var Accordion = function Accordion(_ref) {
8963
8970
  accessible: accessible
8964
8971
  }, items.map(function (_ref2, index) {
8965
8972
  var key = _ref2.key,
8966
- props = _objectWithoutProperties(_ref2, _excluded$H);
8973
+ props = _objectWithoutProperties(_ref2, _excluded$I);
8967
8974
  var open = _activeItemKey === key;
8968
8975
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, {
8969
8976
  key: key
@@ -9799,7 +9806,7 @@ var borderWidths = {
9799
9806
  var config = _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, colors), space), radii), borderWidths);
9800
9807
  var flexPropsKey = ['alignContent', 'alignItems', 'alignSelf', 'display', 'flex', 'flexBasis', 'flexDirection', 'flexGrow', 'flexShrink', 'flexWrap', 'justifyContent'];
9801
9808
 
9802
- var _excluded$G = ["theme"];
9809
+ var _excluded$H = ["theme"];
9803
9810
  var getThemeValue = function getThemeValue(theme, key, props) {
9804
9811
  var propConfig = config[key];
9805
9812
  var propValue = props[key];
@@ -9826,18 +9833,18 @@ var mapStylePropToThemeValue = function mapStylePropToThemeValue(theme, props) {
9826
9833
  var configKeys = Object.keys(config);
9827
9834
  var StyledBox = index$c(View)(function (_ref5) {
9828
9835
  var theme = _ref5.theme,
9829
- otherProps = _objectWithoutProperties(_ref5, _excluded$G);
9836
+ otherProps = _objectWithoutProperties(_ref5, _excluded$H);
9830
9837
  var styleProps = pick(configKeys, otherProps);
9831
9838
  var flexProps = pick(_toConsumableArray(flexPropsKey), otherProps);
9832
9839
  return _objectSpread2(_objectSpread2({}, mapStylePropToThemeValue(theme, styleProps)), flexProps);
9833
9840
  });
9834
9841
 
9835
- var _excluded$F = ["children", "style", "testID"];
9842
+ var _excluded$G = ["children", "style", "testID"];
9836
9843
  var Box = function Box(_ref) {
9837
9844
  var children = _ref.children,
9838
9845
  style = _ref.style,
9839
9846
  testID = _ref.testID,
9840
- otherProps = _objectWithoutProperties(_ref, _excluded$F);
9847
+ otherProps = _objectWithoutProperties(_ref, _excluded$G);
9841
9848
  return /*#__PURE__*/React__default.createElement(StyledBox, _extends$1({}, otherProps, {
9842
9849
  style: style,
9843
9850
  testID: testID
@@ -10104,7 +10111,7 @@ var StyledIcon$4 = index$c(Icon)(function (_ref6) {
10104
10111
  };
10105
10112
  });
10106
10113
 
10107
- var _excluded$E = ["children", "visible", "intent", "style", "testID"];
10114
+ var _excluded$F = ["children", "visible", "intent", "style", "testID"];
10108
10115
  var Status$1 = function Status(_ref) {
10109
10116
  var children = _ref.children,
10110
10117
  _ref$visible = _ref.visible,
@@ -10113,7 +10120,7 @@ var Status$1 = function Status(_ref) {
10113
10120
  intent = _ref$intent === void 0 ? 'danger' : _ref$intent,
10114
10121
  style = _ref.style,
10115
10122
  testID = _ref.testID,
10116
- nativeProps = _objectWithoutProperties(_ref, _excluded$E);
10123
+ nativeProps = _objectWithoutProperties(_ref, _excluded$F);
10117
10124
  var _React$useRef = React__default.useRef(new Animated.Value(visible ? 1 : 0)),
10118
10125
  opacity = _React$useRef.current;
10119
10126
  var isFirstRendering = React__default.useRef(true);
@@ -10149,7 +10156,7 @@ var Status$1 = function Status(_ref) {
10149
10156
 
10150
10157
  var DEFAULT_MAX_NUMBER = 99;
10151
10158
 
10152
- var _excluded$D = ["children", "visible", "style", "max", "testID", "content"];
10159
+ var _excluded$E = ["children", "visible", "style", "max", "testID", "content"];
10153
10160
  var Status = function Status(_ref) {
10154
10161
  var children = _ref.children,
10155
10162
  _ref$visible = _ref.visible,
@@ -10159,7 +10166,7 @@ var Status = function Status(_ref) {
10159
10166
  max = _ref$max === void 0 ? DEFAULT_MAX_NUMBER : _ref$max,
10160
10167
  testID = _ref.testID,
10161
10168
  originalContent = _ref.content,
10162
- nativeProps = _objectWithoutProperties(_ref, _excluded$D);
10169
+ nativeProps = _objectWithoutProperties(_ref, _excluded$E);
10163
10170
  var content = useMemo(function () {
10164
10171
  return originalContent > max ? "".concat(max, "+") : String(originalContent);
10165
10172
  }, [originalContent, max]);
@@ -10171,7 +10178,7 @@ var Status = function Status(_ref) {
10171
10178
  }, /*#__PURE__*/React__default.createElement(StyledCountText, null, content)));
10172
10179
  };
10173
10180
 
10174
- var _excluded$C = ["content", "visible", "max", "intent", "style", "testID", "size", "variant", "icon"];
10181
+ var _excluded$D = ["content", "visible", "max", "intent", "style", "testID", "size", "variant", "icon"];
10175
10182
  var getPaddingState = function getPaddingState(content) {
10176
10183
  return content.length > 1 ? 'wideContent' : 'narrowContent';
10177
10184
  };
@@ -10190,7 +10197,7 @@ var Badge = function Badge(_ref) {
10190
10197
  _ref$variant = _ref.variant,
10191
10198
  variant = _ref$variant === void 0 ? 'filled' : _ref$variant,
10192
10199
  icon = _ref.icon,
10193
- nativeProps = _objectWithoutProperties(_ref, _excluded$C);
10200
+ nativeProps = _objectWithoutProperties(_ref, _excluded$D);
10194
10201
  var _React$useRef = React__default.useRef(new Animated.Value(visible ? 1 : 0)),
10195
10202
  opacity = _React$useRef.current;
10196
10203
  var isFirstRendering = React__default.useRef(true);
@@ -10289,7 +10296,7 @@ var StyledBottomBarText = index$c(Typography.Label)(function (_ref3) {
10289
10296
  };
10290
10297
  });
10291
10298
 
10292
- var _excluded$B = ["onTabPress", "renderActiveTabOnly", "selectedTabKey", "tabs"];
10299
+ var _excluded$C = ["onTabPress", "renderActiveTabOnly", "selectedTabKey", "tabs"];
10293
10300
  var getInactiveIcon = function getInactiveIcon(icon) {
10294
10301
  var inactiveIcon = "".concat(icon, "-outlined");
10295
10302
  return isHeroIcon(inactiveIcon) ? inactiveIcon : icon;
@@ -10300,7 +10307,7 @@ var BottomNavigation = function BottomNavigation(_ref) {
10300
10307
  renderActiveTabOnly = _ref$renderActiveTabO === void 0 ? false : _ref$renderActiveTabO,
10301
10308
  selectedTabKey = _ref.selectedTabKey,
10302
10309
  tabs = _ref.tabs,
10303
- nativeProps = _objectWithoutProperties(_ref, _excluded$B);
10310
+ nativeProps = _objectWithoutProperties(_ref, _excluded$C);
10304
10311
  var insets = useSafeAreaInsets();
10305
10312
  /**
10306
10313
  * List of loaded tabs, tabs will be loaded when navigated to.
@@ -10385,13 +10392,13 @@ var StyledDivider = index$c(View)(function (_ref) {
10385
10392
  }, horizontalMargin), verticalMargin);
10386
10393
  });
10387
10394
 
10388
- var _excluded$A = ["marginHorizontal", "marginVertical", "style", "testID"];
10395
+ var _excluded$B = ["marginHorizontal", "marginVertical", "style", "testID"];
10389
10396
  var Divider = function Divider(_ref) {
10390
10397
  var marginHorizontal = _ref.marginHorizontal,
10391
10398
  marginVertical = _ref.marginVertical,
10392
10399
  style = _ref.style,
10393
10400
  testID = _ref.testID,
10394
- nativeProps = _objectWithoutProperties(_ref, _excluded$A);
10401
+ nativeProps = _objectWithoutProperties(_ref, _excluded$B);
10395
10402
  return /*#__PURE__*/React__default.createElement(StyledDivider, _extends$1({}, nativeProps, {
10396
10403
  themeMarginHorizontal: marginHorizontal,
10397
10404
  themeMarginVertical: marginVertical,
@@ -10452,7 +10459,7 @@ var StyledHeaderWrapper = index$c(View)(function (_ref5) {
10452
10459
  paddingHorizontal: theme.__hd__.bottomSheet.space.headerWrapperHorizontalPadding
10453
10460
  };
10454
10461
  });
10455
- var StyledHeader = index$c(View)({
10462
+ var StyledHeader$1 = index$c(View)({
10456
10463
  flex: 1,
10457
10464
  justifyContent: 'center'
10458
10465
  });
@@ -10521,7 +10528,7 @@ var StyledLoadingDot = index$c(View)(function (_ref) {
10521
10528
  }, themeStyling());
10522
10529
  });
10523
10530
 
10524
- var _excluded$z = ["count", "size", "testID", "themeVariant"];
10531
+ var _excluded$A = ["count", "size", "testID", "themeVariant"];
10525
10532
  var AnimatedLoadingIndicatorWrapper = Animated.createAnimatedComponent(StyledLoadingIndicatorWrapper);
10526
10533
  var AnimatedLoadingDot = Animated.createAnimatedComponent(StyledLoadingDot);
10527
10534
  var renderDotComponent = function renderDotComponent(_ref) {
@@ -10553,7 +10560,7 @@ var LoadingIndicator = function LoadingIndicator(_ref2) {
10553
10560
  size = _ref2$size === void 0 ? 12 : _ref2$size,
10554
10561
  testID = _ref2.testID,
10555
10562
  themeVariant = _ref2.themeVariant,
10556
- nativeProps = _objectWithoutProperties(_ref2, _excluded$z);
10563
+ nativeProps = _objectWithoutProperties(_ref2, _excluded$A);
10557
10564
  var progressAnimation = useRef(new Animated.Value(0));
10558
10565
  useEffect(function () {
10559
10566
  var animation = Animated.loop(Animated.timing(progressAnimation.current, {
@@ -11162,7 +11169,7 @@ var Header = function Header(_ref) {
11162
11169
  _ref$variant = _ref.variant,
11163
11170
  variant = _ref$variant === void 0 ? 'fixed' : _ref$variant;
11164
11171
  var theme = useTheme();
11165
- return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(StyledHeaderWrapper, null, typeof content === 'string' ? /*#__PURE__*/React__default.createElement(StyledHeader, null, /*#__PURE__*/React__default.createElement(Typography.Body, {
11172
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(StyledHeaderWrapper, null, typeof content === 'string' ? /*#__PURE__*/React__default.createElement(StyledHeader$1, null, /*#__PURE__*/React__default.createElement(Typography.Body, {
11166
11173
  variant: "regular-bold"
11167
11174
  }, content)) : /*#__PURE__*/React__default.createElement(View, {
11168
11175
  style: {
@@ -11185,11 +11192,11 @@ var Header = function Header(_ref) {
11185
11192
  }))) : null), showDivider ? /*#__PURE__*/React__default.createElement(Divider, null) : null);
11186
11193
  };
11187
11194
 
11188
- var _excluded$y = ["scrollEventThrottle"];
11195
+ var _excluded$z = ["scrollEventThrottle"];
11189
11196
  var BottomSheetScrollView = /*#__PURE__*/forwardRef(function (_ref, ref) {
11190
11197
  var _ref$scrollEventThrot = _ref.scrollEventThrottle,
11191
11198
  scrollEventThrottle = _ref$scrollEventThrot === void 0 ? 100 : _ref$scrollEventThrot,
11192
- props = _objectWithoutProperties(_ref, _excluded$y);
11199
+ props = _objectWithoutProperties(_ref, _excluded$z);
11193
11200
  var _useContext = useContext(BottomSheetContext),
11194
11201
  setInternalShowDivider = _useContext.setInternalShowDivider;
11195
11202
  var onScrollBeginDrag = useCallback(function (e) {
@@ -14317,12 +14324,12 @@ var Indicator = index$c(View)(function (_ref3) {
14317
14324
  };
14318
14325
  });
14319
14326
 
14320
- var _excluded$x = ["intent", "children"];
14327
+ var _excluded$y = ["intent", "children"];
14321
14328
  var DataCard = function DataCard(_ref) {
14322
14329
  var _ref$intent = _ref.intent,
14323
14330
  intent = _ref$intent === void 0 ? 'info' : _ref$intent,
14324
14331
  children = _ref.children,
14325
- nativeProps = _objectWithoutProperties(_ref, _excluded$x);
14332
+ nativeProps = _objectWithoutProperties(_ref, _excluded$y);
14326
14333
  return /*#__PURE__*/React__default.createElement(StyledDataCard, nativeProps, /*#__PURE__*/React__default.createElement(Indicator, {
14327
14334
  themeIntent: intent,
14328
14335
  testID: "data-card-indicator"
@@ -14341,13 +14348,13 @@ var StyledCard$1 = index$c(View)(function (_ref) {
14341
14348
  });
14342
14349
  });
14343
14350
 
14344
- var _excluded$w = ["intent", "children", "variant"];
14351
+ var _excluded$x = ["intent", "children", "variant"];
14345
14352
  var Card = function Card(_ref) {
14346
14353
  var intent = _ref.intent,
14347
14354
  children = _ref.children,
14348
14355
  _ref$variant = _ref.variant,
14349
14356
  variant = _ref$variant === void 0 ? 'basic' : _ref$variant,
14350
- nativeProps = _objectWithoutProperties(_ref, _excluded$w);
14357
+ nativeProps = _objectWithoutProperties(_ref, _excluded$x);
14351
14358
  return /*#__PURE__*/React__default.createElement(StyledCard$1, _extends$1({}, nativeProps, {
14352
14359
  themeIntent: intent,
14353
14360
  themeVariant: variant
@@ -14614,7 +14621,7 @@ var CardCarousel = /*#__PURE__*/forwardRef(function (_ref, ref) {
14614
14621
  });
14615
14622
  CardCarousel.displayName = 'CardCarousel';
14616
14623
 
14617
- var _excluded$v = ["rounded", "size", "testID", "style"];
14624
+ var _excluded$w = ["rounded", "size", "testID", "style"];
14618
14625
  /**
14619
14626
  * @deprecated Image component will soon be deprecated. Please use `Image` from `react-native` instead.
14620
14627
  */
@@ -14625,7 +14632,7 @@ var Image = function Image(_ref) {
14625
14632
  size = _ref$size === void 0 ? '6xlarge' : _ref$size,
14626
14633
  testID = _ref.testID,
14627
14634
  style = _ref.style,
14628
- imageNativeProps = _objectWithoutProperties(_ref, _excluded$v);
14635
+ imageNativeProps = _objectWithoutProperties(_ref, _excluded$w);
14629
14636
  useDeprecation('Image component will soon be deprecated. Please use `Image` from `react-native` instead.');
14630
14637
  var theme = useTheme();
14631
14638
  var imageSize = theme.__hd__.image.sizes[size];
@@ -14760,7 +14767,7 @@ var CarouselItem = function CarouselItem(_ref) {
14760
14767
  }, heading), !!body && /*#__PURE__*/React__default.createElement(Typography.Body, null, body)));
14761
14768
  };
14762
14769
 
14763
- var _excluded$u = ["items", "onItemIndexChange", "renderActions", "selectedItemIndex", "style", "shouldShowPagination", "testID", "pageControlPosition"];
14770
+ var _excluded$v = ["items", "onItemIndexChange", "renderActions", "selectedItemIndex", "style", "shouldShowPagination", "testID", "pageControlPosition"];
14764
14771
  function useStateFromProp(initialValue) {
14765
14772
  var _useState = useState(initialValue),
14766
14773
  _useState2 = _slicedToArray(_useState, 2),
@@ -14787,7 +14794,7 @@ var Carousel = function Carousel(_ref) {
14787
14794
  testID = _ref.testID,
14788
14795
  _ref$pageControlPosit = _ref.pageControlPosition,
14789
14796
  pageControlPosition = _ref$pageControlPosit === void 0 ? 'top' : _ref$pageControlPosit,
14790
- nativeProps = _objectWithoutProperties(_ref, _excluded$u);
14797
+ nativeProps = _objectWithoutProperties(_ref, _excluded$v);
14791
14798
  useDeprecation("shouldShowPagination prop has been deprecated", shouldShowPagination !== noop$1);
14792
14799
  useDeprecation("The use of 'pageControlPosition == bottom' has been deprecated", pageControlPosition === 'bottom');
14793
14800
  var theme = useTheme();
@@ -20058,7 +20065,7 @@ var StyledChipIcon = index$c(Icon)(function (_ref2) {
20058
20065
  };
20059
20066
  });
20060
20067
 
20061
- var _excluded$t = ["label", "variant", "selected", "icon", "onPress", "showSelectedIcon", "accessible"];
20068
+ var _excluded$u = ["label", "variant", "selected", "icon", "onPress", "showSelectedIcon", "accessible"];
20062
20069
  var getChipLabel = function getChipLabel(label) {
20063
20070
  if (typeof label === 'string') {
20064
20071
  return /*#__PURE__*/React__default.createElement(Typography.Body, {
@@ -20092,7 +20099,7 @@ var Chip = function Chip(_ref) {
20092
20099
  _ref$showSelectedIcon = _ref.showSelectedIcon,
20093
20100
  showSelectedIcon = _ref$showSelectedIcon === void 0 ? true : _ref$showSelectedIcon,
20094
20101
  accessible = _ref.accessible,
20095
- otherProps = _objectWithoutProperties(_ref, _excluded$t);
20102
+ otherProps = _objectWithoutProperties(_ref, _excluded$u);
20096
20103
  useDeprecation('Chip variant `outlined` and `filled` are deprecated.', variant === 'outlined' || variant === 'filled');
20097
20104
  var renamedVariant = getChipVariant(variant);
20098
20105
  var shouldShowSelectedIcon = (renamedVariant === 'selection' || renamedVariant === 'compact-outlined') && selected && showSelectedIcon;
@@ -20445,7 +20452,7 @@ var StyledErrorAndMaxLengthContainer = index$c(View)(function (_ref12) {
20445
20452
  };
20446
20453
  });
20447
20454
 
20448
- var _excluded$s = ["label", "prefix", "suffix", "style", "textStyle", "testID", "accessibilityLabelledBy", "error", "required", "editable", "disabled", "loading", "maxLength", "hideCharacterCount", "helpText", "value", "defaultValue", "renderInputValue", "allowFontScaling", "variant"];
20455
+ var _excluded$t = ["label", "prefix", "suffix", "style", "textStyle", "testID", "accessibilityLabelledBy", "error", "required", "editable", "disabled", "loading", "maxLength", "hideCharacterCount", "helpText", "value", "defaultValue", "renderInputValue", "allowFontScaling", "variant"];
20449
20456
  var getState$3 = function getState(_ref) {
20450
20457
  var disabled = _ref.disabled,
20451
20458
  error = _ref.error,
@@ -20564,7 +20571,7 @@ var TextInput = /*#__PURE__*/forwardRef(function (_ref8, ref) {
20564
20571
  allowFontScaling = _ref8$allowFontScalin === void 0 ? false : _ref8$allowFontScalin,
20565
20572
  _ref8$variant = _ref8.variant,
20566
20573
  variant = _ref8$variant === void 0 ? 'text' : _ref8$variant,
20567
- nativeProps = _objectWithoutProperties(_ref8, _excluded$s);
20574
+ nativeProps = _objectWithoutProperties(_ref8, _excluded$t);
20568
20575
  var displayText = getDisplayText(value, defaultValue);
20569
20576
  var isEmptyValue = displayText.length === 0;
20570
20577
  var _React$useState = React__default.useState({
@@ -21343,13 +21350,13 @@ var DatePickerIOS = function DatePickerIOS(_ref) {
21343
21350
  }));
21344
21351
  };
21345
21352
 
21346
- var _excluded$r = ["variant", "TextInputComponent"];
21353
+ var _excluded$s = ["variant", "TextInputComponent"];
21347
21354
  var DatePicker = function DatePicker(_ref) {
21348
21355
  var _ref$variant = _ref.variant,
21349
21356
  variant = _ref$variant === void 0 ? 'default' : _ref$variant,
21350
21357
  _ref$TextInputCompone = _ref.TextInputComponent,
21351
21358
  TextInputComponent = _ref$TextInputCompone === void 0 ? TextInput : _ref$TextInputCompone,
21352
- props = _objectWithoutProperties(_ref, _excluded$r);
21359
+ props = _objectWithoutProperties(_ref, _excluded$s);
21353
21360
  if (variant === 'calendar') {
21354
21361
  return /*#__PURE__*/React__default.createElement(DatePickerCalendar, _extends$1({}, props, {
21355
21362
  TextInputComponent: TextInputComponent
@@ -23415,7 +23422,7 @@ var StyledErrorDescription = index$c(Typography.Body)(function (_ref10) {
23415
23422
  };
23416
23423
  });
23417
23424
 
23418
- var _excluded$q = ["variant", "title", "description", "image", "testID", "ctaText", "onCtaPress", "secondaryCtaText", "onSecondaryCtaPress", "icon"],
23425
+ var _excluded$r = ["variant", "title", "description", "image", "testID", "ctaText", "onCtaPress", "secondaryCtaText", "onSecondaryCtaPress", "icon"],
23419
23426
  _excluded2 = ["visible", "variant", "title", "description", "image", "testID", "ctaText", "onCtaPress", "secondaryCtaText", "onSecondaryCtaPress"];
23420
23427
  var renderImage$1 = function renderImage(image) {
23421
23428
  if (/*#__PURE__*/isValidElement(image)) {
@@ -23456,7 +23463,7 @@ var ErrorPage = function ErrorPage(_ref2) {
23456
23463
  secondaryCtaText = _ref2.secondaryCtaText,
23457
23464
  onSecondaryCtaPress = _ref2.onSecondaryCtaPress,
23458
23465
  icon = _ref2.icon,
23459
- nativeProps = _objectWithoutProperties(_ref2, _excluded$q);
23466
+ nativeProps = _objectWithoutProperties(_ref2, _excluded$r);
23460
23467
  var showCta = ctaText && onCtaPress !== undefined;
23461
23468
  var showSecondaryCta = secondaryCtaText && onSecondaryCtaPress !== undefined;
23462
23469
  var showButtonContainer = showCta || showSecondaryCta;
@@ -23682,13 +23689,13 @@ var ActionItem = function ActionItem(_ref) {
23682
23689
  })), /*#__PURE__*/React__default.createElement(StyledActionItemText, null, title))));
23683
23690
  };
23684
23691
 
23685
- var _excluded$p = ["active"];
23692
+ var _excluded$q = ["active"];
23686
23693
  var AnimatedIcons = Animated.createAnimatedComponent(/*#__PURE__*/React__default.forwardRef(function (props, _) {
23687
23694
  return /*#__PURE__*/React__default.createElement(StyledFABIcon, props);
23688
23695
  }));
23689
23696
  var AnimatedFABIcon = function AnimatedFABIcon(_ref) {
23690
23697
  var active = _ref.active,
23691
- iconProps = _objectWithoutProperties(_ref, _excluded$p);
23698
+ iconProps = _objectWithoutProperties(_ref, _excluded$q);
23692
23699
  var rotateAnimation = useRef(new Animated.Value(active ? 1 : 0));
23693
23700
  useEffect(function () {
23694
23701
  var animation = Animated.spring(rotateAnimation.current, {
@@ -24046,11 +24053,11 @@ var StyledFAB = index$c(FAB$1)(function (_ref) {
24046
24053
  };
24047
24054
  });
24048
24055
 
24049
- var _excluded$o = ["fabConfig", "onCancel"];
24056
+ var _excluded$p = ["fabConfig", "onCancel"];
24050
24057
  var Pair = function Pair(_ref) {
24051
24058
  var fabConfig = _ref.fabConfig,
24052
24059
  onCancel = _ref.onCancel,
24053
- props = _objectWithoutProperties(_ref, _excluded$o);
24060
+ props = _objectWithoutProperties(_ref, _excluded$p);
24054
24061
  var icon = fabConfig.icon,
24055
24062
  title = fabConfig.title,
24056
24063
  onPress = fabConfig.onPress,
@@ -24780,11 +24787,11 @@ var StyledFocusIcon = index$c(Icon)(function (_ref7) {
24780
24787
  };
24781
24788
  });
24782
24789
 
24783
- var _excluded$n = ["style", "testID"];
24790
+ var _excluded$o = ["style", "testID"];
24784
24791
  var MapPinFocussed = function MapPinFocussed(_ref) {
24785
24792
  var style = _ref.style,
24786
24793
  testID = _ref.testID,
24787
- nativeProps = _objectWithoutProperties(_ref, _excluded$n);
24794
+ nativeProps = _objectWithoutProperties(_ref, _excluded$o);
24788
24795
  return /*#__PURE__*/React__default.createElement(StyledContainer$3, _extends$1({}, nativeProps, {
24789
24796
  style: style,
24790
24797
  testID: testID
@@ -24794,7 +24801,7 @@ var MapPinFocussed = function MapPinFocussed(_ref) {
24794
24801
  }));
24795
24802
  };
24796
24803
 
24797
- var _excluded$m = ["style", "testID", "state", "image", "icon"];
24804
+ var _excluded$n = ["style", "testID", "state", "image", "icon"];
24798
24805
  var getBadgeIconName = function getBadgeIconName(state) {
24799
24806
  var iconMap = {
24800
24807
  idle: undefined,
@@ -24810,7 +24817,7 @@ var MapPin = function MapPin(_ref) {
24810
24817
  state = _ref$state === void 0 ? 'idle' : _ref$state,
24811
24818
  image = _ref.image,
24812
24819
  icon = _ref.icon,
24813
- nativeProps = _objectWithoutProperties(_ref, _excluded$m);
24820
+ nativeProps = _objectWithoutProperties(_ref, _excluded$n);
24814
24821
  var badgeIcon = getBadgeIconName(state);
24815
24822
  return /*#__PURE__*/React__default.createElement(StyledContainer$3, _extends$1({}, nativeProps, {
24816
24823
  style: style,
@@ -25131,7 +25138,7 @@ var THEME_INTENT_MAP = {
25131
25138
  'archived-inverted': 'archivedInverted'
25132
25139
  };
25133
25140
 
25134
- var _excluded$l = ["value", "renderValue", "intent", "style", "testID"];
25141
+ var _excluded$m = ["value", "renderValue", "intent", "style", "testID"];
25135
25142
  var defaultRenderValue = function defaultRenderValue(value) {
25136
25143
  return "".concat(value, "%");
25137
25144
  };
@@ -25144,7 +25151,7 @@ var ProgressCircle = function ProgressCircle(_ref) {
25144
25151
  intent = _ref$intent === void 0 ? 'primary' : _ref$intent,
25145
25152
  style = _ref.style,
25146
25153
  testID = _ref.testID,
25147
- nativeProps = _objectWithoutProperties(_ref, _excluded$l);
25154
+ nativeProps = _objectWithoutProperties(_ref, _excluded$m);
25148
25155
  var theme = useTheme$1();
25149
25156
  var size = theme.__hd__.progress.sizes.circleDiameter;
25150
25157
  var strokeWidth = theme.__hd__.progress.sizes.circleCompletenessHeight;
@@ -25214,14 +25221,14 @@ var StyledInner = index$c(Animated.View)(function (_ref2) {
25214
25221
  };
25215
25222
  });
25216
25223
 
25217
- var _excluded$k = ["value", "intent", "style", "testID"];
25224
+ var _excluded$l = ["value", "intent", "style", "testID"];
25218
25225
  var ProgressBar = function ProgressBar(_ref) {
25219
25226
  var value = _ref.value,
25220
25227
  _ref$intent = _ref.intent,
25221
25228
  intent = _ref$intent === void 0 ? 'primary' : _ref$intent,
25222
25229
  style = _ref.style,
25223
25230
  testID = _ref.testID,
25224
- nativeProps = _objectWithoutProperties(_ref, _excluded$k);
25231
+ nativeProps = _objectWithoutProperties(_ref, _excluded$l);
25225
25232
  var _useState = useState(0),
25226
25233
  _useState2 = _slicedToArray(_useState, 2),
25227
25234
  width = _useState2[0],
@@ -25311,7 +25318,7 @@ var StyledSingleStep = index$c(Box)(function (_ref3) {
25311
25318
  };
25312
25319
  });
25313
25320
 
25314
- var _excluded$j = ["steps", "current", "onLayout"];
25321
+ var _excluded$k = ["steps", "current", "onLayout"];
25315
25322
  var getStepState = function getStepState(current, index) {
25316
25323
  if (index < current) {
25317
25324
  return 'complete';
@@ -25325,7 +25332,7 @@ var ProgressStep = function ProgressStep(_ref) {
25325
25332
  var steps = _ref.steps,
25326
25333
  current = _ref.current,
25327
25334
  onLayout = _ref.onLayout,
25328
- props = _objectWithoutProperties(_ref, _excluded$j);
25335
+ props = _objectWithoutProperties(_ref, _excluded$k);
25329
25336
  var theme = useTheme$1();
25330
25337
  var _React$useState = React__default.useState(0),
25331
25338
  _React$useState2 = _slicedToArray(_React$useState, 2),
@@ -25360,9 +25367,141 @@ var ProgressStep = function ProgressStep(_ref) {
25360
25367
  }));
25361
25368
  };
25362
25369
 
25370
+ var MIN_PROGRESS_VALUE = 0;
25371
+ var MAX_PROGRESS_VALUE = 100;
25372
+ var SEGMENTED_BAR_ERRORS = {
25373
+ negativeValue: '[Progress.SegmentedBar] value:$value is less than 0'
25374
+ };
25375
+
25376
+ var useValidateSegmentedBarData = function useValidateSegmentedBarData(_ref) {
25377
+ var values = _ref.values,
25378
+ dataLength = _ref.dataLength;
25379
+ var _React$useMemo = React__default.useMemo(function () {
25380
+ var foundNegativeValue = values.find(function (value) {
25381
+ return value < 0;
25382
+ });
25383
+ return {
25384
+ hasNegativeValue: foundNegativeValue !== undefined,
25385
+ negativeValue: foundNegativeValue
25386
+ };
25387
+ }, [dataLength, values]),
25388
+ hasNegativeValue = _React$useMemo.hasNegativeValue,
25389
+ negativeValue = _React$useMemo.negativeValue;
25390
+ assert(!hasNegativeValue, SEGMENTED_BAR_ERRORS.negativeValue.replace('$value', String(negativeValue)));
25391
+ };
25392
+
25393
+ var StyledHeader = index$c(Box)(function (_ref) {
25394
+ var theme = _ref.theme;
25395
+ return {
25396
+ flexDirection: 'row',
25397
+ justifyContent: 'space-between',
25398
+ alignItems: 'baseline',
25399
+ marginBottom: theme.__hd__.progress.space.segmentedHeaderMarginBottom
25400
+ };
25401
+ });
25402
+ var StyledTrack = index$c(Box)(function (_ref2) {
25403
+ var theme = _ref2.theme;
25404
+ return {
25405
+ width: '100%',
25406
+ height: theme.__hd__.progress.sizes.barHeight,
25407
+ borderRadius: theme.__hd__.progress.radii["default"],
25408
+ overflow: 'hidden',
25409
+ flexDirection: 'row'
25410
+ };
25411
+ });
25412
+ var StyledSegment = index$c(Box)(function (_ref3) {
25413
+ var themeColor = _ref3.themeColor,
25414
+ themeWidthPercent = _ref3.themeWidthPercent;
25415
+ return {
25416
+ backgroundColor: themeColor,
25417
+ flexGrow: 0,
25418
+ flexShrink: 0,
25419
+ width: "".concat(themeWidthPercent, "%")
25420
+ };
25421
+ });
25422
+
25423
+ var getTextComponent = function getTextComponent(content, textElement) {
25424
+ if (!content) {
25425
+ return null;
25426
+ }
25427
+ if (typeof content === 'string' || typeof content === 'number') {
25428
+ return textElement;
25429
+ }
25430
+ return content;
25431
+ };
25432
+
25433
+ var _excluded$j = ["data", "headerConfig", "style", "testID"];
25434
+ var ProgressSegmentedBar = function ProgressSegmentedBar(_ref) {
25435
+ var data = _ref.data,
25436
+ headerConfig = _ref.headerConfig,
25437
+ style = _ref.style,
25438
+ testID = _ref.testID,
25439
+ nativeProps = _objectWithoutProperties(_ref, _excluded$j);
25440
+ var values = React__default.useMemo(function () {
25441
+ return data.map(function (s) {
25442
+ return s.data;
25443
+ });
25444
+ }, [data]);
25445
+ useValidateSegmentedBarData({
25446
+ dataLength: data.length,
25447
+ values: values
25448
+ });
25449
+ var theme = useTheme$1();
25450
+ var totalPercent = React__default.useMemo(function () {
25451
+ return values.reduce(function (acc, value) {
25452
+ return acc + value;
25453
+ }, 0);
25454
+ }, [values]);
25455
+ var ariaValueMax = totalPercent > MAX_PROGRESS_VALUE ? totalPercent : MAX_PROGRESS_VALUE;
25456
+ var remainderPercent = React__default.useMemo(function () {
25457
+ return totalPercent >= MAX_PROGRESS_VALUE ? 0 : MAX_PROGRESS_VALUE - totalPercent;
25458
+ }, [totalPercent]);
25459
+ // Mock colors
25460
+ var segmentColors = [theme.colors.primary, theme.colors.success, theme.colors.warning, theme.colors.error, theme.colors.info, theme.colors.archived];
25461
+ var headerRight = React__default.useMemo(function () {
25462
+ return getTextComponent(headerConfig === null || headerConfig === void 0 ? void 0 : headerConfig.right, /*#__PURE__*/React__default.createElement(Typography.Caption, {
25463
+ intent: "muted"
25464
+ }, headerConfig === null || headerConfig === void 0 ? void 0 : headerConfig.right));
25465
+ }, [headerConfig === null || headerConfig === void 0 ? void 0 : headerConfig.right]);
25466
+ var showHeader = Boolean((headerConfig === null || headerConfig === void 0 ? void 0 : headerConfig.left) || headerRight);
25467
+ return /*#__PURE__*/React__default.createElement(Box, _extends$1({}, nativeProps, {
25468
+ style: style,
25469
+ testID: testID
25470
+ }), showHeader ? /*#__PURE__*/React__default.createElement(StyledHeader, {
25471
+ testID: testID ? "".concat(testID, "-header") : undefined
25472
+ }, headerConfig !== null && headerConfig !== void 0 && headerConfig.left ? /*#__PURE__*/React__default.createElement(Typography.Body, {
25473
+ variant: "regular-bold",
25474
+ testID: testID ? "".concat(testID, "-header-left") : undefined
25475
+ }, headerConfig.left) : null, headerRight ? /*#__PURE__*/React__default.createElement(Box, {
25476
+ testID: testID ? "".concat(testID, "-header-right") : undefined
25477
+ }, headerRight) : null) : null, /*#__PURE__*/React__default.createElement(StyledTrack, {
25478
+ testID: testID ? "".concat(testID, "-track") : undefined,
25479
+ accessibilityRole: "progressbar",
25480
+ accessibilityValue: {
25481
+ min: MIN_PROGRESS_VALUE,
25482
+ max: ariaValueMax,
25483
+ now: totalPercent
25484
+ }
25485
+ }, data.map(function (s, index) {
25486
+ var segmentColor = segmentColors[index % segmentColors.length];
25487
+ return /*#__PURE__*/React__default.createElement(StyledSegment, {
25488
+ key: "".concat(s.label, "-").concat(segmentColor),
25489
+ themeColor: segmentColor,
25490
+ themeWidthPercent: s.data,
25491
+ testID: testID ? "".concat(testID, "-segment-").concat(s.label) : undefined
25492
+ });
25493
+ }), remainderPercent > 0 ? /*#__PURE__*/React__default.createElement(StyledSegment, {
25494
+ key: "remainder",
25495
+ themeColor: theme.__hd__.progress.colors.segmentedRemainderBackground,
25496
+ themeWidthPercent: remainderPercent,
25497
+ testID: testID ? "".concat(testID, "-segment-remainder") : undefined
25498
+ }) : null));
25499
+ };
25500
+
25363
25501
  var Progress = {
25364
25502
  Circle: ProgressCircle,
25365
25503
  Bar: ProgressBar,
25504
+ SegmentedBar: ProgressSegmentedBar,
25366
25505
  Step: ProgressStep
25367
25506
  };
25368
25507