{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "tile",
  "type": "registry:ui",
  "title": "Tile",
  "description": "Tile groups related information in a bordered container.",
  "dependencies": [
    "@radix-ui/react-checkbox@^1.3.3",
    "@radix-ui/react-radio-group@^1.3.8",
    "@radix-ui/react-slot@^1.2.4",
    "@remixicon/react@^4.9.0",
    "class-variance-authority@^0.7.1"
  ],
  "registryDependencies": [
    "https://wideset.co/r/field-label.json",
    "https://wideset.co/r/styles.json",
    "https://wideset.co/r/utils.json"
  ],
  "files": [
    {
      "path": "src/components/tile/Tile.tsx",
      "type": "registry:ui",
      "target": "components/ui/wideset/tile/Tile.tsx",
      "content": "'use client';\n\nimport { Slot } from '@radix-ui/react-slot';\nimport { cn } from '@/lib/wideset/utils';\n\nimport type { TileProps, TileWithSubComponents } from './Tile.types';\nimport { tileVariants } from './Tile.variants';\nimport { TileBody } from './TileBody';\nimport { TileCheckbox } from './TileCheckbox';\nimport { TileDescription } from './TileDescription';\nimport { TileIcon } from './TileIcon';\nimport { TileIndicator } from './TileIndicator';\nimport { TileRadio } from './TileRadio';\nimport { TileRadioGroup } from './TileRadioGroup';\nimport { TileTitle } from './TileTitle';\n\n/**\n * A container for grouped information. Static: it renders a plain `div` and\n * carries no role, no tab stop, no key handling and no selection state.\n *\n * Pick the component that matches what the tile *is*:\n *\n * - `Tile`: static content\n * - `Tile.Checkbox`: multiple selection (`role=\"checkbox\"`)\n * - `Tile.Radio` in `Tile.RadioGroup`: single selection (`role=\"radio\"`)\n * - `ActionTile`: an action or a link (`<button>` / `<a>`)\n */\nconst Tile = ({\n  asChild,\n  className,\n  children,\n  description,\n  icon,\n  title,\n  ref,\n  ...props\n}: TileProps) => {\n  const Comp = asChild ? Slot : 'div';\n\n  return (\n    <Comp ref={ref} data-slot=\"tile\" className={cn(tileVariants(), className)} {...props}>\n      {asChild ? (\n        children\n      ) : (\n        <TileBody description={description} icon={icon} title={title}>\n          {children}\n        </TileBody>\n      )}\n    </Comp>\n  );\n};\n\nTile.displayName = 'Tile';\n\nTile.Checkbox = TileCheckbox;\nTile.Description = TileDescription;\nTile.Icon = TileIcon;\nTile.Indicator = TileIndicator;\nTile.Radio = TileRadio;\nTile.RadioGroup = TileRadioGroup;\nTile.Title = TileTitle;\n\nexport { Tile };\nexport type { TileWithSubComponents };\n"
    },
    {
      "path": "src/components/tile/Tile.types.ts",
      "type": "registry:ui",
      "target": "components/ui/wideset/tile/Tile.types.ts",
      "content": "import type * as CheckboxPrimitive from '@radix-ui/react-checkbox';\nimport type * as RadioGroupPrimitive from '@radix-ui/react-radio-group';\nimport type { RemixiconComponentType } from '@remixicon/react';\n\nimport type { TileCheckbox } from './TileCheckbox';\nimport type { TileDescription } from './TileDescription';\nimport type { TileIcon } from './TileIcon';\nimport type { TileIndicator } from './TileIndicator';\nimport type { TileRadio } from './TileRadio';\nimport type { TileRadioGroup } from './TileRadioGroup';\nimport type { TileTitle } from './TileTitle';\n\n/** The icon/title/description content shared by every tile flavour. */\nexport type TileBodyProps = {\n  /** Leading icon rendered beside the text column. */\n  icon?: RemixiconComponentType;\n  /** The title text of the tile. */\n  title?: string;\n  /** The description text of the tile. */\n  description?: string;\n  /** Content rendered inside the component. */\n  children?: React.ReactNode;\n};\n\n/**\n * Static tile. Presentational only: no role, no tab stop, no selection state.\n * Use `Tile.Checkbox` / `Tile.Radio` for selection and `ActionTile` for an\n * action or a link.\n */\nexport type TileProps = React.HTMLAttributes<HTMLDivElement> &\n  TileBodyProps & {\n    /** Additional CSS classes merged with the rendered element. */\n    className?: string;\n    /**\n     * Renders the tile styling onto the child element via Radix Slot, for the\n     * rare case where you own the element (a `<li>`, a `<label>`, ...).\n     */\n    asChild?: boolean;\n    /** Ref to the rendered element. */\n    ref?: React.Ref<HTMLDivElement>;\n  };\n\n/** A selectable tile allowing independent selection. */\nexport type TileCheckboxProps = Omit<\n  React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>,\n  'children' | 'asChild'\n> &\n  TileBodyProps & {\n    /** Additional CSS classes merged with the rendered element. */\n    className?: string;\n  };\n\n/** A selectable tile belonging to a radio group. */\nexport type TileRadioProps = Omit<\n  React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>,\n  'children' | 'asChild'\n> &\n  TileBodyProps & {\n    /** Additional CSS classes merged with the rendered element. */\n    className?: string;\n  };\n\n/** A group of mutually exclusive radio options. */\nexport type TileRadioGroupProps = React.ComponentPropsWithoutRef<\n  typeof RadioGroupPrimitive.Root\n> & {\n  /** Additional CSS classes merged with the rendered element. */\n  className?: string;\n  /**\n   * Accessible name for the group, rendered as a `FieldLabel` and wired with\n   * `aria-labelledby`. Without it a screen reader announces only \"radio group\".\n   * An explicit `aria-label` / `aria-labelledby` takes precedence.\n   */\n  label?: React.ReactNode;\n};\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/** An icon rendered within `Tile`. */\nexport type IconProps = React.HTMLAttributes<HTMLDivElement> & {\n  /** Icon component from `@remixicon/react`. */\n  icon: RemixiconComponentType;\n  /** Ref to the rendered element. */\n  ref?: React.Ref<HTMLDivElement>;\n};\n\n/** A decorative selected-state indicator. */\nexport type IndicatorProps = React.HTMLAttributes<HTMLDivElement>;\n\nexport type TileWithSubComponents = ((props: TileProps) => React.ReactElement | null) & {\n  displayName?: string;\n  Checkbox: typeof TileCheckbox;\n  Description: typeof TileDescription;\n  Icon: typeof TileIcon;\n  Indicator: typeof TileIndicator;\n  Radio: typeof TileRadio;\n  RadioGroup: typeof TileRadioGroup;\n  Title: typeof TileTitle;\n};\n"
    },
    {
      "path": "src/components/tile/Tile.variants.ts",
      "type": "registry:ui",
      "target": "components/ui/wideset/tile/Tile.variants.ts",
      "content": "import { cva } from 'class-variance-authority';\nimport { cn } from '@/lib/wideset/utils';\n\n/**\n * Figma draws the tile outline *inside* the 64px frame, so a CSS `border` would\n * add 2px to the auto height and push content to 13/17px from the edge. The\n * outline is an inset ring instead, which lands the frame at exactly 64px with\n * content 12/16px from the edge.\n *\n * Ring colours go through `inset-ring-[var(--dynamic-stroke-*)]` rather than\n * `border-*` classes because the generated semantic CSS has no `--ring-color-*`\n * namespace. Adding one belongs in the token pipeline, not here.\n */\nconst TILE_BASE = cn(\n  'group bg-ws-static-highlight-base rounded-ws-container-md min-h-ws-20 gap-ws-5 px-ws-9 py-ws-7 flex items-center inset-ring',\n);\n\n/** Static tile: a plain container with the default outline and no interaction states. */\nexport const tileVariants = cva(\n  cn(TILE_BASE, 'inset-ring-[var(--ws-dynamic-stroke-secondary-default)]'),\n);\n\n/**\n * `Tile.Checkbox` and `Tile.Radio` are rooted on a Radix primitive, so selection\n * state arrives as `data-state` rather than as a prop. Every state pairs the\n * checked/unchecked variant with `disabled:` explicitly, the way\n * `Checkbox.variants.ts` does: Tailwind orders variants by its own rules, not by\n * class-string order, so `disabled:` and `radix-state-checked:` would otherwise\n * race and the winner would depend on the generated CSS order.\n */\nexport const selectableTileVariants = cva(\n  cn(\n    TILE_BASE,\n    'focus-visible:outline-ws-dynamic-primary-strong-default focus-visible:wds-focus-visible',\n    'w-full cursor-pointer text-left',\n    // unselected\n    'radix-state-unchecked:inset-ring-[var(--ws-dynamic-stroke-secondary-default)]',\n    'radix-state-unchecked:hover:inset-ring-[var(--ws-dynamic-stroke-secondary-hover)]',\n    'radix-state-unchecked:active:inset-ring-[var(--ws-dynamic-stroke-secondary-pressed)]',\n    // selected\n    'radix-state-checked:bg-ws-static-highlight-strong',\n    'radix-state-checked:outline-ws-dynamic-primary-default/20 radix-state-checked:outline-2',\n    'radix-state-checked:inset-ring-[var(--ws-dynamic-stroke-primary-strong-default)]',\n    'radix-state-checked:hover:inset-ring-[var(--ws-dynamic-stroke-primary-strong-hover)]',\n    'radix-state-checked:active:inset-ring-[var(--ws-dynamic-stroke-primary-strong-pressed)]',\n    // disabled, paired with both selection states so neither can win on CSS order\n    'disabled:is-disabled disabled:pointer-events-none disabled:cursor-default',\n    'radix-state-unchecked:disabled:inset-ring-[var(--ws-dynamic-stroke-secondary-disabled)]',\n    'radix-state-checked:disabled:bg-ws-static-highlight-base',\n    'radix-state-checked:disabled:outline-0',\n    'radix-state-checked:disabled:inset-ring-[var(--ws-dynamic-stroke-secondary-disabled)]',\n  ),\n);\n\n/**\n * The switch visual inside a selectable tile, as a non-interactive copy.\n *\n * It cannot be the real `Switch`: that renders a `<button>`, and the tile root\n * is already a `<button role=\"checkbox\">`. A button inside a button is invalid\n * HTML and an axe `nested-interactive` failure. Mantine draws the same\n * distinction with `Checkbox.Indicator`: it looks like the control and\n * deliberately is not one.\n *\n * State comes from the tile root's `data-state` via `group-radix-state-checked:`,\n * so the classes parallel `switchVariants` rather than reusing it, because those\n * key off `data-state` on the switch itself.\n */\nexport const tileIndicatorTrackVariants = cva(\n  cn(\n    'relative shrink-0 rounded-full transition-colors',\n    'h-ws-control-md w-ws-control-xxl',\n    'bg-ws-dynamic-secondary-alpha-strong-default',\n    'group-radix-state-checked:bg-ws-dynamic-primary-default',\n    'group-disabled:bg-ws-dynamic-secondary-disabled',\n    'group-radix-state-checked:group-disabled:bg-ws-dynamic-primary-disabled',\n  ),\n);\n\nexport const tileIndicatorThumbVariants = cva(\n  cn(\n    'absolute top-1/2 left-0 shrink-0 -translate-y-1/2 transform rounded-full transition-transform',\n    'h-ws-control-sm w-ws-control-sm',\n    'shadow-ws-medium bg-(--ws-dynamic-text-on-primary-default)',\n    'translate-x-(--spacing-ws-2)',\n    'group-radix-state-checked:translate-x-[calc(100%-var(--spacing-ws-2))]',\n    'group-disabled:bg-(--ws-dynamic-text-on-primary-disabled) group-disabled:shadow-none',\n  ),\n);\n"
    },
    {
      "path": "src/components/tile/TileBody.tsx",
      "type": "registry:ui",
      "target": "components/ui/wideset/tile/TileBody.tsx",
      "content": "'use client';\n\nimport type { TileBodyProps } from './Tile.types';\nimport { TileDescription } from './TileDescription';\nimport { TileIcon } from './TileIcon';\nimport { TileTitle } from './TileTitle';\n\n/**\n * The shared inner layout of every tile flavour: an optional icon beside a\n * title/description column, wrapped in the content group Figma nests inside the\n * tile frame (`Gap/3` icon-to-text, `Gap/5` from the group to a trailing slot).\n * Internal: consumers get it implicitly via the `icon`/`title`/`description`\n * props, or compose it themselves with `Tile.Icon` / `Tile.Title`.\n */\nconst TileBody = ({ icon, title, description, children }: TileBodyProps) => (\n  <>\n    {(icon || title || description) && (\n      <div data-slot=\"tile-body\" className=\"gap-ws-3 flex flex-1 items-start\">\n        {icon && <TileIcon icon={icon} />}\n        {(title || description) && (\n          <div className=\"gap-ws-3 flex flex-1 flex-col\">\n            {title && <TileTitle>{title}</TileTitle>}\n            {description && <TileDescription>{description}</TileDescription>}\n          </div>\n        )}\n      </div>\n    )}\n    {children}\n  </>\n);\n\nTileBody.displayName = 'Tile.Body';\n\nexport { TileBody };\n"
    },
    {
      "path": "src/components/tile/TileCheckbox.tsx",
      "type": "registry:ui",
      "target": "components/ui/wideset/tile/TileCheckbox.tsx",
      "content": "'use client';\n\nimport * as CheckboxPrimitive from '@radix-ui/react-checkbox';\nimport * as React from 'react';\nimport { cn } from '@/lib/wideset/utils';\n\nimport type { TileCheckboxProps } from './Tile.types';\nimport { selectableTileVariants } from './Tile.variants';\nimport { TileBody } from './TileBody';\n\n/**\n * A tile used for multiple selection: the whole tile is the checkbox.\n *\n * Rooted on Radix's checkbox primitive, so the root carries `role=\"checkbox\"`\n * and `aria-checked`, and Space toggles it, all without a key handler. That is\n * the contract screen readers expect here; `role=\"button\"` + `aria-pressed`\n * would announce a toggle button instead.\n *\n * Put a `Tile.Indicator` inside for the visual, never a real `Switch` or\n * `Checkbox`, which would nest one control inside another.\n */\nconst TileCheckbox = React.forwardRef<\n  React.ComponentRef<typeof CheckboxPrimitive.Root>,\n  TileCheckboxProps\n>(({ className, children, description, icon, title, ...props }, ref) => (\n  <CheckboxPrimitive.Root\n    ref={ref}\n    data-slot=\"tile-checkbox\"\n    className={cn(selectableTileVariants(), className)}\n    {...props}\n  >\n    <TileBody description={description} icon={icon} title={title}>\n      {children}\n    </TileBody>\n  </CheckboxPrimitive.Root>\n));\n\nTileCheckbox.displayName = 'Tile.Checkbox';\n\nexport { TileCheckbox };\n"
    },
    {
      "path": "src/components/tile/TileDescription.tsx",
      "type": "registry:ui",
      "target": "components/ui/wideset/tile/TileDescription.tsx",
      "content": "'use client';\n\nimport * as React from 'react';\nimport { cn } from '@/lib/wideset/utils';\n\nimport type { DescriptionProps } from './Tile.types';\n\nconst TileDescription = React.forwardRef<HTMLParagraphElement, DescriptionProps>(\n  ({ children, className, ...props }, ref) => (\n    <p\n      ref={ref}\n      data-slot=\"tile-description\"\n      {...props}\n      className={cn('typography-body-sm text-ws-static-subtle', className)}\n    >\n      {children}\n    </p>\n  ),\n);\n\nTileDescription.displayName = 'Tile.Description';\n\nexport { TileDescription };\n"
    },
    {
      "path": "src/components/tile/TileIcon.tsx",
      "type": "registry:ui",
      "target": "components/ui/wideset/tile/TileIcon.tsx",
      "content": "'use client';\n\nimport * as React from 'react';\nimport { cn } from '@/lib/wideset/utils';\n\nimport type { IconProps } from './Tile.types';\n\nconst TileIcon = React.forwardRef<HTMLDivElement, IconProps>(\n  ({ className, icon: Icon, ...props }, ref) => (\n    <div\n      ref={ref}\n      className={cn('size-ws-11 flex items-center justify-center', className)}\n      data-slot=\"tile-icon\"\n      {...props}\n    >\n      <Icon\n        aria-hidden=\"true\"\n        focusable=\"false\"\n        className=\"text-ws-static-strong group-[.is-disabled]:text-ws-static-subtle size-ws-9\"\n      />\n    </div>\n  ),\n);\n\nTileIcon.displayName = 'Tile.Icon';\n\nexport { TileIcon };\n"
    },
    {
      "path": "src/components/tile/TileIndicator.tsx",
      "type": "registry:ui",
      "target": "components/ui/wideset/tile/TileIndicator.tsx",
      "content": "'use client';\n\nimport * as React from 'react';\nimport { cn } from '@/lib/wideset/utils';\n\nimport type { IndicatorProps } from './Tile.types';\nimport { tileIndicatorThumbVariants, tileIndicatorTrackVariants } from './Tile.variants';\n\n/**\n * A non-interactive switch visual that reflects the owning tile's selection\n * state. Use it inside `Tile.Checkbox` or `Tile.Radio`, where the whole tile is\n * the control.\n *\n * It is deliberately not the `Switch` component: `Switch` renders a `<button>`,\n * the tile root already is one, and a button inside a button is invalid HTML plus\n * an axe `nested-interactive` failure. This is the same split Mantine makes with\n * `Checkbox.Indicator`: it looks like the control and is not one. It is\n * `aria-hidden` because the tile already announces its own checked state.\n */\nconst TileIndicator = React.forwardRef<HTMLDivElement, IndicatorProps>(\n  ({ className, ...props }, ref) => (\n    <div\n      ref={ref}\n      aria-hidden=\"true\"\n      className={cn(tileIndicatorTrackVariants(), className)}\n      data-slot=\"tile-indicator\"\n      {...props}\n    >\n      <span className={tileIndicatorThumbVariants()} />\n    </div>\n  ),\n);\n\nTileIndicator.displayName = 'Tile.Indicator';\n\nexport { TileIndicator };\n"
    },
    {
      "path": "src/components/tile/TileRadio.tsx",
      "type": "registry:ui",
      "target": "components/ui/wideset/tile/TileRadio.tsx",
      "content": "'use client';\n\nimport * as RadioGroupPrimitive from '@radix-ui/react-radio-group';\nimport * as React from 'react';\nimport { cn } from '@/lib/wideset/utils';\n\nimport type { TileRadioProps } from './Tile.types';\nimport { selectableTileVariants } from './Tile.variants';\nimport { TileBody } from './TileBody';\n\n/**\n * One option of a single-select tile group. Must sit inside a\n * `Tile.RadioGroup`.\n *\n * Rooted on Radix's radio item, so the root carries `role=\"radio\"` and\n * `aria-checked`, and the group handles arrow-key navigation and roving\n * tabindex, so the group is one tab stop, not one per tile. None of that is\n * expressible with `role=\"button\"`.\n */\nconst TileRadio = React.forwardRef<\n  React.ComponentRef<typeof RadioGroupPrimitive.Item>,\n  TileRadioProps\n>(({ className, children, description, icon, title, ...props }, ref) => (\n  <RadioGroupPrimitive.Item\n    ref={ref}\n    className={cn(selectableTileVariants(), className)}\n    data-slot=\"tile-radio\"\n    {...props}\n  >\n    <TileBody description={description} icon={icon} title={title}>\n      {children}\n    </TileBody>\n  </RadioGroupPrimitive.Item>\n));\n\nTileRadio.displayName = 'Tile.Radio';\n\nexport { TileRadio };\n"
    },
    {
      "path": "src/components/tile/TileRadioGroup.tsx",
      "type": "registry:ui",
      "target": "components/ui/wideset/tile/TileRadioGroup.tsx",
      "content": "'use client';\n\nimport * as RadioGroupPrimitive from '@radix-ui/react-radio-group';\nimport * as React from 'react';\nimport { cn } from '@/lib/wideset/utils';\n\nimport { FieldLabel } from '../field-label/FieldLabel';\nimport type { TileRadioGroupProps } from './Tile.types';\n\n/**\n * Owns single selection across a set of `Tile.Radio` children: renders\n * `role=\"radiogroup\"` and supplies arrow-key navigation, roving tabindex and\n * form `name`.\n *\n * Pass `label` to give the group an accessible name. Without one a screen\n * reader announces \"radio group\" and nothing else. Carbon's `TileGroup` gets\n * this from `<fieldset><legend>`; here the label is wired with\n * `aria-labelledby`, which names the `radiogroup` element itself rather than an\n * outer `fieldset` whose role has been overridden.\n *\n * Otherwise mirrors `RadioButton.Group`'s contract (`value`, `onValueChange`,\n * `name`, `orientation`, `required`) so the two are interchangeable in a form.\n */\nconst TileRadioGroup = React.forwardRef<\n  React.ComponentRef<typeof RadioGroupPrimitive.Root>,\n  TileRadioGroupProps\n>(({ className, label, orientation = 'vertical', required, ...props }, ref) => {\n  const labelId = React.useId();\n  // An explicit aria-label / aria-labelledby from the consumer wins over `label`.\n  const isLabelled = !!props['aria-label'] || !!props['aria-labelledby'];\n\n  const group = (\n    <RadioGroupPrimitive.Root\n      ref={ref}\n      orientation={orientation}\n      required={required}\n      aria-labelledby={label && !isLabelled ? labelId : undefined}\n      className={cn('gap-ws-5 flex', orientation === 'vertical' && 'flex-col', className)}\n      data-slot=\"tile-radio-group\"\n      {...props}\n    />\n  );\n\n  if (!label) return group;\n\n  return (\n    <div className=\"gap-ws-5 flex flex-col\">\n      <FieldLabel id={labelId} required={required}>\n        {label}\n      </FieldLabel>\n      {group}\n    </div>\n  );\n});\n\nTileRadioGroup.displayName = 'Tile.RadioGroup';\n\nexport { TileRadioGroup };\n"
    },
    {
      "path": "src/components/tile/TileTitle.tsx",
      "type": "registry:ui",
      "target": "components/ui/wideset/tile/TileTitle.tsx",
      "content": "'use client';\n\nimport * as React from 'react';\nimport { cn } from '@/lib/wideset/utils';\n\nimport type { TitleProps } from './Tile.types';\n\nconst TileTitle = React.forwardRef<HTMLParagraphElement, TitleProps>(\n  ({ children, className, ...props }, ref) => (\n    <p\n      ref={ref}\n      data-slot=\"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\nTileTitle.displayName = 'Tile.Title';\n\nexport { TileTitle };\n"
    }
  ],
  "meta": {
    "version": "1.0.0",
    "commit": "8bb3627"
  }
}
