@react-fabric/core 1.0.0-beta.57 → 1.0.0-beta.58

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 (77) hide show
  1. package/css/components/_icon.css +3 -3
  2. package/dist/cjs/components/avatar/Avatar.js +1 -0
  3. package/dist/cjs/components/badge/Badge.js +2 -10
  4. package/dist/cjs/components/button/Button.js +4 -11
  5. package/dist/cjs/components/chip/Chip.js +5 -12
  6. package/dist/cjs/components/icon/Icon.js +28 -3
  7. package/dist/cjs/components/menu/MenuItem.js +5 -12
  8. package/dist/cjs/components/panel/Panel.js +4 -13
  9. package/dist/cjs/components/tabpanel/Tab.js +3 -12
  10. package/dist/cjs/core/aside/Aside.js +2 -11
  11. package/dist/cjs/core/headfoot/HeadFoot.js +4 -2
  12. package/dist/cjs/core/page/Page.js +4 -13
  13. package/dist/cjs/index.js +1 -0
  14. package/dist/cjs/overlays/alert/Alert.js +3 -1
  15. package/dist/cjs/overlays/flyout/Flyout.js +4 -11
  16. package/dist/cjs/overlays/message/Message.js +2 -0
  17. package/dist/cjs/overlays/modal/Modal.js +4 -11
  18. package/dist/cjs/overlays/toast/Toast.js +3 -1
  19. package/dist/cjs/types/icons.js +2 -1
  20. package/dist/esm/components/avatar/Avatar.js +1 -0
  21. package/dist/esm/components/badge/Badge.js +3 -11
  22. package/dist/esm/components/button/Button.js +6 -13
  23. package/dist/esm/components/chip/Chip.js +6 -13
  24. package/dist/esm/components/icon/Icon.js +30 -6
  25. package/dist/esm/components/menu/MenuItem.js +6 -13
  26. package/dist/esm/components/panel/Panel.js +5 -14
  27. package/dist/esm/components/tabpanel/Tab.js +4 -13
  28. package/dist/esm/core/aside/Aside.js +3 -12
  29. package/dist/esm/core/headfoot/HeadFoot.js +4 -2
  30. package/dist/esm/core/page/Page.js +5 -14
  31. package/dist/esm/index.js +1 -1
  32. package/dist/esm/overlays/alert/Alert.js +3 -1
  33. package/dist/esm/overlays/flyout/Flyout.js +5 -12
  34. package/dist/esm/overlays/message/Message.js +2 -0
  35. package/dist/esm/overlays/modal/Modal.js +5 -12
  36. package/dist/esm/overlays/toast/Toast.js +3 -1
  37. package/dist/esm/types/icons.js +2 -1
  38. package/dist/types/components/badge/Badge.d.ts +8 -3
  39. package/dist/types/components/button/Button.d.ts +8 -3
  40. package/dist/types/components/chip/Chip.d.ts +8 -3
  41. package/dist/types/components/icon/Icon.d.ts +10 -4
  42. package/dist/types/components/index.d.ts +1 -1
  43. package/dist/types/components/menu/MenuItem.d.ts +1 -1
  44. package/dist/types/components/menu/types.d.ts +7 -2
  45. package/dist/types/components/panel/Panel.d.ts +8 -5
  46. package/dist/types/components/tabpanel/Tab.d.ts +8 -5
  47. package/dist/types/core/aside/Aside.d.ts +8 -5
  48. package/dist/types/core/page/Page.d.ts +8 -5
  49. package/dist/types/overlays/alert/Alert.d.ts +15 -3
  50. package/dist/types/overlays/flyout/Flyout.d.ts +5 -5
  51. package/dist/types/overlays/message/Message.d.ts +15 -3
  52. package/dist/types/overlays/modal/Modal.d.ts +5 -5
  53. package/dist/types/overlays/toast/Toast.d.ts +15 -3
  54. package/dist/types/types/icons.d.ts +2 -1
  55. package/dist/types/types/index.d.ts +0 -18
  56. package/package.json +14 -14
  57. package/src/components/avatar/Avatar.tsx +1 -1
  58. package/src/components/badge/Badge.tsx +7 -13
  59. package/src/components/button/Button.tsx +10 -18
  60. package/src/components/chip/Chip.tsx +7 -11
  61. package/src/components/icon/Icon.tsx +43 -6
  62. package/src/components/index.ts +1 -1
  63. package/src/components/menu/MenuItem.tsx +4 -9
  64. package/src/components/menu/types.ts +6 -6
  65. package/src/components/panel/Panel.tsx +7 -13
  66. package/src/components/tabpanel/Tab.tsx +6 -17
  67. package/src/core/aside/Aside.tsx +7 -13
  68. package/src/core/headfoot/HeadFoot.tsx +2 -2
  69. package/src/core/page/Page.tsx +8 -23
  70. package/src/overlays/alert/Alert.tsx +24 -5
  71. package/src/overlays/flyout/Flyout.tsx +5 -21
  72. package/src/overlays/message/Message.tsx +18 -3
  73. package/src/overlays/modal/Modal.tsx +5 -21
  74. package/src/overlays/toast/Toast.tsx +23 -4
  75. package/src/types/global.d.ts +8 -0
  76. package/src/types/icons.ts +3 -1
  77. package/src/types/index.ts +0 -19
@@ -40,6 +40,7 @@ var Toast = function Toast(_ref) {
40
40
  _ref$color = _ref.color,
41
41
  color = _ref$color === void 0 ? "primary" : _ref$color,
42
42
  icon = _ref.icon,
43
+ iconSrc = _ref.iconSrc,
43
44
  rtlFlip = _ref.rtlFlip,
44
45
  actions = _ref.actions,
45
46
  onClose = _ref.onClose,
@@ -52,6 +53,7 @@ var Toast = function Toast(_ref) {
52
53
  var iconType = useMemo(function () {
53
54
  if (icon) return /*#__PURE__*/jsx(Icon, {
54
55
  icon: icon,
56
+ iconSrc: iconSrc,
55
57
  size: "md",
56
58
  rtlFlip: rtlFlip,
57
59
  color: color + "-600"
@@ -78,7 +80,7 @@ var Toast = function Toast(_ref) {
78
80
  color: "".concat(color, "-600")
79
81
  });
80
82
  }
81
- }, [color, type, icon]);
83
+ }, [color, type, icon, iconSrc, rtlFlip]);
82
84
  var elRef = useRef(null);
83
85
  var handleClose = useCallback(function (ret) {
84
86
  elRef.current && (elRef.current.dataset.show = "false");
@@ -183,7 +183,7 @@ var CoreIcons;
183
183
  _CoreIcons.mediaAspect = "M19,12H17V15H14V17H19V12M7,9H10V7H5V12H7V9M21,3H3A2,2 0 0,0 1,5V19A2,2 0 0,0 3,21H21A2,2 0 0,0 23,19V5A2,2 0 0,0 21,3M21,19H3V5H21V19Z";
184
184
  _CoreIcons.mediaZoomer = "M15 0.004c-4.97 0-9 4.030-9 9 0 1.52 0.38 2.95 1.046 4.206l-6.258 6.256 0.005 0.005c-0.489 0.481-0.794 1.147-0.794 1.887 0 1.462 1.185 2.647 2.647 2.647 0.739 0 1.406-0.304 1.886-0.794l-0.002-0.001 6.256-6.255c1.257 0.668 2.689 1.050 4.213 1.050 4.97 0 9-4.030 9-9s-4.030-9-9-9zM3.596 22.273c-0.241 0.25-0.576 0.407-0.95 0.407-0.731 0-1.324-0.592-1.324-1.323 0-0.373 0.157-0.707 0.407-0.95l-0.007-0.006 6.050-6.050c0.529 0.713 1.159 1.343 1.87 1.874l-6.047 6.047zM15 16.505c-4.142 0-7.5-3.359-7.5-7.5s3.358-7.5 7.5-7.5c4.141 0 7.5 3.358 7.5 7.5s-3.359 7.5-7.5 7.5zM15 3.754c0.206 0 0.375 0.168 0.375 0.375s-0.169 0.375-0.375 0.375c-2.486 0-4.5 2.015-4.5 4.5 0 0.207-0.168 0.375-0.375 0.375s-0.375-0.168-0.375-0.375c0-2.9 2.35-5.25 5.25-5.25z";
185
185
  _CoreIcons.mediaOrient = "M7.34,6.41L0.86,12.9L7.35,19.38L13.84,12.9L7.34,6.41M3.69,12.9L7.35,9.24L11,12.9L7.34,16.56L3.69,12.9M19.36,6.64C17.61,4.88 15.3,4 13,4V0.76L8.76,5L13,9.24V6C14.79,6 16.58,6.68 17.95,8.05C20.68,10.78 20.68,15.22 17.95,17.95C16.58,19.32 14.79,20 13,20C12.03,20 11.06,19.79 10.16,19.39L8.67,20.88C10,21.62 11.5,22 13,22C15.3,22 17.61,21.12 19.36,19.36C22.88,15.85 22.88,10.15 19.36,6.64Z";
186
- _CoreIcons.mediaCrop = "M7,17V1H5V5H1V7H5V17A2,2 0 0,0 7,19H17V23H19V19H23V17M17,15H19V7C19,5.89 18.1,5 17,5H9V7H17V15Z";
186
+ _CoreIcons.mediaCrop = "M13,17H17V13H19V17H23V19H19V23H17V19H13V17M11,17V19H9V17H11M7,17V19H5V17H7M19,9V11H17V9H19M19,5V7H17V5H19M15,5V7H13V5H15M11,5V7H9V5H11M7,5V7H5V5H7M7,13V15H5V13H7M7,9V11H5V9H7Z";
187
187
  _CoreIcons.mediaImage = "M19,19H5V5H19M19,3H5A2,2 0 0,0 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5A2,2 0 0,0 19,3M13.96,12.29L11.21,15.83L9.25,13.47L6.5,17H17.5L13.96,12.29Z";
188
188
  _CoreIcons.mediaVideo = "M15,8V16H5V8H15M16,6H4A1,1 0 0,0 3,7V17A1,1 0 0,0 4,18H16A1,1 0 0,0 17,17V13.5L21,17.5V6.5L17,10.5V7A1,1 0 0,0 16,6Z";
189
189
  _CoreIcons.mediaAudio = "M17.3,11C17.3,14 14.76,16.1 12,16.1C9.24,16.1 6.7,14 6.7,11H5C5,14.41 7.72,17.23 11,17.72V21H13V17.72C16.28,17.23 19,14.41 19,11M10.8,4.9C10.8,4.24 11.34,3.7 12,3.7C12.66,3.7 13.2,4.24 13.2,4.9L13.19,11.1C13.19,11.76 12.66,12.3 12,12.3C11.34,12.3 10.8,11.76 10.8,11.1M12,14A3,3 0 0,0 15,11V5A3,3 0 0,0 12,2A3,3 0 0,0 9,5V11A3,3 0 0,0 12,14Z";
@@ -205,6 +205,7 @@ var CoreIcons;
205
205
  _CoreIcons.mediaVolume3 = "M14,3.23V5.29C16.89,6.15 19,8.83 19,12C19,15.17 16.89,17.84 14,18.7V20.77C18,19.86 21,16.28 21,12C21,7.72 18,4.14 14,3.23M16.5,12C16.5,10.23 15.5,8.71 14,7.97V16C15.5,15.29 16.5,13.76 16.5,12M3,9V15H7L12,20V4L7,9H3Z";
206
206
  _CoreIcons.mediaComment = "M9,22A1,1 0 0,1 8,21V18H4A2,2 0 0,1 2,16V4C2,2.89 2.9,2 4,2H20A2,2 0 0,1 22,4V16A2,2 0 0,1 20,18H13.9L10.2,21.71C10,21.9 9.75,22 9.5,22V22H9M10,16V19.08L13.08,16H20V4H4V16H10M6,7H18V9H6V7M6,11H15V13H6V11Z";
207
207
  _CoreIcons.mediaCommentAdd = "M9,22A1,1 0 0,1 8,21V18H4A2,2 0 0,1 2,16V4C2,2.89 2.9,2 4,2H20A2,2 0 0,1 22,4V16A2,2 0 0,1 20,18H13.9L10.2,21.71C10,21.9 9.75,22 9.5,22V22H9M10,16V19.08L13.08,16H20V4H4V16H10M11,6H13V9H16V11H13V14H11V11H8V9H11V6Z";
208
+ _CoreIcons.mediaCapture = "M12,10L11.06,12.06L9,13L11.06,13.94L12,16L12.94,13.94L15,13L12.94,12.06L12,10M20,5H16.83L15,3H9L7.17,5H4A2,2 0 0,0 2,7V19A2,2 0 0,0 4,21H20A2,2 0 0,0 22,19V7A2,2 0 0,0 20,5M20,19H4V7H8.05L8.64,6.35L9.88,5H14.12L15.36,6.35L15.95,7H20V19M12,8A5,5 0 0,0 7,13A5,5 0 0,0 12,18A5,5 0 0,0 17,13A5,5 0 0,0 12,8M12,16A3,3 0 0,1 9,13A3,3 0 0,1 12,10A3,3 0 0,1 15,13A3,3 0 0,1 12,16Z";
208
209
  _CoreIcons.mediaLightness = "M12,18A6,6 0 0,1 6,12A6,6 0 0,1 12,6A6,6 0 0,1 18,12A6,6 0 0,1 12,18M20,15.31L23.31,12L20,8.69V4H15.31L12,0.69L8.69,4H4V8.69L0.69,12L4,15.31V20H8.69L12,23.31L15.31,20H20V15.31Z";
209
210
  _CoreIcons.mediaColor = "M19,11.5C19,11.5 17,13.67 17,15A2,2 0 0,0 19,17A2,2 0 0,0 21,15C21,13.67 19,11.5 19,11.5M5.21,10L10,5.21L14.79,10M16.56,8.94L7.62,0L6.21,1.41L8.59,3.79L3.44,8.94C2.85,9.5 2.85,10.47 3.44,11.06L8.94,16.56C9.23,16.85 9.62,17 10,17C10.38,17 10.77,16.85 11.06,16.56L16.56,11.06C17.15,10.47 17.15,9.5 16.56,8.94Z";
210
211
  _CoreIcons.mediaInvert = "M12,19.58V19.58C10.4,19.58 8.89,18.96 7.76,17.83C6.62,16.69 6,15.19 6,13.58C6,12 6.62,10.47 7.76,9.34L12,5.1M17.66,7.93L12,2.27V2.27L6.34,7.93C3.22,11.05 3.22,16.12 6.34,19.24C7.9,20.8 9.95,21.58 12,21.58C14.05,21.58 16.1,20.8 17.66,19.24C20.78,16.12 20.78,11.05 17.66,7.93Z";
@@ -1,5 +1,6 @@
1
- import { type BadgeType, type ChildProp, type CssProp, type IconProps, type RefProp } from "../../types";
2
- export interface BadgeProps extends CssProp, RefProp, IconProps, Partial<ChildProp> {
1
+ import { type BadgeType, type ChildProp, type CssProp, type RefProp } from "../../types";
2
+ import { IconProps } from "../icon/Icon";
3
+ export interface BadgeProps extends CssProp, RefProp, Partial<ChildProp> {
3
4
  /**
4
5
  * make wrapper a block element
5
6
  */
@@ -12,6 +13,10 @@ export interface BadgeProps extends CssProp, RefProp, IconProps, Partial<ChildPr
12
13
  * badge value
13
14
  */
14
15
  value?: number | string;
16
+ /**
17
+ * icon path or props
18
+ */
19
+ icon?: IconProps;
15
20
  /**
16
21
  * max value for number display
17
22
  */
@@ -51,4 +56,4 @@ export declare const getBadgeProps: (badge?: string | number | BadgeType) => Any
51
56
  *
52
57
  * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/core-components-badge--docs} for more details.
53
58
  */
54
- export declare const Badge: ({ ref, className, value, max, ping, block, inline, placement, children, forButton, icon, iconBg, iconColor, rtlFlip, ...rest }: BadgeProps) => import("react/jsx-runtime").JSX.Element;
59
+ export declare const Badge: ({ ref, className, value, max, ping, block, inline, placement, children, forButton, icon, ...rest }: BadgeProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,7 @@
1
1
  import { type MouseEventHandler, type WheelEventHandler } from "react";
2
- import { type ColorState, type AriaProps, type BadgeType, type CallbackReturn, type CssProp, type IconProps, type PolymorphicProps, type RefProp, type SizeType, type TestProps } from "../../types";
3
- export interface BaseProps extends CssProp, AriaProps, IconProps, RefProp, TestProps {
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";
4
+ export interface BaseProps extends CssProp, AriaProps, RefProp, TestProps {
4
5
  /**
5
6
  * primary icon alignment
6
7
  */
@@ -17,6 +18,10 @@ export interface BaseProps extends CssProp, AriaProps, IconProps, RefProp, TestP
17
18
  * button color
18
19
  */
19
20
  color?: ColorState;
21
+ /**
22
+ * icon path or props
23
+ */
24
+ icon?: IconProps;
20
25
  /**
21
26
  * button type
22
27
  */
@@ -118,5 +123,5 @@ export type ButtonProps<Tag extends React.ElementType = "button"> = BaseProps &
118
123
  *
119
124
  * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/core-components-button--docs} for more details.
120
125
  */
121
- export declare const Button: <Tag extends React.ElementType = "button">({ as, ref, children, className, active, color, icon, iconBg, iconColor, iconAlign, altIcon, rtlFlip, rounded, size, disabled, loading, variant, badge, fullWidth, spinOnHover, onClick, actionMessage, preventDefault, stopPropagation, type, hotKey, showActionDone, showActionDoneEvent, tabIndex, "data-ref": dataRef, ...aria }: ButtonProps<Tag>) => import("react/jsx-runtime").JSX.Element;
126
+ export declare const Button: <Tag extends React.ElementType = "button">({ as, ref, children, className, active, color, icon, iconAlign, altIcon, rounded, size, disabled, loading, variant, badge, fullWidth, spinOnHover, onClick, actionMessage, preventDefault, stopPropagation, type, hotKey, showActionDone, showActionDoneEvent, tabIndex, "data-ref": dataRef, ...aria }: ButtonProps<Tag>) => import("react/jsx-runtime").JSX.Element;
122
127
  export {};
@@ -1,6 +1,7 @@
1
1
  import { type ReactElement } from "react";
2
- import { type AriaProps, type ChildProp, type ColorType, type CssProp, type IconProps, type PaletteType, type PolymorphicProps, type RefProp, type SizeType, type TestProps } from "../../types";
3
- export interface ChipProps extends CssProp, AriaProps, IconProps, TestProps, ChildProp<string | ReactElement>, RefProp<HTMLDivElement> {
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";
4
+ export interface ChipProps extends CssProp, AriaProps, TestProps, ChildProp<string | ReactElement>, RefProp<HTMLDivElement> {
4
5
  /**
5
6
  * chip size
6
7
  */
@@ -17,6 +18,10 @@ export interface ChipProps extends CssProp, AriaProps, IconProps, TestProps, Chi
17
18
  * full rounded edges
18
19
  */
19
20
  rounded?: boolean;
21
+ /**
22
+ * icon path or props
23
+ */
24
+ icon?: IconProps;
20
25
  /**
21
26
  * disabled state
22
27
  */
@@ -62,4 +67,4 @@ export interface ChipProps extends CssProp, AriaProps, IconProps, TestProps, Chi
62
67
  *
63
68
  * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/core-components-chip--docs} for more details.
64
69
  */
65
- export declare const Chip: <Tag extends React.ElementType = "div">({ ref, children, className, size, color, variant, icon, iconBg, iconColor, rtlFlip, disabled, onClick, onIconClick, onRemove, rounded, preventDefault, stopPropagation, as, ...aria }: ChipProps & PolymorphicProps<Tag>) => import("react/jsx-runtime").JSX.Element;
70
+ export declare const Chip: <Tag extends React.ElementType = "div">({ ref, children, className, size, color, variant, icon, disabled, onClick, onIconClick, onRemove, rounded, preventDefault, stopPropagation, as, ...aria }: ChipProps & PolymorphicProps<Tag>) => import("react/jsx-runtime").JSX.Element;
@@ -1,9 +1,13 @@
1
- import { type PaletteType, type AriaProps, type ColorType, type CssProp, type RefProp, type SizeType, type TestProps } from "../../types";
2
- export interface IconProps extends CssProp, AriaProps, RefProp, TestProps {
1
+ import { type AriaProps, type ColorType, type CssProp, type PaletteType, type RefProp, type SizeType, type TestProps } from "../../types";
2
+ export interface Props extends CssProp, AriaProps, RefProp, TestProps {
3
3
  /**
4
4
  * svg path / webfont className / 1-4 letter text
5
5
  */
6
- icon: string;
6
+ icon: string | JSX.Element;
7
+ /**
8
+ * icon image source URL, if failed to load then shows icon
9
+ */
10
+ iconSrc?: string;
7
11
  /**
8
12
  * background color (CSS color / tailwind color)
9
13
  */
@@ -38,6 +42,8 @@ export interface IconProps extends CssProp, AriaProps, RefProp, TestProps {
38
42
  */
39
43
  onClick?: React.MouseEventHandler;
40
44
  }
45
+ export type IconProps = string | Pick<Props, "icon" | "iconSrc" | "bg" | "color" | "size" | "rtlFlip" | "viewBox" | "rounded" | "animate">;
46
+ export declare const getIconProps: (props: IconProps) => Props;
41
47
  /**
42
48
  * A versatile icon component that supports SVG paths, webfont icons, and text icons.
43
49
  * It can be styled with background color, icon color, size, and animations.
@@ -67,4 +73,4 @@ export interface IconProps extends CssProp, AriaProps, RefProp, TestProps {
67
73
  *
68
74
  * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/core-components-icon--docs} for more details.
69
75
  */
70
- export declare const Icon: ({ ref, icon, bg, color, size, rtlFlip, animate, rounded, disabled, viewBox, className, onClick, ...rest }: IconProps) => import("react/jsx-runtime").JSX.Element;
76
+ export declare const Icon: ({ ref, icon, iconSrc, bg, color, size, rtlFlip, animate, rounded, disabled, viewBox, className, onClick, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
@@ -18,7 +18,7 @@ export { Divider } from "./divider/Divider";
18
18
  export { Dropdown, DropdownDismiss } from "./dropdown/Dropdown";
19
19
  export { DropdownTool } from "./dropdown/DropdownTool";
20
20
  export { EmptyContent } from "./empty/EmptyContent";
21
- export { Icon } from "./icon/Icon";
21
+ export { Icon, getIconProps } from "./icon/Icon";
22
22
  export { Image, Video } from "./media/Media";
23
23
  export { ContextMenu } from "./menu/ContextMenu";
24
24
  export { Menu } from "./menu/Menu";
@@ -21,4 +21,4 @@ import { type MenuItemProps } from "./types";
21
21
  *
22
22
  * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/core-components-menu--docs} for documentation.
23
23
  */
24
- export declare const MenuItem: <Tag extends React.ElementType = "button">({ as, label, color, className, icon, iconBg, iconColor, appendLabel, rtlFlip, altIcon, id, active, disabled, onClick, badge, hotKey, tabIndex, minimal, "data-open": childOpen, ref, ...aria }: MenuItemProps & PolymorphicProps<Tag>) => import("react/jsx-runtime").JSX.Element;
24
+ export declare const MenuItem: <Tag extends React.ElementType = "button">({ as, label, color, className, icon, appendLabel, altIcon, id, active, disabled, onClick, badge, hotKey, tabIndex, minimal, "data-open": childOpen, ref, ...aria }: MenuItemProps & PolymorphicProps<Tag>) => import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,7 @@
1
1
  import { type ElementType, type MouseEvent } from "react";
2
- import { type AriaProps, type BadgeType, type CallbackReturn, type ChildrenProp, type ColorState, type CssProp, type IconProps, type TestProps } from "../../types";
3
- export interface MenuItemProps extends CssProp, AriaProps, TestProps, IconProps {
2
+ import { type AriaProps, type BadgeType, type CallbackReturn, type ChildrenProp, type ColorState, type CssProp, type TestProps } from "../../types";
3
+ import { IconProps } from "../icon/Icon";
4
+ export interface MenuItemProps extends CssProp, AriaProps, TestProps {
4
5
  /**
5
6
  * menu id passed via menu.onClick
6
7
  */
@@ -17,6 +18,10 @@ export interface MenuItemProps extends CssProp, AriaProps, TestProps, IconProps
17
18
  * menu color
18
19
  */
19
20
  color?: ColorState;
21
+ /**
22
+ * icon path or props
23
+ */
24
+ icon?: IconProps;
20
25
  /**
21
26
  * item active
22
27
  */
@@ -1,7 +1,8 @@
1
1
  import { type ContentProps } from "../../core/content/Content";
2
2
  import { type HeadFootProps } from "../../core/headfoot/HeadFoot";
3
- import { type AriaProps, type ChildrenProp, type CollapseProps, type CssProp, type ExpandProps, type IconProps, type TestProps } from "../../types";
4
- export interface PanelProps extends CssProp, AriaProps, TestProps, IconProps, ExpandProps, CollapseProps, ChildrenProp<HeadFootProps | ContentProps> {
3
+ import { type AriaProps, type ChildrenProp, type CollapseProps, type CssProp, type ExpandProps, type TestProps } from "../../types";
4
+ import { IconProps } from "../icon/Icon";
5
+ export interface PanelProps extends CssProp, AriaProps, TestProps, ExpandProps, CollapseProps, ChildrenProp<HeadFootProps | ContentProps> {
5
6
  /**
6
7
  * panel id used by panel stack
7
8
  */
@@ -22,6 +23,10 @@ export interface PanelProps extends CssProp, AriaProps, TestProps, IconProps, Ex
22
23
  * title css classname(s)
23
24
  */
24
25
  titleClassName?: string;
26
+ /**
27
+ * icon path or props
28
+ */
29
+ icon?: IconProps;
25
30
  /**
26
31
  * loading state
27
32
  */
@@ -71,8 +76,6 @@ export interface PanelProps extends CssProp, AriaProps, TestProps, IconProps, Ex
71
76
  * <Panel
72
77
  * title="Panel Title"
73
78
  * icon={CoreIcons.info}
74
- * iconBg="bg-blue-500"
75
- * iconColor="text-white"
76
79
  * actions={<button>Action</button>}
77
80
  * expandable
78
81
  * collapsable
@@ -92,4 +95,4 @@ export interface PanelProps extends CssProp, AriaProps, TestProps, IconProps, Ex
92
95
  *
93
96
  * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/core-components-panel--docs} for more details.
94
97
  */
95
- export declare const Panel: ({ children, className, titleClassName, headerClassName, title, actions, icon, iconBg, iconColor, rtlFlip, panelId, height, width, minHeight, minWidth, maxHeight, maxWidth, loading, expandable, expanded: _expanded, onExpand, collapsable, collapsed: _collapsed, onCollapse, onClose, onBack, ...aria }: PanelProps) => import("react/jsx-runtime").JSX.Element;
98
+ export declare const Panel: ({ children, className, titleClassName, headerClassName, title, actions, icon, panelId, height, width, minHeight, minWidth, maxHeight, maxWidth, loading, expandable, expanded: _expanded, onExpand, collapsable, collapsed: _collapsed, onCollapse, onClose, onBack, ...aria }: PanelProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,7 @@
1
1
  import { type ReactElement } from "react";
2
- import { type AriaProps, type BadgeType, type CallbackReturn, type ChildrenProp, type ColorState, type CssProp, type IconProps, type PolymorphicProps, type RefProp, type TestProps, type TooltipProp } from "../../types";
3
- export interface TabProps extends Partial<ChildrenProp>, CssProp, RefProp, AriaProps, TestProps, IconProps, TooltipProp {
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";
4
+ export interface TabProps extends Partial<ChildrenProp>, CssProp, RefProp, AriaProps, TestProps, TooltipProp {
4
5
  /**
5
6
  * tab id
6
7
  */
@@ -13,6 +14,10 @@ export interface TabProps extends Partial<ChildrenProp>, CssProp, RefProp, AriaP
13
14
  * tab color
14
15
  */
15
16
  color?: ColorState;
17
+ /**
18
+ * icon path or props
19
+ */
20
+ icon?: IconProps;
16
21
  /**
17
22
  * tab badge
18
23
  */
@@ -56,8 +61,6 @@ export interface TabProps extends Partial<ChildrenProp>, CssProp, RefProp, AriaP
56
61
  * id="tab1"
57
62
  * label="Tab 1"
58
63
  * icon="home"
59
- * iconBg="bg-blue-500"
60
- * iconColor="text-white"
61
64
  * badge="New"
62
65
  * onClick={(id) => console.log(`Tab clicked: ${id}`)}
63
66
  * onClose={() => console.log("Tab closed")}
@@ -73,4 +76,4 @@ export interface TabProps extends Partial<ChildrenProp>, CssProp, RefProp, AriaP
73
76
  *
74
77
  * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/core-components-tabpanel--docs} for more details.
75
78
  */
76
- export declare const Tab: <Tag extends React.ElementType = "button">({ ref, as, id, className, label, icon, iconBg, iconColor, rtlFlip, badge, disabled, onClose, active, onClick, tabFlex, color, actions, tooltip, activeClassName, ...aria }: TabProps & PolymorphicProps<Tag>) => import("react/jsx-runtime").JSX.Element;
79
+ export declare const Tab: <Tag extends React.ElementType = "button">({ ref, as, id, className, label, icon, badge, disabled, onClose, active, onClick, tabFlex, color, actions, tooltip, activeClassName, ...aria }: TabProps & PolymorphicProps<Tag>) => import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,7 @@
1
1
  import { type ReactNode } from "react";
2
- import { type ChildrenProp, type CollapseProps, type CssProp, type Elements, type IconProps, type TestProps } from "../../types";
3
- export interface AsideProps extends IconProps, ChildrenProp, CollapseProps, CssProp, TestProps {
2
+ import { IconProps } from "../../components/icon/Icon";
3
+ import { type ChildrenProp, type CollapseProps, type CssProp, type Elements, type TestProps } from "../../types";
4
+ export interface AsideProps extends ChildrenProp, CollapseProps, CssProp, TestProps {
4
5
  /**
5
6
  * page title
6
7
  */
@@ -9,6 +10,10 @@ export interface AsideProps extends IconProps, ChildrenProp, CollapseProps, CssP
9
10
  * align inline-end
10
11
  */
11
12
  align?: "start" | "end";
13
+ /**
14
+ * icon path or props
15
+ */
16
+ icon?: IconProps;
12
17
  /**
13
18
  * header actions
14
19
  */
@@ -63,8 +68,6 @@ export interface AsideProps extends IconProps, ChildrenProp, CollapseProps, CssP
63
68
  * <Aside
64
69
  * title="Sidebar Title"
65
70
  * icon={CoreIcons.menu}
66
- * iconBg="bg-gray-200"
67
- * iconColor="text-gray-800"
68
71
  * rtlFlip={true}
69
72
  * className="custom-aside"
70
73
  * bodyClassName="custom-aside-body"
@@ -90,4 +93,4 @@ export interface AsideProps extends IconProps, ChildrenProp, CollapseProps, CssP
90
93
  *
91
94
  * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-application--aside} for more details.
92
95
  */
93
- export declare const Aside: ({ children, title, icon, iconBg, iconColor, rtlFlip, className, bodyClassName, headerClassName, resizeable, flyout, onFlyout, collapsed, collapsable, onCollapse, actions, loading, align, width: wd, minWidth, maxWidth, "data-testid": testId, "data-test-value": testValue, }: AsideProps) => import("react/jsx-runtime").JSX.Element;
96
+ export declare const Aside: ({ children, title, icon, className, bodyClassName, headerClassName, resizeable, flyout, onFlyout, collapsed, collapsable, onCollapse, actions, loading, align, width: wd, minWidth, maxWidth, "data-testid": testId, "data-test-value": testValue, }: AsideProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,6 @@
1
- import { type ChildrenProp, type IconProps, type RefProp, type TestProps } from "../../types";
2
- export interface PageProps extends IconProps, ChildrenProp, TestProps, RefProp<HTMLDivElement> {
1
+ import { IconProps } from "../../components/icon/Icon";
2
+ import { type ChildrenProp, type RefProp, type TestProps } from "../../types";
3
+ export interface PageProps extends ChildrenProp, TestProps, RefProp<HTMLDivElement> {
3
4
  /**
4
5
  * page title
5
6
  */
@@ -12,6 +13,10 @@ export interface PageProps extends IconProps, ChildrenProp, TestProps, RefProp<H
12
13
  * paper style drop shadow
13
14
  */
14
15
  paper?: boolean;
16
+ /**
17
+ * icon path or props
18
+ */
19
+ icon?: IconProps;
15
20
  /**
16
21
  * loading indicator
17
22
  */
@@ -31,8 +36,6 @@ export interface PageProps extends IconProps, ChildrenProp, TestProps, RefProp<H
31
36
  * <Page
32
37
  * title="My Page"
33
38
  * icon="home"
34
- * iconBg="bg-blue-500"
35
- * iconColor="text-white"
36
39
  * loading={false}
37
40
  * paper={true}
38
41
  * data-testid="my-page"
@@ -45,4 +48,4 @@ export interface PageProps extends IconProps, ChildrenProp, TestProps, RefProp<H
45
48
  *
46
49
  * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-application--page} for more details.
47
50
  */
48
- export declare const Page: ({ ref, children, paper, title, titleClassName, icon, rtlFlip, iconBg, iconColor, loading, "data-testid": testId, "data-test-value": testValue, ...rest }: PageProps) => import("react/jsx-runtime").JSX.Element;
51
+ export declare const Page: ({ ref, children, paper, title, titleClassName, icon, loading, "data-testid": testId, "data-test-value": testValue, ...rest }: PageProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,9 +1,21 @@
1
- import { type ColorState, type Elements, type IconProps } from "../../types";
2
- export interface AlertProps extends Omit<IconProps, "iconBg" | "iconColor"> {
1
+ import { type ColorState, type Elements } from "../../types";
2
+ export interface AlertProps {
3
3
  /**
4
4
  * toast type
5
5
  */
6
6
  type?: "alert" | "confirm" | "prompt";
7
+ /**
8
+ * svg path / webfont className / 1-4 letter text
9
+ */
10
+ icon: string;
11
+ /**
12
+ * icon image source URL, if failed to load then shows icon
13
+ */
14
+ iconSrc?: string;
15
+ /**
16
+ * flip icon in rtl
17
+ */
18
+ rtlFlip?: boolean;
7
19
  /**
8
20
  * toast title
9
21
  */
@@ -37,4 +49,4 @@ export interface AlertProps extends Omit<IconProps, "iconBg" | "iconColor"> {
37
49
  */
38
50
  defaultValue?: string;
39
51
  }
40
- export declare const Alert: ({ title, message, color, icon, rtlFlip, actions, onClose, type, okLabel, cancelLabel, placeholder, defaultValue, }: AlertProps) => import("react/jsx-runtime").JSX.Element;
52
+ export declare const Alert: ({ title, message, color, icon, iconSrc, rtlFlip, actions, onClose, type, okLabel, cancelLabel, placeholder, defaultValue, }: AlertProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,7 @@
1
- import { type ElementType } from "react";
2
- import { type AriaProps, type CallbackReturn, type ChildrenProp, type Elements, type IconProps, type TestProps } from "../../types";
3
- export interface FlyoutProps extends AriaProps, TestProps, Omit<IconProps, "icon">, ChildrenProp {
4
- icon?: string | ElementType<IconProps>;
1
+ import { IconProps } from "../../components/icon/Icon";
2
+ import { type AriaProps, type CallbackReturn, type ChildrenProp, type Elements, type TestProps } from "../../types";
3
+ export interface FlyoutProps extends AriaProps, TestProps, ChildrenProp {
4
+ icon?: IconProps;
5
5
  /**
6
6
  * flyout alignment
7
7
  */
@@ -59,4 +59,4 @@ export interface FlyoutProps extends AriaProps, TestProps, Omit<IconProps, "icon
59
59
  */
60
60
  onBeforeClose?: (...args: AnyObject) => CallbackReturn;
61
61
  }
62
- export declare const Flyout: ({ icon, iconBg, iconColor, iconClassName, rtlFlip, title, actions, closeOnClick, headerClassName, onClose, onBeforeClose, children, loading, size, width, minWidth, root, hideMask, align, ...aria }: FlyoutProps) => import("react/jsx-runtime").JSX.Element;
62
+ export declare const Flyout: ({ icon, iconClassName, title, actions, closeOnClick, headerClassName, onClose, onBeforeClose, children, loading, size, width, minWidth, root, hideMask, align, ...aria }: FlyoutProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,17 @@
1
- import { type ColorState, type Elements, type IconProps } from "../../types";
2
- export interface MessageProps extends Omit<IconProps, "iconBg" | "iconColor"> {
1
+ import { type ColorState, type Elements } from "../../types";
2
+ export interface MessageProps {
3
+ /**
4
+ * svg path / webfont className / 1-4 letter text
5
+ */
6
+ icon: string;
7
+ /**
8
+ * icon image source URL, if failed to load then shows icon
9
+ */
10
+ iconSrc?: string;
11
+ /**
12
+ * flip icon in rtl
13
+ */
14
+ rtlFlip?: boolean;
3
15
  /**
4
16
  * message title
5
17
  */
@@ -17,4 +29,4 @@ export interface MessageProps extends Omit<IconProps, "iconBg" | "iconColor"> {
17
29
  */
18
30
  actions?: Elements<JSX.Element>;
19
31
  }
20
- export declare const Message: ({ title, message, color, icon, rtlFlip, actions, onClose, }: MessageProps) => import("react/jsx-runtime").JSX.Element;
32
+ export declare const Message: ({ title, message, color, icon, iconSrc, rtlFlip, actions, onClose, }: MessageProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,7 @@
1
- import { type ElementType } from "react";
2
- import { type AriaProps, type CallbackReturn, type ChildrenProp, type Elements, type IconProps, type TestProps } from "../../types";
3
- export interface ModalProps extends AriaProps, TestProps, Omit<IconProps, "icon">, ChildrenProp {
4
- icon?: string | ElementType<IconProps>;
1
+ import { IconProps } from "../../components/icon/Icon";
2
+ import { type AriaProps, type CallbackReturn, type ChildrenProp, type Elements, type TestProps } from "../../types";
3
+ export interface ModalProps extends AriaProps, TestProps, ChildrenProp {
4
+ icon?: IconProps;
5
5
  /**
6
6
  * header className
7
7
  */
@@ -59,4 +59,4 @@ export interface ModalProps extends AriaProps, TestProps, Omit<IconProps, "icon"
59
59
  */
60
60
  onBeforeClose?: (...args: AnyObject) => CallbackReturn;
61
61
  }
62
- export declare const Modal: ({ icon, iconBg, iconColor, iconClassName, rtlFlip, title, actions, headerClassName, onClose, onBeforeClose, children, loading, root, size, hideMask, width, height, minHeight, minWidth, ...aria }: ModalProps) => import("react/jsx-runtime").JSX.Element;
62
+ export declare const Modal: ({ icon, iconClassName, title, actions, headerClassName, onClose, onBeforeClose, children, loading, root, size, hideMask, width, height, minHeight, minWidth, ...aria }: ModalProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,9 +1,21 @@
1
- import { type ColorState, type Elements, type IconProps } from "../../types";
2
- export interface ToastProps extends Omit<IconProps, "iconBg" | "iconColor"> {
1
+ import { type ColorState, type Elements } from "../../types";
2
+ export interface ToastProps {
3
3
  /**
4
4
  * toast type
5
5
  */
6
6
  type?: "alert" | "confirm";
7
+ /**
8
+ * svg path / webfont className / 1-4 letter text
9
+ */
10
+ icon: string;
11
+ /**
12
+ * icon image source URL, if failed to load then shows icon
13
+ */
14
+ iconSrc?: string;
15
+ /**
16
+ * flip icon in rtl
17
+ */
18
+ rtlFlip?: boolean;
7
19
  /**
8
20
  * toast title
9
21
  */
@@ -29,4 +41,4 @@ export interface ToastProps extends Omit<IconProps, "iconBg" | "iconColor"> {
29
41
  */
30
42
  cancelLabel?: string;
31
43
  }
32
- export declare const Toast: ({ title, message, color, icon, rtlFlip, actions, onClose, onCloseAll, type, okLabel, cancelLabel, }: ToastProps) => import("react/jsx-runtime").JSX.Element;
44
+ export declare const Toast: ({ title, message, color, icon, iconSrc, rtlFlip, actions, onClose, onCloseAll, type, okLabel, cancelLabel, }: ToastProps) => import("react/jsx-runtime").JSX.Element;
@@ -180,7 +180,7 @@ export declare namespace CoreIcons {
180
180
  const mediaAspect = "M19,12H17V15H14V17H19V12M7,9H10V7H5V12H7V9M21,3H3A2,2 0 0,0 1,5V19A2,2 0 0,0 3,21H21A2,2 0 0,0 23,19V5A2,2 0 0,0 21,3M21,19H3V5H21V19Z";
181
181
  const mediaZoomer = "M15 0.004c-4.97 0-9 4.030-9 9 0 1.52 0.38 2.95 1.046 4.206l-6.258 6.256 0.005 0.005c-0.489 0.481-0.794 1.147-0.794 1.887 0 1.462 1.185 2.647 2.647 2.647 0.739 0 1.406-0.304 1.886-0.794l-0.002-0.001 6.256-6.255c1.257 0.668 2.689 1.050 4.213 1.050 4.97 0 9-4.030 9-9s-4.030-9-9-9zM3.596 22.273c-0.241 0.25-0.576 0.407-0.95 0.407-0.731 0-1.324-0.592-1.324-1.323 0-0.373 0.157-0.707 0.407-0.95l-0.007-0.006 6.050-6.050c0.529 0.713 1.159 1.343 1.87 1.874l-6.047 6.047zM15 16.505c-4.142 0-7.5-3.359-7.5-7.5s3.358-7.5 7.5-7.5c4.141 0 7.5 3.358 7.5 7.5s-3.359 7.5-7.5 7.5zM15 3.754c0.206 0 0.375 0.168 0.375 0.375s-0.169 0.375-0.375 0.375c-2.486 0-4.5 2.015-4.5 4.5 0 0.207-0.168 0.375-0.375 0.375s-0.375-0.168-0.375-0.375c0-2.9 2.35-5.25 5.25-5.25z";
182
182
  const mediaOrient = "M7.34,6.41L0.86,12.9L7.35,19.38L13.84,12.9L7.34,6.41M3.69,12.9L7.35,9.24L11,12.9L7.34,16.56L3.69,12.9M19.36,6.64C17.61,4.88 15.3,4 13,4V0.76L8.76,5L13,9.24V6C14.79,6 16.58,6.68 17.95,8.05C20.68,10.78 20.68,15.22 17.95,17.95C16.58,19.32 14.79,20 13,20C12.03,20 11.06,19.79 10.16,19.39L8.67,20.88C10,21.62 11.5,22 13,22C15.3,22 17.61,21.12 19.36,19.36C22.88,15.85 22.88,10.15 19.36,6.64Z";
183
- const mediaCrop = "M7,17V1H5V5H1V7H5V17A2,2 0 0,0 7,19H17V23H19V19H23V17M17,15H19V7C19,5.89 18.1,5 17,5H9V7H17V15Z";
183
+ const mediaCrop = "M13,17H17V13H19V17H23V19H19V23H17V19H13V17M11,17V19H9V17H11M7,17V19H5V17H7M19,9V11H17V9H19M19,5V7H17V5H19M15,5V7H13V5H15M11,5V7H9V5H11M7,5V7H5V5H7M7,13V15H5V13H7M7,9V11H5V9H7Z";
184
184
  const mediaImage = "M19,19H5V5H19M19,3H5A2,2 0 0,0 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5A2,2 0 0,0 19,3M13.96,12.29L11.21,15.83L9.25,13.47L6.5,17H17.5L13.96,12.29Z";
185
185
  const mediaVideo = "M15,8V16H5V8H15M16,6H4A1,1 0 0,0 3,7V17A1,1 0 0,0 4,18H16A1,1 0 0,0 17,17V13.5L21,17.5V6.5L17,10.5V7A1,1 0 0,0 16,6Z";
186
186
  const mediaAudio = "M17.3,11C17.3,14 14.76,16.1 12,16.1C9.24,16.1 6.7,14 6.7,11H5C5,14.41 7.72,17.23 11,17.72V21H13V17.72C16.28,17.23 19,14.41 19,11M10.8,4.9C10.8,4.24 11.34,3.7 12,3.7C12.66,3.7 13.2,4.24 13.2,4.9L13.19,11.1C13.19,11.76 12.66,12.3 12,12.3C11.34,12.3 10.8,11.76 10.8,11.1M12,14A3,3 0 0,0 15,11V5A3,3 0 0,0 12,2A3,3 0 0,0 9,5V11A3,3 0 0,0 12,14Z";
@@ -202,6 +202,7 @@ export declare namespace CoreIcons {
202
202
  const mediaVolume3 = "M14,3.23V5.29C16.89,6.15 19,8.83 19,12C19,15.17 16.89,17.84 14,18.7V20.77C18,19.86 21,16.28 21,12C21,7.72 18,4.14 14,3.23M16.5,12C16.5,10.23 15.5,8.71 14,7.97V16C15.5,15.29 16.5,13.76 16.5,12M3,9V15H7L12,20V4L7,9H3Z";
203
203
  const mediaComment = "M9,22A1,1 0 0,1 8,21V18H4A2,2 0 0,1 2,16V4C2,2.89 2.9,2 4,2H20A2,2 0 0,1 22,4V16A2,2 0 0,1 20,18H13.9L10.2,21.71C10,21.9 9.75,22 9.5,22V22H9M10,16V19.08L13.08,16H20V4H4V16H10M6,7H18V9H6V7M6,11H15V13H6V11Z";
204
204
  const mediaCommentAdd = "M9,22A1,1 0 0,1 8,21V18H4A2,2 0 0,1 2,16V4C2,2.89 2.9,2 4,2H20A2,2 0 0,1 22,4V16A2,2 0 0,1 20,18H13.9L10.2,21.71C10,21.9 9.75,22 9.5,22V22H9M10,16V19.08L13.08,16H20V4H4V16H10M11,6H13V9H16V11H13V14H11V11H8V9H11V6Z";
205
+ const mediaCapture = "M12,10L11.06,12.06L9,13L11.06,13.94L12,16L12.94,13.94L15,13L12.94,12.06L12,10M20,5H16.83L15,3H9L7.17,5H4A2,2 0 0,0 2,7V19A2,2 0 0,0 4,21H20A2,2 0 0,0 22,19V7A2,2 0 0,0 20,5M20,19H4V7H8.05L8.64,6.35L9.88,5H14.12L15.36,6.35L15.95,7H20V19M12,8A5,5 0 0,0 7,13A5,5 0 0,0 12,18A5,5 0 0,0 17,13A5,5 0 0,0 12,8M12,16A3,3 0 0,1 9,13A3,3 0 0,1 12,10A3,3 0 0,1 15,13A3,3 0 0,1 12,16Z";
205
206
  const mediaLightness = "M12,18A6,6 0 0,1 6,12A6,6 0 0,1 12,6A6,6 0 0,1 18,12A6,6 0 0,1 12,18M20,15.31L23.31,12L20,8.69V4H15.31L12,0.69L8.69,4H4V8.69L0.69,12L4,15.31V20H8.69L12,23.31L15.31,20H20V15.31Z";
206
207
  const mediaColor = "M19,11.5C19,11.5 17,13.67 17,15A2,2 0 0,0 19,17A2,2 0 0,0 21,15C21,13.67 19,11.5 19,11.5M5.21,10L10,5.21L14.79,10M16.56,8.94L7.62,0L6.21,1.41L8.59,3.79L3.44,8.94C2.85,9.5 2.85,10.47 3.44,11.06L8.94,16.56C9.23,16.85 9.62,17 10,17C10.38,17 10.77,16.85 11.06,16.56L16.56,11.06C17.15,10.47 17.15,9.5 16.56,8.94Z";
207
208
  const mediaInvert = "M12,19.58V19.58C10.4,19.58 8.89,18.96 7.76,17.83C6.62,16.69 6,15.19 6,13.58C6,12 6.62,10.47 7.76,9.34L12,5.1M17.66,7.93L12,2.27V2.27L6.34,7.93C3.22,11.05 3.22,16.12 6.34,19.24C7.9,20.8 9.95,21.58 12,21.58C14.05,21.58 16.1,20.8 17.66,19.24C20.78,16.12 20.78,11.05 17.66,7.93Z";
@@ -84,24 +84,6 @@ export type PolymorphicProps<AsTag extends ReactTag> = Omit<PropsOf<AsTag>, "chi
84
84
  */
85
85
  as?: AsTag;
86
86
  };
87
- export interface IconProps {
88
- /**
89
- * svg path / image url
90
- */
91
- icon?: string;
92
- /**
93
- * flip icon in rtl
94
- */
95
- rtlFlip?: boolean;
96
- /**
97
- * icon background color
98
- */
99
- iconBg?: ColorType | PaletteType | string;
100
- /**
101
- * icon color
102
- */
103
- iconColor?: ColorType | PaletteType | string;
104
- }
105
87
  export interface CollapseProps {
106
88
  /**
107
89
  * Allow collapsing
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-fabric/core",
3
- "version": "1.0.0-beta.57",
3
+ "version": "1.0.0-beta.58",
4
4
  "description": "RUF: Core package",
5
5
  "author": "Adarsh Pastakia <adarshpastakia@outlook.com>",
6
6
  "license": "MIT",
@@ -35,24 +35,24 @@
35
35
  "watch": "npm-run-all -p watch:rollup watch:dts"
36
36
  },
37
37
  "dependencies": {
38
- "@floating-ui/react": "^0.27.12",
39
- "@react-fabric/utilities": "^1.0.0-beta.52",
40
- "@tailwindcss/postcss": "~4.1.8",
41
- "boring-avatars": "^1.11.2",
42
- "classnames": "^2.5.1",
43
- "color": "^4.2.3",
44
- "resize-observer-polyfill": "^1.5.1",
45
- "tailwindcss": "^4.1.8"
38
+ "@floating-ui/react": "~0.27.16",
39
+ "@react-fabric/utilities": "^1.0.0-beta.58",
40
+ "@tailwindcss/postcss": "~4.1.16",
41
+ "boring-avatars": "~1.11.2",
42
+ "classnames": "~2.5.1",
43
+ "color": "~5.0.2",
44
+ "resize-observer-polyfill": "~1.5.1",
45
+ "tailwindcss": "~4.1.16"
46
46
  },
47
47
  "peerDependencies": {
48
- "i18next": "^25.2.1",
49
- "react": "^19.0.0",
50
- "react-dom": "^19.0.0",
51
- "react-i18next": "^15.5.2"
48
+ "i18next": "~25.6.0",
49
+ "react": "~19.2.0",
50
+ "react-dom": "~19.2.0",
51
+ "react-i18next": "~16.2.1"
52
52
  },
53
53
  "engines": {
54
54
  "node": ">=18.12.0",
55
55
  "npm": ">=8.19.0"
56
56
  },
57
- "gitHead": "9b596a0a8d6cecaa8479f80c495b64fb42ce739f"
57
+ "gitHead": "7e66f8c498e37a40e410ecafff2ea6b31505dc1a"
58
58
  }
@@ -185,7 +185,7 @@ export const Avatar = ({
185
185
  const fallbackAvatar = useMemo(() => {
186
186
  if (fallbackIcon) {
187
187
  return isSvgPath(fallbackIcon) ? (
188
- <svg viewBox={viewBox}>
188
+ <svg viewBox={viewBox} className="p-[0.125em]">
189
189
  <path fill="currentColor" d={fallbackIcon.toString()} />
190
190
  </svg>
191
191
  ) : (
@@ -28,16 +28,11 @@ import {
28
28
  type BadgeType,
29
29
  type ChildProp,
30
30
  type CssProp,
31
- type IconProps,
32
31
  type RefProp,
33
32
  } from "../../types";
34
- import { Icon } from "../icon/Icon";
33
+ import { getIconProps, Icon, IconProps } from "../icon/Icon";
35
34
 
36
- export interface BadgeProps
37
- extends CssProp,
38
- RefProp,
39
- IconProps,
40
- Partial<ChildProp> {
35
+ export interface BadgeProps extends CssProp, RefProp, Partial<ChildProp> {
41
36
  /**
42
37
  * make wrapper a block element
43
38
  */
@@ -50,6 +45,10 @@ export interface BadgeProps
50
45
  * badge value
51
46
  */
52
47
  value?: number | string;
48
+ /**
49
+ * icon path or props
50
+ */
51
+ icon?: IconProps;
53
52
  /**
54
53
  * max value for number display
55
54
  */
@@ -124,9 +123,6 @@ export const Badge = ({
124
123
  // @ts-expect-error ignore
125
124
  forButton = false,
126
125
  icon,
127
- iconBg,
128
- iconColor,
129
- rtlFlip,
130
126
  ...rest
131
127
  }: BadgeProps) => {
132
128
  const label = useMemo(() => {
@@ -176,9 +172,7 @@ export const Badge = ({
176
172
  )}
177
173
  >
178
174
  {label && <span className="p-1">{label}</span>}
179
- {icon && (
180
- <Icon icon={icon} bg={iconBg} color={iconColor} rtlFlip={rtlFlip} />
181
- )}
175
+ {icon && <Icon {...getIconProps(icon)} />}
182
176
  </div>
183
177
  )}
184
178
  </div>