@react-fabric/core 1.0.0-beta.59 → 1.0.0-beta.60

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 (73) hide show
  1. package/css/theme/_utilities.css +11 -0
  2. package/dist/cjs/components/dropdown/DropdownTool.js +1 -1
  3. package/dist/cjs/components/icon/Icon.js +6 -0
  4. package/dist/cjs/components/meter/Meter.js +1 -1
  5. package/dist/cjs/components/panel/PanelStack.js +0 -2
  6. package/dist/cjs/core/boundary/ErrorBoundary.js +2 -0
  7. package/dist/cjs/core/page/Page.js +1 -1
  8. package/dist/cjs/overlays/modal/Modal.js +1 -1
  9. package/dist/cjs/overlays/tooltip/Tooltip.js +1 -1
  10. package/dist/cjs/types/icons.js +0 -1
  11. package/dist/cjs/typography/Abbr.js +3 -1
  12. package/dist/cjs/typography/Mark.js +3 -1
  13. package/dist/esm/components/dropdown/DropdownTool.js +1 -1
  14. package/dist/esm/components/icon/Icon.js +7 -1
  15. package/dist/esm/components/meter/Meter.js +1 -1
  16. package/dist/esm/components/panel/PanelStack.js +0 -2
  17. package/dist/esm/core/boundary/ErrorBoundary.js +2 -0
  18. package/dist/esm/core/page/Page.js +1 -1
  19. package/dist/esm/overlays/modal/Modal.js +1 -1
  20. package/dist/esm/overlays/tooltip/Tooltip.js +1 -1
  21. package/dist/esm/types/icons.js +0 -1
  22. package/dist/esm/typography/Abbr.js +3 -1
  23. package/dist/esm/typography/Mark.js +3 -1
  24. package/dist/types/components/badge/Badge.d.ts +1 -1
  25. package/dist/types/components/button/Button.d.ts +1 -1
  26. package/dist/types/components/card/Card.d.ts +1 -1
  27. package/dist/types/components/chip/Chip.d.ts +1 -1
  28. package/dist/types/components/icon/Icon.d.ts +1 -1
  29. package/dist/types/components/menu/types.d.ts +1 -1
  30. package/dist/types/components/panel/Panel.d.ts +1 -1
  31. package/dist/types/components/tabpanel/Tab.d.ts +1 -1
  32. package/dist/types/components/tabpanel/TabPanel.d.ts +2 -3
  33. package/dist/types/core/aside/Aside.d.ts +2 -3
  34. package/dist/types/core/page/Page.d.ts +1 -1
  35. package/dist/types/core/section/Section.d.ts +1 -1
  36. package/dist/types/hooks/useOverlayService.d.ts +2 -2
  37. package/dist/types/hooks/useStepper.d.ts +2 -3
  38. package/dist/types/overlays/alert/Alert.d.ts +1 -1
  39. package/dist/types/overlays/flyout/Flyout.d.ts +1 -1
  40. package/dist/types/overlays/modal/Modal.d.ts +1 -1
  41. package/dist/types/overlays/toast/Toast.d.ts +1 -1
  42. package/dist/types/utils/cloneElement.d.ts +1 -2
  43. package/package.json +3 -3
  44. package/src/components/badge/Badge.tsx +1 -1
  45. package/src/components/button/Button.tsx +1 -1
  46. package/src/components/card/Card.tsx +1 -1
  47. package/src/components/chip/Chip.tsx +1 -1
  48. package/src/components/dropdown/DropdownTool.tsx +1 -1
  49. package/src/components/icon/Icon.tsx +10 -2
  50. package/src/components/menu/MenuItem.tsx +0 -1
  51. package/src/components/menu/types.ts +1 -1
  52. package/src/components/meter/Meter.tsx +1 -1
  53. package/src/components/panel/Panel.tsx +1 -1
  54. package/src/components/panel/PanelStack.tsx +2 -2
  55. package/src/components/tabpanel/Tab.tsx +1 -1
  56. package/src/components/tabpanel/TabPanel.tsx +2 -3
  57. package/src/core/aside/Aside.tsx +3 -10
  58. package/src/core/boundary/ErrorBoundary.tsx +1 -0
  59. package/src/core/page/Page.tsx +2 -2
  60. package/src/core/section/Section.tsx +1 -1
  61. package/src/hooks/useOverlayService.tsx +3 -8
  62. package/src/hooks/useStepper.tsx +2 -2
  63. package/src/overlays/alert/Alert.tsx +3 -2
  64. package/src/overlays/flyout/Flyout.tsx +1 -1
  65. package/src/overlays/message/Message.tsx +1 -0
  66. package/src/overlays/modal/Modal.tsx +2 -2
  67. package/src/overlays/toast/Toast.tsx +3 -1
  68. package/src/overlays/tooltip/Tooltip.tsx +1 -1
  69. package/src/types/icons.ts +1 -1
  70. package/src/types/index.ts +0 -1
  71. package/src/typography/Abbr.tsx +1 -0
  72. package/src/typography/Mark.tsx +1 -0
  73. package/src/utils/cloneElement.ts +5 -5
@@ -363,6 +363,17 @@
363
363
  flex: 0 1 calc((--value(integer) / 12) * 100% - var(--gutter, 0px));
364
364
  }
365
365
 
366
+ @utility grid-cols-repeat-* {
367
+ grid-template-columns: repeat(
368
+ auto-fill,
369
+ minmax(min(--value([ *]), 100%), 1fr)
370
+ );
371
+ grid-template-columns: repeat(
372
+ auto-fill,
373
+ minmax(min(calc(var(--spacing) * --value(integer)), 100%), 1fr)
374
+ );
375
+ }
376
+
366
377
  @media (min-width: theme(screens.xs)) {
367
378
  .hide-xs {
368
379
  @apply hidden;
@@ -20,7 +20,7 @@ var DropdownTool = function DropdownTool(_ref) {
20
20
  return /*#__PURE__*/jsxRuntime.jsxs(Dropdown.Dropdown, _objectSpread(_objectSpread({}, props), {}, {
21
21
  children: [/*#__PURE__*/jsxRuntime.jsx(Icon.Icon, {
22
22
  icon: icon !== null && icon !== void 0 ? icon : icons.CoreIcons.caretDown,
23
- className: classNames("outline bg-tint-50/50 flex-content pointer-events-auto cursor-pointer", className, groupHover && "hidden group-hover/tool:inline-block data-[dropdown-open]:inline-block")
23
+ className: classNames("outline bg-tint-50/50 flex-content pointer-events-auto cursor-pointer", className, groupHover && "hidden group-hover/tool:inline-block data-dropdown-open:inline-block")
24
24
  }), children]
25
25
  }));
26
26
  };
@@ -18,6 +18,11 @@ var getIconProps = function getIconProps(props) {
18
18
  icon: props
19
19
  };
20
20
  }
21
+ if ( /*#__PURE__*/react.isValidElement(props)) {
22
+ return {
23
+ icon: props
24
+ };
25
+ }
21
26
  return props;
22
27
  };
23
28
  var SvgTextSize = ["", ".875em", ".525em", ".35em", ".25em"];
@@ -152,6 +157,7 @@ var Icon = function Icon(_ref) {
152
157
  "data-inner-clickable": !!_onClick,
153
158
  children: [iconSrc && !imageFailed && /*#__PURE__*/jsxRuntime.jsx("img", {
154
159
  src: iconSrc,
160
+ alt: "fallback icon",
155
161
  onError: function onError() {
156
162
  return setImageFailed(true);
157
163
  }
@@ -44,7 +44,7 @@ var Meter = function Meter(_ref) {
44
44
  return value / 16.67;
45
45
  }, [value], "Meter activeCount");
46
46
  return /*#__PURE__*/jsxRuntime.jsxs("div", _objectSpread(_objectSpread({
47
- className: classNames("fabric-meter", className, "flex flex-nowrap items-center gap-[2px]")
47
+ className: classNames("fabric-meter", className, "flex flex-nowrap items-center gap-0.5")
48
48
  }, aria), {}, {
49
49
  children: [[0, 1, 2, 3, 4, 5].map(function (step) {
50
50
  return /*#__PURE__*/jsxRuntime.jsx("div", {
@@ -73,7 +73,6 @@ var PanelStack = function PanelStack(_ref) {
73
73
  }, [onPanelChange, history]);
74
74
  var goBack = react.useCallback(function () {
75
75
  var _history$2;
76
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-boolean-literal-compare
77
76
  if ((onBack === null || onBack === void 0 ? void 0 : onBack(history[0], (_history$2 = history[1]) !== null && _history$2 !== void 0 ? _history$2 : "root")) !== false) {
78
77
  setHistory(history.slice(1));
79
78
  }
@@ -89,7 +88,6 @@ var PanelStack = function PanelStack(_ref) {
89
88
  if (panelKey === "back") {
90
89
  goBack();
91
90
  } else if (panelKey === "root") {
92
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-boolean-literal-compare
93
91
  if ((onBack === null || onBack === void 0 ? void 0 : onBack(history[0], "root")) !== false) {
94
92
  setHistory([]);
95
93
  }
@@ -117,6 +117,8 @@ var ErrorBoundary = /*#__PURE__*/function (_Component) {
117
117
  stack: error.stack
118
118
  });
119
119
  }
120
+
121
+ // eslint-disable-next-line @typescript-eslint/promise-function-async
120
122
  }, {
121
123
  key: "render",
122
124
  value: function render() {
@@ -51,7 +51,7 @@ var Page = function Page(_ref) {
51
51
  "data-testid": testId,
52
52
  "data-test-value": testValue,
53
53
  "data-loading": loading,
54
- className: classNames("fabric-page relative", "overflow-hidden grid area-content", paper && "shadow-paper m-[6px] rounded-capped"),
54
+ className: classNames("fabric-page relative", "overflow-hidden grid area-content", paper && "shadow-paper m-1.5 rounded-capped"),
55
55
  ref: ref
56
56
  }, rest), {}, {
57
57
  children: [title && /*#__PURE__*/jsxRuntime.jsxs("div", {
@@ -86,7 +86,7 @@ var Modal = function Modal(_ref) {
86
86
  children: /*#__PURE__*/jsxRuntime.jsx(react.FloatingFocusManager, {
87
87
  context: context,
88
88
  children: /*#__PURE__*/jsxRuntime.jsx("dialog", _objectSpread(_objectSpread(_objectSpread({
89
- className: classNames("fabric-modal", "rounded-capped relative overflow-hidden flex flex-col flex-nowrap", "ring-2 ring-offset-2 ring-tint-100 focus-within:ring-primary-300 shadow-xl", size === "sm" && "w-[20rem]", size === "md" && "w-[40rem]", size === "lg" && "w-[60vw]", size === "xl" && "w-[80vw]", size === "screen" && "w-screen h-screen"),
89
+ className: classNames("fabric-modal", "rounded-capped relative overflow-hidden flex flex-col flex-nowrap", "ring-2 ring-offset-2 ring-tint-100 focus-within:ring-primary-300 shadow-xl", size === "sm" && "w-[20rem]", size === "md" && "w-160", size === "lg" && "w-[60vw]", size === "xl" && "w-[80vw]", size === "screen" && "w-screen h-screen"),
90
90
  style: {
91
91
  width: width,
92
92
  height: height,
@@ -114,7 +114,7 @@ var Tooltip = function Tooltip(_ref) {
114
114
  }, open ? {} : getReferenceProps(rest))), isOpen && content && /*#__PURE__*/jsxRuntime.jsx(react$1.FloatingPortal, {
115
115
  children: /*#__PURE__*/jsxRuntime.jsxs("dfn", _objectSpread(_objectSpread({
116
116
  "data-ref": "tooltip",
117
- className: classNames("fabric-tooltip z-(--z-tooltip)", "select-none text-sm not-italic flex py-1 px-2 !max-w-lg rounded shadow-md bg-muted"),
117
+ className: classNames("fabric-tooltip z-(--z-tooltip)", "select-none text-sm not-italic flex py-1 px-2 max-w-lg! rounded shadow-md bg-muted"),
118
118
  ref: refs.setFloating,
119
119
  style: _objectSpread({
120
120
  color: textColor ? getColor.getColor(textColor) : undefined,
@@ -23,7 +23,6 @@
23
23
  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24
24
  */
25
25
  /* istanbul ignore file */
26
- /* eslint-disable @typescript-eslint/no-namespace */
27
26
  /**
28
27
  * Core icons used in the application.
29
28
  * These icons are typically used for navigation, actions, and other UI elements.
@@ -85,7 +85,9 @@ var Abbr = function Abbr(_ref2) {
85
85
  }, [renderer, copyContent]);
86
86
 
87
87
  /** ***************** tokenize text with abbr list *******************/
88
- var inner = useEffectDebugger.useMemoDebugger(function () {
88
+ var inner = useEffectDebugger.useMemoDebugger(
89
+ // eslint-disable-next-line @typescript-eslint/promise-function-async
90
+ function () {
89
91
  if (utilities.isString(children)) {
90
92
  if (!utilities.isEmpty(abbr)) {
91
93
  var tokens = utilities.tokenize(children, abbr.map(function (_ref3) {
@@ -59,7 +59,9 @@ var Mark = function Mark(_ref2) {
59
59
  }, [renderer]);
60
60
 
61
61
  /** ***************** tokenize text with abbr list *******************/
62
- var inner = useEffectDebugger.useMemoDebugger(function () {
62
+ var inner = useEffectDebugger.useMemoDebugger(
63
+ // eslint-disable-next-line @typescript-eslint/promise-function-async
64
+ function () {
63
65
  if (utilities.isString(children)) {
64
66
  if (!utilities.isEmpty(mark)) {
65
67
  var tokens = utilities.tokenize(children, mark.map(function (_ref3) {
@@ -20,7 +20,7 @@ var DropdownTool = function DropdownTool(_ref) {
20
20
  return /*#__PURE__*/jsxs(Dropdown, _objectSpread(_objectSpread({}, props), {}, {
21
21
  children: [/*#__PURE__*/jsx(Icon, {
22
22
  icon: icon !== null && icon !== void 0 ? icon : CoreIcons.caretDown,
23
- className: classNames("outline bg-tint-50/50 flex-content pointer-events-auto cursor-pointer", className, groupHover && "hidden group-hover/tool:inline-block data-[dropdown-open]:inline-block")
23
+ className: classNames("outline bg-tint-50/50 flex-content pointer-events-auto cursor-pointer", className, groupHover && "hidden group-hover/tool:inline-block data-dropdown-open:inline-block")
24
24
  }), children]
25
25
  }));
26
26
  };
@@ -5,7 +5,7 @@ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
5
5
  import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
6
6
  import { isSvgPath, isString } from '@react-fabric/utilities';
7
7
  import classNames from 'classnames';
8
- import { useState, useEffect, useMemo, isValidElement } from 'react';
8
+ import { isValidElement, useState, useEffect, useMemo } from 'react';
9
9
  import { jsx, jsxs } from 'react/jsx-runtime';
10
10
  import { getColor } from '../../utils/getColor.js';
11
11
 
@@ -18,6 +18,11 @@ var getIconProps = function getIconProps(props) {
18
18
  icon: props
19
19
  };
20
20
  }
21
+ if ( /*#__PURE__*/isValidElement(props)) {
22
+ return {
23
+ icon: props
24
+ };
25
+ }
21
26
  return props;
22
27
  };
23
28
  var SvgTextSize = ["", ".875em", ".525em", ".35em", ".25em"];
@@ -152,6 +157,7 @@ var Icon = function Icon(_ref) {
152
157
  "data-inner-clickable": !!_onClick,
153
158
  children: [iconSrc && !imageFailed && /*#__PURE__*/jsx("img", {
154
159
  src: iconSrc,
160
+ alt: "fallback icon",
155
161
  onError: function onError() {
156
162
  return setImageFailed(true);
157
163
  }
@@ -44,7 +44,7 @@ var Meter = function Meter(_ref) {
44
44
  return value / 16.67;
45
45
  }, [value], "Meter activeCount");
46
46
  return /*#__PURE__*/jsxs("div", _objectSpread(_objectSpread({
47
- className: classNames("fabric-meter", className, "flex flex-nowrap items-center gap-[2px]")
47
+ className: classNames("fabric-meter", className, "flex flex-nowrap items-center gap-0.5")
48
48
  }, aria), {}, {
49
49
  children: [[0, 1, 2, 3, 4, 5].map(function (step) {
50
50
  return /*#__PURE__*/jsx("div", {
@@ -73,7 +73,6 @@ var PanelStack = function PanelStack(_ref) {
73
73
  }, [onPanelChange, history]);
74
74
  var goBack = useCallback(function () {
75
75
  var _history$2;
76
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-boolean-literal-compare
77
76
  if ((onBack === null || onBack === void 0 ? void 0 : onBack(history[0], (_history$2 = history[1]) !== null && _history$2 !== void 0 ? _history$2 : "root")) !== false) {
78
77
  setHistory(history.slice(1));
79
78
  }
@@ -89,7 +88,6 @@ var PanelStack = function PanelStack(_ref) {
89
88
  if (panelKey === "back") {
90
89
  goBack();
91
90
  } else if (panelKey === "root") {
92
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-boolean-literal-compare
93
91
  if ((onBack === null || onBack === void 0 ? void 0 : onBack(history[0], "root")) !== false) {
94
92
  setHistory([]);
95
93
  }
@@ -117,6 +117,8 @@ var ErrorBoundary = /*#__PURE__*/function (_Component) {
117
117
  stack: error.stack
118
118
  });
119
119
  }
120
+
121
+ // eslint-disable-next-line @typescript-eslint/promise-function-async
120
122
  }, {
121
123
  key: "render",
122
124
  value: function render() {
@@ -51,7 +51,7 @@ var Page = function Page(_ref) {
51
51
  "data-testid": testId,
52
52
  "data-test-value": testValue,
53
53
  "data-loading": loading,
54
- className: classNames("fabric-page relative", "overflow-hidden grid area-content", paper && "shadow-paper m-[6px] rounded-capped"),
54
+ className: classNames("fabric-page relative", "overflow-hidden grid area-content", paper && "shadow-paper m-1.5 rounded-capped"),
55
55
  ref: ref
56
56
  }, rest), {}, {
57
57
  children: [title && /*#__PURE__*/jsxs("div", {
@@ -86,7 +86,7 @@ var Modal = function Modal(_ref) {
86
86
  children: /*#__PURE__*/jsx(FloatingFocusManager, {
87
87
  context: context,
88
88
  children: /*#__PURE__*/jsx("dialog", _objectSpread(_objectSpread(_objectSpread({
89
- className: classNames("fabric-modal", "rounded-capped relative overflow-hidden flex flex-col flex-nowrap", "ring-2 ring-offset-2 ring-tint-100 focus-within:ring-primary-300 shadow-xl", size === "sm" && "w-[20rem]", size === "md" && "w-[40rem]", size === "lg" && "w-[60vw]", size === "xl" && "w-[80vw]", size === "screen" && "w-screen h-screen"),
89
+ className: classNames("fabric-modal", "rounded-capped relative overflow-hidden flex flex-col flex-nowrap", "ring-2 ring-offset-2 ring-tint-100 focus-within:ring-primary-300 shadow-xl", size === "sm" && "w-[20rem]", size === "md" && "w-160", size === "lg" && "w-[60vw]", size === "xl" && "w-[80vw]", size === "screen" && "w-screen h-screen"),
90
90
  style: {
91
91
  width: width,
92
92
  height: height,
@@ -114,7 +114,7 @@ var Tooltip = function Tooltip(_ref) {
114
114
  }, open ? {} : getReferenceProps(rest))), isOpen && content && /*#__PURE__*/jsx(FloatingPortal, {
115
115
  children: /*#__PURE__*/jsxs("dfn", _objectSpread(_objectSpread({
116
116
  "data-ref": "tooltip",
117
- className: classNames("fabric-tooltip z-(--z-tooltip)", "select-none text-sm not-italic flex py-1 px-2 !max-w-lg rounded shadow-md bg-muted"),
117
+ className: classNames("fabric-tooltip z-(--z-tooltip)", "select-none text-sm not-italic flex py-1 px-2 max-w-lg! rounded shadow-md bg-muted"),
118
118
  ref: refs.setFloating,
119
119
  style: _objectSpread({
120
120
  color: textColor ? getColor(textColor) : undefined,
@@ -23,7 +23,6 @@
23
23
  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24
24
  */
25
25
  /* istanbul ignore file */
26
- /* eslint-disable @typescript-eslint/no-namespace */
27
26
  /**
28
27
  * Core icons used in the application.
29
28
  * These icons are typically used for navigation, actions, and other UI elements.
@@ -85,7 +85,9 @@ var Abbr = function Abbr(_ref2) {
85
85
  }, [renderer, copyContent]);
86
86
 
87
87
  /** ***************** tokenize text with abbr list *******************/
88
- var inner = useMemoDebugger(function () {
88
+ var inner = useMemoDebugger(
89
+ // eslint-disable-next-line @typescript-eslint/promise-function-async
90
+ function () {
89
91
  if (isString(children)) {
90
92
  if (!isEmpty(abbr)) {
91
93
  var tokens = tokenize(children, abbr.map(function (_ref3) {
@@ -59,7 +59,9 @@ var Mark = function Mark(_ref2) {
59
59
  }, [renderer]);
60
60
 
61
61
  /** ***************** tokenize text with abbr list *******************/
62
- var inner = useMemoDebugger(function () {
62
+ var inner = useMemoDebugger(
63
+ // eslint-disable-next-line @typescript-eslint/promise-function-async
64
+ function () {
63
65
  if (isString(children)) {
64
66
  if (!isEmpty(mark)) {
65
67
  var tokens = tokenize(children, mark.map(function (_ref3) {
@@ -1,5 +1,5 @@
1
1
  import { type BadgeType, type ChildProp, type CssProp, type RefProp } from "../../types";
2
- import { IconProps } from "../icon/Icon";
2
+ import { type IconProps } from "../icon/Icon";
3
3
  export interface BadgeProps extends CssProp, RefProp, Partial<ChildProp> {
4
4
  /**
5
5
  * make wrapper a block element
@@ -1,6 +1,6 @@
1
1
  import { type MouseEventHandler, type WheelEventHandler } from "react";
2
2
  import { type AriaProps, type BadgeType, type CallbackReturn, type ColorState, type CssProp, type PolymorphicProps, type RefProp, type SizeType, type TestProps } from "../../types";
3
- import { IconProps } from "../icon/Icon";
3
+ import { type IconProps } from "../icon/Icon";
4
4
  export interface BaseProps extends CssProp, AriaProps, RefProp, TestProps {
5
5
  /**
6
6
  * primary icon alignment
@@ -1,7 +1,7 @@
1
1
  import { type DragEvent, type MouseEventHandler } from "react";
2
2
  import { type ContentProps } from "../../core/content/Content";
3
3
  import { type HeadFootProps } from "../../core/headfoot/HeadFoot";
4
- import { PolymorphicProps, type AriaProps, type ChildrenProp, type CssProp, type RefProp, type TestProps } from "../../types";
4
+ import { type PolymorphicProps, type AriaProps, type ChildrenProp, type CssProp, type RefProp, type TestProps } from "../../types";
5
5
  interface BaseProps extends CssProp, AriaProps, TestProps, RefProp<HTMLDivElement>, ChildrenProp<React.ReactElement<HeadFootProps | ContentProps>> {
6
6
  /**
7
7
  * apply flex fill styling
@@ -1,6 +1,6 @@
1
1
  import { type ReactElement } from "react";
2
2
  import { type AriaProps, type ChildProp, type ColorType, type CssProp, type PaletteType, type PolymorphicProps, type RefProp, type SizeType, type TestProps } from "../../types";
3
- import { IconProps } from "../icon/Icon";
3
+ import { type IconProps } from "../icon/Icon";
4
4
  export interface ChipProps extends CssProp, AriaProps, TestProps, ChildProp<string | ReactElement>, RefProp<HTMLDivElement> {
5
5
  /**
6
6
  * chip size
@@ -42,7 +42,7 @@ export interface Props extends CssProp, AriaProps, RefProp, TestProps {
42
42
  */
43
43
  onClick?: React.MouseEventHandler;
44
44
  }
45
- export type IconProps = string | Pick<Props, "icon" | "iconSrc" | "bg" | "color" | "size" | "rtlFlip" | "viewBox" | "rounded" | "animate">;
45
+ export type IconProps = string | JSX.Element | Pick<Props, "icon" | "iconSrc" | "bg" | "color" | "size" | "rtlFlip" | "viewBox" | "rounded" | "animate">;
46
46
  export declare const getIconProps: (props: IconProps) => Props;
47
47
  /**
48
48
  * A versatile icon component that supports SVG paths, webfont icons, and text icons.
@@ -1,6 +1,6 @@
1
1
  import { type ElementType, type MouseEvent } from "react";
2
2
  import { type AriaProps, type BadgeType, type CallbackReturn, type ChildrenProp, type ColorState, type CssProp, type TestProps } from "../../types";
3
- import { IconProps } from "../icon/Icon";
3
+ import { type IconProps } from "../icon/Icon";
4
4
  export interface MenuItemProps extends CssProp, AriaProps, TestProps {
5
5
  /**
6
6
  * menu id passed via menu.onClick
@@ -1,7 +1,7 @@
1
1
  import { type ContentProps } from "../../core/content/Content";
2
2
  import { type HeadFootProps } from "../../core/headfoot/HeadFoot";
3
3
  import { type AriaProps, type ChildrenProp, type CollapseProps, type CssProp, type ExpandProps, type TestProps } from "../../types";
4
- import { IconProps } from "../icon/Icon";
4
+ import { type IconProps } from "../icon/Icon";
5
5
  export interface PanelProps extends CssProp, AriaProps, TestProps, ExpandProps, CollapseProps, ChildrenProp<HeadFootProps | ContentProps> {
6
6
  /**
7
7
  * panel id used by panel stack
@@ -1,6 +1,6 @@
1
1
  import { type ReactElement } from "react";
2
2
  import { type AriaProps, type BadgeType, type CallbackReturn, type ChildrenProp, type ColorState, type CssProp, type PolymorphicProps, type RefProp, type TestProps, type TooltipProp } from "../../types";
3
- import { IconProps } from "../icon/Icon";
3
+ import { type IconProps } from "../icon/Icon";
4
4
  export interface TabProps extends Partial<ChildrenProp>, CssProp, RefProp, AriaProps, TestProps, TooltipProp {
5
5
  /**
6
6
  * tab id
@@ -1,4 +1,3 @@
1
- import { type ReactNode } from "react";
2
1
  import { type CallbackReturn, type ChildrenProp } from "../../types";
3
2
  import { Tab } from "./Tab";
4
3
  export interface TabPanelProps extends ChildrenProp<typeof Tab> {
@@ -41,11 +40,11 @@ export interface TabPanelProps extends ChildrenProp<typeof Tab> {
41
40
  /**
42
41
  * append element
43
42
  */
44
- append?: ReactNode;
43
+ append?: React.ReactNode;
45
44
  /**
46
45
  * prepend element
47
46
  */
48
- prepend?: ReactNode;
47
+ prepend?: React.ReactNode;
49
48
  /**
50
49
  * change handler
51
50
  */
@@ -1,11 +1,10 @@
1
- import { type ReactNode } from "react";
2
- import { IconProps } from "../../components/icon/Icon";
1
+ import { type IconProps } from "../../components/icon/Icon";
3
2
  import { type ChildrenProp, type CollapseProps, type CssProp, type Elements, type TestProps } from "../../types";
4
3
  export interface AsideProps extends ChildrenProp, CollapseProps, CssProp, TestProps {
5
4
  /**
6
5
  * page title
7
6
  */
8
- title?: ReactNode;
7
+ title?: React.ReactNode;
9
8
  /**
10
9
  * align inline-end
11
10
  */
@@ -1,4 +1,4 @@
1
- import { IconProps } from "../../components/icon/Icon";
1
+ import { type IconProps } from "../../components/icon/Icon";
2
2
  import { type ChildrenProp, type RefProp, type TestProps } from "../../types";
3
3
  export interface PageProps extends ChildrenProp, TestProps, RefProp<HTMLDivElement> {
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { TestProps, type ChildrenProp, type CssProp, type RefProp } from "../../types";
1
+ import { type TestProps, type ChildrenProp, type CssProp, type RefProp } from "../../types";
2
2
  /**
3
3
  * A component that represents a section of content within a page, with templated grid layout.
4
4
  * It can be used to group related content together and can be styled with additional CSS classes.
@@ -1,4 +1,4 @@
1
- import { type ElementType, type ReactNode } from "react";
1
+ import { type ElementType } from "react";
2
2
  import { type ModalProps } from "../types";
3
3
  type OverlayComponent = ElementType<ModalProps<AnyObject>>;
4
4
  /**
@@ -25,5 +25,5 @@ type OverlayComponent = ElementType<ModalProps<AnyObject>>;
25
25
  * <Overlay />
26
26
  * ```
27
27
  */
28
- export declare const useOverlayService: (ModalOrFlyout: OverlayComponent) => [Overlay: ReactNode | null, openOverlay: (props?: KeyValue) => Promise<AnyObject>];
28
+ export declare const useOverlayService: (ModalOrFlyout: OverlayComponent) => [Overlay: React.ReactNode | null, openOverlay: (props?: KeyValue) => Promise<AnyObject>];
29
29
  export {};
@@ -1,8 +1,7 @@
1
- import { ReactNode } from "react";
2
1
  export declare const useStepper: ({ steps, activeStep: _initialActiveStep, }: {
3
2
  steps: Array<{
4
- label?: ReactNode;
5
- icon?: ReactNode;
3
+ label?: React.ReactNode;
4
+ icon?: React.ReactNode;
6
5
  }>;
7
6
  activeStep?: number;
8
7
  }) => {
@@ -7,7 +7,7 @@ export interface AlertProps {
7
7
  /**
8
8
  * svg path / webfont className / 1-4 letter text
9
9
  */
10
- icon: string;
10
+ icon?: string;
11
11
  /**
12
12
  * icon image source URL, if failed to load then shows icon
13
13
  */
@@ -1,4 +1,4 @@
1
- import { IconProps } from "../../components/icon/Icon";
1
+ import { type IconProps } from "../../components/icon/Icon";
2
2
  import { type AriaProps, type CallbackReturn, type ChildrenProp, type Elements, type TestProps } from "../../types";
3
3
  export interface FlyoutProps extends AriaProps, TestProps, ChildrenProp {
4
4
  icon?: IconProps;
@@ -1,4 +1,4 @@
1
- import { IconProps } from "../../components/icon/Icon";
1
+ import { type IconProps } from "../../components/icon/Icon";
2
2
  import { type AriaProps, type CallbackReturn, type ChildrenProp, type Elements, type TestProps } from "../../types";
3
3
  export interface ModalProps extends AriaProps, TestProps, ChildrenProp {
4
4
  icon?: IconProps;
@@ -7,7 +7,7 @@ export interface ToastProps {
7
7
  /**
8
8
  * svg path / webfont className / 1-4 letter text
9
9
  */
10
- icon: string;
10
+ icon?: string;
11
11
  /**
12
12
  * icon image source URL, if failed to load then shows icon
13
13
  */
@@ -1,2 +1 @@
1
- import { type ReactNode } from "react";
2
- export declare const cloneChildren: (children: ReactNode, callback: (child: ReactNode, index: number) => ReactNode) => ReactNode;
1
+ export declare const cloneChildren: (children: React.ReactNode, callback: (child: React.ReactNode, index: number) => React.ReactNode) => React.ReactNode;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-fabric/core",
3
- "version": "1.0.0-beta.59",
3
+ "version": "1.0.0-beta.60",
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.27.16",
39
- "@react-fabric/utilities": "^1.0.0-beta.59",
39
+ "@react-fabric/utilities": "^1.0.0-beta.60",
40
40
  "@tailwindcss/postcss": "~4.1.16",
41
41
  "boring-avatars": "~1.11.2",
42
42
  "classnames": "~2.5.1",
@@ -54,5 +54,5 @@
54
54
  "node": ">=18.12.0",
55
55
  "npm": ">=8.19.0"
56
56
  },
57
- "gitHead": "74efd06c9c5ac629b6ef5cdc6d53ecb1c356f2eb"
57
+ "gitHead": "a79f053ee7e13422c06d7d9c35d4f0c2610cdf5d"
58
58
  }
@@ -30,7 +30,7 @@ import {
30
30
  type CssProp,
31
31
  type RefProp,
32
32
  } from "../../types";
33
- import { getIconProps, Icon, IconProps } from "../icon/Icon";
33
+ import { getIconProps, Icon, type IconProps } from "../icon/Icon";
34
34
 
35
35
  export interface BadgeProps extends CssProp, RefProp, Partial<ChildProp> {
36
36
  /**
@@ -53,7 +53,7 @@ import {
53
53
  import { getColor } from "../../utils";
54
54
  import { AnimationIndicator } from "../animations/Animations";
55
55
  import { Badge, getBadgeProps } from "../badge/Badge";
56
- import { getIconProps, Icon, IconProps } from "../icon/Icon";
56
+ import { getIconProps, Icon, type IconProps } from "../icon/Icon";
57
57
 
58
58
  export interface BaseProps extends CssProp, AriaProps, RefProp, TestProps {
59
59
  /**
@@ -37,7 +37,7 @@ import {
37
37
  type HeadFootProps,
38
38
  } from "../../core/headfoot/HeadFoot";
39
39
  import {
40
- PolymorphicProps,
40
+ type PolymorphicProps,
41
41
  type AriaProps,
42
42
  type ChildrenProp,
43
43
  type CssProp,
@@ -36,7 +36,7 @@ import {
36
36
  type TestProps,
37
37
  } from "../../types";
38
38
  import { getColor } from "../../utils";
39
- import { getIconProps, Icon, IconProps } from "../icon/Icon";
39
+ import { getIconProps, Icon, type IconProps } from "../icon/Icon";
40
40
 
41
41
  export interface ChipProps
42
42
  extends CssProp,
@@ -75,7 +75,7 @@ export const DropdownTool = ({
75
75
  "outline bg-tint-50/50 flex-content pointer-events-auto cursor-pointer",
76
76
  className,
77
77
  groupHover &&
78
- "hidden group-hover/tool:inline-block data-[dropdown-open]:inline-block",
78
+ "hidden group-hover/tool:inline-block data-dropdown-open:inline-block",
79
79
  )}
80
80
  />
81
81
  {children}
@@ -81,6 +81,7 @@ export interface Props extends CssProp, AriaProps, RefProp, TestProps {
81
81
 
82
82
  export type IconProps =
83
83
  | string
84
+ | JSX.Element
84
85
  | Pick<
85
86
  Props,
86
87
  | "icon"
@@ -98,7 +99,10 @@ export const getIconProps = (props: IconProps): Props => {
98
99
  if (typeof props === "string") {
99
100
  return { icon: props };
100
101
  }
101
- return props;
102
+ if (isValidElement(props)) {
103
+ return { icon: props };
104
+ }
105
+ return props as unknown as Props;
102
106
  };
103
107
 
104
108
  const SvgTextSize = ["", ".875em", ".525em", ".35em", ".25em"];
@@ -238,7 +242,11 @@ export const Icon = ({
238
242
  data-inner-clickable={!!onClick}
239
243
  >
240
244
  {iconSrc && !imageFailed && (
241
- <img src={iconSrc} onError={() => setImageFailed(true)} />
245
+ <img
246
+ src={iconSrc}
247
+ alt="fallback icon"
248
+ onError={() => setImageFailed(true)}
249
+ />
242
250
  )}
243
251
  {(!iconSrc || imageFailed) && iconEl}
244
252
  </dfn>
@@ -32,7 +32,6 @@ import { type PolymorphicProps } from "../../types";
32
32
  import { Badge, getBadgeProps } from "../badge/Badge";
33
33
  import { getIconProps, Icon } from "../icon/Icon";
34
34
  import { type MenuItemProps } from "./types";
35
- import { get } from "http";
36
35
 
37
36
  /**
38
37
  * A menu item component that can be used in a dropdown or menu.
@@ -31,7 +31,7 @@ import {
31
31
  type CssProp,
32
32
  type TestProps,
33
33
  } from "../../types";
34
- import { IconProps } from "../icon/Icon";
34
+ import { type IconProps } from "../icon/Icon";
35
35
 
36
36
  export interface MenuItemProps extends CssProp, AriaProps, TestProps {
37
37
  /**
@@ -76,7 +76,7 @@ export const Meter = ({ value, hideLabel, className, ...aria }: MeterProps) => {
76
76
  className={classNames(
77
77
  "fabric-meter",
78
78
  className,
79
- "flex flex-nowrap items-center gap-[2px]",
79
+ "flex flex-nowrap items-center gap-0.5",
80
80
  )}
81
81
  {...aria}
82
82
  >
@@ -37,7 +37,7 @@ import {
37
37
  } from "../../types";
38
38
  import { CoreIcons } from "../../types/icons";
39
39
  import { Loading } from "../animations/Animations";
40
- import { getIconProps, Icon, IconProps } from "../icon/Icon";
40
+ import { getIconProps, Icon, type IconProps } from "../icon/Icon";
41
41
 
42
42
  export interface PanelProps
43
43
  extends CssProp,
@@ -113,7 +113,7 @@ export const PanelStack = ({
113
113
  }, [onPanelChange, history]);
114
114
 
115
115
  const goBack = useCallback(() => {
116
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-boolean-literal-compare
116
+
117
117
  if (onBack?.(history[0], history[1] ?? "root") !== false) {
118
118
  setHistory(history.slice(1));
119
119
  }
@@ -131,7 +131,7 @@ export const PanelStack = ({
131
131
  if (panelKey === "back") {
132
132
  goBack();
133
133
  } else if (panelKey === "root") {
134
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-boolean-literal-compare
134
+
135
135
  if (onBack?.(history[0], "root") !== false) {
136
136
  setHistory([]);
137
137
  }
@@ -39,7 +39,7 @@ import {
39
39
  } from "../../types";
40
40
  import { Badge, getBadgeProps } from "../badge/Badge";
41
41
  import { DropdownTool } from "../dropdown/DropdownTool";
42
- import { getIconProps, Icon, IconProps } from "../icon/Icon";
42
+ import { getIconProps, Icon, type IconProps } from "../icon/Icon";
43
43
 
44
44
  export interface TabProps
45
45
  extends Partial<ChildrenProp>,
@@ -25,7 +25,6 @@ import classNames from "classnames";
25
25
  import {
26
26
  Children,
27
27
  cloneElement,
28
- type ReactNode,
29
28
  useCallback,
30
29
  useEffect,
31
30
  useMemo,
@@ -75,11 +74,11 @@ export interface TabPanelProps extends ChildrenProp<typeof Tab> {
75
74
  /**
76
75
  * append element
77
76
  */
78
- append?: ReactNode;
77
+ append?: React.ReactNode;
79
78
  /**
80
79
  * prepend element
81
80
  */
82
- prepend?: ReactNode;
81
+ prepend?: React.ReactNode;
83
82
  /**
84
83
  * change handler
85
84
  */
@@ -22,16 +22,9 @@
22
22
  */
23
23
 
24
24
  import classNames from "classnames";
25
- import {
26
- useCallback,
27
- useEffect,
28
- useMemo,
29
- useRef,
30
- useState,
31
- type ReactNode,
32
- } from "react";
25
+ import { useCallback, useEffect, useMemo, useRef, useState } from "react";
33
26
  import { Loading } from "../../components/animations/Animations";
34
- import { getIconProps, Icon, IconProps } from "../../components/icon/Icon";
27
+ import { getIconProps, Icon, type IconProps } from "../../components/icon/Icon";
35
28
  import { useLayoutEffectDebugger } from "../../hooks/useEffectDebugger";
36
29
  import { usePropToggle } from "../../hooks/usePropToggle";
37
30
  import { useResize } from "../../hooks/useResize";
@@ -53,7 +46,7 @@ export interface AsideProps
53
46
  /**
54
47
  * page title
55
48
  */
56
- title?: ReactNode;
49
+ title?: React.ReactNode;
57
50
  /**
58
51
  * align inline-end
59
52
  */
@@ -131,6 +131,7 @@ export class ErrorBoundary extends Component<
131
131
  this.setState({ hasError: true, error: error.message, stack: error.stack });
132
132
  }
133
133
 
134
+ // eslint-disable-next-line @typescript-eslint/promise-function-async
134
135
  render() {
135
136
  const env = process.env.NODE_ENV;
136
137
  if (this.state.hasError) {
@@ -23,7 +23,7 @@
23
23
 
24
24
  import classNames from "classnames";
25
25
  import { Loading } from "../../components/animations/Animations";
26
- import { getIconProps, Icon, IconProps } from "../../components/icon/Icon";
26
+ import { getIconProps, Icon, type IconProps } from "../../components/icon/Icon";
27
27
  import { type ChildrenProp, type RefProp, type TestProps } from "../../types";
28
28
 
29
29
  export interface PageProps
@@ -98,7 +98,7 @@ export const Page = ({
98
98
  className={classNames(
99
99
  "fabric-page relative",
100
100
  "overflow-hidden grid area-content",
101
- paper && "shadow-paper m-[6px] rounded-capped",
101
+ paper && "shadow-paper m-1.5 rounded-capped",
102
102
  )}
103
103
  ref={ref}
104
104
  {...rest}
@@ -23,7 +23,7 @@
23
23
 
24
24
  import classNames from "classnames";
25
25
  import {
26
- TestProps,
26
+ type TestProps,
27
27
  type ChildrenProp,
28
28
  type CssProp,
29
29
  type RefProp,
@@ -21,12 +21,7 @@
21
21
  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
22
  */
23
23
 
24
- import {
25
- useState,
26
- type ComponentProps,
27
- type ElementType,
28
- type ReactNode,
29
- } from "react";
24
+ import { useState, type ComponentProps, type ElementType } from "react";
30
25
  import { type ModalProps } from "../types";
31
26
 
32
27
  type OverlayComponent = ElementType<ModalProps<AnyObject>>;
@@ -58,10 +53,10 @@ type OverlayComponent = ElementType<ModalProps<AnyObject>>;
58
53
  export const useOverlayService = (
59
54
  ModalOrFlyout: OverlayComponent,
60
55
  ): [
61
- Overlay: ReactNode | null,
56
+ Overlay: React.ReactNode | null,
62
57
  openOverlay: (props?: KeyValue) => Promise<AnyObject>,
63
58
  ] => {
64
- const [Overlay, setOverlay] = useState<ReactNode | null>(null);
59
+ const [Overlay, setOverlay] = useState<React.ReactNode | null>(null);
65
60
 
66
61
  const openOverlay = async ({
67
62
  onClose,
@@ -21,14 +21,14 @@
21
21
  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
22
  */
23
23
 
24
- import { ReactNode, useMemo, useState } from "react";
24
+ import { useMemo, useState } from "react";
25
25
  import { Icon } from "../components";
26
26
 
27
27
  export const useStepper = ({
28
28
  steps,
29
29
  activeStep: _initialActiveStep = 0,
30
30
  }: {
31
- steps: Array<{ label?: ReactNode; icon?: ReactNode }>;
31
+ steps: Array<{ label?: React.ReactNode; icon?: React.ReactNode }>;
32
32
  activeStep?: number;
33
33
  }) => {
34
34
  const [activeStep, setActiveStep] = useState(_initialActiveStep);
@@ -35,7 +35,7 @@ import { useCallback, useLayoutEffect, useMemo, useState } from "react";
35
35
  import { useTranslation } from "react-i18next";
36
36
  import { AnimationIndicator } from "../../components/animations/Animations";
37
37
  import { Button } from "../../components/button/Button";
38
- import { Icon, IconProps } from "../../components/icon/Icon";
38
+ import { Icon } from "../../components/icon/Icon";
39
39
  import { type ColorState, type Elements } from "../../types";
40
40
  import { CoreIcons } from "../../types/icons";
41
41
  import { Title } from "../../typography/Title";
@@ -49,7 +49,7 @@ export interface AlertProps {
49
49
  /**
50
50
  * svg path / webfont className / 1-4 letter text
51
51
  */
52
- icon: string;
52
+ icon?: string;
53
53
  /**
54
54
  * icon image source URL, if failed to load then shows icon
55
55
  */
@@ -101,6 +101,7 @@ export const Alert = ({
101
101
  rtlFlip,
102
102
  actions,
103
103
  // @ts-expect-error internal prop
104
+ // eslint-disable-next-line react/prop-types --- IGNORE ---
104
105
  onClose,
105
106
  type,
106
107
  okLabel,
@@ -34,7 +34,7 @@ import { isString } from "@react-fabric/utilities";
34
34
  import classNames from "classnames";
35
35
  import { isValidElement, useCallback, useEffect } from "react";
36
36
  import { Loading } from "../../components/animations/Animations";
37
- import { getIconProps, Icon, IconProps } from "../../components/icon/Icon";
37
+ import { getIconProps, Icon, type IconProps } from "../../components/icon/Icon";
38
38
  import { Header } from "../../core/headfoot/HeadFoot";
39
39
  import { HotKeyWrapper } from "../../hotkeys/HotKeyWrapper";
40
40
  import {
@@ -67,6 +67,7 @@ export const Message = ({
67
67
  rtlFlip,
68
68
  actions,
69
69
  // @ts-expect-error internal prop
70
+ // eslint-disable-next-line react/prop-types --- IGNORE ---
70
71
  onClose,
71
72
  }: MessageProps) => {
72
73
  const elRef = useRef<HTMLDivElement>(null);
@@ -34,7 +34,7 @@ import { isString } from "@react-fabric/utilities";
34
34
  import classNames from "classnames";
35
35
  import { isValidElement, useCallback, useEffect } from "react";
36
36
  import { Loading } from "../../components/animations/Animations";
37
- import { getIconProps, Icon, IconProps } from "../../components/icon/Icon";
37
+ import { getIconProps, Icon, type IconProps } from "../../components/icon/Icon";
38
38
  import { Header } from "../../core/headfoot/HeadFoot";
39
39
  import { HotKeyWrapper } from "../../hotkeys/HotKeyWrapper";
40
40
  import {
@@ -190,7 +190,7 @@ export const Modal = ({
190
190
  "rounded-capped relative overflow-hidden flex flex-col flex-nowrap",
191
191
  "ring-2 ring-offset-2 ring-tint-100 focus-within:ring-primary-300 shadow-xl",
192
192
  size === "sm" && "w-[20rem]",
193
- size === "md" && "w-[40rem]",
193
+ size === "md" && "w-160",
194
194
  size === "lg" && "w-[60vw]",
195
195
  size === "xl" && "w-[80vw]",
196
196
  size === "screen" && "w-screen h-screen",
@@ -39,7 +39,7 @@ export interface ToastProps {
39
39
  /**
40
40
  * svg path / webfont className / 1-4 letter text
41
41
  */
42
- icon: string;
42
+ icon?: string;
43
43
  /**
44
44
  * icon image source URL, if failed to load then shows icon
45
45
  */
@@ -83,8 +83,10 @@ export const Toast = ({
83
83
  rtlFlip,
84
84
  actions,
85
85
  // @ts-expect-error internal prop
86
+ // eslint-disable-next-line react/prop-types --- IGNORE ---
86
87
  onClose,
87
88
  // @ts-expect-error internal prop
89
+ // eslint-disable-next-line react/prop-types --- IGNORE ---
88
90
  onCloseAll,
89
91
  type,
90
92
  okLabel,
@@ -178,7 +178,7 @@ export const Tooltip = ({
178
178
  data-ref="tooltip"
179
179
  className={classNames(
180
180
  "fabric-tooltip z-(--z-tooltip)",
181
- "select-none text-sm not-italic flex py-1 px-2 !max-w-lg rounded shadow-md bg-muted",
181
+ "select-none text-sm not-italic flex py-1 px-2 max-w-lg! rounded shadow-md bg-muted",
182
182
  )}
183
183
  ref={refs.setFloating}
184
184
  style={{
@@ -22,7 +22,7 @@
22
22
  */
23
23
 
24
24
  /* istanbul ignore file */
25
- /* eslint-disable @typescript-eslint/no-namespace */
25
+
26
26
 
27
27
  /**
28
28
  * Core icons used in the application.
@@ -367,7 +367,6 @@ export interface RefProp<T = HTMLElement> {
367
367
 
368
368
  /* *********** */
369
369
 
370
- // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
371
370
  export type CallbackReturn<T = unknown> =
372
371
  | undefined
373
372
  | T
@@ -142,6 +142,7 @@ export const Abbr = ({
142
142
 
143
143
  /** ***************** tokenize text with abbr list *******************/
144
144
  const inner = useMemoDebugger(
145
+ // eslint-disable-next-line @typescript-eslint/promise-function-async
145
146
  () => {
146
147
  if (isString(children)) {
147
148
  if (!isEmpty(abbr)) {
@@ -96,6 +96,7 @@ export const Mark = ({ children, mark, renderer }: MarkProps) => {
96
96
 
97
97
  /** ***************** tokenize text with abbr list *******************/
98
98
  const inner = useMemoDebugger(
99
+ // eslint-disable-next-line @typescript-eslint/promise-function-async
99
100
  () => {
100
101
  if (isString(children)) {
101
102
  if (!isEmpty(mark)) {
@@ -21,14 +21,14 @@
21
21
  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
22
  */
23
23
 
24
- import { type ReactNode, Children, isValidElement } from "react";
24
+ import { Children, isValidElement } from "react";
25
25
  import { Fragment } from "react/jsx-runtime";
26
26
 
27
27
  export const cloneChildren = (
28
- children: ReactNode,
29
- callback: (child: ReactNode, index: number) => ReactNode,
30
- ): ReactNode => {
31
- return Children.map(children, (c: ReactNode) => {
28
+ children: React.ReactNode,
29
+ callback: (child: React.ReactNode, index: number) => React.ReactNode,
30
+ ): React.ReactNode => {
31
+ return Children.map(children, (c: React.ReactNode) => {
32
32
  if (isValidElement(c)) {
33
33
  if (c.type === Fragment) {
34
34
  // just compare to `Fragment`