@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
|
@@ -9114,14 +9114,13 @@ function WorkbenchCollection({
|
|
|
9114
9114
|
const content = renderItem(entry.item, context);
|
|
9115
9115
|
const titleConfig = config.item?.title;
|
|
9116
9116
|
const visibility = titleConfig?.visibility ?? "always";
|
|
9117
|
-
|
|
9118
|
-
const
|
|
9119
|
-
|
|
9120
|
-
const
|
|
9121
|
-
const
|
|
9122
|
-
const
|
|
9123
|
-
const
|
|
9124
|
-
const titleNode = /* @__PURE__ */ jsx(
|
|
9117
|
+
const title = titleConfig && visibility !== "never" ? titleConfig.getContent?.(entry.item, context) ?? context.renderSlot("title") : null;
|
|
9118
|
+
const hasTitle = Boolean(titleConfig && hasRenderableNode(title));
|
|
9119
|
+
const placement = titleConfig?.placement ?? "below";
|
|
9120
|
+
const titleOverlay = hasTitle && placement.startsWith("overlay-");
|
|
9121
|
+
const maxLines = normalizeTitleMaxLines(titleConfig?.maxLines);
|
|
9122
|
+
const surface = titleConfig?.surface ?? (titleOverlay ? "scrim" : "none");
|
|
9123
|
+
const titleNode = hasTitle ? /* @__PURE__ */ jsx(
|
|
9125
9124
|
"div",
|
|
9126
9125
|
{
|
|
9127
9126
|
"data-collection-item-title": "",
|
|
@@ -9129,10 +9128,10 @@ function WorkbenchCollection({
|
|
|
9129
9128
|
"data-title-visibility": visibility,
|
|
9130
9129
|
className: cn(
|
|
9131
9130
|
"min-w-0 px-1 py-2 text-sm font-medium text-foreground",
|
|
9132
|
-
titleConfig
|
|
9133
|
-
titleConfig
|
|
9134
|
-
visibility === "hover" && "opacity-0 transition-opacity group-hover/workbench-collection-item
|
|
9135
|
-
|
|
9131
|
+
titleConfig?.align === "center" && "text-center",
|
|
9132
|
+
titleConfig?.align === "end" && "text-right",
|
|
9133
|
+
visibility === "hover" && "!opacity-0 transition-opacity group-hover/workbench-collection-item:!opacity-100 group-focus-within/workbench-collection-item:!opacity-100",
|
|
9134
|
+
titleOverlay && "pointer-events-none absolute inset-x-0 z-10 px-3 py-2",
|
|
9136
9135
|
placement === "overlay-top" && "top-0",
|
|
9137
9136
|
placement === "overlay-center" && "top-1/2 -translate-y-1/2 motion-reduce:transform-none",
|
|
9138
9137
|
placement === "overlay-bottom" && "bottom-0",
|
|
@@ -9146,20 +9145,51 @@ function WorkbenchCollection({
|
|
|
9146
9145
|
style: maxLines ? { WebkitLineClamp: maxLines } : void 0,
|
|
9147
9146
|
children: title
|
|
9148
9147
|
}
|
|
9149
|
-
);
|
|
9148
|
+
) : null;
|
|
9149
|
+
const actionsConfig = config.item?.actions;
|
|
9150
|
+
const actionsVisibility = actionsConfig?.visibility ?? "always";
|
|
9151
|
+
const actions = actionsConfig && actionsVisibility !== "never" ? context.renderSlot("actions") : null;
|
|
9152
|
+
const hasActions = Boolean(actionsConfig && hasRenderableNode(actions));
|
|
9153
|
+
const actionsPlacement = actionsConfig?.placement ?? "overlay-bottom";
|
|
9154
|
+
const actionsOverlay = hasActions && actionsPlacement.startsWith("overlay-");
|
|
9155
|
+
const actionsNode = hasActions ? /* @__PURE__ */ jsx(
|
|
9156
|
+
"div",
|
|
9157
|
+
{
|
|
9158
|
+
"data-collection-item-actions": "",
|
|
9159
|
+
"data-actions-placement": actionsPlacement,
|
|
9160
|
+
"data-actions-align": actionsConfig?.align ?? "center",
|
|
9161
|
+
"data-actions-visibility": actionsVisibility,
|
|
9162
|
+
className: cn(
|
|
9163
|
+
"flex min-w-0 items-center gap-2 px-2 py-2",
|
|
9164
|
+
actionsConfig?.align === "start" && "justify-start",
|
|
9165
|
+
(actionsConfig?.align === void 0 || actionsConfig.align === "center") && "justify-center",
|
|
9166
|
+
actionsConfig?.align === "end" && "justify-end",
|
|
9167
|
+
actionsConfig?.wrap !== false && "flex-wrap",
|
|
9168
|
+
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",
|
|
9169
|
+
actionsOverlay && "pointer-events-none absolute inset-x-0 z-20",
|
|
9170
|
+
actionsPlacement === "overlay-top" && "top-1",
|
|
9171
|
+
actionsPlacement === "overlay-bottom" && "bottom-1",
|
|
9172
|
+
classNames?.itemActions
|
|
9173
|
+
),
|
|
9174
|
+
children: /* @__PURE__ */ jsx("div", { className: cn("pointer-events-auto flex items-center gap-2", actionsConfig?.wrap !== false && "flex-wrap"), children: actions })
|
|
9175
|
+
}
|
|
9176
|
+
) : null;
|
|
9177
|
+
if (!hasTitle && !hasActions) return content;
|
|
9150
9178
|
return /* @__PURE__ */ jsxs(
|
|
9151
9179
|
"div",
|
|
9152
9180
|
{
|
|
9153
|
-
className: cn("min-w-0",
|
|
9181
|
+
className: cn("min-w-0", (titleOverlay || actionsOverlay) && "relative", classNames?.itemContent),
|
|
9154
9182
|
"data-collection-item-content": "",
|
|
9155
9183
|
children: [
|
|
9156
9184
|
placement === "above" ? titleNode : null,
|
|
9185
|
+
actionsPlacement === "above" ? actionsNode : null,
|
|
9157
9186
|
content,
|
|
9158
|
-
placement === "below" ||
|
|
9187
|
+
placement === "below" || titleOverlay ? titleNode : null,
|
|
9188
|
+
actionsPlacement === "below" || actionsOverlay ? actionsNode : null
|
|
9159
9189
|
]
|
|
9160
9190
|
}
|
|
9161
9191
|
);
|
|
9162
|
-
}, [classNames?.itemContent, classNames?.itemTitle, config.item
|
|
9192
|
+
}, [classNames?.itemActions, classNames?.itemContent, classNames?.itemTitle, config.item, renderItem]);
|
|
9163
9193
|
const renderEntry = useCallback((entry, layout, includeShell = true) => {
|
|
9164
9194
|
const context = createItemContext(entry, layout);
|
|
9165
9195
|
const content = renderItemContent2(entry, context);
|