@hero-design/rn 8.121.0 → 8.123.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/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @hero-design/rn
2
2
 
3
+ ## 8.123.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#5000](https://github.com/Thinkei/hero-design/pull/5000) [`65005affb073e5de21dbe2511a8ef42251aa21ca`](https://github.com/Thinkei/hero-design/commit/65005affb073e5de21dbe2511a8ef42251aa21ca) Thanks [@phucdph](https://github.com/phucdph)! - Add `InlineLoader` component for React Native with idle, loading, success, and error states. Supports five text size variants (10–18px), a neutral intent and an AI intent with animated gradient text for the loading state.
8
+
9
+ ## 8.122.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [#4992](https://github.com/Thinkei/hero-design/pull/4992) [`87bd2b334180c9908328a7cdd2e686694dae1d7d`](https://github.com/Thinkei/hero-design/commit/87bd2b334180c9908328a7cdd2e686694dae1d7d) Thanks [@haudao-eh](https://github.com/haudao-eh)! - [Avatar] Add `neutral` intent to Avatar. `neutral` is now the default intent, replacing `primary`.
14
+
15
+ **Note:** Any Avatar rendered without an explicit `intent` prop will now
16
+ display a teal-grey background instead of dark purple. Add `intent="primary"`
17
+ to preserve the previous appearance.
18
+
3
19
  ## 8.121.0
4
20
 
5
21
  ### Minor Changes
package/es/index.js CHANGED
@@ -5614,6 +5614,7 @@ var getAttachmentTheme = function getAttachmentTheme(theme) {
5614
5614
 
5615
5615
  var getAvatarTheme = function getAvatarTheme(theme) {
5616
5616
  var colors = {
5617
+ neutral: palette$8.maasstrichtBlueLight25,
5617
5618
  primary: theme.colors.primary,
5618
5619
  info: theme.colors.info,
5619
5620
  danger: theme.colors.error,
@@ -7885,6 +7886,23 @@ var getSegmentedControlTheme = function getSegmentedControlTheme(theme) {
7885
7886
  };
7886
7887
  };
7887
7888
 
7889
+ var getInlineLoaderTheme = function getInlineLoaderTheme(theme) {
7890
+ return {
7891
+ space: {
7892
+ gap: theme.space.small
7893
+ },
7894
+ icon: {
7895
+ lineHeights: {
7896
+ xsmall: theme.lineHeights.xsmall,
7897
+ small: theme.lineHeights.small,
7898
+ medium: theme.lineHeights.medium,
7899
+ large: theme.lineHeights.large,
7900
+ xlarge: theme.lineHeights.xlarge
7901
+ }
7902
+ }
7903
+ };
7904
+ };
7905
+
7888
7906
  var getTheme = function getTheme() {
7889
7907
  var scale = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : scale$1;
7890
7908
  var systemPallete = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : swagSystemPalette$2;
@@ -7946,6 +7964,7 @@ var getTheme = function getTheme() {
7946
7964
  toolbar: getToolbarTheme(globalTheme),
7947
7965
  typography: getTypographyTheme(globalTheme),
7948
7966
  floatingIsland: getFloatingIslandTheme(globalTheme),
7967
+ inlineLoader: getInlineLoaderTheme(globalTheme),
7949
7968
  segmentedControl: getSegmentedControlTheme(globalTheme)
7950
7969
  }
7951
7970
  });
@@ -9396,7 +9415,7 @@ var StyledContent$1 = index$c(View)(function (_ref) {
9396
9415
  alignSelf: 'center'
9397
9416
  };
9398
9417
  });
9399
- var StyledContainer$9 = index$c(View)(function (_ref2) {
9418
+ var StyledContainer$a = index$c(View)(function (_ref2) {
9400
9419
  var theme = _ref2.theme;
9401
9420
  return {
9402
9421
  width: '100%',
@@ -9404,7 +9423,7 @@ var StyledContainer$9 = index$c(View)(function (_ref2) {
9404
9423
  backgroundColor: theme.__hd__.appCue.colors.backdropColor
9405
9424
  };
9406
9425
  });
9407
- var StyledIconContainer$1 = index$c(Animated.View)(function (_ref3) {
9426
+ var StyledIconContainer$2 = index$c(Animated.View)(function (_ref3) {
9408
9427
  var theme = _ref3.theme,
9409
9428
  themePlacement = _ref3.themePlacement;
9410
9429
  return _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({
@@ -9719,7 +9738,7 @@ var AppCue = function AppCue(_ref) {
9719
9738
  onPress: function onPress() {
9720
9739
  return setVisible(false);
9721
9740
  }
9722
- }, /*#__PURE__*/React__default.createElement(StyledContainer$9, null, /*#__PURE__*/React__default.createElement(View, {
9741
+ }, /*#__PURE__*/React__default.createElement(StyledContainer$a, null, /*#__PURE__*/React__default.createElement(View, {
9723
9742
  style: StyleSheet$1.flatten([{
9724
9743
  position: 'absolute',
9725
9744
  top: pos.top,
@@ -9734,7 +9753,7 @@ var AppCue = function AppCue(_ref) {
9734
9753
  maxWidth: maxWidth
9735
9754
  },
9736
9755
  testID: testID && "".concat(testID, "-content")
9737
- }, renderContent()), /*#__PURE__*/React__default.createElement(StyledIconContainer$1, {
9756
+ }, renderContent()), /*#__PURE__*/React__default.createElement(StyledIconContainer$2, {
9738
9757
  themePlacement: placement,
9739
9758
  testID: testID && "".concat(testID, "-arrow")
9740
9759
  }, /*#__PURE__*/React__default.createElement(Icon, {
@@ -9743,7 +9762,7 @@ var AppCue = function AppCue(_ref) {
9743
9762
  })))))));
9744
9763
  };
9745
9764
 
9746
- var StyledContainer$8 = index$c(View)({
9765
+ var StyledContainer$9 = index$c(View)({
9747
9766
  alignItems: 'center',
9748
9767
  flexDirection: 'row'
9749
9768
  });
@@ -9785,7 +9804,7 @@ var Attachment = function Attachment(_ref) {
9785
9804
  backgroundHighlighted = _ref$backgroundHighli === void 0 ? false : _ref$backgroundHighli,
9786
9805
  style = _ref.style,
9787
9806
  testID = _ref.testID;
9788
- return /*#__PURE__*/React__default.createElement(StyledContainer$8, {
9807
+ return /*#__PURE__*/React__default.createElement(StyledContainer$9, {
9789
9808
  testID: testID,
9790
9809
  style: style
9791
9810
  }, /*#__PURE__*/React__default.createElement(StyledContentContainer$1, {
@@ -9873,7 +9892,7 @@ var Avatar = function Avatar(_ref) {
9873
9892
  _ref$size = _ref.size,
9874
9893
  size = _ref$size === void 0 ? 'small' : _ref$size,
9875
9894
  _ref$intent = _ref.intent,
9876
- intent = _ref$intent === void 0 ? 'primary' : _ref$intent;
9895
+ intent = _ref$intent === void 0 ? 'neutral' : _ref$intent;
9877
9896
  var _useState = useState(false),
9878
9897
  _useState2 = _slicedToArray(_useState, 2),
9879
9898
  hasImageError = _useState2[0],
@@ -13907,7 +13926,7 @@ function ContentNavigator(_ref) {
13907
13926
  }));
13908
13927
  }
13909
13928
 
13910
- var StyledContainer$7 = index$c(View)(function (_ref) {
13929
+ var StyledContainer$8 = index$c(View)(function (_ref) {
13911
13930
  var theme = _ref.theme;
13912
13931
  return {
13913
13932
  backgroundColor: theme.__hd__.calendar.colors.background
@@ -14342,7 +14361,7 @@ var CalendarRange = function CalendarRange(_ref) {
14342
14361
  textIntent: isCurrentMonth ? undefined : 'subdued'
14343
14362
  });
14344
14363
  };
14345
- return /*#__PURE__*/React__default.createElement(StyledContainer$7, {
14364
+ return /*#__PURE__*/React__default.createElement(StyledContainer$8, {
14346
14365
  testID: testID
14347
14366
  }, /*#__PURE__*/React__default.createElement(StyledCalendarHeader, null, /*#__PURE__*/React__default.createElement(ContentNavigator, {
14348
14367
  value: !shouldShowMonthPicker ? formatTime('MMMM yyyy', visibleDate) : /*#__PURE__*/React__default.createElement(TouchableOpacity, {
@@ -14476,7 +14495,7 @@ var Calendar$1 = function Calendar(_ref) {
14476
14495
  monthPickerVisible = _useState2[0],
14477
14496
  setMonthPickerVisible = _useState2[1];
14478
14497
  var now = new Date();
14479
- return /*#__PURE__*/React__default.createElement(StyledContainer$7, {
14498
+ return /*#__PURE__*/React__default.createElement(StyledContainer$8, {
14480
14499
  testID: testID
14481
14500
  }, /*#__PURE__*/React__default.createElement(StyledCalendarHeader, null, /*#__PURE__*/React__default.createElement(ContentNavigator, {
14482
14501
  value: !shouldShowMonthPicker ? formatTime('MMMM yyyy', visibleDate) : /*#__PURE__*/React__default.createElement(TouchableOpacity, {
@@ -20624,7 +20643,7 @@ var index$9 = Object.assign(DefaultCheckbox, {
20624
20643
  Inline: InlineCheckbox
20625
20644
  });
20626
20645
 
20627
- var StyledContainer$6 = index$c(View)(function (_ref) {
20646
+ var StyledContainer$7 = index$c(View)(function (_ref) {
20628
20647
  var theme = _ref.theme;
20629
20648
  return {
20630
20649
  width: '100%',
@@ -21012,7 +21031,7 @@ var TextInput = /*#__PURE__*/forwardRef(function (_ref8, ref) {
21012
21031
  defaultValue: defaultValue,
21013
21032
  placeholder: isFocused || label === undefined ? nativeProps.placeholder : EMPTY_PLACEHOLDER_VALUE
21014
21033
  });
21015
- return /*#__PURE__*/React__default.createElement(StyledContainer$6, {
21034
+ return /*#__PURE__*/React__default.createElement(StyledContainer$7, {
21016
21035
  style: styleWithoutBackgroundColor,
21017
21036
  pointerEvents: state === 'disabled' || state === 'readonly' ? 'none' : 'auto',
21018
21037
  testID: testID
@@ -21692,7 +21711,7 @@ var index$8 = Object.assign(PublicDatePicker, {
21692
21711
  });
21693
21712
 
21694
21713
  var AnimatedPressable = Animated.createAnimatedComponent(Pressable);
21695
- var StyledContainer$5 = index$c(View)(function (_ref) {
21714
+ var StyledContainer$6 = index$c(View)(function (_ref) {
21696
21715
  var theme = _ref.theme,
21697
21716
  enableShadow = _ref.enableShadow;
21698
21717
  return _objectSpread2(_objectSpread2({}, StyleSheet$1.absoluteFillObject), {}, {
@@ -21952,7 +21971,7 @@ var Drawer = function Drawer(_ref) {
21952
21971
  return animation.stop();
21953
21972
  };
21954
21973
  }, [visible]);
21955
- return /*#__PURE__*/React__default.createElement(StyledContainer$5, {
21974
+ return /*#__PURE__*/React__default.createElement(StyledContainer$6, {
21956
21975
  testID: testID,
21957
21976
  enableShadow: enableShadow,
21958
21977
  pointerEvents: "box-none"
@@ -23943,7 +23962,7 @@ var StyledFABText = index$c(Typography.Body)(function (_ref3) {
23943
23962
  marginHorizontal: theme.__hd__.fab.space.titleMarginHorizontal
23944
23963
  };
23945
23964
  });
23946
- var StyledIconContainer = index$c(Box)(function (_ref4) {
23965
+ var StyledIconContainer$1 = index$c(Box)(function (_ref4) {
23947
23966
  var theme = _ref4.theme;
23948
23967
  return {
23949
23968
  width: theme.__hd__.fab.sizes.iconContainerWidth,
@@ -23987,7 +24006,7 @@ var ActionItem = function ActionItem(_ref) {
23987
24006
  style: style,
23988
24007
  onPress: onPress,
23989
24008
  testID: testID
23990
- }, /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(StyledIconContainer, null, /*#__PURE__*/React__default.createElement(StyledIcon$3, {
24009
+ }, /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(StyledIconContainer$1, null, /*#__PURE__*/React__default.createElement(StyledIcon$3, {
23991
24010
  size: "xsmall",
23992
24011
  icon: icon
23993
24012
  })), /*#__PURE__*/React__default.createElement(StyledActionItemText, null, title))));
@@ -24036,14 +24055,14 @@ var IconOnlyContent = function IconOnlyContent(_ref) {
24036
24055
  animated = _ref.animated,
24037
24056
  active = _ref.active;
24038
24057
  if (animated) {
24039
- return /*#__PURE__*/React__default.createElement(StyledIconContainer, null, /*#__PURE__*/React__default.createElement(AnimatedFABIcon, {
24058
+ return /*#__PURE__*/React__default.createElement(StyledIconContainer$1, null, /*#__PURE__*/React__default.createElement(AnimatedFABIcon, {
24040
24059
  active: active,
24041
24060
  icon: icon,
24042
24061
  testID: "animated-fab-icon",
24043
24062
  size: "xsmall"
24044
24063
  }));
24045
24064
  }
24046
- return /*#__PURE__*/React__default.createElement(StyledIconContainer, null, /*#__PURE__*/React__default.createElement(StyledFABIcon, {
24065
+ return /*#__PURE__*/React__default.createElement(StyledIconContainer$1, null, /*#__PURE__*/React__default.createElement(StyledFABIcon, {
24047
24066
  size: "xsmall",
24048
24067
  icon: icon,
24049
24068
  testID: "styled-fab-icon"
@@ -24052,7 +24071,7 @@ var IconOnlyContent = function IconOnlyContent(_ref) {
24052
24071
  var IconWithTextContent = function IconWithTextContent(_ref2) {
24053
24072
  var icon = _ref2.icon,
24054
24073
  title = _ref2.title;
24055
- return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(StyledIconContainer, null, /*#__PURE__*/React__default.createElement(StyledFABIcon, {
24074
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(StyledIconContainer$1, null, /*#__PURE__*/React__default.createElement(StyledFABIcon, {
24056
24075
  size: "xsmall",
24057
24076
  icon: icon,
24058
24077
  testID: "styled-fab-icon"
@@ -24210,7 +24229,7 @@ var FAB$1 = /*#__PURE__*/forwardRef(function (_ref3, ref) {
24210
24229
  });
24211
24230
  FAB$1.displayName = 'FAB';
24212
24231
 
24213
- var StyledContainer$4 = index$c(View)({
24232
+ var StyledContainer$5 = index$c(View)({
24214
24233
  position: 'absolute',
24215
24234
  left: 0,
24216
24235
  right: 0,
@@ -24317,7 +24336,7 @@ var ActionGroup = /*#__PURE__*/forwardRef(function (_ref, ref) {
24317
24336
  inputRange: [0, 1],
24318
24337
  outputRange: [0, 1]
24319
24338
  });
24320
- return /*#__PURE__*/React__default.createElement(StyledContainer$4, {
24339
+ return /*#__PURE__*/React__default.createElement(StyledContainer$5, {
24321
24340
  testID: testID,
24322
24341
  pointerEvents: "box-none",
24323
24342
  style: style
@@ -25048,7 +25067,7 @@ var HeroDesignProvider = function HeroDesignProvider(_ref) {
25048
25067
  }, /*#__PURE__*/React__default.createElement(Toast.Provider, null, /*#__PURE__*/React__default.createElement(Portal.Provider, null, children))));
25049
25068
  };
25050
25069
 
25051
- var StyledContainer$3 = index$c(View)(function (_ref) {
25070
+ var StyledContainer$4 = index$c(View)(function (_ref) {
25052
25071
  var theme = _ref.theme;
25053
25072
  return {
25054
25073
  width: theme.__hd__.mapPin.sizes["default"],
@@ -25128,7 +25147,7 @@ var MapPinFocussed = function MapPinFocussed(_ref) {
25128
25147
  var style = _ref.style,
25129
25148
  testID = _ref.testID,
25130
25149
  nativeProps = _objectWithoutProperties(_ref, _excluded$o);
25131
- return /*#__PURE__*/React__default.createElement(StyledContainer$3, _extends$1({}, nativeProps, {
25150
+ return /*#__PURE__*/React__default.createElement(StyledContainer$4, _extends$1({}, nativeProps, {
25132
25151
  style: style,
25133
25152
  testID: testID
25134
25153
  }), /*#__PURE__*/React__default.createElement(StyledFocusIcon, {
@@ -25155,7 +25174,7 @@ var MapPin = function MapPin(_ref) {
25155
25174
  icon = _ref.icon,
25156
25175
  nativeProps = _objectWithoutProperties(_ref, _excluded$n);
25157
25176
  var badgeIcon = getBadgeIconName(state);
25158
- return /*#__PURE__*/React__default.createElement(StyledContainer$3, _extends$1({}, nativeProps, {
25177
+ return /*#__PURE__*/React__default.createElement(StyledContainer$4, _extends$1({}, nativeProps, {
25159
25178
  style: style,
25160
25179
  testID: testID
25161
25180
  }), /*#__PURE__*/React__default.createElement(StyledContent, {
@@ -25437,7 +25456,7 @@ var PinInput = /*#__PURE__*/forwardRef(function (_ref2, ref) {
25437
25456
  });
25438
25457
  PinInput.displayName = 'PinInput';
25439
25458
 
25440
- var StyledContainer$2 = index$c(View)(function (_ref) {
25459
+ var StyledContainer$3 = index$c(View)(function (_ref) {
25441
25460
  var theme = _ref.theme;
25442
25461
  return {
25443
25462
  flexDirection: 'row',
@@ -25509,7 +25528,7 @@ var ProgressCircle = function ProgressCircle(_ref) {
25509
25528
  return /*#__PURE__*/React__default.createElement(View, _extends$1({}, nativeProps, {
25510
25529
  testID: testID,
25511
25530
  style: style
25512
- }), /*#__PURE__*/React__default.createElement(StyledContainer$2, null, /*#__PURE__*/React__default.createElement(Svg, {
25531
+ }), /*#__PURE__*/React__default.createElement(StyledContainer$3, null, /*#__PURE__*/React__default.createElement(Svg, {
25513
25532
  width: size,
25514
25533
  height: size,
25515
25534
  viewBox: "0 0 ".concat(size, " ").concat(size)
@@ -27243,7 +27262,7 @@ var index$4 = Object.assign(SingleSelect, {
27243
27262
  Multi: MultiSelect
27244
27263
  });
27245
27264
 
27246
- var StyledContainer$1 = index$c(Box)(function (_ref) {
27265
+ var StyledContainer$2 = index$c(Box)(function (_ref) {
27247
27266
  var theme = _ref.theme,
27248
27267
  themeIntent = _ref.themeIntent,
27249
27268
  themeVariant = _ref.themeVariant;
@@ -27329,7 +27348,7 @@ var Skeleton = function Skeleton(_ref) {
27329
27348
  }
27330
27349
  onLayout === null || onLayout === void 0 || onLayout(e);
27331
27350
  }, []);
27332
- return /*#__PURE__*/React__default.createElement(StyledContainer$1, _extends$1({
27351
+ return /*#__PURE__*/React__default.createElement(StyledContainer$2, _extends$1({
27333
27352
  style: style,
27334
27353
  themeVariant: variant,
27335
27354
  themeIntent: intent,
@@ -41304,7 +41323,7 @@ var RichTextEditor = function RichTextEditor(_ref) {
41304
41323
  onBlur === null || onBlur === void 0 || onBlur();
41305
41324
  setIsFocused(false);
41306
41325
  }, [onBlur]);
41307
- return /*#__PURE__*/React__default.createElement(StyledContainer$6, {
41326
+ return /*#__PURE__*/React__default.createElement(StyledContainer$7, {
41308
41327
  testID: testID
41309
41328
  }, /*#__PURE__*/React__default.createElement(StyledLabelContainerInsideTextInput, {
41310
41329
  themeHasPrefix: false,
@@ -41558,7 +41577,7 @@ function SectionListWithFAB(_ref) {
41558
41577
  });
41559
41578
  }
41560
41579
 
41561
- var StyledContainer = index$c(View)(function () {
41580
+ var StyledContainer$1 = index$c(View)(function () {
41562
41581
  return {
41563
41582
  width: '100%'
41564
41583
  };
@@ -41663,7 +41682,7 @@ var SearchTwoLine = function SearchTwoLine(props) {
41663
41682
  _props$variant = props.variant,
41664
41683
  variant = _props$variant === void 0 ? 'basic' : _props$variant,
41665
41684
  accessible = props.accessible;
41666
- return /*#__PURE__*/React__default.createElement(StyledContainer, {
41685
+ return /*#__PURE__*/React__default.createElement(StyledContainer$1, {
41667
41686
  style: style,
41668
41687
  testID: testID,
41669
41688
  accessible: accessible
@@ -41780,7 +41799,7 @@ var SearchOneLine = /*#__PURE__*/forwardRef(function (props, ref) {
41780
41799
  }));
41781
41800
  };
41782
41801
  var shouldShowClearButton = clearable && (state === 'filled' || isFocused) && !isEmptyValue;
41783
- return /*#__PURE__*/React__default.createElement(StyledContainer, {
41802
+ return /*#__PURE__*/React__default.createElement(StyledContainer$1, {
41784
41803
  pointerEvents: state === 'disabled' || state === 'readonly' ? 'none' : 'auto',
41785
41804
  testID: testID,
41786
41805
  style: style,
@@ -42237,4 +42256,235 @@ var FilterTrigger = function FilterTrigger(_ref) {
42237
42256
  })));
42238
42257
  };
42239
42258
 
42240
- export { Accordion, Alert, AppCue, Attachment, index$b as Avatar, Badge, BottomNavigation, BottomSheet, Box, CompoundButton as Button, Calendar, Card, index$a as Carousel, Chart, index$9 as Checkbox, Chip, Collapse, ContentNavigator, index$8 as DatePicker, Divider, index$7 as Drawer, Empty, ErrorComponent as Error, FAB, FilterTrigger, FlatListWithFAB, FloatingIsland, HeroDesignProvider, Icon, Illustration, IllustrationList, Image, List$1 as List, LocaleProvider, index$6 as MapPin, PageControl, PinInput, Portal, Progress, CompoundRadio as Radio, Rate, RefreshControl, index as RichTextEditor, ScrollViewWithFAB, Search, SectionHeading, SectionListWithFAB, SegmentedControl, index$4 as Select, Skeleton, Slider, Spinner, Success, index$5 as Swipeable, index$3 as Switch, index$2 as Tabs, Tag, TextInput, ThemeProvider, ThemeSwitcher, PublicTimePicker as TimePicker, Toast, index$1 as Toolbar, Typography, eBensSystemPalette, ehJobsSystemPalette, ehWorkDarkSystemPalette, ehWorkSystemPalette, getTheme, jobsSystemPalette, scale, index$c as styled, swagDarkSystemPalette, swagLightJobsSystemPalette, swagSystemPalette$1 as swagLightSystemPalette, swagSystemPalette$2 as swagSystemPalette, defaultTheme as theme, useAvatarColors, useTheme, walletSystemPalette, withTheme, workSystemPalette };
42259
+ var ANIMATION_DURATION_MS = 2000;
42260
+ var AnimatedGradientText = function AnimatedGradientText(_ref) {
42261
+ var children = _ref.children,
42262
+ fontSize = _ref.fontSize,
42263
+ lineHeight = _ref.lineHeight;
42264
+ var theme = useTheme();
42265
+ var gradient = theme.colors.gradients.aiHorizontal;
42266
+ var _useState = useState(null),
42267
+ _useState2 = _slicedToArray(_useState, 2),
42268
+ size = _useState2[0],
42269
+ setSize = _useState2[1];
42270
+ var animatedValue = useRef(new Animated.Value(0));
42271
+ var onLayout = useCallback(function (event) {
42272
+ var _event$nativeEvent$la = event.nativeEvent.layout,
42273
+ width = _event$nativeEvent$la.width,
42274
+ height = _event$nativeEvent$la.height;
42275
+ setSize(function (prev) {
42276
+ if ((prev === null || prev === void 0 ? void 0 : prev.width) === width && (prev === null || prev === void 0 ? void 0 : prev.height) === height) return prev;
42277
+ return {
42278
+ width: width,
42279
+ height: height
42280
+ };
42281
+ });
42282
+ }, []);
42283
+ useEffect(function () {
42284
+ if (!size) return;
42285
+ animatedValue.current.setValue(0);
42286
+ var animation = Animated.loop(Animated.timing(animatedValue.current, {
42287
+ toValue: 1,
42288
+ duration: ANIMATION_DURATION_MS,
42289
+ easing: Easing.linear,
42290
+ useNativeDriver: Platform.OS !== 'web'
42291
+ }));
42292
+ animation.start();
42293
+ return function () {
42294
+ return animation.stop();
42295
+ };
42296
+ }, [size]);
42297
+ // Slide left by one full text-width per loop cycle.
42298
+ // Starting at 0 keeps the gradient visible from the first frame.
42299
+ var translateX = size ? animatedValue.current.interpolate({
42300
+ inputRange: [0, 1],
42301
+ outputRange: [0, -size.width]
42302
+ }) : animatedValue.current;
42303
+ return /*#__PURE__*/React__default.createElement(View, null, /*#__PURE__*/React__default.createElement(MaskedView, {
42304
+ accessibilityElementsHidden: true,
42305
+ importantForAccessibility: "no-hide-descendants",
42306
+ maskElement: /*#__PURE__*/React__default.createElement(View, {
42307
+ onLayout: onLayout,
42308
+ style: {
42309
+ backgroundColor: 'transparent'
42310
+ },
42311
+ testID: "animated-gradient-text-mask"
42312
+ }, /*#__PURE__*/React__default.createElement(Typography.Body, {
42313
+ intent: "body",
42314
+ style: {
42315
+ fontSize: fontSize,
42316
+ lineHeight: lineHeight
42317
+ }
42318
+ }, children))
42319
+ }, size ? /*#__PURE__*/React__default.createElement(View, {
42320
+ style: {
42321
+ width: size.width,
42322
+ height: size.height,
42323
+ overflow: 'hidden'
42324
+ }
42325
+ }, /*#__PURE__*/React__default.createElement(Animated.View, {
42326
+ style: {
42327
+ width: size.width * 2,
42328
+ height: size.height,
42329
+ transform: [{
42330
+ translateX: translateX
42331
+ }]
42332
+ }
42333
+ }, /*#__PURE__*/React__default.createElement(LinearGradient, {
42334
+ start: gradient.start,
42335
+ end: gradient.end,
42336
+ colors: [gradient.colors[0], gradient.colors[1], gradient.colors[2], gradient.colors[1], gradient.colors[0]],
42337
+ locations: [0, 0.25, 0.5, 0.75, 1.0],
42338
+ style: {
42339
+ width: '100%',
42340
+ height: '100%'
42341
+ }
42342
+ }))) : /*#__PURE__*/React__default.createElement(Typography.Body, {
42343
+ intent: "body",
42344
+ style: {
42345
+ fontSize: fontSize,
42346
+ lineHeight: lineHeight
42347
+ }
42348
+ }, children)), /*#__PURE__*/React__default.createElement(View, {
42349
+ style: {
42350
+ position: 'absolute',
42351
+ opacity: 0
42352
+ },
42353
+ importantForAccessibility: "yes",
42354
+ accessibilityElementsHidden: false
42355
+ }, /*#__PURE__*/React__default.createElement(Typography.Body, {
42356
+ intent: "body",
42357
+ style: {
42358
+ fontSize: fontSize,
42359
+ lineHeight: lineHeight
42360
+ }
42361
+ }, children)));
42362
+ };
42363
+
42364
+ var TEXT_SIZE_NAMES = {
42365
+ 10: 'xsmall',
42366
+ 12: 'small',
42367
+ 14: 'medium',
42368
+ 16: 'large',
42369
+ 18: 'xlarge'
42370
+ };
42371
+ var getTextSizeName = function getTextSizeName(size) {
42372
+ return TEXT_SIZE_NAMES[size];
42373
+ };
42374
+ var getIconName = function getIconName(state) {
42375
+ switch (state) {
42376
+ case 'idle':
42377
+ return 'circle-ok-outlined';
42378
+ case 'loading':
42379
+ return 'loading';
42380
+ case 'success':
42381
+ return 'circle-check';
42382
+ case 'error':
42383
+ return 'circle-cancel-outlined';
42384
+ }
42385
+ };
42386
+ var getIconIntent = function getIconIntent(state, intent) {
42387
+ switch (state) {
42388
+ case 'idle':
42389
+ return 'inactive';
42390
+ case 'loading':
42391
+ return intent === 'ai' ? 'ai' : 'primary';
42392
+ case 'success':
42393
+ return 'success';
42394
+ case 'error':
42395
+ return 'danger';
42396
+ }
42397
+ };
42398
+ var getIconSize = function getIconSize(textSize) {
42399
+ switch (textSize) {
42400
+ case 10:
42401
+ return {
42402
+ size: 'xxxsmall'
42403
+ };
42404
+ case 12:
42405
+ return {
42406
+ size: 'xxxsmall',
42407
+ styleFontSize: 14
42408
+ };
42409
+ case 14:
42410
+ return {
42411
+ size: 'xxxsmall',
42412
+ styleFontSize: 14
42413
+ };
42414
+ case 16:
42415
+ return {
42416
+ size: 'xsmall'
42417
+ };
42418
+ case 18:
42419
+ return {
42420
+ size: 'small'
42421
+ };
42422
+ }
42423
+ };
42424
+
42425
+ var StyledContainer = index$c(View)(function (_ref) {
42426
+ var theme = _ref.theme;
42427
+ return {
42428
+ flexDirection: 'row',
42429
+ alignItems: 'flex-start',
42430
+ gap: theme.__hd__.inlineLoader.space.gap
42431
+ };
42432
+ });
42433
+ var StyledIconContainer = index$c(View)(function (_ref2) {
42434
+ var themeSize = _ref2.themeSize,
42435
+ theme = _ref2.theme;
42436
+ return {
42437
+ height: theme.__hd__.inlineLoader.icon.lineHeights[themeSize],
42438
+ justifyContent: 'center'
42439
+ };
42440
+ });
42441
+
42442
+ var InlineLoader = function InlineLoader(_ref) {
42443
+ var text = _ref.text,
42444
+ _ref$state = _ref.state,
42445
+ state = _ref$state === void 0 ? 'idle' : _ref$state,
42446
+ _ref$intent = _ref.intent,
42447
+ intent = _ref$intent === void 0 ? 'neutral' : _ref$intent,
42448
+ _ref$size = _ref.size,
42449
+ size = _ref$size === void 0 ? 14 : _ref$size,
42450
+ style = _ref.style,
42451
+ testID = _ref.testID;
42452
+ var theme = useTheme();
42453
+ var textSizeName = getTextSizeName(size);
42454
+ var lineHeight = theme.__hd__.inlineLoader.icon.lineHeights[textSizeName];
42455
+ var iconName = getIconName(state);
42456
+ var iconIntent = getIconIntent(state, intent);
42457
+ var _getIconSize = getIconSize(size),
42458
+ iconSize = _getIconSize.size,
42459
+ styleFontSize = _getIconSize.styleFontSize;
42460
+ var iconStyle = styleFontSize ? {
42461
+ fontSize: styleFontSize
42462
+ } : undefined;
42463
+ var isAiLoading = state === 'loading' && intent === 'ai';
42464
+ return /*#__PURE__*/React__default.createElement(StyledContainer, {
42465
+ testID: testID,
42466
+ style: style
42467
+ }, /*#__PURE__*/React__default.createElement(StyledIconContainer, {
42468
+ themeSize: textSizeName
42469
+ }, /*#__PURE__*/React__default.createElement(Icon, {
42470
+ icon: iconName,
42471
+ intent: iconIntent,
42472
+ size: iconSize,
42473
+ spin: state === 'loading',
42474
+ style: iconStyle,
42475
+ accessible: false,
42476
+ accessibilityElementsHidden: true,
42477
+ importantForAccessibility: "no-hide-descendants"
42478
+ })), isAiLoading ? /*#__PURE__*/React__default.createElement(AnimatedGradientText, {
42479
+ fontSize: size,
42480
+ lineHeight: lineHeight
42481
+ }, text) : /*#__PURE__*/React__default.createElement(Typography.Body, {
42482
+ intent: "body",
42483
+ style: {
42484
+ fontSize: size,
42485
+ lineHeight: lineHeight
42486
+ }
42487
+ }, text));
42488
+ };
42489
+
42490
+ export { Accordion, Alert, AppCue, Attachment, index$b as Avatar, Badge, BottomNavigation, BottomSheet, Box, CompoundButton as Button, Calendar, Card, index$a as Carousel, Chart, index$9 as Checkbox, Chip, Collapse, ContentNavigator, index$8 as DatePicker, Divider, index$7 as Drawer, Empty, ErrorComponent as Error, FAB, FilterTrigger, FlatListWithFAB, FloatingIsland, HeroDesignProvider, Icon, Illustration, IllustrationList, Image, InlineLoader, List$1 as List, LocaleProvider, index$6 as MapPin, PageControl, PinInput, Portal, Progress, CompoundRadio as Radio, Rate, RefreshControl, index as RichTextEditor, ScrollViewWithFAB, Search, SectionHeading, SectionListWithFAB, SegmentedControl, index$4 as Select, Skeleton, Slider, Spinner, Success, index$5 as Swipeable, index$3 as Switch, index$2 as Tabs, Tag, TextInput, ThemeProvider, ThemeSwitcher, PublicTimePicker as TimePicker, Toast, index$1 as Toolbar, Typography, eBensSystemPalette, ehJobsSystemPalette, ehWorkDarkSystemPalette, ehWorkSystemPalette, getTheme, jobsSystemPalette, scale, index$c as styled, swagDarkSystemPalette, swagLightJobsSystemPalette, swagSystemPalette$1 as swagLightSystemPalette, swagSystemPalette$2 as swagSystemPalette, defaultTheme as theme, useAvatarColors, useTheme, walletSystemPalette, withTheme, workSystemPalette };