diff --git a/apps/www/public/registry/styles/default/phone-input.json b/apps/www/public/registry/styles/default/phone-input.json index d1d501dab58..c96753cfd73 100644 --- a/apps/www/public/registry/styles/default/phone-input.json +++ b/apps/www/public/registry/styles/default/phone-input.json @@ -12,7 +12,7 @@ "files": [ { "name": "phone-input.tsx", - "content": "import * as React from \"react\"\nimport { Check, ChevronsUpDown } from \"lucide-react\"\nimport * as RPNInput from \"react-phone-number-input\"\nimport flags from \"react-phone-number-input/flags\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/registry/default/ui/button\"\nimport {\n Command,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n} from \"@/registry/default/ui/command\"\nimport { Input, InputProps } from \"@/registry/default/ui/input\"\nimport {\n Popover,\n PopoverContent,\n PopoverTrigger,\n} from \"@/registry/default/ui/popover\"\n\ntype PhoneInputProps = Omit<\n React.InputHTMLAttributes,\n \"onChange\" | \"value\"\n> &\n Omit, \"onChange\"> & {\n onChange?: (value: RPNInput.Value) => void\n }\n\nconst PhoneInput: React.ForwardRefExoticComponent =\n React.forwardRef, PhoneInputProps>(\n ({ className, onChange, ...props }, ref) => (\n onChange?.(value || \"\")}\n {...props}\n />\n )\n )\nPhoneInput.displayName = \"PhoneInput\"\n\nconst InputComponent = React.forwardRef(\n ({ className, ...props }, ref) => (\n \n )\n)\nInputComponent.displayName = \"InputComponent\"\n\ntype CountrySelectOption = { label: string; value: RPNInput.Country }\n\ntype CountrySelectProps = {\n disabled?: boolean\n value: RPNInput.Country\n onChange: (value: RPNInput.Country) => void\n options: CountrySelectOption[]\n}\n\nconst CountrySelect = ({\n disabled,\n value,\n onChange,\n options,\n}: CountrySelectProps) => {\n const handleSelect = React.useCallback(\n (country: RPNInput.Country) => {\n onChange(country)\n },\n [onChange]\n )\n\n return (\n \n \n \n \n \n \n \n \n \n \n \n No country found.\n \n {options.map((option) => (\n handleSelect(option.value)}\n >\n \n {option.label}\n {option.value && (\n \n {`+${RPNInput.getCountryCallingCode(option.value)}`}\n \n )}\n \n \n ))}\n \n \n \n \n \n )\n}\n\nconst FlagComponent = ({ country, countryName }: RPNInput.FlagProps) => {\n const Flag = flags[country]\n\n return (\n \n {Flag && }\n \n )\n}\nFlagComponent.displayName = \"FlagComponent\"\n\nexport { PhoneInput }\n" + "content": "import * as React from \"react\"\nimport { Check, ChevronsUpDown } from \"lucide-react\"\nimport * as RPNInput from \"react-phone-number-input\"\nimport flags from \"react-phone-number-input/flags\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/registry/default/ui/button\"\nimport {\n Command,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n} from \"@/registry/default/ui/command\"\nimport { Input, InputProps } from \"@/registry/default/ui/input\"\nimport {\n Popover,\n PopoverContent,\n PopoverTrigger,\n} from \"@/registry/default/ui/popover\"\n\ntype PhoneInputProps = Omit<\n React.InputHTMLAttributes,\n \"onChange\" | \"value\"\n> &\n Omit, \"onChange\"> & {\n onChange?: (value: RPNInput.Value) => void\n }\n\nconst PhoneInput: React.ForwardRefExoticComponent =\n React.forwardRef, PhoneInputProps>(\n ({ className, onChange, ...props }, ref) => (\n onChange?.(value || \"\")}\n {...props}\n />\n )\n )\nPhoneInput.displayName = \"PhoneInput\"\n\nconst InputComponent = React.forwardRef(\n ({ className, ...props }, ref) => (\n \n )\n)\nInputComponent.displayName = \"InputComponent\"\n\ntype CountrySelectOption = { label: string; value: RPNInput.Country }\n\ntype CountrySelectProps = {\n disabled?: boolean\n value: RPNInput.Country\n onChange: (value: RPNInput.Country) => void\n options: CountrySelectOption[]\n}\n\nconst CountrySelect = ({\n disabled,\n value,\n onChange,\n options,\n}: CountrySelectProps) => {\n const handleSelect = React.useCallback(\n (country: RPNInput.Country) => {\n onChange(country)\n },\n [onChange]\n )\n\n return (\n \n \n \n \n \n \n \n \n \n \n \n No country found.\n \n {options.map((option) => (\n handleSelect(option.value)}\n >\n \n {option.label}\n {option.value && (\n \n {`+${RPNInput.getCountryCallingCode(option.value)}`}\n \n )}\n \n \n ))}\n \n \n \n \n \n )\n}\n\nconst FlagComponent = ({ country, countryName }: RPNInput.FlagProps) => {\n const Flag = flags[country]\n\n return (\n \n {Flag && }\n \n )\n}\nFlagComponent.displayName = \"FlagComponent\"\n\nexport { PhoneInput }\n" } ], "type": "components:ui" diff --git a/apps/www/public/registry/styles/new-york/phone-input.json b/apps/www/public/registry/styles/new-york/phone-input.json index 9f4b0680ed2..f950f60c0f0 100644 --- a/apps/www/public/registry/styles/new-york/phone-input.json +++ b/apps/www/public/registry/styles/new-york/phone-input.json @@ -12,7 +12,7 @@ "files": [ { "name": "phone-input.tsx", - "content": "import * as React from \"react\"\nimport { CaretSortIcon, CheckIcon } from \"@radix-ui/react-icons\"\nimport * as RPNInput from \"react-phone-number-input\"\nimport flags from \"react-phone-number-input/flags\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/registry/new-york/ui/button\"\nimport {\n Command,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n} from \"@/registry/new-york/ui/command\"\nimport { Input, InputProps } from \"@/registry/new-york/ui/input\"\nimport {\n Popover,\n PopoverContent,\n PopoverTrigger,\n} from \"@/registry/new-york/ui/popover\"\n\ntype PhoneInputProps = Omit<\n React.InputHTMLAttributes,\n \"onChange\" | \"value\"\n> &\n Omit, \"onChange\"> & {\n onChange?: (value: RPNInput.Value) => void\n }\n\nconst PhoneInput: React.ForwardRefExoticComponent =\n React.forwardRef, PhoneInputProps>(\n ({ className, onChange, ...props }, ref) => (\n onChange?.(value || \"\")}\n {...props}\n />\n )\n )\nPhoneInput.displayName = \"PhoneInput\"\n\nconst InputComponent = React.forwardRef(\n ({ className, ...props }, ref) => (\n \n )\n)\nInputComponent.displayName = \"InputComponent\"\n\ntype CountrySelectOption = { label: string; value: RPNInput.Country }\n\ntype CountrySelectProps = {\n disabled?: boolean\n value: RPNInput.Country\n onChange: (value: RPNInput.Country) => void\n options: CountrySelectOption[]\n}\n\nconst CountrySelect = ({\n disabled,\n value,\n onChange,\n options,\n}: CountrySelectProps) => {\n const handleSelect = React.useCallback(\n (country: RPNInput.Country) => {\n onChange(country)\n },\n [onChange]\n )\n\n return (\n \n \n \n \n \n \n \n \n \n \n \n No country found.\n \n {options.map((option) => (\n handleSelect(option.value)}\n >\n \n {option.label}\n {option.value && (\n \n {`+${RPNInput.getCountryCallingCode(option.value)}`}\n \n )}\n \n \n ))}\n \n \n \n \n \n )\n}\n\nconst FlagComponent = ({ country, countryName }: RPNInput.FlagProps) => {\n const Flag = flags[country]\n\n return (\n \n {Flag && }\n \n )\n}\nFlagComponent.displayName = \"FlagComponent\"\n\nexport { PhoneInput }\n" + "content": "import * as React from \"react\"\nimport { CaretSortIcon, CheckIcon } from \"@radix-ui/react-icons\"\nimport * as RPNInput from \"react-phone-number-input\"\nimport flags from \"react-phone-number-input/flags\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/registry/new-york/ui/button\"\nimport {\n Command,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n} from \"@/registry/new-york/ui/command\"\nimport { Input, InputProps } from \"@/registry/new-york/ui/input\"\nimport {\n Popover,\n PopoverContent,\n PopoverTrigger,\n} from \"@/registry/new-york/ui/popover\"\n\ntype PhoneInputProps = Omit<\n React.InputHTMLAttributes,\n \"onChange\" | \"value\"\n> &\n Omit, \"onChange\"> & {\n onChange?: (value: RPNInput.Value) => void\n }\n\nconst PhoneInput: React.ForwardRefExoticComponent =\n React.forwardRef, PhoneInputProps>(\n ({ className, onChange, ...props }, ref) => (\n onChange?.(value || \"\")}\n {...props}\n />\n )\n )\nPhoneInput.displayName = \"PhoneInput\"\n\nconst InputComponent = React.forwardRef(\n ({ className, ...props }, ref) => (\n \n )\n)\nInputComponent.displayName = \"InputComponent\"\n\ntype CountrySelectOption = { label: string; value: RPNInput.Country }\n\ntype CountrySelectProps = {\n disabled?: boolean\n value: RPNInput.Country\n onChange: (value: RPNInput.Country) => void\n options: CountrySelectOption[]\n}\n\nconst CountrySelect = ({\n disabled,\n value,\n onChange,\n options,\n}: CountrySelectProps) => {\n const handleSelect = React.useCallback(\n (country: RPNInput.Country) => {\n onChange(country)\n },\n [onChange]\n )\n\n return (\n \n \n \n \n \n \n \n \n \n \n \n No country found.\n \n {options.map((option) => (\n handleSelect(option.value)}\n >\n \n {option.label}\n {option.value && (\n \n {`+${RPNInput.getCountryCallingCode(option.value)}`}\n \n )}\n \n \n ))}\n \n \n \n \n \n )\n}\n\nconst FlagComponent = ({ country, countryName }: RPNInput.FlagProps) => {\n const Flag = flags[country]\n\n return (\n \n {Flag && }\n \n )\n}\nFlagComponent.displayName = \"FlagComponent\"\n\nexport { PhoneInput }\n" } ], "type": "components:ui" diff --git a/apps/www/registry/default/ui/phone-input.tsx b/apps/www/registry/default/ui/phone-input.tsx index cdb67859e96..2ba1d10e9cc 100644 --- a/apps/www/registry/default/ui/phone-input.tsx +++ b/apps/www/registry/default/ui/phone-input.tsx @@ -92,13 +92,13 @@ const CountrySelect = ({