@zendeskgarden/react-avatars 8.49.2 → 8.50.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/dist/index.cjs.js CHANGED
@@ -75,10 +75,13 @@ function _objectWithoutProperties(source, excluded) {
75
75
  return target;
76
76
  }
77
77
 
78
+ var SIZE = ['extraextrasmall', 'extrasmall', 'small', 'medium', 'large'];
79
+ var STATUS = ['available', 'away'];
80
+
78
81
  var COMPONENT_ID$1 = 'avatars.text';
79
82
  var StyledText = styled__default["default"].span.attrs({
80
83
  'data-garden-id': COMPONENT_ID$1,
81
- 'data-garden-version': '8.49.2'
84
+ 'data-garden-version': '8.50.0'
82
85
  }).withConfig({
83
86
  displayName: "StyledText",
84
87
  componentId: "sc-1a6hivh-0"
@@ -205,7 +208,7 @@ var sizeStyles = function sizeStyles(props) {
205
208
  };
206
209
  var StyledAvatar = styled__default["default"].figure.attrs({
207
210
  'data-garden-id': COMPONENT_ID,
208
- 'data-garden-version': '8.49.2'
211
+ 'data-garden-version': '8.50.0'
209
212
  }).withConfig({
210
213
  displayName: "StyledAvatar",
211
214
  componentId: "sc-608m04-0"
@@ -263,8 +266,8 @@ AvatarComponent.propTypes = {
263
266
  surfaceColor: PropTypes__default["default"].string,
264
267
  isSystem: PropTypes__default["default"].bool,
265
268
  badge: PropTypes__default["default"].oneOfType([PropTypes__default["default"].string, PropTypes__default["default"].number]),
266
- size: PropTypes__default["default"].oneOf(['extraextrasmall', 'extrasmall', 'small', 'medium', 'large']),
267
- status: PropTypes__default["default"].oneOf(['available', 'away'])
269
+ size: PropTypes__default["default"].oneOf(SIZE),
270
+ status: PropTypes__default["default"].oneOf(STATUS)
268
271
  };
269
272
  AvatarComponent.defaultProps = {
270
273
  size: 'medium'
package/dist/index.esm.js CHANGED
@@ -65,10 +65,13 @@ function _objectWithoutProperties(source, excluded) {
65
65
  return target;
66
66
  }
67
67
 
68
+ var SIZE = ['extraextrasmall', 'extrasmall', 'small', 'medium', 'large'];
69
+ var STATUS = ['available', 'away'];
70
+
68
71
  var COMPONENT_ID$1 = 'avatars.text';
69
72
  var StyledText = styled.span.attrs({
70
73
  'data-garden-id': COMPONENT_ID$1,
71
- 'data-garden-version': '8.49.2'
74
+ 'data-garden-version': '8.50.0'
72
75
  }).withConfig({
73
76
  displayName: "StyledText",
74
77
  componentId: "sc-1a6hivh-0"
@@ -195,7 +198,7 @@ var sizeStyles = function sizeStyles(props) {
195
198
  };
196
199
  var StyledAvatar = styled.figure.attrs({
197
200
  'data-garden-id': COMPONENT_ID,
198
- 'data-garden-version': '8.49.2'
201
+ 'data-garden-version': '8.50.0'
199
202
  }).withConfig({
200
203
  displayName: "StyledAvatar",
201
204
  componentId: "sc-608m04-0"
@@ -253,8 +256,8 @@ AvatarComponent.propTypes = {
253
256
  surfaceColor: PropTypes.string,
254
257
  isSystem: PropTypes.bool,
255
258
  badge: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
256
- size: PropTypes.oneOf(['extraextrasmall', 'extrasmall', 'small', 'medium', 'large']),
257
- status: PropTypes.oneOf(['available', 'away'])
259
+ size: PropTypes.oneOf(SIZE),
260
+ status: PropTypes.oneOf(STATUS)
258
261
  };
259
262
  AvatarComponent.defaultProps = {
260
263
  size: 'medium'
@@ -4,24 +4,9 @@
4
4
  * Use of this source code is governed under the Apache License, Version 2.0
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
- import React, { HTMLAttributes } from 'react';
7
+ import React from 'react';
8
+ import { IAvatarProps } from '../types';
8
9
  import { Text } from './components/Text';
9
- export interface IAvatarProps extends HTMLAttributes<HTMLElement> {
10
- /** Sets the avatar background color */
11
- backgroundColor?: string;
12
- /** Sets the color for child SVG or `Avatar.Text` components */
13
- foregroundColor?: string;
14
- /** Provides surface color for an avatar placed on a non-white background */
15
- surfaceColor?: string;
16
- /** Applies system styling for representing objects, brands, or products */
17
- isSystem?: boolean;
18
- /** Specifies the avatar size */
19
- size?: 'extraextrasmall' | 'extrasmall' | 'small' | 'medium' | 'large';
20
- /** Applies status styling */
21
- status?: 'available' | 'away';
22
- /** Sets the badge text and applies active styling */
23
- badge?: string | number;
24
- }
25
10
  /**
26
11
  * @extends HTMLAttributes<HTMLElement>
27
12
  */
@@ -5,4 +5,4 @@
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
7
  export { Avatar } from './elements/Avatar';
8
- export type { IAvatarProps } from './elements/Avatar';
8
+ export type { IAvatarProps } from './types';
@@ -5,13 +5,9 @@
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
7
  import { DefaultTheme } from 'styled-components';
8
- export interface IStyledAvatarProps {
9
- backgroundColor?: string;
10
- foregroundColor?: string;
11
- surfaceColor?: string;
12
- isSystem?: boolean;
13
- size?: 'extraextrasmall' | 'extrasmall' | 'small' | 'medium' | 'large';
14
- status?: 'available' | 'active' | 'away';
8
+ import { IAvatarProps } from '../types';
9
+ export interface IStyledAvatarProps extends Pick<IAvatarProps, 'backgroundColor' | 'foregroundColor' | 'surfaceColor' | 'isSystem' | 'size'> {
10
+ status?: IAvatarProps['status'] | 'active';
15
11
  }
16
12
  /**
17
13
  * Accepts all `<figure>` props
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ import { HTMLAttributes } from 'react';
8
+ export declare const SIZE: readonly ["extraextrasmall", "extrasmall", "small", "medium", "large"];
9
+ export declare const STATUS: readonly ["available", "away"];
10
+ export interface IAvatarProps extends HTMLAttributes<HTMLElement> {
11
+ /** Sets the avatar background color */
12
+ backgroundColor?: string;
13
+ /** Sets the color for child SVG or `Avatar.Text` components */
14
+ foregroundColor?: string;
15
+ /** Provides surface color for an avatar placed on a non-white background */
16
+ surfaceColor?: string;
17
+ /** Applies system styling for representing objects, brands, or products */
18
+ isSystem?: boolean;
19
+ /** Specifies the avatar size */
20
+ size?: typeof SIZE[number];
21
+ /** Applies status styling */
22
+ status?: typeof STATUS[number];
23
+ /** Sets the badge text and applies active styling */
24
+ badge?: string | number;
25
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zendeskgarden/react-avatars",
3
- "version": "8.49.2",
3
+ "version": "8.50.0",
4
4
  "description": "Components relating to avatars in the Garden Design System",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Zendesk Garden <garden@zendesk.com>",
@@ -31,7 +31,7 @@
31
31
  "styled-components": "^4.2.0 || ^5.0.0"
32
32
  },
33
33
  "devDependencies": {
34
- "@zendeskgarden/react-theming": "^8.49.2"
34
+ "@zendeskgarden/react-theming": "^8.50.0"
35
35
  },
36
36
  "keywords": [
37
37
  "components",
@@ -43,5 +43,5 @@
43
43
  "access": "public"
44
44
  },
45
45
  "zendeskgarden:src": "src/index.ts",
46
- "gitHead": "fd7769285a2f4bc1169c63f4db57a85a6e793027"
46
+ "gitHead": "d5b66e1980faf0fd40818c9e74801dfa1c3550a0"
47
47
  }