@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.
- package/.eslintrc.json +0 -6
- package/.expo/packager-info.json +1 -1
- package/babel.config.js +0 -14
- package/es/index.js +2787 -8941
- package/jest-setup.ts +0 -1
- package/jest.config.js +2 -4
- package/lib/index.js +2822 -8956
- package/package.json +5 -7
- package/playground/components/BottomNavigation.tsx +14 -11
- package/playground/components/Button.tsx +67 -0
- package/playground/components/Card.tsx +141 -107
- package/playground/components/Tabs.tsx +44 -0
- package/playground/index.tsx +13 -7
- package/src/components/Badge/StyledBadge.tsx +19 -21
- package/src/components/Badge/__tests__/Badge.spec.tsx +9 -18
- package/src/components/Badge/__tests__/__snapshots__/Badge.spec.tsx.snap +76 -96
- package/src/components/Badge/index.tsx +1 -1
- package/src/components/BottomNavigation/StyledBottomNavigation.tsx +44 -42
- package/src/components/BottomNavigation/__tests__/__snapshots__/{BottomNavigation.spec.tsx.snap → index.spec.tsx.snap} +130 -96
- package/src/components/BottomNavigation/__tests__/{BottomNavigation.spec.tsx → index.spec.tsx} +4 -4
- package/src/components/BottomNavigation/index.tsx +28 -32
- package/src/components/Button/IconButton.tsx +62 -0
- package/src/components/Button/__tests__/__snapshots__/index.spec.tsx.snap +46 -0
- package/src/components/Button/__tests__/index.spec.tsx +23 -0
- package/src/components/Button/index.tsx +5 -0
- package/src/components/Card/StyledCard.tsx +6 -6
- package/src/components/Card/__tests__/StyledCard.spec.tsx +2 -7
- package/src/components/Card/__tests__/__snapshots__/StyledCard.spec.tsx.snap +8 -11
- package/src/components/Card/__tests__/__snapshots__/{Card.spec.tsx.snap → index.spec.tsx.snap} +2 -8
- package/src/components/Card/__tests__/index.spec.tsx +35 -0
- package/src/components/Divider/StyledDivider.tsx +18 -60
- package/src/components/Divider/__tests__/StyledDivider.spec.tsx +5 -10
- package/src/components/Divider/__tests__/__snapshots__/StyledDivider.spec.tsx.snap +106 -70
- package/src/components/Divider/index.tsx +1 -1
- package/src/components/FAB/ActionGroup/ActionItem.tsx +2 -4
- package/src/components/FAB/ActionGroup/StyledActionGroup.tsx +36 -37
- package/src/components/FAB/ActionGroup/StyledActionItem.tsx +26 -24
- package/src/components/FAB/ActionGroup/__tests__/__snapshots__/index.spec.tsx.snap +271 -245
- package/src/components/FAB/ActionGroup/__tests__/index.spec.tsx +29 -33
- package/src/components/FAB/ActionGroup/index.tsx +1 -5
- package/src/components/FAB/AnimatedFABIcon.tsx +1 -1
- package/src/components/FAB/FAB.tsx +5 -9
- package/src/components/FAB/StyledFAB.tsx +22 -0
- package/src/components/FAB/__tests__/AnimatedFABIcon.spec.tsx +3 -6
- package/src/components/FAB/__tests__/StyledFAB.spec.tsx +24 -0
- package/src/components/FAB/__tests__/__snapshots__/AnimatedFABIcon.spec.tsx.snap +14 -10
- package/src/components/FAB/__tests__/__snapshots__/StyledFAB.spec.tsx.snap +72 -0
- package/src/components/FAB/__tests__/__snapshots__/index.spec.tsx.snap +16 -17
- package/src/components/FAB/__tests__/index.spec.tsx +21 -26
- package/src/components/Icon/HeroIcon/index.tsx +5 -7
- package/src/components/Icon/__tests__/__snapshots__/{Icon.spec.tsx.snap → index.spec.tsx.snap} +21 -12
- package/src/components/Icon/__tests__/index.spec.tsx +25 -0
- package/src/components/Icon/index.tsx +1 -1
- package/src/components/Tabs/StyledTabs.tsx +70 -0
- package/src/components/Tabs/__tests__/__snapshots__/index.spec.tsx.snap +321 -0
- package/src/components/Tabs/__tests__/index.spec.tsx +79 -0
- package/src/components/Tabs/index.tsx +185 -0
- package/src/components/Typography/Text/StyledText.tsx +19 -64
- package/src/components/Typography/Text/__tests__/__snapshots__/StyledText.spec.tsx.snap +90 -63
- package/src/emotion.d.ts +6 -0
- package/src/index.ts +9 -3
- package/src/testHelpers/renderWithTheme.tsx +2 -1
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +70 -48
- package/src/theme/components/badge.ts +10 -9
- package/src/theme/components/bottomNavigation.ts +7 -3
- package/src/theme/components/card.ts +2 -2
- package/src/theme/components/divider.ts +6 -6
- package/src/theme/components/fab.ts +19 -17
- package/src/theme/components/tabs.ts +20 -0
- package/src/theme/components/typography.ts +4 -4
- package/src/theme/global/borders.ts +8 -2
- package/src/theme/global/colors.ts +3 -1
- package/src/theme/global/index.ts +31 -17
- package/src/theme/global/scale.ts +18 -0
- package/src/theme/global/space.ts +23 -13
- package/src/theme/global/typography.ts +71 -27
- package/src/theme/index.ts +29 -13
- package/src/types.ts +7 -0
- package/src/utils/__tests__/scale.spec.ts +3 -3
- package/testUtils/setup.ts +11 -0
- package/tsconfig.json +1 -5
- package/types/playground/components/BottomNavigation.d.ts +2 -2
- package/types/playground/components/Button.d.ts +2 -0
- package/types/playground/components/Tabs.d.ts +2 -0
- package/types/src/components/Badge/StyledBadge.d.ts +16 -5
- package/types/src/components/Badge/index.d.ts +1 -1
- package/types/src/components/BottomNavigation/StyledBottomNavigation.d.ts +44 -9
- package/types/src/components/{Typography/Text/__test__ → BottomNavigation/__tests__}/index.spec.d.ts +0 -0
- package/types/src/components/BottomNavigation/index.d.ts +19 -14
- package/types/src/components/Button/IconButton.d.ts +34 -0
- package/types/{theme → src/components/Button}/__tests__/index.spec.d.ts +0 -0
- package/types/src/components/Button/index.d.ts +4 -0
- package/types/src/components/Card/StyledCard.d.ts +7 -1
- package/types/{components/Card/__tests__/Card.spec.d.ts → src/components/Card/__tests__/index.spec.d.ts} +0 -0
- package/types/src/components/Divider/StyledDivider.d.ts +8 -2
- package/types/src/components/Divider/index.d.ts +1 -1
- package/types/src/components/FAB/ActionGroup/StyledActionGroup.d.ts +25 -7
- package/types/src/components/FAB/ActionGroup/StyledActionItem.d.ts +11 -2
- package/types/src/components/FAB/ActionGroup/index.d.ts +1 -1
- package/types/src/components/FAB/FAB.d.ts +4 -4
- package/types/src/components/FAB/StyledFAB.d.ts +14 -0
- package/types/{components/Card/__tests__/StyledCard.spec.d.ts → src/components/FAB/__tests__/StyledFAB.spec.d.ts} +0 -0
- package/types/src/components/Icon/HeroIcon/index.d.ts +8 -2
- package/types/{components/Divider/__tests__/StyledDivider.spec.d.ts → src/components/Icon/__tests__/index.spec.d.ts} +0 -0
- package/types/src/components/Icon/index.d.ts +1 -1
- package/types/src/components/Icon/utils.d.ts +1 -1
- package/types/src/components/Tabs/StyledTabs.d.ts +55 -0
- package/types/{components/ExampleComponent/__tests__/StyledView.spec.d.ts → src/components/Tabs/__tests__/index.spec.d.ts} +0 -0
- package/types/src/components/Tabs/index.d.ts +45 -0
- package/types/src/components/Typography/Text/StyledText.d.ts +8 -2
- package/types/src/index.d.ts +6 -3
- package/types/src/theme/components/badge.d.ts +8 -7
- package/types/src/theme/components/bottomNavigation.d.ts +8 -2
- package/types/src/theme/components/card.d.ts +2 -2
- package/types/src/theme/components/divider.d.ts +6 -6
- package/types/src/theme/components/fab.d.ts +19 -17
- package/types/src/theme/components/tabs.d.ts +15 -0
- package/types/src/theme/components/typography.d.ts +4 -4
- package/types/src/theme/global/borders.d.ts +4 -3
- package/types/src/theme/global/colors.d.ts +2 -2
- package/types/src/theme/global/index.d.ts +10 -45
- package/types/src/theme/global/scale.d.ts +8 -0
- package/types/src/theme/global/space.d.ts +8 -7
- package/types/src/theme/global/typography.d.ts +9 -16
- package/types/src/theme/index.d.ts +4 -2
- package/types/src/types.d.ts +5 -0
- package/lib/assets/fonts/be-vietnam-pro-light.ttf +0 -0
- package/lib/assets/fonts/be-vietnam-pro-regular.ttf +0 -0
- package/lib/assets/fonts/be-vietnam-pro-semibold.ttf +0 -0
- package/src/components/Card/__tests__/Card.spec.tsx +0 -36
- package/src/components/FAB/StyledFABContainer.tsx +0 -14
- package/src/components/FAB/StyledFABIcon.tsx +0 -9
- package/src/components/FAB/__tests__/StyledFABContainer.spec.tsx +0 -18
- package/src/components/FAB/__tests__/StyledFABIcon.spec.tsx +0 -16
- package/src/components/FAB/__tests__/__snapshots__/StyledFABContainer.spec.tsx.snap +0 -46
- package/src/components/FAB/__tests__/__snapshots__/StyledFABIcon.spec.tsx.snap +0 -21
- package/src/components/Icon/__tests__/Icon.spec.tsx +0 -36
- package/src/styled-components.ts +0 -14
- package/src/styled.d.ts +0 -7
- package/types/components/Card/StyledCard.d.ts +0 -3
- package/types/components/Card/index.d.ts +0 -5
- package/types/components/Divider/StyledDivider.d.ts +0 -7
- package/types/components/Divider/index.d.ts +0 -12
- package/types/components/ExampleComponent/StyledView.d.ts +0 -7
- package/types/components/ExampleComponent/index.d.ts +0 -16
- package/types/index.d.ts +0 -5
- package/types/src/components/BottomNavigation/__tests__/BottomNavigation.spec.d.ts +0 -1
- package/types/src/components/Card/__tests__/Card.spec.d.ts +0 -1
- package/types/src/components/FAB/StyledFABContainer.d.ts +0 -3
- package/types/src/components/FAB/StyledFABIcon.d.ts +0 -3
- package/types/src/components/FAB/__tests__/StyledFABContainer.spec.d.ts +0 -1
- package/types/src/components/FAB/__tests__/StyledFABIcon.spec.d.ts +0 -1
- package/types/src/components/Icon/__tests__/Icon.spec.d.ts +0 -1
- package/types/src/components/Typography/Text/__test__/StyledText.spec.d.ts +0 -1
- package/types/src/styled-components.d.ts +0 -6
- package/types/styled-components.d.ts +0 -6
- package/types/theme/components/card.d.ts +0 -10
- package/types/theme/components/divider.d.ts +0 -17
- package/types/theme/components/exampleComponent.d.ts +0 -14
- package/types/theme/global/borders.d.ts +0 -4
- package/types/theme/global/colors.d.ts +0 -26
- package/types/theme/global/index.d.ts +0 -63
- package/types/theme/global/space.d.ts +0 -12
- package/types/theme/global/typography.d.ts +0 -21
- package/types/theme/index.d.ts +0 -13
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
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 } =
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
`;
|
package/src/components/Card/__tests__/__snapshots__/{Card.spec.tsx.snap → index.spec.tsx.snap}
RENAMED
|
@@ -16,15 +16,9 @@ exports[`Card renders correct 1`] = `
|
|
|
16
16
|
style={
|
|
17
17
|
Array [
|
|
18
18
|
Object {
|
|
19
|
-
"
|
|
20
|
-
"borderBottomRightRadius": 12,
|
|
21
|
-
"borderTopLeftRadius": 12,
|
|
22
|
-
"borderTopRightRadius": 12,
|
|
19
|
+
"borderRadius": 12,
|
|
23
20
|
"overflow": "hidden",
|
|
24
|
-
"
|
|
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
|
|
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
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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
|
|
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 } =
|
|
17
|
-
<
|
|
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 } =
|
|
35
|
-
<
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
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
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
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
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
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
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
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
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
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
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
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
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
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
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
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
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
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
|
/>
|
|
@@ -18,10 +18,8 @@ const ActionItem = ({
|
|
|
18
18
|
testID,
|
|
19
19
|
}: ActionItemProps) => (
|
|
20
20
|
<StyledActionItem style={style} onPress={onPress} testID={testID}>
|
|
21
|
-
|
|
22
|
-
|
|
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 '
|
|
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
|
-
|
|
15
|
-
|
|
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
|
-
|
|
22
|
-
|
|
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
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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
|
-
|
|
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
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
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 '
|
|
2
|
+
import styled from '@emotion/native';
|
|
3
3
|
import Typography from '../../Typography';
|
|
4
4
|
|
|
5
|
-
const StyledActionItem = styled(TouchableOpacity)<TouchableOpacityProps
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
theme.__hd__.fab.space.actionItemPaddingRight
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
theme.__hd__.fab.space.
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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 };
|