@utilitywarehouse/hearth-react-native 0.4.2 → 0.6.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 (207) hide show
  1. package/.storybook/main.ts +21 -1
  2. package/.turbo/turbo-build.log +1 -1
  3. package/.turbo/turbo-lint.log +1 -1
  4. package/CHANGELOG.md +52 -0
  5. package/build/components/Alert/AlertTitle.js +6 -6
  6. package/build/components/Badge/Badge.js +3 -3
  7. package/build/components/Badge/Badge.props.d.ts +1 -0
  8. package/build/components/Button/ButtonRoot.js +4 -0
  9. package/build/components/Button/ButtonText.js +2 -2
  10. package/build/components/Card/CardRoot.js +1 -1
  11. package/build/components/Carousel/Carousel.context.d.ts +4 -0
  12. package/build/components/Carousel/Carousel.context.js +4 -0
  13. package/build/components/Carousel/Carousel.d.ts +6 -0
  14. package/build/components/Carousel/Carousel.js +278 -0
  15. package/build/components/Carousel/Carousel.props.d.ts +65 -0
  16. package/build/components/Carousel/Carousel.props.js +1 -0
  17. package/build/components/Carousel/CarouselControlItem.d.ts +24 -0
  18. package/build/components/Carousel/CarouselControlItem.js +64 -0
  19. package/build/components/Carousel/CarouselControls.d.ts +4 -0
  20. package/build/components/Carousel/CarouselControls.js +74 -0
  21. package/build/components/Carousel/CarouselItem.d.ts +6 -0
  22. package/build/components/Carousel/CarouselItem.js +38 -0
  23. package/build/components/Carousel/index.d.ts +5 -0
  24. package/build/components/Carousel/index.js +5 -0
  25. package/build/components/Container/Container.d.ts +6 -0
  26. package/build/components/Container/Container.js +40 -0
  27. package/build/components/Container/Container.props.d.ts +85 -0
  28. package/build/components/Container/Container.props.js +1 -0
  29. package/build/components/Container/index.d.ts +2 -0
  30. package/build/components/Container/index.js +1 -0
  31. package/build/components/DescriptionList/DescriptionList.d.ts +1 -1
  32. package/build/components/DescriptionList/DescriptionList.js +2 -2
  33. package/build/components/DescriptionList/DescriptionList.props.d.ts +1 -8
  34. package/build/components/DescriptionList/DescriptionListItem.d.ts +1 -1
  35. package/build/components/DescriptionList/DescriptionListItem.js +4 -3
  36. package/build/components/DescriptionList/DescriptionListItem.props.d.ts +3 -8
  37. package/build/components/IndicatorIconButton/IndicatorIconButton.d.ts +6 -0
  38. package/build/components/IndicatorIconButton/IndicatorIconButton.js +26 -0
  39. package/build/components/IndicatorIconButton/IndicatorIconButton.props.d.ts +8 -0
  40. package/build/components/IndicatorIconButton/IndicatorIconButton.props.js +1 -0
  41. package/build/components/IndicatorIconButton/index.d.ts +2 -0
  42. package/build/components/IndicatorIconButton/index.js +1 -0
  43. package/build/components/Link/LinkText.js +3 -3
  44. package/build/components/List/List.context.d.ts +0 -2
  45. package/build/components/List/List.d.ts +1 -1
  46. package/build/components/List/List.js +5 -5
  47. package/build/components/List/List.props.d.ts +1 -9
  48. package/build/components/List/ListAction/ListAction.d.ts +18 -0
  49. package/build/components/List/ListAction/ListAction.js +103 -0
  50. package/build/components/List/ListAction/ListAction.props.d.ts +8 -0
  51. package/build/components/List/ListAction/ListAction.props.js +1 -0
  52. package/build/components/List/ListAction/ListActionContent.d.ts +6 -0
  53. package/build/components/List/ListAction/ListActionContent.js +14 -0
  54. package/build/components/List/ListAction/ListActionText.d.ts +6 -0
  55. package/build/components/List/ListAction/ListActionText.js +7 -0
  56. package/build/components/List/ListAction/ListActionTrailingContent.d.ts +6 -0
  57. package/build/components/List/ListAction/ListActionTrailingContent.js +5 -0
  58. package/build/components/List/ListAction/ListActionTrailingIcon.d.ts +9 -0
  59. package/build/components/List/ListAction/ListActionTrailingIcon.js +18 -0
  60. package/build/components/List/ListAction/index.d.ts +6 -0
  61. package/build/components/List/ListAction/index.js +5 -0
  62. package/build/components/List/ListItem/ListItem.context.d.ts +1 -1
  63. package/build/components/List/ListItem/ListItem.props.d.ts +9 -5
  64. package/build/components/List/ListItem/ListItemRoot.d.ts +1 -1
  65. package/build/components/List/ListItem/ListItemRoot.js +10 -12
  66. package/build/components/List/ListItem/index.d.ts +4 -4
  67. package/build/components/List/ListItem/index.js +3 -3
  68. package/build/components/List/index.d.ts +1 -0
  69. package/build/components/List/index.js +1 -0
  70. package/build/components/ProgressStepper/ProgressStep.d.ts +10 -0
  71. package/build/components/ProgressStepper/ProgressStep.js +100 -0
  72. package/build/components/ProgressStepper/ProgressStepper.d.ts +6 -0
  73. package/build/components/ProgressStepper/ProgressStepper.js +22 -0
  74. package/build/components/ProgressStepper/ProgressStepper.props.d.ts +22 -0
  75. package/build/components/ProgressStepper/ProgressStepper.props.js +1 -0
  76. package/build/components/ProgressStepper/ProgressStepperRoot.d.ts +6 -0
  77. package/build/components/ProgressStepper/ProgressStepperRoot.js +16 -0
  78. package/build/components/ProgressStepper/index.d.ts +3 -0
  79. package/build/components/ProgressStepper/index.js +2 -0
  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/ThemedImage/ThemedImage.d.ts +12 -0
  89. package/build/components/ThemedImage/ThemedImage.js +27 -0
  90. package/build/components/ThemedImage/ThemedImage.props.d.ts +13 -0
  91. package/build/components/ThemedImage/ThemedImage.props.js +1 -0
  92. package/build/components/ThemedImage/index.d.ts +2 -0
  93. package/build/components/ThemedImage/index.js +1 -0
  94. package/build/components/ToggleButton/ToggleButtonText.js +2 -2
  95. package/build/components/UnstyledIconButton/UnstyledIconButton.props.d.ts +4 -1
  96. package/build/components/index.d.ts +5 -0
  97. package/build/components/index.js +5 -0
  98. package/build/core/themes.d.ts +12 -24
  99. package/build/hooks/useStyleProps.js +1 -1
  100. package/build/tokens/components/dark/button.d.ts +1 -1
  101. package/build/tokens/components/dark/button.js +1 -1
  102. package/build/tokens/components/dark/dialog.d.ts +1 -0
  103. package/build/tokens/components/dark/dialog.js +1 -0
  104. package/build/tokens/components/dark/illustrations.d.ts +1 -0
  105. package/build/tokens/components/dark/illustrations.js +1 -0
  106. package/build/tokens/components/dark/toast.d.ts +4 -1
  107. package/build/tokens/components/dark/toast.js +4 -1
  108. package/build/tokens/components/light/button.d.ts +1 -1
  109. package/build/tokens/components/light/button.js +1 -1
  110. package/build/tokens/components/light/dialog.d.ts +1 -0
  111. package/build/tokens/components/light/dialog.js +1 -0
  112. package/build/tokens/components/light/illustrations.d.ts +1 -0
  113. package/build/tokens/components/light/illustrations.js +1 -0
  114. package/build/tokens/components/light/toast.d.ts +4 -1
  115. package/build/tokens/components/light/toast.js +4 -1
  116. package/build/tokens/layout.d.ts +6 -12
  117. package/build/tokens/layout.js +3 -6
  118. package/docs/components/AllComponents.web.tsx +122 -5
  119. package/docs/components/BadgeList.tsx +20 -56
  120. package/docs/components/SwitchList.tsx +4 -8
  121. package/docs/getting-started.mdx +30 -14
  122. package/docs/introduction.mdx +1 -1
  123. package/docs/layout-components.docs.mdx +30 -0
  124. package/package.json +6 -4
  125. package/src/components/Alert/AlertTitle.tsx +7 -7
  126. package/src/components/Badge/Badge.props.ts +1 -0
  127. package/src/components/Badge/Badge.tsx +3 -2
  128. package/src/components/Button/ButtonRoot.tsx +4 -0
  129. package/src/components/Button/ButtonText.tsx +3 -3
  130. package/src/components/Card/CardRoot.tsx +2 -0
  131. package/src/components/Carousel/Carousel.context.tsx +8 -0
  132. package/src/components/Carousel/Carousel.docs.mdx +389 -0
  133. package/src/components/Carousel/Carousel.props.ts +89 -0
  134. package/src/components/Carousel/Carousel.stories.tsx +317 -0
  135. package/src/components/Carousel/Carousel.tsx +444 -0
  136. package/src/components/Carousel/CarouselControlItem.tsx +87 -0
  137. package/src/components/Carousel/CarouselControls.tsx +150 -0
  138. package/src/components/Carousel/CarouselItem.tsx +68 -0
  139. package/src/components/Carousel/index.ts +6 -0
  140. package/src/components/Container/Container.docs.mdx +168 -0
  141. package/src/components/Container/Container.props.ts +89 -0
  142. package/src/components/Container/Container.stories.tsx +274 -0
  143. package/src/components/Container/Container.tsx +52 -0
  144. package/src/components/Container/index.tsx +2 -0
  145. package/src/components/DescriptionList/DescriptionList.docs.mdx +24 -27
  146. package/src/components/DescriptionList/DescriptionList.props.ts +1 -8
  147. package/src/components/DescriptionList/DescriptionList.stories.tsx +13 -19
  148. package/src/components/DescriptionList/DescriptionList.tsx +2 -14
  149. package/src/components/DescriptionList/DescriptionListItem.props.ts +3 -8
  150. package/src/components/DescriptionList/DescriptionListItem.tsx +13 -21
  151. package/src/components/IndicatorIconButton/IndicatorIconButton.docs.mdx +85 -0
  152. package/src/components/IndicatorIconButton/IndicatorIconButton.props.ts +12 -0
  153. package/src/components/IndicatorIconButton/IndicatorIconButton.stories.tsx +142 -0
  154. package/src/components/IndicatorIconButton/IndicatorIconButton.tsx +36 -0
  155. package/src/components/IndicatorIconButton/index.tsx +2 -0
  156. package/src/components/Link/LinkText.tsx +4 -4
  157. package/src/components/List/List.context.ts +0 -1
  158. package/src/components/List/List.docs.mdx +376 -179
  159. package/src/components/List/List.props.ts +1 -9
  160. package/src/components/List/List.stories.tsx +289 -38
  161. package/src/components/List/List.tsx +5 -26
  162. package/src/components/List/ListAction/ListAction.props.ts +10 -0
  163. package/src/components/List/ListAction/ListAction.tsx +133 -0
  164. package/src/components/List/ListAction/ListActionContent.tsx +21 -0
  165. package/src/components/List/ListAction/ListActionText.tsx +14 -0
  166. package/src/components/List/ListAction/ListActionTrailingContent.tsx +9 -0
  167. package/src/components/List/ListAction/ListActionTrailingIcon.tsx +32 -0
  168. package/src/components/List/ListAction/index.ts +6 -0
  169. package/src/components/List/ListItem/ListItem.context.ts +1 -1
  170. package/src/components/List/ListItem/ListItem.props.ts +9 -5
  171. package/src/components/List/ListItem/ListItemRoot.tsx +18 -14
  172. package/src/components/List/ListItem/index.ts +4 -4
  173. package/src/components/List/index.ts +1 -0
  174. package/src/components/ProgressStepper/ProgressStep.tsx +134 -0
  175. package/src/components/ProgressStepper/ProgressStepper.docs.mdx +87 -0
  176. package/src/components/ProgressStepper/ProgressStepper.props.ts +27 -0
  177. package/src/components/ProgressStepper/ProgressStepper.stories.tsx +108 -0
  178. package/src/components/ProgressStepper/ProgressStepper.tsx +26 -0
  179. package/src/components/ProgressStepper/ProgressStepperRoot.tsx +32 -0
  180. package/src/components/ProgressStepper/index.ts +3 -0
  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/ThemedImage/ThemedImage.docs.mdx +208 -0
  190. package/src/components/ThemedImage/ThemedImage.props.ts +15 -0
  191. package/src/components/ThemedImage/ThemedImage.stories.tsx +175 -0
  192. package/src/components/ThemedImage/ThemedImage.tsx +34 -0
  193. package/src/components/ThemedImage/index.tsx +2 -0
  194. package/src/components/ToggleButton/ToggleButtonText.tsx +3 -3
  195. package/src/components/UnstyledIconButton/UnstyledIconButton.props.ts +2 -1
  196. package/src/components/index.ts +5 -0
  197. package/src/hooks/useStyleProps.ts +1 -1
  198. package/src/tokens/components/dark/button.ts +1 -1
  199. package/src/tokens/components/dark/dialog.ts +1 -0
  200. package/src/tokens/components/dark/illustrations.ts +1 -0
  201. package/src/tokens/components/dark/toast.ts +4 -1
  202. package/src/tokens/components/light/button.ts +1 -1
  203. package/src/tokens/components/light/dialog.ts +1 -0
  204. package/src/tokens/components/light/illustrations.ts +1 -0
  205. package/src/tokens/components/light/toast.ts +4 -1
  206. package/src/tokens/layout.ts +3 -6
  207. package/src/vite-env.d.ts +6 -0
@@ -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,8 @@
1
+ import type { PressableProps } from 'react-native';
2
+ interface ListActionProps extends Omit<PressableProps, 'children'> {
3
+ heading: string;
4
+ disabled?: boolean;
5
+ variant?: 'subtle' | 'emphasis';
6
+ isFirst?: boolean;
7
+ }
8
+ export default ListActionProps;
@@ -0,0 +1,6 @@
1
+ import { type ViewProps } from 'react-native';
2
+ declare const ListActionContent: {
3
+ ({ children, ...props }: ViewProps): import("react/jsx-runtime").JSX.Element;
4
+ displayName: string;
5
+ };
6
+ export default ListActionContent;
@@ -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;
@@ -0,0 +1,6 @@
1
+ import { TextProps } from 'react-native';
2
+ declare const ListActionText: {
3
+ ({ children, ...props }: TextProps): import("react/jsx-runtime").JSX.Element;
4
+ displayName: string;
5
+ };
6
+ export default ListActionText;
@@ -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,6 @@
1
+ import { type ViewProps } from 'react-native';
2
+ declare const ListActionTrailingContent: {
3
+ ({ children, ...props }: ViewProps): import("react/jsx-runtime").JSX.Element;
4
+ displayName: string;
5
+ };
6
+ export default ListActionTrailingContent;
@@ -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, 'divider' | 'loading' | 'disabled'> {
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 type { ColorValue } from '../../../types';
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
- text?: never;
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
- text: string;
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
- ({ text, helperText, leadingContent, trailingContent, disabled, divider, loading, children, states, variant, ...props }: ListItemProps & {
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 = ({ text, helperText, leadingContent, trailingContent, disabled, divider, loading, children, states, variant = 'subtle', ...props }) => {
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, showDivider, isLoading, isDisabled]);
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: text }), helperText ? _jsx(ListItemHelperText, { children: helperText }) : null] }), trailingContent ? (_jsx(ListItemTrailingContent, { children: trailingContent })) : onPress ? (_jsx(ListItemTrailingContent, { children: _jsx(ListItemTrailingIcon, { as: ChevronRightSmallIcon }) })) : null] })) }) }));
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';
@@ -1,3 +1,4 @@
1
1
  export { default as List } from './List';
2
2
  export { useListContext } from './List.context';
3
+ export * from './ListAction';
3
4
  export * from './ListItem';
@@ -1,3 +1,4 @@
1
1
  export { default as List } from './List';
2
2
  export { useListContext } from './List.context';
3
+ export * from './ListAction';
3
4
  export * from './ListItem';
@@ -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
+ ({ status, 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 = ({ status, index = 0, isLast = false, ...rest }) => {
8
+ styles.useVariants({ status, 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}, ${status}`, ...rest, children: [_jsx(View, { style: styles.step, children: status === 'complete' ? (_jsx(Icon, { as: TickSmallIcon, width: 20, height: 20, style: styles.text })) : status === '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
+ status: {
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
+ status: {
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
+ status: {
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,6 @@
1
+ import ProgressStepperProps from './ProgressStepper.props';
2
+ declare const ProgressStepper: {
3
+ ({ children, ...rest }: ProgressStepperProps): import("react/jsx-runtime").JSX.Element;
4
+ displayName: string;
5
+ };
6
+ export default ProgressStepper;
@@ -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 StepStatus = '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 status of the step
16
+ */
17
+ status: StepStatus;
18
+ }
19
+ export interface ProgressStepperRootProps extends ViewProps {
20
+ children: React.ReactNode;
21
+ }
22
+ export default ProgressStepperProps;
@@ -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;
@@ -0,0 +1,3 @@
1
+ export { default as ProgressStepper } from './ProgressStepper';
2
+ export { default as ProgressStep } from './ProgressStep';
3
+ export type { ProgressStepperProps, ProgressStepProps, StepStatus } from './ProgressStepper.props';
@@ -0,0 +1,2 @@
1
+ export { default as ProgressStepper } from './ProgressStepper';
2
+ export { default as ProgressStep } from './ProgressStep';
@@ -1,6 +1,6 @@
1
1
  import SectionHeaderProps from './SectionHeader.props';
2
2
  declare const SectionHeader: {
3
- ({ heading, helperText, children, style, linkHref, linkIcon, linkIconPosition, linkOnPress, linkShowIcon, linkTarget, linkText, ...props }: SectionHeaderProps): import("react/jsx-runtime").JSX.Element;
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 { Link } from '../Link';
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
- const SectionHeader = ({ heading, helperText, children, style, linkHref, linkIcon, linkIconPosition, linkOnPress, linkShowIcon, linkTarget, linkText, ...props }) => {
9
- 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 })] }), !!linkText && (_jsx(Link, { href: linkHref, onPress: linkOnPress, icon: linkIcon, showIcon: linkShowIcon, iconPosition: linkIconPosition, target: linkTarget, children: linkText }))] })) }));
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 => ({