@utilitywarehouse/hearth-react-native 0.35.4 → 0.35.6

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.
@@ -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: isBrandBackground ? 'brand' : 'primary',
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
- primary: {
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
- primary: {
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;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,11 @@
1
+ import { StyleSheet } from 'react-native-unistyles';
2
+ import { breakpoints } from './breakpoints';
3
+ import { themes } from './themes';
4
+ StyleSheet.configure({
5
+ breakpoints,
6
+ themes,
7
+ settings: {
8
+ initialTheme: 'light',
9
+ adaptiveThemes: false,
10
+ },
11
+ });
@@ -1,14 +1,3 @@
1
- import { StyleSheet } from 'react-native-unistyles';
2
- import { breakpoints } from './breakpoints';
3
- import { themes } from './themes';
4
1
  export { createUnistylesElement, Display, getServerUnistyles, Hide, hydrateServerUnistyles, mq, NavigationBar, resetServerUnistyles, ScopedTheme, StatusBar, StyleSheet, UnistylesRuntime, useServerUnistyles, useUnistyles, withUnistyles, } from 'react-native-unistyles';
5
2
  export * from './breakpoints';
6
3
  export * from './themes';
7
- StyleSheet.configure({
8
- breakpoints,
9
- themes,
10
- settings: {
11
- initialTheme: 'light',
12
- adaptiveThemes: false,
13
- },
14
- });
package/build/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import './core/configure';
1
2
  export * from './core';
2
3
  export * from './hooks';
3
4
  export * from './components';
package/build/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  'use client';
2
+ import './core/configure';
2
3
  export * from './core';
3
4
  export * from './hooks';
4
5
  export * from './components';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@utilitywarehouse/hearth-react-native",
3
- "version": "0.35.4",
3
+ "version": "0.35.6",
4
4
  "description": "Utility Warehouse React Native UI library",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -12,7 +12,9 @@
12
12
  "types": "build/index.d.ts",
13
13
  "module": "build/index",
14
14
  "type": "module",
15
- "sideEffects": false,
15
+ "sideEffects": [
16
+ "build/core/configure.js"
17
+ ],
16
18
  "bin": {
17
19
  "hearth-react-native": "./scripts/init-ai.js"
18
20
  },
@@ -77,11 +79,11 @@
77
79
  "vite-plugin-svgr": "^4.5.0",
78
80
  "vitest": "^4.1.7",
79
81
  "@utilitywarehouse/hearth-storybook-utils": "0.0.0",
82
+ "@utilitywarehouse/hearth-react-icons": "^0.9.0",
80
83
  "@utilitywarehouse/hearth-fonts": "^0.1.1",
81
84
  "@utilitywarehouse/hearth-react-native-icons": "^0.9.0",
82
- "@utilitywarehouse/hearth-react-icons": "^0.9.0",
83
- "@utilitywarehouse/hearth-svg-assets": "^0.6.5",
84
- "@utilitywarehouse/hearth-tokens": "^0.4.4"
85
+ "@utilitywarehouse/hearth-tokens": "^0.4.4",
86
+ "@utilitywarehouse/hearth-svg-assets": "^0.6.5"
85
87
  },
86
88
  "peerDependencies": {
87
89
  "@gorhom/bottom-sheet": ">=5.0.0",
@@ -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'` | Switches between the default surface background and the brand background treatment. | `'default'` |
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
4
+ Current version: v0.35.6
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