@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.
@@ -3,7 +3,7 @@ import { View as View$1, ScrollView as ScrollView$1, Pressable as Pressable$1, I
3
3
  export { useClipboard, useContrastText, useMediaQuery, useSx, useToken } from 'native-base';
4
4
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
5
5
  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';
6
- import { Animated, Easing, ScrollView as ScrollView$2, View as View$2, StyleSheet, Modal, Linking, Pressable as Pressable$2, useWindowDimensions } from 'react-native';
6
+ import { Animated, Easing, StyleSheet, Modal, Linking, Pressable as Pressable$2, useWindowDimensions } from 'react-native';
7
7
  export { useWindowDimensions as useWindowSize } from 'react-native';
8
8
  import { createPortal } from 'react-dom';
9
9
  import { CSSTransition } from 'react-transition-group';
@@ -4697,7 +4697,8 @@ function AnimatedChoiceItemView({
4697
4697
  isPressed,
4698
4698
  isDisabled,
4699
4699
  isSelected,
4700
- hasError
4700
+ hasError,
4701
+ shouldExpand = false
4701
4702
  }) {
4702
4703
  const theme = useTheme();
4703
4704
  return /*#__PURE__*/jsx(View, {
@@ -4716,6 +4717,8 @@ function AnimatedChoiceItemView({
4716
4717
  isPressed
4717
4718
  }),
4718
4719
  padding: size === 'small' ? 'kitt.2' : 'kitt.4',
4720
+ flexGrow: shouldExpand ? 1 : undefined,
4721
+ flexShrink: shouldExpand ? 1 : undefined,
4719
4722
  _web: {
4720
4723
  style: {
4721
4724
  transitionProperty: theme.kitt.choices.item.transition.property,
@@ -4751,6 +4754,7 @@ function ChoiceItem({
4751
4754
  value,
4752
4755
  selected,
4753
4756
  disabled,
4757
+ shouldExpand = false,
4754
4758
  children,
4755
4759
  isPressedInternal,
4756
4760
  isHoveredInternal,
@@ -4786,6 +4790,8 @@ function ChoiceItem({
4786
4790
  checked: selected
4787
4791
  },
4788
4792
  style: style,
4793
+ flexGrow: shouldExpand ? 1 : undefined,
4794
+ flexShrink: shouldExpand ? 1 : undefined,
4789
4795
  onBlur: onBlur,
4790
4796
  onFocus: onFocus,
4791
4797
  onPress: e => {
@@ -4805,6 +4811,8 @@ function ChoiceItem({
4805
4811
  });
4806
4812
  return /*#__PURE__*/jsxs(VStack, {
4807
4813
  space: "kitt.2",
4814
+ flexGrow: shouldExpand ? 1 : undefined,
4815
+ flexShrink: shouldExpand ? 1 : undefined,
4808
4816
  children: [/*#__PURE__*/jsxs(AnimatedChoiceItemView, {
4809
4817
  animatedStyles: backgroundStyles,
4810
4818
  isHovered: isHovered || isHoveredInternal,
@@ -4812,10 +4820,13 @@ function ChoiceItem({
4812
4820
  isSelected: selected,
4813
4821
  isPressed: isPressed || isPressedInternal,
4814
4822
  hasError: hasError,
4823
+ shouldExpand: shouldExpand,
4815
4824
  size: size,
4816
4825
  children: [/*#__PURE__*/jsxs(Stack, {
4817
4826
  alignItems: "center",
4818
4827
  space: "kitt.2",
4828
+ flexGrow: shouldExpand ? 1 : undefined,
4829
+ flexShrink: shouldExpand ? 1 : undefined,
4819
4830
  children: [icon ? /*#__PURE__*/jsx(TypographyIcon, {
4820
4831
  color: textColor,
4821
4832
  icon: icon
@@ -4844,36 +4855,49 @@ function ChoiceItem({
4844
4855
  function ChoiceItemContainer({
4845
4856
  children,
4846
4857
  direction,
4858
+ shouldExpand,
4847
4859
  isLast
4848
4860
  }) {
4849
4861
  const currentItemMarginValue = isLast ? undefined : 'kitt.3';
4850
- const flexProps = direction === 'row' ? {
4862
+ const directionFlexProps = direction === 'row' ? {
4851
4863
  flexGrow: 1,
4852
4864
  flexShrink: 1,
4853
4865
  flexBasis: 0
4854
4866
  } : {};
4867
+ const shouldExpandFlexProps = shouldExpand ? {
4868
+ flexGrow: 1,
4869
+ flexShrink: 1
4870
+ } : {};
4855
4871
  return /*#__PURE__*/jsx(View, {
4856
4872
  marginRight: direction === 'row' ? currentItemMarginValue : undefined,
4857
4873
  marginBottom: direction === 'column' ? currentItemMarginValue : undefined,
4858
- ...flexProps,
4874
+ ...directionFlexProps,
4875
+ ...shouldExpandFlexProps,
4859
4876
  children: children
4860
4877
  });
4861
4878
  }
4862
4879
 
4863
4880
  function ChoicesContainer({
4864
4881
  direction,
4882
+ shouldExpand,
4865
4883
  contentContainerStyle,
4866
4884
  ...props
4867
4885
  }) {
4886
+ const shouldExpandFlexProps = shouldExpand ? {
4887
+ flexGrow: 1,
4888
+ flexShrink: 1
4889
+ } : {};
4868
4890
  if (direction === 'row') {
4869
- return /*#__PURE__*/jsx(ScrollView$2, {
4891
+ return /*#__PURE__*/jsx(ScrollView, {
4870
4892
  horizontal: true,
4871
- contentContainerStyle: contentContainerStyle,
4872
- ...props
4893
+ contentContainerStyle: shouldExpand ? shouldExpandFlexProps : contentContainerStyle,
4894
+ ...props,
4895
+ ...shouldExpandFlexProps
4873
4896
  });
4874
4897
  }
4875
- return /*#__PURE__*/jsx(View$2, {
4876
- ...props
4898
+ return /*#__PURE__*/jsx(View, {
4899
+ ...props,
4900
+ ...shouldExpandFlexProps
4877
4901
  });
4878
4902
  }
4879
4903
 
@@ -4885,6 +4909,7 @@ function Choices({
4885
4909
  type,
4886
4910
  direction = 'column',
4887
4911
  disabled,
4912
+ shouldExpand = false,
4888
4913
  children,
4889
4914
  value,
4890
4915
  onPress,
@@ -4901,6 +4926,7 @@ function Choices({
4901
4926
  const sharedProps = {
4902
4927
  type,
4903
4928
  disabled,
4929
+ shouldExpand,
4904
4930
  onPress: !isForm ? onPress : undefined,
4905
4931
  onChange: isForm ? newValue => {
4906
4932
  setCurrentValue(newValue);
@@ -4912,6 +4938,7 @@ function Choices({
4912
4938
  };
4913
4939
  return /*#__PURE__*/jsx(ChoicesContainer, {
4914
4940
  direction: direction,
4941
+ shouldExpand: shouldExpand,
4915
4942
  testID: testID,
4916
4943
  id: id,
4917
4944
  style: style,
@@ -4923,6 +4950,7 @@ function Choices({
4923
4950
  });
4924
4951
  return /*#__PURE__*/jsx(ChoiceItemContainer, {
4925
4952
  direction: direction,
4953
+ shouldExpand: shouldExpand,
4926
4954
  isLast: index === childrenArray.length - 1,
4927
4955
  children: element
4928
4956
  }, child.key);