@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
@@ -1,3 +1,5 @@
1
+ import { fileURLToPath } from "node:url";
2
+ import { dirname } from "node:path";
1
3
  import remarkGfm from 'remark-gfm';
2
4
  import svgr from 'vite-plugin-svgr';
3
5
 
@@ -12,9 +14,9 @@ const unistylesPluginOptions = {
12
14
  const config = {
13
15
  stories: ['../**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
14
16
  addons: [
15
- '@chromatic-com/storybook',
17
+ getAbsolutePath("@chromatic-com/storybook"),
16
18
  {
17
- name: '@storybook/addon-docs',
19
+ name: getAbsolutePath("@storybook/addon-docs"),
18
20
  options: {
19
21
  mdxPluginOptions: {
20
22
  mdxCompileOptions: {
@@ -23,18 +25,18 @@ const config = {
23
25
  },
24
26
  },
25
27
  },
26
- '@storybook/addon-a11y',
27
- '@storybook/addon-vitest',
28
+ getAbsolutePath("@storybook/addon-a11y"),
29
+ getAbsolutePath("@storybook/addon-vitest"),
28
30
  ],
29
31
  framework: {
30
- name: '@storybook/react-native-web-vite',
32
+ name: getAbsolutePath("@storybook/react-native-web-vite"),
31
33
  options: {
32
34
  pluginReactOptions: {
33
35
  babel: {
34
36
  plugins: [
35
37
  ['react-native-unistyles/plugin', unistylesPluginOptions],
36
38
  '@babel/plugin-proposal-export-namespace-from',
37
- 'react-native-reanimated/plugin',
39
+ 'react-native-worklets/plugin',
38
40
  ],
39
41
  },
40
42
  },
@@ -73,3 +75,7 @@ const config = {
73
75
  },
74
76
  };
75
77
  export default config;
78
+
79
+ function getAbsolutePath(value: string): any {
80
+ return dirname(fileURLToPath(import.meta.resolve(`${value}/package.json`)));
81
+ }
@@ -1,4 +1,4 @@
1
1
 
2
- > @utilitywarehouse/hearth-react-native@0.6.0 build /home/runner/work/hearth/hearth/packages/react-native
2
+ > @utilitywarehouse/hearth-react-native@0.8.0 build /home/runner/work/hearth/hearth/packages/react-native
3
3
  > tsc
4
4
 
@@ -1,5 +1,5 @@
1
1
 
2
- > @utilitywarehouse/hearth-react-native@0.6.0 lint /home/runner/work/hearth/hearth/packages/react-native
2
+ > @utilitywarehouse/hearth-react-native@0.8.0 lint /home/runner/work/hearth/hearth/packages/react-native
3
3
  > TIMING=1 eslint --max-warnings 0
4
4
 
5
5
  Rule | Time (ms) | Relative
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @utilitywarehouse/hearth-react-native
2
2
 
3
+ ## 0.8.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#635](https://github.com/utilitywarehouse/hearth/pull/635) [`4cac2f2`](https://github.com/utilitywarehouse/hearth/commit/4cac2f28c12279557e2133d67cd75783f30c89ff) Thanks [@jordmccord](https://github.com/jordmccord)! - Adds `Expandable` component
8
+
9
+ - [#631](https://github.com/utilitywarehouse/hearth/pull/631) [`57b4991`](https://github.com/utilitywarehouse/hearth/commit/57b49912c90dce3d88a699bd50217df08dab601a) Thanks [@jordmccord](https://github.com/jordmccord)! - Adds `Banner` component
10
+
11
+ - [#636](https://github.com/utilitywarehouse/hearth/pull/636) [`a363352`](https://github.com/utilitywarehouse/hearth/commit/a363352dbfbc44245c64e2a16347463b89ff519a) Thanks [@jordmccord](https://github.com/jordmccord)! - Adds `ExpandableCard` component
12
+
13
+ - [#631](https://github.com/utilitywarehouse/hearth/pull/631) [`57b4991`](https://github.com/utilitywarehouse/hearth/commit/57b49912c90dce3d88a699bd50217df08dab601a) Thanks [@jordmccord](https://github.com/jordmccord)! - Adds `HighlightBanner` component
14
+
15
+ ## 0.7.0
16
+
17
+ ### Minor Changes
18
+
19
+ - [#613](https://github.com/utilitywarehouse/hearth/pull/613) [`0bdfbe4`](https://github.com/utilitywarehouse/hearth/commit/0bdfbe41ed8b30e5abf49de6ea4cb3a12194921e) Thanks [@jordmccord](https://github.com/jordmccord)! - Adds `CardAction` component
20
+
3
21
  ## 0.6.0
4
22
 
5
23
  ### Minor Changes
@@ -0,0 +1,6 @@
1
+ import type BannerProps from './Banner.props';
2
+ declare const Banner: {
3
+ ({ icon, iconContainerVariant, iconContainerSize, iconContainerColor, illustration, image, heading, description, direction, link, button, onPress, onClose, variant, colorScheme, style, ...props }: BannerProps): import("react/jsx-runtime").JSX.Element;
4
+ displayName: string;
5
+ };
6
+ export default Banner;
@@ -0,0 +1,161 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { ChevronRightSmallIcon, CloseSmallIcon } from '@utilitywarehouse/hearth-react-native-icons';
3
+ import { Pressable, View } from 'react-native';
4
+ import { StyleSheet } from 'react-native-unistyles';
5
+ import { BodyText } from '../BodyText';
6
+ import { Card } from '../Card';
7
+ import { Heading } from '../Heading';
8
+ import { IconContainer } from '../IconContainer';
9
+ import { ThemedImage } from '../ThemedImage';
10
+ import { UnstyledIconButton } from '../UnstyledIconButton';
11
+ const Banner = ({ icon, iconContainerVariant = 'subtle', iconContainerSize = 'md', iconContainerColor = 'pig', illustration, image, heading, description, direction = 'horizontal', link, button, onPress, onClose, variant = 'subtle', colorScheme = 'pig', style, ...props }) => {
12
+ const hasIllustration = Boolean(illustration);
13
+ styles.useVariants({ direction, hasIllustration });
14
+ const renderIconOrImage = () => {
15
+ if (icon) {
16
+ return (_jsx(IconContainer, { icon: icon, variant: iconContainerVariant, size: iconContainerSize, color: iconContainerColor, style: styles.media }));
17
+ }
18
+ if (illustration) {
19
+ return (_jsx(ThemedImage, { light: illustration.light, dark: illustration.dark, style: styles.image, accessible: true, accessibilityLabel: heading }));
20
+ }
21
+ if (image) {
22
+ return (_jsx(View, { style: [styles.media, styles.imageWrapper], children: _jsx(ThemedImage, { light: image.light, dark: image.dark, style: styles.image, accessible: true, accessibilityLabel: heading }) }));
23
+ }
24
+ return null;
25
+ };
26
+ const renderAction = () => {
27
+ if (link) {
28
+ return _jsx(View, { style: styles.action, children: link });
29
+ }
30
+ if (button) {
31
+ return _jsx(View, { style: styles.action, children: button });
32
+ }
33
+ return null;
34
+ };
35
+ const content = (_jsxs(View, { style: styles.container, children: [renderIconOrImage(), _jsxs(View, { style: styles.contentContainer, children: [_jsxs(View, { style: styles.textContainer, children: [_jsx(Heading, { size: "sm", style: styles.heading, textAlign: hasIllustration && direction === 'vertical' ? 'center' : 'left', children: heading }), _jsx(BodyText, { size: "md", style: styles.description, textAlign: hasIllustration && direction === 'vertical' ? 'center' : 'left', children: description }), renderAction()] }), onPress && (_jsx(UnstyledIconButton, { icon: ChevronRightSmallIcon, size: "sm", onPress: onPress, style: styles.chevron })), onClose && (_jsx(UnstyledIconButton, { icon: CloseSmallIcon, size: "sm", onPress: onClose, style: styles.closeButton, accessibilityLabel: "Close banner" }))] })] }));
36
+ if (onPress) {
37
+ return (_jsx(Card, { variant: variant, style: [styles.card, style], ...props, children: _jsx(Pressable, { onPress: onPress, accessibilityRole: "button", style: styles.pressable, children: content }) }));
38
+ }
39
+ return (_jsx(Card, { variant: variant, style: [styles.card, style], ...props, children: content }));
40
+ };
41
+ Banner.displayName = 'Banner';
42
+ const styles = StyleSheet.create(theme => ({
43
+ card: {},
44
+ pressable: {
45
+ width: '100%',
46
+ },
47
+ container: {
48
+ flexDirection: 'row',
49
+ gap: theme.space.lg,
50
+ variants: {
51
+ direction: {
52
+ horizontal: {
53
+ flexDirection: 'row',
54
+ alignItems: 'flex-start',
55
+ },
56
+ vertical: {
57
+ flexDirection: 'column',
58
+ alignItems: 'stretch',
59
+ },
60
+ },
61
+ hasIllustration: {
62
+ true: {},
63
+ false: {},
64
+ },
65
+ },
66
+ compoundVariants: [
67
+ {
68
+ direction: 'vertical',
69
+ hasIllustration: false,
70
+ styles: {
71
+ alignItems: 'flex-start',
72
+ },
73
+ },
74
+ {
75
+ direction: 'vertical',
76
+ hasIllustration: true,
77
+ styles: {
78
+ alignItems: 'center',
79
+ },
80
+ },
81
+ ],
82
+ },
83
+ media: {
84
+ flexShrink: 0,
85
+ variants: {
86
+ direction: {
87
+ horizontal: {},
88
+ vertical: {
89
+ alignSelf: 'flex-start',
90
+ },
91
+ },
92
+ },
93
+ },
94
+ imageWrapper: {
95
+ variants: {
96
+ direction: {
97
+ horizontal: {},
98
+ vertical: {
99
+ width: '100%',
100
+ },
101
+ },
102
+ },
103
+ },
104
+ image: {
105
+ borderRadius: theme.borderRadius.md,
106
+ borderWidth: theme.borderWidth[1],
107
+ borderColor: theme.color.border.strong,
108
+ variants: {
109
+ direction: {
110
+ horizontal: { width: 160, height: 95 },
111
+ vertical: {
112
+ width: '100%',
113
+ height: 160,
114
+ },
115
+ },
116
+ },
117
+ },
118
+ contentContainer: {
119
+ flex: 1,
120
+ flexDirection: 'row',
121
+ alignItems: 'flex-start',
122
+ justifyContent: 'space-between',
123
+ gap: theme.space.lg,
124
+ },
125
+ textContainer: {
126
+ flex: 1,
127
+ gap: theme.space.lg,
128
+ },
129
+ heading: {
130
+ compoundVariants: [
131
+ {
132
+ direction: 'vertical',
133
+ hasIllustration: true,
134
+ styles: {
135
+ textAlign: 'center',
136
+ },
137
+ },
138
+ ],
139
+ },
140
+ description: {
141
+ compoundVariants: [
142
+ {
143
+ direction: 'vertical',
144
+ hasIllustration: true,
145
+ styles: {
146
+ textAlign: 'center',
147
+ },
148
+ },
149
+ ],
150
+ },
151
+ action: {
152
+ alignSelf: 'flex-start',
153
+ },
154
+ chevron: {
155
+ alignSelf: 'center',
156
+ },
157
+ closeButton: {
158
+ alignSelf: 'flex-start',
159
+ },
160
+ }));
161
+ export default Banner;
@@ -0,0 +1,82 @@
1
+ import type { ComponentType, ReactElement } from 'react';
2
+ import type { ImageSourcePropType } from 'react-native';
3
+ import type CardProps from '../Card/Card.props';
4
+ export type BannerDirection = 'horizontal' | 'vertical';
5
+ export interface BannerProps extends Omit<CardProps, 'noPadding' | 'variant' | 'colorScheme' | 'space' | 'gap' | 'rowGap' | 'columnGap' | 'flexDirection' | 'flexWrap' | 'alignItems' | 'justifyContent'> {
6
+ /**
7
+ * Icon component to display in the banner
8
+ * Mutually exclusive with image
9
+ */
10
+ icon?: ComponentType;
11
+ /**
12
+ * Icon container variant
13
+ * @default 'subtle'
14
+ */
15
+ iconContainerVariant?: 'subtle' | 'emphasis';
16
+ /**
17
+ * Icon container size
18
+ * @default 'md'
19
+ */
20
+ iconContainerSize?: 'sm' | 'md' | 'lg';
21
+ /**
22
+ * Icon container color
23
+ * @default 'pig'
24
+ */
25
+ iconContainerColor?: 'pig' | 'energy' | 'broadband' | 'mobile' | 'insurance' | 'cashback' | 'highlight';
26
+ /**
27
+ * Illustration to display in the banner
28
+ * Mutually exclusive with icon and image
29
+ */
30
+ illustration?: {
31
+ light: ImageSourcePropType | ReactElement | ComponentType;
32
+ dark: ImageSourcePropType | ReactElement | ComponentType;
33
+ };
34
+ /**
35
+ * Image to display in the banner
36
+ * Mutually exclusive with icon and illustration
37
+ */
38
+ image?: {
39
+ light: ImageSourcePropType | ReactElement | ComponentType;
40
+ dark: ImageSourcePropType | ReactElement | ComponentType;
41
+ };
42
+ /**
43
+ * Heading text
44
+ */
45
+ heading: string;
46
+ /**
47
+ * Description text
48
+ */
49
+ description: string;
50
+ /**
51
+ * Layout direction for icon/image and content
52
+ * @default 'horizontal'
53
+ */
54
+ direction?: BannerDirection;
55
+ /**
56
+ * Link element to display
57
+ */
58
+ link?: ReactElement;
59
+ /**
60
+ * Button element to display
61
+ */
62
+ button?: ReactElement;
63
+ /**
64
+ * Makes the entire banner pressable
65
+ */
66
+ onPress?: () => void;
67
+ /**
68
+ * Close button handler
69
+ */
70
+ onClose?: () => void;
71
+ /**
72
+ * Card variant
73
+ * @default 'subtle'
74
+ */
75
+ variant?: 'subtle' | 'emphasis';
76
+ /**
77
+ * Color scheme for the banner
78
+ * @default 'pig'
79
+ */
80
+ colorScheme?: 'pig' | 'energy' | 'broadband' | 'mobile' | 'insurance' | 'cashback' | 'highlight';
81
+ }
82
+ export default BannerProps;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export { default as Banner } from './Banner';
2
+ export type { default as BannerProps } from './Banner.props';
@@ -0,0 +1 @@
1
+ export { default as Banner } from './Banner';
@@ -5,11 +5,7 @@ import { useTheme } from '../../hooks';
5
5
  const StyledBottomSheetBackdrop = withUnistyles(Backdrop);
6
6
  const BottomSheetBackdrop = ({ style, ...props }) => {
7
7
  const theme = useTheme();
8
- return (_jsx(StyledBottomSheetBackdrop
9
- // @ts-expect-error - style unistyles error
10
- , {
11
- // @ts-expect-error - style unistyles error
12
- style: [styles.backdrop, style], opacity: theme.components.overlay.opacity / 100, appearsOnIndex: 0, disappearsOnIndex: -1, ...props }));
8
+ return (_jsx(StyledBottomSheetBackdrop, { style: [styles.backdrop, style], opacity: theme.components.overlay.opacity / 100, appearsOnIndex: 0, disappearsOnIndex: -1, ...props }));
13
9
  };
14
10
  const styles = StyleSheet.create(theme => ({
15
11
  backdrop: {
@@ -9,11 +9,7 @@ const BottomSheetFlatList = ({ style, contentContainerStyle, isModal = true, ...
9
9
  isModal,
10
10
  handle,
11
11
  });
12
- return (_jsx(StyledBottomSheetFlatList
13
- // @ts-expect-error - style
14
- , {
15
- // @ts-expect-error - style
16
- style: [styles.container, style], contentContainerStyle: [styles.contentContainer, contentContainerStyle], ...props }));
12
+ return (_jsx(StyledBottomSheetFlatList, { style: [styles.container, style], contentContainerStyle: [styles.contentContainer, contentContainerStyle], ...props }));
17
13
  };
18
14
  const styles = StyleSheet.create((theme, rt) => ({
19
15
  container: {},
@@ -3,11 +3,7 @@ import { BottomSheetHandle as Handle } from '@gorhom/bottom-sheet';
3
3
  import { StyleSheet, withUnistyles } from 'react-native-unistyles';
4
4
  const StyledBottomSheetHandle = withUnistyles(Handle);
5
5
  const BottomSheetHandle = ({ style, indicatorStyle, ...props }) => {
6
- return (_jsx(StyledBottomSheetHandle
7
- // @ts-expect-error - style
8
- , {
9
- // @ts-expect-error - style
10
- style: [styles.handle, style], indicatorStyle: [styles.indicator, indicatorStyle], ...props }));
6
+ return (_jsx(StyledBottomSheetHandle, { style: [styles.handle, style], indicatorStyle: [styles.indicator, indicatorStyle], ...props }));
11
7
  };
12
8
  const styles = StyleSheet.create(theme => ({
13
9
  handle: {
@@ -9,7 +9,7 @@ interface UseBottomSheetLogicProps<T = any> {
9
9
  handleStyle?: ViewStyle;
10
10
  }
11
11
  declare const useBottomSheetLogic: <T = any>(props: UseBottomSheetLogicProps<T>) => {
12
- renderBackdrop: (backDropProps: BottomSheetBackdropProps) => string | number | bigint | boolean | import("react/jsx-runtime").JSX.Element | Iterable<React.ReactNode> | Promise<React.ReactNode> | null | undefined;
12
+ renderBackdrop: (backDropProps: BottomSheetBackdropProps) => string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<React.ReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined;
13
13
  renderHandle: (handleProps: BottomSheetHandleProps) => import("react/jsx-runtime").JSX.Element | null;
14
14
  };
15
15
  export default useBottomSheetLogic;
@@ -7,7 +7,8 @@ const ButtonIcon = ({ children, ...props }) => {
7
7
  const { colorScheme, variant, inverted, disabled } = useButtonContext();
8
8
  styles.useVariants({ colorScheme, variant, inverted, disabled });
9
9
  return (_jsx(Icon, { ...props, style: Platform.OS === 'web'
10
- ? StyleSheet.compose(styles.icon, props.style)
10
+ ? // @ts-expect-error - style prop type issue
11
+ { ...styles.icon, ...props.style }
11
12
  : [styles.icon, props.style], children: children }));
12
13
  };
13
14
  ButtonIcon.displayName = 'ButtonIcon';
@@ -2,11 +2,11 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useMemo } from 'react';
3
3
  import { Pressable } from 'react-native';
4
4
  import { StyleSheet } from 'react-native-unistyles';
5
- import { useCardActionContext } from '../Card';
5
+ import { useCardPressHandlerContext } from '../Card';
6
6
  import { ButtonContext } from './Button.context';
7
7
  const ButtonRoot = ({ children, colorScheme = 'highlight', variant = 'solid', size = 'md', inverted = false, states, onPress, paddingNone = false, ...props }) => {
8
8
  const { active, disabled = false } = states || {};
9
- const { pressed } = useCardActionContext();
9
+ const { pressed } = useCardPressHandlerContext();
10
10
  styles.useVariants({
11
11
  variant,
12
12
  size,
@@ -79,7 +79,6 @@ const styles = StyleSheet.create(theme => ({
79
79
  ghost: {
80
80
  backgroundColor: 'transparent',
81
81
  borderWidth: 0,
82
- textDecoration: 'underline',
83
82
  },
84
83
  },
85
84
  size: {
@@ -325,7 +324,6 @@ const styles = StyleSheet.create(theme => ({
325
324
  variant: 'ghost',
326
325
  colorScheme: 'functional',
327
326
  styles: {
328
- textDecorationColor: theme.color.interactive.functional.foreground.subtle,
329
327
  _web: {
330
328
  _hover: {
331
329
  backgroundColor: theme.color.interactive.functional.surface.subtle.hover,
@@ -373,7 +371,6 @@ const styles = StyleSheet.create(theme => ({
373
371
  variant: 'ghost',
374
372
  colorScheme: 'affirmative',
375
373
  styles: {
376
- textDecorationColor: theme.color.interactive.affirmative.foreground.subtle,
377
374
  _web: {
378
375
  _hover: {
379
376
  backgroundColor: theme.color.interactive.affirmative.surface.subtle.hover,
@@ -397,7 +394,6 @@ const styles = StyleSheet.create(theme => ({
397
394
  variant: 'ghost',
398
395
  colorScheme: 'destructive',
399
396
  styles: {
400
- textDecorationColor: theme.color.interactive.destructive.foreground.subtle,
401
397
  _web: {
402
398
  _hover: {
403
399
  backgroundColor: theme.color.interactive.destructive.surface.subtle.hover,
@@ -15,7 +15,10 @@ const styles = StyleSheet.create(theme => ({
15
15
  emphasis: {},
16
16
  solid: {},
17
17
  outline: {},
18
- ghost: {},
18
+ ghost: {
19
+ textDecorationStyle: 'solid',
20
+ textDecorationLine: 'underline',
21
+ },
19
22
  },
20
23
  colorScheme: {
21
24
  highlight: {},
@@ -1,5 +1,12 @@
1
+ import CardProps from './Card.props';
1
2
  interface CardContextProps {
2
3
  pressed?: boolean;
4
+ noPadding?: boolean;
5
+ hasActions?: boolean;
6
+ hasContent?: boolean;
7
+ hasOnlyActions?: boolean;
8
+ space?: CardProps['space'];
9
+ variant?: CardProps['variant'];
3
10
  }
4
11
  export declare const CardContext: import("react").Context<CardContextProps>;
5
12
  export declare const useCardContext: () => CardContextProps;
@@ -0,0 +1,9 @@
1
+ export interface ICardActionContext {
2
+ showPressed: boolean;
3
+ active?: boolean;
4
+ loading: boolean;
5
+ disabled: boolean;
6
+ size: 'md' | 'lg';
7
+ }
8
+ export declare const CardActionContext: import("react").Context<ICardActionContext>;
9
+ export declare const useCardActionContext: () => ICardActionContext;
@@ -1,5 +1,11 @@
1
1
  import { createContext, useContext } from 'react';
2
- export const CardActionContext = createContext({});
2
+ export const CardActionContext = createContext({
3
+ showPressed: false,
4
+ active: false,
5
+ loading: false,
6
+ disabled: false,
7
+ size: 'md',
8
+ });
3
9
  export const useCardActionContext = () => {
4
10
  const context = useContext(CardActionContext);
5
11
  return context;
@@ -0,0 +1,18 @@
1
+ declare const CardAction: import("react").ForwardRefExoticComponent<(((import("./CardAction.props").default & {
2
+ states?: {
3
+ active?: boolean;
4
+ disabled?: boolean;
5
+ };
6
+ isFirst?: boolean;
7
+ }) & Omit<import("react-native").PressableProps, "children">) & {
8
+ tabIndex?: 0 | -1 | undefined;
9
+ } & {
10
+ children?: import("react").ReactNode | (({ hovered, pressed, focused, focusVisible, disabled, }: {
11
+ hovered?: boolean | undefined;
12
+ pressed?: boolean | undefined;
13
+ focused?: boolean | undefined;
14
+ focusVisible?: boolean | undefined;
15
+ disabled?: boolean | undefined;
16
+ }) => import("react").ReactNode);
17
+ }) & import("react").RefAttributes<unknown>>;
18
+ export default CardAction;
@@ -0,0 +1,7 @@
1
+ import { createPressable } from '@gluestack-ui/pressable';
2
+ import CardActionRoot from './CardActionRoot';
3
+ const CardAction = createPressable({
4
+ Root: CardActionRoot,
5
+ });
6
+ CardAction.displayName = 'CardAction';
7
+ export default CardAction;
@@ -0,0 +1,63 @@
1
+ import { ComponentType } from 'react';
2
+ import type { PressableProps, ViewProps } from 'react-native';
3
+ import BadgeProps from '../../Badge/Badge.props';
4
+ import { IconContainerProps } from '../../IconContainer';
5
+ interface CardActionBaseProps extends Omit<PressableProps, 'children'> {
6
+ loading?: boolean;
7
+ disabled?: boolean;
8
+ size?: 'md' | 'lg';
9
+ }
10
+ interface CardActionContentProps {
11
+ heading: string;
12
+ helperText?: string;
13
+ badge?: BadgeProps;
14
+ badgePosition?: 'bottom' | 'middle' | 'right' | 'top';
15
+ iconContainer?: boolean;
16
+ iconContainerVariant?: IconContainerProps['variant'];
17
+ iconContainerColor?: IconContainerProps['color'];
18
+ }
19
+ export interface CardActionWithChildren extends CardActionBaseProps {
20
+ children: ViewProps['children'];
21
+ heading?: never;
22
+ helperText?: never;
23
+ leadingContent?: never;
24
+ leadingIcon?: never;
25
+ trailingContent?: never;
26
+ trailingIcon?: never;
27
+ badge?: never;
28
+ badgePosition?: never;
29
+ iconContainer?: never;
30
+ iconContainerVariant?: never;
31
+ iconContainerColor?: never;
32
+ }
33
+ type CardActionWithLeadingContent = CardActionBaseProps & CardActionContentProps & {
34
+ children?: never;
35
+ leadingContent: ViewProps['children'];
36
+ leadingIcon?: never;
37
+ };
38
+ type CardActionWithLeadingIcon = CardActionBaseProps & CardActionContentProps & {
39
+ children?: never;
40
+ leadingContent?: never;
41
+ leadingIcon: ComponentType;
42
+ };
43
+ type CardActionWithNoLeading = CardActionBaseProps & CardActionContentProps & {
44
+ children?: never;
45
+ leadingContent?: never;
46
+ leadingIcon?: never;
47
+ };
48
+ type CardActionLeadingVariants = CardActionWithLeadingContent | CardActionWithLeadingIcon | CardActionWithNoLeading;
49
+ type CardActionWithTrailingContent = CardActionLeadingVariants & {
50
+ trailingContent: ViewProps['children'];
51
+ trailingIcon?: never;
52
+ };
53
+ type CardActionWithTrailingIcon = CardActionLeadingVariants & {
54
+ trailingContent?: never;
55
+ trailingIcon: ComponentType;
56
+ };
57
+ type CardActionWithNoTrailing = CardActionLeadingVariants & {
58
+ trailingContent?: never;
59
+ trailingIcon?: never;
60
+ };
61
+ type CardActionWithoutChildren = CardActionWithTrailingContent | CardActionWithTrailingIcon | CardActionWithNoTrailing;
62
+ type CardActionProps = CardActionWithChildren | CardActionWithoutChildren;
63
+ export default CardActionProps;
@@ -0,0 +1,6 @@
1
+ import { type ViewProps } from 'react-native';
2
+ declare const CardActionContent: {
3
+ ({ children, ...props }: ViewProps): import("react/jsx-runtime").JSX.Element;
4
+ displayName: string;
5
+ };
6
+ export default CardActionContent;
@@ -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 CardActionContent = ({ children, ...props }) => {
5
+ return (_jsx(View, { ...props, style: [styles.container, props.style], children: children }));
6
+ };
7
+ CardActionContent.displayName = 'CardActionContent';
8
+ const styles = StyleSheet.create({
9
+ container: {
10
+ flex: 1,
11
+ },
12
+ });
13
+ export default CardActionContent;
@@ -0,0 +1,6 @@
1
+ import { TextProps } from 'react-native';
2
+ declare const CardActionHelperText: {
3
+ ({ children, ...props }: TextProps): import("react/jsx-runtime").JSX.Element;
4
+ displayName: string;
5
+ };
6
+ export default CardActionHelperText;
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { StyleSheet } from 'react-native-unistyles';
3
+ import { BodyText } from '../../BodyText';
4
+ const CardActionHelperText = ({ children, ...props }) => {
5
+ return (_jsx(BodyText, { size: "md", ...props, style: [styles.text, props.style], children: children }));
6
+ };
7
+ CardActionHelperText.displayName = 'CardActionHelperText';
8
+ const styles = StyleSheet.create(theme => ({
9
+ text: {
10
+ color: theme.color.text.secondary,
11
+ },
12
+ }));
13
+ export default CardActionHelperText;