{
  "component": {
    "id": "tag-input",
    "name": "Tag input",
    "tier": "pro",
    "exampleId": "tag-input",
    "access": "pro",
    "requiresAuthorization": true
  },
  "source": {
    "demoModule": "src/tag-input-demo.tsx",
    "exportName": "TagInputDemo",
    "sha256": "9b0439de8a049d0af6c31650967c9fbbb70335fd248a0abf23db8b732496dd50",
    "helperImports": [],
    "directComponentImports": [
      "tag-input"
    ],
    "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/tag-input",
    "registryUrl": "https://tidalui.com/r/pro/tag-input.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/tag-input",
      "purpose": "component",
      "command": "npx shadcn@latest add @tidal-pro/tag-input",
      "registryUrl": "https://tidalui.com/r/pro/tag-input.json",
      "access": "pro",
      "sourceDelivery": "server-gated",
      "requiresAuthorization": true
    }
  ],
  "imports": {
    "componentPath": "components/ui/tag-input.tsx",
    "exports": [
      "TidalTagInput",
      "TidalTagInputSuggestion",
      "TidalTagInputTag"
    ],
    "stylesheets": [
      "components/ui/tidal.css",
      "components/ui/tag-input.css"
    ],
    "scopeClass": "tidal-scope"
  },
  "dependencies": {
    "npm": [],
    "registry": [],
    "additionalRegistry": [],
    "installClosure": [
      "tag-input"
    ],
    "css": [
      "components/ui/tidal.css",
      "components/ui/tag-input.css"
    ],
    "demoCss": [],
    "consumerOwned": [
      "react",
      "react-dom"
    ]
  },
  "files": {
    "sourceFile": "/examples/tag-input.tsx",
    "demoStyles": [],
    "inlinedDemoStyles": [
      "src/tag-input-demo.css"
    ],
    "assets": []
  },
  "example": {
    "language": "tsx",
    "source": "\"use client\";\n\nimport \"./components/ui/tidal.css\";\n\nimport { useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from \"react\";\n\nimport { TidalTagInput, type TidalTagInputSuggestion, type TidalTagInputTag } from \"./components/ui/tag-input\";\n\nimport \"./components/ui/tag-input.css\";\n\n\n\nconst tidalExampleStyles = \".tidal-scope .tag-input-demo,\\n.tidal-scope .tag-input-demo * {\\n  box-sizing: border-box;\\n}\\n\\n.tidal-scope .tag-input-demo {\\n  width: 100%;\\n  min-width: 0;\\n  overflow: hidden;\\n  border: 1px solid var(--t-border);\\n  border-radius: 22px;\\n  background:\\n    linear-gradient(90deg, var(--t-border) 1px, transparent 1px) 0 0 / 28px 28px,\\n    linear-gradient(var(--t-border) 1px, transparent 1px) 0 0 / 28px 28px,\\n    var(--t-subtle);\\n  color: var(--t-ink);\\n  container: tag-input-demo / inline-size;\\n}\\n\\n.tidal-scope .tag-input-demo-layout {\\n  display: grid;\\n  min-width: 0;\\n  grid-template-columns: minmax(0, 1.08fr) minmax(250px, 0.72fr);\\n  gap: 14px;\\n  padding: 20px;\\n}\\n\\n.tidal-scope .tag-input-demo-editor {\\n  min-width: 0;\\n  padding: 27px;\\n  border: 1px solid var(--t-border);\\n  border-radius: 18px;\\n  background: var(--t-surface);\\n  box-shadow: 0 30px 70px -58px #0000009e;\\n}\\n\\n.tidal-scope .tag-input-demo-heading {\\n  display: flex;\\n  min-width: 0;\\n  align-items: center;\\n  justify-content: space-between;\\n  gap: 14px;\\n}\\n\\n.tidal-scope .tag-input-demo-heading > span {\\n  min-width: 0;\\n  color: var(--t-muted);\\n  font-size: 11px;\\n  font-weight: 740;\\n  letter-spacing: 0.12em;\\n  line-height: 1.35;\\n  text-transform: uppercase;\\n  overflow-wrap: anywhere;\\n}\\n\\n.tidal-scope .tag-input-demo-heading > strong {\\n  flex: none;\\n  padding: 5px 8px;\\n  border: 1px solid var(--t-border);\\n  border-radius: 7px;\\n  font-size: 11px;\\n  font-variant-numeric: tabular-nums;\\n  line-height: 1.3;\\n}\\n\\n.tidal-scope .tag-input-demo-editor > h2 {\\n  max-width: 16ch;\\n  margin: 15px 0 0;\\n  font-size: clamp(29px, 5.2cqi, 47px);\\n  font-weight: 560;\\n  letter-spacing: -0.058em;\\n  line-height: 0.98;\\n  text-wrap: balance;\\n  overflow-wrap: anywhere;\\n}\\n\\n.tidal-scope .tag-input-demo-editor > p {\\n  max-width: 56ch;\\n  margin: 13px 0 22px;\\n  color: var(--t-muted);\\n  font-size: 11px;\\n  line-height: 1.65;\\n  overflow-wrap: anywhere;\\n}\\n\\n.tidal-scope .tag-input-demo-reset {\\n  display: inline-flex;\\n  min-width: 44px;\\n  min-height: 44px;\\n  align-items: center;\\n  justify-content: center;\\n  margin-top: 12px;\\n  padding: 8px 13px;\\n  border: 1px solid var(--t-border);\\n  border-radius: 10px;\\n  background: var(--t-surface);\\n  color: var(--t-ink);\\n  font: inherit;\\n  font-size: 11px;\\n  font-weight: 680;\\n  cursor: pointer;\\n  transition:\\n    border-color 180ms,\\n    background 180ms,\\n    transform 140ms var(--t-ease-out);\\n}\\n\\n.tidal-scope .tag-input-demo-reset:hover {\\n  border-color: var(--t-ink);\\n  background: var(--t-subtle);\\n}\\n\\n.tidal-scope .tag-input-demo-reset:active {\\n  transform: scale(0.97);\\n}\\n\\n.tidal-scope .tag-input-demo-reset:focus-visible {\\n  outline: 2px solid var(--t-accent);\\n  outline-offset: 3px;\\n}\\n\\n.tidal-scope .tag-input-demo-board {\\n  min-width: 0;\\n  align-self: start;\\n  padding: 22px;\\n  border: 1px solid var(--t-ink);\\n  border-radius: 18px;\\n  background: var(--t-ink);\\n  color: var(--t-surface);\\n  box-shadow: 0 32px 70px -54px #000000c4;\\n}\\n\\n.tidal-scope .tag-input-demo-board-head {\\n  display: flex;\\n  min-width: 0;\\n  align-items: center;\\n  justify-content: space-between;\\n  gap: 14px;\\n  padding-bottom: 17px;\\n  border-bottom: 1px solid\\n    color-mix(in srgb, var(--t-surface) 22%, var(--t-ink));\\n}\\n\\n.tidal-scope .tag-input-demo-board-head > div {\\n  min-width: 0;\\n}\\n\\n.tidal-scope .tag-input-demo-board-head > div > span {\\n  color: color-mix(in srgb, var(--t-surface) 60%, var(--t-ink));\\n  font-size: 11px;\\n  font-weight: 700;\\n  letter-spacing: 0.1em;\\n  line-height: 1.35;\\n  text-transform: uppercase;\\n}\\n\\n.tidal-scope .tag-input-demo-board-head h3 {\\n  margin: 5px 0 0;\\n  font-size: 20px;\\n  font-weight: 590;\\n  letter-spacing: -0.035em;\\n  line-height: 1.1;\\n  overflow-wrap: anywhere;\\n}\\n\\n.tidal-scope .tag-input-demo-board-head > span {\\n  display: grid;\\n  width: 44px;\\n  height: 44px;\\n  flex: none;\\n  place-items: center;\\n  border: 1px solid color-mix(in srgb, var(--t-surface) 28%, var(--t-ink));\\n  border-radius: 10px;\\n  font-size: 14px;\\n  font-variant-numeric: tabular-nums;\\n  font-weight: 620;\\n}\\n\\n.tidal-scope .tag-input-demo-board ul {\\n  display: grid;\\n  gap: 8px;\\n  margin: 16px 0 0;\\n  padding: 0;\\n  list-style: none;\\n}\\n\\n.tidal-scope .tag-input-demo-board li {\\n  min-width: 0;\\n  padding: 12px;\\n  border: 1px solid color-mix(in srgb, var(--t-surface) 20%, var(--t-ink));\\n  border-radius: 12px;\\n  background: color-mix(in srgb, var(--t-surface) 4%, var(--t-ink));\\n  animation: tag-input-row-in 420ms var(--t-ease-out) both;\\n  animation-delay: calc(var(--tag-row-index) * 55ms);\\n}\\n\\n.tidal-scope .tag-input-demo-board li > div:first-child {\\n  display: flex;\\n  min-width: 0;\\n  align-items: baseline;\\n  justify-content: space-between;\\n  gap: 10px;\\n}\\n\\n.tidal-scope .tag-input-demo-board li strong {\\n  min-width: 0;\\n  font-size: 11px;\\n  font-weight: 650;\\n  line-height: 1.35;\\n  overflow-wrap: anywhere;\\n}\\n\\n.tidal-scope .tag-input-demo-board li > div:first-child > span {\\n  max-width: 44%;\\n  color: color-mix(in srgb, var(--t-surface) 62%, var(--t-ink));\\n  font-size: 11px;\\n  line-height: 1.35;\\n  text-align: end;\\n  overflow-wrap: anywhere;\\n}\\n\\n.tidal-scope .tag-input-demo-progress {\\n  height: 4px;\\n  margin-top: 10px;\\n  overflow: hidden;\\n  border-radius: 999px;\\n  background: color-mix(in srgb, var(--t-surface) 18%, var(--t-ink));\\n}\\n\\n.tidal-scope .tag-input-demo-progress > span {\\n  display: block;\\n  height: 100%;\\n  border-radius: inherit;\\n  background: var(--t-surface);\\n  transform-origin: left center;\\n  animation: tag-input-progress-in 620ms var(--t-ease-out) both;\\n}\\n\\n.tidal-scope[dir=\\\"rtl\\\"] .tag-input-demo-progress > span {\\n  transform-origin: right center;\\n}\\n\\n.tidal-scope .tag-input-demo-empty {\\n  display: grid;\\n  min-height: 184px;\\n  place-content: center;\\n  gap: 6px;\\n  text-align: center;\\n}\\n\\n.tidal-scope .tag-input-demo-empty strong {\\n  font-size: 12px;\\n}\\n\\n.tidal-scope .tag-input-demo-empty span {\\n  color: color-mix(in srgb, var(--t-surface) 64%, var(--t-ink));\\n  font-size: 11px;\\n  line-height: 1.45;\\n}\\n\\n@container tag-input-demo (max-width: 760px) {\\n  .tidal-scope .tag-input-demo-layout {\\n    grid-template-columns: minmax(0, 1fr);\\n    padding: 10px;\\n  }\\n\\n  .tidal-scope .tag-input-demo-editor {\\n    padding: 21px;\\n  }\\n\\n  .tidal-scope .tag-input-demo-board {\\n    padding: 18px;\\n  }\\n}\\n\\n@container tag-input-demo (max-width: 390px) {\\n  .tidal-scope .tag-input-demo-layout {\\n    gap: 8px;\\n    padding: 6px;\\n  }\\n\\n  .tidal-scope .tag-input-demo-editor,\\n  .tidal-scope .tag-input-demo-board {\\n    padding: 15px;\\n  }\\n\\n  .tidal-scope .tag-input-demo-editor > h2 {\\n    font-size: 29px;\\n  }\\n}\\n\\n@keyframes tag-input-row-in {\\n  from {\\n    opacity: 0;\\n    transform: translateY(7px);\\n  }\\n}\\n\\n@keyframes tag-input-progress-in {\\n  from {\\n    transform: scaleX(0);\\n  }\\n}\\n\\n@media (prefers-reduced-motion: reduce) {\\n  .tidal-scope .tag-input-demo-board li,\\n  .tidal-scope .tag-input-demo-progress > span {\\n    animation: none;\\n  }\\n\\n  .tidal-scope .tag-input-demo-reset {\\n    transition: none;\\n  }\\n\\n  .tidal-scope .tag-input-demo-reset:active {\\n    transform: none;\\n  }\\n}\";\n\nconst ALL_TAGS: readonly TidalTagInputTag[] = [\n  { id: \"review\", value: \"review\", label: \"Review\", accessibleLabel: \"Review\" },\n  { id: \"design\", value: \"design\", label: \"Design\", accessibleLabel: \"Design\" },\n  { id: \"copy\", value: \"copy\", label: \"Copy\", accessibleLabel: \"Copy\" },\n  {\n    id: \"blocked\",\n    value: \"blocked\",\n    label: \"Blocked\",\n    accessibleLabel: \"Blocked\",\n  },\n  { id: \"ready\", value: \"ready\", label: \"Ready\", accessibleLabel: \"Ready\" },\n];\n\nconst SAMPLE_ITEMS = [\n  {\n    id: \"brief\",\n    title: \"Project brief\",\n    tags: [\"review\", \"copy\"],\n    progress: 72,\n  },\n  {\n    id: \"landing\",\n    title: \"Landing page\",\n    tags: [\"review\", \"design\"],\n    progress: 48,\n  },\n  { id: \"launch\", title: \"Launch checklist\", tags: [\"ready\"], progress: 100 },\n  {\n    id: \"notes\",\n    title: \"Interview notes\",\n    tags: [\"blocked\", \"copy\"],\n    progress: 24,\n  },\n] as const;\n\nexport function TagInputDemo() {\n  const [tags, setTags] = useState<readonly TidalTagInputTag[]>([\n    ALL_TAGS[0],\n    ALL_TAGS[1],\n  ]);\n  const [query, setQuery] = useState(\"\");\n  const [message, setMessage] = useState(\"Two labels selected.\");\n  const inputRef = useRef<HTMLInputElement>(null);\n  const pendingInputFocus = useRef(false);\n\n  useLayoutEffect(() => {\n    if (!pendingInputFocus.current) return;\n    pendingInputFocus.current = false;\n    inputRef.current?.focus({ preventScroll: true });\n  }, [tags]);\n\n  const suggestions = useMemo(\n    () =>\n      ALL_TAGS.filter(\n        (candidate) =>\n          !tags.some((tag) => tag.id === candidate.id) &&\n          candidate.accessibleLabel.toLowerCase().includes(query.toLowerCase()),\n      ),\n    [query, tags],\n  );\n  const visibleItems = useMemo(\n    () =>\n      SAMPLE_ITEMS.filter(\n        (item) =>\n          tags.length === 0 ||\n          tags.some((tag) => item.tags.includes(tag.value as never)),\n      ),\n    [tags],\n  );\n\n  const selectSuggestion = (suggestion: TidalTagInputSuggestion) => {\n    const tag = ALL_TAGS.find((candidate) => candidate.id === suggestion.id);\n    if (!tag) return;\n    setTags((current) => [...current, tag]);\n    setQuery(\"\");\n    setMessage(`${tag.accessibleLabel} added.`);\n    inputRef.current?.focus({ preventScroll: true });\n  };\n\n  return (\n    <section className=\"tag-input-demo\" aria-label=\"Project label preview\">\n      <div className=\"tag-input-demo-layout\">\n        <div className=\"tag-input-demo-editor\">\n          <div className=\"tag-input-demo-heading\">\n            <span>Review queue</span>\n            <strong>{visibleItems.length} visible</strong>\n          </div>\n          <TidalTagInput\n            label=\"Project labels\"\n            description=\"Choose up to five labels.\"\n            tags={tags}\n            query={query}\n            maxTags={5}\n            inputRef={inputRef}\n            inputProps={{ placeholder: \"Find a label\" }}\n            onQueryChange={(value) => setQuery(value)}\n            onRemoveTag={(tag) => {\n              pendingInputFocus.current = true;\n              setTags((current) =>\n                current.filter((candidate) => candidate.id !== tag.id),\n              );\n              setMessage(`${tag.accessibleLabel} removed.`);\n            }}\n            suggestions={{\n              label: query ? `Suggestions for “${query}”` : \"Available labels\",\n              accessibleLabel: \"Available project labels\",\n              items: suggestions,\n              onSelect: selectSuggestion,\n            }}\n            status={\n              <span role=\"status\" aria-live=\"polite\">\n                {message} Sample data. Changes stay in this preview.\n              </span>\n            }\n          />\n\n          <button\n            type=\"button\"\n            className=\"tag-input-demo-reset\"\n            onClick={() => {\n              setTags([ALL_TAGS[0], ALL_TAGS[1]]);\n              setQuery(\"\");\n              setMessage(\"Labels reset.\");\n              inputRef.current?.focus({ preventScroll: true });\n            }}\n          >\n            Reset labels\n          </button>\n        </div>\n\n        <section className=\"tag-input-demo-board\" aria-label=\"Filtered work\">\n          <div className=\"tag-input-demo-board-head\">\n            <div>\n              <span>Tasks</span>\n              <h3>Review queue</h3>\n            </div>\n            <span>{visibleItems.length.toString().padStart(2, \"0\")}</span>\n          </div>\n          {visibleItems.length ? (\n            <ul>\n              {visibleItems.map((item, index) => (\n                <li\n                  key={item.id}\n                  style={{ \"--tag-row-index\": index } as CSSProperties}\n                >\n                  <div>\n                    <strong>{item.title}</strong>\n                    <span>{item.tags.join(\" · \")}</span>\n                  </div>\n                  <div\n                    className=\"tag-input-demo-progress\"\n                    role=\"img\"\n                    aria-label={`${item.progress}% complete`}\n                  >\n                    <span style={{ width: `${item.progress}%` }} />\n                  </div>\n                </li>\n              ))}\n            </ul>\n          ) : (\n            <div className=\"tag-input-demo-empty\">\n              <strong>No matching tasks.</strong>\n              <span>Remove a label or reset the filters.</span>\n            </div>\n          )}\n        </section>\n      </div>\n    </section>\n  );\n}\n\nexport default function AgentExample() {\n  return (\n    <div className=\"tidal-scope\" data-theme=\"light\" dir=\"ltr\">\n      <style>{tidalExampleStyles}</style>\n      <TagInputDemo />\n    </div>\n  );\n}\n",
    "sourceFile": "/examples/tag-input.tsx",
    "fixtureData": "Existing demo fixture data only; replace with consumer-owned data before production use."
  },
  "controlledState": [
    {
      "prop": "tags",
      "type": "inferred-from-existing-demo",
      "initial": "[\n    ALL_TAGS[0],\n    ALL_TAGS[1],\n  ]",
      "setter": "setTags",
      "proposalCanBeRejected": false
    },
    {
      "prop": "query",
      "type": "inferred-from-existing-demo",
      "initial": "\"\"",
      "setter": "setQuery",
      "proposalCanBeRejected": false
    }
  ],
  "events": [
    {
      "name": "onClick",
      "nativeType": "React synthetic event or native callback",
      "callerFirst": true,
      "preventable": true,
      "observedResult": "The existing demo callback remains the source of truth; this example does not call a live service."
    },
    {
      "name": "onQueryChange",
      "nativeType": "component callback",
      "callerFirst": true,
      "preventable": true,
      "observedResult": "The existing demo callback remains the source of truth; this example does not call a live service."
    },
    {
      "name": "onRemoveTag",
      "nativeType": "component callback",
      "callerFirst": true,
      "preventable": true,
      "observedResult": "The existing demo callback remains the source of truth; this example does not call a live service."
    }
  ],
  "nativeForm": {
    "participates": true,
    "names": [],
    "expectedFormData": {},
    "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": []
}
