@hero-design/rn-work-uikit 1.12.0 → 1.12.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,12 @@
1
1
  # @hero-design/rn-work-uikit
2
2
 
3
+ ## 1.12.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`bc9741dbf1dcb5a8176a14bfe85c19a70c50d283`](https://github.com/Thinkei/hero-design/commit/bc9741dbf1dcb5a8176a14bfe85c19a70c50d283), [`611662ff1d9a1ebe799a6c4a06935b51d6795da2`](https://github.com/Thinkei/hero-design/commit/611662ff1d9a1ebe799a6c4a06935b51d6795da2)]:
8
+ - @hero-design/rn@8.119.1
9
+
3
10
  ## 1.12.0
4
11
 
5
12
  ### 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.base
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: theme.__hd__.badge.colors[themeIntent],
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 : theme.__hd__.badge.colors[themeIntent]
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, {
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.base
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: theme.__hd__.badge.colors[themeIntent],
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 : theme.__hd__.badge.colors[themeIntent]
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, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hero-design/rn-work-uikit",
3
- "version": "1.12.0",
3
+ "version": "1.12.1",
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.119.0",
26
+ "@hero-design/rn": "8.119.1",
27
27
  "hero-editor": "^1.17.0"
28
28
  },
29
29
  "peerDependencies": {