@dinofront/design_system 1.17.2 → 1.17.3
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 +28 -25
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1936,19 +1936,19 @@ function Zn({ children: e }) {
|
|
|
1936
1936
|
ref: i,
|
|
1937
1937
|
onClick: (e) => {
|
|
1938
1938
|
let n = a.onClick;
|
|
1939
|
-
n?.(e), e.defaultPrevented || r(!t);
|
|
1939
|
+
n?.(e), e.stopPropagation(), e.defaultPrevented || r(!t);
|
|
1940
1940
|
},
|
|
1941
1941
|
"aria-haspopup": "menu",
|
|
1942
1942
|
"aria-expanded": t
|
|
1943
1943
|
});
|
|
1944
1944
|
}
|
|
1945
|
-
var Qn = "min-w-[200px] rounded-lg border border-border-default bg-bg-default shadow-z4 z-50 py-1", $n = a(function({ children: e, align: t = "start", strategy: n = "fixed", side: r = "bottom", sideOffset: i = 4, flip: a = !0, shift: o = !0, matchTriggerWidth: s = !1, closeOnScroll: c = !1, className: u, dataTestId: d,
|
|
1946
|
-
let { open:
|
|
1945
|
+
var Qn = "min-w-[200px] rounded-lg border border-border-default bg-bg-default shadow-z4 z-50 py-1", $n = a(function({ children: e, align: t = "start", strategy: n = "fixed", side: r = "bottom", sideOffset: i = 4, flip: a = !0, shift: o = !0, matchTriggerWidth: s = !1, closeOnScroll: c = !1, className: u, dataTestId: d, onClick: h, ...g }, _) {
|
|
1946
|
+
let { open: v, setOpen: y, triggerRef: b, anchorRef: x } = Yn(), S = p(null), [C, w] = m(null), { style: T, resolvedSide: E } = Kn({
|
|
1947
1947
|
anchor: f(() => ({ get current() {
|
|
1948
|
-
return qn(
|
|
1949
|
-
} }), [
|
|
1950
|
-
panel:
|
|
1951
|
-
open:
|
|
1948
|
+
return qn(x) ?? b.current;
|
|
1949
|
+
} }), [x, b]),
|
|
1950
|
+
panel: C,
|
|
1951
|
+
open: v && n === "fixed",
|
|
1952
1952
|
side: r,
|
|
1953
1953
|
align: t,
|
|
1954
1954
|
offset: i,
|
|
@@ -1957,53 +1957,56 @@ var Qn = "min-w-[200px] rounded-lg border border-border-default bg-bg-default sh
|
|
|
1957
1957
|
matchAnchorWidth: s
|
|
1958
1958
|
});
|
|
1959
1959
|
if (l(() => {
|
|
1960
|
-
if (!
|
|
1960
|
+
if (!v) return;
|
|
1961
1961
|
let e = (e) => {
|
|
1962
1962
|
let t = e.target;
|
|
1963
|
-
|
|
1963
|
+
S.current?.contains(t) || b.current?.contains(t) || qn(x)?.contains(t) || y(!1);
|
|
1964
1964
|
};
|
|
1965
1965
|
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
1966
1966
|
}, [
|
|
1967
|
-
_,
|
|
1968
1967
|
v,
|
|
1969
1968
|
y,
|
|
1970
|
-
b
|
|
1969
|
+
b,
|
|
1970
|
+
x
|
|
1971
1971
|
]), l(() => {
|
|
1972
|
-
if (!
|
|
1973
|
-
let e = () =>
|
|
1972
|
+
if (!v || !c) return;
|
|
1973
|
+
let e = () => y(!1);
|
|
1974
1974
|
return document.addEventListener("scroll", e, {
|
|
1975
1975
|
capture: !0,
|
|
1976
1976
|
passive: !0
|
|
1977
1977
|
}), () => document.removeEventListener("scroll", e, { capture: !0 });
|
|
1978
1978
|
}, [
|
|
1979
|
-
|
|
1979
|
+
v,
|
|
1980
1980
|
c,
|
|
1981
|
-
|
|
1981
|
+
y
|
|
1982
1982
|
]), l(() => {
|
|
1983
|
-
if (!
|
|
1983
|
+
if (!v) return;
|
|
1984
1984
|
let e = requestAnimationFrame(() => {
|
|
1985
|
-
(
|
|
1985
|
+
(S.current?.querySelector("[role=\"menuitem\"]:not(:disabled)"))?.focus();
|
|
1986
1986
|
});
|
|
1987
1987
|
return () => cancelAnimationFrame(e);
|
|
1988
|
-
}, [
|
|
1989
|
-
let
|
|
1990
|
-
ref: Gt(
|
|
1988
|
+
}, [v]), !v) return null;
|
|
1989
|
+
let D = /* @__PURE__ */ q("div", {
|
|
1990
|
+
ref: Gt(_, S, n === "fixed" ? w : void 0),
|
|
1991
1991
|
role: "menu",
|
|
1992
1992
|
"data-test-id": d,
|
|
1993
|
-
"data-side": n === "fixed" ?
|
|
1993
|
+
"data-side": n === "fixed" ? E : void 0,
|
|
1994
1994
|
"data-align": t,
|
|
1995
1995
|
onKeyDown: (e) => {
|
|
1996
|
-
let t = Array.from(
|
|
1996
|
+
let t = Array.from(S.current?.querySelectorAll("[role=\"menuitem\"]:not(:disabled)") ?? []);
|
|
1997
1997
|
if (!t.length) return;
|
|
1998
1998
|
let n = t.indexOf(document.activeElement);
|
|
1999
1999
|
e.key === "ArrowDown" ? (e.preventDefault(), t[(n + 1 + t.length) % t.length]?.focus()) : e.key === "ArrowUp" ? (e.preventDefault(), t[(n - 1 + t.length) % t.length]?.focus()) : e.key === "Home" ? (e.preventDefault(), t[0]?.focus()) : e.key === "End" && (e.preventDefault(), t[t.length - 1]?.focus());
|
|
2000
2000
|
},
|
|
2001
|
-
|
|
2001
|
+
onClick: (e) => {
|
|
2002
|
+
h?.(e), e.stopPropagation();
|
|
2003
|
+
},
|
|
2004
|
+
style: n === "fixed" ? T : void 0,
|
|
2002
2005
|
className: Q(Qn, n === "absolute" && Q("absolute top-full mt-1", t === "end" ? "right-0" : "left-0"), u),
|
|
2003
|
-
...
|
|
2006
|
+
...g,
|
|
2004
2007
|
children: e
|
|
2005
2008
|
});
|
|
2006
|
-
return n === "fixed" ? _e(
|
|
2009
|
+
return n === "fixed" ? _e(D, document.body) : D;
|
|
2007
2010
|
}), er = a(function({ children: e, onSelect: t, disabled: n, icon: r, shortcut: i, destructive: a, checked: o, meta: s, className: c, dataTestId: l, onClick: u, ...d }, f) {
|
|
2008
2011
|
let { setOpen: p } = Yn();
|
|
2009
2012
|
return /* @__PURE__ */ J("button", {
|