@react-fabric/core 1.0.0-beta.26 → 1.0.0-beta.28
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/cjs/components/avatar/Avatar.js +1 -2
- package/dist/cjs/components/avatar/AvatarGroup.js +1 -0
- package/dist/cjs/components/badge/Badge.js +1 -1
- package/dist/cjs/components/icon/Icon.js +1 -0
- package/dist/esm/components/avatar/Avatar.js +1 -2
- package/dist/esm/components/avatar/AvatarGroup.js +1 -0
- package/dist/esm/components/badge/Badge.js +1 -1
- package/dist/esm/components/icon/Icon.js +1 -0
- package/package.json +3 -3
- package/src/components/avatar/Avatar.tsx +3 -2
- package/src/components/avatar/AvatarGroup.tsx +1 -0
- package/src/components/badge/Badge.tsx +1 -1
- package/src/components/icon/Icon.tsx +1 -0
|
@@ -99,8 +99,7 @@ var Avatar = function Avatar(_ref) {
|
|
|
99
99
|
});
|
|
100
100
|
}
|
|
101
101
|
if (variant === "text") {
|
|
102
|
-
var
|
|
103
|
-
var _ref2 = (_name$match = name.match(/(?=(\w).* (\w).*)|(?=(\w\w).*)/)) !== null && _name$match !== void 0 ? _name$match : [],
|
|
102
|
+
var _ref2 = name.match(/(?=(\w).* (\w).*)|(?=(\w\w).*)/),
|
|
104
103
|
_ref3 = _slicedToArray(_ref2, 4),
|
|
105
104
|
first = _ref3[1],
|
|
106
105
|
second = _ref3[2],
|
|
@@ -52,6 +52,7 @@ var AvatarGroup = function AvatarGroup(_ref) {
|
|
|
52
52
|
className: classNames(Avatar_module.avatarGroup, className, "inline-flex flex-nowrap", !rounded && "rounded", rounded && "rounded-full"),
|
|
53
53
|
style: styles,
|
|
54
54
|
children: [avatars, !!diff && /*#__PURE__*/jsxRuntime.jsx("dfn", {
|
|
55
|
+
"data-ref": "avatarCount",
|
|
55
56
|
className: classNames(Avatar_module.avatar, "select-none relative overflow-hidden inline-block box-content leading-none not-italic text-center", Avatar_module.extra),
|
|
56
57
|
children: /*#__PURE__*/jsxRuntime.jsx("svg", {
|
|
57
58
|
children: /*#__PURE__*/jsxRuntime.jsx("text", {
|
|
@@ -63,7 +63,7 @@ var Badge = function Badge(_ref) {
|
|
|
63
63
|
className: classNames(forButton || inline ? "contents" : "relative", block ? "block" : "inline-block"),
|
|
64
64
|
children: [children && /*#__PURE__*/react.cloneElement(children, _objectSpread(_objectSpread({}, rest), {}, {
|
|
65
65
|
ref: innerRef
|
|
66
|
-
})), (!!ping || label) && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
66
|
+
})), (!!ping || (label !== null && label !== void 0 ? label : icon)) && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
67
67
|
"data-ref": "badge",
|
|
68
68
|
"data-ping": ping,
|
|
69
69
|
"data-placement": placement,
|
|
@@ -93,6 +93,7 @@ var Icon = function Icon(_ref) {
|
|
|
93
93
|
}, [icon, isSvg, viewBox]);
|
|
94
94
|
return /*#__PURE__*/jsxRuntime.jsx("dfn", _objectSpread(_objectSpread({}, rest), {}, {
|
|
95
95
|
ref: ref,
|
|
96
|
+
"data-ref": "icon",
|
|
96
97
|
role: "presentation",
|
|
97
98
|
className: classNames(Icon_module.icon, className, "select-none overflow-hidden inline-block box-content leading-none not-italic text-center", bg && getColor.getBgClass(bg), color && getColor.getColorClass(color), !rounded && "rounded", rounded && "rounded-full", animate && "animate-".concat(animate)),
|
|
98
99
|
onClick: onClick,
|
|
@@ -99,8 +99,7 @@ var Avatar = function Avatar(_ref) {
|
|
|
99
99
|
});
|
|
100
100
|
}
|
|
101
101
|
if (variant === "text") {
|
|
102
|
-
var
|
|
103
|
-
var _ref2 = (_name$match = name.match(/(?=(\w).* (\w).*)|(?=(\w\w).*)/)) !== null && _name$match !== void 0 ? _name$match : [],
|
|
102
|
+
var _ref2 = name.match(/(?=(\w).* (\w).*)|(?=(\w\w).*)/),
|
|
104
103
|
_ref3 = _slicedToArray(_ref2, 4),
|
|
105
104
|
first = _ref3[1],
|
|
106
105
|
second = _ref3[2],
|
|
@@ -52,6 +52,7 @@ var AvatarGroup = function AvatarGroup(_ref) {
|
|
|
52
52
|
className: classNames(classes.avatarGroup, className, "inline-flex flex-nowrap", !rounded && "rounded", rounded && "rounded-full"),
|
|
53
53
|
style: styles,
|
|
54
54
|
children: [avatars, !!diff && /*#__PURE__*/jsx("dfn", {
|
|
55
|
+
"data-ref": "avatarCount",
|
|
55
56
|
className: classNames(classes.avatar, "select-none relative overflow-hidden inline-block box-content leading-none not-italic text-center", classes.extra),
|
|
56
57
|
children: /*#__PURE__*/jsx("svg", {
|
|
57
58
|
children: /*#__PURE__*/jsx("text", {
|
|
@@ -63,7 +63,7 @@ var Badge = function Badge(_ref) {
|
|
|
63
63
|
className: classNames(forButton || inline ? "contents" : "relative", block ? "block" : "inline-block"),
|
|
64
64
|
children: [children && /*#__PURE__*/cloneElement(children, _objectSpread(_objectSpread({}, rest), {}, {
|
|
65
65
|
ref: innerRef
|
|
66
|
-
})), (!!ping || label) && /*#__PURE__*/jsxs("div", {
|
|
66
|
+
})), (!!ping || (label !== null && label !== void 0 ? label : icon)) && /*#__PURE__*/jsxs("div", {
|
|
67
67
|
"data-ref": "badge",
|
|
68
68
|
"data-ping": ping,
|
|
69
69
|
"data-placement": placement,
|
|
@@ -93,6 +93,7 @@ var Icon = function Icon(_ref) {
|
|
|
93
93
|
}, [icon, isSvg, viewBox]);
|
|
94
94
|
return /*#__PURE__*/jsx("dfn", _objectSpread(_objectSpread({}, rest), {}, {
|
|
95
95
|
ref: ref,
|
|
96
|
+
"data-ref": "icon",
|
|
96
97
|
role: "presentation",
|
|
97
98
|
className: classNames(classes.icon, className, "select-none overflow-hidden inline-block box-content leading-none not-italic text-center", bg && getBgClass(bg), color && getColorClass(color), !rounded && "rounded", rounded && "rounded-full", animate && "animate-".concat(animate)),
|
|
98
99
|
onClick: onClick,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-fabric/core",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.28",
|
|
4
4
|
"description": "RUF: Core package",
|
|
5
5
|
"author": "Adarsh Pastakia <adarshpastakia@outlook.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@floating-ui/react": "^0.26.24",
|
|
39
|
-
"@react-fabric/utilities": "^1.0.0-beta.
|
|
39
|
+
"@react-fabric/utilities": "^1.0.0-beta.28",
|
|
40
40
|
"@tailwindcss/container-queries": "^0.1.1",
|
|
41
41
|
"@tailwindcss/forms": "^0.5.7",
|
|
42
42
|
"@tailwindcss/typography": "^0.5.13",
|
|
@@ -56,5 +56,5 @@
|
|
|
56
56
|
"node": ">=18.12.0",
|
|
57
57
|
"npm": ">=8.19.0"
|
|
58
58
|
},
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "80f9d8a9f96dbd0e7a4287087e23996682bf2c0a"
|
|
60
60
|
}
|
|
@@ -160,8 +160,9 @@ export const Avatar = ({
|
|
|
160
160
|
);
|
|
161
161
|
}
|
|
162
162
|
if (variant === "text") {
|
|
163
|
-
const [, first, second, group] =
|
|
164
|
-
|
|
163
|
+
const [, first, second, group] = name.match(
|
|
164
|
+
/(?=(\w).* (\w).*)|(?=(\w\w).*)/,
|
|
165
|
+
) as string[];
|
|
165
166
|
return (
|
|
166
167
|
<svg role="img">
|
|
167
168
|
<text
|