@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,259 @@
1
+ import { Meta, StoryObj } from '@storybook/react-vite';
2
+ import { View } from 'react-native';
3
+ import { Button } from '../Button';
4
+ import { Flex } from '../Flex';
5
+ import { Link } from '../Link';
6
+ import HighlightBanner from './HighlightBanner';
7
+
8
+ const meta = {
9
+ title: 'Stories / HighlightBanner',
10
+ component: HighlightBanner,
11
+ parameters: {
12
+ layout: 'centered',
13
+ },
14
+ argTypes: {
15
+ heading: {
16
+ control: 'text',
17
+ description: 'The heading text displayed at the top of the card',
18
+ },
19
+ headingColor: {
20
+ control: 'select',
21
+ description: 'The background color for the heading section',
22
+ options: ['pig', 'energy', 'broadband', 'mobile', 'insurance', 'cashback', 'highlight'],
23
+ },
24
+ description: {
25
+ control: 'text',
26
+ description: 'The description text displayed in the footer',
27
+ },
28
+ variant: {
29
+ control: 'select',
30
+ description: 'The variant style of the HighlightBanner',
31
+ options: ['emphasis', 'subtle'],
32
+ },
33
+ },
34
+ args: {
35
+ heading: 'Featured Content',
36
+ headingColor: 'highlight',
37
+ description: 'This is a description of the featured content that appears below the image.',
38
+ image: {
39
+ source: {
40
+ uri: 'https://images.unsplash.com/photo-1506126613408-eca07ce68773?w=800&q=80',
41
+ },
42
+ },
43
+ },
44
+ } satisfies Meta<typeof HighlightBanner>;
45
+
46
+ export default meta;
47
+ type Story = StoryObj<typeof meta>;
48
+
49
+ export const Playground: Story = {
50
+ render: args => {
51
+ return (
52
+ <View style={{ width: 400 }}>
53
+ <HighlightBanner {...args} />
54
+ </View>
55
+ );
56
+ },
57
+ };
58
+
59
+ export const WithButton: Story = {
60
+ render: args => {
61
+ return (
62
+ <View style={{ width: 400 }}>
63
+ <HighlightBanner
64
+ {...args}
65
+ button={<Button onPress={() => console.log('Button pressed')}>Learn More</Button>}
66
+ />
67
+ </View>
68
+ );
69
+ },
70
+ };
71
+
72
+ export const WithLink: Story = {
73
+ render: args => {
74
+ return (
75
+ <View style={{ width: 400 }}>
76
+ <HighlightBanner
77
+ {...args}
78
+ link={<Link onPress={() => console.log('Link pressed')}>View details</Link>}
79
+ />
80
+ </View>
81
+ );
82
+ },
83
+ };
84
+
85
+ export const ColorVariants: Story = {
86
+ render: args => {
87
+ return (
88
+ <View style={{ width: 400 }}>
89
+ <Flex space="lg" direction="column" align="stretch">
90
+ <HighlightBanner
91
+ {...args}
92
+ heading="Energy Blue"
93
+ headingColor="energy"
94
+ image={{
95
+ source: {
96
+ uri: 'https://images.unsplash.com/photo-1473186578172-c141e6798cf4?w=800&q=80',
97
+ },
98
+ }}
99
+ description="Featured content with energy blue heading"
100
+ link={<Link onPress={() => console.log('pressed')}>Learn more</Link>}
101
+ />
102
+ <HighlightBanner
103
+ {...args}
104
+ heading="Broadband Green"
105
+ headingColor="broadband"
106
+ image={{
107
+ source: {
108
+ uri: 'https://images.unsplash.com/photo-1501594907352-04cda38ebc29?w=800&q=80',
109
+ },
110
+ }}
111
+ description="Featured content with broadband green heading"
112
+ />
113
+ <HighlightBanner
114
+ {...args}
115
+ heading="Insurance Orange"
116
+ headingColor="insurance"
117
+ image={{
118
+ source: {
119
+ uri: 'https://images.unsplash.com/photo-1470071459604-3b5ec3a7fe05?w=800&q=80',
120
+ },
121
+ }}
122
+ description="Featured content with insurance orange heading"
123
+ button={<Button onPress={() => console.log('pressed')}>Get Started</Button>}
124
+ />
125
+ <HighlightBanner
126
+ {...args}
127
+ heading="Cashback Lilac"
128
+ headingColor="cashback"
129
+ image={{
130
+ source: {
131
+ uri: 'https://images.unsplash.com/photo-1506748686214-e9df14d4d9d0?w=800&q=80',
132
+ },
133
+ }}
134
+ description="Featured content with cashback lilac heading"
135
+ button={<Button onPress={() => console.log('pressed')}>Get Started</Button>}
136
+ />
137
+ <HighlightBanner
138
+ {...args}
139
+ heading="Pig Pink"
140
+ headingColor="pig"
141
+ image={{
142
+ source: {
143
+ uri: 'https://images.unsplash.com/photo-1494526585095-c41746248156?w=800&q=80',
144
+ },
145
+ }}
146
+ description="Featured content with pig pink heading"
147
+ link={<Link onPress={() => console.log('pressed')}>Learn more</Link>}
148
+ />
149
+ <HighlightBanner
150
+ {...args}
151
+ heading="Mobile Rose"
152
+ headingColor="mobile"
153
+ image={{
154
+ source: {
155
+ uri: 'https://images.unsplash.com/photo-1511707171634-5f897ff02aa9?w=800&q=80',
156
+ },
157
+ }}
158
+ description="Featured content with mobile rose heading"
159
+ />
160
+ <HighlightBanner
161
+ {...args}
162
+ heading="Highlight Yellow"
163
+ headingColor="highlight"
164
+ image={{
165
+ source: {
166
+ uri: 'https://images.unsplash.com/photo-1504384308090-c894fdcc538d?w=800&q=80',
167
+ },
168
+ }}
169
+ description="Featured content with highlight yellow heading"
170
+ />
171
+ </Flex>
172
+ </View>
173
+ );
174
+ },
175
+ };
176
+
177
+ export const SubtleCard: Story = {
178
+ args: {
179
+ variant: 'subtle',
180
+ },
181
+ render: args => {
182
+ return (
183
+ <View style={{ width: 400 }}>
184
+ <HighlightBanner {...args} />
185
+ </View>
186
+ );
187
+ },
188
+ };
189
+
190
+ export const DifferentImages: Story = {
191
+ render: args => {
192
+ return (
193
+ <Flex space="lg" direction="column">
194
+ <View style={{ width: 400 }}>
195
+ <HighlightBanner
196
+ {...args}
197
+ heading="Nature Landscape"
198
+ headingColor="broadband"
199
+ image={{
200
+ source: {
201
+ uri: 'https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=800&q=80',
202
+ },
203
+ }}
204
+ description="Beautiful mountain landscape with clear blue sky"
205
+ link={<Link onPress={() => console.log('pressed')}>View gallery</Link>}
206
+ />
207
+ </View>
208
+ <View style={{ width: 400 }}>
209
+ <HighlightBanner
210
+ {...args}
211
+ heading="Urban Architecture"
212
+ headingColor="highlight"
213
+ image={{
214
+ source: {
215
+ uri: 'https://images.unsplash.com/photo-1480714378408-67cf0d13bc1b?w=800&q=80',
216
+ },
217
+ }}
218
+ description="Modern city buildings and urban design"
219
+ button={<Button onPress={() => console.log('pressed')}>Explore Cities</Button>}
220
+ />
221
+ </View>
222
+ <View style={{ width: 400 }}>
223
+ <HighlightBanner
224
+ {...args}
225
+ heading="Ocean Waves"
226
+ headingColor="energy"
227
+ image={{
228
+ source: {
229
+ uri: 'https://images.unsplash.com/photo-1505142468610-359e7d316be0?w=800&q=80',
230
+ },
231
+ }}
232
+ description="Stunning ocean views and coastal beauty"
233
+ />
234
+ </View>
235
+ </Flex>
236
+ );
237
+ },
238
+ };
239
+
240
+ export const LongContent: Story = {
241
+ render: args => {
242
+ return (
243
+ <View style={{ width: 400 }}>
244
+ <HighlightBanner
245
+ {...args}
246
+ heading="Extended Information Card"
247
+ headingColor="energy"
248
+ image={{
249
+ source: {
250
+ uri: 'https://images.unsplash.com/photo-1441974231531-c6227db76b6e?w=800&q=80',
251
+ },
252
+ }}
253
+ description="This is a much longer description that demonstrates how the component handles extended text content. It includes multiple sentences and provides more detailed information about the featured content, ensuring the layout remains clean and readable even with more text."
254
+ button={<Button onPress={() => console.log('pressed')}>Read Full Article</Button>}
255
+ />
256
+ </View>
257
+ );
258
+ },
259
+ };
@@ -0,0 +1,122 @@
1
+ import { Image, View } from 'react-native';
2
+ import { StyleSheet } from 'react-native-unistyles';
3
+ import { BodyText } from '../BodyText';
4
+ import { Card } from '../Card';
5
+ import type HighlightBannerProps from './HighlightBanner.props';
6
+
7
+ const HighlightBanner = ({
8
+ heading,
9
+ headingColor,
10
+ image,
11
+ imageContainerHeight,
12
+ description,
13
+ link,
14
+ button,
15
+ variant = 'emphasis',
16
+ style,
17
+ ...props
18
+ }: HighlightBannerProps) => {
19
+ styles.useVariants({ headingColor, variant });
20
+
21
+ return (
22
+ <Card variant={variant} noPadding style={style} {...props}>
23
+ <View style={[styles.container]}>
24
+ <View style={[styles.header]}>
25
+ <BodyText size="md" textAlign="center" weight="semibold">
26
+ {heading}
27
+ </BodyText>
28
+ </View>
29
+ <View style={styles.imageContainer(imageContainerHeight)}>
30
+ <Image resizeMode="cover" {...image} style={[styles.image, image?.style]} />
31
+ </View>
32
+ <View style={styles.footer}>
33
+ <BodyText size="md" textAlign="center">
34
+ {description}
35
+ </BodyText>
36
+ {link && <View style={styles.linkContainer}>{link}</View>}
37
+ {button && <View style={styles.buttonContainer}>{button}</View>}
38
+ </View>
39
+ </View>
40
+ </Card>
41
+ );
42
+ };
43
+
44
+ HighlightBanner.displayName = 'HighlightBanner';
45
+
46
+ const styles = StyleSheet.create(theme => ({
47
+ container: {
48
+ overflow: 'hidden',
49
+ flex: 1,
50
+ width: '100%',
51
+ },
52
+ header: {
53
+ padding: theme.components.banner.highlight.padding,
54
+ alignItems: 'center',
55
+ justifyContent: 'center',
56
+ variants: {
57
+ headingColor: {
58
+ highlight: {
59
+ backgroundColor: theme.color.surface.highlight.subtle,
60
+ },
61
+ pig: {
62
+ backgroundColor: theme.color.surface.pig.subtle,
63
+ },
64
+ energy: {
65
+ backgroundColor: theme.color.surface.energy.subtle,
66
+ },
67
+ broadband: {
68
+ backgroundColor: theme.color.surface.broadband.subtle,
69
+ },
70
+ mobile: {
71
+ backgroundColor: theme.color.surface.mobile.subtle,
72
+ },
73
+ insurance: {
74
+ backgroundColor: theme.color.surface.insurance.subtle,
75
+ },
76
+ cashback: {
77
+ backgroundColor: theme.color.surface.cashback.subtle,
78
+ },
79
+ },
80
+ variant: {
81
+ emphasis: {
82
+ borderColor: theme.color.border.strong,
83
+ borderBottomWidth: theme.borderWidth[2],
84
+ },
85
+ subtle: {
86
+ borderColor: theme.color.border.subtle,
87
+ },
88
+ },
89
+ },
90
+ },
91
+ imageContainer: (height: number = 200) => ({
92
+ width: '100%',
93
+ height,
94
+ }),
95
+ image: {
96
+ width: '100%',
97
+ height: '100%',
98
+ },
99
+ footer: {
100
+ padding: theme.components.banner.highlight.padding,
101
+ gap: theme.components.banner.highlight.content.gap,
102
+ variants: {
103
+ variant: {
104
+ emphasis: {
105
+ borderColor: theme.color.border.strong,
106
+ borderTopWidth: theme.borderWidth[2],
107
+ },
108
+ subtle: {
109
+ borderColor: theme.color.border.subtle,
110
+ },
111
+ },
112
+ },
113
+ },
114
+ linkContainer: {
115
+ alignItems: 'center',
116
+ },
117
+ buttonContainer: {
118
+ alignItems: 'stretch',
119
+ },
120
+ }));
121
+
122
+ export default HighlightBanner;
@@ -0,0 +1,2 @@
1
+ export { default as HighlightBanner } from './HighlightBanner';
2
+ export type { default as HighlightBannerProps } from './HighlightBanner.props';
@@ -1,4 +1,5 @@
1
1
  import { createIcon } from '@gluestack-ui/icon';
2
+ import type React from 'react';
2
3
  import { useMemo } from 'react';
3
4
  import { Svg } from 'react-native-svg';
4
5
  import { withUnistyles } from 'react-native-unistyles';
@@ -44,8 +45,8 @@ const PrimitiveIcon = withUnistyles(
44
45
 
45
46
  PrimitiveIcon.displayName = 'PrimitiveIcon';
46
47
 
47
- export const Icon = createIcon({
48
- Root: PrimitiveIcon,
49
- });
48
+ export const Icon: React.ForwardRefExoticComponent<IconProps> = createIcon({
49
+ Root: PrimitiveIcon as any,
50
+ }) as React.ForwardRefExoticComponent<IconProps>;
50
51
 
51
52
  export default Icon;
@@ -18,7 +18,8 @@ const IconButtonIcon = (props: IconProps) => {
18
18
  {...props}
19
19
  style={
20
20
  Platform.OS === 'web'
21
- ? StyleSheet.compose(styles.icon as StyleProp<ViewStyle>, props.style)
21
+ ? // @ts-expect-error - style prop type issue
22
+ { ...(styles.icon as StyleProp<ViewStyle>), ...props.style }
22
23
  : [styles.icon as ViewStyle, props.style]
23
24
  }
24
25
  >
@@ -1,27 +1,25 @@
1
1
  import { View } from 'react-native';
2
- import { StyleSheet, withUnistyles } from 'react-native-unistyles';
2
+ import { StyleSheet } from 'react-native-unistyles';
3
3
  import { Icon } from '../Icon';
4
4
  import type IconContainerProps from './IconContainer.props';
5
5
 
6
- const IconContainer = withUnistyles(
7
- ({
8
- icon: IconComp,
9
- size = 'md',
10
- radiusNone = false,
11
- variant = 'subtle',
12
- color = 'pig',
13
- style,
14
- ...props
15
- }: IconContainerProps) => {
16
- styles.useVariants({ size, radiusNone, variant, color });
6
+ const IconContainer = ({
7
+ icon: IconComp,
8
+ size = 'md',
9
+ radiusNone = false,
10
+ variant = 'subtle',
11
+ color = 'pig',
12
+ style,
13
+ ...props
14
+ }: IconContainerProps) => {
15
+ styles.useVariants({ size, radiusNone, variant, color });
17
16
 
18
- return (
19
- <View style={[styles.container, style]} {...props}>
20
- {IconComp ? <Icon as={IconComp} style={styles.icon} /> : null}
21
- </View>
22
- );
23
- }
24
- );
17
+ return (
18
+ <View style={[styles.container, style]} {...props}>
19
+ {IconComp ? <Icon as={IconComp} style={styles.icon} /> : null}
20
+ </View>
21
+ );
22
+ };
25
23
 
26
24
  IconContainer.displayName = 'IconContainer';
27
25
 
@@ -15,6 +15,7 @@ const InputField = ({
15
15
 
16
16
  if (inBottomSheet) {
17
17
  return (
18
+ // @ts-expect-error - BottomSheetTextInput type issue
18
19
  <BottomSheetTextInput
19
20
  placeholderTextColor={color.text.secondary}
20
21
  selectionColor={color.purple[700]}
@@ -52,7 +53,7 @@ const styles = StyleSheet.create(theme => ({
52
53
  color: theme.color.text.primary,
53
54
  fontSize: theme.typography.mobile.bodyText.md.fontSize,
54
55
  fontFamily: theme.typography.mobile.bodyText.fontFamily,
55
- fontWeight: theme.typography.mobile.bodyText.fontWeight,
56
+ fontWeight: `${theme.typography.mobile.bodyText.fontWeight}`,
56
57
  borderWidth: 0,
57
58
  variants: {
58
59
  focused: {
@@ -9,7 +9,8 @@ const InputIcon = ({ children, ...props }: IconProps & { as?: ComponentType }) =
9
9
  {...props}
10
10
  style={
11
11
  Platform.OS === 'web'
12
- ? StyleSheet.compose(styles.icon as StyleProp<ViewStyle>, props.style)
12
+ ? // @ts-expect-error - style prop type issue
13
+ { ...(styles.icon as StyleProp<ViewStyle>), ...props.style }
13
14
  : ([styles.icon as StyleProp<ViewStyle>, props.style] as any)
14
15
  }
15
16
  >
@@ -1,8 +1,8 @@
1
1
  import { Platform, type StyleProp, type ViewStyle } from 'react-native';
2
- import { useLinkContext } from './Link.context';
3
2
  import { StyleSheet } from 'react-native-unistyles';
4
3
  import { Icon } from '../Icon';
5
4
  import IconProps from '../Icon/Icon.props';
5
+ import { useLinkContext } from './Link.context';
6
6
 
7
7
  const LinkIcon = ({ children, ...props }: IconProps) => {
8
8
  const { active, inverted, disabled } = useLinkContext();
@@ -13,7 +13,8 @@ const LinkIcon = ({ children, ...props }: IconProps) => {
13
13
  {...props}
14
14
  style={
15
15
  Platform.OS === 'web'
16
- ? StyleSheet.compose(styles.icon as StyleProp<ViewStyle>, props.style)
16
+ ? // @ts-expect-error - style prop type issue
17
+ { ...(styles.icon as StyleProp<ViewStyle>), ...props.style }
17
18
  : [styles.icon as StyleProp<ViewStyle>, props.style]
18
19
  }
19
20
  >
@@ -10,7 +10,8 @@ const ListActionTrailingIcon = ({ children, ...props }: IconProps & { as?: Compo
10
10
  {...props}
11
11
  style={
12
12
  Platform.OS === 'web'
13
- ? StyleSheet.compose(styles.icon as StyleProp<ViewStyle>, props.style)
13
+ ? // @ts-expect-error - style prop type issue
14
+ { ...(styles.icon as StyleProp<ViewStyle>), ...props.style }
14
15
  : ([styles.icon as StyleProp<ViewStyle>, props.style] as any)
15
16
  }
16
17
  >
@@ -9,7 +9,8 @@ const ListItemIcon = ({ children, ...props }: IconProps & { as?: ComponentType }
9
9
  {...props}
10
10
  style={
11
11
  Platform.OS === 'web'
12
- ? StyleSheet.compose(styles.icon as StyleProp<ViewStyle>, props.style)
12
+ ? // @ts-expect-error - style prop type issue
13
+ { ...(styles.icon as StyleProp<ViewStyle>), ...props.style }
13
14
  : ([styles.icon as StyleProp<ViewStyle>, props.style] as any)
14
15
  }
15
16
  >
@@ -10,7 +10,8 @@ const ListItemTrailingIcon = ({ children, ...props }: IconProps & { as?: Compone
10
10
  {...props}
11
11
  style={
12
12
  Platform.OS === 'web'
13
- ? StyleSheet.compose(styles.icon as StyleProp<ViewStyle>, props.style)
13
+ ? // @ts-expect-error - style prop type issue
14
+ { ...(styles.icon as StyleProp<ViewStyle>), ...props.style }
14
15
  : ([styles.icon as StyleProp<ViewStyle>, props.style] as any)
15
16
  }
16
17
  >
@@ -24,8 +25,6 @@ ListItemTrailingIcon.displayName = 'ListItemTrailingIcon';
24
25
  const styles = StyleSheet.create(theme => ({
25
26
  icon: {
26
27
  color: theme.color.icon.primary,
27
- width: 24,
28
- height: 24,
29
28
  },
30
29
  }));
31
30
 
@@ -1,8 +1,8 @@
1
+ import { Platform, StyleProp, ViewStyle } from 'react-native';
1
2
  import { StyleSheet } from 'react-native-unistyles';
2
3
  import { Icon } from '../Icon';
3
- import { CircleIcon } from '../Icons';
4
4
  import IconProps from '../Icon/Icon.props';
5
- import { Platform } from 'react-native';
5
+ import { CircleIcon } from '../Icons';
6
6
 
7
7
  const RadioIcon = ({ style, ...props }: IconProps) => {
8
8
  return (
@@ -11,7 +11,12 @@ const RadioIcon = ({ style, ...props }: IconProps) => {
11
11
  {...props}
12
12
  style={
13
13
  Platform.OS === 'web'
14
- ? StyleSheet.compose(styles.container, style)
14
+ ? {
15
+ // @ts-expect-error - style prop type issue
16
+ ...(styles.container as StyleProp<ViewStyle>),
17
+ // @ts-expect-error - style prop type issue
18
+ ...(props.style as StyleProp<ViewStyle>),
19
+ }
15
20
  : ([styles.container, style] as any)
16
21
  }
17
22
  />
@@ -1,8 +1,8 @@
1
+ import { Platform, StyleProp, ViewStyle } from 'react-native';
1
2
  import { StyleSheet } from 'react-native-unistyles';
2
3
  import { Icon } from '../Icon';
3
- import { CircleIcon } from '../Icons';
4
4
  import IconProps from '../Icon/Icon.props';
5
- import { Platform } from 'react-native';
5
+ import { CircleIcon } from '../Icons';
6
6
 
7
7
  const RadioCardIcon = ({ style, ...props }: IconProps) => {
8
8
  return (
@@ -11,7 +11,8 @@ const RadioCardIcon = ({ style, ...props }: IconProps) => {
11
11
  {...props}
12
12
  style={
13
13
  Platform.OS === 'web'
14
- ? StyleSheet.compose(styles.container, style)
14
+ ? // @ts-expect-error - style prop type issue
15
+ { ...(styles.container as StyleProp<ViewStyle>), ...props.style }
15
16
  : ([styles.container, style] as any)
16
17
  }
17
18
  />
@@ -11,6 +11,7 @@ import Animated, {
11
11
  withTiming,
12
12
  } from 'react-native-reanimated';
13
13
  import { StyleSheet } from 'react-native-unistyles';
14
+ import { useAnimatedTheme } from 'react-native-unistyles/reanimated';
14
15
  import { useTheme } from '../../hooks';
15
16
  import { Icon } from '../Icon';
16
17
  import SwitchProps from './Switch.props';
@@ -23,6 +24,7 @@ const CustomSwitch = ({
23
24
  ...accessibilityProps
24
25
  }: SwitchProps) => {
25
26
  const { components, color } = useTheme();
27
+ const theme = useAnimatedTheme();
26
28
  const SWITCH_WIDTH = size === 'medium' ? components.switch.md.width : components.switch.sm.width;
27
29
  const THUMB_SIZE =
28
30
  size === 'medium' ? components.switch.md.circle.size : components.switch.sm.circle.size;
@@ -34,17 +36,20 @@ const CustomSwitch = ({
34
36
  const offset = useSharedValue(value ? SWITCH_WIDTH - THUMB_SIZE - PADDING * 2 : 0);
35
37
  const progress = useSharedValue(value ? 1 : 0);
36
38
 
37
- const animatedThumbStyle = useAnimatedStyle(() => ({
38
- transform: [{ translateX: offset.value }],
39
- }));
39
+ const animatedThumbStyle = useAnimatedStyle(
40
+ () => ({
41
+ transform: [{ translateX: offset.value }],
42
+ }),
43
+ [offset]
44
+ );
40
45
 
41
46
  const animatedSwitchBackgroundStyle = useAnimatedStyle(() => {
42
47
  const backgroundColor = interpolateColor(
43
48
  progress.value,
44
49
  [0, 1],
45
50
  [
46
- color.interactive.functional.surface.strong.default,
47
- color.interactive.brand.surface.strong.default,
51
+ theme.value.color.interactive.functional.surface.strong.default,
52
+ theme.value.color.interactive.brand.surface.strong.default,
48
53
  ]
49
54
  );
50
55
  return { backgroundColor };
@@ -122,6 +122,7 @@ const CustomSwitch = ({
122
122
  return <IconAny as={TickSmallIcon} style={styles.icon as any} />;
123
123
  })()}
124
124
  </AnimatedView>
125
+
125
126
  <AnimatedView style={[styles.iconWrap, animatedCrossStyle]}>
126
127
  {(() => {
127
128
  const IconAny = Icon as any;
@@ -33,7 +33,7 @@ const styles = StyleSheet.create(theme => ({
33
33
  color: theme.color.text.primary,
34
34
  fontSize: theme.typography.mobile.bodyText.md.fontSize,
35
35
  fontFamily: theme.typography.mobile.bodyText.fontFamily,
36
- fontWeight: theme.typography.mobile.bodyText.fontWeight,
36
+ fontWeight: `${theme.typography.mobile.bodyText.fontWeight}`,
37
37
  borderWidth: 0,
38
38
  outlineWidth: 0,
39
39
  _web: {
@@ -19,7 +19,8 @@ const ButtonIcon = ({
19
19
  {...props}
20
20
  style={
21
21
  Platform.OS === 'web'
22
- ? StyleSheet.compose(styles.icon as StyleProp<ViewStyle>, props.style)
22
+ ? // @ts-ignore
23
+ { ...(styles.icon as StyleProp<ViewStyle>), ...props.style }
23
24
  : [styles.icon as StyleProp<ViewStyle>, props.style]
24
25
  }
25
26
  >