@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.mjs
CHANGED
|
@@ -22891,14 +22891,13 @@ function WorkbenchCollection({
|
|
|
22891
22891
|
const content = renderItem(entry.item, context);
|
|
22892
22892
|
const titleConfig = config.item?.title;
|
|
22893
22893
|
const visibility = titleConfig?.visibility ?? "always";
|
|
22894
|
-
|
|
22895
|
-
const
|
|
22896
|
-
|
|
22897
|
-
const
|
|
22898
|
-
const
|
|
22899
|
-
const
|
|
22900
|
-
const
|
|
22901
|
-
const titleNode = /* @__PURE__ */ jsx(
|
|
22894
|
+
const title = titleConfig && visibility !== "never" ? titleConfig.getContent?.(entry.item, context) ?? context.renderSlot("title") : null;
|
|
22895
|
+
const hasTitle = Boolean(titleConfig && hasRenderableNode(title));
|
|
22896
|
+
const placement = titleConfig?.placement ?? "below";
|
|
22897
|
+
const titleOverlay = hasTitle && placement.startsWith("overlay-");
|
|
22898
|
+
const maxLines = normalizeTitleMaxLines(titleConfig?.maxLines);
|
|
22899
|
+
const surface = titleConfig?.surface ?? (titleOverlay ? "scrim" : "none");
|
|
22900
|
+
const titleNode = hasTitle ? /* @__PURE__ */ jsx(
|
|
22902
22901
|
"div",
|
|
22903
22902
|
{
|
|
22904
22903
|
"data-collection-item-title": "",
|
|
@@ -22906,10 +22905,10 @@ function WorkbenchCollection({
|
|
|
22906
22905
|
"data-title-visibility": visibility,
|
|
22907
22906
|
className: cn(
|
|
22908
22907
|
"min-w-0 px-1 py-2 text-sm font-medium text-foreground",
|
|
22909
|
-
titleConfig
|
|
22910
|
-
titleConfig
|
|
22911
|
-
visibility === "hover" && "opacity-0 transition-opacity group-hover/workbench-collection-item
|
|
22912
|
-
|
|
22908
|
+
titleConfig?.align === "center" && "text-center",
|
|
22909
|
+
titleConfig?.align === "end" && "text-right",
|
|
22910
|
+
visibility === "hover" && "!opacity-0 transition-opacity group-hover/workbench-collection-item:!opacity-100 group-focus-within/workbench-collection-item:!opacity-100",
|
|
22911
|
+
titleOverlay && "pointer-events-none absolute inset-x-0 z-10 px-3 py-2",
|
|
22913
22912
|
placement === "overlay-top" && "top-0",
|
|
22914
22913
|
placement === "overlay-center" && "top-1/2 -translate-y-1/2 motion-reduce:transform-none",
|
|
22915
22914
|
placement === "overlay-bottom" && "bottom-0",
|
|
@@ -22923,20 +22922,51 @@ function WorkbenchCollection({
|
|
|
22923
22922
|
style: maxLines ? { WebkitLineClamp: maxLines } : void 0,
|
|
22924
22923
|
children: title
|
|
22925
22924
|
}
|
|
22926
|
-
);
|
|
22925
|
+
) : null;
|
|
22926
|
+
const actionsConfig = config.item?.actions;
|
|
22927
|
+
const actionsVisibility = actionsConfig?.visibility ?? "always";
|
|
22928
|
+
const actions = actionsConfig && actionsVisibility !== "never" ? context.renderSlot("actions") : null;
|
|
22929
|
+
const hasActions = Boolean(actionsConfig && hasRenderableNode(actions));
|
|
22930
|
+
const actionsPlacement = actionsConfig?.placement ?? "overlay-bottom";
|
|
22931
|
+
const actionsOverlay = hasActions && actionsPlacement.startsWith("overlay-");
|
|
22932
|
+
const actionsNode = hasActions ? /* @__PURE__ */ jsx(
|
|
22933
|
+
"div",
|
|
22934
|
+
{
|
|
22935
|
+
"data-collection-item-actions": "",
|
|
22936
|
+
"data-actions-placement": actionsPlacement,
|
|
22937
|
+
"data-actions-align": actionsConfig?.align ?? "center",
|
|
22938
|
+
"data-actions-visibility": actionsVisibility,
|
|
22939
|
+
className: cn(
|
|
22940
|
+
"flex min-w-0 items-center gap-2 px-2 py-2",
|
|
22941
|
+
actionsConfig?.align === "start" && "justify-start",
|
|
22942
|
+
(actionsConfig?.align === void 0 || actionsConfig.align === "center") && "justify-center",
|
|
22943
|
+
actionsConfig?.align === "end" && "justify-end",
|
|
22944
|
+
actionsConfig?.wrap !== false && "flex-wrap",
|
|
22945
|
+
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",
|
|
22946
|
+
actionsOverlay && "pointer-events-none absolute inset-x-0 z-20",
|
|
22947
|
+
actionsPlacement === "overlay-top" && "top-1",
|
|
22948
|
+
actionsPlacement === "overlay-bottom" && "bottom-1",
|
|
22949
|
+
classNames?.itemActions
|
|
22950
|
+
),
|
|
22951
|
+
children: /* @__PURE__ */ jsx("div", { className: cn("pointer-events-auto flex items-center gap-2", actionsConfig?.wrap !== false && "flex-wrap"), children: actions })
|
|
22952
|
+
}
|
|
22953
|
+
) : null;
|
|
22954
|
+
if (!hasTitle && !hasActions) return content;
|
|
22927
22955
|
return /* @__PURE__ */ jsxs(
|
|
22928
22956
|
"div",
|
|
22929
22957
|
{
|
|
22930
|
-
className: cn("min-w-0",
|
|
22958
|
+
className: cn("min-w-0", (titleOverlay || actionsOverlay) && "relative", classNames?.itemContent),
|
|
22931
22959
|
"data-collection-item-content": "",
|
|
22932
22960
|
children: [
|
|
22933
22961
|
placement === "above" ? titleNode : null,
|
|
22962
|
+
actionsPlacement === "above" ? actionsNode : null,
|
|
22934
22963
|
content,
|
|
22935
|
-
placement === "below" ||
|
|
22964
|
+
placement === "below" || titleOverlay ? titleNode : null,
|
|
22965
|
+
actionsPlacement === "below" || actionsOverlay ? actionsNode : null
|
|
22936
22966
|
]
|
|
22937
22967
|
}
|
|
22938
22968
|
);
|
|
22939
|
-
}, [classNames?.itemContent, classNames?.itemTitle, config.item
|
|
22969
|
+
}, [classNames?.itemActions, classNames?.itemContent, classNames?.itemTitle, config.item, renderItem]);
|
|
22940
22970
|
const renderEntry = useCallback((entry, layout, includeShell = true) => {
|
|
22941
22971
|
const context = createItemContext(entry, layout);
|
|
22942
22972
|
const content = renderItemContent2(entry, context);
|