@ornikar/kitt-universal 32.3.0 → 32.3.1-canary.e5e3462569f2f32f91e8d06437eb0642c84cb55f.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.
@@ -4834,6 +4834,7 @@ function AnimatedChoiceItemView({
4834
4834
  isDisabled,
4835
4835
  isSelected,
4836
4836
  hasError,
4837
+ shouldExpand = false,
4837
4838
  animatedStyles
4838
4839
  }) {
4839
4840
  const sx = nativeBase.useSx();
@@ -4852,7 +4853,9 @@ function AnimatedChoiceItemView({
4852
4853
  isHovered,
4853
4854
  isPressed
4854
4855
  }),
4855
- padding: size === 'small' ? 'kitt.2' : 'kitt.4'
4856
+ padding: size === 'small' ? 'kitt.2' : 'kitt.4',
4857
+ flexGrow: shouldExpand ? 1 : undefined,
4858
+ flexShrink: shouldExpand ? 1 : undefined
4856
4859
  });
4857
4860
  return /*#__PURE__*/jsxRuntime.jsx(Animated__default.View, {
4858
4861
  style: [style, animatedStyles],
@@ -4916,6 +4919,7 @@ function ChoiceItem({
4916
4919
  value,
4917
4920
  selected,
4918
4921
  disabled,
4922
+ shouldExpand = false,
4919
4923
  children,
4920
4924
  isPressedInternal,
4921
4925
  isHoveredInternal,
@@ -4955,6 +4959,8 @@ function ChoiceItem({
4955
4959
  checked: selected
4956
4960
  },
4957
4961
  style: style,
4962
+ flexGrow: shouldExpand ? 1 : undefined,
4963
+ flexShrink: shouldExpand ? 1 : undefined,
4958
4964
  onBlur: onBlur,
4959
4965
  onFocus: onFocus,
4960
4966
  onPress: e => {
@@ -4974,6 +4980,8 @@ function ChoiceItem({
4974
4980
  });
4975
4981
  return /*#__PURE__*/jsxRuntime.jsxs(VStack, {
4976
4982
  space: "kitt.2",
4983
+ flexGrow: shouldExpand ? 1 : undefined,
4984
+ flexShrink: shouldExpand ? 1 : undefined,
4977
4985
  children: [/*#__PURE__*/jsxRuntime.jsxs(AnimatedChoiceItemView, {
4978
4986
  animatedStyles: backgroundStyles,
4979
4987
  isHovered: isHovered || isHoveredInternal,
@@ -4981,10 +4989,13 @@ function ChoiceItem({
4981
4989
  isSelected: selected,
4982
4990
  isPressed: isPressed || isPressedInternal,
4983
4991
  hasError: hasError,
4992
+ shouldExpand: shouldExpand,
4984
4993
  size: size,
4985
4994
  children: [/*#__PURE__*/jsxRuntime.jsxs(Stack, {
4986
4995
  alignItems: "center",
4987
4996
  space: "kitt.2",
4997
+ flexGrow: shouldExpand ? 1 : undefined,
4998
+ flexShrink: shouldExpand ? 1 : undefined,
4988
4999
  children: [icon ? /*#__PURE__*/jsxRuntime.jsx(TypographyIcon, {
4989
5000
  color: textColor,
4990
5001
  icon: icon
@@ -5013,36 +5024,49 @@ function ChoiceItem({
5013
5024
  function ChoiceItemContainer({
5014
5025
  children,
5015
5026
  direction,
5027
+ shouldExpand,
5016
5028
  isLast
5017
5029
  }) {
5018
5030
  const currentItemMarginValue = isLast ? undefined : 'kitt.3';
5019
- const flexProps = direction === 'row' ? {
5031
+ const directionFlexProps = direction === 'row' ? {
5020
5032
  flexGrow: 1,
5021
5033
  flexShrink: 1,
5022
5034
  flexBasis: 0
5023
5035
  } : {};
5036
+ const shouldExpandFlexProps = shouldExpand ? {
5037
+ flexGrow: 1,
5038
+ flexShrink: 1
5039
+ } : {};
5024
5040
  return /*#__PURE__*/jsxRuntime.jsx(View, {
5025
5041
  marginRight: direction === 'row' ? currentItemMarginValue : undefined,
5026
5042
  marginBottom: direction === 'column' ? currentItemMarginValue : undefined,
5027
- ...flexProps,
5043
+ ...directionFlexProps,
5044
+ ...shouldExpandFlexProps,
5028
5045
  children: children
5029
5046
  });
5030
5047
  }
5031
5048
 
5032
5049
  function ChoicesContainer({
5033
5050
  direction,
5051
+ shouldExpand,
5034
5052
  contentContainerStyle,
5035
5053
  ...props
5036
5054
  }) {
5055
+ const shouldExpandFlexProps = shouldExpand ? {
5056
+ flexGrow: 1,
5057
+ flexShrink: 1
5058
+ } : {};
5037
5059
  if (direction === 'row') {
5038
- return /*#__PURE__*/jsxRuntime.jsx(reactNative.ScrollView, {
5060
+ return /*#__PURE__*/jsxRuntime.jsx(ScrollView, {
5039
5061
  horizontal: true,
5040
- contentContainerStyle: contentContainerStyle,
5041
- ...props
5062
+ contentContainerStyle: shouldExpand ? shouldExpandFlexProps : contentContainerStyle,
5063
+ ...props,
5064
+ ...shouldExpandFlexProps
5042
5065
  });
5043
5066
  }
5044
- return /*#__PURE__*/jsxRuntime.jsx(reactNative.View, {
5045
- ...props
5067
+ return /*#__PURE__*/jsxRuntime.jsx(View, {
5068
+ ...props,
5069
+ ...shouldExpandFlexProps
5046
5070
  });
5047
5071
  }
5048
5072
 
@@ -5054,6 +5078,7 @@ function Choices({
5054
5078
  type,
5055
5079
  direction = 'column',
5056
5080
  disabled,
5081
+ shouldExpand = false,
5057
5082
  children,
5058
5083
  value,
5059
5084
  onPress,
@@ -5070,6 +5095,7 @@ function Choices({
5070
5095
  const sharedProps = {
5071
5096
  type,
5072
5097
  disabled,
5098
+ shouldExpand,
5073
5099
  onPress: !isForm ? onPress : undefined,
5074
5100
  onChange: isForm ? newValue => {
5075
5101
  setCurrentValue(newValue);
@@ -5081,6 +5107,7 @@ function Choices({
5081
5107
  };
5082
5108
  return /*#__PURE__*/jsxRuntime.jsx(ChoicesContainer, {
5083
5109
  direction: direction,
5110
+ shouldExpand: shouldExpand,
5084
5111
  testID: testID,
5085
5112
  id: id,
5086
5113
  style: style,
@@ -5092,6 +5119,7 @@ function Choices({
5092
5119
  });
5093
5120
  return /*#__PURE__*/jsxRuntime.jsx(ChoiceItemContainer, {
5094
5121
  direction: direction,
5122
+ shouldExpand: shouldExpand,
5095
5123
  isLast: index === childrenArray.length - 1,
5096
5124
  children: element
5097
5125
  }, child.key);