@sustaina/shared-ui 1.23.0 → 1.23.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.js +9 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5110,17 +5110,17 @@ var defaultResource = {
|
|
|
5110
5110
|
};
|
|
5111
5111
|
|
|
5112
5112
|
// src/components/dialog-alert/locale/i18n.ts
|
|
5113
|
-
i18n__default.default.
|
|
5113
|
+
var instance = i18n__default.default.createInstance({
|
|
5114
5114
|
resources: defaultResource,
|
|
5115
5115
|
lng: "sharedui",
|
|
5116
5116
|
fallbackLng: "sharedui",
|
|
5117
5117
|
defaultNS: "translation",
|
|
5118
5118
|
interpolation: {
|
|
5119
5119
|
escapeValue: false
|
|
5120
|
-
// react already safes from xss
|
|
5121
5120
|
}
|
|
5122
|
-
});
|
|
5123
|
-
|
|
5121
|
+
}).use(reactI18next.initReactI18next);
|
|
5122
|
+
instance.init();
|
|
5123
|
+
var i18n_default = instance;
|
|
5124
5124
|
var titleColorVariant = {
|
|
5125
5125
|
default: "",
|
|
5126
5126
|
success: "text-green-600",
|
|
@@ -5136,7 +5136,7 @@ function DialogAlert({
|
|
|
5136
5136
|
description,
|
|
5137
5137
|
variant = "default",
|
|
5138
5138
|
confirmText,
|
|
5139
|
-
cancelText = "cancel",
|
|
5139
|
+
cancelText = i18nPrefix + "cancel",
|
|
5140
5140
|
onConfirm,
|
|
5141
5141
|
onCancel,
|
|
5142
5142
|
showCancel = true,
|
|
@@ -5145,7 +5145,6 @@ function DialogAlert({
|
|
|
5145
5145
|
persistent = false
|
|
5146
5146
|
}) {
|
|
5147
5147
|
const alignClass = align === "start" ? "justify-start" : align === "end" ? "justify-end" : "justify-center";
|
|
5148
|
-
const { t } = reactI18next.useTranslation();
|
|
5149
5148
|
const handleCancel = React4.useCallback(() => {
|
|
5150
5149
|
onCancel?.();
|
|
5151
5150
|
onOpenChange(false);
|
|
@@ -5157,13 +5156,13 @@ function DialogAlert({
|
|
|
5157
5156
|
return /* @__PURE__ */ jsxRuntime.jsx(Dialog2, { open, onOpenChange: persistent ? () => {
|
|
5158
5157
|
} : onOpenChange, children: /* @__PURE__ */ jsxRuntime.jsxs(DialogContent2, { className: "max-w-md", showCloseButton: !persistent, children: [
|
|
5159
5158
|
/* @__PURE__ */ jsxRuntime.jsxs(DialogHeader2, { children: [
|
|
5160
|
-
title && /* @__PURE__ */ jsxRuntime.jsx(DialogTitle2, { className: titleColorVariant[variant], children: t(title) }),
|
|
5161
|
-
description && /* @__PURE__ */ jsxRuntime.jsx(DialogDescription2, { children: t(description) })
|
|
5159
|
+
title && /* @__PURE__ */ jsxRuntime.jsx(DialogTitle2, { className: titleColorVariant[variant], children: i18n_default.t(title) }),
|
|
5160
|
+
description && /* @__PURE__ */ jsxRuntime.jsx(DialogDescription2, { children: i18n_default.t(description) })
|
|
5162
5161
|
] }),
|
|
5163
5162
|
outlet && outlet,
|
|
5164
5163
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: `flex gap-3 mt-3 ${alignClass}`, children: [
|
|
5165
|
-
showCancel && /* @__PURE__ */ jsxRuntime.jsx(Button2, { variant: "cancel", onClick: handleCancel, children: t(cancelText) }),
|
|
5166
|
-
confirmText && /* @__PURE__ */ jsxRuntime.jsx(Button2, { variant, onClick: handleConfirm, children: t(confirmText) })
|
|
5164
|
+
showCancel && /* @__PURE__ */ jsxRuntime.jsx(Button2, { variant: "cancel", onClick: handleCancel, children: i18n_default.t(cancelText) }),
|
|
5165
|
+
confirmText && /* @__PURE__ */ jsxRuntime.jsx(Button2, { variant, onClick: handleConfirm, children: i18n_default.t(confirmText) })
|
|
5167
5166
|
] })
|
|
5168
5167
|
] }) });
|
|
5169
5168
|
}
|