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

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 (82) hide show
  1. package/css/components/_button.css +10 -2
  2. package/css/components/_icon.css +1 -1
  3. package/css/reset/_reset.css +1 -1
  4. package/css/reset/_theme.css +3 -3
  5. package/css/styles.css +2 -0
  6. package/css/theme/_colors.css +2 -2
  7. package/dist/cjs/components/animations/Animations.js +54 -49
  8. package/dist/cjs/components/button/Button.js +1 -1
  9. package/dist/cjs/components/callout/Callout.js +4 -4
  10. package/dist/cjs/components/collapsable/Collapsable.js +4 -5
  11. package/dist/cjs/components/dropdown/DropdownTool.js +1 -2
  12. package/dist/cjs/components/media/Media.js +9 -8
  13. package/dist/cjs/components/menu/Menu.js +1 -2
  14. package/dist/cjs/components/menu/MenuItem.js +0 -1
  15. package/dist/cjs/components/navigator/Navigator.js +2 -3
  16. package/dist/cjs/components/panel/Panel.js +7 -7
  17. package/dist/cjs/components/tabpanel/Tab.js +0 -1
  18. package/dist/cjs/core/aside/Aside.js +3 -4
  19. package/dist/cjs/core/page/Page.js +1 -1
  20. package/dist/cjs/hooks/useStepper.js +0 -1
  21. package/dist/cjs/index.js +3 -8
  22. package/dist/cjs/overlays/alert/Alert.js +1 -2
  23. package/dist/cjs/overlays/flyout/Flyout.js +2 -3
  24. package/dist/cjs/overlays/modal/Modal.js +2 -3
  25. package/dist/cjs/overlays/toast/Toast.js +2 -3
  26. package/dist/cjs/overlays/tooltip/Tooltip.js +1 -2
  27. package/dist/cjs/typography/Copy.js +1 -2
  28. package/dist/esm/components/animations/Animations.js +51 -47
  29. package/dist/esm/components/button/Button.js +1 -1
  30. package/dist/esm/components/callout/Callout.js +4 -4
  31. package/dist/esm/components/collapsable/Collapsable.js +4 -5
  32. package/dist/esm/components/dropdown/DropdownTool.js +1 -2
  33. package/dist/esm/components/media/Media.js +9 -8
  34. package/dist/esm/components/menu/Menu.js +1 -2
  35. package/dist/esm/components/menu/MenuItem.js +0 -1
  36. package/dist/esm/components/navigator/Navigator.js +2 -3
  37. package/dist/esm/components/panel/Panel.js +8 -8
  38. package/dist/esm/components/tabpanel/Tab.js +0 -1
  39. package/dist/esm/core/aside/Aside.js +4 -5
  40. package/dist/esm/core/page/Page.js +2 -2
  41. package/dist/esm/hooks/useStepper.js +0 -1
  42. package/dist/esm/index.js +1 -2
  43. package/dist/esm/overlays/alert/Alert.js +1 -2
  44. package/dist/esm/overlays/flyout/Flyout.js +3 -4
  45. package/dist/esm/overlays/modal/Modal.js +3 -4
  46. package/dist/esm/overlays/toast/Toast.js +2 -3
  47. package/dist/esm/overlays/tooltip/Tooltip.js +1 -2
  48. package/dist/esm/typography/Copy.js +1 -2
  49. package/dist/types/components/animations/Animations.d.ts +28 -9
  50. package/dist/types/components/collapsable/Collapsable.d.ts +2 -2
  51. package/dist/types/components/index.d.ts +1 -1
  52. package/dist/types/components/panel/Panel.d.ts +1 -1
  53. package/dist/types/core/aside/Aside.d.ts +1 -1
  54. package/dist/types/index.d.ts +0 -1
  55. package/dist/types/types/index.d.ts +9 -3
  56. package/package.json +6 -3
  57. package/src/components/animations/Animations.tsx +53 -45
  58. package/src/components/button/Button.tsx +1 -1
  59. package/src/components/callout/Callout.tsx +4 -5
  60. package/src/components/collapsable/Collapsable.tsx +4 -5
  61. package/src/components/dropdown/DropdownTool.tsx +1 -2
  62. package/src/components/index.ts +3 -3
  63. package/src/components/media/Media.tsx +7 -8
  64. package/src/components/menu/Menu.tsx +1 -2
  65. package/src/components/navigator/Navigator.tsx +2 -3
  66. package/src/components/panel/Panel.tsx +14 -8
  67. package/src/core/aside/Aside.tsx +4 -5
  68. package/src/core/page/Page.tsx +2 -2
  69. package/src/index.ts +0 -1
  70. package/src/overlays/alert/Alert.tsx +1 -2
  71. package/src/overlays/flyout/Flyout.tsx +3 -4
  72. package/src/overlays/modal/Modal.tsx +3 -4
  73. package/src/overlays/toast/Toast.tsx +2 -3
  74. package/src/overlays/tooltip/Tooltip.tsx +1 -2
  75. package/src/types/index.ts +32 -2
  76. package/src/typography/Copy.tsx +1 -2
  77. package/css/flags.rect.css +0 -1607
  78. package/css/flags.wavy.css +0 -1606
  79. package/dist/cjs/types/icons.js +0 -212
  80. package/dist/esm/types/icons.js +0 -214
  81. package/dist/types/types/icons.d.ts +0 -210
  82. package/src/types/icons.ts +0 -451
@@ -9,7 +9,6 @@ import { useTranslation } from 'react-i18next';
9
9
  import { AnimationIndicator } from '../../components/animations/Animations.js';
10
10
  import { Button } from '../../components/button/Button.js';
11
11
  import { Icon } from '../../components/icon/Icon.js';
12
- import { CoreIcons } from '../../types/icons.js';
13
12
  import { Title } from '../../typography/Title.js';
14
13
  import { jsx, jsxs } from 'react/jsx-runtime';
15
14
  import { getColor } from '../../utils/getColor.js';
@@ -180,7 +179,7 @@ var Alert = function Alert(_ref) {
180
179
  onClick: function onClick() {
181
180
  return handleClose(false);
182
181
  },
183
- icon: CoreIcons.close,
182
+ icon: "icon-[mdi--close]",
184
183
  "aria-label": "close"
185
184
  })
186
185
  })]
@@ -6,11 +6,10 @@ import { useFloating, useDismiss, useRole, useInteractions, FloatingPortal, Floa
6
6
  import { isString } from '@react-fabric/utilities';
7
7
  import classNames from 'classnames';
8
8
  import { useCallback, useEffect, isValidElement } from 'react';
9
- import { Loading } from '../../components/animations/Animations.js';
9
+ import { LoadingLine } from '../../components/animations/Animations.js';
10
10
  import { Icon, getIconProps } from '../../components/icon/Icon.js';
11
11
  import { Header } from '../../core/headfoot/HeadFoot.js';
12
12
  import { HotKeyWrapper } from '../../hotkeys/HotKeyWrapper.js';
13
- import { CoreIcons } from '../../types/icons.js';
14
13
  import { jsxs, jsx } from 'react/jsx-runtime';
15
14
 
16
15
  var _excluded = ["icon", "iconClassName", "title", "actions", "closeOnClick", "headerClassName", "onClose", "onBeforeClose", "children", "loading", "size", "width", "minWidth", "root", "hideMask", "align"];
@@ -116,12 +115,12 @@ var Flyout = function Flyout(_ref) {
116
115
  }), actions, /*#__PURE__*/jsx(Icon, {
117
116
  "data-ref": "panelClose",
118
117
  className: classNames("fabric-panelAction", "cursor-pointer p-1 text-xl self-center"),
119
- icon: CoreIcons.close,
118
+ icon: "icon-[mdi--close]",
120
119
  onClick: function onClick() {
121
120
  return handleClose(false);
122
121
  }
123
122
  })]
124
- }), loading && /*#__PURE__*/jsx(Loading, {}), /*#__PURE__*/jsx("div", {
123
+ }), loading && /*#__PURE__*/jsx(LoadingLine, {}), /*#__PURE__*/jsx("div", {
125
124
  role: "dialog",
126
125
  className: classNames("fabric-flyoutBody", "flex-1 grid overflow-hidden"),
127
126
  tabIndex: 0,
@@ -6,11 +6,10 @@ import { useFloating, useDismiss, useRole, useInteractions, FloatingPortal, Floa
6
6
  import { isString } from '@react-fabric/utilities';
7
7
  import classNames from 'classnames';
8
8
  import { useCallback, useEffect, isValidElement } from 'react';
9
- import { Loading } from '../../components/animations/Animations.js';
9
+ import { LoadingLine } from '../../components/animations/Animations.js';
10
10
  import { Icon, getIconProps } from '../../components/icon/Icon.js';
11
11
  import { Header } from '../../core/headfoot/HeadFoot.js';
12
12
  import { HotKeyWrapper } from '../../hotkeys/HotKeyWrapper.js';
13
- import { CoreIcons } from '../../types/icons.js';
14
13
  import { jsx, jsxs } from 'react/jsx-runtime';
15
14
 
16
15
  var _excluded = ["icon", "iconClassName", "title", "actions", "headerClassName", "onClose", "onBeforeClose", "children", "loading", "root", "size", "hideMask", "width", "height", "minHeight", "minWidth"];
@@ -108,12 +107,12 @@ var Modal = function Modal(_ref) {
108
107
  }), actions, /*#__PURE__*/jsx(Icon, {
109
108
  "data-ref": "panelClose",
110
109
  className: classNames("fabric-panelAction", "cursor-pointer p-1 text-xl self-center"),
111
- icon: CoreIcons.close,
110
+ icon: "icon-[mdi--close]",
112
111
  onClick: function onClick() {
113
112
  return handleClose(false);
114
113
  }
115
114
  })]
116
- }), loading && /*#__PURE__*/jsx(Loading, {}), /*#__PURE__*/jsx("div", {
115
+ }), loading && /*#__PURE__*/jsx(LoadingLine, {}), /*#__PURE__*/jsx("div", {
117
116
  role: "dialog",
118
117
  className: classNames("fabric-modalBody", "flex-1 grid overflow-hidden"),
119
118
  tabIndex: 0,
@@ -6,7 +6,6 @@ import { useTranslation } from 'react-i18next';
6
6
  import { AnimationIndicator } from '../../components/animations/Animations.js';
7
7
  import { Button } from '../../components/button/Button.js';
8
8
  import { Icon } from '../../components/icon/Icon.js';
9
- import { CoreIcons } from '../../types/icons.js';
10
9
  import { jsx, jsxs } from 'react/jsx-runtime';
11
10
  import { getColor } from '../../utils/getColor.js';
12
11
  import '@react-fabric/utilities';
@@ -122,7 +121,7 @@ var Toast = function Toast(_ref) {
122
121
  variant: "link",
123
122
  className: "m-0",
124
123
  color: color,
125
- icon: CoreIcons.closeAll,
124
+ icon: "icon-[mdi--close-box-multiple-outline]",
126
125
  "aria-label": "close-all",
127
126
  onClick: onCloseAll
128
127
  }), /*#__PURE__*/jsx(Button, {
@@ -130,7 +129,7 @@ var Toast = function Toast(_ref) {
130
129
  variant: "link",
131
130
  className: "m-0",
132
131
  color: color,
133
- icon: CoreIcons.close,
132
+ icon: "icon-[mdi--close]",
134
133
  "aria-label": "close",
135
134
  onClick: function onClick() {
136
135
  return handleClose(false);
@@ -9,7 +9,6 @@ import classNames from 'classnames';
9
9
  import { useRef, useState, useEffect, useMemo, Fragment, cloneElement, isValidElement } from 'react';
10
10
  import { Icon } from '../../components/icon/Icon.js';
11
11
  import { useIsRtl } from '../../hooks/useIsRtl.js';
12
- import { CoreIcons } from '../../types/icons.js';
13
12
  import { jsx, jsxs } from 'react/jsx-runtime';
14
13
  import { getColor } from '../../utils/getColor.js';
15
14
 
@@ -102,7 +101,7 @@ var Tooltip = function Tooltip(_ref) {
102
101
  className: "ms-2 cursor-pointer text-dimmed flex-content opacity-75 hover:opacity-90 active:opacity-60",
103
102
  onClick: handler,
104
103
  children: /*#__PURE__*/jsx(Icon, {
105
- icon: CoreIcons.copy
104
+ icon: "icon-[mdi--content-copy]"
106
105
  })
107
106
  });
108
107
  }
@@ -5,7 +5,6 @@ import { useCallback } from 'react';
5
5
  import { useTranslation } from 'react-i18next';
6
6
  import { Button } from '../components/button/Button.js';
7
7
  import { Tooltip } from '../overlays/tooltip/Tooltip.js';
8
- import { CoreIcons } from '../types/icons.js';
9
8
  import { jsx } from 'react/jsx-runtime';
10
9
 
11
10
  /*
@@ -45,7 +44,7 @@ var Copy = function Copy(_ref) {
45
44
  return /*#__PURE__*/jsx(Tooltip, {
46
45
  content: t("action.copy"),
47
46
  children: /*#__PURE__*/jsx(Button, {
48
- icon: CoreIcons.copy,
47
+ icon: "icon-[mdi--content-copy]",
49
48
  "aria-label": "Copy text",
50
49
  actionMessage: t("action.copied"),
51
50
  variant: "link",
@@ -33,47 +33,66 @@ export interface AnimationProps extends CssProp, AriaProps {
33
33
  * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-components-animations--docs} for more details.
34
34
  */
35
35
  export declare const AnimationIndicator: ({ className, color, strokeColor, type, ...aria }: AnimationProps) => import("react/jsx-runtime").JSX.Element;
36
+ /**
37
+ * A component that displays a loading animation with a customizable icon, color, size, and mask blur.
38
+ * It is typically used to indicate loading states in the UI.
39
+ *
40
+ * @param {Object} props - The properties for the AnimationLoader component.
41
+ * @param {ColorType | PaletteType | string} [props.color="tint-500"] - The color of the loader icon.
42
+ * @param {number | string} [props.size="2rem"] - The size of the loader icon.
43
+ * @param {string} props.icon - The icon to be displayed as the loader.
44
+ * @param {"sm" | "md" | "lg"} [props.maskBlur] - The blur effect for the background mask.
45
+ * @returns {JSX.Element} The rendered AnimationLoader component.
46
+ */
47
+ export declare const AnimationLoader: ({ color, size, icon, maskBlur, }: {
48
+ icon: string;
49
+ maskBlur?: "sm" | "md" | "lg";
50
+ color?: ColorType | PaletteType | string;
51
+ size?: number | string;
52
+ }) => import("react/jsx-runtime").JSX.Element;
36
53
  /**
37
54
  * A component that displays an animated bars loader.
38
55
  * It can be customized with color and size properties.
39
56
  * This component is typically used to indicate loading states in the UI.
40
57
  *
41
- * @param {Object} props - The properties for the AnimationBars component.
58
+ * @param {Object} props - The properties for the LoadingBars component.
42
59
  * @param {ColorType | PaletteType | string} [props.color="tint-500"] - The color of the bars.
43
60
  * @param {number | string} [props.size="2rem"] - The size of the bars.
44
- * @returns {JSX.Element} The rendered AnimationBars component.
61
+ * @returns {JSX.Element} The rendered LoadingBars component.
45
62
  *
46
63
  * @example
47
64
  * ```jsx
48
- * <AnimationBars color="primary-500" size="3rem" />
65
+ * <LoadingBars color="primary-500" size="3rem" />
49
66
  * ```
50
67
  *
51
68
  * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-components-animations--docs} for more details.
52
69
  */
53
- export declare const AnimationBars: ({ color, size, }: {
70
+ export declare const LoadingBars: (props: {
54
71
  color?: ColorType | PaletteType | string;
55
72
  size?: number | string;
73
+ maskBlur?: "sm" | "md" | "lg";
56
74
  }) => import("react/jsx-runtime").JSX.Element;
57
75
  /**
58
76
  * A component that displays a spinner animation.
59
77
  * It can be customized with color and size properties.
60
78
  * This component is typically used to indicate loading states in the UI.
61
79
  *
62
- * @param {Object} props - The properties for the AnimationSpinner component.
80
+ * @param {Object} props - The properties for the LoadingSpinner component.
63
81
  * @param {ColorType | PaletteType | string} [props.color="tint-700"] - The color of the spinner.
64
82
  * @param {number | string} [props.size="2rem"] - The size of the spinner.
65
- * @returns {JSX.Element} The rendered AnimationSpinner component.
83
+ * @returns {JSX.Element} The rendered LoadingSpinner component.
66
84
  *
67
85
  * @example
68
86
  * ```jsx
69
- * <AnimationSpinner color="primary-500" size="3rem" />
87
+ * <LoadingSpinner color="primary-500" size="3rem" />
70
88
  * ```
71
89
  *
72
90
  * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-components-animations--docs} for more details.
73
91
  */
74
- export declare const AnimationSpinner: ({ color, size, }: {
92
+ export declare const LoadingSpinner: (props: {
75
93
  color?: ColorType | PaletteType | string;
76
94
  size?: number | string;
95
+ maskBlur?: "sm" | "md" | "lg";
77
96
  }) => import("react/jsx-runtime").JSX.Element;
78
97
  /**
79
98
  * A component that displays a skeleton loader with a placeholder for content.
@@ -99,4 +118,4 @@ export declare const Skeleton: ({ className, ...rest }: CssProp) => import("reac
99
118
  *
100
119
  * @returns {JSX.Element} The rendered Loading component.
101
120
  */
102
- export declare const Loading: () => import("react/jsx-runtime").JSX.Element;
121
+ export declare const LoadingLine: () => import("react/jsx-runtime").JSX.Element;
@@ -60,8 +60,8 @@ export interface CollapsableProps extends CssProp, AriaProps, TestProps, RefProp
60
60
  * ```jsx
61
61
  * <Collapsable
62
62
  * iconAlign="start"
63
- * iconOpen={CoreIcons.chevronDown}
64
- * iconClosed={CoreIcons.chevronRight}
63
+ * iconOpen="icon-[mdi--chevron-down]"
64
+ * iconClosed="icon-[mdi--chevron-right]"
65
65
  * open={true}
66
66
  * onOpen={() => console.log("Opened")}
67
67
  * onClose={() => console.log("Closed")}
@@ -1,5 +1,5 @@
1
1
  export { ActionLabel } from "./actionLabel/ActionLabel";
2
- export { AnimationBars, AnimationIndicator, AnimationSpinner, Loading, Skeleton, } from "./animations/Animations";
2
+ export { LoadingBars, AnimationIndicator, LoadingSpinner, LoadingLine, Skeleton, } from "./animations/Animations";
3
3
  export { Avatar } from "./avatar/Avatar";
4
4
  export { AvatarGroup } from "./avatar/AvatarGroup";
5
5
  export { Badge, getBadgeProps } from "./badge/Badge";
@@ -75,7 +75,7 @@ export interface PanelProps extends CssProp, AriaProps, TestProps, ExpandProps,
75
75
  * ```jsx
76
76
  * <Panel
77
77
  * title="Panel Title"
78
- * icon={CoreIcons.info}
78
+ * icon="icon-[mdi--info]"
79
79
  * actions={<button>Action</button>}
80
80
  * expandable
81
81
  * collapsable
@@ -66,7 +66,7 @@ export interface AsideProps extends ChildrenProp, CollapseProps, CssProp, TestPr
66
66
  * ```jsx
67
67
  * <Aside
68
68
  * title="Sidebar Title"
69
- * icon={CoreIcons.menu}
69
+ * icon=icon-[mdi--menu]
70
70
  * rtlFlip={true}
71
71
  * className="custom-aside"
72
72
  * bodyClassName="custom-aside-body"
@@ -18,6 +18,5 @@ export { HotKey } from "./hotkeys/HotKey";
18
18
  export { HotKeyLabel } from "./hotkeys/HotKeyLabel";
19
19
  export { HotKeyWrapper } from "./hotkeys/HotKeyWrapper";
20
20
  export { type ModalProps } from "./types";
21
- export { CoreIcons } from "./types/icons";
22
21
  export { cloneChildren } from "./utils";
23
22
  export { ApplicationProvider, useApplicationContext, useGlobals, useNotificationService, } from "./context/Global";
@@ -5,7 +5,7 @@ export type ModalProps<P = unknown> = P & {
5
5
  };
6
6
  export type SizeType = "xs" | "sm" | "md" | "lg" | "xl";
7
7
  export type SizeTypeWithZero = "xs" | "sm" | "md" | "lg" | "xl" | 0;
8
- export type ColorState = "primary" | "accent" | "info" | "danger" | "success" | "warning";
8
+ export type ColorState = "default" | "primary" | "accent" | "muted" | "info" | "danger" | "success" | "warning";
9
9
  export type ColorType = "primary-50" | "primary-100" | "primary-200" | "primary-300" | "primary-400" | "primary-500" | "primary-600" | "primary-700" | "primary-800" | "primary-900" | "primary-950" | "accent-50" | "accent-100" | "accent-200" | "accent-300" | "accent-400" | "accent-500" | "accent-600" | "accent-700" | "accent-800" | "accent-900" | "accent-950" | "info-50" | "info-100" | "info-200" | "info-300" | "info-400" | "info-500" | "info-600" | "info-700" | "info-800" | "info-900" | "info-950" | "danger-50" | "danger-100" | "danger-200" | "danger-300" | "danger-400" | "danger-500" | "danger-600" | "danger-700" | "danger-800" | "danger-900" | "danger-950" | "success-50" | "success-100" | "success-200" | "success-300" | "success-400" | "success-500" | "success-600" | "success-700" | "success-800" | "success-900" | "success-950" | "warning-50" | "warning-100" | "warning-200" | "warning-300" | "warning-400" | "warning-500" | "warning-600" | "warning-700" | "warning-800" | "warning-900" | "warning-950";
10
10
  export type PaletteType = "scarlet-50" | "scarlet-100" | "scarlet-200" | "scarlet-300" | "scarlet-400" | "scarlet-500" | "scarlet-600" | "scarlet-700" | "scarlet-800" | "scarlet-900" | "scarlet-950" | "pumpkin-50" | "pumpkin-100" | "pumpkin-200" | "pumpkin-300" | "pumpkin-400" | "pumpkin-500" | "pumpkin-600" | "pumpkin-700" | "pumpkin-800" | "pumpkin-900" | "pumpkin-950" | "marigold-50" | "marigold-100" | "marigold-200" | "marigold-300" | "marigold-400" | "marigold-500" | "marigold-600" | "marigold-700" | "marigold-800" | "marigold-900" | "marigold-950" | "avacado-50" | "avacado-100" | "avacado-200" | "avacado-300" | "avacado-400" | "avacado-500" | "avacado-600" | "avacado-700" | "avacado-800" | "avacado-900" | "avacado-950" | "jade-50" | "jade-100" | "jade-200" | "jade-300" | "jade-400" | "jade-500" | "jade-600" | "jade-700" | "jade-800" | "jade-900" | "jade-950" | "denim-50" | "denim-100" | "denim-200" | "denim-300" | "denim-400" | "denim-500" | "denim-600" | "denim-700" | "denim-800" | "denim-900" | "denim-950" | "iris-50" | "iris-100" | "iris-200" | "iris-300" | "iris-400" | "iris-500" | "iris-600" | "iris-700" | "iris-800" | "iris-900" | "iris-950" | "lilac-50" | "lilac-100" | "lilac-200" | "lilac-300" | "lilac-400" | "lilac-500" | "lilac-600" | "lilac-700" | "lilac-800" | "lilac-900" | "lilac-950" | "coral-50" | "coral-100" | "coral-200" | "coral-300" | "coral-400" | "coral-500" | "coral-600" | "coral-700" | "coral-800" | "coral-900" | "coral-950" | "wood-50" | "wood-100" | "wood-200" | "wood-300" | "wood-400" | "wood-500" | "wood-600" | "wood-700" | "wood-800" | "wood-900" | "wood-950" | "silver-50" | "silver-100" | "silver-200" | "silver-300" | "silver-400" | "silver-500" | "silver-600" | "silver-700" | "silver-800" | "silver-900" | "silver-950" | "steel-50" | "steel-100" | "steel-200" | "steel-300" | "steel-400" | "steel-500" | "steel-600" | "steel-700" | "steel-800" | "steel-900" | "steel-950" | "olive-50" | "olive-100" | "olive-200" | "olive-300" | "olive-400" | "olive-500" | "olive-600" | "olive-700" | "olive-800" | "olive-900" | "olive-950" | "sand-50" | "sand-100" | "sand-200" | "sand-300" | "sand-400" | "sand-500" | "sand-600" | "sand-700" | "sand-800" | "sand-900" | "sand-950" | "tint-50" | "tint-100" | "tint-200" | "tint-300" | "tint-400" | "tint-500" | "tint-600" | "tint-700" | "tint-800" | "tint-900" | "tint-950";
11
11
  export type ColorWithGrays = ColorType | "invert" | "dimmed" | "muted";
@@ -118,10 +118,11 @@ export interface TooltipProp {
118
118
  */
119
119
  tooltip?: string | TooltipType;
120
120
  }
121
- export interface ChildProp<T = JSX.Element> {
121
+ export type ReactElement = React.ReactElement | string | number | bigint | Iterable<React.ReactNode> | React.ReactPortal | boolean | null | undefined;
122
+ export interface ChildProp<T = ReactElement> {
122
123
  children: Elements<T>;
123
124
  }
124
- export interface ChildrenProp<T = JSX.Element> {
125
+ export interface ChildrenProp<T = ReactElement> {
125
126
  children: Elements<T> | Array<Elements<T>>;
126
127
  }
127
128
  export interface PositionObject {
@@ -140,3 +141,8 @@ export type ArrayType<T extends readonly any[] | ArrayLike<any> | undefined> = T
140
141
  export type Complete<T> = {
141
142
  [P in keyof Required<T>]: Pick<T, P> extends Required<Pick<T, P>> ? T[P] : T[P] | undefined;
142
143
  };
144
+ export type NestedKeys<T> = T extends object ? {
145
+ [K in keyof T]: K extends string | number ? T[K] extends object ? T[K] extends readonly any[] ? T[K][number] extends object ? // Array of objects/items: return key with array index notation and recurse
146
+ `${K}.${NestedKeys<T[K][number]>}` | `${K}` : `${K}` : // Standard object: return key with dot notation and recurse
147
+ `${K}.${NestedKeys<T[K]>}` | `${K}` : `${K}` : never;
148
+ }[keyof T] : "";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-fabric/core",
3
- "version": "1.0.0-beta.60",
3
+ "version": "1.0.0-beta.61",
4
4
  "description": "RUF: Core package",
5
5
  "author": "Adarsh Pastakia <adarshpastakia@outlook.com>",
6
6
  "license": "MIT",
@@ -36,7 +36,10 @@
36
36
  },
37
37
  "dependencies": {
38
38
  "@floating-ui/react": "~0.27.16",
39
- "@react-fabric/utilities": "^1.0.0-beta.60",
39
+ "@iconify-json/mdi": "~1.2.3",
40
+ "@iconify-json/svg-spinners": "~1.2.4",
41
+ "@iconify/tailwind4": "~1.2.1",
42
+ "@react-fabric/utilities": "^1.0.0-beta.61",
40
43
  "@tailwindcss/postcss": "~4.1.16",
41
44
  "boring-avatars": "~1.11.2",
42
45
  "classnames": "~2.5.1",
@@ -54,5 +57,5 @@
54
57
  "node": ">=18.12.0",
55
58
  "npm": ">=8.19.0"
56
59
  },
57
- "gitHead": "a79f053ee7e13422c06d7d9c35d4f0c2610cdf5d"
60
+ "gitHead": "a0b0c571bf9c189fa3355bbc3b896ecc4b9d6a04"
58
61
  }
@@ -126,26 +126,24 @@ export const AnimationIndicator = ({
126
126
  };
127
127
 
128
128
  /**
129
- * A component that displays an animated bars loader.
130
- * It can be customized with color and size properties.
131
- * This component is typically used to indicate loading states in the UI.
129
+ * A component that displays a loading animation with a customizable icon, color, size, and mask blur.
130
+ * It is typically used to indicate loading states in the UI.
132
131
  *
133
- * @param {Object} props - The properties for the AnimationBars component.
134
- * @param {ColorType | PaletteType | string} [props.color="tint-500"] - The color of the bars.
135
- * @param {number | string} [props.size="2rem"] - The size of the bars.
136
- * @returns {JSX.Element} The rendered AnimationBars component.
137
- *
138
- * @example
139
- * ```jsx
140
- * <AnimationBars color="primary-500" size="3rem" />
141
- * ```
142
- *
143
- * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-components-animations--docs} for more details.
132
+ * @param {Object} props - The properties for the AnimationLoader component.
133
+ * @param {ColorType | PaletteType | string} [props.color="tint-500"] - The color of the loader icon.
134
+ * @param {number | string} [props.size="2rem"] - The size of the loader icon.
135
+ * @param {string} props.icon - The icon to be displayed as the loader.
136
+ * @param {"sm" | "md" | "lg"} [props.maskBlur] - The blur effect for the background mask.
137
+ * @returns {JSX.Element} The rendered AnimationLoader component.
144
138
  */
145
- export const AnimationBars = ({
139
+ export const AnimationLoader = ({
146
140
  color = "tint-500",
147
141
  size = "2rem",
142
+ icon,
143
+ maskBlur,
148
144
  }: {
145
+ icon: string;
146
+ maskBlur?: "sm" | "md" | "lg";
149
147
  color?: ColorType | PaletteType | string;
150
148
  size?: number | string;
151
149
  }) => {
@@ -153,65 +151,75 @@ export const AnimationBars = ({
153
151
  <div
154
152
  className={classNames(
155
153
  "absolute inset-0 z-10 flex justify-center items-center cursor-wait",
154
+ maskBlur === "sm" && "backdrop-blur-sm",
155
+ maskBlur === "md" && "backdrop-blur-md",
156
+ maskBlur === "lg" && "backdrop-blur-lg",
156
157
  )}
157
158
  >
158
159
  <div
159
160
  className={classNames(
160
- "outline outline-tint-500/20 p-4 bg-tint-50/50 backdrop-blur-sm rounded",
161
+ "outline outline-tint-500/20 p-4 bg-tint-50/50 backdrop-blur-sm leading-0 rounded",
161
162
  )}
162
163
  >
163
164
  <div
164
- className={classNames("fabric-bars")}
165
- style={{ width: size, color: getColor(color) }}
165
+ className={classNames("aspect-square", icon)}
166
+ style={{ fontSize: size, color: getColor(color) }}
166
167
  />
167
168
  </div>
168
169
  </div>
169
170
  );
170
171
  };
171
172
 
173
+ /**
174
+ * A component that displays an animated bars loader.
175
+ * It can be customized with color and size properties.
176
+ * This component is typically used to indicate loading states in the UI.
177
+ *
178
+ * @param {Object} props - The properties for the LoadingBars component.
179
+ * @param {ColorType | PaletteType | string} [props.color="tint-500"] - The color of the bars.
180
+ * @param {number | string} [props.size="2rem"] - The size of the bars.
181
+ * @returns {JSX.Element} The rendered LoadingBars component.
182
+ *
183
+ * @example
184
+ * ```jsx
185
+ * <LoadingBars color="primary-500" size="3rem" />
186
+ * ```
187
+ *
188
+ * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-components-animations--docs} for more details.
189
+ */
190
+ export const LoadingBars = (props: {
191
+ color?: ColorType | PaletteType | string;
192
+ size?: number | string;
193
+ maskBlur?: "sm" | "md" | "lg";
194
+ }) => {
195
+ return (
196
+ <AnimationLoader icon="icon-[svg-spinners--bars-scale-fade]" {...props} />
197
+ );
198
+ };
199
+
172
200
  /**
173
201
  * A component that displays a spinner animation.
174
202
  * It can be customized with color and size properties.
175
203
  * This component is typically used to indicate loading states in the UI.
176
204
  *
177
- * @param {Object} props - The properties for the AnimationSpinner component.
205
+ * @param {Object} props - The properties for the LoadingSpinner component.
178
206
  * @param {ColorType | PaletteType | string} [props.color="tint-700"] - The color of the spinner.
179
207
  * @param {number | string} [props.size="2rem"] - The size of the spinner.
180
- * @returns {JSX.Element} The rendered AnimationSpinner component.
208
+ * @returns {JSX.Element} The rendered LoadingSpinner component.
181
209
  *
182
210
  * @example
183
211
  * ```jsx
184
- * <AnimationSpinner color="primary-500" size="3rem" />
212
+ * <LoadingSpinner color="primary-500" size="3rem" />
185
213
  * ```
186
214
  *
187
215
  * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-components-animations--docs} for more details.
188
216
  */
189
- export const AnimationSpinner = ({
190
- color = "tint-700",
191
- size = "2rem",
192
- }: {
217
+ export const LoadingSpinner = (props: {
193
218
  color?: ColorType | PaletteType | string;
194
219
  size?: number | string;
220
+ maskBlur?: "sm" | "md" | "lg";
195
221
  }) => {
196
- return (
197
- <div
198
- className={classNames(
199
- "absolute inset-0 z-10 flex justify-center items-center cursor-wait",
200
- )}
201
- data-ref="spinner"
202
- >
203
- <div
204
- className={classNames(
205
- "outline outline-tint-500/20 p-4 bg-tint-50/50 backdrop-blur-sm rounded",
206
- )}
207
- >
208
- <div
209
- className={classNames("fabric-spinner")}
210
- style={{ width: size, color: getColor(color) }}
211
- />
212
- </div>
213
- </div>
214
- );
222
+ return <AnimationLoader icon="icon-[svg-spinners--eclipse]" {...props} />;
215
223
  };
216
224
 
217
225
  /**
@@ -260,7 +268,7 @@ export const Skeleton = ({ className, ...rest }: CssProp) => {
260
268
  *
261
269
  * @returns {JSX.Element} The rendered Loading component.
262
270
  */
263
- export const Loading = () => {
271
+ export const LoadingLine = () => {
264
272
  return (
265
273
  <div
266
274
  className={classNames(
@@ -187,7 +187,7 @@ export const Button = <Tag extends React.ElementType = "button">({
187
187
  children,
188
188
  className,
189
189
  active,
190
- color = "primary",
190
+ color = "default",
191
191
  icon,
192
192
  iconAlign = "start",
193
193
  altIcon,
@@ -29,7 +29,6 @@ import {
29
29
  type CssProp,
30
30
  type TestProps,
31
31
  } from "../../types";
32
- import { CoreIcons } from "../../types/icons";
33
32
  import { Icon } from "../icon/Icon";
34
33
 
35
34
  export interface CalloutProps
@@ -66,7 +65,8 @@ export interface CalloutProps
66
65
  // colors for different callout types
67
66
  const colors = {
68
67
  none: "bg-base text-tint-900 border-tint-100",
69
- tint: "bg-tint-50/50 text-tint-800 border-tint-300",
68
+ default: "bg-tint-50/50 text-tint-800 border-tint-300",
69
+ muted: "bg-tint-50/50 text-muted border-muted",
70
70
  primary: "bg-primary-50/50 text-primary-800 border-primary-300",
71
71
  accent: "bg-accent-50/50 text-accent-800 border-accent-300",
72
72
  info: "bg-info-50/50 text-info-800 border-info-300",
@@ -103,8 +103,7 @@ const colors = {
103
103
  */
104
104
  export const Callout = ({
105
105
  children,
106
- // @ts-expect-error ignore
107
- color = "tint",
106
+ color = "default",
108
107
  legend,
109
108
  title,
110
109
  icon,
@@ -145,7 +144,7 @@ export const Callout = ({
145
144
  size="md"
146
145
  data-ref="calloutClose"
147
146
  className={classNames("absolute end-2", legend ? "top-0" : "top-2")}
148
- icon={CoreIcons.close}
147
+ icon="icon-[mdi--close]"
149
148
  onClick={onClose}
150
149
  />
151
150
  )}
@@ -38,7 +38,6 @@ import {
38
38
  type RefProp,
39
39
  type TestProps,
40
40
  } from "../../types";
41
- import { CoreIcons } from "../../types/icons";
42
41
  import { Icon } from "../icon/Icon";
43
42
 
44
43
  interface CollapsableRef {
@@ -108,8 +107,8 @@ export interface CollapsableProps
108
107
  * ```jsx
109
108
  * <Collapsable
110
109
  * iconAlign="start"
111
- * iconOpen={CoreIcons.chevronDown}
112
- * iconClosed={CoreIcons.chevronRight}
110
+ * iconOpen="icon-[mdi--chevron-down]"
111
+ * iconClosed="icon-[mdi--chevron-right]"
113
112
  * open={true}
114
113
  * onOpen={() => console.log("Opened")}
115
114
  * onClose={() => console.log("Closed")}
@@ -130,8 +129,8 @@ export const Collapsable = ({
130
129
  children,
131
130
  iconAlign,
132
131
  stickyHeader,
133
- iconClosed = CoreIcons.chevronRight,
134
- iconOpen = CoreIcons.chevronDown,
132
+ iconClosed = "icon-[mdi--chevron-right]",
133
+ iconOpen = "icon-[mdi--chevron-down]",
135
134
  open,
136
135
  onClose,
137
136
  onOpen,
@@ -23,7 +23,6 @@
23
23
 
24
24
  import classNames from "classnames";
25
25
  import { type ChildProp, type CssProp } from "../../types";
26
- import { CoreIcons } from "../../types/icons";
27
26
  import { Icon } from "../icon/Icon";
28
27
  import { Dropdown, type DropdownProps } from "./Dropdown";
29
28
 
@@ -70,7 +69,7 @@ export const DropdownTool = ({
70
69
  return (
71
70
  <Dropdown {...props}>
72
71
  <Icon
73
- icon={icon ?? CoreIcons.caretDown}
72
+ icon={icon ?? "icon-[mdi--menu-down]"}
74
73
  className={classNames(
75
74
  "outline bg-tint-50/50 flex-content pointer-events-auto cursor-pointer",
76
75
  className,
@@ -23,10 +23,10 @@
23
23
 
24
24
  export { ActionLabel } from "./actionLabel/ActionLabel";
25
25
  export {
26
- AnimationBars,
26
+ LoadingBars,
27
27
  AnimationIndicator,
28
- AnimationSpinner,
29
- Loading,
28
+ LoadingSpinner,
29
+ LoadingLine,
30
30
  Skeleton,
31
31
  } from "./animations/Animations";
32
32
  export { Avatar } from "./avatar/Avatar";