{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "item",
  "title": "Item",
  "description": "One row of a list: leading media, a title with a description, and trailing actions.",
  "registryDependencies": [
    "@ouro/lib-class-name-check",
    "@ouro/lib-cn",
    "@ouro/lib-env",
    "@ouro/lib-router-link",
    "@ouro/lib-stretched-link",
    "@ouro/lib-use-dev-messages"
  ],
  "files": [
    {
      "path": "registry/ouro/components/ouro/item/item.tsx",
      "content": "\"use client\";\n\nimport { createElement, useId, type HTMLAttributes, type JSX, type MouseEvent, type ReactNode, type Ref } from \"react\";\nimport { useAppearanceClassNameCheck } from \"@/registry/ouro/lib/ouro/class-name-check\";\nimport { cn } from \"@/registry/ouro/lib/ouro/cn\";\nimport { RouterLink, safeRel } from \"@/registry/ouro/lib/ouro/router-link\";\nimport { raiseControlsClass, stretchedLinkClass } from \"@/registry/ouro/lib/ouro/stretched-link\";\nimport { useDevWarnings } from \"@/registry/ouro/lib/ouro/use-dev-messages\";\n\n/**\n * How big an Item's media is: an `icon` in a muted 40px tile, or an image at 40, 64 or 112px.\n *\n * @claim \"How big an Item's media is\" registry/ouro/components/ouro/item/item.test.tsx verify:testExists(registry/ouro/components/ouro/item/item.test.tsx::Item > sizes its media: sm 40px by default, md 64px, lg 112px, and an icon in a 40px tile)\n * @claim \"How big an Item's media is\" registry/ouro/components/ouro/item/item.test.tsx verify:testExists(registry/ouro/components/ouro/item/item.test.tsx::Item > gives an icon a muted tile and hides it from screen readers)\n */\nexport type ItemMediaSize = \"icon\" | \"sm\" | \"md\" | \"lg\";\n\n/**\n * The props every Item takes, with or without `href`.\n *\n * @claim \"The props every Item takes, with\" registry/ouro/components/ouro/item/item.test-d.ts verify:fileLine(registry/ouro/components/ouro/item/item.test-d.ts, /expectTypeOf<\\{\\stitle:\\s\"Ribs\";\\shref:\\s\"\\/recipes\\/1\";/)\n */\nexport interface ItemOwnProps {\n  /**\n   * A short line under the title. Pass `<Text lines={2}>` to clamp a long one. With `href`, it\n   * also describes the link (`aria-describedby`), so a screen reader that lands on the row hears\n   * its title and then this line: a result's byline and snippet, a recipe's time.\n   * @claim \"so a screen reader that lands\" registry/ouro/e2e/screen-reader/item.sr.spec.ts verify:fileLine(registry/ouro/e2e/screen-reader/item.sr.spec.ts, /is heard as a link by its title, then its description/)\n   * @claim \"With `href`, it also describes the\" registry/ouro/components/ouro/item/item.test.tsx verify:testExists(registry/ouro/components/ouro/item/item.test.tsx::Item with href > describes the row's link by its description, which keeps its place under the title)\n   */\n  description?: ReactNode;\n  /**\n   * Leading media: an `<img>` (cropped square), an `Avatar`, or an icon with\n   * `mediaSize=\"icon\"`. Give an image `alt=\"\"` when the title already names it. Beside a\n   * description, it lines up with the title and the description's first line, so it stays\n   * level with the title however long the description runs; beside a title alone, it is centered.\n   * @claim \"Beside a description, it lines up\" registry/ouro/components/ouro/item/item.test.tsx verify:testExists(registry/ouro/components/ouro/item/item.test.tsx::Item > keeps the media level with the title when the description runs past one line, and centered beside shorter text)\n   */\n  media?: ReactNode;\n  /**\n   * The media's size: `icon` puts an icon in a muted 40px tile (and hides it from screen\n   * readers); `sm` is 40px, `md` 64px, `lg` 112px for a recipe photo.\n   * @default \"sm\"\n   * @claim \"The media's size: `icon` puts an\" registry/ouro/components/ouro/item/item.test.tsx verify:testExists(registry/ouro/components/ouro/item/item.test.tsx::Item > sizes its media: sm 40px by default, md 64px, lg 112px, and an icon in a 40px tile)\n   * @claim \"The media's size: `icon` puts an\" registry/ouro/components/ouro/item/item.test.tsx verify:testExists(registry/ouro/components/ouro/item/item.test.tsx::Item > gives an icon a muted tile and hides it from screen readers)\n   */\n  mediaSize?: ItemMediaSize | (string & { 'Use \"icon\", \"sm\" (40px), \"md\" (64px) or \"lg\" (112px)': never }) | undefined;\n  /**\n   * Below this breakpoint the media leaves the row and runs full width above the text, at\n   * 4:3, as a recipe list shows its photos on a phone; above it, it sits beside the text at\n   * `mediaSize`. `always` keeps it above at every width.\n   * @claim \"Below this breakpoint the media leaves\" registry/ouro/components/ouro/item/item.test.tsx verify:testExists(registry/ouro/components/ouro/item/item.test.tsx::Item > always puts the media above the text with mediaAbove=always, with the actions beside the title)\n   * @claim \"Below this breakpoint the media leaves\" registry/ouro/components/ouro/item/item.test.tsx verify:testExists(registry/ouro/components/ouro/item/item.test.tsx::Item > stacks the actions beside media below md and the media above below sm)\n   * @claim \"Below this breakpoint the media leaves\" registry/ouro/components/ouro/item/item.tsx verify:fileLine(registry/ouro/components/ouro/item/item.tsx, /media:\\s\"col-span-full\\sw-full\\sh-auto\\saspect-\\[4\\/3\\]\\srounded-ouro-lg\"/)\n   * @claim \"`always` keeps it above at every\" registry/ouro/components/ouro/item/item.test.tsx verify:testExists(registry/ouro/components/ouro/item/item.test.tsx::Item > always puts the media above the text with mediaAbove=always, with the actions beside the title)\n   */\n  mediaAbove?: \"always\" | \"sm\" | \"md\" | (string & { 'Use \"always\", \"sm\" (640px) or \"md\" (768px)': never }) | undefined;\n  /**\n   * Trailing content at the end of the row: buttons, a switch, a badge or a timestamp. With\n   * `href`, controls here stay their own tab stops, above the link.\n   */\n  actions?: ReactNode;\n  /**\n   * Below this breakpoint the actions drop under the text, lined up with the title, as in a\n   * settings row on a phone. Without it they stay at the end at every width.\n   * @claim \"Without it they stay at the\" registry/ouro/components/ouro/item/item.test.tsx verify:testExists(registry/ouro/components/ouro/item/item.test.tsx::Item > keeps the actions beside the text on a phone by default)\n   */\n  stackBelow?: \"sm\" | \"md\" | (string & { 'Use \"sm\" (640px) or \"md\" (768px)': never }) | undefined;\n  /**\n   * `plain` has no frame, for rows in an `ItemGroup`; `outline` is a bordered, padded box for\n   * a row on its own.\n   * @default \"plain\"\n   * @claim \"`plain` has no frame, for rows\" registry/ouro/components/ouro/item/item.test.tsx verify:testExists(registry/ouro/components/ouro/item/item.test.tsx::Item > is a bordered box with padding with variant=outline, and tighter with size=sm)\n   * @claim \"`plain` has no frame, for rows\" registry/ouro/components/ouro/item/item-group.test.tsx verify:testExists(registry/ouro/components/ouro/item/item-group.test.tsx::ItemGroup > has no lines with variant=plain)\n   */\n  variant?: \"plain\" | \"outline\" | (string & { 'Use \"plain\" or \"outline\"; muted is a Card': never }) | undefined;\n  /**\n   * Row height: `md` has 12px above and below, `sm` 8px for dense lists. @default \"md\"\n   *\n   * @claim \"Row height: `md` has 12px above\" registry/ouro/components/ouro/item/item.tsx verify:fileLine(registry/ouro/components/ouro/item/item.tsx, /const\\ssizes\\s=\\s\\{\\smd:\\s\"py-3\",\\ssm:\\s\"py-2\"\\s\\}/)\n   */\n  size?: \"md\" | \"sm\" | (string & { 'Use \"md\" or \"sm\"': never }) | undefined;\n  /**\n   * The element to render. `ItemGroup` already wraps each Item in an `<li>`.\n   * @default \"div\"\n   * @claim \"`ItemGroup` already wraps each Item in\" registry/ouro/components/ouro/item/item-group.test.tsx verify:testExists(registry/ouro/components/ouro/item/item-group.test.tsx::ItemGroup > is a list labelled by its label, with each Item a list item)\n   * @claim \"`ItemGroup` already wraps each Item in\" registry/ouro/components/ouro/item/item-group.test.tsx verify:testExists(registry/ouro/components/ouro/item/item-group.test.tsx::ItemGroup development messages > warns when an Item inside renders its own <li>)\n   */\n  as?: \"div\" | \"li\" | \"article\" | (string & { 'Use \"div\", \"li\" or \"article\"; for a link use href': never }) | undefined;\n  /** Layout only: margins, grid placement (`mt-2`). Appearance classes warn in development; use `variant`. */\n  className?: string | undefined;\n  ref?: Ref<HTMLElement> | undefined;\n\n  /** Not a prop. Ouro UI uses `description`: `<Item description=\"Four hours\">`. */\n  subtitle?: { 'Use <Item description=\"Four hours\">': never };\n  /** Not a prop. Ouro UI uses `media`: `<Item media={<Icon />} mediaSize=\"icon\">`. */\n  icon?: { 'Use <Item media={<Icon />} mediaSize=\"icon\">': never };\n  /** Not a prop. Ouro UI uses `media`: `<Item media={<Avatar … />}>`. */\n  avatar?: { \"Use <Item media={<Avatar ... />}>\": never };\n  /** Not a prop. Ouro UI uses `media`: `<Item media={<img src=\"…\" alt=\"\" />}>`. */\n  image?: { 'Use <Item media={<img src=\"...\" alt=\"\" />}>': never };\n  /** Not a prop. Ouro UI uses `media`: `<Item media={<img src=\"…\" alt=\"\" />}>`. */\n  thumbnail?: { 'Use <Item media={<img src=\"...\" alt=\"\" />}>': never };\n  /** Not a prop. Ouro UI uses `actions`, for one control or several: `<Item actions={<Button>…</Button>}>`. */\n  action?: { \"Use <Item actions={<Button>...</Button>}>\": never };\n  /** Not a prop. Ouro UI uses `title`: `<Item title=\"Braised short ribs\">`. */\n  label?: { 'Use <Item title=\"Braised short ribs\">': never };\n  /** Not a prop. Ouro UI uses `href`, for router links too: `<Item href=\"/recipes/1\" title=\"…\">`. */\n  to?: { 'Use <Item href=\"/recipes/1\" title=\"...\">': never };\n  /** Not a prop. With `href` the whole row is a link: `<Item href=\"/recipes/1\" title=\"…\">`. */\n  asChild?: { 'Use <Item href=\"/recipes/1\" title=\"...\">': never };\n  /** Not a prop. The chosen row is `selected`: `<Item selected={row.id === openId} onSelect={() => open(row.id)}>`. */\n  active?: { \"Use selected={row.id === openId}\": never };\n  /** Not a prop. The chosen row is `selected`: `<Item selected={row.id === openId} onSelect={() => open(row.id)}>`. */\n  isSelected?: { \"Use selected={row.id === openId}\": never };\n  /** Not a prop. The chosen row is `selected`: `<Item selected={row.id === openId} onSelect={() => open(row.id)}>`. */\n  current?: { \"Use selected={row.id === openId}\": never };\n}\n\n/** Props for {@link Item}. The HTML attributes sit outside the `href` union, which keeps the editor's hover docs. */\nexport type ItemProps = Omit<HTMLAttributes<HTMLElement>, keyof ItemOwnProps | \"title\" | \"onSelect\"> &\n  ItemOwnProps & {\n    /** What the row is: a name, a recipe title, a setting. It is the link's text with `href`. */\n    title: ReactNode;\n  } & (\n    | {\n        /**\n         * Makes the whole row one link, with one tab stop, named by its title. Internal paths\n         * go through `OuroProvider`'s `linkComponent`, as with `Link`. Controls anywhere in\n         * the row (a link in the description, a button in the media or the actions) stay\n         * their own tab stops and take their own clicks and taps. On a touch screen the row\n         * is at least 44px tall.\n         * @claim \"On a touch screen the row\" registry/ouro/components/ouro/item/item.touch.test.tsx verify:testExists(registry/ouro/components/ouro/item/item.touch.test.tsx::makes a linked row at least 44px tall at every size, so it is a full touch target)\n         */\n        href: string;\n        /** Opens the link in a new tab, safely, and tells screen readers so. */\n        external?: boolean | undefined;\n        /** A ref to the link's `<a>`, to move focus to it. */\n        linkRef?: Ref<HTMLAnchorElement> | undefined;\n        /**\n         * Marks the row as the page shown, as in a list of sections beside their content: the\n         * link reads as the current page (`aria-current=\"page\"`) and the row takes the selected\n         * colour. Pass it on every row, `false` on the others, so the rows line up.\n         */\n        selected?: boolean | undefined;\n        /** Only without `href`. A linked row opens its link. */\n        onSelect?: never;\n        /** Only without `href`. */\n        buttonRef?: never;\n      }\n    | {\n        /**\n         * Makes the whole row one button, with one tab stop, named by its title: for a list\n         * beside its detail, where pressing a row shows it. Controls anywhere in the row stay\n         * their own tab stops and take their own presses. On a touch screen the row is at\n         * least 44px tall. Use `href` instead when the row opens a page of its own.\n         * @claim \"On a touch screen the row\" registry/ouro/components/ouro/item/item.touch.test.tsx verify:testExists(registry/ouro/components/ouro/item/item.touch.test.tsx::makes a row with onSelect at least 44px tall too, so the whole row is a touch target)\n         */\n        onSelect: (event: MouseEvent<HTMLButtonElement>) => void;\n        /**\n         * Marks the row as the one shown: the button reads as current (`aria-current=\"true\"`)\n         * and the row takes the selected colour. Pass it on every row, `false` on the others.\n         */\n        selected?: boolean | undefined;\n        /** A ref to the row's `<button>`, to move focus to it. */\n        buttonRef?: Ref<HTMLButtonElement> | undefined;\n        /** Only with `href`. */\n        href?: never;\n        /** Only with `href`. */\n        external?: never;\n        /** Only with `href`. */\n        linkRef?: never;\n      }\n    | {\n        /** Not without `href`. Add `href` to make the whole row a link. */\n        href?: never;\n        /** Only with `href`. */\n        external?: never;\n        /** Only with `href`. */\n        linkRef?: never;\n        /** Only with `href` or `onSelect`: a row a person can choose. */\n        selected?: never;\n        /** A handler, which makes the whole row a button. */\n        onSelect?: never;\n        /** Only with `onSelect`. */\n        buttonRef?: never;\n      }\n  );\n\nconst elements = [\"div\", \"li\", \"article\"] as const;\nconst variants = { plain: \"\", outline: \"rounded-ouro-xl border border-border px-4\" } as const;\nconst sizes = { md: \"py-3\", sm: \"py-2\" } as const;\nconst mediaSizes = {\n  icon: \"size-10 rounded-ouro-lg bg-muted text-muted-foreground flex items-center justify-center *:[svg]:size-5\",\n  sm: \"size-10 rounded-ouro-md overflow-hidden *:size-full *:object-cover\",\n  md: \"size-16 rounded-ouro-lg overflow-hidden *:size-full *:object-cover\",\n  lg: \"size-28 rounded-ouro-lg overflow-hidden *:size-full *:object-cover\",\n} as const;\n// With a description, the media lines up with the title and the description's first line (24px,\n// 2px apart, 20px: 46px) instead of the whole text, so it stays level with the title when the\n// description runs longer. A 40px media sits 3px down that band, where centering put it before.\nconst mediaWithDescription = {\n  icon: \"self-start mt-0.75\",\n  sm: \"self-start mt-0.75\",\n  md: \"self-start\",\n  lg: \"self-start\",\n} as const;\n\n// Columns for each layout, and the stacked layout below a breakpoint, where the actions\n// move under the text into the title's column. Literal strings so the app's Tailwind finds them.\nconst columns = {\n  media: { actions: \"grid-cols-[auto_minmax(0,1fr)_auto]\", none: \"grid-cols-[auto_minmax(0,1fr)]\" },\n  none: { actions: \"grid-cols-[minmax(0,1fr)_auto]\", none: \"grid-cols-[minmax(0,1fr)]\" },\n} as const;\nconst stacked = {\n  media: {\n    sm: { root: \"max-sm:grid-cols-[auto_minmax(0,1fr)]\", actions: \"max-sm:col-start-2 max-sm:justify-start\" },\n    md: { root: \"max-md:grid-cols-[auto_minmax(0,1fr)]\", actions: \"max-md:col-start-2 max-md:justify-start\" },\n  },\n  none: {\n    sm: { root: \"max-sm:grid-cols-[minmax(0,1fr)]\", actions: \"max-sm:col-start-1 max-sm:justify-start\" },\n    md: { root: \"max-md:grid-cols-[minmax(0,1fr)]\", actions: \"max-md:col-start-1 max-md:justify-start\" },\n  },\n} as const;\n\n// With href, the title's link stretches over the row (`stretchedLinkClass`) and every\n// control in the row sits above it (`raiseControlsClass`), as in Card and Table.\n// A linked row is a full touch target on a coarse pointer, at either size.\nconst linkRoot =\n  \"press cursor-pointer outline-ring -outline-offset-2 has-[[data-item-link]:focus-visible]:outline-2 has-[[data-item-link]:focus-visible]:outline-solid \" +\n  \"pointer-coarse:min-h-11\";\n// A row a person chooses (onSelect, or href with selected): its own padding and corners, so the selected colour has room\n// in a group that strips them, and the selected colour when it is the one shown. Its description mixes 20% toward the\n// foreground, as muted text on a muted surface does, since the stock pair is under 4.5:1.\nconst choosableRoot = \"rounded-ouro-lg px-3\";\nconst selectedRoot = \"bg-accent text-accent-foreground [&_[data-ouro-text]]:text-[color-mix(in_oklab,var(--muted-foreground)_80%,var(--foreground))]\";\n// Forced colours drop the fills, so the layer the row's button or link stretches over the row draws its edge, and the\n// one shown a thicker Highlight edge, which keep.\nconst choosableControl =\n  \"forced-colors:after:border forced-colors:after:border-solid forced-colors:aria-[current]:after:border-2 forced-colors:aria-[current]:after:border-[Highlight]\";\n// The row's button: no box of its own, the title's type, and the stretched link's layer over the row.\nconst buttonReset = \"m-0 cursor-pointer appearance-none border-0 bg-transparent p-0 text-start font-[inherit] [font-size:inherit] [line-height:inherit]\";\n\n// With mediaAbove, below the breakpoint the media takes its own full-width row at 4:3 and\n// the columns drop the media's; `always` does so at every width.\nconst above = {\n  always: {\n    root: { actions: \"grid-cols-[minmax(0,1fr)_auto]\", none: \"grid-cols-[minmax(0,1fr)]\" },\n    media: \"col-span-full w-full h-auto aspect-[4/3] rounded-ouro-lg\",\n  },\n  sm: {\n    root: { actions: \"max-sm:grid-cols-[minmax(0,1fr)_auto]\", none: \"max-sm:grid-cols-[minmax(0,1fr)]\" },\n    media: \"max-sm:col-span-full max-sm:w-full max-sm:h-auto max-sm:aspect-[4/3] max-sm:rounded-ouro-lg\",\n  },\n  md: {\n    root: { actions: \"max-md:grid-cols-[minmax(0,1fr)_auto]\", none: \"max-md:grid-cols-[minmax(0,1fr)]\" },\n    media: \"max-md:col-span-full max-md:w-full max-md:h-auto max-md:aspect-[4/3] max-md:rounded-ouro-lg\",\n  },\n} as const;\n\n/**\n * One row of a list: leading media, a title with a description, and trailing actions.\n * With `href` the whole row is one link, named by its title, with one tab stop, and the\n * actions stay their own; with `onSelect` it is one button the same way, for a list beside\n * its detail, and `selected` marks the row shown. Put rows in an `ItemGroup`, which makes\n * them a list.\n *\n * Use `Card` instead for a larger tile with a cover image and a body, and `Row` for a\n * plain horizontal layout with no list semantics.\n *\n * @group Lists\n * @see https://ui.ouroboros.bot/docs/item\n *\n * @example\n * <Item\n *   href=\"/recipes/short-ribs\"\n *   media={<img src={photo} alt=\"\" />}\n *   mediaSize=\"md\"\n *   title=\"Braised short ribs\"\n *   description=\"Four hours, mostly hands-off\"\n * />\n * <Item title=\"Passkey on iPhone\" description=\"Added May 2\" actions={<Button variant=\"plain\">Remove</Button>} stackBelow=\"sm\" />\n * {recipes.map((recipe) => (\n *   <Item key={recipe.id} title={recipe.title} selected={recipe.id === openId} onSelect={() => setOpenId(recipe.id)} />\n * ))}\n */\nexport function Item(props: ItemProps): JSX.Element {\n  const {\n    href,\n    title,\n    external,\n    linkRef,\n    description,\n    media,\n    mediaSize: mediaSizeProp = \"sm\",\n    mediaAbove: mediaAboveProp,\n    actions,\n    stackBelow: stackBelowProp,\n    variant: variantProp = \"plain\",\n    size: sizeProp = \"md\",\n    as: asProp = \"div\",\n    className,\n    subtitle,\n    icon,\n    avatar,\n    image,\n    thumbnail,\n    action,\n    label,\n    to,\n    asChild,\n    onSelect,\n    selected,\n    buttonRef,\n    active,\n    isSelected,\n    current,\n    ...rest\n  } = props;\n  const variant = Object.hasOwn(variants, variantProp) ? (variantProp as keyof typeof variants) : \"plain\";\n  const size = Object.hasOwn(sizes, sizeProp) ? (sizeProp as keyof typeof sizes) : \"md\";\n  const mediaSize = Object.hasOwn(mediaSizes, mediaSizeProp) ? (mediaSizeProp as ItemMediaSize) : \"sm\";\n  const stackBelow: \"sm\" | \"md\" | undefined = stackBelowProp === \"sm\" ? \"sm\" : stackBelowProp === \"md\" ? \"md\" : undefined;\n  const mediaAbove = mediaAboveProp !== undefined && Object.hasOwn(above, mediaAboveProp) ? (mediaAboveProp as keyof typeof above) : undefined;\n  const element = (elements as readonly string[]).includes(asProp) ? (asProp as (typeof elements)[number]) : \"div\";\n  const linked = href !== undefined;\n  const pressable = !linked && onSelect !== undefined;\n  // A row in a list a person chooses from: a button row, or a link row told whether it is the one shown.\n  const choosable = pressable || (linked && selected !== undefined);\n  const descriptionId = `${useId()}description`;\n  useAppearanceClassNameCheck(\n    \"Item\",\n    className,\n    process.env.NODE_ENV !== \"production\"\n      ? '<Item variant=\"outline\">, or <ItemGroup variant=\"outline\"> around the rows'\n      : /* istanbul ignore next @preserve -- production only */ \"\",\n  );\n  useDevWarnings(\n    \"Item\",\n    process.env.NODE_ENV !== \"production\"\n      ? () => [\n          !title && [\"title is required; it names the row\", '<Item title=\"Braised short ribs\">'],\n          variant !== variantProp && [`variant=\"${String(variantProp)}\" is not a variant; use \"plain\", \"outline\"`, '<Item variant=\"plain\">'],\n          size !== sizeProp && [`size=\"${String(sizeProp)}\" is not a size; use \"md\", \"sm\"`, '<Item size=\"md\">'],\n          mediaSize !== mediaSizeProp && [\n            `mediaSize=\"${String(mediaSizeProp)}\" is not a media size; use \"icon\", \"sm\", \"md\", \"lg\"`,\n            '<Item mediaSize=\"lg\">',\n          ],\n          mediaAboveProp !== undefined &&\n            mediaAbove !== mediaAboveProp && [\n              `mediaAbove=\"${String(mediaAboveProp)}\" is not a breakpoint; use \"always\", \"sm\", \"md\"`,\n              '<Item mediaAbove=\"sm\">',\n            ],\n          mediaAbove !== undefined && !media && [\"mediaAbove needs media\", '<Item media={<img src=\"…\" alt=\"\" />} mediaAbove=\"sm\">'],\n          mediaAbove !== undefined &&\n            Boolean(media) &&\n            mediaSize === \"icon\" && [\n              \"mediaAbove is for a photo, not an icon\",\n              '<Item media={<img src=\"…\" alt=\"\" />} mediaSize=\"lg\" mediaAbove=\"sm\">',\n            ],\n          stackBelowProp !== undefined &&\n            stackBelow !== stackBelowProp && [`stackBelow=\"${String(stackBelowProp)}\" is not a breakpoint; use \"sm\", \"md\"`, '<Item stackBelow=\"sm\">'],\n          element !== asProp && [\n            `as=\"${String(asProp)}\" is not an element Item renders; use ${elements.map((name) => `\"${name}\"`).join(\", \")}`,\n            asProp === \"a\" ? '<Item href=\"/path\" title=\"…\">' : '<Item as=\"div\">',\n          ],\n          subtitle !== undefined && [\"subtitle is not a prop\", `<Item description=\"${String(subtitle)}\">`],\n          icon !== undefined && [\"icon is not a prop\", '<Item media={<Icon />} mediaSize=\"icon\">'],\n          avatar !== undefined && [\"avatar is not a prop\", \"<Item media={<Avatar … />}>\"],\n          image !== undefined && [\"image is not a prop\", `<Item media={<img src=\"${String(image)}\" alt=\"\" />}>`],\n          thumbnail !== undefined && [\"thumbnail is not a prop\", `<Item media={<img src=\"${String(thumbnail)}\" alt=\"\" />}>`],\n          action !== undefined && [\"action is not a prop\", \"<Item actions={<Button>…</Button>}>\"],\n          label !== undefined && [\"label is not a prop\", `<Item title=\"${String(label)}\">`],\n          to !== undefined && [\"to is not a prop\", `<Item href=\"${typeof to === \"string\" ? to : \"/path\"}\" title=\"…\">`],\n          asChild !== undefined && [\"asChild is not a prop\", '<Item href=\"/path\" title=\"…\">'],\n          selected !== undefined &&\n            !linked &&\n            !pressable && [\"selected marks a row a person chooses; give it onSelect, or href\", \"<Item selected={row.id === openId} onSelect={() => open(row.id)} title=\\\"…\\\">\"],\n          active !== undefined && [\"active is not a prop\", \"<Item selected={row.id === openId} onSelect={() => open(row.id)}>\"],\n          isSelected !== undefined && [\"isSelected is not a prop\", \"<Item selected={row.id === openId} onSelect={() => open(row.id)}>\"],\n          current !== undefined && [\"current is not a prop\", \"<Item selected={row.id === openId} onSelect={() => open(row.id)}>\"],\n        ]\n      : /* istanbul ignore next @preserve -- production only */ undefined,\n  );\n  const hasMedia = media ? \"media\" : \"none\";\n  // Media above the text at some width: its own row there, and the stacked layout below\n  // the smaller of the two breakpoints is the one without media.\n  const lifted = media && mediaAbove && mediaSize !== \"icon\" ? above[mediaAbove] : undefined;\n  const stackLayouts: { root: string; actions: string }[] = [];\n  if (stackBelow && actions) {\n    if (!lifted) stackLayouts.push(stacked[hasMedia][stackBelow]);\n    else if (mediaAbove === \"always\") stackLayouts.push(stacked.none[stackBelow]);\n    else {\n      stackLayouts.push(stacked.media[stackBelow]);\n      stackLayouts.push(stacked.none[mediaAbove === \"sm\" || stackBelow === \"sm\" ? \"sm\" : \"md\"]);\n    }\n  }\n  return createElement(\n    element,\n    {\n      ...rest,\n      \"data-ouro\": \"item\",\n      \"data-linked\": linked || pressable ? \"\" : undefined,\n      \"data-choosable\": choosable ? \"\" : undefined,\n      className: cn(\n        \"relative isolate grid min-w-0 list-none items-center gap-x-4 gap-y-2\",\n        columns[hasMedia][actions ? \"actions\" : \"none\"],\n        lifted?.root[actions ? \"actions\" : \"none\"],\n        stackLayouts.map((layout) => layout.root),\n        variants[variant],\n        sizes[size],\n        (linked || pressable) && linkRoot,\n        (linked || pressable) && raiseControlsClass,\n        choosable && variant === \"plain\" && choosableRoot,\n        choosable && selected && selectedRoot,\n        className,\n      ),\n    },\n    media && (\n      <div\n        aria-hidden={mediaSize === \"icon\" ? true : undefined}\n        className={cn(\"shrink-0\", mediaSizes[mediaSize], description && !lifted && mediaWithDescription[mediaSize], lifted?.media)}\n      >\n        {media}\n      </div>\n    ),\n    <div className=\"flex min-w-0 flex-col gap-0.5\">\n      <div className={cn(\"text-base font-medium\", choosable && selected ? \"text-accent-foreground\" : \"text-foreground\")}>\n        {pressable ? (\n          <button\n            type=\"button\"\n            ref={buttonRef}\n            onClick={onSelect}\n            aria-current={selected ? \"true\" : undefined}\n            aria-describedby={description ? descriptionId : undefined}\n            data-item-link=\"\"\n            data-stretched-link=\"\"\n            data-ouro-control=\"item\"\n            data-ouro-part=\"select\"\n            className={cn(buttonReset, stretchedLinkClass, variant === \"outline\" ? \"after:rounded-ouro-xl\" : \"after:rounded-ouro-lg\", choosableControl)}\n          >\n            {title}\n          </button>\n        ) : linked ? (\n          <RouterLink\n            href={href}\n            ref={linkRef}\n            target={external ? \"_blank\" : undefined}\n            rel={external ? safeRel(undefined) : undefined}\n            aria-current={selected ? \"page\" : undefined}\n            aria-describedby={description ? descriptionId : undefined}\n            data-item-link=\"\"\n            data-stretched-link=\"\"\n            data-ouro-control=\"item\"\n            data-ouro-part=\"link\"\n            className={cn(stretchedLinkClass, variant === \"outline\" ? \"after:rounded-ouro-xl\" : choosable && \"after:rounded-ouro-lg\", choosable && choosableControl)}\n          >\n            {title}\n            {external && <span className=\"sr-only\"> (opens in a new tab)</span>}\n          </RouterLink>\n        ) : (\n          title\n        )}\n      </div>\n      {description && (\n        <div id={linked || pressable ? descriptionId : undefined} data-ouro-text=\"\" className=\"text-sm text-muted-foreground\">\n          {description}\n        </div>\n      )}\n    </div>,\n    actions && <div className={cn(\"flex flex-wrap items-center justify-end gap-2\", stackLayouts.map((layout) => layout.actions))}>{actions}</div>,\n  );\n}\n",
      "type": "registry:ui",
      "target": "@components/ouro/item/item.tsx"
    }
  ],
  "docs": "One row of a list: leading media, a title with a description, and trailing actions. Import: import { Item } from \"@/components/ouro/item/item\", with @/components replaced by your components alias (aliases.components in components.json, such as ~/components). Also installed: the helpers it imports in lib/ouro. Needs ouro-base in your stylesheet: add that item once per app, from the same place as this one, if you have not. Docs: https://ui.ouroboros.bot/docs/item.md Ouro UI v1.3.257.",
  "type": "registry:ui"
}