@utilitywarehouse/hearth-react-native 0.4.2 → 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 (180) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/.turbo/turbo-lint.log +1 -1
  3. package/CHANGELOG.md +44 -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/DescriptionList/DescriptionList.d.ts +1 -1
  25. package/build/components/DescriptionList/DescriptionList.js +2 -2
  26. package/build/components/DescriptionList/DescriptionList.props.d.ts +1 -8
  27. package/build/components/DescriptionList/DescriptionListItem.d.ts +1 -1
  28. package/build/components/DescriptionList/DescriptionListItem.js +4 -3
  29. package/build/components/DescriptionList/DescriptionListItem.props.d.ts +3 -8
  30. package/build/components/IndicatorIconButton/IndicatorIconButton.d.ts +6 -0
  31. package/build/components/IndicatorIconButton/IndicatorIconButton.js +26 -0
  32. package/build/components/IndicatorIconButton/IndicatorIconButton.props.d.ts +8 -0
  33. package/build/components/IndicatorIconButton/IndicatorIconButton.props.js +1 -0
  34. package/build/components/IndicatorIconButton/index.d.ts +2 -0
  35. package/build/components/IndicatorIconButton/index.js +1 -0
  36. package/build/components/Link/LinkText.js +3 -3
  37. package/build/components/List/List.context.d.ts +0 -2
  38. package/build/components/List/List.d.ts +1 -1
  39. package/build/components/List/List.js +5 -5
  40. package/build/components/List/List.props.d.ts +1 -9
  41. package/build/components/List/ListAction/ListAction.d.ts +18 -0
  42. package/build/components/List/ListAction/ListAction.js +103 -0
  43. package/build/components/List/ListAction/ListAction.props.d.ts +8 -0
  44. package/build/components/List/ListAction/ListAction.props.js +1 -0
  45. package/build/components/List/ListAction/ListActionContent.d.ts +6 -0
  46. package/build/components/List/ListAction/ListActionContent.js +14 -0
  47. package/build/components/List/ListAction/ListActionText.d.ts +6 -0
  48. package/build/components/List/ListAction/ListActionText.js +7 -0
  49. package/build/components/List/ListAction/ListActionTrailingContent.d.ts +6 -0
  50. package/build/components/List/ListAction/ListActionTrailingContent.js +5 -0
  51. package/build/components/List/ListAction/ListActionTrailingIcon.d.ts +9 -0
  52. package/build/components/List/ListAction/ListActionTrailingIcon.js +18 -0
  53. package/build/components/List/ListAction/index.d.ts +6 -0
  54. package/build/components/List/ListAction/index.js +5 -0
  55. package/build/components/List/ListItem/ListItem.context.d.ts +1 -1
  56. package/build/components/List/ListItem/ListItem.props.d.ts +9 -5
  57. package/build/components/List/ListItem/ListItemRoot.d.ts +1 -1
  58. package/build/components/List/ListItem/ListItemRoot.js +10 -12
  59. package/build/components/List/ListItem/index.d.ts +4 -4
  60. package/build/components/List/ListItem/index.js +3 -3
  61. package/build/components/List/index.d.ts +1 -0
  62. package/build/components/List/index.js +1 -0
  63. package/build/components/ProgressStepper/ProgressStep.d.ts +10 -0
  64. package/build/components/ProgressStepper/ProgressStep.js +100 -0
  65. package/build/components/ProgressStepper/ProgressStepper.d.ts +6 -0
  66. package/build/components/ProgressStepper/ProgressStepper.js +22 -0
  67. package/build/components/ProgressStepper/ProgressStepper.props.d.ts +22 -0
  68. package/build/components/ProgressStepper/ProgressStepper.props.js +1 -0
  69. package/build/components/ProgressStepper/ProgressStepperRoot.d.ts +6 -0
  70. package/build/components/ProgressStepper/ProgressStepperRoot.js +16 -0
  71. package/build/components/ProgressStepper/index.d.ts +3 -0
  72. package/build/components/ProgressStepper/index.js +2 -0
  73. package/build/components/SectionHeader/SectionHeader.d.ts +1 -1
  74. package/build/components/SectionHeader/SectionHeader.js +6 -3
  75. package/build/components/SectionHeader/SectionHeader.props.d.ts +9 -16
  76. package/build/components/SectionHeader/SectionHeaderTrailingContent.d.ts +6 -0
  77. package/build/components/SectionHeader/SectionHeaderTrailingContent.js +13 -0
  78. package/build/components/SectionHeader/index.d.ts +1 -0
  79. package/build/components/SectionHeader/index.js +1 -0
  80. package/build/components/Tabs/Tab.js +2 -2
  81. package/build/components/ToggleButton/ToggleButtonText.js +2 -2
  82. package/build/components/UnstyledIconButton/UnstyledIconButton.props.d.ts +4 -1
  83. package/build/components/index.d.ts +3 -0
  84. package/build/components/index.js +3 -0
  85. package/build/core/themes.d.ts +12 -24
  86. package/build/tokens/components/dark/button.d.ts +1 -1
  87. package/build/tokens/components/dark/button.js +1 -1
  88. package/build/tokens/components/dark/dialog.d.ts +1 -0
  89. package/build/tokens/components/dark/dialog.js +1 -0
  90. package/build/tokens/components/dark/illustrations.d.ts +1 -0
  91. package/build/tokens/components/dark/illustrations.js +1 -0
  92. package/build/tokens/components/dark/toast.d.ts +4 -1
  93. package/build/tokens/components/dark/toast.js +4 -1
  94. package/build/tokens/components/light/button.d.ts +1 -1
  95. package/build/tokens/components/light/button.js +1 -1
  96. package/build/tokens/components/light/dialog.d.ts +1 -0
  97. package/build/tokens/components/light/dialog.js +1 -0
  98. package/build/tokens/components/light/illustrations.d.ts +1 -0
  99. package/build/tokens/components/light/illustrations.js +1 -0
  100. package/build/tokens/components/light/toast.d.ts +4 -1
  101. package/build/tokens/components/light/toast.js +4 -1
  102. package/build/tokens/layout.d.ts +6 -12
  103. package/build/tokens/layout.js +3 -6
  104. package/docs/components/AllComponents.web.tsx +86 -4
  105. package/docs/components/BadgeList.tsx +20 -56
  106. package/docs/components/SwitchList.tsx +4 -8
  107. package/docs/getting-started.mdx +30 -14
  108. package/docs/introduction.mdx +1 -1
  109. package/package.json +4 -4
  110. package/src/components/Alert/AlertTitle.tsx +7 -7
  111. package/src/components/Badge/Badge.props.ts +1 -0
  112. package/src/components/Badge/Badge.tsx +3 -2
  113. package/src/components/Button/ButtonRoot.tsx +4 -0
  114. package/src/components/Button/ButtonText.tsx +3 -3
  115. package/src/components/Card/CardRoot.tsx +2 -0
  116. package/src/components/Carousel/Carousel.context.tsx +8 -0
  117. package/src/components/Carousel/Carousel.docs.mdx +389 -0
  118. package/src/components/Carousel/Carousel.props.ts +89 -0
  119. package/src/components/Carousel/Carousel.stories.tsx +317 -0
  120. package/src/components/Carousel/Carousel.tsx +444 -0
  121. package/src/components/Carousel/CarouselControlItem.tsx +87 -0
  122. package/src/components/Carousel/CarouselControls.tsx +150 -0
  123. package/src/components/Carousel/CarouselItem.tsx +68 -0
  124. package/src/components/Carousel/index.ts +6 -0
  125. package/src/components/DescriptionList/DescriptionList.docs.mdx +24 -27
  126. package/src/components/DescriptionList/DescriptionList.props.ts +1 -8
  127. package/src/components/DescriptionList/DescriptionList.stories.tsx +13 -19
  128. package/src/components/DescriptionList/DescriptionList.tsx +2 -14
  129. package/src/components/DescriptionList/DescriptionListItem.props.ts +3 -8
  130. package/src/components/DescriptionList/DescriptionListItem.tsx +13 -21
  131. package/src/components/IndicatorIconButton/IndicatorIconButton.docs.mdx +85 -0
  132. package/src/components/IndicatorIconButton/IndicatorIconButton.props.ts +12 -0
  133. package/src/components/IndicatorIconButton/IndicatorIconButton.stories.tsx +142 -0
  134. package/src/components/IndicatorIconButton/IndicatorIconButton.tsx +36 -0
  135. package/src/components/IndicatorIconButton/index.tsx +2 -0
  136. package/src/components/Link/LinkText.tsx +4 -4
  137. package/src/components/List/List.context.ts +0 -1
  138. package/src/components/List/List.docs.mdx +376 -179
  139. package/src/components/List/List.props.ts +1 -9
  140. package/src/components/List/List.stories.tsx +289 -38
  141. package/src/components/List/List.tsx +5 -26
  142. package/src/components/List/ListAction/ListAction.props.ts +10 -0
  143. package/src/components/List/ListAction/ListAction.tsx +133 -0
  144. package/src/components/List/ListAction/ListActionContent.tsx +21 -0
  145. package/src/components/List/ListAction/ListActionText.tsx +14 -0
  146. package/src/components/List/ListAction/ListActionTrailingContent.tsx +9 -0
  147. package/src/components/List/ListAction/ListActionTrailingIcon.tsx +32 -0
  148. package/src/components/List/ListAction/index.ts +6 -0
  149. package/src/components/List/ListItem/ListItem.context.ts +1 -1
  150. package/src/components/List/ListItem/ListItem.props.ts +9 -5
  151. package/src/components/List/ListItem/ListItemRoot.tsx +18 -14
  152. package/src/components/List/ListItem/index.ts +4 -4
  153. package/src/components/List/index.ts +1 -0
  154. package/src/components/ProgressStepper/ProgressStep.tsx +134 -0
  155. package/src/components/ProgressStepper/ProgressStepper.docs.mdx +87 -0
  156. package/src/components/ProgressStepper/ProgressStepper.props.ts +27 -0
  157. package/src/components/ProgressStepper/ProgressStepper.stories.tsx +108 -0
  158. package/src/components/ProgressStepper/ProgressStepper.tsx +26 -0
  159. package/src/components/ProgressStepper/ProgressStepperRoot.tsx +32 -0
  160. package/src/components/ProgressStepper/index.ts +3 -0
  161. package/src/components/SectionHeader/SectionHeader.props.ts +9 -16
  162. package/src/components/SectionHeader/SectionHeader.stories.tsx +28 -18
  163. package/src/components/SectionHeader/SectionHeader.tsx +18 -19
  164. package/src/components/SectionHeader/SectionHeaderTrailingContent.tsx +20 -0
  165. package/src/components/SectionHeader/Sectionheader.docs.mdx +9 -24
  166. package/src/components/SectionHeader/index.ts +1 -0
  167. package/src/components/Switch/Switch.docs.mdx +0 -4
  168. package/src/components/Tabs/Tab.tsx +4 -2
  169. package/src/components/ToggleButton/ToggleButtonText.tsx +3 -3
  170. package/src/components/UnstyledIconButton/UnstyledIconButton.props.ts +2 -1
  171. package/src/components/index.ts +3 -0
  172. package/src/tokens/components/dark/button.ts +1 -1
  173. package/src/tokens/components/dark/dialog.ts +1 -0
  174. package/src/tokens/components/dark/illustrations.ts +1 -0
  175. package/src/tokens/components/dark/toast.ts +4 -1
  176. package/src/tokens/components/light/button.ts +1 -1
  177. package/src/tokens/components/light/dialog.ts +1 -0
  178. package/src/tokens/components/light/illustrations.ts +1 -0
  179. package/src/tokens/components/light/toast.ts +4 -1
  180. package/src/tokens/layout.ts +3 -6
@@ -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
+ ({ 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,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 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,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, StepState } 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 => ({
@@ -1,5 +1,6 @@
1
- import { ComponentType, Ref } from 'react';
2
- import type { ViewProps, View } from 'react-native';
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
- linkText?: never;
11
- linkHref?: never;
12
- linkOnPress?: never;
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
- linkText?: string;
23
- linkHref?: string;
24
- linkOnPress?: () => void;
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,6 @@
1
+ import { type ViewProps } from 'react-native';
2
+ declare const SectionHeaderTrailingContent: {
3
+ ({ children, ...props }: ViewProps): import("react/jsx-runtime").JSX.Element;
4
+ displayName: string;
5
+ };
6
+ export default SectionHeaderTrailingContent;
@@ -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(DetailText, { size: size, children: children })] }) }));
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 { DetailText } from '../DetailText';
3
+ import { BodyText } from '../BodyText';
4
4
  const ToggleButtonText = ({ children, toggled, ...props }) => {
5
5
  styles.useVariants({ toggled });
6
- return (_jsx(DetailText, { size: "md", ...props, style: [styles.text, props.style], children: children }));
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;
@@ -6,6 +6,7 @@ export * from './BottomSheet';
6
6
  export * from './Box';
7
7
  export * from './Button';
8
8
  export * from './Card';
9
+ export * from './Carousel';
9
10
  export * from './Center';
10
11
  export * from './Checkbox';
11
12
  export * from './CurrencyInput';
@@ -23,12 +24,14 @@ export * from './HTMLElements';
23
24
  export * from './Icon';
24
25
  export * from './IconButton';
25
26
  export * from './IconContainer';
27
+ export * from './IndicatorIconButton';
26
28
  export * from './InlineLink';
27
29
  export * from './Input';
28
30
  export * from './Label';
29
31
  export * from './Link';
30
32
  export * from './List';
31
33
  export * from './Modal';
34
+ export * from './ProgressStepper';
32
35
  export * from './Radio';
33
36
  export * from './RadioCard';
34
37
  export * from './SectionHeader';
@@ -7,6 +7,7 @@ export * from './BottomSheet';
7
7
  export * from './Box';
8
8
  export * from './Button';
9
9
  export * from './Card';
10
+ export * from './Carousel';
10
11
  export * from './Center';
11
12
  export * from './Checkbox';
12
13
  export * from './CurrencyInput';
@@ -24,12 +25,14 @@ export * from './HTMLElements';
24
25
  export * from './Icon';
25
26
  export * from './IconButton';
26
27
  export * from './IconContainer';
28
+ export * from './IndicatorIconButton';
27
29
  export * from './InlineLink';
28
30
  export * from './Input';
29
31
  export * from './Label';
30
32
  export * from './Link';
31
33
  export * from './List';
32
34
  export * from './Modal';
35
+ export * from './ProgressStepper';
33
36
  export * from './Radio';
34
37
  export * from './RadioCard';
35
38
  export * from './SectionHeader';