{
  "component": {
    "id": "password-field",
    "name": "Password input",
    "tier": "pro",
    "exampleId": "password-field",
    "access": "pro",
    "requiresAuthorization": true
  },
  "source": {
    "demoModule": "src/password-field-demo.tsx",
    "exportName": "PasswordFieldDemo",
    "sha256": "4eb199ccf846364d0a7e996b9935b79906110df188ace9a9c5049a4382b5f195",
    "helperImports": [],
    "directComponentImports": [
      "password-field",
      "tidal-button"
    ],
    "sampleBoundary": "Existing local demo fixture with fictional data and callbacks. No live service, customer data, access key, or Pro source is included."
  },
  "install": {
    "command": "npx shadcn@latest add @tidal-pro/password-field",
    "registryUrl": "https://tidalui.com/r/pro/password-field.json",
    "namespace": "@tidal-pro",
    "access": "pro",
    "sourceDelivery": "server-gated",
    "requiresAuthorization": true,
    "tokenSource": "local-env",
    "tokenEnvName": "TIDALUI_TOKEN",
    "cli": {
      "package": "shadcn",
      "requested": "latest"
    }
  },
  "installPlan": [
    {
      "order": 1,
      "kind": "primary",
      "dependency": "@tidal-pro/password-field",
      "purpose": "component",
      "command": "npx shadcn@latest add @tidal-pro/password-field",
      "registryUrl": "https://tidalui.com/r/pro/password-field.json",
      "access": "pro",
      "sourceDelivery": "server-gated",
      "requiresAuthorization": true
    },
    {
      "order": 2,
      "kind": "demo-only-additional",
      "dependency": "https://tidalui.com/r/tidal-button.json",
      "purpose": "complete-example-demo-dependency",
      "command": "npx shadcn@latest add https://tidalui.com/r/tidal-button.json",
      "registryUrl": "https://tidalui.com/r/tidal-button.json",
      "access": "free",
      "sourceDelivery": "public-registry",
      "requiresAuthorization": false
    }
  ],
  "imports": {
    "componentPath": "components/ui/password-field.tsx",
    "exports": [
      "TidalButton",
      "TidalPasswordField"
    ],
    "stylesheets": [
      "components/ui/tidal.css",
      "components/ui/password-field.css"
    ],
    "scopeClass": "tidal-scope"
  },
  "dependencies": {
    "npm": [
      "lucide-react"
    ],
    "registry": [],
    "additionalRegistry": [
      "https://tidalui.com/r/tidal-button.json"
    ],
    "installClosure": [
      "password-field",
      "tidal-button"
    ],
    "css": [
      "components/ui/tidal.css",
      "components/ui/password-field.css"
    ],
    "demoCss": [],
    "consumerOwned": [
      "react",
      "react-dom"
    ]
  },
  "files": {
    "sourceFile": "/examples/password-field.tsx",
    "demoStyles": [],
    "inlinedDemoStyles": [
      "src/password-field-demo.css"
    ],
    "assets": []
  },
  "example": {
    "language": "tsx",
    "source": "import \"./components/ui/tidal.css\";\n\nimport { useEffect, useLayoutEffect, useRef, useState } from \"react\";\n\nimport { ArrowUpRight, Check } from \"lucide-react\";\n\nimport { TidalPasswordField } from \"./components/ui/password-field\";\n\nimport { TidalButton } from \"./components/ui/tidal-button\";\n\nimport \"./components/ui/password-field.css\";\n\n\n\nconst tidalExampleStyles = \".password-field-specimen {\\n  width: 100%;\\n  max-width: 690px;\\n  padding: 28px;\\n  border: 1px solid var(--t-border);\\n  border-radius: var(--t-radius-card);\\n  background: var(--t-surface);\\n  box-shadow:\\n    0 24px 40px -28px #00000030,\\n    0 2px 4px #00000007;\\n  container-type: inline-size;\\n}\\n.password-field-specimen > h3 {\\n  font-size: 29px;\\n  line-height: 1.08;\\n  letter-spacing: -1px;\\n  font-weight: 500;\\n  margin: 13px 0 26px;\\n}\\n.password-field-specimen > h3 > em {\\n  font-family: \\\"Instrument Serif\\\", serif;\\n  font-size: 1.2em;\\n  font-weight: 400;\\n}\\n.password-demo-frame {\\n  overflow: hidden;\\n  transition: height 420ms var(--t-ease-out);\\n  padding: 7px 0;\\n}\\n.password-demo-content {\\n  display: flow-root;\\n}\\n.password-demo-layout {\\n  display: block;\\n  width: min(100%, 480px);\\n  margin-inline: auto;\\n}\\n.password-demo-layout > form {\\n  min-width: 0;\\n  align-self: center;\\n}\\n.password-demo-actions {\\n  display: flex;\\n  flex-wrap: wrap;\\n  gap: 9px;\\n  margin-top: 24px;\\n}\\n.tidal-scope .password-demo-actions > .tidal-button {\\n  font-size: 11px;\\n  padding: 0 12px;\\n  flex: 1;\\n  min-width: 0;\\n}\\n.tidal-scope .password-demo-policy-note {\\n  font-size: 11px;\\n  line-height: 1.6;\\n  color: var(--t-muted);\\n  margin: 14px 0 0;\\n}\\n.password-demo-note {\\n  font-size: 11px;\\n  color: var(--t-muted);\\n  line-height: 1.7;\\n  margin: 16px 0 0;\\n}\\n.password-demo-complete {\\n  text-align: center;\\n  padding: 29px 23px;\\n  border: 1px solid var(--t-border);\\n  border-radius: 13px;\\n  background: var(--t-subtle);\\n  animation: password-demo-complete-in 420ms var(--t-ease-out) both;\\n}\\n.password-demo-complete-icon {\\n  display: grid;\\n  place-items: center;\\n  margin: 0 auto 24px;\\n  width: 54px;\\n  height: 54px;\\n  background: var(--t-ink);\\n  color: var(--t-surface);\\n  border-radius: 14px;\\n  transform: rotate(-5deg);\\n  animation: password-demo-check-in 420ms var(--t-ease-spring) both;\\n}\\n.password-demo-complete > .demo-eyebrow {\\n  display: block;\\n  font-size: 11px;\\n}\\n.password-demo-complete > h4 {\\n  font-size: 25px;\\n  letter-spacing: -0.8px;\\n  line-height: 1.2;\\n  font-weight: 500;\\n  margin: 13px 0;\\n}\\n.password-demo-complete > p {\\n  font-size: 11px;\\n  color: var(--t-muted);\\n  max-width: 330px;\\n  line-height: 1.8;\\n  margin: 0 auto 24px;\\n}\\n.password-demo-complete > .tidal-button {\\n  font-size: 11px;\\n}\\n@media (max-width: 480px) {\\n  .password-field-specimen {\\n    padding: 20px;\\n  }\\n  .password-demo-actions {\\n    gap: 7px;\\n  }\\n  .password-demo-complete {\\n    padding: 24px 17px;\\n  }\\n  .password-demo-complete > h4 {\\n    font-size: 22px;\\n  }\\n}\\n@keyframes password-demo-complete-in {\\n  from {\\n    opacity: 0;\\n    transform: translateY(8px);\\n  }\\n  to {\\n    opacity: 1;\\n    transform: none;\\n  }\\n}\\n@keyframes password-demo-check-in {\\n  from {\\n    opacity: 0;\\n    transform: scale(0.7) rotate(-15deg);\\n  }\\n  to {\\n    opacity: 1;\\n    transform: scale(1) rotate(-5deg);\\n  }\\n}\";\n\nconst sample = \"paper river lantern\";\n\nexport function PasswordFieldDemo() {\n  const [value, setValue] = useState(\"\");\n  const [revealed, setRevealed] = useState(false);\n  const [phase, setPhase] = useState<\"editing\" | \"checking\" | \"complete\">(\n    \"editing\",\n  );\n  const [error, setError] = useState(\"\");\n  const [height, setHeight] = useState<number>();\n  const input = useRef<HTMLInputElement>(null);\n  const success = useRef<HTMLHeadingElement>(null);\n  const content = useRef<HTMLDivElement>(null);\n  const timer = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n  const restore = useRef(false);\n  const focusOwner = useRef<HTMLElement | null>(null);\n  const requirements = [\n    {\n      id: \"length\",\n      label: \"12 or more characters\",\n      met: Array.from(value).length >= 12,\n    },\n    {\n      id: \"words\",\n      label: \"At least 3 words\",\n      met: value.trim().split(/\\s+/u).filter(Boolean).length >= 3,\n    },\n  ];\n  const satisfied = requirements.filter((r) => r.met).length;\n  useEffect(() => () => clearTimeout(timer.current), []);\n  useLayoutEffect(() => {\n    const active = document.activeElement;\n    const canMoveFocus =\n      active === document.body || active === focusOwner.current;\n    if (phase === \"complete\" && canMoveFocus) {\n      success.current?.focus({ preventScroll: true });\n      focusOwner.current = null;\n    } else if (phase === \"editing\" && restore.current) {\n      restore.current = false;\n      if (canMoveFocus) input.current?.focus({ preventScroll: true });\n      focusOwner.current = null;\n    }\n  }, [phase]);\n  useLayoutEffect(() => {\n    const node = content.current;\n    if (!node) return;\n    const measure = () => {\n      const parent = getComputedStyle(node.parentElement!);\n      setHeight(\n        node.offsetHeight +\n          Number.parseFloat(parent.paddingTop) +\n          Number.parseFloat(parent.paddingBottom),\n      );\n    };\n    measure();\n    const observer = new ResizeObserver(measure);\n    observer.observe(node);\n    return () => observer.disconnect();\n  }, []);\n  function reset() {\n    clearTimeout(timer.current);\n    focusOwner.current =\n      document.activeElement instanceof HTMLElement\n        ? document.activeElement\n        : null;\n    setValue(\"\");\n    setRevealed(false);\n    setError(\"\");\n    restore.current = true;\n    setPhase(\"editing\");\n    if (phase === \"editing\") {\n      restore.current = false;\n      input.current?.focus({ preventScroll: true });\n    }\n  }\n  return (\n    <div className=\"password-field-specimen\">\n      <div className=\"password-demo-frame\" style={{ height }}>\n        <div ref={content} className=\"password-demo-content\">\n          {phase === \"complete\" ? (\n            <div className=\"password-demo-complete\">\n              <span className=\"password-demo-complete-icon\" aria-hidden=\"true\">\n                <Check size={25} />\n              </span>\n              <span className=\"demo-eyebrow\">SAMPLE CHECK COMPLETE</span>\n              <h4 ref={success} tabIndex={-1}>\n                Ready for the next step.\n              </h4>\n              <p>\n                Both sample requirements were met. This preview created no\n                account and saved no password.\n              </p>\n              <TidalButton variant=\"secondary\" onClick={reset}>\n                Try the sample again\n              </TidalButton>\n            </div>\n          ) : (\n            <>\n              <div className=\"password-demo-layout\">\n                <form\n                  noValidate\n                  onSubmit={(event) => {\n                    event.preventDefault();\n                    if (satisfied !== 2) {\n                      setError(\n                        \"Complete both sample requirements to continue.\",\n                      );\n                      input.current?.focus({ preventScroll: true });\n                      return;\n                    }\n                    focusOwner.current =\n                      (event.nativeEvent as SubmitEvent).submitter instanceof\n                      HTMLElement\n                        ? (event.nativeEvent as SubmitEvent).submitter\n                        : document.activeElement instanceof HTMLElement\n                          ? document.activeElement\n                          : null;\n                    setError(\"\");\n                    setRevealed(false);\n                    setPhase(\"checking\");\n                    timer.current = setTimeout(() => {\n                      setValue(\"\");\n                      setPhase(\"complete\");\n                    }, 650);\n                  }}\n                >\n                  <TidalPasswordField\n                    ref={input}\n                    label=\"Sample passphrase\"\n                    name=\"sample-passphrase\"\n                    placeholder=\"Start with a few words…\"\n                    value={value}\n                    onChange={(event) => {\n                      setValue(event.target.value);\n                      setError(\"\");\n                    }}\n                    revealed={revealed}\n                    onRevealedChange={setRevealed}\n                    autoComplete=\"off\"\n                    required\n                    disabled={phase === \"checking\"}\n                    description=\"Use the provided fictional phrase to explore.\"\n                    error={error}\n                    requirements={requirements}\n                    requirementsLabel=\"Sample requirements\"\n                    formatRequirementCount={(met, total) =>\n                      `${met} of ${total} checks met`\n                    }\n                  />\n                  <div className=\"password-demo-actions\">\n                    <TidalButton\n                      type=\"button\"\n                      variant=\"secondary\"\n                      onClick={() => {\n                        if (phase === \"checking\") {\n                          reset();\n                          return;\n                        }\n                        setValue(sample);\n                        setError(\"\");\n                        input.current?.focus({ preventScroll: true });\n                      }}\n                    >\n                      {phase === \"checking\"\n                        ? \"Cancel check\"\n                        : \"Use sample phrase\"}\n                    </TidalButton>\n                    <TidalButton type=\"submit\" loading={phase === \"checking\"}>\n                      Check sample\n                      <ArrowUpRight size={13} aria-hidden=\"true\" />\n                    </TidalButton>\n                  </div>\n                  <p className=\"password-demo-policy-note\">\n                    Illustrative requirements, not a password-strength rating.\n                  </p>\n                </form>\n              </div>\n            </>\n          )}\n        </div>\n      </div>\n      <p className=\"password-demo-note\">\n        This form runs in your browser. No account is created and no password is\n        saved.\n      </p>\n    </div>\n  );\n}\n\nexport default function AgentExample() {\n  return (\n    <div className=\"tidal-scope\" data-theme=\"light\" dir=\"ltr\">\n      <style>{tidalExampleStyles}</style>\n      <PasswordFieldDemo />\n    </div>\n  );\n}\n",
    "sourceFile": "/examples/password-field.tsx",
    "fixtureData": "Existing demo fixture data only; replace with consumer-owned data before production use."
  },
  "controlledState": [
    {
      "prop": "value",
      "type": "inferred-from-existing-demo",
      "initial": "\"\"",
      "setter": "setValue",
      "proposalCanBeRejected": false
    },
    {
      "prop": "revealed",
      "type": "inferred-from-existing-demo",
      "initial": "false",
      "setter": "setRevealed",
      "proposalCanBeRejected": false
    },
    {
      "prop": "error",
      "type": "inferred-from-existing-demo",
      "initial": "\"\"",
      "setter": "setError",
      "proposalCanBeRejected": false
    }
  ],
  "events": [
    {
      "name": "onChange",
      "nativeType": "React synthetic event or native callback",
      "callerFirst": true,
      "preventable": false,
      "observedResult": "The existing demo callback remains the source of truth; this example does not call a live service."
    },
    {
      "name": "onClick",
      "nativeType": "React synthetic event or native callback",
      "callerFirst": true,
      "preventable": false,
      "observedResult": "The existing demo callback remains the source of truth; this example does not call a live service."
    },
    {
      "name": "onRevealedChange",
      "nativeType": "component callback",
      "callerFirst": true,
      "preventable": false,
      "observedResult": "The existing demo callback remains the source of truth; this example does not call a live service."
    },
    {
      "name": "onSubmit",
      "nativeType": "React synthetic event or native callback",
      "callerFirst": true,
      "preventable": false,
      "observedResult": "The existing demo callback remains the source of truth; this example does not call a live service."
    }
  ],
  "nativeForm": {
    "participates": true,
    "names": [
      "sample-passphrase"
    ],
    "expectedFormData": {
      "sample-passphrase": "fixture value"
    },
    "submitBehavior": "The existing demo's native form callback receives the submit event.",
    "resetBehavior": "Native reset behavior remains available where the demo renders a resettable control.",
    "disabledBehavior": "Disabled controls remain excluded from successful native form submission.",
    "readOnlyBehavior": "Read-only controls retain their value and remain inspectable by the consumer."
  },
  "accessibility": {
    "labelSource": "Existing demo label or ARIA prop",
    "semantics": "Preserve the component's native element and the semantics demonstrated by the source fixture.",
    "keyboard": [
      "Tab and Shift+Tab",
      "Enter or Space for native activation",
      "Arrow keys where the component exposes a composite control"
    ],
    "focusReturn": "Preserve browser focus order and visible focus.",
    "errorAnnouncement": "The existing error or alert path remains consumer-owned and should be announced by the rendered semantics.",
    "reducedMotion": "Verify prefers-reduced-motion with the existing component transition path.",
    "forcedColors": "Verify visible borders, text, and focus in forced-colors mode."
  },
  "responsive": {
    "widths": [
      320,
      390,
      768,
      1260
    ],
    "shortViewport": "Check the example at a 300px viewport height with keyboard or portal content visible.",
    "overflow": "The page should not gain horizontal overflow; component-local scrolling must remain intentional.",
    "touchTargetMinPx": 44,
    "coarseInputFontPx": 16
  },
  "errors": [
    {
      "fixture": "Exercise the existing demo's error, empty, loading, or invalid fixture.",
      "visibleResult": "The consumer-visible result must remain explicit and must not be replaced by a silent console error.",
      "focusResult": "Focus must remain on the triggering control or move to the announced error according to the native pattern.",
      "ownership": "Consumer-owned sample state only; no network request or customer data is used."
    }
  ],
  "verification": {
    "commands": [
      "npx tsc --noEmit",
      "npx vite build"
    ],
    "lockfile": "Use the consumer project's committed lockfile.",
    "browser": [
      "Chromium 1260x800",
      "Chromium 390x844",
      "Keyboard and reduced-motion pass"
    ]
  },
  "validation": {
    "consumerFixture": {
      "tsc": "pass",
      "viteBuild": "pass",
      "resourceModel": "Generated usage plus only the component files and CSS delivered by the primary item and listed registry dependencies."
    },
    "registryArtifact": "server-gated"
  },
  "exceptions": []
}
