{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "menu-item-configurator",
  "title": "Menu Item Configurator",
  "type": "registry:block",
  "files": [
    {
      "path": "packages/registry-native/blocks/menu-item-configurator/MenuItemConfigurator.tsx",
      "content": "import * as React from 'react'\nimport { View, type ViewProps } from 'react-native'\nimport { Button } from '@/components/ui/button'\nimport { QuantityStepper } from '@/components/ui/quantity-stepper'\nimport { Text } from '@/components/ui/text'\nimport { Textarea } from '@/components/ui/textarea'\nimport { cn } from '@/lib/utils'\n\nexport interface MenuItemSelection {\n  quantity: number\n  note: string\n}\n\nexport interface MenuItemConfiguratorProps extends ViewProps {\n  className?: string\n  title: string\n  description?: string\n  /** An optional image or other item media supplied by the caller. */\n  media?: React.ReactNode\n  quantityLabel?: string\n  noteLabel?: string\n  addLabel?: string\n  /** Current price for this quantity and the consumer's chosen options. */\n  formatTotal?: (quantity: number) => string\n  /** Visible explanation when a required choice or availability blocks adding. */\n  blockedReason?: string\n  /** An error returned by the caller, with the form still available for retry. */\n  error?: string\n  loading?: boolean\n  /** Option controls are composed as children. The caller owns their selections. */\n  children?: React.ReactNode\n  onAdd: (selection: MenuItemSelection) => void\n}\n\nexport function MenuItemConfigurator({\n  className,\n  title,\n  description,\n  media,\n  quantityLabel = 'Quantity',\n  noteLabel = 'Preparation note (optional)',\n  addLabel = 'Add to order',\n  formatTotal,\n  blockedReason,\n  error,\n  loading = false,\n  children,\n  onAdd,\n  ...props\n}: MenuItemConfiguratorProps) {\n  const [quantity, setQuantity] = React.useState(1)\n  const [note, setNote] = React.useState('')\n  const total = formatTotal?.(quantity)\n\n  function addItem() {\n    if (blockedReason || loading) return\n    onAdd({ quantity, note: note.trim() })\n  }\n\n  return (\n    <View {...props} className={cn('gap-[24px]', className)}>\n      {media}\n      <View className=\"gap-[8px]\">\n        <Text size=\"title\" accessibilityRole=\"header\">\n          {title}\n        </Text>\n        {description ? <Text variant=\"muted\">{description}</Text> : null}\n      </View>\n      {children}\n      <View className=\"flex-row flex-wrap items-center justify-between gap-[8px]\">\n        <Text size=\"sm\" aria-hidden className=\"shrink font-medium\">\n          {quantityLabel}\n        </Text>\n        <QuantityStepper\n          min={1}\n          value={quantity}\n          onValueChange={setQuantity}\n          disabled={loading}\n          accessibilityLabel={quantityLabel}\n        />\n      </View>\n      <View className=\"gap-[8px]\">\n        <Text size=\"sm\" aria-hidden className=\"font-medium\">\n          {noteLabel}\n        </Text>\n        <Textarea\n          accessibilityLabel={noteLabel}\n          value={note}\n          onChangeText={setNote}\n          editable={!loading}\n          className=\"max-h-[160px] min-h-[80px]\"\n        />\n      </View>\n      <View className=\"gap-[8px]\">\n        {blockedReason ? (\n          <Text size=\"sm\" variant=\"muted\" accessibilityLiveRegion=\"polite\">\n            {blockedReason}\n          </Text>\n        ) : null}\n        {error ? (\n          <Text size=\"sm\" accessibilityRole=\"alert\" className=\"text-destructive\">\n            {error}\n          </Text>\n        ) : null}\n        <Button\n          accessibilityLabel={total ? `${addLabel}, ${total}` : addLabel}\n          disabled={Boolean(blockedReason)}\n          loading={loading}\n          onPress={addItem}\n        >\n          {total ? `${addLabel} · ${total}` : addLabel}\n        </Button>\n      </View>\n    </View>\n  )\n}\n",
      "type": "registry:block",
      "target": "~/components/blocks/menu-item-configurator/MenuItemConfigurator.tsx"
    },
    {
      "path": "packages/registry-native/blocks/menu-item-configurator/index.ts",
      "content": "export { MenuItemConfigurator, type MenuItemConfiguratorProps, type MenuItemSelection } from './MenuItemConfigurator'\n",
      "type": "registry:block",
      "target": "~/components/blocks/menu-item-configurator/index.ts"
    }
  ],
  "dependencies": [],
  "devDependencies": [],
  "registryDependencies": [
    "https://native.uipkge.dev/r/native/button.json",
    "https://native.uipkge.dev/r/native/quantity-stepper.json",
    "https://native.uipkge.dev/r/native/text.json",
    "https://native.uipkge.dev/r/native/textarea.json"
  ],
  "description": "Food-order item form with a modifier slot, bounded quantity, preparation note and a price-aware add action.",
  "categories": [
    "commerce"
  ]
}