@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.
@@ -7,7 +7,7 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
7
7
  import _objectDestructuringEmpty from '@babel/runtime/helpers/objectDestructuringEmpty';
8
8
  import _extends from '@babel/runtime/helpers/extends';
9
9
  import Animated, { useSharedValue, useAnimatedStyle, interpolateColor, withSpring, withTiming, Easing as Easing$1, runOnJS, useDerivedValue, useAnimatedProps, withDelay, withRepeat, interpolate, ReducedMotionConfig, ReduceMotion } from 'react-native-reanimated';
10
- import { Platform, Animated as Animated$1, Easing, StyleSheet, Modal, ScrollView as ScrollView$2, View as View$2, Linking, Pressable as Pressable$2, Keyboard, Text as Text$1, useWindowDimensions, PixelRatio } from 'react-native';
10
+ import { Platform, Animated as Animated$1, Easing, StyleSheet, Modal, Linking, Pressable as Pressable$2, Keyboard, Text as Text$1, useWindowDimensions, ScrollView as ScrollView$2, PixelRatio } from 'react-native';
11
11
  export { useWindowDimensions as useWindowSize } from 'react-native';
12
12
  import { SpinnerGapRegularIcon, UserRegularIcon, XRegularIcon, ArrowLeftRegularIcon, CaretUpFillIcon, CaretDownFillIcon, MapPinRegularIcon, EyeClosedRegularIcon, EyeRegularIcon, CheckCircleFillIcon, CaretDownRegularIcon, CaretRightRegularIcon, InfoRegularIcon, WarningRegularIcon, CheckRegularIcon, WarningCircleRegularIcon, ArrowCounterClockwiseRegularIcon, InfoFillIcon, WarningCircleFillIcon, WarningFillIcon } from '@ornikar/kitt-icons/phosphor';
13
13
  import { BottomSheetView, BottomSheetScrollView, BottomSheetSectionList, BottomSheetFlatList, BottomSheetHandle, BottomSheetBackdrop, BottomSheetFooter, BottomSheetTextInput, BottomSheetModal, useBottomSheetModal } from '@gorhom/bottom-sheet';
@@ -4807,6 +4807,7 @@ function AnimatedChoiceItemView({
4807
4807
  isDisabled,
4808
4808
  isSelected,
4809
4809
  hasError,
4810
+ shouldExpand = false,
4810
4811
  animatedStyles
4811
4812
  }) {
4812
4813
  const sx = useSx();
@@ -4825,7 +4826,9 @@ function AnimatedChoiceItemView({
4825
4826
  isHovered,
4826
4827
  isPressed
4827
4828
  }),
4828
- padding: size === 'small' ? 'kitt.2' : 'kitt.4'
4829
+ padding: size === 'small' ? 'kitt.2' : 'kitt.4',
4830
+ flexGrow: shouldExpand ? 1 : undefined,
4831
+ flexShrink: shouldExpand ? 1 : undefined
4829
4832
  });
4830
4833
  return /*#__PURE__*/jsx(Animated.View, {
4831
4834
  style: [style, animatedStyles],
@@ -4889,6 +4892,7 @@ function ChoiceItem({
4889
4892
  value,
4890
4893
  selected,
4891
4894
  disabled,
4895
+ shouldExpand = false,
4892
4896
  children,
4893
4897
  isPressedInternal,
4894
4898
  isHoveredInternal,
@@ -4928,6 +4932,8 @@ function ChoiceItem({
4928
4932
  checked: selected
4929
4933
  },
4930
4934
  style: style,
4935
+ flexGrow: shouldExpand ? 1 : undefined,
4936
+ flexShrink: shouldExpand ? 1 : undefined,
4931
4937
  onBlur: onBlur,
4932
4938
  onFocus: onFocus,
4933
4939
  onPress: e => {
@@ -4947,6 +4953,8 @@ function ChoiceItem({
4947
4953
  });
4948
4954
  return /*#__PURE__*/jsxs(VStack, {
4949
4955
  space: "kitt.2",
4956
+ flexGrow: shouldExpand ? 1 : undefined,
4957
+ flexShrink: shouldExpand ? 1 : undefined,
4950
4958
  children: [/*#__PURE__*/jsxs(AnimatedChoiceItemView, {
4951
4959
  animatedStyles: backgroundStyles,
4952
4960
  isHovered: isHovered || isHoveredInternal,
@@ -4954,10 +4962,13 @@ function ChoiceItem({
4954
4962
  isSelected: selected,
4955
4963
  isPressed: isPressed || isPressedInternal,
4956
4964
  hasError: hasError,
4965
+ shouldExpand: shouldExpand,
4957
4966
  size: size,
4958
4967
  children: [/*#__PURE__*/jsxs(Stack, {
4959
4968
  alignItems: "center",
4960
4969
  space: "kitt.2",
4970
+ flexGrow: shouldExpand ? 1 : undefined,
4971
+ flexShrink: shouldExpand ? 1 : undefined,
4961
4972
  children: [icon ? /*#__PURE__*/jsx(TypographyIcon, {
4962
4973
  color: textColor,
4963
4974
  icon: icon
@@ -4986,36 +4997,46 @@ function ChoiceItem({
4986
4997
  function ChoiceItemContainer({
4987
4998
  children,
4988
4999
  direction,
5000
+ shouldExpand,
4989
5001
  isLast
4990
5002
  }) {
4991
5003
  const currentItemMarginValue = isLast ? undefined : 'kitt.3';
4992
- const flexProps = direction === 'row' ? {
5004
+ const directionFlexProps = direction === 'row' ? {
4993
5005
  flexGrow: 1,
4994
5006
  flexShrink: 1,
4995
5007
  flexBasis: 0
4996
5008
  } : {};
4997
- return /*#__PURE__*/jsx(View, _objectSpread(_objectSpread({
5009
+ const shouldExpandFlexProps = shouldExpand ? {
5010
+ flexGrow: 1,
5011
+ flexShrink: 1
5012
+ } : {};
5013
+ return /*#__PURE__*/jsx(View, _objectSpread(_objectSpread(_objectSpread({
4998
5014
  marginRight: direction === 'row' ? currentItemMarginValue : undefined,
4999
5015
  marginBottom: direction === 'column' ? currentItemMarginValue : undefined
5000
- }, flexProps), {}, {
5016
+ }, directionFlexProps), shouldExpandFlexProps), {}, {
5001
5017
  children: children
5002
5018
  }));
5003
5019
  }
5004
5020
 
5005
- const _excluded$G = ["direction", "contentContainerStyle"];
5021
+ const _excluded$G = ["direction", "shouldExpand", "contentContainerStyle"];
5006
5022
  function ChoicesContainer(_ref) {
5007
5023
  let {
5008
5024
  direction,
5025
+ shouldExpand,
5009
5026
  contentContainerStyle
5010
5027
  } = _ref,
5011
5028
  props = _objectWithoutProperties(_ref, _excluded$G);
5029
+ const shouldExpandFlexProps = shouldExpand ? {
5030
+ flexGrow: 1,
5031
+ flexShrink: 1
5032
+ } : {};
5012
5033
  if (direction === 'row') {
5013
- return /*#__PURE__*/jsx(ScrollView$2, _objectSpread({
5034
+ return /*#__PURE__*/jsx(ScrollView, _objectSpread(_objectSpread({
5014
5035
  horizontal: true,
5015
- contentContainerStyle: contentContainerStyle
5016
- }, props));
5036
+ contentContainerStyle: shouldExpand ? shouldExpandFlexProps : contentContainerStyle
5037
+ }, props), shouldExpandFlexProps));
5017
5038
  }
5018
- return /*#__PURE__*/jsx(View$2, _objectSpread({}, props));
5039
+ return /*#__PURE__*/jsx(View, _objectSpread(_objectSpread({}, props), shouldExpandFlexProps));
5019
5040
  }
5020
5041
 
5021
5042
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -5026,6 +5047,7 @@ function Choices({
5026
5047
  type,
5027
5048
  direction = 'column',
5028
5049
  disabled,
5050
+ shouldExpand = false,
5029
5051
  children,
5030
5052
  value,
5031
5053
  onPress,
@@ -5042,6 +5064,7 @@ function Choices({
5042
5064
  const sharedProps = {
5043
5065
  type,
5044
5066
  disabled,
5067
+ shouldExpand,
5045
5068
  onPress: !isForm ? onPress : undefined,
5046
5069
  onChange: isForm ? newValue => {
5047
5070
  setCurrentValue(newValue);
@@ -5053,6 +5076,7 @@ function Choices({
5053
5076
  };
5054
5077
  return /*#__PURE__*/jsx(ChoicesContainer, {
5055
5078
  direction: direction,
5079
+ shouldExpand: shouldExpand,
5056
5080
  testID: testID,
5057
5081
  id: id,
5058
5082
  style: style,
@@ -5063,6 +5087,7 @@ function Choices({
5063
5087
  }, sharedProps));
5064
5088
  return /*#__PURE__*/jsx(ChoiceItemContainer, {
5065
5089
  direction: direction,
5090
+ shouldExpand: shouldExpand,
5066
5091
  isLast: index === childrenArray.length - 1,
5067
5092
  children: element
5068
5093
  }, child.key);