@webority/ui-react 0.9.20 → 0.9.22

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, confirmPhrase: c, onConfirm: l, onClose: u, loading: f = !1, staticBackdrop: p = !1, placement: m = "center", size: h = "md", className: g = "", ..._ }) {
6369
- I("AppConfirmDialog", _);
6370
- let [v, y] = d("");
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 || y("");
6372
+ e || b("");
6373
6373
  }, [e]), !e) return null;
6374
- let b = !!c && v.trim() !== c, x = ir[s || (a ? "delete" : "info")], S = () => {
6375
- f || u?.();
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: S,
6383
- staticBackdrop: p,
6384
- placement: m,
6385
- size: h,
6386
- className: ["wui-confirm", g].filter(Boolean).join(" "),
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: f,
6392
- onClick: S,
6391
+ disabled: p,
6392
+ onClick: C,
6393
6393
  children: i
6394
6394
  }), /* @__PURE__ */ T(ke, {
6395
6395
  variant: a ? "danger" : "primary",
6396
- disabled: b,
6397
- loading: f,
6398
- onClick: l,
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
- x && /* @__PURE__ */ T("span", {
6405
+ c ? /* @__PURE__ */ T("span", {
6406
6406
  className: "wui-confirm-icon",
6407
- children: /* @__PURE__ */ T(x, { size: 80 })
6407
+ children: /* @__PURE__ */ T("img", {
6408
+ src: c,
6409
+ alt: "",
6410
+ "aria-hidden": "true"
6411
+ })
6412
+ }) : S && /* @__PURE__ */ T("span", {
6413
+ className: "wui-confirm-icon",
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
- c && /* @__PURE__ */ T(Zn, {
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: c }),
6430
+ /* @__PURE__ */ T("strong", { children: l }),
6424
6431
  " to confirm"
6425
6432
  ] }),
6426
- value: v,
6427
- onChange: (e) => y(e.target.value),
6428
- "aria-label": `Type ${c} to confirm`,
6429
- disabled: f
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
  })
@@ -8752,20 +8759,20 @@ function xi({ groups: e = [], brand: t, sidebarStart: n, sidebarStartCompact: r,
8752
8759
  i && /* @__PURE__ */ T("div", {
8753
8760
  className: "app-sidebar-foot",
8754
8761
  children: i
8762
+ }),
8763
+ !p && /* @__PURE__ */ T("button", {
8764
+ type: "button",
8765
+ className: "app-sidebar-toggle",
8766
+ onClick: D,
8767
+ "aria-label": w ? "Expand navigation" : "Collapse navigation",
8768
+ "aria-expanded": !w,
8769
+ children: /* @__PURE__ */ T(W, {
8770
+ name: "chevrons-left",
8771
+ size: 20
8772
+ })
8755
8773
  })
8756
8774
  ]
8757
8775
  }),
8758
- !p && /* @__PURE__ */ T("button", {
8759
- type: "button",
8760
- className: "app-sidebar-toggle",
8761
- onClick: D,
8762
- "aria-label": w ? "Expand navigation" : "Collapse navigation",
8763
- "aria-expanded": !w,
8764
- children: /* @__PURE__ */ T(W, {
8765
- name: "chevrons-left",
8766
- size: 20
8767
- })
8768
- }),
8769
8776
  /* @__PURE__ */ E("div", {
8770
8777
  className: "app-main",
8771
8778
  children: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webority/ui-react",
3
- "version": "0.9.20",
3
+ "version": "0.9.22",
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.20",
32
- "@webority/ui-elements": "0.9.20"
31
+ "@webority/theme": "0.9.22",
32
+ "@webority/ui-elements": "0.9.22"
33
33
  },
34
34
  "peerDependencies": {
35
35
  "bootstrap": "5.3.3",