@sustaina/shared-ui 1.66.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",
@@ -10757,6 +10761,18 @@ var DIALOG_ALERT_TEMPLATES = {
10757
10761
  title: "confirm.logout.title",
10758
10762
  description: "confirm.logout.description",
10759
10763
  confirmText: "confirm.logout.confirm_text"
10764
+ },
10765
+ "confirm.set_default": {
10766
+ variant: "confirm",
10767
+ title: "confirm.set_default.title",
10768
+ description: "confirm.set_default.description",
10769
+ confirmText: "confirm.set_default.confirm_text"
10770
+ },
10771
+ "confirm.unset_default": {
10772
+ variant: "confirm",
10773
+ title: "confirm.unset_default.title",
10774
+ description: "confirm.unset_default.description",
10775
+ confirmText: "confirm.unset_default.confirm_text"
10760
10776
  }
10761
10777
  };
10762
10778
 
@@ -10886,6 +10902,16 @@ var defaultResource = {
10886
10902
  title: "Confirmation",
10887
10903
  description: "Do you want to log out?",
10888
10904
  confirm_text: "Logout"
10905
+ },
10906
+ "confirm.set_default": {
10907
+ title: "Confirmation",
10908
+ description: "Set this item as the default?",
10909
+ confirm_text: "Confirm"
10910
+ },
10911
+ "confirm.unset_default": {
10912
+ title: "Confirmation",
10913
+ description: "Remove default status from this item?",
10914
+ confirm_text: "Confirm"
10889
10915
  }
10890
10916
  }
10891
10917
  }