@utilitywarehouse/hearth-react-native 0.6.0 → 0.8.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 (258) hide show
  1. package/.storybook/main.ts +12 -6
  2. package/.turbo/turbo-build.log +1 -1
  3. package/.turbo/turbo-lint.log +1 -1
  4. package/CHANGELOG.md +18 -0
  5. package/build/components/Banner/Banner.d.ts +6 -0
  6. package/build/components/Banner/Banner.js +161 -0
  7. package/build/components/Banner/Banner.props.d.ts +82 -0
  8. package/build/components/Banner/Banner.props.js +1 -0
  9. package/build/components/Banner/index.d.ts +2 -0
  10. package/build/components/Banner/index.js +1 -0
  11. package/build/components/BottomSheet/BottomSheetBackdrop.js +1 -5
  12. package/build/components/BottomSheet/BottomSheetFlatList.js +1 -5
  13. package/build/components/BottomSheet/BottomSheetHandle.js +1 -5
  14. package/build/components/BottomSheet/useBottomSheetLogic.d.ts +1 -1
  15. package/build/components/Button/ButtonIcon.js +2 -1
  16. package/build/components/Button/ButtonRoot.js +2 -6
  17. package/build/components/Button/ButtonText.js +4 -1
  18. package/build/components/Card/Card.context.d.ts +7 -0
  19. package/build/components/Card/CardAction/CardAction.context.d.ts +9 -0
  20. package/build/components/Card/{CardAction.context.js → CardAction/CardAction.context.js} +7 -1
  21. package/build/components/Card/CardAction/CardAction.d.ts +18 -0
  22. package/build/components/Card/CardAction/CardAction.js +7 -0
  23. package/build/components/Card/CardAction/CardAction.props.d.ts +63 -0
  24. package/build/components/Card/CardAction/CardAction.props.js +1 -0
  25. package/build/components/Card/CardAction/CardActionContent.d.ts +6 -0
  26. package/build/components/Card/CardAction/CardActionContent.js +13 -0
  27. package/build/components/Card/CardAction/CardActionHelperText.d.ts +6 -0
  28. package/build/components/Card/CardAction/CardActionHelperText.js +13 -0
  29. package/build/components/Card/CardAction/CardActionIcon.d.ts +9 -0
  30. package/build/components/Card/CardAction/CardActionIcon.js +19 -0
  31. package/build/components/Card/CardAction/CardActionLeadingContent.d.ts +6 -0
  32. package/build/components/Card/CardAction/CardActionLeadingContent.js +5 -0
  33. package/build/components/Card/CardAction/CardActionRoot.d.ts +12 -0
  34. package/build/components/Card/CardAction/CardActionRoot.js +155 -0
  35. package/build/components/Card/CardAction/CardActionText.d.ts +6 -0
  36. package/build/components/Card/CardAction/CardActionText.js +9 -0
  37. package/build/components/Card/CardAction/CardActionTrailingContent.d.ts +6 -0
  38. package/build/components/Card/CardAction/CardActionTrailingContent.js +5 -0
  39. package/build/components/Card/CardAction/CardActionTrailingIcon.d.ts +9 -0
  40. package/build/components/Card/CardAction/CardActionTrailingIcon.js +19 -0
  41. package/build/components/Card/CardAction/index.d.ts +10 -0
  42. package/build/components/Card/CardAction/index.js +9 -0
  43. package/build/components/Card/CardContent.d.ts +6 -0
  44. package/build/components/Card/CardContent.js +33 -0
  45. package/build/components/Card/CardPressHandler.context.d.ts +6 -0
  46. package/build/components/Card/CardPressHandler.context.js +6 -0
  47. package/build/components/Card/{CardAction.d.ts → CardPressHandler.d.ts} +3 -3
  48. package/build/components/Card/CardPressHandler.js +13 -0
  49. package/build/components/Card/CardRoot.js +103 -11
  50. package/build/components/Card/index.d.ts +3 -2
  51. package/build/components/Card/index.js +3 -2
  52. package/build/components/Checkbox/CheckboxIcon.js +2 -1
  53. package/build/components/Container/Container.js +3 -3
  54. package/build/components/CurrencyInput/CurrencyInput.js +1 -1
  55. package/build/components/Expandable/Expandable.d.ts +6 -0
  56. package/build/components/Expandable/Expandable.js +44 -0
  57. package/build/components/Expandable/Expandable.props.d.ts +38 -0
  58. package/build/components/Expandable/Expandable.props.js +1 -0
  59. package/build/components/Expandable/index.d.ts +2 -0
  60. package/build/components/Expandable/index.js +1 -0
  61. package/build/components/ExpandableCard/ExpandableCard.d.ts +6 -0
  62. package/build/components/ExpandableCard/ExpandableCard.js +23 -0
  63. package/build/components/ExpandableCard/ExpandableCard.props.d.ts +69 -0
  64. package/build/components/ExpandableCard/ExpandableCard.props.js +1 -0
  65. package/build/components/ExpandableCard/ExpandableCardContent.d.ts +6 -0
  66. package/build/components/ExpandableCard/ExpandableCardContent.js +14 -0
  67. package/build/components/ExpandableCard/ExpandableCardExpandedContent.d.ts +11 -0
  68. package/build/components/ExpandableCard/ExpandableCardExpandedContent.js +18 -0
  69. package/build/components/ExpandableCard/ExpandableCardGroup.d.ts +6 -0
  70. package/build/components/ExpandableCard/ExpandableCardGroup.js +17 -0
  71. package/build/components/ExpandableCard/ExpandableCardGroup.props.d.ts +25 -0
  72. package/build/components/ExpandableCard/ExpandableCardGroup.props.js +1 -0
  73. package/build/components/ExpandableCard/ExpandableCardHelperText.d.ts +6 -0
  74. package/build/components/ExpandableCard/ExpandableCardHelperText.js +13 -0
  75. package/build/components/ExpandableCard/ExpandableCardIcon.d.ts +9 -0
  76. package/build/components/ExpandableCard/ExpandableCardIcon.js +19 -0
  77. package/build/components/ExpandableCard/ExpandableCardLeadingContent.d.ts +6 -0
  78. package/build/components/ExpandableCard/ExpandableCardLeadingContent.js +5 -0
  79. package/build/components/ExpandableCard/ExpandableCardText.d.ts +6 -0
  80. package/build/components/ExpandableCard/ExpandableCardText.js +7 -0
  81. package/build/components/ExpandableCard/ExpandableCardTrailingContent.d.ts +6 -0
  82. package/build/components/ExpandableCard/ExpandableCardTrailingContent.js +5 -0
  83. package/build/components/ExpandableCard/ExpandableCardTrailingIcon.d.ts +9 -0
  84. package/build/components/ExpandableCard/ExpandableCardTrailingIcon.js +17 -0
  85. package/build/components/ExpandableCard/ExpandableCardTrigger.d.ts +17 -0
  86. package/build/components/ExpandableCard/ExpandableCardTrigger.js +7 -0
  87. package/build/components/ExpandableCard/ExpandableCardTrigger.props.d.ts +44 -0
  88. package/build/components/ExpandableCard/ExpandableCardTrigger.props.js +1 -0
  89. package/build/components/ExpandableCard/ExpandableCardTriggerRoot.d.ts +11 -0
  90. package/build/components/ExpandableCard/ExpandableCardTriggerRoot.js +91 -0
  91. package/build/components/ExpandableCard/index.d.ts +14 -0
  92. package/build/components/ExpandableCard/index.js +11 -0
  93. package/build/components/Helper/HelperIcon.js +2 -1
  94. package/build/components/HighlightBanner/HighlightBanner.d.ts +6 -0
  95. package/build/components/HighlightBanner/HighlightBanner.js +86 -0
  96. package/build/components/HighlightBanner/HighlightBanner.props.d.ts +14 -0
  97. package/build/components/HighlightBanner/HighlightBanner.props.js +1 -0
  98. package/build/components/HighlightBanner/index.d.ts +2 -0
  99. package/build/components/HighlightBanner/index.js +1 -0
  100. package/build/components/Icon/Icon.d.ts +2 -6
  101. package/build/components/IconButton/IconButtonIcon.js +2 -1
  102. package/build/components/IconContainer/IconContainer.d.ts +4 -3
  103. package/build/components/IconContainer/IconContainer.js +3 -3
  104. package/build/components/Input/InputField.js +4 -2
  105. package/build/components/Input/InputIcon.js +2 -1
  106. package/build/components/Link/LinkIcon.js +3 -2
  107. package/build/components/List/ListAction/ListActionTrailingIcon.js +2 -1
  108. package/build/components/List/ListItem/ListItemIcon.js +2 -1
  109. package/build/components/List/ListItem/ListItemTrailingIcon.js +2 -3
  110. package/build/components/Radio/RadioIcon.js +7 -2
  111. package/build/components/RadioCard/RadioCardIcon.js +3 -2
  112. package/build/components/Spinner/Spinner.web.d.ts +2 -1
  113. package/build/components/Switch/Switch.js +5 -3
  114. package/build/components/Textarea/TextareaField.js +1 -1
  115. package/build/components/ToggleButton/ToggleButtonIcon.js +2 -1
  116. package/build/components/ToggleButton/ToggleButtonRoot.js +2 -2
  117. package/build/components/UnstyledIconButton/UnstyledIconButtonIcon.js +2 -1
  118. package/build/components/index.d.ts +5 -1
  119. package/build/components/index.js +5 -1
  120. package/build/core/index.d.ts +3 -3
  121. package/build/core/index.js +3 -3
  122. package/build/core/themes.d.ts +24 -12
  123. package/build/hooks/useColorMode.d.ts +1 -1
  124. package/build/hooks/useColorMode.js +7 -8
  125. package/build/tokens/components/dark/banner.d.ts +19 -0
  126. package/build/tokens/components/dark/banner.js +19 -0
  127. package/build/tokens/components/dark/card-action.d.ts +11 -0
  128. package/build/tokens/components/dark/card-action.js +10 -0
  129. package/build/tokens/components/dark/card-content.d.ts +25 -0
  130. package/build/tokens/components/dark/card-content.js +24 -0
  131. package/build/tokens/components/dark/drawer.d.ts +29 -0
  132. package/build/tokens/components/dark/drawer.js +28 -0
  133. package/build/tokens/components/dark/illustrations.d.ts +0 -1
  134. package/build/tokens/components/dark/illustrations.js +0 -1
  135. package/build/tokens/components/dark/index.d.ts +3 -0
  136. package/build/tokens/components/dark/index.js +3 -0
  137. package/build/tokens/components/light/banner.d.ts +19 -0
  138. package/build/tokens/components/light/banner.js +19 -0
  139. package/build/tokens/components/light/card-action.d.ts +11 -0
  140. package/build/tokens/components/light/card-action.js +10 -0
  141. package/build/tokens/components/light/card-content.d.ts +25 -0
  142. package/build/tokens/components/light/card-content.js +24 -0
  143. package/build/tokens/components/light/drawer.d.ts +29 -0
  144. package/build/tokens/components/light/drawer.js +28 -0
  145. package/build/tokens/components/light/illustrations.d.ts +0 -1
  146. package/build/tokens/components/light/illustrations.js +0 -1
  147. package/build/tokens/components/light/index.d.ts +3 -0
  148. package/build/tokens/components/light/index.js +3 -0
  149. package/build/tokens/layout.d.ts +6 -6
  150. package/build/tokens/layout.js +3 -3
  151. package/build/tokens/typography.d.ts +6 -0
  152. package/build/tokens/typography.js +3 -0
  153. package/docs/components/AllComponents.web.tsx +75 -4
  154. package/docs/components/NextPrevPage.tsx +5 -5
  155. package/docs/components/VariantTitle.tsx +17 -7
  156. package/package.json +16 -14
  157. package/src/components/Banner/Banner.docs.mdx +402 -0
  158. package/src/components/Banner/Banner.props.ts +106 -0
  159. package/src/components/Banner/Banner.stories.tsx +494 -0
  160. package/src/components/Banner/Banner.tsx +264 -0
  161. package/src/components/Banner/index.ts +2 -0
  162. package/src/components/BottomSheet/BottomSheetBackdrop.tsx +1 -2
  163. package/src/components/BottomSheet/BottomSheetFlatList.tsx +1 -3
  164. package/src/components/BottomSheet/BottomSheetHandle.tsx +0 -1
  165. package/src/components/Button/ButtonIcon.tsx +2 -1
  166. package/src/components/Button/ButtonRoot.tsx +2 -6
  167. package/src/components/Button/ButtonText.tsx +4 -1
  168. package/src/components/Card/Card.context.ts +7 -0
  169. package/src/components/Card/Card.docs.mdx +221 -15
  170. package/src/components/Card/Card.stories.tsx +50 -3
  171. package/src/components/Card/CardAction/CardAction.context.ts +22 -0
  172. package/src/components/Card/CardAction/CardAction.props.ts +87 -0
  173. package/src/components/Card/CardAction/CardAction.stories.tsx +265 -0
  174. package/src/components/Card/CardAction/CardAction.tsx +10 -0
  175. package/src/components/Card/CardAction/CardActionContent.tsx +20 -0
  176. package/src/components/Card/CardAction/CardActionHelperText.tsx +21 -0
  177. package/src/components/Card/CardAction/CardActionIcon.tsx +32 -0
  178. package/src/components/Card/CardAction/CardActionLeadingContent.tsx +9 -0
  179. package/src/components/Card/CardAction/CardActionRoot.tsx +258 -0
  180. package/src/components/Card/CardAction/CardActionText.tsx +17 -0
  181. package/src/components/Card/CardAction/CardActionTrailingContent.tsx +9 -0
  182. package/src/components/Card/CardAction/CardActionTrailingIcon.tsx +32 -0
  183. package/src/components/Card/CardAction/index.ts +10 -0
  184. package/src/components/Card/CardContent.tsx +40 -0
  185. package/src/components/Card/CardPressHandler.context.ts +12 -0
  186. package/src/components/Card/CardPressHandler.tsx +20 -0
  187. package/src/components/Card/CardRoot.tsx +128 -13
  188. package/src/components/Card/index.ts +3 -2
  189. package/src/components/Checkbox/CheckboxIcon.tsx +2 -1
  190. package/src/components/Container/Container.tsx +3 -3
  191. package/src/components/CurrencyInput/CurrencyInput.tsx +1 -1
  192. package/src/components/Expandable/Expandable.docs.mdx +201 -0
  193. package/src/components/Expandable/Expandable.props.ts +46 -0
  194. package/src/components/Expandable/Expandable.stories.tsx +284 -0
  195. package/src/components/Expandable/Expandable.tsx +92 -0
  196. package/src/components/Expandable/index.ts +2 -0
  197. package/src/components/ExpandableCard/ExpandableCard.docs.mdx +312 -0
  198. package/src/components/ExpandableCard/ExpandableCard.props.ts +85 -0
  199. package/src/components/ExpandableCard/ExpandableCard.stories.tsx +326 -0
  200. package/src/components/ExpandableCard/ExpandableCard.tsx +76 -0
  201. package/src/components/ExpandableCard/ExpandableCardContent.tsx +21 -0
  202. package/src/components/ExpandableCard/ExpandableCardExpandedContent.tsx +42 -0
  203. package/src/components/ExpandableCard/ExpandableCardGroup.props.ts +31 -0
  204. package/src/components/ExpandableCard/ExpandableCardGroup.tsx +40 -0
  205. package/src/components/ExpandableCard/ExpandableCardHelperText.tsx +21 -0
  206. package/src/components/ExpandableCard/ExpandableCardIcon.tsx +32 -0
  207. package/src/components/ExpandableCard/ExpandableCardLeadingContent.tsx +9 -0
  208. package/src/components/ExpandableCard/ExpandableCardText.tsx +14 -0
  209. package/src/components/ExpandableCard/ExpandableCardTrailingContent.tsx +9 -0
  210. package/src/components/ExpandableCard/ExpandableCardTrailingIcon.tsx +30 -0
  211. package/src/components/ExpandableCard/ExpandableCardTrigger.props.ts +47 -0
  212. package/src/components/ExpandableCard/ExpandableCardTrigger.tsx +10 -0
  213. package/src/components/ExpandableCard/ExpandableCardTriggerRoot.tsx +154 -0
  214. package/src/components/ExpandableCard/index.ts +14 -0
  215. package/src/components/Helper/HelperIcon.tsx +2 -1
  216. package/src/components/HighlightBanner/HighlightBanner.docs.mdx +277 -0
  217. package/src/components/HighlightBanner/HighlightBanner.props.ts +29 -0
  218. package/src/components/HighlightBanner/HighlightBanner.stories.tsx +259 -0
  219. package/src/components/HighlightBanner/HighlightBanner.tsx +122 -0
  220. package/src/components/HighlightBanner/index.ts +2 -0
  221. package/src/components/Icon/Icon.tsx +4 -3
  222. package/src/components/IconButton/IconButtonIcon.tsx +2 -1
  223. package/src/components/IconContainer/IconContainer.tsx +17 -19
  224. package/src/components/Input/InputField.tsx +2 -1
  225. package/src/components/Input/InputIcon.tsx +2 -1
  226. package/src/components/Link/LinkIcon.tsx +3 -2
  227. package/src/components/List/ListAction/ListActionTrailingIcon.tsx +2 -1
  228. package/src/components/List/ListItem/ListItemIcon.tsx +2 -1
  229. package/src/components/List/ListItem/ListItemTrailingIcon.tsx +2 -3
  230. package/src/components/Radio/RadioIcon.tsx +8 -3
  231. package/src/components/RadioCard/RadioCardIcon.tsx +4 -3
  232. package/src/components/Switch/Switch.tsx +10 -5
  233. package/src/components/Switch/Switch.web.tsx +1 -0
  234. package/src/components/Textarea/TextareaField.tsx +1 -1
  235. package/src/components/ToggleButton/ToggleButtonIcon.tsx +2 -1
  236. package/src/components/ToggleButton/ToggleButtonRoot.tsx +2 -2
  237. package/src/components/UnstyledIconButton/UnstyledIconButtonIcon.tsx +2 -1
  238. package/src/components/index.ts +5 -9
  239. package/src/core/index.ts +14 -11
  240. package/src/hooks/useColorMode.ts +9 -12
  241. package/src/tokens/components/dark/banner.ts +19 -0
  242. package/src/tokens/components/dark/card-action.ts +11 -0
  243. package/src/tokens/components/dark/card-content.ts +25 -0
  244. package/src/tokens/components/dark/drawer.ts +29 -0
  245. package/src/tokens/components/dark/illustrations.ts +0 -1
  246. package/src/tokens/components/dark/index.ts +3 -0
  247. package/src/tokens/components/light/banner.ts +19 -0
  248. package/src/tokens/components/light/card-action.ts +11 -0
  249. package/src/tokens/components/light/card-content.ts +25 -0
  250. package/src/tokens/components/light/drawer.ts +29 -0
  251. package/src/tokens/components/light/illustrations.ts +0 -1
  252. package/src/tokens/components/light/index.ts +3 -0
  253. package/src/tokens/layout.ts +3 -3
  254. package/src/tokens/typography.ts +3 -0
  255. package/build/components/Card/CardAction.context.d.ts +0 -6
  256. package/build/components/Card/CardAction.js +0 -13
  257. package/src/components/Card/CardAction.context.ts +0 -12
  258. package/src/components/Card/CardAction.tsx +0 -18
@@ -0,0 +1,47 @@
1
+ import type { ComponentType } from 'react';
2
+ import type { PressableProps } from 'react-native';
3
+ import type BadgeProps from '../Badge/Badge.props';
4
+
5
+ export interface ExpandableCardTriggerProps extends Omit<PressableProps, 'children'> {
6
+ /**
7
+ * The main heading text
8
+ */
9
+ heading?: string;
10
+ /**
11
+ * Optional helper text displayed below the heading
12
+ */
13
+ helperText?: string;
14
+ /**
15
+ * Leading icon component
16
+ */
17
+ leadingIcon?: ComponentType;
18
+ /**
19
+ * Content to display on the left side (e.g., icon, avatar)
20
+ */
21
+ leadingContent?: React.ReactNode;
22
+ /**
23
+ * Optional badge to display
24
+ */
25
+ badge?: BadgeProps;
26
+ /**
27
+ * Position of the badge relative to the heading
28
+ * @default 'bottom'
29
+ */
30
+ badgePosition?: 'top' | 'bottom';
31
+ /**
32
+ * Optional numeric value to display
33
+ */
34
+ numericValue?: string | number;
35
+ /**
36
+ * Whether the expandable card is expanded
37
+ */
38
+ isExpanded: boolean;
39
+ /**
40
+ * Whether the trigger is disabled
41
+ */
42
+ disabled?: boolean;
43
+ /* Optional children */
44
+ children?: React.ReactNode;
45
+ }
46
+
47
+ export default ExpandableCardTriggerProps;
@@ -0,0 +1,10 @@
1
+ import { createPressable } from '@gluestack-ui/pressable';
2
+ import ExpandableCardTriggerRoot from './ExpandableCardTriggerRoot';
3
+
4
+ const ExpandableCardTrigger = createPressable({
5
+ Root: ExpandableCardTriggerRoot,
6
+ });
7
+
8
+ ExpandableCardTrigger.displayName = 'ExpandableCardTrigger';
9
+
10
+ export default ExpandableCardTrigger;
@@ -0,0 +1,154 @@
1
+ import {
2
+ ChevronDownSmallIcon,
3
+ ChevronUpSmallIcon,
4
+ } from '@utilitywarehouse/hearth-react-native-icons';
5
+ import { Pressable, ViewStyle } from 'react-native';
6
+ import { StyleSheet } from 'react-native-unistyles';
7
+ import { Badge } from '../Badge';
8
+ import { DetailText } from '../DetailText';
9
+ import ExpandableCardContent from './ExpandableCardContent';
10
+ import ExpandableCardHelperText from './ExpandableCardHelperText';
11
+ import ExpandableCardIcon from './ExpandableCardIcon';
12
+ import ExpandableCardLeadingContent from './ExpandableCardLeadingContent';
13
+ import ExpandableCardText from './ExpandableCardText';
14
+ import ExpandableCardTrailingContent from './ExpandableCardTrailingContent';
15
+ import ExpandableCardTrailingIcon from './ExpandableCardTrailingIcon';
16
+ import type ExpandableCardTriggerProps from './ExpandableCardTrigger.props';
17
+
18
+ const ExpandableCardTriggerRoot = ({
19
+ heading,
20
+ helperText,
21
+ leadingIcon,
22
+ leadingContent,
23
+ badge,
24
+ badgePosition = 'bottom',
25
+ numericValue,
26
+ isExpanded,
27
+ disabled,
28
+ states,
29
+ children,
30
+ ...props
31
+ }: ExpandableCardTriggerProps & { states?: { active?: boolean; disabled?: boolean } }) => {
32
+ const { active } = states || { active: false };
33
+
34
+ const testID = props.testID || 'expandable-card-trigger';
35
+
36
+ styles.useVariants({
37
+ active,
38
+ disabled: !!disabled,
39
+ });
40
+
41
+ const renderLeadingContent = () => {
42
+ if (leadingIcon) {
43
+ return (
44
+ <ExpandableCardLeadingContent>
45
+ <ExpandableCardIcon as={leadingIcon} />
46
+ </ExpandableCardLeadingContent>
47
+ );
48
+ }
49
+
50
+ if (leadingContent) {
51
+ return <ExpandableCardLeadingContent>{leadingContent}</ExpandableCardLeadingContent>;
52
+ }
53
+
54
+ return null;
55
+ };
56
+
57
+ const renderTopBadge = () => {
58
+ if (badgePosition === 'top' && badge) {
59
+ return <Badge {...badge} />;
60
+ }
61
+ return null;
62
+ };
63
+
64
+ const renderBottomBadge = () => {
65
+ if (badgePosition === 'bottom' && badge) {
66
+ return <Badge {...badge} />;
67
+ }
68
+ return null;
69
+ };
70
+
71
+ const renderDefaultContent = () => (
72
+ <>
73
+ {renderLeadingContent()}
74
+ <ExpandableCardContent>
75
+ {renderTopBadge()}
76
+ <ExpandableCardText>{heading}</ExpandableCardText>
77
+ {helperText && <ExpandableCardHelperText>{helperText}</ExpandableCardHelperText>}
78
+ {renderBottomBadge()}
79
+ </ExpandableCardContent>
80
+ {numericValue && (
81
+ <DetailText size="lg" style={styles.numericValue}>
82
+ {numericValue}
83
+ </DetailText>
84
+ )}
85
+ <ExpandableCardTrailingContent style={styles.chevron}>
86
+ <ExpandableCardTrailingIcon as={isExpanded ? ChevronUpSmallIcon : ChevronDownSmallIcon} />
87
+ </ExpandableCardTrailingContent>
88
+ </>
89
+ );
90
+
91
+ return (
92
+ <Pressable
93
+ {...props}
94
+ testID={testID}
95
+ style={[styles.container, props.style as ViewStyle]}
96
+ disabled={disabled}
97
+ accessibilityRole="button"
98
+ accessibilityState={{ expanded: isExpanded, disabled }}
99
+ accessibilityLabel={`${heading}${helperText ? `, ${helperText}` : ''}`}
100
+ >
101
+ {children || renderDefaultContent()}
102
+ </Pressable>
103
+ );
104
+ };
105
+
106
+ ExpandableCardTriggerRoot.displayName = 'ExpandableCardTriggerRoot';
107
+
108
+ const styles = StyleSheet.create(theme => ({
109
+ container: {
110
+ paddingVertical: theme.components.card.mobile.padding,
111
+ paddingHorizontal: theme.components.card.mobile.padding,
112
+ flexDirection: 'row',
113
+ width: '100%',
114
+ gap: theme.components.expandableCard.gapHorizontal,
115
+ variants: {
116
+ disabled: {
117
+ true: {
118
+ cursor: 'auto',
119
+ opacity: theme.opacity.disabled,
120
+ },
121
+ false: {
122
+ _web: {
123
+ _hover: {
124
+ backgroundColor: theme.color.interactive.neutral.surface.subtle.hover,
125
+ },
126
+ _active: {
127
+ backgroundColor: theme.color.interactive.neutral.surface.subtle.active,
128
+ },
129
+ },
130
+ },
131
+ },
132
+ active: {
133
+ true: {},
134
+ },
135
+ },
136
+ compoundVariants: [
137
+ {
138
+ disabled: false,
139
+ active: true,
140
+ styles: {
141
+ backgroundColor: theme.color.interactive.neutral.surface.subtle.active,
142
+ },
143
+ },
144
+ ],
145
+ },
146
+ chevron: {
147
+ justifyContent: 'center',
148
+ },
149
+ numericValue: {
150
+ alignSelf: 'center',
151
+ },
152
+ }));
153
+
154
+ export default ExpandableCardTriggerRoot;
@@ -0,0 +1,14 @@
1
+ export { default as ExpandableCard } from './ExpandableCard';
2
+ export type { default as ExpandableCardProps } from './ExpandableCard.props';
3
+ export { default as ExpandableCardContent } from './ExpandableCardContent';
4
+ export { default as ExpandableCardExpandedContent } from './ExpandableCardExpandedContent';
5
+ export { default as ExpandableCardGroup } from './ExpandableCardGroup';
6
+ export type { default as ExpandableCardGroupProps } from './ExpandableCardGroup.props';
7
+ export { default as ExpandableCardHelperText } from './ExpandableCardHelperText';
8
+ export { default as ExpandableCardIcon } from './ExpandableCardIcon';
9
+ export { default as ExpandableCardLeadingContent } from './ExpandableCardLeadingContent';
10
+ export { default as ExpandableCardText } from './ExpandableCardText';
11
+ export { default as ExpandableCardTrailingContent } from './ExpandableCardTrailingContent';
12
+ export { default as ExpandableCardTrailingIcon } from './ExpandableCardTrailingIcon';
13
+ export { default as ExpandableCardTrigger } from './ExpandableCardTrigger';
14
+ export type { default as ExpandableCardTriggerProps } from './ExpandableCardTrigger.props';
@@ -12,7 +12,8 @@ const HelperIcon = (props: IconProps) => {
12
12
  <Icon
13
13
  style={
14
14
  Platform.OS === 'web'
15
- ? StyleSheet.compose(styles.icon as StyleProp<ViewStyle>, props.style)
15
+ ? // @ts-expect-error - style prop type issue
16
+ { ...(styles.icon as StyleProp<ViewStyle>), ...props.style }
16
17
  : ([styles.icon as StyleProp<ViewStyle>, props.style] as any)
17
18
  }
18
19
  {...props}
@@ -0,0 +1,277 @@
1
+ import { Canvas, Controls, Meta } from '@storybook/addon-docs/blocks';
2
+ import { Button, Center, HighlightBanner, Link } from '../../';
3
+ import { BackToTopButton, UsageWrap, ViewFigmaButton } from '../../../docs/components';
4
+ import * as Stories from './HighlightBanner.stories';
5
+
6
+ <Meta title="Components / Highlight Banner" />
7
+
8
+ <ViewFigmaButton url="https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR/Hearth-Components---Tokens?node-id=8306-4665&t=qkAoIRb6rKiYkSIE-4" />
9
+
10
+ <BackToTopButton />
11
+
12
+ # Highlight Banner
13
+
14
+ A `HighlightBanner` component is a specialised card layout designed for highlighting featured content with an image. It combines a colored heading banner, an image, and descriptive text with optional action buttons or links. Perfect for promotional content, featured articles, or important announcements.
15
+
16
+ - [Playground](#playground)
17
+ - [Usage](#usage)
18
+ - [Props](#props)
19
+ - [Variants](#variants)
20
+ - [Examples](#examples)
21
+ - [With Button](#with-button)
22
+ - [With Link](#with-link)
23
+ - [Color Variants](#color-variants)
24
+ - [Subtle Variant](#subtle-variant)
25
+ - [Different Images](#different-images)
26
+ - [Custom Image Height](#custom-image-height)
27
+
28
+ ## Playground
29
+
30
+ <Canvas of={Stories.Playground} />
31
+
32
+ <Controls of={Stories.Playground} />
33
+
34
+ ## Usage
35
+
36
+ <UsageWrap>
37
+ <Center>
38
+ <HighlightBanner
39
+ heading="Featured Content"
40
+ headingColor="energy"
41
+ image={{
42
+ source: {
43
+ uri: 'https://images.unsplash.com/photo-1506126613408-eca07ce68773?w=800&q=80',
44
+ },
45
+ }}
46
+ description="This is a description of the featured content that appears below the image."
47
+ />
48
+ </Center>
49
+ </UsageWrap>
50
+
51
+ ```jsx
52
+ import { HighlightBanner } from '@utilitywarehouse/hearth-react-native';
53
+
54
+ const MyComponent = () => (
55
+ <HighlightBanner
56
+ heading="Featured Content"
57
+ headingColor="energy"
58
+ image={{
59
+ source: {
60
+ uri: 'https://example.com/image.jpg',
61
+ },
62
+ }}
63
+ description="This is a description of the featured content."
64
+ />
65
+ );
66
+ ```
67
+
68
+ ## Props
69
+
70
+ | Property | Type | Description | Default |
71
+ | -------------------- | -------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- | ------------ |
72
+ | heading | `string` | The heading text displayed at the top with colored background | `-` |
73
+ | headingColor | `'pig' \| 'energy' \| 'broadband' \| 'mobile' \|` <br />`'insurance' \| 'cashback' \| 'highlight'` | The semantic color scheme for the heading background | `-` |
74
+ | image | `ImageProps` | React Native Image props for the featured image | `-` |
75
+ | imageContainerHeight | `number` | Height of the image container in pixels | `200` |
76
+ | description | `string` | Description text displayed below the image | `-` |
77
+ | link | `ReactElement` | Optional Link component displayed below description | `-` |
78
+ | button | `ReactElement` | Optional Button component displayed below description | `-` |
79
+ | variant | `'emphasis' \| 'subtle'` | Visual style variant with strong or subtle borders | `'emphasis'` |
80
+
81
+ The component also accepts all standard Card props except `noPadding`, `space`, `gap`, `rowGap`, `columnGap`, `flexDirection`, `flexWrap`, `alignItems`, and `justifyContent`.
82
+
83
+ ## Variants
84
+
85
+ The HighlightBanner supports two visual variants:
86
+
87
+ - **emphasis** (default) - Strong borders for clear visual separation
88
+ - **subtle** - Softer borders for a more understated appearance
89
+
90
+ ## Examples
91
+
92
+ ### With Button
93
+
94
+ Add a Button component to provide a clear call-to-action:
95
+
96
+ <Canvas of={Stories.WithButton} />
97
+
98
+ ```jsx
99
+ import { HighlightBanner, Button } from '@utilitywarehouse/hearth-react-native';
100
+
101
+ const MyComponent = () => (
102
+ <HighlightBanner
103
+ heading="New Feature"
104
+ headingColor="energy"
105
+ image={{
106
+ source: {
107
+ uri: 'https://example.com/feature.jpg',
108
+ },
109
+ }}
110
+ description="Check out our latest feature"
111
+ button={<Button onPress={() => console.log('pressed')}>Get Started</Button>}
112
+ />
113
+ );
114
+ ```
115
+
116
+ ### With Link
117
+
118
+ Use a Link component for a lighter-weight action:
119
+
120
+ <Canvas of={Stories.WithLink} />
121
+
122
+ ```jsx
123
+ import { HighlightBanner, Link } from '@utilitywarehouse/hearth-react-native';
124
+
125
+ const MyComponent = () => (
126
+ <HighlightBanner
127
+ heading="Learn More"
128
+ headingColor="broadband"
129
+ image={{
130
+ source: {
131
+ uri: 'https://example.com/info.jpg',
132
+ },
133
+ }}
134
+ description="Explore our documentation"
135
+ link={<Link onPress={() => console.log('pressed')}>Read more</Link>}
136
+ />
137
+ );
138
+ ```
139
+
140
+ ### Color Variants
141
+
142
+ The component supports seven semantic color schemes that automatically apply the appropriate subtle background colors:
143
+
144
+ <Canvas of={Stories.ColorVariants} />
145
+
146
+ ```jsx
147
+ import { HighlightBanner } from '@utilitywarehouse/hearth-react-native';
148
+
149
+ const MyComponent = () => (
150
+ <>
151
+ {/* Energy Blue */}
152
+ <HighlightBanner
153
+ heading="Energy Services"
154
+ headingColor="energy"
155
+ image={{ source: { uri: 'https://example.com/energy.jpg' } }}
156
+ description="Discover our energy solutions"
157
+ />
158
+
159
+ {/* Broadband Green */}
160
+ <HighlightBanner
161
+ heading="Broadband Deals"
162
+ headingColor="broadband"
163
+ image={{ source: { uri: 'https://example.com/broadband.jpg' } }}
164
+ description="Fast and reliable broadband"
165
+ />
166
+
167
+ {/* Insurance Orange */}
168
+ <HighlightBanner
169
+ heading="Insurance Coverage"
170
+ headingColor="insurance"
171
+ image={{ source: { uri: 'https://example.com/insurance.jpg' } }}
172
+ description="Protect what matters most"
173
+ />
174
+
175
+ {/* Mobile Rose */}
176
+ <HighlightBanner
177
+ heading="Mobile Plans"
178
+ headingColor="mobile"
179
+ image={{ source: { uri: 'https://example.com/mobile.jpg' } }}
180
+ description="Stay connected anywhere"
181
+ />
182
+
183
+ {/* Cashback Lilac */}
184
+ <HighlightBanner
185
+ heading="Cashback Rewards"
186
+ headingColor="cashback"
187
+ image={{ source: { uri: 'https://example.com/cashback.jpg' } }}
188
+ description="Earn rewards on your bills"
189
+ />
190
+
191
+ {/* Pig Pink */}
192
+ <HighlightBanner
193
+ heading="Savings Account"
194
+ headingColor="pig"
195
+ image={{ source: { uri: 'https://example.com/savings.jpg' } }}
196
+ description="Save for your future"
197
+ />
198
+
199
+ {/* Highlight Yellow */}
200
+ <HighlightBanner
201
+ heading="Special Offer"
202
+ headingColor="highlight"
203
+ image={{ source: { uri: 'https://example.com/offer.jpg' } }}
204
+ description="Limited time promotion"
205
+ />
206
+ </>
207
+ );
208
+ ```
209
+
210
+ ### Subtle Variant
211
+
212
+ Use the subtle variant for a softer, less prominent appearance:
213
+
214
+ <Canvas of={Stories.SubtleCard} />
215
+
216
+ ```jsx
217
+ import { HighlightBanner } from '@utilitywarehouse/hearth-react-native';
218
+
219
+ const MyComponent = () => (
220
+ <HighlightBanner
221
+ variant="subtle"
222
+ heading="Featured Content"
223
+ headingColor="energy"
224
+ image={{
225
+ source: {
226
+ uri: 'https://example.com/image.jpg',
227
+ },
228
+ }}
229
+ description="This banner has a subtle appearance"
230
+ />
231
+ );
232
+ ```
233
+
234
+ ### Different Images
235
+
236
+ The component works well with various types of imagery:
237
+
238
+ <Canvas of={Stories.DifferentImages} />
239
+
240
+ ### Custom Image Height
241
+
242
+ Control the image container height to suit your content needs:
243
+
244
+ ```jsx
245
+ import { HighlightBanner } from '@utilitywarehouse/hearth-react-native';
246
+
247
+ const MyComponent = () => (
248
+ <>
249
+ {/* Default height (200px) */}
250
+ <HighlightBanner
251
+ heading="Standard Image"
252
+ headingColor="energy"
253
+ image={{ source: { uri: 'https://example.com/image.jpg' } }}
254
+ description="Using default height"
255
+ />
256
+
257
+ {/* Custom height */}
258
+ <HighlightBanner
259
+ heading="Tall Image"
260
+ headingColor="broadband"
261
+ image={{ source: { uri: 'https://example.com/image.jpg' } }}
262
+ imageContainerHeight={300}
263
+ description="Using custom height of 300px"
264
+ />
265
+ </>
266
+ );
267
+ ```
268
+
269
+ ## Best Practices
270
+
271
+ - Use the **energy**, **broadband**, **mobile**, **insurance**, **cashback**, or **pig** colors to align with specific service offerings
272
+ - Use **highlight** for time-sensitive promotions or special offers
273
+ - Keep descriptions concise and scannable
274
+ - Choose between link and button based on the importance of the action - use buttons for primary actions
275
+ - Consider using the subtle variant when displaying multiple banners to reduce visual clutter
276
+ - Ensure images are high quality and relevant to the content
277
+ - Use appropriate image heights based on the aspect ratio of your images
@@ -0,0 +1,29 @@
1
+ import { ReactElement } from 'react';
2
+ import { ImageProps } from 'react-native';
3
+ import CardProps from '../Card/Card.props';
4
+
5
+ interface HighlightBannerProps
6
+ extends Omit<
7
+ CardProps,
8
+ | 'noPadding'
9
+ | 'variant'
10
+ | 'space'
11
+ | 'gap'
12
+ | 'rowGap'
13
+ | 'columnGap'
14
+ | 'flexDirection'
15
+ | 'flexWrap'
16
+ | 'alignItems'
17
+ | 'justifyContent'
18
+ > {
19
+ heading?: string;
20
+ headingColor?: 'pig' | 'energy' | 'broadband' | 'mobile' | 'insurance' | 'cashback' | 'highlight';
21
+ variant?: 'emphasis' | 'subtle';
22
+ image?: ImageProps;
23
+ imageContainerHeight?: number;
24
+ description?: string;
25
+ link?: ReactElement;
26
+ button?: ReactElement;
27
+ }
28
+
29
+ export default HighlightBannerProps;