{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "action-tile",
  "type": "registry:ui",
  "title": "ActionTile",
  "description": "ActionTile is a tile-shaped entry point to an action or a destination: an entity badge, a title and description, and a trailing arrow.",
  "dependencies": [
    "@radix-ui/react-slot@^1.2.4",
    "@remixicon/react@^4.9.0",
    "class-variance-authority@^0.7.1"
  ],
  "registryDependencies": [
    "https://wideset.co/r/motion.json",
    "https://wideset.co/r/styles.json",
    "https://wideset.co/r/utils.json"
  ],
  "files": [
    {
      "path": "src/components/action-tile/ActionTile.tsx",
      "type": "registry:ui",
      "target": "components/ui/wideset/action-tile/ActionTile.tsx",
      "content": "'use client';\n\nimport { Slot } from '@radix-ui/react-slot';\nimport type * as React from 'react';\nimport { cn } from '@/lib/wideset/utils';\n\nimport { useDefaultMotion } from '@/lib/wideset/motion/MotionProvider';\nimport type { ActionTileProps } from './ActionTile.types';\nimport { actionTileMotionVariants, actionTileVariants } from './ActionTile.variants';\nimport { ActionTileDescription } from './ActionTileDescription';\nimport { ActionTileEntity } from './ActionTileEntity';\nimport { ActionTileIcon } from './ActionTileIcon';\nimport { ActionTileTitle } from './ActionTileTitle';\n\n/**\n * A tile that performs an action or navigates. The element follows the props:\n * `href` renders a real `<a>`, `onClick` / `type` / `asChild` a real `<button>`\n * (or your element), and none of those a plain `div`, so a decorative tile is\n * not a dead tab stop. Enter/Space, `disabled` and link affordances come from\n * the platform, not from a key handler.\n *\n * The whole tile is the control; the trailing arrow is decoration, not a nested\n * button. It is hidden when disabled, matching Figma.\n */\nconst ActionTile = ({\n  asChild,\n  className,\n  children,\n  variant,\n  title,\n  description,\n  entity,\n  icon,\n  disabled,\n  href,\n  onClick,\n  type,\n  defaultMotion,\n  ref,\n  ...props\n}: ActionTileProps) => {\n  // `type` alone must select a button: form submit/reset tiles often have no\n  // onClick, and must still participate as a native <button type=\"submit\">.\n  const isInteractive = !!href || !!onClick || !!asChild || type !== undefined;\n  const motion = useDefaultMotion(defaultMotion);\n\n  // Widened because a polymorphic root cannot satisfy <a>, <button> and <div>\n  // prop types at once; `ActionTileProps` still constrains the public surface.\n  const Comp: React.ElementType = asChild ? Slot : href ? 'a' : isInteractive ? 'button' : 'div';\n  const isButton = Comp === 'button';\n\n  // Only <button> has a native `disabled`. An <a>, a Slot child or a div has\n  // nothing to disable, so the state is carried by `aria-disabled`, the element\n  // leaves the tab order, and the click (and a link's navigation) is blocked.\n  const handleClick = (event: React.MouseEvent<HTMLElement>) => {\n    if (disabled) {\n      event.preventDefault();\n      return;\n    }\n    (onClick as React.MouseEventHandler<HTMLElement> | undefined)?.(event);\n  };\n\n  const interactionProps = isButton\n    ? { disabled, type: type ?? 'button', onClick }\n    : {\n        'aria-disabled': disabled || undefined,\n        tabIndex: disabled ? -1 : undefined,\n        onClick: isInteractive ? handleClick : undefined,\n        href: href && !disabled ? href : undefined,\n      };\n\n  return (\n    <Comp\n      ref={ref}\n      className={cn(\n        actionTileVariants({ variant, disabled, isInteractive }),\n        actionTileMotionVariants({ enabled: motion, isInteractive }),\n        className,\n      )}\n      data-slot=\"action-tile\"\n      {...props}\n      {...interactionProps}\n    >\n      {asChild ? (\n        children\n      ) : (\n        <>\n          {entity && <ActionTileEntity icon={entity} />}\n          {(title || description) && (\n            <div className=\"gap-ws-3 flex flex-1 flex-col\">\n              {title && <ActionTileTitle>{title}</ActionTileTitle>}\n              {description && <ActionTileDescription>{description}</ActionTileDescription>}\n            </div>\n          )}\n          {icon && !disabled && <ActionTileIcon className=\"ml-auto\" icon={icon} />}\n          {children}\n        </>\n      )}\n    </Comp>\n  );\n};\n\nActionTile.displayName = 'ActionTile';\nActionTile.Title = ActionTileTitle;\nActionTile.Description = ActionTileDescription;\nActionTile.Entity = ActionTileEntity;\nActionTile.Icon = ActionTileIcon;\n\nexport { ActionTile };\n"
    },
    {
      "path": "src/components/action-tile/ActionTile.types.ts",
      "type": "registry:ui",
      "target": "components/ui/wideset/action-tile/ActionTile.types.ts",
      "content": "import type { RemixiconComponentType } from '@remixicon/react';\nimport type { VariantProps } from 'class-variance-authority';\n\nimport type { MotionProps } from '@/lib/wideset/motion/Motion.types';\nimport type { actionTileVariants } from './ActionTile.variants';\n\n/** Shared content and behavior options. */\ntype ActionTileSharedProps = {\n  /** Additional CSS classes merged with the rendered element. */\n  className?: string;\n  /** Renders the tile styling onto the child element via Radix Slot (e.g. a router `<Link>`). */\n  asChild?: boolean;\n  /** The title text of the tile. */\n  title?: string;\n  /** The description text of the tile. */\n  description?: string;\n  /** Leading entity badge icon. */\n  entity?: RemixiconComponentType;\n  /** Trailing arrow. Decorative: the whole tile is the control. Hidden when disabled. */\n  icon?: RemixiconComponentType;\n  /** Disables the tile. Native `disabled` on `<button>`, `aria-disabled` otherwise. */\n  disabled?: boolean;\n  /** Ref to the rendered element. */\n  ref?: React.Ref<HTMLElement>;\n} & MotionProps &\n  Omit<VariantProps<typeof actionTileVariants>, 'isInteractive'>;\n\n/**\n * Button path: no `href`. Renders a `<button>` when given `onClick`, `type` or\n * `asChild`, and a plain `div` when given none of those.\n */\ntype ActionTileAsButtonProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'type'> &\n  ActionTileSharedProps & {\n    href?: never;\n    /**\n     * Native button type used for form behavior. Setting `type` alone renders a\n     * `<button>`, so `type=\"submit\"` works without an `onClick`.\n     */\n    type?: 'button' | 'submit' | 'reset';\n  };\n\n/**\n * Link path: `href` is required. Renders an `<a>`; native anchor attributes\n * (`target`, `rel`, `download`, …) are accepted, button `type` is not.\n */\ntype ActionTileAsLinkProps = Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'type'> &\n  ActionTileSharedProps & {\n    /** Renders an `<a>` instead of a `<button>` and navigates on activation. */\n    href: string;\n    type?: never;\n  };\n\n/** A tile that performs an action or links to a destination. */\nexport type ActionTileProps = ActionTileAsButtonProps | ActionTileAsLinkProps;\n\n/** The primary title text. */\nexport type TitleProps = React.HTMLAttributes<HTMLParagraphElement> & {\n  /** Ref to the rendered element. */\n  ref?: React.Ref<HTMLParagraphElement>;\n};\n\n/** Supporting descriptive text. */\nexport type DescriptionProps = React.HTMLAttributes<HTMLParagraphElement> & {\n  /** Ref to the rendered element. */\n  ref?: React.Ref<HTMLParagraphElement>;\n};\n\n// Both render a `div` wrapper around the icon, so the spread props are div\n// attributes.\n/** The square icon badge rendered by `ActionTile.Entity`. */\nexport type EntityProps = React.HTMLAttributes<HTMLDivElement> & {\n  /** Icon component from `@remixicon/react`. */\n  icon: RemixiconComponentType;\n};\n\n/** An icon rendered within `ActionTile`. */\nexport type IconProps = React.HTMLAttributes<HTMLDivElement> & {\n  /** Icon component from `@remixicon/react`. */\n  icon: RemixiconComponentType;\n};\n"
    },
    {
      "path": "src/components/action-tile/ActionTile.variants.ts",
      "type": "registry:ui",
      "target": "components/ui/wideset/action-tile/ActionTile.variants.ts",
      "content": "import { cva } from 'class-variance-authority';\n\nimport { hoverTintMotion, pressMotion } from '@/lib/wideset/motion/recipes';\n\nexport const actionTileVariants = cva(\n  `rounded-ws-container-md focus-visible:outline-ws-dynamic-primary-strong-default focus-visible:wds-focus-visible min-h-ws-20 gap-ws-7 px-ws-9 py-ws-7 flex w-full items-center text-left`,\n  {\n    variants: {\n      variant: {\n        border:\n          'bg-ws-static-highlight-base inset-ring inset-ring-[var(--ws-dynamic-stroke-secondary-default)] group-[.is-disabled]:inset-ring-[var(--ws-dynamic-stroke-secondary-disabled)] hover:inset-ring-[var(--ws-dynamic-stroke-secondary-hover)] active:inset-ring-[var(--ws-dynamic-stroke-secondary-pressed)]',\n        filled:\n          'bg-ws-dynamic-tertiary-alpha-strong-default active:bg-ws-dynamic-tertiary-alpha-strong-pressed hover:bg-ws-dynamic-tertiary-alpha-strong-hover group-[.is-disabled]:bg-ws-static-alpha-subtle',\n      },\n      disabled: {\n        true: 'is-disabled group pointer-events-none',\n      },\n      // A decorative tile (no href, onClick, asChild, or type) keeps the visuals\n      // and drops the pointer affordance — it is not a control.\n      isInteractive: {\n        true: 'cursor-pointer',\n        false: '',\n      },\n    },\n    compoundVariants: [\n      {\n        disabled: true,\n        isInteractive: true,\n        className: 'cursor-default',\n      },\n    ],\n    defaultVariants: {\n      variant: 'border',\n      disabled: false,\n      isInteractive: false,\n    },\n  },\n);\n\nexport const actionTileMotionVariants = cva('', {\n  variants: {\n    enabled: { true: hoverTintMotion, false: '' },\n    isInteractive: { true: '', false: '' },\n  },\n  compoundVariants: [{ enabled: true, isInteractive: true, className: pressMotion }],\n  defaultVariants: { enabled: true, isInteractive: false },\n});\n"
    },
    {
      "path": "src/components/action-tile/ActionTileDescription.tsx",
      "type": "registry:ui",
      "target": "components/ui/wideset/action-tile/ActionTileDescription.tsx",
      "content": "'use client';\n\nimport * as React from 'react';\nimport { cn } from '@/lib/wideset/utils';\n\nimport type { DescriptionProps } from './ActionTile.types';\n\nconst ActionTileDescription = React.forwardRef<HTMLParagraphElement, DescriptionProps>(\n  ({ children, className, ...props }, ref) => (\n    <p\n      ref={ref}\n      data-slot=\"action-tile-description\"\n      {...props}\n      className={cn('typography-body-sm text-ws-static-subtle', className)}\n    >\n      {children}\n    </p>\n  ),\n);\n\nActionTileDescription.displayName = 'ActionTile.Description';\n\nexport { ActionTileDescription };\n"
    },
    {
      "path": "src/components/action-tile/ActionTileEntity.tsx",
      "type": "registry:ui",
      "target": "components/ui/wideset/action-tile/ActionTileEntity.tsx",
      "content": "'use client';\n\nimport * as React from 'react';\nimport { cn } from '@/lib/wideset/utils';\n\nimport type { EntityProps } from './ActionTile.types';\n\nconst ActionTileEntity = React.forwardRef<HTMLDivElement, EntityProps>(\n  ({ className, icon: Icon, ...props }, ref) => (\n    <div\n      ref={ref}\n      className={cn(\n        'rounded-ws-control-lg bg-ws-non-semantic-purple-strong size-ws-14 flex items-center justify-center',\n        className,\n      )}\n      data-slot=\"action-tile-entity\"\n      {...props}\n    >\n      <Icon\n        aria-hidden=\"true\"\n        focusable=\"false\"\n        className=\"text-ws-non-semantic-purple-on-strong size-ws-11\"\n      />\n    </div>\n  ),\n);\n\nActionTileEntity.displayName = 'ActionTile.Entity';\n\nexport { ActionTileEntity };\n"
    },
    {
      "path": "src/components/action-tile/ActionTileIcon.tsx",
      "type": "registry:ui",
      "target": "components/ui/wideset/action-tile/ActionTileIcon.tsx",
      "content": "'use client';\n\nimport * as React from 'react';\nimport { cn } from '@/lib/wideset/utils';\n\nimport type { IconProps } from './ActionTile.types';\n\nconst ActionTileIcon = React.forwardRef<HTMLDivElement, IconProps>(\n  ({ className, icon: Icon, ...props }, ref) => (\n    <div\n      ref={ref}\n      className={cn('size-ws-14 flex items-center justify-center', className)}\n      data-slot=\"action-tile-icon\"\n      {...props}\n    >\n      <Icon\n        aria-hidden=\"true\"\n        focusable=\"false\"\n        className=\"text-ws-dynamic-secondary-default size-ws-9\"\n      />\n    </div>\n  ),\n);\n\nActionTileIcon.displayName = 'ActionTile.Icon';\n\nexport { ActionTileIcon };\n"
    },
    {
      "path": "src/components/action-tile/ActionTileTitle.tsx",
      "type": "registry:ui",
      "target": "components/ui/wideset/action-tile/ActionTileTitle.tsx",
      "content": "'use client';\n\nimport * as React from 'react';\nimport { cn } from '@/lib/wideset/utils';\n\nimport type { TitleProps } from './ActionTile.types';\n\nconst ActionTileTitle = React.forwardRef<HTMLParagraphElement, TitleProps>(\n  ({ children, className, ...props }, ref) => (\n    <p\n      ref={ref}\n      data-slot=\"action-tile-title\"\n      {...props}\n      className={cn(\n        'text-ws-static-strong typography-label-strong-sm group-[.is-disabled]:text-ws-static-subtle',\n        className,\n      )}\n    >\n      {children}\n    </p>\n  ),\n);\n\nActionTileTitle.displayName = 'ActionTile.Title';\n\nexport { ActionTileTitle };\n"
    }
  ],
  "meta": {
    "version": "1.0.0",
    "commit": "8bb3627"
  }
}
