mirror of
https://github.com/hanzoai/shadcn.git
synced 2026-10-30 18:22:59 +00:00
Squash merge of shadcn-ui/ui main branch into hanzo/ui, bringing in: - [email protected] through [email protected] releases - New apps/v4 directory structure - Registry system improvements and MCP server - Framework support (Vue, Svelte, React Native) - New templates (vite-app, monorepo-next, laravel) - Zod 4 compatibility (scoped override for zod@>4) - Test fixture corrections for alias resolution All 867 merge conflicts resolved preserving Hanzo customizations. 1020/1020 shadcn tests pass.
62 lines
1.6 KiB
TypeScript
62 lines
1.6 KiB
TypeScript
import * as React from "react"
|
|
|
|
import { cn } from "@/registry/bases/base/lib/utils"
|
|
import { IconPlaceholder } from "@/app/(create)/components/icon-placeholder"
|
|
|
|
type NativeSelectProps = Omit<React.ComponentProps<"select">, "size"> & {
|
|
size?: "sm" | "default"
|
|
}
|
|
|
|
function NativeSelect({
|
|
className,
|
|
size = "default",
|
|
...props
|
|
}: NativeSelectProps) {
|
|
return (
|
|
<div
|
|
className={cn(
|
|
"cn-native-select-wrapper group/native-select relative w-fit has-[select:disabled]:opacity-50",
|
|
className
|
|
)}
|
|
data-slot="native-select-wrapper"
|
|
data-size={size}
|
|
>
|
|
<select
|
|
data-slot="native-select"
|
|
data-size={size}
|
|
className="cn-native-select outline-none disabled:pointer-events-none disabled:cursor-not-allowed"
|
|
{...props}
|
|
/>
|
|
<IconPlaceholder
|
|
lucide="ChevronDownIcon"
|
|
tabler="IconSelector"
|
|
hugeicons="UnfoldMoreIcon"
|
|
phosphor="CaretDownIcon"
|
|
remixicon="RiArrowDownSLine"
|
|
className="cn-native-select-icon pointer-events-none absolute select-none"
|
|
aria-hidden="true"
|
|
data-slot="native-select-icon"
|
|
/>
|
|
</div>
|
|
)
|
|
}
|
|
|
|
function NativeSelectOption({ ...props }: React.ComponentProps<"option">) {
|
|
return <option data-slot="native-select-option" {...props} />
|
|
}
|
|
|
|
function NativeSelectOptGroup({
|
|
className,
|
|
...props
|
|
}: React.ComponentProps<"optgroup">) {
|
|
return (
|
|
<optgroup
|
|
data-slot="native-select-optgroup"
|
|
className={cn(className)}
|
|
{...props}
|
|
/>
|
|
)
|
|
}
|
|
|
|
export { NativeSelect, NativeSelectOptGroup, NativeSelectOption }
|