musae 0.2.22 → 0.2.24
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.
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import type { AvatarProps } from "./types";
|
|
3
2
|
/**
|
|
4
3
|
* @description
|
|
5
4
|
* `Avatar`
|
|
6
5
|
*/
|
|
7
|
-
declare const Avatar: React.ForwardRefExoticComponent<
|
|
6
|
+
declare const Avatar: React.ForwardRefExoticComponent<import("../../types/element").ComponentProps & {
|
|
7
|
+
src?: string;
|
|
8
|
+
alt?: string;
|
|
9
|
+
size?: "small" | "medium" | "large";
|
|
10
|
+
shape?: "circular" | "squared";
|
|
11
|
+
} & React.RefAttributes<HTMLSpanElement>>;
|
|
8
12
|
export default Avatar;
|
|
@@ -11,7 +11,7 @@ import { typography } from '../theme/theme.js';
|
|
|
11
11
|
import { useImageLoader, clsx } from '@aiszlab/relax';
|
|
12
12
|
import { ComponentToken } from '../../utils/component-token.js';
|
|
13
13
|
|
|
14
|
-
var _excluded = ["src", "alt", "shape", "size"];
|
|
14
|
+
var _excluded = ["src", "alt", "shape", "size", "className", "style"];
|
|
15
15
|
var styles = {
|
|
16
16
|
avatar: function avatar(props) {
|
|
17
17
|
return [{
|
|
@@ -140,6 +140,8 @@ var Avatar = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
140
140
|
_shape = _ref$shape === void 0 ? "circular" : _ref$shape,
|
|
141
141
|
_ref$size = _ref.size,
|
|
142
142
|
_size = _ref$size === void 0 ? "medium" : _ref$size,
|
|
143
|
+
className = _ref.className,
|
|
144
|
+
style = _ref.style,
|
|
143
145
|
props$1 = _objectWithoutProperties(_ref, _excluded);
|
|
144
146
|
var theme = useTheme();
|
|
145
147
|
var group = useContext(Context);
|
|
@@ -160,8 +162,8 @@ var Avatar = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
160
162
|
image: props(styles.image, styles[size])
|
|
161
163
|
};
|
|
162
164
|
return /*#__PURE__*/React.createElement("span", _objectSpread(_objectSpread({}, props$1), {}, {
|
|
163
|
-
className: clsx(classNames[AvatarClassToken.Avatar], styled.avatar.className),
|
|
164
|
-
style: styled.avatar.style,
|
|
165
|
+
className: clsx(classNames[AvatarClassToken.Avatar], className, styled.avatar.className),
|
|
166
|
+
style: _objectSpread(_objectSpread({}, styled.avatar.style), style),
|
|
165
167
|
ref: ref
|
|
166
168
|
}), loadStatus === "loaded" ? (/*#__PURE__*/React.createElement("img", {
|
|
167
169
|
draggable: false,
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { ReactNode, RefAttributes } from "react";
|
|
2
|
+
import { ComponentProps } from "../../types/element";
|
|
2
3
|
type Size = "small" | "medium" | "large";
|
|
3
4
|
type Shape = "circular" | "squared";
|
|
4
5
|
/**
|
|
5
6
|
* @description
|
|
6
7
|
* avatar props
|
|
7
8
|
*/
|
|
8
|
-
export type AvatarProps = {
|
|
9
|
+
export type AvatarProps = ComponentProps & {
|
|
9
10
|
/**
|
|
10
11
|
* @description
|
|
11
12
|
* src
|