"use client"
import { useState } from "react"
import { toast } from "sonner"
import {
Example,
ExampleWrapper,
} from "@/registry/bases/base/components/example"
import { Button } from "@/registry/bases/base/ui/button"
import {
ButtonGroup,
ButtonGroupText,
} from "@/registry/bases/base/ui/button-group"
import {
Card,
CardContent,
CardDescription,
CardFooter,
CardHeader,
CardTitle,
} from "@/registry/bases/base/ui/card"
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuTrigger,
} from "@/registry/bases/base/ui/dropdown-menu"
import {
Field,
FieldDescription,
FieldGroup,
FieldLabel,
} from "@/registry/bases/base/ui/field"
import { Input } from "@/registry/bases/base/ui/input"
import {
InputGroup,
InputGroupAddon,
InputGroupButton,
InputGroupInput,
InputGroupText,
InputGroupTextarea,
} from "@/registry/bases/base/ui/input-group"
import { Kbd, KbdGroup } from "@/registry/bases/base/ui/kbd"
import {
Popover,
PopoverContent,
PopoverDescription,
PopoverHeader,
PopoverTitle,
PopoverTrigger,
} from "@/registry/bases/base/ui/popover"
import { Spinner } from "@/registry/bases/base/ui/spinner"
import { Textarea } from "@/registry/bases/base/ui/textarea"
import {
Tooltip,
TooltipContent,
TooltipTrigger,
} from "@/registry/bases/base/ui/tooltip"
import { IconPlaceholder } from "@/app/(create)/components/icon-placeholder"
export default function InputGroupExample() {
const [country, setCountry] = useState("+1")
return (
)
}
function InputGroupBasic() {
return (
Default (No Input Group)
Input GroupDisabledInvalid
)
}
function InputGroupWithAddons() {
return (
Addon (inline-start)
Addon (inline-end)
Addon (inline-start and inline-end)
Addon (block-start)First NameAddon (block-end)20/240 charactersMultiple Icons toast("Copied to clipboard")}
>
Description
This is a description of the input group.
LabelLabel(optional)
)
}
function InputGroupWithButtons() {
return (
ButtonDefaultOutlineSecondaryButton
)
}
function InputGroupWithTooltip({
country,
setCountry,
}: {
country: string
setCountry: (value: string) => void
}) {
return (
Tooltip
}
>
This is content in a tooltip.
This is a description of the input group.
Dropdown
}
>
{country}{" "}
setCountry("+1")}>
+1
setCountry("+44")}>
+44
setCountry("+46")}>
+46
This is a description of the input group.
Popover} nativeButton={false}>
Your connection is not secure.
You should not enter any sensitive information on this site.
https://
toast("Added to favorites")}
>
This is a description of the input group.
Button Grouphttps://.com
This is a description of the input group.
)
}
function InputGroupWithKbd() {
return (
Input Group with Kbd⌘K⌘KAsk AITabCtrlCUsername
This username is available.
12 resultsDisabledFirst NameLast Name
Loading ("data-disabled="true")
This is a description of the input group.
)
}
function InputGroupInCard() {
return (
Card with Input GroupThis is a card with an input group.Email AddressWebsite URLhttps://
Feedback & Comments
0/500 characters
)
}
function InputGroupTextareaExamples() {
return (
Default Textarea (No Input Group)
Input Group
This is a description of the input group.
Invalid
This is a description of the input group.
Disabled
This is a description of the input group.
Addon (block-start)Ask, Search or Chat...
This is a description of the input group.
Addon (block-end)
0/280 charactersSendAddon (Buttons)
Cancel
Post Comment
Code Editor
script.js
Line 1, Column 1JavaScript
)
}