@react-fabric/core 1.0.0-beta.57 → 1.0.0-beta.59
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/_icon.css +3 -3
- package/css/components/_stepper.css +86 -0
- package/css/components/index.css +1 -0
- package/dist/cjs/components/avatar/Avatar.js +1 -0
- package/dist/cjs/components/badge/Badge.js +2 -10
- package/dist/cjs/components/button/Button.js +4 -11
- package/dist/cjs/components/chip/Chip.js +5 -12
- package/dist/cjs/components/icon/Icon.js +28 -3
- package/dist/cjs/components/menu/MenuItem.js +5 -12
- package/dist/cjs/components/panel/Panel.js +4 -13
- package/dist/cjs/components/tabpanel/Tab.js +3 -12
- package/dist/cjs/core/aside/Aside.js +2 -11
- package/dist/cjs/core/headfoot/HeadFoot.js +4 -2
- package/dist/cjs/core/page/Page.js +4 -13
- package/dist/cjs/hooks/useStepper.js +75 -0
- package/dist/cjs/index.js +3 -0
- package/dist/cjs/overlays/alert/Alert.js +3 -1
- package/dist/cjs/overlays/flyout/Flyout.js +4 -11
- package/dist/cjs/overlays/message/Message.js +2 -0
- package/dist/cjs/overlays/modal/Modal.js +4 -11
- package/dist/cjs/overlays/toast/Toast.js +3 -1
- package/dist/cjs/types/icons.js +2 -1
- package/dist/esm/components/avatar/Avatar.js +1 -0
- package/dist/esm/components/badge/Badge.js +3 -11
- package/dist/esm/components/button/Button.js +6 -13
- package/dist/esm/components/chip/Chip.js +6 -13
- package/dist/esm/components/icon/Icon.js +30 -6
- package/dist/esm/components/menu/MenuItem.js +6 -13
- package/dist/esm/components/panel/Panel.js +5 -14
- package/dist/esm/components/tabpanel/Tab.js +4 -13
- package/dist/esm/core/aside/Aside.js +3 -12
- package/dist/esm/core/headfoot/HeadFoot.js +4 -2
- package/dist/esm/core/page/Page.js +5 -14
- package/dist/esm/hooks/useStepper.js +75 -0
- package/dist/esm/index.js +2 -1
- package/dist/esm/overlays/alert/Alert.js +3 -1
- package/dist/esm/overlays/flyout/Flyout.js +5 -12
- package/dist/esm/overlays/message/Message.js +2 -0
- package/dist/esm/overlays/modal/Modal.js +5 -12
- package/dist/esm/overlays/toast/Toast.js +3 -1
- package/dist/esm/types/icons.js +2 -1
- package/dist/types/components/badge/Badge.d.ts +8 -3
- package/dist/types/components/button/Button.d.ts +8 -3
- package/dist/types/components/chip/Chip.d.ts +8 -3
- package/dist/types/components/icon/Icon.d.ts +10 -4
- package/dist/types/components/index.d.ts +1 -1
- package/dist/types/components/menu/MenuItem.d.ts +1 -1
- package/dist/types/components/menu/types.d.ts +7 -2
- package/dist/types/components/panel/Panel.d.ts +8 -5
- package/dist/types/components/tabpanel/Tab.d.ts +8 -5
- package/dist/types/core/aside/Aside.d.ts +8 -5
- package/dist/types/core/page/Page.d.ts +8 -5
- package/dist/types/hooks/useStepper.d.ts +15 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/overlays/alert/Alert.d.ts +15 -3
- package/dist/types/overlays/flyout/Flyout.d.ts +5 -5
- package/dist/types/overlays/message/Message.d.ts +15 -3
- package/dist/types/overlays/modal/Modal.d.ts +5 -5
- package/dist/types/overlays/toast/Toast.d.ts +15 -3
- package/dist/types/types/icons.d.ts +2 -1
- package/dist/types/types/index.d.ts +0 -18
- package/package.json +14 -14
- package/src/components/avatar/Avatar.tsx +1 -1
- package/src/components/badge/Badge.tsx +7 -13
- package/src/components/button/Button.tsx +10 -18
- package/src/components/chip/Chip.tsx +7 -11
- package/src/components/icon/Icon.tsx +43 -6
- package/src/components/index.ts +1 -1
- package/src/components/menu/MenuItem.tsx +4 -9
- package/src/components/menu/types.ts +6 -6
- package/src/components/panel/Panel.tsx +7 -13
- package/src/components/tabpanel/Tab.tsx +6 -17
- package/src/core/aside/Aside.tsx +7 -13
- package/src/core/headfoot/HeadFoot.tsx +2 -2
- package/src/core/page/Page.tsx +8 -23
- package/src/hooks/useStepper.tsx +68 -0
- package/src/index.ts +1 -0
- package/src/overlays/alert/Alert.tsx +24 -5
- package/src/overlays/flyout/Flyout.tsx +5 -21
- package/src/overlays/message/Message.tsx +18 -3
- package/src/overlays/modal/Modal.tsx +5 -21
- package/src/overlays/toast/Toast.tsx +23 -4
- package/src/types/global.d.ts +8 -0
- package/src/types/icons.ts +3 -1
- package/src/types/index.ts +0 -19
|
@@ -4,10 +4,10 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
|
4
4
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
5
5
|
import classNames from 'classnames';
|
|
6
6
|
import { Loading } from '../../components/animations/Animations.js';
|
|
7
|
-
import { Icon } from '../../components/icon/Icon.js';
|
|
7
|
+
import { Icon, getIconProps } from '../../components/icon/Icon.js';
|
|
8
8
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
9
9
|
|
|
10
|
-
var _excluded = ["ref", "children", "paper", "title", "titleClassName", "icon", "
|
|
10
|
+
var _excluded = ["ref", "children", "paper", "title", "titleClassName", "icon", "loading", "data-testid", "data-test-value"];
|
|
11
11
|
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; }
|
|
12
12
|
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; }
|
|
13
13
|
/**
|
|
@@ -24,8 +24,6 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
24
24
|
* <Page
|
|
25
25
|
* title="My Page"
|
|
26
26
|
* icon="home"
|
|
27
|
-
* iconBg="bg-blue-500"
|
|
28
|
-
* iconColor="text-white"
|
|
29
27
|
* loading={false}
|
|
30
28
|
* paper={true}
|
|
31
29
|
* data-testid="my-page"
|
|
@@ -45,9 +43,6 @@ var Page = function Page(_ref) {
|
|
|
45
43
|
title = _ref.title,
|
|
46
44
|
titleClassName = _ref.titleClassName,
|
|
47
45
|
icon = _ref.icon,
|
|
48
|
-
rtlFlip = _ref.rtlFlip,
|
|
49
|
-
iconBg = _ref.iconBg,
|
|
50
|
-
iconColor = _ref.iconColor,
|
|
51
46
|
loading = _ref.loading,
|
|
52
47
|
testId = _ref["data-testid"],
|
|
53
48
|
testValue = _ref["data-test-value"],
|
|
@@ -62,13 +57,9 @@ var Page = function Page(_ref) {
|
|
|
62
57
|
children: [title && /*#__PURE__*/jsxs("div", {
|
|
63
58
|
"data-ref": "pageTitle",
|
|
64
59
|
className: classNames("fabric-pageTitle", "select-none flex gap-1 items-center justify-center px-1 py-0.5 font-medium text-center", titleClassName),
|
|
65
|
-
children: [icon && /*#__PURE__*/jsx(Icon, {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
rtlFlip: rtlFlip,
|
|
69
|
-
bg: iconBg,
|
|
70
|
-
color: iconColor
|
|
71
|
-
}), title]
|
|
60
|
+
children: [icon && /*#__PURE__*/jsx(Icon, _objectSpread({
|
|
61
|
+
size: "1.25em"
|
|
62
|
+
}, getIconProps(icon))), title]
|
|
72
63
|
}), loading && /*#__PURE__*/jsx(Loading, {}), children]
|
|
73
64
|
}));
|
|
74
65
|
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
4
|
+
import { useState, useMemo } from 'react';
|
|
5
|
+
import '@babel/runtime/helpers/defineProperty';
|
|
6
|
+
import '@babel/runtime/helpers/objectWithoutProperties';
|
|
7
|
+
import 'classnames';
|
|
8
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
9
|
+
import '@react-fabric/utilities';
|
|
10
|
+
import './useEffectDebugger.js';
|
|
11
|
+
import 'boring-avatars';
|
|
12
|
+
import { Icon } from '../components/icon/Icon.js';
|
|
13
|
+
import '@floating-ui/react';
|
|
14
|
+
import '../hotkeys/HotKeyWrapper.js';
|
|
15
|
+
import 'react-i18next';
|
|
16
|
+
import '../types/icons.js';
|
|
17
|
+
import '@babel/runtime/helpers/toConsumableArray';
|
|
18
|
+
import '@babel/runtime/helpers/classCallCheck';
|
|
19
|
+
import '@babel/runtime/helpers/createClass';
|
|
20
|
+
import '@babel/runtime/helpers/possibleConstructorReturn';
|
|
21
|
+
import '@babel/runtime/helpers/getPrototypeOf';
|
|
22
|
+
import '@babel/runtime/helpers/inherits';
|
|
23
|
+
import 'i18next';
|
|
24
|
+
import '@babel/runtime/helpers/asyncToGenerator';
|
|
25
|
+
import '@babel/runtime/regenerator';
|
|
26
|
+
import 'react-dom';
|
|
27
|
+
import '../components/media/Media.js';
|
|
28
|
+
import '@babel/runtime/helpers/toArray';
|
|
29
|
+
|
|
30
|
+
var useStepper = function useStepper(_ref) {
|
|
31
|
+
var steps = _ref.steps,
|
|
32
|
+
_ref$activeStep = _ref.activeStep,
|
|
33
|
+
_initialActiveStep = _ref$activeStep === void 0 ? 0 : _ref$activeStep;
|
|
34
|
+
var _useState = useState(_initialActiveStep),
|
|
35
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
36
|
+
activeStep = _useState2[0],
|
|
37
|
+
setActiveStep = _useState2[1];
|
|
38
|
+
var maxSteps = useMemo(function () {
|
|
39
|
+
return steps.length - 1;
|
|
40
|
+
}, [steps]);
|
|
41
|
+
var stepper = useMemo(function () {
|
|
42
|
+
return /*#__PURE__*/jsx("div", {
|
|
43
|
+
className: "fabric-stepper bg-base flex-1 flex justify-center py-1 px-2 overflow-x-auto",
|
|
44
|
+
children: steps.map(function (child, index) {
|
|
45
|
+
return /*#__PURE__*/jsxs("div", {
|
|
46
|
+
className: "fabric-stepper--pill",
|
|
47
|
+
"data-state": index === activeStep ? "active" : index < activeStep ? "completed" : undefined,
|
|
48
|
+
children: [child.icon && /*#__PURE__*/jsx(Icon, {
|
|
49
|
+
icon: child.icon
|
|
50
|
+
}), child.label && /*#__PURE__*/jsx("label", {
|
|
51
|
+
children: child.label
|
|
52
|
+
})]
|
|
53
|
+
}, index);
|
|
54
|
+
})
|
|
55
|
+
});
|
|
56
|
+
}, [steps]);
|
|
57
|
+
return {
|
|
58
|
+
stepper: stepper,
|
|
59
|
+
activeStep: activeStep,
|
|
60
|
+
firstStep: activeStep === 0,
|
|
61
|
+
lastStep: activeStep === maxSteps,
|
|
62
|
+
next: function next() {
|
|
63
|
+
return setActiveStep(function (s) {
|
|
64
|
+
return Math.min(s + 1, maxSteps);
|
|
65
|
+
});
|
|
66
|
+
},
|
|
67
|
+
prev: function prev() {
|
|
68
|
+
return setActiveStep(function (s) {
|
|
69
|
+
return Math.max(s - 1, 0);
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export { useStepper };
|
package/dist/esm/index.js
CHANGED
|
@@ -20,7 +20,7 @@ export { Divider } from './components/divider/Divider.js';
|
|
|
20
20
|
export { Dropdown, DropdownDismiss } from './components/dropdown/Dropdown.js';
|
|
21
21
|
export { DropdownTool } from './components/dropdown/DropdownTool.js';
|
|
22
22
|
export { EmptyContent } from './components/empty/EmptyContent.js';
|
|
23
|
-
export { Icon } from './components/icon/Icon.js';
|
|
23
|
+
export { Icon, getIconProps } from './components/icon/Icon.js';
|
|
24
24
|
export { Image, Video } from './components/media/Media.js';
|
|
25
25
|
export { ContextMenu } from './components/menu/ContextMenu.js';
|
|
26
26
|
export { Menu } from './components/menu/Menu.js';
|
|
@@ -72,6 +72,7 @@ export { useNavigator } from './hooks/useNavigator.js';
|
|
|
72
72
|
export { useOverlayService } from './hooks/useOverlayService.js';
|
|
73
73
|
export { useResize } from './hooks/useResize.js';
|
|
74
74
|
export { useResizeObserver } from './hooks/useResizeObserver.js';
|
|
75
|
+
export { useStepper } from './hooks/useStepper.js';
|
|
75
76
|
export { useLocalStorage, useSessionStorage } from './hooks/useStorage.js';
|
|
76
77
|
export { HotKey } from './hotkeys/HotKey.js';
|
|
77
78
|
export { HotKeyLabel } from './hotkeys/HotKeyLabel.js';
|
|
@@ -23,6 +23,7 @@ var Alert = function Alert(_ref) {
|
|
|
23
23
|
_ref$color = _ref.color,
|
|
24
24
|
color = _ref$color === void 0 ? "primary" : _ref$color,
|
|
25
25
|
icon = _ref.icon,
|
|
26
|
+
iconSrc = _ref.iconSrc,
|
|
26
27
|
rtlFlip = _ref.rtlFlip,
|
|
27
28
|
actions = _ref.actions,
|
|
28
29
|
onClose = _ref.onClose,
|
|
@@ -57,6 +58,7 @@ var Alert = function Alert(_ref) {
|
|
|
57
58
|
var iconType = useMemo(function () {
|
|
58
59
|
if (icon) return /*#__PURE__*/jsx(Icon, {
|
|
59
60
|
icon: icon,
|
|
61
|
+
iconSrc: iconSrc,
|
|
60
62
|
size: "md",
|
|
61
63
|
rtlFlip: rtlFlip,
|
|
62
64
|
color: "".concat(color, "-600")
|
|
@@ -83,7 +85,7 @@ var Alert = function Alert(_ref) {
|
|
|
83
85
|
color: "".concat(color, "-600")
|
|
84
86
|
});
|
|
85
87
|
}
|
|
86
|
-
}, [color, type, icon]);
|
|
88
|
+
}, [color, type, icon, iconSrc, rtlFlip]);
|
|
87
89
|
var handleClose = useCallback(function (ret) {
|
|
88
90
|
refs.floating.current && (refs.floating.current.dataset.show = "false");
|
|
89
91
|
setTimeout(function () {
|
|
@@ -7,21 +7,18 @@ import { isString } from '@react-fabric/utilities';
|
|
|
7
7
|
import classNames from 'classnames';
|
|
8
8
|
import { useCallback, useEffect, isValidElement } from 'react';
|
|
9
9
|
import { Loading } from '../../components/animations/Animations.js';
|
|
10
|
-
import { Icon } from '../../components/icon/Icon.js';
|
|
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
13
|
import { CoreIcons } from '../../types/icons.js';
|
|
14
14
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
15
15
|
|
|
16
|
-
var _excluded = ["icon", "
|
|
16
|
+
var _excluded = ["icon", "iconClassName", "title", "actions", "closeOnClick", "headerClassName", "onClose", "onBeforeClose", "children", "loading", "size", "width", "minWidth", "root", "hideMask", "align"];
|
|
17
17
|
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; }
|
|
18
18
|
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; }
|
|
19
19
|
var Flyout = function Flyout(_ref) {
|
|
20
20
|
var icon = _ref.icon,
|
|
21
|
-
iconBg = _ref.iconBg,
|
|
22
|
-
iconColor = _ref.iconColor,
|
|
23
21
|
iconClassName = _ref.iconClassName,
|
|
24
|
-
rtlFlip = _ref.rtlFlip,
|
|
25
22
|
title = _ref.title,
|
|
26
23
|
actions = _ref.actions,
|
|
27
24
|
closeOnClick = _ref.closeOnClick,
|
|
@@ -111,13 +108,9 @@ var Flyout = function Flyout(_ref) {
|
|
|
111
108
|
flex: true,
|
|
112
109
|
align: "center",
|
|
113
110
|
className: classNames("fabric-flyoutHeader", headerClassName),
|
|
114
|
-
children: [isString(icon) && /*#__PURE__*/jsx(Icon, {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
color: iconColor,
|
|
118
|
-
className: classNames(iconClassName, "p-1"),
|
|
119
|
-
rtlFlip: rtlFlip
|
|
120
|
-
}), /*#__PURE__*/isValidElement(icon) && icon, /*#__PURE__*/jsx("label", {
|
|
111
|
+
children: [isString(icon) && /*#__PURE__*/jsx(Icon, _objectSpread({
|
|
112
|
+
className: classNames(iconClassName, "p-1")
|
|
113
|
+
}, getIconProps(icon))), /*#__PURE__*/isValidElement(icon) && icon, /*#__PURE__*/jsx("label", {
|
|
121
114
|
className: "flex-1 truncate py-2 px-1",
|
|
122
115
|
children: title
|
|
123
116
|
}), actions, /*#__PURE__*/jsx(Icon, {
|
|
@@ -35,6 +35,7 @@ var Message = function Message(_ref) {
|
|
|
35
35
|
message = _ref.message,
|
|
36
36
|
color = _ref.color,
|
|
37
37
|
icon = _ref.icon,
|
|
38
|
+
iconSrc = _ref.iconSrc,
|
|
38
39
|
rtlFlip = _ref.rtlFlip,
|
|
39
40
|
actions = _ref.actions,
|
|
40
41
|
onClose = _ref.onClose;
|
|
@@ -59,6 +60,7 @@ var Message = function Message(_ref) {
|
|
|
59
60
|
ref: elRef,
|
|
60
61
|
children: [icon && /*#__PURE__*/jsx(Icon, {
|
|
61
62
|
icon: icon,
|
|
63
|
+
iconSrc: iconSrc,
|
|
62
64
|
size: "md",
|
|
63
65
|
rtlFlip: rtlFlip
|
|
64
66
|
}), title && /*#__PURE__*/jsx("div", {
|
|
@@ -7,21 +7,18 @@ import { isString } from '@react-fabric/utilities';
|
|
|
7
7
|
import classNames from 'classnames';
|
|
8
8
|
import { useCallback, useEffect, isValidElement } from 'react';
|
|
9
9
|
import { Loading } from '../../components/animations/Animations.js';
|
|
10
|
-
import { Icon } from '../../components/icon/Icon.js';
|
|
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
13
|
import { CoreIcons } from '../../types/icons.js';
|
|
14
14
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
15
15
|
|
|
16
|
-
var _excluded = ["icon", "
|
|
16
|
+
var _excluded = ["icon", "iconClassName", "title", "actions", "headerClassName", "onClose", "onBeforeClose", "children", "loading", "root", "size", "hideMask", "width", "height", "minHeight", "minWidth"];
|
|
17
17
|
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; }
|
|
18
18
|
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; }
|
|
19
19
|
var Modal = function Modal(_ref) {
|
|
20
20
|
var icon = _ref.icon,
|
|
21
|
-
iconBg = _ref.iconBg,
|
|
22
|
-
iconColor = _ref.iconColor,
|
|
23
21
|
iconClassName = _ref.iconClassName,
|
|
24
|
-
rtlFlip = _ref.rtlFlip,
|
|
25
22
|
title = _ref.title,
|
|
26
23
|
actions = _ref.actions,
|
|
27
24
|
headerClassName = _ref.headerClassName,
|
|
@@ -103,13 +100,9 @@ var Modal = function Modal(_ref) {
|
|
|
103
100
|
flex: true,
|
|
104
101
|
align: "center",
|
|
105
102
|
className: classNames("fabric-modalHeader", headerClassName),
|
|
106
|
-
children: [isString(icon) && /*#__PURE__*/jsx(Icon, {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
color: iconColor,
|
|
110
|
-
className: classNames(iconClassName, "p-1"),
|
|
111
|
-
rtlFlip: rtlFlip
|
|
112
|
-
}), /*#__PURE__*/isValidElement(icon) && icon, /*#__PURE__*/jsx("label", {
|
|
103
|
+
children: [isString(icon) && /*#__PURE__*/jsx(Icon, _objectSpread({
|
|
104
|
+
className: classNames(iconClassName, "p-1")
|
|
105
|
+
}, getIconProps(icon))), /*#__PURE__*/isValidElement(icon) && icon, /*#__PURE__*/jsx("label", {
|
|
113
106
|
className: "flex-1 truncate py-2 px-1",
|
|
114
107
|
children: title
|
|
115
108
|
}), actions, /*#__PURE__*/jsx(Icon, {
|
|
@@ -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");
|
package/dist/esm/types/icons.js
CHANGED
|
@@ -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 = "
|
|
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
|
|
2
|
-
|
|
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,
|
|
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
|
|
3
|
-
|
|
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,
|
|
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
|
|
3
|
-
|
|
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,
|
|
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
|
|
2
|
-
export interface
|
|
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 }:
|
|
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,
|
|
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
|
|
3
|
-
|
|
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
|
|
4
|
-
|
|
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,
|
|
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
|
|
3
|
-
|
|
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,
|
|
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 {
|
|
3
|
-
|
|
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,
|
|
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 {
|
|
2
|
-
|
|
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,
|
|
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;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
export declare const useStepper: ({ steps, activeStep: _initialActiveStep, }: {
|
|
3
|
+
steps: Array<{
|
|
4
|
+
label?: ReactNode;
|
|
5
|
+
icon?: ReactNode;
|
|
6
|
+
}>;
|
|
7
|
+
activeStep?: number;
|
|
8
|
+
}) => {
|
|
9
|
+
stepper: import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
activeStep: number;
|
|
11
|
+
firstStep: boolean;
|
|
12
|
+
lastStep: boolean;
|
|
13
|
+
next: () => void;
|
|
14
|
+
prev: () => void;
|
|
15
|
+
};
|