@utilitywarehouse/hearth-react-native 0.4.2 → 0.5.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/.turbo/turbo-build.log +1 -1
- package/.turbo/turbo-lint.log +1 -1
- package/CHANGELOG.md +44 -0
- package/build/components/Alert/AlertTitle.js +6 -6
- package/build/components/Badge/Badge.js +3 -3
- package/build/components/Badge/Badge.props.d.ts +1 -0
- package/build/components/Button/ButtonRoot.js +4 -0
- package/build/components/Button/ButtonText.js +2 -2
- package/build/components/Card/CardRoot.js +1 -1
- package/build/components/Carousel/Carousel.context.d.ts +4 -0
- package/build/components/Carousel/Carousel.context.js +4 -0
- package/build/components/Carousel/Carousel.d.ts +6 -0
- package/build/components/Carousel/Carousel.js +278 -0
- package/build/components/Carousel/Carousel.props.d.ts +65 -0
- package/build/components/Carousel/Carousel.props.js +1 -0
- package/build/components/Carousel/CarouselControlItem.d.ts +24 -0
- package/build/components/Carousel/CarouselControlItem.js +64 -0
- package/build/components/Carousel/CarouselControls.d.ts +4 -0
- package/build/components/Carousel/CarouselControls.js +74 -0
- package/build/components/Carousel/CarouselItem.d.ts +6 -0
- package/build/components/Carousel/CarouselItem.js +38 -0
- package/build/components/Carousel/index.d.ts +5 -0
- package/build/components/Carousel/index.js +5 -0
- package/build/components/DescriptionList/DescriptionList.d.ts +1 -1
- package/build/components/DescriptionList/DescriptionList.js +2 -2
- package/build/components/DescriptionList/DescriptionList.props.d.ts +1 -8
- package/build/components/DescriptionList/DescriptionListItem.d.ts +1 -1
- package/build/components/DescriptionList/DescriptionListItem.js +4 -3
- package/build/components/DescriptionList/DescriptionListItem.props.d.ts +3 -8
- package/build/components/IndicatorIconButton/IndicatorIconButton.d.ts +6 -0
- package/build/components/IndicatorIconButton/IndicatorIconButton.js +26 -0
- package/build/components/IndicatorIconButton/IndicatorIconButton.props.d.ts +8 -0
- package/build/components/IndicatorIconButton/IndicatorIconButton.props.js +1 -0
- package/build/components/IndicatorIconButton/index.d.ts +2 -0
- package/build/components/IndicatorIconButton/index.js +1 -0
- package/build/components/Link/LinkText.js +3 -3
- package/build/components/List/List.context.d.ts +0 -2
- package/build/components/List/List.d.ts +1 -1
- package/build/components/List/List.js +5 -5
- package/build/components/List/List.props.d.ts +1 -9
- package/build/components/List/ListAction/ListAction.d.ts +18 -0
- package/build/components/List/ListAction/ListAction.js +103 -0
- package/build/components/List/ListAction/ListAction.props.d.ts +8 -0
- package/build/components/List/ListAction/ListAction.props.js +1 -0
- package/build/components/List/ListAction/ListActionContent.d.ts +6 -0
- package/build/components/List/ListAction/ListActionContent.js +14 -0
- package/build/components/List/ListAction/ListActionText.d.ts +6 -0
- package/build/components/List/ListAction/ListActionText.js +7 -0
- package/build/components/List/ListAction/ListActionTrailingContent.d.ts +6 -0
- package/build/components/List/ListAction/ListActionTrailingContent.js +5 -0
- package/build/components/List/ListAction/ListActionTrailingIcon.d.ts +9 -0
- package/build/components/List/ListAction/ListActionTrailingIcon.js +18 -0
- package/build/components/List/ListAction/index.d.ts +6 -0
- package/build/components/List/ListAction/index.js +5 -0
- package/build/components/List/ListItem/ListItem.context.d.ts +1 -1
- package/build/components/List/ListItem/ListItem.props.d.ts +9 -5
- package/build/components/List/ListItem/ListItemRoot.d.ts +1 -1
- package/build/components/List/ListItem/ListItemRoot.js +10 -12
- package/build/components/List/ListItem/index.d.ts +4 -4
- package/build/components/List/ListItem/index.js +3 -3
- package/build/components/List/index.d.ts +1 -0
- package/build/components/List/index.js +1 -0
- package/build/components/ProgressStepper/ProgressStep.d.ts +10 -0
- package/build/components/ProgressStepper/ProgressStep.js +100 -0
- package/build/components/ProgressStepper/ProgressStepper.d.ts +6 -0
- package/build/components/ProgressStepper/ProgressStepper.js +22 -0
- package/build/components/ProgressStepper/ProgressStepper.props.d.ts +22 -0
- package/build/components/ProgressStepper/ProgressStepper.props.js +1 -0
- package/build/components/ProgressStepper/ProgressStepperRoot.d.ts +6 -0
- package/build/components/ProgressStepper/ProgressStepperRoot.js +16 -0
- package/build/components/ProgressStepper/index.d.ts +3 -0
- package/build/components/ProgressStepper/index.js +2 -0
- package/build/components/SectionHeader/SectionHeader.d.ts +1 -1
- package/build/components/SectionHeader/SectionHeader.js +6 -3
- package/build/components/SectionHeader/SectionHeader.props.d.ts +9 -16
- package/build/components/SectionHeader/SectionHeaderTrailingContent.d.ts +6 -0
- package/build/components/SectionHeader/SectionHeaderTrailingContent.js +13 -0
- package/build/components/SectionHeader/index.d.ts +1 -0
- package/build/components/SectionHeader/index.js +1 -0
- package/build/components/Tabs/Tab.js +2 -2
- package/build/components/ToggleButton/ToggleButtonText.js +2 -2
- package/build/components/UnstyledIconButton/UnstyledIconButton.props.d.ts +4 -1
- package/build/components/index.d.ts +3 -0
- package/build/components/index.js +3 -0
- package/build/core/themes.d.ts +12 -24
- package/build/tokens/components/dark/button.d.ts +1 -1
- package/build/tokens/components/dark/button.js +1 -1
- package/build/tokens/components/dark/dialog.d.ts +1 -0
- package/build/tokens/components/dark/dialog.js +1 -0
- package/build/tokens/components/dark/illustrations.d.ts +1 -0
- package/build/tokens/components/dark/illustrations.js +1 -0
- package/build/tokens/components/dark/toast.d.ts +4 -1
- package/build/tokens/components/dark/toast.js +4 -1
- package/build/tokens/components/light/button.d.ts +1 -1
- package/build/tokens/components/light/button.js +1 -1
- package/build/tokens/components/light/dialog.d.ts +1 -0
- package/build/tokens/components/light/dialog.js +1 -0
- package/build/tokens/components/light/illustrations.d.ts +1 -0
- package/build/tokens/components/light/illustrations.js +1 -0
- package/build/tokens/components/light/toast.d.ts +4 -1
- package/build/tokens/components/light/toast.js +4 -1
- package/build/tokens/layout.d.ts +6 -12
- package/build/tokens/layout.js +3 -6
- package/docs/components/AllComponents.web.tsx +86 -4
- package/docs/components/BadgeList.tsx +20 -56
- package/docs/components/SwitchList.tsx +4 -8
- package/docs/getting-started.mdx +30 -14
- package/docs/introduction.mdx +1 -1
- package/package.json +4 -4
- package/src/components/Alert/AlertTitle.tsx +7 -7
- package/src/components/Badge/Badge.props.ts +1 -0
- package/src/components/Badge/Badge.tsx +3 -2
- package/src/components/Button/ButtonRoot.tsx +4 -0
- package/src/components/Button/ButtonText.tsx +3 -3
- package/src/components/Card/CardRoot.tsx +2 -0
- package/src/components/Carousel/Carousel.context.tsx +8 -0
- package/src/components/Carousel/Carousel.docs.mdx +389 -0
- package/src/components/Carousel/Carousel.props.ts +89 -0
- package/src/components/Carousel/Carousel.stories.tsx +317 -0
- package/src/components/Carousel/Carousel.tsx +444 -0
- package/src/components/Carousel/CarouselControlItem.tsx +87 -0
- package/src/components/Carousel/CarouselControls.tsx +150 -0
- package/src/components/Carousel/CarouselItem.tsx +68 -0
- package/src/components/Carousel/index.ts +6 -0
- package/src/components/DescriptionList/DescriptionList.docs.mdx +24 -27
- package/src/components/DescriptionList/DescriptionList.props.ts +1 -8
- package/src/components/DescriptionList/DescriptionList.stories.tsx +13 -19
- package/src/components/DescriptionList/DescriptionList.tsx +2 -14
- package/src/components/DescriptionList/DescriptionListItem.props.ts +3 -8
- package/src/components/DescriptionList/DescriptionListItem.tsx +13 -21
- package/src/components/IndicatorIconButton/IndicatorIconButton.docs.mdx +85 -0
- package/src/components/IndicatorIconButton/IndicatorIconButton.props.ts +12 -0
- package/src/components/IndicatorIconButton/IndicatorIconButton.stories.tsx +142 -0
- package/src/components/IndicatorIconButton/IndicatorIconButton.tsx +36 -0
- package/src/components/IndicatorIconButton/index.tsx +2 -0
- package/src/components/Link/LinkText.tsx +4 -4
- package/src/components/List/List.context.ts +0 -1
- package/src/components/List/List.docs.mdx +376 -179
- package/src/components/List/List.props.ts +1 -9
- package/src/components/List/List.stories.tsx +289 -38
- package/src/components/List/List.tsx +5 -26
- package/src/components/List/ListAction/ListAction.props.ts +10 -0
- package/src/components/List/ListAction/ListAction.tsx +133 -0
- package/src/components/List/ListAction/ListActionContent.tsx +21 -0
- package/src/components/List/ListAction/ListActionText.tsx +14 -0
- package/src/components/List/ListAction/ListActionTrailingContent.tsx +9 -0
- package/src/components/List/ListAction/ListActionTrailingIcon.tsx +32 -0
- package/src/components/List/ListAction/index.ts +6 -0
- package/src/components/List/ListItem/ListItem.context.ts +1 -1
- package/src/components/List/ListItem/ListItem.props.ts +9 -5
- package/src/components/List/ListItem/ListItemRoot.tsx +18 -14
- package/src/components/List/ListItem/index.ts +4 -4
- package/src/components/List/index.ts +1 -0
- package/src/components/ProgressStepper/ProgressStep.tsx +134 -0
- package/src/components/ProgressStepper/ProgressStepper.docs.mdx +87 -0
- package/src/components/ProgressStepper/ProgressStepper.props.ts +27 -0
- package/src/components/ProgressStepper/ProgressStepper.stories.tsx +108 -0
- package/src/components/ProgressStepper/ProgressStepper.tsx +26 -0
- package/src/components/ProgressStepper/ProgressStepperRoot.tsx +32 -0
- package/src/components/ProgressStepper/index.ts +3 -0
- package/src/components/SectionHeader/SectionHeader.props.ts +9 -16
- package/src/components/SectionHeader/SectionHeader.stories.tsx +28 -18
- package/src/components/SectionHeader/SectionHeader.tsx +18 -19
- package/src/components/SectionHeader/SectionHeaderTrailingContent.tsx +20 -0
- package/src/components/SectionHeader/Sectionheader.docs.mdx +9 -24
- package/src/components/SectionHeader/index.ts +1 -0
- package/src/components/Switch/Switch.docs.mdx +0 -4
- package/src/components/Tabs/Tab.tsx +4 -2
- package/src/components/ToggleButton/ToggleButtonText.tsx +3 -3
- package/src/components/UnstyledIconButton/UnstyledIconButton.props.ts +2 -1
- package/src/components/index.ts +3 -0
- package/src/tokens/components/dark/button.ts +1 -1
- package/src/tokens/components/dark/dialog.ts +1 -0
- package/src/tokens/components/dark/illustrations.ts +1 -0
- package/src/tokens/components/dark/toast.ts +4 -1
- package/src/tokens/components/light/button.ts +1 -1
- package/src/tokens/components/light/dialog.ts +1 -0
- package/src/tokens/components/light/illustrations.ts +1 -0
- package/src/tokens/components/light/toast.ts +4 -1
- package/src/tokens/layout.ts +3 -6
|
@@ -1,64 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Badge,
|
|
3
|
-
BadgeText,
|
|
4
|
-
Box,
|
|
5
|
-
Flex,
|
|
6
|
-
List,
|
|
7
|
-
ListItem,
|
|
8
|
-
ListItemContent,
|
|
9
|
-
ListItemHelperText,
|
|
10
|
-
ListItemIcon,
|
|
11
|
-
ListItemLeadingContent,
|
|
12
|
-
ListItemText,
|
|
13
|
-
ListItemTrailingContent,
|
|
14
|
-
ListItemTrailingIcon,
|
|
15
|
-
} from '../../src';
|
|
1
|
+
import { IconContainer, List, ListItem } from '../../src';
|
|
16
2
|
|
|
17
|
-
import {
|
|
18
|
-
ChevronRightMediumIcon,
|
|
19
|
-
ElectricityMediumIcon,
|
|
20
|
-
GasMediumIcon,
|
|
21
|
-
} from '@utilitywarehouse/hearth-react-native-icons';
|
|
3
|
+
import { ElectricityMediumIcon, GasMediumIcon } from '@utilitywarehouse/hearth-react-native-icons';
|
|
22
4
|
|
|
23
5
|
const BadgeList = () => {
|
|
24
6
|
return (
|
|
25
7
|
<List>
|
|
26
|
-
<ListItem
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
<
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
<ListItemLeadingContent>
|
|
45
|
-
<Box padding="300" borderRadius="lg" bg="energyBlue300">
|
|
46
|
-
<ListItemIcon as={GasMediumIcon} color="energyBlue600" />
|
|
47
|
-
</Box>
|
|
48
|
-
</ListItemLeadingContent>
|
|
49
|
-
<ListItemContent>
|
|
50
|
-
<Flex direction="row" style={{ justifyContent: 'space-between' }}>
|
|
51
|
-
<ListItemText>Gas</ListItemText>
|
|
52
|
-
<Badge colorScheme="positive">
|
|
53
|
-
<BadgeText>Smart meter</BadgeText>
|
|
54
|
-
</Badge>
|
|
55
|
-
</Flex>
|
|
56
|
-
<ListItemHelperText>Last reading 23/03/24</ListItemHelperText>
|
|
57
|
-
</ListItemContent>
|
|
58
|
-
<ListItemTrailingContent>
|
|
59
|
-
<ListItemTrailingIcon as={ChevronRightMediumIcon} />
|
|
60
|
-
</ListItemTrailingContent>
|
|
61
|
-
</ListItem>
|
|
8
|
+
<ListItem
|
|
9
|
+
heading="Electricity"
|
|
10
|
+
helperText="Last reading 23/03/24"
|
|
11
|
+
onPress={() => console.log('pressed')}
|
|
12
|
+
leadingContent={
|
|
13
|
+
<IconContainer icon={ElectricityMediumIcon} size="md" variant="emphasis" color="energy" />
|
|
14
|
+
}
|
|
15
|
+
badge={{ text: 'Text' }}
|
|
16
|
+
/>
|
|
17
|
+
<ListItem
|
|
18
|
+
heading="Gas"
|
|
19
|
+
helperText="Last reading 23/03/24"
|
|
20
|
+
onPress={() => console.log('pressed')}
|
|
21
|
+
leadingContent={
|
|
22
|
+
<IconContainer icon={GasMediumIcon} size="md" variant="emphasis" color="energy" />
|
|
23
|
+
}
|
|
24
|
+
badge={{ text: 'Smart Meter' }}
|
|
25
|
+
/>
|
|
62
26
|
</List>
|
|
63
27
|
);
|
|
64
28
|
};
|
|
@@ -16,9 +16,8 @@ const SwitchList = () => {
|
|
|
16
16
|
return (
|
|
17
17
|
<List container="subtleWhite">
|
|
18
18
|
<ListItem
|
|
19
|
-
|
|
19
|
+
heading="Notifications"
|
|
20
20
|
helperText="Allow notifications"
|
|
21
|
-
divider
|
|
22
21
|
leadingContent={<ListItemIcon as={BellMediumIcon} />}
|
|
23
22
|
trailingContent={
|
|
24
23
|
<Switch value={notifications} onValueChange={setNotifications} size="small" />
|
|
@@ -26,25 +25,22 @@ const SwitchList = () => {
|
|
|
26
25
|
onPress={() => setNotifications(!notifications)}
|
|
27
26
|
/>
|
|
28
27
|
<ListItem
|
|
29
|
-
|
|
28
|
+
heading="Secure ID"
|
|
30
29
|
helperText="Use secure ID"
|
|
31
|
-
divider
|
|
32
30
|
leadingContent={<ListItemIcon as={LockMediumIcon} />}
|
|
33
31
|
trailingContent={<Switch value={secureId} onValueChange={setSecureId} size="small" />}
|
|
34
32
|
onPress={() => setSecureId(!secureId)}
|
|
35
33
|
/>
|
|
36
34
|
<ListItem
|
|
37
|
-
|
|
35
|
+
heading="Location"
|
|
38
36
|
helperText="Allow location"
|
|
39
|
-
divider
|
|
40
37
|
leadingContent={<ListItemIcon as={LocationMediumIcon} />}
|
|
41
38
|
trailingContent={<Switch value={location} onValueChange={setLocation} size="small" />}
|
|
42
39
|
onPress={() => setLocation(!location)}
|
|
43
40
|
/>
|
|
44
41
|
<ListItem
|
|
45
|
-
|
|
42
|
+
heading="Dark mode"
|
|
46
43
|
helperText="Enable dark mode"
|
|
47
|
-
divider
|
|
48
44
|
leadingContent={<ListItemIcon as={EyeMediumIcon} />}
|
|
49
45
|
trailingContent={<Switch value={darkMode} onValueChange={setDarkMode} size="small" />}
|
|
50
46
|
onPress={() => setDarkMode(!darkMode)}
|
package/docs/getting-started.mdx
CHANGED
|
@@ -8,6 +8,7 @@ import { BackToTopButton, NextPrevPage } from './components';
|
|
|
8
8
|
|
|
9
9
|
You can just start using the components from the `@utilitywarehouse/hearth-react-native` package.
|
|
10
10
|
Although there are a few components that require a `BottomSheetModalProvider` to be wrapped around your app.
|
|
11
|
+
You should also make sure you're app is wrapped in a `GestureHandlerRootView` from `react-native-gesture-handler`.
|
|
11
12
|
|
|
12
13
|
```tsx
|
|
13
14
|
import {
|
|
@@ -16,14 +17,17 @@ import {
|
|
|
16
17
|
BodyText,
|
|
17
18
|
BottomSheetModalProvider,
|
|
18
19
|
} from '@utilitywarehouse/hearth-react-native';
|
|
20
|
+
import { GestureHandlerRootView } from 'react-native-gesture-handler';
|
|
19
21
|
|
|
20
22
|
const App: React.FC = () => (
|
|
21
|
-
<
|
|
22
|
-
<
|
|
23
|
-
<
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
<GestureHandlerRootView>
|
|
24
|
+
<BottomSheetModalProvider>
|
|
25
|
+
<Box p="200">
|
|
26
|
+
<Alert colorScheme="positive" text="Welcome to Hearth React Native!" />
|
|
27
|
+
<BodyText>Start building your app with Hearth React Native components.</BodyText>
|
|
28
|
+
</Box>
|
|
29
|
+
</BottomSheetModalProvider>
|
|
30
|
+
</GestureHandlerRootView>
|
|
27
31
|
);
|
|
28
32
|
```
|
|
29
33
|
|
|
@@ -33,19 +37,31 @@ By default the light colour mode is enabled. If you want to enable dark mode, yo
|
|
|
33
37
|
use the `useColorMode` hook to toggle between light and dark modes.
|
|
34
38
|
|
|
35
39
|
```tsx
|
|
36
|
-
import {
|
|
40
|
+
import {
|
|
41
|
+
useColorMode,
|
|
42
|
+
Box,
|
|
43
|
+
Alert,
|
|
44
|
+
BodyText,
|
|
45
|
+
Button,
|
|
46
|
+
BottomSheetModalProvider,
|
|
47
|
+
} from '@utilitywarehouse/hearth-react-native';
|
|
48
|
+
import { GestureHandlerRootView } from 'react-native-gesture-handler';
|
|
37
49
|
|
|
38
50
|
const App: React.FC = () => {
|
|
39
51
|
const [colorMode, setColorMode] = useColorMode();
|
|
40
52
|
|
|
41
53
|
return (
|
|
42
|
-
<
|
|
43
|
-
<
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
54
|
+
<GestureHandlerRootView>
|
|
55
|
+
<BottomSheetModalProvider>
|
|
56
|
+
<Box p="200">
|
|
57
|
+
<Alert colorScheme="positive" text="Welcome to Hearth React Native!" />
|
|
58
|
+
<BodyText>Start building your app with Hearth React Native components.</BodyText>
|
|
59
|
+
<Button onPress={() => setColorMode(colorMode === 'light' ? 'dark' : 'light')}>
|
|
60
|
+
Toggle Color Mode
|
|
61
|
+
</Button>
|
|
62
|
+
</Box>
|
|
63
|
+
</BottomSheetModalProvider>
|
|
64
|
+
</GestureHandlerRootView>
|
|
49
65
|
);
|
|
50
66
|
};
|
|
51
67
|
```
|
package/docs/introduction.mdx
CHANGED
|
@@ -42,7 +42,7 @@ npm install @utilitywarehouse/hearth-react-native
|
|
|
42
42
|
To install the peer dependencies, you can run the following command:
|
|
43
43
|
|
|
44
44
|
```console
|
|
45
|
-
npm install react-native-unistyles react-native-edge-to-edge react-native-nitro-modules
|
|
45
|
+
npm install react-native-unistyles react-native-edge-to-edge react-native-nitro-modules @gorhom/bottom-sheet react-native-svg react-native-reanimated react-native-worklets react-native-gesture-handler @utilitywarehouse/hearth-react-native-icons
|
|
46
46
|
```
|
|
47
47
|
|
|
48
48
|
For more information on how to install and configure `react-native-svg`, `react-native-gesture-handler` and `react-native-reanimated`,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@utilitywarehouse/hearth-react-native",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Utility Warehouse React Native UI library",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -53,14 +53,14 @@
|
|
|
53
53
|
"typescript": "^5.7.3",
|
|
54
54
|
"vite": "^7.1.3",
|
|
55
55
|
"vitest": "^3.2.4",
|
|
56
|
-
"@utilitywarehouse/hearth-react-icons": "^0.5.0",
|
|
57
56
|
"@utilitywarehouse/hearth-fonts": "^0.0.4",
|
|
58
|
-
"@utilitywarehouse/hearth-react-
|
|
57
|
+
"@utilitywarehouse/hearth-react-icons": "^0.7.0",
|
|
58
|
+
"@utilitywarehouse/hearth-react-native-icons": "^0.7.0",
|
|
59
59
|
"@utilitywarehouse/hearth-tokens": "^0.1.3"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
62
62
|
"@gorhom/bottom-sheet": "^5.0.0",
|
|
63
|
-
"@utilitywarehouse/hearth-react-native-icons": "0.
|
|
63
|
+
"@utilitywarehouse/hearth-react-native-icons": "0.6.0",
|
|
64
64
|
"react": ">=17 || ^18.0.0 || ^19.0.0",
|
|
65
65
|
"react-native": ">=0.77",
|
|
66
66
|
"react-native-gesture-handler": "^2.22.0",
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import type { TextProps, TextStyle } from 'react-native';
|
|
2
2
|
import { StyleSheet } from 'react-native-unistyles';
|
|
3
|
-
import {
|
|
3
|
+
import { BodyText } from '../BodyText';
|
|
4
4
|
import { useAlertContext } from './Alert.context';
|
|
5
5
|
|
|
6
6
|
const AlertTitle = ({ children, style, ...props }: TextProps) => {
|
|
7
7
|
const { colorScheme } = useAlertContext();
|
|
8
8
|
styles.useVariants({ colorScheme });
|
|
9
9
|
return (
|
|
10
|
-
<
|
|
10
|
+
<BodyText size="md" weight="semibold" style={[styles.title as TextStyle, style]} {...props}>
|
|
11
11
|
{children}
|
|
12
|
-
</
|
|
12
|
+
</BodyText>
|
|
13
13
|
);
|
|
14
14
|
};
|
|
15
15
|
|
|
@@ -18,16 +18,16 @@ const styles = StyleSheet.create(theme => ({
|
|
|
18
18
|
variants: {
|
|
19
19
|
colorScheme: {
|
|
20
20
|
info: {
|
|
21
|
-
color: theme.color.feedback.info.foreground,
|
|
21
|
+
color: theme.color.feedback.info.foreground.default,
|
|
22
22
|
},
|
|
23
23
|
positive: {
|
|
24
|
-
color: theme.color.feedback.positive.foreground,
|
|
24
|
+
color: theme.color.feedback.positive.foreground.default,
|
|
25
25
|
},
|
|
26
26
|
danger: {
|
|
27
|
-
color: theme.color.feedback.danger.foreground,
|
|
27
|
+
color: theme.color.feedback.danger.foreground.default,
|
|
28
28
|
},
|
|
29
29
|
warning: {
|
|
30
|
-
color: theme.color.feedback.warning.foreground,
|
|
30
|
+
color: theme.color.feedback.warning.foreground.default,
|
|
31
31
|
},
|
|
32
32
|
},
|
|
33
33
|
},
|
|
@@ -14,6 +14,7 @@ const Badge = ({ children, ...props }: BadgeProps) => {
|
|
|
14
14
|
flatBase = false,
|
|
15
15
|
size = 'sm',
|
|
16
16
|
style,
|
|
17
|
+
text,
|
|
17
18
|
...rest
|
|
18
19
|
} = props;
|
|
19
20
|
|
|
@@ -22,7 +23,7 @@ const Badge = ({ children, ...props }: BadgeProps) => {
|
|
|
22
23
|
[colorScheme, flatBase, variant, size]
|
|
23
24
|
);
|
|
24
25
|
|
|
25
|
-
const childIsText = typeof children === 'string' || typeof children === 'number';
|
|
26
|
+
const childIsText = typeof children === 'string' || typeof children === 'number' || !!text;
|
|
26
27
|
|
|
27
28
|
styles.useVariants({ colorScheme, flatBase, variant, size });
|
|
28
29
|
|
|
@@ -30,7 +31,7 @@ const Badge = ({ children, ...props }: BadgeProps) => {
|
|
|
30
31
|
<BadgeContext.Provider value={value}>
|
|
31
32
|
<View {...rest} style={[styles.container, style]}>
|
|
32
33
|
{!!icon && <BadgeIcon as={icon} />}
|
|
33
|
-
{childIsText ? <BadgeText>{children}</BadgeText> : children}
|
|
34
|
+
{childIsText ? <BadgeText>{text ?? children}</BadgeText> : children}
|
|
34
35
|
</View>
|
|
35
36
|
</BadgeContext.Provider>
|
|
36
37
|
);
|
|
@@ -103,6 +103,7 @@ const styles = StyleSheet.create(theme => ({
|
|
|
103
103
|
ghost: {
|
|
104
104
|
backgroundColor: 'transparent',
|
|
105
105
|
borderWidth: 0,
|
|
106
|
+
textDecoration: 'underline',
|
|
106
107
|
},
|
|
107
108
|
},
|
|
108
109
|
size: {
|
|
@@ -348,6 +349,7 @@ const styles = StyleSheet.create(theme => ({
|
|
|
348
349
|
variant: 'ghost',
|
|
349
350
|
colorScheme: 'functional',
|
|
350
351
|
styles: {
|
|
352
|
+
textDecorationColor: theme.color.interactive.functional.foreground.subtle,
|
|
351
353
|
_web: {
|
|
352
354
|
_hover: {
|
|
353
355
|
backgroundColor: theme.color.interactive.functional.surface.subtle.hover,
|
|
@@ -395,6 +397,7 @@ const styles = StyleSheet.create(theme => ({
|
|
|
395
397
|
variant: 'ghost',
|
|
396
398
|
colorScheme: 'affirmative',
|
|
397
399
|
styles: {
|
|
400
|
+
textDecorationColor: theme.color.interactive.affirmative.foreground.subtle,
|
|
398
401
|
_web: {
|
|
399
402
|
_hover: {
|
|
400
403
|
backgroundColor: theme.color.interactive.affirmative.surface.subtle.hover,
|
|
@@ -418,6 +421,7 @@ const styles = StyleSheet.create(theme => ({
|
|
|
418
421
|
variant: 'ghost',
|
|
419
422
|
colorScheme: 'destructive',
|
|
420
423
|
styles: {
|
|
424
|
+
textDecorationColor: theme.color.interactive.destructive.foreground.subtle,
|
|
421
425
|
_web: {
|
|
422
426
|
_hover: {
|
|
423
427
|
backgroundColor: theme.color.interactive.destructive.surface.subtle.hover,
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { TextProps } from 'react-native';
|
|
2
2
|
import { StyleSheet } from 'react-native-unistyles';
|
|
3
|
-
import {
|
|
3
|
+
import { BodyText } from '../BodyText';
|
|
4
4
|
import { useButtonContext } from './Button.context';
|
|
5
5
|
|
|
6
6
|
const ButtonText = ({ children, ...props }: TextProps) => {
|
|
7
7
|
const { colorScheme, variant, inverted, disabled } = useButtonContext();
|
|
8
8
|
styles.useVariants({ colorScheme, variant, inverted, disabled });
|
|
9
9
|
return (
|
|
10
|
-
<
|
|
10
|
+
<BodyText size="md" weight="semibold" {...props} style={[styles.text, props.style]}>
|
|
11
11
|
{children}
|
|
12
|
-
</
|
|
12
|
+
</BodyText>
|
|
13
13
|
);
|
|
14
14
|
};
|
|
15
15
|
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createContext, useContext } from 'react';
|
|
2
|
+
import { CarouselContextValue } from './Carousel.props';
|
|
3
|
+
|
|
4
|
+
const CarouselContext = createContext<CarouselContextValue>({} as CarouselContextValue);
|
|
5
|
+
|
|
6
|
+
export const useCarouselContext = () => useContext(CarouselContext);
|
|
7
|
+
|
|
8
|
+
export default CarouselContext;
|