@dndbuilder.com/react
Version:
Drag and drop builder for React
103 lines (102 loc) • 4.43 kB
JavaScript
"use client";
import { jsx as t, jsxs as n } from "react/jsx-runtime";
import d from "react";
import { Group as R, SelectGroup as C, Value as I, SelectValue as V, Trigger as m, Icon as v, Portal as G, Content as c, Viewport as j, Label as p, Item as f, ItemIndicator as T, ItemText as z, Separator as u, Root as L, Select as $ } from "../../../../../node_modules/.pnpm/@radix-ui_react-select@2.2.4_@types_react-dom@19.0.4_@types_react@19.0.10__@types_react@19.0._peyebhllg4jtb52yrparcrrmki/node_modules/@radix-ui/react-select/dist/index.js";
import { HiChevronDown as _ } from "../../../../../node_modules/.pnpm/react-icons@5.5.0_react@19.0.0/node_modules/react-icons/hi/index.js";
import { BsCheck2 as k } from "../../../../../node_modules/.pnpm/react-icons@5.5.0_react@19.0.0/node_modules/react-icons/bs/index.js";
import { classNames as l } from "../../../../../utils.js";
const o = ({ children: e, ...a }) => /* @__PURE__ */ t(L, { ...a, children: e }), y = d.forwardRef(({ children: e, ...a }, r) => /* @__PURE__ */ t(R, { ref: r, ...a, children: e }));
y.displayName = C.displayName;
const h = d.forwardRef(({ children: e, className: a, ...r }, s) => /* @__PURE__ */ t(I, { className: l("", a), ref: s, ...r, children: e }));
h.displayName = V.displayName;
const g = d.forwardRef(({ className: e, children: a, chevronDown: r = !0, ...s }, i) => /* @__PURE__ */ n(
m,
{
ref: i,
className: l(
"focus:outline-hidden flex h-[30px] w-full items-center justify-between whitespace-nowrap rounded-sm border border-gray-300 bg-transparent p-2 text-xs text-gray-800 placeholder:text-gray-300 focus:border-gray-500 focus:ring-0 disabled:cursor-not-allowed disabled:opacity-50",
e
),
...s,
children: [
a,
r && /* @__PURE__ */ t(v, { asChild: !0, children: /* @__PURE__ */ t(_, { className: "h-4 w-4 opacity-50" }) })
]
}
));
g.displayName = m.displayName;
const N = d.forwardRef(({ className: e, sideOffset: a = -40, children: r, position: s = "popper", ...i }, S) => /* @__PURE__ */ t(G, { children: /* @__PURE__ */ t(
c,
{
ref: S,
className: l(
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 min-w-32 overflow-hidden rounded-sm border bg-white shadow-md",
s === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
e
),
sideOffset: a,
position: s,
...i,
children: /* @__PURE__ */ t(
j,
{
className: l(
// 'p-1',
s === "popper" && "h-(--radix-select-trigger-height) min-w-(--radix-select-trigger-width) w-full"
),
children: r
}
)
}
) }));
N.displayName = c.displayName;
const w = d.forwardRef(({ className: e, children: a, ...r }, s) => /* @__PURE__ */ t(
p,
{
ref: s,
className: l("py-1.5 pe-2 ps-8 text-sm font-semibold", e),
...r,
children: a
}
));
w.displayName = p.displayName;
const x = d.forwardRef(
({ className: e, children: a, showCheck: r = !0, ...s }, i) => /* @__PURE__ */ n(
f,
{
ref: i,
className: l(
"rounded-xs outline-hidden data-disabled:pointer-events-none data-disabled:opacity-50 relative flex w-full cursor-default select-none items-center py-1.5 pe-2 ps-8 text-xs text-gray-800 focus:bg-gray-100 focus:text-gray-900",
e
),
...s,
children: [
r && /* @__PURE__ */ t("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ t(T, { children: /* @__PURE__ */ t(k, { className: "h-4 w-4" }) }) }),
/* @__PURE__ */ t(z, { children: a })
]
}
)
);
x.displayName = f.displayName;
const b = d.forwardRef(({ className: e, children: a, ...r }, s) => /* @__PURE__ */ t(
u,
{
ref: s,
className: l("-mx-1 my-1 h-px bg-gray-300", e),
...r,
children: a
}
));
b.displayName = u.displayName;
o.Group = y;
o.Value = h;
o.Trigger = g;
o.Content = N;
o.Label = w;
o.Item = x;
o.Separator = b;
o.displayName = $.displayName;
export {
o as Select
};
//# sourceMappingURL=select.js.map