@utilitywarehouse/hearth-react-native 0.30.1 → 0.30.2

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.2 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.2 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 | 1495.988 | 61.0%
57
+ react-hooks/exhaustive-deps | 86.813 | 3.5%
58
+ no-global-assign | 85.050 | 3.5%
59
+ react-hooks/rules-of-hooks | 60.522 | 2.5%
60
+ @typescript-eslint/ban-ts-comment | 49.138 | 2.0%
61
+ no-unexpected-multiline | 46.592 | 1.9%
62
+ no-useless-escape | 39.187 | 1.6%
63
+ no-misleading-character-class | 35.552 | 1.5%
64
+ @typescript-eslint/no-unused-expressions | 33.343 | 1.4%
65
+ @typescript-eslint/no-unnecessary-type-constraint | 31.189 | 1.3%
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @utilitywarehouse/hearth-react-native
2
2
 
3
+ ## 0.30.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#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.
8
+
9
+ `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.
10
+
11
+ **Components affected**:
12
+ - `Banner`
13
+
14
+ **Developer changes**:
15
+
16
+ No changes are required unless you want to override the default centred chevron alignment.
17
+
3
18
  ## 0.30.1
4
19
 
5
20
  ### 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]);
@@ -187,6 +192,25 @@ const styles = StyleSheet.create(theme => ({
187
192
  },
188
193
  chevron: {
189
194
  alignSelf: 'center',
195
+ variants: {
196
+ direction: {
197
+ horizontal: {},
198
+ vertical: {
199
+ display: 'none',
200
+ },
201
+ },
202
+ alignChevron: {
203
+ center: {
204
+ alignSelf: 'center',
205
+ },
206
+ start: {
207
+ alignSelf: 'flex-start',
208
+ },
209
+ end: {
210
+ alignSelf: 'flex-end',
211
+ },
212
+ },
213
+ },
190
214
  },
191
215
  closeButton: {
192
216
  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,73 @@ 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.1
13
+
14
+ ### Patch Changes
15
+
16
+ - [#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.
17
+
18
+ `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.
19
+
20
+ **Developer changes**:
21
+
22
+ If you need to disable the inset padding, use the `useSafeAreaInsets` prop. The old `safeAreaViewProps` escape hatch is no longer available.
23
+
24
+ ## 0.30.0
25
+
26
+ ### Minor Changes
27
+
28
+ - [#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`
29
+
30
+ `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.
31
+
32
+ **Components affected**:
33
+ - `Modal`
34
+ - `NavModal`
35
+
36
+ **Developer changes**:
37
+
38
+ No changes are required for existing usage. To show supporting text in a loading state, pass `loadingDescription` alongside `loading` and, if needed, `loadingHeading`.
39
+
40
+ ### Patch Changes
41
+
42
+ - [#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.
43
+
44
+ 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.
45
+
46
+ **Components affected**:
47
+ - `DescriptionListItem`
48
+ - `ExpandableCard`
49
+ - `ListItem`
50
+
51
+ **Developer changes**:
52
+
53
+ No changes are required.
54
+
55
+ - [#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.
56
+
57
+ `Heading` now sets `accessibilityRole="header"` automatically so VoiceOver and TalkBack can identify headings as part of the screen structure.
58
+
59
+ **Components affected**:
60
+ - `Heading`
61
+
62
+ **Developer changes**:
63
+
64
+ No changes are required.
65
+
66
+ - [#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`
67
+
68
+ `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.
69
+
70
+ **Components affected**:
71
+ - `List`
72
+ - `ListItem`
73
+ - `ListAction`
74
+
75
+ **Developer changes**:
76
+
77
+ 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.
78
+
12
79
  ## 0.29.2
13
80
 
14
81
  ### 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.2",
4
4
  "description": "Utility Warehouse React Native UI library",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -60,8 +60,8 @@
60
60
  "@utilitywarehouse/hearth-fonts": "^0.0.4",
61
61
  "@utilitywarehouse/hearth-react-icons": "^0.8.0",
62
62
  "@utilitywarehouse/hearth-react-native-icons": "^0.8.0",
63
- "@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-tokens": "^0.2.4"
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;
@@ -301,6 +301,22 @@ export const Pressable: Story = {
301
301
  description="Manage your account preferences."
302
302
  onPress={() => console.log('Banner pressed')}
303
303
  />
304
+ <Banner
305
+ direction="vertical"
306
+ image={
307
+ <BannerImage
308
+ light={{
309
+ uri: 'https://images.unsplash.com/photo-1506126613408-eca07ce68773?w=200&q=80',
310
+ }}
311
+ dark={{
312
+ uri: 'https://images.unsplash.com/photo-1506126613408-eca07ce68773?w=200&q=80',
313
+ }}
314
+ />
315
+ }
316
+ heading="Account Settings"
317
+ description="Manage your account preferences."
318
+ onPress={() => console.log('Banner pressed')}
319
+ />
304
320
  </Flex>
305
321
  </View>
306
322
  );
@@ -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
  () => ({
@@ -295,6 +301,25 @@ const styles = StyleSheet.create(theme => ({
295
301
  },
296
302
  chevron: {
297
303
  alignSelf: 'center',
304
+ variants: {
305
+ direction: {
306
+ horizontal: {},
307
+ vertical: {
308
+ display: 'none',
309
+ },
310
+ },
311
+ alignChevron: {
312
+ center: {
313
+ alignSelf: 'center',
314
+ },
315
+ start: {
316
+ alignSelf: 'flex-start',
317
+ },
318
+ end: {
319
+ alignSelf: 'flex-end',
320
+ },
321
+ },
322
+ },
298
323
  },
299
324
  closeButton: {
300
325
  alignSelf: 'flex-start',