@hero-design/rn 7.2.1 → 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 (95) hide show
  1. package/.expo/packager-info.json +2 -2
  2. package/.turbo/turbo-build.log +8 -8
  3. package/es/index.js +18 -23
  4. package/lib/index.js +18 -23
  5. package/package.json +2 -2
  6. package/playground/components/Card.tsx +3 -12
  7. package/src/components/Card/StyledCard.tsx +0 -1
  8. package/src/components/Card/__tests__/__snapshots__/StyledCard.spec.tsx.snap +0 -1
  9. package/src/components/Card/__tests__/__snapshots__/index.spec.tsx.snap +1 -2
  10. package/src/components/Card/__tests__/index.spec.tsx +1 -1
  11. package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +0 -3
  12. package/src/theme/components/card.ts +2 -8
  13. package/src/theme/index.ts +1 -1
  14. package/types/playground/components/Badge.d.ts +0 -0
  15. package/types/playground/components/BottomNavigation.d.ts +0 -0
  16. package/types/playground/components/Button.d.ts +0 -0
  17. package/types/playground/components/Card.d.ts +0 -0
  18. package/types/playground/components/Divider.d.ts +0 -0
  19. package/types/playground/components/FAB.d.ts +0 -0
  20. package/types/playground/components/Icon.d.ts +0 -0
  21. package/types/playground/components/Tabs.d.ts +0 -0
  22. package/types/playground/components/Typography.d.ts +0 -0
  23. package/types/playground/index.d.ts +0 -0
  24. package/types/src/components/Badge/StyledBadge.d.ts +0 -0
  25. package/types/src/components/Badge/__tests__/Badge.spec.d.ts +0 -0
  26. package/types/src/components/Badge/index.d.ts +0 -0
  27. package/types/src/components/BottomNavigation/StyledBottomNavigation.d.ts +0 -0
  28. package/types/src/components/BottomNavigation/__tests__/BottomNavigation.spec.d.ts +1 -0
  29. package/types/src/components/BottomNavigation/__tests__/index.spec.d.ts +0 -0
  30. package/types/src/components/BottomNavigation/index.d.ts +0 -0
  31. package/types/src/components/Button/IconButton.d.ts +0 -0
  32. package/types/src/components/Button/__tests__/index.spec.d.ts +0 -0
  33. package/types/src/components/Button/index.d.ts +0 -0
  34. package/types/src/components/Card/StyledCard.d.ts +0 -0
  35. package/types/src/components/Card/__tests__/Card.spec.d.ts +1 -0
  36. package/types/src/components/Card/__tests__/StyledCard.spec.d.ts +0 -0
  37. package/types/src/components/Card/__tests__/index.spec.d.ts +0 -0
  38. package/types/src/components/Card/index.d.ts +0 -0
  39. package/types/src/components/Divider/StyledDivider.d.ts +0 -0
  40. package/types/src/components/Divider/__tests__/StyledDivider.spec.d.ts +0 -0
  41. package/types/src/components/Divider/index.d.ts +0 -0
  42. package/types/src/components/FAB/ActionGroup/ActionItem.d.ts +0 -0
  43. package/types/src/components/FAB/ActionGroup/StyledActionGroup.d.ts +0 -0
  44. package/types/src/components/FAB/ActionGroup/StyledActionItem.d.ts +0 -0
  45. package/types/src/components/FAB/ActionGroup/__tests__/index.spec.d.ts +0 -0
  46. package/types/src/components/FAB/ActionGroup/index.d.ts +0 -0
  47. package/types/src/components/FAB/AnimatedFABIcon.d.ts +0 -0
  48. package/types/src/components/FAB/FAB.d.ts +0 -0
  49. package/types/src/components/FAB/StyledFAB.d.ts +0 -0
  50. package/types/src/components/FAB/StyledFABContainer.d.ts +3 -0
  51. package/types/src/components/FAB/StyledFABIcon.d.ts +3 -0
  52. package/types/src/components/FAB/__tests__/AnimatedFABIcon.spec.d.ts +0 -0
  53. package/types/src/components/FAB/__tests__/StyledFAB.spec.d.ts +0 -0
  54. package/types/src/components/FAB/__tests__/StyledFABContainer.spec.d.ts +1 -0
  55. package/types/src/components/FAB/__tests__/StyledFABIcon.spec.d.ts +1 -0
  56. package/types/src/components/FAB/__tests__/index.spec.d.ts +0 -0
  57. package/types/src/components/FAB/index.d.ts +0 -0
  58. package/types/src/components/Icon/HeroIcon/index.d.ts +0 -0
  59. package/types/src/components/Icon/IconList.d.ts +0 -0
  60. package/types/src/components/Icon/__tests__/Icon.spec.d.ts +1 -0
  61. package/types/src/components/Icon/__tests__/index.spec.d.ts +0 -0
  62. package/types/src/components/Icon/index.d.ts +0 -0
  63. package/types/src/components/Icon/utils.d.ts +0 -0
  64. package/types/src/components/Tabs/StyledTabs.d.ts +0 -0
  65. package/types/src/components/Tabs/__tests__/Tabs.spec.d.ts +1 -0
  66. package/types/src/components/Tabs/__tests__/index.spec.d.ts +0 -0
  67. package/types/src/components/Tabs/index.d.ts +0 -0
  68. package/types/src/components/Typography/Text/StyledText.d.ts +0 -0
  69. package/types/src/components/Typography/Text/__tests__/StyledText.spec.d.ts +0 -0
  70. package/types/src/components/Typography/Text/__tests__/index.spec.d.ts +0 -0
  71. package/types/src/components/Typography/Text/index.d.ts +0 -0
  72. package/types/src/components/Typography/index.d.ts +0 -0
  73. package/types/src/index.d.ts +0 -0
  74. package/types/src/styled-components.d.ts +6 -0
  75. package/types/src/testHelpers/renderWithTheme.d.ts +0 -0
  76. package/types/src/theme/__tests__/index.spec.d.ts +0 -0
  77. package/types/src/theme/components/badge.d.ts +0 -0
  78. package/types/src/theme/components/bottomNavigation.d.ts +0 -0
  79. package/types/src/theme/components/card.d.ts +1 -5
  80. package/types/src/theme/components/divider.d.ts +0 -0
  81. package/types/src/theme/components/fab.d.ts +0 -0
  82. package/types/src/theme/components/icon.d.ts +0 -0
  83. package/types/src/theme/components/tabs.d.ts +0 -0
  84. package/types/src/theme/components/typography.d.ts +0 -0
  85. package/types/src/theme/global/borders.d.ts +0 -0
  86. package/types/src/theme/global/colors.d.ts +0 -0
  87. package/types/src/theme/global/index.d.ts +0 -0
  88. package/types/src/theme/global/scale.d.ts +0 -0
  89. package/types/src/theme/global/space.d.ts +0 -0
  90. package/types/src/theme/global/typography.d.ts +0 -0
  91. package/types/src/theme/index.d.ts +0 -0
  92. package/types/src/types.d.ts +0 -0
  93. package/types/src/utils/__tests__/scale.spec.d.ts +0 -0
  94. package/types/src/utils/helpers.d.ts +0 -0
  95. package/types/src/utils/scale.d.ts +0 -0
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "devToolsPort": 19002,
3
- "expoServerPort": null,
4
- "packagerPort": null,
3
+ "expoServerPort": 19000,
4
+ "packagerPort": 19000,
5
5
  "packagerPid": null,
6
6
  "expoServerNgrokUrl": null,
7
7
  "packagerNgrokUrl": null,
@@ -1,8 +1,8 @@
1
- @hero-design/rn:build: cache hit, replaying output 838d0cbb27d952b0
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 12.8s
8
- @hero-design/rn:build: $ tsc --noEmit false --emitDeclarationOnly
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
package/es/index.js CHANGED
@@ -1187,21 +1187,6 @@ function prefixer(element, index, children, callback) {
1187
1187
  }
1188
1188
  }
1189
1189
 
1190
- var weakMemoize = function weakMemoize(func) {
1191
- // $FlowFixMe flow doesn't include all non-primitive types as allowed for weakmaps
1192
- var cache = new WeakMap();
1193
- return function (arg) {
1194
- if (cache.has(arg)) {
1195
- // $FlowFixMe
1196
- return cache.get(arg);
1197
- }
1198
-
1199
- var ret = func(arg);
1200
- cache.set(arg, ret);
1201
- return ret;
1202
- };
1203
- };
1204
-
1205
1190
  var identifierWithPointTracking = function identifierWithPointTracking(begin, points, index) {
1206
1191
  var previous = 0;
1207
1192
  var character = 0;
@@ -1439,6 +1424,21 @@ function _extends$1() {
1439
1424
  return _extends$1.apply(this, arguments);
1440
1425
  }
1441
1426
 
1427
+ var weakMemoize = function weakMemoize(func) {
1428
+ // $FlowFixMe flow doesn't include all non-primitive types as allowed for weakmaps
1429
+ var cache = new WeakMap();
1430
+ return function (arg) {
1431
+ if (cache.has(arg)) {
1432
+ // $FlowFixMe
1433
+ return cache.get(arg);
1434
+ }
1435
+
1436
+ var ret = func(arg);
1437
+ cache.set(arg, ret);
1438
+ return ret;
1439
+ };
1440
+ };
1441
+
1442
1442
  var EmotionCacheContext = /* #__PURE__ */createContext( // we're doing this to avoid preconstruct's dead code elimination in this one case
1443
1443
  // because this module is primarily intended for the browser and node
1444
1444
  // but it's also required in react native and similar environments sometimes
@@ -1777,16 +1777,12 @@ var getBottomNavigationTheme = function getBottomNavigationTheme(theme) {
1777
1777
  };
1778
1778
  };
1779
1779
 
1780
- var getCardTheme = function getCardTheme(theme) {
1780
+ var getCardTheme = function getCardTheme() {
1781
1781
  var radii = {
1782
1782
  "default": 12
1783
1783
  };
1784
- var padding = {
1785
- "default": theme.space.small
1786
- };
1787
1784
  return {
1788
- radii: radii,
1789
- padding: padding
1785
+ radii: radii
1790
1786
  };
1791
1787
  };
1792
1788
 
@@ -1942,7 +1938,7 @@ var getTheme = function getTheme() {
1942
1938
  __hd__: {
1943
1939
  badge: getBadgeTheme(globalTheme),
1944
1940
  bottomNavigation: getBottomNavigationTheme(globalTheme),
1945
- card: getCardTheme(globalTheme),
1941
+ card: getCardTheme(),
1946
1942
  divider: getDividerTheme(globalTheme),
1947
1943
  icon: getIconTheme(globalTheme),
1948
1944
  tabs: getTabsTheme(globalTheme),
@@ -13802,7 +13798,6 @@ var StyledCard = index$1(View)(function (_ref) {
13802
13798
  var theme = _ref.theme;
13803
13799
  return {
13804
13800
  borderRadius: theme.__hd__.card.radii["default"],
13805
- padding: theme.__hd__.card.padding["default"],
13806
13801
  overflow: 'hidden'
13807
13802
  };
13808
13803
  });
package/lib/index.js CHANGED
@@ -1214,21 +1214,6 @@ function prefixer(element, index, children, callback) {
1214
1214
  }
1215
1215
  }
1216
1216
 
1217
- var weakMemoize = function weakMemoize(func) {
1218
- // $FlowFixMe flow doesn't include all non-primitive types as allowed for weakmaps
1219
- var cache = new WeakMap();
1220
- return function (arg) {
1221
- if (cache.has(arg)) {
1222
- // $FlowFixMe
1223
- return cache.get(arg);
1224
- }
1225
-
1226
- var ret = func(arg);
1227
- cache.set(arg, ret);
1228
- return ret;
1229
- };
1230
- };
1231
-
1232
1217
  var identifierWithPointTracking = function identifierWithPointTracking(begin, points, index) {
1233
1218
  var previous = 0;
1234
1219
  var character = 0;
@@ -1466,6 +1451,21 @@ function _extends$1() {
1466
1451
  return _extends$1.apply(this, arguments);
1467
1452
  }
1468
1453
 
1454
+ var weakMemoize = function weakMemoize(func) {
1455
+ // $FlowFixMe flow doesn't include all non-primitive types as allowed for weakmaps
1456
+ var cache = new WeakMap();
1457
+ return function (arg) {
1458
+ if (cache.has(arg)) {
1459
+ // $FlowFixMe
1460
+ return cache.get(arg);
1461
+ }
1462
+
1463
+ var ret = func(arg);
1464
+ cache.set(arg, ret);
1465
+ return ret;
1466
+ };
1467
+ };
1468
+
1469
1469
  var EmotionCacheContext = /* #__PURE__ */React.createContext( // we're doing this to avoid preconstruct's dead code elimination in this one case
1470
1470
  // because this module is primarily intended for the browser and node
1471
1471
  // but it's also required in react native and similar environments sometimes
@@ -1804,16 +1804,12 @@ var getBottomNavigationTheme = function getBottomNavigationTheme(theme) {
1804
1804
  };
1805
1805
  };
1806
1806
 
1807
- var getCardTheme = function getCardTheme(theme) {
1807
+ var getCardTheme = function getCardTheme() {
1808
1808
  var radii = {
1809
1809
  "default": 12
1810
1810
  };
1811
- var padding = {
1812
- "default": theme.space.small
1813
- };
1814
1811
  return {
1815
- radii: radii,
1816
- padding: padding
1812
+ radii: radii
1817
1813
  };
1818
1814
  };
1819
1815
 
@@ -1969,7 +1965,7 @@ var getTheme = function getTheme() {
1969
1965
  __hd__: {
1970
1966
  badge: getBadgeTheme(globalTheme),
1971
1967
  bottomNavigation: getBottomNavigationTheme(globalTheme),
1972
- card: getCardTheme(globalTheme),
1968
+ card: getCardTheme(),
1973
1969
  divider: getDividerTheme(globalTheme),
1974
1970
  icon: getIconTheme(globalTheme),
1975
1971
  tabs: getTabsTheme(globalTheme),
@@ -13829,7 +13825,6 @@ var StyledCard = index$1(reactNative.View)(function (_ref) {
13829
13825
  var theme = _ref.theme;
13830
13826
  return {
13831
13827
  borderRadius: theme.__hd__.card.radii["default"],
13832
- padding: theme.__hd__.card.padding["default"],
13833
13828
  overflow: 'hidden'
13834
13829
  };
13835
13830
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hero-design/rn",
3
- "version": "7.2.1",
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.2.1"
23
+ "@hero-design/colors": "7.2.2"
24
24
  },
25
25
  "peerDependencies": {
26
26
  "react": "17.0.2",
@@ -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
  ])}
@@ -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();
@@ -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;
@@ -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),
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1 @@
1
+ export {};
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -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 };
File without changes
File without changes
File without changes
@@ -0,0 +1 @@
1
+ export {};
File without changes
File without changes
File without changes
@@ -0,0 +1 @@
1
+ export {};
File without changes
File without changes
File without changes
File without changes
@@ -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;
File without changes
File without changes
File without changes
File without changes
@@ -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;
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes