"use client";
import { cn } from "./index3.js";
import { Check, ChevronDown, ChevronUp } from "lucide-react";
import * as React from "react";
import { jsx, jsxs } from "react/jsx-runtime";
import { Select } from "@base-ui/react/select";
//#region src/components/ui/select.tsx
var Select$1 = Select.Root;
var SelectGroup = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(Select.Group, {
	ref,
	"data-slot": "select-group",
	className: cn("scroll-my-1 p-1", className),
	...props
}));
SelectGroup.displayName = "Select.Group";
var SelectValue = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(Select.Value, {
	ref,
	"data-slot": "select-value",
	className: cn("flex flex-1 text-left", className),
	...props
}));
SelectValue.displayName = "Select.Value";
var SelectTrigger = React.forwardRef(({ className, size = "md", shape = "rounded", state = "default", children, ...props }, ref) => /* @__PURE__ */ jsxs(Select.Trigger, {
	ref,
	"data-slot": "select-trigger",
	"data-size": size,
	"data-shape": shape,
	"data-state": state,
	"aria-invalid": state === "error" || void 0,
	className: cn("flex w-full items-center justify-between gap-1.5 outline-none", "bg-background border shadow-xs transition-[color,border-color,box-shadow] duration-200 ease-out motion-reduce:transition-none", "not-disabled:hover:border-ring/50", "disabled:cursor-not-allowed disabled:opacity-50", "*:data-[slot=select-value]:flex *:data-[slot=select-value]:flex-1 *:data-[slot=select-value]:items-center", "data-[placeholder]:text-muted-foreground", size === "xs" && "h-7 px-3 py-1 text-xs", size === "sm" && "h-8 px-3 py-1.5 text-xs", size === "md" && "h-9 px-3 py-2 text-xs", size === "lg" && "h-10 px-3 py-2.5 text-sm", shape === "rounded" && "rounded-xl", shape === "round" && "rounded-full", state === "default" && "border-input", state === "success" && "border-success", state === "error" && "border-destructive", "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]", state === "error" && "focus-visible:ring-destructive/20", className),
	...props,
	children: [children, /* @__PURE__ */ jsx(Select.Icon, { render: /* @__PURE__ */ jsx(ChevronDown, { className: "size-4 shrink-0 text-muted-foreground" }) })]
}));
SelectTrigger.displayName = "Select.Trigger";
var SelectPopup = React.forwardRef(({ className, children, side = "bottom", sideOffset = 4, align = "center", alignOffset = 0, alignItemWithTrigger = true, ...props }, ref) => /* @__PURE__ */ jsx(Select.Portal, { children: /* @__PURE__ */ jsx(Select.Positioner, {
	side,
	sideOffset,
	align,
	alignOffset,
	alignItemWithTrigger,
	className: "isolate z-50",
	children: /* @__PURE__ */ jsxs(Select.Popup, {
		ref,
		"data-slot": "select-popup",
		className: cn("bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-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 motion-reduce:animate-none ring-foreground/10 min-w-36 rounded-md shadow-md ring-1 duration-100 relative isolate z-50 max-h-(--available-height) w-(--anchor-width) origin-(--transform-origin) overflow-x-hidden overflow-y-auto", className),
		...props,
		children: [
			/* @__PURE__ */ jsx(SelectScrollUpButton, {}),
			/* @__PURE__ */ jsx(Select.List, { children }),
			/* @__PURE__ */ jsx(SelectScrollDownButton, {})
		]
	})
}) }));
SelectPopup.displayName = "Select.Popup";
var SelectGroupLabel = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(Select.GroupLabel, {
	ref,
	"data-slot": "select-group-label",
	className: cn("text-muted-foreground px-2 py-1.5 text-xs", className),
	...props
}));
SelectGroupLabel.displayName = "Select.GroupLabel";
var SelectItem = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(Select.Item, {
	ref,
	"data-slot": "select-item",
	className: cn("focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground transition-colors duration-75 ease-out motion-reduce:transition-none gap-2 rounded-sm py-1.5 pe-8 ps-2 text-sm [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2 relative flex w-full cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0", className),
	...props,
	children: [/* @__PURE__ */ jsx(Select.ItemText, {
		className: "flex flex-1 gap-2 shrink-0 whitespace-nowrap",
		children
	}), /* @__PURE__ */ jsx(Select.ItemIndicator, {
		render: /* @__PURE__ */ jsx("span", { className: "pointer-events-none absolute end-2 flex size-4 items-center justify-center" }),
		children: /* @__PURE__ */ jsx(Check, { className: "pointer-events-none animate-in zoom-in-75 fade-in duration-150 motion-reduce:animate-none" })
	})]
}));
SelectItem.displayName = "Select.Item";
var SelectSeparator = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(Select.Separator, {
	ref,
	"data-slot": "select-separator",
	className: cn("bg-border -mx-1 my-1 h-px pointer-events-none", className),
	...props
}));
SelectSeparator.displayName = "Select.Separator";
var SelectScrollUpButton = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(Select.ScrollUpArrow, {
	ref,
	"data-slot": "select-scroll-up-button",
	className: cn("bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4 top-0 w-full", className),
	...props,
	children: /* @__PURE__ */ jsx(ChevronUp, {})
}));
SelectScrollUpButton.displayName = "Select.ScrollUpButton";
var SelectScrollDownButton = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(Select.ScrollDownArrow, {
	ref,
	"data-slot": "select-scroll-down-button",
	className: cn("bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4 bottom-0 w-full", className),
	...props,
	children: /* @__PURE__ */ jsx(ChevronDown, {})
}));
SelectScrollDownButton.displayName = "Select.ScrollDownButton";
//#endregion
export { Select$1 as Select, SelectItem, SelectPopup, SelectTrigger, SelectValue };

//# sourceMappingURL=index425.js.map