{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"shadcn-studio/combobox-07","type":"registry:component","title":"Combobox 7","description":"Timezone selector combobox with real timezone data from Intl API","registryDependencies":["combobox","label"],"files":[{"path":"src/registry/new-york/components/combobox/combobox-07.tsx","content":"'use client'\n\nimport { useId, useMemo } from 'react'\n\nimport {\n  Combobox,\n  ComboboxContent,\n  ComboboxEmpty,\n  ComboboxInput,\n  ComboboxItem,\n  ComboboxList\n} from '@/registry/new-york/ui/combobox'\nimport { Label } from '@/registry/new-york/ui/label'\n\nconst ComboboxTimezoneDemo = () => {\n  const id = useId()\n\n  // Fetch supported timezones\n  const timezones = Intl.supportedValuesOf('timeZone')\n\n  const formattedTimezones = useMemo(() => {\n    return timezones\n      .map(timezone => {\n        const formatter = new Intl.DateTimeFormat('en', {\n          timeZone: timezone,\n          timeZoneName: 'shortOffset'\n        })\n\n        const parts = formatter.formatToParts(new Date())\n        const offset = parts.find(part => part.type === 'timeZoneName')?.value || ''\n        const formattedOffset = offset === 'GMT' ? 'GMT+0' : offset\n\n        return {\n          value: timezone,\n          label: `(${formattedOffset}) ${timezone.replace(/_/g, ' ')}`,\n          numericOffset: parseInt(formattedOffset.replace('GMT', '').replace('+', '') || '0')\n        }\n      })\n      .sort((a, b) => a.numericOffset - b.numericOffset) // Sort by numeric offset\n  }, [timezones])\n\n  return (\n    <div className='w-full max-w-xs space-y-2'>\n      <Label htmlFor={id}>Timezone combobox</Label>\n      <Combobox id={id} items={formattedTimezones}>\n        <ComboboxInput placeholder='Select a timezone' />\n        <ComboboxContent>\n          <ComboboxEmpty>No items found.</ComboboxEmpty>\n          <ComboboxList>\n            {item => (\n              <ComboboxItem key={item.value} value={item.label}>\n                {item.label}\n              </ComboboxItem>\n            )}\n          </ComboboxList>\n        </ComboboxContent>\n      </Combobox>\n    </div>\n  )\n}\n\nexport default ComboboxTimezoneDemo\n","type":"registry:component","target":"components/shadcn-studio/combobox/combobox-07.tsx"}]}