@utilitywarehouse/hearth-react-native 0.28.3 → 0.28.5

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.28.3 build /home/runner/work/hearth/hearth/packages/react-native
2
+ > @utilitywarehouse/hearth-react-native@0.28.5 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.28.3 lint /home/runner/work/hearth/hearth/packages/react-native
2
+ > @utilitywarehouse/hearth-react-native@0.28.5 lint /home/runner/work/hearth/hearth/packages/react-native
3
3
  > TIMING=1 eslint .
4
4
 
5
5
 
@@ -56,13 +56,13 @@
56
56
 
57
57
  Rule | Time (ms) | Relative
58
58
  :-----------------------------------------|----------:|--------:
59
- @typescript-eslint/no-unused-vars | 1554.353 | 59.2%
60
- react-hooks/exhaustive-deps | 144.027 | 5.5%
61
- no-global-assign | 113.457 | 4.3%
62
- react-hooks/rules-of-hooks | 91.927 | 3.5%
63
- @typescript-eslint/ban-ts-comment | 60.650 | 2.3%
64
- no-fallthrough | 48.638 | 1.9%
65
- no-unexpected-multiline | 47.691 | 1.8%
66
- no-misleading-character-class | 45.726 | 1.7%
67
- @typescript-eslint/no-unused-expressions | 29.696 | 1.1%
68
- @typescript-eslint/triple-slash-reference | 29.272 | 1.1%
59
+ @typescript-eslint/no-unused-vars | 1665.555 | 62.9%
60
+ react-hooks/exhaustive-deps | 114.741 | 4.3%
61
+ no-misleading-character-class | 86.661 | 3.3%
62
+ no-global-assign | 82.213 | 3.1%
63
+ react-hooks/rules-of-hooks | 71.322 | 2.7%
64
+ no-unexpected-multiline | 47.421 | 1.8%
65
+ @typescript-eslint/ban-ts-comment | 37.884 | 1.4%
66
+ @typescript-eslint/triple-slash-reference | 36.368 | 1.4%
67
+ no-loss-of-precision | 33.743 | 1.3%
68
+ no-regex-spaces | 23.584 | 0.9%
package/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # @utilitywarehouse/hearth-react-native
2
2
 
3
+ ## 0.28.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1045](https://github.com/utilitywarehouse/hearth/pull/1045) [`3778061`](https://github.com/utilitywarehouse/hearth/commit/37780613890221368edb74c0ce83b8bf3d03e5b3) Thanks [@jordmccord](https://github.com/jordmccord)! - 🐛 [FIX]: The `BannerIllustration` now stays centered in vertical banners and no longer inherits image border styling or horizontal stretching.
8
+
9
+ ## 0.28.4
10
+
11
+ ### Patch Changes
12
+
13
+ - [#1034](https://github.com/utilitywarehouse/hearth/pull/1034) [`76598eb`](https://github.com/utilitywarehouse/hearth/commit/76598eb0374c79f9e6c2c23c421f2b9602fbb113) Thanks [@jordmccord](https://github.com/jordmccord)! - 🐛 [FIX]: The `CheckboxTile` spacing now uses the tile gap token instead of the base checkbox gap token.
14
+
15
+ - [#1034](https://github.com/utilitywarehouse/hearth/pull/1034) [`76598eb`](https://github.com/utilitywarehouse/hearth/commit/76598eb0374c79f9e6c2c23c421f2b9602fbb113) Thanks [@jordmccord](https://github.com/jordmccord)! - 🐛 [FIX]: The `Combobox` trigger outline so it is only shown when the control is focused.
16
+
17
+ - [#1034](https://github.com/utilitywarehouse/hearth/pull/1034) [`76598eb`](https://github.com/utilitywarehouse/hearth/commit/76598eb0374c79f9e6c2c23c421f2b9602fbb113) Thanks [@jordmccord](https://github.com/jordmccord)! - 🐛 [FIX]: The `RadioTile` spacing now uses the tile gap token instead of the base radio gap token.
18
+
19
+ - [#1036](https://github.com/utilitywarehouse/hearth/pull/1036) [`b7636e6`](https://github.com/utilitywarehouse/hearth/commit/b7636e6185879264e8d929c3be44fd0d1a354c22) Thanks [@jordmccord](https://github.com/jordmccord)! - 🐛 [FIX]: The `CurrencyInput` font size.
20
+
21
+ - [#1039](https://github.com/utilitywarehouse/hearth/pull/1039) [`3a895bc`](https://github.com/utilitywarehouse/hearth/commit/3a895bcb8dcceb7d55a454ec63de9256d2d8322f) Thanks [@jordmccord](https://github.com/jordmccord)! - 💅 [ENHANCEMENT]: Align all `Radio` and `Checkbox` default and tile gap sizes.
22
+
23
+ - [#1035](https://github.com/utilitywarehouse/hearth/pull/1035) [`01633a7`](https://github.com/utilitywarehouse/hearth/commit/01633a73153563d9b2286f42b764ad771e48ff82) Thanks [@jordmccord](https://github.com/jordmccord)! - 🐛 [FIX]: The `Pill` component no longer applies extra vertical padding and fixes vertical alignment.
24
+
3
25
  ## 0.28.3
4
26
 
5
27
  ### Patch Changes
@@ -130,7 +130,9 @@ const styles = StyleSheet.create(theme => ({
130
130
  variants: {
131
131
  direction: {
132
132
  horizontal: {
133
- flex: 1,
133
+ _web: {
134
+ flex: 1,
135
+ },
134
136
  },
135
137
  vertical: {},
136
138
  },
@@ -12,14 +12,14 @@ const BannerIllustration = (props) => {
12
12
  }
13
13
  return (_jsx(View, { style: [styles.media, styles.imageWrapper], children: _jsx(Image, { ...props, style: [styles.image, props.style] }) }));
14
14
  };
15
- const styles = StyleSheet.create(theme => ({
15
+ const styles = StyleSheet.create({
16
16
  media: {
17
17
  flexShrink: 0,
18
18
  variants: {
19
19
  direction: {
20
20
  horizontal: {},
21
21
  vertical: {
22
- alignSelf: 'flex-start',
22
+ alignSelf: 'center',
23
23
  },
24
24
  },
25
25
  },
@@ -29,16 +29,11 @@ const styles = StyleSheet.create(theme => ({
29
29
  variants: {
30
30
  direction: {
31
31
  horizontal: {},
32
- vertical: {
33
- width: '100%',
34
- },
32
+ vertical: {},
35
33
  },
36
34
  },
37
35
  },
38
36
  image: {
39
- borderRadius: theme.borderRadius.md,
40
- borderColor: theme.color.border.strong,
41
- borderWidth: theme.borderWidth[1],
42
37
  variants: {
43
38
  direction: {
44
39
  horizontal: { width: 160, height: 95 },
@@ -49,5 +44,5 @@ const styles = StyleSheet.create(theme => ({
49
44
  },
50
45
  },
51
46
  },
52
- }));
47
+ });
53
48
  export default BannerIllustration;
@@ -17,7 +17,7 @@ const styles = StyleSheet.create(theme => ({
17
17
  flexDirection: 'row',
18
18
  justifyContent: 'flex-start',
19
19
  alignSelf: 'stretch',
20
- gap: theme.components.checkbox.gap,
20
+ gap: theme.components.checkbox.tile.gap,
21
21
  padding: theme.components.checkbox.tile.padding,
22
22
  borderWidth: theme.components.checkbox.tile.borderWidth,
23
23
  borderColor: theme.color.border.strong,
@@ -17,7 +17,7 @@ const CurrencyInput = ({ validationStatus = 'initial', disabled, focused, readon
17
17
  }
18
18
  };
19
19
  const displayValue = !disableGroupSeparator && typeof value === 'string' ? formatThousands(value) : value;
20
- return (_jsxs(Input, { validationStatus: validationStatus, disabled: disabled, readonly: readonly, focused: focused, required: required, style: styles.wrap, label: label, labelVariant: labelVariant, helperText: helperText, helperIcon: helperIcon, validText: validText, invalidText: invalidText, children: [_jsx(InputSlot, { children: _jsx(DetailText, { size: "4xl", style: styles.text, accessible: false, children: "\u00A3" }) }), _jsx(InputField, { ref: ref, inputMode: "decimal", inBottomSheet: inBottomSheet, accessibilityHint: 'Enter the amount in pounds and pence, for example "10.99"', ...rest, placeholder: getPlaceholder, keyboardType: "decimal-pad", style: styles.input, value: displayValue, onChangeText: handleChangeText })] }));
20
+ return (_jsxs(Input, { validationStatus: validationStatus, disabled: disabled, readonly: readonly, focused: focused, required: required, style: styles.wrap, label: label, labelVariant: labelVariant, helperText: helperText, helperIcon: helperIcon, validText: validText, invalidText: invalidText, children: [_jsx(InputSlot, { children: _jsx(DetailText, { size: "3xl", style: styles.text, accessible: false, children: "\u00A3" }) }), _jsx(InputField, { ref: ref, inputMode: "decimal", inBottomSheet: inBottomSheet, accessibilityHint: 'Enter the amount in pounds and pence, for example "10.99"', ...rest, placeholder: getPlaceholder, keyboardType: "decimal-pad", style: styles.input, value: displayValue, onChangeText: handleChangeText })] }));
21
21
  };
22
22
  CurrencyInput.displayName = 'CurrencyInput';
23
23
  const styles = StyleSheet.create(theme => ({
@@ -26,13 +26,13 @@ const styles = StyleSheet.create(theme => ({
26
26
  gap: theme.components.input.currency.gap,
27
27
  },
28
28
  text: {
29
- ...(Platform.OS === 'ios' && { lineHeight: 46 }),
29
+ ...(Platform.OS === 'ios' && { lineHeight: 40 }),
30
30
  _web: {
31
31
  marginTop: 1,
32
32
  },
33
33
  },
34
34
  input: {
35
- fontSize: theme.typography.mobile.detailText['4xl'].fontSize,
35
+ fontSize: theme.typography.mobile.detailText['3xl'].fontSize,
36
36
  fontFamily: theme.typography.mobile.detailText.fontFamily,
37
37
  fontWeight: `${theme.typography.mobile.detailText.fontWeight}`,
38
38
  paddingTop: 0,
@@ -26,7 +26,6 @@ const styles = StyleSheet.create(theme => ({
26
26
  minWidth: theme.components.pill.minWidth,
27
27
  gap: theme.components.pill.gap,
28
28
  paddingHorizontal: theme.components.pill.paddingHorizontal,
29
- paddingVertical: theme.components.pill.paddingVertical,
30
29
  borderRadius: theme.components.pill.borderRadius,
31
30
  borderWidth: theme.components.pill.borderWidth,
32
31
  borderColor: theme.color.interactive.neutral.border.subtle,
@@ -17,7 +17,7 @@ const styles = StyleSheet.create(theme => ({
17
17
  flexDirection: 'row',
18
18
  justifyContent: 'flex-start',
19
19
  alignSelf: 'stretch',
20
- gap: theme.components.radio.gap,
20
+ gap: theme.components.radio.tile.gap,
21
21
  padding: theme.components.radio.tile.padding,
22
22
  borderWidth: theme.components.radio.tile.borderWidth,
23
23
  borderColor: theme.color.border.strong,
@@ -10,7 +10,7 @@ declare const _default: {
10
10
  readonly color: "#fcfbf2";
11
11
  };
12
12
  };
13
- readonly gap: 12;
13
+ readonly gap: 8;
14
14
  readonly group: {
15
15
  readonly gap: 16;
16
16
  readonly stack: {
@@ -24,7 +24,7 @@ declare const _default: {
24
24
  readonly borderRadius: 8;
25
25
  readonly borderWidth: 1;
26
26
  readonly borderWidthSelected: 2;
27
- readonly gap: 12;
27
+ readonly gap: 8;
28
28
  readonly group: {
29
29
  readonly gap: 6;
30
30
  readonly heading: {
@@ -10,7 +10,7 @@ export default {
10
10
  color: '#fcfbf2',
11
11
  },
12
12
  },
13
- gap: 12,
13
+ gap: 8,
14
14
  group: {
15
15
  gap: 16,
16
16
  stack: {
@@ -24,7 +24,7 @@ export default {
24
24
  borderRadius: 8,
25
25
  borderWidth: 1,
26
26
  borderWidthSelected: 2,
27
- gap: 12,
27
+ gap: 8,
28
28
  group: {
29
29
  gap: 6,
30
30
  heading: {
@@ -7,7 +7,7 @@ declare const _default: {
7
7
  readonly checked: {
8
8
  readonly color: "#101010";
9
9
  };
10
- readonly gap: 12;
10
+ readonly gap: 8;
11
11
  readonly group: {
12
12
  readonly gap: 16;
13
13
  readonly stack: {
@@ -7,7 +7,7 @@ export default {
7
7
  checked: {
8
8
  color: '#101010',
9
9
  },
10
- gap: 12,
10
+ gap: 8,
11
11
  group: {
12
12
  gap: 16,
13
13
  stack: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@utilitywarehouse/hearth-react-native",
3
- "version": "0.28.3",
3
+ "version": "0.28.5",
4
4
  "description": "Utility Warehouse React Native UI library",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -96,11 +96,7 @@ type Story = StoryObj<typeof meta>;
96
96
 
97
97
  export const Playground: Story = {
98
98
  render: (args: any) => {
99
- return (
100
- <View style={{ width: 400 }}>
101
- <Banner {...args} icon={ElectricityMediumIcon} />
102
- </View>
103
- );
99
+ return <Banner {...args} icon={ElectricityMediumIcon} />;
104
100
  },
105
101
  };
106
102
 
@@ -138,7 +134,7 @@ export const WithIcon: Story = {
138
134
  export const WithIllustration: Story = {
139
135
  render: () => {
140
136
  return (
141
- <View style={{ width: 400 }}>
137
+ <View>
142
138
  <Flex spacing="lg" direction="column">
143
139
  <Banner
144
140
  illustration={
@@ -238,7 +238,9 @@ const styles = StyleSheet.create(theme => ({
238
238
  variants: {
239
239
  direction: {
240
240
  horizontal: {
241
- flex: 1,
241
+ _web: {
242
+ flex: 1,
243
+ },
242
244
  },
243
245
  vertical: {},
244
246
  },
@@ -21,14 +21,14 @@ const BannerIllustration = (props: ImageProps | ThemedImageProps) => {
21
21
  );
22
22
  };
23
23
 
24
- const styles = StyleSheet.create(theme => ({
24
+ const styles = StyleSheet.create({
25
25
  media: {
26
26
  flexShrink: 0,
27
27
  variants: {
28
28
  direction: {
29
29
  horizontal: {},
30
30
  vertical: {
31
- alignSelf: 'flex-start',
31
+ alignSelf: 'center',
32
32
  },
33
33
  },
34
34
  },
@@ -38,16 +38,11 @@ const styles = StyleSheet.create(theme => ({
38
38
  variants: {
39
39
  direction: {
40
40
  horizontal: {},
41
- vertical: {
42
- width: '100%',
43
- },
41
+ vertical: {},
44
42
  },
45
43
  },
46
44
  },
47
45
  image: {
48
- borderRadius: theme.borderRadius.md,
49
- borderColor: theme.color.border.strong,
50
- borderWidth: theme.borderWidth[1],
51
46
  variants: {
52
47
  direction: {
53
48
  horizontal: { width: 160, height: 95 },
@@ -58,6 +53,6 @@ const styles = StyleSheet.create(theme => ({
58
53
  },
59
54
  },
60
55
  },
61
- }));
56
+ });
62
57
 
63
58
  export default BannerIllustration;
@@ -18,7 +18,7 @@ const styles = StyleSheet.create(theme => ({
18
18
  flexDirection: 'row',
19
19
  justifyContent: 'flex-start',
20
20
  alignSelf: 'stretch',
21
- gap: theme.components.checkbox.gap,
21
+ gap: theme.components.checkbox.tile.gap,
22
22
  padding: theme.components.checkbox.tile.padding,
23
23
  borderWidth: theme.components.checkbox.tile.borderWidth,
24
24
  borderColor: theme.color.border.strong,
@@ -56,7 +56,7 @@ const CurrencyInput = ({
56
56
  invalidText={invalidText}
57
57
  >
58
58
  <InputSlot>
59
- <DetailText size="4xl" style={styles.text} accessible={false}>
59
+ <DetailText size="3xl" style={styles.text} accessible={false}>
60
60
  £
61
61
  </DetailText>
62
62
  </InputSlot>
@@ -83,13 +83,13 @@ const styles = StyleSheet.create(theme => ({
83
83
  gap: theme.components.input.currency.gap,
84
84
  },
85
85
  text: {
86
- ...(Platform.OS === 'ios' && { lineHeight: 46 }),
86
+ ...(Platform.OS === 'ios' && { lineHeight: 40 }),
87
87
  _web: {
88
88
  marginTop: 1,
89
89
  },
90
90
  },
91
91
  input: {
92
- fontSize: theme.typography.mobile.detailText['4xl'].fontSize,
92
+ fontSize: theme.typography.mobile.detailText['3xl'].fontSize,
93
93
  fontFamily: theme.typography.mobile.detailText.fontFamily,
94
94
  fontWeight: `${theme.typography.mobile.detailText.fontWeight}`,
95
95
  paddingTop: 0,
@@ -34,7 +34,9 @@ Icons are often used to enhance the usability and accessibility of digital produ
34
34
  You can either use the React Native components directy from our `@utilitywarehouse/hearth-react-native-icons` package or use the `Icon`
35
35
  component from our `@utilitywarehouse/hearth-react-native` package to render the icons with utility props such as `color`.
36
36
 
37
- The following example shows how to use the icons directly from the `@utilitywarehouse/hearth-react-native-icons` package.
37
+ We reccomend that you use the `Icon` component to ensure that the icons are styled correctly and consistently across your application.
38
+ The `Icon` component also provides additional functionality such as handling different color modes and sizes as well as automatically applying
39
+ light and dark mode colors from the theme.
38
40
 
39
41
  <UsageWrap>
40
42
  <Center>
@@ -60,16 +62,16 @@ const MyComponent = () => {
60
62
  const { color } = useTheme();
61
63
  return (
62
64
  <Flex spacing="lg" direction="row" alignItems="center">
63
- <ElectricityMediumIcon color={color.energyBlue['700']} />
64
- <MobileMediumIcon color={color.mobileRose['700']} />
65
- <BroadbandMediumIcon color={color.broadbandGreen['700']} />
66
- <InsuranceMediumIcon color={color.insuranceOrange['700']} />
65
+ <Icon as={ElectricityMediumIcon} color={color.energyBlue['700']} />
66
+ <Icon as={MobileMediumIcon} color={color.mobileRose['700']} />
67
+ <Icon as={BroadbandMediumIcon} color={color.broadbandGreen['700']} />
68
+ <Icon as={InsuranceMediumIcon} color={color.insuranceOrange['700']} />
67
69
  </Flex>
68
70
  );
69
71
  };
70
72
  ```
71
73
 
72
- Or you can use the `Icon` component to render the icons.
74
+ Or you can use the icons directly from the `@utilitywarehouse/hearth-react-native-icons` package. Make sure you handle the color prop correctly, including light and dark modes.
73
75
 
74
76
  ```jsx
75
77
  import { Flex, Icon, color } from '@utilitywarehouse/hearth-react-native';
@@ -81,12 +83,13 @@ import {
81
83
  } from '@utilitywarehouse/hearth-react-native-icons';
82
84
 
83
85
  const MyComponent = () => {
86
+ const { color } = useTheme();
84
87
  return (
85
88
  <Flex spacing="lg" direction="row" alignItems="center">
86
- <Icon as={ElectricityMediumIcon} color="energyBlue700" />
87
- <Icon as={MobileMediumIcon} color="mobileRose700" />
88
- <Icon as={BroadbandMediumIcon} color="broadbandGreen700" />
89
- <Icon as={InsuranceMediumIcon} color="insuranceOrange700" />
89
+ <ElectricityMediumIcon color={color.energyBlue['700']} />
90
+ <MobileMediumIcon color={color.mobileRose['700']} />
91
+ <BroadbandMediumIcon color={color.broadbandGreen['700']} />
92
+ <InsuranceMediumIcon color={color.insuranceOrange['700']} />
90
93
  </Flex>
91
94
  );
92
95
  };
@@ -52,7 +52,6 @@ const styles = StyleSheet.create(theme => ({
52
52
  minWidth: theme.components.pill.minWidth,
53
53
  gap: theme.components.pill.gap,
54
54
  paddingHorizontal: theme.components.pill.paddingHorizontal,
55
- paddingVertical: theme.components.pill.paddingVertical,
56
55
  borderRadius: theme.components.pill.borderRadius,
57
56
  borderWidth: theme.components.pill.borderWidth,
58
57
  borderColor: theme.color.interactive.neutral.border.subtle,
@@ -2,8 +2,8 @@ import { useMemo } from 'react';
2
2
  import { StyleSheet } from 'react-native-unistyles';
3
3
 
4
4
  import { Pressable, ViewStyle } from 'react-native';
5
- import type RadioProps from './Radio.props';
6
5
  import { RadioContext } from './Radio.context';
6
+ import type RadioProps from './Radio.props';
7
7
  import { useRadioGroupContext } from './RadioGroup.context';
8
8
 
9
9
  const RadioRoot = ({
@@ -18,7 +18,7 @@ const styles = StyleSheet.create(theme => ({
18
18
  flexDirection: 'row',
19
19
  justifyContent: 'flex-start',
20
20
  alignSelf: 'stretch',
21
- gap: theme.components.radio.gap,
21
+ gap: theme.components.radio.tile.gap,
22
22
  padding: theme.components.radio.tile.padding,
23
23
  borderWidth: theme.components.radio.tile.borderWidth,
24
24
  borderColor: theme.color.border.strong,
@@ -11,7 +11,7 @@ export default {
11
11
  color: '#fcfbf2',
12
12
  },
13
13
  },
14
- gap: 12,
14
+ gap: 8,
15
15
  group: {
16
16
  gap: 16,
17
17
  stack: {
@@ -25,7 +25,7 @@ export default {
25
25
  borderRadius: 8,
26
26
  borderWidth: 1,
27
27
  borderWidthSelected: 2,
28
- gap: 12,
28
+ gap: 8,
29
29
  group: {
30
30
  gap: 6,
31
31
  heading: {
@@ -8,7 +8,7 @@ export default {
8
8
  checked: {
9
9
  color: '#101010',
10
10
  },
11
- gap: 12,
11
+ gap: 8,
12
12
  group: {
13
13
  gap: 16,
14
14
  stack: {