@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.
- package/.storybook/main.ts +33 -7
- package/.turbo/turbo-build.log +1 -1
- package/.turbo/turbo-lint.log +1 -1
- package/CHANGELOG.md +14 -0
- package/build/components/BottomSheet/BottomSheetBackdrop.js +2 -2
- package/build/components/BottomSheet/BottomSheetFlatList.js +2 -2
- package/build/components/BottomSheet/BottomSheetHandle.js +2 -2
- package/build/components/Button/ButtonIcon.js +2 -1
- package/build/components/Button/ButtonRoot.js +2 -6
- package/build/components/Button/ButtonText.js +4 -1
- package/build/components/Card/Card.context.d.ts +7 -0
- package/build/components/Card/CardAction/CardAction.context.d.ts +9 -0
- package/build/components/Card/{CardAction.context.js → CardAction/CardAction.context.js} +7 -1
- package/build/components/Card/CardAction/CardAction.d.ts +18 -0
- package/build/components/Card/CardAction/CardAction.js +7 -0
- package/build/components/Card/CardAction/CardAction.props.d.ts +63 -0
- package/build/components/Card/CardAction/CardAction.props.js +1 -0
- package/build/components/Card/CardAction/CardActionContent.d.ts +6 -0
- package/build/components/Card/CardAction/CardActionContent.js +13 -0
- package/build/components/Card/CardAction/CardActionHelperText.d.ts +6 -0
- package/build/components/Card/CardAction/CardActionHelperText.js +13 -0
- package/build/components/Card/CardAction/CardActionIcon.d.ts +9 -0
- package/build/components/Card/CardAction/CardActionIcon.js +19 -0
- package/build/components/Card/CardAction/CardActionLeadingContent.d.ts +6 -0
- package/build/components/Card/CardAction/CardActionLeadingContent.js +5 -0
- package/build/components/Card/CardAction/CardActionRoot.d.ts +12 -0
- package/build/components/Card/CardAction/CardActionRoot.js +155 -0
- package/build/components/Card/CardAction/CardActionText.d.ts +6 -0
- package/build/components/Card/CardAction/CardActionText.js +9 -0
- package/build/components/Card/CardAction/CardActionTrailingContent.d.ts +6 -0
- package/build/components/Card/CardAction/CardActionTrailingContent.js +5 -0
- package/build/components/Card/CardAction/CardActionTrailingIcon.d.ts +9 -0
- package/build/components/Card/CardAction/CardActionTrailingIcon.js +19 -0
- package/build/components/Card/CardAction/index.d.ts +10 -0
- package/build/components/Card/CardAction/index.js +9 -0
- package/build/components/Card/CardContent.d.ts +6 -0
- package/build/components/Card/CardContent.js +33 -0
- package/build/components/Card/CardPressHandler.context.d.ts +6 -0
- package/build/components/Card/CardPressHandler.context.js +6 -0
- package/build/components/Card/{CardAction.d.ts → CardPressHandler.d.ts} +3 -3
- package/build/components/Card/CardPressHandler.js +13 -0
- package/build/components/Card/CardRoot.js +103 -11
- package/build/components/Card/index.d.ts +3 -2
- package/build/components/Card/index.js +3 -2
- package/build/components/Checkbox/CheckboxIcon.js +2 -1
- package/build/components/Container/Container.d.ts +6 -0
- package/build/components/Container/Container.js +40 -0
- package/build/components/Container/Container.props.d.ts +85 -0
- package/build/components/Container/Container.props.js +1 -0
- package/build/components/Container/index.d.ts +2 -0
- package/build/components/Container/index.js +1 -0
- package/build/components/CurrencyInput/CurrencyInput.js +1 -1
- package/build/components/Helper/HelperIcon.js +2 -1
- package/build/components/Icon/Icon.d.ts +2 -6
- package/build/components/IconButton/IconButtonIcon.js +2 -1
- package/build/components/IconContainer/IconContainer.d.ts +4 -3
- package/build/components/IconContainer/IconContainer.js +3 -3
- package/build/components/Input/InputField.js +4 -2
- package/build/components/Input/InputIcon.js +2 -1
- package/build/components/Link/LinkIcon.js +3 -2
- package/build/components/List/ListAction/ListActionTrailingIcon.js +2 -1
- package/build/components/List/ListItem/ListItemIcon.js +2 -1
- package/build/components/List/ListItem/ListItemTrailingIcon.js +2 -3
- package/build/components/ProgressStepper/ProgressStep.d.ts +1 -1
- package/build/components/ProgressStepper/ProgressStep.js +6 -6
- package/build/components/ProgressStepper/ProgressStepper.props.d.ts +3 -3
- package/build/components/ProgressStepper/index.d.ts +1 -1
- package/build/components/Radio/RadioIcon.js +7 -2
- package/build/components/RadioCard/RadioCardIcon.js +3 -2
- package/build/components/Spinner/Spinner.js +2 -0
- package/build/components/Spinner/Spinner.web.js +2 -0
- package/build/components/Switch/Switch.js +5 -3
- package/build/components/Switch/Switch.web.js +1 -0
- package/build/components/Tabs/TabsList.js +6 -1
- package/build/components/Textarea/TextareaField.js +1 -1
- package/build/components/ThemedImage/ThemedImage.d.ts +12 -0
- package/build/components/ThemedImage/ThemedImage.js +27 -0
- package/build/components/ThemedImage/ThemedImage.props.d.ts +13 -0
- package/build/components/ThemedImage/ThemedImage.props.js +1 -0
- package/build/components/ThemedImage/index.d.ts +2 -0
- package/build/components/ThemedImage/index.js +1 -0
- package/build/components/ToggleButton/ToggleButtonIcon.js +2 -1
- package/build/components/ToggleButton/ToggleButtonRoot.js +2 -2
- package/build/components/UnstyledIconButton/UnstyledIconButtonIcon.js +2 -1
- package/build/components/index.d.ts +3 -1
- package/build/components/index.js +3 -1
- package/build/core/index.d.ts +3 -3
- package/build/core/index.js +3 -3
- package/build/core/themes.d.ts +24 -12
- package/build/hooks/useColorMode.d.ts +1 -1
- package/build/hooks/useColorMode.js +7 -8
- package/build/hooks/useStyleProps.js +1 -1
- package/build/tokens/components/dark/banner.d.ts +19 -0
- package/build/tokens/components/dark/banner.js +19 -0
- package/build/tokens/components/dark/card-action.d.ts +11 -0
- package/build/tokens/components/dark/card-action.js +10 -0
- package/build/tokens/components/dark/card-content.d.ts +25 -0
- package/build/tokens/components/dark/card-content.js +24 -0
- package/build/tokens/components/dark/drawer.d.ts +29 -0
- package/build/tokens/components/dark/drawer.js +28 -0
- package/build/tokens/components/dark/illustrations.d.ts +0 -1
- package/build/tokens/components/dark/illustrations.js +0 -1
- package/build/tokens/components/dark/index.d.ts +3 -0
- package/build/tokens/components/dark/index.js +3 -0
- package/build/tokens/components/light/banner.d.ts +19 -0
- package/build/tokens/components/light/banner.js +19 -0
- package/build/tokens/components/light/card-action.d.ts +11 -0
- package/build/tokens/components/light/card-action.js +10 -0
- package/build/tokens/components/light/card-content.d.ts +25 -0
- package/build/tokens/components/light/card-content.js +24 -0
- package/build/tokens/components/light/drawer.d.ts +29 -0
- package/build/tokens/components/light/drawer.js +28 -0
- package/build/tokens/components/light/illustrations.d.ts +0 -1
- package/build/tokens/components/light/illustrations.js +0 -1
- package/build/tokens/components/light/index.d.ts +3 -0
- package/build/tokens/components/light/index.js +3 -0
- package/build/tokens/layout.d.ts +6 -6
- package/build/tokens/layout.js +3 -3
- package/build/tokens/typography.d.ts +6 -0
- package/build/tokens/typography.js +3 -0
- package/docs/components/AllComponents.web.tsx +38 -3
- package/docs/components/NextPrevPage.tsx +5 -5
- package/docs/components/VariantTitle.tsx +17 -7
- package/docs/layout-components.docs.mdx +30 -0
- package/package.json +18 -14
- package/src/components/BottomSheet/BottomSheetBackdrop.tsx +2 -2
- package/src/components/BottomSheet/BottomSheetFlatList.tsx +2 -3
- package/src/components/BottomSheet/BottomSheetHandle.tsx +1 -1
- package/src/components/Button/ButtonIcon.tsx +2 -1
- package/src/components/Button/ButtonRoot.tsx +2 -6
- package/src/components/Button/ButtonText.tsx +4 -1
- package/src/components/Card/Card.context.ts +7 -0
- package/src/components/Card/Card.docs.mdx +212 -14
- package/src/components/Card/Card.stories.tsx +50 -3
- package/src/components/Card/CardAction/CardAction.context.ts +22 -0
- package/src/components/Card/CardAction/CardAction.props.ts +87 -0
- package/src/components/Card/CardAction/CardAction.stories.tsx +265 -0
- package/src/components/Card/CardAction/CardAction.tsx +10 -0
- package/src/components/Card/CardAction/CardActionContent.tsx +20 -0
- package/src/components/Card/CardAction/CardActionHelperText.tsx +21 -0
- package/src/components/Card/CardAction/CardActionIcon.tsx +32 -0
- package/src/components/Card/CardAction/CardActionLeadingContent.tsx +9 -0
- package/src/components/Card/CardAction/CardActionRoot.tsx +258 -0
- package/src/components/Card/CardAction/CardActionText.tsx +17 -0
- package/src/components/Card/CardAction/CardActionTrailingContent.tsx +9 -0
- package/src/components/Card/CardAction/CardActionTrailingIcon.tsx +32 -0
- package/src/components/Card/CardAction/index.ts +10 -0
- package/src/components/Card/CardContent.tsx +40 -0
- package/src/components/Card/CardPressHandler.context.ts +12 -0
- package/src/components/Card/CardPressHandler.tsx +20 -0
- package/src/components/Card/CardRoot.tsx +128 -13
- package/src/components/Card/index.ts +3 -2
- package/src/components/Checkbox/CheckboxIcon.tsx +2 -1
- package/src/components/Container/Container.docs.mdx +168 -0
- package/src/components/Container/Container.props.ts +89 -0
- package/src/components/Container/Container.stories.tsx +274 -0
- package/src/components/Container/Container.tsx +52 -0
- package/src/components/Container/index.tsx +2 -0
- package/src/components/CurrencyInput/CurrencyInput.tsx +1 -1
- package/src/components/Helper/HelperIcon.tsx +2 -1
- package/src/components/Icon/Icon.tsx +4 -3
- package/src/components/IconButton/IconButtonIcon.tsx +2 -1
- package/src/components/IconContainer/IconContainer.tsx +17 -19
- package/src/components/Input/InputField.tsx +2 -1
- package/src/components/Input/InputIcon.tsx +2 -1
- package/src/components/Link/LinkIcon.tsx +3 -2
- package/src/components/List/ListAction/ListActionTrailingIcon.tsx +2 -1
- package/src/components/List/ListItem/ListItemIcon.tsx +2 -1
- package/src/components/List/ListItem/ListItemTrailingIcon.tsx +2 -3
- package/src/components/ProgressStepper/ProgressStep.tsx +8 -8
- package/src/components/ProgressStepper/ProgressStepper.docs.mdx +11 -11
- package/src/components/ProgressStepper/ProgressStepper.props.ts +3 -3
- package/src/components/ProgressStepper/ProgressStepper.stories.tsx +27 -27
- package/src/components/ProgressStepper/index.ts +1 -1
- package/src/components/Radio/RadioIcon.tsx +8 -3
- package/src/components/RadioCard/RadioCardIcon.tsx +4 -3
- package/src/components/Spinner/Spinner.tsx +2 -0
- package/src/components/Spinner/Spinner.web.tsx +2 -0
- package/src/components/Switch/Switch.tsx +10 -5
- package/src/components/Switch/Switch.web.tsx +5 -0
- package/src/components/Tabs/TabsList.tsx +2 -0
- package/src/components/Textarea/TextareaField.tsx +1 -1
- package/src/components/ThemedImage/ThemedImage.docs.mdx +208 -0
- package/src/components/ThemedImage/ThemedImage.props.ts +15 -0
- package/src/components/ThemedImage/ThemedImage.stories.tsx +175 -0
- package/src/components/ThemedImage/ThemedImage.tsx +34 -0
- package/src/components/ThemedImage/index.tsx +2 -0
- package/src/components/ToggleButton/ToggleButtonIcon.tsx +2 -1
- package/src/components/ToggleButton/ToggleButtonRoot.tsx +2 -2
- package/src/components/UnstyledIconButton/UnstyledIconButtonIcon.tsx +2 -1
- package/src/components/index.ts +3 -9
- package/src/core/index.ts +14 -11
- package/src/hooks/useColorMode.ts +9 -12
- package/src/hooks/useStyleProps.ts +1 -1
- package/src/tokens/components/dark/banner.ts +19 -0
- package/src/tokens/components/dark/card-action.ts +11 -0
- package/src/tokens/components/dark/card-content.ts +25 -0
- package/src/tokens/components/dark/drawer.ts +29 -0
- package/src/tokens/components/dark/illustrations.ts +0 -1
- package/src/tokens/components/dark/index.ts +3 -0
- package/src/tokens/components/light/banner.ts +19 -0
- package/src/tokens/components/light/card-action.ts +11 -0
- package/src/tokens/components/light/card-content.ts +25 -0
- package/src/tokens/components/light/drawer.ts +29 -0
- package/src/tokens/components/light/illustrations.ts +0 -1
- package/src/tokens/components/light/index.ts +3 -0
- package/src/tokens/layout.ts +3 -3
- package/src/tokens/typography.ts +3 -0
- package/src/vite-env.d.ts +6 -0
- package/build/components/Card/CardAction.context.d.ts +0 -6
- package/build/components/Card/CardAction.js +0 -13
- package/src/components/Card/CardAction.context.ts +0 -12
- 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,
|
|
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
|
-
<
|
|
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
|
-
</
|
|
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
|
-
<
|
|
52
|
+
<CardPressHandler>
|
|
53
53
|
<Link onPress={() => openLink(nextLink)}>Next Page</Link>
|
|
54
|
-
</
|
|
54
|
+
</CardPressHandler>
|
|
55
55
|
</Card>
|
|
56
56
|
)}
|
|
57
57
|
</View>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ViewProps } from 'react-native';
|
|
2
|
-
import {
|
|
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
|
-
|
|
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.
|
|
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.
|
|
27
|
+
"@chromatic-com/storybook": "^4.1.2",
|
|
28
28
|
"@figma/code-connect": "^1.3.3",
|
|
29
|
-
"@gorhom/bottom-sheet": "5.
|
|
30
|
-
"@storybook/addon-a11y": "^
|
|
31
|
-
"@storybook/addon-docs": "^
|
|
32
|
-
"@storybook/addon-vitest": "^
|
|
33
|
-
"@storybook/react
|
|
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": "
|
|
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.
|
|
47
|
-
"react-native-reanimated": "
|
|
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.
|
|
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": "^
|
|
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.
|
|
58
|
-
"@utilitywarehouse/hearth-react-native-icons": "^0.7.
|
|
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
|
|
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
|
-
?
|
|
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 {
|
|
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 } =
|
|
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,
|
|
@@ -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>({});
|