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.
81 lines
1.8 KiB
TypeScript
81 lines
1.8 KiB
TypeScript
"use client"
|
|
|
|
import {
|
|
Combobox,
|
|
ComboboxCollection,
|
|
ComboboxContent,
|
|
ComboboxEmpty,
|
|
ComboboxGroup,
|
|
ComboboxInput,
|
|
ComboboxItem,
|
|
ComboboxLabel,
|
|
ComboboxList,
|
|
} from "@/examples/base/ui/combobox"
|
|
import { InputGroupAddon } from "@/examples/base/ui/input-group"
|
|
import { GlobeIcon } from "lucide-react"
|
|
|
|
const timezones = [
|
|
{
|
|
value: "Americas",
|
|
items: [
|
|
"(GMT-5) New York",
|
|
"(GMT-8) Los Angeles",
|
|
"(GMT-6) Chicago",
|
|
"(GMT-5) Toronto",
|
|
"(GMT-8) Vancouver",
|
|
"(GMT-3) São Paulo",
|
|
],
|
|
},
|
|
{
|
|
value: "Europe",
|
|
items: [
|
|
"(GMT+0) London",
|
|
"(GMT+1) Paris",
|
|
"(GMT+1) Berlin",
|
|
"(GMT+1) Rome",
|
|
"(GMT+1) Madrid",
|
|
"(GMT+1) Amsterdam",
|
|
],
|
|
},
|
|
{
|
|
value: "Asia/Pacific",
|
|
items: [
|
|
"(GMT+9) Tokyo",
|
|
"(GMT+8) Shanghai",
|
|
"(GMT+8) Singapore",
|
|
"(GMT+4) Dubai",
|
|
"(GMT+11) Sydney",
|
|
"(GMT+9) Seoul",
|
|
],
|
|
},
|
|
] as const
|
|
|
|
export function ComboxboxInputGroup() {
|
|
return (
|
|
<Combobox items={timezones}>
|
|
<ComboboxInput placeholder="Select a timezone">
|
|
<InputGroupAddon>
|
|
<GlobeIcon />
|
|
</InputGroupAddon>
|
|
</ComboboxInput>
|
|
<ComboboxContent alignOffset={-28} className="w-60">
|
|
<ComboboxEmpty>No timezones found.</ComboboxEmpty>
|
|
<ComboboxList>
|
|
{(group) => (
|
|
<ComboboxGroup key={group.value} items={group.items}>
|
|
<ComboboxLabel>{group.value}</ComboboxLabel>
|
|
<ComboboxCollection>
|
|
{(item) => (
|
|
<ComboboxItem key={item} value={item}>
|
|
{item}
|
|
</ComboboxItem>
|
|
)}
|
|
</ComboboxCollection>
|
|
</ComboboxGroup>
|
|
)}
|
|
</ComboboxList>
|
|
</ComboboxContent>
|
|
</Combobox>
|
|
)
|
|
}
|