@utilitywarehouse/hearth-react-native 0.4.1 → 0.5.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/.turbo/turbo-build.log +1 -1
- package/.turbo/turbo-lint.log +1 -1
- package/CHANGELOG.md +54 -0
- package/build/components/Alert/AlertTitle.js +6 -6
- package/build/components/Badge/Badge.js +3 -3
- package/build/components/Badge/Badge.props.d.ts +1 -0
- package/build/components/Button/ButtonRoot.js +4 -0
- package/build/components/Button/ButtonText.js +2 -2
- package/build/components/Card/CardRoot.js +1 -1
- package/build/components/Carousel/Carousel.context.d.ts +4 -0
- package/build/components/Carousel/Carousel.context.js +4 -0
- package/build/components/Carousel/Carousel.d.ts +6 -0
- package/build/components/Carousel/Carousel.js +278 -0
- package/build/components/Carousel/Carousel.props.d.ts +65 -0
- package/build/components/Carousel/Carousel.props.js +1 -0
- package/build/components/Carousel/CarouselControlItem.d.ts +24 -0
- package/build/components/Carousel/CarouselControlItem.js +64 -0
- package/build/components/Carousel/CarouselControls.d.ts +4 -0
- package/build/components/Carousel/CarouselControls.js +74 -0
- package/build/components/Carousel/CarouselItem.d.ts +6 -0
- package/build/components/Carousel/CarouselItem.js +38 -0
- package/build/components/Carousel/index.d.ts +5 -0
- package/build/components/Carousel/index.js +5 -0
- package/build/components/Checkbox/CheckboxTextContent.d.ts +1 -1
- package/build/components/Checkbox/CheckboxTextContent.js +9 -2
- package/build/components/CurrencyInput/CurrencyInput.d.ts +1 -1
- package/build/components/CurrencyInput/CurrencyInput.js +3 -3
- package/build/components/CurrencyInput/CurrencyInput.props.d.ts +2 -2
- package/build/components/DescriptionList/DescriptionList.d.ts +1 -1
- package/build/components/DescriptionList/DescriptionList.js +2 -2
- package/build/components/DescriptionList/DescriptionList.props.d.ts +1 -8
- package/build/components/DescriptionList/DescriptionListItem.d.ts +1 -1
- package/build/components/DescriptionList/DescriptionListItem.js +4 -3
- package/build/components/DescriptionList/DescriptionListItem.props.d.ts +3 -8
- package/build/components/IndicatorIconButton/IndicatorIconButton.d.ts +6 -0
- package/build/components/IndicatorIconButton/IndicatorIconButton.js +26 -0
- package/build/components/IndicatorIconButton/IndicatorIconButton.props.d.ts +8 -0
- package/build/components/IndicatorIconButton/IndicatorIconButton.props.js +1 -0
- package/build/components/IndicatorIconButton/index.d.ts +2 -0
- package/build/components/IndicatorIconButton/index.js +1 -0
- package/build/components/Link/LinkText.js +3 -3
- package/build/components/List/List.context.d.ts +0 -2
- package/build/components/List/List.d.ts +1 -1
- package/build/components/List/List.js +5 -5
- package/build/components/List/List.props.d.ts +1 -9
- package/build/components/List/ListAction/ListAction.d.ts +18 -0
- package/build/components/List/ListAction/ListAction.js +103 -0
- package/build/components/List/ListAction/ListAction.props.d.ts +8 -0
- package/build/components/List/ListAction/ListAction.props.js +1 -0
- package/build/components/List/ListAction/ListActionContent.d.ts +6 -0
- package/build/components/List/ListAction/ListActionContent.js +14 -0
- package/build/components/List/ListAction/ListActionText.d.ts +6 -0
- package/build/components/List/ListAction/ListActionText.js +7 -0
- package/build/components/List/ListAction/ListActionTrailingContent.d.ts +6 -0
- package/build/components/List/ListAction/ListActionTrailingContent.js +5 -0
- package/build/components/List/ListAction/ListActionTrailingIcon.d.ts +9 -0
- package/build/components/List/ListAction/ListActionTrailingIcon.js +18 -0
- package/build/components/List/ListAction/index.d.ts +6 -0
- package/build/components/List/ListAction/index.js +5 -0
- package/build/components/List/ListItem/ListItem.context.d.ts +1 -1
- package/build/components/List/ListItem/ListItem.props.d.ts +9 -5
- package/build/components/List/ListItem/ListItemRoot.d.ts +1 -1
- package/build/components/List/ListItem/ListItemRoot.js +10 -12
- package/build/components/List/ListItem/index.d.ts +4 -4
- package/build/components/List/ListItem/index.js +3 -3
- package/build/components/List/index.d.ts +1 -0
- package/build/components/List/index.js +1 -0
- package/build/components/ProgressStepper/ProgressStep.d.ts +10 -0
- package/build/components/ProgressStepper/ProgressStep.js +100 -0
- package/build/components/ProgressStepper/ProgressStepper.d.ts +6 -0
- package/build/components/ProgressStepper/ProgressStepper.js +22 -0
- package/build/components/ProgressStepper/ProgressStepper.props.d.ts +22 -0
- package/build/components/ProgressStepper/ProgressStepper.props.js +1 -0
- package/build/components/ProgressStepper/ProgressStepperRoot.d.ts +6 -0
- package/build/components/ProgressStepper/ProgressStepperRoot.js +16 -0
- package/build/components/ProgressStepper/index.d.ts +3 -0
- package/build/components/ProgressStepper/index.js +2 -0
- package/build/components/Radio/RadioTextContent.d.ts +1 -1
- package/build/components/Radio/RadioTextContent.js +9 -2
- package/build/components/SectionHeader/SectionHeader.d.ts +1 -1
- package/build/components/SectionHeader/SectionHeader.js +6 -3
- package/build/components/SectionHeader/SectionHeader.props.d.ts +9 -16
- package/build/components/SectionHeader/SectionHeaderTrailingContent.d.ts +6 -0
- package/build/components/SectionHeader/SectionHeaderTrailingContent.js +13 -0
- package/build/components/SectionHeader/index.d.ts +1 -0
- package/build/components/SectionHeader/index.js +1 -0
- package/build/components/Tabs/Tab.js +2 -2
- package/build/components/ToggleButton/ToggleButtonText.js +2 -2
- package/build/components/UnstyledIconButton/UnstyledIconButton.props.d.ts +4 -1
- package/build/components/index.d.ts +3 -0
- package/build/components/index.js +3 -0
- package/build/core/themes.d.ts +12 -24
- package/build/tokens/components/dark/button.d.ts +1 -1
- package/build/tokens/components/dark/button.js +1 -1
- package/build/tokens/components/dark/dialog.d.ts +1 -0
- package/build/tokens/components/dark/dialog.js +1 -0
- package/build/tokens/components/dark/illustrations.d.ts +1 -0
- package/build/tokens/components/dark/illustrations.js +1 -0
- package/build/tokens/components/dark/toast.d.ts +4 -1
- package/build/tokens/components/dark/toast.js +4 -1
- package/build/tokens/components/light/button.d.ts +1 -1
- package/build/tokens/components/light/button.js +1 -1
- package/build/tokens/components/light/dialog.d.ts +1 -0
- package/build/tokens/components/light/dialog.js +1 -0
- package/build/tokens/components/light/illustrations.d.ts +1 -0
- package/build/tokens/components/light/illustrations.js +1 -0
- package/build/tokens/components/light/toast.d.ts +4 -1
- package/build/tokens/components/light/toast.js +4 -1
- package/build/tokens/layout.d.ts +6 -12
- package/build/tokens/layout.js +3 -6
- package/build/utils/getFlattenedColorValue.js +2 -19
- package/build/utils/index.d.ts +1 -0
- package/build/utils/index.js +1 -0
- package/build/utils/styleUtils.d.ts +0 -4
- package/build/utils/styleUtils.js +0 -50
- package/build/utils/themeValueHelpers.d.ts +17 -0
- package/build/utils/themeValueHelpers.js +54 -0
- package/docs/components/AllComponents.web.tsx +86 -4
- package/docs/components/BadgeList.tsx +20 -56
- package/docs/components/SwitchList.tsx +4 -8
- package/docs/getting-started.mdx +37 -13
- package/docs/introduction.mdx +51 -6
- package/package.json +7 -7
- package/src/components/Alert/AlertTitle.tsx +7 -7
- package/src/components/Badge/Badge.props.ts +1 -0
- package/src/components/Badge/Badge.tsx +3 -2
- package/src/components/Button/ButtonRoot.tsx +4 -0
- package/src/components/Button/ButtonText.tsx +3 -3
- package/src/components/Card/CardRoot.tsx +2 -0
- package/src/components/Carousel/Carousel.context.tsx +8 -0
- package/src/components/Carousel/Carousel.docs.mdx +389 -0
- package/src/components/Carousel/Carousel.props.ts +89 -0
- package/src/components/Carousel/Carousel.stories.tsx +317 -0
- package/src/components/Carousel/Carousel.tsx +444 -0
- package/src/components/Carousel/CarouselControlItem.tsx +87 -0
- package/src/components/Carousel/CarouselControls.tsx +150 -0
- package/src/components/Carousel/CarouselItem.tsx +68 -0
- package/src/components/Carousel/index.ts +6 -0
- package/src/components/Checkbox/CheckboxTextContent.tsx +11 -3
- package/src/components/CurrencyInput/CurrencyInput.docs.mdx +4 -4
- package/src/components/CurrencyInput/CurrencyInput.props.ts +2 -2
- package/src/components/CurrencyInput/CurrencyInput.stories.tsx +17 -15
- package/src/components/CurrencyInput/CurrencyInput.tsx +3 -3
- package/src/components/DescriptionList/DescriptionList.docs.mdx +24 -27
- package/src/components/DescriptionList/DescriptionList.props.ts +1 -8
- package/src/components/DescriptionList/DescriptionList.stories.tsx +13 -19
- package/src/components/DescriptionList/DescriptionList.tsx +2 -14
- package/src/components/DescriptionList/DescriptionListItem.props.ts +3 -8
- package/src/components/DescriptionList/DescriptionListItem.tsx +13 -21
- package/src/components/IndicatorIconButton/IndicatorIconButton.docs.mdx +85 -0
- package/src/components/IndicatorIconButton/IndicatorIconButton.props.ts +12 -0
- package/src/components/IndicatorIconButton/IndicatorIconButton.stories.tsx +142 -0
- package/src/components/IndicatorIconButton/IndicatorIconButton.tsx +36 -0
- package/src/components/IndicatorIconButton/index.tsx +2 -0
- package/src/components/Link/LinkText.tsx +4 -4
- package/src/components/List/List.context.ts +0 -1
- package/src/components/List/List.docs.mdx +376 -179
- package/src/components/List/List.props.ts +1 -9
- package/src/components/List/List.stories.tsx +289 -38
- package/src/components/List/List.tsx +5 -26
- package/src/components/List/ListAction/ListAction.props.ts +10 -0
- package/src/components/List/ListAction/ListAction.tsx +133 -0
- package/src/components/List/ListAction/ListActionContent.tsx +21 -0
- package/src/components/List/ListAction/ListActionText.tsx +14 -0
- package/src/components/List/ListAction/ListActionTrailingContent.tsx +9 -0
- package/src/components/List/ListAction/ListActionTrailingIcon.tsx +32 -0
- package/src/components/List/ListAction/index.ts +6 -0
- package/src/components/List/ListItem/ListItem.context.ts +1 -1
- package/src/components/List/ListItem/ListItem.props.ts +9 -5
- package/src/components/List/ListItem/ListItemRoot.tsx +18 -14
- package/src/components/List/ListItem/index.ts +4 -4
- package/src/components/List/index.ts +1 -0
- package/src/components/ProgressStepper/ProgressStep.tsx +134 -0
- package/src/components/ProgressStepper/ProgressStepper.docs.mdx +87 -0
- package/src/components/ProgressStepper/ProgressStepper.props.ts +27 -0
- package/src/components/ProgressStepper/ProgressStepper.stories.tsx +108 -0
- package/src/components/ProgressStepper/ProgressStepper.tsx +26 -0
- package/src/components/ProgressStepper/ProgressStepperRoot.tsx +32 -0
- package/src/components/ProgressStepper/index.ts +3 -0
- package/src/components/Radio/RadioTextContent.tsx +11 -3
- package/src/components/SectionHeader/SectionHeader.props.ts +9 -16
- package/src/components/SectionHeader/SectionHeader.stories.tsx +28 -18
- package/src/components/SectionHeader/SectionHeader.tsx +18 -19
- package/src/components/SectionHeader/SectionHeaderTrailingContent.tsx +20 -0
- package/src/components/SectionHeader/Sectionheader.docs.mdx +9 -24
- package/src/components/SectionHeader/index.ts +1 -0
- package/src/components/Switch/Switch.docs.mdx +0 -4
- package/src/components/Tabs/Tab.tsx +4 -2
- package/src/components/ToggleButton/ToggleButtonText.tsx +3 -3
- package/src/components/UnstyledIconButton/UnstyledIconButton.props.ts +2 -1
- package/src/components/index.ts +3 -0
- package/src/tokens/components/dark/button.ts +1 -1
- package/src/tokens/components/dark/dialog.ts +1 -0
- package/src/tokens/components/dark/illustrations.ts +1 -0
- package/src/tokens/components/dark/toast.ts +4 -1
- package/src/tokens/components/light/button.ts +1 -1
- package/src/tokens/components/light/dialog.ts +1 -0
- package/src/tokens/components/light/illustrations.ts +1 -0
- package/src/tokens/components/light/toast.ts +4 -1
- package/src/tokens/layout.ts +3 -6
- package/src/utils/getFlattenedColorValue.ts +2 -21
- package/src/utils/getStyleValue.ts +0 -3
- package/src/utils/index.ts +1 -0
- package/src/utils/styleUtils.ts +0 -57
- package/src/utils/themeValueHelpers.ts +60 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { nanoid } from 'nanoid/non-secure';
|
|
3
|
+
import { useContext, useEffect, useMemo } from 'react';
|
|
4
|
+
import { StyleSheet } from 'react-native-unistyles';
|
|
5
|
+
import { View } from 'react-native';
|
|
6
|
+
import { ChevronLeftSmallIcon, ChevronRightSmallIcon, } from '@utilitywarehouse/hearth-react-native-icons';
|
|
7
|
+
import { UnstyledIconButton } from '../UnstyledIconButton';
|
|
8
|
+
import CarouselContext from './Carousel.context';
|
|
9
|
+
import CarouselControlItem from './CarouselControlItem';
|
|
10
|
+
export const CarouselControls = ({ testID = 'pagination', style, itemStyle, activeItemStyle, showNavigation = false, onPressPrev, onPressNext, accessibilityHidden, ...props }) => {
|
|
11
|
+
const context = useContext(CarouselContext);
|
|
12
|
+
const { activeIndex = 0, numItems = 0, setActiveIndex, controlsAccessibilityHidden, disabled = false, } = context;
|
|
13
|
+
const isAccessibilityHidden = accessibilityHidden ?? controlsAccessibilityHidden ?? true;
|
|
14
|
+
styles.useVariants({ showNavigation });
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
if (!Object.keys(context).length) {
|
|
17
|
+
console.warn('CarouselControls must be a child of Carousel. Pagination will not be displayed.');
|
|
18
|
+
}
|
|
19
|
+
}, [context]);
|
|
20
|
+
const keys = useMemo(() => {
|
|
21
|
+
return Array(numItems)
|
|
22
|
+
.fill(null)
|
|
23
|
+
.map(() => nanoid());
|
|
24
|
+
}, [numItems]);
|
|
25
|
+
const handlePrev = () => {
|
|
26
|
+
if (activeIndex > 0) {
|
|
27
|
+
setActiveIndex(activeIndex - 1);
|
|
28
|
+
onPressPrev?.();
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
const handleNext = () => {
|
|
32
|
+
if (activeIndex < numItems - 1) {
|
|
33
|
+
setActiveIndex(activeIndex + 1);
|
|
34
|
+
onPressNext?.();
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
const handleItemPress = (index) => {
|
|
38
|
+
setActiveIndex(index);
|
|
39
|
+
};
|
|
40
|
+
if (!Object.keys(context).length) {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
return (_jsxs(View, { style: [styles.root, style], testID: testID, importantForAccessibility: isAccessibilityHidden ? 'no-hide-descendants' : 'auto', accessibilityElementsHidden: isAccessibilityHidden, ...props, children: [showNavigation && (_jsx(UnstyledIconButton, { icon: ChevronLeftSmallIcon, onPress: handlePrev, disabled: disabled || activeIndex === 0, accessibilityLabel: "Previous", style: styles.button, inverted: context.inverted })), _jsx(View, { style: styles.dotsContainer, children: keys.map((_, index) => (_jsx(CarouselControlItem, { active: index === activeIndex, index: index, style: itemStyle, activeStyle: activeItemStyle, onPress: () => handleItemPress(index), disabled: disabled }, keys[index]))) }), showNavigation && (_jsx(UnstyledIconButton, { icon: ChevronRightSmallIcon, onPress: handleNext, disabled: disabled || activeIndex === numItems - 1, accessibilityLabel: "Next", style: styles.button, inverted: context.inverted }))] }));
|
|
44
|
+
};
|
|
45
|
+
const styles = StyleSheet.create(theme => ({
|
|
46
|
+
root: {
|
|
47
|
+
width: '100%',
|
|
48
|
+
alignSelf: 'center',
|
|
49
|
+
flexDirection: 'row',
|
|
50
|
+
alignItems: 'center',
|
|
51
|
+
gap: theme.components.carouselControl.gap,
|
|
52
|
+
justifyContent: 'space-between',
|
|
53
|
+
variants: {
|
|
54
|
+
showNavigation: {
|
|
55
|
+
true: {
|
|
56
|
+
justifyContent: 'space-between',
|
|
57
|
+
},
|
|
58
|
+
false: {
|
|
59
|
+
justifyContent: 'center',
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
dotsContainer: {
|
|
65
|
+
flexDirection: 'row',
|
|
66
|
+
gap: theme.components.carouselControl.gap,
|
|
67
|
+
},
|
|
68
|
+
button: {
|
|
69
|
+
width: 24,
|
|
70
|
+
height: 24,
|
|
71
|
+
},
|
|
72
|
+
}));
|
|
73
|
+
CarouselControls.displayName = 'CarouselControls';
|
|
74
|
+
export default CarouselControls;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CarouselItemProps } from './Carousel.props';
|
|
2
|
+
export declare const CarouselItem: {
|
|
3
|
+
({ active, children, inactiveOpacity, style, width, ...props }: CarouselItemProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
displayName: string;
|
|
5
|
+
};
|
|
6
|
+
export default CarouselItem;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect } from 'react';
|
|
3
|
+
import { Platform, View } from 'react-native';
|
|
4
|
+
import Animated, { useAnimatedStyle, useSharedValue, withTiming } from 'react-native-reanimated';
|
|
5
|
+
import { StyleSheet } from 'react-native-unistyles';
|
|
6
|
+
export const CarouselItem = ({ active, children, inactiveOpacity = 1, style, width, ...props }) => {
|
|
7
|
+
const isWeb = Platform.OS === 'web';
|
|
8
|
+
const opacity = useSharedValue(inactiveOpacity);
|
|
9
|
+
const animatedStyles = useAnimatedStyle(() => ({
|
|
10
|
+
opacity: opacity.value,
|
|
11
|
+
width,
|
|
12
|
+
}), [opacity, width]);
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
opacity.value = withTiming(active ? 1 : inactiveOpacity, { duration: 200 });
|
|
15
|
+
}, [active, inactiveOpacity, opacity]);
|
|
16
|
+
// For web, use a regular View with CSS transitions
|
|
17
|
+
if (isWeb) {
|
|
18
|
+
return (_jsx(View, { style: [
|
|
19
|
+
styles.container,
|
|
20
|
+
style,
|
|
21
|
+
{
|
|
22
|
+
opacity: active ? 1 : inactiveOpacity,
|
|
23
|
+
width,
|
|
24
|
+
},
|
|
25
|
+
], ...props, children: children }));
|
|
26
|
+
}
|
|
27
|
+
// For native, use Animated.View with reanimated
|
|
28
|
+
return (_jsx(Animated.View, { style: [styles.container, style, animatedStyles], ...props, children: children }));
|
|
29
|
+
};
|
|
30
|
+
CarouselItem.displayName = 'CarouselItem';
|
|
31
|
+
const styles = StyleSheet.create(() => ({
|
|
32
|
+
container: {
|
|
33
|
+
_web: {
|
|
34
|
+
transition: 'opacity 200ms ease-in-out',
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
}));
|
|
38
|
+
export default CarouselItem;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import FlexProps from '../Flex/Flex.props';
|
|
2
2
|
declare const CheckboxTextContent: {
|
|
3
|
-
({ children, ...props }: FlexProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
({ children, style, ...props }: FlexProps): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
displayName: string;
|
|
5
5
|
};
|
|
6
6
|
export default CheckboxTextContent;
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { StyleSheet } from 'react-native-unistyles';
|
|
2
3
|
import { Flex } from '../Flex';
|
|
3
|
-
const CheckboxTextContent = ({ children, ...props }) => {
|
|
4
|
-
return (_jsx(Flex, { direction: "column", space: "none", ...props, children: children }));
|
|
4
|
+
const CheckboxTextContent = ({ children, style, ...props }) => {
|
|
5
|
+
return (_jsx(Flex, { style: [styles.content, style], direction: "column", space: "none", ...props, children: children }));
|
|
5
6
|
};
|
|
7
|
+
const styles = StyleSheet.create({
|
|
8
|
+
content: {
|
|
9
|
+
flex: 1,
|
|
10
|
+
flexShrink: 1,
|
|
11
|
+
},
|
|
12
|
+
});
|
|
6
13
|
CheckboxTextContent.displayName = 'CheckboxTextContent';
|
|
7
14
|
export default CheckboxTextContent;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type CurrencyInputProps from './CurrencyInput.props';
|
|
2
2
|
declare const CurrencyInput: {
|
|
3
|
-
({ validationStatus, disabled, focused, readonly, placeholder, inBottomSheet, required,
|
|
3
|
+
({ validationStatus, disabled, focused, readonly, placeholder, inBottomSheet, required, disableGroupSeparator, value, onChangeText, ...rest }: CurrencyInputProps): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
displayName: string;
|
|
5
5
|
};
|
|
6
6
|
export default CurrencyInput;
|
|
@@ -5,14 +5,14 @@ import { formatThousands } from '../../utils';
|
|
|
5
5
|
import { DetailText } from '../DetailText';
|
|
6
6
|
import { useFormFieldContext } from '../FormField';
|
|
7
7
|
import { Input, InputField, InputSlot } from '../Input';
|
|
8
|
-
const CurrencyInput = ({ validationStatus = 'initial', disabled, focused, readonly, placeholder, inBottomSheet = false, required,
|
|
8
|
+
const CurrencyInput = ({ validationStatus = 'initial', disabled, focused, readonly, placeholder, inBottomSheet = false, required, disableGroupSeparator = false, value, onChangeText, ...rest }) => {
|
|
9
9
|
const formFieldContext = useFormFieldContext();
|
|
10
10
|
const { disabled: formFieldDisabled } = formFieldContext;
|
|
11
11
|
const validationStatusFromContext = formFieldContext?.validationStatus ?? validationStatus;
|
|
12
12
|
const defaultFormat = '0.00';
|
|
13
13
|
const getPlaceholder = placeholder ?? defaultFormat;
|
|
14
14
|
const handleChangeText = (text) => {
|
|
15
|
-
if (
|
|
15
|
+
if (!disableGroupSeparator) {
|
|
16
16
|
const formatted = formatThousands(text);
|
|
17
17
|
onChangeText?.(formatted);
|
|
18
18
|
}
|
|
@@ -20,7 +20,7 @@ const CurrencyInput = ({ validationStatus = 'initial', disabled, focused, readon
|
|
|
20
20
|
onChangeText?.(text);
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
|
-
const displayValue =
|
|
23
|
+
const displayValue = !disableGroupSeparator && typeof value === 'string' ? formatThousands(value) : value;
|
|
24
24
|
return (_jsxs(Input, { validationStatus: validationStatusFromContext, disabled: formFieldDisabled ?? disabled, readonly: readonly, focused: focused, style: styles.wrap, children: [_jsx(InputSlot, { children: _jsx(DetailText, { size: "4xl", style: styles.text, accessible: false, children: "\u00A3" }) }), _jsx(InputField, { inputMode: "decimal", inBottomSheet: inBottomSheet, accessibilityHint: 'Enter the amount in pounds and pence, for example "10.99"', ...rest, placeholder: getPlaceholder, keyboardType: "decimal-pad", style: styles.input, value: displayValue, onChangeText: handleChangeText })] }));
|
|
25
25
|
};
|
|
26
26
|
CurrencyInput.displayName = 'CurrencyInput';
|
|
@@ -7,8 +7,8 @@ export interface CurrencyInputBaseProps {
|
|
|
7
7
|
placeholder?: string;
|
|
8
8
|
inBottomSheet?: boolean;
|
|
9
9
|
required?: boolean;
|
|
10
|
-
/** When
|
|
11
|
-
|
|
10
|
+
/** When not specifically disabled, the numeric value is automatically formatted with thousand separators (e.g. 1234 -> 1,234). */
|
|
11
|
+
disableGroupSeparator?: boolean;
|
|
12
12
|
}
|
|
13
13
|
export type CurrencyInputProps = CurrencyInputBaseProps & Omit<TextInputProps, 'children'> & ViewProps;
|
|
14
14
|
export default CurrencyInputProps;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type DescriptionListProps from './DescriptionList.props';
|
|
2
2
|
declare const DescriptionList: {
|
|
3
|
-
({ direction, itemHeadingWidth, heading, helperText,
|
|
3
|
+
({ direction, itemHeadingWidth, heading, helperText, headerTrailingContent, children, style, ...props }: DescriptionListProps): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
displayName: string;
|
|
5
5
|
};
|
|
6
6
|
export default DescriptionList;
|
|
@@ -4,10 +4,10 @@ import { View } from 'react-native';
|
|
|
4
4
|
import { StyleSheet } from 'react-native-unistyles';
|
|
5
5
|
import { SectionHeader } from '../SectionHeader';
|
|
6
6
|
import { DescriptionListContext } from './DescriptionList.context';
|
|
7
|
-
const DescriptionList = ({ direction = 'column', itemHeadingWidth, heading, helperText,
|
|
7
|
+
const DescriptionList = ({ direction = 'column', itemHeadingWidth, heading, helperText, headerTrailingContent, children, style, ...props }) => {
|
|
8
8
|
styles.useVariants({ direction });
|
|
9
9
|
const value = useMemo(() => ({ direction, itemHeadingWidth }), [direction, itemHeadingWidth]);
|
|
10
|
-
return (_jsx(DescriptionListContext.Provider, { value: value, children: _jsxs(View, { accessibilityRole: "list", ...props, style: [styles.container, style], children: [heading ? (_jsx(SectionHeader, { heading: heading, helperText: helperText,
|
|
10
|
+
return (_jsx(DescriptionListContext.Provider, { value: value, children: _jsxs(View, { accessibilityRole: "list", ...props, style: [styles.container, style], children: [heading ? (_jsx(SectionHeader, { heading: heading, helperText: helperText, trailingContent: headerTrailingContent })) : null, children] }) }));
|
|
11
11
|
};
|
|
12
12
|
DescriptionList.displayName = 'DescriptionList';
|
|
13
13
|
const styles = StyleSheet.create(theme => ({
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ComponentType } from 'react';
|
|
2
1
|
import type { ViewProps } from 'react-native';
|
|
3
2
|
export interface DescriptionListProps extends ViewProps {
|
|
4
3
|
/** Direction orientation for items */
|
|
@@ -7,12 +6,6 @@ export interface DescriptionListProps extends ViewProps {
|
|
|
7
6
|
itemHeadingWidth?: number;
|
|
8
7
|
heading?: string;
|
|
9
8
|
helperText?: string;
|
|
10
|
-
|
|
11
|
-
linkHref?: string;
|
|
12
|
-
linkIcon?: ComponentType;
|
|
13
|
-
linkIconPosition?: 'left' | 'right';
|
|
14
|
-
linkOnPress?: () => void;
|
|
15
|
-
linkTarget?: '_blank' | '_self' | '_parent' | '_top';
|
|
16
|
-
linkShowIcon?: boolean;
|
|
9
|
+
headerTrailingContent?: React.ReactNode;
|
|
17
10
|
}
|
|
18
11
|
export default DescriptionListProps;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type DescriptionListItemProps from './DescriptionListItem.props';
|
|
2
2
|
declare const DescriptionListItem: {
|
|
3
|
-
({ heading, description, headingWidth,
|
|
3
|
+
({ heading, description, headingWidth, trailingContent, invalidText, style, ...props }: DescriptionListItemProps): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
displayName: string;
|
|
5
5
|
};
|
|
6
6
|
export default DescriptionListItem;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ErrorCircleSmallIcon } from '@utilitywarehouse/hearth-react-native-icons';
|
|
2
3
|
import { View } from 'react-native';
|
|
3
4
|
import { StyleSheet } from 'react-native-unistyles';
|
|
4
5
|
import { useTheme } from '../../hooks';
|
|
5
6
|
import { BodyText } from '../BodyText';
|
|
6
|
-
import
|
|
7
|
+
import Helper from '../Helper/Helper';
|
|
7
8
|
import { useDescriptionListContext } from './DescriptionList.context';
|
|
8
|
-
const DescriptionListItem = ({ heading, description, headingWidth,
|
|
9
|
+
const DescriptionListItem = ({ heading, description, headingWidth, trailingContent, invalidText, style, ...props }) => {
|
|
9
10
|
const { components } = useTheme();
|
|
10
11
|
const { direction, itemHeadingWidth = components.descriptionList.item.row.headingWidth } = useDescriptionListContext();
|
|
11
12
|
styles.useVariants({ direction });
|
|
@@ -13,7 +14,7 @@ const DescriptionListItem = ({ heading, description, headingWidth, linkText, lin
|
|
|
13
14
|
const descIsText = typeof description === 'string' || typeof description === 'number';
|
|
14
15
|
const combinedLabel = headingIsText && descIsText ? `${heading}: ${description}` : undefined;
|
|
15
16
|
const hideDescendants = !!combinedLabel;
|
|
16
|
-
return (_jsxs(View, { accessibilityRole: "text", accessible: !!combinedLabel, accessibilityLabel: combinedLabel, ...props, style: [styles.item, style], children: [_jsxs(View, { style: styles.textWrap, importantForAccessibility: hideDescendants ? 'no-hide-descendants' : undefined, accessibilityElementsHidden: hideDescendants || undefined, children: [_jsx(View, { style: [direction === 'row' && { width: headingWidth || itemHeadingWidth }], children: headingIsText ? _jsx(BodyText, { style: styles.headingText, children: heading }) : heading }),
|
|
17
|
+
return (_jsxs(View, { accessibilityRole: "text", accessible: !!combinedLabel, accessibilityLabel: combinedLabel, ...props, style: [styles.item, style], children: [_jsxs(View, { style: styles.textWrap, importantForAccessibility: hideDescendants ? 'no-hide-descendants' : undefined, accessibilityElementsHidden: hideDescendants || undefined, children: [_jsx(View, { style: [direction === 'row' && { width: headingWidth || itemHeadingWidth }], children: headingIsText ? _jsx(BodyText, { style: styles.headingText, children: heading }) : heading }), _jsxs(View, { style: styles.descriptionWrapper, children: [descIsText ? _jsx(BodyText, { children: description }) : description, !!invalidText && (_jsx(Helper, { validationStatus: "invalid", showIcon: true, icon: ErrorCircleSmallIcon, text: invalidText || '' }))] })] }), trailingContent ? trailingContent : null] }));
|
|
17
18
|
};
|
|
18
19
|
DescriptionListItem.displayName = 'DescriptionListItem';
|
|
19
20
|
const styles = StyleSheet.create(theme => ({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
2
|
import type { ViewProps } from 'react-native';
|
|
3
3
|
export interface DescriptionListItemProps extends ViewProps {
|
|
4
4
|
/** Heading / label part */
|
|
@@ -6,12 +6,7 @@ export interface DescriptionListItemProps extends ViewProps {
|
|
|
6
6
|
/** Description / value part */
|
|
7
7
|
description: ReactNode;
|
|
8
8
|
headingWidth?: number;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
linkIcon?: ComponentType;
|
|
12
|
-
linkIconPosition?: 'left' | 'right';
|
|
13
|
-
linkOnPress?: () => void;
|
|
14
|
-
linkTarget?: '_blank' | '_self' | '_parent' | '_top';
|
|
15
|
-
linkShowIcon?: boolean;
|
|
9
|
+
trailingContent?: ReactNode;
|
|
10
|
+
invalidText?: string;
|
|
16
11
|
}
|
|
17
12
|
export default DescriptionListItemProps;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { IndicatorIconButtonProps } from './IndicatorIconButton.props';
|
|
2
|
+
declare const IndicatorIconButton: {
|
|
3
|
+
({ indicator, ...props }: IndicatorIconButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
displayName: string;
|
|
5
|
+
};
|
|
6
|
+
export default IndicatorIconButton;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import { StyleSheet } from 'react-native-unistyles';
|
|
4
|
+
import { UnstyledIconButton } from '../UnstyledIconButton';
|
|
5
|
+
const IndicatorIconButton = ({ indicator = false, ...props }) => {
|
|
6
|
+
return (_jsxs(View, { style: styles.container, children: [_jsx(UnstyledIconButton, { size: "md", ...props }), indicator && _jsx(View, { style: styles.indicator })] }));
|
|
7
|
+
};
|
|
8
|
+
IndicatorIconButton.displayName = 'IndicatorIconButton';
|
|
9
|
+
const styles = StyleSheet.create(theme => ({
|
|
10
|
+
container: {
|
|
11
|
+
position: 'relative',
|
|
12
|
+
width: theme.components.iconButton.unstyled.md.width,
|
|
13
|
+
height: theme.components.iconButton.unstyled.md.height,
|
|
14
|
+
},
|
|
15
|
+
indicator: {
|
|
16
|
+
position: 'absolute',
|
|
17
|
+
top: 2,
|
|
18
|
+
right: 1,
|
|
19
|
+
width: theme.components.indicatorIconButton.indicator.width,
|
|
20
|
+
height: theme.components.indicatorIconButton.indicator.height,
|
|
21
|
+
borderRadius: theme.components.indicatorIconButton.indicator.radius,
|
|
22
|
+
backgroundColor: theme.color.interactive.destructive.surface.strong.default,
|
|
23
|
+
zIndex: 1,
|
|
24
|
+
},
|
|
25
|
+
}));
|
|
26
|
+
export default IndicatorIconButton;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { UnstyledIconButtonProps } from '../UnstyledIconButton';
|
|
2
|
+
export type IndicatorIconButtonProps = Omit<UnstyledIconButtonProps, 'size' | 'disabled' | 'loading'> & {
|
|
3
|
+
/**
|
|
4
|
+
* If `true`, displays a red dot indicator in the top-right corner.
|
|
5
|
+
* @default false
|
|
6
|
+
*/
|
|
7
|
+
indicator?: boolean;
|
|
8
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as IndicatorIconButton } from './IndicatorIconButton';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useLinkContext } from './Link.context';
|
|
3
2
|
import { StyleSheet } from 'react-native-unistyles';
|
|
4
|
-
import {
|
|
3
|
+
import { BodyText } from '../BodyText';
|
|
4
|
+
import { useLinkContext } from './Link.context';
|
|
5
5
|
const LinkText = ({ children, ...props }) => {
|
|
6
6
|
const { inverted, disabled, active } = useLinkContext();
|
|
7
7
|
styles.useVariants({ active, inverted, disabled });
|
|
8
|
-
return (_jsx(
|
|
8
|
+
return (_jsx(BodyText, { size: "md", weight: "semibold", ...props, style: [styles.text, props.style], children: children }));
|
|
9
9
|
};
|
|
10
10
|
LinkText.displayName = 'LinkText';
|
|
11
11
|
const styles = StyleSheet.create(theme => ({
|
|
@@ -2,12 +2,10 @@ import type ListProps from './List.props';
|
|
|
2
2
|
export declare const ListContext: import("react").Context<{
|
|
3
3
|
loading?: ListProps["loading"];
|
|
4
4
|
disabled?: ListProps["disabled"];
|
|
5
|
-
divider?: ListProps["divider"];
|
|
6
5
|
container?: ListProps["container"];
|
|
7
6
|
}>;
|
|
8
7
|
export declare const useListContext: () => {
|
|
9
8
|
loading?: ListProps["loading"];
|
|
10
9
|
disabled?: ListProps["disabled"];
|
|
11
|
-
divider?: ListProps["divider"];
|
|
12
10
|
container?: ListProps["container"];
|
|
13
11
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type ListProps from './List.props';
|
|
2
2
|
declare const List: {
|
|
3
|
-
({ children, heading, helperText,
|
|
3
|
+
({ children, heading, helperText, headerTrailingContent, ...props }: ListProps): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
displayName: string;
|
|
5
5
|
};
|
|
6
6
|
export default List;
|
|
@@ -3,8 +3,8 @@ import React, { useMemo } from 'react';
|
|
|
3
3
|
import { View } from 'react-native';
|
|
4
4
|
import { StyleSheet } from 'react-native-unistyles';
|
|
5
5
|
import { Card } from '../Card';
|
|
6
|
-
import { ListContext } from './List.context';
|
|
7
6
|
import { SectionHeader } from '../SectionHeader';
|
|
7
|
+
import { ListContext } from './List.context';
|
|
8
8
|
import { ListItem } from './ListItem';
|
|
9
9
|
const markFirstListItem = (children) => {
|
|
10
10
|
let found = false;
|
|
@@ -33,8 +33,8 @@ const markFirstListItem = (children) => {
|
|
|
33
33
|
};
|
|
34
34
|
return recursiveClone(children);
|
|
35
35
|
};
|
|
36
|
-
const List = ({ children, heading, helperText,
|
|
37
|
-
const { loading, disabled,
|
|
36
|
+
const List = ({ children, heading, helperText, headerTrailingContent, ...props }) => {
|
|
37
|
+
const { loading, disabled, container = 'none' } = props;
|
|
38
38
|
const containerToCard = {
|
|
39
39
|
variant: container === 'subtleWhite' || container === 'subtleWarmWhite' ? 'subtle' : 'emphasis',
|
|
40
40
|
colorScheme: container === 'subtleWhite' || container === 'emphasisWhite'
|
|
@@ -42,9 +42,9 @@ const List = ({ children, heading, helperText, linkText, linkHref, linkIcon, lin
|
|
|
42
42
|
: 'neutralSubtle',
|
|
43
43
|
};
|
|
44
44
|
const updatedChildren = markFirstListItem(children);
|
|
45
|
-
const value = useMemo(() => ({ loading, disabled,
|
|
45
|
+
const value = useMemo(() => ({ loading, disabled, container }), [loading, disabled, container]);
|
|
46
46
|
styles.useVariants({ disabled });
|
|
47
|
-
return (_jsx(ListContext.Provider, { value: value, children: _jsxs(View, { ...props, style: [styles.container, props.style], children: [heading ? (_jsx(SectionHeader, { heading: heading, helperText: helperText,
|
|
47
|
+
return (_jsx(ListContext.Provider, { value: value, children: _jsxs(View, { ...props, style: [styles.container, props.style], children: [heading ? (_jsx(SectionHeader, { heading: heading, helperText: helperText, trailingContent: headerTrailingContent })) : null, container === 'none' ? (_jsx(View, { children: updatedChildren })) : (_jsx(Card, { ...containerToCard, noPadding: true, style: styles.card, children: _jsx(_Fragment, { children: updatedChildren }) }))] }) }));
|
|
48
48
|
};
|
|
49
49
|
List.displayName = 'List';
|
|
50
50
|
const styles = StyleSheet.create(theme => ({
|
|
@@ -1,18 +1,10 @@
|
|
|
1
1
|
import type { ViewProps } from 'react-native';
|
|
2
|
-
import { ComponentType } from 'react';
|
|
3
2
|
interface ListProps extends ViewProps {
|
|
4
3
|
container?: 'none' | 'subtleWhite' | 'emphasisWhite' | 'subtleWarmWhite' | 'emphasisWarmWhite';
|
|
5
4
|
heading?: string;
|
|
6
5
|
helperText?: string;
|
|
7
|
-
|
|
8
|
-
linkHref?: string;
|
|
9
|
-
linkIcon?: ComponentType;
|
|
10
|
-
linkIconPosition?: 'left' | 'right';
|
|
11
|
-
linkOnPress?: () => void;
|
|
12
|
-
linkTarget?: '_blank' | '_self' | '_parent' | '_top';
|
|
13
|
-
linkShowIcon?: boolean;
|
|
6
|
+
headerTrailingContent?: React.ReactNode;
|
|
14
7
|
disabled?: boolean;
|
|
15
8
|
loading?: boolean;
|
|
16
|
-
divider?: boolean;
|
|
17
9
|
}
|
|
18
10
|
export default ListProps;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type ListActionProps from './ListAction.props';
|
|
2
|
+
declare const ListAction: import("react").ForwardRefExoticComponent<ListActionProps & {
|
|
3
|
+
states?: {
|
|
4
|
+
active?: boolean;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
};
|
|
7
|
+
} & Omit<import("react-native").PressableProps, "children"> & {
|
|
8
|
+
tabIndex?: 0 | -1 | undefined;
|
|
9
|
+
} & {
|
|
10
|
+
children?: import("react").ReactNode | (({ hovered, pressed, focused, focusVisible, disabled, }: {
|
|
11
|
+
hovered?: boolean | undefined;
|
|
12
|
+
pressed?: boolean | undefined;
|
|
13
|
+
focused?: boolean | undefined;
|
|
14
|
+
focusVisible?: boolean | undefined;
|
|
15
|
+
disabled?: boolean | undefined;
|
|
16
|
+
}) => import("react").ReactNode);
|
|
17
|
+
} & import("react").RefAttributes<unknown>>;
|
|
18
|
+
export default ListAction;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { createPressable } from '@gluestack-ui/pressable';
|
|
3
|
+
import { ChevronRightSmallIcon } from '@utilitywarehouse/hearth-react-native-icons';
|
|
4
|
+
import { Pressable } from 'react-native';
|
|
5
|
+
import { StyleSheet } from 'react-native-unistyles';
|
|
6
|
+
import { useListContext } from '../List.context';
|
|
7
|
+
import ListActionContent from './ListActionContent';
|
|
8
|
+
import ListActionText from './ListActionText';
|
|
9
|
+
import ListActionTrailingContent from './ListActionTrailingContent';
|
|
10
|
+
import ListActionTrailingIcon from './ListActionTrailingIcon';
|
|
11
|
+
const ListActionRoot = ({ heading, disabled, variant = 'subtle', ...props }) => {
|
|
12
|
+
const { onPress } = props;
|
|
13
|
+
const listContext = useListContext();
|
|
14
|
+
const { active } = props.states || { active: false };
|
|
15
|
+
const getListContainer = () => {
|
|
16
|
+
if (listContext?.container?.includes('subtle')) {
|
|
17
|
+
return 'subtle';
|
|
18
|
+
}
|
|
19
|
+
if (listContext?.container?.includes('emphasis')) {
|
|
20
|
+
return 'emphasis';
|
|
21
|
+
}
|
|
22
|
+
return undefined;
|
|
23
|
+
};
|
|
24
|
+
const isDisabled = disabled || listContext?.disabled || false;
|
|
25
|
+
const listItemVariant = getListContainer() || variant;
|
|
26
|
+
const testID = props.testID || 'list-action';
|
|
27
|
+
styles.useVariants({
|
|
28
|
+
variant: listItemVariant,
|
|
29
|
+
disabled: isDisabled,
|
|
30
|
+
active,
|
|
31
|
+
showDisabled: !listContext?.disabled && disabled,
|
|
32
|
+
isFirstChild: props.isFirst,
|
|
33
|
+
container: listContext?.container,
|
|
34
|
+
});
|
|
35
|
+
return (_jsxs(Pressable, { ...props, testID: testID, style: [styles.container, props.style], disabled: isDisabled || !onPress, children: [_jsx(ListActionContent, { children: _jsx(ListActionText, { children: heading }) }), _jsx(ListActionTrailingContent, { style: styles.centeredTrailingIcon, children: _jsx(ListActionTrailingIcon, { as: ChevronRightSmallIcon }) })] }));
|
|
36
|
+
};
|
|
37
|
+
const ListAction = createPressable({
|
|
38
|
+
Root: ListActionRoot,
|
|
39
|
+
});
|
|
40
|
+
ListAction.displayName = 'ListAction';
|
|
41
|
+
const styles = StyleSheet.create(theme => ({
|
|
42
|
+
container: {
|
|
43
|
+
paddingVertical: theme.components.list.item.functional.padding,
|
|
44
|
+
paddingHorizontal: theme.components.list.item.functional.padding,
|
|
45
|
+
flexDirection: 'row',
|
|
46
|
+
gap: theme.components.list.item.gap,
|
|
47
|
+
borderTopWidth: theme.borderWidth['1'],
|
|
48
|
+
borderStyle: 'solid',
|
|
49
|
+
variants: {
|
|
50
|
+
isFirstChild: {
|
|
51
|
+
true: {
|
|
52
|
+
borderTopWidth: 0,
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
variant: {
|
|
56
|
+
subtle: {
|
|
57
|
+
borderTopColor: theme.color.border.subtle,
|
|
58
|
+
},
|
|
59
|
+
emphasis: {
|
|
60
|
+
borderTopColor: theme.color.border.strong,
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
active: {
|
|
64
|
+
true: {
|
|
65
|
+
backgroundColor: theme.color.interactive.neutral.surface.subtle.active,
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
disabled: {
|
|
69
|
+
true: {
|
|
70
|
+
cursor: 'auto',
|
|
71
|
+
},
|
|
72
|
+
false: {
|
|
73
|
+
_web: {
|
|
74
|
+
_hover: {
|
|
75
|
+
backgroundColor: theme.color.interactive.neutral.surface.subtle.hover,
|
|
76
|
+
},
|
|
77
|
+
_active: {
|
|
78
|
+
backgroundColor: theme.color.interactive.neutral.surface.subtle.active,
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
showDisabled: {
|
|
84
|
+
true: {
|
|
85
|
+
opacity: theme.opacity.disabled,
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
container: {
|
|
89
|
+
none: {
|
|
90
|
+
paddingHorizontal: 0,
|
|
91
|
+
},
|
|
92
|
+
subtleWhite: {},
|
|
93
|
+
emphasisWhite: {},
|
|
94
|
+
subtleWarmWhite: {},
|
|
95
|
+
emphasisWarmWhite: {},
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
centeredTrailingIcon: {
|
|
100
|
+
justifyContent: 'center',
|
|
101
|
+
},
|
|
102
|
+
}));
|
|
103
|
+
export default ListAction;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import { StyleSheet } from 'react-native-unistyles';
|
|
4
|
+
const ListActionContent = ({ children, ...props }) => {
|
|
5
|
+
return (_jsx(View, { ...props, style: [styles.container, props.style], children: children }));
|
|
6
|
+
};
|
|
7
|
+
ListActionContent.displayName = 'ListActionContent';
|
|
8
|
+
const styles = StyleSheet.create(theme => ({
|
|
9
|
+
container: {
|
|
10
|
+
gap: theme.components.list.item.contentGap,
|
|
11
|
+
flex: 1,
|
|
12
|
+
},
|
|
13
|
+
}));
|
|
14
|
+
export default ListActionContent;
|