@utilitywarehouse/hearth-react-native 0.35.5 → 0.35.7
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/build/components/Flex/Flex.props.d.ts +2 -2
- package/build/components/NavModal/NavModal.js +10 -3
- package/build/components/NavModal/NavModal.props.d.ts +1 -1
- package/build/types/utilityProps.d.ts +1 -1
- package/package.json +2 -2
- package/public/llms/components/nav-modal.md +14 -1
- package/public/llms/docs/introduction.md +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { FlexAlignType, ViewProps, ViewStyle } from 'react-native';
|
|
2
|
-
import { DisplayProps, FlexLayoutProps, GapProps, MarginProps, PaddingProps, SpacingValues } from '../../types';
|
|
3
|
-
interface FlexProps extends ViewProps, MarginProps, PaddingProps, FlexLayoutProps, GapProps, Omit<DisplayProps, 'direction'> {
|
|
2
|
+
import { DisplayProps, FlexLayoutProps, GapProps, MarginProps, PaddingProps, SizeProps, SpacingValues } from '../../types';
|
|
3
|
+
interface FlexProps extends ViewProps, MarginProps, PaddingProps, FlexLayoutProps, GapProps, Pick<SizeProps, 'width'>, Omit<DisplayProps, 'direction'> {
|
|
4
4
|
direction?: ViewStyle['flexDirection'];
|
|
5
5
|
align?: FlexAlignType;
|
|
6
6
|
justify?: ViewStyle['justifyContent'];
|
|
@@ -16,6 +16,7 @@ const NavModal = ({ ref, children, heading, description, showCloseButton = true,
|
|
|
16
16
|
const backgroundOpacity = useSharedValue(0);
|
|
17
17
|
const pretendContentTranslateY = useSharedValue(20);
|
|
18
18
|
const isBrandBackground = background === 'brand';
|
|
19
|
+
const backgroundVariant = background === 'default' ? 'neutral' : background;
|
|
19
20
|
const isFullScreenPresentation = presentation === 'fullScreenModal';
|
|
20
21
|
const usesSheetPresentation = !isFullScreenPresentation;
|
|
21
22
|
const triggerCloseAnimation = useCallback(() => {
|
|
@@ -67,7 +68,7 @@ const NavModal = ({ ref, children, heading, description, showCloseButton = true,
|
|
|
67
68
|
const hasDescription = description !== undefined && description !== null;
|
|
68
69
|
styles.useVariants({
|
|
69
70
|
loading,
|
|
70
|
-
background:
|
|
71
|
+
background: backgroundVariant,
|
|
71
72
|
presentation: isFullScreenPresentation ? 'fullScreen' : 'modal',
|
|
72
73
|
useSafeAreaInsets,
|
|
73
74
|
usesSheetPresentation,
|
|
@@ -104,9 +105,12 @@ const styles = StyleSheet.create((theme, rt) => ({
|
|
|
104
105
|
brand: {
|
|
105
106
|
backgroundColor: theme.color.background.brand,
|
|
106
107
|
},
|
|
107
|
-
|
|
108
|
+
neutral: {
|
|
108
109
|
backgroundColor: theme.color.background.secondary,
|
|
109
110
|
},
|
|
111
|
+
primary: {
|
|
112
|
+
backgroundColor: theme.color.background.primary,
|
|
113
|
+
},
|
|
110
114
|
},
|
|
111
115
|
usesSheetPresentation: {
|
|
112
116
|
true: {},
|
|
@@ -197,12 +201,15 @@ const styles = StyleSheet.create((theme, rt) => ({
|
|
|
197
201
|
flex: 1,
|
|
198
202
|
variants: {
|
|
199
203
|
background: {
|
|
200
|
-
|
|
204
|
+
neutral: {
|
|
201
205
|
backgroundColor: theme.color.surface.neutral.strong,
|
|
202
206
|
},
|
|
203
207
|
brand: {
|
|
204
208
|
backgroundColor: theme.color.background.brand,
|
|
205
209
|
},
|
|
210
|
+
primary: {
|
|
211
|
+
backgroundColor: theme.color.background.primary,
|
|
212
|
+
},
|
|
206
213
|
},
|
|
207
214
|
presentation: {
|
|
208
215
|
modal: {
|
|
@@ -6,7 +6,7 @@ export interface NavModalRef {
|
|
|
6
6
|
}
|
|
7
7
|
type NavModalBaseProps = ModalCommonBaseProps & {
|
|
8
8
|
ref?: Ref<NavModalRef>;
|
|
9
|
-
background?: 'default' | 'brand';
|
|
9
|
+
background?: 'default' | 'brand' | 'primary';
|
|
10
10
|
scrollable?: boolean;
|
|
11
11
|
presentation?: 'fullScreenModal' | 'modal' | 'transparentModal' | 'containedModal' | 'containedTransparentModal';
|
|
12
12
|
useSafeAreaInsets?: boolean;
|
|
@@ -282,7 +282,7 @@ export interface IconColorProps {
|
|
|
282
282
|
* Common text styling props shared across text components (BodyText, Heading, DetailText).
|
|
283
283
|
* Includes margin utility props, simplified semantic text color, and standard text style props.
|
|
284
284
|
*/
|
|
285
|
-
export interface CommonTextProps extends RNTextProps, MarginProps {
|
|
285
|
+
export interface CommonTextProps extends RNTextProps, MarginProps, Pick<FlexLayoutProps, 'flexShrink'> {
|
|
286
286
|
/** Whether to truncate text with an ellipsis. */
|
|
287
287
|
truncated?: boolean;
|
|
288
288
|
/** Whether to show strikethrough text. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@utilitywarehouse/hearth-react-native",
|
|
3
|
-
"version": "0.35.
|
|
3
|
+
"version": "0.35.7",
|
|
4
4
|
"description": "Utility Warehouse React Native UI library",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -78,10 +78,10 @@
|
|
|
78
78
|
"vite": "^7.1.3",
|
|
79
79
|
"vite-plugin-svgr": "^4.5.0",
|
|
80
80
|
"vitest": "^4.1.7",
|
|
81
|
+
"@utilitywarehouse/hearth-react-native-icons": "^0.9.0",
|
|
81
82
|
"@utilitywarehouse/hearth-react-icons": "^0.9.0",
|
|
82
83
|
"@utilitywarehouse/hearth-fonts": "^0.1.1",
|
|
83
84
|
"@utilitywarehouse/hearth-storybook-utils": "0.0.0",
|
|
84
|
-
"@utilitywarehouse/hearth-react-native-icons": "^0.9.0",
|
|
85
85
|
"@utilitywarehouse/hearth-svg-assets": "^0.6.5",
|
|
86
86
|
"@utilitywarehouse/hearth-tokens": "^0.4.4"
|
|
87
87
|
},
|
|
@@ -152,7 +152,7 @@ const styles = StyleSheet.create({
|
|
|
152
152
|
| `image` | `ReactNode` | Optional image or illustration shown above the text content. | - |
|
|
153
153
|
| `children` | `ReactNode` | Content rendered inside the modal body. | - |
|
|
154
154
|
| `stickyFooter` | `boolean` | Keeps action buttons pinned to the bottom instead of flowing with the content. | `true` |
|
|
155
|
-
| `background` | `'default' /\| 'brand'`
|
|
155
|
+
| `background` | `'default' /\| 'brand' /\| 'primary'` | Switches between the default surface background, the brand background, and the primary background treatment. | `'default'` |
|
|
156
156
|
| `scrollable` | `boolean` | Wraps the content area in a `ScrollView`. Set this to `false` for custom layouts that should not scroll. | `true` |
|
|
157
157
|
| `presentation` | `'modal' \| 'fullScreenModal' \| 'transparentModal' `<br />` \| 'containedModal' \| 'containedTransparentModal'` | Matches the React Navigation screen presentation. `fullScreenModal` uses the full-screen layout; the other values use the sheet-style layout. | `'modal'` |
|
|
158
158
|
| `useSafeAreaInsets` | `boolean` | Whether to apply safe area insets as padding within the component. This is enabled by default to fix full-screen presentation padding but can be disabled if you want to manage insets yourself. | `true` |
|
|
@@ -184,6 +184,19 @@ When `footer` is provided, the primary and secondary button props are not availa
|
|
|
184
184
|
</View>
|
|
185
185
|
```
|
|
186
186
|
|
|
187
|
+
### Primary Background
|
|
188
|
+
|
|
189
|
+
```tsx
|
|
190
|
+
// Example usage
|
|
191
|
+
<View style={Platform.OS === 'web' ? { width: 400, height: 720 } : { flex: 1 }}>
|
|
192
|
+
<NavModal {...args}>
|
|
193
|
+
<Box gap="200">
|
|
194
|
+
<BodyText>This is a navigation modal with the primary background.</BodyText>
|
|
195
|
+
</Box>
|
|
196
|
+
</NavModal>
|
|
197
|
+
</View>
|
|
198
|
+
```
|
|
199
|
+
|
|
187
200
|
### Full-Screen Presentation
|
|
188
201
|
|
|
189
202
|
```tsx
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Hearth React Native
|
|
2
2
|
|
|
3
3
|
React Native component library for building UIs at Utility Warehouse.<br/>
|
|
4
|
-
Current version: v0.35.
|
|
4
|
+
Current version: v0.35.7
|
|
5
5
|
|
|
6
6
|
Hearth React Native is a comprehensive design system library for React Native, providing reusable components, consistent styling, and tools to streamline UI development. It is built to enhance productivity and maintain design consistency across projects.
|
|
7
7
|
|