@react-fabric/core 1.0.0-beta.4 → 1.0.0-beta.6
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/dist/cjs/components/animations/Animations.js +12 -5
- package/dist/cjs/components/avatar/Avatar.js +6 -7
- package/dist/cjs/components/button/ConfirmButton.js +4 -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 +3 -2
- package/dist/cjs/components/dropdown/Dropdown.js +2 -1
- package/dist/cjs/components/dropdown/DropdownTool.js +3 -2
- package/dist/cjs/components/icon/Icon.js +7 -7
- package/dist/cjs/components/menu/ContextMenu.js +30 -10
- package/dist/cjs/components/menu/Menu.js +1 -1
- package/dist/cjs/components/navigator/Navigator.js +2 -0
- package/dist/cjs/components/panel/Panel.js +2 -0
- package/dist/cjs/components/tabpanel/Tab.js +54 -36
- package/dist/cjs/core/aside/Aside.js +3 -0
- package/dist/cjs/core/content/Content.js +8 -5
- package/dist/cjs/core/page/Page.js +1 -0
- package/dist/cjs/typography/Typography.module.css +1 -1
- package/dist/esm/components/animations/Animations.js +12 -5
- package/dist/esm/components/avatar/Avatar.js +7 -8
- package/dist/esm/components/button/ConfirmButton.js +4 -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 +3 -2
- package/dist/esm/components/dropdown/Dropdown.js +2 -1
- package/dist/esm/components/dropdown/DropdownTool.js +3 -2
- package/dist/esm/components/icon/Icon.js +7 -7
- package/dist/esm/components/menu/ContextMenu.js +32 -12
- package/dist/esm/components/menu/Menu.js +1 -1
- package/dist/esm/components/navigator/Navigator.js +2 -0
- package/dist/esm/components/panel/Panel.js +2 -0
- package/dist/esm/components/tabpanel/Tab.js +55 -37
- package/dist/esm/core/aside/Aside.js +3 -0
- package/dist/esm/core/content/Content.js +8 -5
- package/dist/esm/core/page/Page.js +1 -0
- 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/button/ConfirmButton.d.ts +6 -1
- package/dist/types/components/card/Card.d.ts +3 -3
- package/dist/types/components/collapsable/Collapsable.d.ts +5 -1
- package/dist/types/components/dropdown/DropdownTool.d.ts +2 -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/tabpanel/Tab.d.ts +4 -4
- package/dist/types/core/content/Content.d.ts +3 -2
- package/dist/types/overlays/modal/Modal.d.ts +1 -1
- package/dist/types/types/index.d.ts +4 -0
- package/package.json +3 -3
- package/src/components/actionLabel/ActionLabel.tsx +12 -3
- package/src/components/animations/Animations.tsx +8 -2
- package/src/components/avatar/Avatar.tsx +68 -81
- package/src/components/button/ConfirmButton.tsx +10 -4
- 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 +6 -0
- package/src/components/dropdown/Dropdown.tsx +1 -0
- package/src/components/dropdown/DropdownTool.tsx +3 -1
- package/src/components/icon/Icon.tsx +45 -57
- package/src/components/media/Media.tsx +2 -2
- package/src/components/menu/ContextMenu.tsx +36 -11
- package/src/components/menu/Menu.tsx +1 -1
- package/src/components/navigator/Navigator.tsx +2 -0
- package/src/components/panel/Panel.tsx +2 -0
- package/src/components/tabpanel/Tab.tsx +73 -59
- package/src/core/aside/Aside.tsx +3 -0
- package/src/core/content/Content.tsx +16 -10
- package/src/core/page/Page.tsx +1 -0
- package/src/overlays/modal/Modal.tsx +1 -1
- package/src/types/index.ts +5 -0
- package/src/typography/Typography.module.css +1 -1
|
@@ -10,7 +10,8 @@ require('@react-fabric/utilities');
|
|
|
10
10
|
var Animations_module = require('./Animations.module.css');
|
|
11
11
|
var jsxRuntime = require('react/jsx-runtime');
|
|
12
12
|
|
|
13
|
-
var _excluded = ["className", "color", "strokeColor", "type"]
|
|
13
|
+
var _excluded = ["className", "color", "strokeColor", "type"],
|
|
14
|
+
_excluded2 = ["className"];
|
|
14
15
|
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
16
|
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
17
|
var AnimationIndicator = function AnimationIndicator(_ref) {
|
|
@@ -81,6 +82,7 @@ var AnimationSpinner = function AnimationSpinner(_ref3) {
|
|
|
81
82
|
size = _ref3$size === void 0 ? "2rem" : _ref3$size;
|
|
82
83
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
83
84
|
className: classNames("absolute inset-0 z-10 flex justify-center items-center cursor-wait"),
|
|
85
|
+
"data-testid": "spinner",
|
|
84
86
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
85
87
|
className: classNames("outline outline-tint-500/20 p-4 bg-base/50 backdrop-blur-sm rounded"),
|
|
86
88
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -95,14 +97,19 @@ var AnimationSpinner = function AnimationSpinner(_ref3) {
|
|
|
95
97
|
var Loading = function Loading() {
|
|
96
98
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
97
99
|
className: classNames(Animations_module.loader, "area-[loader] relative overflow-x-clip"),
|
|
100
|
+
"data-testid": "loading",
|
|
98
101
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
99
102
|
className: "absolute z-10 py-px inset-x-0 top-0 after:h-0.5 after:block after:bg-primary-500"
|
|
100
103
|
})
|
|
101
104
|
});
|
|
102
105
|
};
|
|
103
|
-
var Skeleton = function Skeleton() {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
+
var Skeleton = function Skeleton(_ref4) {
|
|
107
|
+
var className = _ref4.className,
|
|
108
|
+
rest = _objectWithoutProperties(_ref4, _excluded2);
|
|
109
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", _objectSpread(_objectSpread({
|
|
110
|
+
className: classNames(className, "p-2 animate-pulse flex gap-2 max-w-lg"),
|
|
111
|
+
"data-testid": "skeleton"
|
|
112
|
+
}, rest), {}, {
|
|
106
113
|
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
107
114
|
className: "bg-tint-100 rounded aspect-square h-12"
|
|
108
115
|
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
@@ -125,7 +132,7 @@ var Skeleton = function Skeleton() {
|
|
|
125
132
|
})]
|
|
126
133
|
})]
|
|
127
134
|
})]
|
|
128
|
-
});
|
|
135
|
+
}));
|
|
129
136
|
};
|
|
130
137
|
|
|
131
138
|
exports.AnimationBars = AnimationBars;
|
|
@@ -7,7 +7,6 @@ var utilities = require('@react-fabric/utilities');
|
|
|
7
7
|
var BoringAvatar = require('boring-avatars');
|
|
8
8
|
var classNames = require('classnames');
|
|
9
9
|
var react = require('react');
|
|
10
|
-
var useEffectDebugger = require('../../hooks/useEffectDebugger.js');
|
|
11
10
|
var getColor = require('../../utils/getColor.js');
|
|
12
11
|
var Avatar_module = require('./Avatar.module.css');
|
|
13
12
|
var jsxRuntime = require('react/jsx-runtime');
|
|
@@ -49,7 +48,7 @@ var Avatar = function Avatar(_ref) {
|
|
|
49
48
|
setFallback = _useState2[1];
|
|
50
49
|
|
|
51
50
|
/** ***************** style map *******************/
|
|
52
|
-
var styles =
|
|
51
|
+
var styles = react.useMemo(function () {
|
|
53
52
|
var s = {};
|
|
54
53
|
if (bg) {
|
|
55
54
|
s.backgroundColor = getColor.getColor(bg);
|
|
@@ -64,10 +63,10 @@ var Avatar = function Avatar(_ref) {
|
|
|
64
63
|
s.fontSize = SizeMap[size];
|
|
65
64
|
}
|
|
66
65
|
return s;
|
|
67
|
-
}, [bg, color, size]
|
|
66
|
+
}, [bg, color, size]);
|
|
68
67
|
|
|
69
68
|
/** ***************** render icon *******************/
|
|
70
|
-
var avatarImage =
|
|
69
|
+
var avatarImage = react.useMemo(function () {
|
|
71
70
|
setFallback(!avatar);
|
|
72
71
|
return avatar && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
73
72
|
className: "contents",
|
|
@@ -86,8 +85,8 @@ var Avatar = function Avatar(_ref) {
|
|
|
86
85
|
}
|
|
87
86
|
})]
|
|
88
87
|
});
|
|
89
|
-
}, [avatar]
|
|
90
|
-
var fallbackAvatar =
|
|
88
|
+
}, [avatar]);
|
|
89
|
+
var fallbackAvatar = react.useMemo(function () {
|
|
91
90
|
if (fallbackIcon) {
|
|
92
91
|
return utilities.isSvgPath(fallbackIcon) ? /*#__PURE__*/jsxRuntime.jsx("svg", {
|
|
93
92
|
viewBox: viewBox,
|
|
@@ -128,7 +127,7 @@ var Avatar = function Avatar(_ref) {
|
|
|
128
127
|
variant: variant,
|
|
129
128
|
name: name
|
|
130
129
|
});
|
|
131
|
-
}, [name, variant, fallbackIcon]
|
|
130
|
+
}, [name, variant, fallbackIcon]);
|
|
132
131
|
return /*#__PURE__*/jsxRuntime.jsxs("dfn", _objectSpread(_objectSpread({
|
|
133
132
|
role: "presentation",
|
|
134
133
|
className: classNames(Avatar_module.avatar, className, "select-none relative overflow-hidden inline-block box-content leading-none not-italic text-center", bg && getColor.getBgClass(bg), color && getColor.getColorClass(color), !rounded && "rounded", rounded && "rounded-full"),
|
|
@@ -11,7 +11,7 @@ var reactI18next = require('react-i18next');
|
|
|
11
11
|
var Button = require('./Button.js');
|
|
12
12
|
var jsxRuntime = require('react/jsx-runtime');
|
|
13
13
|
|
|
14
|
-
var _excluded = ["ref", "message", "color", "okLabel", "cancelLabel", "onClick", "loading", "actionMessage", "showActionDone", "showActionDoneEvent"],
|
|
14
|
+
var _excluded = ["ref", "message", "color", "okLabel", "cancelLabel", "onClick", "loading", "placement", "actionMessage", "showActionDone", "showActionDoneEvent"],
|
|
15
15
|
_excluded2 = ["ref"];
|
|
16
16
|
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; }
|
|
17
17
|
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; }
|
|
@@ -26,6 +26,8 @@ var ConfirmButton = function ConfirmButton(_ref) {
|
|
|
26
26
|
cancelLabel = _ref.cancelLabel,
|
|
27
27
|
onClick = _ref.onClick,
|
|
28
28
|
loading = _ref.loading,
|
|
29
|
+
_ref$placement = _ref.placement,
|
|
30
|
+
placement = _ref$placement === void 0 ? "bottom" : _ref$placement,
|
|
29
31
|
actionMessage = _ref.actionMessage,
|
|
30
32
|
showActionDone = _ref.showActionDone,
|
|
31
33
|
_ref$showActionDoneEv = _ref.showActionDoneEvent,
|
|
@@ -77,7 +79,7 @@ var ConfirmButton = function ConfirmButton(_ref) {
|
|
|
77
79
|
}
|
|
78
80
|
},
|
|
79
81
|
strategy: "fixed",
|
|
80
|
-
placement:
|
|
82
|
+
placement: placement,
|
|
81
83
|
whileElementsMounted: react$1.autoUpdate,
|
|
82
84
|
middleware: [react$1.shift({
|
|
83
85
|
padding: 8
|
|
@@ -12,7 +12,7 @@ var nodeCheck = require('../../utils/nodeCheck.js');
|
|
|
12
12
|
var Card_module = require('./Card.module.css');
|
|
13
13
|
var jsxRuntime = require('react/jsx-runtime');
|
|
14
14
|
|
|
15
|
-
var _excluded = ["children", "className", "bodyClassName", "selected", "selectedRibbon", "onClick", "flex", "draggable", "dragKey", "dragData"];
|
|
15
|
+
var _excluded = ["children", "className", "bodyClassName", "selected", "selectedRibbon", "onClick", "flex", "draggable", "dragKey", "dragData", "ref"];
|
|
16
16
|
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; }
|
|
17
17
|
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; }
|
|
18
18
|
var Card = function Card(_ref) {
|
|
@@ -26,6 +26,7 @@ var Card = function Card(_ref) {
|
|
|
26
26
|
draggable = _ref.draggable,
|
|
27
27
|
dragKey = _ref.dragKey,
|
|
28
28
|
dragData = _ref.dragData,
|
|
29
|
+
ref = _ref.ref,
|
|
29
30
|
aria = _objectWithoutProperties(_ref, _excluded);
|
|
30
31
|
var _useMemo = react.useMemo(function () {
|
|
31
32
|
return react.Children.toArray(children).reduce(function (ret, node) {
|
|
@@ -46,7 +47,8 @@ var Card = function Card(_ref) {
|
|
|
46
47
|
onDragStart: !draggable ? undefined : function (e) {
|
|
47
48
|
var _e$dataTransfer;
|
|
48
49
|
return dragKey && ((_e$dataTransfer = e.dataTransfer) === null || _e$dataTransfer === void 0 ? void 0 : _e$dataTransfer.setData(dragKey, JSON.stringify(dragData)));
|
|
49
|
-
}
|
|
50
|
+
},
|
|
51
|
+
ref: ref
|
|
50
52
|
}, aria), {}, {
|
|
51
53
|
children: [header, /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
52
54
|
role: "none",
|
|
@@ -66,7 +66,7 @@ var Chip = function Chip(_ref) {
|
|
|
66
66
|
return /*#__PURE__*/jsxRuntime.jsxs(E, _objectSpread(_objectSpread({
|
|
67
67
|
ref: ref,
|
|
68
68
|
role: "term",
|
|
69
|
-
className: classNames(Chip_module.chip, className, color && getColor.getColorClass(color), "select-none inline-flex flex-nowrap items-center max-w-72 text-sm
|
|
69
|
+
className: classNames(Chip_module.chip, className, color && getColor.getColorClass(color), "select-none inline-flex flex-nowrap items-center max-w-72 text-sm rounded", rounded && "rounded-full", !!onClick && Chip_module.clickable, disabled && Chip_module.disabled),
|
|
70
70
|
style: styles,
|
|
71
71
|
"data-variant": variant,
|
|
72
72
|
"data-inner-clickable": !!onClick,
|
|
@@ -80,7 +80,7 @@ var Chip = function Chip(_ref) {
|
|
|
80
80
|
color: iconColor,
|
|
81
81
|
rtlFlip: rtlFlip
|
|
82
82
|
}), children && /*#__PURE__*/jsxRuntime.jsx("label", {
|
|
83
|
-
className: classNames(Chip_module.chipLabel, "
|
|
83
|
+
className: classNames(Chip_module.chipLabel, "truncate"),
|
|
84
84
|
children: children
|
|
85
85
|
}), onRemove && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
86
86
|
role: "none",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer comp{.chip{--blank-gradient:linear-gradient(180deg,#00000005 0%,#0000 10%);background-image:var(--blank-gradient);color:theme(colors.tint.500);outline:1px solid color-mix(in lab,currentcolor 20%,var(--fabric-bg));outline-offset:-1px;&>.chipLabel{padding
|
|
1
|
+
@layer comp{.chip{--blank-gradient:linear-gradient(180deg,#00000005 0%,#0000 10%);background-image:var(--blank-gradient);color:theme(colors.tint.500);outline:1px solid color-mix(in lab,currentcolor 20%,var(--fabric-bg));outline-offset:-1px;&>.chipLabel{padding:0 .5em}&>.chipIcon{&+.chipLabel{margin-inline-start:-.5em}}&.clickable{background-image:var(--click-gradient);cursor:pointer;&.disabled{opacity:.5;pointer-events:none}}}}@layer var{.chip{background-color:color-mix(in lab,currentcolor 10%,var(--fabric-bg));height:unset;padding:unset;&[data-variant=outline]{box-shadow:0 0 2px color-mix(in lab,currentcolor 50%,var(--tint)) inset;outline-color:color-mix(in lab,currentcolor 50%,var(--fabric-bg))}>*{color:color-mix(in lab,currentcolor 50%,var(--fabric-text))}&.clickable{&:hover{background-color:color-mix(in lab,currentcolor 20%,var(--fabric-bg))}&:active,&[data-dropdown-open=true]{background-color:color-mix(in lab,currentcolor 15%,var(--fabric-bg));background-image:var(--active-gradient)}&[data-dropdown-open=true]{pointer-events:none}}&[data-variant=solid]{background-color:color-mix(in lab,currentcolor 35%,var(--fabric-bg));outline-color:color-mix(in lab,currentcolor 50%,var(--fabric-bg));&>*{color:color-mix(in lab,currentcolor 5%,var(--fabric-text))}&.clickable{&:hover{background-color:color-mix(in lab,currentcolor 45%,var(--fabric-bg))}&:active,&[data-dropdown-open=true]{background-color:color-mix(in lab,currentcolor 30%,var(--fabric-bg))}}}}}
|
|
@@ -11,7 +11,7 @@ var Icon = require('../icon/Icon.js');
|
|
|
11
11
|
var Collapsable_module = require('./Collapsable.module.css');
|
|
12
12
|
var jsxRuntime = require('react/jsx-runtime');
|
|
13
13
|
|
|
14
|
-
var _excluded = ["ref", "disabled", "className", "bodyClassName", "headerClassName", "children", "iconAlign", "iconClosed", "iconOpen", "open", "onClose", "onOpen"];
|
|
14
|
+
var _excluded = ["ref", "disabled", "className", "bodyClassName", "headerClassName", "children", "iconAlign", "stickyHeader", "iconClosed", "iconOpen", "open", "onClose", "onOpen"];
|
|
15
15
|
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; }
|
|
16
16
|
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; }
|
|
17
17
|
var Collapsable = function Collapsable(_ref) {
|
|
@@ -22,6 +22,7 @@ var Collapsable = function Collapsable(_ref) {
|
|
|
22
22
|
headerClassName = _ref.headerClassName,
|
|
23
23
|
children = _ref.children,
|
|
24
24
|
iconAlign = _ref.iconAlign,
|
|
25
|
+
stickyHeader = _ref.stickyHeader,
|
|
25
26
|
_ref$iconClosed = _ref.iconClosed,
|
|
26
27
|
iconClosed = _ref$iconClosed === void 0 ? icons.CoreIcons.chevronRight : _ref$iconClosed,
|
|
27
28
|
_ref$iconOpen = _ref.iconOpen,
|
|
@@ -62,7 +63,7 @@ var Collapsable = function Collapsable(_ref) {
|
|
|
62
63
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
63
64
|
role: "none",
|
|
64
65
|
ref: headRef,
|
|
65
|
-
className: classNames(Collapsable_module.collapsableHead, "flex gap-1 flex-nowrap py-2 font-medium cursor-pointer items-center select-none hover:opacity-70", headerClassName, iconAlign === "end" ? "flex-row-reverse" : "flex-row"),
|
|
66
|
+
className: classNames(Collapsable_module.collapsableHead, "flex gap-1 flex-nowrap py-2 font-medium cursor-pointer items-center select-none hover:opacity-70", headerClassName, stickyHeader && "bg-base sticky top-0 px-2 py-1 z-10", iconAlign === "end" ? "flex-row-reverse" : "flex-row"),
|
|
66
67
|
onClick: function onClick() {
|
|
67
68
|
return !disabled && setOpenState(!openState);
|
|
68
69
|
},
|
|
@@ -131,7 +131,8 @@ var DropdownElement = function DropdownElement(_ref) {
|
|
|
131
131
|
style: _objectSpread({
|
|
132
132
|
minWidth: minWidth,
|
|
133
133
|
zIndex: "var(--z-popover)"
|
|
134
|
-
}, floatingStyles)
|
|
134
|
+
}, floatingStyles),
|
|
135
|
+
"data-testid": "dropdown-body"
|
|
135
136
|
}, getFloatingProps({
|
|
136
137
|
onClick: function onClick(e) {
|
|
137
138
|
return e.stopPropagation();
|
|
@@ -8,17 +8,18 @@ var Icon = require('../icon/Icon.js');
|
|
|
8
8
|
var Dropdown = require('./Dropdown.js');
|
|
9
9
|
var jsxRuntime = require('react/jsx-runtime');
|
|
10
10
|
|
|
11
|
-
var _excluded = ["children", "className", "groupHover"];
|
|
11
|
+
var _excluded = ["children", "className", "groupHover", "icon"];
|
|
12
12
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
13
13
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
14
14
|
var DropdownTool = function DropdownTool(_ref) {
|
|
15
15
|
var children = _ref.children,
|
|
16
16
|
className = _ref.className,
|
|
17
17
|
groupHover = _ref.groupHover,
|
|
18
|
+
icon = _ref.icon,
|
|
18
19
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
19
20
|
return /*#__PURE__*/jsxRuntime.jsxs(Dropdown.Dropdown, _objectSpread(_objectSpread({}, props), {}, {
|
|
20
21
|
children: [/*#__PURE__*/jsxRuntime.jsx(Icon.Icon, {
|
|
21
|
-
icon: icons.CoreIcons.caretDown,
|
|
22
|
+
icon: icon !== null && icon !== void 0 ? icon : icons.CoreIcons.caretDown,
|
|
22
23
|
className: classNames(className, "outline bg-base flex-content pointer-events-auto cursor-pointer", groupHover && "hidden group-hover:inline-block data-[dropdown-open]:inline-block")
|
|
23
24
|
}), children]
|
|
24
25
|
}));
|
|
@@ -4,7 +4,7 @@ var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
|
4
4
|
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
5
5
|
var utilities = require('@react-fabric/utilities');
|
|
6
6
|
var classNames = require('classnames');
|
|
7
|
-
var
|
|
7
|
+
var react = require('react');
|
|
8
8
|
var getColor = require('../../utils/getColor.js');
|
|
9
9
|
var Icon_module = require('./Icon.module.css');
|
|
10
10
|
var jsxRuntime = require('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 = react.useMemo(function () {
|
|
44
44
|
var s = {};
|
|
45
45
|
if (bg) {
|
|
46
46
|
s.backgroundColor = getColor.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 = react.useMemo(function () {
|
|
62
62
|
return utilities.isSvgPath(icon);
|
|
63
|
-
}, [icon]
|
|
63
|
+
}, [icon]);
|
|
64
64
|
|
|
65
65
|
/** ***************** render icon *******************/
|
|
66
|
-
var iconEl =
|
|
66
|
+
var iconEl = react.useMemo(function () {
|
|
67
67
|
var _SvgTextSize$icon$len;
|
|
68
68
|
if (!utilities.isString(icon)) {
|
|
69
69
|
throw Error("Invalid icon expected string");
|
|
@@ -90,7 +90,7 @@ var Icon = function Icon(_ref) {
|
|
|
90
90
|
}) : /*#__PURE__*/jsxRuntime.jsx("i", {
|
|
91
91
|
className: "".concat(icon)
|
|
92
92
|
});
|
|
93
|
-
}, [icon, isSvg, viewBox]
|
|
93
|
+
}, [icon, isSvg, viewBox]);
|
|
94
94
|
return /*#__PURE__*/jsxRuntime.jsx("dfn", _objectSpread(_objectSpread({}, rest), {}, {
|
|
95
95
|
ref: ref,
|
|
96
96
|
role: "presentation",
|
|
@@ -9,15 +9,22 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
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 = react.useState(false),
|
|
15
17
|
_useState2 = _slicedToArray(_useState, 2),
|
|
16
18
|
isOpen = _useState2[0],
|
|
17
19
|
setIsOpen = _useState2[1];
|
|
20
|
+
var nodeId = react$1.useFloatingNodeId();
|
|
18
21
|
var _useFloating = react$1.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: react$1.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 = react$1.useClick(context, {
|
|
30
|
-
|
|
36
|
+
var click = react$1.useClick(context, {
|
|
37
|
+
toggle: true,
|
|
38
|
+
ignoreMouse: true
|
|
39
|
+
});
|
|
40
|
+
var dismiss = react$1.useDismiss(context, {
|
|
41
|
+
bubbles: true
|
|
42
|
+
});
|
|
31
43
|
var _useInteractions = react$1.useInteractions([dismiss, click]),
|
|
32
44
|
getFloatingProps = _useInteractions.getFloatingProps;
|
|
33
45
|
var handleClick = react.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 = react.useRef(
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
66
|
+
var wrapperRef = react.useRef(null);
|
|
67
|
+
react.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 = react.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__*/jsxRuntime.jsxs("div", {
|
|
66
85
|
className: "contents",
|
|
67
|
-
ref: wrapperRef
|
|
86
|
+
ref: wrapperRef,
|
|
68
87
|
onMouseUpCapture: tryClosing.current,
|
|
69
88
|
children: [children, isOpen && /*#__PURE__*/jsxRuntime.jsx(react$1.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__*/react.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__*/jsxRuntime.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: utilities.mergeRefs(
|
|
166
|
+
ref: utilities.mergeRefs(isNested ? refs.setFloating : ref)
|
|
167
167
|
}, getFloatingProps({
|
|
168
168
|
onClick: isNested ? undefined : handleClick
|
|
169
169
|
})), {}, {
|
|
@@ -34,6 +34,7 @@ var Navigator = function Navigator(_ref) {
|
|
|
34
34
|
color: color,
|
|
35
35
|
className: "text-[1em] p-1",
|
|
36
36
|
"aria-label": "previous",
|
|
37
|
+
"data-testid": "previous",
|
|
37
38
|
icon: icons.CoreIcons.chevronLeft,
|
|
38
39
|
onClick: function onClick(e) {
|
|
39
40
|
return [e.stopPropagation(), onNavigate(-1)];
|
|
@@ -43,6 +44,7 @@ var Navigator = function Navigator(_ref) {
|
|
|
43
44
|
className: "text-[1em] p-1",
|
|
44
45
|
color: color,
|
|
45
46
|
"aria-label": "next",
|
|
47
|
+
"data-testid": "next",
|
|
46
48
|
icon: icons.CoreIcons.chevronRight,
|
|
47
49
|
onClick: function onClick(e) {
|
|
48
50
|
return [e.stopPropagation(), onNavigate(1)];
|
|
@@ -74,6 +74,7 @@ var Panel = function Panel(_ref) {
|
|
|
74
74
|
children: [/*#__PURE__*/jsxRuntime.jsxs("header", {
|
|
75
75
|
role: "none",
|
|
76
76
|
className: classNames(Panel_module.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__*/jsxRuntime.jsx(Icon.Icon, {
|
|
79
80
|
"data-ref": "panelBack",
|
|
@@ -116,6 +117,7 @@ var Panel = function Panel(_ref) {
|
|
|
116
117
|
})]
|
|
117
118
|
})]
|
|
118
119
|
}), (!collapsed || expanded) && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
120
|
+
"data-testid": "panel-body",
|
|
119
121
|
className: classNames(Panel_module.panelBody, "area-content grid overflow-hidden"),
|
|
120
122
|
children: [loading && /*#__PURE__*/jsxRuntime.jsx(Animations.Loading, {}), children]
|
|
121
123
|
})]
|
|
@@ -2,15 +2,23 @@
|
|
|
2
2
|
|
|
3
3
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
4
4
|
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
5
|
+
var utilities = require('@react-fabric/utilities');
|
|
5
6
|
var classNames = require('classnames');
|
|
6
7
|
var react = require('react');
|
|
8
|
+
require('@babel/runtime/helpers/slicedToArray');
|
|
9
|
+
require('@floating-ui/react');
|
|
10
|
+
require('react-i18next');
|
|
11
|
+
require('../../hooks/useEffectDebugger.js');
|
|
12
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
13
|
+
require('../../hotkeys/HotKeyWrapper.js');
|
|
14
|
+
var Tooltip = require('../../overlays/tooltip/Tooltip.js');
|
|
7
15
|
var Badge = require('../badge/Badge.js');
|
|
8
|
-
var DropdownTool = require('../dropdown/DropdownTool.js');
|
|
9
16
|
var Icon = require('../icon/Icon.js');
|
|
17
|
+
require('../../types/icons.js');
|
|
18
|
+
var DropdownTool = require('../dropdown/DropdownTool.js');
|
|
10
19
|
var TabPanel_module = require('./TabPanel.module.css');
|
|
11
|
-
var jsxRuntime = require('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,56 @@ 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 = react.useMemo(function () {
|
|
38
47
|
return Badge.getBadgeProps(badge);
|
|
39
48
|
}, [badge]);
|
|
49
|
+
var tooltipProps = react.useMemo(function () {
|
|
50
|
+
if (utilities.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
|
-
}, aria), {}, {
|
|
51
|
-
children: [icon && /*#__PURE__*/jsxRuntime.jsx(Icon.Icon, {
|
|
52
|
-
icon: icon,
|
|
53
|
-
bg: iconBg,
|
|
54
|
-
color: iconColor,
|
|
55
|
-
rtlFlip: rtlFlip,
|
|
56
|
-
className: "flex-content"
|
|
57
|
-
}), !minimal && /*#__PURE__*/jsxRuntime.jsx("label", {
|
|
58
|
-
className: "flex-initial truncate text-center px-1 py-1",
|
|
59
|
-
children: label
|
|
60
|
-
}), badge && /*#__PURE__*/jsxRuntime.jsx(Badge.Badge, _objectSpread(_objectSpread({}, badgeProps), {}, {
|
|
61
|
-
placement: minimal ? "end" : "",
|
|
62
|
-
className: classNames("me-1", badgeProps.className)
|
|
63
|
-
})), actions && active && /*#__PURE__*/jsxRuntime.jsx(DropdownTool.DropdownTool, {
|
|
64
|
-
className: "bg-base/20 me-1 z-5",
|
|
65
|
-
children: actions
|
|
66
|
-
}), onClose && /*#__PURE__*/jsxRuntime.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.Tooltip : react.Fragment;
|
|
57
|
+
return /*#__PURE__*/jsxRuntime.jsx(W, _objectSpread(_objectSpread({}, tooltipProps), {}, {
|
|
58
|
+
children: /*#__PURE__*/jsxRuntime.jsxs(E, _objectSpread(_objectSpread({
|
|
59
|
+
"data-id": id,
|
|
60
|
+
disabled: disabled,
|
|
61
|
+
"data-color": color,
|
|
62
|
+
className: classNames(TabPanel_module.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"),
|
|
63
|
+
onClick: function onClick() {
|
|
64
|
+
return !active && (_onClick === null || _onClick === void 0 ? void 0 : _onClick(id));
|
|
72
65
|
},
|
|
73
|
-
|
|
74
|
-
})
|
|
66
|
+
ref: ref
|
|
67
|
+
}, aria), {}, {
|
|
68
|
+
children: [icon && /*#__PURE__*/jsxRuntime.jsx(Icon.Icon, {
|
|
69
|
+
icon: icon,
|
|
70
|
+
bg: iconBg,
|
|
71
|
+
color: iconColor,
|
|
72
|
+
rtlFlip: rtlFlip,
|
|
73
|
+
className: "flex-content"
|
|
74
|
+
}), !minimal && /*#__PURE__*/jsxRuntime.jsx("label", {
|
|
75
|
+
className: "flex-initial truncate text-center px-1 py-1",
|
|
76
|
+
children: label
|
|
77
|
+
}), badge && /*#__PURE__*/jsxRuntime.jsx(Badge.Badge, _objectSpread(_objectSpread({}, badgeProps), {}, {
|
|
78
|
+
placement: minimal ? "end" : "",
|
|
79
|
+
className: classNames("me-1", badgeProps.className)
|
|
80
|
+
})), actions && active && /*#__PURE__*/jsxRuntime.jsx(DropdownTool.DropdownTool, {
|
|
81
|
+
className: "bg-base/20 me-1 z-5",
|
|
82
|
+
children: actions
|
|
83
|
+
}), onClose && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
84
|
+
role: "none",
|
|
85
|
+
className: classNames("cursor-pointer me-1 opacity-65 hover:opacity-90 pointer-events-auto"),
|
|
86
|
+
onClick: function onClick(e) {
|
|
87
|
+
onClose === null || onClose === void 0 || onClose();
|
|
88
|
+
e.stopPropagation();
|
|
89
|
+
},
|
|
90
|
+
children: "\xD7"
|
|
91
|
+
})]
|
|
92
|
+
}))
|
|
75
93
|
}));
|
|
76
94
|
};
|
|
77
95
|
|
|
@@ -106,12 +106,14 @@ var Aside = function Aside(_ref) {
|
|
|
106
106
|
className: classNames(Aside_module.aside, className, "overflow-hidden grid"),
|
|
107
107
|
"data-align": align,
|
|
108
108
|
"data-flyout": peek,
|
|
109
|
+
"data-loading": loading,
|
|
109
110
|
"data-collapsed": isCollapsed,
|
|
110
111
|
style: isCollapsed ? undefined : widthStyles,
|
|
111
112
|
"data-testid": testId,
|
|
112
113
|
"data-test-value": testValue,
|
|
113
114
|
children: [/*#__PURE__*/jsxRuntime.jsxs("header", {
|
|
114
115
|
className: classNames(Aside_module.asideHeader, headerClassName, "grid area-head items-center"),
|
|
116
|
+
"data-testid": "aside-header",
|
|
115
117
|
children: [title && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
116
118
|
className: classNames(Aside_module.asideTitle, "truncate py-0.5 px-1 select-none pointer-events-none"),
|
|
117
119
|
children: title
|
|
@@ -142,6 +144,7 @@ var Aside = function Aside(_ref) {
|
|
|
142
144
|
"data-ref": "asideBody",
|
|
143
145
|
className: classNames(Aside_module.asideBody, bodyClassName, "overflow-hidden grid"),
|
|
144
146
|
style: isCollapsed ? widthStyles : undefined,
|
|
147
|
+
"data-testid": "aside-body",
|
|
145
148
|
children: /*#__PURE__*/jsxRuntime.jsx(ErrorBoundary.ErrorBoundary, {
|
|
146
149
|
children: children
|
|
147
150
|
})
|
|
@@ -44,12 +44,15 @@ var Content = function Content(_ref) {
|
|
|
44
44
|
testValue = _ref["data-test-value"];
|
|
45
45
|
var resizeHandle = useResizeObserver.useResizeObserver(onResize);
|
|
46
46
|
var scrollHandler = useDebounce.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
|
react.useImperativeHandle(ref, function () {
|
|
55
58
|
return resizeHandle.current;
|
|
@@ -47,6 +47,7 @@ var Page = function Page(_ref) {
|
|
|
47
47
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
48
48
|
"data-testid": testId,
|
|
49
49
|
"data-test-value": testValue,
|
|
50
|
+
"data-loading": loading,
|
|
50
51
|
className: classNames(Page_module.page, "overflow-hidden grid area-content", paper && "shadow-paper m-[6px] rounded-capped"),
|
|
51
52
|
children: [title && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
52
53
|
"data-ref": "pageTitle",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer comp{.title{line-height:1.125}.moreLink{margin:-.25rem 0 1rem;text-align:end;&>span{color:theme(colors.accent.700);cursor:pointer;font-size:.75rem;user-select:none;&:hover{color:theme(colors.accent.500);text-decoration:underline;text-underline-offset:2px}}}}@layer util{.text{-webkit-line-clamp:var(--text-clamp)}.abbr{--abbr-color:var(--accent);color:color-mix(in lab,var(--abbr-color) 50%,var(--fabric-text))}.mark{--mark-color:var(--
|
|
1
|
+
@layer comp{.title{line-height:1.125}.moreLink{margin:-.25rem 0 1rem;text-align:end;&>span{color:theme(colors.accent.700);cursor:pointer;font-size:.75rem;user-select:none;&:hover{color:theme(colors.accent.500);text-decoration:underline;text-underline-offset:2px}}}}@layer util{.text{-webkit-line-clamp:var(--text-clamp)}.abbr{--abbr-color:var(--accent);color:color-mix(in lab,var(--abbr-color) 50%,var(--fabric-text))}.mark{--mark-color:var(--primary);background-color:color-mix(in lab,var(--mark-color) 25%,var(--fabric-bg))}}
|