@utilitywarehouse/hearth-react-native 0.30.1 → 0.30.3

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.
@@ -1,4 +1,4 @@
1
1
 
2
- > @utilitywarehouse/hearth-react-native@0.30.1 build /home/runner/work/hearth/hearth/packages/react-native
2
+ > @utilitywarehouse/hearth-react-native@0.30.3 build /home/runner/work/hearth/hearth/packages/react-native
3
3
  > tsc
4
4
 
@@ -1,5 +1,5 @@
1
1
 
2
- > @utilitywarehouse/hearth-react-native@0.30.1 lint /home/runner/work/hearth/hearth/packages/react-native
2
+ > @utilitywarehouse/hearth-react-native@0.30.3 lint /home/runner/work/hearth/hearth/packages/react-native
3
3
  > TIMING=1 eslint .
4
4
 
5
5
 
@@ -51,15 +51,15 @@
51
51
 
52
52
  ✖ 22 problems (0 errors, 22 warnings)
53
53
 
54
- Rule | Time (ms) | Relative
55
- :---------------------------------|----------:|--------:
56
- @typescript-eslint/no-unused-vars | 1663.735 | 62.2%
57
- react-hooks/exhaustive-deps | 114.322 | 4.3%
58
- no-global-assign | 106.232 | 4.0%
59
- react-hooks/rules-of-hooks | 88.095 | 3.3%
60
- no-misleading-character-class | 76.056 | 2.8%
61
- no-unexpected-multiline | 42.483 | 1.6%
62
- @typescript-eslint/ban-ts-comment | 34.247 | 1.3%
63
- no-loss-of-precision | 32.608 | 1.2%
64
- no-useless-escape | 30.291 | 1.1%
65
- no-control-regex | 26.605 | 1.0%
54
+ Rule | Time (ms) | Relative
55
+ :-------------------------------------------------|----------:|--------:
56
+ @typescript-eslint/no-unused-vars | 1593.466 | 60.1%
57
+ react-hooks/rules-of-hooks | 130.000 | 4.9%
58
+ react-hooks/exhaustive-deps | 126.596 | 4.8%
59
+ no-global-assign | 112.238 | 4.2%
60
+ no-unexpected-multiline | 53.984 | 2.0%
61
+ @typescript-eslint/ban-ts-comment | 41.634 | 1.6%
62
+ no-useless-escape | 37.152 | 1.4%
63
+ no-loss-of-precision | 36.053 | 1.4%
64
+ no-misleading-character-class | 33.418 | 1.3%
65
+ @typescript-eslint/no-unnecessary-type-constraint | 30.353 | 1.1%
package/CHANGELOG.md CHANGED
@@ -1,5 +1,35 @@
1
1
  # @utilitywarehouse/hearth-react-native
2
2
 
3
+ ## 0.30.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1094](https://github.com/utilitywarehouse/hearth/pull/1094) [`a9d8e66`](https://github.com/utilitywarehouse/hearth/commit/a9d8e660b7efa23c7a573af2658fc10ab6c043b9) Thanks [@jordmccord](https://github.com/jordmccord)! - 🐛 [FIX]: Make horizontal pressable `Banner` content flex correctly on native and web.
8
+
9
+ This fixes horizontal pressable `Banner` layouts where the content area did not expand consistently, which could misplace the chevron and action content.
10
+
11
+ **Components affected**:
12
+ - `Banner`
13
+
14
+ **Developer changes**:
15
+
16
+ No changes are required.
17
+
18
+ ## 0.30.2
19
+
20
+ ### Patch Changes
21
+
22
+ - [#1090](https://github.com/utilitywarehouse/hearth/pull/1090) [`1420244`](https://github.com/utilitywarehouse/hearth/commit/1420244fbc23c8a755f9249f8b39cb094a865cea) Thanks [@jordmccord](https://github.com/jordmccord)! - 🌟 [FEATURE]: Add `alignChevron` to `Banner` for horizontal pressable layouts.
23
+
24
+ `Banner` now supports an `alignChevron` prop to control the chevron alignment when `onPress` is used in the horizontal layout. Use `'start'`, `'center'`, or `'end'` to match the chevron position to the content layout.
25
+
26
+ **Components affected**:
27
+ - `Banner`
28
+
29
+ **Developer changes**:
30
+
31
+ No changes are required unless you want to override the default centred chevron alignment.
32
+
3
33
  ## 0.30.1
4
34
 
5
35
  ### Patch Changes
@@ -1,6 +1,6 @@
1
1
  import type BannerProps from './Banner.props';
2
2
  declare const Banner: {
3
- ({ icon, iconContainerVariant, iconContainerSize, iconContainerColor, illustration, image, heading, description, direction, link, button, onPress, onClose, variant, style, ...props }: BannerProps): import("react/jsx-runtime").JSX.Element;
3
+ ({ icon, iconContainerVariant, iconContainerSize, iconContainerColor, illustration, image, heading, description, direction, link, button, onPress, onClose, variant, alignChevron, style, ...props }: BannerProps): import("react/jsx-runtime").JSX.Element;
4
4
  displayName: string;
5
5
  };
6
6
  export default Banner;
@@ -9,9 +9,14 @@ import { Heading } from '../Heading';
9
9
  import { IconContainer } from '../IconContainer';
10
10
  import { UnstyledIconButton } from '../UnstyledIconButton';
11
11
  import BannerContext from './Banner.context';
12
- const Banner = ({ icon, iconContainerVariant = 'subtle', iconContainerSize = 'md', iconContainerColor = 'pig', illustration, image, heading, description, direction = 'horizontal', link, button, onPress, onClose, variant = 'subtle', style, ...props }) => {
12
+ const Banner = ({ icon, iconContainerVariant = 'subtle', iconContainerSize = 'md', iconContainerColor = 'pig', illustration, image, heading, description, direction = 'horizontal', link, button, onPress, onClose, variant = 'subtle', alignChevron = 'center', style, ...props }) => {
13
13
  const hasIllustration = Boolean(illustration);
14
- styles.useVariants({ direction, hasIllustration, isPressable: Boolean(onPress) });
14
+ styles.useVariants({
15
+ direction,
16
+ hasIllustration,
17
+ isPressable: Boolean(onPress),
18
+ alignChevron,
19
+ });
15
20
  const context = useMemo(() => ({
16
21
  direction,
17
22
  }), [direction]);
@@ -130,9 +135,7 @@ const styles = StyleSheet.create(theme => ({
130
135
  variants: {
131
136
  direction: {
132
137
  horizontal: {
133
- _web: {
134
- flex: 1,
135
- },
138
+ flex: 1,
136
139
  },
137
140
  vertical: {},
138
141
  },
@@ -187,6 +190,25 @@ const styles = StyleSheet.create(theme => ({
187
190
  },
188
191
  chevron: {
189
192
  alignSelf: 'center',
193
+ variants: {
194
+ direction: {
195
+ horizontal: {},
196
+ vertical: {
197
+ display: 'none',
198
+ },
199
+ },
200
+ alignChevron: {
201
+ center: {
202
+ alignSelf: 'center',
203
+ },
204
+ start: {
205
+ alignSelf: 'flex-start',
206
+ },
207
+ end: {
208
+ alignSelf: 'flex-end',
209
+ },
210
+ },
211
+ },
190
212
  },
191
213
  closeButton: {
192
214
  alignSelf: 'flex-start',
@@ -66,5 +66,10 @@ export interface BannerProps extends Omit<CardProps, 'noPadding' | 'variant' | '
66
66
  * @default 'subtle'
67
67
  */
68
68
  variant?: 'subtle' | 'emphasis';
69
+ /**
70
+ * Chevron alignment for horizontal layout
71
+ * @default 'center'
72
+ */
73
+ alignChevron?: 'center' | 'start' | 'end';
69
74
  }
70
75
  export default BannerProps;
@@ -9,6 +9,88 @@ import { BackToTopButton, NextPrevPage } from './components';
9
9
  The changelog for the Hearth React Native library. Here you can find all the changes, improvements, and bug fixes for each version.
10
10
 
11
11
 
12
+ ## 0.30.2
13
+
14
+ ### Patch Changes
15
+
16
+ - [#1090](https://github.com/utilitywarehouse/hearth/pull/1090) [`1420244`](https://github.com/utilitywarehouse/hearth/commit/1420244fbc23c8a755f9249f8b39cb094a865cea) Thanks [@jordmccord](https://github.com/jordmccord)! - 🌟 [FEATURE]: Add `alignChevron` to `Banner` for horizontal pressable layouts.
17
+
18
+ `Banner` now supports an `alignChevron` prop to control the chevron alignment when `onPress` is used in the horizontal layout. Use `'start'`, `'center'`, or `'end'` to match the chevron position to the content layout.
19
+
20
+ **Components affected**:
21
+ - `Banner`
22
+
23
+ **Developer changes**:
24
+
25
+ No changes are required unless you want to override the default centred chevron alignment.
26
+
27
+ ## 0.30.1
28
+
29
+ ### Patch Changes
30
+
31
+ - [#1081](https://github.com/utilitywarehouse/hearth/pull/1081) [`5db8538`](https://github.com/utilitywarehouse/hearth/commit/5db8538b69115a23289f0038f681fc8b87a310c4) Thanks [@jordmccord](https://github.com/jordmccord)! - 🐛 [FIX]: Correct `NavModal` safe area handling across sheet and full-screen presentations.
32
+
33
+ `NavModal` now applies safe area insets directly within the component layout, which fixes padding in full-screen presentations and keeps sheet-style presentations aligned with the modal footer behaviour.
34
+
35
+ **Developer changes**:
36
+
37
+ If you need to disable the inset padding, use the `useSafeAreaInsets` prop. The old `safeAreaViewProps` escape hatch is no longer available.
38
+
39
+ ## 0.30.0
40
+
41
+ ### Minor Changes
42
+
43
+ - [#1072](https://github.com/utilitywarehouse/hearth/pull/1072) [`55f0095`](https://github.com/utilitywarehouse/hearth/commit/55f009576ba55081de358bccc21691861ddd7c33) Thanks [@jordmccord](https://github.com/jordmccord)! - 🌟 [FEATURE]: Add `loadingDescription` support to `Modal` and `NavModal`
44
+
45
+ `Modal` and `NavModal` now accept a `loadingDescription` prop to render supporting text beneath the spinner while `loading` is true. This makes it easier to give users more context during loading states without building custom loading content.
46
+
47
+ **Components affected**:
48
+ - `Modal`
49
+ - `NavModal`
50
+
51
+ **Developer changes**:
52
+
53
+ No changes are required for existing usage. To show supporting text in a loading state, pass `loadingDescription` alongside `loading` and, if needed, `loadingHeading`.
54
+
55
+ ### Patch Changes
56
+
57
+ - [#1070](https://github.com/utilitywarehouse/hearth/pull/1070) [`93c042c`](https://github.com/utilitywarehouse/hearth/commit/93c042c7772ab298e2ea4888a9777e8176453098) Thanks [@jordmccord](https://github.com/jordmccord)! - 🐛 [FIX]: Standardise numeric value typography across list-based components.
58
+
59
+ Numeric values in `DescriptionListItem`, `ExpandableCard`, and `ListItem` now render with semibold `BodyText` instead of `DetailText`, aligning them with the updated content hierarchy used elsewhere in the library.
60
+
61
+ **Components affected**:
62
+ - `DescriptionListItem`
63
+ - `ExpandableCard`
64
+ - `ListItem`
65
+
66
+ **Developer changes**:
67
+
68
+ No changes are required.
69
+
70
+ - [#1073](https://github.com/utilitywarehouse/hearth/pull/1073) [`9759622`](https://github.com/utilitywarehouse/hearth/commit/975962229137dd196e5f72a04037a8f181907818) Thanks [@jordmccord](https://github.com/jordmccord)! - 🐛 [FIX]: Announce `Heading` as a header for assistive technologies.
71
+
72
+ `Heading` now sets `accessibilityRole="header"` automatically so VoiceOver and TalkBack can identify headings as part of the screen structure.
73
+
74
+ **Components affected**:
75
+ - `Heading`
76
+
77
+ **Developer changes**:
78
+
79
+ No changes are required.
80
+
81
+ - [#1074](https://github.com/utilitywarehouse/hearth/pull/1074) [`95fe19e`](https://github.com/utilitywarehouse/hearth/commit/95fe19e6328bf652ff3ac1b2c723e1389fc59936) Thanks [@jordmccord](https://github.com/jordmccord)! - 🐛 [FIX]: Improve accessibility roles for `List`, `ListItem`, and `ListAction`
82
+
83
+ `List` now defaults to `accessibilityRole="list"`, `ListAction` now defaults to `accessibilityRole="button"`, and `ListItem` respects an explicitly provided `accessibilityRole` instead of always forcing button semantics when `onPress` is set.
84
+
85
+ **Components affected**:
86
+ - `List`
87
+ - `ListItem`
88
+ - `ListAction`
89
+
90
+ **Developer changes**:
91
+
92
+ No changes are required unless you want a tappable `ListItem` to be announced as something other than a button. In that case, pass `accessibilityRole` explicitly.
93
+
12
94
  ## 0.29.2
13
95
 
14
96
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@utilitywarehouse/hearth-react-native",
3
- "version": "0.30.1",
3
+ "version": "0.30.3",
4
4
  "description": "Utility Warehouse React Native UI library",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -58,10 +58,10 @@
58
58
  "vite-plugin-svgr": "^4.5.0",
59
59
  "vitest": "^3.2.4",
60
60
  "@utilitywarehouse/hearth-fonts": "^0.0.4",
61
- "@utilitywarehouse/hearth-react-icons": "^0.8.0",
62
61
  "@utilitywarehouse/hearth-react-native-icons": "^0.8.0",
63
62
  "@utilitywarehouse/hearth-tokens": "^0.2.4",
64
- "@utilitywarehouse/hearth-svg-assets": "^0.5.0"
63
+ "@utilitywarehouse/hearth-svg-assets": "^0.6.0",
64
+ "@utilitywarehouse/hearth-react-icons": "^0.8.0"
65
65
  },
66
66
  "peerDependencies": {
67
67
  "@gorhom/bottom-sheet": ">=5.0.0",
@@ -81,6 +81,7 @@ const MyComponent = () => (
81
81
  | onClose | `() => void` | Shows close button with handler | `-` |
82
82
  | variant | `'subtle' \| 'emphasis'` | Card visual style variant | `'subtle'` |
83
83
  | colorScheme | `'pig' \| 'energy' \| 'broadband' \| 'mobile' \|` <br />`'insurance' \| 'cashback' \| 'highlight'` | Color scheme for buttons | `'pig'` |
84
+ | alignChevron | `'center' \| 'start' \| 'end'` | Alignment of chevron when `onPress` is used with horizontal layout | `'center'` |
84
85
 
85
86
  The component also accepts all standard Card props except `noPadding`, `spacing`, `gap`, `rowGap`, `columnGap`, `flexDirection`, `flexWrap`, `alignItems`, and `justifyContent`.
86
87
 
@@ -87,6 +87,11 @@ export interface BannerProps extends Omit<
87
87
  * @default 'subtle'
88
88
  */
89
89
  variant?: 'subtle' | 'emphasis';
90
+ /**
91
+ * Chevron alignment for horizontal layout
92
+ * @default 'center'
93
+ */
94
+ alignChevron?: 'center' | 'start' | 'end';
90
95
  }
91
96
 
92
97
  export default BannerProps;
@@ -279,6 +279,26 @@ export const Pressable: Story = {
279
279
  return (
280
280
  <View style={{ width: 400 }}>
281
281
  <Flex spacing="lg" direction="column">
282
+ <Banner
283
+ variant="emphasis"
284
+ colorScheme="neutralStrong"
285
+ testID="next-best-action-card"
286
+ onPress={() => console.log('Banner pressed')}
287
+ heading="Add your appointment outcome"
288
+ description="Save the outcome of Don Instantino (Traditional Thai Cuisine)'s appointment"
289
+ alignChevron="start"
290
+ button={
291
+ <Button
292
+ variant="outline"
293
+ colorScheme="functional"
294
+ size="sm"
295
+ onPress={() => console.log('View to-do list pressed')}
296
+ testID="view-to-do-list"
297
+ >
298
+ View to-do list
299
+ </Button>
300
+ }
301
+ />
282
302
  <Banner
283
303
  icon={ElectricityMediumIcon}
284
304
  iconContainerColor="energy"
@@ -301,6 +321,22 @@ export const Pressable: Story = {
301
321
  description="Manage your account preferences."
302
322
  onPress={() => console.log('Banner pressed')}
303
323
  />
324
+ <Banner
325
+ direction="vertical"
326
+ image={
327
+ <BannerImage
328
+ light={{
329
+ uri: 'https://images.unsplash.com/photo-1506126613408-eca07ce68773?w=200&q=80',
330
+ }}
331
+ dark={{
332
+ uri: 'https://images.unsplash.com/photo-1506126613408-eca07ce68773?w=200&q=80',
333
+ }}
334
+ />
335
+ }
336
+ heading="Account Settings"
337
+ description="Manage your account preferences."
338
+ onPress={() => console.log('Banner pressed')}
339
+ />
304
340
  </Flex>
305
341
  </View>
306
342
  );
@@ -25,11 +25,17 @@ const Banner = ({
25
25
  onPress,
26
26
  onClose,
27
27
  variant = 'subtle',
28
+ alignChevron = 'center',
28
29
  style,
29
30
  ...props
30
31
  }: BannerProps) => {
31
32
  const hasIllustration = Boolean(illustration);
32
- styles.useVariants({ direction, hasIllustration, isPressable: Boolean(onPress) });
33
+ styles.useVariants({
34
+ direction,
35
+ hasIllustration,
36
+ isPressable: Boolean(onPress),
37
+ alignChevron,
38
+ });
33
39
 
34
40
  const context = useMemo(
35
41
  () => ({
@@ -238,9 +244,7 @@ const styles = StyleSheet.create(theme => ({
238
244
  variants: {
239
245
  direction: {
240
246
  horizontal: {
241
- _web: {
242
- flex: 1,
243
- },
247
+ flex: 1,
244
248
  },
245
249
  vertical: {},
246
250
  },
@@ -295,6 +299,25 @@ const styles = StyleSheet.create(theme => ({
295
299
  },
296
300
  chevron: {
297
301
  alignSelf: 'center',
302
+ variants: {
303
+ direction: {
304
+ horizontal: {},
305
+ vertical: {
306
+ display: 'none',
307
+ },
308
+ },
309
+ alignChevron: {
310
+ center: {
311
+ alignSelf: 'center',
312
+ },
313
+ start: {
314
+ alignSelf: 'flex-start',
315
+ },
316
+ end: {
317
+ alignSelf: 'flex-end',
318
+ },
319
+ },
320
+ },
298
321
  },
299
322
  closeButton: {
300
323
  alignSelf: 'flex-start',