@react-fabric/core 1.0.0-beta.28 → 1.0.0-beta.29

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.
Files changed (32) hide show
  1. package/dist/cjs/components/animations/Animations.js +3 -3
  2. package/dist/cjs/components/breadcrumbs/Breadcrumbs.js +3 -0
  3. package/dist/cjs/components/button/ConfirmButton.js +3 -0
  4. package/dist/cjs/components/callout/Callout.js +5 -1
  5. package/dist/cjs/components/chip/Chip.js +5 -1
  6. package/dist/cjs/components/dropdown/Dropdown.js +1 -1
  7. package/dist/cjs/components/icon/Icon.js +4 -4
  8. package/dist/cjs/components/navigator/Navigator.js +3 -2
  9. package/dist/cjs/components/panel/Panel.js +2 -2
  10. package/dist/cjs/core/aside/Aside.js +1 -2
  11. package/dist/esm/components/animations/Animations.js +3 -3
  12. package/dist/esm/components/breadcrumbs/Breadcrumbs.js +3 -0
  13. package/dist/esm/components/button/ConfirmButton.js +3 -0
  14. package/dist/esm/components/callout/Callout.js +5 -1
  15. package/dist/esm/components/chip/Chip.js +5 -1
  16. package/dist/esm/components/dropdown/Dropdown.js +1 -1
  17. package/dist/esm/components/icon/Icon.js +4 -4
  18. package/dist/esm/components/navigator/Navigator.js +3 -2
  19. package/dist/esm/components/panel/Panel.js +2 -2
  20. package/dist/esm/core/aside/Aside.js +1 -2
  21. package/dist/types/components/chip/Chip.d.ts +1 -1
  22. package/package.json +3 -3
  23. package/src/components/animations/Animations.tsx +3 -3
  24. package/src/components/breadcrumbs/Breadcrumbs.tsx +7 -2
  25. package/src/components/button/ConfirmButton.tsx +5 -1
  26. package/src/components/callout/Callout.tsx +12 -3
  27. package/src/components/chip/Chip.tsx +9 -3
  28. package/src/components/dropdown/Dropdown.tsx +1 -1
  29. package/src/components/icon/Icon.tsx +3 -3
  30. package/src/components/navigator/Navigator.tsx +3 -2
  31. package/src/components/panel/Panel.tsx +2 -2
  32. package/src/core/aside/Aside.tsx +1 -2
@@ -82,7 +82,7 @@ var AnimationSpinner = function AnimationSpinner(_ref3) {
82
82
  size = _ref3$size === void 0 ? "2rem" : _ref3$size;
83
83
  return /*#__PURE__*/jsxRuntime.jsx("div", {
84
84
  className: classNames("absolute inset-0 z-10 flex justify-center items-center cursor-wait"),
85
- "data-testid": "spinner",
85
+ "data-ref": "spinner",
86
86
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
87
87
  className: classNames("outline outline-tint-500/20 p-4 bg-base/50 backdrop-blur-sm rounded"),
88
88
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
@@ -97,7 +97,7 @@ var AnimationSpinner = function AnimationSpinner(_ref3) {
97
97
  var Loading = function Loading() {
98
98
  return /*#__PURE__*/jsxRuntime.jsx("div", {
99
99
  className: classNames(Animations_module.loader, "area-[loader] relative overflow-x-clip"),
100
- "data-testid": "loading",
100
+ "data-ref": "loading",
101
101
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
102
102
  className: "absolute z-10 py-px inset-x-0 top-0 after:h-0.5 after:block after:bg-primary-500"
103
103
  })
@@ -108,7 +108,7 @@ var Skeleton = function Skeleton(_ref4) {
108
108
  rest = _objectWithoutProperties(_ref4, _excluded2);
109
109
  return /*#__PURE__*/jsxRuntime.jsxs("div", _objectSpread(_objectSpread({
110
110
  className: classNames(className, "p-2 animate-pulse flex gap-2 max-w-lg"),
111
- "data-testid": "skeleton"
111
+ "data-ref": "skeleton"
112
112
  }, rest), {}, {
113
113
  children: [/*#__PURE__*/jsxRuntime.jsx("div", {
114
114
  className: "bg-tint-100 rounded aspect-square h-12"
@@ -34,6 +34,7 @@ var Breadcrumbs = function Breadcrumbs(_ref) {
34
34
  overflow = _useMemo2[1],
35
35
  end = _useMemo2[2];
36
36
  return /*#__PURE__*/jsxRuntime.jsxs("nav", _objectSpread(_objectSpread({
37
+ "data-ref": "breadcrumbs",
37
38
  "data-color": color,
38
39
  "data-variant": variant,
39
40
  className: classNames(Breadcrumbs_module.breadcrumbs, className, "flex flex-nowrap items-center")
@@ -50,7 +51,9 @@ var Breadcrumbs = function Breadcrumbs(_ref) {
50
51
  children: [/*#__PURE__*/jsxRuntime.jsx("li", {
51
52
  className: Breadcrumbs_module.breadcrumbLink,
52
53
  "data-separator": separator,
54
+ "data-ref": "breadcrumbOverflow",
53
55
  children: /*#__PURE__*/jsxRuntime.jsx(Anchor.Anchor, {
56
+ "data-": true,
54
57
  children: "..."
55
58
  })
56
59
  }), /*#__PURE__*/jsxRuntime.jsx("div", {
@@ -131,12 +131,14 @@ var ConfirmButton = function ConfirmButton(_ref) {
131
131
  className: "font-medium ",
132
132
  children: [/*#__PURE__*/jsxRuntime.jsx("p", {
133
133
  className: "py-2 px-4",
134
+ "data-ref": "confirmMessage",
134
135
  children: message
135
136
  }), /*#__PURE__*/jsxRuntime.jsxs("div", {
136
137
  className: "flex justify-end py-2 px-4 gap-2",
137
138
  children: [/*#__PURE__*/jsxRuntime.jsx(Button.Button, {
138
139
  size: "sm",
139
140
  variant: "link",
141
+ "data-ref": "confirmCancel",
140
142
  color: color,
141
143
  onClick: function onClick() {
142
144
  return [clickHandler(false), setIsOpen(false)];
@@ -147,6 +149,7 @@ var ConfirmButton = function ConfirmButton(_ref) {
147
149
  variant: "solid",
148
150
  color: color,
149
151
  autoFocus: true,
152
+ "data-ref": "confirmOk",
150
153
  onClick: function onClick() {
151
154
  return [clickHandler(true), setIsOpen(false)];
152
155
  },
@@ -29,15 +29,18 @@ var Callout = function Callout(_ref) {
29
29
  }, aria), {}, {
30
30
  children: [legend && /*#__PURE__*/jsxRuntime.jsx("legend", {
31
31
  className: "px-2 mx-4 font-medium",
32
+ "data-ref": "calloutLegend",
32
33
  children: legend
33
34
  }), /*#__PURE__*/jsxRuntime.jsxs("div", {
34
35
  className: classNames("break-words whitespace-break-spaces p-2"),
35
36
  children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
36
37
  className: "flex flex-nowrap items-center text-xl pe-4 gap-2 mb-4 empty:mb-0",
37
38
  children: [icon && /*#__PURE__*/jsxRuntime.jsx(Icon.Icon, {
38
- icon: icon
39
+ icon: icon,
40
+ "data-ref": "calloutIcon"
39
41
  }), title && /*#__PURE__*/jsxRuntime.jsx("p", {
40
42
  className: "flex-1",
43
+ "data-ref": "calloutTitle",
41
44
  children: title
42
45
  })]
43
46
  }), /*#__PURE__*/jsxRuntime.jsx("div", {
@@ -46,6 +49,7 @@ var Callout = function Callout(_ref) {
46
49
  })]
47
50
  }), onClose && /*#__PURE__*/jsxRuntime.jsx(Icon.Icon, {
48
51
  size: "md",
52
+ "data-ref": "calloutClose",
49
53
  className: classNames("absolute end-2", legend ? "top-0" : "top-2"),
50
54
  icon: icons.CoreIcons.close,
51
55
  onClick: onClose
@@ -66,13 +66,15 @@ var Chip = function Chip(_ref) {
66
66
  return /*#__PURE__*/jsxRuntime.jsxs(E, _objectSpread(_objectSpread({
67
67
  ref: ref,
68
68
  role: "term",
69
+ "data-ref": "chip",
69
70
  className: classNames(Chip_module.chip, className, color && getColor.getColorClass(color), "select-none inline-flex flex-nowrap items-center align-middle max-w-72 rounded", rounded && "rounded-full", !!onClick && Chip_module.clickable, disabled && Chip_module.disabled),
70
71
  style: styles,
71
72
  "data-variant": variant,
72
73
  "data-inner-clickable": !!onClick,
73
- onClick: clickHandler
74
+ onClick: disabled ? undefined : clickHandler
74
75
  }, aria), {}, {
75
76
  children: [icon && /*#__PURE__*/jsxRuntime.jsx(Icon.Icon, {
77
+ "data-ref": "chipIcon",
76
78
  className: classNames(Chip_module.chipIcon, "m-1"),
77
79
  icon: icon,
78
80
  bg: iconBg,
@@ -80,10 +82,12 @@ var Chip = function Chip(_ref) {
80
82
  color: iconColor,
81
83
  rtlFlip: rtlFlip
82
84
  }), children && /*#__PURE__*/jsxRuntime.jsx("label", {
85
+ "data-ref": "chipLabel",
83
86
  className: classNames(Chip_module.chipLabel, "truncate"),
84
87
  children: children
85
88
  }), onRemove && /*#__PURE__*/jsxRuntime.jsx("span", {
86
89
  role: "none",
90
+ "data-ref": "chipRemove",
87
91
  "data-inner-cliackable": true,
88
92
  className: classNames(Chip_module.chipRemove, "cursor-pointer pe-1 opacity-65 hover:opacity-90"),
89
93
  onClick: removeHandler,
@@ -133,7 +133,7 @@ var DropdownElement = function DropdownElement(_ref) {
133
133
  minWidth: minWidth,
134
134
  zIndex: "var(--z-popover)"
135
135
  }, floatingStyles),
136
- "data-testid": "dropdown-body"
136
+ "data-ref": "dropdownBody"
137
137
  }, getFloatingProps({
138
138
  onClick: function onClick(e) {
139
139
  return e.stopPropagation();
@@ -64,7 +64,6 @@ var Icon = function Icon(_ref) {
64
64
 
65
65
  /** ***************** render icon *******************/
66
66
  var iconEl = react.useMemo(function () {
67
- var _SvgTextSize$icon$len;
68
67
  if (!utilities.isString(icon)) {
69
68
  throw Error("Invalid icon expected string");
70
69
  }
@@ -83,7 +82,7 @@ var Icon = function Icon(_ref) {
83
82
  dominantBaseline: "middle",
84
83
  textAnchor: "middle",
85
84
  style: {
86
- fontSize: (_SvgTextSize$icon$len = SvgTextSize[icon.length]) !== null && _SvgTextSize$icon$len !== void 0 ? _SvgTextSize$icon$len : "1em"
85
+ fontSize: SvgTextSize[icon.length]
87
86
  },
88
87
  children: icon
89
88
  })
@@ -91,9 +90,10 @@ var Icon = function Icon(_ref) {
91
90
  className: "".concat(icon)
92
91
  });
93
92
  }, [icon, isSvg, viewBox]);
94
- return /*#__PURE__*/jsxRuntime.jsx("dfn", _objectSpread(_objectSpread({}, rest), {}, {
95
- ref: ref,
93
+ return /*#__PURE__*/jsxRuntime.jsx("dfn", _objectSpread(_objectSpread({
96
94
  "data-ref": "icon",
95
+ ref: ref
96
+ }, rest), {}, {
97
97
  role: "presentation",
98
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)),
99
99
  onClick: onClick,
@@ -25,6 +25,7 @@ var Navigator = function Navigator(_ref) {
25
25
  return onNavigate(+1);
26
26
  }, [onNavigate]);
27
27
  return /*#__PURE__*/jsxRuntime.jsxs("div", _objectSpread(_objectSpread({
28
+ "data-ref": "navigator",
28
29
  className: classNames(className, "inline-flex items-center leading-none")
29
30
  }, aria), {}, {
30
31
  children: [/*#__PURE__*/jsxRuntime.jsx(HotKey.HotKey, {
@@ -38,7 +39,7 @@ var Navigator = function Navigator(_ref) {
38
39
  color: color,
39
40
  className: "text-[1em] p-1",
40
41
  "aria-label": "previous",
41
- "data-testid": "previous",
42
+ "data-ref": "previous",
42
43
  icon: icons.CoreIcons.chevronLeft,
43
44
  onClick: function onClick(e) {
44
45
  return [e.stopPropagation(), onNavigate(-1)];
@@ -48,7 +49,7 @@ var Navigator = function Navigator(_ref) {
48
49
  className: "text-[1em] p-1",
49
50
  color: color,
50
51
  "aria-label": "next",
51
- "data-testid": "next",
52
+ "data-ref": "next",
52
53
  icon: icons.CoreIcons.chevronRight,
53
54
  onClick: function onClick(e) {
54
55
  return [e.stopPropagation(), onNavigate(1)];
@@ -74,7 +74,7 @@ var Panel = function Panel(_ref) {
74
74
  children: [/*#__PURE__*/jsxRuntime.jsxs("header", {
75
75
  role: "none",
76
76
  className: classNames(Panel_module.panelHeader, headerClassName, "flex flex-nowrap items-center area-head"),
77
- "data-testid": "panel-header",
77
+ "data-ref": "panelHeader",
78
78
  onClick: collapsable ? toggleCollapse : undefined,
79
79
  children: [onBack && /*#__PURE__*/jsxRuntime.jsx(Icon.Icon, {
80
80
  "data-ref": "panelBack",
@@ -117,7 +117,7 @@ var Panel = function Panel(_ref) {
117
117
  })]
118
118
  })]
119
119
  }), (!collapsed || expanded) && /*#__PURE__*/jsxRuntime.jsxs("div", {
120
- "data-testid": "panel-body",
120
+ "data-ref": "panelBody",
121
121
  className: classNames(Panel_module.panelBody, "area-content grid overflow-hidden"),
122
122
  children: [loading && /*#__PURE__*/jsxRuntime.jsx(Animations.Loading, {}), children]
123
123
  })]
@@ -113,7 +113,7 @@ var Aside = function Aside(_ref) {
113
113
  "data-test-value": testValue,
114
114
  children: [/*#__PURE__*/jsxRuntime.jsxs("header", {
115
115
  className: classNames(Aside_module.asideHeader, headerClassName, "grid area-head items-center"),
116
- "data-testid": "aside-header",
116
+ "data-ref": "asideHeader",
117
117
  children: [title && /*#__PURE__*/jsxRuntime.jsx("div", {
118
118
  className: classNames(Aside_module.asideTitle, "truncate py-0.5 px-1 select-none pointer-events-none"),
119
119
  children: title
@@ -144,7 +144,6 @@ var Aside = function Aside(_ref) {
144
144
  "data-ref": "asideBody",
145
145
  className: classNames(Aside_module.asideBody, bodyClassName, "overflow-hidden grid"),
146
146
  style: isCollapsed ? widthStyles : undefined,
147
- "data-testid": "aside-body",
148
147
  children: /*#__PURE__*/jsxRuntime.jsx(ErrorBoundary.ErrorBoundary, {
149
148
  children: children
150
149
  })
@@ -82,7 +82,7 @@ var AnimationSpinner = function AnimationSpinner(_ref3) {
82
82
  size = _ref3$size === void 0 ? "2rem" : _ref3$size;
83
83
  return /*#__PURE__*/jsx("div", {
84
84
  className: classNames("absolute inset-0 z-10 flex justify-center items-center cursor-wait"),
85
- "data-testid": "spinner",
85
+ "data-ref": "spinner",
86
86
  children: /*#__PURE__*/jsx("div", {
87
87
  className: classNames("outline outline-tint-500/20 p-4 bg-base/50 backdrop-blur-sm rounded"),
88
88
  children: /*#__PURE__*/jsx("div", {
@@ -97,7 +97,7 @@ var AnimationSpinner = function AnimationSpinner(_ref3) {
97
97
  var Loading = function Loading() {
98
98
  return /*#__PURE__*/jsx("div", {
99
99
  className: classNames(classes.loader, "area-[loader] relative overflow-x-clip"),
100
- "data-testid": "loading",
100
+ "data-ref": "loading",
101
101
  children: /*#__PURE__*/jsx("div", {
102
102
  className: "absolute z-10 py-px inset-x-0 top-0 after:h-0.5 after:block after:bg-primary-500"
103
103
  })
@@ -108,7 +108,7 @@ var Skeleton = function Skeleton(_ref4) {
108
108
  rest = _objectWithoutProperties(_ref4, _excluded2);
109
109
  return /*#__PURE__*/jsxs("div", _objectSpread(_objectSpread({
110
110
  className: classNames(className, "p-2 animate-pulse flex gap-2 max-w-lg"),
111
- "data-testid": "skeleton"
111
+ "data-ref": "skeleton"
112
112
  }, rest), {}, {
113
113
  children: [/*#__PURE__*/jsx("div", {
114
114
  className: "bg-tint-100 rounded aspect-square h-12"
@@ -34,6 +34,7 @@ var Breadcrumbs = function Breadcrumbs(_ref) {
34
34
  overflow = _useMemo2[1],
35
35
  end = _useMemo2[2];
36
36
  return /*#__PURE__*/jsxs("nav", _objectSpread(_objectSpread({
37
+ "data-ref": "breadcrumbs",
37
38
  "data-color": color,
38
39
  "data-variant": variant,
39
40
  className: classNames(classes.breadcrumbs, className, "flex flex-nowrap items-center")
@@ -50,7 +51,9 @@ var Breadcrumbs = function Breadcrumbs(_ref) {
50
51
  children: [/*#__PURE__*/jsx("li", {
51
52
  className: classes.breadcrumbLink,
52
53
  "data-separator": separator,
54
+ "data-ref": "breadcrumbOverflow",
53
55
  children: /*#__PURE__*/jsx(Anchor, {
56
+ "data-": true,
54
57
  children: "..."
55
58
  })
56
59
  }), /*#__PURE__*/jsx("div", {
@@ -131,12 +131,14 @@ var ConfirmButton = function ConfirmButton(_ref) {
131
131
  className: "font-medium ",
132
132
  children: [/*#__PURE__*/jsx("p", {
133
133
  className: "py-2 px-4",
134
+ "data-ref": "confirmMessage",
134
135
  children: message
135
136
  }), /*#__PURE__*/jsxs("div", {
136
137
  className: "flex justify-end py-2 px-4 gap-2",
137
138
  children: [/*#__PURE__*/jsx(Button, {
138
139
  size: "sm",
139
140
  variant: "link",
141
+ "data-ref": "confirmCancel",
140
142
  color: color,
141
143
  onClick: function onClick() {
142
144
  return [clickHandler(false), setIsOpen(false)];
@@ -147,6 +149,7 @@ var ConfirmButton = function ConfirmButton(_ref) {
147
149
  variant: "solid",
148
150
  color: color,
149
151
  autoFocus: true,
152
+ "data-ref": "confirmOk",
150
153
  onClick: function onClick() {
151
154
  return [clickHandler(true), setIsOpen(false)];
152
155
  },
@@ -29,15 +29,18 @@ var Callout = function Callout(_ref) {
29
29
  }, aria), {}, {
30
30
  children: [legend && /*#__PURE__*/jsx("legend", {
31
31
  className: "px-2 mx-4 font-medium",
32
+ "data-ref": "calloutLegend",
32
33
  children: legend
33
34
  }), /*#__PURE__*/jsxs("div", {
34
35
  className: classNames("break-words whitespace-break-spaces p-2"),
35
36
  children: [/*#__PURE__*/jsxs("div", {
36
37
  className: "flex flex-nowrap items-center text-xl pe-4 gap-2 mb-4 empty:mb-0",
37
38
  children: [icon && /*#__PURE__*/jsx(Icon, {
38
- icon: icon
39
+ icon: icon,
40
+ "data-ref": "calloutIcon"
39
41
  }), title && /*#__PURE__*/jsx("p", {
40
42
  className: "flex-1",
43
+ "data-ref": "calloutTitle",
41
44
  children: title
42
45
  })]
43
46
  }), /*#__PURE__*/jsx("div", {
@@ -46,6 +49,7 @@ var Callout = function Callout(_ref) {
46
49
  })]
47
50
  }), onClose && /*#__PURE__*/jsx(Icon, {
48
51
  size: "md",
52
+ "data-ref": "calloutClose",
49
53
  className: classNames("absolute end-2", legend ? "top-0" : "top-2"),
50
54
  icon: CoreIcons.close,
51
55
  onClick: onClose
@@ -66,13 +66,15 @@ var Chip = function Chip(_ref) {
66
66
  return /*#__PURE__*/jsxs(E, _objectSpread(_objectSpread({
67
67
  ref: ref,
68
68
  role: "term",
69
+ "data-ref": "chip",
69
70
  className: classNames(classes.chip, className, color && getColorClass(color), "select-none inline-flex flex-nowrap items-center align-middle max-w-72 rounded", rounded && "rounded-full", !!onClick && classes.clickable, disabled && classes.disabled),
70
71
  style: styles,
71
72
  "data-variant": variant,
72
73
  "data-inner-clickable": !!onClick,
73
- onClick: clickHandler
74
+ onClick: disabled ? undefined : clickHandler
74
75
  }, aria), {}, {
75
76
  children: [icon && /*#__PURE__*/jsx(Icon, {
77
+ "data-ref": "chipIcon",
76
78
  className: classNames(classes.chipIcon, "m-1"),
77
79
  icon: icon,
78
80
  bg: iconBg,
@@ -80,10 +82,12 @@ var Chip = function Chip(_ref) {
80
82
  color: iconColor,
81
83
  rtlFlip: rtlFlip
82
84
  }), children && /*#__PURE__*/jsx("label", {
85
+ "data-ref": "chipLabel",
83
86
  className: classNames(classes.chipLabel, "truncate"),
84
87
  children: children
85
88
  }), onRemove && /*#__PURE__*/jsx("span", {
86
89
  role: "none",
90
+ "data-ref": "chipRemove",
87
91
  "data-inner-cliackable": true,
88
92
  className: classNames(classes.chipRemove, "cursor-pointer pe-1 opacity-65 hover:opacity-90"),
89
93
  onClick: removeHandler,
@@ -133,7 +133,7 @@ var DropdownElement = function DropdownElement(_ref) {
133
133
  minWidth: minWidth,
134
134
  zIndex: "var(--z-popover)"
135
135
  }, floatingStyles),
136
- "data-testid": "dropdown-body"
136
+ "data-ref": "dropdownBody"
137
137
  }, getFloatingProps({
138
138
  onClick: function onClick(e) {
139
139
  return e.stopPropagation();
@@ -64,7 +64,6 @@ var Icon = function Icon(_ref) {
64
64
 
65
65
  /** ***************** render icon *******************/
66
66
  var iconEl = useMemo(function () {
67
- var _SvgTextSize$icon$len;
68
67
  if (!isString(icon)) {
69
68
  throw Error("Invalid icon expected string");
70
69
  }
@@ -83,7 +82,7 @@ var Icon = function Icon(_ref) {
83
82
  dominantBaseline: "middle",
84
83
  textAnchor: "middle",
85
84
  style: {
86
- fontSize: (_SvgTextSize$icon$len = SvgTextSize[icon.length]) !== null && _SvgTextSize$icon$len !== void 0 ? _SvgTextSize$icon$len : "1em"
85
+ fontSize: SvgTextSize[icon.length]
87
86
  },
88
87
  children: icon
89
88
  })
@@ -91,9 +90,10 @@ var Icon = function Icon(_ref) {
91
90
  className: "".concat(icon)
92
91
  });
93
92
  }, [icon, isSvg, viewBox]);
94
- return /*#__PURE__*/jsx("dfn", _objectSpread(_objectSpread({}, rest), {}, {
95
- ref: ref,
93
+ return /*#__PURE__*/jsx("dfn", _objectSpread(_objectSpread({
96
94
  "data-ref": "icon",
95
+ ref: ref
96
+ }, rest), {}, {
97
97
  role: "presentation",
98
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)),
99
99
  onClick: onClick,
@@ -25,6 +25,7 @@ var Navigator = function Navigator(_ref) {
25
25
  return onNavigate(+1);
26
26
  }, [onNavigate]);
27
27
  return /*#__PURE__*/jsxs("div", _objectSpread(_objectSpread({
28
+ "data-ref": "navigator",
28
29
  className: classNames(className, "inline-flex items-center leading-none")
29
30
  }, aria), {}, {
30
31
  children: [/*#__PURE__*/jsx(HotKey, {
@@ -38,7 +39,7 @@ var Navigator = function Navigator(_ref) {
38
39
  color: color,
39
40
  className: "text-[1em] p-1",
40
41
  "aria-label": "previous",
41
- "data-testid": "previous",
42
+ "data-ref": "previous",
42
43
  icon: CoreIcons.chevronLeft,
43
44
  onClick: function onClick(e) {
44
45
  return [e.stopPropagation(), onNavigate(-1)];
@@ -48,7 +49,7 @@ var Navigator = function Navigator(_ref) {
48
49
  className: "text-[1em] p-1",
49
50
  color: color,
50
51
  "aria-label": "next",
51
- "data-testid": "next",
52
+ "data-ref": "next",
52
53
  icon: CoreIcons.chevronRight,
53
54
  onClick: function onClick(e) {
54
55
  return [e.stopPropagation(), onNavigate(1)];
@@ -74,7 +74,7 @@ var Panel = function Panel(_ref) {
74
74
  children: [/*#__PURE__*/jsxs("header", {
75
75
  role: "none",
76
76
  className: classNames(classes.panelHeader, headerClassName, "flex flex-nowrap items-center area-head"),
77
- "data-testid": "panel-header",
77
+ "data-ref": "panelHeader",
78
78
  onClick: collapsable ? toggleCollapse : undefined,
79
79
  children: [onBack && /*#__PURE__*/jsx(Icon, {
80
80
  "data-ref": "panelBack",
@@ -117,7 +117,7 @@ var Panel = function Panel(_ref) {
117
117
  })]
118
118
  })]
119
119
  }), (!collapsed || expanded) && /*#__PURE__*/jsxs("div", {
120
- "data-testid": "panel-body",
120
+ "data-ref": "panelBody",
121
121
  className: classNames(classes.panelBody, "area-content grid overflow-hidden"),
122
122
  children: [loading && /*#__PURE__*/jsx(Loading, {}), children]
123
123
  })]
@@ -113,7 +113,7 @@ var Aside = function Aside(_ref) {
113
113
  "data-test-value": testValue,
114
114
  children: [/*#__PURE__*/jsxs("header", {
115
115
  className: classNames(classes.asideHeader, headerClassName, "grid area-head items-center"),
116
- "data-testid": "aside-header",
116
+ "data-ref": "asideHeader",
117
117
  children: [title && /*#__PURE__*/jsx("div", {
118
118
  className: classNames(classes.asideTitle, "truncate py-0.5 px-1 select-none pointer-events-none"),
119
119
  children: title
@@ -144,7 +144,6 @@ var Aside = function Aside(_ref) {
144
144
  "data-ref": "asideBody",
145
145
  className: classNames(classes.asideBody, bodyClassName, "overflow-hidden grid"),
146
146
  style: isCollapsed ? widthStyles : undefined,
147
- "data-testid": "aside-body",
148
147
  children: /*#__PURE__*/jsx(ErrorBoundary, {
149
148
  children: children
150
149
  })
@@ -4,7 +4,7 @@ export interface ChipProps extends CssProp, AriaProps, IconProps, TestProps, Chi
4
4
  /**
5
5
  * chip size
6
6
  */
7
- size?: SizeType;
7
+ size?: SizeType | number | string;
8
8
  /**
9
9
  * chip color (CSS color / tailwind color)
10
10
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-fabric/core",
3
- "version": "1.0.0-beta.28",
3
+ "version": "1.0.0-beta.29",
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.28",
39
+ "@react-fabric/utilities": "^1.0.0-beta.29",
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": "80f9d8a9f96dbd0e7a4287087e23996682bf2c0a"
59
+ "gitHead": "1011b13034b9f8f28c292468aed602217496da4a"
60
60
  }
@@ -142,7 +142,7 @@ export const AnimationSpinner = ({
142
142
  className={classNames(
143
143
  "absolute inset-0 z-10 flex justify-center items-center cursor-wait",
144
144
  )}
145
- data-testid="spinner"
145
+ data-ref="spinner"
146
146
  >
147
147
  <div
148
148
  className={classNames(
@@ -165,7 +165,7 @@ export const Loading = () => {
165
165
  classes.loader,
166
166
  "area-[loader] relative overflow-x-clip",
167
167
  )}
168
- data-testid="loading"
168
+ data-ref="loading"
169
169
  >
170
170
  <div className="absolute z-10 py-px inset-x-0 top-0 after:h-0.5 after:block after:bg-primary-500" />
171
171
  </div>
@@ -176,7 +176,7 @@ export const Skeleton = ({ className, ...rest }: CssProp) => {
176
176
  return (
177
177
  <div
178
178
  className={classNames(className, "p-2 animate-pulse flex gap-2 max-w-lg")}
179
- data-testid="skeleton"
179
+ data-ref="skeleton"
180
180
  {...rest}
181
181
  >
182
182
  <div className="bg-tint-100 rounded aspect-square h-12" />
@@ -64,6 +64,7 @@ export const Breadcrumbs = ({
64
64
 
65
65
  return (
66
66
  <nav
67
+ data-ref="breadcrumbs"
67
68
  data-color={color}
68
69
  data-variant={variant}
69
70
  className={classNames(
@@ -84,8 +85,12 @@ export const Breadcrumbs = ({
84
85
  ))}
85
86
  {overflow && (
86
87
  <Dropdown closeOnClick showArrow>
87
- <li className={classes.breadcrumbLink} data-separator={separator}>
88
- <Anchor>...</Anchor>
88
+ <li
89
+ className={classes.breadcrumbLink}
90
+ data-separator={separator}
91
+ data-ref="breadcrumbOverflow"
92
+ >
93
+ <Anchor data->...</Anchor>
89
94
  </li>
90
95
  <div
91
96
  data-color={color}
@@ -191,11 +191,14 @@ export const ConfirmButton = <Tag extends React.ElementType = "button">({
191
191
  {...getFloatingProps()}
192
192
  >
193
193
  <div className="font-medium ">
194
- <p className="py-2 px-4">{message}</p>
194
+ <p className="py-2 px-4" data-ref="confirmMessage">
195
+ {message}
196
+ </p>
195
197
  <div className="flex justify-end py-2 px-4 gap-2">
196
198
  <Button
197
199
  size="sm"
198
200
  variant="link"
201
+ data-ref="confirmCancel"
199
202
  color={color}
200
203
  onClick={() => [clickHandler(false), setIsOpen(false)]}
201
204
  >
@@ -206,6 +209,7 @@ export const ConfirmButton = <Tag extends React.ElementType = "button">({
206
209
  variant="solid"
207
210
  color={color}
208
211
  autoFocus
212
+ data-ref="confirmOk"
209
213
  onClick={() => [clickHandler(true), setIsOpen(false)]}
210
214
  >
211
215
  {okLabel ?? t("action.ok")}
@@ -90,17 +90,26 @@ export const Callout = ({
90
90
  )}
91
91
  {...aria}
92
92
  >
93
- {legend && <legend className="px-2 mx-4 font-medium">{legend}</legend>}
93
+ {legend && (
94
+ <legend className="px-2 mx-4 font-medium" data-ref="calloutLegend">
95
+ {legend}
96
+ </legend>
97
+ )}
94
98
  <div className={classNames("break-words whitespace-break-spaces p-2")}>
95
99
  <div className="flex flex-nowrap items-center text-xl pe-4 gap-2 mb-4 empty:mb-0">
96
- {icon && <Icon icon={icon} />}
97
- {title && <p className="flex-1">{title}</p>}
100
+ {icon && <Icon icon={icon} data-ref="calloutIcon" />}
101
+ {title && (
102
+ <p className="flex-1" data-ref="calloutTitle">
103
+ {title}
104
+ </p>
105
+ )}
98
106
  </div>
99
107
  <div className="pe-4">{children}</div>
100
108
  </div>
101
109
  {onClose && (
102
110
  <Icon
103
111
  size="md"
112
+ data-ref="calloutClose"
104
113
  className={classNames("absolute end-2", legend ? "top-0" : "top-2")}
105
114
  icon={CoreIcons.close}
106
115
  onClick={onClose}
@@ -49,7 +49,7 @@ export interface ChipProps
49
49
  /**
50
50
  * chip size
51
51
  */
52
- size?: SizeType;
52
+ size?: SizeType | number | string;
53
53
  /**
54
54
  * chip color (CSS color / tailwind color)
55
55
  */
@@ -152,6 +152,7 @@ export const Chip = <Tag extends React.ElementType = "div">({
152
152
  <E
153
153
  ref={ref}
154
154
  role="term"
155
+ data-ref="chip"
155
156
  className={classNames(
156
157
  classes.chip,
157
158
  className,
@@ -164,11 +165,12 @@ export const Chip = <Tag extends React.ElementType = "div">({
164
165
  style={styles}
165
166
  data-variant={variant}
166
167
  data-inner-clickable={!!onClick}
167
- {...{ onClick: clickHandler }}
168
+ {...{ onClick: disabled ? undefined : clickHandler }}
168
169
  {...aria}
169
170
  >
170
171
  {icon && (
171
172
  <Icon
173
+ data-ref="chipIcon"
172
174
  className={classNames(classes.chipIcon, "m-1")}
173
175
  icon={icon}
174
176
  bg={iconBg}
@@ -178,13 +180,17 @@ export const Chip = <Tag extends React.ElementType = "div">({
178
180
  />
179
181
  )}
180
182
  {children && (
181
- <label className={classNames(classes.chipLabel, "truncate")}>
183
+ <label
184
+ data-ref="chipLabel"
185
+ className={classNames(classes.chipLabel, "truncate")}
186
+ >
182
187
  {children}
183
188
  </label>
184
189
  )}
185
190
  {onRemove && (
186
191
  <span
187
192
  role="none"
193
+ data-ref="chipRemove"
188
194
  data-inner-cliackable
189
195
  className={classNames(
190
196
  classes.chipRemove,
@@ -249,7 +249,7 @@ const DropdownElement = ({
249
249
  zIndex: "var(--z-popover)",
250
250
  ...floatingStyles,
251
251
  }}
252
- data-testid="dropdown-body"
252
+ data-ref="dropdownBody"
253
253
  {...getFloatingProps({
254
254
  onClick: (e) => e.stopPropagation(),
255
255
  })}
@@ -140,7 +140,7 @@ export const Icon = ({
140
140
  dy=".1em"
141
141
  dominantBaseline="middle"
142
142
  textAnchor="middle"
143
- style={{ fontSize: SvgTextSize[icon.length] ?? "1em" }}
143
+ style={{ fontSize: SvgTextSize[icon.length] }}
144
144
  >
145
145
  {icon}
146
146
  </text>
@@ -152,9 +152,9 @@ export const Icon = ({
152
152
 
153
153
  return (
154
154
  <dfn
155
- {...rest}
156
- ref={ref}
157
155
  data-ref="icon"
156
+ ref={ref}
157
+ {...rest}
158
158
  role="presentation"
159
159
  className={classNames(
160
160
  classes.icon,
@@ -60,6 +60,7 @@ export const Navigator = ({
60
60
  const navNext = useCallback(() => onNavigate(+1), [onNavigate]);
61
61
  return (
62
62
  <div
63
+ data-ref="navigator"
63
64
  className={classNames(className, "inline-flex items-center leading-none")}
64
65
  {...aria}
65
66
  >
@@ -70,7 +71,7 @@ export const Navigator = ({
70
71
  color={color}
71
72
  className="text-[1em] p-1"
72
73
  aria-label="previous"
73
- data-testid="previous"
74
+ data-ref="previous"
74
75
  icon={CoreIcons.chevronLeft}
75
76
  onClick={(e) => [e.stopPropagation(), onNavigate(-1)]}
76
77
  />
@@ -80,7 +81,7 @@ export const Navigator = ({
80
81
  className="text-[1em] p-1"
81
82
  color={color}
82
83
  aria-label="next"
83
- data-testid="next"
84
+ data-ref="next"
84
85
  icon={CoreIcons.chevronRight}
85
86
  onClick={(e) => [e.stopPropagation(), onNavigate(1)]}
86
87
  />
@@ -176,7 +176,7 @@ export const Panel = ({
176
176
  headerClassName,
177
177
  "flex flex-nowrap items-center area-head",
178
178
  )}
179
- data-testid="panel-header"
179
+ data-ref="panelHeader"
180
180
  onClick={collapsable ? toggleCollapse : undefined}
181
181
  >
182
182
  {onBack && (
@@ -241,7 +241,7 @@ export const Panel = ({
241
241
  </header>
242
242
  {(!collapsed || expanded) && (
243
243
  <div
244
- data-testid="panel-body"
244
+ data-ref="panelBody"
245
245
  className={classNames(
246
246
  classes.panelBody,
247
247
  "area-content grid overflow-hidden",
@@ -212,7 +212,7 @@ export const Aside = ({
212
212
  headerClassName,
213
213
  "grid area-head items-center",
214
214
  )}
215
- data-testid="aside-header"
215
+ data-ref="asideHeader"
216
216
  >
217
217
  {title && (
218
218
  <div
@@ -266,7 +266,6 @@ export const Aside = ({
266
266
  "overflow-hidden grid",
267
267
  )}
268
268
  style={isCollapsed ? widthStyles : undefined}
269
- data-testid="aside-body"
270
269
  >
271
270
  <ErrorBoundary>{children}</ErrorBoundary>
272
271
  </section>