@react-fabric/core 1.0.0-beta.0 → 1.0.0-beta.11
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/index.js +13 -13
- package/dist/cjs/components/actionLabel/ActionLabel.js +1 -0
- package/dist/cjs/components/animations/Animations.js +13 -6
- package/dist/cjs/components/avatar/Avatar.js +6 -7
- package/dist/cjs/components/badge/Badge.js +6 -4
- package/dist/cjs/components/breadcrumbs/Breadcrumbs.js +2 -2
- package/dist/cjs/components/button/Button.js +9 -7
- package/dist/cjs/components/button/Button.module.css +1 -1
- package/dist/cjs/components/button/ConfirmButton.js +4 -2
- package/dist/cjs/components/callout/Callout.js +3 -2
- package/dist/cjs/components/card/Card.js +4 -2
- package/dist/cjs/components/chip/Chip.js +2 -2
- package/dist/cjs/components/chip/Chip.module.css +1 -1
- package/dist/cjs/components/collapsable/Collapsable.js +5 -3
- package/dist/cjs/components/divider/Divider.js +3 -2
- package/dist/cjs/components/divider/Divider.module.css +1 -0
- package/dist/cjs/components/dropdown/Dropdown.js +3 -1
- package/dist/cjs/components/dropdown/DropdownTool.js +4 -2
- package/dist/cjs/components/icon/Icon.js +8 -7
- package/dist/cjs/components/menu/ContextMenu.js +30 -10
- package/dist/cjs/components/menu/Menu.js +1 -1
- package/dist/cjs/components/menu/MenuItem.js +1 -1
- package/dist/cjs/components/navigator/Navigator.js +15 -9
- package/dist/cjs/components/panel/Panel.js +2 -0
- package/dist/cjs/components/tabpanel/Tab.js +55 -36
- package/dist/cjs/components/tabpanel/TabPanel.js +18 -13
- package/dist/cjs/components/tabpanel/TabPanel.module.css +1 -1
- package/dist/cjs/core/aside/Aside.js +7 -2
- package/dist/cjs/core/content/Content.js +8 -5
- package/dist/cjs/core/headfoot/HeadFoot.js +1 -1
- package/dist/cjs/core/headfoot/HeadFoot.module.css +1 -1
- package/dist/cjs/core/page/Page.js +1 -0
- package/dist/cjs/core/section/Section.js +5 -2
- package/dist/cjs/hooks/useNavigator.js +6 -4
- package/dist/cjs/index.js +4 -2
- package/dist/cjs/overlays/alert/Alert.js +38 -16
- package/dist/cjs/overlays/modal/Modal.js +1 -1
- package/dist/cjs/overlays/tooltip/Tooltip.js +2 -2
- package/dist/cjs/overlays/tooltip/Tooltip.module.css +1 -1
- package/dist/cjs/types/icons.js +3 -0
- package/dist/cjs/typography/Abbr.js +2 -0
- package/dist/cjs/typography/{Link.js → Anchor.js} +2 -2
- package/dist/cjs/typography/Typography.module.css +1 -1
- package/dist/esm/components/actionLabel/ActionLabel.js +1 -0
- package/dist/esm/components/animations/Animations.js +13 -6
- package/dist/esm/components/avatar/Avatar.js +7 -8
- package/dist/esm/components/badge/Badge.js +7 -5
- package/dist/esm/components/breadcrumbs/Breadcrumbs.js +2 -2
- package/dist/esm/components/button/Button.js +9 -7
- package/dist/esm/components/button/Button.module.css +1 -1
- package/dist/esm/components/button/ConfirmButton.js +4 -2
- package/dist/esm/components/callout/Callout.js +3 -2
- package/dist/esm/components/card/Card.js +4 -2
- package/dist/esm/components/chip/Chip.js +2 -2
- package/dist/esm/components/chip/Chip.module.css +1 -1
- package/dist/esm/components/collapsable/Collapsable.js +5 -3
- package/dist/esm/components/divider/Divider.js +3 -2
- package/dist/esm/components/divider/Divider.module.css +1 -0
- package/dist/esm/components/dropdown/Dropdown.js +3 -1
- package/dist/esm/components/dropdown/DropdownTool.js +4 -2
- package/dist/esm/components/icon/Icon.js +8 -7
- package/dist/esm/components/menu/ContextMenu.js +32 -12
- package/dist/esm/components/menu/Menu.js +1 -1
- package/dist/esm/components/menu/MenuItem.js +1 -1
- package/dist/esm/components/navigator/Navigator.js +15 -9
- package/dist/esm/components/panel/Panel.js +2 -0
- package/dist/esm/components/tabpanel/Tab.js +56 -37
- package/dist/esm/components/tabpanel/TabPanel.js +18 -13
- package/dist/esm/components/tabpanel/TabPanel.module.css +1 -1
- package/dist/esm/core/aside/Aside.js +7 -2
- package/dist/esm/core/content/Content.js +8 -5
- package/dist/esm/core/headfoot/HeadFoot.js +1 -1
- package/dist/esm/core/headfoot/HeadFoot.module.css +1 -1
- package/dist/esm/core/page/Page.js +1 -0
- package/dist/esm/core/section/Section.js +5 -2
- package/dist/esm/hooks/useNavigator.js +7 -5
- package/dist/esm/index.js +3 -2
- package/dist/esm/overlays/alert/Alert.js +27 -5
- package/dist/esm/overlays/modal/Modal.js +1 -1
- package/dist/esm/overlays/tooltip/Tooltip.js +2 -2
- package/dist/esm/overlays/tooltip/Tooltip.module.css +1 -1
- package/dist/esm/types/icons.js +3 -0
- package/dist/esm/typography/Abbr.js +2 -0
- package/dist/esm/typography/{Link.js → Anchor.js} +2 -2
- package/dist/esm/typography/Typography.module.css +1 -1
- package/dist/types/components/actionLabel/ActionLabel.d.ts +2 -2
- package/dist/types/components/animations/Animations.d.ts +1 -1
- package/dist/types/components/breadcrumbs/Breadcrumbs.d.ts +2 -2
- package/dist/types/components/button/Button.d.ts +5 -2
- package/dist/types/components/button/ConfirmButton.d.ts +6 -1
- package/dist/types/components/callout/Callout.d.ts +3 -3
- package/dist/types/components/card/Card.d.ts +3 -3
- package/dist/types/components/collapsable/Collapsable.d.ts +9 -1
- package/dist/types/components/dropdown/DropdownTool.d.ts +2 -1
- package/dist/types/components/index.d.ts +1 -1
- package/dist/types/components/media/Media.d.ts +2 -2
- package/dist/types/components/menu/ContextMenu.d.ts +2 -1
- package/dist/types/components/menu/types.d.ts +2 -2
- package/dist/types/components/navigator/Navigator.d.ts +3 -3
- package/dist/types/components/tabpanel/Tab.d.ts +8 -4
- package/dist/types/components/tabpanel/TabPanel.d.ts +10 -1
- package/dist/types/core/aside/Aside.d.ts +9 -5
- package/dist/types/core/content/Content.d.ts +3 -2
- package/dist/types/core/section/Section.d.ts +2 -2
- package/dist/types/overlays/alert/Alert.d.ts +9 -1
- package/dist/types/overlays/modal/Modal.d.ts +1 -1
- package/dist/types/types/icons.d.ts +3 -0
- package/dist/types/types/index.d.ts +6 -2
- package/dist/types/typography/Abbr.d.ts +3 -3
- package/dist/types/typography/{Link.d.ts → Anchor.d.ts} +4 -3
- package/dist/types/typography/index.d.ts +1 -1
- package/package.json +3 -3
- package/src/components/actionLabel/ActionLabel.tsx +13 -3
- package/src/components/animations/Animations.tsx +9 -3
- package/src/components/avatar/Avatar.tsx +68 -81
- package/src/components/badge/Badge.tsx +24 -20
- package/src/components/breadcrumbs/Breadcrumbs.tsx +3 -3
- package/src/components/button/Button.module.css +1 -1
- package/src/components/button/Button.tsx +16 -10
- package/src/components/button/ConfirmButton.tsx +10 -4
- package/src/components/callout/Callout.tsx +8 -1
- package/src/components/card/Card.tsx +4 -0
- package/src/components/chip/Chip.module.css +1 -1
- package/src/components/chip/Chip.tsx +2 -4
- package/src/components/collapsable/Collapsable.tsx +12 -1
- package/src/components/divider/Divider.module.css +32 -0
- package/src/components/divider/Divider.tsx +3 -2
- package/src/components/dropdown/Dropdown.tsx +2 -0
- package/src/components/dropdown/DropdownTool.tsx +4 -1
- package/src/components/icon/Icon.tsx +46 -57
- package/src/components/index.ts +1 -0
- package/src/components/media/Media.tsx +2 -2
- package/src/components/menu/ContextMenu.tsx +36 -11
- package/src/components/menu/Menu.tsx +2 -2
- package/src/components/menu/types.ts +2 -2
- package/src/components/navigator/Navigator.tsx +16 -4
- package/src/components/panel/Panel.tsx +2 -0
- package/src/components/tabpanel/Tab.tsx +78 -59
- package/src/components/tabpanel/TabPanel.module.css +19 -26
- package/src/components/tabpanel/TabPanel.tsx +32 -10
- package/src/core/aside/Aside.tsx +26 -4
- package/src/core/content/Content.tsx +16 -10
- package/src/core/headfoot/HeadFoot.module.css +2 -0
- package/src/core/headfoot/HeadFoot.tsx +1 -1
- package/src/core/page/Page.tsx +1 -0
- package/src/core/section/Section.tsx +8 -2
- package/src/hooks/useNavigator.tsx +10 -5
- package/src/overlays/alert/Alert.tsx +25 -2
- package/src/overlays/modal/Modal.tsx +2 -2
- package/src/overlays/tooltip/Tooltip.module.css +1 -1
- package/src/overlays/tooltip/Tooltip.tsx +3 -3
- package/src/types/icons.ts +6 -0
- package/src/types/index.ts +10 -2
- package/src/typography/Abbr.tsx +4 -3
- package/src/typography/{Link.tsx → Anchor.tsx} +6 -3
- package/src/typography/Typography.module.css +2 -2
- package/src/typography/index.ts +1 -1
|
@@ -4,7 +4,7 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
|
4
4
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
5
5
|
import { isSvgPath, isString } from '@react-fabric/utilities';
|
|
6
6
|
import classNames from 'classnames';
|
|
7
|
-
import {
|
|
7
|
+
import { useMemo } from 'react';
|
|
8
8
|
import { getColor, getBgClass, getColorClass } from '../../utils/getColor.js';
|
|
9
9
|
import classes from './Icon.module.css';
|
|
10
10
|
import { jsx } from 'react/jsx-runtime';
|
|
@@ -40,7 +40,7 @@ var Icon = function Icon(_ref) {
|
|
|
40
40
|
onClick = _ref.onClick,
|
|
41
41
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
42
42
|
/** ***************** style map *******************/
|
|
43
|
-
var styles =
|
|
43
|
+
var styles = useMemo(function () {
|
|
44
44
|
var s = {};
|
|
45
45
|
if (bg) {
|
|
46
46
|
s.backgroundColor = getColor(bg);
|
|
@@ -55,15 +55,15 @@ var Icon = function Icon(_ref) {
|
|
|
55
55
|
s.fontSize = SizeMap[size];
|
|
56
56
|
}
|
|
57
57
|
return s;
|
|
58
|
-
}, [bg, color, size]
|
|
58
|
+
}, [bg, color, size]);
|
|
59
59
|
|
|
60
60
|
/** ***************** check if icon is svg path *******************/
|
|
61
|
-
var isSvg =
|
|
61
|
+
var isSvg = useMemo(function () {
|
|
62
62
|
return isSvgPath(icon);
|
|
63
|
-
}, [icon]
|
|
63
|
+
}, [icon]);
|
|
64
64
|
|
|
65
65
|
/** ***************** render icon *******************/
|
|
66
|
-
var iconEl =
|
|
66
|
+
var iconEl = useMemo(function () {
|
|
67
67
|
var _SvgTextSize$icon$len;
|
|
68
68
|
if (!isString(icon)) {
|
|
69
69
|
throw Error("Invalid icon expected string");
|
|
@@ -90,7 +90,7 @@ var Icon = function Icon(_ref) {
|
|
|
90
90
|
}) : /*#__PURE__*/jsx("i", {
|
|
91
91
|
className: "".concat(icon)
|
|
92
92
|
});
|
|
93
|
-
}, [icon, isSvg, viewBox]
|
|
93
|
+
}, [icon, isSvg, viewBox]);
|
|
94
94
|
return /*#__PURE__*/jsx("dfn", _objectSpread(_objectSpread({}, rest), {}, {
|
|
95
95
|
ref: ref,
|
|
96
96
|
role: "presentation",
|
|
@@ -99,6 +99,7 @@ var Icon = function Icon(_ref) {
|
|
|
99
99
|
"data-flip": rtlFlip,
|
|
100
100
|
style: styles,
|
|
101
101
|
"data-clickable": !!onClick,
|
|
102
|
+
"data-inner-clickable": !!onClick,
|
|
102
103
|
children: iconEl
|
|
103
104
|
}));
|
|
104
105
|
};
|
|
@@ -2,22 +2,29 @@
|
|
|
2
2
|
|
|
3
3
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
4
4
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
5
|
-
import { useFloating, autoUpdate, offset, flip, useClick, useDismiss, useInteractions, FloatingPortal } from '@floating-ui/react';
|
|
6
|
-
import { useState, useRef, cloneElement } from 'react';
|
|
5
|
+
import { useFloatingNodeId, useFloating, autoUpdate, offset, flip, useClick, useDismiss, useInteractions, FloatingPortal } from '@floating-ui/react';
|
|
6
|
+
import { useState, useRef, useEffect, cloneElement } from 'react';
|
|
7
7
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
8
8
|
|
|
9
9
|
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; }
|
|
10
10
|
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; }
|
|
11
11
|
var ContextMenu = function ContextMenu(_ref) {
|
|
12
|
+
var _refs$domReference$cu, _refs$domReference$cu2;
|
|
12
13
|
var children = _ref.children,
|
|
13
|
-
menu = _ref.menu
|
|
14
|
+
menu = _ref.menu,
|
|
15
|
+
disabled = _ref.disabled;
|
|
14
16
|
var _useState = useState(false),
|
|
15
17
|
_useState2 = _slicedToArray(_useState, 2),
|
|
16
18
|
isOpen = _useState2[0],
|
|
17
19
|
setIsOpen = _useState2[1];
|
|
20
|
+
var nodeId = useFloatingNodeId();
|
|
18
21
|
var _useFloating = useFloating({
|
|
19
22
|
open: isOpen,
|
|
20
|
-
|
|
23
|
+
nodeId: nodeId,
|
|
24
|
+
onOpenChange: function onOpenChange(open, evt, reason) {
|
|
25
|
+
var target = evt === null || evt === void 0 ? void 0 : evt.target;
|
|
26
|
+
if (!(target !== null && target !== void 0 && target.closest(".menu-list"))) setIsOpen(open);
|
|
27
|
+
},
|
|
21
28
|
strategy: "fixed",
|
|
22
29
|
placement: "bottom-start",
|
|
23
30
|
whileElementsMounted: autoUpdate,
|
|
@@ -26,8 +33,13 @@ var ContextMenu = function ContextMenu(_ref) {
|
|
|
26
33
|
refs = _useFloating.refs,
|
|
27
34
|
floatingStyles = _useFloating.floatingStyles,
|
|
28
35
|
context = _useFloating.context;
|
|
29
|
-
var click = useClick(context, {
|
|
30
|
-
|
|
36
|
+
var click = useClick(context, {
|
|
37
|
+
toggle: true,
|
|
38
|
+
ignoreMouse: true
|
|
39
|
+
});
|
|
40
|
+
var dismiss = useDismiss(context, {
|
|
41
|
+
bubbles: true
|
|
42
|
+
});
|
|
31
43
|
var _useInteractions = useInteractions([dismiss, click]),
|
|
32
44
|
getFloatingProps = _useInteractions.getFloatingProps;
|
|
33
45
|
var handleClick = useRef(function (e) {
|
|
@@ -51,11 +63,18 @@ var ContextMenu = function ContextMenu(_ref) {
|
|
|
51
63
|
e.preventDefault();
|
|
52
64
|
return false;
|
|
53
65
|
});
|
|
54
|
-
var wrapperRef = useRef(
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
66
|
+
var wrapperRef = useRef(null);
|
|
67
|
+
useEffect(function () {
|
|
68
|
+
var el = wrapperRef.current;
|
|
69
|
+
if (el && !disabled) {
|
|
70
|
+
var _el$parentElement;
|
|
71
|
+
el === null || el === void 0 || (_el$parentElement = el.parentElement) === null || _el$parentElement === void 0 || _el$parentElement.addEventListener("contextmenu", handleClick.current);
|
|
72
|
+
return function () {
|
|
73
|
+
var _el$parentElement2;
|
|
74
|
+
el === null || el === void 0 || (_el$parentElement2 = el.parentElement) === null || _el$parentElement2 === void 0 || _el$parentElement2.removeEventListener("contextmenu", handleClick.current);
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
}, [disabled]);
|
|
59
78
|
var tryClosing = useRef(function (e) {
|
|
60
79
|
var _e$target;
|
|
61
80
|
if ((_e$target = e.target) !== null && _e$target !== void 0 && _e$target.closest("[data-dropdown-dismiss='true']")) setTimeout(function () {
|
|
@@ -64,9 +83,10 @@ var ContextMenu = function ContextMenu(_ref) {
|
|
|
64
83
|
});
|
|
65
84
|
return /*#__PURE__*/jsxs("div", {
|
|
66
85
|
className: "contents",
|
|
67
|
-
ref: wrapperRef
|
|
86
|
+
ref: wrapperRef,
|
|
68
87
|
onMouseUpCapture: tryClosing.current,
|
|
69
88
|
children: [children, isOpen && /*#__PURE__*/jsx(FloatingPortal, {
|
|
89
|
+
root: (_refs$domReference$cu = (_refs$domReference$cu2 = refs.domReference.current) === null || _refs$domReference$cu2 === void 0 ? void 0 : _refs$domReference$cu2.closest(".theme-base")) !== null && _refs$domReference$cu !== void 0 ? _refs$domReference$cu : undefined,
|
|
70
90
|
children: /*#__PURE__*/cloneElement(menu, _objectSpread(_objectSpread({}, getFloatingProps()), {}, {
|
|
71
91
|
style: _objectSpread(_objectSpread({}, floatingStyles), {}, {
|
|
72
92
|
borderRadius: "var(--rounding)",
|
|
@@ -163,7 +163,7 @@ var MenuComponent = function MenuComponent(_ref) {
|
|
|
163
163
|
children: /*#__PURE__*/jsx("div", _objectSpread(_objectSpread({
|
|
164
164
|
className: classNames(menuClassName, "flex flex-col bg-base p-1 menu-list", isNested && "outline shadow-lg rounded-capped max-h-96 overflow-auto scroll-thin z-[var(--z-popover)]"),
|
|
165
165
|
autoFocus: true,
|
|
166
|
-
ref: mergeRefs(
|
|
166
|
+
ref: mergeRefs(isNested ? refs.setFloating : ref)
|
|
167
167
|
}, getFloatingProps({
|
|
168
168
|
onClick: isNested ? undefined : handleClick
|
|
169
169
|
})), {}, {
|
|
@@ -7,10 +7,10 @@ import { iconToken } from '@react-fabric/utilities';
|
|
|
7
7
|
import classNames from 'classnames';
|
|
8
8
|
import { useMemo, useCallback, Fragment } from 'react';
|
|
9
9
|
import { HotKeyLabel } from '../../hotkeys/HotKeyLabel.js';
|
|
10
|
+
import '@babel/runtime/helpers/slicedToArray';
|
|
10
11
|
import 'react-i18next';
|
|
11
12
|
import '../../hooks/useEffectDebugger.js';
|
|
12
13
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
13
|
-
import '@babel/runtime/helpers/slicedToArray';
|
|
14
14
|
import '../../hotkeys/HotKeyWrapper.js';
|
|
15
15
|
import { Tooltip } from '../../overlays/tooltip/Tooltip.js';
|
|
16
16
|
import { getBadgeProps, Badge } from '../badge/Badge.js';
|
|
@@ -6,43 +6,49 @@ import classNames from 'classnames';
|
|
|
6
6
|
import { HotKey } from '../../hotkeys/HotKey.js';
|
|
7
7
|
import { CoreIcons } from '../../types/icons.js';
|
|
8
8
|
import { Icon } from '../icon/Icon.js';
|
|
9
|
+
import { useCallback } from 'react';
|
|
9
10
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
10
11
|
|
|
11
|
-
var _excluded = ["className", "onNavigate", "color"];
|
|
12
|
+
var _excluded = ["className", "onNavigate", "color", "children"];
|
|
12
13
|
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
14
|
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
15
|
var Navigator = function Navigator(_ref) {
|
|
15
16
|
var className = _ref.className,
|
|
16
17
|
onNavigate = _ref.onNavigate,
|
|
17
18
|
color = _ref.color,
|
|
19
|
+
children = _ref.children,
|
|
18
20
|
aria = _objectWithoutProperties(_ref, _excluded);
|
|
21
|
+
var navPrev = useCallback(function () {
|
|
22
|
+
return onNavigate(-1);
|
|
23
|
+
}, [onNavigate]);
|
|
24
|
+
var navNext = useCallback(function () {
|
|
25
|
+
return onNavigate(+1);
|
|
26
|
+
}, [onNavigate]);
|
|
19
27
|
return /*#__PURE__*/jsxs("div", _objectSpread(_objectSpread({
|
|
20
|
-
className: classNames(className, "inline-
|
|
28
|
+
className: classNames(className, "inline-flex items-center leading-none")
|
|
21
29
|
}, aria), {}, {
|
|
22
30
|
children: [/*#__PURE__*/jsx(HotKey, {
|
|
23
31
|
keyCombo: "left",
|
|
24
|
-
handler:
|
|
25
|
-
return onNavigate(-1);
|
|
26
|
-
}
|
|
32
|
+
handler: navPrev
|
|
27
33
|
}), /*#__PURE__*/jsx(HotKey, {
|
|
28
34
|
keyCombo: "right",
|
|
29
|
-
handler:
|
|
30
|
-
return onNavigate(1);
|
|
31
|
-
}
|
|
35
|
+
handler: navNext
|
|
32
36
|
}), /*#__PURE__*/jsx(Icon, {
|
|
33
37
|
rtlFlip: true,
|
|
34
38
|
color: color,
|
|
35
39
|
className: "text-[1em] p-1",
|
|
36
40
|
"aria-label": "previous",
|
|
41
|
+
"data-testid": "previous",
|
|
37
42
|
icon: CoreIcons.chevronLeft,
|
|
38
43
|
onClick: function onClick(e) {
|
|
39
44
|
return [e.stopPropagation(), onNavigate(-1)];
|
|
40
45
|
}
|
|
41
|
-
}), /*#__PURE__*/jsx(Icon, {
|
|
46
|
+
}), children, /*#__PURE__*/jsx(Icon, {
|
|
42
47
|
rtlFlip: true,
|
|
43
48
|
className: "text-[1em] p-1",
|
|
44
49
|
color: color,
|
|
45
50
|
"aria-label": "next",
|
|
51
|
+
"data-testid": "next",
|
|
46
52
|
icon: CoreIcons.chevronRight,
|
|
47
53
|
onClick: function onClick(e) {
|
|
48
54
|
return [e.stopPropagation(), onNavigate(1)];
|
|
@@ -74,6 +74,7 @@ var Panel = function Panel(_ref) {
|
|
|
74
74
|
children: [/*#__PURE__*/jsxs("header", {
|
|
75
75
|
role: "none",
|
|
76
76
|
className: classNames(classes.panelHeader, headerClassName, "flex flex-nowrap items-center area-head"),
|
|
77
|
+
"data-testid": "panel-header",
|
|
77
78
|
onClick: collapsable ? toggleCollapse : undefined,
|
|
78
79
|
children: [onBack && /*#__PURE__*/jsx(Icon, {
|
|
79
80
|
"data-ref": "panelBack",
|
|
@@ -116,6 +117,7 @@ var Panel = function Panel(_ref) {
|
|
|
116
117
|
})]
|
|
117
118
|
})]
|
|
118
119
|
}), (!collapsed || expanded) && /*#__PURE__*/jsxs("div", {
|
|
120
|
+
"data-testid": "panel-body",
|
|
119
121
|
className: classNames(classes.panelBody, "area-content grid overflow-hidden"),
|
|
120
122
|
children: [loading && /*#__PURE__*/jsx(Loading, {}), children]
|
|
121
123
|
})]
|
|
@@ -2,15 +2,23 @@
|
|
|
2
2
|
|
|
3
3
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
4
4
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
5
|
+
import { isString } from '@react-fabric/utilities';
|
|
5
6
|
import classNames from 'classnames';
|
|
6
|
-
import { useMemo } from 'react';
|
|
7
|
+
import { useMemo, Fragment } from 'react';
|
|
8
|
+
import '@babel/runtime/helpers/slicedToArray';
|
|
9
|
+
import '@floating-ui/react';
|
|
10
|
+
import 'react-i18next';
|
|
11
|
+
import '../../hooks/useEffectDebugger.js';
|
|
12
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
13
|
+
import '../../hotkeys/HotKeyWrapper.js';
|
|
14
|
+
import { Tooltip } from '../../overlays/tooltip/Tooltip.js';
|
|
7
15
|
import { getBadgeProps, Badge } from '../badge/Badge.js';
|
|
8
|
-
import { DropdownTool } from '../dropdown/DropdownTool.js';
|
|
9
16
|
import { Icon } from '../icon/Icon.js';
|
|
17
|
+
import '../../types/icons.js';
|
|
18
|
+
import { DropdownTool } from '../dropdown/DropdownTool.js';
|
|
10
19
|
import classes from './TabPanel.module.css';
|
|
11
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
12
20
|
|
|
13
|
-
var _excluded = ["ref", "as", "id", "className", "label", "icon", "iconBg", "iconColor", "rtlFlip", "badge", "disabled", "onClose", "active", "minimal", "onClick", "tabFlex", "color", "actions", "activeClassName"];
|
|
21
|
+
var _excluded = ["ref", "as", "id", "className", "label", "icon", "iconBg", "iconColor", "rtlFlip", "badge", "disabled", "onClose", "active", "minimal", "onClick", "tabFlex", "color", "actions", "tooltip", "activeClassName"];
|
|
14
22
|
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; }
|
|
15
23
|
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; }
|
|
16
24
|
var Tab = function Tab(_ref) {
|
|
@@ -32,46 +40,57 @@ var Tab = function Tab(_ref) {
|
|
|
32
40
|
tabFlex = _ref.tabFlex,
|
|
33
41
|
color = _ref.color,
|
|
34
42
|
actions = _ref.actions,
|
|
43
|
+
tooltip = _ref.tooltip,
|
|
35
44
|
activeClassName = _ref.activeClassName,
|
|
36
45
|
aria = _objectWithoutProperties(_ref, _excluded);
|
|
37
46
|
var badgeProps = useMemo(function () {
|
|
38
47
|
return getBadgeProps(badge);
|
|
39
48
|
}, [badge]);
|
|
49
|
+
var tooltipProps = useMemo(function () {
|
|
50
|
+
if (isString(tooltip)) return {
|
|
51
|
+
content: tooltip
|
|
52
|
+
};
|
|
53
|
+
return tooltip !== null && tooltip !== void 0 ? tooltip : {};
|
|
54
|
+
}, [tooltip]);
|
|
40
55
|
var E = as !== null && as !== void 0 ? as : "button";
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
children: [icon && /*#__PURE__*/jsx(Icon, {
|
|
52
|
-
icon: icon,
|
|
53
|
-
bg: iconBg,
|
|
54
|
-
color: iconColor,
|
|
55
|
-
rtlFlip: rtlFlip,
|
|
56
|
-
className: "flex-content"
|
|
57
|
-
}), !minimal && /*#__PURE__*/jsx("label", {
|
|
58
|
-
className: "flex-initial truncate text-center px-1 py-1",
|
|
59
|
-
children: label
|
|
60
|
-
}), badge && /*#__PURE__*/jsx(Badge, _objectSpread(_objectSpread({}, badgeProps), {}, {
|
|
61
|
-
placement: minimal ? "end" : "",
|
|
62
|
-
className: classNames("me-1", badgeProps.className)
|
|
63
|
-
})), actions && active && /*#__PURE__*/jsx(DropdownTool, {
|
|
64
|
-
className: "bg-base/20 me-1 z-5",
|
|
65
|
-
children: actions
|
|
66
|
-
}), onClose && /*#__PURE__*/jsx("span", {
|
|
67
|
-
role: "none",
|
|
68
|
-
className: classNames("cursor-pointer me-1 opacity-65 hover:opacity-90 pointer-events-auto"),
|
|
69
|
-
onClick: function onClick(e) {
|
|
70
|
-
onClose === null || onClose === void 0 || onClose();
|
|
71
|
-
e.stopPropagation();
|
|
56
|
+
var W = tooltip ? Tooltip : Fragment;
|
|
57
|
+
return /*#__PURE__*/jsx(W, _objectSpread(_objectSpread({}, tooltipProps), {}, {
|
|
58
|
+
children: /*#__PURE__*/jsxs(E, _objectSpread(_objectSpread({
|
|
59
|
+
"data-id": id,
|
|
60
|
+
disabled: disabled,
|
|
61
|
+
"data-color": color,
|
|
62
|
+
"data-inner-clickable": true,
|
|
63
|
+
className: classNames(classes.tabButton, className, active && "active pointer-events-none", active && activeClassName, disabled && "text-tint-500 pointer-events-none", tabFlex ? "flex-1" : "flex-initial max-w-36 min-w-24", "flex items-center justify-center px-1 rounded overflow-hidden"),
|
|
64
|
+
onClick: function onClick() {
|
|
65
|
+
return !active && (_onClick === null || _onClick === void 0 ? void 0 : _onClick(id));
|
|
72
66
|
},
|
|
73
|
-
|
|
74
|
-
})
|
|
67
|
+
ref: ref
|
|
68
|
+
}, aria), {}, {
|
|
69
|
+
children: [icon && /*#__PURE__*/jsx(Icon, {
|
|
70
|
+
icon: icon,
|
|
71
|
+
bg: iconBg,
|
|
72
|
+
color: iconColor,
|
|
73
|
+
rtlFlip: rtlFlip,
|
|
74
|
+
className: "flex-content"
|
|
75
|
+
}), !minimal && /*#__PURE__*/jsx("label", {
|
|
76
|
+
className: "flex-initial truncate text-center px-1 py-1",
|
|
77
|
+
children: label
|
|
78
|
+
}), badge && /*#__PURE__*/jsx(Badge, _objectSpread(_objectSpread({}, badgeProps), {}, {
|
|
79
|
+
placement: minimal ? "end" : "",
|
|
80
|
+
className: classNames("me-1", badgeProps.className)
|
|
81
|
+
})), actions && active && /*#__PURE__*/jsx(DropdownTool, {
|
|
82
|
+
className: "bg-base/20 me-1 z-5",
|
|
83
|
+
children: actions
|
|
84
|
+
}), onClose && /*#__PURE__*/jsx("span", {
|
|
85
|
+
role: "none",
|
|
86
|
+
className: classNames("cursor-pointer me-1 opacity-65 hover:opacity-90 pointer-events-auto"),
|
|
87
|
+
onClick: function onClick(e) {
|
|
88
|
+
onClose === null || onClose === void 0 || onClose();
|
|
89
|
+
e.stopPropagation();
|
|
90
|
+
},
|
|
91
|
+
children: "\xD7"
|
|
92
|
+
})]
|
|
93
|
+
}))
|
|
75
94
|
}));
|
|
76
95
|
};
|
|
77
96
|
|
|
@@ -20,6 +20,8 @@ var TabPanel = function TabPanel(_ref) {
|
|
|
20
20
|
justify = _ref.justify,
|
|
21
21
|
variant = _ref.variant,
|
|
22
22
|
tabFlex = _ref.tabFlex,
|
|
23
|
+
append = _ref.append,
|
|
24
|
+
prepend = _ref.prepend,
|
|
23
25
|
gap = _ref.gap,
|
|
24
26
|
onBeforeChange = _ref.onBeforeChange,
|
|
25
27
|
onChange = _ref.onChange;
|
|
@@ -57,19 +59,22 @@ var TabPanel = function TabPanel(_ref) {
|
|
|
57
59
|
className: classNames(classes.tabPanel, "area-content grid bg-base overflow-hidden"),
|
|
58
60
|
"data-orientation": orientation,
|
|
59
61
|
"data-variant": variant !== null && variant !== void 0 ? variant : "default",
|
|
60
|
-
children: [/*#__PURE__*/
|
|
61
|
-
className: classNames(classes.
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
62
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
63
|
+
className: classNames(classes.tabHeader, headerClassName, justify && "justify-".concat(justify), ["start", "end"].includes(orientation) && "flex-col", "flex flex-nowrap overflow-hidden items-center"),
|
|
64
|
+
children: [prepend, /*#__PURE__*/jsx("div", {
|
|
65
|
+
className: classNames(classes.tabList, justify && "justify-".concat(justify), ["start", "end"].includes(orientation) && "flex-col", "flex flex-1 flex-nowrap overflow-auto scroll-thin"),
|
|
66
|
+
style: {
|
|
67
|
+
gap: gap
|
|
68
|
+
},
|
|
69
|
+
children: tabs.map(function (node) {
|
|
70
|
+
var _node$props$tabFlex;
|
|
71
|
+
return /*#__PURE__*/cloneElement(node, {
|
|
72
|
+
tabFlex: (_node$props$tabFlex = node.props.tabFlex) !== null && _node$props$tabFlex !== void 0 ? _node$props$tabFlex : tabFlex,
|
|
73
|
+
onClick: handleClick,
|
|
74
|
+
active: node.props.id === active
|
|
75
|
+
});
|
|
76
|
+
})
|
|
77
|
+
}), append]
|
|
73
78
|
}), rest, activeTabPanel]
|
|
74
79
|
});
|
|
75
80
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer comp{.tabPanel{--color:theme(colors.primary.500);&>.
|
|
1
|
+
@layer comp{.tabPanel{--color:theme(colors.primary.500);&>.tabHeader{grid-area:tablist;&>.tabList>.tabButton{&[data-color=accent]{--color:theme(colors.accent.500)}&[data-color=info]{--color:theme(colors.info.500)}&[data-color=danger]{--color:theme(colors.danger.500)}&[data-color=success]{--color:theme(colors.success.500)}&[data-color=warning]{--color:theme(colors.warning.500)}&:not(:global(.active)):hover{background-color:theme(colors.tint.100/50%);color:color-mix(in lab,var(--color) 65%,var(--fabric-text))}&:global(.active){--active-color:var(--color);color:color-mix(in lab,var(--color) 65%,var(--fabric-text));font-weight:500}}}&[data-variant=outline]{& .tabList>.tabButton:global(.active){--active-color:theme(backgroundColor.base);--active-border:0 0 0 1px theme(borderColor.base) inset;background-color:theme(backgroundColor.base)}}&[data-variant=solid]{& .tabList>.tabButton:global(.active){background-color:var(--color);color:theme(colors.white)}}&[data-variant=soft]{& .tabList>.tabButton:global(.active){background-color:color-mix(in lab,var(--color) 20%,var(--fabric-bg))}}&[data-orientation=top]{grid-template:"tablist" auto "content" 1fr/1fr;padding-inline:2px;.tabHeader{box-shadow:inset 0 -1px 0 theme(borderColor.dimmed)}}&[data-orientation=bottom]{grid-template:"content" 1fr "tablist" auto/1fr;padding-inline:2px;.tabHeader{box-shadow:inset 0 1px 0 theme(borderColor.dimmed);margin-top:1px}}&[data-orientation=start]{grid-template:"tablist content" 1fr/auto 1fr;padding-block:2px;.tabHeader{box-shadow:inset -1px 0 0 theme(borderColor.dimmed)}}&[data-orientation=end]{grid-template:"content tablist" 1fr/1fr auto;padding-block:2px;.tabHeader{box-shadow:inset 1px 0 0 theme(borderColor.dimmed)}}}}@layer util{.tabPanel{& .tabList>.tabButton:global(.active){pointer-events:none}&[data-orientation=top] .tabList{&>.tabButton:global(.active){box-shadow:0 -2px 0 var(--active-color) inset,var(--active-border,0 0 0 transparent)}}&[data-orientation=bottom] .tabList{&>.tabButton:global(.active){box-shadow:0 2px 0 var(--active-color) inset,var(--active-border,0 0 0 transparent)}}&[data-orientation=start] .tabList{&>.tabButton:global(.active){box-shadow:-2px 0 0 var(--active-color) inset,var(--active-border,0 0 0 transparent)}}&[data-orientation=end] .tabList{&>.tabButton:global(.active){box-shadow:2px 0 0 var(--active-color) inset,var(--active-border,0 0 0 transparent)}}&[data-orientation=top] .tabList>.tabButton{border-end-end-radius:0;border-end-start-radius:0;margin-top:2px;margin-inline:1px}&[data-orientation=bottom] .tabList>.tabButton{border-start-end-radius:0;border-start-start-radius:0;margin-bottom:2px;margin-inline:1px}&[data-orientation=start] .tabList>.tabButton{border-end-end-radius:0;border-start-end-radius:0;margin-block:1px;margin-inline-start:2px}&[data-orientation=end] .tabList>.tabButton{border-end-start-radius:0;border-start-start-radius:0;margin-block:1px;margin-inline-end:2px}}}
|
|
@@ -26,6 +26,8 @@ var Aside = function Aside(_ref) {
|
|
|
26
26
|
iconBg = _ref.iconBg,
|
|
27
27
|
iconColor = _ref.iconColor,
|
|
28
28
|
rtlFlip = _ref.rtlFlip,
|
|
29
|
+
className = _ref.className,
|
|
30
|
+
bodyClassName = _ref.bodyClassName,
|
|
29
31
|
headerClassName = _ref.headerClassName,
|
|
30
32
|
resizeable = _ref.resizeable,
|
|
31
33
|
flyout = _ref.flyout,
|
|
@@ -101,15 +103,17 @@ var Aside = function Aside(_ref) {
|
|
|
101
103
|
};
|
|
102
104
|
}, [width, minWidth, maxWidth]);
|
|
103
105
|
return /*#__PURE__*/jsxs("aside", {
|
|
104
|
-
className: classNames(classes.aside, "overflow-hidden grid"),
|
|
106
|
+
className: classNames(classes.aside, className, "overflow-hidden grid"),
|
|
105
107
|
"data-align": align,
|
|
106
108
|
"data-flyout": peek,
|
|
109
|
+
"data-loading": loading,
|
|
107
110
|
"data-collapsed": isCollapsed,
|
|
108
111
|
style: isCollapsed ? undefined : widthStyles,
|
|
109
112
|
"data-testid": testId,
|
|
110
113
|
"data-test-value": testValue,
|
|
111
114
|
children: [/*#__PURE__*/jsxs("header", {
|
|
112
115
|
className: classNames(classes.asideHeader, headerClassName, "grid area-head items-center"),
|
|
116
|
+
"data-testid": "aside-header",
|
|
113
117
|
children: [title && /*#__PURE__*/jsx("div", {
|
|
114
118
|
className: classNames(classes.asideTitle, "truncate py-0.5 px-1 select-none pointer-events-none"),
|
|
115
119
|
children: title
|
|
@@ -138,8 +142,9 @@ var Aside = function Aside(_ref) {
|
|
|
138
142
|
}), /*#__PURE__*/jsx("section", {
|
|
139
143
|
ref: elementRef,
|
|
140
144
|
"data-ref": "asideBody",
|
|
141
|
-
className: classNames(classes.asideBody, "overflow-hidden grid"),
|
|
145
|
+
className: classNames(classes.asideBody, bodyClassName, "overflow-hidden grid"),
|
|
142
146
|
style: isCollapsed ? widthStyles : undefined,
|
|
147
|
+
"data-testid": "aside-body",
|
|
143
148
|
children: /*#__PURE__*/jsx(ErrorBoundary, {
|
|
144
149
|
children: children
|
|
145
150
|
})
|
|
@@ -44,12 +44,15 @@ var Content = function Content(_ref) {
|
|
|
44
44
|
testValue = _ref["data-test-value"];
|
|
45
45
|
var resizeHandle = useResizeObserver(onResize);
|
|
46
46
|
var scrollHandler = useDebounce(function (e) {
|
|
47
|
+
var el = e.target;
|
|
47
48
|
onScroll === null || onScroll === void 0 || onScroll({
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
left: el.scrollLeft,
|
|
50
|
+
top: el.scrollTop,
|
|
51
|
+
scrollHeight: el.scrollHeight,
|
|
52
|
+
scrollWidth: el.scrollWidth,
|
|
53
|
+
width: el.offsetWidth,
|
|
54
|
+
height: el.offsetHeight
|
|
55
|
+
}, e);
|
|
53
56
|
}, [onScroll]);
|
|
54
57
|
useImperativeHandle(ref, function () {
|
|
55
58
|
return resizeHandle.current;
|
|
@@ -39,7 +39,7 @@ var HeadFoot = function HeadFoot(_ref) {
|
|
|
39
39
|
}, [bg], "HeadFoot styles");
|
|
40
40
|
return /*#__PURE__*/jsx(E, _objectSpread(_objectSpread({
|
|
41
41
|
dir: dir,
|
|
42
|
-
className: classNames(classes.headfoot, className, bg && getBgClass(bg), color && getColorClass(color), area === "head" ? "area-head" : "area-foot", "leading-none", flex && "flex flex-nowrap
|
|
42
|
+
className: classNames(classes.headfoot, className, bg && getBgClass(bg), color && getColorClass(color), area === "head" ? "area-head" : "area-foot", "leading-none", flex && "flex flex-nowrap", align && "items-".concat(align), justify && "justify-".concat(justify)),
|
|
43
43
|
style: styles
|
|
44
44
|
}, aria), {}, {
|
|
45
45
|
children: children
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer comp{.headfoot{
|
|
1
|
+
@layer comp{.headfoot{gap:2px;.buttonWrapper+.buttonWrapper{margin-inline-start:.25rem}}}@layer util{.headfoot{height:unset;margin:unset;width:unset}}
|
|
@@ -47,6 +47,7 @@ var Page = function Page(_ref) {
|
|
|
47
47
|
return /*#__PURE__*/jsxs("div", {
|
|
48
48
|
"data-testid": testId,
|
|
49
49
|
"data-test-value": testValue,
|
|
50
|
+
"data-loading": loading,
|
|
50
51
|
className: classNames(classes.page, "overflow-hidden grid area-content", paper && "shadow-paper m-[6px] rounded-capped"),
|
|
51
52
|
children: [title && /*#__PURE__*/jsxs("div", {
|
|
52
53
|
"data-ref": "pageTitle",
|
|
@@ -30,11 +30,14 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
30
30
|
|
|
31
31
|
var Section = function Section(_ref) {
|
|
32
32
|
var children = _ref.children,
|
|
33
|
-
|
|
33
|
+
className = _ref.className,
|
|
34
|
+
dir = _ref.dir,
|
|
35
|
+
ref = _ref.ref;
|
|
34
36
|
return /*#__PURE__*/jsx("div", {
|
|
35
37
|
"data-ref": "section",
|
|
36
38
|
dir: dir,
|
|
37
|
-
|
|
39
|
+
ref: ref,
|
|
40
|
+
className: classNames(classes.section, className, "grid area-content overflow-hidden"),
|
|
38
41
|
children: /*#__PURE__*/jsx(ErrorBoundary, {
|
|
39
42
|
children: children
|
|
40
43
|
})
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
4
|
-
import { useState, useCallback, useMemo } from 'react';
|
|
4
|
+
import { useState, useRef, useCallback, useMemo } from 'react';
|
|
5
5
|
import { jsxs } from 'react/jsx-runtime';
|
|
6
6
|
|
|
7
7
|
var useNavigator = function useNavigator() {
|
|
@@ -11,17 +11,19 @@ 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);
|
|
14
15
|
var onNavigate = useCallback(function (dir) {
|
|
15
16
|
if (dir === -1) {
|
|
16
|
-
|
|
17
|
+
refCurrent.current = refCurrent.current > 0 ? refCurrent.current - 1 : totalCount - 1;
|
|
17
18
|
}
|
|
18
19
|
if (dir === 1) {
|
|
19
|
-
|
|
20
|
+
refCurrent.current = refCurrent.current + 1 < totalCount ? refCurrent.current + 1 : 0;
|
|
20
21
|
}
|
|
21
|
-
|
|
22
|
+
setCurrentIndex(refCurrent.current);
|
|
23
|
+
}, [totalCount]);
|
|
22
24
|
var headLabel = useMemo(function () {
|
|
23
25
|
return /*#__PURE__*/jsxs("span", {
|
|
24
|
-
className: "text-muted leading-
|
|
26
|
+
className: "text-muted leading-5",
|
|
25
27
|
children: [currentIndex + 1, "/", totalCount]
|
|
26
28
|
});
|
|
27
29
|
}, [currentIndex, totalCount]);
|
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 { AnimationBars, AnimationIndicator, AnimationSpinner, Skeleton } from './components/animations/Animations.js';
|
|
4
|
+
export { AnimationBars, AnimationIndicator, AnimationSpinner, Loading, 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';
|
|
@@ -44,6 +44,7 @@ export { ThemeProvider } from './core/theme/ThemeProvider.js';
|
|
|
44
44
|
export { Viewport } from './core/viewport/Viewport.js';
|
|
45
45
|
export { addTranslationBundle } from './i18n/index.js';
|
|
46
46
|
import '@babel/runtime/helpers/defineProperty';
|
|
47
|
+
import '@babel/runtime/helpers/slicedToArray';
|
|
47
48
|
import '@floating-ui/react';
|
|
48
49
|
import 'classnames';
|
|
49
50
|
import 'react';
|
|
@@ -56,8 +57,8 @@ export { Flyout } from './overlays/flyout/Flyout.js';
|
|
|
56
57
|
export { Modal } from './overlays/modal/Modal.js';
|
|
57
58
|
export { Tooltip } from './overlays/tooltip/Tooltip.js';
|
|
58
59
|
export { Abbr } from './typography/Abbr.js';
|
|
60
|
+
export { Anchor } from './typography/Anchor.js';
|
|
59
61
|
export { Copy } from './typography/Copy.js';
|
|
60
|
-
export { Link } from './typography/Link.js';
|
|
61
62
|
export { Mark } from './typography/Mark.js';
|
|
62
63
|
export { Text } from './typography/Text.js';
|
|
63
64
|
export { useClientService } from './hooks/useClientService.js';
|