@hero-design/rn 7.1.3-alpha8 → 7.2.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.
Files changed (28) hide show
  1. package/.expo/packager-info.json +1 -1
  2. package/.turbo/turbo-build.log +8 -0
  3. package/.turbo/turbo-publish:npm.log +0 -0
  4. package/es/index.js +4 -8
  5. package/lib/index.js +4 -8
  6. package/package.json +2 -38
  7. package/playground/components/Card.tsx +4 -13
  8. package/playground/index.tsx +39 -31
  9. package/src/components/Card/StyledCard.tsx +0 -1
  10. package/src/components/Card/__tests__/__snapshots__/StyledCard.spec.tsx.snap +0 -1
  11. package/src/components/Card/__tests__/__snapshots__/index.spec.tsx.snap +1 -2
  12. package/src/components/Card/__tests__/index.spec.tsx +1 -1
  13. package/src/components/FAB/ActionGroup/index.tsx +1 -2
  14. package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +0 -3
  15. package/src/theme/components/card.ts +2 -8
  16. package/src/theme/global/colors.ts +1 -1
  17. package/src/theme/index.ts +1 -1
  18. package/types/src/components/BottomNavigation/__tests__/BottomNavigation.spec.d.ts +1 -0
  19. package/types/src/components/Card/__tests__/Card.spec.d.ts +1 -0
  20. package/types/src/components/FAB/ActionGroup/index.d.ts +3 -0
  21. package/types/src/components/FAB/StyledFABContainer.d.ts +3 -0
  22. package/types/src/components/FAB/StyledFABIcon.d.ts +3 -0
  23. package/types/src/components/FAB/__tests__/StyledFABContainer.spec.d.ts +1 -0
  24. package/types/src/components/FAB/__tests__/StyledFABIcon.spec.d.ts +1 -0
  25. package/types/src/components/Icon/__tests__/Icon.spec.d.ts +1 -0
  26. package/types/src/components/Tabs/__tests__/Tabs.spec.d.ts +1 -0
  27. package/types/src/styled-components.d.ts +6 -0
  28. package/types/src/theme/components/card.d.ts +1 -5
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "devToolsPort": 19002,
3
- "expoServerPort": null,
3
+ "expoServerPort": 19000,
4
4
  "packagerPort": 19000,
5
5
  "packagerPid": null,
6
6
  "expoServerNgrokUrl": null,
@@ -0,0 +1,8 @@
1
+ @hero-design/rn:build: cache hit, replaying output 27643cfcbb96545b
2
+ @hero-design/rn:build: $ yarn build:js && yarn build:types
3
+ @hero-design/rn:build: $ rollup -c
4
+ @hero-design/rn:build: 
5
+ @hero-design/rn:build: src/index.ts → lib/index.js, es/index.js...
6
+ @hero-design/rn:build: (!) Plugin replace: @rollup/plugin-replace: 'preventAssignment' currently defaults to false. It is recommended to set this option to `true`, as the next major version will default this option to `true`.
7
+ @hero-design/rn:build: created lib/index.js, es/index.js in 15.1s
8
+ @hero-design/rn:build: $ tsc --noEmit false --emitDeclarationOnly
File without changes
package/es/index.js CHANGED
@@ -1563,6 +1563,7 @@ var palette = {
1563
1563
  smaltDark75: '#000d20',
1564
1564
  smaltLight30: '#4d72a6',
1565
1565
  smaltLight45: '#7390b9',
1566
+ smaltLight75: '#bfcddf',
1566
1567
  smaltLight90: '#e6ebf2',
1567
1568
  violet: '#7622d7',
1568
1569
  violetDark15: '#641db7',
@@ -1776,16 +1777,12 @@ var getBottomNavigationTheme = function getBottomNavigationTheme(theme) {
1776
1777
  };
1777
1778
  };
1778
1779
 
1779
- var getCardTheme = function getCardTheme(theme) {
1780
+ var getCardTheme = function getCardTheme() {
1780
1781
  var radii = {
1781
1782
  "default": 12
1782
1783
  };
1783
- var padding = {
1784
- "default": theme.space.small
1785
- };
1786
1784
  return {
1787
- radii: radii,
1788
- padding: padding
1785
+ radii: radii
1789
1786
  };
1790
1787
  };
1791
1788
 
@@ -1941,7 +1938,7 @@ var getTheme = function getTheme() {
1941
1938
  __hd__: {
1942
1939
  badge: getBadgeTheme(globalTheme),
1943
1940
  bottomNavigation: getBottomNavigationTheme(globalTheme),
1944
- card: getCardTheme(globalTheme),
1941
+ card: getCardTheme(),
1945
1942
  divider: getDividerTheme(globalTheme),
1946
1943
  icon: getIconTheme(globalTheme),
1947
1944
  tabs: getTabsTheme(globalTheme),
@@ -13801,7 +13798,6 @@ var StyledCard = index$1(View)(function (_ref) {
13801
13798
  var theme = _ref.theme;
13802
13799
  return {
13803
13800
  borderRadius: theme.__hd__.card.radii["default"],
13804
- padding: theme.__hd__.card.padding["default"],
13805
13801
  overflow: 'hidden'
13806
13802
  };
13807
13803
  });
package/lib/index.js CHANGED
@@ -1590,6 +1590,7 @@ var palette = {
1590
1590
  smaltDark75: '#000d20',
1591
1591
  smaltLight30: '#4d72a6',
1592
1592
  smaltLight45: '#7390b9',
1593
+ smaltLight75: '#bfcddf',
1593
1594
  smaltLight90: '#e6ebf2',
1594
1595
  violet: '#7622d7',
1595
1596
  violetDark15: '#641db7',
@@ -1803,16 +1804,12 @@ var getBottomNavigationTheme = function getBottomNavigationTheme(theme) {
1803
1804
  };
1804
1805
  };
1805
1806
 
1806
- var getCardTheme = function getCardTheme(theme) {
1807
+ var getCardTheme = function getCardTheme() {
1807
1808
  var radii = {
1808
1809
  "default": 12
1809
1810
  };
1810
- var padding = {
1811
- "default": theme.space.small
1812
- };
1813
1811
  return {
1814
- radii: radii,
1815
- padding: padding
1812
+ radii: radii
1816
1813
  };
1817
1814
  };
1818
1815
 
@@ -1968,7 +1965,7 @@ var getTheme = function getTheme() {
1968
1965
  __hd__: {
1969
1966
  badge: getBadgeTheme(globalTheme),
1970
1967
  bottomNavigation: getBottomNavigationTheme(globalTheme),
1971
- card: getCardTheme(globalTheme),
1968
+ card: getCardTheme(),
1972
1969
  divider: getDividerTheme(globalTheme),
1973
1970
  icon: getIconTheme(globalTheme),
1974
1971
  tabs: getTabsTheme(globalTheme),
@@ -13828,7 +13825,6 @@ var StyledCard = index$1(reactNative.View)(function (_ref) {
13828
13825
  var theme = _ref.theme;
13829
13826
  return {
13830
13827
  borderRadius: theme.__hd__.card.radii["default"],
13831
- padding: theme.__hd__.card.padding["default"],
13832
13828
  overflow: 'hidden'
13833
13829
  };
13834
13830
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hero-design/rn",
3
- "version": "7.1.3-alpha8",
3
+ "version": "7.2.2",
4
4
  "license": "MIT",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -20,7 +20,7 @@
20
20
  "dependencies": {
21
21
  "@emotion/native": "^11.9.3",
22
22
  "@emotion/react": "^11.9.3",
23
- "@hero-design/colors": "7.1.2"
23
+ "@hero-design/colors": "7.2.2"
24
24
  },
25
25
  "peerDependencies": {
26
26
  "react": "17.0.2",
@@ -70,41 +70,5 @@
70
70
  "rollup-plugin-copy": "^3.4.0",
71
71
  "ts-jest": "^27.0.7",
72
72
  "typescript": "^4.5.5"
73
- },
74
- "nx": {
75
- "targets": {
76
- "type-check": {
77
- "dependsOn": [
78
- {
79
- "target": "build:types",
80
- "projects": "dependencies"
81
- }
82
- ]
83
- },
84
- "lint": {
85
- "dependsOn": [
86
- {
87
- "target": "build:js",
88
- "projects": "dependencies"
89
- }
90
- ]
91
- },
92
- "test:ci": {
93
- "dependsOn": [
94
- {
95
- "target": "build",
96
- "projects": "dependencies"
97
- }
98
- ]
99
- },
100
- "dev": {
101
- "dependsOn": [
102
- {
103
- "target": "build",
104
- "projects": "dependencies"
105
- }
106
- ]
107
- }
108
- }
109
73
  }
110
74
  }
@@ -6,7 +6,7 @@ import {
6
6
  TouchableOpacity,
7
7
  ScrollView,
8
8
  } from 'react-native';
9
- import { palette } from '@hero-design/colors';
9
+ import palette from '@hero-design/colors';
10
10
  import {
11
11
  scale,
12
12
  Card,
@@ -71,13 +71,7 @@ const ApprovalCard = ({ style }: ViewProps) => {
71
71
  return (
72
72
  <Card
73
73
  style={StyleSheet.flatten([
74
- {
75
- backgroundColor: palette.greyLight90,
76
- paddingTop: 0,
77
- paddingRight: 0,
78
- paddingBottom: 0,
79
- paddingLeft: 0,
80
- },
74
+ { backgroundColor: palette.greyLight90 },
81
75
  style,
82
76
  ])}
83
77
  >
@@ -117,7 +111,7 @@ const DashboardCard = ({
117
111
  const theme = useTheme();
118
112
 
119
113
  return (
120
- <Card style={style}>
114
+ <Card style={StyleSheet.flatten([{ padding: theme.space.small }, style])}>
121
115
  <View style={{ flex: 1, alignItems: 'flex-end' }}>
122
116
  <Icon icon={icon} />
123
117
  </View>
@@ -175,6 +169,7 @@ const RostersCard = (props: ViewProps) => {
175
169
  flexDirection: 'row',
176
170
  alignItems: 'center',
177
171
  backgroundColor: palette.greyLight90,
172
+ padding: theme.space.small,
178
173
  },
179
174
  style,
180
175
  ])}
@@ -211,10 +206,6 @@ const MyLeaveCard = (props: ViewProps) => {
211
206
  style={StyleSheet.flatten([
212
207
  {
213
208
  backgroundColor: palette.greyLight90,
214
- paddingBottom: 0,
215
- paddingTop: 0,
216
- paddingRight: 0,
217
- paddingLeft: 0,
218
209
  },
219
210
  style,
220
211
  ])}
@@ -6,8 +6,15 @@ import {
6
6
  NativeStackScreenProps,
7
7
  } from '@react-navigation/native-stack';
8
8
  import { useFonts } from 'expo-font';
9
- import { SafeAreaView, FlatList } from 'react-native';
10
- import { ThemeProvider, theme, useTheme, Typography } from '../src/index';
9
+ import { SafeAreaView, FlatList, View, TouchableOpacity } from 'react-native';
10
+ import {
11
+ ThemeProvider,
12
+ theme,
13
+ useTheme,
14
+ Typography,
15
+ Icon,
16
+ Divider,
17
+ } from '../src/index';
11
18
  import BadgePlayground from './components/Badge';
12
19
  import BottomNavigation from './components/BottomNavigation';
13
20
  import Button from './components/Button';
@@ -52,44 +59,45 @@ const components = [
52
59
  { name: 'Typography', component: TypographyPlayground },
53
60
  ] as const;
54
61
 
55
- const ComponentItem = ({
56
- name,
57
- onPress,
58
- }: {
59
- name: string;
60
- onPress: () => void;
61
- }) => {
62
+ const ComponentItem = ({ name }: { name: string }) => {
62
63
  const hdTheme = useTheme();
63
64
  return (
64
- <Typography.Text
65
- fontSize="large"
66
- onPress={onPress}
65
+ <View
67
66
  style={{
68
- marginTop: hdTheme.space.medium,
67
+ flex: 1,
68
+ flexDirection: 'row',
69
+ alignItems: 'center',
70
+ justifyContent: 'space-between',
71
+ marginHorizontal: hdTheme.space.medium,
72
+ marginVertical: hdTheme.space.medium,
69
73
  }}
70
74
  >
71
- {name}
72
- </Typography.Text>
73
- );
74
- };
75
-
76
- const ComponentList = ({ navigation }: Navigation) => {
77
- const hdTheme = useTheme();
78
- return (
79
- <SafeAreaView style={{ marginHorizontal: hdTheme.space.large }}>
80
- <FlatList
81
- data={components}
82
- renderItem={({ item }) => (
83
- <ComponentItem
84
- name={item.name}
85
- onPress={() => navigation.navigate(item.name)}
86
- />
87
- )}
75
+ <Typography.Text fontSize="large">{name}</Typography.Text>
76
+ <Icon
77
+ icon="arrow-right"
78
+ size="small"
79
+ style={{ color: hdTheme.colors.disabledText }}
88
80
  />
89
- </SafeAreaView>
81
+ </View>
90
82
  );
91
83
  };
92
84
 
85
+ const ComponentList = ({ navigation }: Navigation) => (
86
+ <SafeAreaView>
87
+ <FlatList
88
+ data={components}
89
+ renderItem={({ item }) => (
90
+ <>
91
+ <TouchableOpacity onPress={() => navigation.navigate(item.name)}>
92
+ <ComponentItem name={item.name} />
93
+ </TouchableOpacity>
94
+ <Divider marginHorizontal="small" />
95
+ </>
96
+ )}
97
+ />
98
+ </SafeAreaView>
99
+ );
100
+
93
101
  const App = () => {
94
102
  const CustomNavigationTheme = {
95
103
  ...DefaultTheme,
@@ -3,7 +3,6 @@ import styled from '@emotion/native';
3
3
 
4
4
  const StyledCard = styled(View)(({ theme }) => ({
5
5
  borderRadius: theme.__hd__.card.radii.default,
6
- padding: theme.__hd__.card.padding.default,
7
6
  overflow: 'hidden',
8
7
  }));
9
8
 
@@ -7,7 +7,6 @@ exports[`StyledCard renders correct style 1`] = `
7
7
  Object {
8
8
  "borderRadius": 12,
9
9
  "overflow": "hidden",
10
- "padding": 8,
11
10
  },
12
11
  undefined,
13
12
  ]
@@ -1,6 +1,6 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`Card renders correct 1`] = `
3
+ exports[`Card renders correctly 1`] = `
4
4
  <View
5
5
  hitSlop={
6
6
  Object {
@@ -18,7 +18,6 @@ exports[`Card renders correct 1`] = `
18
18
  Object {
19
19
  "borderRadius": 12,
20
20
  "overflow": "hidden",
21
- "padding": 8,
22
21
  },
23
22
  Object {
24
23
  "backgroundColor": "#292a2b",
@@ -23,7 +23,7 @@ describe('Card', () => {
23
23
  );
24
24
  });
25
25
 
26
- it('renders correct', () => {
26
+ it('renders correctly', () => {
27
27
  expect(wrapper.queryAllByTestId('card')).toHaveLength(1);
28
28
 
29
29
  expect(wrapper.toJSON()).toMatchSnapshot();
@@ -25,7 +25,7 @@ const ActionItemsListComponent = ({
25
25
  );
26
26
 
27
27
  export interface ActionGroupProps {
28
- /*
28
+ /**
29
29
  * Title of the action group header.
30
30
  */
31
31
  headerTitle?: string;
@@ -37,7 +37,6 @@ export interface ActionGroupProps {
37
37
  * Specify if the FAB button is in active state and the action group is shown.
38
38
  * */
39
39
  active?: boolean;
40
-
41
40
  /**
42
41
  * Additional style.
43
42
  */
@@ -53,9 +53,6 @@ Object {
53
53
  },
54
54
  },
55
55
  "card": Object {
56
- "padding": Object {
57
- "default": 8,
58
- },
59
56
  "radii": Object {
60
57
  "default": 12,
61
58
  },
@@ -1,15 +1,9 @@
1
- import { GlobalTheme } from '../global';
2
-
3
- const getCardTheme = (theme: GlobalTheme) => {
1
+ const getCardTheme = () => {
4
2
  const radii = {
5
3
  default: 12,
6
4
  };
7
5
 
8
- const padding = {
9
- default: theme.space.small,
10
- };
11
-
12
- return { radii, padding };
6
+ return { radii };
13
7
  };
14
8
 
15
9
  export default getCardTheme;
@@ -1,4 +1,4 @@
1
- import { palette } from '@hero-design/colors';
1
+ import palette from '@hero-design/colors';
2
2
 
3
3
  const systemPalette = {
4
4
  primary: palette.violet,
@@ -39,7 +39,7 @@ const getTheme = (
39
39
  __hd__: {
40
40
  badge: getBadgeTheme(globalTheme),
41
41
  bottomNavigation: getBottomNavigationTheme(globalTheme),
42
- card: getCardTheme(globalTheme),
42
+ card: getCardTheme(),
43
43
  divider: getDividerTheme(globalTheme),
44
44
  icon: getIconTheme(globalTheme),
45
45
  tabs: getTabsTheme(globalTheme),
@@ -0,0 +1 @@
1
+ export {};
@@ -1,6 +1,9 @@
1
1
  import { StyleProp, ViewStyle } from 'react-native';
2
2
  import { ActionItemProps } from './ActionItem';
3
3
  export interface ActionGroupProps {
4
+ /**
5
+ * Title of the action group header.
6
+ */
4
7
  headerTitle?: string;
5
8
  /**
6
9
  * This function is called on pressing the FAB button.
@@ -0,0 +1,3 @@
1
+ import { TouchableHighlight, TouchableHighlightProps } from 'react-native';
2
+ declare const StyledFABContainer: import("styled-components").StyledComponent<typeof TouchableHighlight, import("../../theme").Theme, TouchableHighlightProps, never>;
3
+ export { StyledFABContainer };
@@ -0,0 +1,3 @@
1
+ import { IconProps } from '../Icon';
2
+ declare const StyledFABIcon: import("styled-components").StyledComponent<({ icon, style, size, intent, testID, }: IconProps) => JSX.Element, import("../../theme").Theme, IconProps, never>;
3
+ export { StyledFABIcon };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ /// <reference types="styled-components-react-native" />
2
+ import * as styledComponents from 'styled-components/native';
3
+ import type { Theme } from './theme';
4
+ declare const styled: styledComponents.ReactNativeStyledInterface<Theme>, useTheme: () => Theme, css: import("styled-components").ThemedCssFunction<Theme>, ThemeProvider: import("styled-components").ThemeProviderComponent<Theme, Theme>;
5
+ export { useTheme, css, ThemeProvider };
6
+ export default styled;
@@ -1,10 +1,6 @@
1
- import { GlobalTheme } from '../global';
2
- declare const getCardTheme: (theme: GlobalTheme) => {
1
+ declare const getCardTheme: () => {
3
2
  radii: {
4
3
  default: number;
5
4
  };
6
- padding: {
7
- default: number;
8
- };
9
5
  };
10
6
  export default getCardTheme;