{
  "schemaVersion": 1,
  "target": "react",
  "name": "empty",
  "version": "0.1.0",
  "category": "feedback",
  "title": "Empty",
  "description": "An empty state with an icon or illustration slot, a title, a description, and actions, plus a compact row variant for tables and lists.",
  "tags": [
    "empty state",
    "blank slate",
    "zero state",
    "no results",
    "placeholder",
    "onboarding"
  ],
  "requires": {
    "projectTypes": [
      "next",
      "vite-react"
    ],
    "styling": "tailwind-v4"
  },
  "npmDependencies": {},
  "registryDependencies": [
    {
      "name": "button",
      "version": "0.2.1"
    }
  ],
  "docsPath": "/components/empty",
  "props": [
    {
      "name": "size",
      "type": "\"default\" | \"compact\"",
      "default": "\"default\"",
      "description": "default is a centered block for pages and panels; compact is one left-aligned row for table bodies, lists, and sidebars, with actions on the right from the sm breakpoint."
    },
    {
      "name": "bordered",
      "type": "boolean",
      "default": "false",
      "description": "Draws a dashed hairline around the empty state, for drop zones and panels without their own border."
    },
    {
      "name": "EmptyMedia variant",
      "type": "\"icon\" | \"illustration\"",
      "default": "\"icon\"",
      "description": "icon places a 20px icon on a hairline tile over a still dot field; illustration is a bare slot for your own SVG or image."
    },
    {
      "name": "EmptyTitle level",
      "type": "2 | 3 | 4",
      "default": "3",
      "description": "Heading level of the title, so it fits the page outline."
    }
  ],
  "accessibility": [
    "The title is a real heading (h3 by default, adjustable with level), so the empty state appears in the page outline.",
    "EmptyMedia is aria-hidden: the icon and dot field are decorative and the title carries the meaning.",
    "Actions are your own buttons or links and keep their native keyboard behavior and focus rings.",
    "No motion; the dot field is a still background."
  ],
  "states": [
    "default",
    "compact",
    "bordered"
  ],
  "files": [
    {
      "path": "ui/empty.tsx",
      "content": "import type { ComponentProps } from \"react\";\n\nfunction cx(...classes: (string | false | null | undefined)[]) {\n  return classes.filter(Boolean).join(\" \");\n}\n\nexport interface EmptyProps extends ComponentProps<\"div\"> {\n  /**\n   * `default` is a centered block for pages and panels. `compact` is a single left-aligned row\n   * for table bodies, lists, and sidebars.\n   */\n  size?: \"default\" | \"compact\";\n  /** Draws a dashed hairline around it, for drop zones and empty panels without their own border. */\n  bordered?: boolean;\n}\n\n/**\n * An empty state: what is missing, why, and what to do next.\n * Compose it with `EmptyMedia`, `EmptyTitle`, `EmptyDescription`, and `EmptyActions`.\n */\nexport function Empty({ size = \"default\", bordered = false, className, ...props }: EmptyProps) {\n  const compact = size === \"compact\";\n  return (\n    <div\n      data-size={size}\n      className={cx(\n        \"group/empty text-zinc-950 dark:text-white\",\n        compact\n          ? \"grid grid-cols-[auto_minmax(0,1fr)] items-start gap-x-3 gap-y-0.5 px-4 py-4 text-left sm:items-center sm:has-[>[data-slot=empty-actions]]:grid-cols-[auto_minmax(0,1fr)_auto]\"\n          : \"flex flex-col items-center gap-1.5 px-6 py-12 text-center\",\n        bordered && \"rounded-xl border border-dashed border-zinc-950/15 dark:border-white/15\",\n        className,\n      )}\n      {...props}\n    />\n  );\n}\n\nexport interface EmptyMediaProps extends ComponentProps<\"div\"> {\n  /**\n   * `icon` puts a 20px icon on a hairline tile over a faint dot field.\n   * `illustration` is a bare slot for your own SVG or image.\n   */\n  variant?: \"icon\" | \"illustration\";\n}\n\n/** The icon or illustration slot. Decorative: it is hidden from screen readers. */\nexport function EmptyMedia({ variant = \"icon\", className, children, ...props }: EmptyMediaProps) {\n  if (variant === \"illustration\") {\n    return (\n      <div\n        aria-hidden=\"true\"\n        className={cx(\"mb-3 flex items-center justify-center group-data-[size=compact]/empty:row-span-2 group-data-[size=compact]/empty:mb-0\", className)}\n        {...props}\n      >\n        {children}\n      </div>\n    );\n  }\n  return (\n    <div\n      aria-hidden=\"true\"\n      className={cx(\n        \"relative isolate flex items-center justify-center\",\n        \"mb-4 size-12 group-data-[size=compact]/empty:row-span-2 group-data-[size=compact]/empty:mb-0 group-data-[size=compact]/empty:size-9\",\n        className,\n      )}\n      {...props}\n    >\n      {/* A still field of dots fading out from the tile: the agent marks' dot language, at rest. */}\n      <span\n        className={cx(\n          \"pointer-events-none absolute -inset-10 -z-10 group-data-[size=compact]/empty:hidden\",\n          \"bg-[radial-gradient(circle,rgb(9_9_11/0.16)_1px,transparent_1.2px)] bg-size-[10px_10px] bg-center\",\n          \"dark:bg-[radial-gradient(circle,rgb(255_255_255/0.16)_1px,transparent_1.2px)]\",\n          \"[mask-image:radial-gradient(closest-side,black,transparent)]\",\n        )}\n      />\n      <span\n        className={cx(\n          \"flex size-full items-center justify-center rounded-xl border border-zinc-950/10 bg-white text-zinc-500 shadow-[0_1px_2px_rgb(0_0_0/0.05)]\",\n          \"dark:border-white/12 dark:bg-black dark:text-zinc-400 dark:shadow-[inset_0_1px_0_rgb(255_255_255/0.07)]\",\n          \"[&_svg]:size-5 group-data-[size=compact]/empty:rounded-lg group-data-[size=compact]/empty:[&_svg]:size-4\",\n        )}\n      >\n        {children}\n      </span>\n    </div>\n  );\n}\n\nexport interface EmptyTitleProps extends ComponentProps<\"h3\"> {\n  /** Heading level. Defaults to 3; use the level that fits your page outline. */\n  level?: 2 | 3 | 4;\n}\n\n/** What is empty, in plain words (\"No deployments yet\"). */\nexport function EmptyTitle({ level = 3, className, ...props }: EmptyTitleProps) {\n  const Tag = `h${level}` as const;\n  return (\n    <Tag\n      className={cx(\n        \"text-sm leading-5 font-semibold text-balance text-zinc-950 dark:text-white\",\n        \"group-data-[size=compact]/empty:col-start-2 group-data-[size=compact]/empty:font-medium\",\n        className,\n      )}\n      {...props}\n    />\n  );\n}\n\n/** Why it is empty, or what will appear here once it is not. */\nexport function EmptyDescription({ className, ...props }: ComponentProps<\"p\">) {\n  return (\n    <p\n      className={cx(\n        \"max-w-[42ch] text-sm leading-relaxed text-pretty text-zinc-600 dark:text-zinc-400\",\n        \"group-data-[size=compact]/empty:col-start-2 group-data-[size=compact]/empty:max-w-none group-data-[size=compact]/empty:leading-5\",\n        \"[&_a]:font-medium [&_a]:text-zinc-950 [&_a]:underline [&_a]:decoration-zinc-950/25 [&_a]:underline-offset-[3px] dark:[&_a]:text-white dark:[&_a]:decoration-white/30\",\n        className,\n      )}\n      {...props}\n    />\n  );\n}\n\n/** The next step: one primary action and at most one secondary one. */\nexport function EmptyActions({ className, ...props }: ComponentProps<\"div\">) {\n  return (\n    <div\n      data-slot=\"empty-actions\"\n      className={cx(\n        \"mt-4 flex flex-wrap items-center justify-center gap-2\",\n        \"group-data-[size=compact]/empty:col-start-2 group-data-[size=compact]/empty:mt-2 group-data-[size=compact]/empty:justify-start\",\n        \"sm:group-data-[size=compact]/empty:col-start-3 sm:group-data-[size=compact]/empty:row-span-2 sm:group-data-[size=compact]/empty:row-start-1 sm:group-data-[size=compact]/empty:mt-0\",\n        className,\n      )}\n      {...props}\n    />\n  );\n}\n"
    }
  ],
  "example": {
    "content": "import { Button } from \"@/components/shaken/ui/button\";\nimport { Empty, EmptyActions, EmptyDescription, EmptyMedia, EmptyTitle } from \"@/components/shaken/ui/empty\";\n\nfunction CubeIcon() {\n  return (\n    <svg viewBox=\"0 0 20 20\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.4\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n      <path d=\"M10 2.25 17 6.1v7.8l-7 3.85-7-3.85V6.1Z\" />\n      <path d=\"M3 6.1 10 10l7-3.9M10 10v7.75\" />\n    </svg>\n  );\n}\n\nfunction KeyIcon() {\n  return (\n    <svg viewBox=\"0 0 20 20\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.4\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n      <circle cx=\"6.5\" cy=\"13.5\" r=\"3.75\" />\n      <path d=\"m9.2 10.8 7.8-7.8M14.8 5.2l2.2 2.2M12.2 7.8l1.8 1.8\" />\n    </svg>\n  );\n}\n\nexport default function EmptyExample() {\n  return (\n    <div className=\"grid w-full max-w-xl gap-6\">\n      <div className=\"rounded-xl border border-zinc-950/10 dark:border-white/10\">\n        <Empty>\n          <EmptyMedia>\n            <CubeIcon />\n          </EmptyMedia>\n          <EmptyTitle>No deployments yet</EmptyTitle>\n          <EmptyDescription>\n            Push to the main branch or deploy from the command line. Every build shows up here with its logs.\n          </EmptyDescription>\n          <EmptyActions>\n            <Button size=\"sm\">Import repository</Button>\n            <Button size=\"sm\" variant=\"secondary\">\n              Read the CLI guide\n            </Button>\n          </EmptyActions>\n        </Empty>\n      </div>\n\n      <div className=\"overflow-hidden rounded-xl border border-zinc-950/10 dark:border-white/10\">\n        <div className=\"grid grid-cols-[1fr_auto] border-b border-zinc-950/[0.07] px-4 py-2.5 text-xs font-medium text-zinc-500 dark:border-white/[0.08]\">\n          <span>API keys</span>\n          <span>Last used</span>\n        </div>\n        <Empty size=\"compact\">\n          <EmptyMedia>\n            <KeyIcon />\n          </EmptyMedia>\n          <EmptyTitle>No API keys</EmptyTitle>\n          <EmptyDescription>Create a key to call the API from your servers.</EmptyDescription>\n          <EmptyActions>\n            <Button size=\"sm\" variant=\"secondary\">\n              Create key\n            </Button>\n          </EmptyActions>\n        </Empty>\n      </div>\n    </div>\n  );\n}\n"
  }
}
