@webority/ui-react 0.112.3 → 0.114.0

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.
@@ -13478,14 +13478,13 @@ function spe(e, n, r, i, a, o) {
13478
13478
  }) : null;
13479
13479
  }
13480
13480
  function ms(r) {
13481
- let { marker: i, props: a } = H("AppAlert", r), { variant: o = "info", children: s, title: c, icon: l, iconVariant: u, iconSize: d, image: f, imageAlt: p = "", imageSize: m, className: h = "", onClose: g, dismissible: _, bordered: v = !0, accent: y = !1, size: b = "md", action: x, role: S = "alert", ...C } = a;
13482
- U("AppAlert", C), V("AppAlert", "variant", o, rpe), V("AppAlert", "size", b, ipe), V("AppAlert", "role", S, ape), V("AppAlert", "iconVariant", u, ope);
13481
+ let { marker: i, props: a } = H("AppAlert", r), { tone: o = "info", children: s, title: c, icon: l, iconVariant: u, iconSize: d, image: f, imageAlt: p = "", imageSize: m, className: h = "", onClose: g, dismissible: _, bordered: v = !0, accent: y = !1, size: b = "md", action: x, role: S = "alert", ...C } = a;
13482
+ U("AppAlert", C), V("AppAlert", "tone", o, rpe), V("AppAlert", "size", b, ipe), V("AppAlert", "role", S, ape), V("AppAlert", "iconVariant", u, ope);
13483
13483
  let w = l === void 0 ? npe[o] : l === "none" ? null : l, T = !!f || !!w, E = x != null && x !== !1, D = c ? t("div", {
13484
13484
  className: "alert-heading",
13485
13485
  children: c
13486
13486
  }) : null, O = T && !!D && !!s, k = d > 0 ? d : b === "lg" ? O ? 17 : 15 : O ? 13 : 11;
13487
13487
  return t(Ute, {
13488
- variant: o,
13489
13488
  className: [
13490
13489
  T ? "alert-has-icon" : "",
13491
13490
  E ? "alert-has-action" : "",
@@ -13502,6 +13501,7 @@ function ms(r) {
13502
13501
  role: S === "none" ? void 0 : S,
13503
13502
  ...i,
13504
13503
  ...C,
13504
+ variant: o,
13505
13505
  children: T || E ? n(e, { children: [
13506
13506
  T && spe(w, k, u, f, p, m),
13507
13507
  n("div", {
@@ -13874,49 +13874,81 @@ var wpe = {
13874
13874
  name: "computeStyles",
13875
13875
  options: { gpuAcceleration: !1 }
13876
13876
  }] }, Epe = ["dialog"];
13877
- function Ds({ trigger: e, children: r, title: i, placement: a = "bottom", triggerType: o = "click", onToggle: c, className: l = "", show: u, role: d, labelledBy: f, autoFocus: p = !1, ...m }) {
13878
- U("AppPopover", m), V("AppPopover", "role", d, Epe);
13879
- let g = h(), _ = `${g}-title`, v = x(null), [y, b] = S(!1), C = u !== void 0, w = C ? u : y, T = d === "dialog", E = (e) => {
13880
- C || b(e), c?.(e);
13881
- }, D = n(Sa, {
13882
- id: g,
13877
+ function Ds({ trigger: e, children: r, title: i, placement: a = "bottom", triggerType: o = "click", onToggle: c, className: l = "", show: u, role: d, labelledBy: f, autoFocus: p = !1, openDelay: g = 80, closeDelay: _ = 220, ...v }) {
13878
+ U("AppPopover", v), V("AppPopover", "role", d, Epe);
13879
+ let y = h(), b = `${y}-title`, C = x(null), [w, T] = S(!1), E = u !== void 0, D = E ? u : w, O = d === "dialog", k = o === "hover" || Array.isArray(o) && o.includes("hover"), A = k && !E, j = x(null), M = x(w);
13880
+ M.current = w;
13881
+ let N = () => {
13882
+ clearTimeout(j.current), j.current = null;
13883
+ }, P = (e, t) => {
13884
+ N(), j.current = setTimeout(() => {
13885
+ j.current = null, e !== M.current && (T(e), c?.(e));
13886
+ }, t);
13887
+ };
13888
+ m(() => () => clearTimeout(j.current), []), m(() => {
13889
+ if (!A || !w) return;
13890
+ let e = (e) => {
13891
+ e.key === "Escape" && (clearTimeout(j.current), j.current = null, T(!1), c?.(!1));
13892
+ };
13893
+ return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
13894
+ }, [
13895
+ A,
13896
+ w,
13897
+ c
13898
+ ]);
13899
+ let F = (e) => {
13900
+ if (A) {
13901
+ P(e, e ? g : _);
13902
+ return;
13903
+ }
13904
+ E || T(e), c?.(e);
13905
+ }, I = O ? {
13906
+ role: "dialog",
13907
+ "aria-modal": "false",
13908
+ "aria-labelledby": f ?? (i ? b : void 0)
13909
+ } : {}, L = A ? {
13910
+ onMouseEnter: N,
13911
+ onMouseLeave: () => P(!1, _),
13912
+ onFocus: N,
13913
+ onBlur: (e) => {
13914
+ e.currentTarget.contains(e.relatedTarget) || P(!1, _);
13915
+ }
13916
+ } : {}, R = n(Sa, {
13917
+ id: y,
13883
13918
  className: l || void 0,
13884
- ...T ? {
13885
- role: "dialog",
13886
- "aria-modal": "false",
13887
- "aria-labelledby": f ?? (i ? _ : void 0)
13888
- } : {},
13919
+ ...I,
13920
+ ...L,
13889
13921
  children: [
13890
- p && t(Cpe, { triggerRef: v }),
13922
+ p && t(Cpe, { triggerRef: C }),
13891
13923
  i && t(Sa.Header, {
13892
13924
  as: "div",
13893
- id: _,
13925
+ id: b,
13894
13926
  children: i
13895
13927
  }),
13896
13928
  r == null ? null : t(Sa.Body, { children: r })
13897
13929
  ]
13898
- }), { onClick: O, "aria-expanded": k, ...A } = m, j = e.props["aria-expanded"], M, N = o === "click" || Array.isArray(o) && o.includes("click");
13899
- k === void 0 ? j === void 0 ? N && (M = w) : M = j : M = k;
13900
- let P = s(e, {
13901
- ...A,
13902
- ...M === void 0 ? {} : { "aria-expanded": M },
13930
+ }), { onClick: z, "aria-expanded": B, ...ee } = v, te = e.props["aria-expanded"], ne, re = o === "click" || Array.isArray(o) && o.includes("click");
13931
+ B === void 0 ? te === void 0 ? re && (ne = D) : ne = te : ne = B;
13932
+ let ie = s(e, {
13933
+ ...ee,
13934
+ ...ne === void 0 ? {} : { "aria-expanded": ne },
13903
13935
  onClick: (t) => {
13904
- v.current = t.currentTarget, O?.(t), typeof e.props.onClick == "function" && e.props.onClick(t);
13936
+ C.current = t.currentTarget, z?.(t), typeof e.props.onClick == "function" && e.props.onClick(t);
13905
13937
  }
13906
- }), F = o === "click", I = o === "hover" || Array.isArray(o) && o.includes("hover");
13938
+ }), ae = o === "click";
13907
13939
  return t(bae, {
13908
13940
  trigger: o,
13909
13941
  placement: wpe[a] || a,
13910
13942
  popperConfig: Tpe,
13911
- overlay: D,
13912
- rootClose: F || T,
13913
- delay: I ? {
13914
- show: 80,
13915
- hide: 220
13943
+ overlay: R,
13944
+ rootClose: ae || O,
13945
+ delay: E && k ? {
13946
+ show: g,
13947
+ hide: _
13916
13948
  } : void 0,
13917
- onToggle: E,
13918
- ...C ? { show: u } : {},
13919
- children: P
13949
+ onToggle: F,
13950
+ ...E || k ? { show: D } : {},
13951
+ children: ie
13920
13952
  });
13921
13953
  }
13922
13954
  //#endregion
@@ -14939,18 +14971,18 @@ var dc = [
14939
14971
  "neutral"
14940
14972
  ];
14941
14973
  function fc(e) {
14942
- let { marker: r, props: i } = H("AppBanner", e), { tone: a = "info", icon: o, children: s, dismissible: c = !1, onDismiss: l, className: u = "", ...d } = i;
14943
- U("AppBanner", d), V("AppBanner", "tone", a, dc);
14944
- let [f, p] = S(!0);
14945
- if (!f) return null;
14946
- let m = dc.includes(a) ? a : "info", h = () => {
14947
- p(!1), l?.();
14974
+ let { marker: r, props: i } = H("AppBanner", e), { tone: a = "info", icon: o, children: s, dismissible: c = !1, onDismiss: l, action: u, className: d = "", ...f } = i;
14975
+ U("AppBanner", f), V("AppBanner", "tone", a, dc);
14976
+ let [p, m] = S(!0);
14977
+ if (!p) return null;
14978
+ let h = dc.includes(a) ? a : "info", g = u != null && u !== !1, _ = () => {
14979
+ m(!1), l?.();
14948
14980
  };
14949
14981
  return n("div", {
14950
- className: `wui-banner wui-banner-${m}${u ? ` ${u}` : ""}`,
14982
+ className: `wui-banner wui-banner-${h}${g ? " wui-banner-has-action" : ""}${d ? ` ${d}` : ""}`,
14951
14983
  role: "status",
14952
14984
  ...r,
14953
- ...d,
14985
+ ...f,
14954
14986
  children: [
14955
14987
  o && t("span", {
14956
14988
  className: "wui-banner-icon",
@@ -14960,11 +14992,15 @@ function fc(e) {
14960
14992
  className: "wui-banner-body",
14961
14993
  children: s
14962
14994
  }),
14995
+ g && t("div", {
14996
+ className: "wui-banner-action",
14997
+ children: u
14998
+ }),
14963
14999
  c && t("button", {
14964
15000
  type: "button",
14965
15001
  className: "wui-banner-dismiss",
14966
15002
  "aria-label": "Dismiss",
14967
- onClick: h,
15003
+ onClick: _,
14968
15004
  children: t(W, {
14969
15005
  name: "x",
14970
15006
  size: 18
@@ -39045,7 +39081,8 @@ function rD(e) {
39045
39081
  label: a.label ?? "",
39046
39082
  format: g,
39047
39083
  min: nG(a.min) ? a.min : void 0,
39048
- max: nG(a.max) ? a.max : void 0
39084
+ max: nG(a.max) ? a.max : void 0,
39085
+ wholeNumbers: a.wholeNumbers === !0
39049
39086
  },
39050
39087
  target: rG(e.target) && nG(e.target.value) ? {
39051
39088
  value: e.target.value,
@@ -39824,20 +39861,29 @@ function VLe(e, t, n) {
39824
39861
  series: 0
39825
39862
  };
39826
39863
  }
39827
- function MD(e, t, n, r) {
39828
- let i = QE(e);
39829
- if (i.style !== "compact" || !Number.isFinite(t) || !Number.isFinite(n)) return i;
39830
- let a = (n - t) / r;
39831
- if (!(a > 0) || a >= Math.max(Math.abs(t), Math.abs(n)) * .02) return i;
39832
- let o = Math.min(6, Math.max(0, Math.ceil(-Math.log10(a))));
39833
- return i.currency ? {
39864
+ function MD(e, t, n, r, i = !1) {
39865
+ let a = QE(e);
39866
+ if (i) return a.currency ? {
39834
39867
  style: "currency",
39835
- currency: i.currency,
39836
- unit: i.unit,
39837
- decimals: o
39868
+ currency: a.currency,
39869
+ unit: a.unit,
39870
+ decimals: 0
39838
39871
  } : {
39839
39872
  style: "number",
39840
- decimals: o
39873
+ decimals: 0
39874
+ };
39875
+ if (a.style !== "compact" || !Number.isFinite(t) || !Number.isFinite(n)) return a;
39876
+ let o = (n - t) / r;
39877
+ if (!(o > 0) || o >= Math.max(Math.abs(t), Math.abs(n)) * .02) return a;
39878
+ let s = Math.min(6, Math.max(0, Math.ceil(-Math.log10(o))));
39879
+ return a.currency ? {
39880
+ style: "currency",
39881
+ currency: a.currency,
39882
+ unit: a.unit,
39883
+ decimals: s
39884
+ } : {
39885
+ style: "number",
39886
+ decimals: s
39841
39887
  };
39842
39888
  }
39843
39889
  function ND(e) {
@@ -39955,7 +40001,7 @@ function LD(e, t, n, r) {
39955
40001
  animate: a
39956
40002
  }, f = oVe[e.type];
39957
40003
  if (f) return f(e, t, n, r, d);
39958
- let p = e.type === "bar", m = e.x.kind === "time", h = e.stack === "percent" ? mD(e, r.hidden) : null, g = p || e.type === "column" ? ULe(e, r.hidden, p) : null, _ = e.series.length === 1, v = r.renderer === "canvas", [y, b] = pG(e.series.flatMap((t) => e.data.map((n, r) => iD(e, t.key, r))), !0), x = e.stack === "percent" ? jD(e) : MD(e.y.format, e.y.min ?? y, e.y.max ?? b, i ? 3 : 4), S = h?.some((e) => Object.values(e).some((e) => e != null && e < 0)) ? -1 : 0, C = e.series.findIndex((e) => !r.hidden.has(e.key)), w = {
40004
+ let p = e.type === "bar", m = e.x.kind === "time", h = e.stack === "percent" ? mD(e, r.hidden) : null, g = p || e.type === "column" ? ULe(e, r.hidden, p) : null, _ = e.series.length === 1, v = r.renderer === "canvas", [y, b] = pG(e.series.flatMap((t) => e.data.map((n, r) => iD(e, t.key, r))), !0), x = e.stack === "percent" ? jD(e) : MD(e.y.format, e.y.min ?? y, e.y.max ?? b, i ? 3 : 4, e.y.wholeNumbers), S = h?.some((e) => Object.values(e).some((e) => e != null && e < 0)) ? -1 : 0, C = e.series.findIndex((e) => !r.hidden.has(e.key)), w = {
39959
40005
  type: m ? "time" : "category",
39960
40006
  boundaryGap: !m && (e.type === "column" || p),
39961
40007
  inverse: p,
@@ -39978,6 +40024,7 @@ function LD(e, t, n, r) {
39978
40024
  splitNumber: i ? 3 : 4,
39979
40025
  min: e.stack === "percent" ? S : e.y.min,
39980
40026
  max: e.stack === "percent" ? 1 : e.y.max,
40027
+ minInterval: e.y.wholeNumbers ? 1 : void 0,
39981
40028
  interval: e.stack === "percent" ? .25 : void 0,
39982
40029
  axisLine: { show: !1 },
39983
40030
  axisTick: { show: !1 },
@@ -58545,7 +58592,8 @@ var GD, KD, qD, JD, YD, XD, ZD, QD, $D, eO, tO, nO, rO, iO, aO, oO, sO, cO, lO,
58545
58592
  "label",
58546
58593
  "format",
58547
58594
  "min",
58548
- "max"
58595
+ "max",
58596
+ "wholeNumbers"
58549
58597
  ], BBe = ["value", "label"], VBe = [
58550
58598
  "style",
58551
58599
  "currency",
@@ -87365,11 +87413,11 @@ function BQe(r) {
87365
87413
  })] }),
87366
87414
  children: [
87367
87415
  Le === "error" && Ne && t(ms, {
87368
- variant: "danger",
87416
+ tone: "danger",
87369
87417
  children: se.unreadable(Ne.file)
87370
87418
  }),
87371
87419
  ze && t(ms, {
87372
- variant: "danger",
87420
+ tone: "danger",
87373
87421
  children: ze
87374
87422
  }),
87375
87423
  Ne && Le !== "error" && t("wui-image-crop", {
@@ -126744,7 +126792,7 @@ function Amt(e) {
126744
126792
  }), j ? t("div", {
126745
126793
  className: "wui-section-lead-success",
126746
126794
  children: t(ms, {
126747
- variant: "success",
126795
+ tone: "success",
126748
126796
  title: u,
126749
126797
  children: d
126750
126798
  })
@@ -126758,7 +126806,7 @@ function Amt(e) {
126758
126806
  children: s.map(F)
126759
126807
  }),
126760
126808
  D != null && t(ms, {
126761
- variant: "danger",
126809
+ tone: "danger",
126762
126810
  children: D
126763
126811
  }),
126764
126812
  t(bs, {
@@ -133468,7 +133516,7 @@ var iyt = u(function({ compact: r, tenant: i, "aria-label": a, className: o, ...
133468
133516
  kind: "WeborityWeb",
133469
133517
  library: {
133470
133518
  name: "@webority/ui-react",
133471
- version: "0.112.3"
133519
+ version: "0.114.0"
133472
133520
  },
133473
133521
  rendererProtocolVersion: 13,
133474
133522
  platform: "Web",
@@ -133836,7 +133884,7 @@ var iyt = u(function({ compact: r, tenant: i, "aria-label": a, className: o, ...
133836
133884
  name: "accent",
133837
133885
  type: "boolean",
133838
133886
  required: !1,
133839
- description: "A thick left edge in the variant colour, marking the alert as an aside.",
133887
+ description: "A thick left edge in the tone colour, marking the alert as an aside.",
133840
133888
  default: !1
133841
133889
  },
133842
133890
  {
@@ -133849,7 +133897,7 @@ var iyt = u(function({ compact: r, tenant: i, "aria-label": a, className: o, ...
133849
133897
  name: "bordered",
133850
133898
  type: "boolean",
133851
133899
  required: !1,
133852
- description: "Draws the soft border of the variant. False keeps only the tint fill.",
133900
+ description: "Draws the soft border of the tone. False keeps only the tint fill.",
133853
133901
  default: !0
133854
133902
  },
133855
133903
  {
@@ -133869,7 +133917,7 @@ var iyt = u(function({ compact: r, tenant: i, "aria-label": a, className: o, ...
133869
133917
  name: "icon",
133870
133918
  type: "icon",
133871
133919
  required: !1,
133872
- description: "A leading glyph, given as a semantic icon name. It defaults to the glyph of the variant; pass null for no badge."
133920
+ description: "A leading glyph, given as a semantic icon name. It defaults to the glyph of the tone; pass null for no badge."
133873
133921
  },
133874
133922
  {
133875
133923
  name: "iconSize",
@@ -133941,7 +133989,7 @@ var iyt = u(function({ compact: r, tenant: i, "aria-label": a, className: o, ...
133941
133989
  description: "A bold heading line above the body."
133942
133990
  },
133943
133991
  {
133944
- name: "variant",
133992
+ name: "tone",
133945
133993
  type: "enum",
133946
133994
  enum: [
133947
133995
  "danger",
@@ -133984,17 +134032,17 @@ var iyt = u(function({ compact: r, tenant: i, "aria-label": a, className: o, ...
133984
134032
  }
133985
134033
  ],
133986
134034
  do: [{
133987
- note: "Match the variant to intent and say what to do next. A danger alert names the problem and the recovery.",
134035
+ note: "Match the tone to intent and say what to do next. A danger alert names the problem and the recovery.",
133988
134036
  example: [{
133989
134037
  component: "AppAlert",
133990
- props: { variant: "danger" },
134038
+ props: { tone: "danger" },
133991
134039
  children: "We couldn't save your changes: check the highlighted fields and try again."
133992
134040
  }]
133993
134041
  }, {
133994
134042
  note: "A neutral, informational notice uses the info tone: calm, not alarming.",
133995
134043
  example: [{
133996
134044
  component: "AppAlert",
133997
- props: { variant: "info" },
134045
+ props: { tone: "info" },
133998
134046
  children: "Reports use the latest IEC 62305-2 methodology."
133999
134047
  }]
134000
134048
  }],
@@ -134002,14 +134050,14 @@ var iyt = u(function({ compact: r, tenant: i, "aria-label": a, className: o, ...
134002
134050
  note: "A success (green) tone on an error message contradicts the words. The colour lies about what happened.",
134003
134051
  example: [{
134004
134052
  component: "AppAlert",
134005
- props: { variant: "success" },
134053
+ props: { tone: "success" },
134006
134054
  children: "Something went wrong while saving."
134007
134055
  }]
134008
134056
  }, {
134009
134057
  note: "A warning (amber) tone on a purely informational message implies a problem that is not there.",
134010
134058
  example: [{
134011
134059
  component: "AppAlert",
134012
- props: { variant: "warning" },
134060
+ props: { tone: "warning" },
134013
134061
  children: "Reports use the latest IEC 62305-2 methodology."
134014
134062
  }]
134015
134063
  }],
@@ -134817,6 +134865,12 @@ var iyt = u(function({ compact: r, tenant: i, "aria-label": a, className: o, ...
134817
134865
  marker: "AppBanner",
134818
134866
  acceptsChildren: !0,
134819
134867
  props: [
134868
+ {
134869
+ name: "action",
134870
+ type: "node",
134871
+ required: !1,
134872
+ description: "A button or link at the banner's right edge; it wraps below the message on a phone."
134873
+ },
134820
134874
  {
134821
134875
  name: "className",
134822
134876
  type: "string",
@@ -146548,12 +146602,26 @@ var iyt = u(function({ compact: r, tenant: i, "aria-label": a, className: o, ...
146548
146602
  description: "Extra classes on the popover panel.",
146549
146603
  default: ""
146550
146604
  },
146605
+ {
146606
+ name: "closeDelay",
146607
+ type: "number",
146608
+ required: !1,
146609
+ description: "Milliseconds a hover popover waits before it closes after the pointer leaves the trigger and the panel.",
146610
+ default: 220
146611
+ },
146551
146612
  {
146552
146613
  name: "labelledBy",
146553
146614
  type: "string",
146554
146615
  required: !1,
146555
146616
  description: "The id of the element that names a dialog panel. It wins over the title."
146556
146617
  },
146618
+ {
146619
+ name: "openDelay",
146620
+ type: "number",
146621
+ required: !1,
146622
+ description: "Milliseconds a hover popover waits before it opens.",
146623
+ default: 80
146624
+ },
146557
146625
  {
146558
146626
  name: "placement",
146559
146627
  type: "enum",
@@ -2,7 +2,7 @@
2
2
  "kind": "WeborityWeb",
3
3
  "library": {
4
4
  "name": "@webority/ui-react",
5
- "version": "0.112.3"
5
+ "version": "0.114.0"
6
6
  },
7
7
  "rendererProtocolVersion": 13,
8
8
  "platform": "Web",
@@ -404,7 +404,7 @@
404
404
  "name": "accent",
405
405
  "type": "boolean",
406
406
  "required": false,
407
- "description": "A thick left edge in the variant colour, marking the alert as an aside.",
407
+ "description": "A thick left edge in the tone colour, marking the alert as an aside.",
408
408
  "default": false
409
409
  },
410
410
  {
@@ -417,7 +417,7 @@
417
417
  "name": "bordered",
418
418
  "type": "boolean",
419
419
  "required": false,
420
- "description": "Draws the soft border of the variant. False keeps only the tint fill.",
420
+ "description": "Draws the soft border of the tone. False keeps only the tint fill.",
421
421
  "default": true
422
422
  },
423
423
  {
@@ -437,7 +437,7 @@
437
437
  "name": "icon",
438
438
  "type": "icon",
439
439
  "required": false,
440
- "description": "A leading glyph, given as a semantic icon name. It defaults to the glyph of the variant; pass null for no badge."
440
+ "description": "A leading glyph, given as a semantic icon name. It defaults to the glyph of the tone; pass null for no badge."
441
441
  },
442
442
  {
443
443
  "name": "iconSize",
@@ -509,7 +509,7 @@
509
509
  "description": "A bold heading line above the body."
510
510
  },
511
511
  {
512
- "name": "variant",
512
+ "name": "tone",
513
513
  "type": "enum",
514
514
  "enum": [
515
515
  "danger",
@@ -553,12 +553,12 @@
553
553
  ],
554
554
  "do": [
555
555
  {
556
- "note": "Match the variant to intent and say what to do next. A danger alert names the problem and the recovery.",
556
+ "note": "Match the tone to intent and say what to do next. A danger alert names the problem and the recovery.",
557
557
  "example": [
558
558
  {
559
559
  "component": "AppAlert",
560
560
  "props": {
561
- "variant": "danger"
561
+ "tone": "danger"
562
562
  },
563
563
  "children": "We couldn't save your changes: check the highlighted fields and try again."
564
564
  }
@@ -570,7 +570,7 @@
570
570
  {
571
571
  "component": "AppAlert",
572
572
  "props": {
573
- "variant": "info"
573
+ "tone": "info"
574
574
  },
575
575
  "children": "Reports use the latest IEC 62305-2 methodology."
576
576
  }
@@ -584,7 +584,7 @@
584
584
  {
585
585
  "component": "AppAlert",
586
586
  "props": {
587
- "variant": "success"
587
+ "tone": "success"
588
588
  },
589
589
  "children": "Something went wrong while saving."
590
590
  }
@@ -596,7 +596,7 @@
596
596
  {
597
597
  "component": "AppAlert",
598
598
  "props": {
599
- "variant": "warning"
599
+ "tone": "warning"
600
600
  },
601
601
  "children": "Reports use the latest IEC 62305-2 methodology."
602
602
  }
@@ -1499,6 +1499,12 @@
1499
1499
  "marker": "AppBanner",
1500
1500
  "acceptsChildren": true,
1501
1501
  "props": [
1502
+ {
1503
+ "name": "action",
1504
+ "type": "node",
1505
+ "required": false,
1506
+ "description": "A button or link at the banner's right edge; it wraps below the message on a phone."
1507
+ },
1502
1508
  {
1503
1509
  "name": "className",
1504
1510
  "type": "string",
@@ -14290,12 +14296,26 @@
14290
14296
  "description": "Extra classes on the popover panel.",
14291
14297
  "default": ""
14292
14298
  },
14299
+ {
14300
+ "name": "closeDelay",
14301
+ "type": "number",
14302
+ "required": false,
14303
+ "description": "Milliseconds a hover popover waits before it closes after the pointer leaves the trigger and the panel.",
14304
+ "default": 220
14305
+ },
14293
14306
  {
14294
14307
  "name": "labelledBy",
14295
14308
  "type": "string",
14296
14309
  "required": false,
14297
14310
  "description": "The id of the element that names a dialog panel. It wins over the title."
14298
14311
  },
14312
+ {
14313
+ "name": "openDelay",
14314
+ "type": "number",
14315
+ "required": false,
14316
+ "description": "Milliseconds a hover popover waits before it opens.",
14317
+ "default": 80
14318
+ },
14299
14319
  {
14300
14320
  "name": "placement",
14301
14321
  "type": "enum",
@@ -1,21 +1,21 @@
1
1
  {
2
2
  "name": "webority-web",
3
- "version": "0.112.3",
3
+ "version": "0.114.0",
4
4
  "platform": "Web",
5
5
  "kitModuleVersion": 2,
6
6
  "rendererProtocolVersion": 13,
7
7
  "library": {
8
8
  "name": "@webority/ui-react",
9
- "version": "0.112.3"
9
+ "version": "0.114.0"
10
10
  },
11
11
  "files": {
12
12
  "manifest.json": {
13
- "sha256": "9e08c0d55fbc86f082ba6d5f35eacf6153b31f74097b2eae611c7f1488e41b93",
14
- "bytes": 857685
13
+ "sha256": "d9a185e6be8f43d80f424ef9831640b150662f5bb705b855f7f12ba02e027efe",
14
+ "bytes": 858353
15
15
  },
16
16
  "kit.js": {
17
- "sha256": "76d84b194bb320fe0b2472de363952d0cf230800974a73c327b8d12bc049c83a",
18
- "bytes": 10907236
17
+ "sha256": "97955ff754e742e41855e36007554f3eac9d220d001fc80a32153fa08b8faacf",
18
+ "bytes": 10909053
19
19
  },
20
20
  "kit.css": {
21
21
  "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
@@ -1 +1 @@
1
- import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import r from"./AppIcon.js";import{Alert as i}from"react-bootstrap";import{Fragment as a,jsx as o,jsxs as s}from"react/jsx-runtime";var c={info:`info`,success:`check`,warning:`alert-triangle`,danger:`x`},l=[`info`,`success`,`warning`,`danger`,`neutral`],u=[`sm`,`md`,`lg`],d=[`alert`,`status`,`none`],f=[`linear`,`outline`,`bold`,`bulk`,`broken`,`twotone`];function p(e,t,n,i,a,s){return i?o(`span`,{className:`alert-icon alert-icon-image`,style:s>0?{width:s,height:s}:void 0,children:o(`img`,{src:i,alt:a})}):e?typeof e==`string`?o(`span`,{className:`alert-icon`,children:o(r,{name:e,size:t,variant:n})}):o(`span`,{className:`alert-icon`,children:e}):null}function m(r){let{marker:m,props:h}=e(`AppAlert`,r),{variant:g=`info`,children:_,title:v,icon:y,iconVariant:b,iconSize:x,image:S,imageAlt:C=``,imageSize:w,className:T=``,onClose:E,dismissible:D,bordered:O=!0,accent:k=!1,size:A=`md`,action:j,role:M=`alert`,...N}=h;n(`AppAlert`,N),t(`AppAlert`,`variant`,g,l),t(`AppAlert`,`size`,A,u),t(`AppAlert`,`role`,M,d),t(`AppAlert`,`iconVariant`,b,f);let P=y===void 0?c[g]:y===`none`?null:y,F=!!S||!!P,I=j!=null&&j!==!1,L=v?o(`div`,{className:`alert-heading`,children:v}):null,R=F&&!!L&&!!_,z=x>0?x:A===`lg`?R?17:15:R?13:11;return o(i,{variant:g,className:[F?`alert-has-icon`:``,I?`alert-has-action`:``,R?`alert-stack`:``,O?``:`alert-borderless`,k?`alert-accent`:``,A===`sm`?`alert-sm`:``,A===`lg`?`alert-lg`:``,T].filter(Boolean).join(` `)||void 0,onClose:E,dismissible:D??typeof E==`function`,transition:!1,role:M===`none`?void 0:M,...m,...N,children:F||I?s(a,{children:[F&&p(P,z,b,S,C,w),s(`div`,{className:`alert-content`,children:[L,_]}),I&&o(`div`,{className:`alert-action`,children:j})]}):s(a,{children:[L,_]})})}export{m as default};
1
+ import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import r from"./AppIcon.js";import{Alert as i}from"react-bootstrap";import{Fragment as a,jsx as o,jsxs as s}from"react/jsx-runtime";var c={info:`info`,success:`check`,warning:`alert-triangle`,danger:`x`},l=[`info`,`success`,`warning`,`danger`,`neutral`],u=[`sm`,`md`,`lg`],d=[`alert`,`status`,`none`],f=[`linear`,`outline`,`bold`,`bulk`,`broken`,`twotone`];function p(e,t,n,i,a,s){return i?o(`span`,{className:`alert-icon alert-icon-image`,style:s>0?{width:s,height:s}:void 0,children:o(`img`,{src:i,alt:a})}):e?typeof e==`string`?o(`span`,{className:`alert-icon`,children:o(r,{name:e,size:t,variant:n})}):o(`span`,{className:`alert-icon`,children:e}):null}function m(r){let{marker:m,props:h}=e(`AppAlert`,r),{tone:g=`info`,children:_,title:v,icon:y,iconVariant:b,iconSize:x,image:S,imageAlt:C=``,imageSize:w,className:T=``,onClose:E,dismissible:D,bordered:O=!0,accent:k=!1,size:A=`md`,action:j,role:M=`alert`,...N}=h;n(`AppAlert`,N),t(`AppAlert`,`tone`,g,l),t(`AppAlert`,`size`,A,u),t(`AppAlert`,`role`,M,d),t(`AppAlert`,`iconVariant`,b,f);let P=y===void 0?c[g]:y===`none`?null:y,F=!!S||!!P,I=j!=null&&j!==!1,L=v?o(`div`,{className:`alert-heading`,children:v}):null,R=F&&!!L&&!!_,z=x>0?x:A===`lg`?R?17:15:R?13:11;return o(i,{className:[F?`alert-has-icon`:``,I?`alert-has-action`:``,R?`alert-stack`:``,O?``:`alert-borderless`,k?`alert-accent`:``,A===`sm`?`alert-sm`:``,A===`lg`?`alert-lg`:``,T].filter(Boolean).join(` `)||void 0,onClose:E,dismissible:D??typeof E==`function`,transition:!1,role:M===`none`?void 0:M,...m,...N,variant:g,children:F||I?s(a,{children:[F&&p(P,z,b,S,C,w),s(`div`,{className:`alert-content`,children:[L,_]}),I&&o(`div`,{className:`alert-action`,children:j})]}):s(a,{children:[L,_]})})}export{m as default};
@@ -1 +1 @@
1
- import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import r from"./AppIcon.js";import i from"./renderIconProp.js";import{useState as a}from"react";import{jsx as o,jsxs as s}from"react/jsx-runtime";var c=[`info`,`success`,`warning`,`danger`,`neutral`];function l(l){let{marker:u,props:d}=e(`AppBanner`,l),{tone:f=`info`,icon:p,children:m,dismissible:h=!1,onDismiss:g,className:_=``,...v}=d;n(`AppBanner`,v),t(`AppBanner`,`tone`,f,c);let[y,b]=a(!0);if(!y)return null;let x=c.includes(f)?f:`info`,S=()=>{b(!1),g?.()};return s(`div`,{className:`wui-banner wui-banner-${x}${_?` ${_}`:``}`,role:`status`,...u,...v,children:[p&&o(`span`,{className:`wui-banner-icon`,children:i(p,{size:18})}),o(`div`,{className:`wui-banner-body`,children:m}),h&&o(`button`,{type:`button`,className:`wui-banner-dismiss`,"aria-label":`Dismiss`,onClick:S,children:o(r,{name:`x`,size:18})})]})}export{l as default};
1
+ import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import r from"./AppIcon.js";import i from"./renderIconProp.js";import{useState as a}from"react";import{jsx as o,jsxs as s}from"react/jsx-runtime";var c=[`info`,`success`,`warning`,`danger`,`neutral`];function l(l){let{marker:u,props:d}=e(`AppBanner`,l),{tone:f=`info`,icon:p,children:m,dismissible:h=!1,onDismiss:g,action:_,className:v=``,...y}=d;n(`AppBanner`,y),t(`AppBanner`,`tone`,f,c);let[b,x]=a(!0);if(!b)return null;let S=c.includes(f)?f:`info`,C=_!=null&&_!==!1,w=()=>{x(!1),g?.()};return s(`div`,{className:`wui-banner wui-banner-${S}${C?` wui-banner-has-action`:``}${v?` ${v}`:``}`,role:`status`,...u,...y,children:[p&&o(`span`,{className:`wui-banner-icon`,children:i(p,{size:18})}),o(`div`,{className:`wui-banner-body`,children:m}),C&&o(`div`,{className:`wui-banner-action`,children:_}),h&&o(`button`,{type:`button`,className:`wui-banner-dismiss`,"aria-label":`Dismiss`,onClick:w,children:o(r,{name:`x`,size:18})})]})}export{l as default};
@@ -1 +1 @@
1
- import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import ee from"./withTooltip.js";import r from"./AppIcon.js";import te from"./AppAlert.js";import i from"./AppButton.js";import ne from"../lib/FieldMessage.js";import re from"./AppRequiredMark.js";import ie from"./AppModal.js";import ae from"../lib/useFileDrop.js";import{AVATAR_ACCEPT as oe,AVATAR_MAX_SIZE_MB as a,AVATAR_OUTPUT_SIZE as se,AVATAR_OUTPUT_TYPE as o,AVATAR_PREVIEW_SIZES as ce,AVATAR_TEXT as s,DEFAULT_IMAGE_ACCEPT as c,DEFAULT_MAX_SIZE_MB as l,avatarUnreadableMessage as u,validateFile as le}from"@webority/ui-elements/helpers";import{useCallback as ue,useEffect as de,useId as fe,useRef as d,useState as f}from"react";import{Fragment as pe,jsx as p,jsxs as m}from"react/jsx-runtime";import"@webority/ui-elements/elements/image-crop";var me=[`logo`,`avatar`],he=[`overlay`,`buttons`],ge=[`stacked`,`inline`,`profile`],_e=[`initials`,`avatar`],ve=[`circle`,`rounded`,`square`],ye=[`keep`,`image/webp`],be=ce.join(` `),xe={logo:{controls:`overlay`,accept:c,maxSizeMb:l,crop:void 0,rotatable:!1,previews:!1,camera:!1,outputSize:void 0,outputType:`keep`,variant:`initials`,sizes:{sm:72,md:120,lg:160}},avatar:{controls:`buttons`,accept:oe,maxSizeMb:a,crop:1,rotatable:!0,previews:!0,camera:!0,outputSize:se,outputType:o,variant:`avatar`,sizes:{sm:64,md:96,lg:128}}},Se=`That image could not be cropped. Choose another one.`,Ce=`That image could not be opened. Choose another one.`,we={dialogSize:`lg`,dialogTitle:`Crop photo`,dialogSubtitle:`Drag the frame and zoom to choose what to keep.`,save:`Apply`,cancel:`Cancel`,cropFailed:Se,unreadable:()=>Ce},Te={dialogSize:void 0,dialogTitle:s.dialogTitle,dialogSubtitle:s.dialogSubtitle,save:s.save,cancel:s.cancel,cropFailed:s.cropFailed,unreadable:u};function Ee(oe){let{marker:a,props:se}=e(`AppImagePicker`,oe),{kind:o=`logo`,controls:ce,value:c,fallback:l,variant:u,name:Se,onPick:Ce,onRemove:Ee,removeName:h,loading:g=!1,disabled:De=!1,accept:Oe,maxSizeMb:ke,shape:_=`circle`,size:v=`md`,crop:Ae,rotatable:je,previews:Me,camera:Ne,outputSize:Pe,outputType:Fe,layout:y=`stacked`,title:Ie,subtitle:Le,overlayIcon:Re=`image`,overlayLabel:ze=`Update photo`,removeLabel:b=`Remove photo`,ariaLabel:Be,label:Ve,hint:x,error:He,required:Ue=!1,className:We=``,fieldClassName:S=``,style:C,...w}=se;n(`AppImagePicker`,w),t(`AppImagePicker`,`kind`,o,me),t(`AppImagePicker`,`controls`,ce,he),t(`AppImagePicker`,`variant`,u,_e),t(`AppImagePicker`,`layout`,y,ge),t(`AppImagePicker`,`shape`,_,ve),t(`AppImagePicker`,`outputType`,Fe,ye);let T=xe[o]??xe.logo,E=o===`avatar`?Te:we,D=T.sizes;t(`AppImagePicker`,`size`,typeof v==`string`?v:null,Object.keys(D));let Ge=(ce??T.controls)===`overlay`,Ke=u??T.variant,O=Oe??T.accept,k=ke??T.maxSizeMb,A=Pe??T.outputSize,qe=Fe??T.outputType,Je=je??T.rotatable,Ye=Me??T.previews,Xe=Ne??T.camera,j=Ae??T.crop,M=j===`free`?null:typeof j==`number`&&Number.isFinite(j)&&j>0?j:void 0;j!=null&&M===void 0&&t(`AppImagePicker`,`crop`,String(j),[`free`,`a positive number`]);let Ze=M!==void 0&&A===void 0,N=d(null),Qe=d(null),P=d(null),F=fe(),[I,L]=f(null),[$e,R]=f(!1),[et,z]=f(!1),[tt,B]=f(``),[V,H]=f(null),[U,nt]=f(!1),[W,G]=f(`loading`),[rt,K]=f(``),it=ue(e=>{if(P.current=e,!e)return;let t=()=>{G(`ready`),e.querySelector(`.wui-crop-stage`)?.focus()},n=()=>G(`error`);return e.addEventListener(`load`,t),e.addEventListener(`error`,n),()=>{e.removeEventListener(`load`,t),e.removeEventListener(`error`,n),P.current=null}},[]);de(()=>()=>V&&URL.revokeObjectURL(V.url),[V]),de(()=>()=>I&&URL.revokeObjectURL(I),[I]);let[at,ot]=f(c);c!==at&&(ot(c),L(null),R(!1),z(!1));let q=g||De,J=$e?null:I||(c&&!et?c:null),st=!!J,Y=He||tt,X=x&&!Y?`${F}-hint`:void 0,Z=Y?`${F}-error`:void 0,ct=Z||X,lt=!q&&st&&(!!I||!!Ee||!!h),ut=st?s.change:s.choose,dt=typeof v==`number`?v:D[v]??D.md,ft=()=>{q||N.current?.click()},pt=()=>{q||Qe.current?.click()},mt=e=>{if(Se&&N.current&&typeof DataTransfer==`function`){let t=new DataTransfer;t.items.add(e),N.current.files=t.files}R(!1),z(!1),L(URL.createObjectURL(e)),Ce(e)},ht=e=>{let t=M!==void 0&&e.type!==`image/svg+xml`,n=le(e,{accept:O,maxSizeMb:t&&Ze?0:k});if(n){B(n);return}if(B(``),t){G(`loading`),K(``),H({file:e,url:URL.createObjectURL(e)});return}mt(e)},{dragOver:gt,dropProps:_t}=ae({accept:O,maxSizeMb:Ze?0:k,disabled:q,onFiles:e=>ht(e[0]),onReject:({message:e})=>B(e)}),vt=e=>{let t=qe===`keep`?e.type:qe;return A===void 0?{name:e.name,type:t,maxBytes:k>0?k*1024*1024:0}:{name:e.name||`photo`,type:t,size:A}},yt=async()=>{let{file:e}=V;nt(!0),K(``);let t=null;try{t=await P.current?.toFile(vt(e))}catch{t=null}if(nt(!1),!t){K(E.cropFailed);return}if(H(null),Ze){let e=le(t,{accept:O,maxSizeMb:k});e?B(e):mt(t);return}mt(t)},bt=()=>{U||H(null)},xt=e=>{let t=e.target.files?.[0];e.target.value=``,t&&ht(t)},St=()=>{L(null),R(!0),B(``),N.current&&(N.current.value=``),Ee?.()},Q=M!==void 0&&m(ie,{open:!!V,title:E.dialogTitle,subtitle:E.dialogSubtitle,size:E.dialogSize,staticBackdrop:!0,dismissible:!U,onClose:bt,footer:m(pe,{children:[p(i,{type:`button`,variant:`secondary`,disabled:U,onClick:bt,children:E.cancel}),p(i,{type:`button`,variant:`primary`,loading:U,disabled:W!==`ready`,onClick:yt,children:E.save})]}),children:[W===`error`&&V&&p(te,{variant:`danger`,children:E.unreadable(V.file)}),rt&&p(te,{variant:`danger`,children:rt}),V&&W!==`error`&&p(`wui-image-crop`,{ref:it,src:V.url,aspect:M??`free`,round:M===1&&_===`circle`,rotatable:Je,previews:Ye?be:void 0})]}),Ct=h&&p(`input`,{type:`hidden`,name:h,value:`true`,disabled:!$e}),$=Ve&&m(`label`,{className:`label`,htmlFor:F,children:[Ve,Ue&&p(re,{})]}),wt=p(`input`,{id:F,ref:N,type:`file`,name:Se,hidden:!0,accept:O,disabled:q,onChange:xt});if(!Ge){let e=dt,t=Xe&&m(`button`,{type:`button`,className:`btn btn-secondary btn-sm wui-image-picker-buttons-camera`,disabled:q,onClick:pt,children:[p(r,{name:`camera`,size:16}),s.camera]});return m(`div`,{...a,className:`field wui-image-picker-field${S?` ${S}`:``}`,children:[$,m(`div`,{className:`wui-image-picker-buttons${gt?` is-dragging`:``}${We?` ${We}`:``}`,style:{"--wui-avatar-size":`${e}px`,...C},..._t,children:[m(`button`,{type:`button`,className:`wui-image-picker-buttons-face`,tabIndex:-1,"aria-label":Be??ut,"aria-describedby":ct,"aria-busy":g||void 0,disabled:q,onClick:ft,...w,children:[J?p(`img`,{className:`wui-image-picker-buttons-img`,src:J,alt:``,onError:()=>z(!0)}):p(`span`,{className:`wui-image-picker-buttons-placeholder`,"aria-hidden":`true`,children:l||p(r,{name:`user`,size:Math.round(e*.5)})}),p(`span`,{className:`wui-image-picker-buttons-badge`,"aria-hidden":`true`,children:g?p(r,{name:`refresh-cw`,size:14,className:`wui-spin`}):p(r,{name:`camera`,size:14})})]}),m(`div`,{className:`wui-image-picker-buttons-actions`,children:[p(i,{variant:`secondary`,size:`sm`,disabled:q,"aria-describedby":ct,onClick:ft,children:ut}),t,p(i,{variant:`secondary-danger`,size:`sm`,"data-wui-image-picker-remove":!0,hidden:!lt,onClick:St,children:b})]}),wt,Xe&&p(`input`,{ref:Qe,type:`file`,hidden:!0,accept:`image/*`,capture:`user`,disabled:q,onChange:xt}),Ct]}),p(ne,{error:Y,hint:x,errorId:Z,hintId:X}),Q]})}let Tt=dt,Et=Math.max(14,Math.round(Tt*.18)),Dt=Math.round(Tt*.5),Ot=`wui-image-picker${Ke===`avatar`?` wui-image-picker-avatar`:``}${_===`rounded`?` wui-image-picker-rounded`:_===`square`?` wui-image-picker-square`:``}${gt?` is-dragging`:``}`,kt=y===`inline`,At=y===`profile`,jt=[`field`,`wui-image-picker-field`,kt&&`wui-image-picker-field-inline`,At&&`wui-image-picker-field-profile`,We,S].filter(Boolean).join(` `),Mt=m(`div`,{className:`wui-image-picker-shell`,style:{"--wui-logo-size":`${Tt}px`},children:[p(`button`,{type:`button`,className:Ot,onClick:ft,disabled:q,"aria-busy":g||void 0,"aria-label":Be??`Upload photo`,"aria-describedby":Z||X,..._t,...w,children:m(`span`,{className:`wui-image-picker-ring`,"data-overlay-label":ze,children:[J?p(`img`,{className:`wui-image-picker-img`,src:J,alt:``,onError:()=>z(!0)}):p(`span`,{className:`wui-image-picker-logo`,children:l||Ke===`avatar`&&p(r,{name:`user`,size:Dt})}),g?p(`span`,{className:`wui-image-picker-overlay is-loading`,"aria-hidden":`true`,children:p(r,{name:`refresh-cw`,size:Et,className:`wui-spin`})}):!De&&m(`span`,{className:`wui-image-picker-overlay`,children:[p(r,{name:Re,size:Et}),p(`span`,{children:ze})]})]})}),ee(p(`button`,{type:`button`,className:`wui-image-picker-remove`,hidden:!lt,"aria-label":b,"data-wui-image-picker-remove":!0,onClick:St,children:p(r,{name:`x`,size:14})}),lt?b:null),wt,Ct]}),Nt=x&&!Y?p(`div`,{className:`wui-image-picker-hint`,id:X,children:x}):null,Pt=Y?p(ne,{error:Y,errorId:Z}):null,Ft=m(`div`,{className:`wui-image-picker-meta`,children:[Ie&&p(`div`,{className:`wui-image-picker-title`,children:Ie}),Le&&p(`div`,{className:`wui-image-picker-subtitle`,children:Le}),Nt,Pt]});return kt?m(`div`,{...a,className:jt,style:C,children:[$,m(`div`,{className:`wui-image-picker-row`,children:[Mt,Ft]}),Q]}):At?m(`div`,{...a,className:jt,style:C,children:[$,Mt,Ft,Q]}):m(`div`,{...a,className:jt,style:C,children:[$,Mt,Nt,Pt,Q]})}export{Ee as default};
1
+ import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import ee from"./withTooltip.js";import r from"./AppIcon.js";import te from"./AppAlert.js";import i from"./AppButton.js";import ne from"../lib/FieldMessage.js";import re from"./AppRequiredMark.js";import ie from"./AppModal.js";import ae from"../lib/useFileDrop.js";import{AVATAR_ACCEPT as oe,AVATAR_MAX_SIZE_MB as a,AVATAR_OUTPUT_SIZE as se,AVATAR_OUTPUT_TYPE as o,AVATAR_PREVIEW_SIZES as ce,AVATAR_TEXT as s,DEFAULT_IMAGE_ACCEPT as c,DEFAULT_MAX_SIZE_MB as l,avatarUnreadableMessage as u,validateFile as le}from"@webority/ui-elements/helpers";import{useCallback as ue,useEffect as de,useId as fe,useRef as d,useState as f}from"react";import{Fragment as pe,jsx as p,jsxs as m}from"react/jsx-runtime";import"@webority/ui-elements/elements/image-crop";var me=[`logo`,`avatar`],he=[`overlay`,`buttons`],ge=[`stacked`,`inline`,`profile`],_e=[`initials`,`avatar`],ve=[`circle`,`rounded`,`square`],ye=[`keep`,`image/webp`],be=ce.join(` `),xe={logo:{controls:`overlay`,accept:c,maxSizeMb:l,crop:void 0,rotatable:!1,previews:!1,camera:!1,outputSize:void 0,outputType:`keep`,variant:`initials`,sizes:{sm:72,md:120,lg:160}},avatar:{controls:`buttons`,accept:oe,maxSizeMb:a,crop:1,rotatable:!0,previews:!0,camera:!0,outputSize:se,outputType:o,variant:`avatar`,sizes:{sm:64,md:96,lg:128}}},Se=`That image could not be cropped. Choose another one.`,Ce=`That image could not be opened. Choose another one.`,we={dialogSize:`lg`,dialogTitle:`Crop photo`,dialogSubtitle:`Drag the frame and zoom to choose what to keep.`,save:`Apply`,cancel:`Cancel`,cropFailed:Se,unreadable:()=>Ce},Te={dialogSize:void 0,dialogTitle:s.dialogTitle,dialogSubtitle:s.dialogSubtitle,save:s.save,cancel:s.cancel,cropFailed:s.cropFailed,unreadable:u};function Ee(oe){let{marker:a,props:se}=e(`AppImagePicker`,oe),{kind:o=`logo`,controls:ce,value:c,fallback:l,variant:u,name:Se,onPick:Ce,onRemove:Ee,removeName:h,loading:g=!1,disabled:De=!1,accept:Oe,maxSizeMb:ke,shape:_=`circle`,size:v=`md`,crop:Ae,rotatable:je,previews:Me,camera:Ne,outputSize:Pe,outputType:Fe,layout:y=`stacked`,title:Ie,subtitle:Le,overlayIcon:Re=`image`,overlayLabel:ze=`Update photo`,removeLabel:b=`Remove photo`,ariaLabel:Be,label:Ve,hint:x,error:He,required:Ue=!1,className:We=``,fieldClassName:S=``,style:C,...w}=se;n(`AppImagePicker`,w),t(`AppImagePicker`,`kind`,o,me),t(`AppImagePicker`,`controls`,ce,he),t(`AppImagePicker`,`variant`,u,_e),t(`AppImagePicker`,`layout`,y,ge),t(`AppImagePicker`,`shape`,_,ve),t(`AppImagePicker`,`outputType`,Fe,ye);let T=xe[o]??xe.logo,E=o===`avatar`?Te:we,D=T.sizes;t(`AppImagePicker`,`size`,typeof v==`string`?v:null,Object.keys(D));let Ge=(ce??T.controls)===`overlay`,Ke=u??T.variant,O=Oe??T.accept,k=ke??T.maxSizeMb,A=Pe??T.outputSize,qe=Fe??T.outputType,Je=je??T.rotatable,Ye=Me??T.previews,Xe=Ne??T.camera,j=Ae??T.crop,M=j===`free`?null:typeof j==`number`&&Number.isFinite(j)&&j>0?j:void 0;j!=null&&M===void 0&&t(`AppImagePicker`,`crop`,String(j),[`free`,`a positive number`]);let Ze=M!==void 0&&A===void 0,N=d(null),Qe=d(null),P=d(null),F=fe(),[I,L]=f(null),[$e,R]=f(!1),[et,z]=f(!1),[tt,B]=f(``),[V,H]=f(null),[U,nt]=f(!1),[W,G]=f(`loading`),[rt,K]=f(``),it=ue(e=>{if(P.current=e,!e)return;let t=()=>{G(`ready`),e.querySelector(`.wui-crop-stage`)?.focus()},n=()=>G(`error`);return e.addEventListener(`load`,t),e.addEventListener(`error`,n),()=>{e.removeEventListener(`load`,t),e.removeEventListener(`error`,n),P.current=null}},[]);de(()=>()=>V&&URL.revokeObjectURL(V.url),[V]),de(()=>()=>I&&URL.revokeObjectURL(I),[I]);let[at,ot]=f(c);c!==at&&(ot(c),L(null),R(!1),z(!1));let q=g||De,J=$e?null:I||(c&&!et?c:null),st=!!J,Y=He||tt,X=x&&!Y?`${F}-hint`:void 0,Z=Y?`${F}-error`:void 0,ct=Z||X,lt=!q&&st&&(!!I||!!Ee||!!h),ut=st?s.change:s.choose,dt=typeof v==`number`?v:D[v]??D.md,ft=()=>{q||N.current?.click()},pt=()=>{q||Qe.current?.click()},mt=e=>{if(Se&&N.current&&typeof DataTransfer==`function`){let t=new DataTransfer;t.items.add(e),N.current.files=t.files}R(!1),z(!1),L(URL.createObjectURL(e)),Ce(e)},ht=e=>{let t=M!==void 0&&e.type!==`image/svg+xml`,n=le(e,{accept:O,maxSizeMb:t&&Ze?0:k});if(n){B(n);return}if(B(``),t){G(`loading`),K(``),H({file:e,url:URL.createObjectURL(e)});return}mt(e)},{dragOver:gt,dropProps:_t}=ae({accept:O,maxSizeMb:Ze?0:k,disabled:q,onFiles:e=>ht(e[0]),onReject:({message:e})=>B(e)}),vt=e=>{let t=qe===`keep`?e.type:qe;return A===void 0?{name:e.name,type:t,maxBytes:k>0?k*1024*1024:0}:{name:e.name||`photo`,type:t,size:A}},yt=async()=>{let{file:e}=V;nt(!0),K(``);let t=null;try{t=await P.current?.toFile(vt(e))}catch{t=null}if(nt(!1),!t){K(E.cropFailed);return}if(H(null),Ze){let e=le(t,{accept:O,maxSizeMb:k});e?B(e):mt(t);return}mt(t)},bt=()=>{U||H(null)},xt=e=>{let t=e.target.files?.[0];e.target.value=``,t&&ht(t)},St=()=>{L(null),R(!0),B(``),N.current&&(N.current.value=``),Ee?.()},Q=M!==void 0&&m(ie,{open:!!V,title:E.dialogTitle,subtitle:E.dialogSubtitle,size:E.dialogSize,staticBackdrop:!0,dismissible:!U,onClose:bt,footer:m(pe,{children:[p(i,{type:`button`,variant:`secondary`,disabled:U,onClick:bt,children:E.cancel}),p(i,{type:`button`,variant:`primary`,loading:U,disabled:W!==`ready`,onClick:yt,children:E.save})]}),children:[W===`error`&&V&&p(te,{tone:`danger`,children:E.unreadable(V.file)}),rt&&p(te,{tone:`danger`,children:rt}),V&&W!==`error`&&p(`wui-image-crop`,{ref:it,src:V.url,aspect:M??`free`,round:M===1&&_===`circle`,rotatable:Je,previews:Ye?be:void 0})]}),Ct=h&&p(`input`,{type:`hidden`,name:h,value:`true`,disabled:!$e}),$=Ve&&m(`label`,{className:`label`,htmlFor:F,children:[Ve,Ue&&p(re,{})]}),wt=p(`input`,{id:F,ref:N,type:`file`,name:Se,hidden:!0,accept:O,disabled:q,onChange:xt});if(!Ge){let e=dt,t=Xe&&m(`button`,{type:`button`,className:`btn btn-secondary btn-sm wui-image-picker-buttons-camera`,disabled:q,onClick:pt,children:[p(r,{name:`camera`,size:16}),s.camera]});return m(`div`,{...a,className:`field wui-image-picker-field${S?` ${S}`:``}`,children:[$,m(`div`,{className:`wui-image-picker-buttons${gt?` is-dragging`:``}${We?` ${We}`:``}`,style:{"--wui-avatar-size":`${e}px`,...C},..._t,children:[m(`button`,{type:`button`,className:`wui-image-picker-buttons-face`,tabIndex:-1,"aria-label":Be??ut,"aria-describedby":ct,"aria-busy":g||void 0,disabled:q,onClick:ft,...w,children:[J?p(`img`,{className:`wui-image-picker-buttons-img`,src:J,alt:``,onError:()=>z(!0)}):p(`span`,{className:`wui-image-picker-buttons-placeholder`,"aria-hidden":`true`,children:l||p(r,{name:`user`,size:Math.round(e*.5)})}),p(`span`,{className:`wui-image-picker-buttons-badge`,"aria-hidden":`true`,children:g?p(r,{name:`refresh-cw`,size:14,className:`wui-spin`}):p(r,{name:`camera`,size:14})})]}),m(`div`,{className:`wui-image-picker-buttons-actions`,children:[p(i,{variant:`secondary`,size:`sm`,disabled:q,"aria-describedby":ct,onClick:ft,children:ut}),t,p(i,{variant:`secondary-danger`,size:`sm`,"data-wui-image-picker-remove":!0,hidden:!lt,onClick:St,children:b})]}),wt,Xe&&p(`input`,{ref:Qe,type:`file`,hidden:!0,accept:`image/*`,capture:`user`,disabled:q,onChange:xt}),Ct]}),p(ne,{error:Y,hint:x,errorId:Z,hintId:X}),Q]})}let Tt=dt,Et=Math.max(14,Math.round(Tt*.18)),Dt=Math.round(Tt*.5),Ot=`wui-image-picker${Ke===`avatar`?` wui-image-picker-avatar`:``}${_===`rounded`?` wui-image-picker-rounded`:_===`square`?` wui-image-picker-square`:``}${gt?` is-dragging`:``}`,kt=y===`inline`,At=y===`profile`,jt=[`field`,`wui-image-picker-field`,kt&&`wui-image-picker-field-inline`,At&&`wui-image-picker-field-profile`,We,S].filter(Boolean).join(` `),Mt=m(`div`,{className:`wui-image-picker-shell`,style:{"--wui-logo-size":`${Tt}px`},children:[p(`button`,{type:`button`,className:Ot,onClick:ft,disabled:q,"aria-busy":g||void 0,"aria-label":Be??`Upload photo`,"aria-describedby":Z||X,..._t,...w,children:m(`span`,{className:`wui-image-picker-ring`,"data-overlay-label":ze,children:[J?p(`img`,{className:`wui-image-picker-img`,src:J,alt:``,onError:()=>z(!0)}):p(`span`,{className:`wui-image-picker-logo`,children:l||Ke===`avatar`&&p(r,{name:`user`,size:Dt})}),g?p(`span`,{className:`wui-image-picker-overlay is-loading`,"aria-hidden":`true`,children:p(r,{name:`refresh-cw`,size:Et,className:`wui-spin`})}):!De&&m(`span`,{className:`wui-image-picker-overlay`,children:[p(r,{name:Re,size:Et}),p(`span`,{children:ze})]})]})}),ee(p(`button`,{type:`button`,className:`wui-image-picker-remove`,hidden:!lt,"aria-label":b,"data-wui-image-picker-remove":!0,onClick:St,children:p(r,{name:`x`,size:14})}),lt?b:null),wt,Ct]}),Nt=x&&!Y?p(`div`,{className:`wui-image-picker-hint`,id:X,children:x}):null,Pt=Y?p(ne,{error:Y,errorId:Z}):null,Ft=m(`div`,{className:`wui-image-picker-meta`,children:[Ie&&p(`div`,{className:`wui-image-picker-title`,children:Ie}),Le&&p(`div`,{className:`wui-image-picker-subtitle`,children:Le}),Nt,Pt]});return kt?m(`div`,{...a,className:jt,style:C,children:[$,m(`div`,{className:`wui-image-picker-row`,children:[Mt,Ft]}),Q]}):At?m(`div`,{...a,className:jt,style:C,children:[$,Mt,Ft,Q]}):m(`div`,{...a,className:jt,style:C,children:[$,Mt,Nt,Pt,Q]})}export{Ee as default};
@@ -1 +1 @@
1
- import e from"./warnInvalidValue.js";import t from"./warnUnknownProps.js";import n from"../lib/FocusPanel.js";import{cloneElement as r,useId as i,useRef as a,useState as o}from"react";import{OverlayTrigger as s,Popover as c}from"react-bootstrap";import{jsx as l,jsxs as u}from"react/jsx-runtime";var d={start:`left`,end:`right`,top:`top`,bottom:`bottom`,auto:`auto`},f={modifiers:[{name:`computeStyles`,options:{gpuAcceleration:!1}}]},p=[`dialog`];function m({trigger:m,children:h,title:g,placement:_=`bottom`,triggerType:v=`click`,onToggle:y,className:b=``,show:x,role:S,labelledBy:C,autoFocus:w=!1,...T}){t(`AppPopover`,T),e(`AppPopover`,`role`,S,p);let E=i(),D=`${E}-title`,O=a(null),[k,A]=o(!1),j=x!==void 0,M=j?x:k,N=S===`dialog`,P=e=>{j||A(e),y?.(e)},F=u(c,{id:E,className:b||void 0,...N?{role:`dialog`,"aria-modal":`false`,"aria-labelledby":C??(g?D:void 0)}:{},children:[w&&l(n,{triggerRef:O}),g&&l(c.Header,{as:`div`,id:D,children:g}),h==null?null:l(c.Body,{children:h})]}),{onClick:I,"aria-expanded":L,...R}=T,z=m.props[`aria-expanded`],B,V=v===`click`||Array.isArray(v)&&v.includes(`click`);L===void 0?z===void 0?V&&(B=M):B=z:B=L;let H=r(m,{...R,...B===void 0?{}:{"aria-expanded":B},onClick:e=>{O.current=e.currentTarget,I?.(e),typeof m.props.onClick==`function`&&m.props.onClick(e)}}),U=v===`click`,W=v===`hover`||Array.isArray(v)&&v.includes(`hover`);return l(s,{trigger:v,placement:d[_]||_,popperConfig:f,overlay:F,rootClose:U||N,delay:W?{show:80,hide:220}:void 0,onToggle:P,...j?{show:x}:{},children:H})}export{m as default};
1
+ import e from"./warnInvalidValue.js";import t from"./warnUnknownProps.js";import n from"../lib/FocusPanel.js";import{cloneElement as r,useEffect as i,useId as a,useRef as o,useState as s}from"react";import{OverlayTrigger as c,Popover as l}from"react-bootstrap";import{jsx as u,jsxs as d}from"react/jsx-runtime";var f={start:`left`,end:`right`,top:`top`,bottom:`bottom`,auto:`auto`},p={modifiers:[{name:`computeStyles`,options:{gpuAcceleration:!1}}]},m=[`dialog`];function h({trigger:h,children:g,title:_,placement:v=`bottom`,triggerType:y=`click`,onToggle:b,className:x=``,show:S,role:C,labelledBy:w,autoFocus:T=!1,openDelay:E=80,closeDelay:D=220,...O}){t(`AppPopover`,O),e(`AppPopover`,`role`,C,m);let k=a(),A=`${k}-title`,j=o(null),[M,N]=s(!1),P=S!==void 0,F=P?S:M,I=C===`dialog`,L=y===`hover`||Array.isArray(y)&&y.includes(`hover`),R=L&&!P,z=o(null),B=o(M);B.current=M;let V=()=>{clearTimeout(z.current),z.current=null},H=(e,t)=>{V(),z.current=setTimeout(()=>{z.current=null,e!==B.current&&(N(e),b?.(e))},t)};i(()=>()=>clearTimeout(z.current),[]),i(()=>{if(!R||!M)return;let e=e=>{e.key===`Escape`&&(clearTimeout(z.current),z.current=null,N(!1),b?.(!1))};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[R,M,b]);let U=e=>{if(R){H(e,e?E:D);return}P||N(e),b?.(e)},W=I?{role:`dialog`,"aria-modal":`false`,"aria-labelledby":w??(_?A:void 0)}:{},G=R?{onMouseEnter:V,onMouseLeave:()=>H(!1,D),onFocus:V,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||H(!1,D)}}:{},K=d(l,{id:k,className:x||void 0,...W,...G,children:[T&&u(n,{triggerRef:j}),_&&u(l.Header,{as:`div`,id:A,children:_}),g==null?null:u(l.Body,{children:g})]}),{onClick:q,"aria-expanded":J,...Y}=O,X=h.props[`aria-expanded`],Z,Q=y===`click`||Array.isArray(y)&&y.includes(`click`);J===void 0?X===void 0?Q&&(Z=F):Z=X:Z=J;let $=r(h,{...Y,...Z===void 0?{}:{"aria-expanded":Z},onClick:e=>{j.current=e.currentTarget,q?.(e),typeof h.props.onClick==`function`&&h.props.onClick(e)}}),ee=y===`click`;return u(c,{trigger:y,placement:f[v]||v,popperConfig:p,overlay:K,rootClose:ee||I,delay:P&&L?{show:E,hide:D}:void 0,onToggle:U,...P||L?{show:F}:{},children:$})}export{h as default};
@@ -1 +1 @@
1
- import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import r from"./AppAlert.js";import i from"./AppButton.js";import a from"./AppInput.js";import o from"./AppPhoneNumberInput.js";import s,{SECTION_ALIGNS as c,SECTION_HEADINGS as l,SECTION_VARIANTS as u,sectionHeading as d}from"../lib/sectionShell.js";import f from"./AppTextarea.js";import{useId as p,useState as m}from"react";import{jsx as h,jsxs as g}from"react/jsx-runtime";var _=[`name`,`email`,`phone`,`company`,`message`],v={name:`Name`,email:`Email`,phone:`Phone number`,company:`Company`,message:`Message`},y={name:`name`,email:`email`,company:`organization`},b=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,x=`This field is required.`,S=`Enter an email address such as name@example.com.`,C=`We could not send your message. Please try again.`;function w(e,t){let n={};for(let{name:r,required:i=!1}of e){let e=t[r].trim();i&&e===``?n[r]=x:r===`email`&&e!==``&&!b.test(e)&&(n[r]=S)}return n}function T(b){let{marker:x,props:S}=e(`AppSectionLeadCapture`,b),{title:T,text:E,fields:D,onSubmit:O,submitLabel:k=`Send`,successTitle:A,successText:j,consent:M,as:N=`h2`,eyebrow:P,subtitle:F,align:I=`center`,variant:L=`default`,className:R=``,...z}=S;n(`AppSectionLeadCapture`,z),t(`AppSectionLeadCapture`,`as`,N,l),t(`AppSectionLeadCapture`,`align`,I,c),t(`AppSectionLeadCapture`,`variant`,L,u);for(let e of D)t(`AppSectionLeadCapture`,`fields.name`,e.name,_);let B=p(),[V,H]=m(()=>Object.fromEntries(D.map(e=>[e.name,``]))),[U,W]=m({}),[G,K]=m(null),[q,J]=m(!1),[Y,X]=m(!1),Z=(e,t)=>H(n=>({...n,[e]:t}));async function Q(e){if(e.preventDefault(),q)return;let t=w(D,V);if(W(t),K(null),Object.keys(t).length>0)return;let n=Object.fromEntries(Object.entries(V).map(([e,t])=>[e,t.trim()]));J(!0);try{await O(n),X(!0)}catch(e){K(typeof e?.message==`string`&&e.message!==``?e.message:C)}finally{J(!1)}}function $({name:e,label:t=v[e],required:n=!1}){let r=`${B}-${e}`,i=U[e];return e===`phone`?h(o,{id:r,name:e,label:t,required:n,value:V[e],onChange:t=>Z(e,t),error:i},e):e===`message`?h(f,{id:r,name:e,label:t,required:n,value:V[e],onChange:t=>Z(e,t.target.value),error:i},e):h(a,{id:r,name:e,type:e===`email`?`email`:`text`,autoComplete:y[e],label:t,required:n,value:V[e],onChange:t=>Z(e,t.target.value),error:i},e)}return g(s,{component:`AppSectionLeadCapture`,kind:`lead-capture`,title:T,as:d(N,`h2`),eyebrow:P,subtitle:F,align:I,variant:L,className:R,rest:{...x,...z},children:[E!=null&&E!==``&&h(`p`,{className:`wui-section-lead-text`,children:E}),Y?h(`div`,{className:`wui-section-lead-success`,children:h(r,{variant:`success`,title:A,children:j})}):g(`form`,{className:`wui-section-lead-form`,noValidate:!0,onSubmit:Q,children:[h(`div`,{className:`wui-section-lead-fields`,children:D.map($)}),G!=null&&h(r,{variant:`danger`,children:G}),h(i,{type:`submit`,variant:`primary`,loading:q,children:k}),M!=null&&M!==``&&h(`p`,{className:`wui-section-lead-consent`,children:M})]})]})}export{T as default};
1
+ import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import r from"./AppAlert.js";import i from"./AppButton.js";import a from"./AppInput.js";import o from"./AppPhoneNumberInput.js";import s,{SECTION_ALIGNS as c,SECTION_HEADINGS as l,SECTION_VARIANTS as u,sectionHeading as d}from"../lib/sectionShell.js";import f from"./AppTextarea.js";import{useId as p,useState as m}from"react";import{jsx as h,jsxs as g}from"react/jsx-runtime";var _=[`name`,`email`,`phone`,`company`,`message`],v={name:`Name`,email:`Email`,phone:`Phone number`,company:`Company`,message:`Message`},y={name:`name`,email:`email`,company:`organization`},b=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,x=`This field is required.`,S=`Enter an email address such as name@example.com.`,C=`We could not send your message. Please try again.`;function w(e,t){let n={};for(let{name:r,required:i=!1}of e){let e=t[r].trim();i&&e===``?n[r]=x:r===`email`&&e!==``&&!b.test(e)&&(n[r]=S)}return n}function T(b){let{marker:x,props:S}=e(`AppSectionLeadCapture`,b),{title:T,text:E,fields:D,onSubmit:O,submitLabel:k=`Send`,successTitle:A,successText:j,consent:M,as:N=`h2`,eyebrow:P,subtitle:F,align:I=`center`,variant:L=`default`,className:R=``,...z}=S;n(`AppSectionLeadCapture`,z),t(`AppSectionLeadCapture`,`as`,N,l),t(`AppSectionLeadCapture`,`align`,I,c),t(`AppSectionLeadCapture`,`variant`,L,u);for(let e of D)t(`AppSectionLeadCapture`,`fields.name`,e.name,_);let B=p(),[V,H]=m(()=>Object.fromEntries(D.map(e=>[e.name,``]))),[U,W]=m({}),[G,K]=m(null),[q,J]=m(!1),[Y,X]=m(!1),Z=(e,t)=>H(n=>({...n,[e]:t}));async function Q(e){if(e.preventDefault(),q)return;let t=w(D,V);if(W(t),K(null),Object.keys(t).length>0)return;let n=Object.fromEntries(Object.entries(V).map(([e,t])=>[e,t.trim()]));J(!0);try{await O(n),X(!0)}catch(e){K(typeof e?.message==`string`&&e.message!==``?e.message:C)}finally{J(!1)}}function $({name:e,label:t=v[e],required:n=!1}){let r=`${B}-${e}`,i=U[e];return e===`phone`?h(o,{id:r,name:e,label:t,required:n,value:V[e],onChange:t=>Z(e,t),error:i},e):e===`message`?h(f,{id:r,name:e,label:t,required:n,value:V[e],onChange:t=>Z(e,t.target.value),error:i},e):h(a,{id:r,name:e,type:e===`email`?`email`:`text`,autoComplete:y[e],label:t,required:n,value:V[e],onChange:t=>Z(e,t.target.value),error:i},e)}return g(s,{component:`AppSectionLeadCapture`,kind:`lead-capture`,title:T,as:d(N,`h2`),eyebrow:P,subtitle:F,align:I,variant:L,className:R,rest:{...x,...z},children:[E!=null&&E!==``&&h(`p`,{className:`wui-section-lead-text`,children:E}),Y?h(`div`,{className:`wui-section-lead-success`,children:h(r,{tone:`success`,title:A,children:j})}):g(`form`,{className:`wui-section-lead-form`,noValidate:!0,onSubmit:Q,children:[h(`div`,{className:`wui-section-lead-fields`,children:D.map($)}),G!=null&&h(r,{tone:`danger`,children:G}),h(i,{type:`submit`,variant:`primary`,loading:q,children:k}),M!=null&&M!==``&&h(`p`,{className:`wui-section-lead-consent`,children:M})]})]})}export{T as default};
@@ -2,7 +2,7 @@
2
2
  "format": "webority-guidance/1",
3
3
  "package": {
4
4
  "name": "@webority/ui-react",
5
- "version": "0.112.3"
5
+ "version": "0.114.0"
6
6
  },
7
7
  "components": [
8
8
  {
@@ -220,12 +220,12 @@
220
220
  ],
221
221
  "do": [
222
222
  {
223
- "note": "Match the variant to intent and say what to do next. A danger alert names the problem and the recovery.",
223
+ "note": "Match the tone to intent and say what to do next. A danger alert names the problem and the recovery.",
224
224
  "example": [
225
225
  {
226
226
  "component": "AppAlert",
227
227
  "props": {
228
- "variant": "danger"
228
+ "tone": "danger"
229
229
  },
230
230
  "children": "We couldn't save your changes: check the highlighted fields and try again."
231
231
  }
@@ -237,7 +237,7 @@
237
237
  {
238
238
  "component": "AppAlert",
239
239
  "props": {
240
- "variant": "info"
240
+ "tone": "info"
241
241
  },
242
242
  "children": "Reports use the latest IEC 62305-2 methodology."
243
243
  }
@@ -251,7 +251,7 @@
251
251
  {
252
252
  "component": "AppAlert",
253
253
  "props": {
254
- "variant": "success"
254
+ "tone": "success"
255
255
  },
256
256
  "children": "Something went wrong while saving."
257
257
  }
@@ -263,7 +263,7 @@
263
263
  {
264
264
  "component": "AppAlert",
265
265
  "props": {
266
- "variant": "warning"
266
+ "tone": "warning"
267
267
  },
268
268
  "children": "Reports use the latest IEC 62305-2 methodology."
269
269
  }
@@ -11,7 +11,7 @@
11
11
  * `accent` adds the thick left edge that marks such an aside.
12
12
  *
13
13
  * @param {object} props
14
- * @param {"info"|"success"|"warning"|"danger"|"neutral"} [props.variant]
14
+ * @param {"info"|"success"|"warning"|"danger"|"neutral"} [props.tone]
15
15
  * @param {import('react').ReactNode} props.children The alert body.
16
16
  * @param {import('react').ReactNode} [props.title]
17
17
  * @param {string|import('react').ReactNode} [props.icon]
@@ -34,11 +34,11 @@ export default function AppAlert(props: {
34
34
  * The status tone. Neutral is a plain notice in ink on a grey surface, with no semantic colour.
35
35
  * @default "info"
36
36
  */
37
- variant?: "info" | "success" | "warning" | "danger" | "neutral";
37
+ tone?: "info" | "success" | "warning" | "danger" | "neutral";
38
38
  children: import('react').ReactNode;
39
39
  /** A bold heading line above the body. */
40
40
  title?: import('react').ReactNode;
41
- /** A leading glyph, given as a semantic icon name. It defaults to the glyph of the variant; pass null for no badge. */
41
+ /** A leading glyph, given as a semantic icon name. It defaults to the glyph of the tone; pass null for no badge. */
42
42
  icon?: string | import('react').ReactNode;
43
43
  /** The iconsax style of a named icon. It does not change an image. */
44
44
  iconVariant?: 'linear' | 'outline' | 'bold' | 'bulk' | 'broken' | 'twotone';
@@ -62,12 +62,12 @@ export default function AppAlert(props: {
62
62
  /** Shows the close button. It is on by default when a close handler is set. */
63
63
  dismissible?: boolean;
64
64
  /**
65
- * Draws the soft border of the variant. False keeps only the tint fill.
65
+ * Draws the soft border of the tone. False keeps only the tint fill.
66
66
  * @default true
67
67
  */
68
68
  bordered?: boolean;
69
69
  /**
70
- * A thick left edge in the variant colour, marking the alert as an aside.
70
+ * A thick left edge in the tone colour, marking the alert as an aside.
71
71
  * @default false
72
72
  */
73
73
  accent?: boolean;
@@ -10,6 +10,7 @@
10
10
  * @param {import('react').ReactNode} props.children The message; may include an inline action link.
11
11
  * @param {boolean} [props.dismissible]
12
12
  * @param {() => void} [props.onDismiss] Called after the banner is dismissed.
13
+ * @param {import('react').ReactNode} [props.action] A button or link at the banner's right edge.
13
14
  * @param {string} [props.className]
14
15
  */
15
16
  export default function AppBanner(props: {
@@ -27,6 +28,8 @@ export default function AppBanner(props: {
27
28
  */
28
29
  dismissible?: boolean;
29
30
  onDismiss?: () => void;
31
+ /** A button or link at the banner's right edge; it wraps below the message on a phone. */
32
+ action?: import('react').ReactNode;
30
33
  /**
31
34
  * Extra classes on the banner.
32
35
  * @default ""
@@ -17,8 +17,10 @@
17
17
  * @param {'dialog'} [props.role]
18
18
  * @param {string} [props.labelledBy]
19
19
  * @param {boolean} [props.autoFocus]
20
+ * @param {number} [props.openDelay] Milliseconds a hover popover waits before it opens.
21
+ * @param {number} [props.closeDelay] Milliseconds a hover popover waits before it closes after the pointer leaves the trigger and the panel.
20
22
  */
21
- export default function AppPopover({ trigger, children, title, placement, triggerType, onToggle, className, show, role, labelledBy, autoFocus, ...rest }: {
23
+ export default function AppPopover({ trigger, children, title, placement, triggerType, onToggle, className, show, role, labelledBy, autoFocus, openDelay, closeDelay, ...rest }: {
22
24
  /** The element the panel opens from. It must be a single element that forwards a ref, such as a plain element, AppButton or AppActionIcon. */
23
25
  trigger: import('react').ReactElement;
24
26
  children: import('react').ReactNode;
@@ -47,4 +49,14 @@ export default function AppPopover({ trigger, children, title, placement, trigge
47
49
  * @default false
48
50
  */
49
51
  autoFocus?: boolean;
52
+ /**
53
+ * Milliseconds a hover popover waits before it opens.
54
+ * @default 80
55
+ */
56
+ openDelay?: number;
57
+ /**
58
+ * Milliseconds a hover popover waits before it closes after the pointer leaves the trigger and the panel.
59
+ * @default 220
60
+ */
61
+ closeDelay?: number;
50
62
  }): import("react").JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webority/ui-react",
3
- "version": "0.112.3",
3
+ "version": "0.114.0",
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",
@@ -29,9 +29,9 @@
29
29
  },
30
30
  "sideEffects": false,
31
31
  "dependencies": {
32
- "@webority/markdown-core": "0.112.3",
33
- "@webority/theme": "0.112.3",
34
- "@webority/ui-elements": "0.112.3"
32
+ "@webority/markdown-core": "0.114.0",
33
+ "@webority/theme": "0.114.0",
34
+ "@webority/ui-elements": "0.114.0"
35
35
  },
36
36
  "peerDependencies": {
37
37
  "@webority/analytics": "^0.30.0",
@@ -57,8 +57,8 @@
57
57
  "typescript": "^7.0.2",
58
58
  "vite": "^8.0.12",
59
59
  "vitest": "5.0.1",
60
- "@webority/canvas-kit": "0.112.3",
61
- "@webority/tokens": "0.112.3"
60
+ "@webority/canvas-kit": "0.114.0",
61
+ "@webority/tokens": "0.114.0"
62
62
  },
63
63
  "scripts": {
64
64
  "build": "vite build && tsc -p tsconfig.json && node ../../scripts/inject-meta-docs.mjs && node ../canvas-kit/dist/cli.js build --config canvas-kit.json --out dist/canvas-kit && node ../canvas-kit/dist/cli.js guidance --config canvas-kit.json --out dist/guidance.json && node ../../scripts/sync-rcl-assets.mjs analytics",