@hero-design/rn 7.1.3-alpha5 → 7.1.3-alpha8

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.
Files changed (165) hide show
  1. package/.eslintrc.json +0 -6
  2. package/.expo/packager-info.json +1 -1
  3. package/babel.config.js +0 -14
  4. package/es/index.js +2787 -8941
  5. package/jest-setup.ts +0 -1
  6. package/jest.config.js +2 -4
  7. package/lib/index.js +2822 -8956
  8. package/package.json +5 -7
  9. package/playground/components/BottomNavigation.tsx +14 -11
  10. package/playground/components/Button.tsx +67 -0
  11. package/playground/components/Card.tsx +141 -107
  12. package/playground/components/Tabs.tsx +44 -0
  13. package/playground/index.tsx +13 -7
  14. package/src/components/Badge/StyledBadge.tsx +19 -21
  15. package/src/components/Badge/__tests__/Badge.spec.tsx +9 -18
  16. package/src/components/Badge/__tests__/__snapshots__/Badge.spec.tsx.snap +76 -96
  17. package/src/components/Badge/index.tsx +1 -1
  18. package/src/components/BottomNavigation/StyledBottomNavigation.tsx +44 -42
  19. package/src/components/BottomNavigation/__tests__/__snapshots__/{BottomNavigation.spec.tsx.snap → index.spec.tsx.snap} +130 -96
  20. package/src/components/BottomNavigation/__tests__/{BottomNavigation.spec.tsx → index.spec.tsx} +4 -4
  21. package/src/components/BottomNavigation/index.tsx +28 -32
  22. package/src/components/Button/IconButton.tsx +62 -0
  23. package/src/components/Button/__tests__/__snapshots__/index.spec.tsx.snap +46 -0
  24. package/src/components/Button/__tests__/index.spec.tsx +23 -0
  25. package/src/components/Button/index.tsx +5 -0
  26. package/src/components/Card/StyledCard.tsx +6 -6
  27. package/src/components/Card/__tests__/StyledCard.spec.tsx +2 -7
  28. package/src/components/Card/__tests__/__snapshots__/StyledCard.spec.tsx.snap +8 -11
  29. package/src/components/Card/__tests__/__snapshots__/{Card.spec.tsx.snap → index.spec.tsx.snap} +2 -8
  30. package/src/components/Card/__tests__/index.spec.tsx +35 -0
  31. package/src/components/Divider/StyledDivider.tsx +18 -60
  32. package/src/components/Divider/__tests__/StyledDivider.spec.tsx +5 -10
  33. package/src/components/Divider/__tests__/__snapshots__/StyledDivider.spec.tsx.snap +106 -70
  34. package/src/components/Divider/index.tsx +1 -1
  35. package/src/components/FAB/ActionGroup/ActionItem.tsx +2 -4
  36. package/src/components/FAB/ActionGroup/StyledActionGroup.tsx +36 -37
  37. package/src/components/FAB/ActionGroup/StyledActionItem.tsx +26 -24
  38. package/src/components/FAB/ActionGroup/__tests__/__snapshots__/index.spec.tsx.snap +271 -245
  39. package/src/components/FAB/ActionGroup/__tests__/index.spec.tsx +29 -33
  40. package/src/components/FAB/ActionGroup/index.tsx +1 -5
  41. package/src/components/FAB/AnimatedFABIcon.tsx +1 -1
  42. package/src/components/FAB/FAB.tsx +5 -9
  43. package/src/components/FAB/StyledFAB.tsx +22 -0
  44. package/src/components/FAB/__tests__/AnimatedFABIcon.spec.tsx +3 -6
  45. package/src/components/FAB/__tests__/StyledFAB.spec.tsx +24 -0
  46. package/src/components/FAB/__tests__/__snapshots__/AnimatedFABIcon.spec.tsx.snap +14 -10
  47. package/src/components/FAB/__tests__/__snapshots__/StyledFAB.spec.tsx.snap +72 -0
  48. package/src/components/FAB/__tests__/__snapshots__/index.spec.tsx.snap +16 -17
  49. package/src/components/FAB/__tests__/index.spec.tsx +21 -26
  50. package/src/components/Icon/HeroIcon/index.tsx +5 -7
  51. package/src/components/Icon/__tests__/__snapshots__/{Icon.spec.tsx.snap → index.spec.tsx.snap} +21 -12
  52. package/src/components/Icon/__tests__/index.spec.tsx +25 -0
  53. package/src/components/Icon/index.tsx +1 -1
  54. package/src/components/Tabs/StyledTabs.tsx +70 -0
  55. package/src/components/Tabs/__tests__/__snapshots__/index.spec.tsx.snap +321 -0
  56. package/src/components/Tabs/__tests__/index.spec.tsx +79 -0
  57. package/src/components/Tabs/index.tsx +185 -0
  58. package/src/components/Typography/Text/StyledText.tsx +19 -64
  59. package/src/components/Typography/Text/__tests__/__snapshots__/StyledText.spec.tsx.snap +90 -63
  60. package/src/emotion.d.ts +6 -0
  61. package/src/index.ts +9 -3
  62. package/src/testHelpers/renderWithTheme.tsx +2 -1
  63. package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +70 -48
  64. package/src/theme/components/badge.ts +10 -9
  65. package/src/theme/components/bottomNavigation.ts +7 -3
  66. package/src/theme/components/card.ts +2 -2
  67. package/src/theme/components/divider.ts +6 -6
  68. package/src/theme/components/fab.ts +19 -17
  69. package/src/theme/components/tabs.ts +20 -0
  70. package/src/theme/components/typography.ts +4 -4
  71. package/src/theme/global/borders.ts +8 -2
  72. package/src/theme/global/colors.ts +3 -1
  73. package/src/theme/global/index.ts +31 -17
  74. package/src/theme/global/scale.ts +18 -0
  75. package/src/theme/global/space.ts +23 -13
  76. package/src/theme/global/typography.ts +71 -27
  77. package/src/theme/index.ts +29 -13
  78. package/src/types.ts +7 -0
  79. package/src/utils/__tests__/scale.spec.ts +3 -3
  80. package/testUtils/setup.ts +11 -0
  81. package/tsconfig.json +1 -5
  82. package/types/playground/components/BottomNavigation.d.ts +2 -2
  83. package/types/playground/components/Button.d.ts +2 -0
  84. package/types/playground/components/Tabs.d.ts +2 -0
  85. package/types/src/components/Badge/StyledBadge.d.ts +16 -5
  86. package/types/src/components/Badge/index.d.ts +1 -1
  87. package/types/src/components/BottomNavigation/StyledBottomNavigation.d.ts +44 -9
  88. package/types/src/components/{Typography/Text/__test__ → BottomNavigation/__tests__}/index.spec.d.ts +0 -0
  89. package/types/src/components/BottomNavigation/index.d.ts +19 -14
  90. package/types/src/components/Button/IconButton.d.ts +34 -0
  91. package/types/{theme → src/components/Button}/__tests__/index.spec.d.ts +0 -0
  92. package/types/src/components/Button/index.d.ts +4 -0
  93. package/types/src/components/Card/StyledCard.d.ts +7 -1
  94. package/types/{components/Card/__tests__/Card.spec.d.ts → src/components/Card/__tests__/index.spec.d.ts} +0 -0
  95. package/types/src/components/Divider/StyledDivider.d.ts +8 -2
  96. package/types/src/components/Divider/index.d.ts +1 -1
  97. package/types/src/components/FAB/ActionGroup/StyledActionGroup.d.ts +25 -7
  98. package/types/src/components/FAB/ActionGroup/StyledActionItem.d.ts +11 -2
  99. package/types/src/components/FAB/ActionGroup/index.d.ts +1 -1
  100. package/types/src/components/FAB/FAB.d.ts +4 -4
  101. package/types/src/components/FAB/StyledFAB.d.ts +14 -0
  102. package/types/{components/Card/__tests__/StyledCard.spec.d.ts → src/components/FAB/__tests__/StyledFAB.spec.d.ts} +0 -0
  103. package/types/src/components/Icon/HeroIcon/index.d.ts +8 -2
  104. package/types/{components/Divider/__tests__/StyledDivider.spec.d.ts → src/components/Icon/__tests__/index.spec.d.ts} +0 -0
  105. package/types/src/components/Icon/index.d.ts +1 -1
  106. package/types/src/components/Icon/utils.d.ts +1 -1
  107. package/types/src/components/Tabs/StyledTabs.d.ts +55 -0
  108. package/types/{components/ExampleComponent/__tests__/StyledView.spec.d.ts → src/components/Tabs/__tests__/index.spec.d.ts} +0 -0
  109. package/types/src/components/Tabs/index.d.ts +45 -0
  110. package/types/src/components/Typography/Text/StyledText.d.ts +8 -2
  111. package/types/src/index.d.ts +6 -3
  112. package/types/src/theme/components/badge.d.ts +8 -7
  113. package/types/src/theme/components/bottomNavigation.d.ts +8 -2
  114. package/types/src/theme/components/card.d.ts +2 -2
  115. package/types/src/theme/components/divider.d.ts +6 -6
  116. package/types/src/theme/components/fab.d.ts +19 -17
  117. package/types/src/theme/components/tabs.d.ts +15 -0
  118. package/types/src/theme/components/typography.d.ts +4 -4
  119. package/types/src/theme/global/borders.d.ts +4 -3
  120. package/types/src/theme/global/colors.d.ts +2 -2
  121. package/types/src/theme/global/index.d.ts +10 -45
  122. package/types/src/theme/global/scale.d.ts +8 -0
  123. package/types/src/theme/global/space.d.ts +8 -7
  124. package/types/src/theme/global/typography.d.ts +9 -16
  125. package/types/src/theme/index.d.ts +4 -2
  126. package/types/src/types.d.ts +5 -0
  127. package/lib/assets/fonts/be-vietnam-pro-light.ttf +0 -0
  128. package/lib/assets/fonts/be-vietnam-pro-regular.ttf +0 -0
  129. package/lib/assets/fonts/be-vietnam-pro-semibold.ttf +0 -0
  130. package/src/components/Card/__tests__/Card.spec.tsx +0 -36
  131. package/src/components/FAB/StyledFABContainer.tsx +0 -14
  132. package/src/components/FAB/StyledFABIcon.tsx +0 -9
  133. package/src/components/FAB/__tests__/StyledFABContainer.spec.tsx +0 -18
  134. package/src/components/FAB/__tests__/StyledFABIcon.spec.tsx +0 -16
  135. package/src/components/FAB/__tests__/__snapshots__/StyledFABContainer.spec.tsx.snap +0 -46
  136. package/src/components/FAB/__tests__/__snapshots__/StyledFABIcon.spec.tsx.snap +0 -21
  137. package/src/components/Icon/__tests__/Icon.spec.tsx +0 -36
  138. package/src/styled-components.ts +0 -14
  139. package/src/styled.d.ts +0 -7
  140. package/types/components/Card/StyledCard.d.ts +0 -3
  141. package/types/components/Card/index.d.ts +0 -5
  142. package/types/components/Divider/StyledDivider.d.ts +0 -7
  143. package/types/components/Divider/index.d.ts +0 -12
  144. package/types/components/ExampleComponent/StyledView.d.ts +0 -7
  145. package/types/components/ExampleComponent/index.d.ts +0 -16
  146. package/types/index.d.ts +0 -5
  147. package/types/src/components/BottomNavigation/__tests__/BottomNavigation.spec.d.ts +0 -1
  148. package/types/src/components/Card/__tests__/Card.spec.d.ts +0 -1
  149. package/types/src/components/FAB/StyledFABContainer.d.ts +0 -3
  150. package/types/src/components/FAB/StyledFABIcon.d.ts +0 -3
  151. package/types/src/components/FAB/__tests__/StyledFABContainer.spec.d.ts +0 -1
  152. package/types/src/components/FAB/__tests__/StyledFABIcon.spec.d.ts +0 -1
  153. package/types/src/components/Icon/__tests__/Icon.spec.d.ts +0 -1
  154. package/types/src/components/Typography/Text/__test__/StyledText.spec.d.ts +0 -1
  155. package/types/src/styled-components.d.ts +0 -6
  156. package/types/styled-components.d.ts +0 -6
  157. package/types/theme/components/card.d.ts +0 -10
  158. package/types/theme/components/divider.d.ts +0 -17
  159. package/types/theme/components/exampleComponent.d.ts +0 -14
  160. package/types/theme/global/borders.d.ts +0 -4
  161. package/types/theme/global/colors.d.ts +0 -26
  162. package/types/theme/global/index.d.ts +0 -63
  163. package/types/theme/global/space.d.ts +0 -12
  164. package/types/theme/global/typography.d.ts +0 -21
  165. package/types/theme/index.d.ts +0 -13
@@ -1,15 +1,10 @@
1
1
  import React from 'react';
2
- import { render } from '@testing-library/react-native';
3
- import { ThemeProvider, theme } from '../../../index';
2
+ import renderWithTheme from '../../../testHelpers/renderWithTheme';
4
3
  import { StyledCard } from '../StyledCard';
5
4
 
6
5
  describe('StyledCard', () => {
7
6
  it('renders correct style', () => {
8
- const { toJSON } = render(
9
- <ThemeProvider theme={theme}>
10
- <StyledCard />
11
- </ThemeProvider>
12
- );
7
+ const { toJSON } = renderWithTheme(<StyledCard />);
13
8
  expect(toJSON()).toMatchSnapshot();
14
9
  });
15
10
  });
@@ -3,17 +3,14 @@
3
3
  exports[`StyledCard renders correct style 1`] = `
4
4
  <View
5
5
  style={
6
- Object {
7
- "borderBottomLeftRadius": 12,
8
- "borderBottomRightRadius": 12,
9
- "borderTopLeftRadius": 12,
10
- "borderTopRightRadius": 12,
11
- "overflow": "hidden",
12
- "paddingBottom": 8,
13
- "paddingLeft": 8,
14
- "paddingRight": 8,
15
- "paddingTop": 8,
16
- }
6
+ Array [
7
+ Object {
8
+ "borderRadius": 12,
9
+ "overflow": "hidden",
10
+ "padding": 8,
11
+ },
12
+ undefined,
13
+ ]
17
14
  }
18
15
  />
19
16
  `;
@@ -16,15 +16,9 @@ exports[`Card renders correct 1`] = `
16
16
  style={
17
17
  Array [
18
18
  Object {
19
- "borderBottomLeftRadius": 12,
20
- "borderBottomRightRadius": 12,
21
- "borderTopLeftRadius": 12,
22
- "borderTopRightRadius": 12,
19
+ "borderRadius": 12,
23
20
  "overflow": "hidden",
24
- "paddingBottom": 8,
25
- "paddingLeft": 8,
26
- "paddingRight": 8,
27
- "paddingTop": 8,
21
+ "padding": 8,
28
22
  },
29
23
  Object {
30
24
  "backgroundColor": "#292a2b",
@@ -0,0 +1,35 @@
1
+ import React from 'react';
2
+ import { RenderAPI } from '@testing-library/react-native';
3
+ import { View } from 'react-native';
4
+ import renderWithTheme from '../../../testHelpers/renderWithTheme';
5
+ import { theme } from '../../../index';
6
+ import Card from '..';
7
+
8
+ describe('Card', () => {
9
+ let wrapper: RenderAPI;
10
+
11
+ beforeEach(() => {
12
+ wrapper = renderWithTheme(
13
+ <Card
14
+ style={{ backgroundColor: theme.colors.backgroundDark }}
15
+ testID="card"
16
+ nativeID="card-native-id"
17
+ hitSlop={{ top: 1, left: 1, bottom: 1, right: 1 }}
18
+ pointerEvents="box-only"
19
+ removeClippedSubviews
20
+ >
21
+ <View testID="child-view" />
22
+ </Card>
23
+ );
24
+ });
25
+
26
+ it('renders correct', () => {
27
+ expect(wrapper.queryAllByTestId('card')).toHaveLength(1);
28
+
29
+ expect(wrapper.toJSON()).toMatchSnapshot();
30
+ });
31
+
32
+ it('has child', () => {
33
+ expect(wrapper.queryAllByTestId('child-view')).toHaveLength(1);
34
+ });
35
+ });
@@ -1,70 +1,28 @@
1
1
  import { View } from 'react-native';
2
- import styled, { css } from 'styled-components-native';
2
+ import styled from '@emotion/native';
3
3
 
4
4
  type MarginSize = 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge';
5
5
 
6
6
  const StyledDivider = styled(View)<{
7
7
  themeMarginHorizontal?: MarginSize;
8
8
  themeMarginVertical?: MarginSize;
9
- }>`
10
- border-bottom-width: ${({ theme }) =>
11
- theme.__hd__.divider.borderWidths.default};
12
- border-bottom-color: ${({ theme }) => theme.__hd__.divider.colors.default};
13
- max-width: 100%;
9
+ }>(({ themeMarginHorizontal, themeMarginVertical, theme }) => {
10
+ const horizontalMargin =
11
+ themeMarginHorizontal !== undefined
12
+ ? { marginHorizontal: theme.__hd__.divider.space[themeMarginHorizontal] }
13
+ : {};
14
+ const verticalMargin =
15
+ themeMarginVertical !== undefined
16
+ ? { marginVertical: theme.__hd__.divider.space[themeMarginVertical] }
17
+ : {};
14
18
 
15
- ${({ themeMarginHorizontal, theme }) => {
16
- switch (themeMarginHorizontal) {
17
- case undefined:
18
- return css``;
19
- case 'xsmall':
20
- return css`
21
- margin-horizontal: ${theme.__hd__.divider.space.xsmall};
22
- `;
23
- case 'small':
24
- return css`
25
- margin-horizontal: ${theme.__hd__.divider.space.small};
26
- `;
27
- case 'medium':
28
- return css`
29
- margin-horizontal: ${theme.__hd__.divider.space.medium};
30
- `;
31
- case 'large':
32
- return css`
33
- margin-horizontal: ${theme.__hd__.divider.space.large};
34
- `;
35
- case 'xlarge':
36
- return css`
37
- margin-horizontal: ${theme.__hd__.divider.space.xlarge};
38
- `;
39
- }
40
- }}
41
-
42
- ${({ themeMarginVertical, theme }) => {
43
- switch (themeMarginVertical) {
44
- case undefined:
45
- return css``;
46
- case 'xsmall':
47
- return css`
48
- margin-vertical: ${theme.__hd__.divider.space.xsmall};
49
- `;
50
- case 'small':
51
- return css`
52
- margin-vertical: ${theme.__hd__.divider.space.small};
53
- `;
54
- case 'medium':
55
- return css`
56
- margin-vertical: ${theme.__hd__.divider.space.medium};
57
- `;
58
- case 'large':
59
- return css`
60
- margin-vertical: ${theme.__hd__.divider.space.large};
61
- `;
62
- case 'xlarge':
63
- return css`
64
- margin-vertical: ${theme.__hd__.divider.space.xlarge};
65
- `;
66
- }
67
- }}
68
- `;
19
+ return {
20
+ maxWidth: '100%',
21
+ borderBottomColor: theme.__hd__.divider.colors.default,
22
+ borderBottomWidth: theme.__hd__.divider.borderWidths.default,
23
+ ...horizontalMargin,
24
+ ...verticalMargin,
25
+ };
26
+ });
69
27
 
70
28
  export { StyledDivider };
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
- import { render } from '@testing-library/react-native';
3
- import { ThemeProvider, theme } from '../../../index';
2
+ import renderWithTheme from '../../../testHelpers/renderWithTheme';
4
3
  import Divider from '..';
5
4
 
6
5
  describe('Divider', () => {
@@ -13,10 +12,8 @@ describe('Divider', () => {
13
12
  ${'large'}
14
13
  ${'xlarge'}
15
14
  `('has $marginHorizontal marginHorizontal style', ({ marginHorizontal }) => {
16
- const { toJSON } = render(
17
- <ThemeProvider theme={theme}>
18
- <Divider marginHorizontal={marginHorizontal} />
19
- </ThemeProvider>
15
+ const { toJSON } = renderWithTheme(
16
+ <Divider marginHorizontal={marginHorizontal} />
20
17
  );
21
18
 
22
19
  expect(toJSON()).toMatchSnapshot();
@@ -31,10 +28,8 @@ describe('Divider', () => {
31
28
  ${'large'}
32
29
  ${'xlarge'}
33
30
  `('has $marginVertical marginVertical style', ({ marginVertical }) => {
34
- const { toJSON } = render(
35
- <ThemeProvider theme={theme}>
36
- <Divider marginVertical={marginVertical} />
37
- </ThemeProvider>
31
+ const { toJSON } = renderWithTheme(
32
+ <Divider marginVertical={marginVertical} />
38
33
  );
39
34
 
40
35
  expect(toJSON()).toMatchSnapshot();
@@ -3,12 +3,15 @@
3
3
  exports[`Divider has large marginHorizontal style 1`] = `
4
4
  <View
5
5
  style={
6
- Object {
7
- "borderBottomColor": "#dadbde",
8
- "borderBottomWidth": 1,
9
- "marginHorizontal": 24,
10
- "maxWidth": "100%",
11
- }
6
+ Array [
7
+ Object {
8
+ "borderBottomColor": "#dadbde",
9
+ "borderBottomWidth": 1,
10
+ "marginHorizontal": 24,
11
+ "maxWidth": "100%",
12
+ },
13
+ undefined,
14
+ ]
12
15
  }
13
16
  themeMarginHorizontal="large"
14
17
  />
@@ -17,12 +20,15 @@ exports[`Divider has large marginHorizontal style 1`] = `
17
20
  exports[`Divider has large marginVertical style 1`] = `
18
21
  <View
19
22
  style={
20
- Object {
21
- "borderBottomColor": "#dadbde",
22
- "borderBottomWidth": 1,
23
- "marginVertical": 24,
24
- "maxWidth": "100%",
25
- }
23
+ Array [
24
+ Object {
25
+ "borderBottomColor": "#dadbde",
26
+ "borderBottomWidth": 1,
27
+ "marginVertical": 24,
28
+ "maxWidth": "100%",
29
+ },
30
+ undefined,
31
+ ]
26
32
  }
27
33
  themeMarginVertical="large"
28
34
  />
@@ -31,12 +37,15 @@ exports[`Divider has large marginVertical style 1`] = `
31
37
  exports[`Divider has medium marginHorizontal style 1`] = `
32
38
  <View
33
39
  style={
34
- Object {
35
- "borderBottomColor": "#dadbde",
36
- "borderBottomWidth": 1,
37
- "marginHorizontal": 16,
38
- "maxWidth": "100%",
39
- }
40
+ Array [
41
+ Object {
42
+ "borderBottomColor": "#dadbde",
43
+ "borderBottomWidth": 1,
44
+ "marginHorizontal": 16,
45
+ "maxWidth": "100%",
46
+ },
47
+ undefined,
48
+ ]
40
49
  }
41
50
  themeMarginHorizontal="medium"
42
51
  />
@@ -45,12 +54,15 @@ exports[`Divider has medium marginHorizontal style 1`] = `
45
54
  exports[`Divider has medium marginVertical style 1`] = `
46
55
  <View
47
56
  style={
48
- Object {
49
- "borderBottomColor": "#dadbde",
50
- "borderBottomWidth": 1,
51
- "marginVertical": 16,
52
- "maxWidth": "100%",
53
- }
57
+ Array [
58
+ Object {
59
+ "borderBottomColor": "#dadbde",
60
+ "borderBottomWidth": 1,
61
+ "marginVertical": 16,
62
+ "maxWidth": "100%",
63
+ },
64
+ undefined,
65
+ ]
54
66
  }
55
67
  themeMarginVertical="medium"
56
68
  />
@@ -59,12 +71,15 @@ exports[`Divider has medium marginVertical style 1`] = `
59
71
  exports[`Divider has small marginHorizontal style 1`] = `
60
72
  <View
61
73
  style={
62
- Object {
63
- "borderBottomColor": "#dadbde",
64
- "borderBottomWidth": 1,
65
- "marginHorizontal": 8,
66
- "maxWidth": "100%",
67
- }
74
+ Array [
75
+ Object {
76
+ "borderBottomColor": "#dadbde",
77
+ "borderBottomWidth": 1,
78
+ "marginHorizontal": 8,
79
+ "maxWidth": "100%",
80
+ },
81
+ undefined,
82
+ ]
68
83
  }
69
84
  themeMarginHorizontal="small"
70
85
  />
@@ -73,12 +88,15 @@ exports[`Divider has small marginHorizontal style 1`] = `
73
88
  exports[`Divider has small marginVertical style 1`] = `
74
89
  <View
75
90
  style={
76
- Object {
77
- "borderBottomColor": "#dadbde",
78
- "borderBottomWidth": 1,
79
- "marginVertical": 8,
80
- "maxWidth": "100%",
81
- }
91
+ Array [
92
+ Object {
93
+ "borderBottomColor": "#dadbde",
94
+ "borderBottomWidth": 1,
95
+ "marginVertical": 8,
96
+ "maxWidth": "100%",
97
+ },
98
+ undefined,
99
+ ]
82
100
  }
83
101
  themeMarginVertical="small"
84
102
  />
@@ -87,11 +105,14 @@ exports[`Divider has small marginVertical style 1`] = `
87
105
  exports[`Divider has undefined marginHorizontal style 1`] = `
88
106
  <View
89
107
  style={
90
- Object {
91
- "borderBottomColor": "#dadbde",
92
- "borderBottomWidth": 1,
93
- "maxWidth": "100%",
94
- }
108
+ Array [
109
+ Object {
110
+ "borderBottomColor": "#dadbde",
111
+ "borderBottomWidth": 1,
112
+ "maxWidth": "100%",
113
+ },
114
+ undefined,
115
+ ]
95
116
  }
96
117
  />
97
118
  `;
@@ -99,11 +120,14 @@ exports[`Divider has undefined marginHorizontal style 1`] = `
99
120
  exports[`Divider has undefined marginVertical style 1`] = `
100
121
  <View
101
122
  style={
102
- Object {
103
- "borderBottomColor": "#dadbde",
104
- "borderBottomWidth": 1,
105
- "maxWidth": "100%",
106
- }
123
+ Array [
124
+ Object {
125
+ "borderBottomColor": "#dadbde",
126
+ "borderBottomWidth": 1,
127
+ "maxWidth": "100%",
128
+ },
129
+ undefined,
130
+ ]
107
131
  }
108
132
  />
109
133
  `;
@@ -111,12 +135,15 @@ exports[`Divider has undefined marginVertical style 1`] = `
111
135
  exports[`Divider has xlarge marginHorizontal style 1`] = `
112
136
  <View
113
137
  style={
114
- Object {
115
- "borderBottomColor": "#dadbde",
116
- "borderBottomWidth": 1,
117
- "marginHorizontal": 32,
118
- "maxWidth": "100%",
119
- }
138
+ Array [
139
+ Object {
140
+ "borderBottomColor": "#dadbde",
141
+ "borderBottomWidth": 1,
142
+ "marginHorizontal": 32,
143
+ "maxWidth": "100%",
144
+ },
145
+ undefined,
146
+ ]
120
147
  }
121
148
  themeMarginHorizontal="xlarge"
122
149
  />
@@ -125,12 +152,15 @@ exports[`Divider has xlarge marginHorizontal style 1`] = `
125
152
  exports[`Divider has xlarge marginVertical style 1`] = `
126
153
  <View
127
154
  style={
128
- Object {
129
- "borderBottomColor": "#dadbde",
130
- "borderBottomWidth": 1,
131
- "marginVertical": 32,
132
- "maxWidth": "100%",
133
- }
155
+ Array [
156
+ Object {
157
+ "borderBottomColor": "#dadbde",
158
+ "borderBottomWidth": 1,
159
+ "marginVertical": 32,
160
+ "maxWidth": "100%",
161
+ },
162
+ undefined,
163
+ ]
134
164
  }
135
165
  themeMarginVertical="xlarge"
136
166
  />
@@ -139,12 +169,15 @@ exports[`Divider has xlarge marginVertical style 1`] = `
139
169
  exports[`Divider has xsmall marginHorizontal style 1`] = `
140
170
  <View
141
171
  style={
142
- Object {
143
- "borderBottomColor": "#dadbde",
144
- "borderBottomWidth": 1,
145
- "marginHorizontal": 4,
146
- "maxWidth": "100%",
147
- }
172
+ Array [
173
+ Object {
174
+ "borderBottomColor": "#dadbde",
175
+ "borderBottomWidth": 1,
176
+ "marginHorizontal": 4,
177
+ "maxWidth": "100%",
178
+ },
179
+ undefined,
180
+ ]
148
181
  }
149
182
  themeMarginHorizontal="xsmall"
150
183
  />
@@ -153,12 +186,15 @@ exports[`Divider has xsmall marginHorizontal style 1`] = `
153
186
  exports[`Divider has xsmall marginVertical style 1`] = `
154
187
  <View
155
188
  style={
156
- Object {
157
- "borderBottomColor": "#dadbde",
158
- "borderBottomWidth": 1,
159
- "marginVertical": 4,
160
- "maxWidth": "100%",
161
- }
189
+ Array [
190
+ Object {
191
+ "borderBottomColor": "#dadbde",
192
+ "borderBottomWidth": 1,
193
+ "marginVertical": 4,
194
+ "maxWidth": "100%",
195
+ },
196
+ undefined,
197
+ ]
162
198
  }
163
199
  themeMarginVertical="xsmall"
164
200
  />
@@ -12,7 +12,7 @@ interface DividerProps extends ViewProps {
12
12
  */
13
13
  marginVertical?: 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge';
14
14
  /**
15
- * Addditional style.
15
+ * Additional style.
16
16
  */
17
17
  style?: StyleProp<ViewStyle>;
18
18
  /**
@@ -18,10 +18,8 @@ const ActionItem = ({
18
18
  testID,
19
19
  }: ActionItemProps) => (
20
20
  <StyledActionItem style={style} onPress={onPress} testID={testID}>
21
- <>
22
- <Icon icon={icon} />
23
- <StyledActionItemText>{title}</StyledActionItemText>
24
- </>
21
+ <Icon icon={icon} />
22
+ <StyledActionItemText>{title}</StyledActionItemText>
25
23
  </StyledActionItem>
26
24
  );
27
25
 
@@ -1,54 +1,53 @@
1
1
  import { ComponentProps } from 'react';
2
2
  import { Animated, View, ViewProps } from 'react-native';
3
- import styled from 'styled-components-native';
3
+ import styled from '@emotion/native';
4
4
  import FAB from '../FAB';
5
5
  import Typography from '../../Typography';
6
6
  import { TextProps } from '../../Typography/Text';
7
7
 
8
- const StyledContainer = styled(View)<ViewProps>`
9
- position: absolute;
10
- left: 0;
11
- right: 0;
12
- top: 0;
13
- bottom: 0;
14
- align-items: flex-end;
15
- justify-content: flex-end;
16
- `;
8
+ const StyledContainer = styled(View)<ViewProps>({
9
+ position: 'absolute',
10
+ left: 0,
11
+ right: 0,
12
+ top: 0,
13
+ bottom: 0,
14
+ alignItems: 'flex-end',
15
+ justifyContent: 'flex-end',
16
+ });
17
17
 
18
18
  const StyledActionGroupContainer = styled(Animated.View)<
19
19
  ComponentProps<typeof Animated.View>
20
- >`
21
- align-items: flex-end;
22
- justify-content: flex-end;
23
- width: 70%;
24
- `;
20
+ >({
21
+ alignItems: 'flex-end',
22
+ justifyContent: 'flex-end',
23
+ width: '70%',
24
+ });
25
25
 
26
- const StyledFAB = styled(FAB)<{}>`
27
- margin-right: ${({ theme }) => theme.space.large};
28
- align-self: flex-end;
29
- margin-top: ${({ theme }) => theme.space.large};
30
- `;
26
+ const StyledFAB = styled(FAB)(({ theme }) => ({
27
+ marginRight: theme.__hd__.fab.space.buttonMarginRight,
28
+ marginTop: theme.__hd__.fab.space.buttonMarginTop,
29
+ alignSelf: 'flex-end',
30
+ }));
31
31
 
32
32
  const StyledBackdrop = styled(Animated.View)<
33
33
  ComponentProps<typeof Animated.View>
34
- >`
35
- position: absolute;
36
- left: 0;
37
- right: 0;
38
- top: 0;
39
- bottom: 0;
40
- background: ${({ theme }) => theme.__hd__.fab.colors.backdropBackground};
41
- `;
34
+ >(({ theme }) => ({
35
+ position: 'absolute',
36
+ left: 0,
37
+ right: 0,
38
+ top: 0,
39
+ bottom: 0,
40
+ backgroundColor: theme.__hd__.fab.colors.backdropBackground,
41
+ }));
42
42
 
43
- const StyledHeaderText = styled(Typography.Text)<TextProps>`
44
- font-size: ${({ theme }) => theme.__hd__.fab.fontSizes.header};
45
- line-height: ${({ theme }) => theme.__hd__.fab.lineHeights.header};
46
- font-family: ${({ theme }) => theme.__hd__.fab.fonts.header};
47
- margin-right: ${({ theme }) => theme.__hd__.fab.space.headerTextMarginRight};
48
- margin-bottom: ${({ theme }) =>
49
- theme.__hd__.fab.space.headerTextMarginBottom};
50
- text-align: right;
51
- `;
43
+ const StyledHeaderText = styled(Typography.Text)<TextProps>(({ theme }) => ({
44
+ fontSize: theme.__hd__.fab.fontSizes.header,
45
+ lineHeight: theme.__hd__.fab.lineHeights.header,
46
+ fontFamily: theme.__hd__.fab.fonts.header,
47
+ marginRight: theme.__hd__.fab.space.headerTextMarginRight,
48
+ marginBottom: theme.__hd__.fab.space.headerTextMarginBottom,
49
+ textAlign: 'right',
50
+ }));
52
51
 
53
52
  export {
54
53
  StyledHeaderText,
@@ -1,29 +1,31 @@
1
1
  import { TouchableOpacity, TouchableOpacityProps } from 'react-native';
2
- import styled from 'styled-components-native';
2
+ import styled from '@emotion/native';
3
3
  import Typography from '../../Typography';
4
4
 
5
- const StyledActionItem = styled(TouchableOpacity)<TouchableOpacityProps>`
6
- padding-left: ${({ theme }) => theme.__hd__.fab.space.actionItemPaddingLeft};
7
- padding-right: ${({ theme }) =>
8
- theme.__hd__.fab.space.actionItemPaddingRight};
9
- padding-top: ${({ theme }) => theme.__hd__.fab.space.actionItemPaddingTop};
10
- padding-bottom: ${({ theme }) =>
11
- theme.__hd__.fab.space.actionItemPaddingBottom};
12
- margin: ${({ theme }) => theme.__hd__.fab.space.actionItemMargin};
13
- margin-right: ${({ theme }) => theme.__hd__.fab.space.actionItemMarginRight};
14
- background: ${({ theme }) => theme.__hd__.fab.colors.actionItemBackground};
15
- border-radius: ${({ theme }) => theme.__hd__.fab.radii.actionItem};
16
- flex-direction: row;
17
- align-items: center;
18
- align-self: flex-end;
19
- overflow: hidden;
20
- `;
5
+ const StyledActionItem = styled(TouchableOpacity)<TouchableOpacityProps>(
6
+ ({ theme }) => ({
7
+ paddingLeft: theme.__hd__.fab.space.actionItemPaddingLeft,
8
+ paddingRight: theme.__hd__.fab.space.actionItemPaddingRight,
9
+ paddingTop: theme.__hd__.fab.space.actionItemPaddingTop,
10
+ paddingBottom: theme.__hd__.fab.space.actionItemPaddingBottom,
11
+ margin: theme.__hd__.fab.space.actionItemMargin,
12
+ marginRight: theme.__hd__.fab.space.actionItemMarginRight,
13
+ backgroundColor: theme.__hd__.fab.colors.actionItemBackground,
14
+ borderRadius: theme.__hd__.fab.radii.actionItem,
15
+ flexDirection: 'row',
16
+ alignItems: 'center',
17
+ alignSelf: 'flex-end',
18
+ overflow: 'hidden',
19
+ })
20
+ );
21
+
22
+ const StyledActionItemText = styled(Typography.Text)<TouchableOpacityProps>(
23
+ ({ theme }) => ({
24
+ paddingLeft: theme.__hd__.fab.space.actionItemTextPaddingLeft,
25
+ fontSize: theme.__hd__.fab.fontSizes.actionItemText,
26
+ lineHeight: theme.__hd__.fab.lineHeights.actionItemText,
27
+ fontFamily: theme.__hd__.fab.fonts.actionItemText,
28
+ })
29
+ );
21
30
 
22
- const StyledActionItemText = styled(Typography.Text)<TouchableOpacityProps>`
23
- padding-left: ${({ theme }) =>
24
- theme.__hd__.fab.space.actionItemTextPaddingLeft};
25
- font-size: ${({ theme }) => theme.__hd__.fab.fontSizes.actionItemText};
26
- line-height: ${({ theme }) => theme.__hd__.fab.lineHeights.actionItemText};
27
- font-family: ${({ theme }) => theme.__hd__.fab.fonts.actionItemText};
28
- `;
29
31
  export { StyledActionItem, StyledActionItemText };