@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.
Files changed (205) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/.turbo/turbo-lint.log +1 -1
  3. package/CHANGELOG.md +54 -0
  4. package/build/components/Alert/AlertTitle.js +6 -6
  5. package/build/components/Badge/Badge.js +3 -3
  6. package/build/components/Badge/Badge.props.d.ts +1 -0
  7. package/build/components/Button/ButtonRoot.js +4 -0
  8. package/build/components/Button/ButtonText.js +2 -2
  9. package/build/components/Card/CardRoot.js +1 -1
  10. package/build/components/Carousel/Carousel.context.d.ts +4 -0
  11. package/build/components/Carousel/Carousel.context.js +4 -0
  12. package/build/components/Carousel/Carousel.d.ts +6 -0
  13. package/build/components/Carousel/Carousel.js +278 -0
  14. package/build/components/Carousel/Carousel.props.d.ts +65 -0
  15. package/build/components/Carousel/Carousel.props.js +1 -0
  16. package/build/components/Carousel/CarouselControlItem.d.ts +24 -0
  17. package/build/components/Carousel/CarouselControlItem.js +64 -0
  18. package/build/components/Carousel/CarouselControls.d.ts +4 -0
  19. package/build/components/Carousel/CarouselControls.js +74 -0
  20. package/build/components/Carousel/CarouselItem.d.ts +6 -0
  21. package/build/components/Carousel/CarouselItem.js +38 -0
  22. package/build/components/Carousel/index.d.ts +5 -0
  23. package/build/components/Carousel/index.js +5 -0
  24. package/build/components/Checkbox/CheckboxTextContent.d.ts +1 -1
  25. package/build/components/Checkbox/CheckboxTextContent.js +9 -2
  26. package/build/components/CurrencyInput/CurrencyInput.d.ts +1 -1
  27. package/build/components/CurrencyInput/CurrencyInput.js +3 -3
  28. package/build/components/CurrencyInput/CurrencyInput.props.d.ts +2 -2
  29. package/build/components/DescriptionList/DescriptionList.d.ts +1 -1
  30. package/build/components/DescriptionList/DescriptionList.js +2 -2
  31. package/build/components/DescriptionList/DescriptionList.props.d.ts +1 -8
  32. package/build/components/DescriptionList/DescriptionListItem.d.ts +1 -1
  33. package/build/components/DescriptionList/DescriptionListItem.js +4 -3
  34. package/build/components/DescriptionList/DescriptionListItem.props.d.ts +3 -8
  35. package/build/components/IndicatorIconButton/IndicatorIconButton.d.ts +6 -0
  36. package/build/components/IndicatorIconButton/IndicatorIconButton.js +26 -0
  37. package/build/components/IndicatorIconButton/IndicatorIconButton.props.d.ts +8 -0
  38. package/build/components/IndicatorIconButton/IndicatorIconButton.props.js +1 -0
  39. package/build/components/IndicatorIconButton/index.d.ts +2 -0
  40. package/build/components/IndicatorIconButton/index.js +1 -0
  41. package/build/components/Link/LinkText.js +3 -3
  42. package/build/components/List/List.context.d.ts +0 -2
  43. package/build/components/List/List.d.ts +1 -1
  44. package/build/components/List/List.js +5 -5
  45. package/build/components/List/List.props.d.ts +1 -9
  46. package/build/components/List/ListAction/ListAction.d.ts +18 -0
  47. package/build/components/List/ListAction/ListAction.js +103 -0
  48. package/build/components/List/ListAction/ListAction.props.d.ts +8 -0
  49. package/build/components/List/ListAction/ListAction.props.js +1 -0
  50. package/build/components/List/ListAction/ListActionContent.d.ts +6 -0
  51. package/build/components/List/ListAction/ListActionContent.js +14 -0
  52. package/build/components/List/ListAction/ListActionText.d.ts +6 -0
  53. package/build/components/List/ListAction/ListActionText.js +7 -0
  54. package/build/components/List/ListAction/ListActionTrailingContent.d.ts +6 -0
  55. package/build/components/List/ListAction/ListActionTrailingContent.js +5 -0
  56. package/build/components/List/ListAction/ListActionTrailingIcon.d.ts +9 -0
  57. package/build/components/List/ListAction/ListActionTrailingIcon.js +18 -0
  58. package/build/components/List/ListAction/index.d.ts +6 -0
  59. package/build/components/List/ListAction/index.js +5 -0
  60. package/build/components/List/ListItem/ListItem.context.d.ts +1 -1
  61. package/build/components/List/ListItem/ListItem.props.d.ts +9 -5
  62. package/build/components/List/ListItem/ListItemRoot.d.ts +1 -1
  63. package/build/components/List/ListItem/ListItemRoot.js +10 -12
  64. package/build/components/List/ListItem/index.d.ts +4 -4
  65. package/build/components/List/ListItem/index.js +3 -3
  66. package/build/components/List/index.d.ts +1 -0
  67. package/build/components/List/index.js +1 -0
  68. package/build/components/ProgressStepper/ProgressStep.d.ts +10 -0
  69. package/build/components/ProgressStepper/ProgressStep.js +100 -0
  70. package/build/components/ProgressStepper/ProgressStepper.d.ts +6 -0
  71. package/build/components/ProgressStepper/ProgressStepper.js +22 -0
  72. package/build/components/ProgressStepper/ProgressStepper.props.d.ts +22 -0
  73. package/build/components/ProgressStepper/ProgressStepper.props.js +1 -0
  74. package/build/components/ProgressStepper/ProgressStepperRoot.d.ts +6 -0
  75. package/build/components/ProgressStepper/ProgressStepperRoot.js +16 -0
  76. package/build/components/ProgressStepper/index.d.ts +3 -0
  77. package/build/components/ProgressStepper/index.js +2 -0
  78. package/build/components/Radio/RadioTextContent.d.ts +1 -1
  79. package/build/components/Radio/RadioTextContent.js +9 -2
  80. package/build/components/SectionHeader/SectionHeader.d.ts +1 -1
  81. package/build/components/SectionHeader/SectionHeader.js +6 -3
  82. package/build/components/SectionHeader/SectionHeader.props.d.ts +9 -16
  83. package/build/components/SectionHeader/SectionHeaderTrailingContent.d.ts +6 -0
  84. package/build/components/SectionHeader/SectionHeaderTrailingContent.js +13 -0
  85. package/build/components/SectionHeader/index.d.ts +1 -0
  86. package/build/components/SectionHeader/index.js +1 -0
  87. package/build/components/Tabs/Tab.js +2 -2
  88. package/build/components/ToggleButton/ToggleButtonText.js +2 -2
  89. package/build/components/UnstyledIconButton/UnstyledIconButton.props.d.ts +4 -1
  90. package/build/components/index.d.ts +3 -0
  91. package/build/components/index.js +3 -0
  92. package/build/core/themes.d.ts +12 -24
  93. package/build/tokens/components/dark/button.d.ts +1 -1
  94. package/build/tokens/components/dark/button.js +1 -1
  95. package/build/tokens/components/dark/dialog.d.ts +1 -0
  96. package/build/tokens/components/dark/dialog.js +1 -0
  97. package/build/tokens/components/dark/illustrations.d.ts +1 -0
  98. package/build/tokens/components/dark/illustrations.js +1 -0
  99. package/build/tokens/components/dark/toast.d.ts +4 -1
  100. package/build/tokens/components/dark/toast.js +4 -1
  101. package/build/tokens/components/light/button.d.ts +1 -1
  102. package/build/tokens/components/light/button.js +1 -1
  103. package/build/tokens/components/light/dialog.d.ts +1 -0
  104. package/build/tokens/components/light/dialog.js +1 -0
  105. package/build/tokens/components/light/illustrations.d.ts +1 -0
  106. package/build/tokens/components/light/illustrations.js +1 -0
  107. package/build/tokens/components/light/toast.d.ts +4 -1
  108. package/build/tokens/components/light/toast.js +4 -1
  109. package/build/tokens/layout.d.ts +6 -12
  110. package/build/tokens/layout.js +3 -6
  111. package/build/utils/getFlattenedColorValue.js +2 -19
  112. package/build/utils/index.d.ts +1 -0
  113. package/build/utils/index.js +1 -0
  114. package/build/utils/styleUtils.d.ts +0 -4
  115. package/build/utils/styleUtils.js +0 -50
  116. package/build/utils/themeValueHelpers.d.ts +17 -0
  117. package/build/utils/themeValueHelpers.js +54 -0
  118. package/docs/components/AllComponents.web.tsx +86 -4
  119. package/docs/components/BadgeList.tsx +20 -56
  120. package/docs/components/SwitchList.tsx +4 -8
  121. package/docs/getting-started.mdx +37 -13
  122. package/docs/introduction.mdx +51 -6
  123. package/package.json +7 -7
  124. package/src/components/Alert/AlertTitle.tsx +7 -7
  125. package/src/components/Badge/Badge.props.ts +1 -0
  126. package/src/components/Badge/Badge.tsx +3 -2
  127. package/src/components/Button/ButtonRoot.tsx +4 -0
  128. package/src/components/Button/ButtonText.tsx +3 -3
  129. package/src/components/Card/CardRoot.tsx +2 -0
  130. package/src/components/Carousel/Carousel.context.tsx +8 -0
  131. package/src/components/Carousel/Carousel.docs.mdx +389 -0
  132. package/src/components/Carousel/Carousel.props.ts +89 -0
  133. package/src/components/Carousel/Carousel.stories.tsx +317 -0
  134. package/src/components/Carousel/Carousel.tsx +444 -0
  135. package/src/components/Carousel/CarouselControlItem.tsx +87 -0
  136. package/src/components/Carousel/CarouselControls.tsx +150 -0
  137. package/src/components/Carousel/CarouselItem.tsx +68 -0
  138. package/src/components/Carousel/index.ts +6 -0
  139. package/src/components/Checkbox/CheckboxTextContent.tsx +11 -3
  140. package/src/components/CurrencyInput/CurrencyInput.docs.mdx +4 -4
  141. package/src/components/CurrencyInput/CurrencyInput.props.ts +2 -2
  142. package/src/components/CurrencyInput/CurrencyInput.stories.tsx +17 -15
  143. package/src/components/CurrencyInput/CurrencyInput.tsx +3 -3
  144. package/src/components/DescriptionList/DescriptionList.docs.mdx +24 -27
  145. package/src/components/DescriptionList/DescriptionList.props.ts +1 -8
  146. package/src/components/DescriptionList/DescriptionList.stories.tsx +13 -19
  147. package/src/components/DescriptionList/DescriptionList.tsx +2 -14
  148. package/src/components/DescriptionList/DescriptionListItem.props.ts +3 -8
  149. package/src/components/DescriptionList/DescriptionListItem.tsx +13 -21
  150. package/src/components/IndicatorIconButton/IndicatorIconButton.docs.mdx +85 -0
  151. package/src/components/IndicatorIconButton/IndicatorIconButton.props.ts +12 -0
  152. package/src/components/IndicatorIconButton/IndicatorIconButton.stories.tsx +142 -0
  153. package/src/components/IndicatorIconButton/IndicatorIconButton.tsx +36 -0
  154. package/src/components/IndicatorIconButton/index.tsx +2 -0
  155. package/src/components/Link/LinkText.tsx +4 -4
  156. package/src/components/List/List.context.ts +0 -1
  157. package/src/components/List/List.docs.mdx +376 -179
  158. package/src/components/List/List.props.ts +1 -9
  159. package/src/components/List/List.stories.tsx +289 -38
  160. package/src/components/List/List.tsx +5 -26
  161. package/src/components/List/ListAction/ListAction.props.ts +10 -0
  162. package/src/components/List/ListAction/ListAction.tsx +133 -0
  163. package/src/components/List/ListAction/ListActionContent.tsx +21 -0
  164. package/src/components/List/ListAction/ListActionText.tsx +14 -0
  165. package/src/components/List/ListAction/ListActionTrailingContent.tsx +9 -0
  166. package/src/components/List/ListAction/ListActionTrailingIcon.tsx +32 -0
  167. package/src/components/List/ListAction/index.ts +6 -0
  168. package/src/components/List/ListItem/ListItem.context.ts +1 -1
  169. package/src/components/List/ListItem/ListItem.props.ts +9 -5
  170. package/src/components/List/ListItem/ListItemRoot.tsx +18 -14
  171. package/src/components/List/ListItem/index.ts +4 -4
  172. package/src/components/List/index.ts +1 -0
  173. package/src/components/ProgressStepper/ProgressStep.tsx +134 -0
  174. package/src/components/ProgressStepper/ProgressStepper.docs.mdx +87 -0
  175. package/src/components/ProgressStepper/ProgressStepper.props.ts +27 -0
  176. package/src/components/ProgressStepper/ProgressStepper.stories.tsx +108 -0
  177. package/src/components/ProgressStepper/ProgressStepper.tsx +26 -0
  178. package/src/components/ProgressStepper/ProgressStepperRoot.tsx +32 -0
  179. package/src/components/ProgressStepper/index.ts +3 -0
  180. package/src/components/Radio/RadioTextContent.tsx +11 -3
  181. package/src/components/SectionHeader/SectionHeader.props.ts +9 -16
  182. package/src/components/SectionHeader/SectionHeader.stories.tsx +28 -18
  183. package/src/components/SectionHeader/SectionHeader.tsx +18 -19
  184. package/src/components/SectionHeader/SectionHeaderTrailingContent.tsx +20 -0
  185. package/src/components/SectionHeader/Sectionheader.docs.mdx +9 -24
  186. package/src/components/SectionHeader/index.ts +1 -0
  187. package/src/components/Switch/Switch.docs.mdx +0 -4
  188. package/src/components/Tabs/Tab.tsx +4 -2
  189. package/src/components/ToggleButton/ToggleButtonText.tsx +3 -3
  190. package/src/components/UnstyledIconButton/UnstyledIconButton.props.ts +2 -1
  191. package/src/components/index.ts +3 -0
  192. package/src/tokens/components/dark/button.ts +1 -1
  193. package/src/tokens/components/dark/dialog.ts +1 -0
  194. package/src/tokens/components/dark/illustrations.ts +1 -0
  195. package/src/tokens/components/dark/toast.ts +4 -1
  196. package/src/tokens/components/light/button.ts +1 -1
  197. package/src/tokens/components/light/dialog.ts +1 -0
  198. package/src/tokens/components/light/illustrations.ts +1 -0
  199. package/src/tokens/components/light/toast.ts +4 -1
  200. package/src/tokens/layout.ts +3 -6
  201. package/src/utils/getFlattenedColorValue.ts +2 -21
  202. package/src/utils/getStyleValue.ts +0 -3
  203. package/src/utils/index.ts +1 -0
  204. package/src/utils/styleUtils.ts +0 -57
  205. 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;
@@ -0,0 +1,2 @@
1
+ export { default as IndicatorIconButton } from './IndicatorIconButton';
2
+ export type { IndicatorIconButtonProps } from './IndicatorIconButton.props';
@@ -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 { DetailText } from '../DetailText';
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
- <DetailText size="md" {...props} style={[styles.text, props.style]}>
10
+ <BodyText size="md" weight="semibold" {...props} style={[styles.text, props.style]}>
11
11
  {children}
12
- </DetailText>
12
+ </BodyText>
13
13
  );
14
14
  };
15
15
 
@@ -4,7 +4,6 @@ import type ListProps from './List.props';
4
4
  export const ListContext = createContext<{
5
5
  loading?: ListProps['loading'];
6
6
  disabled?: ListProps['disabled'];
7
- divider?: ListProps['divider'];
8
7
  container?: ListProps['container'];
9
8
  }>({});
10
9