{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "sensitive-value",
  "title": "Sensitive Value",
  "type": "registry:ui",
  "files": [
    {
      "path": "packages/registry-native/components/sensitive-value/SensitiveValue.tsx",
      "content": "import * as React from 'react'\nimport { View, type ViewProps } from 'react-native'\nimport { Button } from '@/components/ui/button'\nimport { Text } from '@/components/ui/text'\nimport { cn } from '@/lib/utils'\n\nexport interface SensitiveValueProps extends Omit<ViewProps, 'children'> {\n  className?: string\n  label: string\n  value: string\n  visible?: boolean\n  defaultVisible?: boolean\n  onVisibilityChange?: (visible: boolean) => void\n  disabled?: boolean\n  mask?: string\n  hiddenLabel?: string\n  showLabel?: string\n  hideLabel?: string\n}\n\n/** Presentation control. A hidden value is absent from the rendered and accessibility trees. */\nexport function SensitiveValue({\n  className,\n  label,\n  value,\n  visible,\n  defaultVisible = false,\n  onVisibilityChange,\n  disabled = false,\n  mask = '••••',\n  hiddenLabel = 'Hidden',\n  showLabel = 'Show',\n  hideLabel = 'Hide',\n  ...props\n}: SensitiveValueProps) {\n  const [internal, setInternal] = React.useState(defaultVisible)\n  const shown = visible ?? internal\n  const action = shown ? hideLabel : showLabel\n\n  return (\n    <View {...props} className={cn('flex-row flex-wrap items-center justify-between gap-3', className)}>\n      <View\n        accessible\n        accessibilityLabel={`${label}, ${shown ? value : hiddenLabel}`}\n        className=\"min-w-[96px] flex-1 gap-1\"\n      >\n        <Text size=\"sm\" variant=\"muted\" aria-hidden>\n          {label}\n        </Text>\n        <Text size=\"xl\" style={{ fontVariant: ['tabular-nums'] }} aria-hidden>\n          {shown ? value : mask}\n        </Text>\n      </View>\n      <Button\n        variant=\"outline\"\n        disabled={disabled}\n        accessibilityLabel={`${action} ${label}`}\n        accessibilityState={{ expanded: shown }}\n        onPress={() => {\n          if (disabled) return\n          if (visible === undefined) setInternal(!shown)\n          onVisibilityChange?.(!shown)\n        }}\n      >\n        {action}\n      </Button>\n    </View>\n  )\n}\n",
      "type": "registry:ui",
      "target": "~/components/ui/sensitive-value/SensitiveValue.tsx"
    },
    {
      "path": "packages/registry-native/components/sensitive-value/index.ts",
      "content": "export { SensitiveValue, type SensitiveValueProps } from './SensitiveValue'\n",
      "type": "registry:ui",
      "target": "~/components/ui/sensitive-value/index.ts"
    }
  ],
  "dependencies": [],
  "devDependencies": [],
  "registryDependencies": [
    "https://native.uipkge.dev/r/native/button.json",
    "https://native.uipkge.dev/r/native/text.json",
    "https://native.uipkge.dev/r/native/utils.json"
  ],
  "description": "Explicitly reveal and hide a formatted value, with an accessible toggle and hidden-state label.",
  "categories": [
    "control"
  ]
}