@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
package/dist/index.js
CHANGED
|
@@ -3079,7 +3079,10 @@ var enUS = {
|
|
|
3079
3079
|
loadError: "Unable to load items",
|
|
3080
3080
|
refreshError: "Unable to refresh items",
|
|
3081
3081
|
retry: "Retry",
|
|
3082
|
-
loadingMore: "Loading more items"
|
|
3082
|
+
loadingMore: "Loading more items",
|
|
3083
|
+
permission: "You do not have permission to view this content",
|
|
3084
|
+
offline: "You appear to be offline",
|
|
3085
|
+
requestAccess: "Request access"
|
|
3083
3086
|
},
|
|
3084
3087
|
interactiveTable: {
|
|
3085
3088
|
columnActions: "Column actions",
|
|
@@ -3359,7 +3362,10 @@ var zhCN = {
|
|
|
3359
3362
|
loadError: "\u65E0\u6CD5\u52A0\u8F7D\u5185\u5BB9",
|
|
3360
3363
|
refreshError: "\u65E0\u6CD5\u5237\u65B0\u5185\u5BB9",
|
|
3361
3364
|
retry: "\u91CD\u8BD5",
|
|
3362
|
-
loadingMore: "\u6B63\u5728\u52A0\u8F7D\u66F4\u591A\u5185\u5BB9"
|
|
3365
|
+
loadingMore: "\u6B63\u5728\u52A0\u8F7D\u66F4\u591A\u5185\u5BB9",
|
|
3366
|
+
permission: "\u4F60\u6CA1\u6709\u6743\u9650\u67E5\u770B\u6B64\u5185\u5BB9",
|
|
3367
|
+
offline: "\u7F51\u7EDC\u8FDE\u63A5\u5DF2\u65AD\u5F00",
|
|
3368
|
+
requestAccess: "\u7533\u8BF7\u6743\u9650"
|
|
3363
3369
|
},
|
|
3364
3370
|
interactiveTable: {
|
|
3365
3371
|
columnActions: "\u5217\u64CD\u4F5C",
|
|
@@ -3856,6 +3862,9 @@ function useMonkeysDataExplorerAppearance(explicit) {
|
|
|
3856
3862
|
[explicit, inherited]
|
|
3857
3863
|
);
|
|
3858
3864
|
}
|
|
3865
|
+
function useMonkeysStatusStates() {
|
|
3866
|
+
return React2.useContext(MonkeysThemeContext).statusStates ?? {};
|
|
3867
|
+
}
|
|
3859
3868
|
function useMonkeysDirection() {
|
|
3860
3869
|
return React2.useContext(MonkeysDirectionContext).direction;
|
|
3861
3870
|
}
|
|
@@ -3941,7 +3950,8 @@ function MonkeysProvider({
|
|
|
3941
3950
|
density,
|
|
3942
3951
|
appearance,
|
|
3943
3952
|
environment,
|
|
3944
|
-
portal
|
|
3953
|
+
portal,
|
|
3954
|
+
statusStates
|
|
3945
3955
|
}) {
|
|
3946
3956
|
const parentLocale = React2.useContext(MonkeysLocaleContext);
|
|
3947
3957
|
const parentTheme = React2.useContext(MonkeysThemeContext);
|
|
@@ -3997,6 +4007,14 @@ function MonkeysProvider({
|
|
|
3997
4007
|
...parentTheme.dataExplorerAppearance?.styles,
|
|
3998
4008
|
...appearance?.dataExplorer?.styles
|
|
3999
4009
|
}
|
|
4010
|
+
},
|
|
4011
|
+
statusStates: {
|
|
4012
|
+
...parentTheme.statusStates,
|
|
4013
|
+
...statusStates,
|
|
4014
|
+
loading: { ...parentTheme.statusStates?.loading, ...statusStates?.loading },
|
|
4015
|
+
empty: { ...parentTheme.statusStates?.empty, ...statusStates?.empty },
|
|
4016
|
+
error: { ...parentTheme.statusStates?.error, ...statusStates?.error },
|
|
4017
|
+
permission: { ...parentTheme.statusStates?.permission, ...statusStates?.permission }
|
|
4000
4018
|
}
|
|
4001
4019
|
}),
|
|
4002
4020
|
[
|
|
@@ -4005,8 +4023,10 @@ function MonkeysProvider({
|
|
|
4005
4023
|
density,
|
|
4006
4024
|
parentTheme.baseAppearance,
|
|
4007
4025
|
parentTheme.dataExplorerAppearance,
|
|
4026
|
+
parentTheme.statusStates,
|
|
4008
4027
|
parentTheme.themeId,
|
|
4009
4028
|
resolvedTheme,
|
|
4029
|
+
statusStates,
|
|
4010
4030
|
themeId
|
|
4011
4031
|
]
|
|
4012
4032
|
);
|
|
@@ -8581,6 +8601,7 @@ var BaseEmptyState = React2.forwardRef(
|
|
|
8581
8601
|
title,
|
|
8582
8602
|
description,
|
|
8583
8603
|
actions,
|
|
8604
|
+
variant,
|
|
8584
8605
|
appearance,
|
|
8585
8606
|
className,
|
|
8586
8607
|
classNames,
|
|
@@ -8589,6 +8610,9 @@ var BaseEmptyState = React2.forwardRef(
|
|
|
8589
8610
|
}, ref) {
|
|
8590
8611
|
const resolvedAppearance = useMonkeysBaseAppearance(appearance);
|
|
8591
8612
|
const componentAttributes = useMonkeysComponentAttributes();
|
|
8613
|
+
const statusStates = useMonkeysStatusStates();
|
|
8614
|
+
const resolvedVariant = variant ?? statusStates.empty?.variant ?? "default";
|
|
8615
|
+
const densityClassName = statusStates.density === "compact" ? "min-h-0 px-3 py-3" : statusStates.density === "comfortable" ? "min-h-56 px-8 py-12" : void 0;
|
|
8592
8616
|
const theme = resolveBaseAppearance(resolvedAppearance);
|
|
8593
8617
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8594
8618
|
"div",
|
|
@@ -8599,7 +8623,15 @@ var BaseEmptyState = React2.forwardRef(
|
|
|
8599
8623
|
"data-monkeys-component": "empty-state",
|
|
8600
8624
|
"data-slot": "root",
|
|
8601
8625
|
"data-state": "empty",
|
|
8602
|
-
|
|
8626
|
+
"data-variant": resolvedVariant,
|
|
8627
|
+
"data-density": statusStates.density,
|
|
8628
|
+
className: cn(
|
|
8629
|
+
theme.slots.stateRoot,
|
|
8630
|
+
densityClassName,
|
|
8631
|
+
resolvedVariant === "compact" && "min-h-0 gap-1 py-3",
|
|
8632
|
+
classNames?.root,
|
|
8633
|
+
className
|
|
8634
|
+
),
|
|
8603
8635
|
style: {
|
|
8604
8636
|
...theme.styles.stateRoot,
|
|
8605
8637
|
...style
|
|
@@ -9976,6 +10008,59 @@ var BaseLayoutSplit = React2.forwardRef(
|
|
|
9976
10008
|
);
|
|
9977
10009
|
}
|
|
9978
10010
|
);
|
|
10011
|
+
var variantClassNames = {
|
|
10012
|
+
line: "h-4 w-full",
|
|
10013
|
+
block: "h-24 w-full",
|
|
10014
|
+
circle: "aspect-square h-10 rounded-full"
|
|
10015
|
+
};
|
|
10016
|
+
var BaseSkeleton = React2.forwardRef(
|
|
10017
|
+
function BaseSkeleton2({
|
|
10018
|
+
variant = "line",
|
|
10019
|
+
animated = true,
|
|
10020
|
+
appearance,
|
|
10021
|
+
className,
|
|
10022
|
+
classNames,
|
|
10023
|
+
style,
|
|
10024
|
+
...skeletonProps
|
|
10025
|
+
}, ref) {
|
|
10026
|
+
if (variant !== "line" && variant !== "block" && variant !== "circle") {
|
|
10027
|
+
throw new TypeError(
|
|
10028
|
+
'BaseSkeleton variant must be "line", "block", or "circle".'
|
|
10029
|
+
);
|
|
10030
|
+
}
|
|
10031
|
+
if (typeof animated !== "boolean") {
|
|
10032
|
+
throw new TypeError("BaseSkeleton animated must be a boolean.");
|
|
10033
|
+
}
|
|
10034
|
+
const resolvedAppearance = useMonkeysBaseAppearance(appearance);
|
|
10035
|
+
const componentAttributes = useMonkeysComponentAttributes();
|
|
10036
|
+
const theme = resolveBaseAppearance(resolvedAppearance);
|
|
10037
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10038
|
+
"div",
|
|
10039
|
+
{
|
|
10040
|
+
...componentAttributes,
|
|
10041
|
+
...skeletonProps,
|
|
10042
|
+
ref,
|
|
10043
|
+
"aria-hidden": "true",
|
|
10044
|
+
"data-monkeys-component": "skeleton",
|
|
10045
|
+
"data-slot": "root",
|
|
10046
|
+
"data-variant": variant,
|
|
10047
|
+
"data-animated": animated,
|
|
10048
|
+
"data-state": animated ? "animated" : "static",
|
|
10049
|
+
className: cn(
|
|
10050
|
+
theme.slots.skeletonRoot,
|
|
10051
|
+
variantClassNames[variant],
|
|
10052
|
+
animated && "motion-safe:animate-pulse motion-reduce:animate-none",
|
|
10053
|
+
classNames?.root,
|
|
10054
|
+
className
|
|
10055
|
+
),
|
|
10056
|
+
style: {
|
|
10057
|
+
...theme.styles.skeleton,
|
|
10058
|
+
...style
|
|
10059
|
+
}
|
|
10060
|
+
}
|
|
10061
|
+
);
|
|
10062
|
+
}
|
|
10063
|
+
);
|
|
9979
10064
|
function DefaultLoadingIcon({ className }) {
|
|
9980
10065
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
9981
10066
|
"svg",
|
|
@@ -10013,6 +10098,7 @@ var BaseLoadingState = React2.forwardRef(function BaseLoadingState2({
|
|
|
10013
10098
|
title,
|
|
10014
10099
|
description,
|
|
10015
10100
|
actions,
|
|
10101
|
+
variant,
|
|
10016
10102
|
appearance,
|
|
10017
10103
|
className,
|
|
10018
10104
|
classNames,
|
|
@@ -10027,8 +10113,11 @@ var BaseLoadingState = React2.forwardRef(function BaseLoadingState2({
|
|
|
10027
10113
|
const resolvedAppearance = useMonkeysBaseAppearance(appearance);
|
|
10028
10114
|
const componentAttributes = useMonkeysComponentAttributes();
|
|
10029
10115
|
const loadingMessages = useMonkeysLocaleMessages().loading;
|
|
10116
|
+
const statusStates = useMonkeysStatusStates();
|
|
10117
|
+
const resolvedVariant = variant ?? statusStates.loading?.variant ?? "spinner";
|
|
10118
|
+
const densityClassName = statusStates.density === "compact" ? "min-h-0 px-3 py-3" : statusStates.density === "comfortable" ? "min-h-56 px-8 py-12" : void 0;
|
|
10030
10119
|
const theme = resolveBaseAppearance(resolvedAppearance);
|
|
10031
|
-
const resolvedIcon = icon === void 0 ? /* @__PURE__ */ jsxRuntime.jsx(DefaultLoadingIcon, { className: theme.slots.loadingSpinner }) : icon;
|
|
10120
|
+
const resolvedIcon = resolvedVariant === "skeleton" && icon === void 0 ? void 0 : icon === void 0 ? /* @__PURE__ */ jsxRuntime.jsx(DefaultLoadingIcon, { className: theme.slots.loadingSpinner }) : icon;
|
|
10032
10121
|
const resolvedAriaLabel = nativeAriaLabel ?? (nativeAriaLabelledBy === void 0 ? loadingMessages.spinner : void 0);
|
|
10033
10122
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10034
10123
|
"div",
|
|
@@ -10044,13 +10133,19 @@ var BaseLoadingState = React2.forwardRef(function BaseLoadingState2({
|
|
|
10044
10133
|
"data-monkeys-component": "loading-state",
|
|
10045
10134
|
"data-slot": "root",
|
|
10046
10135
|
"data-state": "loading",
|
|
10047
|
-
|
|
10136
|
+
"data-variant": resolvedVariant,
|
|
10137
|
+
"data-density": statusStates.density,
|
|
10138
|
+
className: cn(theme.slots.stateRoot, densityClassName, classNames?.root, className),
|
|
10048
10139
|
style: {
|
|
10049
10140
|
...theme.styles.stateRoot,
|
|
10050
10141
|
...style
|
|
10051
10142
|
},
|
|
10052
10143
|
children: [
|
|
10053
|
-
|
|
10144
|
+
resolvedVariant === "skeleton" ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex w-full max-w-sm flex-col gap-3", "data-slot": "skeleton", children: [
|
|
10145
|
+
/* @__PURE__ */ jsxRuntime.jsx(BaseSkeleton, { variant: "block", className: "h-20" }),
|
|
10146
|
+
/* @__PURE__ */ jsxRuntime.jsx(BaseSkeleton, { variant: "line", className: "w-4/5" }),
|
|
10147
|
+
/* @__PURE__ */ jsxRuntime.jsx(BaseSkeleton, { variant: "line", className: "w-3/5" })
|
|
10148
|
+
] }) : hasRenderableNode(resolvedIcon) ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
10054
10149
|
"div",
|
|
10055
10150
|
{
|
|
10056
10151
|
"data-slot": "icon",
|
|
@@ -12947,59 +13042,6 @@ function BaseSegmentedControl({
|
|
|
12947
13042
|
}
|
|
12948
13043
|
);
|
|
12949
13044
|
}
|
|
12950
|
-
var variantClassNames = {
|
|
12951
|
-
line: "h-4 w-full",
|
|
12952
|
-
block: "h-24 w-full",
|
|
12953
|
-
circle: "aspect-square h-10 rounded-full"
|
|
12954
|
-
};
|
|
12955
|
-
var BaseSkeleton = React2.forwardRef(
|
|
12956
|
-
function BaseSkeleton2({
|
|
12957
|
-
variant = "line",
|
|
12958
|
-
animated = true,
|
|
12959
|
-
appearance,
|
|
12960
|
-
className,
|
|
12961
|
-
classNames,
|
|
12962
|
-
style,
|
|
12963
|
-
...skeletonProps
|
|
12964
|
-
}, ref) {
|
|
12965
|
-
if (variant !== "line" && variant !== "block" && variant !== "circle") {
|
|
12966
|
-
throw new TypeError(
|
|
12967
|
-
'BaseSkeleton variant must be "line", "block", or "circle".'
|
|
12968
|
-
);
|
|
12969
|
-
}
|
|
12970
|
-
if (typeof animated !== "boolean") {
|
|
12971
|
-
throw new TypeError("BaseSkeleton animated must be a boolean.");
|
|
12972
|
-
}
|
|
12973
|
-
const resolvedAppearance = useMonkeysBaseAppearance(appearance);
|
|
12974
|
-
const componentAttributes = useMonkeysComponentAttributes();
|
|
12975
|
-
const theme = resolveBaseAppearance(resolvedAppearance);
|
|
12976
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
12977
|
-
"div",
|
|
12978
|
-
{
|
|
12979
|
-
...componentAttributes,
|
|
12980
|
-
...skeletonProps,
|
|
12981
|
-
ref,
|
|
12982
|
-
"aria-hidden": "true",
|
|
12983
|
-
"data-monkeys-component": "skeleton",
|
|
12984
|
-
"data-slot": "root",
|
|
12985
|
-
"data-variant": variant,
|
|
12986
|
-
"data-animated": animated,
|
|
12987
|
-
"data-state": animated ? "animated" : "static",
|
|
12988
|
-
className: cn(
|
|
12989
|
-
theme.slots.skeletonRoot,
|
|
12990
|
-
variantClassNames[variant],
|
|
12991
|
-
animated && "motion-safe:animate-pulse motion-reduce:animate-none",
|
|
12992
|
-
classNames?.root,
|
|
12993
|
-
className
|
|
12994
|
-
),
|
|
12995
|
-
style: {
|
|
12996
|
-
...theme.styles.skeleton,
|
|
12997
|
-
...style
|
|
12998
|
-
}
|
|
12999
|
-
}
|
|
13000
|
-
);
|
|
13001
|
-
}
|
|
13002
|
-
);
|
|
13003
13045
|
var BaseSpinner = React2.forwardRef(
|
|
13004
13046
|
function BaseSpinner2({
|
|
13005
13047
|
decorative = false,
|
|
@@ -13610,6 +13652,131 @@ var BaseSwitch = React2.forwardRef(
|
|
|
13610
13652
|
);
|
|
13611
13653
|
}
|
|
13612
13654
|
);
|
|
13655
|
+
function SystemStateIcon({ kind }) {
|
|
13656
|
+
const path = {
|
|
13657
|
+
error: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
13658
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "12", r: "9" }),
|
|
13659
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 7v6" }),
|
|
13660
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 17h.01" })
|
|
13661
|
+
] }),
|
|
13662
|
+
permission: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
13663
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "5", y: "10", width: "14", height: "10", rx: "2" }),
|
|
13664
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M8 10V7a4 4 0 0 1 8 0v3" })
|
|
13665
|
+
] }),
|
|
13666
|
+
offline: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
13667
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M5 12.5a10 10 0 0 1 14 0" }),
|
|
13668
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M8.5 16a5 5 0 0 1 7 0" }),
|
|
13669
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 20h.01" }),
|
|
13670
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "m4 4 16 16" })
|
|
13671
|
+
] }),
|
|
13672
|
+
fallback: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
13673
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "12", r: "9" }),
|
|
13674
|
+
/* @__PURE__ */ jsxRuntime.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" }),
|
|
13675
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 17h.01" })
|
|
13676
|
+
] })
|
|
13677
|
+
};
|
|
13678
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
13679
|
+
"svg",
|
|
13680
|
+
{
|
|
13681
|
+
"aria-hidden": "true",
|
|
13682
|
+
viewBox: "0 0 24 24",
|
|
13683
|
+
className: "h-7 w-7",
|
|
13684
|
+
fill: "none",
|
|
13685
|
+
stroke: "currentColor",
|
|
13686
|
+
strokeLinecap: "round",
|
|
13687
|
+
strokeLinejoin: "round",
|
|
13688
|
+
strokeWidth: "1.8",
|
|
13689
|
+
children: path[kind]
|
|
13690
|
+
}
|
|
13691
|
+
);
|
|
13692
|
+
}
|
|
13693
|
+
var BaseSystemState = React2.forwardRef(
|
|
13694
|
+
function BaseSystemState2({
|
|
13695
|
+
kind = "fallback",
|
|
13696
|
+
icon,
|
|
13697
|
+
title,
|
|
13698
|
+
description,
|
|
13699
|
+
actions,
|
|
13700
|
+
appearance,
|
|
13701
|
+
className,
|
|
13702
|
+
classNames,
|
|
13703
|
+
style,
|
|
13704
|
+
role,
|
|
13705
|
+
"aria-live": ariaLive,
|
|
13706
|
+
...stateProps
|
|
13707
|
+
}, ref) {
|
|
13708
|
+
const resolvedAppearance = useMonkeysBaseAppearance(appearance);
|
|
13709
|
+
const componentAttributes = useMonkeysComponentAttributes();
|
|
13710
|
+
const statusStates = useMonkeysStatusStates();
|
|
13711
|
+
const densityClassName = statusStates.density === "compact" ? "min-h-0 px-3 py-3" : statusStates.density === "comfortable" ? "min-h-56 px-8 py-12" : void 0;
|
|
13712
|
+
const theme = resolveBaseAppearance(resolvedAppearance);
|
|
13713
|
+
const resolvedIcon = icon === void 0 ? /* @__PURE__ */ jsxRuntime.jsx(SystemStateIcon, { kind }) : icon;
|
|
13714
|
+
const resolvedRole = role ?? (kind === "error" || kind === "offline" ? "alert" : "status");
|
|
13715
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
13716
|
+
"div",
|
|
13717
|
+
{
|
|
13718
|
+
...componentAttributes,
|
|
13719
|
+
...stateProps,
|
|
13720
|
+
ref,
|
|
13721
|
+
role: resolvedRole,
|
|
13722
|
+
"aria-live": ariaLive ?? (resolvedRole === "alert" ? "assertive" : "polite"),
|
|
13723
|
+
"data-monkeys-component": "system-state",
|
|
13724
|
+
"data-slot": "root",
|
|
13725
|
+
"data-state": kind,
|
|
13726
|
+
"data-density": statusStates.density,
|
|
13727
|
+
className: cn(
|
|
13728
|
+
theme.slots.stateRoot,
|
|
13729
|
+
densityClassName,
|
|
13730
|
+
classNames?.root,
|
|
13731
|
+
className
|
|
13732
|
+
),
|
|
13733
|
+
style: { ...theme.styles.stateRoot, ...style },
|
|
13734
|
+
children: [
|
|
13735
|
+
hasRenderableNode(resolvedIcon) ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
13736
|
+
"div",
|
|
13737
|
+
{
|
|
13738
|
+
"data-slot": "icon",
|
|
13739
|
+
"data-state": kind,
|
|
13740
|
+
className: cn(theme.slots.stateIcon, classNames?.icon),
|
|
13741
|
+
style: theme.styles.stateIcon,
|
|
13742
|
+
children: resolvedIcon
|
|
13743
|
+
}
|
|
13744
|
+
) : null,
|
|
13745
|
+
hasRenderableNode(title) ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
13746
|
+
"div",
|
|
13747
|
+
{
|
|
13748
|
+
"data-slot": "title",
|
|
13749
|
+
"data-state": kind,
|
|
13750
|
+
className: cn(theme.slots.stateTitle, classNames?.title),
|
|
13751
|
+
children: title
|
|
13752
|
+
}
|
|
13753
|
+
) : null,
|
|
13754
|
+
hasRenderableNode(description) ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
13755
|
+
"div",
|
|
13756
|
+
{
|
|
13757
|
+
"data-slot": "description",
|
|
13758
|
+
"data-state": kind,
|
|
13759
|
+
className: cn(
|
|
13760
|
+
theme.slots.stateDescription,
|
|
13761
|
+
classNames?.description
|
|
13762
|
+
),
|
|
13763
|
+
children: description
|
|
13764
|
+
}
|
|
13765
|
+
) : null,
|
|
13766
|
+
hasRenderableNode(actions) ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
13767
|
+
"div",
|
|
13768
|
+
{
|
|
13769
|
+
"data-slot": "actions",
|
|
13770
|
+
"data-state": kind,
|
|
13771
|
+
className: cn(theme.slots.stateActions, classNames?.actions),
|
|
13772
|
+
children: actions
|
|
13773
|
+
}
|
|
13774
|
+
) : null
|
|
13775
|
+
]
|
|
13776
|
+
}
|
|
13777
|
+
);
|
|
13778
|
+
}
|
|
13779
|
+
);
|
|
13613
13780
|
var DATA_TRANSFER_COLUMN_TYPE = "application/x-monkeys-base-table-column";
|
|
13614
13781
|
var COLUMN_RESIZE_KEYBOARD_STEP = 8;
|
|
13615
13782
|
function assignRef2(ref, value) {
|
|
@@ -22598,6 +22765,7 @@ function WorkbenchCollection({
|
|
|
22598
22765
|
}) {
|
|
22599
22766
|
const componentAttributes = useMonkeysComponentAttributes();
|
|
22600
22767
|
const localeMessages = useMonkeysLocaleMessages().workbench.collection;
|
|
22768
|
+
const statusStates = useMonkeysStatusStates();
|
|
22601
22769
|
const componentId = React2.useId().replace(/:/g, "");
|
|
22602
22770
|
const rootRef = React2.useRef(null);
|
|
22603
22771
|
const itemsRef = React2.useRef(null);
|
|
@@ -22688,7 +22856,10 @@ function WorkbenchCollection({
|
|
|
22688
22856
|
loadError: config.labels?.loadError ?? localeMessages.loadError,
|
|
22689
22857
|
refreshError: config.labels?.refreshError ?? localeMessages.refreshError,
|
|
22690
22858
|
retry: config.labels?.retry ?? localeMessages.retry,
|
|
22691
|
-
loadingMore: config.labels?.loadingMore ?? localeMessages.loadingMore
|
|
22859
|
+
loadingMore: config.labels?.loadingMore ?? localeMessages.loadingMore,
|
|
22860
|
+
permission: config.labels?.permission ?? localeMessages.permission,
|
|
22861
|
+
offline: config.labels?.offline ?? localeMessages.offline,
|
|
22862
|
+
requestAccess: config.labels?.requestAccess ?? localeMessages.requestAccess
|
|
22692
22863
|
}), [config.labels, localeMessages]);
|
|
22693
22864
|
const virtualizationError = React2.useMemo(() => {
|
|
22694
22865
|
const virtualization = config.virtualization;
|
|
@@ -23136,11 +23307,15 @@ function WorkbenchCollection({
|
|
|
23136
23307
|
const selectionToolbar = selectedKeys.size > 0 ? resolveRenderableSlot(slots?.selectionToolbar, slotContext) : null;
|
|
23137
23308
|
const beforeItems = resolveRenderableSlot(slots?.beforeItems, slotContext);
|
|
23138
23309
|
const footer = resolveRenderableSlot(slots?.footer, slotContext);
|
|
23139
|
-
const
|
|
23140
|
-
const
|
|
23141
|
-
const
|
|
23310
|
+
const showPermission = state?.permission === true;
|
|
23311
|
+
const showOffline = state?.offline === true && !showPermission;
|
|
23312
|
+
const showInitialLoading = loading && items.length === 0 && !showPermission && !showOffline;
|
|
23313
|
+
const showInitialError = Boolean(effectiveError) && items.length === 0 && !showPermission && !showOffline && !showInitialLoading;
|
|
23314
|
+
const showEmpty = !showPermission && !showOffline && !showInitialLoading && !showInitialError && (state?.empty === true || items.length === 0);
|
|
23142
23315
|
const loadingSlot = resolveRenderableSlot(slots?.loading, slotContext);
|
|
23143
23316
|
const errorSlot = resolveRenderableSlot(slots?.error, slotContext);
|
|
23317
|
+
const permissionSlot = resolveRenderableSlot(slots?.permission, slotContext);
|
|
23318
|
+
const offlineSlot = resolveRenderableSlot(slots?.offline, slotContext);
|
|
23144
23319
|
const emptySlot = resolveRenderableSlot(slots?.empty, slotContext);
|
|
23145
23320
|
const loadMoreSlot = resolveRenderableSlot(slots?.loadMore, slotContext);
|
|
23146
23321
|
const selfScrollable = config.layout.scrollOwner === "self" || config.layout.scrollOwner === void 0 && (config.layout.fillHeight || config.layout.maxHeight);
|
|
@@ -23171,14 +23346,26 @@ function WorkbenchCollection({
|
|
|
23171
23346
|
hasRenderableNode(toolbar) ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: classNames?.toolbar, children: toolbar }) : null,
|
|
23172
23347
|
hasRenderableNode(selectionToolbar) ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: classNames?.selectionToolbar, children: selectionToolbar }) : null,
|
|
23173
23348
|
hasRenderableNode(beforeItems) ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: classNames?.beforeItems, children: beforeItems }) : null,
|
|
23174
|
-
|
|
23175
|
-
|
|
23349
|
+
showPermission ? hasRenderableNode(permissionSlot) ? permissionSlot : /* @__PURE__ */ jsxRuntime.jsx(
|
|
23350
|
+
BaseSystemState,
|
|
23351
|
+
{
|
|
23352
|
+
kind: "permission",
|
|
23353
|
+
title: labels.permission,
|
|
23354
|
+
actions: statusStates.permission?.showRequestAccess !== false && callbacks?.onRequestAccess ? /* @__PURE__ */ jsxRuntime.jsx(BaseButton, { size: "sm", label: labels.requestAccess, onClick: callbacks.onRequestAccess }) : void 0
|
|
23355
|
+
}
|
|
23356
|
+
) : showOffline ? hasRenderableNode(offlineSlot) ? offlineSlot : /* @__PURE__ */ jsxRuntime.jsx(
|
|
23357
|
+
BaseSystemState,
|
|
23358
|
+
{
|
|
23359
|
+
kind: "offline",
|
|
23360
|
+
title: labels.offline,
|
|
23361
|
+
actions: statusStates.error?.showRetry !== false && callbacks?.onRetry ? /* @__PURE__ */ jsxRuntime.jsx(BaseButton, { size: "sm", label: labels.retry, onClick: callbacks.onRetry }) : void 0
|
|
23362
|
+
}
|
|
23363
|
+
) : showInitialLoading ? hasRenderableNode(loadingSlot) ? loadingSlot : /* @__PURE__ */ jsxRuntime.jsx(BaseLoadingState, { title: labels.loading }) : showInitialError ? hasRenderableNode(errorSlot) ? errorSlot : /* @__PURE__ */ jsxRuntime.jsx(
|
|
23364
|
+
BaseSystemState,
|
|
23176
23365
|
{
|
|
23177
|
-
|
|
23178
|
-
role: "alert",
|
|
23179
|
-
"aria-live": "assertive",
|
|
23366
|
+
kind: "error",
|
|
23180
23367
|
title: labels.loadError,
|
|
23181
|
-
actions: callbacks?.onRetry ? /* @__PURE__ */ jsxRuntime.jsx(BaseButton, { size: "sm", label: labels.retry, onClick: callbacks.onRetry }) : void 0
|
|
23368
|
+
actions: statusStates.error?.showRetry !== false && callbacks?.onRetry ? /* @__PURE__ */ jsxRuntime.jsx(BaseButton, { size: "sm", label: labels.retry, onClick: callbacks.onRetry }) : void 0
|
|
23182
23369
|
}
|
|
23183
23370
|
) : showEmpty ? hasRenderableNode(emptySlot) ? emptySlot : /* @__PURE__ */ jsxRuntime.jsx(BaseEmptyState, { title: labels.empty }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
23184
23371
|
"div",
|
|
@@ -23210,12 +23397,11 @@ function WorkbenchCollection({
|
|
|
23210
23397
|
}
|
|
23211
23398
|
),
|
|
23212
23399
|
items.length > 0 && effectiveError ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: classNames?.status, children: hasRenderableNode(errorSlot) ? errorSlot : /* @__PURE__ */ jsxRuntime.jsx(
|
|
23213
|
-
|
|
23400
|
+
BaseSystemState,
|
|
23214
23401
|
{
|
|
23215
|
-
|
|
23216
|
-
role: "alert",
|
|
23402
|
+
kind: "error",
|
|
23217
23403
|
title: labels.refreshError,
|
|
23218
|
-
actions: callbacks?.onRetry ? /* @__PURE__ */ jsxRuntime.jsx(BaseButton, { size: "sm", label: labels.retry, onClick: callbacks.onRetry }) : void 0
|
|
23404
|
+
actions: statusStates.error?.showRetry !== false && callbacks?.onRetry ? /* @__PURE__ */ jsxRuntime.jsx(BaseButton, { size: "sm", label: labels.retry, onClick: callbacks.onRetry }) : void 0
|
|
23219
23405
|
}
|
|
23220
23406
|
) }) : null,
|
|
23221
23407
|
items.length > 0 && (hasMore || loadingMore) ? /* @__PURE__ */ jsxRuntime.jsx("div", { ref: loadMoreRef, className: classNames?.loadMore, "data-collection-load-more": "", children: hasRenderableNode(loadMoreSlot) ? loadMoreSlot : loadingMore ? /* @__PURE__ */ jsxRuntime.jsx(BaseLoadingState, { title: labels.loadingMore }) : null }) : null,
|
|
@@ -30624,6 +30810,7 @@ exports.BaseSpinner = BaseSpinner;
|
|
|
30624
30810
|
exports.BaseStack = BaseStack;
|
|
30625
30811
|
exports.BaseSteps = BaseSteps;
|
|
30626
30812
|
exports.BaseSwitch = BaseSwitch;
|
|
30813
|
+
exports.BaseSystemState = BaseSystemState;
|
|
30627
30814
|
exports.BaseTable = BaseTable;
|
|
30628
30815
|
exports.BaseTableBody = BaseTableBody;
|
|
30629
30816
|
exports.BaseTableCaption = BaseTableCaption;
|
|
@@ -30757,6 +30944,7 @@ exports.useMonkeysLocale = useMonkeysLocale;
|
|
|
30757
30944
|
exports.useMonkeysLocaleMessages = useMonkeysLocaleMessages;
|
|
30758
30945
|
exports.useMonkeysPortalOptions = useMonkeysPortalOptions;
|
|
30759
30946
|
exports.useMonkeysResolvedTheme = useMonkeysResolvedTheme;
|
|
30947
|
+
exports.useMonkeysStatusStates = useMonkeysStatusStates;
|
|
30760
30948
|
exports.useToastFeed = useToastFeed;
|
|
30761
30949
|
exports.useToastOnValue = useToastOnValue;
|
|
30762
30950
|
exports.zhCN = zhCN;
|