@utilitywarehouse/hearth-react-native 0.5.0 → 0.7.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 (213) hide show
  1. package/.storybook/main.ts +33 -7
  2. package/.turbo/turbo-build.log +1 -1
  3. package/.turbo/turbo-lint.log +1 -1
  4. package/CHANGELOG.md +14 -0
  5. package/build/components/BottomSheet/BottomSheetBackdrop.js +2 -2
  6. package/build/components/BottomSheet/BottomSheetFlatList.js +2 -2
  7. package/build/components/BottomSheet/BottomSheetHandle.js +2 -2
  8. package/build/components/Button/ButtonIcon.js +2 -1
  9. package/build/components/Button/ButtonRoot.js +2 -6
  10. package/build/components/Button/ButtonText.js +4 -1
  11. package/build/components/Card/Card.context.d.ts +7 -0
  12. package/build/components/Card/CardAction/CardAction.context.d.ts +9 -0
  13. package/build/components/Card/{CardAction.context.js → CardAction/CardAction.context.js} +7 -1
  14. package/build/components/Card/CardAction/CardAction.d.ts +18 -0
  15. package/build/components/Card/CardAction/CardAction.js +7 -0
  16. package/build/components/Card/CardAction/CardAction.props.d.ts +63 -0
  17. package/build/components/Card/CardAction/CardAction.props.js +1 -0
  18. package/build/components/Card/CardAction/CardActionContent.d.ts +6 -0
  19. package/build/components/Card/CardAction/CardActionContent.js +13 -0
  20. package/build/components/Card/CardAction/CardActionHelperText.d.ts +6 -0
  21. package/build/components/Card/CardAction/CardActionHelperText.js +13 -0
  22. package/build/components/Card/CardAction/CardActionIcon.d.ts +9 -0
  23. package/build/components/Card/CardAction/CardActionIcon.js +19 -0
  24. package/build/components/Card/CardAction/CardActionLeadingContent.d.ts +6 -0
  25. package/build/components/Card/CardAction/CardActionLeadingContent.js +5 -0
  26. package/build/components/Card/CardAction/CardActionRoot.d.ts +12 -0
  27. package/build/components/Card/CardAction/CardActionRoot.js +155 -0
  28. package/build/components/Card/CardAction/CardActionText.d.ts +6 -0
  29. package/build/components/Card/CardAction/CardActionText.js +9 -0
  30. package/build/components/Card/CardAction/CardActionTrailingContent.d.ts +6 -0
  31. package/build/components/Card/CardAction/CardActionTrailingContent.js +5 -0
  32. package/build/components/Card/CardAction/CardActionTrailingIcon.d.ts +9 -0
  33. package/build/components/Card/CardAction/CardActionTrailingIcon.js +19 -0
  34. package/build/components/Card/CardAction/index.d.ts +10 -0
  35. package/build/components/Card/CardAction/index.js +9 -0
  36. package/build/components/Card/CardContent.d.ts +6 -0
  37. package/build/components/Card/CardContent.js +33 -0
  38. package/build/components/Card/CardPressHandler.context.d.ts +6 -0
  39. package/build/components/Card/CardPressHandler.context.js +6 -0
  40. package/build/components/Card/{CardAction.d.ts → CardPressHandler.d.ts} +3 -3
  41. package/build/components/Card/CardPressHandler.js +13 -0
  42. package/build/components/Card/CardRoot.js +103 -11
  43. package/build/components/Card/index.d.ts +3 -2
  44. package/build/components/Card/index.js +3 -2
  45. package/build/components/Checkbox/CheckboxIcon.js +2 -1
  46. package/build/components/Container/Container.d.ts +6 -0
  47. package/build/components/Container/Container.js +40 -0
  48. package/build/components/Container/Container.props.d.ts +85 -0
  49. package/build/components/Container/Container.props.js +1 -0
  50. package/build/components/Container/index.d.ts +2 -0
  51. package/build/components/Container/index.js +1 -0
  52. package/build/components/CurrencyInput/CurrencyInput.js +1 -1
  53. package/build/components/Helper/HelperIcon.js +2 -1
  54. package/build/components/Icon/Icon.d.ts +2 -6
  55. package/build/components/IconButton/IconButtonIcon.js +2 -1
  56. package/build/components/IconContainer/IconContainer.d.ts +4 -3
  57. package/build/components/IconContainer/IconContainer.js +3 -3
  58. package/build/components/Input/InputField.js +4 -2
  59. package/build/components/Input/InputIcon.js +2 -1
  60. package/build/components/Link/LinkIcon.js +3 -2
  61. package/build/components/List/ListAction/ListActionTrailingIcon.js +2 -1
  62. package/build/components/List/ListItem/ListItemIcon.js +2 -1
  63. package/build/components/List/ListItem/ListItemTrailingIcon.js +2 -3
  64. package/build/components/ProgressStepper/ProgressStep.d.ts +1 -1
  65. package/build/components/ProgressStepper/ProgressStep.js +6 -6
  66. package/build/components/ProgressStepper/ProgressStepper.props.d.ts +3 -3
  67. package/build/components/ProgressStepper/index.d.ts +1 -1
  68. package/build/components/Radio/RadioIcon.js +7 -2
  69. package/build/components/RadioCard/RadioCardIcon.js +3 -2
  70. package/build/components/Spinner/Spinner.js +2 -0
  71. package/build/components/Spinner/Spinner.web.js +2 -0
  72. package/build/components/Switch/Switch.js +5 -3
  73. package/build/components/Switch/Switch.web.js +1 -0
  74. package/build/components/Tabs/TabsList.js +6 -1
  75. package/build/components/Textarea/TextareaField.js +1 -1
  76. package/build/components/ThemedImage/ThemedImage.d.ts +12 -0
  77. package/build/components/ThemedImage/ThemedImage.js +27 -0
  78. package/build/components/ThemedImage/ThemedImage.props.d.ts +13 -0
  79. package/build/components/ThemedImage/ThemedImage.props.js +1 -0
  80. package/build/components/ThemedImage/index.d.ts +2 -0
  81. package/build/components/ThemedImage/index.js +1 -0
  82. package/build/components/ToggleButton/ToggleButtonIcon.js +2 -1
  83. package/build/components/ToggleButton/ToggleButtonRoot.js +2 -2
  84. package/build/components/UnstyledIconButton/UnstyledIconButtonIcon.js +2 -1
  85. package/build/components/index.d.ts +3 -1
  86. package/build/components/index.js +3 -1
  87. package/build/core/index.d.ts +3 -3
  88. package/build/core/index.js +3 -3
  89. package/build/core/themes.d.ts +24 -12
  90. package/build/hooks/useColorMode.d.ts +1 -1
  91. package/build/hooks/useColorMode.js +7 -8
  92. package/build/hooks/useStyleProps.js +1 -1
  93. package/build/tokens/components/dark/banner.d.ts +19 -0
  94. package/build/tokens/components/dark/banner.js +19 -0
  95. package/build/tokens/components/dark/card-action.d.ts +11 -0
  96. package/build/tokens/components/dark/card-action.js +10 -0
  97. package/build/tokens/components/dark/card-content.d.ts +25 -0
  98. package/build/tokens/components/dark/card-content.js +24 -0
  99. package/build/tokens/components/dark/drawer.d.ts +29 -0
  100. package/build/tokens/components/dark/drawer.js +28 -0
  101. package/build/tokens/components/dark/illustrations.d.ts +0 -1
  102. package/build/tokens/components/dark/illustrations.js +0 -1
  103. package/build/tokens/components/dark/index.d.ts +3 -0
  104. package/build/tokens/components/dark/index.js +3 -0
  105. package/build/tokens/components/light/banner.d.ts +19 -0
  106. package/build/tokens/components/light/banner.js +19 -0
  107. package/build/tokens/components/light/card-action.d.ts +11 -0
  108. package/build/tokens/components/light/card-action.js +10 -0
  109. package/build/tokens/components/light/card-content.d.ts +25 -0
  110. package/build/tokens/components/light/card-content.js +24 -0
  111. package/build/tokens/components/light/drawer.d.ts +29 -0
  112. package/build/tokens/components/light/drawer.js +28 -0
  113. package/build/tokens/components/light/illustrations.d.ts +0 -1
  114. package/build/tokens/components/light/illustrations.js +0 -1
  115. package/build/tokens/components/light/index.d.ts +3 -0
  116. package/build/tokens/components/light/index.js +3 -0
  117. package/build/tokens/layout.d.ts +6 -6
  118. package/build/tokens/layout.js +3 -3
  119. package/build/tokens/typography.d.ts +6 -0
  120. package/build/tokens/typography.js +3 -0
  121. package/docs/components/AllComponents.web.tsx +38 -3
  122. package/docs/components/NextPrevPage.tsx +5 -5
  123. package/docs/components/VariantTitle.tsx +17 -7
  124. package/docs/layout-components.docs.mdx +30 -0
  125. package/package.json +18 -14
  126. package/src/components/BottomSheet/BottomSheetBackdrop.tsx +2 -2
  127. package/src/components/BottomSheet/BottomSheetFlatList.tsx +2 -3
  128. package/src/components/BottomSheet/BottomSheetHandle.tsx +1 -1
  129. package/src/components/Button/ButtonIcon.tsx +2 -1
  130. package/src/components/Button/ButtonRoot.tsx +2 -6
  131. package/src/components/Button/ButtonText.tsx +4 -1
  132. package/src/components/Card/Card.context.ts +7 -0
  133. package/src/components/Card/Card.docs.mdx +212 -14
  134. package/src/components/Card/Card.stories.tsx +50 -3
  135. package/src/components/Card/CardAction/CardAction.context.ts +22 -0
  136. package/src/components/Card/CardAction/CardAction.props.ts +87 -0
  137. package/src/components/Card/CardAction/CardAction.stories.tsx +265 -0
  138. package/src/components/Card/CardAction/CardAction.tsx +10 -0
  139. package/src/components/Card/CardAction/CardActionContent.tsx +20 -0
  140. package/src/components/Card/CardAction/CardActionHelperText.tsx +21 -0
  141. package/src/components/Card/CardAction/CardActionIcon.tsx +32 -0
  142. package/src/components/Card/CardAction/CardActionLeadingContent.tsx +9 -0
  143. package/src/components/Card/CardAction/CardActionRoot.tsx +258 -0
  144. package/src/components/Card/CardAction/CardActionText.tsx +17 -0
  145. package/src/components/Card/CardAction/CardActionTrailingContent.tsx +9 -0
  146. package/src/components/Card/CardAction/CardActionTrailingIcon.tsx +32 -0
  147. package/src/components/Card/CardAction/index.ts +10 -0
  148. package/src/components/Card/CardContent.tsx +40 -0
  149. package/src/components/Card/CardPressHandler.context.ts +12 -0
  150. package/src/components/Card/CardPressHandler.tsx +20 -0
  151. package/src/components/Card/CardRoot.tsx +128 -13
  152. package/src/components/Card/index.ts +3 -2
  153. package/src/components/Checkbox/CheckboxIcon.tsx +2 -1
  154. package/src/components/Container/Container.docs.mdx +168 -0
  155. package/src/components/Container/Container.props.ts +89 -0
  156. package/src/components/Container/Container.stories.tsx +274 -0
  157. package/src/components/Container/Container.tsx +52 -0
  158. package/src/components/Container/index.tsx +2 -0
  159. package/src/components/CurrencyInput/CurrencyInput.tsx +1 -1
  160. package/src/components/Helper/HelperIcon.tsx +2 -1
  161. package/src/components/Icon/Icon.tsx +4 -3
  162. package/src/components/IconButton/IconButtonIcon.tsx +2 -1
  163. package/src/components/IconContainer/IconContainer.tsx +17 -19
  164. package/src/components/Input/InputField.tsx +2 -1
  165. package/src/components/Input/InputIcon.tsx +2 -1
  166. package/src/components/Link/LinkIcon.tsx +3 -2
  167. package/src/components/List/ListAction/ListActionTrailingIcon.tsx +2 -1
  168. package/src/components/List/ListItem/ListItemIcon.tsx +2 -1
  169. package/src/components/List/ListItem/ListItemTrailingIcon.tsx +2 -3
  170. package/src/components/ProgressStepper/ProgressStep.tsx +8 -8
  171. package/src/components/ProgressStepper/ProgressStepper.docs.mdx +11 -11
  172. package/src/components/ProgressStepper/ProgressStepper.props.ts +3 -3
  173. package/src/components/ProgressStepper/ProgressStepper.stories.tsx +27 -27
  174. package/src/components/ProgressStepper/index.ts +1 -1
  175. package/src/components/Radio/RadioIcon.tsx +8 -3
  176. package/src/components/RadioCard/RadioCardIcon.tsx +4 -3
  177. package/src/components/Spinner/Spinner.tsx +2 -0
  178. package/src/components/Spinner/Spinner.web.tsx +2 -0
  179. package/src/components/Switch/Switch.tsx +10 -5
  180. package/src/components/Switch/Switch.web.tsx +5 -0
  181. package/src/components/Tabs/TabsList.tsx +2 -0
  182. package/src/components/Textarea/TextareaField.tsx +1 -1
  183. package/src/components/ThemedImage/ThemedImage.docs.mdx +208 -0
  184. package/src/components/ThemedImage/ThemedImage.props.ts +15 -0
  185. package/src/components/ThemedImage/ThemedImage.stories.tsx +175 -0
  186. package/src/components/ThemedImage/ThemedImage.tsx +34 -0
  187. package/src/components/ThemedImage/index.tsx +2 -0
  188. package/src/components/ToggleButton/ToggleButtonIcon.tsx +2 -1
  189. package/src/components/ToggleButton/ToggleButtonRoot.tsx +2 -2
  190. package/src/components/UnstyledIconButton/UnstyledIconButtonIcon.tsx +2 -1
  191. package/src/components/index.ts +3 -9
  192. package/src/core/index.ts +14 -11
  193. package/src/hooks/useColorMode.ts +9 -12
  194. package/src/hooks/useStyleProps.ts +1 -1
  195. package/src/tokens/components/dark/banner.ts +19 -0
  196. package/src/tokens/components/dark/card-action.ts +11 -0
  197. package/src/tokens/components/dark/card-content.ts +25 -0
  198. package/src/tokens/components/dark/drawer.ts +29 -0
  199. package/src/tokens/components/dark/illustrations.ts +0 -1
  200. package/src/tokens/components/dark/index.ts +3 -0
  201. package/src/tokens/components/light/banner.ts +19 -0
  202. package/src/tokens/components/light/card-action.ts +11 -0
  203. package/src/tokens/components/light/card-content.ts +25 -0
  204. package/src/tokens/components/light/drawer.ts +29 -0
  205. package/src/tokens/components/light/illustrations.ts +0 -1
  206. package/src/tokens/components/light/index.ts +3 -0
  207. package/src/tokens/layout.ts +3 -3
  208. package/src/tokens/typography.ts +3 -0
  209. package/src/vite-env.d.ts +6 -0
  210. package/build/components/Card/CardAction.context.d.ts +0 -6
  211. package/build/components/Card/CardAction.js +0 -13
  212. package/src/components/Card/CardAction.context.ts +0 -12
  213. package/src/components/Card/CardAction.tsx +0 -18
@@ -10,6 +10,10 @@ import {
10
10
  InsuranceMediumIcon,
11
11
  MobileMediumIcon,
12
12
  } from '@utilitywarehouse/hearth-react-native-icons';
13
+ // @ts-ignore
14
+ import SpotBillingDark from '@utilitywarehouse/hearth-svg-assets/lib/spot-billing-dark.svg';
15
+ // @ts-ignore
16
+ import SpotBillingLight from '@utilitywarehouse/hearth-svg-assets/lib/spot-billing-light.svg';
13
17
  import { Pressable, ScrollView, View, ViewProps } from 'react-native';
14
18
  import { StyleSheet } from 'react-native-unistyles';
15
19
  import {
@@ -29,6 +33,7 @@ import {
29
33
  CarouselItem,
30
34
  Center,
31
35
  Checkbox,
36
+ Container,
32
37
  CurrencyInput,
33
38
  DatePicker,
34
39
  DatePickerInput,
@@ -53,8 +58,8 @@ import {
53
58
  ListItem,
54
59
  Modal,
55
60
  OL,
56
- ProgressStepper,
57
61
  ProgressStep,
62
+ ProgressStepper,
58
63
  Radio,
59
64
  RadioCard,
60
65
  RadioCardGroup,
@@ -69,6 +74,7 @@ import {
69
74
  Tabs,
70
75
  TabsList,
71
76
  Textarea,
77
+ ThemedImage,
72
78
  ToggleButtonCard,
73
79
  ToggleButtonCardGroup,
74
80
  UL,
@@ -154,7 +160,7 @@ const AllComponents: React.FC = () => {
154
160
  return (
155
161
  <div className="sb-unstyled">
156
162
  <ScrollView contentContainerStyle={styles.container}>
157
- <Flex direction="row" wrap="wrap" space="md">
163
+ <Flex direction="row" wrap="wrap" space="md" style={styles.grid}>
158
164
  <ComponentWrapper name="Accordion" link="/?path=/docs/components-accordion--docs">
159
165
  <Center flex={1} p="200">
160
166
  <Accordion type="single">
@@ -294,6 +300,13 @@ const AllComponents: React.FC = () => {
294
300
  </View>
295
301
  </Center>
296
302
  </ComponentWrapper>
303
+ <ComponentWrapper name="Container" link="/?path=/docs/primitives-container--docs">
304
+ <Container space="md" backgroundColor="backgroundSecondary">
305
+ <Box h={20} bg="blue300" />
306
+ <Box h={20} bg="blue400" />
307
+ <Box h={20} bg="blue500" />
308
+ </Container>
309
+ </ComponentWrapper>
297
310
  <ComponentWrapper name="Currency Input" link="/?path=/docs/forms-currency-input--docs">
298
311
  <Center flex={1} padding="200">
299
312
  <CurrencyInput />
@@ -514,7 +527,7 @@ const AllComponents: React.FC = () => {
514
527
  name="Progress Stepper"
515
528
  link="/?path=/docs/components-progress-stepper--docs"
516
529
  >
517
- <Center flex={1}>
530
+ <Center flex={1} px="300">
518
531
  <ProgressStepper>
519
532
  <ProgressStep id="customer-data" state="complete" />
520
533
  <ProgressStep id="shipping-data" state="complete" />
@@ -617,6 +630,17 @@ const AllComponents: React.FC = () => {
617
630
  <Textarea numberOfLines={3} placeholder="This is a textarea" />
618
631
  </Center>
619
632
  </ComponentWrapper>
633
+ <ComponentWrapper
634
+ name="Themed Image"
635
+ link="/?path=/docs/utility-components-themed-image--docs"
636
+ >
637
+ <Center flex={1} p="300">
638
+ <ThemedImage
639
+ light={<SpotBillingLight width={160} height={160} />}
640
+ dark={<SpotBillingDark width={160} height={160} />}
641
+ />
642
+ </Center>
643
+ </ComponentWrapper>
620
644
  <ComponentWrapper
621
645
  name="Toggle Button Card"
622
646
  link="/?path=/docs/components-toggle-button-card--docs"
@@ -658,6 +682,17 @@ const AllComponents: React.FC = () => {
658
682
 
659
683
  const styles = StyleSheet.create(theme => ({
660
684
  container: {},
685
+ grid: {
686
+ _web: {
687
+ display: 'grid',
688
+ gridTemplateColumns: {
689
+ xs: '1fr',
690
+ md: 'repeat(3, 1fr)',
691
+ lg: 'repeat(auto-fit, minmax(300px, 1fr))',
692
+ },
693
+ gap: theme.space['200'],
694
+ },
695
+ },
661
696
  component: {
662
697
  borderColor: theme.color.warmWhite[300],
663
698
  borderWidth: theme.borderWidth['1'],
@@ -1,6 +1,6 @@
1
1
  import { ChevronLeftSmallIcon } from '@utilitywarehouse/hearth-react-native-icons';
2
2
  import { StyleSheet, View } from 'react-native';
3
- import { Card, CardAction, Heading, Link } from '../../src';
3
+ import { Card, CardPressHandler, Heading, Link } from '../../src';
4
4
  import { addReactNativePrefix } from '../heplers';
5
5
 
6
6
  type NextPrevPageProps = {
@@ -34,7 +34,7 @@ const NextPrevPage: React.FC<NextPrevPageProps> = ({
34
34
  {!!prevLink && (
35
35
  <Card gap="100">
36
36
  {!!prevTitle && <Heading size="sm">{prevTitle}</Heading>}
37
- <CardAction>
37
+ <CardPressHandler>
38
38
  <Link
39
39
  onPress={() => openLink(prevLink)}
40
40
  iconPosition="left"
@@ -42,16 +42,16 @@ const NextPrevPage: React.FC<NextPrevPageProps> = ({
42
42
  >
43
43
  Prev Page
44
44
  </Link>
45
- </CardAction>
45
+ </CardPressHandler>
46
46
  </Card>
47
47
  )}
48
48
  <div />
49
49
  {!!nextLink && (
50
50
  <Card gap="100">
51
51
  {!!nextTitle && <Heading size="sm">{nextTitle}</Heading>}
52
- <CardAction>
52
+ <CardPressHandler>
53
53
  <Link onPress={() => openLink(nextLink)}>Next Page</Link>
54
- </CardAction>
54
+ </CardPressHandler>
55
55
  </Card>
56
56
  )}
57
57
  </View>
@@ -1,5 +1,6 @@
1
1
  import { ViewProps } from 'react-native';
2
- import { Box, DetailText, useColorMode } from '../../src';
2
+ import { StyleSheet } from 'react-native-unistyles';
3
+ import { Box, DetailText } from '../../src';
3
4
 
4
5
  const VariantTitle = ({
5
6
  title,
@@ -12,14 +13,10 @@ const VariantTitle = ({
12
13
  invert?: boolean;
13
14
  children: ViewProps['children'];
14
15
  }) => {
15
- const [colorMode] = useColorMode();
16
+ styles.useVariants({ invert });
16
17
  return (
17
18
  <Box gap="100" w="full">
18
- <DetailText
19
- textTransform={upperCase ? 'uppercase' : 'none'}
20
- size="sm"
21
- color={invert ? 'warmWhite50' : colorMode === 'light' ? 'grey600' : 'grey200'}
22
- >
19
+ <DetailText textTransform={upperCase ? 'uppercase' : 'none'} size="sm" style={styles.text}>
23
20
  {title}
24
21
  </DetailText>
25
22
  {children}
@@ -27,4 +24,17 @@ const VariantTitle = ({
27
24
  );
28
25
  };
29
26
 
27
+ const styles = StyleSheet.create(theme => ({
28
+ text: {
29
+ color: theme.colorMode === 'light' ? theme.color.grey[600] : theme.color.grey[200],
30
+ variants: {
31
+ invert: {
32
+ true: {
33
+ color: theme.color.warmWhite[50],
34
+ },
35
+ },
36
+ },
37
+ },
38
+ }));
39
+
30
40
  export default VariantTitle;
@@ -1,5 +1,6 @@
1
1
  import { ArgTypes, Canvas, Meta } from '@storybook/addon-docs/blocks';
2
2
  import * as BoxStories from '../src/components/Box/Box.stories';
3
+ import * as ContainerStories from '../src/components/Container/Container.stories';
3
4
  import * as FlexStories from '../src/components/Flex/Flex.stories';
4
5
  import * as GridStories from '../src/components/Grid/Grid.stories';
5
6
  import { BackToTopButton, NextPrevPage } from './components';
@@ -15,6 +16,7 @@ upon our design tokens, and providing styling options which make it easier to
15
16
  apply design decisions coherently.
16
17
 
17
18
  - [Box](#box)
19
+ - [Container](#container)
18
20
  - [Flex](#flex)
19
21
  - [Grid](#grid)
20
22
 
@@ -36,6 +38,34 @@ elements within `Flex` and `Grid` containers.
36
38
  </Box>
37
39
  ```
38
40
 
41
+ ## Container
42
+
43
+ <Canvas of={ContainerStories.Playground} sourceState="none" />
44
+
45
+ `Container` is a specialised layout component that provides consistent page-level
46
+ spacing using the design system's responsive layout tokens. It automatically applies
47
+ appropriate margin and padding based on the current breakpoint, making it ideal for
48
+ wrapping page content or major sections.
49
+
50
+ ```tsx
51
+ <Container space="lg">
52
+ <Box>{...}</Box>
53
+ <Box>{...}</Box>
54
+ </Container>
55
+ ```
56
+
57
+ When you need custom spacing, you can override the defaults while maintaining
58
+ the convenience of the component:
59
+
60
+ ```tsx
61
+ <Container
62
+ marginHorizontal="none"
63
+ space="xl"
64
+ >
65
+ {...}
66
+ </Container>
67
+ ```
68
+
39
69
  ## Flex
40
70
 
41
71
  <Canvas of={FlexStories.Playground} sourceState="none" />
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@utilitywarehouse/hearth-react-native",
3
- "version": "0.5.0",
3
+ "version": "0.7.0",
4
4
  "description": "Utility Warehouse React Native UI library",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -24,38 +24,42 @@
24
24
  },
25
25
  "devDependencies": {
26
26
  "@babel/plugin-proposal-export-namespace-from": "^7.18.9",
27
- "@chromatic-com/storybook": "^4.1.1",
27
+ "@chromatic-com/storybook": "^4.1.2",
28
28
  "@figma/code-connect": "^1.3.3",
29
- "@gorhom/bottom-sheet": "5.1.6",
30
- "@storybook/addon-a11y": "^9.1.6",
31
- "@storybook/addon-docs": "^9.1.6",
32
- "@storybook/addon-vitest": "^9.1.6",
33
- "@storybook/react-native-web-vite": "^9.1.6",
29
+ "@gorhom/bottom-sheet": "5.2.6",
30
+ "@storybook/addon-a11y": "^10.0.5",
31
+ "@storybook/addon-docs": "^10.0.5",
32
+ "@storybook/addon-vitest": "^10.0.5",
33
+ "@storybook/react": "^10.0.5",
34
+ "@storybook/react-native-web-vite": "^10.0.5",
34
35
  "@types/prismjs": "^1.26.5",
35
36
  "@types/react": "^19.1.10",
36
37
  "@vitest/browser": "^3.2.4",
37
38
  "@vitest/coverage-v8": "^3.2.4",
38
39
  "chromatic": "^13.3.0",
39
- "eslint-plugin-storybook": "9.1.6",
40
+ "eslint-plugin-storybook": "10.0.5",
40
41
  "playwright": "^1.55.1",
41
42
  "prismjs": "^1.30.0",
42
43
  "react": "^19.1.0",
43
44
  "react-native": "0.80.0",
44
45
  "react-native-edge-to-edge": "1.6.1",
45
46
  "react-native-gesture-handler": "2.26.0",
46
- "react-native-nitro-modules": "^0.28.0",
47
- "react-native-reanimated": "3.19.1",
47
+ "react-native-nitro-modules": "^0.31.4",
48
+ "react-native-reanimated": "4.1.3",
48
49
  "react-native-svg": "^15.12.1",
49
- "react-native-unistyles": "3.0.10",
50
+ "react-native-unistyles": "3.0.17",
50
51
  "react-native-web": "^0.20.0",
52
+ "react-native-worklets": "^0.6.1",
51
53
  "remark-gfm": "^4.0.1",
52
- "storybook": "^9.1.6",
54
+ "storybook": "^10.0.5",
53
55
  "typescript": "^5.7.3",
54
56
  "vite": "^7.1.3",
57
+ "vite-plugin-svgr": "^4.5.0",
55
58
  "vitest": "^3.2.4",
56
59
  "@utilitywarehouse/hearth-fonts": "^0.0.4",
57
- "@utilitywarehouse/hearth-react-icons": "^0.7.0",
58
- "@utilitywarehouse/hearth-react-native-icons": "^0.7.0",
60
+ "@utilitywarehouse/hearth-react-icons": "^0.7.2",
61
+ "@utilitywarehouse/hearth-react-native-icons": "^0.7.2",
62
+ "@utilitywarehouse/hearth-svg-assets": "^0.2.0",
59
63
  "@utilitywarehouse/hearth-tokens": "^0.1.3"
60
64
  },
61
65
  "peerDependencies": {
@@ -1,7 +1,7 @@
1
1
  import { BottomSheetBackdrop as Backdrop } from '@gorhom/bottom-sheet';
2
+ import { BottomSheetDefaultBackdropProps } from '@gorhom/bottom-sheet/lib/typescript/components/bottomSheetBackdrop/types';
2
3
  import { StyleSheet, withUnistyles } from 'react-native-unistyles';
3
4
  import { useTheme } from '../../hooks';
4
- import { BottomSheetDefaultBackdropProps } from '@gorhom/bottom-sheet/lib/typescript/components/bottomSheetBackdrop/types';
5
5
 
6
6
  const StyledBottomSheetBackdrop = withUnistyles(Backdrop);
7
7
 
@@ -9,7 +9,7 @@ const BottomSheetBackdrop = ({ style, ...props }: BottomSheetDefaultBackdropProp
9
9
  const theme = useTheme();
10
10
  return (
11
11
  <StyledBottomSheetBackdrop
12
- // @ts-expect-error - style unistyles error
12
+ // @ts-expect-error - style prop type issue
13
13
  style={[styles.backdrop, style]}
14
14
  opacity={theme.components.overlay.opacity / 100}
15
15
  appearsOnIndex={0}
@@ -1,8 +1,7 @@
1
-
2
1
  import { BottomSheetFlatList as FlatList } from '@gorhom/bottom-sheet';
2
+ import { BottomSheetFlatListProps } from '@gorhom/bottom-sheet/lib/typescript/components/bottomSheetScrollable/types';
3
3
  import { StyleSheet, withUnistyles } from 'react-native-unistyles';
4
4
  import { useBottomSheetContext } from './BottomSheet.context';
5
- import { BottomSheetFlatListProps } from '@gorhom/bottom-sheet/lib/typescript/components/bottomSheetScrollable/types';
6
5
 
7
6
  const StyledBottomSheetFlatList = withUnistyles(FlatList);
8
7
 
@@ -20,7 +19,7 @@ const BottomSheetFlatList = ({
20
19
 
21
20
  return (
22
21
  <StyledBottomSheetFlatList
23
- // @ts-expect-error - style
22
+ // @ts-expect-error - style prop type issue
24
23
  style={[styles.container, style]}
25
24
  contentContainerStyle={[styles.contentContainer, contentContainerStyle]}
26
25
  {...props}
@@ -7,7 +7,7 @@ const StyledBottomSheetHandle = withUnistyles(Handle);
7
7
  const BottomSheetHandle = ({ style, indicatorStyle, ...props }: BottomSheetDefaultHandleProps) => {
8
8
  return (
9
9
  <StyledBottomSheetHandle
10
- // @ts-expect-error - style
10
+ // @ts-expect-error - style prop type issue
11
11
  style={[styles.handle, style]}
12
12
  indicatorStyle={[styles.indicator, indicatorStyle]}
13
13
  {...props}
@@ -13,7 +13,8 @@ const ButtonIcon = ({ 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
  >
@@ -1,7 +1,7 @@
1
1
  import { useMemo } from 'react';
2
2
  import { Pressable, ViewStyle } from 'react-native';
3
3
  import { StyleSheet } from 'react-native-unistyles';
4
- import { useCardActionContext } from '../Card';
4
+ import { useCardPressHandlerContext } from '../Card';
5
5
  import { ButtonContext } from './Button.context';
6
6
  import type { BaseButtonProps } from './Button.props';
7
7
 
@@ -17,7 +17,7 @@ const ButtonRoot = ({
17
17
  ...props
18
18
  }: BaseButtonProps & { states?: { active?: boolean; disabled?: boolean } }) => {
19
19
  const { active, disabled = false } = states || {};
20
- const { pressed } = useCardActionContext();
20
+ const { pressed } = useCardPressHandlerContext();
21
21
 
22
22
  styles.useVariants({
23
23
  variant,
@@ -103,7 +103,6 @@ const styles = StyleSheet.create(theme => ({
103
103
  ghost: {
104
104
  backgroundColor: 'transparent',
105
105
  borderWidth: 0,
106
- textDecoration: 'underline',
107
106
  },
108
107
  },
109
108
  size: {
@@ -349,7 +348,6 @@ const styles = StyleSheet.create(theme => ({
349
348
  variant: 'ghost',
350
349
  colorScheme: 'functional',
351
350
  styles: {
352
- textDecorationColor: theme.color.interactive.functional.foreground.subtle,
353
351
  _web: {
354
352
  _hover: {
355
353
  backgroundColor: theme.color.interactive.functional.surface.subtle.hover,
@@ -397,7 +395,6 @@ const styles = StyleSheet.create(theme => ({
397
395
  variant: 'ghost',
398
396
  colorScheme: 'affirmative',
399
397
  styles: {
400
- textDecorationColor: theme.color.interactive.affirmative.foreground.subtle,
401
398
  _web: {
402
399
  _hover: {
403
400
  backgroundColor: theme.color.interactive.affirmative.surface.subtle.hover,
@@ -421,7 +418,6 @@ const styles = StyleSheet.create(theme => ({
421
418
  variant: 'ghost',
422
419
  colorScheme: 'destructive',
423
420
  styles: {
424
- textDecorationColor: theme.color.interactive.destructive.foreground.subtle,
425
421
  _web: {
426
422
  _hover: {
427
423
  backgroundColor: theme.color.interactive.destructive.surface.subtle.hover,
@@ -22,7 +22,10 @@ const styles = StyleSheet.create(theme => ({
22
22
  emphasis: {},
23
23
  solid: {},
24
24
  outline: {},
25
- ghost: {},
25
+ ghost: {
26
+ textDecorationStyle: 'solid',
27
+ textDecorationLine: 'underline',
28
+ },
26
29
  },
27
30
  colorScheme: {
28
31
  highlight: {},
@@ -1,7 +1,14 @@
1
1
  import { createContext, useContext } from 'react';
2
+ import CardProps from './Card.props';
2
3
 
3
4
  interface CardContextProps {
4
5
  pressed?: boolean;
6
+ noPadding?: boolean;
7
+ hasActions?: boolean;
8
+ hasContent?: boolean;
9
+ hasOnlyActions?: boolean;
10
+ space?: CardProps['space'];
11
+ variant?: CardProps['variant'];
5
12
  }
6
13
 
7
14
  export const CardContext = createContext<CardContextProps>({});