@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,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { BodyText } from '../../BodyText';
|
|
3
|
+
const ListActionText = ({ children, ...props }) => {
|
|
4
|
+
return (_jsx(BodyText, { size: "md", weight: "semibold", ...props, children: children }));
|
|
5
|
+
};
|
|
6
|
+
ListActionText.displayName = 'ListActionText';
|
|
7
|
+
export default ListActionText;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
const ListActionTrailingContent = ({ children, ...props }) => (_jsx(View, { ...props, children: children }));
|
|
4
|
+
ListActionTrailingContent.displayName = 'ListActionTrailingContent';
|
|
5
|
+
export default ListActionTrailingContent;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ComponentType } from 'react';
|
|
2
|
+
import { IconProps } from '../../Icon';
|
|
3
|
+
declare const ListActionTrailingIcon: {
|
|
4
|
+
({ children, ...props }: IconProps & {
|
|
5
|
+
as?: ComponentType;
|
|
6
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
displayName: string;
|
|
8
|
+
};
|
|
9
|
+
export default ListActionTrailingIcon;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Platform } from 'react-native';
|
|
3
|
+
import { StyleSheet } from 'react-native-unistyles';
|
|
4
|
+
import { Icon } from '../../Icon';
|
|
5
|
+
const ListActionTrailingIcon = ({ children, ...props }) => {
|
|
6
|
+
return (_jsx(Icon, { ...props, style: Platform.OS === 'web'
|
|
7
|
+
? StyleSheet.compose(styles.icon, props.style)
|
|
8
|
+
: [styles.icon, props.style], children: children }));
|
|
9
|
+
};
|
|
10
|
+
ListActionTrailingIcon.displayName = 'ListActionTrailingIcon';
|
|
11
|
+
const styles = StyleSheet.create(theme => ({
|
|
12
|
+
icon: {
|
|
13
|
+
color: theme.color.icon.primary,
|
|
14
|
+
width: 24,
|
|
15
|
+
height: 24,
|
|
16
|
+
},
|
|
17
|
+
}));
|
|
18
|
+
export default ListActionTrailingIcon;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default as ListAction } from './ListAction';
|
|
2
|
+
export type { default as ListActionProps } from './ListAction.props';
|
|
3
|
+
export { default as ListActionContent } from './ListActionContent';
|
|
4
|
+
export { default as ListActionText } from './ListActionText';
|
|
5
|
+
export { default as ListActionTrailingContent } from './ListActionTrailingContent';
|
|
6
|
+
export { default as ListActionTrailingIcon } from './ListActionTrailingIcon';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { default as ListAction } from './ListAction';
|
|
2
|
+
export { default as ListActionContent } from './ListActionContent';
|
|
3
|
+
export { default as ListActionText } from './ListActionText';
|
|
4
|
+
export { default as ListActionTrailingContent } from './ListActionTrailingContent';
|
|
5
|
+
export { default as ListActionTrailingIcon } from './ListActionTrailingIcon';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import ListItemProps from './ListItem.props';
|
|
2
|
-
export interface IListItemContext extends Pick<ListItemProps, '
|
|
2
|
+
export interface IListItemContext extends Pick<ListItemProps, 'loading' | 'disabled'> {
|
|
3
3
|
showPressed?: boolean;
|
|
4
4
|
active?: boolean;
|
|
5
5
|
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import type { PressableProps, ViewProps } from 'react-native';
|
|
2
|
-
import
|
|
2
|
+
import BadgeProps from '../../Badge/Badge.props';
|
|
3
3
|
interface ListItemBaseProps extends Omit<PressableProps, 'children'> {
|
|
4
|
-
divider?: boolean;
|
|
5
|
-
dividerColor?: ColorValue;
|
|
6
4
|
loading?: boolean;
|
|
7
5
|
disabled?: boolean;
|
|
8
6
|
variant?: 'subtle' | 'emphasis';
|
|
@@ -10,17 +8,23 @@ interface ListItemBaseProps extends Omit<PressableProps, 'children'> {
|
|
|
10
8
|
}
|
|
11
9
|
export interface ListItemWithChildren extends ListItemBaseProps {
|
|
12
10
|
children: ViewProps['children'];
|
|
13
|
-
|
|
11
|
+
heading?: never;
|
|
14
12
|
helperText?: never;
|
|
15
13
|
leadingContent?: never;
|
|
16
14
|
trailingContent?: never;
|
|
15
|
+
numericValue?: never;
|
|
16
|
+
badge?: never;
|
|
17
|
+
badgePosition?: never;
|
|
17
18
|
}
|
|
18
19
|
export interface ListItemWithoutChildren extends ListItemBaseProps {
|
|
19
20
|
children?: never;
|
|
20
|
-
|
|
21
|
+
heading: string;
|
|
21
22
|
helperText?: string;
|
|
22
23
|
leadingContent?: ViewProps['children'];
|
|
23
24
|
trailingContent?: ViewProps['children'];
|
|
25
|
+
numericValue?: string | number;
|
|
26
|
+
badge?: BadgeProps;
|
|
27
|
+
badgePosition?: 'top' | 'bottom';
|
|
24
28
|
}
|
|
25
29
|
type ListItemProps = ListItemWithChildren | ListItemWithoutChildren;
|
|
26
30
|
export default ListItemProps;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type ListItemProps from './ListItem.props';
|
|
2
2
|
declare const ListItemRoot: {
|
|
3
|
-
({
|
|
3
|
+
({ heading, helperText, leadingContent, trailingContent, disabled, loading, children, states, variant, badge, badgePosition, numericValue, ...props }: ListItemProps & {
|
|
4
4
|
states?: {
|
|
5
5
|
active?: boolean;
|
|
6
6
|
disabled?: boolean;
|
|
@@ -3,6 +3,8 @@ import { ChevronRightSmallIcon } from '@utilitywarehouse/hearth-react-native-ico
|
|
|
3
3
|
import { useMemo } from 'react';
|
|
4
4
|
import { Pressable } from 'react-native';
|
|
5
5
|
import { StyleSheet } from 'react-native-unistyles';
|
|
6
|
+
import { Badge } from '../../Badge';
|
|
7
|
+
import { DetailText } from '../../DetailText';
|
|
6
8
|
import { Skeleton } from '../../Skeleton';
|
|
7
9
|
import { useListContext } from '../List.context';
|
|
8
10
|
import { ListItemContext } from './ListItem.context';
|
|
@@ -12,7 +14,7 @@ import ListItemLeadingContent from './ListItemLeadingContent';
|
|
|
12
14
|
import ListItemText from './ListItemText';
|
|
13
15
|
import ListItemTrailingContent from './ListItemTrailingContent';
|
|
14
16
|
import ListItemTrailingIcon from './ListItemTrailingIcon';
|
|
15
|
-
const ListItemRoot = ({
|
|
17
|
+
const ListItemRoot = ({ heading, helperText, leadingContent, trailingContent, disabled, loading, children, states, variant = 'subtle', badge, badgePosition = 'bottom', numericValue, ...props }) => {
|
|
16
18
|
const { onPress } = props;
|
|
17
19
|
const listContext = useListContext();
|
|
18
20
|
const { active } = states || { active: false };
|
|
@@ -27,13 +29,11 @@ const ListItemRoot = ({ text, helperText, leadingContent, trailingContent, disab
|
|
|
27
29
|
};
|
|
28
30
|
const isLoading = loading || listContext?.loading;
|
|
29
31
|
const showPressed = isLoading ? false : !!onPress;
|
|
30
|
-
const showDivider = listContext?.divider ?? divider;
|
|
31
32
|
const isDisabled = disabled || listContext?.disabled || false;
|
|
32
33
|
const listItemVariant = getListContainer() || variant;
|
|
33
34
|
const testID = props.testID || 'list-item';
|
|
34
35
|
const loadingTestID = isLoading ? `${testID}-loading` : testID;
|
|
35
36
|
styles.useVariants({
|
|
36
|
-
divider: showDivider,
|
|
37
37
|
variant: listItemVariant,
|
|
38
38
|
showPressed,
|
|
39
39
|
active,
|
|
@@ -45,16 +45,15 @@ const ListItemRoot = ({ text, helperText, leadingContent, trailingContent, disab
|
|
|
45
45
|
const value = useMemo(() => {
|
|
46
46
|
return {
|
|
47
47
|
showPressed,
|
|
48
|
-
divider: showDivider,
|
|
49
48
|
active,
|
|
50
49
|
loading: isLoading,
|
|
51
50
|
disabled: isDisabled,
|
|
52
51
|
};
|
|
53
|
-
}, [active, showPressed,
|
|
52
|
+
}, [active, showPressed, isLoading, isDisabled]);
|
|
54
53
|
if (loading || listContext?.loading) {
|
|
55
54
|
return (_jsxs(Pressable, { ...props, testID: loadingTestID, style: [styles.container, props.style], disabled: isDisabled, children: [leadingContent ? _jsx(Skeleton, { width: 24, height: 24 }) : null, _jsxs(ListItemContent, { children: [_jsx(Skeleton, { width: "80%", height: 20 }), _jsx(Skeleton, { width: "100%", height: 16 })] }), onPress || trailingContent ? _jsx(Skeleton, { width: 24, height: 24 }) : null] }));
|
|
56
55
|
}
|
|
57
|
-
return (_jsx(ListItemContext.Provider, { value: value, children: _jsx(Pressable, { ...props, testID: testID, style: [styles.container, props.style], disabled: isDisabled, children: children ? (children) : (_jsxs(_Fragment, { children: [leadingContent ? (_jsx(ListItemLeadingContent, { children: leadingContent })) : null, _jsxs(ListItemContent, { children: [_jsx(ListItemText, { children:
|
|
56
|
+
return (_jsx(ListItemContext.Provider, { value: value, children: _jsx(Pressable, { ...props, testID: testID, style: [styles.container, props.style], disabled: isDisabled, accessibilityRole: onPress ? 'button' : undefined, children: children ? (children) : (_jsxs(_Fragment, { children: [leadingContent ? (_jsx(ListItemLeadingContent, { children: leadingContent })) : null, _jsxs(ListItemContent, { children: [badgePosition === 'top' && badge ? _jsx(Badge, { ...badge }) : null, _jsx(ListItemText, { children: heading }), helperText ? _jsx(ListItemHelperText, { children: helperText }) : null, badgePosition === 'bottom' && badge ? _jsx(Badge, { ...badge }) : null] }), !!numericValue && _jsx(DetailText, { size: "lg", children: numericValue }), trailingContent ? (_jsx(ListItemTrailingContent, { children: trailingContent })) : onPress ? (_jsx(ListItemTrailingContent, { style: styles.centeredTrailingIcon, children: _jsx(ListItemTrailingIcon, { as: ChevronRightSmallIcon }) })) : null] })) }) }));
|
|
58
57
|
};
|
|
59
58
|
ListItemRoot.displayName = 'ListItemRoot';
|
|
60
59
|
const styles = StyleSheet.create(theme => ({
|
|
@@ -63,13 +62,9 @@ const styles = StyleSheet.create(theme => ({
|
|
|
63
62
|
paddingHorizontal: theme.components.list.item.functional.padding,
|
|
64
63
|
flexDirection: 'row',
|
|
65
64
|
gap: theme.components.list.item.gap,
|
|
65
|
+
borderTopWidth: theme.borderWidth['1'],
|
|
66
|
+
borderStyle: 'solid',
|
|
66
67
|
variants: {
|
|
67
|
-
divider: {
|
|
68
|
-
true: {
|
|
69
|
-
borderTopWidth: theme.borderWidth['1'],
|
|
70
|
-
borderStyle: 'solid',
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
68
|
isFirstChild: {
|
|
74
69
|
true: {
|
|
75
70
|
borderTopWidth: 0,
|
|
@@ -131,5 +126,8 @@ const styles = StyleSheet.create(theme => ({
|
|
|
131
126
|
},
|
|
132
127
|
],
|
|
133
128
|
},
|
|
129
|
+
centeredTrailingIcon: {
|
|
130
|
+
justifyContent: 'center',
|
|
131
|
+
},
|
|
134
132
|
}));
|
|
135
133
|
export default ListItemRoot;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export { default as ListItem } from './ListItem';
|
|
2
|
-
export { default as ListItemIcon } from './ListItemIcon';
|
|
3
|
-
export { default as ListItemContent } from './ListItemContent';
|
|
4
2
|
export type { default as ListItemProps } from './ListItem.props';
|
|
3
|
+
export { default as ListItemContent } from './ListItemContent';
|
|
4
|
+
export { default as ListItemHelperText } from './ListItemHelperText';
|
|
5
|
+
export { default as ListItemIcon } from './ListItemIcon';
|
|
5
6
|
export { default as ListItemLeadingContent } from './ListItemLeadingContent';
|
|
7
|
+
export { default as ListItemText } from './ListItemText';
|
|
6
8
|
export { default as ListItemTrailingContent } from './ListItemTrailingContent';
|
|
7
9
|
export { default as ListItemTrailingIcon } from './ListItemTrailingIcon';
|
|
8
|
-
export { default as ListItemHelperText } from './ListItemHelperText';
|
|
9
|
-
export { default as ListItemText } from './ListItemText';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export { default as ListItem } from './ListItem';
|
|
2
|
-
export { default as ListItemIcon } from './ListItemIcon';
|
|
3
2
|
export { default as ListItemContent } from './ListItemContent';
|
|
3
|
+
export { default as ListItemHelperText } from './ListItemHelperText';
|
|
4
|
+
export { default as ListItemIcon } from './ListItemIcon';
|
|
4
5
|
export { default as ListItemLeadingContent } from './ListItemLeadingContent';
|
|
6
|
+
export { default as ListItemText } from './ListItemText';
|
|
5
7
|
export { default as ListItemTrailingContent } from './ListItemTrailingContent';
|
|
6
8
|
export { default as ListItemTrailingIcon } from './ListItemTrailingIcon';
|
|
7
|
-
export { default as ListItemHelperText } from './ListItemHelperText';
|
|
8
|
-
export { default as ListItemText } from './ListItemText';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ProgressStepProps } from './ProgressStepper.props';
|
|
2
|
+
interface ProgressStepInternalProps extends ProgressStepProps {
|
|
3
|
+
index?: number;
|
|
4
|
+
isLast?: boolean;
|
|
5
|
+
}
|
|
6
|
+
declare const ProgressStep: {
|
|
7
|
+
({ state, index, isLast, ...rest }: ProgressStepInternalProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
displayName: string;
|
|
9
|
+
};
|
|
10
|
+
export default ProgressStep;
|
|
@@ -0,0 +1,100 @@
|
|
|
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 { TickSmallIcon } from '@utilitywarehouse/hearth-react-native-icons';
|
|
5
|
+
import { Icon } from '../Icon';
|
|
6
|
+
import { BodyText } from '../BodyText';
|
|
7
|
+
const ProgressStep = ({ state, index = 0, isLast = false, ...rest }) => {
|
|
8
|
+
styles.useVariants({ state, isLast });
|
|
9
|
+
const renderStepNumber = () => {
|
|
10
|
+
return (_jsx(BodyText, { size: "md", weight: "semibold", style: styles.text, children: index + 1 }));
|
|
11
|
+
};
|
|
12
|
+
return (_jsxs(View, { style: styles.container, accessible: true, "aria-label": `Step ${index + 1}, ${rest.id}, ${state}`, ...rest, children: [_jsx(View, { style: styles.step, children: state === 'complete' ? (_jsx(Icon, { as: TickSmallIcon, width: 20, height: 20, style: styles.text })) : state === 'active' ? (_jsx(View, { style: styles.inner, children: renderStepNumber() })) : (renderStepNumber()) }), !isLast && _jsx(View, { style: styles.connector })] }));
|
|
13
|
+
};
|
|
14
|
+
ProgressStep.displayName = 'ProgressStep';
|
|
15
|
+
const styles = StyleSheet.create(theme => ({
|
|
16
|
+
container: {
|
|
17
|
+
flexDirection: 'row',
|
|
18
|
+
alignItems: 'center',
|
|
19
|
+
variants: {
|
|
20
|
+
isLast: {
|
|
21
|
+
true: {
|
|
22
|
+
flex: 0,
|
|
23
|
+
_web: {
|
|
24
|
+
flex: 'none',
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
false: {
|
|
28
|
+
flex: 1,
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
step: {
|
|
34
|
+
width: theme.components.progressStepper.indicator.width,
|
|
35
|
+
height: theme.components.progressStepper.indicator.height,
|
|
36
|
+
borderRadius: theme.borderRadius.full,
|
|
37
|
+
alignItems: 'center',
|
|
38
|
+
justifyContent: 'center',
|
|
39
|
+
variants: {
|
|
40
|
+
state: {
|
|
41
|
+
complete: {
|
|
42
|
+
backgroundColor: theme.color.surface.brand.default,
|
|
43
|
+
},
|
|
44
|
+
active: {
|
|
45
|
+
backgroundColor: theme.color.surface.brand.default,
|
|
46
|
+
padding: theme.borderWidth[2],
|
|
47
|
+
},
|
|
48
|
+
incomplete: {
|
|
49
|
+
borderWidth: theme.components.progressStepper.indicator.future.borderWidth,
|
|
50
|
+
borderColor: theme.color.border.subtle,
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
inner: {
|
|
56
|
+
width: theme.components.progressStepper.indicator.width - theme.borderWidth[2] * 2,
|
|
57
|
+
height: theme.components.progressStepper.indicator.height - theme.borderWidth[2] * 2,
|
|
58
|
+
borderRadius: theme.borderRadius.full,
|
|
59
|
+
backgroundColor: theme.color.surface.brand.default,
|
|
60
|
+
borderWidth: theme.borderWidth[2],
|
|
61
|
+
borderColor: theme.color.surface.neutral.subtle,
|
|
62
|
+
alignItems: 'center',
|
|
63
|
+
justifyContent: 'center',
|
|
64
|
+
},
|
|
65
|
+
text: {
|
|
66
|
+
variants: {
|
|
67
|
+
state: {
|
|
68
|
+
complete: {
|
|
69
|
+
color: theme.color.text.inverted,
|
|
70
|
+
},
|
|
71
|
+
active: {
|
|
72
|
+
color: theme.color.text.inverted,
|
|
73
|
+
// NOTE: Adjust lineHeight to vertically center the text within the smaller inner circle
|
|
74
|
+
lineHeight: theme.lineHeight[500] - theme.borderWidth[2] * 2,
|
|
75
|
+
},
|
|
76
|
+
incomplete: {
|
|
77
|
+
color: theme.color.text.primary,
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
connector: {
|
|
83
|
+
flex: 1,
|
|
84
|
+
height: theme.components.progressStepper.bar.height,
|
|
85
|
+
variants: {
|
|
86
|
+
state: {
|
|
87
|
+
complete: {
|
|
88
|
+
backgroundColor: theme.components.progressStepper.bar.complete.backgroundColor,
|
|
89
|
+
},
|
|
90
|
+
active: {
|
|
91
|
+
backgroundColor: theme.color.border.subtle,
|
|
92
|
+
},
|
|
93
|
+
incomplete: {
|
|
94
|
+
backgroundColor: theme.color.border.subtle,
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
}));
|
|
100
|
+
export default ProgressStep;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo, Children, cloneElement, isValidElement } from 'react';
|
|
3
|
+
import ProgressStepperRoot from './ProgressStepperRoot';
|
|
4
|
+
const ProgressStepper = ({ children, ...rest }) => {
|
|
5
|
+
// Process children to add index and isLast props
|
|
6
|
+
const processedChildren = useMemo(() => {
|
|
7
|
+
const childrenArray = Children.toArray(children);
|
|
8
|
+
return childrenArray.map((child, index) => {
|
|
9
|
+
if (isValidElement(child)) {
|
|
10
|
+
return cloneElement(child, {
|
|
11
|
+
...child.props,
|
|
12
|
+
index,
|
|
13
|
+
isLast: index === childrenArray.length - 1,
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
return child;
|
|
17
|
+
});
|
|
18
|
+
}, [children]);
|
|
19
|
+
return _jsx(ProgressStepperRoot, { ...rest, children: processedChildren });
|
|
20
|
+
};
|
|
21
|
+
ProgressStepper.displayName = 'ProgressStepper';
|
|
22
|
+
export default ProgressStepper;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ViewProps } from 'react-native';
|
|
2
|
+
export type StepState = 'complete' | 'active' | 'incomplete';
|
|
3
|
+
export interface ProgressStepperProps extends ViewProps {
|
|
4
|
+
/**
|
|
5
|
+
* Child ProgressStep components
|
|
6
|
+
*/
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export interface ProgressStepProps extends ViewProps {
|
|
10
|
+
/**
|
|
11
|
+
* Unique identifier for the step
|
|
12
|
+
*/
|
|
13
|
+
id: string;
|
|
14
|
+
/**
|
|
15
|
+
* Current state of the step
|
|
16
|
+
*/
|
|
17
|
+
state: StepState;
|
|
18
|
+
}
|
|
19
|
+
export interface ProgressStepperRootProps extends ViewProps {
|
|
20
|
+
children: React.ReactNode;
|
|
21
|
+
}
|
|
22
|
+
export default ProgressStepperProps;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ProgressStepperRootProps } from './ProgressStepper.props';
|
|
2
|
+
declare const ProgressStepperRoot: {
|
|
3
|
+
({ children, style, ...rest }: ProgressStepperRootProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
displayName: string;
|
|
5
|
+
};
|
|
6
|
+
export default ProgressStepperRoot;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import { StyleSheet } from 'react-native-unistyles';
|
|
4
|
+
const ProgressStepperRoot = ({ children, style, ...rest }) => {
|
|
5
|
+
return (_jsx(View, { style: [styles.root, style], ...rest, children: children }));
|
|
6
|
+
};
|
|
7
|
+
ProgressStepperRoot.displayName = 'ProgressStepperRoot';
|
|
8
|
+
const styles = StyleSheet.create(() => ({
|
|
9
|
+
root: {
|
|
10
|
+
flexDirection: 'row',
|
|
11
|
+
alignItems: 'center',
|
|
12
|
+
justifyContent: 'space-between',
|
|
13
|
+
width: '100%',
|
|
14
|
+
},
|
|
15
|
+
}));
|
|
16
|
+
export default ProgressStepperRoot;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import FlexProps from '../Flex/Flex.props';
|
|
2
2
|
declare const RadioTextContent: {
|
|
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 RadioTextContent;
|
|
@@ -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 RadioTextContent = ({ children, ...props }) => {
|
|
4
|
-
return (_jsx(Flex, { direction: "column", space: "none", ...props, children: children }));
|
|
4
|
+
const RadioTextContent = ({ children, style, ...props }) => {
|
|
5
|
+
return (_jsx(Flex, { direction: "column", space: "none", style: [styles.content, style], ...props, children: children }));
|
|
5
6
|
};
|
|
7
|
+
const styles = StyleSheet.create({
|
|
8
|
+
content: {
|
|
9
|
+
flex: 1,
|
|
10
|
+
flexShrink: 1,
|
|
11
|
+
},
|
|
12
|
+
});
|
|
6
13
|
RadioTextContent.displayName = 'RadioTextContent';
|
|
7
14
|
export default RadioTextContent;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import SectionHeaderProps from './SectionHeader.props';
|
|
2
2
|
declare const SectionHeader: {
|
|
3
|
-
({ heading, helperText, children, style,
|
|
3
|
+
({ heading, helperText, children, style, trailingContent, badge, invalidText, ...props }: SectionHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
displayName: string;
|
|
5
5
|
};
|
|
6
6
|
export default SectionHeader;
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } 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
|
-
import {
|
|
5
|
+
import { Badge } from '../Badge';
|
|
6
|
+
import { Helper } from '../Helper';
|
|
5
7
|
import SectionHeaderTitle from './SectionHeaderHeading';
|
|
6
8
|
import SectionHeaderHelperText from './SectionHeaderHelperText';
|
|
7
9
|
import SectionHeaderTextContent from './SectionHeaderTextContent';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
+
import SectionHeaderTrailingContent from './SectionHeaderTrailingContent';
|
|
11
|
+
const SectionHeader = ({ heading, helperText, children, style, trailingContent, badge, invalidText, ...props }) => {
|
|
12
|
+
return (_jsx(View, { ...props, style: [styles.container, style], children: children ? (children) : (_jsxs(_Fragment, { children: [_jsxs(SectionHeaderTextContent, { children: [_jsx(SectionHeaderTitle, { children: heading }), !!helperText && _jsx(SectionHeaderHelperText, { children: helperText }), !!invalidText && (_jsx(Helper, { validationStatus: "invalid", showIcon: true, icon: ErrorCircleSmallIcon, text: invalidText || '' }))] }), !!badge && _jsx(Badge, { ...badge }), !!trailingContent && (_jsx(SectionHeaderTrailingContent, { children: trailingContent }))] })) }));
|
|
10
13
|
};
|
|
11
14
|
SectionHeader.displayName = 'SectionHeader';
|
|
12
15
|
const styles = StyleSheet.create(theme => ({
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type {
|
|
1
|
+
import { Ref } from 'react';
|
|
2
|
+
import type { View, ViewProps } from 'react-native';
|
|
3
|
+
import BadgeProps from '../Badge/Badge.props';
|
|
3
4
|
interface SectionHeaderBaseProps extends Omit<ViewProps, 'children'> {
|
|
4
5
|
ref?: Ref<View>;
|
|
5
6
|
}
|
|
@@ -7,25 +8,17 @@ export interface SectionHeaderWithChildren extends SectionHeaderBaseProps {
|
|
|
7
8
|
children: ViewProps['children'];
|
|
8
9
|
heading?: never;
|
|
9
10
|
helperText?: never;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
linkTarget?: never;
|
|
14
|
-
linkIcon?: never;
|
|
15
|
-
linkIconPosition?: never;
|
|
16
|
-
linkShowIcon?: never;
|
|
11
|
+
trailingContent?: never;
|
|
12
|
+
badge?: never;
|
|
13
|
+
invalidText?: never;
|
|
17
14
|
}
|
|
18
15
|
export interface SectionHeaderWithoutChildren extends SectionHeaderBaseProps {
|
|
19
16
|
children?: never;
|
|
20
17
|
heading: string;
|
|
21
18
|
helperText?: string;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
linkTarget?: '_blank' | '_self' | '_parent' | '_top';
|
|
26
|
-
linkIcon?: ComponentType;
|
|
27
|
-
linkIconPosition?: 'left' | 'right';
|
|
28
|
-
linkShowIcon?: boolean;
|
|
19
|
+
trailingContent?: React.ReactNode;
|
|
20
|
+
badge?: BadgeProps;
|
|
21
|
+
invalidText?: string;
|
|
29
22
|
}
|
|
30
23
|
type SectionHeaderProps = SectionHeaderWithChildren | SectionHeaderWithoutChildren;
|
|
31
24
|
export default SectionHeaderProps;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import { StyleSheet } from 'react-native-unistyles';
|
|
4
|
+
const SectionHeaderTrailingContent = ({ children, ...props }) => {
|
|
5
|
+
return (_jsx(View, { ...props, style: [styles.container, props.style], children: children }));
|
|
6
|
+
};
|
|
7
|
+
SectionHeaderTrailingContent.displayName = 'SectionHeaderTrailingContent';
|
|
8
|
+
const styles = StyleSheet.create({
|
|
9
|
+
container: {
|
|
10
|
+
alignSelf: 'flex-start',
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
export default SectionHeaderTrailingContent;
|
|
@@ -2,3 +2,4 @@ export { default as SectionHeader } from './SectionHeader';
|
|
|
2
2
|
export { default as SectionHeaderHeading } from './SectionHeaderHeading';
|
|
3
3
|
export { default as SectionHeaderHelperText } from './SectionHeaderHelperText';
|
|
4
4
|
export { default as SectionHeaderTextContent } from './SectionHeaderTextContent';
|
|
5
|
+
export { default as SectionHeaderTrailingContent } from './SectionHeaderTrailingContent';
|
|
@@ -2,3 +2,4 @@ export { default as SectionHeader } from './SectionHeader';
|
|
|
2
2
|
export { default as SectionHeaderHeading } from './SectionHeaderHeading';
|
|
3
3
|
export { default as SectionHeaderHelperText } from './SectionHeaderHelperText';
|
|
4
4
|
export { default as SectionHeaderTextContent } from './SectionHeaderTextContent';
|
|
5
|
+
export { default as SectionHeaderTrailingContent } from './SectionHeaderTrailingContent';
|
|
@@ -2,10 +2,10 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useCallback, useRef } from 'react';
|
|
3
3
|
import { Platform, Pressable, View } from 'react-native';
|
|
4
4
|
import { StyleSheet } from 'react-native-unistyles';
|
|
5
|
-
import { DetailText } from '../DetailText';
|
|
6
5
|
import { Icon } from '../Icon';
|
|
7
6
|
import { useTabsContext } from './Tabs.context';
|
|
8
7
|
import { createPressable } from '@gluestack-ui/pressable';
|
|
8
|
+
import { BodyText } from '../BodyText';
|
|
9
9
|
const Tab = ({ value, children, icon, disabled, style, states, ...props }) => {
|
|
10
10
|
const { value: active, select, size, disabled: allDisabled, registerTabLayout, } = useTabsContext();
|
|
11
11
|
const { active: pressed } = states || { active: false };
|
|
@@ -23,7 +23,7 @@ const Tab = ({ value, children, icon, disabled, style, states, ...props }) => {
|
|
|
23
23
|
}, [value, registerTabLayout]);
|
|
24
24
|
return (_jsx(Pressable, { ref: ref, accessibilityRole: "tab", accessibilityState: { selected: isActive, disabled: !!(disabled || allDisabled) }, onPress: handlePress, onLayout: handleLayout, style: [styles.tab, style], ...(Platform.OS === 'web'
|
|
25
25
|
? { id: `tab-${value}`, 'aria-controls': `tabpanel-${value}` }
|
|
26
|
-
: null), ...props, children: _jsxs(View, { style: styles.content, children: [icon ? _jsx(Icon, { as: icon }) : null, _jsx(
|
|
26
|
+
: null), ...props, children: _jsxs(View, { style: styles.content, children: [icon ? _jsx(Icon, { as: icon }) : null, _jsx(BodyText, { size: size, weight: "semibold", children: children })] }) }));
|
|
27
27
|
};
|
|
28
28
|
Tab.displayName = 'Tab';
|
|
29
29
|
const styles = StyleSheet.create(theme => ({
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { StyleSheet } from 'react-native-unistyles';
|
|
3
|
-
import {
|
|
3
|
+
import { BodyText } from '../BodyText';
|
|
4
4
|
const ToggleButtonText = ({ children, toggled, ...props }) => {
|
|
5
5
|
styles.useVariants({ toggled });
|
|
6
|
-
return (_jsx(
|
|
6
|
+
return (_jsx(BodyText, { size: "md", weight: "semibold", ...props, style: [styles.text, props.style], children: children }));
|
|
7
7
|
};
|
|
8
8
|
ToggleButtonText.displayName = 'ToggleButtonText';
|
|
9
9
|
const styles = StyleSheet.create(theme => ({
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ComponentType } from 'react';
|
|
2
2
|
import type { PressableProps, ViewProps } from 'react-native';
|
|
3
|
+
import { ColorValue } from '../../types';
|
|
3
4
|
export type UnstyledIconButtonProps = {
|
|
4
5
|
disabled?: boolean;
|
|
5
6
|
pressed?: boolean;
|
|
@@ -8,5 +9,7 @@ export type UnstyledIconButtonProps = {
|
|
|
8
9
|
size?: 'sm' | 'md';
|
|
9
10
|
inverted?: boolean;
|
|
10
11
|
children?: React.ReactNode;
|
|
11
|
-
iconStyle?: ViewProps['style']
|
|
12
|
+
iconStyle?: ViewProps['style'] & {
|
|
13
|
+
color?: ColorValue;
|
|
14
|
+
};
|
|
12
15
|
} & PressableProps;
|