mirror of
https://github.com/hanzoai/ui.git
synced 2026-11-21 00:18:41 +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.
64 lines
2.0 KiB
TypeScript
64 lines
2.0 KiB
TypeScript
"use client"
|
|
|
|
import * as React from "react"
|
|
import { Button } from "@/examples/base/ui/button"
|
|
import { Calendar } from "@/examples/base/ui/calendar"
|
|
import { Field, FieldGroup, FieldLabel } from "@/examples/base/ui/field"
|
|
import { Input } from "@/examples/base/ui/input"
|
|
import {
|
|
Popover,
|
|
PopoverContent,
|
|
PopoverTrigger,
|
|
} from "@/examples/base/ui/popover"
|
|
import { format } from "date-fns"
|
|
import { ChevronDownIcon } from "lucide-react"
|
|
|
|
export function DatePickerTime() {
|
|
const [open, setOpen] = React.useState(false)
|
|
const [date, setDate] = React.useState<Date | undefined>(undefined)
|
|
|
|
return (
|
|
<FieldGroup className="mx-auto max-w-xs flex-row">
|
|
<Field>
|
|
<FieldLabel htmlFor="date-picker-optional">Date</FieldLabel>
|
|
<Popover open={open} onOpenChange={setOpen}>
|
|
<PopoverTrigger
|
|
render={
|
|
<Button
|
|
variant="outline"
|
|
id="date-picker-optional"
|
|
className="w-32 justify-between font-normal"
|
|
/>
|
|
}
|
|
>
|
|
{date ? format(date, "PPP") : "Select date"}
|
|
<ChevronDownIcon data-icon="inline-end" />
|
|
</PopoverTrigger>
|
|
<PopoverContent className="w-auto overflow-hidden p-0" align="start">
|
|
<Calendar
|
|
mode="single"
|
|
selected={date}
|
|
captionLayout="dropdown"
|
|
defaultMonth={date}
|
|
onSelect={(date) => {
|
|
setDate(date)
|
|
setOpen(false)
|
|
}}
|
|
/>
|
|
</PopoverContent>
|
|
</Popover>
|
|
</Field>
|
|
<Field className="w-32">
|
|
<FieldLabel htmlFor="time-picker-optional">Time</FieldLabel>
|
|
<Input
|
|
type="time"
|
|
id="time-picker-optional"
|
|
step="1"
|
|
defaultValue="10:30:00"
|
|
className="bg-background appearance-none [&::-webkit-calendar-picker-indicator]:hidden [&::-webkit-calendar-picker-indicator]:appearance-none"
|
|
/>
|
|
</Field>
|
|
</FieldGroup>
|
|
)
|
|
}
|