{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "files": [
    {
      "content": "\"use client\";\n\nimport {\n  ChevronDownIcon,\n  ChevronUpIcon,\n  MinusIcon,\n  PlusIcon,\n} from \"lucide-react\";\nimport { Button, Group, Input } from \"react-aria-components\";\nimport { Label } from \"~/registry/ui/label\";\nimport { NumberField } from \"~/registry/ui/number-field\";\n\nexport function NumberFieldDemo() {\n  return (\n    <div className=\"grid gap-4\">\n      <NumberField>\n        <Input placeholder=\"Basic\" />\n      </NumberField>\n\n      <PlusMinusButton />\n\n      <WithChevrons />\n    </div>\n  );\n}\n\nfunction PlusMinusButton() {\n  return (\n    <NumberField>\n      <Label>Number input with plus/minus buttons</Label>\n      <Group className=\"relative inline-flex h-9 w-full items-center overflow-hidden whitespace-nowrap rounded-md border border-input text-sm shadow-xs outline-none transition-[color,box-shadow] data-focus-within:border-ring data-disabled:opacity-50 data-focus-within:ring-[3px] data-focus-within:ring-ring/50 data-focus-within:has-aria-invalid:border-destructive data-focus-within:has-aria-invalid:ring-destructive/20 dark:data-focus-within:has-aria-invalid:ring-destructive/40\">\n        <Button\n          className=\"-ms-px flex aspect-square h-[inherit] items-center justify-center rounded-s-md border border-input bg-background text-muted-foreground/80 text-sm transition-[color,box-shadow] hover:bg-accent hover:text-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50\"\n          slot=\"decrement\"\n        >\n          <MinusIcon aria-hidden=\"true\" size={16} />\n        </Button>\n        <Input className=\"w-full grow bg-background px-3 py-2 text-center text-foreground tabular-nums\" />\n        <Button\n          className=\"-me-px flex aspect-square h-[inherit] items-center justify-center rounded-e-md border border-input bg-background text-muted-foreground/80 text-sm transition-[color,box-shadow] hover:bg-accent hover:text-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50\"\n          slot=\"increment\"\n        >\n          <PlusIcon aria-hidden=\"true\" size={16} />\n        </Button>\n      </Group>\n    </NumberField>\n  );\n}\n\nfunction WithChevrons() {\n  return (\n    <NumberField\n      defaultValue={99}\n      formatOptions={{\n        currency: \"EUR\",\n        currencySign: \"accounting\",\n        style: \"currency\",\n      }}\n    >\n      <Label className=\"font-medium text-foreground text-sm\">\n        Number input with chevrons\n      </Label>\n      <Group className=\"doutline-none relative inline-flex h-9 w-full items-center overflow-hidden whitespace-nowrap rounded-md border border-input text-sm shadow-xs transition-[color,box-shadow] data-focus-within:border-ring data-disabled:opacity-50 data-focus-within:ring-[3px] data-focus-within:ring-ring/50 data-focus-within:has-aria-invalid:border-destructive data-focus-within:has-aria-invalid:ring-destructive/20 dark:data-focus-within:has-aria-invalid:ring-destructive/40\">\n        <Input className=\"flex-1 bg-background px-3 py-2 text-foreground tabular-nums\" />\n        <div className=\"flex h-[calc(100%+2px)] flex-col\">\n          <Button\n            className=\"-me-px flex h-1/2 w-6 flex-1 items-center justify-center border border-input bg-background text-muted-foreground/80 text-sm transition-[color,box-shadow] hover:bg-accent hover:text-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50\"\n            slot=\"increment\"\n          >\n            <ChevronUpIcon aria-hidden=\"true\" size={12} />\n          </Button>\n          <Button\n            className=\"-me-px -mt-px flex h-1/2 w-6 flex-1 items-center justify-center border border-input bg-background text-muted-foreground/80 text-sm transition-[color,box-shadow] hover:bg-accent hover:text-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50\"\n            slot=\"decrement\"\n          >\n            <ChevronDownIcon aria-hidden=\"true\" size={12} />\n          </Button>\n        </div>\n      </Group>\n    </NumberField>\n  );\n}\n",
      "path": "src/registry/examples/number-field/number-field-demo.tsx",
      "type": "registry:example"
    }
  ],
  "name": "number-field-demo",
  "registryDependencies": [
    "@kanpeki/number"
  ],
  "type": "registry:example"
}