{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "v-combobox-21",
  "description": "Timezone picker with UTC offset badge in trigger and region info below",
  "registryDependencies": [
    "@cnippet/combobox"
  ],
  "files": [
    {
      "path": "registry/default/variants/v-combobox-21.tsx",
      "content": "// title: Timezone picker with UTC offset badge in trigger and region info below\n\"use client\";\n\nimport { ChevronsUpDownIcon, XIcon } from \"lucide-react\";\nimport { useState } from \"react\";\nimport { Badge } from \"@/registry/default/ui/badge\";\nimport { Button } from \"@/registry/default/ui/button\";\nimport {\n  Combobox,\n  ComboboxEmpty,\n  ComboboxInput,\n  ComboboxItem,\n  ComboboxList,\n  ComboboxPopup,\n  ComboboxTrigger,\n  ComboboxValue,\n} from \"@/registry/default/ui/combobox\";\n\ninterface Timezone {\n  label: string;\n  value: string;\n  offset: string;\n  region: string;\n}\n\nconst timezones: Timezone[] = [\n  {\n    label: \"Pacific Time\",\n    offset: \"UTC-8\",\n    region: \"Americas\",\n    value: \"America/Los_Angeles\",\n  },\n  {\n    label: \"Mountain Time\",\n    offset: \"UTC-7\",\n    region: \"Americas\",\n    value: \"America/Denver\",\n  },\n  {\n    label: \"Central Time\",\n    offset: \"UTC-6\",\n    region: \"Americas\",\n    value: \"America/Chicago\",\n  },\n  {\n    label: \"Eastern Time\",\n    offset: \"UTC-5\",\n    region: \"Americas\",\n    value: \"America/New_York\",\n  },\n  { label: \"UTC\", offset: \"UTC+0\", region: \"Europe\", value: \"UTC\" },\n  {\n    label: \"Central European\",\n    offset: \"UTC+1\",\n    region: \"Europe\",\n    value: \"Europe/Paris\",\n  },\n  {\n    label: \"Eastern European\",\n    offset: \"UTC+2\",\n    region: \"Europe\",\n    value: \"Europe/Helsinki\",\n  },\n  {\n    label: \"India Standard\",\n    offset: \"UTC+5:30\",\n    region: \"Asia\",\n    value: \"Asia/Kolkata\",\n  },\n  {\n    label: \"China Standard\",\n    offset: \"UTC+8\",\n    region: \"Asia\",\n    value: \"Asia/Shanghai\",\n  },\n  {\n    label: \"Japan Standard\",\n    offset: \"UTC+9\",\n    region: \"Asia\",\n    value: \"Asia/Tokyo\",\n  },\n  {\n    label: \"AEST\",\n    offset: \"UTC+10\",\n    region: \"Pacific\",\n    value: \"Australia/Sydney\",\n  },\n];\n\nexport default function Particle() {\n  const [value, setValue] = useState<Timezone | null>(\n    timezones.find((t) => t.value === \"UTC\") ?? null,\n  );\n\n  return (\n    <div className=\"flex w-full max-w-xs flex-col gap-3\">\n      <div className=\"flex gap-2\">\n        <Combobox\n          items={timezones}\n          onValueChange={(v) => setValue(v as Timezone | null)}\n          value={value}\n        >\n          <ComboboxTrigger\n            render={\n              <Button\n                className=\"flex-1 justify-between font-normal\"\n                variant=\"outline\"\n              />\n            }\n          >\n            {value ? (\n              <span className=\"flex items-center gap-2 text-sm\">\n                <Badge size=\"sm\" variant=\"secondary\">\n                  {value.offset}\n                </Badge>\n                <ComboboxValue />\n              </span>\n            ) : (\n              <ComboboxValue placeholder=\"Select timezone...\" />\n            )}\n            <ChevronsUpDownIcon className=\"-me-1!\" />\n          </ComboboxTrigger>\n          <ComboboxPopup>\n            <ComboboxInput\n              placeholder=\"Search timezone...\"\n              showTrigger={false}\n            />\n            <ComboboxEmpty>No timezones found.</ComboboxEmpty>\n            <ComboboxList>\n              {(tz: Timezone) => (\n                <ComboboxItem\n                  className=\"**:data-check:ms-auto\"\n                  key={tz.value}\n                  value={tz}\n                >\n                  <div className=\"flex flex-1 items-center justify-between gap-2\">\n                    <span className=\"text-sm\">{tz.label}</span>\n                    <span className=\"text-muted-foreground text-xs\">\n                      {tz.offset}\n                    </span>\n                  </div>\n                </ComboboxItem>\n              )}\n            </ComboboxList>\n          </ComboboxPopup>\n        </Combobox>\n        <Button\n          aria-label=\"Clear\"\n          disabled={!value}\n          onClick={() => setValue(null)}\n          size=\"icon\"\n          variant=\"ghost\"\n        >\n          <XIcon />\n        </Button>\n      </div>\n      {value && (\n        <p className=\"text-muted-foreground text-xs\">\n          Region:{\" \"}\n          <span className=\"font-medium text-foreground\">{value.region}</span> ·\n          Identifier:{\" \"}\n          <span className=\"font-mono text-foreground\">{value.value}</span>\n        </p>\n      )}\n    </div>\n  );\n}\n",
      "type": "registry:block"
    }
  ],
  "meta": {
    "className": ""
  },
  "categories": [
    "combobox"
  ],
  "type": "registry:block"
}