@webority/ui-react 0.113.0 → 0.115.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
@@ -87377,11 +87413,11 @@ function BQe(r) {
87377
87413
  })] }),
87378
87414
  children: [
87379
87415
  Le === "error" && Ne && t(ms, {
87380
- variant: "danger",
87416
+ tone: "danger",
87381
87417
  children: se.unreadable(Ne.file)
87382
87418
  }),
87383
87419
  ze && t(ms, {
87384
- variant: "danger",
87420
+ tone: "danger",
87385
87421
  children: ze
87386
87422
  }),
87387
87423
  Ne && Le !== "error" && t("wui-image-crop", {
@@ -126756,7 +126792,7 @@ function Amt(e) {
126756
126792
  }), j ? t("div", {
126757
126793
  className: "wui-section-lead-success",
126758
126794
  children: t(ms, {
126759
- variant: "success",
126795
+ tone: "success",
126760
126796
  title: u,
126761
126797
  children: d
126762
126798
  })
@@ -126770,7 +126806,7 @@ function Amt(e) {
126770
126806
  children: s.map(F)
126771
126807
  }),
126772
126808
  D != null && t(ms, {
126773
- variant: "danger",
126809
+ tone: "danger",
126774
126810
  children: D
126775
126811
  }),
126776
126812
  t(bs, {
@@ -133480,7 +133516,7 @@ var iyt = u(function({ compact: r, tenant: i, "aria-label": a, className: o, ...
133480
133516
  kind: "WeborityWeb",
133481
133517
  library: {
133482
133518
  name: "@webority/ui-react",
133483
- version: "0.113.0"
133519
+ version: "0.115.0"
133484
133520
  },
133485
133521
  rendererProtocolVersion: 13,
133486
133522
  platform: "Web",
@@ -133848,7 +133884,7 @@ var iyt = u(function({ compact: r, tenant: i, "aria-label": a, className: o, ...
133848
133884
  name: "accent",
133849
133885
  type: "boolean",
133850
133886
  required: !1,
133851
- 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.",
133852
133888
  default: !1
133853
133889
  },
133854
133890
  {
@@ -133861,7 +133897,7 @@ var iyt = u(function({ compact: r, tenant: i, "aria-label": a, className: o, ...
133861
133897
  name: "bordered",
133862
133898
  type: "boolean",
133863
133899
  required: !1,
133864
- 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.",
133865
133901
  default: !0
133866
133902
  },
133867
133903
  {
@@ -133881,7 +133917,7 @@ var iyt = u(function({ compact: r, tenant: i, "aria-label": a, className: o, ...
133881
133917
  name: "icon",
133882
133918
  type: "icon",
133883
133919
  required: !1,
133884
- 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."
133885
133921
  },
133886
133922
  {
133887
133923
  name: "iconSize",
@@ -133953,7 +133989,7 @@ var iyt = u(function({ compact: r, tenant: i, "aria-label": a, className: o, ...
133953
133989
  description: "A bold heading line above the body."
133954
133990
  },
133955
133991
  {
133956
- name: "variant",
133992
+ name: "tone",
133957
133993
  type: "enum",
133958
133994
  enum: [
133959
133995
  "danger",
@@ -133996,17 +134032,17 @@ var iyt = u(function({ compact: r, tenant: i, "aria-label": a, className: o, ...
133996
134032
  }
133997
134033
  ],
133998
134034
  do: [{
133999
- 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.",
134000
134036
  example: [{
134001
134037
  component: "AppAlert",
134002
- props: { variant: "danger" },
134038
+ props: { tone: "danger" },
134003
134039
  children: "We couldn't save your changes: check the highlighted fields and try again."
134004
134040
  }]
134005
134041
  }, {
134006
134042
  note: "A neutral, informational notice uses the info tone: calm, not alarming.",
134007
134043
  example: [{
134008
134044
  component: "AppAlert",
134009
- props: { variant: "info" },
134045
+ props: { tone: "info" },
134010
134046
  children: "Reports use the latest IEC 62305-2 methodology."
134011
134047
  }]
134012
134048
  }],
@@ -134014,14 +134050,14 @@ var iyt = u(function({ compact: r, tenant: i, "aria-label": a, className: o, ...
134014
134050
  note: "A success (green) tone on an error message contradicts the words. The colour lies about what happened.",
134015
134051
  example: [{
134016
134052
  component: "AppAlert",
134017
- props: { variant: "success" },
134053
+ props: { tone: "success" },
134018
134054
  children: "Something went wrong while saving."
134019
134055
  }]
134020
134056
  }, {
134021
134057
  note: "A warning (amber) tone on a purely informational message implies a problem that is not there.",
134022
134058
  example: [{
134023
134059
  component: "AppAlert",
134024
- props: { variant: "warning" },
134060
+ props: { tone: "warning" },
134025
134061
  children: "Reports use the latest IEC 62305-2 methodology."
134026
134062
  }]
134027
134063
  }],
@@ -134829,6 +134865,12 @@ var iyt = u(function({ compact: r, tenant: i, "aria-label": a, className: o, ...
134829
134865
  marker: "AppBanner",
134830
134866
  acceptsChildren: !0,
134831
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
+ },
134832
134874
  {
134833
134875
  name: "className",
134834
134876
  type: "string",
@@ -146560,12 +146602,26 @@ var iyt = u(function({ compact: r, tenant: i, "aria-label": a, className: o, ...
146560
146602
  description: "Extra classes on the popover panel.",
146561
146603
  default: ""
146562
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
+ },
146563
146612
  {
146564
146613
  name: "labelledBy",
146565
146614
  type: "string",
146566
146615
  required: !1,
146567
146616
  description: "The id of the element that names a dialog panel. It wins over the title."
146568
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
+ },
146569
146625
  {
146570
146626
  name: "placement",
146571
146627
  type: "enum",
@@ -2,7 +2,7 @@
2
2
  "kind": "WeborityWeb",
3
3
  "library": {
4
4
  "name": "@webority/ui-react",
5
- "version": "0.113.0"
5
+ "version": "0.115.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.113.0",
3
+ "version": "0.115.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.113.0"
9
+ "version": "0.115.0"
10
10
  },
11
11
  "files": {
12
12
  "manifest.json": {
13
- "sha256": "507e46306b003ed13b82c96b6cd126a2b50d9750ffbac40d25f60e4ed79015b2",
14
- "bytes": 857685
13
+ "sha256": "fc11cfacd3f26beb34544aff96b00c418be9e61c164015dc41fcfd43fbd3c303",
14
+ "bytes": 858353
15
15
  },
16
16
  "kit.js": {
17
- "sha256": "6266a26d8d26d3baa189b1e54ef3377b24ebea7530217cb4ca801fce6fd2b379",
18
- "bytes": 10907516
17
+ "sha256": "ddb72d05323d932251e834ec1e00d08629a22768d18080d7694f23d145267107",
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.113.0"
5
+ "version": "0.115.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.113.0",
3
+ "version": "0.115.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.113.0",
33
- "@webority/theme": "0.113.0",
34
- "@webority/ui-elements": "0.113.0"
32
+ "@webority/markdown-core": "0.115.0",
33
+ "@webority/ui-elements": "0.115.0",
34
+ "@webority/theme": "0.115.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.113.0",
61
- "@webority/tokens": "0.113.0"
60
+ "@webority/canvas-kit": "0.115.0",
61
+ "@webority/tokens": "0.115.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",