@ornikar/kitt-universal 32.1.1-canary.28d1f9f68cb643b8c67559f72df59006a88da1e9.0 → 32.2.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/dist/index.es.js CHANGED
@@ -8,7 +8,7 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
8
8
  import _objectDestructuringEmpty from '@babel/runtime/helpers/objectDestructuringEmpty';
9
9
  import _extends from '@babel/runtime/helpers/extends';
10
10
  import Animated, { useSharedValue, useAnimatedStyle, interpolateColor, withSpring, withTiming, Easing as Easing$1, runOnJS, useDerivedValue, useAnimatedProps, withDelay, withRepeat, interpolate, ReducedMotionConfig, ReduceMotion } from 'react-native-reanimated';
11
- 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
+ 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';
12
12
  export { useWindowDimensions as useWindowSize } from 'react-native';
13
13
  import _typeof from '@babel/runtime/helpers/typeof';
14
14
  import _regeneratorRuntime from '@babel/runtime/helpers/regeneratorRuntime';
@@ -4861,8 +4861,6 @@ function AnimatedChoiceItemView(_ref) {
4861
4861
  isDisabled = _ref.isDisabled,
4862
4862
  isSelected = _ref.isSelected,
4863
4863
  hasError = _ref.hasError,
4864
- _ref$shouldExpand = _ref.shouldExpand,
4865
- shouldExpand = _ref$shouldExpand === void 0 ? false : _ref$shouldExpand,
4866
4864
  animatedStyles = _ref.animatedStyles;
4867
4865
  var sx = useSx();
4868
4866
  var style = sx({
@@ -4880,9 +4878,7 @@ function AnimatedChoiceItemView(_ref) {
4880
4878
  isHovered: isHovered,
4881
4879
  isPressed: isPressed
4882
4880
  }),
4883
- padding: size === 'small' ? 'kitt.2' : 'kitt.4',
4884
- flexGrow: shouldExpand ? 1 : undefined,
4885
- flexShrink: shouldExpand ? 1 : undefined
4881
+ padding: size === 'small' ? 'kitt.2' : 'kitt.4'
4886
4882
  });
4887
4883
  return /*#__PURE__*/jsx(Animated.View, {
4888
4884
  style: [style, animatedStyles],
@@ -4945,8 +4941,6 @@ function ChoiceItem(_ref) {
4945
4941
  value = _ref.value,
4946
4942
  selected = _ref.selected,
4947
4943
  disabled = _ref.disabled,
4948
- _ref$shouldExpand = _ref.shouldExpand,
4949
- shouldExpand = _ref$shouldExpand === void 0 ? false : _ref$shouldExpand,
4950
4944
  _children = _ref.children,
4951
4945
  isPressedInternal = _ref.isPressedInternal,
4952
4946
  isHoveredInternal = _ref.isHoveredInternal,
@@ -4984,8 +4978,6 @@ function ChoiceItem(_ref) {
4984
4978
  checked: selected
4985
4979
  },
4986
4980
  style: style,
4987
- flexGrow: shouldExpand ? 1 : undefined,
4988
- flexShrink: shouldExpand ? 1 : undefined,
4989
4981
  onBlur: onBlur,
4990
4982
  onFocus: onFocus,
4991
4983
  onPress: function (e) {
@@ -5004,8 +4996,6 @@ function ChoiceItem(_ref) {
5004
4996
  });
5005
4997
  return /*#__PURE__*/jsxs(VStack, {
5006
4998
  space: "kitt.2",
5007
- flexGrow: shouldExpand ? 1 : undefined,
5008
- flexShrink: shouldExpand ? 1 : undefined,
5009
4999
  children: [/*#__PURE__*/jsxs(AnimatedChoiceItemView, {
5010
5000
  animatedStyles: backgroundStyles,
5011
5001
  isHovered: isHovered || isHoveredInternal,
@@ -5013,13 +5003,10 @@ function ChoiceItem(_ref) {
5013
5003
  isSelected: selected,
5014
5004
  isPressed: isPressed || isPressedInternal,
5015
5005
  hasError: hasError,
5016
- shouldExpand: shouldExpand,
5017
5006
  size: size,
5018
5007
  children: [/*#__PURE__*/jsxs(Stack, {
5019
5008
  alignItems: "center",
5020
5009
  space: "kitt.2",
5021
- flexGrow: shouldExpand ? 1 : undefined,
5022
- flexShrink: shouldExpand ? 1 : undefined,
5023
5010
  children: [icon ? /*#__PURE__*/jsx(TypographyIcon, {
5024
5011
  color: textColor,
5025
5012
  icon: icon
@@ -5048,43 +5035,33 @@ function ChoiceItem(_ref) {
5048
5035
  function ChoiceItemContainer(_ref) {
5049
5036
  var children = _ref.children,
5050
5037
  direction = _ref.direction,
5051
- shouldExpand = _ref.shouldExpand,
5052
5038
  isLast = _ref.isLast;
5053
5039
  var currentItemMarginValue = isLast ? undefined : 'kitt.3';
5054
- var directionFlexProps = direction === 'row' ? {
5040
+ var flexProps = direction === 'row' ? {
5055
5041
  flexGrow: 1,
5056
5042
  flexShrink: 1,
5057
5043
  flexBasis: 0
5058
5044
  } : {};
5059
- var shouldExpandFlexProps = shouldExpand ? {
5060
- flexGrow: 1,
5061
- flexShrink: 1
5062
- } : {};
5063
- return /*#__PURE__*/jsx(View, _objectSpread(_objectSpread(_objectSpread({
5045
+ return /*#__PURE__*/jsx(View, _objectSpread(_objectSpread({
5064
5046
  marginRight: direction === 'row' ? currentItemMarginValue : undefined,
5065
5047
  marginBottom: direction === 'column' ? currentItemMarginValue : undefined
5066
- }, directionFlexProps), shouldExpandFlexProps), {}, {
5048
+ }, flexProps), {}, {
5067
5049
  children: children
5068
5050
  }));
5069
5051
  }
5070
5052
 
5071
- var _excluded$G = ["direction", "shouldExpand", "contentContainerStyle"];
5053
+ var _excluded$G = ["direction", "contentContainerStyle"];
5072
5054
  function ChoicesContainer(_ref) {
5073
5055
  var direction = _ref.direction,
5074
- shouldExpand = _ref.shouldExpand,
5075
5056
  contentContainerStyle = _ref.contentContainerStyle,
5076
5057
  props = _objectWithoutProperties(_ref, _excluded$G);
5077
- var shouldExpandFlexProps = shouldExpand ? {
5078
- flexGrow: 1,
5079
- flexShrink: 1
5080
- } : {};
5081
5058
  if (direction === 'row') {
5082
- return /*#__PURE__*/jsx(ScrollView, _objectSpread(_objectSpread({
5059
+ return /*#__PURE__*/jsx(ScrollView$2, _objectSpread({
5083
5060
  horizontal: true,
5084
- contentContainerStyle: shouldExpand ? shouldExpandFlexProps : contentContainerStyle
5085
- }, props), shouldExpandFlexProps));
5061
+ contentContainerStyle: contentContainerStyle
5062
+ }, props));
5086
5063
  }
5087
- return /*#__PURE__*/jsx(View, _objectSpread(_objectSpread({}, props), shouldExpandFlexProps));
5064
+ return /*#__PURE__*/jsx(View$2, _objectSpread({}, props));
5088
5065
  }
5089
5066
 
5090
5067
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -5096,8 +5073,6 @@ function Choices(_ref2) {
5096
5073
  _ref2$direction = _ref2.direction,
5097
5074
  direction = _ref2$direction === void 0 ? 'column' : _ref2$direction,
5098
5075
  disabled = _ref2.disabled,
5099
- _ref2$shouldExpand = _ref2.shouldExpand,
5100
- shouldExpand = _ref2$shouldExpand === void 0 ? false : _ref2$shouldExpand,
5101
5076
  children = _ref2.children,
5102
5077
  value = _ref2.value,
5103
5078
  onPress = _ref2.onPress,
@@ -5116,7 +5091,6 @@ function Choices(_ref2) {
5116
5091
  var sharedProps = {
5117
5092
  type: type,
5118
5093
  disabled: disabled,
5119
- shouldExpand: shouldExpand,
5120
5094
  onPress: !isForm ? onPress : undefined,
5121
5095
  onChange: isForm ? function (newValue) {
5122
5096
  setCurrentValue(newValue);
@@ -5128,7 +5102,6 @@ function Choices(_ref2) {
5128
5102
  };
5129
5103
  return /*#__PURE__*/jsx(ChoicesContainer, {
5130
5104
  direction: direction,
5131
- shouldExpand: shouldExpand,
5132
5105
  testID: testID,
5133
5106
  id: id,
5134
5107
  style: style,
@@ -5139,7 +5112,6 @@ function Choices(_ref2) {
5139
5112
  }, sharedProps));
5140
5113
  return /*#__PURE__*/jsx(ChoiceItemContainer, {
5141
5114
  direction: direction,
5142
- shouldExpand: shouldExpand,
5143
5115
  isLast: index === childrenArray.length - 1,
5144
5116
  children: element
5145
5117
  }, child.key);