@hero-design/rn-work-uikit 1.12.0 → 1.12.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.
- package/CHANGELOG.md +14 -0
- package/es/index.js +41 -10
- package/lib/index.js +41 -10
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @hero-design/rn-work-uikit
|
|
2
2
|
|
|
3
|
+
## 1.12.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`c3c35f0c8d2825138330aaae0ae383b624b8e067`](https://github.com/Thinkei/hero-design/commit/c3c35f0c8d2825138330aaae0ae383b624b8e067)]:
|
|
8
|
+
- @hero-design/rn@8.120.0
|
|
9
|
+
|
|
10
|
+
## 1.12.1
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Updated dependencies [[`bc9741dbf1dcb5a8176a14bfe85c19a70c50d283`](https://github.com/Thinkei/hero-design/commit/bc9741dbf1dcb5a8176a14bfe85c19a70c50d283), [`611662ff1d9a1ebe799a6c4a06935b51d6795da2`](https://github.com/Thinkei/hero-design/commit/611662ff1d9a1ebe799a6c4a06935b51d6795da2)]:
|
|
15
|
+
- @hero-design/rn@8.119.1
|
|
16
|
+
|
|
3
17
|
## 1.12.0
|
|
4
18
|
|
|
5
19
|
### Minor Changes
|
package/es/index.js
CHANGED
|
@@ -5913,7 +5913,23 @@ var getBadgeTheme = function getBadgeTheme(theme) {
|
|
|
5913
5913
|
archived: theme.colors.onArchivedSurface,
|
|
5914
5914
|
text: theme.colors.onDarkGlobalSurface,
|
|
5915
5915
|
border: theme.colors.defaultGlobalSurface,
|
|
5916
|
-
countText: theme.colors.onDarkGlobalSurface
|
|
5916
|
+
countText: theme.colors.onDarkGlobalSurface,
|
|
5917
|
+
stringBackground: {
|
|
5918
|
+
primary: theme.colors.highlightedSurface,
|
|
5919
|
+
danger: theme.colors.errorSurface,
|
|
5920
|
+
info: theme.colors.infoSurface,
|
|
5921
|
+
success: theme.colors.successSurface,
|
|
5922
|
+
warning: theme.colors.warningSurface,
|
|
5923
|
+
archived: theme.colors.archivedSurface
|
|
5924
|
+
},
|
|
5925
|
+
stringText: {
|
|
5926
|
+
primary: theme.colors.primary,
|
|
5927
|
+
danger: theme.colors.onErrorSurface,
|
|
5928
|
+
info: theme.colors.onInfoSurface,
|
|
5929
|
+
success: theme.colors.onSuccessSurface,
|
|
5930
|
+
warning: theme.colors.onWarningSurface,
|
|
5931
|
+
archived: theme.colors.onArchivedSurface
|
|
5932
|
+
}
|
|
5917
5933
|
};
|
|
5918
5934
|
var fonts = {
|
|
5919
5935
|
medium: theme.fonts.neutral.regular,
|
|
@@ -7249,7 +7265,7 @@ var getTagTheme = function getTagTheme(theme) {
|
|
|
7249
7265
|
verticalPadding: theme.space.xsmall
|
|
7250
7266
|
};
|
|
7251
7267
|
var radii = {
|
|
7252
|
-
"default": theme.radii.
|
|
7268
|
+
"default": theme.radii.large
|
|
7253
7269
|
};
|
|
7254
7270
|
return {
|
|
7255
7271
|
borderWidths: borderWidths,
|
|
@@ -16213,27 +16229,31 @@ var StyledView$1 = index$c(Animated.View)(function (_ref) {
|
|
|
16213
16229
|
themePadding = _ref.themePadding,
|
|
16214
16230
|
themeSize = _ref.themeSize,
|
|
16215
16231
|
themeVariant = _ref.themeVariant,
|
|
16232
|
+
themeIsStringBadge = _ref.themeIsStringBadge,
|
|
16216
16233
|
theme = _ref.theme;
|
|
16234
|
+
var backgroundColor = themeIsStringBadge ? theme.__hd__.badge.colors.stringBackground[themeIntent] : theme.__hd__.badge.colors[themeIntent];
|
|
16217
16235
|
return {
|
|
16218
16236
|
height: theme.__hd__.badge.sizes[themeSize].height,
|
|
16219
16237
|
minWidth: theme.__hd__.badge.sizes[themeSize].minWidth,
|
|
16220
16238
|
alignItems: 'center',
|
|
16221
16239
|
justifyContent: 'center',
|
|
16222
|
-
backgroundColor:
|
|
16240
|
+
backgroundColor: backgroundColor,
|
|
16223
16241
|
borderRadius: theme.radii.rounded,
|
|
16224
16242
|
paddingHorizontal: themePadding === 'wideContent' ? theme.__hd__.badge.space[themeSize].horizontalPadding : undefined,
|
|
16225
16243
|
borderWidth: theme.__hd__.badge.borderWidths["default"],
|
|
16226
|
-
borderColor: themeVariant === 'outlined' ? theme.__hd__.badge.colors.border :
|
|
16244
|
+
borderColor: themeVariant === 'outlined' ? theme.__hd__.badge.colors.border : backgroundColor
|
|
16227
16245
|
};
|
|
16228
16246
|
});
|
|
16229
16247
|
var StyledText$2 = index$c(Typography.Caption)(function (_ref2) {
|
|
16230
16248
|
var theme = _ref2.theme,
|
|
16231
|
-
themeSize = _ref2.themeSize
|
|
16249
|
+
themeSize = _ref2.themeSize,
|
|
16250
|
+
themeIntent = _ref2.themeIntent,
|
|
16251
|
+
themeIsStringBadge = _ref2.themeIsStringBadge;
|
|
16232
16252
|
return {
|
|
16233
16253
|
fontSize: theme.__hd__.badge.fontSizes[themeSize],
|
|
16234
16254
|
lineHeight: theme.__hd__.badge.lineHeights[themeSize],
|
|
16235
16255
|
fontFamily: theme.__hd__.badge.fonts[themeSize],
|
|
16236
|
-
color: theme.__hd__.badge.colors.text,
|
|
16256
|
+
color: themeIsStringBadge ? theme.__hd__.badge.colors.stringText[themeIntent] : theme.__hd__.badge.colors.text,
|
|
16237
16257
|
includeFontPadding: false,
|
|
16238
16258
|
textAlignVertical: 'center',
|
|
16239
16259
|
textAlign: 'center'
|
|
@@ -16391,6 +16411,7 @@ var Badge$1 = function Badge(_ref) {
|
|
|
16391
16411
|
}).start();
|
|
16392
16412
|
}, [visible, opacity]);
|
|
16393
16413
|
var isIconBadge = !!icon;
|
|
16414
|
+
var isStringBadge = !isIconBadge && typeof originalContent === 'string';
|
|
16394
16415
|
var content = useMemo(function () {
|
|
16395
16416
|
if (isIconBadge) {
|
|
16396
16417
|
return '';
|
|
@@ -16402,6 +16423,7 @@ var Badge$1 = function Badge(_ref) {
|
|
|
16402
16423
|
themePadding: getPaddingState(content),
|
|
16403
16424
|
themeSize: size,
|
|
16404
16425
|
themeVariant: variant,
|
|
16426
|
+
themeIsStringBadge: isStringBadge,
|
|
16405
16427
|
style: [{
|
|
16406
16428
|
opacity: opacity,
|
|
16407
16429
|
transform: [{
|
|
@@ -16417,7 +16439,9 @@ var Badge$1 = function Badge(_ref) {
|
|
|
16417
16439
|
themeSize: size,
|
|
16418
16440
|
intent: "text-inverted"
|
|
16419
16441
|
}) : /*#__PURE__*/React__default.createElement(StyledText$2, {
|
|
16420
|
-
themeSize: size
|
|
16442
|
+
themeSize: size,
|
|
16443
|
+
themeIntent: intent,
|
|
16444
|
+
themeIsStringBadge: isStringBadge
|
|
16421
16445
|
}, content));
|
|
16422
16446
|
};
|
|
16423
16447
|
var Badge = Object.assign(Badge$1, {
|
|
@@ -16543,10 +16567,12 @@ var BottomNavigation = function BottomNavigation(_ref) {
|
|
|
16543
16567
|
})), /*#__PURE__*/React__default.createElement(BottomBarWrapper, {
|
|
16544
16568
|
themeInsets: insets
|
|
16545
16569
|
}, /*#__PURE__*/React__default.createElement(BottomBar, null, tabs.map(function (tab) {
|
|
16570
|
+
var _badge$count, _badge$testID;
|
|
16546
16571
|
var key = tab.key,
|
|
16547
16572
|
icon = tab.icon,
|
|
16548
16573
|
title = tab.title,
|
|
16549
|
-
testID = tab.testID
|
|
16574
|
+
testID = tab.testID,
|
|
16575
|
+
badge = tab.badge;
|
|
16550
16576
|
var active = selectedTabKey === key;
|
|
16551
16577
|
var inactiveIcon = getInactiveIcon(icon);
|
|
16552
16578
|
return /*#__PURE__*/React__default.createElement(TouchableWithoutFeedback, {
|
|
@@ -16555,11 +16581,16 @@ var BottomNavigation = function BottomNavigation(_ref) {
|
|
|
16555
16581
|
return onTabPress(key);
|
|
16556
16582
|
},
|
|
16557
16583
|
testID: testID
|
|
16558
|
-
}, /*#__PURE__*/React__default.createElement(BottomBarItem, null, /*#__PURE__*/React__default.createElement(
|
|
16584
|
+
}, /*#__PURE__*/React__default.createElement(BottomBarItem, null, /*#__PURE__*/React__default.createElement(Status, {
|
|
16585
|
+
content: (_badge$count = badge === null || badge === void 0 ? void 0 : badge.count) !== null && _badge$count !== void 0 ? _badge$count : 0,
|
|
16586
|
+
visible: !!badge && badge.count > 0,
|
|
16587
|
+
max: badge === null || badge === void 0 ? void 0 : badge.max,
|
|
16588
|
+
testID: (_badge$testID = badge === null || badge === void 0 ? void 0 : badge.testID) !== null && _badge$testID !== void 0 ? _badge$testID : "bottom-nav-badge-".concat(key)
|
|
16589
|
+
}, /*#__PURE__*/React__default.createElement(Icon, {
|
|
16559
16590
|
icon: active ? icon : inactiveIcon,
|
|
16560
16591
|
intent: active ? 'primary' : 'muted',
|
|
16561
16592
|
testID: "hero-icon-".concat(icon)
|
|
16562
|
-
}), !!title && /*#__PURE__*/React__default.createElement(StyledBottomBarText, {
|
|
16593
|
+
})), !!title && /*#__PURE__*/React__default.createElement(StyledBottomBarText, {
|
|
16563
16594
|
intent: active ? 'primary' : 'muted',
|
|
16564
16595
|
numberOfLines: 1
|
|
16565
16596
|
}, title)));
|
package/lib/index.js
CHANGED
|
@@ -5942,7 +5942,23 @@ var getBadgeTheme = function getBadgeTheme(theme) {
|
|
|
5942
5942
|
archived: theme.colors.onArchivedSurface,
|
|
5943
5943
|
text: theme.colors.onDarkGlobalSurface,
|
|
5944
5944
|
border: theme.colors.defaultGlobalSurface,
|
|
5945
|
-
countText: theme.colors.onDarkGlobalSurface
|
|
5945
|
+
countText: theme.colors.onDarkGlobalSurface,
|
|
5946
|
+
stringBackground: {
|
|
5947
|
+
primary: theme.colors.highlightedSurface,
|
|
5948
|
+
danger: theme.colors.errorSurface,
|
|
5949
|
+
info: theme.colors.infoSurface,
|
|
5950
|
+
success: theme.colors.successSurface,
|
|
5951
|
+
warning: theme.colors.warningSurface,
|
|
5952
|
+
archived: theme.colors.archivedSurface
|
|
5953
|
+
},
|
|
5954
|
+
stringText: {
|
|
5955
|
+
primary: theme.colors.primary,
|
|
5956
|
+
danger: theme.colors.onErrorSurface,
|
|
5957
|
+
info: theme.colors.onInfoSurface,
|
|
5958
|
+
success: theme.colors.onSuccessSurface,
|
|
5959
|
+
warning: theme.colors.onWarningSurface,
|
|
5960
|
+
archived: theme.colors.onArchivedSurface
|
|
5961
|
+
}
|
|
5946
5962
|
};
|
|
5947
5963
|
var fonts = {
|
|
5948
5964
|
medium: theme.fonts.neutral.regular,
|
|
@@ -7278,7 +7294,7 @@ var getTagTheme = function getTagTheme(theme) {
|
|
|
7278
7294
|
verticalPadding: theme.space.xsmall
|
|
7279
7295
|
};
|
|
7280
7296
|
var radii = {
|
|
7281
|
-
"default": theme.radii.
|
|
7297
|
+
"default": theme.radii.large
|
|
7282
7298
|
};
|
|
7283
7299
|
return {
|
|
7284
7300
|
borderWidths: borderWidths,
|
|
@@ -16242,27 +16258,31 @@ var StyledView$1 = index$c(reactNative.Animated.View)(function (_ref) {
|
|
|
16242
16258
|
themePadding = _ref.themePadding,
|
|
16243
16259
|
themeSize = _ref.themeSize,
|
|
16244
16260
|
themeVariant = _ref.themeVariant,
|
|
16261
|
+
themeIsStringBadge = _ref.themeIsStringBadge,
|
|
16245
16262
|
theme = _ref.theme;
|
|
16263
|
+
var backgroundColor = themeIsStringBadge ? theme.__hd__.badge.colors.stringBackground[themeIntent] : theme.__hd__.badge.colors[themeIntent];
|
|
16246
16264
|
return {
|
|
16247
16265
|
height: theme.__hd__.badge.sizes[themeSize].height,
|
|
16248
16266
|
minWidth: theme.__hd__.badge.sizes[themeSize].minWidth,
|
|
16249
16267
|
alignItems: 'center',
|
|
16250
16268
|
justifyContent: 'center',
|
|
16251
|
-
backgroundColor:
|
|
16269
|
+
backgroundColor: backgroundColor,
|
|
16252
16270
|
borderRadius: theme.radii.rounded,
|
|
16253
16271
|
paddingHorizontal: themePadding === 'wideContent' ? theme.__hd__.badge.space[themeSize].horizontalPadding : undefined,
|
|
16254
16272
|
borderWidth: theme.__hd__.badge.borderWidths["default"],
|
|
16255
|
-
borderColor: themeVariant === 'outlined' ? theme.__hd__.badge.colors.border :
|
|
16273
|
+
borderColor: themeVariant === 'outlined' ? theme.__hd__.badge.colors.border : backgroundColor
|
|
16256
16274
|
};
|
|
16257
16275
|
});
|
|
16258
16276
|
var StyledText$2 = index$c(Typography.Caption)(function (_ref2) {
|
|
16259
16277
|
var theme = _ref2.theme,
|
|
16260
|
-
themeSize = _ref2.themeSize
|
|
16278
|
+
themeSize = _ref2.themeSize,
|
|
16279
|
+
themeIntent = _ref2.themeIntent,
|
|
16280
|
+
themeIsStringBadge = _ref2.themeIsStringBadge;
|
|
16261
16281
|
return {
|
|
16262
16282
|
fontSize: theme.__hd__.badge.fontSizes[themeSize],
|
|
16263
16283
|
lineHeight: theme.__hd__.badge.lineHeights[themeSize],
|
|
16264
16284
|
fontFamily: theme.__hd__.badge.fonts[themeSize],
|
|
16265
|
-
color: theme.__hd__.badge.colors.text,
|
|
16285
|
+
color: themeIsStringBadge ? theme.__hd__.badge.colors.stringText[themeIntent] : theme.__hd__.badge.colors.text,
|
|
16266
16286
|
includeFontPadding: false,
|
|
16267
16287
|
textAlignVertical: 'center',
|
|
16268
16288
|
textAlign: 'center'
|
|
@@ -16420,6 +16440,7 @@ var Badge = function Badge(_ref) {
|
|
|
16420
16440
|
}).start();
|
|
16421
16441
|
}, [visible, opacity]);
|
|
16422
16442
|
var isIconBadge = !!icon;
|
|
16443
|
+
var isStringBadge = !isIconBadge && typeof originalContent === 'string';
|
|
16423
16444
|
var content = React.useMemo(function () {
|
|
16424
16445
|
if (isIconBadge) {
|
|
16425
16446
|
return '';
|
|
@@ -16431,6 +16452,7 @@ var Badge = function Badge(_ref) {
|
|
|
16431
16452
|
themePadding: getPaddingState(content),
|
|
16432
16453
|
themeSize: size,
|
|
16433
16454
|
themeVariant: variant,
|
|
16455
|
+
themeIsStringBadge: isStringBadge,
|
|
16434
16456
|
style: [{
|
|
16435
16457
|
opacity: opacity,
|
|
16436
16458
|
transform: [{
|
|
@@ -16446,7 +16468,9 @@ var Badge = function Badge(_ref) {
|
|
|
16446
16468
|
themeSize: size,
|
|
16447
16469
|
intent: "text-inverted"
|
|
16448
16470
|
}) : /*#__PURE__*/React__namespace.default.createElement(StyledText$2, {
|
|
16449
|
-
themeSize: size
|
|
16471
|
+
themeSize: size,
|
|
16472
|
+
themeIntent: intent,
|
|
16473
|
+
themeIsStringBadge: isStringBadge
|
|
16450
16474
|
}, content));
|
|
16451
16475
|
};
|
|
16452
16476
|
var Badge$1 = Object.assign(Badge, {
|
|
@@ -16572,10 +16596,12 @@ var BottomNavigation = function BottomNavigation(_ref) {
|
|
|
16572
16596
|
})), /*#__PURE__*/React__namespace.default.createElement(BottomBarWrapper, {
|
|
16573
16597
|
themeInsets: insets
|
|
16574
16598
|
}, /*#__PURE__*/React__namespace.default.createElement(BottomBar, null, tabs.map(function (tab) {
|
|
16599
|
+
var _badge$count, _badge$testID;
|
|
16575
16600
|
var key = tab.key,
|
|
16576
16601
|
icon = tab.icon,
|
|
16577
16602
|
title = tab.title,
|
|
16578
|
-
testID = tab.testID
|
|
16603
|
+
testID = tab.testID,
|
|
16604
|
+
badge = tab.badge;
|
|
16579
16605
|
var active = selectedTabKey === key;
|
|
16580
16606
|
var inactiveIcon = getInactiveIcon(icon);
|
|
16581
16607
|
return /*#__PURE__*/React__namespace.default.createElement(reactNative.TouchableWithoutFeedback, {
|
|
@@ -16584,11 +16610,16 @@ var BottomNavigation = function BottomNavigation(_ref) {
|
|
|
16584
16610
|
return onTabPress(key);
|
|
16585
16611
|
},
|
|
16586
16612
|
testID: testID
|
|
16587
|
-
}, /*#__PURE__*/React__namespace.default.createElement(BottomBarItem, null, /*#__PURE__*/React__namespace.default.createElement(
|
|
16613
|
+
}, /*#__PURE__*/React__namespace.default.createElement(BottomBarItem, null, /*#__PURE__*/React__namespace.default.createElement(Status, {
|
|
16614
|
+
content: (_badge$count = badge === null || badge === void 0 ? void 0 : badge.count) !== null && _badge$count !== void 0 ? _badge$count : 0,
|
|
16615
|
+
visible: !!badge && badge.count > 0,
|
|
16616
|
+
max: badge === null || badge === void 0 ? void 0 : badge.max,
|
|
16617
|
+
testID: (_badge$testID = badge === null || badge === void 0 ? void 0 : badge.testID) !== null && _badge$testID !== void 0 ? _badge$testID : "bottom-nav-badge-".concat(key)
|
|
16618
|
+
}, /*#__PURE__*/React__namespace.default.createElement(Icon, {
|
|
16588
16619
|
icon: active ? icon : inactiveIcon,
|
|
16589
16620
|
intent: active ? 'primary' : 'muted',
|
|
16590
16621
|
testID: "hero-icon-".concat(icon)
|
|
16591
|
-
}), !!title && /*#__PURE__*/React__namespace.default.createElement(StyledBottomBarText, {
|
|
16622
|
+
})), !!title && /*#__PURE__*/React__namespace.default.createElement(StyledBottomBarText, {
|
|
16592
16623
|
intent: active ? 'primary' : 'muted',
|
|
16593
16624
|
numberOfLines: 1
|
|
16594
16625
|
}, title)));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hero-design/rn-work-uikit",
|
|
3
|
-
"version": "1.12.
|
|
3
|
+
"version": "1.12.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@emotion/native": "^11.9.3",
|
|
25
25
|
"@emotion/react": "^11.9.3",
|
|
26
|
-
"@hero-design/rn": "8.
|
|
26
|
+
"@hero-design/rn": "8.120.0",
|
|
27
27
|
"hero-editor": "^1.17.0"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|