@hero-design/rn 8.121.0 → 8.122.0

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,15 @@
1
1
  # @hero-design/rn
2
2
 
3
+ ## 8.122.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#4992](https://github.com/Thinkei/hero-design/pull/4992) [`87bd2b334180c9908328a7cdd2e686694dae1d7d`](https://github.com/Thinkei/hero-design/commit/87bd2b334180c9908328a7cdd2e686694dae1d7d) Thanks [@haudao-eh](https://github.com/haudao-eh)! - [Avatar] Add `neutral` intent to Avatar. `neutral` is now the default intent, replacing `primary`.
8
+
9
+ **Note:** Any Avatar rendered without an explicit `intent` prop will now
10
+ display a teal-grey background instead of dark purple. Add `intent="primary"`
11
+ to preserve the previous appearance.
12
+
3
13
  ## 8.121.0
4
14
 
5
15
  ### Minor Changes
package/es/index.js CHANGED
@@ -5614,6 +5614,7 @@ var getAttachmentTheme = function getAttachmentTheme(theme) {
5614
5614
 
5615
5615
  var getAvatarTheme = function getAvatarTheme(theme) {
5616
5616
  var colors = {
5617
+ neutral: palette$8.maasstrichtBlueLight25,
5617
5618
  primary: theme.colors.primary,
5618
5619
  info: theme.colors.info,
5619
5620
  danger: theme.colors.error,
@@ -9873,7 +9874,7 @@ var Avatar = function Avatar(_ref) {
9873
9874
  _ref$size = _ref.size,
9874
9875
  size = _ref$size === void 0 ? 'small' : _ref$size,
9875
9876
  _ref$intent = _ref.intent,
9876
- intent = _ref$intent === void 0 ? 'primary' : _ref$intent;
9877
+ intent = _ref$intent === void 0 ? 'neutral' : _ref$intent;
9877
9878
  var _useState = useState(false),
9878
9879
  _useState2 = _slicedToArray(_useState, 2),
9879
9880
  hasImageError = _useState2[0],
package/lib/index.js CHANGED
@@ -5644,6 +5644,7 @@ var getAttachmentTheme = function getAttachmentTheme(theme) {
5644
5644
 
5645
5645
  var getAvatarTheme = function getAvatarTheme(theme) {
5646
5646
  var colors = {
5647
+ neutral: palette$8.maasstrichtBlueLight25,
5647
5648
  primary: theme.colors.primary,
5648
5649
  info: theme.colors.info,
5649
5650
  danger: theme.colors.error,
@@ -9903,7 +9904,7 @@ var Avatar = function Avatar(_ref) {
9903
9904
  _ref$size = _ref.size,
9904
9905
  size = _ref$size === void 0 ? 'small' : _ref$size,
9905
9906
  _ref$intent = _ref.intent,
9906
- intent = _ref$intent === void 0 ? 'primary' : _ref$intent;
9907
+ intent = _ref$intent === void 0 ? 'neutral' : _ref$intent;
9907
9908
  var _useState = React.useState(false),
9908
9909
  _useState2 = _slicedToArray(_useState, 2),
9909
9910
  hasImageError = _useState2[0],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hero-design/rn",
3
- "version": "8.121.0",
3
+ "version": "8.122.0",
4
4
  "license": "MIT",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -26,9 +26,9 @@ export interface AvatarProps extends ViewProps {
26
26
  */
27
27
  title?: string;
28
28
  /**
29
- * Intent of the Icon.
29
+ * Visual intent of the Avatar. Defaults to `'neutral'`.
30
30
  */
31
- intent?: 'primary' | 'info' | 'danger' | 'success' | 'warning';
31
+ intent?: 'neutral' | 'primary' | 'info' | 'danger' | 'success' | 'warning';
32
32
  /**
33
33
  * Size of the avatar.
34
34
  */
@@ -58,7 +58,7 @@ const Avatar = ({
58
58
  style,
59
59
  title,
60
60
  size = 'small',
61
- intent = 'primary',
61
+ intent = 'neutral',
62
62
  }: AvatarProps) => {
63
63
  const [hasImageError, setHasImageError] = useState(false);
64
64
 
@@ -12,7 +12,13 @@ type ThemeSize =
12
12
  | 'xxxlarge'
13
13
  | 'xxxxlarge'
14
14
  | 'xxxxxlarge';
15
- type ThemeIntent = 'primary' | 'info' | 'danger' | 'success' | 'warning';
15
+ type ThemeIntent =
16
+ | 'neutral'
17
+ | 'primary'
18
+ | 'info'
19
+ | 'danger'
20
+ | 'success'
21
+ | 'warning';
16
22
 
17
23
  const StyledWrapper = styled(TouchableOpacity)<{
18
24
  themeSize: ThemeSize;
@@ -1,7 +1,9 @@
1
+ import { mobileAvatarPalette } from '@hero-design/colors';
1
2
  import type { GlobalTheme } from '../global';
2
3
 
3
4
  const getAvatarTheme = (theme: GlobalTheme) => {
4
5
  const colors = {
6
+ neutral: mobileAvatarPalette.maasstrichtBlueLight25,
5
7
  primary: theme.colors.primary,
6
8
  info: theme.colors.info,
7
9
  danger: theme.colors.error,
@@ -14,9 +14,9 @@ export interface AvatarProps extends ViewProps {
14
14
  */
15
15
  title?: string;
16
16
  /**
17
- * Intent of the Icon.
17
+ * Visual intent of the Avatar. Defaults to `'neutral'`.
18
18
  */
19
- intent?: 'primary' | 'info' | 'danger' | 'success' | 'warning';
19
+ intent?: 'neutral' | 'primary' | 'info' | 'danger' | 'success' | 'warning';
20
20
  /**
21
21
  * Size of the avatar.
22
22
  */
@@ -1,7 +1,7 @@
1
1
  import { View, Image } from 'react-native';
2
2
  import type { TextProps } from '../Typography/Text';
3
3
  type ThemeSize = 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge' | 'xxxlarge' | 'xxxxlarge' | 'xxxxxlarge';
4
- type ThemeIntent = 'primary' | 'info' | 'danger' | 'success' | 'warning';
4
+ type ThemeIntent = 'neutral' | 'primary' | 'info' | 'danger' | 'success' | 'warning';
5
5
  declare const StyledWrapper: import("@emotion/native").StyledComponent<import("react-native").TouchableOpacityProps & import("react").RefAttributes<View> & {
6
6
  theme?: import("@emotion/react").Theme;
7
7
  as?: React.ElementType;
@@ -1,6 +1,7 @@
1
1
  import type { GlobalTheme } from '../global';
2
2
  declare const getAvatarTheme: (theme: GlobalTheme) => {
3
3
  colors: {
4
+ neutral: string;
4
5
  primary: string;
5
6
  info: string;
6
7
  danger: string;