@dinofront/design_system 1.20.9 → 1.20.11

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.js CHANGED
@@ -897,8 +897,8 @@ function Qt() {
897
897
  //#endregion
898
898
  //#region src/lib/useFloatingPosition.ts
899
899
  var $t = 8, en = 10;
900
- function tn({ anchor: e, panel: t, open: n, side: r = "top", align: i = "center", offset: a = 8, flip: o = !0, shift: s = !0, matchAnchorWidth: c = !1, recomputeKey: l, zIndex: u = 50 }) {
901
- let [f, p] = m({
900
+ function tn({ anchor: e, panel: t, open: n, side: r = "top", align: i = "center", offset: a = 8, flip: o = !0, shift: s = !0, matchAnchorWidth: c = !1, constrainToViewport: l = !1, recomputeKey: u, zIndex: f = 50 }) {
901
+ let [p, h] = m({
902
902
  style: {
903
903
  position: "fixed",
904
904
  top: 0,
@@ -910,50 +910,54 @@ function tn({ anchor: e, panel: t, open: n, side: r = "top", align: i = "center"
910
910
  });
911
911
  return d(() => {
912
912
  if (!n || !t) return;
913
- let l = () => {
913
+ let u = () => {
914
914
  let n = e?.current;
915
915
  if (!n) return;
916
- let l = n.getBoundingClientRect(), d = t.getBoundingClientRect(), f = window.innerWidth, m = window.innerHeight, h = r === "top" || r === "bottom", g = r;
917
- if (o) if (h) {
918
- let e = l.top, t = m - l.bottom;
919
- r === "top" && e < d.height + a && t > e ? g = "bottom" : r === "bottom" && t < d.height + a && e > t && (g = "top");
916
+ let u = n.getBoundingClientRect(), d = t.getBoundingClientRect(), p = window.innerWidth, m = window.innerHeight, g = r === "top" || r === "bottom", _ = r;
917
+ if (o) if (g) {
918
+ let e = u.top, t = m - u.bottom;
919
+ r === "top" && e < d.height + a && t > e ? _ = "bottom" : r === "bottom" && t < d.height + a && e > t && (_ = "top");
920
920
  } else {
921
- let e = l.left, t = f - l.right;
922
- r === "left" && e < d.width + a && t > e ? g = "right" : r === "right" && t < d.width + a && e > t && (g = "left");
921
+ let e = u.left, t = p - u.right;
922
+ r === "left" && e < d.width + a && t > e ? _ = "right" : r === "right" && t < d.width + a && e > t && (_ = "left");
923
923
  }
924
- let _ = g === "top" || g === "bottom", v, y;
925
- _ ? (v = g === "bottom" ? l.bottom + a : l.top - d.height - a, y = i === "start" ? l.left : i === "end" ? l.right - d.width : l.left + l.width / 2 - d.width / 2) : (y = g === "right" ? l.right + a : l.left - d.width - a, v = i === "start" ? l.top : i === "end" ? l.bottom - d.height : l.top + l.height / 2 - d.height / 2), s && (_ ? y = Math.min(Math.max(y, $t), f - d.width - $t) : v = Math.min(Math.max(v, $t), m - d.height - $t));
926
- let b;
927
- if (_) {
928
- let e = l.left + l.width / 2;
929
- b = {
930
- left: Math.min(Math.max(e - y, en), d.width - en),
931
- [g === "bottom" ? "top" : "bottom"]: -8 / 2
924
+ let v = _ === "top" || _ === "bottom", y, b;
925
+ v ? (y = _ === "bottom" ? u.bottom + a : u.top - d.height - a, b = i === "start" ? u.left : i === "end" ? u.right - d.width : u.left + u.width / 2 - d.width / 2) : (b = _ === "right" ? u.right + a : u.left - d.width - a, y = i === "start" ? u.top : i === "end" ? u.bottom - d.height : u.top + u.height / 2 - d.height / 2), s && (v ? b = Math.min(Math.max(b, $t), p - d.width - $t) : y = Math.min(Math.max(y, $t), m - d.height - $t));
926
+ let x;
927
+ if (v) {
928
+ let e = u.left + u.width / 2;
929
+ x = {
930
+ left: Math.min(Math.max(e - b, en), d.width - en),
931
+ [_ === "bottom" ? "top" : "bottom"]: -8 / 2
932
932
  };
933
933
  } else {
934
- let e = l.top + l.height / 2;
935
- b = {
936
- top: Math.min(Math.max(e - v, en), d.height - en),
937
- [g === "right" ? "left" : "right"]: -8 / 2
934
+ let e = u.top + u.height / 2;
935
+ x = {
936
+ top: Math.min(Math.max(e - y, en), d.height - en),
937
+ [_ === "right" ? "left" : "right"]: -8 / 2
938
938
  };
939
939
  }
940
- p({
940
+ let S;
941
+ l && (S = v ? p - 2 * $t : _ === "right" ? p - u.right - a - $t : u.left - a - $t), h({
941
942
  style: {
942
943
  position: "fixed",
943
- top: v,
944
- left: y,
945
- zIndex: u,
946
- ...c ? { minWidth: l.width } : {}
944
+ top: y,
945
+ left: b,
946
+ zIndex: f,
947
+ ...c ? { minWidth: u.width } : {},
948
+ ...S === void 0 ? {} : { maxWidth: S }
947
949
  },
948
- arrowStyle: b,
949
- resolvedSide: g
950
+ arrowStyle: x,
951
+ resolvedSide: _
950
952
  });
951
953
  };
952
- return l(), window.addEventListener("resize", l), document.addEventListener("scroll", l, {
954
+ u(), window.addEventListener("resize", u), document.addEventListener("scroll", u, {
953
955
  capture: !0,
954
956
  passive: !0
955
- }), () => {
956
- window.removeEventListener("resize", l), document.removeEventListener("scroll", l, { capture: !0 });
957
+ });
958
+ let d = new ResizeObserver(u);
959
+ return d.observe(t), () => {
960
+ window.removeEventListener("resize", u), document.removeEventListener("scroll", u, { capture: !0 }), d.disconnect();
957
961
  };
958
962
  }, [
959
963
  n,
@@ -965,8 +969,10 @@ function tn({ anchor: e, panel: t, open: n, side: r = "top", align: i = "center"
965
969
  o,
966
970
  s,
967
971
  c,
968
- l
969
- ]), f;
972
+ l,
973
+ u,
974
+ f
975
+ ]), p;
970
976
  }
971
977
  //#endregion
972
978
  //#region src/components/Popover/Popover.tsx
@@ -5101,25 +5107,26 @@ var xo = a(function({ value: e, defaultValue: t = null, onChange: n, step: r = 1
5101
5107
  panel: g,
5102
5108
  open: f && !!S,
5103
5109
  side: r,
5104
- offset: 8
5110
+ offset: 8,
5111
+ constrainToViewport: !0
5105
5112
  }), E = () => {
5106
5113
  v.current && clearTimeout(v.current), v.current = setTimeout(() => h(!0), a);
5107
5114
  }, D = () => {
5108
5115
  v.current && clearTimeout(v.current), h(!1);
5109
5116
  };
5110
5117
  if (!o(t)) return t;
5111
- let O = t.props ?? {}, k = n(t, {
5118
+ let O = !!y.current?.closest(".dark"), k = t.props ?? {}, A = n(t, {
5112
5119
  onMouseEnter: E,
5113
5120
  onMouseLeave: D,
5114
5121
  onFocus: E,
5115
5122
  onBlur: D,
5116
- "aria-describedby": f ? b : O["aria-describedby"]
5117
- }), A = /* @__PURE__ */ K("span", {
5123
+ "aria-describedby": f ? b : k["aria-describedby"]
5124
+ }), j = /* @__PURE__ */ K("span", {
5118
5125
  ref: S ? _ : void 0,
5119
5126
  role: "tooltip",
5120
5127
  id: b,
5121
5128
  style: S ? C : void 0,
5122
- className: X("z-50 whitespace-pre-wrap w-max rounded-md bg-fg-default text-bg-default shadow-z3 pointer-events-none select-none", So[i], !S && ["absolute", Co[r]], c),
5129
+ className: X("z-50 whitespace-pre-wrap w-max rounded-md bg-fg-default text-bg-default shadow-z3 pointer-events-none select-none", S && O && "dark", So[i], !S && ["absolute", Co[r]], c),
5123
5130
  children: [e, S ? /* @__PURE__ */ G("span", {
5124
5131
  "aria-hidden": !0,
5125
5132
  style: w,
@@ -5133,7 +5140,7 @@ var xo = a(function({ value: e, defaultValue: t = null, onChange: n, step: r = 1
5133
5140
  ref: Xt(d, y),
5134
5141
  "data-test-id": l,
5135
5142
  className: X("inline-flex", !S && "relative"),
5136
- children: [k, f && (S ? be(A, S) : A)]
5143
+ children: [A, f && (S ? be(j, S) : j)]
5137
5144
  });
5138
5145
  }), Do = "We'll be back soon", Oo = "We're currently performing scheduled maintenance to make your experience even better. Please check back shortly.", ko = {
5139
5146
  lg: "xl",