@stenajs-webui/core 22.7.0 → 22.7.2

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,14 +1,14 @@
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
2
  import { cssColor as N } from "@stenajs-webui/theme";
3
3
  import { jsx as c, Fragment as T, jsxs as U } from "react/jsx-runtime";
4
- import V, { forwardRef as f, useState as h, useCallback as m, useLayoutEffect as F, useRef as g, createContext as j, useEffect as p, useMemo as S, useContext as q, isValidElement as B, Fragment as W } from "react";
4
+ import V, { forwardRef as g, useState as h, useCallback as m, useLayoutEffect as F, useRef as f, createContext as j, useEffect as p, useMemo as S, useContext as q, isValidElement as B, Fragment as W } from "react";
5
5
  import E from "@emotion/styled";
6
6
  import { system as X, background as G, border as Y, borderRight as K, borderLeft as Z, borderTop as J, borderBottom as Q, borderColor as ee, borderRadius as te, borderStyle as re, borderWidth as ne, boxShadow as ue, flexbox as oe, overflow as se, position as ie, layout as ae, zIndex as ce, left as le, right as de, top as pe, bottom as me } from "styled-system";
7
- import { memoize as he, pickBy as P, debounce as fe } from "lodash-es";
7
+ import { memoize as he, pickBy as P, debounce as ge } from "lodash-es";
8
8
  import O from "classnames";
9
- const ge = "_separatorLine_nzfcz_1", ye = {
10
- separatorLine: ge
11
- }, lt = f(
9
+ const fe = "_separatorLine_nzfcz_1", ve = {
10
+ separatorLine: fe
11
+ }, lt = g(
12
12
  ({
13
13
  color: e = N("--lhds-color-ui-300"),
14
14
  size: t = "100%",
@@ -17,7 +17,7 @@ const ge = "_separatorLine_nzfcz_1", ye = {
17
17
  }, u) => /* @__PURE__ */ c(
18
18
  "hr",
19
19
  {
20
- className: ye.separatorLine,
20
+ className: ve.separatorLine,
21
21
  "aria-hidden": !0,
22
22
  color: e,
23
23
  style: {
@@ -28,7 +28,7 @@ const ge = "_separatorLine_nzfcz_1", ye = {
28
28
  ref: u
29
29
  }
30
30
  )
31
- ), ve = E.button`
31
+ ), ye = E.button`
32
32
  display: inline-block;
33
33
  user-select: none;
34
34
  border: 0;
@@ -51,7 +51,7 @@ const ge = "_separatorLine_nzfcz_1", ye = {
51
51
  ${({ width: e }) => e ? `width: ${e};` : ""}
52
52
  ${({ height: e }) => e ? `height: ${e};` : ""}
53
53
  ${({ borderRadius: e }) => e ? `border-radius: ${e};` : ""}
54
- `, dt = f(
54
+ `, dt = g(
55
55
  ({
56
56
  disableFocusHighlight: e,
57
57
  onClick: t,
@@ -64,11 +64,11 @@ const ge = "_separatorLine_nzfcz_1", ye = {
64
64
  children: i,
65
65
  background: l = "transparent",
66
66
  hoverBackground: d,
67
- focusBackground: y,
67
+ focusBackground: v,
68
68
  type: k = "button",
69
69
  ..._
70
70
  }, H) => /* @__PURE__ */ c(
71
- ve,
71
+ ye,
72
72
  {
73
73
  opacityOnHover: s,
74
74
  title: n,
@@ -81,7 +81,7 @@ const ge = "_separatorLine_nzfcz_1", ye = {
81
81
  ref: H,
82
82
  background: l,
83
83
  hoverBackground: d,
84
- focusBackground: y,
84
+ focusBackground: v,
85
85
  type: k,
86
86
  ..._,
87
87
  children: i
@@ -676,7 +676,7 @@ const ge = "_separatorLine_nzfcz_1", ye = {
676
676
  ${({ focusWithinBackground: e }) => e ? `background: ${e};` : ""}
677
677
  ${({ focusWithinBorder: e }) => e ? `border: ${e};` : ""}
678
678
  }
679
- `, pt = f(
679
+ `, pt = g(
680
680
  function(t, r) {
681
681
  return /* @__PURE__ */ c(b, { ref: r, ...t });
682
682
  }
@@ -706,18 +706,18 @@ const ge = "_separatorLine_nzfcz_1", ye = {
706
706
  }, [u]), {
707
707
  dimensions: r
708
708
  };
709
- }, mt = f(
709
+ }, mt = g(
710
710
  function({ onResize: t, ...r }, n) {
711
- const u = g(null);
711
+ const u = f(null);
712
712
  return Re(n ?? u, t), /* @__PURE__ */ c(b, { ...r, ref: n });
713
713
  }
714
- ), ht = f(
714
+ ), ht = g(
715
715
  function(t, r) {
716
716
  return /* @__PURE__ */ c(b, { row: !0, ref: r, ...t });
717
717
  }
718
- ), ft = f(function({ num: t = 1, ...r }, n) {
718
+ ), gt = g(function({ num: t = 1, ...r }, n) {
719
719
  return /* @__PURE__ */ c(b, { indent: t, ref: n, ...r });
720
- }), gt = f(
720
+ }), ft = g(
721
721
  function({ num: t = 1, ...r }, n) {
722
722
  return /* @__PURE__ */ c(b, { spacing: t, ref: n, ...r });
723
723
  }
@@ -726,7 +726,7 @@ const ge = "_separatorLine_nzfcz_1", ye = {
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
- `, yt = ({
729
+ `, vt = ({
730
730
  half: e = !1,
731
731
  horizontal: t = !1,
732
732
  num: r = 1,
@@ -743,11 +743,11 @@ const ge = "_separatorLine_nzfcz_1", ye = {
743
743
  }
744
744
  }
745
745
  );
746
- }, vt = ({ children: e, nest: t, render: r }) => t ? /* @__PURE__ */ c(T, { children: r(e) }) : /* @__PURE__ */ c(T, { children: e }), D = j({
746
+ }, yt = ({ children: e, nest: t, render: r }) => t ? /* @__PURE__ */ c(T, { children: r(e) }) : /* @__PURE__ */ c(T, { children: e }), D = j({
747
747
  isFontLarge: !1,
748
748
  fontSizeRatio: 1
749
749
  }), R = 12, bt = ({ children: e }) => {
750
- const t = g(null), [r, n] = h(!1), [u, o] = h(1);
750
+ const t = f(null), [r, n] = h(!1), [u, o] = h(1);
751
751
  p(() => {
752
752
  if (!t.current)
753
753
  return;
@@ -803,7 +803,7 @@ const ge = "_separatorLine_nzfcz_1", ye = {
803
803
  medium: je,
804
804
  small: qe,
805
805
  smaller: Be
806
- }, w = f(
806
+ }, w = g(
807
807
  ({
808
808
  children: e,
809
809
  variant: t = "standard",
@@ -816,7 +816,7 @@ const ge = "_separatorLine_nzfcz_1", ye = {
816
816
  textAlign: i,
817
817
  overflow: l,
818
818
  textOverflow: d,
819
- style: y,
819
+ style: v,
820
820
  ...k
821
821
  }, _) => /* @__PURE__ */ c(
822
822
  "span",
@@ -831,7 +831,7 @@ const ge = "_separatorLine_nzfcz_1", ye = {
831
831
  textAlign: i,
832
832
  overflow: l,
833
833
  textOverflow: d,
834
- ...y
834
+ ...v
835
835
  },
836
836
  ...k,
837
837
  children: e
@@ -845,7 +845,7 @@ const ge = "_separatorLine_nzfcz_1", ye = {
845
845
  h4: Ke,
846
846
  h5: Ze,
847
847
  h6: Je
848
- }, Qe = f(
848
+ }, Qe = g(
849
849
  ({
850
850
  variant: e = "h3",
851
851
  className: t,
@@ -897,14 +897,14 @@ const ge = "_separatorLine_nzfcz_1", ye = {
897
897
  ), u = m(
898
898
  (i) => {
899
899
  t(
900
- i.reduce((l, d) => l.some((y) => r(y, d)) ? l : [...l, d], e)
900
+ i.reduce((l, d) => l.some((v) => r(v, d)) ? l : [...l, d], e)
901
901
  );
902
902
  },
903
903
  [e, t, r]
904
904
  ), o = m(
905
905
  (i) => {
906
906
  const l = e.findIndex((d) => r(d, i));
907
- l >= 0 && t(e.filter((d, y) => y !== l));
907
+ l >= 0 && t(e.filter((d, v) => v !== l));
908
908
  },
909
909
  [e, t, r]
910
910
  ), s = m(
@@ -960,8 +960,8 @@ let tt = 0;
960
960
  const A = (e) => `webui-${e ? e + "-" : ""}${++tt}`, Mt = (e) => {
961
961
  const [t, r] = h(() => A(e));
962
962
  return p(() => r(A(e)), [e]), t;
963
- }, v = (e, t, r) => {
964
- const n = g(null);
963
+ }, y = (e, t, r) => {
964
+ const n = f(null);
965
965
  p(() => {
966
966
  n.current = r;
967
967
  }, [r]), p(() => {
@@ -981,7 +981,7 @@ const A = (e) => `webui-${e ? e + "-" : ""}${++tt}`, Mt = (e) => {
981
981
  const [t, r, n] = C(!1);
982
982
  p(() => {
983
983
  document.activeElement === e.current ? r() : n();
984
- }, [e, n, r]), v(e, "focus", r), v(e, "blur", n);
984
+ }, [e, n, r]), y(e, "focus", r), y(e, "blur", n);
985
985
  const u = m(() => {
986
986
  e.current && e.current.focus();
987
987
  }, [e]), o = m(() => {
@@ -989,7 +989,7 @@ const A = (e) => `webui-${e ? e + "-" : ""}${++tt}`, Mt = (e) => {
989
989
  }, [e]);
990
990
  return { isInFocus: t, focus: u, blur: o };
991
991
  }, Ft = (e) => {
992
- const t = g(e);
992
+ const t = f(e);
993
993
  return F(() => {
994
994
  t.current = e;
995
995
  }), m((...r) => {
@@ -1001,12 +1001,12 @@ const A = (e) => `webui-${e ? e + "-" : ""}${++tt}`, Mt = (e) => {
1001
1001
  return t.current = e, t;
1002
1002
  }, Ot = (e) => {
1003
1003
  const [t, r, n] = C(!1);
1004
- return v(e, "mouseover", r), v(e, "mouseout", n), t;
1004
+ return y(e, "mouseover", r), y(e, "mouseout", n), t;
1005
1005
  }, Dt = (e) => {
1006
1006
  const [t, r, n] = C(!1);
1007
- return v(e, "mouseenter", r), v(e, "mouseleave", n), t;
1007
+ return y(e, "mouseenter", r), y(e, "mouseleave", n), t;
1008
1008
  }, Ht = (e, t) => {
1009
- const r = g(() => {
1009
+ const r = f(() => {
1010
1010
  });
1011
1011
  p(() => {
1012
1012
  r.current = t;
@@ -1019,7 +1019,7 @@ const A = (e) => `webui-${e ? e + "-" : ""}${++tt}`, Mt = (e) => {
1019
1019
  };
1020
1020
  }, [...e]);
1021
1021
  }, Nt = (e, t, r) => {
1022
- const n = g(() => {
1022
+ const n = f(() => {
1023
1023
  });
1024
1024
  p(() => {
1025
1025
  n.current = t;
@@ -1032,12 +1032,12 @@ const A = (e) => `webui-${e ? e + "-" : ""}${++tt}`, Mt = (e) => {
1032
1032
  };
1033
1033
  }, [e, r]);
1034
1034
  }, M = ["mousemove", "mousedown", "keydown", "touchstart", "scroll"], Ut = (e, t) => {
1035
- const r = g(() => {
1035
+ const r = f(() => {
1036
1036
  });
1037
1037
  p(() => {
1038
1038
  r.current = e;
1039
1039
  }, [e]), p(() => {
1040
- const n = fe(r.current, t);
1040
+ const n = ge(r.current, t);
1041
1041
  return M.forEach((u) => window.addEventListener(u, n)), () => {
1042
1042
  M.forEach(
1043
1043
  (u) => window.removeEventListener(u, n)
@@ -1057,12 +1057,12 @@ const A = (e) => `webui-${e ? e + "-" : ""}${++tt}`, Mt = (e) => {
1057
1057
  a.disconnect();
1058
1058
  }), [a, e]), r;
1059
1059
  }, jt = (e) => {
1060
- const t = g(null);
1060
+ const t = f(null);
1061
1061
  return p(() => {
1062
1062
  e && (typeof e == "function" ? e(t.current) : e.current = t.current);
1063
1063
  }), t;
1064
1064
  }, qt = (e, t, r = !0) => {
1065
- const [n, u] = h(e), o = g(null), s = m(
1065
+ const [n, u] = h(e), o = f(null), s = m(
1066
1066
  (a, i = t) => {
1067
1067
  u(a), r && clearTimeout(o.current), o.current = setTimeout(() => u(e), i);
1068
1068
  },
@@ -1104,17 +1104,17 @@ export {
1104
1104
  pt as Column,
1105
1105
  Tt as HeaderText,
1106
1106
  Qe as Heading,
1107
- ft as Indent,
1107
+ gt as Indent,
1108
1108
  Ct as LargeText,
1109
- vt as Nest,
1109
+ yt as Nest,
1110
1110
  mt as ResizeAwareBox,
1111
1111
  ht as Row,
1112
1112
  kt as ScreenReaderOnlyText,
1113
1113
  lt as SeparatorLine,
1114
1114
  $t as SmallText,
1115
1115
  St as SmallerText,
1116
- yt as Space,
1117
- gt as Spacing,
1116
+ vt as Space,
1117
+ ft as Spacing,
1118
1118
  Et as StandardText,
1119
1119
  w as Text,
1120
1120
  _t as Txt,
@@ -1140,7 +1140,7 @@ export {
1140
1140
  Re as useElementDimensions,
1141
1141
  zt as useElementFocus,
1142
1142
  Ft as useEventCallback,
1143
- v as useEventListener,
1143
+ y as useEventListener,
1144
1144
  jt as useForwardedRef,
1145
1145
  Pt as useLatest,
1146
1146
  Dt as useMouseIsEntered,