@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
|
@@ -83,35 +83,31 @@ var AnimationIndicator = function AnimationIndicator(_ref) {
|
|
|
83
83
|
};
|
|
84
84
|
|
|
85
85
|
/**
|
|
86
|
-
* A component that displays
|
|
87
|
-
* It
|
|
88
|
-
* This component is typically used to indicate loading states in the UI.
|
|
89
|
-
*
|
|
90
|
-
* @param {Object} props - The properties for the AnimationBars component.
|
|
91
|
-
* @param {ColorType | PaletteType | string} [props.color="tint-500"] - The color of the bars.
|
|
92
|
-
* @param {number | string} [props.size="2rem"] - The size of the bars.
|
|
93
|
-
* @returns {JSX.Element} The rendered AnimationBars component.
|
|
94
|
-
*
|
|
95
|
-
* @example
|
|
96
|
-
* ```jsx
|
|
97
|
-
* <AnimationBars color="primary-500" size="3rem" />
|
|
98
|
-
* ```
|
|
86
|
+
* A component that displays a loading animation with a customizable icon, color, size, and mask blur.
|
|
87
|
+
* It is typically used to indicate loading states in the UI.
|
|
99
88
|
*
|
|
100
|
-
* @
|
|
89
|
+
* @param {Object} props - The properties for the AnimationLoader component.
|
|
90
|
+
* @param {ColorType | PaletteType | string} [props.color="tint-500"] - The color of the loader icon.
|
|
91
|
+
* @param {number | string} [props.size="2rem"] - The size of the loader icon.
|
|
92
|
+
* @param {string} props.icon - The icon to be displayed as the loader.
|
|
93
|
+
* @param {"sm" | "md" | "lg"} [props.maskBlur] - The blur effect for the background mask.
|
|
94
|
+
* @returns {JSX.Element} The rendered AnimationLoader component.
|
|
101
95
|
*/
|
|
102
|
-
var
|
|
96
|
+
var AnimationLoader = function AnimationLoader(_ref2) {
|
|
103
97
|
var _ref2$color = _ref2.color,
|
|
104
98
|
color = _ref2$color === void 0 ? "tint-500" : _ref2$color,
|
|
105
99
|
_ref2$size = _ref2.size,
|
|
106
|
-
size = _ref2$size === void 0 ? "2rem" : _ref2$size
|
|
100
|
+
size = _ref2$size === void 0 ? "2rem" : _ref2$size,
|
|
101
|
+
icon = _ref2.icon,
|
|
102
|
+
maskBlur = _ref2.maskBlur;
|
|
107
103
|
return /*#__PURE__*/jsx("div", {
|
|
108
|
-
className: classNames("absolute inset-0 z-10 flex justify-center items-center cursor-wait"),
|
|
104
|
+
className: classNames("absolute inset-0 z-10 flex justify-center items-center cursor-wait", maskBlur === "sm" && "backdrop-blur-sm", maskBlur === "md" && "backdrop-blur-md", maskBlur === "lg" && "backdrop-blur-lg"),
|
|
109
105
|
children: /*#__PURE__*/jsx("div", {
|
|
110
|
-
className: classNames("outline outline-tint-500/20 p-4 bg-tint-50/50 backdrop-blur-sm rounded"),
|
|
106
|
+
className: classNames("outline outline-tint-500/20 p-4 bg-tint-50/50 backdrop-blur-sm leading-0 rounded"),
|
|
111
107
|
children: /*#__PURE__*/jsx("div", {
|
|
112
|
-
className: classNames("
|
|
108
|
+
className: classNames("aspect-square", icon),
|
|
113
109
|
style: {
|
|
114
|
-
|
|
110
|
+
fontSize: size,
|
|
115
111
|
color: getColor(color)
|
|
116
112
|
}
|
|
117
113
|
})
|
|
@@ -119,42 +115,50 @@ var AnimationBars = function AnimationBars(_ref2) {
|
|
|
119
115
|
});
|
|
120
116
|
};
|
|
121
117
|
|
|
118
|
+
/**
|
|
119
|
+
* A component that displays an animated bars loader.
|
|
120
|
+
* It can be customized with color and size properties.
|
|
121
|
+
* This component is typically used to indicate loading states in the UI.
|
|
122
|
+
*
|
|
123
|
+
* @param {Object} props - The properties for the LoadingBars component.
|
|
124
|
+
* @param {ColorType | PaletteType | string} [props.color="tint-500"] - The color of the bars.
|
|
125
|
+
* @param {number | string} [props.size="2rem"] - The size of the bars.
|
|
126
|
+
* @returns {JSX.Element} The rendered LoadingBars component.
|
|
127
|
+
*
|
|
128
|
+
* @example
|
|
129
|
+
* ```jsx
|
|
130
|
+
* <LoadingBars color="primary-500" size="3rem" />
|
|
131
|
+
* ```
|
|
132
|
+
*
|
|
133
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-components-animations--docs} for more details.
|
|
134
|
+
*/
|
|
135
|
+
var LoadingBars = function LoadingBars(props) {
|
|
136
|
+
return /*#__PURE__*/jsx(AnimationLoader, _objectSpread({
|
|
137
|
+
icon: "icon-[svg-spinners--bars-scale-fade]"
|
|
138
|
+
}, props));
|
|
139
|
+
};
|
|
140
|
+
|
|
122
141
|
/**
|
|
123
142
|
* A component that displays a spinner animation.
|
|
124
143
|
* It can be customized with color and size properties.
|
|
125
144
|
* This component is typically used to indicate loading states in the UI.
|
|
126
145
|
*
|
|
127
|
-
* @param {Object} props - The properties for the
|
|
146
|
+
* @param {Object} props - The properties for the LoadingSpinner component.
|
|
128
147
|
* @param {ColorType | PaletteType | string} [props.color="tint-700"] - The color of the spinner.
|
|
129
148
|
* @param {number | string} [props.size="2rem"] - The size of the spinner.
|
|
130
|
-
* @returns {JSX.Element} The rendered
|
|
149
|
+
* @returns {JSX.Element} The rendered LoadingSpinner component.
|
|
131
150
|
*
|
|
132
151
|
* @example
|
|
133
152
|
* ```jsx
|
|
134
|
-
* <
|
|
153
|
+
* <LoadingSpinner color="primary-500" size="3rem" />
|
|
135
154
|
* ```
|
|
136
155
|
*
|
|
137
156
|
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-components-animations--docs} for more details.
|
|
138
157
|
*/
|
|
139
|
-
var
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
size = _ref3$size === void 0 ? "2rem" : _ref3$size;
|
|
144
|
-
return /*#__PURE__*/jsx("div", {
|
|
145
|
-
className: classNames("absolute inset-0 z-10 flex justify-center items-center cursor-wait"),
|
|
146
|
-
"data-ref": "spinner",
|
|
147
|
-
children: /*#__PURE__*/jsx("div", {
|
|
148
|
-
className: classNames("outline outline-tint-500/20 p-4 bg-tint-50/50 backdrop-blur-sm rounded"),
|
|
149
|
-
children: /*#__PURE__*/jsx("div", {
|
|
150
|
-
className: classNames("fabric-spinner"),
|
|
151
|
-
style: {
|
|
152
|
-
width: size,
|
|
153
|
-
color: getColor(color)
|
|
154
|
-
}
|
|
155
|
-
})
|
|
156
|
-
})
|
|
157
|
-
});
|
|
158
|
+
var LoadingSpinner = function LoadingSpinner(props) {
|
|
159
|
+
return /*#__PURE__*/jsx(AnimationLoader, _objectSpread({
|
|
160
|
+
icon: "icon-[svg-spinners--eclipse]"
|
|
161
|
+
}, props));
|
|
158
162
|
};
|
|
159
163
|
|
|
160
164
|
/**
|
|
@@ -174,9 +178,9 @@ var AnimationSpinner = function AnimationSpinner(_ref3) {
|
|
|
174
178
|
*
|
|
175
179
|
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-components-animations--docs} for more details.
|
|
176
180
|
*/
|
|
177
|
-
var Skeleton = function Skeleton(
|
|
178
|
-
var className =
|
|
179
|
-
rest = _objectWithoutProperties(
|
|
181
|
+
var Skeleton = function Skeleton(_ref3) {
|
|
182
|
+
var className = _ref3.className,
|
|
183
|
+
rest = _objectWithoutProperties(_ref3, _excluded2);
|
|
180
184
|
return /*#__PURE__*/jsxs("div", _objectSpread(_objectSpread({
|
|
181
185
|
className: classNames(className, "p-2 animate-pulse flex gap-2 max-w-lg"),
|
|
182
186
|
"data-ref": "skeleton"
|
|
@@ -212,7 +216,7 @@ var Skeleton = function Skeleton(_ref4) {
|
|
|
212
216
|
*
|
|
213
217
|
* @returns {JSX.Element} The rendered Loading component.
|
|
214
218
|
*/
|
|
215
|
-
var
|
|
219
|
+
var LoadingLine = function LoadingLine() {
|
|
216
220
|
return /*#__PURE__*/jsx("div", {
|
|
217
221
|
className: classNames("fabric-loader", "area-[loader] relative overflow-x-clip"),
|
|
218
222
|
"data-ref": "loading",
|
|
@@ -222,4 +226,4 @@ var Loading = function Loading() {
|
|
|
222
226
|
});
|
|
223
227
|
};
|
|
224
228
|
|
|
225
|
-
export {
|
|
229
|
+
export { AnimationIndicator, AnimationLoader, LoadingBars, LoadingLine, LoadingSpinner, Skeleton };
|
|
@@ -50,7 +50,7 @@ var Button = function Button(_ref) {
|
|
|
50
50
|
className = _ref.className,
|
|
51
51
|
active = _ref.active,
|
|
52
52
|
_ref$color = _ref.color,
|
|
53
|
-
color = _ref$color === void 0 ? "
|
|
53
|
+
color = _ref$color === void 0 ? "default" : _ref$color,
|
|
54
54
|
icon = _ref.icon,
|
|
55
55
|
_ref$iconAlign = _ref.iconAlign,
|
|
56
56
|
iconAlign = _ref$iconAlign === void 0 ? "start" : _ref$iconAlign,
|
|
@@ -142,7 +142,7 @@ var Button = function Button(_ref) {
|
|
|
142
142
|
"data-size": size,
|
|
143
143
|
"data-loading": busy || loading,
|
|
144
144
|
"data-disabled": disabled,
|
|
145
|
-
children: [hotKey && /*#__PURE__*/jsx(HotKey, {
|
|
145
|
+
children: [!disabled && hotKey && /*#__PURE__*/jsx(HotKey, {
|
|
146
146
|
keyCombo: hotKey,
|
|
147
147
|
handler: hotKeyHandler.current
|
|
148
148
|
}), /*#__PURE__*/jsx(TooltipWrapper, _objectSpread(_objectSpread({}, tooltipProps), {}, {
|
|
@@ -3,7 +3,6 @@
|
|
|
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 { CoreIcons } from '../../types/icons.js';
|
|
7
6
|
import { Icon } from '../icon/Icon.js';
|
|
8
7
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
9
8
|
|
|
@@ -13,7 +12,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
13
12
|
// colors for different callout types
|
|
14
13
|
var colors = {
|
|
15
14
|
none: "bg-base text-tint-900 border-tint-100",
|
|
16
|
-
|
|
15
|
+
"default": "bg-tint-50/50 text-tint-800 border-tint-300",
|
|
16
|
+
muted: "bg-tint-50/50 text-muted border-muted",
|
|
17
17
|
primary: "bg-primary-50/50 text-primary-800 border-primary-300",
|
|
18
18
|
accent: "bg-accent-50/50 text-accent-800 border-accent-300",
|
|
19
19
|
info: "bg-info-50/50 text-info-800 border-info-300",
|
|
@@ -51,7 +51,7 @@ var colors = {
|
|
|
51
51
|
var Callout = function Callout(_ref) {
|
|
52
52
|
var children = _ref.children,
|
|
53
53
|
_ref$color = _ref.color,
|
|
54
|
-
color = _ref$color === void 0 ? "
|
|
54
|
+
color = _ref$color === void 0 ? "default" : _ref$color,
|
|
55
55
|
legend = _ref.legend,
|
|
56
56
|
title = _ref.title,
|
|
57
57
|
icon = _ref.icon,
|
|
@@ -86,7 +86,7 @@ var Callout = function Callout(_ref) {
|
|
|
86
86
|
size: "md",
|
|
87
87
|
"data-ref": "calloutClose",
|
|
88
88
|
className: classNames("absolute end-2", legend ? "top-0" : "top-2"),
|
|
89
|
-
icon:
|
|
89
|
+
icon: "icon-[mdi--close]",
|
|
90
90
|
onClick: onClose
|
|
91
91
|
})]
|
|
92
92
|
}));
|
|
@@ -6,7 +6,6 @@ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
|
6
6
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
7
7
|
import classNames from 'classnames';
|
|
8
8
|
import { useState, useRef, useImperativeHandle, useEffect, useMemo, Children } from 'react';
|
|
9
|
-
import { CoreIcons } from '../../types/icons.js';
|
|
10
9
|
import { Icon } from '../icon/Icon.js';
|
|
11
10
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
12
11
|
|
|
@@ -26,8 +25,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
26
25
|
* ```jsx
|
|
27
26
|
* <Collapsable
|
|
28
27
|
* iconAlign="start"
|
|
29
|
-
* iconOpen=
|
|
30
|
-
* iconClosed=
|
|
28
|
+
* iconOpen="icon-[mdi--chevron-down]"
|
|
29
|
+
* iconClosed="icon-[mdi--chevron-right]"
|
|
31
30
|
* open={true}
|
|
32
31
|
* onOpen={() => console.log("Opened")}
|
|
33
32
|
* onClose={() => console.log("Closed")}
|
|
@@ -49,9 +48,9 @@ var Collapsable = function Collapsable(_ref) {
|
|
|
49
48
|
iconAlign = _ref.iconAlign,
|
|
50
49
|
stickyHeader = _ref.stickyHeader,
|
|
51
50
|
_ref$iconClosed = _ref.iconClosed,
|
|
52
|
-
iconClosed = _ref$iconClosed === void 0 ?
|
|
51
|
+
iconClosed = _ref$iconClosed === void 0 ? "icon-[mdi--chevron-right]" : _ref$iconClosed,
|
|
53
52
|
_ref$iconOpen = _ref.iconOpen,
|
|
54
|
-
iconOpen = _ref$iconOpen === void 0 ?
|
|
53
|
+
iconOpen = _ref$iconOpen === void 0 ? "icon-[mdi--chevron-down]" : _ref$iconOpen,
|
|
55
54
|
open = _ref.open;
|
|
56
55
|
_ref.onClose;
|
|
57
56
|
_ref.onOpen;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
4
4
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
5
|
-
import { FloatingTree,
|
|
5
|
+
import { useFloatingTree, FloatingTree, useFloatingNodeId, useFloating, autoUpdate, shift, flip, offset, arrow, safePolygon, useDismiss, useInteractions, FloatingPortal, FloatingOverlay, FloatingFocusManager, FloatingArrow, useHover, useClick } from '@floating-ui/react';
|
|
6
6
|
import { mergeRefs } from '@react-fabric/utilities';
|
|
7
7
|
import classNames from 'classnames';
|
|
8
8
|
import { useRef, useState, useMemo, Children, useCallback, useEffect, Fragment, cloneElement } from 'react';
|
|
@@ -32,6 +32,7 @@ var DropdownElement = function DropdownElement(_ref) {
|
|
|
32
32
|
isOpen = _useState2[0],
|
|
33
33
|
setIsOpen = _useState2[1];
|
|
34
34
|
var tree = useFloatingTree();
|
|
35
|
+
var nodeId = useFloatingNodeId();
|
|
35
36
|
var _useMemo = useMemo(function () {
|
|
36
37
|
return Children.toArray(children);
|
|
37
38
|
}, [children]),
|
|
@@ -39,6 +40,7 @@ var DropdownElement = function DropdownElement(_ref) {
|
|
|
39
40
|
anchor = _useMemo2[0],
|
|
40
41
|
panel = _useMemo2[1];
|
|
41
42
|
var _useFloating = useFloating({
|
|
43
|
+
nodeId: "dropdown-".concat(nodeId),
|
|
42
44
|
open: isOpen,
|
|
43
45
|
onOpenChange: function onOpenChange(open, _, reason) {
|
|
44
46
|
var _ref2;
|
|
@@ -80,6 +82,10 @@ var DropdownElement = function DropdownElement(_ref) {
|
|
|
80
82
|
}
|
|
81
83
|
return undefined;
|
|
82
84
|
}, [refs, isOpen, fitToParent]);
|
|
85
|
+
var dismissDropdown = useCallback(function () {
|
|
86
|
+
setIsOpen(false);
|
|
87
|
+
onClose === null || onClose === void 0 || onClose();
|
|
88
|
+
}, []);
|
|
83
89
|
var tryClosing = useCallback(function (e) {
|
|
84
90
|
var _refs$floating$curren, _refs$floating$curren2;
|
|
85
91
|
if (!((_refs$floating$curren = refs.floating.current) !== null && _refs$floating$curren !== void 0 && _refs$floating$curren.contains(e.target.closest("[data-dropdown-dismiss='false']"))) && (!!closeOnClick || (_refs$floating$curren2 = refs.floating.current) !== null && _refs$floating$curren2 !== void 0 && _refs$floating$curren2.contains(e.target.closest("[data-dropdown-dismiss='true']")))) {
|
|
@@ -139,7 +145,9 @@ var DropdownElement = function DropdownElement(_ref) {
|
|
|
139
145
|
role: "none",
|
|
140
146
|
className: classNames("fabric-dropdownBody", dropdownClassName, !plainDropdown && "shadow-lg bg-base ring-1 ring-tint-100", "rounded-capped overflow-auto scroll-thin grid max-h-[70vh]"),
|
|
141
147
|
onMouseUpCapture: tryClosing,
|
|
142
|
-
children: panel
|
|
148
|
+
children: /*#__PURE__*/cloneElement(panel, {
|
|
149
|
+
dismiss: dismissDropdown
|
|
150
|
+
})
|
|
143
151
|
}), showArrow && /*#__PURE__*/jsx(FloatingArrow, {
|
|
144
152
|
ref: arrowRef,
|
|
145
153
|
context: context,
|
|
@@ -184,6 +192,10 @@ var DropdownElement = function DropdownElement(_ref) {
|
|
|
184
192
|
* @see {@link https://floating-ui.com/docs/react} for more details on Floating UI.
|
|
185
193
|
*/
|
|
186
194
|
var Dropdown = function Dropdown(props) {
|
|
195
|
+
var tree = useFloatingTree();
|
|
196
|
+
if (tree) {
|
|
197
|
+
return /*#__PURE__*/jsx(DropdownElement, _objectSpread({}, props));
|
|
198
|
+
}
|
|
187
199
|
return /*#__PURE__*/jsx(FloatingTree, {
|
|
188
200
|
children: /*#__PURE__*/jsx(DropdownElement, _objectSpread({}, props))
|
|
189
201
|
});
|
|
@@ -3,7 +3,6 @@
|
|
|
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 { CoreIcons } from '../../types/icons.js';
|
|
7
6
|
import { Icon } from '../icon/Icon.js';
|
|
8
7
|
import { Dropdown } from './Dropdown.js';
|
|
9
8
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
@@ -19,7 +18,7 @@ var DropdownTool = function DropdownTool(_ref) {
|
|
|
19
18
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
20
19
|
return /*#__PURE__*/jsxs(Dropdown, _objectSpread(_objectSpread({}, props), {}, {
|
|
21
20
|
children: [/*#__PURE__*/jsx(Icon, {
|
|
22
|
-
icon: icon !== null && icon !== void 0 ? icon :
|
|
21
|
+
icon: icon !== null && icon !== void 0 ? icon : "icon-[mdi--menu-down]",
|
|
23
22
|
className: classNames("outline bg-tint-50/50 flex-content pointer-events-auto cursor-pointer", className, groupHover && "hidden group-hover/tool:inline-block data-dropdown-open:inline-block")
|
|
24
23
|
}), children]
|
|
25
24
|
}));
|
|
@@ -114,31 +114,31 @@ var Icon = function Icon(_ref) {
|
|
|
114
114
|
/** ***************** render icon *******************/
|
|
115
115
|
var iconEl = useMemo(function () {
|
|
116
116
|
if ( /*#__PURE__*/isValidElement(icon)) return icon;
|
|
117
|
-
if (
|
|
118
|
-
|
|
117
|
+
if (isString(icon)) {
|
|
118
|
+
return isSvg ? /*#__PURE__*/jsx("svg", {
|
|
119
|
+
viewBox: viewBox,
|
|
120
|
+
children: /*#__PURE__*/jsx("path", {
|
|
121
|
+
fill: "currentColor",
|
|
122
|
+
d: icon.toString()
|
|
123
|
+
})
|
|
124
|
+
}) : (icon === null || icon === void 0 ? void 0 : icon.toString().length) <= 4 ? /*#__PURE__*/jsx("svg", {
|
|
125
|
+
role: "img",
|
|
126
|
+
children: /*#__PURE__*/jsx("text", {
|
|
127
|
+
x: "50%",
|
|
128
|
+
y: "50%",
|
|
129
|
+
dy: ".1em",
|
|
130
|
+
dominantBaseline: "middle",
|
|
131
|
+
textAnchor: "middle",
|
|
132
|
+
style: {
|
|
133
|
+
fontSize: SvgTextSize[icon.length]
|
|
134
|
+
},
|
|
135
|
+
children: icon
|
|
136
|
+
})
|
|
137
|
+
}) : /*#__PURE__*/jsx("i", {
|
|
138
|
+
className: "".concat(icon)
|
|
139
|
+
});
|
|
119
140
|
}
|
|
120
|
-
|
|
121
|
-
viewBox: viewBox,
|
|
122
|
-
children: /*#__PURE__*/jsx("path", {
|
|
123
|
-
fill: "currentColor",
|
|
124
|
-
d: icon.toString()
|
|
125
|
-
})
|
|
126
|
-
}) : (icon === null || icon === void 0 ? void 0 : icon.toString().length) <= 4 ? /*#__PURE__*/jsx("svg", {
|
|
127
|
-
role: "img",
|
|
128
|
-
children: /*#__PURE__*/jsx("text", {
|
|
129
|
-
x: "50%",
|
|
130
|
-
y: "50%",
|
|
131
|
-
dy: ".1em",
|
|
132
|
-
dominantBaseline: "middle",
|
|
133
|
-
textAnchor: "middle",
|
|
134
|
-
style: {
|
|
135
|
-
fontSize: SvgTextSize[icon.length]
|
|
136
|
-
},
|
|
137
|
-
children: icon
|
|
138
|
-
})
|
|
139
|
-
}) : /*#__PURE__*/jsx("i", {
|
|
140
|
-
className: "".concat(icon)
|
|
141
|
-
});
|
|
141
|
+
throw Error("Invalid icon expected string");
|
|
142
142
|
}, [icon, isSvg, viewBox]);
|
|
143
143
|
return /*#__PURE__*/jsxs("dfn", _objectSpread(_objectSpread({
|
|
144
144
|
"data-ref": "icon",
|
|
@@ -6,7 +6,6 @@ import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProper
|
|
|
6
6
|
import { getImageColorset } from '@react-fabric/utilities';
|
|
7
7
|
import classNames from 'classnames';
|
|
8
8
|
import { useState, useEffect, useRef, Fragment } from 'react';
|
|
9
|
-
import { CoreIcons } from '../../types/icons.js';
|
|
10
9
|
import { Button } from '../button/Button.js';
|
|
11
10
|
import { Icon } from '../icon/Icon.js';
|
|
12
11
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
@@ -21,8 +20,10 @@ var cover = {
|
|
|
21
20
|
contain: "object-contain"
|
|
22
21
|
};
|
|
23
22
|
var loadIndicator = /*#__PURE__*/jsx("div", {
|
|
24
|
-
className: classNames("fabric-mediaPlaceholder", "absolute z-1 top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 text-
|
|
25
|
-
children: "
|
|
23
|
+
className: classNames("fabric-mediaPlaceholder", "absolute z-1 top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 text-sm text-gray"),
|
|
24
|
+
children: /*#__PURE__*/jsx("i", {
|
|
25
|
+
className: "icon-[svg-spinners--pulse-rings-2]"
|
|
26
|
+
})
|
|
26
27
|
});
|
|
27
28
|
|
|
28
29
|
/**
|
|
@@ -94,7 +95,7 @@ var Image = function Image(_ref) {
|
|
|
94
95
|
}), errored && /*#__PURE__*/jsx(Icon, {
|
|
95
96
|
size: "2rem",
|
|
96
97
|
className: "absolute text-tint-300 top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2",
|
|
97
|
-
icon:
|
|
98
|
+
icon: "icon-[mdi--image-off-outline]"
|
|
98
99
|
})]
|
|
99
100
|
}));
|
|
100
101
|
};
|
|
@@ -211,7 +212,7 @@ var Video = function Video(_ref2) {
|
|
|
211
212
|
rounded: true,
|
|
212
213
|
variant: "link",
|
|
213
214
|
className: "fabric-mediaControlPlaceholder",
|
|
214
|
-
icon:
|
|
215
|
+
icon: "icon-[mdi--dots-vertical]",
|
|
215
216
|
"aria-label": "controls"
|
|
216
217
|
}), /*#__PURE__*/jsx(Button, {
|
|
217
218
|
rounded: true,
|
|
@@ -221,7 +222,7 @@ var Video = function Video(_ref2) {
|
|
|
221
222
|
onClick: function onClick() {
|
|
222
223
|
videoRef.current && (videoRef.current.volume = videoRef.current.volume ? 0 : 1);
|
|
223
224
|
},
|
|
224
|
-
icon: volume ?
|
|
225
|
+
icon: volume ? "icon-[mdi--volume]" : "icon-[mdi--volume-mute]"
|
|
225
226
|
}), /*#__PURE__*/jsx(Button, {
|
|
226
227
|
rounded: true,
|
|
227
228
|
variant: "link",
|
|
@@ -231,13 +232,13 @@ var Video = function Video(_ref2) {
|
|
|
231
232
|
var _videoRef$current3, _videoRef$current4, _videoRef$current5;
|
|
232
233
|
(_videoRef$current3 = videoRef.current) !== null && _videoRef$current3 !== void 0 && _videoRef$current3.paused ? (_videoRef$current4 = videoRef.current) === null || _videoRef$current4 === void 0 ? void 0 : _videoRef$current4.play() : (_videoRef$current5 = videoRef.current) === null || _videoRef$current5 === void 0 ? void 0 : _videoRef$current5.pause();
|
|
233
234
|
},
|
|
234
|
-
icon: state ?
|
|
235
|
+
icon: state ? "icon-[mdi--pause]" : "icon-[mdi--play]"
|
|
235
236
|
})]
|
|
236
237
|
})]
|
|
237
238
|
}), errored && /*#__PURE__*/jsx(Icon, {
|
|
238
239
|
size: "2rem",
|
|
239
240
|
className: "absolute text-tint-300 top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2",
|
|
240
|
-
icon:
|
|
241
|
+
icon: "icon-[mdi--video-off-outline]"
|
|
241
242
|
})]
|
|
242
243
|
}));
|
|
243
244
|
};
|
|
@@ -8,13 +8,12 @@ import { mergeRefs } from '@react-fabric/utilities';
|
|
|
8
8
|
import classNames from 'classnames';
|
|
9
9
|
import { useState, useRef, useEffect, useCallback, cloneElement, Fragment } from 'react';
|
|
10
10
|
import { HotKeyWrapper } from '../../hotkeys/HotKeyWrapper.js';
|
|
11
|
-
import { CoreIcons } from '../../types/icons.js';
|
|
12
11
|
import { cloneChildren } from '../../utils/cloneElement.js';
|
|
13
12
|
import { nodeCheck } from '../../utils/nodeCheck.js';
|
|
14
13
|
import { MenuItem } from './MenuItem.js';
|
|
15
14
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
16
15
|
|
|
17
|
-
var _excluded = ["children", "minimal", "menuClassName", "onClick", "trigger", "ref"];
|
|
16
|
+
var _excluded = ["children", "minimal", "menuClassName", "onClick", "trigger", "ref", "forDropdown"];
|
|
18
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; }
|
|
19
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; }
|
|
20
19
|
// FIXME: refactor menu implementation to differentiate between static and floating menus, implement context wrapper for each menu level
|
|
@@ -28,6 +27,7 @@ var MenuComponent = function MenuComponent(_ref) {
|
|
|
28
27
|
_ref$trigger = _ref.trigger,
|
|
29
28
|
trigger = _ref$trigger === void 0 ? "hover" : _ref$trigger,
|
|
30
29
|
ref = _ref.ref,
|
|
30
|
+
forDropdown = _ref.forDropdown,
|
|
31
31
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
32
32
|
var _useState = useState(false),
|
|
33
33
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -42,9 +42,9 @@ var MenuComponent = function MenuComponent(_ref) {
|
|
|
42
42
|
var tree = useFloatingTree();
|
|
43
43
|
var nodeId = useFloatingNodeId();
|
|
44
44
|
var parentId = useFloatingParentNodeId();
|
|
45
|
-
var isNested = parentId !== null;
|
|
45
|
+
var isNested = parentId !== null && !forDropdown;
|
|
46
46
|
var _useFloating = useFloating({
|
|
47
|
-
nodeId: nodeId,
|
|
47
|
+
nodeId: "menu-".concat(nodeId),
|
|
48
48
|
open: !isNested || isOpen,
|
|
49
49
|
onOpenChange: function onOpenChange(open, event, reason) {
|
|
50
50
|
isNested && setIsOpen(open);
|
|
@@ -166,7 +166,7 @@ var MenuComponent = function MenuComponent(_ref) {
|
|
|
166
166
|
}))), {}, {
|
|
167
167
|
"data-open": isOpen,
|
|
168
168
|
minimal: minimal,
|
|
169
|
-
altIcon:
|
|
169
|
+
altIcon: "icon-[mdi--menu-right]",
|
|
170
170
|
ref: mergeRefs(refs.setReference, ref)
|
|
171
171
|
})), /*#__PURE__*/jsx(FloatingList, {
|
|
172
172
|
elementsRef: elementsRef,
|
|
@@ -15,7 +15,6 @@ import { jsx, jsxs } from 'react/jsx-runtime';
|
|
|
15
15
|
import { Tooltip } from '../../overlays/tooltip/Tooltip.js';
|
|
16
16
|
import { getBadgeProps, Badge } from '../badge/Badge.js';
|
|
17
17
|
import { Icon, getIconProps } from '../icon/Icon.js';
|
|
18
|
-
import '../../types/icons.js';
|
|
19
18
|
import '../../hotkeys/HotKeyWrapper.js';
|
|
20
19
|
|
|
21
20
|
var _excluded = ["as", "label", "color", "className", "icon", "appendLabel", "altIcon", "id", "active", "disabled", "onClick", "badge", "hotKey", "tabIndex", "minimal", "data-open", "ref"],
|
|
@@ -133,7 +132,7 @@ var MenuItem = function MenuItem(_ref) {
|
|
|
133
132
|
(_onClick === null || _onClick === void 0 ? void 0 : _onClick(e)) !== false && (tree === null || tree === void 0 ? void 0 : tree.events.emit("click"));
|
|
134
133
|
}
|
|
135
134
|
}, minimal ? {} : aria), {}, {
|
|
136
|
-
children: [hotKey && /*#__PURE__*/jsx(HotKey, {
|
|
135
|
+
children: [!disabled && hotKey && /*#__PURE__*/jsx(HotKey, {
|
|
137
136
|
keyCombo: hotKey,
|
|
138
137
|
handler: function handler() {
|
|
139
138
|
var _elRef$current2, _elRef$current2$click;
|
|
@@ -2,12 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
4
4
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
5
|
+
import { isEmpty } from '@react-fabric/utilities';
|
|
5
6
|
import classNames from 'classnames';
|
|
6
7
|
import { useCallback } from 'react';
|
|
7
8
|
import { HotKey } from '../../hotkeys/HotKey.js';
|
|
8
|
-
import { CoreIcons } from '../../types/icons.js';
|
|
9
9
|
import { Icon } from '../icon/Icon.js';
|
|
10
|
-
import { isEmpty } from '@react-fabric/utilities';
|
|
11
10
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
12
11
|
|
|
13
12
|
var _excluded = ["className", "onNavigate", "color", "children", "length", "current", "disableKeyHandlers"];
|
|
@@ -46,7 +45,7 @@ var Navigator = function Navigator(_ref) {
|
|
|
46
45
|
aria = _objectWithoutProperties(_ref, _excluded);
|
|
47
46
|
var navPrev = useCallback(function () {
|
|
48
47
|
return (isEmpty(current) || current !== 0) && onNavigate(-1);
|
|
49
|
-
}, [onNavigate, current]);
|
|
48
|
+
}, [onNavigate, current, length]);
|
|
50
49
|
var navNext = useCallback(function () {
|
|
51
50
|
return (isEmpty(current) || current + 1 < (length !== null && length !== void 0 ? length : 0)) && onNavigate(+1);
|
|
52
51
|
}, [onNavigate, current, length]);
|
|
@@ -66,7 +65,7 @@ var Navigator = function Navigator(_ref) {
|
|
|
66
65
|
className: "text-[1em] p-1",
|
|
67
66
|
"aria-label": "previous",
|
|
68
67
|
"data-ref": "previous",
|
|
69
|
-
icon:
|
|
68
|
+
icon: "icon-[mdi--chevron-left]",
|
|
70
69
|
disabled: !isEmpty(current) && current === 0,
|
|
71
70
|
onClick: function onClick(e) {
|
|
72
71
|
return [e.stopPropagation(), navPrev()];
|
|
@@ -77,7 +76,7 @@ var Navigator = function Navigator(_ref) {
|
|
|
77
76
|
color: color,
|
|
78
77
|
"aria-label": "next",
|
|
79
78
|
"data-ref": "next",
|
|
80
|
-
icon:
|
|
79
|
+
icon: "icon-[mdi--chevron-right]",
|
|
81
80
|
disabled: !isEmpty(current) && current + 1 === length,
|
|
82
81
|
onClick: function onClick(e) {
|
|
83
82
|
return [e.stopPropagation(), navNext()];
|
|
@@ -7,8 +7,7 @@ import classNames from 'classnames';
|
|
|
7
7
|
import { useMemo } from 'react';
|
|
8
8
|
import { usePropToggle } from '../../hooks/usePropToggle.js';
|
|
9
9
|
import { HotKey } from '../../hotkeys/HotKey.js';
|
|
10
|
-
import {
|
|
11
|
-
import { Loading } from '../animations/Animations.js';
|
|
10
|
+
import { LoadingLine } from '../animations/Animations.js';
|
|
12
11
|
import { Icon, getIconProps } from '../icon/Icon.js';
|
|
13
12
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
14
13
|
|
|
@@ -30,7 +29,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
30
29
|
* ```jsx
|
|
31
30
|
* <Panel
|
|
32
31
|
* title="Panel Title"
|
|
33
|
-
* icon=
|
|
32
|
+
* icon="icon-[mdi--info]"
|
|
34
33
|
* actions={<button>Action</button>}
|
|
35
34
|
* expandable
|
|
36
35
|
* collapsable
|
|
@@ -112,9 +111,10 @@ var Panel = function Panel(_ref) {
|
|
|
112
111
|
"data-ref": "panelHeader",
|
|
113
112
|
onClick: collapsable ? toggleCollapse : undefined,
|
|
114
113
|
children: [onBack && /*#__PURE__*/jsx(Icon, {
|
|
114
|
+
rtlFlip: true,
|
|
115
115
|
"data-ref": "panelBack",
|
|
116
116
|
className: classNames("fabric-panelAction", "cursor-pointer"),
|
|
117
|
-
icon:
|
|
117
|
+
icon: "icon-[mdi--chevron-left]",
|
|
118
118
|
onClick: onBack
|
|
119
119
|
}), icon && /*#__PURE__*/jsx(Icon, _objectSpread({
|
|
120
120
|
className: "p-2 text-md select-none pointer-events-none"
|
|
@@ -133,24 +133,24 @@ var Panel = function Panel(_ref) {
|
|
|
133
133
|
children: [expandable && /*#__PURE__*/jsx(Icon, {
|
|
134
134
|
"data-ref": "panelExpand",
|
|
135
135
|
className: classNames("fabric-panelAction", "cursor-pointer"),
|
|
136
|
-
icon: expanded ?
|
|
136
|
+
icon: expanded ? "icon-[mdi--fullscreen-exit]" : "icon-[mdi--fullscreen]",
|
|
137
137
|
onClick: toggleExpand
|
|
138
138
|
}), !expanded && collapsable && /*#__PURE__*/jsx(Icon, {
|
|
139
139
|
"data-ref": "panelCollapse",
|
|
140
140
|
className: classNames("fabric-panelAction", "cursor-pointer"),
|
|
141
|
-
icon: collapsed ?
|
|
141
|
+
icon: collapsed ? "icon-[mdi--plus-box]" : "icon-[mdi--minus-box]",
|
|
142
142
|
onClick: toggleCollapse
|
|
143
143
|
}), !expanded && onClose && /*#__PURE__*/jsx(Icon, {
|
|
144
144
|
"data-ref": "panelClose",
|
|
145
145
|
className: classNames("fabric-panelAction", "cursor-pointer"),
|
|
146
|
-
icon:
|
|
146
|
+
icon: "icon-[mdi--close]",
|
|
147
147
|
onClick: onClose
|
|
148
148
|
})]
|
|
149
149
|
})]
|
|
150
150
|
}), (!collapsed || expanded) && /*#__PURE__*/jsxs("div", {
|
|
151
151
|
"data-ref": "panelBody",
|
|
152
152
|
className: classNames("fabric-panelBody", "area-content grid overflow-hidden"),
|
|
153
|
-
children: [loading && /*#__PURE__*/jsx(
|
|
153
|
+
children: [loading && /*#__PURE__*/jsx(LoadingLine, {}), children]
|
|
154
154
|
})]
|
|
155
155
|
}));
|
|
156
156
|
};
|
|
@@ -14,7 +14,6 @@ import '../../hotkeys/HotKeyWrapper.js';
|
|
|
14
14
|
import { Tooltip } from '../../overlays/tooltip/Tooltip.js';
|
|
15
15
|
import { getBadgeProps, Badge } from '../badge/Badge.js';
|
|
16
16
|
import { Icon, getIconProps } from '../icon/Icon.js';
|
|
17
|
-
import '../../types/icons.js';
|
|
18
17
|
import { DropdownTool } from '../dropdown/DropdownTool.js';
|
|
19
18
|
|
|
20
19
|
var _excluded = ["ref", "as", "id", "className", "label", "icon", "badge", "disabled", "onClose", "active", "onClick", "tabFlex", "color", "actions", "tooltip", "activeClassName"];
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
4
|
+
import { getValue } from '@react-fabric/utilities';
|
|
4
5
|
import classNames from 'classnames';
|
|
5
6
|
import { useState, useMemo, Children, useEffect, useCallback, cloneElement } from 'react';
|
|
6
7
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
7
|
-
import '@react-fabric/utilities';
|
|
8
8
|
import { nodeCheck } from '../../utils/nodeCheck.js';
|
|
9
9
|
import { Tab } from './Tab.js';
|
|
10
10
|
|
|
@@ -73,7 +73,8 @@ var TabPanel = function TabPanel(_ref) {
|
|
|
73
73
|
tabs = _useMemo2[0],
|
|
74
74
|
rest = _useMemo2[1];
|
|
75
75
|
useEffect(function () {
|
|
76
|
-
|
|
76
|
+
var _tabs$;
|
|
77
|
+
setActive(getValue(activeTab !== null && activeTab !== void 0 ? activeTab : (_tabs$ = tabs[0]) === null || _tabs$ === void 0 ? void 0 : _tabs$.props.id));
|
|
77
78
|
}, [activeTab]);
|
|
78
79
|
var activeTabPanel = useMemo(function () {
|
|
79
80
|
var _tabs$find;
|