@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/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
- if (!titleConfig || visibility === "never") return content;
22930
- const title = titleConfig.getContent?.(entry.item, context) ?? context.renderSlot("title");
22931
- if (!hasRenderableNode(title)) return content;
22932
- const placement = titleConfig.placement ?? "below";
22933
- const overlay2 = placement.startsWith("overlay-");
22934
- const maxLines = normalizeTitleMaxLines(titleConfig.maxLines);
22935
- const surface = titleConfig.surface ?? (overlay2 ? "scrim" : "none");
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.align === "center" && "text-center",
22945
- titleConfig.align === "end" && "text-right",
22946
- visibility === "hover" && "opacity-0 transition-opacity group-hover/workbench-collection-item:opacity-100 group-focus-within/workbench-collection-item:opacity-100",
22947
- overlay2 && "pointer-events-none absolute inset-x-0 z-10 px-3 py-2",
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", overlay2 && "relative", classNames?.itemContent),
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" || overlay2 ? titleNode : null
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?.title, renderItem]);
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);