@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,142 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import * as Icons from '@utilitywarehouse/hearth-react-native-icons';
|
|
3
|
+
import { ComponentType } from 'react';
|
|
4
|
+
import { VariantTitle } from '../../../docs/components';
|
|
5
|
+
import { Box } from '../Box';
|
|
6
|
+
import { Flex } from '../Flex';
|
|
7
|
+
import { useTheme } from '../../hooks';
|
|
8
|
+
import IndicatorIconButton from './IndicatorIconButton';
|
|
9
|
+
|
|
10
|
+
const meta = {
|
|
11
|
+
title: 'Stories / IndicatorIconButton',
|
|
12
|
+
component: IndicatorIconButton,
|
|
13
|
+
parameters: {
|
|
14
|
+
layout: 'centered',
|
|
15
|
+
},
|
|
16
|
+
argTypes: {
|
|
17
|
+
inverted: {
|
|
18
|
+
type: 'boolean',
|
|
19
|
+
control: 'boolean',
|
|
20
|
+
description: 'To set the button to be inverted. (To only be used on `purple` backgrounds)',
|
|
21
|
+
},
|
|
22
|
+
icon: {
|
|
23
|
+
options: ['none', ...Object.keys(Icons).filter(icon => icon.includes('Medium'))],
|
|
24
|
+
control: 'select',
|
|
25
|
+
description: 'The icon component for the button.',
|
|
26
|
+
},
|
|
27
|
+
pressed: {
|
|
28
|
+
type: 'boolean',
|
|
29
|
+
control: 'boolean',
|
|
30
|
+
description: 'To set the button to be pressed.',
|
|
31
|
+
},
|
|
32
|
+
indicator: {
|
|
33
|
+
type: 'boolean',
|
|
34
|
+
control: 'boolean',
|
|
35
|
+
description: 'To show or hide the red dot indicator.',
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
args: {
|
|
39
|
+
icon: 'BellMediumIcon' as unknown as ComponentType,
|
|
40
|
+
inverted: false,
|
|
41
|
+
pressed: false,
|
|
42
|
+
indicator: true,
|
|
43
|
+
},
|
|
44
|
+
} satisfies Meta<typeof IndicatorIconButton>;
|
|
45
|
+
|
|
46
|
+
export default meta;
|
|
47
|
+
type Story = StoryObj<typeof meta>;
|
|
48
|
+
|
|
49
|
+
export const Playground: Story = {
|
|
50
|
+
render: args => {
|
|
51
|
+
const icon = typeof args.icon === 'string' ? Icons[args.icon as keyof typeof Icons] : args.icon;
|
|
52
|
+
return <IndicatorIconButton {...args} icon={icon} />;
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export const Variants: Story = {
|
|
57
|
+
render: args => {
|
|
58
|
+
const icon = typeof args.icon === 'string' ? Icons[args.icon as keyof typeof Icons] : args.icon;
|
|
59
|
+
return (
|
|
60
|
+
<Flex direction="column" space="xl">
|
|
61
|
+
<Flex direction="row" space="lg">
|
|
62
|
+
<Box>
|
|
63
|
+
<VariantTitle title="Without Indicator" invert={args.inverted}>
|
|
64
|
+
<IndicatorIconButton {...args} icon={icon} indicator={false} />
|
|
65
|
+
</VariantTitle>
|
|
66
|
+
</Box>
|
|
67
|
+
<Box>
|
|
68
|
+
<VariantTitle title="With Indicator" invert={args.inverted}>
|
|
69
|
+
<IndicatorIconButton {...args} icon={icon} indicator={true} />
|
|
70
|
+
</VariantTitle>
|
|
71
|
+
</Box>
|
|
72
|
+
</Flex>
|
|
73
|
+
<Flex direction="row" space="lg">
|
|
74
|
+
<Box style={{ backgroundColor: 'purple', padding: 10, borderRadius: 8 }}>
|
|
75
|
+
<VariantTitle title="Inverted" invert={!args.inverted}>
|
|
76
|
+
<IndicatorIconButton {...args} icon={icon} inverted={true} />
|
|
77
|
+
</VariantTitle>
|
|
78
|
+
</Box>
|
|
79
|
+
</Flex>
|
|
80
|
+
</Flex>
|
|
81
|
+
);
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export const Colourful: Story = {
|
|
86
|
+
render: args => {
|
|
87
|
+
const icon = typeof args.icon === 'string' ? Icons[args.icon as keyof typeof Icons] : args.icon;
|
|
88
|
+
const theme = useTheme();
|
|
89
|
+
|
|
90
|
+
return (
|
|
91
|
+
<Flex direction="column" space="xl">
|
|
92
|
+
<Flex direction="row" space="lg">
|
|
93
|
+
<Box>
|
|
94
|
+
<IndicatorIconButton {...args} icon={icon} iconStyle={{ color: theme.color.energyBlue[500] }} />
|
|
95
|
+
</Box>
|
|
96
|
+
<Box>
|
|
97
|
+
<IndicatorIconButton {...args} icon={icon} iconStyle={{ color: theme.color.cashbackLilac[500] }} />
|
|
98
|
+
</Box>
|
|
99
|
+
</Flex>
|
|
100
|
+
</Flex>
|
|
101
|
+
);
|
|
102
|
+
},
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
export const WithAccessibilityLabel: Story = {
|
|
106
|
+
render: args => {
|
|
107
|
+
return (
|
|
108
|
+
<Flex direction="column" space="xl">
|
|
109
|
+
<Box>
|
|
110
|
+
<VariantTitle title="Notification label" invert={args.inverted}>
|
|
111
|
+
<IndicatorIconButton
|
|
112
|
+
{...args}
|
|
113
|
+
icon={Icons.BellMediumIcon}
|
|
114
|
+
indicator={true}
|
|
115
|
+
accessibilityLabel="New notifications available"
|
|
116
|
+
/>
|
|
117
|
+
</VariantTitle>
|
|
118
|
+
</Box>
|
|
119
|
+
<Box>
|
|
120
|
+
<VariantTitle title="No new actions, cashback section" invert={args.inverted}>
|
|
121
|
+
<IndicatorIconButton
|
|
122
|
+
{...args}
|
|
123
|
+
icon={Icons.CashbackCardMediumIcon}
|
|
124
|
+
indicator={false}
|
|
125
|
+
accessibilityLabel="Cashback section"
|
|
126
|
+
/>
|
|
127
|
+
</VariantTitle>
|
|
128
|
+
</Box>
|
|
129
|
+
<Box>
|
|
130
|
+
<VariantTitle title="New action, cashback section" invert={args.inverted}>
|
|
131
|
+
<IndicatorIconButton
|
|
132
|
+
{...args}
|
|
133
|
+
icon={Icons.CashbackCardMediumIcon}
|
|
134
|
+
indicator={true}
|
|
135
|
+
accessibilityLabel="Cashback section, new transactions"
|
|
136
|
+
/>
|
|
137
|
+
</VariantTitle>
|
|
138
|
+
</Box>
|
|
139
|
+
</Flex>
|
|
140
|
+
);
|
|
141
|
+
},
|
|
142
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import { StyleSheet } from 'react-native-unistyles';
|
|
4
|
+
import { UnstyledIconButton } from '../UnstyledIconButton';
|
|
5
|
+
import { IndicatorIconButtonProps } from './IndicatorIconButton.props';
|
|
6
|
+
|
|
7
|
+
const IndicatorIconButton = ({ indicator = false, ...props }: IndicatorIconButtonProps) => {
|
|
8
|
+
return (
|
|
9
|
+
<View style={styles.container}>
|
|
10
|
+
<UnstyledIconButton size="md" {...props} />
|
|
11
|
+
{indicator && <View style={styles.indicator} />}
|
|
12
|
+
</View>
|
|
13
|
+
);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
IndicatorIconButton.displayName = 'IndicatorIconButton';
|
|
17
|
+
|
|
18
|
+
const styles = StyleSheet.create(theme => ({
|
|
19
|
+
container: {
|
|
20
|
+
position: 'relative',
|
|
21
|
+
width: theme.components.iconButton.unstyled.md.width,
|
|
22
|
+
height: theme.components.iconButton.unstyled.md.height,
|
|
23
|
+
},
|
|
24
|
+
indicator: {
|
|
25
|
+
position: 'absolute',
|
|
26
|
+
top: 2,
|
|
27
|
+
right: 1,
|
|
28
|
+
width: theme.components.indicatorIconButton.indicator.width,
|
|
29
|
+
height: theme.components.indicatorIconButton.indicator.height,
|
|
30
|
+
borderRadius: theme.components.indicatorIconButton.indicator.radius,
|
|
31
|
+
backgroundColor: theme.color.interactive.destructive.surface.strong.default,
|
|
32
|
+
zIndex: 1,
|
|
33
|
+
},
|
|
34
|
+
}));
|
|
35
|
+
|
|
36
|
+
export default IndicatorIconButton;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { TextProps } from 'react-native';
|
|
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
|
|
|
6
6
|
const LinkText = ({ children, ...props }: TextProps) => {
|
|
7
7
|
const { inverted, disabled, active } = useLinkContext();
|
|
8
8
|
styles.useVariants({ active, inverted, disabled });
|
|
9
9
|
return (
|
|
10
|
-
<
|
|
10
|
+
<BodyText size="md" weight="semibold" {...props} style={[styles.text, props.style]}>
|
|
11
11
|
{children}
|
|
12
|
-
</
|
|
12
|
+
</BodyText>
|
|
13
13
|
);
|
|
14
14
|
};
|
|
15
15
|
|