{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "comp-46",
  "type": "registry:component",
  "title": "Comp 46",
  "description": "Comp 46",
  "files": [
    {
      "path": "registry/ui-basic/comp-46.tsx",
      "content": "\"use client\";\n\nimport React, { useId, useState } from \"react\";\n\nimport { Input } from \"@/components/ui/input\";\nimport { Label } from \"@/components/ui/label\";\nimport { ChevronDownIcon, PhoneIcon } from \"lucide-react\";\nimport * as RPNInput from \"react-phone-number-input\";\nimport flags from \"react-phone-number-input/flags\";\n\nimport { cn } from \"../utilities/cn\";\n\nexport default function Component() {\n\tconst id = useId();\n\tconst [value, setValue] = useState(\"\");\n\n\treturn (\n\t\t<div className=\"not-first:*:mt-2\" dir=\"ltr\">\n\t\t\t<Label htmlFor={id}>PhoneIcon number input</Label>\n\t\t\t<RPNInput.default\n\t\t\t\tclassName=\"flex rounded-md shadow-2xs\"\n\t\t\t\tinternational\n\t\t\t\tflagComponent={FlagComponent}\n\t\t\t\tcountrySelectComponent={CountrySelect}\n\t\t\t\tinputComponent={PhoneInput}\n\t\t\t\tid={id}\n\t\t\t\tplaceholder=\"Enter phone number\"\n\t\t\t\tvalue={value}\n\t\t\t\tonChange={(newValue) => setValue(newValue ?? \"\")}\n\t\t\t/>\n\t\t\t<p\n\t\t\t\tclassName=\"text-muted-foreground mt-2 text-xs\"\n\t\t\t\trole=\"region\"\n\t\t\t\taria-live=\"polite\"\n\t\t\t>\n\t\t\t\tBuilt with{\" \"}\n\t\t\t\t<a\n\t\t\t\t\tclassName=\"hover:text-foreground underline\"\n\t\t\t\t\thref=\"https://gitlab.com/catamphetamine/react-phone-number-input\"\n\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\trel=\"noopener nofollow\"\n\t\t\t\t>\n\t\t\t\t\treact-phone-number-input\n\t\t\t\t</a>\n\t\t\t</p>\n\t\t</div>\n\t);\n}\n\nconst PhoneInput = ({ className, ...props }: React.ComponentProps<\"input\">) => {\n\treturn (\n\t\t<Input\n\t\t\tdata-slot=\"phone-input\"\n\t\t\tclassName={cn(\n\t\t\t\t\"-ms-px rounded-s-none shadow-none focus-visible:z-10\",\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n};\n\nPhoneInput.displayName = \"PhoneInput\";\n\ntype CountrySelectProps = {\n\tdisabled?: boolean;\n\tvalue: RPNInput.Country;\n\tonChange: (value: RPNInput.Country) => void;\n\toptions: { label: string; value: RPNInput.Country | undefined }[];\n};\n\nconst CountrySelect = ({\n\tdisabled,\n\tvalue,\n\tonChange,\n\toptions,\n}: CountrySelectProps) => {\n\tconst handleSelect = (event: React.ChangeEvent<HTMLSelectElement>) => {\n\t\tonChange(event.target.value as RPNInput.Country);\n\t};\n\n\treturn (\n\t\t<div className=\"border-input bg-background text-muted-foreground focus-within:border-ring focus-within:ring-ring/50 hover:bg-accent hover:text-foreground has-aria-invalid:border-destructive/60 has-aria-invalid:ring-destructive/20 dark:has-aria-invalid:ring-destructive/40 relative inline-flex items-center self-stretch rounded-s-md border py-2 ps-3 pe-2 transition-[color,box-shadow] outline-hidden focus-within:z-10 focus-within:ring-[3px] has-disabled:pointer-events-none has-disabled:opacity-50\">\n\t\t\t<div className=\"inline-flex items-center gap-1\" aria-hidden=\"true\">\n\t\t\t\t<FlagComponent\n\t\t\t\t\tcountry={value}\n\t\t\t\t\tcountryName={value}\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t/>\n\t\t\t\t<span className=\"text-muted-foreground/80\">\n\t\t\t\t\t<ChevronDownIcon size={16} aria-hidden=\"true\" />\n\t\t\t\t</span>\n\t\t\t</div>\n\t\t\t<select\n\t\t\t\tdisabled={disabled}\n\t\t\t\tvalue={value}\n\t\t\t\tonChange={handleSelect}\n\t\t\t\tclassName=\"absolute inset-0 text-sm opacity-0\"\n\t\t\t\taria-label=\"Select country\"\n\t\t\t>\n\t\t\t\t<option key=\"default\" value=\"\">\n\t\t\t\t\tSelect a country\n\t\t\t\t</option>\n\t\t\t\t{options\n\t\t\t\t\t.filter((x) => x.value)\n\t\t\t\t\t.map((option, i) => (\n\t\t\t\t\t\t<option\n\t\t\t\t\t\t\tkey={option.value ?? `empty-${i}`}\n\t\t\t\t\t\t\tvalue={option.value}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{option.label}{\" \"}\n\t\t\t\t\t\t\t{option.value &&\n\t\t\t\t\t\t\t\t`+${RPNInput.getCountryCallingCode(option.value)}`}\n\t\t\t\t\t\t</option>\n\t\t\t\t\t))}\n\t\t\t</select>\n\t\t</div>\n\t);\n};\n\nconst FlagComponent = ({ country, countryName }: RPNInput.FlagProps) => {\n\tconst Flag = flags[country];\n\n\treturn (\n\t\t<span className=\"w-5 overflow-hidden rounded-sm\">\n\t\t\t{Flag ? (\n\t\t\t\t<Flag title={countryName} />\n\t\t\t) : (\n\t\t\t\t<PhoneIcon size={16} aria-hidden=\"true\" />\n\t\t\t)}\n\t\t</span>\n\t);\n};\n",
      "type": "registry:ui"
    },
    {
      "path": "components/ui/input.tsx",
      "content": "// SHADCN UI GENERATED CODE\n\nimport React from \"react\";\n\nimport { cn } from \"@/registry/utilities/cn\";\n\nexport interface InputProps\n\textends React.InputHTMLAttributes<HTMLInputElement> {}\n\nconst Input = React.forwardRef<HTMLInputElement, InputProps>(\n\t({ className, type, ...props }, ref) => {\n\t\treturn (\n\t\t\t<input\n\t\t\t\ttype={type}\n\t\t\t\tclassName={cn(\n\t\t\t\t\t\"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50\",\n\t\t\t\t\tclassName\n\t\t\t\t)}\n\t\t\t\tref={ref}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t);\n\t}\n);\nInput.displayName = \"Input\";\n\nexport { Input };\n",
      "type": "registry:ui"
    },
    {
      "path": "registry/utilities/cn.ts",
      "content": "import { ClassValue, clsx } from \"clsx\";\r\nimport { twMerge } from \"tailwind-merge\";\r\n\r\nexport function cn(...inputs: ClassValue[]) {\r\n\treturn twMerge(clsx(inputs));\r\n}\r\n",
      "type": "registry:ui"
    },
    {
      "path": "components/ui/label.tsx",
      "content": "\"use client\";\n\nimport React from \"react\";\n\nimport { cn } from \"@/registry/utilities/cn\";\nimport * as LabelPrimitive from \"@radix-ui/react-label\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nconst labelVariants = cva(\n\t\"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70\"\n);\n\nconst Label = React.forwardRef<\n\tReact.ElementRef<typeof LabelPrimitive.Root>,\n\tReact.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &\n\t\tVariantProps<typeof labelVariants>\n>(({ className, ...props }, ref) => (\n\t<LabelPrimitive.Root\n\t\tref={ref}\n\t\tclassName={cn(labelVariants(), className)}\n\t\t{...props}\n\t/>\n));\nLabel.displayName = LabelPrimitive.Root.displayName;\n\nexport { Label };\n",
      "type": "registry:ui"
    }
  ]
}