@hero-design/rn 8.138.0 → 8.138.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @hero-design/rn
2
2
 
3
+ ## 8.138.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#5549](https://github.com/Thinkei/hero-design/pull/5549) [`59baec0`](https://github.com/Thinkei/hero-design/commit/59baec09b5e2e744e76b075c54d6613a65025b92) Thanks [@vinhphan-eh](https://github.com/vinhphan-eh)! - [List.Item] Fix childrenContainerTopMargin applied unconditionally when title is absent
8
+
3
9
  ## 8.138.0
4
10
 
5
11
  ### Minor Changes
package/es/index.js CHANGED
@@ -15770,13 +15770,15 @@ var StyledContentContainer = index$c(View)(function () {
15770
15770
  };
15771
15771
  });
15772
15772
  var StyledChildrenContainer = index$c(View)(function (_ref2) {
15773
- var theme = _ref2.theme;
15774
- return {
15773
+ var theme = _ref2.theme,
15774
+ themeHasTitle = _ref2.themeHasTitle;
15775
+ return _objectSpread2({
15775
15776
  flexDirection: 'column',
15776
15777
  justifyContent: 'flex-start',
15777
- alignItems: 'flex-start',
15778
+ alignItems: 'flex-start'
15779
+ }, themeHasTitle ? {
15778
15780
  marginTop: theme.__hd__.list.space.childrenContainerTopMargin
15779
- };
15781
+ } : {});
15780
15782
  });
15781
15783
  var StyledLeadingStatus = index$c(View)(function (_ref3) {
15782
15784
  var theme = _ref3.theme,
@@ -15850,7 +15852,9 @@ var ListItem = function ListItem(_ref) {
15850
15852
  icon: suffix,
15851
15853
  intent: disabled ? 'disabled-text' : 'primary',
15852
15854
  size: "small"
15853
- }) : suffix)), children && /*#__PURE__*/React__default.createElement(StyledChildrenContainer, null, children))));
15855
+ }) : suffix)), children && /*#__PURE__*/React__default.createElement(StyledChildrenContainer, {
15856
+ themeHasTitle: !!title
15857
+ }, children))));
15854
15858
  };
15855
15859
 
15856
15860
  var StyledPrefixContainer = index$c(View)(function (_ref) {
package/lib/index.js CHANGED
@@ -15799,13 +15799,15 @@ var StyledContentContainer = index$c(reactNative.View)(function () {
15799
15799
  };
15800
15800
  });
15801
15801
  var StyledChildrenContainer = index$c(reactNative.View)(function (_ref2) {
15802
- var theme = _ref2.theme;
15803
- return {
15802
+ var theme = _ref2.theme,
15803
+ themeHasTitle = _ref2.themeHasTitle;
15804
+ return _objectSpread2({
15804
15805
  flexDirection: 'column',
15805
15806
  justifyContent: 'flex-start',
15806
- alignItems: 'flex-start',
15807
+ alignItems: 'flex-start'
15808
+ }, themeHasTitle ? {
15807
15809
  marginTop: theme.__hd__.list.space.childrenContainerTopMargin
15808
- };
15810
+ } : {});
15809
15811
  });
15810
15812
  var StyledLeadingStatus = index$c(reactNative.View)(function (_ref3) {
15811
15813
  var theme = _ref3.theme,
@@ -15879,7 +15881,9 @@ var ListItem = function ListItem(_ref) {
15879
15881
  icon: suffix,
15880
15882
  intent: disabled ? 'disabled-text' : 'primary',
15881
15883
  size: "small"
15882
- }) : suffix)), children && /*#__PURE__*/React__namespace.default.createElement(StyledChildrenContainer, null, children))));
15884
+ }) : suffix)), children && /*#__PURE__*/React__namespace.default.createElement(StyledChildrenContainer, {
15885
+ themeHasTitle: !!title
15886
+ }, children))));
15883
15887
  };
15884
15888
 
15885
15889
  var StyledPrefixContainer = index$c(reactNative.View)(function (_ref) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hero-design/rn",
3
- "version": "8.138.0",
3
+ "version": "8.138.1",
4
4
  "license": "MIT",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -149,7 +149,9 @@ const ListItem = ({
149
149
  )}
150
150
  </View>
151
151
  {children && (
152
- <StyledChildrenContainer>{children}</StyledChildrenContainer>
152
+ <StyledChildrenContainer themeHasTitle={!!title}>
153
+ {children}
154
+ </StyledChildrenContainer>
153
155
  )}
154
156
  </StyledContentContainer>
155
157
  </>
@@ -44,12 +44,16 @@ const StyledContentContainer = styled(View)(() => ({
44
44
  flexGrow: 2,
45
45
  }));
46
46
 
47
- const StyledChildrenContainer = styled(View)(({ theme }) => ({
48
- flexDirection: 'column',
49
- justifyContent: 'flex-start',
50
- alignItems: 'flex-start',
51
- marginTop: theme.__hd__.list.space.childrenContainerTopMargin,
52
- }));
47
+ const StyledChildrenContainer = styled(View)<{ themeHasTitle: boolean }>(
48
+ ({ theme, themeHasTitle }) => ({
49
+ flexDirection: 'column',
50
+ justifyContent: 'flex-start',
51
+ alignItems: 'flex-start',
52
+ ...(themeHasTitle
53
+ ? { marginTop: theme.__hd__.list.space.childrenContainerTopMargin }
54
+ : {}),
55
+ })
56
+ );
53
57
 
54
58
  const StyledLeadingStatus = styled(View)<{
55
59
  themeLeadingStatusIntent: LeadingStatusIntent;
@@ -17,6 +17,8 @@ declare const StyledContentContainer: import("@emotion/native").StyledComponent<
17
17
  declare const StyledChildrenContainer: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
18
18
  theme?: import("@emotion/react").Theme;
19
19
  as?: React.ElementType;
20
+ } & {
21
+ themeHasTitle: boolean;
20
22
  }, {}, {
21
23
  ref?: import("react").Ref<View> | undefined;
22
24
  }>;