@inf-monkeys-tech/monkeys-design 1.0.41 → 1.0.42
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/components/workbench/index.d.mts +13 -2
- package/dist/components/workbench/index.d.ts +13 -2
- package/dist/components/workbench/index.js +46 -16
- package/dist/components/workbench/index.js.map +1 -1
- package/dist/components/workbench/index.mjs +46 -16
- package/dist/components/workbench/index.mjs.map +1 -1
- package/dist/index.js +46 -16
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +46 -16
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -22926,14 +22926,13 @@ function WorkbenchCollection({
|
|
|
22926
22926
|
const content = renderItem(entry.item, context);
|
|
22927
22927
|
const titleConfig = config.item?.title;
|
|
22928
22928
|
const visibility = titleConfig?.visibility ?? "always";
|
|
22929
|
-
|
|
22930
|
-
const
|
|
22931
|
-
|
|
22932
|
-
const
|
|
22933
|
-
const
|
|
22934
|
-
const
|
|
22935
|
-
const
|
|
22936
|
-
const titleNode = /* @__PURE__ */ jsxRuntime.jsx(
|
|
22929
|
+
const title = titleConfig && visibility !== "never" ? titleConfig.getContent?.(entry.item, context) ?? context.renderSlot("title") : null;
|
|
22930
|
+
const hasTitle = Boolean(titleConfig && hasRenderableNode(title));
|
|
22931
|
+
const placement = titleConfig?.placement ?? "below";
|
|
22932
|
+
const titleOverlay = hasTitle && placement.startsWith("overlay-");
|
|
22933
|
+
const maxLines = normalizeTitleMaxLines(titleConfig?.maxLines);
|
|
22934
|
+
const surface = titleConfig?.surface ?? (titleOverlay ? "scrim" : "none");
|
|
22935
|
+
const titleNode = hasTitle ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
22937
22936
|
"div",
|
|
22938
22937
|
{
|
|
22939
22938
|
"data-collection-item-title": "",
|
|
@@ -22941,10 +22940,10 @@ function WorkbenchCollection({
|
|
|
22941
22940
|
"data-title-visibility": visibility,
|
|
22942
22941
|
className: cn(
|
|
22943
22942
|
"min-w-0 px-1 py-2 text-sm font-medium text-foreground",
|
|
22944
|
-
titleConfig
|
|
22945
|
-
titleConfig
|
|
22946
|
-
visibility === "hover" && "opacity-0 transition-opacity group-hover/workbench-collection-item
|
|
22947
|
-
|
|
22943
|
+
titleConfig?.align === "center" && "text-center",
|
|
22944
|
+
titleConfig?.align === "end" && "text-right",
|
|
22945
|
+
visibility === "hover" && "!opacity-0 transition-opacity group-hover/workbench-collection-item:!opacity-100 group-focus-within/workbench-collection-item:!opacity-100",
|
|
22946
|
+
titleOverlay && "pointer-events-none absolute inset-x-0 z-10 px-3 py-2",
|
|
22948
22947
|
placement === "overlay-top" && "top-0",
|
|
22949
22948
|
placement === "overlay-center" && "top-1/2 -translate-y-1/2 motion-reduce:transform-none",
|
|
22950
22949
|
placement === "overlay-bottom" && "bottom-0",
|
|
@@ -22958,20 +22957,51 @@ function WorkbenchCollection({
|
|
|
22958
22957
|
style: maxLines ? { WebkitLineClamp: maxLines } : void 0,
|
|
22959
22958
|
children: title
|
|
22960
22959
|
}
|
|
22961
|
-
);
|
|
22960
|
+
) : null;
|
|
22961
|
+
const actionsConfig = config.item?.actions;
|
|
22962
|
+
const actionsVisibility = actionsConfig?.visibility ?? "always";
|
|
22963
|
+
const actions = actionsConfig && actionsVisibility !== "never" ? context.renderSlot("actions") : null;
|
|
22964
|
+
const hasActions = Boolean(actionsConfig && hasRenderableNode(actions));
|
|
22965
|
+
const actionsPlacement = actionsConfig?.placement ?? "overlay-bottom";
|
|
22966
|
+
const actionsOverlay = hasActions && actionsPlacement.startsWith("overlay-");
|
|
22967
|
+
const actionsNode = hasActions ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
22968
|
+
"div",
|
|
22969
|
+
{
|
|
22970
|
+
"data-collection-item-actions": "",
|
|
22971
|
+
"data-actions-placement": actionsPlacement,
|
|
22972
|
+
"data-actions-align": actionsConfig?.align ?? "center",
|
|
22973
|
+
"data-actions-visibility": actionsVisibility,
|
|
22974
|
+
className: cn(
|
|
22975
|
+
"flex min-w-0 items-center gap-2 px-2 py-2",
|
|
22976
|
+
actionsConfig?.align === "start" && "justify-start",
|
|
22977
|
+
(actionsConfig?.align === void 0 || actionsConfig.align === "center") && "justify-center",
|
|
22978
|
+
actionsConfig?.align === "end" && "justify-end",
|
|
22979
|
+
actionsConfig?.wrap !== false && "flex-wrap",
|
|
22980
|
+
actionsVisibility === "hover" && "!opacity-0 transition-opacity group-hover/workbench-collection-item:!opacity-100 group-focus-within/workbench-collection-item:!opacity-100 [@media(hover:none)]:!opacity-100",
|
|
22981
|
+
actionsOverlay && "pointer-events-none absolute inset-x-0 z-20",
|
|
22982
|
+
actionsPlacement === "overlay-top" && "top-1",
|
|
22983
|
+
actionsPlacement === "overlay-bottom" && "bottom-1",
|
|
22984
|
+
classNames?.itemActions
|
|
22985
|
+
),
|
|
22986
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("pointer-events-auto flex items-center gap-2", actionsConfig?.wrap !== false && "flex-wrap"), children: actions })
|
|
22987
|
+
}
|
|
22988
|
+
) : null;
|
|
22989
|
+
if (!hasTitle && !hasActions) return content;
|
|
22962
22990
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
22963
22991
|
"div",
|
|
22964
22992
|
{
|
|
22965
|
-
className: cn("min-w-0",
|
|
22993
|
+
className: cn("min-w-0", (titleOverlay || actionsOverlay) && "relative", classNames?.itemContent),
|
|
22966
22994
|
"data-collection-item-content": "",
|
|
22967
22995
|
children: [
|
|
22968
22996
|
placement === "above" ? titleNode : null,
|
|
22997
|
+
actionsPlacement === "above" ? actionsNode : null,
|
|
22969
22998
|
content,
|
|
22970
|
-
placement === "below" ||
|
|
22999
|
+
placement === "below" || titleOverlay ? titleNode : null,
|
|
23000
|
+
actionsPlacement === "below" || actionsOverlay ? actionsNode : null
|
|
22971
23001
|
]
|
|
22972
23002
|
}
|
|
22973
23003
|
);
|
|
22974
|
-
}, [classNames?.itemContent, classNames?.itemTitle, config.item
|
|
23004
|
+
}, [classNames?.itemActions, classNames?.itemContent, classNames?.itemTitle, config.item, renderItem]);
|
|
22975
23005
|
const renderEntry = React2.useCallback((entry, layout, includeShell = true) => {
|
|
22976
23006
|
const context = createItemContext(entry, layout);
|
|
22977
23007
|
const content = renderItemContent2(entry, context);
|