307 lines
8.7 KiB
JavaScript
307 lines
8.7 KiB
JavaScript
/*
|
|
* Extracted from browser-delivered Turbopack chunk: 2cd465e94e439d21.d295534e06.js
|
|
* Module id: 524961
|
|
* For reading/searching only; this factory depends on the original Turbopack runtime.
|
|
*/
|
|
|
|
const moduleFactory = (e) => {
|
|
"use strict";
|
|
var t = e.i(462214),
|
|
r = e.i(389435);
|
|
e.i(358379);
|
|
var o = e.i(855698),
|
|
n = e.i(938202);
|
|
e.i(7284);
|
|
var i = e.i(479324),
|
|
a = e.i(450943),
|
|
s = e.i(124859),
|
|
l = e.i(910655),
|
|
c = e.i(403094),
|
|
u = e.i(764218),
|
|
d = e.i(606227),
|
|
f = {
|
|
root: "m_77c9d27d",
|
|
inner: "m_80f1301b",
|
|
label: "m_811560b9",
|
|
section: "m_a74036a",
|
|
loader: "m_a25b86ee",
|
|
group: "m_80d6d844",
|
|
groupSection: "m_70be2a01",
|
|
},
|
|
p = e.i(593307);
|
|
let g = { orientation: "horizontal" },
|
|
m = (0, n.createVarsResolver)((e, { borderWidth: t }) => ({
|
|
group: { "--button-border-width": (0, r.rem)(t) },
|
|
})),
|
|
h = (0, p.factory)((e, r) => {
|
|
let o = (0, i.useProps)("ButtonGroup", g, e),
|
|
{
|
|
className: n,
|
|
style: l,
|
|
classNames: c,
|
|
styles: u,
|
|
unstyled: d,
|
|
orientation: p,
|
|
vars: h,
|
|
borderWidth: b,
|
|
variant: y,
|
|
mod: x,
|
|
attributes: v,
|
|
...S
|
|
} = (0, i.useProps)("ButtonGroup", g, e),
|
|
k = (0, a.useStyles)({
|
|
name: "ButtonGroup",
|
|
props: o,
|
|
classes: f,
|
|
className: n,
|
|
style: l,
|
|
classNames: c,
|
|
styles: u,
|
|
unstyled: d,
|
|
attributes: v,
|
|
vars: h,
|
|
varsResolver: m,
|
|
rootSelector: "group",
|
|
});
|
|
return (0, t.jsx)(s.Box, {
|
|
...k("group"),
|
|
ref: r,
|
|
variant: y,
|
|
mod: [{ "data-orientation": p }, x],
|
|
role: "group",
|
|
...S,
|
|
});
|
|
});
|
|
(h.classes = f), (h.displayName = "@mantine/core/ButtonGroup");
|
|
let b = (0, n.createVarsResolver)(
|
|
(
|
|
e,
|
|
{
|
|
radius: t,
|
|
color: r,
|
|
gradient: n,
|
|
variant: i,
|
|
autoContrast: a,
|
|
size: s,
|
|
},
|
|
) => {
|
|
let l = e.variantColorResolver({
|
|
color: r || e.primaryColor,
|
|
theme: e,
|
|
gradient: n,
|
|
variant: i || "filled",
|
|
autoContrast: a,
|
|
});
|
|
return {
|
|
groupSection: {
|
|
"--section-height": (0, o.getSize)(s, "section-height"),
|
|
"--section-padding-x": (0, o.getSize)(s, "section-padding-x"),
|
|
"--section-fz": s?.includes("compact")
|
|
? (0, o.getFontSize)(s.replace("compact-", ""))
|
|
: (0, o.getFontSize)(s),
|
|
"--section-radius": void 0 === t ? void 0 : (0, o.getRadius)(t),
|
|
"--section-bg": r || i ? l.background : void 0,
|
|
"--section-color": l.color,
|
|
"--section-bd": r || i ? l.border : void 0,
|
|
},
|
|
};
|
|
},
|
|
),
|
|
y = (0, p.factory)((e, r) => {
|
|
let o = (0, i.useProps)("ButtonGroupSection", null, e),
|
|
{
|
|
className: n,
|
|
style: l,
|
|
classNames: c,
|
|
styles: u,
|
|
unstyled: d,
|
|
vars: p,
|
|
variant: g,
|
|
gradient: m,
|
|
radius: h,
|
|
autoContrast: y,
|
|
attributes: x,
|
|
...v
|
|
} = o,
|
|
S = (0, a.useStyles)({
|
|
name: "ButtonGroupSection",
|
|
props: o,
|
|
classes: f,
|
|
className: n,
|
|
style: l,
|
|
classNames: c,
|
|
styles: u,
|
|
unstyled: d,
|
|
attributes: x,
|
|
vars: p,
|
|
varsResolver: b,
|
|
rootSelector: "groupSection",
|
|
});
|
|
return (0, t.jsx)(s.Box, {
|
|
...S("groupSection"),
|
|
ref: r,
|
|
variant: g,
|
|
...v,
|
|
});
|
|
});
|
|
(y.classes = f), (y.displayName = "@mantine/core/ButtonGroupSection");
|
|
let x = {
|
|
in: {
|
|
opacity: 1,
|
|
transform: `translate(-50%, calc(-50% + ${(0, r.rem)(1)}))`,
|
|
},
|
|
out: { opacity: 0, transform: "translate(-50%, -200%)" },
|
|
common: { transformOrigin: "center" },
|
|
transitionProperty: "transform, opacity",
|
|
},
|
|
v = (0, n.createVarsResolver)(
|
|
(
|
|
e,
|
|
{
|
|
radius: t,
|
|
color: r,
|
|
gradient: n,
|
|
variant: i,
|
|
size: a,
|
|
justify: s,
|
|
autoContrast: l,
|
|
},
|
|
) => {
|
|
let c = e.variantColorResolver({
|
|
color: r || e.primaryColor,
|
|
theme: e,
|
|
gradient: n,
|
|
variant: i || "filled",
|
|
autoContrast: l,
|
|
});
|
|
return {
|
|
root: {
|
|
"--button-justify": s,
|
|
"--button-height": (0, o.getSize)(a, "button-height"),
|
|
"--button-padding-x": (0, o.getSize)(a, "button-padding-x"),
|
|
"--button-fz": a?.includes("compact")
|
|
? (0, o.getFontSize)(a.replace("compact-", ""))
|
|
: (0, o.getFontSize)(a),
|
|
"--button-radius": void 0 === t ? void 0 : (0, o.getRadius)(t),
|
|
"--button-bg": r || i ? c.background : void 0,
|
|
"--button-hover": r || i ? c.hover : void 0,
|
|
"--button-color": c.color,
|
|
"--button-bd": r || i ? c.border : void 0,
|
|
"--button-hover-color": r || i ? c.hoverColor : void 0,
|
|
},
|
|
};
|
|
},
|
|
),
|
|
S = (0, l.polymorphicFactory)((e, r) => {
|
|
let o = (0, i.useProps)("Button", null, e),
|
|
{
|
|
style: n,
|
|
vars: l,
|
|
className: p,
|
|
color: g,
|
|
disabled: m,
|
|
children: h,
|
|
leftSection: b,
|
|
rightSection: y,
|
|
fullWidth: S,
|
|
variant: k,
|
|
radius: w,
|
|
loading: C,
|
|
loaderProps: j,
|
|
gradient: E,
|
|
classNames: M,
|
|
styles: $,
|
|
unstyled: T,
|
|
"data-disabled": _,
|
|
autoContrast: R,
|
|
mod: L,
|
|
attributes: A,
|
|
...I
|
|
} = o,
|
|
P = (0, a.useStyles)({
|
|
name: "Button",
|
|
props: o,
|
|
classes: f,
|
|
className: p,
|
|
style: n,
|
|
classNames: M,
|
|
styles: $,
|
|
unstyled: T,
|
|
attributes: A,
|
|
vars: l,
|
|
varsResolver: v,
|
|
}),
|
|
z = !!b,
|
|
N = !!y;
|
|
return (0, t.jsxs)(d.UnstyledButton, {
|
|
ref: r,
|
|
...P("root", { active: !m && !C && !_ }),
|
|
unstyled: T,
|
|
variant: k,
|
|
disabled: m || C,
|
|
mod: [
|
|
{
|
|
disabled: m || _,
|
|
loading: C,
|
|
block: S,
|
|
"with-left-section": z,
|
|
"with-right-section": N,
|
|
},
|
|
L,
|
|
],
|
|
...I,
|
|
children: [
|
|
"boolean" == typeof C &&
|
|
(0, t.jsx)(u.Transition, {
|
|
mounted: C,
|
|
transition: x,
|
|
duration: 150,
|
|
children: (e) =>
|
|
(0, t.jsx)(s.Box, {
|
|
component: "span",
|
|
...P("loader", { style: e }),
|
|
"aria-hidden": !0,
|
|
children: (0, t.jsx)(c.Loader, {
|
|
color: "var(--button-color)",
|
|
size: "calc(var(--button-height) / 1.8)",
|
|
...j,
|
|
}),
|
|
}),
|
|
}),
|
|
(0, t.jsxs)("span", {
|
|
...P("inner"),
|
|
children: [
|
|
b &&
|
|
(0, t.jsx)(s.Box, {
|
|
component: "span",
|
|
...P("section"),
|
|
mod: { position: "left" },
|
|
children: b,
|
|
}),
|
|
(0, t.jsx)(s.Box, {
|
|
component: "span",
|
|
mod: { loading: C },
|
|
...P("label"),
|
|
children: h,
|
|
}),
|
|
y &&
|
|
(0, t.jsx)(s.Box, {
|
|
component: "span",
|
|
...P("section"),
|
|
mod: { position: "right" },
|
|
children: y,
|
|
}),
|
|
],
|
|
}),
|
|
],
|
|
});
|
|
});
|
|
(S.classes = f),
|
|
(S.displayName = "@mantine/core/Button"),
|
|
(S.Group = h),
|
|
(S.GroupSection = y),
|
|
e.s(["Button", () => S], 524961);
|
|
};
|
|
|
|
export default moduleFactory;
|