{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"shadcn-studio/input-mask-03","type":"registry:component","title":"Input Mask 3","description":"A credit card number input with automatic formatting and card type detection","dependencies":["lucide-react","react-payment-inputs"],"devDependencies":["@types/react-payment-inputs"],"registryDependencies":["input-group","label"],"files":[{"path":"src/registry/new-york/components/input-mask/input-mask-03.tsx","content":"'use client'\n\nimport { useId } from 'react'\n\nimport { CreditCardIcon } from 'lucide-react'\n\nimport { usePaymentInputs } from 'react-payment-inputs'\nimport images, { type CardImages } from 'react-payment-inputs/images'\n\nimport { InputGroup, InputGroupAddon, InputGroupInput } from '@/registry/new-york/ui/input-group'\nimport { Label } from '@/registry/new-york/ui/label'\n\nconst InputCardNumberDemo = () => {\n  const id = useId()\n  const { meta, getCardNumberProps, getCardImageProps } = usePaymentInputs()\n\n  return (\n    <div className='w-full max-w-xs space-y-2'>\n      <Label htmlFor={id}>Card number</Label>\n      <InputGroup>\n        <InputGroupInput {...getCardNumberProps()} id={id} />\n        <InputGroupAddon align='inline-end' className='pointer-events-none'>\n          {meta.cardType ? (\n            <svg\n              className='size-6 overflow-hidden'\n              {...getCardImageProps({\n                images: images as unknown as CardImages\n              })}\n            />\n          ) : (\n            <CreditCardIcon className='size-4' />\n          )}\n          <span className='sr-only'>Card Provider</span>\n        </InputGroupAddon>\n      </InputGroup>\n      <p className='text-muted-foreground text-xs'>\n        Built with{' '}\n        <a\n          className='hover:text-foreground underline'\n          href='https://github.com/medipass/react-payment-inputs'\n          target='_blank'\n          rel='noopener noreferrer'\n        >\n          React Payment Inputs\n        </a>\n      </p>\n    </div>\n  )\n}\n\nexport default InputCardNumberDemo\n","type":"registry:component","target":"components/shadcn-studio/input-mask/input-mask-03.tsx"}]}