@dinofront/design_system 1.17.1 → 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 +29 -25
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -177,6 +177,7 @@ var $e = a(function({ type: e = "single", defaultValue: t, value: n, onValueChan
|
|
|
177
177
|
danger: "bg-red-900"
|
|
178
178
|
}, at = a(function({ variant: e = "primary", size: t = "md", leftIcon: n, rightIcon: r, loading: i = !1, iconOnly: a = !1, fullWidth: o = !1, pressed: s = !1, disabled: c, className: l, children: u, onClick: d, dataTestId: f, ...p }, m) {
|
|
179
179
|
return /* @__PURE__ */ q("button", {
|
|
180
|
+
type: "button",
|
|
180
181
|
ref: m,
|
|
181
182
|
disabled: c || i,
|
|
182
183
|
"aria-pressed": s,
|
|
@@ -1935,19 +1936,19 @@ function Zn({ children: e }) {
|
|
|
1935
1936
|
ref: i,
|
|
1936
1937
|
onClick: (e) => {
|
|
1937
1938
|
let n = a.onClick;
|
|
1938
|
-
n?.(e), e.defaultPrevented || r(!t);
|
|
1939
|
+
n?.(e), e.stopPropagation(), e.defaultPrevented || r(!t);
|
|
1939
1940
|
},
|
|
1940
1941
|
"aria-haspopup": "menu",
|
|
1941
1942
|
"aria-expanded": t
|
|
1942
1943
|
});
|
|
1943
1944
|
}
|
|
1944
|
-
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,
|
|
1945
|
-
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({
|
|
1946
1947
|
anchor: f(() => ({ get current() {
|
|
1947
|
-
return qn(
|
|
1948
|
-
} }), [
|
|
1949
|
-
panel:
|
|
1950
|
-
open:
|
|
1948
|
+
return qn(x) ?? b.current;
|
|
1949
|
+
} }), [x, b]),
|
|
1950
|
+
panel: C,
|
|
1951
|
+
open: v && n === "fixed",
|
|
1951
1952
|
side: r,
|
|
1952
1953
|
align: t,
|
|
1953
1954
|
offset: i,
|
|
@@ -1956,53 +1957,56 @@ var Qn = "min-w-[200px] rounded-lg border border-border-default bg-bg-default sh
|
|
|
1956
1957
|
matchAnchorWidth: s
|
|
1957
1958
|
});
|
|
1958
1959
|
if (l(() => {
|
|
1959
|
-
if (!
|
|
1960
|
+
if (!v) return;
|
|
1960
1961
|
let e = (e) => {
|
|
1961
1962
|
let t = e.target;
|
|
1962
|
-
|
|
1963
|
+
S.current?.contains(t) || b.current?.contains(t) || qn(x)?.contains(t) || y(!1);
|
|
1963
1964
|
};
|
|
1964
1965
|
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
1965
1966
|
}, [
|
|
1966
|
-
_,
|
|
1967
1967
|
v,
|
|
1968
1968
|
y,
|
|
1969
|
-
b
|
|
1969
|
+
b,
|
|
1970
|
+
x
|
|
1970
1971
|
]), l(() => {
|
|
1971
|
-
if (!
|
|
1972
|
-
let e = () =>
|
|
1972
|
+
if (!v || !c) return;
|
|
1973
|
+
let e = () => y(!1);
|
|
1973
1974
|
return document.addEventListener("scroll", e, {
|
|
1974
1975
|
capture: !0,
|
|
1975
1976
|
passive: !0
|
|
1976
1977
|
}), () => document.removeEventListener("scroll", e, { capture: !0 });
|
|
1977
1978
|
}, [
|
|
1978
|
-
|
|
1979
|
+
v,
|
|
1979
1980
|
c,
|
|
1980
|
-
|
|
1981
|
+
y
|
|
1981
1982
|
]), l(() => {
|
|
1982
|
-
if (!
|
|
1983
|
+
if (!v) return;
|
|
1983
1984
|
let e = requestAnimationFrame(() => {
|
|
1984
|
-
(
|
|
1985
|
+
(S.current?.querySelector("[role=\"menuitem\"]:not(:disabled)"))?.focus();
|
|
1985
1986
|
});
|
|
1986
1987
|
return () => cancelAnimationFrame(e);
|
|
1987
|
-
}, [
|
|
1988
|
-
let
|
|
1989
|
-
ref: Gt(
|
|
1988
|
+
}, [v]), !v) return null;
|
|
1989
|
+
let D = /* @__PURE__ */ q("div", {
|
|
1990
|
+
ref: Gt(_, S, n === "fixed" ? w : void 0),
|
|
1990
1991
|
role: "menu",
|
|
1991
1992
|
"data-test-id": d,
|
|
1992
|
-
"data-side": n === "fixed" ?
|
|
1993
|
+
"data-side": n === "fixed" ? E : void 0,
|
|
1993
1994
|
"data-align": t,
|
|
1994
1995
|
onKeyDown: (e) => {
|
|
1995
|
-
let t = Array.from(
|
|
1996
|
+
let t = Array.from(S.current?.querySelectorAll("[role=\"menuitem\"]:not(:disabled)") ?? []);
|
|
1996
1997
|
if (!t.length) return;
|
|
1997
1998
|
let n = t.indexOf(document.activeElement);
|
|
1998
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());
|
|
1999
2000
|
},
|
|
2000
|
-
|
|
2001
|
+
onClick: (e) => {
|
|
2002
|
+
h?.(e), e.stopPropagation();
|
|
2003
|
+
},
|
|
2004
|
+
style: n === "fixed" ? T : void 0,
|
|
2001
2005
|
className: Q(Qn, n === "absolute" && Q("absolute top-full mt-1", t === "end" ? "right-0" : "left-0"), u),
|
|
2002
|
-
...
|
|
2006
|
+
...g,
|
|
2003
2007
|
children: e
|
|
2004
2008
|
});
|
|
2005
|
-
return n === "fixed" ? _e(
|
|
2009
|
+
return n === "fixed" ? _e(D, document.body) : D;
|
|
2006
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) {
|
|
2007
2011
|
let { setOpen: p } = Yn();
|
|
2008
2012
|
return /* @__PURE__ */ J("button", {
|