@webority/ui-react 0.9.20 → 0.9.21
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.
|
@@ -8,6 +8,11 @@
|
|
|
8
8
|
* @param {string} [props.confirmLabel="Confirm"]
|
|
9
9
|
* @param {boolean} [props.danger=false]
|
|
10
10
|
* @param {string} [props.tone]
|
|
11
|
+
* @param {string} [props.image] URL of a custom illustration to show in place of the tone
|
|
12
|
+
* artwork. Any source size is fine — the theme boxes it to the same footprint the built-in
|
|
13
|
+
* badge occupies (and to the same reduced footprint when the dialog has no message), so a
|
|
14
|
+
* 1024px PNG and a 64px one land identically. Decorative like the tone artwork: it renders
|
|
15
|
+
* aria-hidden with an empty alt, and the title plus message carry the meaning.
|
|
11
16
|
* @param {string} [props.confirmPhrase]
|
|
12
17
|
* @param {() => void} props.onConfirm
|
|
13
18
|
* @param {string} [props.cancelLabel="Cancel"]
|
|
@@ -23,13 +28,14 @@
|
|
|
23
28
|
* a preset, or an exact max-width in px for a custom size.
|
|
24
29
|
* @param {string} [props.className] Merged with the dialog's own wui-confirm class.
|
|
25
30
|
*/
|
|
26
|
-
export default function AppConfirmDialog({ open, title, message, confirmLabel, cancelLabel, danger, tone, confirmPhrase, onConfirm, onClose, loading, staticBackdrop, placement, size, className, ...rest }: {
|
|
31
|
+
export default function AppConfirmDialog({ open, title, message, confirmLabel, cancelLabel, danger, tone, image, confirmPhrase, onConfirm, onClose, loading, staticBackdrop, placement, size, className, ...rest }: {
|
|
27
32
|
open: boolean;
|
|
28
33
|
title: string;
|
|
29
34
|
message?: import('react').ReactNode;
|
|
30
35
|
confirmLabel?: string;
|
|
31
36
|
danger?: boolean;
|
|
32
37
|
tone?: string;
|
|
38
|
+
image?: string;
|
|
33
39
|
confirmPhrase?: string;
|
|
34
40
|
onConfirm: () => void;
|
|
35
41
|
cancelLabel?: string;
|
package/dist/ui-react.js
CHANGED
|
@@ -6365,46 +6365,53 @@ var rr = (e) => function({ size: t = 72 }) {
|
|
|
6365
6365
|
};
|
|
6366
6366
|
//#endregion
|
|
6367
6367
|
//#region src/components/AppConfirmDialog.jsx
|
|
6368
|
-
function ar({ open: e, title: t, message: n, confirmLabel: r = "Confirm", cancelLabel: i = "Cancel", danger: a = !1, tone: s,
|
|
6369
|
-
I("AppConfirmDialog",
|
|
6370
|
-
let [
|
|
6368
|
+
function ar({ open: e, title: t, message: n, confirmLabel: r = "Confirm", cancelLabel: i = "Cancel", danger: a = !1, tone: s, image: c, confirmPhrase: l, onConfirm: u, onClose: f, loading: p = !1, staticBackdrop: m = !1, placement: h = "center", size: g = "md", className: _ = "", ...v }) {
|
|
6369
|
+
I("AppConfirmDialog", v);
|
|
6370
|
+
let [y, b] = d("");
|
|
6371
6371
|
if (o(() => {
|
|
6372
|
-
e ||
|
|
6372
|
+
e || b("");
|
|
6373
6373
|
}, [e]), !e) return null;
|
|
6374
|
-
let
|
|
6375
|
-
|
|
6374
|
+
let x = !!l && y.trim() !== l, S = c ? null : ir[s || (a ? "delete" : "info")], C = () => {
|
|
6375
|
+
p || f?.();
|
|
6376
6376
|
};
|
|
6377
6377
|
return /* @__PURE__ */ T(nr, {
|
|
6378
|
-
...
|
|
6378
|
+
...v,
|
|
6379
6379
|
open: e,
|
|
6380
6380
|
hideHeader: !0,
|
|
6381
6381
|
title: t,
|
|
6382
|
-
onClose:
|
|
6383
|
-
staticBackdrop:
|
|
6384
|
-
placement:
|
|
6385
|
-
size:
|
|
6386
|
-
className: ["wui-confirm",
|
|
6382
|
+
onClose: C,
|
|
6383
|
+
staticBackdrop: m,
|
|
6384
|
+
placement: h,
|
|
6385
|
+
size: g,
|
|
6386
|
+
className: ["wui-confirm", _].filter(Boolean).join(" "),
|
|
6387
6387
|
footer: /* @__PURE__ */ E("div", {
|
|
6388
6388
|
className: "wui-confirm-actions",
|
|
6389
6389
|
children: [/* @__PURE__ */ T(ke, {
|
|
6390
6390
|
variant: "secondary",
|
|
6391
|
-
disabled:
|
|
6392
|
-
onClick:
|
|
6391
|
+
disabled: p,
|
|
6392
|
+
onClick: C,
|
|
6393
6393
|
children: i
|
|
6394
6394
|
}), /* @__PURE__ */ T(ke, {
|
|
6395
6395
|
variant: a ? "danger" : "primary",
|
|
6396
|
-
disabled:
|
|
6397
|
-
loading:
|
|
6398
|
-
onClick:
|
|
6396
|
+
disabled: x,
|
|
6397
|
+
loading: p,
|
|
6398
|
+
onClick: u,
|
|
6399
6399
|
children: r
|
|
6400
6400
|
})]
|
|
6401
6401
|
}),
|
|
6402
6402
|
children: /* @__PURE__ */ E("div", {
|
|
6403
6403
|
className: "wui-confirm-content",
|
|
6404
6404
|
children: [
|
|
6405
|
-
|
|
6405
|
+
c ? /* @__PURE__ */ T("span", {
|
|
6406
|
+
className: "wui-confirm-icon",
|
|
6407
|
+
children: /* @__PURE__ */ T("img", {
|
|
6408
|
+
src: c,
|
|
6409
|
+
alt: "",
|
|
6410
|
+
"aria-hidden": "true"
|
|
6411
|
+
})
|
|
6412
|
+
}) : S && /* @__PURE__ */ T("span", {
|
|
6406
6413
|
className: "wui-confirm-icon",
|
|
6407
|
-
children: /* @__PURE__ */ T(
|
|
6414
|
+
children: /* @__PURE__ */ T(S, { size: 80 })
|
|
6408
6415
|
}),
|
|
6409
6416
|
/* @__PURE__ */ T("h3", {
|
|
6410
6417
|
className: "wui-confirm-title",
|
|
@@ -6416,17 +6423,17 @@ function ar({ open: e, title: t, message: n, confirmLabel: r = "Confirm", cancel
|
|
|
6416
6423
|
className: "wui-confirm-msg",
|
|
6417
6424
|
children: n
|
|
6418
6425
|
}),
|
|
6419
|
-
|
|
6426
|
+
l && /* @__PURE__ */ T(Zn, {
|
|
6420
6427
|
fieldClassName: "mt-3 mb-0 w-100 text-start",
|
|
6421
6428
|
label: /* @__PURE__ */ E(w, { children: [
|
|
6422
6429
|
"Type ",
|
|
6423
|
-
/* @__PURE__ */ T("strong", { children:
|
|
6430
|
+
/* @__PURE__ */ T("strong", { children: l }),
|
|
6424
6431
|
" to confirm"
|
|
6425
6432
|
] }),
|
|
6426
|
-
value:
|
|
6427
|
-
onChange: (e) =>
|
|
6428
|
-
"aria-label": `Type ${
|
|
6429
|
-
disabled:
|
|
6433
|
+
value: y,
|
|
6434
|
+
onChange: (e) => b(e.target.value),
|
|
6435
|
+
"aria-label": `Type ${l} to confirm`,
|
|
6436
|
+
disabled: p
|
|
6430
6437
|
})
|
|
6431
6438
|
]
|
|
6432
6439
|
})
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webority/ui-react",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.21",
|
|
4
4
|
"description": "Webority shared React component library — App* primitives on react-bootstrap + the @webority/theme design system.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"type": "module",
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
},
|
|
29
29
|
"sideEffects": false,
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@webority/theme": "0.9.
|
|
32
|
-
"@webority/ui-elements": "0.9.
|
|
31
|
+
"@webority/theme": "0.9.21",
|
|
32
|
+
"@webority/ui-elements": "0.9.21"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"bootstrap": "5.3.3",
|