@inf-monkeys-tech/monkeys-design 1.0.42 → 1.0.43
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/OverlayNodeHost-14bb9b0f18f4.d.mts +1 -1
- package/dist/OverlayNodeHost-3c763888b689.d.ts +1 -1
- package/dist/components/agent-workbench/index.js +4 -1
- package/dist/components/agent-workbench/index.js.map +1 -1
- package/dist/components/agent-workbench/index.mjs +4 -1
- package/dist/components/agent-workbench/index.mjs.map +1 -1
- package/dist/components/base/index.d.mts +2 -2
- package/dist/components/base/index.d.ts +2 -2
- package/dist/components/base/index.js +212 -58
- package/dist/components/base/index.js.map +1 -1
- package/dist/components/base/index.mjs +212 -59
- package/dist/components/base/index.mjs.map +1 -1
- package/dist/components/data-explorer/index.js +4 -1
- package/dist/components/data-explorer/index.js.map +1 -1
- package/dist/components/data-explorer/index.mjs +4 -1
- package/dist/components/data-explorer/index.mjs.map +1 -1
- package/dist/components/layout/index.d.mts +1 -1
- package/dist/components/layout/index.d.ts +1 -1
- package/dist/components/layout/index.js +4 -1
- package/dist/components/layout/index.js.map +1 -1
- package/dist/components/layout/index.mjs +4 -1
- package/dist/components/layout/index.mjs.map +1 -1
- package/dist/components/runtime/index.d.mts +1 -1
- package/dist/components/runtime/index.d.ts +1 -1
- package/dist/components/runtime/index.js +4 -1
- package/dist/components/runtime/index.js.map +1 -1
- package/dist/components/runtime/index.mjs +4 -1
- package/dist/components/runtime/index.mjs.map +1 -1
- package/dist/components/toast/index.d.mts +1 -1
- package/dist/components/toast/index.d.ts +1 -1
- package/dist/components/toast/index.js +4 -1
- package/dist/components/toast/index.js.map +1 -1
- package/dist/components/toast/index.mjs +4 -1
- package/dist/components/toast/index.mjs.map +1 -1
- package/dist/components/toolbar/index.js +4 -1
- package/dist/components/toolbar/index.js.map +1 -1
- package/dist/components/toolbar/index.mjs +4 -1
- package/dist/components/toolbar/index.mjs.map +1 -1
- package/dist/components/workbench/index.d.mts +9 -1
- package/dist/components/workbench/index.d.ts +9 -1
- package/dist/components/workbench/index.js +244 -78
- package/dist/components/workbench/index.js.map +1 -1
- package/dist/components/workbench/index.mjs +244 -78
- package/dist/components/workbench/index.mjs.map +1 -1
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +262 -74
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +261 -75
- package/dist/index.mjs.map +1 -1
- package/dist/locale/index.d.mts +8 -2
- package/dist/locale/index.d.ts +8 -2
- package/dist/locale/index.js +8 -2
- package/dist/locale/index.js.map +1 -1
- package/dist/locale/index.mjs +8 -2
- package/dist/locale/index.mjs.map +1 -1
- package/dist/provider/index.d.mts +25 -5
- package/dist/provider/index.d.ts +25 -5
- package/dist/provider/index.js +24 -3
- package/dist/provider/index.js.map +1 -1
- package/dist/provider/index.mjs +24 -4
- package/dist/provider/index.mjs.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/{theme-61b15c3b7960.d.ts → theme-17bde32ca128.d.ts} +3 -2
- package/dist/{theme-7bf5602208e8.d.mts → theme-39d2fdc145c2.d.mts} +3 -2
- package/dist/{types-453d18eab188.d.mts → types-22bd2ecb535c.d.mts} +3 -0
- package/dist/{types-453d18eab188.d.ts → types-22bd2ecb535c.d.ts} +3 -0
- package/dist/{types-3c51850d34c1.d.mts → types-29dff278cb84.d.mts} +15 -1
- package/dist/{types-3c51850d34c1.d.ts → types-29dff278cb84.d.ts} +15 -1
- package/package.json +1 -1
|
@@ -476,7 +476,10 @@ var enUS = {
|
|
|
476
476
|
loadError: "Unable to load items",
|
|
477
477
|
refreshError: "Unable to refresh items",
|
|
478
478
|
retry: "Retry",
|
|
479
|
-
loadingMore: "Loading more items"
|
|
479
|
+
loadingMore: "Loading more items",
|
|
480
|
+
permission: "You do not have permission to view this content",
|
|
481
|
+
offline: "You appear to be offline",
|
|
482
|
+
requestAccess: "Request access"
|
|
480
483
|
},
|
|
481
484
|
interactiveTable: {
|
|
482
485
|
columnActions: "Column actions",
|
|
@@ -740,6 +743,9 @@ function useMonkeysBaseAppearance(explicit) {
|
|
|
740
743
|
[explicit, inherited]
|
|
741
744
|
);
|
|
742
745
|
}
|
|
746
|
+
function useMonkeysStatusStates() {
|
|
747
|
+
return useContext(MonkeysThemeContext).statusStates ?? {};
|
|
748
|
+
}
|
|
743
749
|
function useMonkeysDirection() {
|
|
744
750
|
return useContext(MonkeysDirectionContext).direction;
|
|
745
751
|
}
|
|
@@ -2210,16 +2216,6 @@ function getBaseButtonToneClassName(theme, tone = "default", active = false) {
|
|
|
2210
2216
|
active && theme.slots.buttonActive
|
|
2211
2217
|
);
|
|
2212
2218
|
}
|
|
2213
|
-
function getBaseNoticeToneClassName(theme, tone = "default") {
|
|
2214
|
-
return cn(
|
|
2215
|
-
tone === "default" && theme.slots.noticeDefault,
|
|
2216
|
-
tone === "primary" && theme.slots.noticePrimary,
|
|
2217
|
-
tone === "success" && theme.slots.noticeSuccess,
|
|
2218
|
-
tone === "warning" && theme.slots.noticeWarning,
|
|
2219
|
-
tone === "danger" && theme.slots.noticeDanger,
|
|
2220
|
-
tone === "muted" && theme.slots.noticeMuted
|
|
2221
|
-
);
|
|
2222
|
-
}
|
|
2223
2219
|
function getBaseMenuItemToneClassName(theme, tone = "default") {
|
|
2224
2220
|
return cn(
|
|
2225
2221
|
tone === "default" && theme.slots.menuItemDefault,
|
|
@@ -3479,6 +3475,7 @@ var BaseEmptyState = forwardRef(
|
|
|
3479
3475
|
title,
|
|
3480
3476
|
description,
|
|
3481
3477
|
actions,
|
|
3478
|
+
variant,
|
|
3482
3479
|
appearance,
|
|
3483
3480
|
className,
|
|
3484
3481
|
classNames,
|
|
@@ -3487,6 +3484,9 @@ var BaseEmptyState = forwardRef(
|
|
|
3487
3484
|
}, ref) {
|
|
3488
3485
|
const resolvedAppearance = useMonkeysBaseAppearance(appearance);
|
|
3489
3486
|
const componentAttributes = useMonkeysComponentAttributes();
|
|
3487
|
+
const statusStates = useMonkeysStatusStates();
|
|
3488
|
+
const resolvedVariant = variant ?? statusStates.empty?.variant ?? "default";
|
|
3489
|
+
const densityClassName = statusStates.density === "compact" ? "min-h-0 px-3 py-3" : statusStates.density === "comfortable" ? "min-h-56 px-8 py-12" : void 0;
|
|
3490
3490
|
const theme = resolveBaseAppearance(resolvedAppearance);
|
|
3491
3491
|
return /* @__PURE__ */ jsxs(
|
|
3492
3492
|
"div",
|
|
@@ -3497,7 +3497,15 @@ var BaseEmptyState = forwardRef(
|
|
|
3497
3497
|
"data-monkeys-component": "empty-state",
|
|
3498
3498
|
"data-slot": "root",
|
|
3499
3499
|
"data-state": "empty",
|
|
3500
|
-
|
|
3500
|
+
"data-variant": resolvedVariant,
|
|
3501
|
+
"data-density": statusStates.density,
|
|
3502
|
+
className: cn(
|
|
3503
|
+
theme.slots.stateRoot,
|
|
3504
|
+
densityClassName,
|
|
3505
|
+
resolvedVariant === "compact" && "min-h-0 gap-1 py-3",
|
|
3506
|
+
classNames?.root,
|
|
3507
|
+
className
|
|
3508
|
+
),
|
|
3501
3509
|
style: {
|
|
3502
3510
|
...theme.styles.stateRoot,
|
|
3503
3511
|
...style
|
|
@@ -3903,6 +3911,59 @@ var BaseInput = forwardRef(
|
|
|
3903
3911
|
);
|
|
3904
3912
|
}
|
|
3905
3913
|
);
|
|
3914
|
+
var variantClassNames = {
|
|
3915
|
+
line: "h-4 w-full",
|
|
3916
|
+
block: "h-24 w-full",
|
|
3917
|
+
circle: "aspect-square h-10 rounded-full"
|
|
3918
|
+
};
|
|
3919
|
+
var BaseSkeleton = forwardRef(
|
|
3920
|
+
function BaseSkeleton2({
|
|
3921
|
+
variant = "line",
|
|
3922
|
+
animated = true,
|
|
3923
|
+
appearance,
|
|
3924
|
+
className,
|
|
3925
|
+
classNames,
|
|
3926
|
+
style,
|
|
3927
|
+
...skeletonProps
|
|
3928
|
+
}, ref) {
|
|
3929
|
+
if (variant !== "line" && variant !== "block" && variant !== "circle") {
|
|
3930
|
+
throw new TypeError(
|
|
3931
|
+
'BaseSkeleton variant must be "line", "block", or "circle".'
|
|
3932
|
+
);
|
|
3933
|
+
}
|
|
3934
|
+
if (typeof animated !== "boolean") {
|
|
3935
|
+
throw new TypeError("BaseSkeleton animated must be a boolean.");
|
|
3936
|
+
}
|
|
3937
|
+
const resolvedAppearance = useMonkeysBaseAppearance(appearance);
|
|
3938
|
+
const componentAttributes = useMonkeysComponentAttributes();
|
|
3939
|
+
const theme = resolveBaseAppearance(resolvedAppearance);
|
|
3940
|
+
return /* @__PURE__ */ jsx(
|
|
3941
|
+
"div",
|
|
3942
|
+
{
|
|
3943
|
+
...componentAttributes,
|
|
3944
|
+
...skeletonProps,
|
|
3945
|
+
ref,
|
|
3946
|
+
"aria-hidden": "true",
|
|
3947
|
+
"data-monkeys-component": "skeleton",
|
|
3948
|
+
"data-slot": "root",
|
|
3949
|
+
"data-variant": variant,
|
|
3950
|
+
"data-animated": animated,
|
|
3951
|
+
"data-state": animated ? "animated" : "static",
|
|
3952
|
+
className: cn(
|
|
3953
|
+
theme.slots.skeletonRoot,
|
|
3954
|
+
variantClassNames[variant],
|
|
3955
|
+
animated && "motion-safe:animate-pulse motion-reduce:animate-none",
|
|
3956
|
+
classNames?.root,
|
|
3957
|
+
className
|
|
3958
|
+
),
|
|
3959
|
+
style: {
|
|
3960
|
+
...theme.styles.skeleton,
|
|
3961
|
+
...style
|
|
3962
|
+
}
|
|
3963
|
+
}
|
|
3964
|
+
);
|
|
3965
|
+
}
|
|
3966
|
+
);
|
|
3906
3967
|
function DefaultLoadingIcon({ className }) {
|
|
3907
3968
|
return /* @__PURE__ */ jsxs(
|
|
3908
3969
|
"svg",
|
|
@@ -3940,6 +4001,7 @@ var BaseLoadingState = forwardRef(function BaseLoadingState2({
|
|
|
3940
4001
|
title,
|
|
3941
4002
|
description,
|
|
3942
4003
|
actions,
|
|
4004
|
+
variant,
|
|
3943
4005
|
appearance,
|
|
3944
4006
|
className,
|
|
3945
4007
|
classNames,
|
|
@@ -3954,8 +4016,11 @@ var BaseLoadingState = forwardRef(function BaseLoadingState2({
|
|
|
3954
4016
|
const resolvedAppearance = useMonkeysBaseAppearance(appearance);
|
|
3955
4017
|
const componentAttributes = useMonkeysComponentAttributes();
|
|
3956
4018
|
const loadingMessages = useMonkeysLocaleMessages().loading;
|
|
4019
|
+
const statusStates = useMonkeysStatusStates();
|
|
4020
|
+
const resolvedVariant = variant ?? statusStates.loading?.variant ?? "spinner";
|
|
4021
|
+
const densityClassName = statusStates.density === "compact" ? "min-h-0 px-3 py-3" : statusStates.density === "comfortable" ? "min-h-56 px-8 py-12" : void 0;
|
|
3957
4022
|
const theme = resolveBaseAppearance(resolvedAppearance);
|
|
3958
|
-
const resolvedIcon = icon === void 0 ? /* @__PURE__ */ jsx(DefaultLoadingIcon, { className: theme.slots.loadingSpinner }) : icon;
|
|
4023
|
+
const resolvedIcon = resolvedVariant === "skeleton" && icon === void 0 ? void 0 : icon === void 0 ? /* @__PURE__ */ jsx(DefaultLoadingIcon, { className: theme.slots.loadingSpinner }) : icon;
|
|
3959
4024
|
const resolvedAriaLabel = nativeAriaLabel ?? (nativeAriaLabelledBy === void 0 ? loadingMessages.spinner : void 0);
|
|
3960
4025
|
return /* @__PURE__ */ jsxs(
|
|
3961
4026
|
"div",
|
|
@@ -3971,13 +4036,19 @@ var BaseLoadingState = forwardRef(function BaseLoadingState2({
|
|
|
3971
4036
|
"data-monkeys-component": "loading-state",
|
|
3972
4037
|
"data-slot": "root",
|
|
3973
4038
|
"data-state": "loading",
|
|
3974
|
-
|
|
4039
|
+
"data-variant": resolvedVariant,
|
|
4040
|
+
"data-density": statusStates.density,
|
|
4041
|
+
className: cn(theme.slots.stateRoot, densityClassName, classNames?.root, className),
|
|
3975
4042
|
style: {
|
|
3976
4043
|
...theme.styles.stateRoot,
|
|
3977
4044
|
...style
|
|
3978
4045
|
},
|
|
3979
4046
|
children: [
|
|
3980
|
-
|
|
4047
|
+
resolvedVariant === "skeleton" ? /* @__PURE__ */ jsxs("div", { className: "flex w-full max-w-sm flex-col gap-3", "data-slot": "skeleton", children: [
|
|
4048
|
+
/* @__PURE__ */ jsx(BaseSkeleton, { variant: "block", className: "h-20" }),
|
|
4049
|
+
/* @__PURE__ */ jsx(BaseSkeleton, { variant: "line", className: "w-4/5" }),
|
|
4050
|
+
/* @__PURE__ */ jsx(BaseSkeleton, { variant: "line", className: "w-3/5" })
|
|
4051
|
+
] }) : hasRenderableNode(resolvedIcon) ? /* @__PURE__ */ jsx(
|
|
3981
4052
|
"div",
|
|
3982
4053
|
{
|
|
3983
4054
|
"data-slot": "icon",
|
|
@@ -4018,55 +4089,6 @@ var BaseLoadingState = forwardRef(function BaseLoadingState2({
|
|
|
4018
4089
|
}
|
|
4019
4090
|
);
|
|
4020
4091
|
});
|
|
4021
|
-
function BaseNotice({
|
|
4022
|
-
tone,
|
|
4023
|
-
icon,
|
|
4024
|
-
title,
|
|
4025
|
-
description,
|
|
4026
|
-
actions,
|
|
4027
|
-
children,
|
|
4028
|
-
appearance,
|
|
4029
|
-
className,
|
|
4030
|
-
classNames,
|
|
4031
|
-
style,
|
|
4032
|
-
...noticeProps
|
|
4033
|
-
}) {
|
|
4034
|
-
const theme = resolveBaseAppearance(appearance);
|
|
4035
|
-
const resolvedDescription = children ?? description;
|
|
4036
|
-
return /* @__PURE__ */ jsxs(
|
|
4037
|
-
"div",
|
|
4038
|
-
{
|
|
4039
|
-
...noticeProps,
|
|
4040
|
-
className: cn(
|
|
4041
|
-
theme.slots.noticeBase,
|
|
4042
|
-
getBaseNoticeToneClassName(theme, tone),
|
|
4043
|
-
classNames?.root,
|
|
4044
|
-
className
|
|
4045
|
-
),
|
|
4046
|
-
style: {
|
|
4047
|
-
...theme.styles.notice,
|
|
4048
|
-
...style
|
|
4049
|
-
},
|
|
4050
|
-
children: [
|
|
4051
|
-
hasRenderableNode(icon) ? /* @__PURE__ */ jsx("div", { className: cn(theme.slots.noticeIcon, classNames?.icon), children: icon }) : null,
|
|
4052
|
-
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
4053
|
-
hasRenderableNode(title) ? /* @__PURE__ */ jsx("div", { className: cn(theme.slots.noticeTitle, classNames?.title), children: title }) : null,
|
|
4054
|
-
hasRenderableNode(resolvedDescription) ? /* @__PURE__ */ jsx(
|
|
4055
|
-
"div",
|
|
4056
|
-
{
|
|
4057
|
-
className: cn(
|
|
4058
|
-
theme.slots.noticeDescription,
|
|
4059
|
-
classNames?.description
|
|
4060
|
-
),
|
|
4061
|
-
children: resolvedDescription
|
|
4062
|
-
}
|
|
4063
|
-
) : null,
|
|
4064
|
-
hasRenderableNode(actions) ? /* @__PURE__ */ jsx("div", { className: cn(theme.slots.noticeActions, classNames?.actions), children: actions }) : null
|
|
4065
|
-
] })
|
|
4066
|
-
]
|
|
4067
|
-
}
|
|
4068
|
-
);
|
|
4069
|
-
}
|
|
4070
4092
|
var typeaheadResetDelay = 500;
|
|
4071
4093
|
function validateSelectProps({
|
|
4072
4094
|
options,
|
|
@@ -4809,6 +4831,131 @@ function BaseSegmentedControl({
|
|
|
4809
4831
|
}
|
|
4810
4832
|
);
|
|
4811
4833
|
}
|
|
4834
|
+
function SystemStateIcon({ kind }) {
|
|
4835
|
+
const path = {
|
|
4836
|
+
error: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4837
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "9" }),
|
|
4838
|
+
/* @__PURE__ */ jsx("path", { d: "M12 7v6" }),
|
|
4839
|
+
/* @__PURE__ */ jsx("path", { d: "M12 17h.01" })
|
|
4840
|
+
] }),
|
|
4841
|
+
permission: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4842
|
+
/* @__PURE__ */ jsx("rect", { x: "5", y: "10", width: "14", height: "10", rx: "2" }),
|
|
4843
|
+
/* @__PURE__ */ jsx("path", { d: "M8 10V7a4 4 0 0 1 8 0v3" })
|
|
4844
|
+
] }),
|
|
4845
|
+
offline: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4846
|
+
/* @__PURE__ */ jsx("path", { d: "M5 12.5a10 10 0 0 1 14 0" }),
|
|
4847
|
+
/* @__PURE__ */ jsx("path", { d: "M8.5 16a5 5 0 0 1 7 0" }),
|
|
4848
|
+
/* @__PURE__ */ jsx("path", { d: "M12 20h.01" }),
|
|
4849
|
+
/* @__PURE__ */ jsx("path", { d: "m4 4 16 16" })
|
|
4850
|
+
] }),
|
|
4851
|
+
fallback: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4852
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "9" }),
|
|
4853
|
+
/* @__PURE__ */ jsx("path", { d: "M9.5 9a2.5 2.5 0 1 1 4.2 1.8c-1 .8-1.7 1.2-1.7 2.7" }),
|
|
4854
|
+
/* @__PURE__ */ jsx("path", { d: "M12 17h.01" })
|
|
4855
|
+
] })
|
|
4856
|
+
};
|
|
4857
|
+
return /* @__PURE__ */ jsx(
|
|
4858
|
+
"svg",
|
|
4859
|
+
{
|
|
4860
|
+
"aria-hidden": "true",
|
|
4861
|
+
viewBox: "0 0 24 24",
|
|
4862
|
+
className: "h-7 w-7",
|
|
4863
|
+
fill: "none",
|
|
4864
|
+
stroke: "currentColor",
|
|
4865
|
+
strokeLinecap: "round",
|
|
4866
|
+
strokeLinejoin: "round",
|
|
4867
|
+
strokeWidth: "1.8",
|
|
4868
|
+
children: path[kind]
|
|
4869
|
+
}
|
|
4870
|
+
);
|
|
4871
|
+
}
|
|
4872
|
+
var BaseSystemState = forwardRef(
|
|
4873
|
+
function BaseSystemState2({
|
|
4874
|
+
kind = "fallback",
|
|
4875
|
+
icon,
|
|
4876
|
+
title,
|
|
4877
|
+
description,
|
|
4878
|
+
actions,
|
|
4879
|
+
appearance,
|
|
4880
|
+
className,
|
|
4881
|
+
classNames,
|
|
4882
|
+
style,
|
|
4883
|
+
role,
|
|
4884
|
+
"aria-live": ariaLive,
|
|
4885
|
+
...stateProps
|
|
4886
|
+
}, ref) {
|
|
4887
|
+
const resolvedAppearance = useMonkeysBaseAppearance(appearance);
|
|
4888
|
+
const componentAttributes = useMonkeysComponentAttributes();
|
|
4889
|
+
const statusStates = useMonkeysStatusStates();
|
|
4890
|
+
const densityClassName = statusStates.density === "compact" ? "min-h-0 px-3 py-3" : statusStates.density === "comfortable" ? "min-h-56 px-8 py-12" : void 0;
|
|
4891
|
+
const theme = resolveBaseAppearance(resolvedAppearance);
|
|
4892
|
+
const resolvedIcon = icon === void 0 ? /* @__PURE__ */ jsx(SystemStateIcon, { kind }) : icon;
|
|
4893
|
+
const resolvedRole = role ?? (kind === "error" || kind === "offline" ? "alert" : "status");
|
|
4894
|
+
return /* @__PURE__ */ jsxs(
|
|
4895
|
+
"div",
|
|
4896
|
+
{
|
|
4897
|
+
...componentAttributes,
|
|
4898
|
+
...stateProps,
|
|
4899
|
+
ref,
|
|
4900
|
+
role: resolvedRole,
|
|
4901
|
+
"aria-live": ariaLive ?? (resolvedRole === "alert" ? "assertive" : "polite"),
|
|
4902
|
+
"data-monkeys-component": "system-state",
|
|
4903
|
+
"data-slot": "root",
|
|
4904
|
+
"data-state": kind,
|
|
4905
|
+
"data-density": statusStates.density,
|
|
4906
|
+
className: cn(
|
|
4907
|
+
theme.slots.stateRoot,
|
|
4908
|
+
densityClassName,
|
|
4909
|
+
classNames?.root,
|
|
4910
|
+
className
|
|
4911
|
+
),
|
|
4912
|
+
style: { ...theme.styles.stateRoot, ...style },
|
|
4913
|
+
children: [
|
|
4914
|
+
hasRenderableNode(resolvedIcon) ? /* @__PURE__ */ jsx(
|
|
4915
|
+
"div",
|
|
4916
|
+
{
|
|
4917
|
+
"data-slot": "icon",
|
|
4918
|
+
"data-state": kind,
|
|
4919
|
+
className: cn(theme.slots.stateIcon, classNames?.icon),
|
|
4920
|
+
style: theme.styles.stateIcon,
|
|
4921
|
+
children: resolvedIcon
|
|
4922
|
+
}
|
|
4923
|
+
) : null,
|
|
4924
|
+
hasRenderableNode(title) ? /* @__PURE__ */ jsx(
|
|
4925
|
+
"div",
|
|
4926
|
+
{
|
|
4927
|
+
"data-slot": "title",
|
|
4928
|
+
"data-state": kind,
|
|
4929
|
+
className: cn(theme.slots.stateTitle, classNames?.title),
|
|
4930
|
+
children: title
|
|
4931
|
+
}
|
|
4932
|
+
) : null,
|
|
4933
|
+
hasRenderableNode(description) ? /* @__PURE__ */ jsx(
|
|
4934
|
+
"div",
|
|
4935
|
+
{
|
|
4936
|
+
"data-slot": "description",
|
|
4937
|
+
"data-state": kind,
|
|
4938
|
+
className: cn(
|
|
4939
|
+
theme.slots.stateDescription,
|
|
4940
|
+
classNames?.description
|
|
4941
|
+
),
|
|
4942
|
+
children: description
|
|
4943
|
+
}
|
|
4944
|
+
) : null,
|
|
4945
|
+
hasRenderableNode(actions) ? /* @__PURE__ */ jsx(
|
|
4946
|
+
"div",
|
|
4947
|
+
{
|
|
4948
|
+
"data-slot": "actions",
|
|
4949
|
+
"data-state": kind,
|
|
4950
|
+
className: cn(theme.slots.stateActions, classNames?.actions),
|
|
4951
|
+
children: actions
|
|
4952
|
+
}
|
|
4953
|
+
) : null
|
|
4954
|
+
]
|
|
4955
|
+
}
|
|
4956
|
+
);
|
|
4957
|
+
}
|
|
4958
|
+
);
|
|
4812
4959
|
var DATA_TRANSFER_COLUMN_TYPE = "application/x-monkeys-base-table-column";
|
|
4813
4960
|
var COLUMN_RESIZE_KEYBOARD_STEP = 8;
|
|
4814
4961
|
function assignRef2(ref, value) {
|
|
@@ -8786,6 +8933,7 @@ function WorkbenchCollection({
|
|
|
8786
8933
|
}) {
|
|
8787
8934
|
const componentAttributes = useMonkeysComponentAttributes();
|
|
8788
8935
|
const localeMessages = useMonkeysLocaleMessages().workbench.collection;
|
|
8936
|
+
const statusStates = useMonkeysStatusStates();
|
|
8789
8937
|
const componentId = useId().replace(/:/g, "");
|
|
8790
8938
|
const rootRef = useRef(null);
|
|
8791
8939
|
const itemsRef = useRef(null);
|
|
@@ -8876,7 +9024,10 @@ function WorkbenchCollection({
|
|
|
8876
9024
|
loadError: config.labels?.loadError ?? localeMessages.loadError,
|
|
8877
9025
|
refreshError: config.labels?.refreshError ?? localeMessages.refreshError,
|
|
8878
9026
|
retry: config.labels?.retry ?? localeMessages.retry,
|
|
8879
|
-
loadingMore: config.labels?.loadingMore ?? localeMessages.loadingMore
|
|
9027
|
+
loadingMore: config.labels?.loadingMore ?? localeMessages.loadingMore,
|
|
9028
|
+
permission: config.labels?.permission ?? localeMessages.permission,
|
|
9029
|
+
offline: config.labels?.offline ?? localeMessages.offline,
|
|
9030
|
+
requestAccess: config.labels?.requestAccess ?? localeMessages.requestAccess
|
|
8880
9031
|
}), [config.labels, localeMessages]);
|
|
8881
9032
|
const virtualizationError = useMemo(() => {
|
|
8882
9033
|
const virtualization = config.virtualization;
|
|
@@ -9324,11 +9475,15 @@ function WorkbenchCollection({
|
|
|
9324
9475
|
const selectionToolbar = selectedKeys.size > 0 ? resolveRenderableSlot(slots?.selectionToolbar, slotContext) : null;
|
|
9325
9476
|
const beforeItems = resolveRenderableSlot(slots?.beforeItems, slotContext);
|
|
9326
9477
|
const footer = resolveRenderableSlot(slots?.footer, slotContext);
|
|
9327
|
-
const
|
|
9328
|
-
const
|
|
9329
|
-
const
|
|
9478
|
+
const showPermission = state?.permission === true;
|
|
9479
|
+
const showOffline = state?.offline === true && !showPermission;
|
|
9480
|
+
const showInitialLoading = loading && items.length === 0 && !showPermission && !showOffline;
|
|
9481
|
+
const showInitialError = Boolean(effectiveError) && items.length === 0 && !showPermission && !showOffline && !showInitialLoading;
|
|
9482
|
+
const showEmpty = !showPermission && !showOffline && !showInitialLoading && !showInitialError && (state?.empty === true || items.length === 0);
|
|
9330
9483
|
const loadingSlot = resolveRenderableSlot(slots?.loading, slotContext);
|
|
9331
9484
|
const errorSlot = resolveRenderableSlot(slots?.error, slotContext);
|
|
9485
|
+
const permissionSlot = resolveRenderableSlot(slots?.permission, slotContext);
|
|
9486
|
+
const offlineSlot = resolveRenderableSlot(slots?.offline, slotContext);
|
|
9332
9487
|
const emptySlot = resolveRenderableSlot(slots?.empty, slotContext);
|
|
9333
9488
|
const loadMoreSlot = resolveRenderableSlot(slots?.loadMore, slotContext);
|
|
9334
9489
|
const selfScrollable = config.layout.scrollOwner === "self" || config.layout.scrollOwner === void 0 && (config.layout.fillHeight || config.layout.maxHeight);
|
|
@@ -9359,14 +9514,26 @@ function WorkbenchCollection({
|
|
|
9359
9514
|
hasRenderableNode(toolbar) ? /* @__PURE__ */ jsx("div", { className: classNames?.toolbar, children: toolbar }) : null,
|
|
9360
9515
|
hasRenderableNode(selectionToolbar) ? /* @__PURE__ */ jsx("div", { className: classNames?.selectionToolbar, children: selectionToolbar }) : null,
|
|
9361
9516
|
hasRenderableNode(beforeItems) ? /* @__PURE__ */ jsx("div", { className: classNames?.beforeItems, children: beforeItems }) : null,
|
|
9362
|
-
|
|
9363
|
-
|
|
9517
|
+
showPermission ? hasRenderableNode(permissionSlot) ? permissionSlot : /* @__PURE__ */ jsx(
|
|
9518
|
+
BaseSystemState,
|
|
9519
|
+
{
|
|
9520
|
+
kind: "permission",
|
|
9521
|
+
title: labels.permission,
|
|
9522
|
+
actions: statusStates.permission?.showRequestAccess !== false && callbacks?.onRequestAccess ? /* @__PURE__ */ jsx(BaseButton, { size: "sm", label: labels.requestAccess, onClick: callbacks.onRequestAccess }) : void 0
|
|
9523
|
+
}
|
|
9524
|
+
) : showOffline ? hasRenderableNode(offlineSlot) ? offlineSlot : /* @__PURE__ */ jsx(
|
|
9525
|
+
BaseSystemState,
|
|
9526
|
+
{
|
|
9527
|
+
kind: "offline",
|
|
9528
|
+
title: labels.offline,
|
|
9529
|
+
actions: statusStates.error?.showRetry !== false && callbacks?.onRetry ? /* @__PURE__ */ jsx(BaseButton, { size: "sm", label: labels.retry, onClick: callbacks.onRetry }) : void 0
|
|
9530
|
+
}
|
|
9531
|
+
) : showInitialLoading ? hasRenderableNode(loadingSlot) ? loadingSlot : /* @__PURE__ */ jsx(BaseLoadingState, { title: labels.loading }) : showInitialError ? hasRenderableNode(errorSlot) ? errorSlot : /* @__PURE__ */ jsx(
|
|
9532
|
+
BaseSystemState,
|
|
9364
9533
|
{
|
|
9365
|
-
|
|
9366
|
-
role: "alert",
|
|
9367
|
-
"aria-live": "assertive",
|
|
9534
|
+
kind: "error",
|
|
9368
9535
|
title: labels.loadError,
|
|
9369
|
-
actions: callbacks?.onRetry ? /* @__PURE__ */ jsx(BaseButton, { size: "sm", label: labels.retry, onClick: callbacks.onRetry }) : void 0
|
|
9536
|
+
actions: statusStates.error?.showRetry !== false && callbacks?.onRetry ? /* @__PURE__ */ jsx(BaseButton, { size: "sm", label: labels.retry, onClick: callbacks.onRetry }) : void 0
|
|
9370
9537
|
}
|
|
9371
9538
|
) : showEmpty ? hasRenderableNode(emptySlot) ? emptySlot : /* @__PURE__ */ jsx(BaseEmptyState, { title: labels.empty }) : /* @__PURE__ */ jsx(
|
|
9372
9539
|
"div",
|
|
@@ -9398,12 +9565,11 @@ function WorkbenchCollection({
|
|
|
9398
9565
|
}
|
|
9399
9566
|
),
|
|
9400
9567
|
items.length > 0 && effectiveError ? /* @__PURE__ */ jsx("div", { className: classNames?.status, children: hasRenderableNode(errorSlot) ? errorSlot : /* @__PURE__ */ jsx(
|
|
9401
|
-
|
|
9568
|
+
BaseSystemState,
|
|
9402
9569
|
{
|
|
9403
|
-
|
|
9404
|
-
role: "alert",
|
|
9570
|
+
kind: "error",
|
|
9405
9571
|
title: labels.refreshError,
|
|
9406
|
-
actions: callbacks?.onRetry ? /* @__PURE__ */ jsx(BaseButton, { size: "sm", label: labels.retry, onClick: callbacks.onRetry }) : void 0
|
|
9572
|
+
actions: statusStates.error?.showRetry !== false && callbacks?.onRetry ? /* @__PURE__ */ jsx(BaseButton, { size: "sm", label: labels.retry, onClick: callbacks.onRetry }) : void 0
|
|
9407
9573
|
}
|
|
9408
9574
|
) }) : null,
|
|
9409
9575
|
items.length > 0 && (hasMore || loadingMore) ? /* @__PURE__ */ jsx("div", { ref: loadMoreRef, className: classNames?.loadMore, "data-collection-load-more": "", children: hasRenderableNode(loadMoreSlot) ? loadMoreSlot : loadingMore ? /* @__PURE__ */ jsx(BaseLoadingState, { title: labels.loadingMore }) : null }) : null,
|