@hero-design/rn 8.82.2-alpha.2 → 8.83.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.
Files changed (56) hide show
  1. package/.turbo/turbo-build.log +7 -0
  2. package/CHANGELOG.md +20 -0
  3. package/es/index.js +491 -21
  4. package/lib/index.js +490 -18
  5. package/package.json +6 -4
  6. package/rollup.config.mjs +1 -0
  7. package/src/components/AppCue/StyledAppCue.tsx +46 -0
  8. package/src/components/AppCue/__tests__/StyledAppCue.tsx +18 -0
  9. package/src/components/AppCue/__tests__/__snapshots__/StyledAppCue.tsx.snap +200 -0
  10. package/src/components/AppCue/__tests__/__snapshots__/index.spec.tsx.snap +391 -0
  11. package/src/components/AppCue/__tests__/index.spec.tsx +61 -0
  12. package/src/components/AppCue/__tests__/utils.spec.ts +90 -0
  13. package/src/components/AppCue/index.tsx +188 -0
  14. package/src/components/AppCue/utils.ts +122 -0
  15. package/src/components/Chip/StyledChip.tsx +9 -9
  16. package/src/components/Chip/__tests__/__snapshots__/index.spec.tsx.snap +434 -0
  17. package/src/components/Chip/__tests__/index.spec.tsx +4 -0
  18. package/src/components/Chip/index.tsx +32 -5
  19. package/src/components/Slider/RangeSlider.tsx +187 -0
  20. package/src/components/Slider/SingleSlider.tsx +89 -0
  21. package/src/components/Slider/StyledRangeSlider.tsx +16 -0
  22. package/src/components/Slider/__tests__/RangeSlider.spec.tsx +119 -0
  23. package/src/components/Slider/__tests__/{index.spec.tsx → SingleSlider.spec.tsx} +1 -1
  24. package/src/components/Slider/__tests__/__snapshots__/RangeSlider.spec.tsx.snap +252 -0
  25. package/src/components/Slider/index.tsx +8 -83
  26. package/src/components/Tabs/StyledScrollableTabs.tsx +2 -1
  27. package/src/components/Tabs/StyledTabs.tsx +1 -0
  28. package/src/components/Tabs/__tests__/__snapshots__/ScrollableTabs.spec.tsx.snap +3 -0
  29. package/src/components/Tabs/__tests__/__snapshots__/ScrollableTabsHeader.spec.tsx.snap +2 -0
  30. package/src/components/Tabs/__tests__/__snapshots__/index.spec.tsx.snap +3 -0
  31. package/src/index.ts +2 -0
  32. package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +39 -0
  33. package/src/theme/components/appCue.ts +22 -0
  34. package/src/theme/components/slider.ts +19 -1
  35. package/src/theme/components/tabs.ts +1 -0
  36. package/src/theme/getTheme.ts +3 -0
  37. package/src/types.ts +2 -0
  38. package/stats/8.83.0/rn-stats.html +4844 -0
  39. package/testUtils/setup.tsx +17 -0
  40. package/types/components/AppCue/StyledAppCue.d.ts +20 -0
  41. package/types/components/AppCue/__tests__/StyledAppCue.d.ts +1 -0
  42. package/types/components/AppCue/index.d.ts +21 -0
  43. package/types/components/AppCue/utils.d.ts +63 -0
  44. package/types/components/Chip/StyledChip.d.ts +1 -1
  45. package/types/components/Chip/index.d.ts +2 -2
  46. package/types/components/Slider/RangeSlider.d.ts +60 -0
  47. package/types/components/Slider/SingleSlider.d.ts +53 -0
  48. package/types/components/Slider/StyledRangeSlider.d.ts +10 -0
  49. package/types/components/Slider/index.d.ts +6 -51
  50. package/types/index.d.ts +2 -1
  51. package/types/theme/components/appCue.d.ts +16 -0
  52. package/types/theme/components/slider.d.ts +24 -0
  53. package/types/theme/components/tabs.d.ts +1 -0
  54. package/types/theme/getTheme.d.ts +2 -0
  55. package/types/types.d.ts +2 -1
  56. /package/src/components/Slider/__tests__/__snapshots__/{index.spec.tsx.snap → SingleSlider.spec.tsx.snap} +0 -0
package/es/index.js CHANGED
@@ -1,12 +1,13 @@
1
1
  import * as reactNative from 'react-native';
2
- import { Platform, Dimensions, StyleSheet as StyleSheet$1, Animated, View, UIManager, LayoutAnimation, TouchableOpacity, Text as Text$1, Easing, Image as Image$1, TouchableWithoutFeedback, Pressable, SafeAreaView, KeyboardAvoidingView, TouchableHighlight, ScrollView, Modal as Modal$1, FlatList, TextInput as TextInput$1, PanResponder, BackHandler, InteractionManager, useWindowDimensions, Keyboard, SectionList, RefreshControl as RefreshControl$1 } from 'react-native';
2
+ import { Platform, Dimensions, StyleSheet as StyleSheet$1, Animated, View, UIManager, LayoutAnimation, TouchableOpacity, Text as Text$1, Easing, useWindowDimensions, TouchableWithoutFeedback, Modal as Modal$1, Image as Image$1, Pressable, SafeAreaView, KeyboardAvoidingView, TouchableHighlight, ScrollView, FlatList, TextInput as TextInput$1, PanResponder, BackHandler, InteractionManager, Keyboard, SectionList, RefreshControl as RefreshControl$1 } from 'react-native';
3
3
  import * as React from 'react';
4
- import React__default, { useMemo, useEffect, useCallback, useRef, useState, createContext, useContext, forwardRef, memo, useReducer, useLayoutEffect, useImperativeHandle, isValidElement } from 'react';
4
+ import React__default, { useMemo, useEffect, useCallback, useRef, useLayoutEffect, useState, createContext, useContext, forwardRef, memo, useReducer, useImperativeHandle, isValidElement } from 'react';
5
5
  import { createIconSet } from 'react-native-vector-icons';
6
6
  import { useSafeAreaInsets } from 'react-native-safe-area-context';
7
7
  import { MonthYearPickerViewIOS, MonthYearPickerDialogueAndroid } from '@hero-design/react-native-month-year-picker';
8
8
  import DateTimePicker from '@react-native-community/datetimepicker';
9
9
  import RnSlider from '@react-native-community/slider';
10
+ import MultiSlider from '@ptomasroos/react-native-multi-slider';
10
11
  import { RectButton, GestureHandlerRootView, Swipeable as Swipeable$1 } from 'react-native-gesture-handler';
11
12
  import LinearGradient from 'react-native-linear-gradient';
12
13
  import PagerView from 'react-native-pager-view';
@@ -3304,10 +3305,28 @@ var getSliderTheme = function getSliderTheme(theme) {
3304
3305
  var colors = {
3305
3306
  minimumTrackTint: theme.colors.primary,
3306
3307
  thumbTint: theme.colors.primary,
3307
- maximumTrackTint: theme.colors.highlightedSurface
3308
+ maximumTrackTint: theme.colors.highlightedSurface,
3309
+ trackBackground: theme.colors.highlightedSurface,
3310
+ disabledThumbTint: theme.colors.disabledOnDefaultGlobalSurface,
3311
+ disabledTrackBackground: theme.colors.neutralGlobalSurface
3312
+ };
3313
+ var shadows = {
3314
+ marker: theme.shadows["default"]
3315
+ };
3316
+ var sizes = {
3317
+ trackHeight: theme.sizes.xsmall,
3318
+ markerWidth: theme.sizes.large,
3319
+ markerHeight: theme.sizes.large,
3320
+ markerBorderRadius: theme.radii.rounded
3321
+ };
3322
+ var radii = {
3323
+ marker: theme.radii.rounded
3308
3324
  };
3309
3325
  return {
3310
- colors: colors
3326
+ colors: colors,
3327
+ shadows: shadows,
3328
+ sizes: sizes,
3329
+ radii: radii
3311
3330
  };
3312
3331
  };
3313
3332
 
@@ -3450,7 +3469,8 @@ var getTabsTheme = function getTabsTheme(theme) {
3450
3469
  activeBackground: theme.colors.decorativePrimarySurface,
3451
3470
  headerBottom: theme.colors.secondaryOutline,
3452
3471
  indicator: theme.colors.primary,
3453
- text: theme.colors.onDefaultGlobalSurface
3472
+ text: theme.colors.onDefaultGlobalSurface,
3473
+ headerBackground: theme.colors.defaultGlobalSurface
3454
3474
  };
3455
3475
  var space = {
3456
3476
  flatListHorizontalPadding: theme.space.small,
@@ -4053,6 +4073,26 @@ var getFloatingIslandTheme = function getFloatingIslandTheme(theme) {
4053
4073
  };
4054
4074
  };
4055
4075
 
4076
+ var getAppCueTheme = function getAppCueTheme(theme) {
4077
+ var colors = {
4078
+ background: theme.colors.darkGlobalSurface,
4079
+ backdropColor: 'rgba(0, 0, 0, 0.5)'
4080
+ };
4081
+ var space = {
4082
+ padding: theme.space.medium,
4083
+ offset: theme.space.small,
4084
+ arrowOffset: theme.space.smallMedium
4085
+ };
4086
+ var radii = {
4087
+ container: theme.radii.large
4088
+ };
4089
+ return {
4090
+ colors: colors,
4091
+ space: space,
4092
+ radii: radii
4093
+ };
4094
+ };
4095
+
4056
4096
  var getTheme$1 = function getTheme() {
4057
4097
  var scale = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : scale$1;
4058
4098
  var systemPallete = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : swagSystemPalette$1;
@@ -4061,6 +4101,7 @@ var getTheme$1 = function getTheme() {
4061
4101
  __hd__: {
4062
4102
  accordion: getAccordionTheme(globalTheme),
4063
4103
  alert: getAlertTheme(globalTheme),
4104
+ appCue: getAppCueTheme(globalTheme),
4064
4105
  attachment: getAttachmentTheme(globalTheme),
4065
4106
  avatar: getAvatarTheme(globalTheme),
4066
4107
  badge: getBadgeTheme(globalTheme),
@@ -8206,6 +8247,288 @@ var Alert = function Alert(_ref2) {
8206
8247
  })) : null);
8207
8248
  };
8208
8249
 
8250
+ var StyledContent$1 = index$a(View)(function (_ref) {
8251
+ var theme = _ref.theme;
8252
+ return {
8253
+ padding: theme.__hd__.appCue.space.padding,
8254
+ backgroundColor: theme.__hd__.appCue.colors.background,
8255
+ borderRadius: theme.__hd__.appCue.radii.container,
8256
+ alignSelf: 'center'
8257
+ };
8258
+ });
8259
+ var StyledContainer$9 = index$a(View)(function (_ref2) {
8260
+ var theme = _ref2.theme;
8261
+ return {
8262
+ width: '100%',
8263
+ height: '100%',
8264
+ backgroundColor: theme.__hd__.appCue.colors.backdropColor
8265
+ };
8266
+ });
8267
+ var StyledIconContainer$1 = index$a(Animated.View)(function (_ref3) {
8268
+ var theme = _ref3.theme,
8269
+ themePlacement = _ref3.themePlacement;
8270
+ return _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({
8271
+ position: 'absolute',
8272
+ color: theme.__hd__.appCue.colors.background,
8273
+ display: 'flex',
8274
+ alignItems: 'center',
8275
+ justifyContent: 'center'
8276
+ }, themePlacement === 'top' && {
8277
+ bottom: -theme.__hd__.appCue.space.arrowOffset,
8278
+ width: '100%'
8279
+ }), themePlacement === 'bottom' && {
8280
+ top: -theme.__hd__.appCue.space.arrowOffset,
8281
+ transform: [{
8282
+ rotate: '180deg'
8283
+ }],
8284
+ width: '100%'
8285
+ }), themePlacement === 'right' && {
8286
+ left: -theme.__hd__.appCue.space.arrowOffset,
8287
+ transform: [{
8288
+ rotate: '90deg'
8289
+ }],
8290
+ height: '100%'
8291
+ }), themePlacement === 'left' && {
8292
+ right: -theme.__hd__.appCue.space.arrowOffset,
8293
+ transform: [{
8294
+ rotate: '-90deg'
8295
+ }],
8296
+ height: '100%'
8297
+ });
8298
+ });
8299
+
8300
+ /**
8301
+ * Calculates the position of an element based on its placement relative to a reference position.
8302
+ *
8303
+ * @param {Object} params - The parameters for calculating the position.
8304
+ * @param {Object} params.position - The position and size of target element.
8305
+ * @param {number} params.position.pageX - The X coordinate of the target position.
8306
+ * @param {number} params.position.pageY - The Y coordinate of the target position.
8307
+ * @param {number} params.position.width - The width of the reference element.
8308
+ * @param {number} params.position.height - The height of the reference element.
8309
+ * @param {Object} params.contentSize - The size of the App Cue content.
8310
+ * @param {number} params.contentSize.width - The width of the content.
8311
+ * @param {number} params.contentSize.height - The height of the content.
8312
+ * @param {Placement} params.placement - The placement of the content relative to the reference position ('top', 'bottom', 'right', 'left').
8313
+ * @param {number} params.offset - The offset distance to display an arrow.
8314
+ *
8315
+ * @returns {Object} The calculated position of the App Cue.
8316
+ * @returns {number} return.x - The X coordinate of the App Cue.
8317
+ * @returns {number} return.y - The Y coordinate of the App Cue.
8318
+ */
8319
+ var calculatePosition = function calculatePosition(_ref) {
8320
+ var placement = _ref.placement,
8321
+ position = _ref.position,
8322
+ contentSize = _ref.contentSize,
8323
+ offset = _ref.offset;
8324
+ switch (placement) {
8325
+ case 'top':
8326
+ {
8327
+ return {
8328
+ // The X coordinate is calculated by adding the half of the width of the target element to the X coordinate of the target element.
8329
+ x: position.pageX + (position.width - contentSize.width) / 2,
8330
+ // The Y coordinate is calculated by subtracting the height of the content and the offset from the Y coordinate of the target element
8331
+ y: position.pageY - contentSize.height - offset
8332
+ };
8333
+ }
8334
+ case 'bottom':
8335
+ {
8336
+ return {
8337
+ // The X coordinate is calculated by adding the half of the width of the target element to the X coordinate of the target element.
8338
+ x: position.pageX + (position.width - contentSize.width) / 2,
8339
+ // The Y coordinate is calculated by adding the height of the target element and the offset to the Y coordinate of the target element.
8340
+ y: position.pageY + position.height + offset
8341
+ };
8342
+ }
8343
+ case 'right':
8344
+ {
8345
+ return {
8346
+ // The X coordinate is calculated by adding the width of the target element and the offset to the X coordinate of the target element.
8347
+ x: position.pageX + position.width + offset,
8348
+ // The Y coordinate is calculated by adding half of the height of the target element to the Y coordinate of the target element.
8349
+ y: position.pageY + (position.height - contentSize.height) / 2
8350
+ };
8351
+ }
8352
+ case 'left':
8353
+ {
8354
+ return {
8355
+ // The X coordinate is calculated by subtracting the width of the content and the offset from the X coordinate of the target element.
8356
+ x: position.pageX - contentSize.width - offset,
8357
+ // The Y coordinate is calculated by adding half of the height of the target element to the Y coordinate of the target element.
8358
+ y: position.pageY + (position.height - contentSize.height) / 2
8359
+ };
8360
+ }
8361
+ }
8362
+ };
8363
+ /**
8364
+ * Calculates the maximum width of the content based on its position, offset, placement, and window width.
8365
+ *
8366
+ * @param {Object} params - The parameters for the calculation.
8367
+ * @param {Object} params.position - The position and dimensions of the target element.
8368
+ * @param {number} params.position.pageX - The X coordinate of the target element.
8369
+ * @param {number} params.position.pageY - The Y coordinate of the target element.
8370
+ * @param {number} params.position.width - The width of the target element.
8371
+ * @param {number} params.position.height - The height of the target element.
8372
+ * @param {number} params.offset - The offset value to display an arrow.
8373
+ * @param {Placement} params.placement - The placement of the content relative to the element.
8374
+ * @param {number} params.windowWidth - The width of the window.
8375
+ *
8376
+ * @returns {number | undefined} The maximum width of the content.
8377
+ */
8378
+ var calulateContentMaxWidth = function calulateContentMaxWidth(_ref2) {
8379
+ var position = _ref2.position,
8380
+ offset = _ref2.offset,
8381
+ placement = _ref2.placement,
8382
+ windowWidth = _ref2.windowWidth;
8383
+ switch (placement) {
8384
+ case 'top':
8385
+ {
8386
+ return undefined;
8387
+ }
8388
+ case 'bottom':
8389
+ {
8390
+ return undefined;
8391
+ }
8392
+ case 'right':
8393
+ {
8394
+ return windowWidth - position.pageX - position.width - offset;
8395
+ }
8396
+ case 'left':
8397
+ {
8398
+ return position.pageX - offset;
8399
+ }
8400
+ }
8401
+ };
8402
+
8403
+ var AppCue = function AppCue(_ref) {
8404
+ var target = _ref.target,
8405
+ content = _ref.content,
8406
+ _ref$placement = _ref.placement,
8407
+ placement = _ref$placement === void 0 ? 'top' : _ref$placement,
8408
+ style = _ref.style,
8409
+ testID = _ref.testID;
8410
+ var targetContainerRef = useRef(null);
8411
+ var _React$useState = React__default.useState(false),
8412
+ _React$useState2 = _slicedToArray(_React$useState, 2),
8413
+ visible = _React$useState2[0],
8414
+ setVisible = _React$useState2[1];
8415
+ var theme = useTheme();
8416
+ var offset = theme.__hd__.appCue.space.offset;
8417
+ var _React$useState3 = React__default.useState({
8418
+ pageX: 0,
8419
+ pageY: 0,
8420
+ width: 0,
8421
+ height: 0
8422
+ }),
8423
+ _React$useState4 = _slicedToArray(_React$useState3, 2),
8424
+ position = _React$useState4[0],
8425
+ setPosition = _React$useState4[1];
8426
+ var _React$useState5 = React__default.useState({
8427
+ width: 0,
8428
+ height: 0
8429
+ }),
8430
+ _React$useState6 = _slicedToArray(_React$useState5, 2),
8431
+ contentSize = _React$useState6[0],
8432
+ setContentSize = _React$useState6[1];
8433
+ var doMeasure = useCallback(function (cb) {
8434
+ var _targetContainerRef$c;
8435
+ (_targetContainerRef$c = targetContainerRef.current) === null || _targetContainerRef$c === void 0 || _targetContainerRef$c.measure(function (_, __, width, height, pageX, pageY) {
8436
+ setPosition({
8437
+ pageX: pageX,
8438
+ pageY: pageY,
8439
+ width: width,
8440
+ height: height
8441
+ });
8442
+ cb === null || cb === void 0 || cb();
8443
+ });
8444
+ }, []);
8445
+ var handleOpen = function handleOpen() {
8446
+ doMeasure(function () {
8447
+ return setVisible(true);
8448
+ });
8449
+ };
8450
+ useLayoutEffect(function () {
8451
+ doMeasure();
8452
+ }, [doMeasure]);
8453
+ var enhancedTarget = /*#__PURE__*/React__default.cloneElement(target, {
8454
+ onPress: function onPress() {
8455
+ var _target$props, _target$props$onPress;
8456
+ handleOpen();
8457
+ (_target$props = target.props) === null || _target$props === void 0 || (_target$props$onPress = _target$props.onPress) === null || _target$props$onPress === void 0 || _target$props$onPress.call(_target$props);
8458
+ }
8459
+ }, target.props.children);
8460
+ var measureContent = function measureContent(event) {
8461
+ setContentSize({
8462
+ width: event.nativeEvent.layout.width,
8463
+ height: event.nativeEvent.layout.height
8464
+ });
8465
+ };
8466
+ var pos = calculatePosition({
8467
+ position: position,
8468
+ contentSize: contentSize,
8469
+ placement: placement,
8470
+ offset: offset
8471
+ });
8472
+ var _useWindowDimensions = useWindowDimensions(),
8473
+ windowWidth = _useWindowDimensions.width;
8474
+ var maxWidth = calulateContentMaxWidth({
8475
+ position: position,
8476
+ offset: offset,
8477
+ placement: placement,
8478
+ windowWidth: windowWidth
8479
+ });
8480
+ var renderContent = function renderContent() {
8481
+ if (typeof content === 'string') {
8482
+ return /*#__PURE__*/React__default.createElement(Typography.Body, {
8483
+ intent: "inverted"
8484
+ }, content);
8485
+ }
8486
+ return content;
8487
+ };
8488
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(TouchableWithoutFeedback, {
8489
+ onPress: handleOpen
8490
+ }, /*#__PURE__*/React__default.createElement(View, {
8491
+ collapsable: false,
8492
+ ref: targetContainerRef,
8493
+ style: {
8494
+ alignSelf: 'center'
8495
+ }
8496
+ }, enhancedTarget)), /*#__PURE__*/React__default.createElement(Modal$1, {
8497
+ animationType: "fade",
8498
+ visible: visible,
8499
+ onDismiss: function onDismiss() {
8500
+ return setVisible(false);
8501
+ },
8502
+ transparent: true,
8503
+ presentationStyle: "overFullScreen",
8504
+ statusBarTranslucent: true
8505
+ }, /*#__PURE__*/React__default.createElement(TouchableWithoutFeedback, {
8506
+ testID: testID && "".concat(testID, "-backdrop"),
8507
+ onPress: function onPress() {
8508
+ return setVisible(false);
8509
+ }
8510
+ }, /*#__PURE__*/React__default.createElement(StyledContainer$9, null, /*#__PURE__*/React__default.createElement(View, {
8511
+ style: StyleSheet$1.flatten([{
8512
+ position: 'absolute',
8513
+ top: pos.y,
8514
+ left: pos.x
8515
+ }, style]),
8516
+ onLayout: measureContent,
8517
+ testID: testID
8518
+ }, /*#__PURE__*/React__default.createElement(StyledContent$1, {
8519
+ style: {
8520
+ maxWidth: maxWidth
8521
+ },
8522
+ testID: testID && "".concat(testID, "-content")
8523
+ }, renderContent()), /*#__PURE__*/React__default.createElement(StyledIconContainer$1, {
8524
+ themePlacement: placement,
8525
+ testID: testID && "".concat(testID, "-arrow")
8526
+ }, /*#__PURE__*/React__default.createElement(Icon, {
8527
+ icon: "caret-down",
8528
+ size: "small"
8529
+ })))))));
8530
+ };
8531
+
8209
8532
  var StyledContainer$8 = index$a(View)({
8210
8533
  alignItems: 'center',
8211
8534
  flexDirection: 'row'
@@ -13148,16 +13471,16 @@ var StyledChipWrapper = index$a(TouchableOpacity)(function (_ref) {
13148
13471
  var getShadowStyles = function getShadowStyles() {
13149
13472
  switch (themeVariant) {
13150
13473
  case 'compact':
13151
- case 'filled':
13474
+ case 'filter':
13152
13475
  return _objectSpread2({}, theme.__hd__.chip.shadows.filledWrapper);
13153
- case 'outlined':
13476
+ case 'selection':
13154
13477
  case 'compact-outlined':
13155
13478
  return undefined;
13156
13479
  }
13157
13480
  };
13158
13481
  var getBorderStyles = function getBorderStyles() {
13159
13482
  switch (themeVariant) {
13160
- case 'outlined':
13483
+ case 'selection':
13161
13484
  case 'compact-outlined':
13162
13485
  {
13163
13486
  return {
@@ -13166,7 +13489,7 @@ var StyledChipWrapper = index$a(TouchableOpacity)(function (_ref) {
13166
13489
  };
13167
13490
  }
13168
13491
  case 'compact':
13169
- case 'filled':
13492
+ case 'filter':
13170
13493
  {
13171
13494
  return {
13172
13495
  borderColor: theme.__hd__.chip.colors.wrapperSelectedBorder
@@ -13177,14 +13500,14 @@ var StyledChipWrapper = index$a(TouchableOpacity)(function (_ref) {
13177
13500
  var getBackgroundStyles = function getBackgroundStyles() {
13178
13501
  if (themeSelected) {
13179
13502
  switch (themeVariant) {
13180
- case 'outlined':
13503
+ case 'selection':
13181
13504
  case 'compact-outlined':
13182
13505
  {
13183
13506
  return {
13184
13507
  backgroundColor: themeSelected ? theme.__hd__.chip.colors.outlinedSelectedBackground : theme.__hd__.chip.colors.outlinedDefaultBackground
13185
13508
  };
13186
13509
  }
13187
- case 'filled':
13510
+ case 'filter':
13188
13511
  case 'compact':
13189
13512
  {
13190
13513
  return {
@@ -13194,14 +13517,14 @@ var StyledChipWrapper = index$a(TouchableOpacity)(function (_ref) {
13194
13517
  }
13195
13518
  } else {
13196
13519
  switch (themeVariant) {
13197
- case 'outlined':
13520
+ case 'selection':
13198
13521
  case 'compact-outlined':
13199
13522
  {
13200
13523
  return {
13201
13524
  backgroundColor: theme.__hd__.chip.colors.outlinedDefaultBackground
13202
13525
  };
13203
13526
  }
13204
- case 'filled':
13527
+ case 'filter':
13205
13528
  case 'compact':
13206
13529
  {
13207
13530
  return {
@@ -13254,10 +13577,24 @@ var getChipLabel = function getChipLabel(label) {
13254
13577
  }
13255
13578
  return label;
13256
13579
  };
13580
+ var getChipVariant = function getChipVariant() {
13581
+ var variant = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'selection';
13582
+ switch (variant) {
13583
+ case 'selection':
13584
+ case 'filter':
13585
+ case 'compact':
13586
+ case 'compact-outlined':
13587
+ return variant;
13588
+ case 'outlined':
13589
+ return 'selection';
13590
+ case 'filled':
13591
+ return 'filter';
13592
+ }
13593
+ };
13257
13594
  var Chip = function Chip(_ref) {
13258
13595
  var label = _ref.label,
13259
13596
  _ref$variant = _ref.variant,
13260
- variant = _ref$variant === void 0 ? 'outlined' : _ref$variant,
13597
+ variant = _ref$variant === void 0 ? 'selection' : _ref$variant,
13261
13598
  _ref$selected = _ref.selected,
13262
13599
  selected = _ref$selected === void 0 ? false : _ref$selected,
13263
13600
  icon = _ref.icon,
@@ -13265,13 +13602,15 @@ var Chip = function Chip(_ref) {
13265
13602
  _ref$showSelectedIcon = _ref.showSelectedIcon,
13266
13603
  showSelectedIcon = _ref$showSelectedIcon === void 0 ? true : _ref$showSelectedIcon,
13267
13604
  otherProps = _objectWithoutProperties(_ref, _excluded$s);
13268
- var shouldShowSelectedIcon = (variant === 'outlined' || variant === 'compact-outlined') && selected && showSelectedIcon;
13605
+ useDeprecation('Chip variant `outlined` and `filled` are deprecated.', variant === 'outlined' || variant === 'filled');
13606
+ var renamedVariant = getChipVariant(variant);
13607
+ var shouldShowSelectedIcon = (renamedVariant === 'selection' || renamedVariant === 'compact-outlined') && selected && showSelectedIcon;
13269
13608
  var chipLabel = useMemo(function () {
13270
13609
  return getChipLabel(label);
13271
13610
  }, [label]);
13272
13611
  return /*#__PURE__*/React__default.createElement(StyledChipWrapper, _extends$1({
13273
13612
  onPress: onPress,
13274
- themeVariant: variant,
13613
+ themeVariant: renamedVariant,
13275
13614
  themeSelected: selected
13276
13615
  }, otherProps), icon && /*#__PURE__*/React__default.createElement(Box, {
13277
13616
  marginRight: "small"
@@ -16873,7 +17212,7 @@ var Progress = {
16873
17212
  Step: ProgressStep
16874
17213
  };
16875
17214
 
16876
- var Slider = function Slider(_ref) {
17215
+ var Slider$2 = function Slider(_ref) {
16877
17216
  var _ref$minimumValue = _ref.minimumValue,
16878
17217
  minimumValue = _ref$minimumValue === void 0 ? 0 : _ref$minimumValue,
16879
17218
  _ref$maximumValue = _ref.maximumValue,
@@ -16907,6 +17246,134 @@ var Slider = function Slider(_ref) {
16907
17246
  });
16908
17247
  };
16909
17248
 
17249
+ var StyledMarker = index$a(View)(function (_ref) {
17250
+ var themeDisabled = _ref.themeDisabled,
17251
+ theme = _ref.theme;
17252
+ return _objectSpread2({
17253
+ height: theme.__hd__.slider.sizes.markerHeight,
17254
+ width: theme.__hd__.slider.sizes.markerWidth,
17255
+ borderRadius: theme.__hd__.slider.radii.marker,
17256
+ backgroundColor: themeDisabled ? theme.__hd__.slider.colors.disabledThumbTint : theme.__hd__.slider.colors.thumbTint
17257
+ }, theme.__hd__.slider.shadows.marker);
17258
+ });
17259
+
17260
+ var Slider$1 = function Slider(_ref) {
17261
+ var minimumValue = _ref.minimumValue,
17262
+ maximumValue = _ref.maximumValue,
17263
+ _ref$step = _ref.step,
17264
+ step = _ref$step === void 0 ? 1 : _ref$step,
17265
+ value = _ref.value,
17266
+ onValueChange = _ref.onValueChange,
17267
+ onSlidingStart = _ref.onSlidingStart,
17268
+ onSlidingComplete = _ref.onSlidingComplete,
17269
+ _ref$disabled = _ref.disabled,
17270
+ disabled = _ref$disabled === void 0 ? false : _ref$disabled,
17271
+ style = _ref.style,
17272
+ testID = _ref.testID,
17273
+ _ref$allowOverlap = _ref.allowOverlap,
17274
+ allowOverlap = _ref$allowOverlap === void 0 ? false : _ref$allowOverlap;
17275
+ var theme = useTheme();
17276
+ var handleTwoWaySliderChange = React__default.useCallback(function (values) {
17277
+ if (onValueChange) {
17278
+ onValueChange({
17279
+ start: values[0],
17280
+ end: values[1]
17281
+ });
17282
+ }
17283
+ }, [onValueChange]);
17284
+ var _useState = useState({
17285
+ width: 0,
17286
+ height: 0
17287
+ }),
17288
+ _useState2 = _slicedToArray(_useState, 2),
17289
+ layoutSize = _useState2[0],
17290
+ setLayoutSize = _useState2[1];
17291
+ var nativeValue = useMemo(function () {
17292
+ var _value$start, _value$end;
17293
+ return [(_value$start = value === null || value === void 0 ? void 0 : value.start) !== null && _value$start !== void 0 ? _value$start : minimumValue, (_value$end = value === null || value === void 0 ? void 0 : value.end) !== null && _value$end !== void 0 ? _value$end : maximumValue];
17294
+ }, [value === null || value === void 0 ? void 0 : value.start, value === null || value === void 0 ? void 0 : value.end, minimumValue, maximumValue]);
17295
+ var _theme$__hd__$slider$ = theme.__hd__.slider.colors,
17296
+ trackBackground = _theme$__hd__$slider$.trackBackground,
17297
+ disabledTrackBackground = _theme$__hd__$slider$.disabledTrackBackground,
17298
+ thumbTint = _theme$__hd__$slider$.thumbTint,
17299
+ disabledThumbTint = _theme$__hd__$slider$.disabledThumbTint;
17300
+ var trackHeight = theme.__hd__.slider.sizes.trackHeight;
17301
+ // Define styles for disabled and enabled states
17302
+ var disabledStyles = {
17303
+ track: {
17304
+ backgroundColor: disabledTrackBackground,
17305
+ height: trackHeight
17306
+ },
17307
+ selected: {
17308
+ backgroundColor: disabledThumbTint
17309
+ }
17310
+ };
17311
+ var enabledStyles = {
17312
+ track: {
17313
+ backgroundColor: trackBackground,
17314
+ height: trackHeight
17315
+ },
17316
+ selected: {
17317
+ backgroundColor: thumbTint
17318
+ }
17319
+ };
17320
+ // Use styles based on the `disabled` state
17321
+ var trackStyle = disabled ? disabledStyles.track : enabledStyles.track;
17322
+ var selectedStyle = disabled ? disabledStyles.selected : enabledStyles.selected;
17323
+ var handleOnValueChangeStart = useCallback(function () {
17324
+ if (onSlidingStart) {
17325
+ onSlidingStart();
17326
+ }
17327
+ }, [onSlidingStart]);
17328
+ var handleOnValueChangeFinish = useCallback(function (values) {
17329
+ if (onSlidingComplete) {
17330
+ onSlidingComplete({
17331
+ start: values[0],
17332
+ end: values[1]
17333
+ });
17334
+ }
17335
+ }, [onSlidingComplete]);
17336
+ var onLayoutCallback = useCallback(function (event) {
17337
+ setLayoutSize({
17338
+ width: event.nativeEvent.layout.width,
17339
+ height: event.nativeEvent.layout.height
17340
+ });
17341
+ }, []);
17342
+ var CustomMarker = useMemo(function () {
17343
+ return function () {
17344
+ return /*#__PURE__*/React__default.createElement(StyledMarker, {
17345
+ themeDisabled: disabled
17346
+ });
17347
+ };
17348
+ }, [disabled]);
17349
+ return /*#__PURE__*/React__default.createElement(View, {
17350
+ onLayout: onLayoutCallback,
17351
+ style: style,
17352
+ testID: testID,
17353
+ accessibilityState: {
17354
+ disabled: disabled
17355
+ }
17356
+ }, /*#__PURE__*/React__default.createElement(MultiSlider, {
17357
+ values: nativeValue,
17358
+ onValuesChange: handleTwoWaySliderChange,
17359
+ onValuesChangeStart: handleOnValueChangeStart,
17360
+ onValuesChangeFinish: handleOnValueChangeFinish,
17361
+ sliderLength: layoutSize.width,
17362
+ min: minimumValue,
17363
+ max: maximumValue,
17364
+ step: step,
17365
+ enabledOne: !disabled,
17366
+ enabledTwo: !disabled,
17367
+ allowOverlap: allowOverlap,
17368
+ trackStyle: trackStyle,
17369
+ selectedStyle: selectedStyle,
17370
+ customMarker: CustomMarker
17371
+ }));
17372
+ };
17373
+
17374
+ var Slider = Slider$2;
17375
+ Slider.Range = Slider$1;
17376
+
16910
17377
  var StyledView$1 = index$a(View)();
16911
17378
  var StyledSpinnerContainer = index$a(View)({
16912
17379
  height: '100%',
@@ -18382,7 +18849,8 @@ var HeaderTabWrapper$1 = index$a(View)(function (_ref) {
18382
18849
  return {
18383
18850
  paddingHorizontal: Math.max(themeInsets.left, themeInsets.right),
18384
18851
  borderBottomColor: theme.__hd__.tabs.colors.headerBottom,
18385
- borderBottomWidth: theme.__hd__.tabs.borderWidths.headerBottom
18852
+ borderBottomWidth: theme.__hd__.tabs.borderWidths.headerBottom,
18853
+ backgroundColor: theme.__hd__.tabs.colors.headerBackground
18386
18854
  };
18387
18855
  });
18388
18856
  var HeaderTab = index$a(View)({
@@ -18444,9 +18912,11 @@ var TabContainer = index$a(View)({
18444
18912
  overflow: 'hidden'
18445
18913
  });
18446
18914
  var HeaderTabWrapper = index$a(View)(function (_ref) {
18447
- var themeInsets = _ref.themeInsets;
18915
+ var themeInsets = _ref.themeInsets,
18916
+ theme = _ref.theme;
18448
18917
  return {
18449
- paddingHorizontal: Math.max(themeInsets.left, themeInsets.right)
18918
+ paddingHorizontal: Math.max(themeInsets.left, themeInsets.right),
18919
+ backgroundColor: theme.__hd__.tabs.colors.headerBackground
18450
18920
  };
18451
18921
  });
18452
18922
  var HeaderTabItem = index$a(Animated.View)(function (_ref2) {
@@ -37428,4 +37898,4 @@ var FloatingIsland = function FloatingIsland(_ref2) {
37428
37898
  }));
37429
37899
  };
37430
37900
 
37431
- export { Accordion, Alert, Attachment, index$9 as Avatar, Badge$1 as Badge, BottomNavigation, BottomSheet$1 as BottomSheet, Box, CompoundButton as Button, Calendar, Card$1 as Card, index$8 as Carousel, Checkbox, Chip, Collapse, ContentNavigator, DatePicker, Divider, index$7 as Drawer, Empty, ErrorComponent as Error, FAB, FlatListWithFAB, FloatingIsland, HeroDesignProvider, Icon, Image, List, index$6 as MapPin, PageControl, PinInput, Portal$1 as Portal, Progress, CompoundRadio as Radio, Rate, RefreshControl, index as RichTextEditor, ScrollViewWithFAB, Search, SectionHeading, SectionListWithFAB, index$4 as Select, Skeleton, Slider, Spinner, Success, index$5 as Swipeable, index$3 as Switch, index$2 as Tabs, Tag, TextInput, ThemeProvider, ThemeSwitcher, TimePicker, Toast, index$1 as Toolbar, Typography, eBensSystemPalette, getTheme$1 as getTheme, jobsSystemPalette, scale, swagDarkSystemPalette, swagLightJobsSystemPalette, swagSystemPalette as swagLightSystemPalette, swagSystemPalette$1 as swagSystemPalette, defaultTheme as theme, useAvatarColors, useTheme, walletSystemPalette, withTheme, workSystemPalette };
37901
+ export { Accordion, Alert, AppCue, Attachment, index$9 as Avatar, Badge$1 as Badge, BottomNavigation, BottomSheet$1 as BottomSheet, Box, CompoundButton as Button, Calendar, Card$1 as Card, index$8 as Carousel, Checkbox, Chip, Collapse, ContentNavigator, DatePicker, Divider, index$7 as Drawer, Empty, ErrorComponent as Error, FAB, FlatListWithFAB, FloatingIsland, HeroDesignProvider, Icon, Image, List, index$6 as MapPin, PageControl, PinInput, Portal$1 as Portal, Progress, CompoundRadio as Radio, Rate, RefreshControl, index as RichTextEditor, ScrollViewWithFAB, Search, SectionHeading, SectionListWithFAB, index$4 as Select, Skeleton, Slider, Spinner, Success, index$5 as Swipeable, index$3 as Switch, index$2 as Tabs, Tag, TextInput, ThemeProvider, ThemeSwitcher, TimePicker, Toast, index$1 as Toolbar, Typography, eBensSystemPalette, getTheme$1 as getTheme, jobsSystemPalette, scale, swagDarkSystemPalette, swagLightJobsSystemPalette, swagSystemPalette as swagLightSystemPalette, swagSystemPalette$1 as swagSystemPalette, defaultTheme as theme, useAvatarColors, useTheme, walletSystemPalette, withTheme, workSystemPalette };