@react-fabric/core 1.0.0-beta.60 → 1.0.0-beta.62
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.
- package/css/components/_breadcrumbs.css +2 -0
- package/css/components/_button.css +16 -2
- package/css/components/_icon.css +1 -1
- package/css/components/_modal.css +2 -2
- package/css/core/_theme.css +1 -1
- package/css/reset/_reset.css +5 -1
- package/css/reset/_theme.css +3 -3
- package/css/styles.css +2 -0
- package/css/theme/_colors.css +2 -2
- package/dist/cjs/components/animations/Animations.js +54 -49
- package/dist/cjs/components/button/Button.js +2 -2
- package/dist/cjs/components/callout/Callout.js +4 -4
- package/dist/cjs/components/collapsable/Collapsable.js +4 -5
- package/dist/cjs/components/dropdown/Dropdown.js +13 -1
- package/dist/cjs/components/dropdown/DropdownTool.js +1 -2
- package/dist/cjs/components/icon/Icon.js +24 -24
- package/dist/cjs/components/media/Media.js +9 -8
- package/dist/cjs/components/menu/Menu.js +5 -5
- package/dist/cjs/components/menu/MenuItem.js +1 -2
- package/dist/cjs/components/navigator/Navigator.js +4 -5
- package/dist/cjs/components/panel/Panel.js +7 -7
- package/dist/cjs/components/tabpanel/Tab.js +0 -1
- package/dist/cjs/components/tabpanel/TabPanel.js +3 -2
- package/dist/cjs/core/aside/Aside.js +3 -4
- package/dist/cjs/core/page/Page.js +1 -1
- package/dist/cjs/core/theme/ThemeProvider.js +3 -2
- package/dist/cjs/hooks/useNavigator.js +9 -8
- package/dist/cjs/hooks/useOverlayService.js +34 -13
- package/dist/cjs/hooks/useStepper.js +0 -1
- package/dist/cjs/i18n/index.js +4 -4
- package/dist/cjs/index.js +4 -8
- package/dist/cjs/overlays/alert/Alert.js +1 -2
- package/dist/cjs/overlays/flyout/Flyout.js +2 -3
- package/dist/cjs/overlays/modal/Modal.js +2 -3
- package/dist/cjs/overlays/toast/Toast.js +2 -3
- package/dist/cjs/overlays/tooltip/Tooltip.js +1 -2
- package/dist/cjs/typography/Copy.js +1 -2
- package/dist/esm/components/animations/Animations.js +51 -47
- package/dist/esm/components/button/Button.js +2 -2
- package/dist/esm/components/callout/Callout.js +4 -4
- package/dist/esm/components/collapsable/Collapsable.js +4 -5
- package/dist/esm/components/dropdown/Dropdown.js +14 -2
- package/dist/esm/components/dropdown/DropdownTool.js +1 -2
- package/dist/esm/components/icon/Icon.js +24 -24
- package/dist/esm/components/media/Media.js +9 -8
- package/dist/esm/components/menu/Menu.js +5 -5
- package/dist/esm/components/menu/MenuItem.js +1 -2
- package/dist/esm/components/navigator/Navigator.js +4 -5
- package/dist/esm/components/panel/Panel.js +8 -8
- package/dist/esm/components/tabpanel/Tab.js +0 -1
- package/dist/esm/components/tabpanel/TabPanel.js +3 -2
- package/dist/esm/core/aside/Aside.js +4 -5
- package/dist/esm/core/page/Page.js +2 -2
- package/dist/esm/core/theme/ThemeProvider.js +3 -2
- package/dist/esm/hooks/useNavigator.js +10 -9
- package/dist/esm/hooks/useOverlayService.js +35 -14
- package/dist/esm/hooks/useStepper.js +0 -1
- package/dist/esm/i18n/index.js +2 -2
- package/dist/esm/index.js +1 -2
- package/dist/esm/overlays/alert/Alert.js +1 -2
- package/dist/esm/overlays/flyout/Flyout.js +3 -4
- package/dist/esm/overlays/modal/Modal.js +3 -4
- package/dist/esm/overlays/toast/Toast.js +2 -3
- package/dist/esm/overlays/tooltip/Tooltip.js +1 -2
- package/dist/esm/typography/Copy.js +1 -2
- package/dist/types/components/animations/Animations.d.ts +28 -9
- package/dist/types/components/collapsable/Collapsable.d.ts +2 -2
- package/dist/types/components/index.d.ts +2 -2
- package/dist/types/components/menu/types.d.ts +6 -1
- package/dist/types/components/navigator/Navigator.d.ts +6 -0
- package/dist/types/components/panel/Panel.d.ts +1 -1
- package/dist/types/core/aside/Aside.d.ts +1 -1
- package/dist/types/core/theme/ThemeProvider.d.ts +2 -2
- package/dist/types/hooks/useOverlayService.d.ts +3 -5
- package/dist/types/index.d.ts +0 -1
- package/dist/types/types/index.d.ts +9 -3
- package/package.json +6 -3
- package/src/components/animations/Animations.tsx +53 -45
- package/src/components/button/Button.tsx +4 -2
- package/src/components/callout/Callout.tsx +4 -5
- package/src/components/collapsable/Collapsable.tsx +4 -5
- package/src/components/dropdown/Dropdown.tsx +23 -6
- package/src/components/dropdown/DropdownTool.tsx +1 -2
- package/src/components/icon/Icon.tsx +22 -22
- package/src/components/index.ts +5 -4
- package/src/components/media/Media.tsx +7 -8
- package/src/components/menu/Menu.tsx +4 -4
- package/src/components/menu/MenuItem.tsx +1 -1
- package/src/components/menu/types.ts +6 -1
- package/src/components/navigator/Navigator.tsx +11 -5
- package/src/components/panel/Panel.tsx +14 -8
- package/src/components/tabpanel/TabPanel.tsx +2 -1
- package/src/core/aside/Aside.tsx +4 -5
- package/src/core/page/Page.tsx +2 -2
- package/src/core/theme/ThemeProvider.tsx +4 -2
- package/src/hooks/useNavigator.tsx +10 -11
- package/src/hooks/useOverlayService.tsx +29 -16
- package/src/i18n/index.ts +2 -2
- package/src/index.ts +0 -1
- package/src/overlays/alert/Alert.tsx +1 -2
- package/src/overlays/flyout/Flyout.tsx +3 -4
- package/src/overlays/modal/Modal.tsx +3 -4
- package/src/overlays/toast/Toast.tsx +2 -3
- package/src/overlays/tooltip/Tooltip.tsx +1 -2
- package/src/types/index.ts +32 -2
- package/src/typography/Copy.tsx +1 -2
- package/css/flags.rect.css +0 -1607
- package/css/flags.wavy.css +0 -1606
- package/dist/cjs/types/icons.js +0 -212
- package/dist/esm/types/icons.js +0 -214
- package/dist/types/types/icons.d.ts +0 -210
- package/src/types/icons.ts +0 -451
- /package/dist/cjs/i18n/{ar.json.js → ar/core.json.js} +0 -0
- /package/dist/cjs/i18n/{en.json.js → en/core.json.js} +0 -0
- /package/dist/esm/i18n/{ar.json.js → ar/core.json.js} +0 -0
- /package/dist/esm/i18n/{en.json.js → en/core.json.js} +0 -0
- /package/src/i18n/{ar.json → ar/core.json} +0 -0
- /package/src/i18n/{en.json → en/core.json} +0 -0
|
@@ -4,12 +4,11 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
|
4
4
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
5
5
|
import classNames from 'classnames';
|
|
6
6
|
import { useRef, useState, useEffect, useCallback, useMemo } from 'react';
|
|
7
|
-
import {
|
|
7
|
+
import { LoadingLine } from '../../components/animations/Animations.js';
|
|
8
8
|
import { Icon, getIconProps } from '../../components/icon/Icon.js';
|
|
9
9
|
import { useLayoutEffectDebugger } from '../../hooks/useEffectDebugger.js';
|
|
10
10
|
import { usePropToggle } from '../../hooks/usePropToggle.js';
|
|
11
11
|
import { useResize } from '../../hooks/useResize.js';
|
|
12
|
-
import { CoreIcons } from '../../types/icons.js';
|
|
13
12
|
import { ErrorBoundary } from '../boundary/ErrorBoundary.js';
|
|
14
13
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
15
14
|
|
|
@@ -27,7 +26,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
27
26
|
* ```jsx
|
|
28
27
|
* <Aside
|
|
29
28
|
* title="Sidebar Title"
|
|
30
|
-
* icon=
|
|
29
|
+
* icon=icon-[mdi--menu]
|
|
31
30
|
* rtlFlip={true}
|
|
32
31
|
* className="custom-aside"
|
|
33
32
|
* bodyClassName="custom-aside-body"
|
|
@@ -151,7 +150,7 @@ var Aside = function Aside(_ref) {
|
|
|
151
150
|
}), collapsable && /*#__PURE__*/jsx(Icon, {
|
|
152
151
|
"aria-label": isCollapsed ? "expand" : "collapse",
|
|
153
152
|
className: classNames("fabric-asideCollapse", "p-2 select-none"),
|
|
154
|
-
icon:
|
|
153
|
+
icon: "icon-[mdi--chevron-left]",
|
|
155
154
|
rtlFlip: true,
|
|
156
155
|
onClick: toggleCollapse,
|
|
157
156
|
"data-ref": "asideToggle"
|
|
@@ -161,7 +160,7 @@ var Aside = function Aside(_ref) {
|
|
|
161
160
|
className: "fabric-asideActions",
|
|
162
161
|
children: actions
|
|
163
162
|
})]
|
|
164
|
-
}), loading && /*#__PURE__*/jsx(
|
|
163
|
+
}), loading && /*#__PURE__*/jsx(LoadingLine, {}), isCollapsed && /*#__PURE__*/jsx("div", {
|
|
165
164
|
role: "none",
|
|
166
165
|
onClick: tryPeek,
|
|
167
166
|
"data-ref": "asidePlaceholder",
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
4
4
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
5
5
|
import classNames from 'classnames';
|
|
6
|
-
import {
|
|
6
|
+
import { LoadingLine } from '../../components/animations/Animations.js';
|
|
7
7
|
import { Icon, getIconProps } from '../../components/icon/Icon.js';
|
|
8
8
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
9
9
|
|
|
@@ -60,7 +60,7 @@ var Page = function Page(_ref) {
|
|
|
60
60
|
children: [icon && /*#__PURE__*/jsx(Icon, _objectSpread({
|
|
61
61
|
size: "1.25em"
|
|
62
62
|
}, getIconProps(icon))), title]
|
|
63
|
-
}), loading && /*#__PURE__*/jsx(
|
|
63
|
+
}), loading && /*#__PURE__*/jsx(LoadingLine, {}), children]
|
|
64
64
|
}));
|
|
65
65
|
};
|
|
66
66
|
|
|
@@ -59,7 +59,8 @@ var ThemeProvider = function ThemeProvider(_ref) {
|
|
|
59
59
|
accentColor = _ref.accentColor,
|
|
60
60
|
tintColor = _ref.tintColor,
|
|
61
61
|
colorScheme = _ref.colorScheme,
|
|
62
|
-
rounding = _ref.rounding
|
|
62
|
+
rounding = _ref.rounding,
|
|
63
|
+
className = _ref.className;
|
|
63
64
|
var _useApplicationContex = useApplicationContext(),
|
|
64
65
|
currentColorScheme = _useApplicationContex.currentColorScheme;
|
|
65
66
|
var styles = useMemo(function () {
|
|
@@ -88,7 +89,7 @@ var ThemeProvider = function ThemeProvider(_ref) {
|
|
|
88
89
|
style: styles,
|
|
89
90
|
"data-color-scheme": colorScheme !== null && colorScheme !== void 0 ? colorScheme : currentColorScheme,
|
|
90
91
|
"data-rounding": rounding,
|
|
91
|
-
className: classNames("fabric-themeProvider", "contents theme-base", branding),
|
|
92
|
+
className: classNames("fabric-themeProvider", "contents theme-base", branding, className),
|
|
92
93
|
children: children
|
|
93
94
|
});
|
|
94
95
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
4
|
-
import { useState,
|
|
4
|
+
import { useState, useCallback, useMemo } from 'react';
|
|
5
5
|
import { jsxs } from 'react/jsx-runtime';
|
|
6
6
|
|
|
7
7
|
var useNavigator = function useNavigator() {
|
|
@@ -11,15 +11,16 @@ var useNavigator = function useNavigator() {
|
|
|
11
11
|
_useState2 = _slicedToArray(_useState, 2),
|
|
12
12
|
currentIndex = _useState2[0],
|
|
13
13
|
setCurrentIndex = _useState2[1];
|
|
14
|
-
var refCurrent = useRef(defaultIndex);
|
|
15
14
|
var onNavigate = useCallback(function (dir) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
15
|
+
setCurrentIndex(function (prevValue) {
|
|
16
|
+
if (dir === -1) {
|
|
17
|
+
return prevValue > 0 ? prevValue - 1 : totalCount - 1;
|
|
18
|
+
}
|
|
19
|
+
if (dir === 1) {
|
|
20
|
+
return prevValue + 1 < totalCount ? prevValue + 1 : 0;
|
|
21
|
+
}
|
|
22
|
+
return prevValue;
|
|
23
|
+
});
|
|
23
24
|
}, [totalCount]);
|
|
24
25
|
var headLabel = useMemo(function () {
|
|
25
26
|
return /*#__PURE__*/jsxs("span", {
|
|
@@ -5,12 +5,19 @@ import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProper
|
|
|
5
5
|
import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
|
|
6
6
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
7
7
|
import _regeneratorRuntime from '@babel/runtime/regenerator';
|
|
8
|
-
import { useState } from 'react';
|
|
8
|
+
import { useState, useRef } from 'react';
|
|
9
9
|
import { jsx } from 'react/jsx-runtime';
|
|
10
10
|
|
|
11
11
|
var _excluded = ["onClose"];
|
|
12
12
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
13
13
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
14
|
+
// return the blank function since state functionality will execute if the value is function
|
|
15
|
+
var EMPTY_FC = function EMPTY_FC() {
|
|
16
|
+
return function () {
|
|
17
|
+
return null;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
|
|
14
21
|
/**
|
|
15
22
|
* Hook to manage overlay components like modals or flyouts.
|
|
16
23
|
* It provides a way to open an overlay with specified properties and handle its closure.
|
|
@@ -21,7 +28,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
21
28
|
* of the overlay when it is closed, allowing you to handle the result in a controlled manner.
|
|
22
29
|
*
|
|
23
30
|
* @param ModalOrFlyout - The component to be used as an overlay.
|
|
24
|
-
* @
|
|
31
|
+
* @param toggleOpen - If true, calling `openOverlay` while an overlay is already open will close the existing one instead of opening a new one.
|
|
32
|
+
* @returns An array containing the current overlay, a function to open it, and a boolean indicating if the overlay is open.
|
|
25
33
|
*
|
|
26
34
|
* @example
|
|
27
35
|
* ```jsx
|
|
@@ -36,34 +44,47 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
36
44
|
* ```
|
|
37
45
|
*/
|
|
38
46
|
var useOverlayService = function useOverlayService(ModalOrFlyout) {
|
|
39
|
-
var _useState = useState(
|
|
47
|
+
var _useState = useState(EMPTY_FC),
|
|
40
48
|
_useState2 = _slicedToArray(_useState, 2),
|
|
41
49
|
Overlay = _useState2[0],
|
|
42
50
|
setOverlay = _useState2[1];
|
|
51
|
+
var existingOpenPromise = useRef(null);
|
|
43
52
|
var openOverlay = /*#__PURE__*/function () {
|
|
44
53
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
45
54
|
var _ref2,
|
|
46
55
|
onClose,
|
|
47
|
-
|
|
56
|
+
outerProps,
|
|
48
57
|
_args = arguments;
|
|
49
58
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
50
59
|
while (1) switch (_context.prev = _context.next) {
|
|
51
60
|
case 0:
|
|
52
|
-
_ref2 = _args.length > 0 && _args[0] !== undefined ? _args[0] : {}, onClose = _ref2.onClose,
|
|
53
|
-
|
|
61
|
+
_ref2 = _args.length > 0 && _args[0] !== undefined ? _args[0] : {}, onClose = _ref2.onClose, outerProps = _objectWithoutProperties(_ref2, _excluded);
|
|
62
|
+
if (!existingOpenPromise.current) {
|
|
63
|
+
_context.next = 3;
|
|
64
|
+
break;
|
|
65
|
+
}
|
|
66
|
+
return _context.abrupt("return");
|
|
67
|
+
case 3:
|
|
68
|
+
_context.next = 5;
|
|
54
69
|
return new Promise(function (resolve) {
|
|
55
|
-
|
|
56
|
-
setOverlay(
|
|
70
|
+
existingOpenPromise.current = function (args) {
|
|
71
|
+
setOverlay(EMPTY_FC);
|
|
57
72
|
resolve(args);
|
|
58
73
|
onClose === null || onClose === void 0 || onClose(args);
|
|
74
|
+
existingOpenPromise.current = null;
|
|
59
75
|
};
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
76
|
+
// eslint-disable-next-line react/display-name
|
|
77
|
+
setOverlay(function () {
|
|
78
|
+
return function (overrideProps) {
|
|
79
|
+
return /*#__PURE__*/jsx(ModalOrFlyout, _objectSpread(_objectSpread(_objectSpread({}, outerProps), overrideProps), {}, {
|
|
80
|
+
onClose: existingOpenPromise.current
|
|
81
|
+
}));
|
|
82
|
+
};
|
|
83
|
+
});
|
|
63
84
|
});
|
|
64
|
-
case
|
|
85
|
+
case 5:
|
|
65
86
|
return _context.abrupt("return", _context.sent);
|
|
66
|
-
case
|
|
87
|
+
case 6:
|
|
67
88
|
case "end":
|
|
68
89
|
return _context.stop();
|
|
69
90
|
}
|
|
@@ -73,7 +94,7 @@ var useOverlayService = function useOverlayService(ModalOrFlyout) {
|
|
|
73
94
|
return _ref.apply(this, arguments);
|
|
74
95
|
};
|
|
75
96
|
}();
|
|
76
|
-
return [Overlay, openOverlay];
|
|
97
|
+
return [Overlay, openOverlay, existingOpenPromise.current];
|
|
77
98
|
};
|
|
78
99
|
|
|
79
100
|
export { useOverlayService };
|
|
@@ -13,7 +13,6 @@ import { Icon } from '../components/icon/Icon.js';
|
|
|
13
13
|
import '@floating-ui/react';
|
|
14
14
|
import '../hotkeys/HotKeyWrapper.js';
|
|
15
15
|
import 'react-i18next';
|
|
16
|
-
import '../types/icons.js';
|
|
17
16
|
import '@babel/runtime/helpers/toConsumableArray';
|
|
18
17
|
import '@babel/runtime/helpers/classCallCheck';
|
|
19
18
|
import '@babel/runtime/helpers/createClass';
|
package/dist/esm/i18n/index.js
CHANGED
package/dist/esm/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
export { ActionLabel } from './components/actionLabel/ActionLabel.js';
|
|
4
|
-
export {
|
|
4
|
+
export { AnimationIndicator, AnimationLoader, LoadingBars, LoadingLine, LoadingSpinner, Skeleton } from './components/animations/Animations.js';
|
|
5
5
|
export { Avatar } from './components/avatar/Avatar.js';
|
|
6
6
|
export { AvatarGroup } from './components/avatar/AvatarGroup.js';
|
|
7
7
|
export { Badge, getBadgeProps } from './components/badge/Badge.js';
|
|
@@ -50,7 +50,6 @@ import '@floating-ui/react';
|
|
|
50
50
|
import 'classnames';
|
|
51
51
|
import 'react';
|
|
52
52
|
import 'react-i18next';
|
|
53
|
-
export { CoreIcons } from './types/icons.js';
|
|
54
53
|
export { Title } from './typography/Title.js';
|
|
55
54
|
export { cloneChildren } from './utils/cloneElement.js';
|
|
56
55
|
import '@react-fabric/utilities';
|
|
@@ -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:
|
|
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 {
|
|
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:
|
|
118
|
+
icon: "icon-[mdi--close]",
|
|
120
119
|
onClick: function onClick() {
|
|
121
120
|
return handleClose(false);
|
|
122
121
|
}
|
|
123
122
|
})]
|
|
124
|
-
}), loading && /*#__PURE__*/jsx(
|
|
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 {
|
|
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:
|
|
110
|
+
icon: "icon-[mdi--close]",
|
|
112
111
|
onClick: function onClick() {
|
|
113
112
|
return handleClose(false);
|
|
114
113
|
}
|
|
115
114
|
})]
|
|
116
|
-
}), loading && /*#__PURE__*/jsx(
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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
|
|
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
|
|
61
|
+
* @returns {JSX.Element} The rendered LoadingBars component.
|
|
45
62
|
*
|
|
46
63
|
* @example
|
|
47
64
|
* ```jsx
|
|
48
|
-
* <
|
|
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
|
|
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
|
|
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
|
|
83
|
+
* @returns {JSX.Element} The rendered LoadingSpinner component.
|
|
66
84
|
*
|
|
67
85
|
* @example
|
|
68
86
|
* ```jsx
|
|
69
|
-
* <
|
|
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
|
|
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
|
|
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=
|
|
64
|
-
* iconClosed=
|
|
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 {
|
|
2
|
+
export { AnimationIndicator, AnimationLoader, LoadingBars, LoadingLine, LoadingSpinner, 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";
|
|
@@ -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 {
|
|
21
|
+
export { getIconProps, Icon } 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";
|
|
@@ -13,7 +13,7 @@ export interface MenuItemProps extends CssProp, AriaProps, TestProps {
|
|
|
13
13
|
/**
|
|
14
14
|
* append label badge text
|
|
15
15
|
*/
|
|
16
|
-
appendLabel?: string | false;
|
|
16
|
+
appendLabel?: JSX.Element | string | number | false;
|
|
17
17
|
/**
|
|
18
18
|
* menu color
|
|
19
19
|
*/
|
|
@@ -50,6 +50,10 @@ export interface MenuItemProps extends CssProp, AriaProps, TestProps {
|
|
|
50
50
|
export interface MenuRootProps extends CssProp {
|
|
51
51
|
label?: never;
|
|
52
52
|
minimal?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* use this create a dropdown button within menu-item
|
|
55
|
+
*/
|
|
56
|
+
forDropdown?: boolean;
|
|
53
57
|
menuClassName?: never;
|
|
54
58
|
onClick?: (id: string) => CallbackReturn;
|
|
55
59
|
}
|
|
@@ -57,6 +61,7 @@ export interface MenuInnerProps extends MenuItemProps {
|
|
|
57
61
|
label: string;
|
|
58
62
|
minimal?: never;
|
|
59
63
|
trigger?: "hover" | "click";
|
|
64
|
+
forDropdown?: boolean;
|
|
60
65
|
/**
|
|
61
66
|
* floating menu className
|
|
62
67
|
*/
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { type AriaProps, type ChildProp, type ColorType, type CssProp, type PaletteType, type TestProps } from "../../types";
|
|
2
2
|
export interface NavigatorProps extends CssProp, AriaProps, TestProps, Partial<ChildProp> {
|
|
3
|
+
/**
|
|
4
|
+
* item list length (ignore to enable infinite navigation)
|
|
5
|
+
*/
|
|
3
6
|
length?: number;
|
|
7
|
+
/**
|
|
8
|
+
* current item index (ignore to enable infinite navigation)
|
|
9
|
+
*/
|
|
4
10
|
current?: number;
|
|
5
11
|
disableKeyHandlers?: boolean;
|
|
6
12
|
/**
|
|
@@ -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=
|
|
69
|
+
* icon=icon-[mdi--menu]
|
|
70
70
|
* rtlFlip={true}
|
|
71
71
|
* className="custom-aside"
|
|
72
72
|
* bodyClassName="custom-aside-body"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ChildrenProp } from "../../types";
|
|
1
|
+
import { type ChildrenProp, type CssProp } from "../../types";
|
|
2
2
|
export interface ThemeProps {
|
|
3
3
|
/**
|
|
4
4
|
* light/dark color scheme
|
|
@@ -54,4 +54,4 @@ export interface ThemeProps {
|
|
|
54
54
|
*
|
|
55
55
|
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-application--theme-provider} for more details.
|
|
56
56
|
*/
|
|
57
|
-
export declare const ThemeProvider: ({ children, branding, primaryColor, accentColor, tintColor, colorScheme, rounding, }: ThemeProps & ChildrenProp) => import("react/jsx-runtime").JSX.Element;
|
|
57
|
+
export declare const ThemeProvider: ({ children, branding, primaryColor, accentColor, tintColor, colorScheme, rounding, className, }: ThemeProps & ChildrenProp & CssProp) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { type ElementType } from "react";
|
|
2
1
|
import { type ModalProps } from "../types";
|
|
3
|
-
type OverlayComponent = ElementType<ModalProps<AnyObject>>;
|
|
4
2
|
/**
|
|
5
3
|
* Hook to manage overlay components like modals or flyouts.
|
|
6
4
|
* It provides a way to open an overlay with specified properties and handle its closure.
|
|
@@ -11,7 +9,8 @@ type OverlayComponent = ElementType<ModalProps<AnyObject>>;
|
|
|
11
9
|
* of the overlay when it is closed, allowing you to handle the result in a controlled manner.
|
|
12
10
|
*
|
|
13
11
|
* @param ModalOrFlyout - The component to be used as an overlay.
|
|
14
|
-
* @
|
|
12
|
+
* @param toggleOpen - If true, calling `openOverlay` while an overlay is already open will close the existing one instead of opening a new one.
|
|
13
|
+
* @returns An array containing the current overlay, a function to open it, and a boolean indicating if the overlay is open.
|
|
15
14
|
*
|
|
16
15
|
* @example
|
|
17
16
|
* ```jsx
|
|
@@ -25,5 +24,4 @@ type OverlayComponent = ElementType<ModalProps<AnyObject>>;
|
|
|
25
24
|
* <Overlay />
|
|
26
25
|
* ```
|
|
27
26
|
*/
|
|
28
|
-
export declare const useOverlayService: (ModalOrFlyout:
|
|
29
|
-
export {};
|
|
27
|
+
export declare const useOverlayService: <T extends AnyObject = AnyObject>(ModalOrFlyout: React.FunctionComponent<ModalProps<T>>) => [Overlay: React.FunctionComponent<Partial<T>>, openOverlay: (props?: Partial<T>) => Promise<AnyObject>, closeOverlay: ((args?: AnyObject) => void) | null];
|
package/dist/types/index.d.ts
CHANGED
|
@@ -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";
|