@spaced-out/ui-design-system 0.0.23-beta.0 → 0.0.23

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
@@ -2,6 +2,14 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [0.0.23](https://github.com/spaced-out/ui-design-system/compare/v0.0.23-beta.0...v0.0.23) (2023-02-14)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * import fixes for avataar ([1880ed7](https://github.com/spaced-out/ui-design-system/commit/1880ed760283e48347b68c220a7ba11a54dfcd4f))
11
+ * status support for avataar ([e877b88](https://github.com/spaced-out/ui-design-system/commit/e877b88c326262f9738da89457bd417d4f684002))
12
+
5
13
  ### [0.0.23-beta.0](https://github.com/spaced-out/ui-design-system/compare/v0.0.22...v0.0.23-beta.0) (2023-02-14)
6
14
 
7
15
 
@@ -9,6 +9,7 @@ var _Text = require("../../components/Text");
9
9
  var _color = require("../../styles/variables/_color");
10
10
  var _classify = _interopRequireDefault(require("../../utils/classify"));
11
11
  var _Icon = require("../Icon");
12
+ var _StatusIndicator = require("../StatusIndicator");
12
13
  var _AvatarModule = _interopRequireDefault(require("./Avatar.module.css"));
13
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
15
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -66,14 +67,20 @@ const AvatarConditionalContent = _ref2 => {
66
67
  iconName,
67
68
  size,
68
69
  iconType,
69
- color = 'blue'
70
+ color = 'blue',
71
+ status
70
72
  } = _ref2;
71
73
  return /*#__PURE__*/React.createElement("div", {
72
74
  className: _AvatarModule.default.innerContainer,
73
75
  style: {
74
76
  background: AVATAR_COLOR[color]
75
77
  }
76
- }, imageSrc ? /*#__PURE__*/React.createElement("img", {
78
+ }, !!status && /*#__PURE__*/React.createElement("div", {
79
+ className: (0, _classify.default)(_AvatarModule.default.statusIndicatorWrapper, _AvatarModule.default[size])
80
+ }, /*#__PURE__*/React.createElement(_StatusIndicator.StatusIndicator, {
81
+ status: status,
82
+ withBorder: true
83
+ })), imageSrc ? /*#__PURE__*/React.createElement("img", {
77
84
  src: imageSrc,
78
85
  alt: "Avatar",
79
86
  className: _AvatarModule.default.avatar
@@ -96,7 +103,8 @@ const Avatar = _ref3 => {
96
103
  iconName,
97
104
  iconType,
98
105
  color,
99
- ring = false
106
+ ring = false,
107
+ status
100
108
  } = _ref3;
101
109
  return /*#__PURE__*/React.createElement("div", {
102
110
  className: (0, _classify.default)(_AvatarModule.default.container, {
@@ -115,14 +123,16 @@ const Avatar = _ref3 => {
115
123
  iconName: iconName,
116
124
  iconType: iconType,
117
125
  color: color,
118
- size: size
126
+ size: size,
127
+ status: status
119
128
  }))) : /*#__PURE__*/React.createElement(AvatarConditionalContent, {
120
129
  imageSrc: imageSrc,
121
130
  text: text,
122
131
  iconName: iconName,
123
132
  iconType: iconType,
124
133
  color: color,
125
- size: size
134
+ size: size,
135
+ status: status
126
136
  }));
127
137
  };
128
138
  exports.Avatar = Avatar;
@@ -18,6 +18,8 @@ import {
18
18
  import classify from '../../utils/classify';
19
19
  import type {IconType} from '../Icon';
20
20
  import {Icon} from '../Icon';
21
+ import type {StatusSemanticType} from '../StatusIndicator';
22
+ import {StatusIndicator} from '../StatusIndicator';
21
23
 
22
24
  import css from './Avatar.module.css';
23
25
 
@@ -55,6 +57,7 @@ export type AvatarProps = {
55
57
  iconName?: string,
56
58
  iconType?: IconType,
57
59
  ring?: boolean,
60
+ status?: StatusSemanticType,
58
61
  };
59
62
 
60
63
  const getAvatarText = (text = '') => {
@@ -96,6 +99,7 @@ export type AvatarContentProps = {
96
99
  size: AvatarSize,
97
100
  color?: AvatarColorType,
98
101
  ring?: boolean,
102
+ status?: StatusSemanticType,
99
103
  };
100
104
 
101
105
  const AvatarConditionalContent = ({
@@ -105,8 +109,15 @@ const AvatarConditionalContent = ({
105
109
  size,
106
110
  iconType,
107
111
  color = 'blue',
112
+ status,
108
113
  }: AvatarContentProps) => (
109
114
  <div className={css.innerContainer} style={{background: AVATAR_COLOR[color]}}>
115
+ {!!status && (
116
+ <div className={classify(css.statusIndicatorWrapper, css[size])}>
117
+ <StatusIndicator status={status} withBorder />
118
+ </div>
119
+ )}
120
+
110
121
  {imageSrc ? (
111
122
  <img src={imageSrc} alt="Avatar" className={css.avatar}></img>
112
123
  ) : iconName ? (
@@ -127,6 +138,7 @@ export const Avatar = ({
127
138
  iconType,
128
139
  color,
129
140
  ring = false,
141
+ status,
130
142
  }: AvatarProps): React.Node => (
131
143
  <div
132
144
  className={classify(
@@ -150,6 +162,7 @@ export const Avatar = ({
150
162
  iconType={iconType}
151
163
  color={color}
152
164
  size={size}
165
+ status={status}
153
166
  />
154
167
  </div>
155
168
  </div>
@@ -161,6 +174,7 @@ export const Avatar = ({
161
174
  iconType={iconType}
162
175
  color={color}
163
176
  size={size}
177
+ status={status}
164
178
  />
165
179
  )}
166
180
  </div>
@@ -1,7 +1,7 @@
1
1
  @value (colorFillPrimary, colorBackgroundTertiary, colorInformation) from '../../styles/variables/_color.css';
2
2
  @value ( size34, size42, size60, sizeFluid) from '../../styles/variables/_size.css';
3
3
  @value (borderRadiusCircle, borderRadiusLarge, borderRadiusXLarge, borderWidthSecondary) from '../../styles/variables/_border.css';
4
- @value (spaceXXSmall, spaceXSmall) from '../../styles/variables/_space.css';
4
+ @value (spaceNone, spaceXXSmall, spaceXSmall) from '../../styles/variables/_space.css';
5
5
 
6
6
  .container {
7
7
  border-radius: borderRadiusCircle;
@@ -79,9 +79,29 @@
79
79
 
80
80
  .innerContainer {
81
81
  display: flex;
82
+ position: relative;
82
83
  border-radius: borderRadiusCircle;
83
84
  width: sizeFluid;
84
85
  height: sizeFluid;
85
86
  align-items: center;
86
87
  justify-content: center;
87
88
  }
89
+
90
+ .statusIndicatorWrapper {
91
+ position: absolute;
92
+ }
93
+
94
+ .statusIndicatorWrapper.large {
95
+ top: calc(spaceXXSmall / 2);
96
+ right: calc(spaceXXSmall / 2);
97
+ }
98
+
99
+ .statusIndicatorWrapper.medium {
100
+ top: spaceNone;
101
+ right: spaceNone;
102
+ }
103
+
104
+ .statusIndicatorWrapper.small {
105
+ top: calc((spaceXXSmall / 2) * -1);
106
+ right: calc((spaceXXSmall / 2) * -1);
107
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spaced-out/ui-design-system",
3
- "version": "0.0.23-beta.0",
3
+ "version": "0.0.23",
4
4
  "main": "index.js",
5
5
  "description": "Sense UI components library",
6
6
  "author": {