@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.
- package/CHANGELOG.md +9 -0
- package/dist/definitions/Choices/AnimatedChoiceItemView.d.ts +2 -1
- package/dist/definitions/Choices/AnimatedChoiceItemView.d.ts.map +1 -1
- package/dist/definitions/Choices/AnimatedChoiceItemView.web.d.ts +1 -1
- package/dist/definitions/Choices/AnimatedChoiceItemView.web.d.ts.map +1 -1
- package/dist/definitions/Choices/ChoiceItem.d.ts +2 -1
- package/dist/definitions/Choices/ChoiceItem.d.ts.map +1 -1
- package/dist/definitions/Choices/ChoiceItemContainer.d.ts +2 -1
- package/dist/definitions/Choices/ChoiceItemContainer.d.ts.map +1 -1
- package/dist/definitions/Choices/Choices.d.ts +5 -5
- package/dist/definitions/Choices/Choices.d.ts.map +1 -1
- package/dist/index-metro.es.android.js +35 -10
- package/dist/index-metro.es.android.js.map +1 -1
- package/dist/index-metro.es.ios.js +35 -10
- package/dist/index-metro.es.ios.js.map +1 -1
- package/dist/index-node-22.17.cjs.js +36 -8
- package/dist/index-node-22.17.cjs.js.map +1 -1
- package/dist/index-node-22.17.cjs.web.js +36 -8
- package/dist/index-node-22.17.cjs.web.js.map +1 -1
- package/dist/index-node-22.17.es.mjs +37 -9
- package/dist/index-node-22.17.es.mjs.map +1 -1
- package/dist/index-node-22.17.es.web.mjs +37 -9
- package/dist/index-node-22.17.es.web.mjs.map +1 -1
- package/dist/index.es.js +38 -10
- package/dist/index.es.js.map +1 -1
- package/dist/index.es.web.js +38 -10
- package/dist/index.es.web.js.map +1 -1
- package/dist/tsbuildinfo +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,15 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [32.3.1-canary.e5e3462569f2f32f91e8d06437eb0642c84cb55f.0](https://github.com/ornikar/kitt/compare/@ornikar/kitt-universal@32.3.0...@ornikar/kitt-universal@32.3.1-canary.e5e3462569f2f32f91e8d06437eb0642c84cb55f.0) (2025-12-11)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **kitt-universal/Choices:** add shouldExpand property ([4e7b6a3](https://github.com/ornikar/kitt/commit/4e7b6a34351ef5d388306734921de6f55bbf9b13))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
6
15
|
## [32.3.0](https://github.com/ornikar/kitt/compare/@ornikar/kitt-universal@32.2.0...@ornikar/kitt-universal@32.3.0) (2025-12-11)
|
|
7
16
|
|
|
8
17
|
|
|
@@ -9,7 +9,8 @@ export interface AnimatedChoiceItemViewProps {
|
|
|
9
9
|
isDisabled?: boolean;
|
|
10
10
|
isSelected?: boolean;
|
|
11
11
|
hasError?: boolean;
|
|
12
|
+
shouldExpand?: boolean;
|
|
12
13
|
animatedStyles?: ViewStyle;
|
|
13
14
|
}
|
|
14
|
-
export declare function AnimatedChoiceItemView({ children, size, isHovered, isPressed, isDisabled, isSelected, hasError, animatedStyles, }: AnimatedChoiceItemViewProps): ReactNode;
|
|
15
|
+
export declare function AnimatedChoiceItemView({ children, size, isHovered, isPressed, isDisabled, isSelected, hasError, shouldExpand, animatedStyles, }: AnimatedChoiceItemViewProps): ReactNode;
|
|
15
16
|
//# sourceMappingURL=AnimatedChoiceItemView.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnimatedChoiceItemView.d.ts","sourceRoot":"","sources":["../../../src/Choices/AnimatedChoiceItemView.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,KA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,EACV,QAAQ,EACR,YAAoB,EACpB,cAAc,GACf,EAAE,2BAA2B,GAAG,SAAS,CAezC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import type { AnimatedChoiceItemViewProps } from './AnimatedChoiceItemView';
|
|
3
|
-
export declare function AnimatedChoiceItemView({ children, size, isHovered, isPressed, isDisabled, isSelected, hasError, }: AnimatedChoiceItemViewProps): ReactNode;
|
|
3
|
+
export declare function AnimatedChoiceItemView({ children, size, isHovered, isPressed, isDisabled, isSelected, hasError, shouldExpand, }: AnimatedChoiceItemViewProps): ReactNode;
|
|
4
4
|
//# sourceMappingURL=AnimatedChoiceItemView.web.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnimatedChoiceItemView.web.d.ts","sourceRoot":"","sources":["../../../src/Choices/AnimatedChoiceItemView.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AAI5E,wBAAgB,sBAAsB,CAAC,EACrC,QAAQ,EACR,IAAI,EACJ,SAAS,EACT,SAAS,EACT,UAAU,EACV,UAAU,EACV,QAAQ,
|
|
1
|
+
{"version":3,"file":"AnimatedChoiceItemView.web.d.ts","sourceRoot":"","sources":["../../../src/Choices/AnimatedChoiceItemView.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AAI5E,wBAAgB,sBAAsB,CAAC,EACrC,QAAQ,EACR,IAAI,EACJ,SAAS,EACT,SAAS,EACT,UAAU,EACV,UAAU,EACV,QAAQ,EACR,YAAoB,GACrB,EAAE,2BAA2B,GAAG,SAAS,CAwBzC"}
|
|
@@ -8,6 +8,7 @@ export interface BaseChoiceItemProps<V> {
|
|
|
8
8
|
children: ReactNode;
|
|
9
9
|
disabled?: boolean;
|
|
10
10
|
hasError?: boolean;
|
|
11
|
+
shouldExpand?: boolean;
|
|
11
12
|
size?: ChoiceItemSize;
|
|
12
13
|
orientation?: 'horizontal' | 'vertical';
|
|
13
14
|
icon?: ReactElement<any>;
|
|
@@ -40,5 +41,5 @@ export interface ChoiceItemFormElementProps<V> extends BaseChoiceItemProps<V> {
|
|
|
40
41
|
onPress?: never;
|
|
41
42
|
}
|
|
42
43
|
export type ChoiceItemProps<V> = ChoiceItemButtonProps<V> | ChoiceItemFormElementProps<V>;
|
|
43
|
-
export declare function ChoiceItem<V>({ type, orientation, icon, hasError, description, value, selected, disabled, children, isPressedInternal, isHoveredInternal, onPress, onChange, onBlur, onFocus, size, style, testID, }: ChoiceItemProps<V>): ReactNode;
|
|
44
|
+
export declare function ChoiceItem<V>({ type, orientation, icon, hasError, description, value, selected, disabled, shouldExpand, children, isPressedInternal, isHoveredInternal, onPress, onChange, onBlur, onFocus, size, style, testID, }: ChoiceItemProps<V>): ReactNode;
|
|
44
45
|
//# sourceMappingURL=ChoiceItem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChoiceItem.d.ts","sourceRoot":"","sources":["../../../src/Choices/ChoiceItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,KAAK,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAM1E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAIlD,MAAM,MAAM,cAAc,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5D,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,OAAO,GAAG,UAAU,GAAG,SAAS,CAAC;AAEzE,MAAM,WAAW,mBAAmB,CAAC,CAAC;IACpC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,EACJ,QAAQ,EACR,WAAW,EACX,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,YAAoB,EACpB,QAAQ,EACR,iBAAiB,EACjB,iBAAiB,EACjB,OAAO,EACP,QAAQ,EACR,MAAM,EACN,OAAO,EACP,IAAI,EACJ,KAAK,EACL,MAAM,GACP,EAAE,eAAe,CAAC,CAAC,CAAC,GAAG,SAAS,CA0FhC"}
|
|
@@ -4,7 +4,8 @@ interface ChoiceItemContainerProps {
|
|
|
4
4
|
children: ReactNode;
|
|
5
5
|
isLast?: boolean;
|
|
6
6
|
direction: ChoicesDirection;
|
|
7
|
+
shouldExpand: boolean;
|
|
7
8
|
}
|
|
8
|
-
export declare function ChoiceItemContainer({ children, direction, isLast }: ChoiceItemContainerProps): ReactNode;
|
|
9
|
+
export declare function ChoiceItemContainer({ children, direction, shouldExpand, isLast, }: ChoiceItemContainerProps): ReactNode;
|
|
9
10
|
export {};
|
|
10
11
|
//# sourceMappingURL=ChoiceItemContainer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChoiceItemContainer.d.ts","sourceRoot":"","sources":["../../../src/Choices/ChoiceItemContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAElD,UAAU,wBAAwB;IAChC,QAAQ,EAAE,SAAS,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"ChoiceItemContainer.d.ts","sourceRoot":"","sources":["../../../src/Choices/ChoiceItemContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAElD,UAAU,wBAAwB;IAChC,QAAQ,EAAE,SAAS,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,gBAAgB,CAAC;IAC5B,YAAY,EAAE,OAAO,CAAC;CACvB;AAED,wBAAgB,mBAAmB,CAAC,EAClC,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,MAAM,GACP,EAAE,wBAAwB,GAAG,SAAS,CAetC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
import type { ViewProps } from 'react-native';
|
|
2
|
+
import type { ViewProps as RNViewProps } from 'react-native';
|
|
3
3
|
import type { Except, SetOptional } from 'type-fest';
|
|
4
|
-
import type
|
|
4
|
+
import { type ScrollViewProps } from '../native-base/primitives';
|
|
5
5
|
import type { ChoiceItemButtonProps, ChoiceItemFormElementProps, ChoiceItemType } from './ChoiceItem';
|
|
6
6
|
import { ChoiceItem } from './ChoiceItem';
|
|
7
7
|
export type ChoicesDirection = 'row' | 'column';
|
|
8
|
-
type ChoicesPropsToPick = 'type' | 'disabled' | 'value' | 'onPress' | 'onChange' | 'onBlur' | 'onFocus';
|
|
8
|
+
type ChoicesPropsToPick = 'type' | 'disabled' | 'shouldExpand' | 'value' | 'onPress' | 'onChange' | 'onBlur' | 'onFocus';
|
|
9
9
|
type ChoicesSize = 'small';
|
|
10
10
|
export interface BaseChoicesProps<V> {
|
|
11
11
|
id?: string;
|
|
@@ -13,7 +13,7 @@ export interface BaseChoicesProps<V> {
|
|
|
13
13
|
children: ReactNode;
|
|
14
14
|
direction?: ChoicesDirection;
|
|
15
15
|
size?: ChoicesSize;
|
|
16
|
-
style?:
|
|
16
|
+
style?: RNViewProps['style'];
|
|
17
17
|
contentContainerStyle?: ScrollViewProps['contentContainerStyle'];
|
|
18
18
|
}
|
|
19
19
|
export interface ChoicesButtonProps<V, ChoiceType extends ChoiceItemButtonProps<V>['type']> extends BaseChoicesProps<V>, Pick<ChoiceItemButtonProps<V>, ChoicesPropsToPick> {
|
|
@@ -25,7 +25,7 @@ export interface ChoicesFormElementProps<V, ChoiceType extends ChoiceItemFormEle
|
|
|
25
25
|
export type ChoicesItemPropsFromChoiceType<V, ChoiceType extends ChoiceItemType> = ChoiceType extends ChoiceItemFormElementProps<V>['type'] ? ChoiceItemFormElementProps<V> : ChoiceItemButtonProps<V>;
|
|
26
26
|
export type ChoicesProps<V, ChoiceType extends ChoiceItemType> = ChoiceType extends ChoiceItemFormElementProps<V>['type'] ? ChoicesFormElementProps<V, ChoiceType> : ChoicesButtonProps<V, 'button'>;
|
|
27
27
|
type ExcludeChoiceItemProvidedByChoices = 'type' | 'onPress' | 'onChange' | 'onFocus' | 'onBlur';
|
|
28
|
-
type OptionalChoiceItemProvidedByChoices = 'disabled' | 'size';
|
|
28
|
+
type OptionalChoiceItemProvidedByChoices = 'disabled' | 'shouldExpand' | 'size';
|
|
29
29
|
export interface CreateChoices<V, ChoiceType extends ChoiceItemType> {
|
|
30
30
|
(props: ChoicesProps<V, ChoiceType>): ReactNode;
|
|
31
31
|
Item: (props: SetOptional<Except<ChoicesItemPropsFromChoiceType<V, ChoiceType>, OptionalChoiceItemProvidedByChoices>, ExcludeChoiceItemProvidedByChoices>) => ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Choices.d.ts","sourceRoot":"","sources":["../../../src/Choices/Choices.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAgB,SAAS,EAAE,MAAM,OAAO,CAAC;AAErD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"Choices.d.ts","sourceRoot":"","sources":["../../../src/Choices/Choices.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAgB,SAAS,EAAE,MAAM,OAAO,CAAC;AAErD,OAAO,KAAK,EAAE,SAAS,IAAI,WAAW,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;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AAM,MAAM,8BAA8B,CACxC,CAAC,EACD,UAAU,SAAS,cAAc,IAC/B,UAAU,SAAS,0BAA0B,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,0BAA0B,CAAC,CAAC,CAAC,GAAG,qBAAqB,CAAC,CAAC,CAAC,CAAC;AAExH,MAAM,MAAM,YAAY,CACtB,CAAC,EACD,UAAU,SAAS,cAAc,IAC/B,UAAU,SAAS,0BAA0B,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,GACxD,uBAAuB,CAAC,CAAC,EAAE,UAAU,CAAC,GACtC,kBAAkB,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;AAEpC,KAAK,kCAAkC,GAAG,MAAM,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,GAAG,QAAQ,CAAC;AACjG,KAAK,mCAAmC,GAAG,UAAU,GAAG,cAAc,GAAG,MAAM,CAAC;AA+EhF,MAAM,WAAW,aAAa,CAAC,CAAC,EAAE,UAAU,SAAS,cAAc;IACjE,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC,EAAE,UAAU,CAAC,GAAG,SAAS,CAAC;IAChD,IAAI,EAAE,CACJ,KAAK,EAAE,WAAW,CAChB,MAAM,CAAC,8BAA8B,CAAC,CAAC,EAAE,UAAU,CAAC,EAAE,mCAAmC,CAAC,EAC1F,kCAAkC,CACnC,KACE,SAAS,CAAC;CAChB;AAED,wBAAgB,sBAAsB,CAAC,CAAC,EAAE,UAAU,SAAS,cAAc,KAAK,aAAa,CAAC,CAAC,EAAE,UAAU,CAAC,CAE3G;AAMD,eAAO,MAAM,eAAe;;;CAG3B,CAAC"}
|
|
@@ -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,
|
|
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
|
|
5004
|
+
const directionFlexProps = direction === 'row' ? {
|
|
4993
5005
|
flexGrow: 1,
|
|
4994
5006
|
flexShrink: 1,
|
|
4995
5007
|
flexBasis: 0
|
|
4996
5008
|
} : {};
|
|
4997
|
-
|
|
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
|
-
},
|
|
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
|
|
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
|
|
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);
|