@stenajs-webui/core 21.41.0 → 21.42.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.
package/dist/index.es.js CHANGED
@@ -1,34 +1,34 @@
1
1
  (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode("._separatorLine_nzfcz_1{display:flex;border:0;margin:0;flex:none}._visuallyHidden_1gevf_1{border:0;clip:rect(0 0 0 0);height:1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}._text_1iisw_1{--swui-text-color: var(--swui-text-primary-color);--swui-text-color-caption: var(--lhds-color-ui-600);--swui-text-color-overline: var(--lhds-color-ui-600);--swui-text-font-family: var(--swui-font-primary);--swui-text-font-weight: var(--swui-font-weight-text);--current-color: var(--swui-text-color);--current-font-size: var(--swui-font-size-medium);--current-line-height: var(--swui-line-height-medium);--current-font-weight: var(--swui-text-font-weight);--current-letter-spacing: var(--swui-text-letter-spacing);font-size:var(--current-font-size);line-height:var(--current-line-height);color:var(--current-color);letter-spacing:var(--current-letter-spacing);font-family:var(--swui-text-font-family);font-weight:var(--current-font-weight)}._text_1iisw_1._bold_1iisw_27{--current-font-weight: var(--swui-font-weight-text-bold)}._text_1iisw_1._caption_1iisw_31{--current-font-size: var(--swui-font-size-small);--current-line-height: var(--swui-line-height-small);--current-color: var(--swui-text-color-caption);--current-letter-spacing: 0;font-style:italic}._text_1iisw_1._overline_1iisw_39{--current-font-size: var(--swui-font-size-smaller);--current-line-height: var(--swui-line-height-smaller);--current-color: var(--swui-text-color-overline);--current-font-weight: var(--swui-font-weight-text-bold);--current-letter-spacing: .1rem;text-transform:uppercase}._text_1iisw_1._large_1iisw_48{--current-font-size: var(--swui-font-size-large);--current-line-height: var(--swui-line-height-large)}._text_1iisw_1._medium_1iisw_53{--current-font-size: var(--swui-font-size-medium);--current-line-height: var(--swui-line-height-medium)}._text_1iisw_1._small_1iisw_58{--current-font-size: var(--swui-font-size-small);--current-line-height: var(--swui-line-height-small)}._text_1iisw_1._smaller_1iisw_63{--current-font-size: var(--swui-font-size-smaller);--current-line-height: var(--swui-line-height-smaller)}._heading_1cnsg_1{font-size:2rem;color:var(--swui-text-primary-color);letter-spacing:0;margin:0;line-height:var(--swui-line-height);font-family:var(--swui-font-primary);font-weight:var(--swui-font-weight-text-bold)}._heading_1cnsg_1._h1_1cnsg_10{font-size:2.8rem}._heading_1cnsg_1._h2_1cnsg_14{font-size:2.4rem}._heading_1cnsg_1._h3_1cnsg_18{font-size:2rem}._heading_1cnsg_1._h4_1cnsg_22{font-size:1.8rem}._heading_1cnsg_1._h5_1cnsg_26{font-size:1.6rem}._heading_1cnsg_1._h6_1cnsg_30{font-size:1.4rem}")),document.head.appendChild(e)}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}})();
2
- import { cssColor as D } from "@stenajs-webui/theme";
3
- import { jsx as a, Fragment as T } from "react/jsx-runtime";
4
- import H, { forwardRef as h, useState as y, useCallback as m, useLayoutEffect as M, useRef as g, useEffect as d, useMemo as O } from "react";
5
- import S from "@emotion/styled";
6
- import { system as z, background as F, border as N, borderRight as U, borderLeft as V, borderTop as q, borderBottom as j, borderColor as B, borderRadius as W, borderStyle as X, borderWidth as G, boxShadow as Y, flexbox as K, overflow as Z, position as J, layout as Q, zIndex as ee, left as te, right as re, top as ue, bottom as ne } from "styled-system";
7
- import { memoize as oe, pickBy as se, debounce as ie } from "lodash-es";
2
+ import { cssColor as H } from "@stenajs-webui/theme";
3
+ import { jsx as l, Fragment as T, jsxs as D } from "react/jsx-runtime";
4
+ import N, { forwardRef as f, useState as h, useCallback as m, useLayoutEffect as O, useRef as g, createContext as U, useEffect as p, useMemo as S, useContext as V } from "react";
5
+ import C from "@emotion/styled";
6
+ import { system as j, background as q, border as B, borderRight as W, borderLeft as X, borderTop as G, borderBottom as Y, borderColor as K, borderRadius as Z, borderStyle as J, borderWidth as Q, boxShadow as ee, flexbox as te, overflow as re, position as ne, layout as ue, zIndex as oe, left as se, right as ie, top as ae, bottom as ce } from "styled-system";
7
+ import { memoize as le, pickBy as de, debounce as pe } from "lodash-es";
8
8
  import A from "classnames";
9
- const ae = "_separatorLine_nzfcz_1", ce = {
10
- separatorLine: ae
11
- }, rt = h(
9
+ const me = "_separatorLine_nzfcz_1", he = {
10
+ separatorLine: me
11
+ }, it = f(
12
12
  ({
13
- color: e = D("--lhds-color-ui-300"),
13
+ color: e = H("--lhds-color-ui-300"),
14
14
  size: t = "100%",
15
15
  width: r = "1px",
16
- vertical: u = !1
17
- }, n) => /* @__PURE__ */ a(
16
+ vertical: n = !1
17
+ }, u) => /* @__PURE__ */ l(
18
18
  "hr",
19
19
  {
20
- className: ce.separatorLine,
20
+ className: he.separatorLine,
21
21
  "aria-hidden": !0,
22
22
  color: e,
23
23
  style: {
24
24
  backgroundColor: e,
25
- height: u ? t || "100%" : r || "1px",
26
- width: u ? r || "1px" : t || "100%"
25
+ height: n ? t || "100%" : r || "1px",
26
+ width: n ? r || "1px" : t || "100%"
27
27
  },
28
- ref: n
28
+ ref: u
29
29
  }
30
30
  )
31
- ), le = S.button`
31
+ ), fe = C.button`
32
32
  display: inline-block;
33
33
  user-select: none;
34
34
  border: 0;
@@ -51,46 +51,46 @@ const ae = "_separatorLine_nzfcz_1", ce = {
51
51
  ${({ width: e }) => e ? `width: ${e};` : ""}
52
52
  ${({ height: e }) => e ? `height: ${e};` : ""}
53
53
  ${({ borderRadius: e }) => e ? `border-radius: ${e};` : ""}
54
- `, ut = h(
54
+ `, at = f(
55
55
  ({
56
56
  disableFocusHighlight: e,
57
57
  onClick: t,
58
58
  onDblClick: r,
59
- tooltip: u,
60
- disableOpacityOnClick: n,
59
+ tooltip: n,
60
+ disableOpacityOnClick: u,
61
61
  disablePointer: o,
62
62
  opacityOnHover: s,
63
- disabled: c,
63
+ disabled: a,
64
64
  children: i,
65
- background: l = "transparent",
66
- hoverBackground: p,
67
- focusBackground: f,
65
+ background: c = "transparent",
66
+ hoverBackground: d,
67
+ focusBackground: b,
68
68
  type: k = "button",
69
69
  ..._
70
- }, P) => /* @__PURE__ */ a(
71
- le,
70
+ }, P) => /* @__PURE__ */ l(
71
+ fe,
72
72
  {
73
73
  opacityOnHover: s,
74
- title: u,
75
- disabled: c,
76
- disableOpacityOnClick: n,
74
+ title: n,
75
+ disabled: a,
76
+ disableOpacityOnClick: u,
77
77
  onClick: t,
78
78
  onDoubleClick: r,
79
79
  disableFocusHighlight: e,
80
80
  pointer: !!(t || r) && !o,
81
81
  ref: P,
82
- background: l,
83
- hoverBackground: p,
84
- focusBackground: f,
82
+ background: c,
83
+ hoverBackground: d,
84
+ focusBackground: b,
85
85
  type: k,
86
86
  ..._,
87
87
  children: i
88
88
  }
89
89
  )
90
- ), x = (e) => e == null ? 0 : typeof e == "boolean" ? e ? 1 : 0 : e, de = (e) => {
90
+ ), x = (e) => e == null ? 0 : typeof e == "boolean" ? e ? 1 : 0 : e, ge = (e) => {
91
91
  if (e !== 0)
92
92
  return `calc(${e} * var(--swui-metrics-space))`;
93
- }, C = (e) => de(x(e)), pe = {
93
+ }, I = (e) => ge(x(e)), be = {
94
94
  // react props
95
95
  // https://github.com/facebook/react/blob/5495a7f24aef85ba6937truetrue1ce962673ca9f5fde6/src/renderers/dom/shared/hooks/ReactDOMUnknownPropertyHook.js
96
96
  children: !0,
@@ -577,16 +577,16 @@ const ae = "_separatorLine_nzfcz_1", ce = {
577
577
  for: !0,
578
578
  class: !0,
579
579
  autofocus: !0
580
- }, me = `^((${Object.keys(pe).join(
580
+ }, ve = `^((${Object.keys(be).join(
581
581
  "|"
582
- )})|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$`, he = new RegExp(me), ge = oe(
583
- (e) => he.test(e) || e.charCodeAt(0) === 111 && e.charCodeAt(1) === 110 && e.charCodeAt(2) < 91
584
- ), fe = {
582
+ )})|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$`, ye = new RegExp(ve), we = le(
583
+ (e) => ye.test(e) || e.charCodeAt(0) === 111 && e.charCodeAt(1) === 110 && e.charCodeAt(2) < 91
584
+ ), xe = {
585
585
  box: "var(--swui-shadow-box)",
586
586
  popover: "var(--swui-shadow-popover)",
587
587
  modal: "var(--swui-shadow-modal)",
588
588
  bottom: "var(--swui-shadow-bottom)"
589
- }, ye = [
589
+ }, ke = [
590
590
  "spacing",
591
591
  "indent",
592
592
  "gap",
@@ -594,7 +594,7 @@ const ae = "_separatorLine_nzfcz_1", ce = {
594
594
  "height",
595
595
  "overflow",
596
596
  "display"
597
- ], ve = (e) => ye.includes(e), be = z({
597
+ ], _e = (e) => ke.includes(e), $e = j({
598
598
  row: {
599
599
  property: "flexDirection",
600
600
  transform: (e) => e ? "row" : "column"
@@ -616,18 +616,18 @@ const ae = "_separatorLine_nzfcz_1", ce = {
616
616
  },
617
617
  columnGap: {
618
618
  property: "columnGap",
619
- transform: C
619
+ transform: I
620
620
  },
621
621
  rowGap: {
622
622
  property: "rowGap",
623
- transform: C
623
+ transform: I
624
624
  },
625
625
  shadow: {
626
626
  property: "boxShadow",
627
- transform: (e) => fe[e] ?? e
627
+ transform: (e) => xe[e] ?? e
628
628
  }
629
- }), b = S("div", {
630
- shouldForwardProp: (e) => typeof e == "string" ? ve(e) ? !1 : ge(e) : !1
629
+ }), y = C("div", {
630
+ shouldForwardProp: (e) => typeof e == "string" ? _e(e) ? !1 : we(e) : !1
631
631
  })`
632
632
  --current-spacing: 0;
633
633
  --current-indent: 0;
@@ -635,13 +635,8 @@ const ae = "_separatorLine_nzfcz_1", ce = {
635
635
  box-sizing: border-box;
636
636
  display: flex;
637
637
  flex-direction: column;
638
- ${be};
639
- ${F};
640
- ${N};
641
- ${U};
642
- ${V};
638
+ ${$e};
643
639
  ${q};
644
- ${j};
645
640
  ${B};
646
641
  ${W};
647
642
  ${X};
@@ -654,8 +649,13 @@ const ae = "_separatorLine_nzfcz_1", ce = {
654
649
  ${ee};
655
650
  ${te};
656
651
  ${re};
657
- ${ue};
658
652
  ${ne};
653
+ ${ue};
654
+ ${oe};
655
+ ${se};
656
+ ${ie};
657
+ ${ae};
658
+ ${ce};
659
659
 
660
660
  gap: calc(var(--current-gap) * var(--swui-metrics-space));
661
661
 
@@ -676,232 +676,277 @@ const ae = "_separatorLine_nzfcz_1", ce = {
676
676
  ${({ focusWithinBackground: e }) => e ? `background: ${e};` : ""}
677
677
  ${({ focusWithinBorder: e }) => e ? `border: ${e};` : ""}
678
678
  }
679
- `, nt = h(
679
+ `, ct = f(
680
680
  function(t, r) {
681
- return /* @__PURE__ */ a(b, { ref: r, ...t });
681
+ return /* @__PURE__ */ l(y, { ref: r, ...t });
682
682
  }
683
- ), we = (e) => {
684
- const { x: t, y: r, width: u, height: n, bottom: o, top: s, left: c, right: i } = e.getBoundingClientRect();
683
+ ), Se = (e) => {
684
+ const { x: t, y: r, width: n, height: u, bottom: o, top: s, left: a, right: i } = e.getBoundingClientRect();
685
685
  return {
686
- width: u,
687
- height: n,
686
+ width: n,
687
+ height: u,
688
688
  top: s,
689
- left: c,
689
+ left: a,
690
690
  x: t,
691
691
  y: r,
692
692
  right: i,
693
693
  bottom: o
694
694
  };
695
- }, xe = (e, t) => e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height && e.bottom === t.bottom && e.top === t.top && e.left === t.left && e.right === t.right, ke = (e, t) => {
696
- const [r, u] = y(), n = m(() => {
695
+ }, Ce = (e, t) => e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height && e.bottom === t.bottom && e.top === t.top && e.left === t.left && e.right === t.right, Ee = (e, t) => {
696
+ const [r, n] = h(), u = m(() => {
697
697
  window.requestAnimationFrame(() => {
698
698
  if (e.current) {
699
- const o = we(e.current);
700
- (!r || !xe(r, o)) && t && t(o), u(o);
699
+ const o = Se(e.current);
700
+ (!r || !Ce(r, o)) && t && t(o), n(o);
701
701
  }
702
702
  });
703
- }, [e, r, u, t]);
704
- return M(() => {
705
- n();
706
- }, [n]), {
703
+ }, [e, r, n, t]);
704
+ return O(() => {
705
+ u();
706
+ }, [u]), {
707
707
  dimensions: r
708
708
  };
709
- }, ot = h(
710
- function({ onResize: t, ...r }, u) {
711
- const n = g(null);
712
- return ke(u ?? n, t), /* @__PURE__ */ a(b, { ...r, ref: u });
709
+ }, lt = f(
710
+ function({ onResize: t, ...r }, n) {
711
+ const u = g(null);
712
+ return Ee(n ?? u, t), /* @__PURE__ */ l(y, { ...r, ref: n });
713
713
  }
714
- ), st = h(
714
+ ), dt = f(
715
715
  function(t, r) {
716
- return /* @__PURE__ */ a(b, { row: !0, ref: r, ...t });
716
+ return /* @__PURE__ */ l(y, { row: !0, ref: r, ...t });
717
717
  }
718
- ), it = h(function({ num: t = 1, ...r }, u) {
719
- return /* @__PURE__ */ a(b, { indent: t, ref: u, ...r });
720
- }), at = h(
721
- function({ num: t = 1, ...r }, u) {
722
- return /* @__PURE__ */ a(b, { spacing: t, ref: u, ...r });
718
+ ), pt = f(function({ num: t = 1, ...r }, n) {
719
+ return /* @__PURE__ */ l(y, { indent: t, ref: n, ...r });
720
+ }), mt = f(
721
+ function({ num: t = 1, ...r }, n) {
722
+ return /* @__PURE__ */ l(y, { spacing: t, ref: n, ...r });
723
723
  }
724
- ), _e = S.div`
724
+ ), Te = C.div`
725
725
  --current-size: 1;
726
726
  flex: none;
727
727
  width: calc(var(--current-size) * var(--swui-metrics-space));
728
728
  height: calc(var(--current-size) * var(--swui-metrics-space));
729
- `, ct = ({
729
+ `, ht = ({
730
730
  half: e = !1,
731
731
  horizontal: t = !1,
732
732
  num: r = 1,
733
- vertical: u = !1
733
+ vertical: n = !1
734
734
  }) => {
735
- const n = r * (e ? 0.5 : 1);
736
- return /* @__PURE__ */ a(
737
- _e,
735
+ const u = r * (e ? 0.5 : 1);
736
+ return /* @__PURE__ */ l(
737
+ Te,
738
738
  {
739
739
  style: {
740
- "--current-size": n,
740
+ "--current-size": u,
741
741
  height: t ? 1 : void 0,
742
- width: u ? 1 : void 0
742
+ width: n ? 1 : void 0
743
743
  }
744
744
  }
745
745
  );
746
- }, lt = ({ children: e, nest: t, render: r }) => t ? /* @__PURE__ */ a(T, { children: r(e) }) : /* @__PURE__ */ a(T, { children: e }), $e = "_visuallyHidden_1gevf_1", Se = {
747
- visuallyHidden: $e
748
- }, Ee = (e) => se(e, Te), Te = (e, t) => Ce(t), Ce = (e) => e.startsWith("data-") || e.startsWith("aria-"), dt = ({
746
+ }, ft = ({ children: e, nest: t, render: r }) => t ? /* @__PURE__ */ l(T, { children: r(e) }) : /* @__PURE__ */ l(T, { children: e }), F = U({
747
+ isFontLarge: !1,
748
+ fontSizeRatio: 1
749
+ }), R = 12, gt = ({ children: e }) => {
750
+ const t = g(null), [r, n] = h(!1), [u, o] = h(1);
751
+ p(() => {
752
+ if (!t.current)
753
+ return;
754
+ const a = new ResizeObserver((i) => {
755
+ for (const c of i) {
756
+ const d = c.contentRect.height;
757
+ n(d > R), o(d / R);
758
+ }
759
+ });
760
+ return a.observe(t.current), () => a.disconnect();
761
+ }, []);
762
+ const s = S(
763
+ () => ({ isFontLarge: r, fontSizeRatio: u }),
764
+ [u, r]
765
+ );
766
+ return /* @__PURE__ */ D(F.Provider, { value: s, children: [
767
+ /* @__PURE__ */ l(
768
+ "div",
769
+ {
770
+ ref: t,
771
+ "aria-hidden": !0,
772
+ style: {
773
+ fontSize: "1rem",
774
+ position: "absolute",
775
+ visibility: "hidden",
776
+ height: "auto",
777
+ width: "auto",
778
+ whiteSpace: "nowrap"
779
+ },
780
+ children: "M"
781
+ }
782
+ ),
783
+ e
784
+ ] });
785
+ }, bt = () => {
786
+ const e = V(F);
787
+ return e || {
788
+ isFontLarge: !1,
789
+ fontSizeRatio: 1
790
+ };
791
+ }, Ie = "_visuallyHidden_1gevf_1", Re = {
792
+ visuallyHidden: Ie
793
+ }, Le = (e) => de(e, ze), ze = (e, t) => Me(t), Me = (e) => e.startsWith("data-") || e.startsWith("aria-"), vt = ({
749
794
  children: e,
750
795
  ...t
751
- }) => /* @__PURE__ */ a("span", { className: Se.visuallyHidden, ...Ee(t), children: e }), Ie = "_text_1iisw_1", Re = "_standard_1iisw_24", Le = "_bold_1iisw_27", Me = "_caption_1iisw_31", Oe = "_overline_1iisw_39", Ae = "_large_1iisw_48", Pe = "_medium_1iisw_53", De = "_small_1iisw_58", He = "_smaller_1iisw_63", $ = {
752
- text: Ie,
753
- standard: Re,
754
- bold: Le,
755
- caption: Me,
756
- overline: Oe,
757
- large: Ae,
758
- medium: Pe,
759
- small: De,
760
- smaller: He
761
- }, w = h(
796
+ }) => /* @__PURE__ */ l("span", { className: Re.visuallyHidden, ...Le(t), children: e }), Oe = "_text_1iisw_1", Ae = "_standard_1iisw_24", Fe = "_bold_1iisw_27", Pe = "_caption_1iisw_31", He = "_overline_1iisw_39", De = "_large_1iisw_48", Ne = "_medium_1iisw_53", Ue = "_small_1iisw_58", Ve = "_smaller_1iisw_63", $ = {
797
+ text: Oe,
798
+ standard: Ae,
799
+ bold: Fe,
800
+ caption: Pe,
801
+ overline: He,
802
+ large: De,
803
+ medium: Ne,
804
+ small: Ue,
805
+ smaller: Ve
806
+ }, w = f(
762
807
  ({
763
808
  children: e,
764
809
  variant: t = "standard",
765
810
  size: r = "medium",
766
- className: u,
767
- color: n,
811
+ className: n,
812
+ color: u,
768
813
  userSelect: o,
769
814
  whiteSpace: s,
770
- wordBreak: c,
815
+ wordBreak: a,
771
816
  textAlign: i,
772
- overflow: l,
773
- textOverflow: p,
774
- style: f,
817
+ overflow: c,
818
+ textOverflow: d,
819
+ style: b,
775
820
  ...k
776
- }, _) => /* @__PURE__ */ a(
821
+ }, _) => /* @__PURE__ */ l(
777
822
  "span",
778
823
  {
779
- className: A($.text, $[t], $[r], u),
824
+ className: A($.text, $[t], $[r], n),
780
825
  ref: _,
781
826
  style: {
782
- color: n,
827
+ color: u,
783
828
  userSelect: o,
784
829
  whiteSpace: s,
785
- wordBreak: c,
830
+ wordBreak: a,
786
831
  textAlign: i,
787
- overflow: l,
788
- textOverflow: p,
789
- ...f
832
+ overflow: c,
833
+ textOverflow: d,
834
+ ...b
790
835
  },
791
836
  ...k,
792
837
  children: e
793
838
  }
794
839
  )
795
- ), pt = w, mt = (e) => /* @__PURE__ */ a(w, { size: "small", ...e }), ht = (e) => /* @__PURE__ */ a(w, { size: "smaller", ...e }), gt = (e) => /* @__PURE__ */ a(w, { size: "medium", ...e }), ft = (e) => /* @__PURE__ */ a(w, { size: "large", ...e }), ze = "_heading_1cnsg_1", Fe = "_h1_1cnsg_10", Ne = "_h2_1cnsg_14", Ue = "_h3_1cnsg_18", Ve = "_h4_1cnsg_22", qe = "_h5_1cnsg_26", je = "_h6_1cnsg_30", I = {
796
- heading: ze,
797
- h1: Fe,
798
- h2: Ne,
799
- h3: Ue,
800
- h4: Ve,
801
- h5: qe,
802
- h6: je
803
- }, Be = h(
840
+ ), yt = w, wt = (e) => /* @__PURE__ */ l(w, { size: "small", ...e }), xt = (e) => /* @__PURE__ */ l(w, { size: "smaller", ...e }), kt = (e) => /* @__PURE__ */ l(w, { size: "medium", ...e }), _t = (e) => /* @__PURE__ */ l(w, { size: "large", ...e }), je = "_heading_1cnsg_1", qe = "_h1_1cnsg_10", Be = "_h2_1cnsg_14", We = "_h3_1cnsg_18", Xe = "_h4_1cnsg_22", Ge = "_h5_1cnsg_26", Ye = "_h6_1cnsg_30", L = {
841
+ heading: je,
842
+ h1: qe,
843
+ h2: Be,
844
+ h3: We,
845
+ h4: Xe,
846
+ h5: Ge,
847
+ h6: Ye
848
+ }, Ke = f(
804
849
  ({
805
850
  variant: e = "h3",
806
851
  className: t,
807
852
  color: r,
808
- whiteSpace: u,
809
- wordBreak: n,
853
+ whiteSpace: n,
854
+ wordBreak: u,
810
855
  style: o,
811
856
  children: s,
812
- as: c,
857
+ as: a,
813
858
  ...i
814
- }, l) => /* @__PURE__ */ a(
815
- c ?? e,
859
+ }, c) => /* @__PURE__ */ l(
860
+ a ?? e,
816
861
  {
817
- className: A(I.heading, I[e], t),
818
- style: { color: r, whiteSpace: u, wordBreak: n, ...o },
819
- ref: l,
862
+ className: A(L.heading, L[e], t),
863
+ style: { color: r, whiteSpace: n, wordBreak: u, ...o },
864
+ ref: c,
820
865
  ...i,
821
866
  children: s
822
867
  }
823
868
  )
824
- ), yt = (e) => /* @__PURE__ */ a(Be, { variant: "h2", ...e }), We = (e, t) => e === t, vt = (e, t, r = We) => {
825
- const u = m(
869
+ ), $t = (e) => /* @__PURE__ */ l(Ke, { variant: "h2", ...e }), Ze = (e, t) => e === t, St = (e, t, r = Ze) => {
870
+ const n = m(
826
871
  (i) => {
827
- e.some((l) => r(l, i)) || t([...e, i]);
872
+ e.some((c) => r(c, i)) || t([...e, i]);
828
873
  },
829
874
  [e, t, r]
830
- ), n = m(
875
+ ), u = m(
831
876
  (i) => {
832
877
  t(
833
- i.reduce((l, p) => l.some((f) => r(f, p)) ? l : [...l, p], e)
878
+ i.reduce((c, d) => c.some((b) => r(b, d)) ? c : [...c, d], e)
834
879
  );
835
880
  },
836
881
  [e, t, r]
837
882
  ), o = m(
838
883
  (i) => {
839
- const l = e.findIndex((p) => r(p, i));
840
- l >= 0 && t(e.filter((p, f) => f !== l));
884
+ const c = e.findIndex((d) => r(d, i));
885
+ c >= 0 && t(e.filter((d, b) => b !== c));
841
886
  },
842
887
  [e, t, r]
843
888
  ), s = m(
844
889
  (i) => {
845
- t(e.filter((l) => !i.some((p) => r(p, l))));
890
+ t(e.filter((c) => !i.some((d) => r(d, c))));
846
891
  },
847
892
  [e, t, r]
848
- ), c = m(
893
+ ), a = m(
849
894
  (i) => {
850
- e.some((p) => r(p, i)) ? o(i) : u(i);
895
+ e.some((d) => r(d, i)) ? o(i) : n(i);
851
896
  },
852
- [e, u, o, r]
897
+ [e, n, o, r]
853
898
  );
854
899
  return {
855
- add: u,
856
- addMultiple: n,
900
+ add: n,
901
+ addMultiple: u,
857
902
  remove: o,
858
903
  removeMultiple: s,
859
- toggle: c
904
+ toggle: a
860
905
  };
861
906
  }, E = (e) => {
862
- const [t, r] = y(e), u = m(() => {
907
+ const [t, r] = h(e), n = m(() => {
863
908
  r(!0);
864
- }, [r]), n = m(() => {
909
+ }, [r]), u = m(() => {
865
910
  r(!1);
866
911
  }, [r]), o = m(() => {
867
912
  r((s) => !s);
868
913
  }, [r]);
869
- return [t, u, n, o];
870
- }, bt = (e, t) => {
871
- const [r, u] = y(e);
872
- return d(() => {
873
- const n = setTimeout(() => {
874
- u(e);
914
+ return [t, n, u, o];
915
+ }, Ct = (e, t) => {
916
+ const [r, n] = h(e);
917
+ return p(() => {
918
+ const u = setTimeout(() => {
919
+ n(e);
875
920
  }, t);
876
921
  return () => {
877
- clearTimeout(n);
922
+ clearTimeout(u);
878
923
  };
879
924
  }, [e, t]), r;
880
- }, wt = (e, t) => {
881
- const [r, u] = y(e);
882
- return d(() => {
883
- e && u(!0);
884
- const n = setTimeout(() => {
885
- e || u(e);
925
+ }, Et = (e, t) => {
926
+ const [r, n] = h(e);
927
+ return p(() => {
928
+ e && n(!0);
929
+ const u = setTimeout(() => {
930
+ e || n(e);
886
931
  }, t);
887
932
  return () => {
888
- clearTimeout(n);
933
+ clearTimeout(u);
889
934
  };
890
935
  }, [e, t]), r;
891
936
  };
892
- let Xe = 0;
893
- const R = (e) => `webui-${e ? e + "-" : ""}${++Xe}`, xt = (e) => {
894
- const [t, r] = y(() => R(e));
895
- return d(() => r(R(e)), [e]), t;
937
+ let Je = 0;
938
+ const z = (e) => `webui-${e ? e + "-" : ""}${++Je}`, Tt = (e) => {
939
+ const [t, r] = h(() => z(e));
940
+ return p(() => r(z(e)), [e]), t;
896
941
  }, v = (e, t, r) => {
897
- const u = g(null);
898
- d(() => {
899
- u.current = r;
900
- }, [r]), d(() => {
942
+ const n = g(null);
943
+ p(() => {
944
+ n.current = r;
945
+ }, [r]), p(() => {
901
946
  if (!(e.current && e.current.addEventListener)) return;
902
- const o = (c) => {
903
- if (u.current)
904
- return u.current(c);
947
+ const o = (a) => {
948
+ if (n.current)
949
+ return n.current(a);
905
950
  };
906
951
  if (!e.current)
907
952
  return;
@@ -910,168 +955,171 @@ const R = (e) => `webui-${e ? e + "-" : ""}${++Xe}`, xt = (e) => {
910
955
  s && s.removeEventListener(t, o);
911
956
  };
912
957
  }, [t, e]);
913
- }, kt = (e) => {
914
- const [t, r, u] = E(!1);
915
- d(() => {
916
- document.activeElement === e.current ? r() : u();
917
- }, [e, u, r]), v(e, "focus", r), v(e, "blur", u);
918
- const n = m(() => {
958
+ }, It = (e) => {
959
+ const [t, r, n] = E(!1);
960
+ p(() => {
961
+ document.activeElement === e.current ? r() : n();
962
+ }, [e, n, r]), v(e, "focus", r), v(e, "blur", n);
963
+ const u = m(() => {
919
964
  e.current && e.current.focus();
920
965
  }, [e]), o = m(() => {
921
966
  e.current && e.current.blur();
922
967
  }, [e]);
923
- return { isInFocus: t, focus: n, blur: o };
924
- }, _t = (e) => {
968
+ return { isInFocus: t, focus: u, blur: o };
969
+ }, Rt = (e) => {
925
970
  const t = g(e);
926
- return M(() => {
971
+ return O(() => {
927
972
  t.current = e;
928
973
  }), m((...r) => {
929
- const { current: u } = t;
930
- return u(...r);
974
+ const { current: n } = t;
975
+ return n(...r);
931
976
  }, []);
932
- }, $t = (e) => {
933
- const t = H.useRef(e);
977
+ }, Lt = (e) => {
978
+ const t = N.useRef(e);
934
979
  return t.current = e, t;
935
- }, St = (e) => {
936
- const [t, r, u] = E(!1);
937
- return v(e, "mouseover", r), v(e, "mouseout", u), t;
938
- }, Et = (e) => {
939
- const [t, r, u] = E(!1);
940
- return v(e, "mouseenter", r), v(e, "mouseleave", u), t;
941
- }, Tt = (e, t) => {
980
+ }, zt = (e) => {
981
+ const [t, r, n] = E(!1);
982
+ return v(e, "mouseover", r), v(e, "mouseout", n), t;
983
+ }, Mt = (e) => {
984
+ const [t, r, n] = E(!1);
985
+ return v(e, "mouseenter", r), v(e, "mouseleave", n), t;
986
+ }, Ot = (e, t) => {
942
987
  const r = g(() => {
943
988
  });
944
- d(() => {
989
+ p(() => {
945
990
  r.current = t;
946
- }, [t]), d(() => {
947
- const u = (n) => {
948
- e.filter((s) => s.current).every((s) => s.current && !s.current.contains(n.target)) && r.current(n);
991
+ }, [t]), p(() => {
992
+ const n = (u) => {
993
+ e.filter((s) => s.current).every((s) => s.current && !s.current.contains(u.target)) && r.current(u);
949
994
  };
950
- return document.addEventListener("mousedown", u), document.addEventListener("touchstart", u), () => {
951
- document.removeEventListener("mousedown", u), document.removeEventListener("touchstart", u);
995
+ return document.addEventListener("mousedown", n), document.addEventListener("touchstart", n), () => {
996
+ document.removeEventListener("mousedown", n), document.removeEventListener("touchstart", n);
952
997
  };
953
998
  }, [...e]);
954
- }, Ct = (e, t, r) => {
955
- const u = g(() => {
999
+ }, At = (e, t, r) => {
1000
+ const n = g(() => {
956
1001
  });
957
- d(() => {
958
- u.current = t;
959
- }, [t]), d(() => {
960
- const n = (o) => {
961
- !e.current || e.current.contains(o.target) || u.current(o);
1002
+ p(() => {
1003
+ n.current = t;
1004
+ }, [t]), p(() => {
1005
+ const u = (o) => {
1006
+ !e.current || e.current.contains(o.target) || n.current(o);
962
1007
  };
963
- return document.addEventListener("mousedown", n, r), document.addEventListener("touchstart", n, r), () => {
964
- document.removeEventListener("mousedown", n, r), document.removeEventListener("touchstart", n, r);
1008
+ return document.addEventListener("mousedown", u, r), document.addEventListener("touchstart", u, r), () => {
1009
+ document.removeEventListener("mousedown", u, r), document.removeEventListener("touchstart", u, r);
965
1010
  };
966
1011
  }, [e, r]);
967
- }, L = ["mousemove", "mousedown", "keydown", "touchstart", "scroll"], It = (e, t) => {
1012
+ }, M = ["mousemove", "mousedown", "keydown", "touchstart", "scroll"], Ft = (e, t) => {
968
1013
  const r = g(() => {
969
1014
  });
970
- d(() => {
1015
+ p(() => {
971
1016
  r.current = e;
972
- }, [e]), d(() => {
973
- const u = ie(r.current, t);
974
- return L.forEach((n) => window.addEventListener(n, u)), () => {
975
- L.forEach(
976
- (n) => window.removeEventListener(n, u)
1017
+ }, [e]), p(() => {
1018
+ const n = pe(r.current, t);
1019
+ return M.forEach((u) => window.addEventListener(u, n)), () => {
1020
+ M.forEach(
1021
+ (u) => window.removeEventListener(u, n)
977
1022
  );
978
1023
  };
979
1024
  }, [t]);
980
- }, Rt = (e, t) => {
981
- const [r, u] = y(!1), { rootMargin: n, root: o, threshold: s } = t || {}, c = O(() => new IntersectionObserver(
982
- ([i]) => u(i.isIntersecting),
1025
+ }, Pt = (e, t) => {
1026
+ const [r, n] = h(!1), { rootMargin: u, root: o, threshold: s } = t || {}, a = S(() => new IntersectionObserver(
1027
+ ([i]) => n(i.isIntersecting),
983
1028
  {
984
- rootMargin: n,
1029
+ rootMargin: u,
985
1030
  root: o,
986
1031
  threshold: s
987
1032
  }
988
- ), [u, n, o, s]);
989
- return d(() => (e.current && c.observe(e.current), () => {
990
- c.disconnect();
991
- }), [c, e]), r;
992
- }, Lt = (e) => {
1033
+ ), [n, u, o, s]);
1034
+ return p(() => (e.current && a.observe(e.current), () => {
1035
+ a.disconnect();
1036
+ }), [a, e]), r;
1037
+ }, Ht = (e) => {
993
1038
  const t = g(null);
994
- return d(() => {
1039
+ return p(() => {
995
1040
  e && (typeof e == "function" ? e(t.current) : e.current = t.current);
996
1041
  }), t;
997
- }, Mt = (e, t, r = !0) => {
998
- const [u, n] = y(e), o = g(null), s = m(
999
- (c, i = t) => {
1000
- n(c), r && clearTimeout(o.current), o.current = setTimeout(() => n(e), i);
1042
+ }, Dt = (e, t, r = !0) => {
1043
+ const [n, u] = h(e), o = g(null), s = m(
1044
+ (a, i = t) => {
1045
+ u(a), r && clearTimeout(o.current), o.current = setTimeout(() => u(e), i);
1001
1046
  },
1002
1047
  [t, r, e]
1003
1048
  );
1004
- return d(() => () => {
1049
+ return p(() => () => {
1005
1050
  clearTimeout(o.current);
1006
- }, []), [u, s];
1007
- }, Ot = () => O(() => /* @__PURE__ */ new Date(), []), At = (e) => (t, r) => e(t).localeCompare(e(r)), Pt = (e) => (t, r) => e(t) - e(r), Dt = (e) => {
1051
+ }, []), [n, s];
1052
+ }, Nt = () => S(() => /* @__PURE__ */ new Date(), []), Ut = (e) => (t, r) => e(t).localeCompare(e(r)), Vt = (e) => (t, r) => e(t) - e(r), jt = (e) => {
1008
1053
  throw new Error(`Switch unhandled case: ${e}`);
1009
- }, Ht = (e, t) => t, zt = (e) => Object.keys(e).filter((t) => e[t]), Ft = (e) => {
1054
+ }, qt = (e, t) => t, Bt = (e) => Object.keys(e).filter((t) => e[t]), Wt = (e) => {
1010
1055
  try {
1011
1056
  const t = parseFloat(e);
1012
1057
  return isNaN(t) || t == null ? void 0 : t;
1013
1058
  } catch {
1014
1059
  }
1015
- }, Nt = (e) => {
1060
+ }, Xt = (e) => {
1016
1061
  try {
1017
1062
  const t = parseInt(e, 10);
1018
1063
  return isNaN(t) || t == null ? void 0 : t;
1019
1064
  } catch {
1020
1065
  }
1021
1066
  };
1022
- function Ut(e, t) {
1067
+ function Gt(e, t) {
1023
1068
  if (e == null)
1024
1069
  throw new Error("Invariant error: " + t);
1025
1070
  }
1026
1071
  export {
1027
- b as Box,
1028
- ut as Clickable,
1029
- nt as Column,
1030
- yt as HeaderText,
1031
- Be as Heading,
1032
- it as Indent,
1033
- ft as LargeText,
1034
- lt as Nest,
1035
- ot as ResizeAwareBox,
1036
- st as Row,
1037
- dt as ScreenReaderOnlyText,
1038
- rt as SeparatorLine,
1039
- mt as SmallText,
1040
- ht as SmallerText,
1041
- ct as Space,
1042
- at as Spacing,
1043
- gt as StandardText,
1072
+ F as AccessibleFontSizeContext,
1073
+ gt as AccessibleFontSizeProvider,
1074
+ y as Box,
1075
+ at as Clickable,
1076
+ ct as Column,
1077
+ $t as HeaderText,
1078
+ Ke as Heading,
1079
+ pt as Indent,
1080
+ _t as LargeText,
1081
+ ft as Nest,
1082
+ lt as ResizeAwareBox,
1083
+ dt as Row,
1084
+ vt as ScreenReaderOnlyText,
1085
+ it as SeparatorLine,
1086
+ wt as SmallText,
1087
+ xt as SmallerText,
1088
+ ht as Space,
1089
+ mt as Spacing,
1090
+ kt as StandardText,
1044
1091
  w as Text,
1045
- pt as Txt,
1092
+ yt as Txt,
1046
1093
  x as booleanOrNumberToNumber,
1047
- Pt as byNumberField,
1048
- At as byStringField,
1049
- Ht as exhaustSwitchCase,
1050
- Dt as exhaustSwitchCaseElseThrow,
1051
- Ee as getDataProps,
1052
- we as getDimensionObject,
1053
- Ut as invariant,
1054
- Ft as parseFloatElseUndefined,
1055
- Nt as parseIntElseUndefined,
1056
- zt as truthyKeysAsList,
1057
- vt as useArraySet,
1094
+ Vt as byNumberField,
1095
+ Ut as byStringField,
1096
+ qt as exhaustSwitchCase,
1097
+ jt as exhaustSwitchCaseElseThrow,
1098
+ Le as getDataProps,
1099
+ Se as getDimensionObject,
1100
+ Gt as invariant,
1101
+ Wt as parseFloatElseUndefined,
1102
+ Xt as parseIntElseUndefined,
1103
+ Bt as truthyKeysAsList,
1104
+ bt as useAccessibleFontSizeContext,
1105
+ St as useArraySet,
1058
1106
  E as useBoolean,
1059
- bt as useDebounce,
1060
- wt as useDelayedFalse,
1061
- xt as useDomId,
1062
- ke as useElementDimensions,
1063
- kt as useElementFocus,
1064
- _t as useEventCallback,
1107
+ Ct as useDebounce,
1108
+ Et as useDelayedFalse,
1109
+ Tt as useDomId,
1110
+ Ee as useElementDimensions,
1111
+ It as useElementFocus,
1112
+ Rt as useEventCallback,
1065
1113
  v as useEventListener,
1066
- Lt as useForwardedRef,
1067
- $t as useLatest,
1068
- Et as useMouseIsEntered,
1069
- St as useMouseIsOver,
1070
- Tt as useMultiOnClickOutside,
1071
- Ct as useOnClickOutside,
1072
- It as useOnNoMouseMovement,
1073
- Rt as useOnScreen,
1074
- Mt as useTimeoutState,
1075
- Ot as useToday
1114
+ Ht as useForwardedRef,
1115
+ Lt as useLatest,
1116
+ Mt as useMouseIsEntered,
1117
+ zt as useMouseIsOver,
1118
+ Ot as useMultiOnClickOutside,
1119
+ At as useOnClickOutside,
1120
+ Ft as useOnNoMouseMovement,
1121
+ Pt as useOnScreen,
1122
+ Dt as useTimeoutState,
1123
+ Nt as useToday
1076
1124
  };
1077
1125
  //# sourceMappingURL=index.es.js.map