@sustaina/shared-ui 1.67.0 → 1.67.1

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.mjs CHANGED
@@ -3429,6 +3429,7 @@ var AuditFooter = ({
3429
3429
  updatedBy,
3430
3430
  onDelete,
3431
3431
  canDelete = true,
3432
+ canDeleteBehavior,
3432
3433
  emptyValue = "-",
3433
3434
  labels,
3434
3435
  classNames,
@@ -3449,6 +3450,9 @@ var AuditFooter = ({
3449
3450
  const timeFormatter = formatters?.time ?? ((value) => formatISODate(value, "H:i:s"));
3450
3451
  const userFormatter = formatters?.user ?? ((value) => value ?? emptyValue);
3451
3452
  const resolvedDeleteIcon = deleteIcon ?? /* @__PURE__ */ jsx(TrashIcon, { className: "w-5 h-5" });
3453
+ const resolvedCanDeleteBehavior = canDeleteBehavior ?? "hidden";
3454
+ const shouldShowDelete = canDelete || resolvedCanDeleteBehavior === "disabled";
3455
+ const deleteButtonClassName = canDelete ? cn("w-5 h-5 cursor-pointer text-red-500", classNames?.deleteButton) : cn("w-5 h-5 text-gray-300 cursor-not-allowed", classNames?.deleteButtonDisabled);
3452
3456
  return /* @__PURE__ */ jsxs("div", { className: cn("flex w-full h-14 mt-12 justify-between items-end px-3", classNames?.root), children: [
3453
3457
  /* @__PURE__ */ jsxs(
3454
3458
  "div",
@@ -3473,10 +3477,10 @@ var AuditFooter = ({
3473
3477
  ]
3474
3478
  }
3475
3479
  ),
3476
- onDelete && /* @__PURE__ */ jsx(
3480
+ shouldShowDelete && /* @__PURE__ */ jsx(
3477
3481
  "div",
3478
3482
  {
3479
- className: canDelete ? cn("w-5 h-5 cursor-pointer text-red-500", classNames?.deleteButton) : cn("w-5 h-5 text-gray-300 cursor-not-allowed", classNames?.deleteButtonDisabled),
3483
+ className: deleteButtonClassName,
3480
3484
  onClick: canDelete ? onDelete : void 0,
3481
3485
  "aria-label": deleteAriaLabel,
3482
3486
  role: "button",