@react-fabric/core 1.0.0-beta.27 → 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.
@@ -99,8 +99,7 @@ var Avatar = function Avatar(_ref) {
99
99
  });
100
100
  }
101
101
  if (variant === "text") {
102
- var _name$match;
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 _name$match;
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.27",
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.27",
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": "02ddac152718fe86b6003f35ea5e1ef1581168f2"
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
- name.match(/(?=(\w).* (\w).*)|(?=(\w\w).*)/) ?? [];
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
@@ -115,6 +115,7 @@ export const AvatarGroup = ({
115
115
  {avatars}
116
116
  {!!diff && (
117
117
  <dfn
118
+ data-ref="avatarCount"
118
119
  className={classNames(
119
120
  classes.avatar,
120
121
  "select-none relative overflow-hidden inline-block box-content leading-none not-italic text-center",
@@ -134,7 +134,7 @@ export const Badge = ({
134
134
  ...rest,
135
135
  ref: innerRef,
136
136
  })}
137
- {(!!ping || label) && (
137
+ {(!!ping || (label ?? icon)) && (
138
138
  <div
139
139
  data-ref="badge"
140
140
  data-ping={ping}
@@ -154,6 +154,7 @@ export const Icon = ({
154
154
  <dfn
155
155
  {...rest}
156
156
  ref={ref}
157
+ data-ref="icon"
157
158
  role="presentation"
158
159
  className={classNames(
159
160
  classes.icon,