{
  "version": "0.2.0-preview.1",
  "content_digest": "70ac710f4d22dce040e7ac593379ba8aca9dcb59a0b9c0f839819cae0e2bb721",
  "status": "preview",
  "authority": {
    "repository": "cloakedinc/design",
    "path": "packages/design-system",
    "catalog": "packages/design-system/catalog.json",
    "status": "preview"
  },
  "provenance": {
    "repo": "cloakedinc/automation",
    "commit": "f96f416e1c3bfbfaffcd155a88b87b18b8bb25f1",
    "path": "packages/design-system",
    "imported_spec_status": "approved"
  },
  "adaptations": [
    {
      "id": "button-content-gap",
      "status": "preview",
      "description": "Use the specification's 4px content gap instead of the inherited 8px implementation gap."
    },
    {
      "id": "keyboard-focus",
      "status": "preview",
      "description": "Add visible Button and Input keyboard focus and an overridable inset focus default for shared button resets, including FAQ cards and ListItem rows."
    },
    {
      "id": "supporting-text-contrast",
      "status": "preview",
      "description": "Map light secondary text to the existing grey-04-strong primitive for readable helper text on white and cream."
    },
    {
      "id": "danger-text-contrast",
      "status": "preview",
      "description": "Separate readable danger text/borders from destructive fills; preserve the primary danger-button fill and label pair."
    },
    {
      "id": "preview-status",
      "status": "preview",
      "description": "Local components, specs and token adaptations await human sign-off; upstream approved status is provenance only."
    },
    {
      "id": "motion-comparison-accessibility",
      "status": "preview",
      "description": "Preserve the original MotionShowcase comparisons while requiring explicit replay, responding to live reduced-motion changes, and keeping duration tracks usable on small screens."
    },
    {
      "id": "list-item-ownership",
      "status": "preview",
      "description": "List owns listitem wrappers for its content rows, while section labels stay outside the row count and standalone rows retain their existing semantics."
    },
    {
      "id": "card-delta-text-contrast",
      "status": "preview",
      "description": "Mix Card.Delta foregrounds from 60% existing tone solid and 40% primary text for readable contrast in both themes; preserve the four original tone fills."
    },
    {
      "id": "carousel-keyboard-access",
      "status": "preview",
      "description": "Keep all native-scrolling carousel slide controls exposed to assistive technology and keyboard navigation; pause autoplay while focus is inside the carousel."
    }
  ],
  "id": "grid",
  "name": "Grid",
  "category": "Layout",
  "contract_status": "preview",
  "contract_kind": "source-derived",
  "review": {
    "local_status": "not-reviewed",
    "source_approval": null,
    "imported_spec_status": "approved",
    "spec_origin": "imported-adapted",
    "local_spec_source_status": "approved",
    "imported_source_revision": "f96f416e1c3bfbfaffcd155a88b87b18b8bb25f1",
    "note": "Inherited specification status is provenance, not approval of the current local implementation or extracted contract."
  },
  "approval": "required",
  "visual_reference": {
    "stories": [
      {
        "id": "cloaked-design-system-layout-grid--playground",
        "name": "Playground",
        "title": "Cloaked Design System/Layout/Grid",
        "exportName": "Playground",
        "source_path": "packages/design-system/src/components/layout/Grid/Grid.stories.tsx",
        "source_digest": "4340fe8b0a82c7f219e80a328e763b933507d467be9da0eef3bd5c7b61c5e482",
        "status": "preview",
        "local_url": "/storybook/iframe.html?id=cloaked-design-system-layout-grid--playground&viewMode=story"
      },
      {
        "id": "cloaked-design-system-layout-grid--three-columns",
        "name": "Three Columns",
        "title": "Cloaked Design System/Layout/Grid",
        "exportName": "ThreeColumns",
        "source_path": "packages/design-system/src/components/layout/Grid/Grid.stories.tsx",
        "source_digest": "4340fe8b0a82c7f219e80a328e763b933507d467be9da0eef3bd5c7b61c5e482",
        "status": "preview",
        "local_url": "/storybook/iframe.html?id=cloaked-design-system-layout-grid--three-columns&viewMode=story"
      },
      {
        "id": "cloaked-design-system-layout-grid--separate-axis-gaps",
        "name": "Separate Axis Gaps",
        "title": "Cloaked Design System/Layout/Grid",
        "exportName": "SeparateAxisGaps",
        "source_path": "packages/design-system/src/components/layout/Grid/Grid.stories.tsx",
        "source_digest": "4340fe8b0a82c7f219e80a328e763b933507d467be9da0eef3bd5c7b61c5e482",
        "status": "preview",
        "local_url": "/storybook/iframe.html?id=cloaked-design-system-layout-grid--separate-axis-gaps&viewMode=story"
      },
      {
        "id": "cloaked-design-system-layout-grid--with-padding",
        "name": "With Padding",
        "title": "Cloaked Design System/Layout/Grid",
        "exportName": "WithPadding",
        "source_path": "packages/design-system/src/components/layout/Grid/Grid.stories.tsx",
        "source_digest": "4340fe8b0a82c7f219e80a328e763b933507d467be9da0eef3bd5c7b61c5e482",
        "status": "preview",
        "local_url": "/storybook/iframe.html?id=cloaked-design-system-layout-grid--with-padding&viewMode=story"
      },
      {
        "id": "cloaked-design-system-layout-grid--center-aligned",
        "name": "Center Aligned",
        "title": "Cloaked Design System/Layout/Grid",
        "exportName": "CenterAligned",
        "source_path": "packages/design-system/src/components/layout/Grid/Grid.stories.tsx",
        "source_digest": "4340fe8b0a82c7f219e80a328e763b933507d467be9da0eef3bd5c7b61c5e482",
        "status": "preview",
        "local_url": "/storybook/iframe.html?id=cloaked-design-system-layout-grid--center-aligned&viewMode=story"
      },
      {
        "id": "cloaked-design-system-layout-grid--justify",
        "name": "Justify",
        "title": "Cloaked Design System/Layout/Grid",
        "exportName": "Justify",
        "source_path": "packages/design-system/src/components/layout/Grid/Grid.stories.tsx",
        "source_digest": "4340fe8b0a82c7f219e80a328e763b933507d467be9da0eef3bd5c7b61c5e482",
        "status": "preview",
        "local_url": "/storybook/iframe.html?id=cloaked-design-system-layout-grid--justify&viewMode=story"
      },
      {
        "id": "cloaked-design-system-layout-grid--column-matrix",
        "name": "Column Matrix",
        "title": "Cloaked Design System/Layout/Grid",
        "exportName": "ColumnMatrix",
        "source_path": "packages/design-system/src/components/layout/Grid/Grid.stories.tsx",
        "source_digest": "4340fe8b0a82c7f219e80a328e763b933507d467be9da0eef3bd5c7b61c5e482",
        "status": "preview",
        "local_url": "/storybook/iframe.html?id=cloaked-design-system-layout-grid--column-matrix&viewMode=story"
      },
      {
        "id": "cloaked-design-system-layout-grid--gap-matrix",
        "name": "Gap Matrix",
        "title": "Cloaked Design System/Layout/Grid",
        "exportName": "GapMatrix",
        "source_path": "packages/design-system/src/components/layout/Grid/Grid.stories.tsx",
        "source_digest": "4340fe8b0a82c7f219e80a328e763b933507d467be9da0eef3bd5c7b61c5e482",
        "status": "preview",
        "local_url": "/storybook/iframe.html?id=cloaked-design-system-layout-grid--gap-matrix&viewMode=story"
      },
      {
        "id": "cloaked-design-system-layout-grid--responsive-mobile-width",
        "name": "Responsive Mobile Width",
        "title": "Cloaked Design System/Layout/Grid",
        "exportName": "ResponsiveMobileWidth",
        "source_path": "packages/design-system/src/components/layout/Grid/Grid.stories.tsx",
        "source_digest": "4340fe8b0a82c7f219e80a328e763b933507d467be9da0eef3bd5c7b61c5e482",
        "status": "preview",
        "local_url": "/storybook/iframe.html?id=cloaked-design-system-layout-grid--responsive-mobile-width&viewMode=story"
      }
    ],
    "name": "Grid",
    "id": "grid",
    "category": "Layout"
  },
  "stories_source": {
    "path": "packages/design-system/src/components/layout/Grid/Grid.stories.tsx",
    "code": "import React from 'react';\nimport type { Meta, StoryObj } from '@storybook/react-vite';\nimport { Card } from '../../cards/Card/Card';\nimport { Text } from '../../primitives/Text/Text';\nimport { VStack } from '../VStack/VStack';\nimport {\n    SPACE_OPTIONS,\n    STACK_ALIGN_OPTIONS,\n    STACK_JUSTIFY_OPTIONS,\n    disabledControl,\n    selectArgType,\n} from '../../../storybook/controlOptions';\nimport { Grid } from './Grid';\n\nconst GridCard = ({ title, body }: { title: string; body: string }) => (\n    <Card>\n        <Card.Body gap='xs'>\n            <Text variant='h5' as='div'>\n                {title}\n            </Text>\n            <Text variant='body-small' color='secondary' as='div'>\n                {body}\n            </Text>\n        </Card.Body>\n    </Card>\n);\n\nconst items = [\n    { title: 'Risk', body: 'Score' },\n    { title: 'Scan', body: 'Active' },\n    { title: 'Inbox', body: '12 new' },\n    { title: 'Guard', body: 'Enabled' },\n];\n\nconst manyItems = ['Risk', 'Scan', 'Inbox', 'Guard', 'ID', 'Relay', 'Calls', 'VPN'];\n\nconst meta: Meta<typeof Grid> = {\n    title: 'Cloaked Design System/Layout/Grid',\n    component: Grid,\n    parameters: {\n        a11y: { test: 'error' },\n        docs: {\n            description: {\n                component:\n                    'Equal-width column grid backed by CSS Grid (`repeat(columns, 1fr)`). Column-first: set the ' +\n                    'column count and rows fill implicitly as children flow in. Use it for uniform tiles and ' +\n                    'metric cards; reach for `VStack`/`HStack` for a single-axis flow and `Carousel` for ' +\n                    'one-per-view swiping. Because every column is `1fr`, `align` (align-items) controls how ' +\n                    'cells of unequal height line up, while `justify` (justify-content) is usually a no-op — the ' +\n                    'tracks already fill the container.',\n            },\n        },\n    },\n    args: {\n        columns: 2,\n        gap: 12,\n        children: items.map(item => <GridCard key={item.title} title={item.title} body={item.body} />),\n    },\n    argTypes: {\n        columns: {\n            control: 'number',\n            description: 'Number of equal-width `1fr` columns; rows are created implicitly.',\n        },\n        children: disabledControl,\n        gap: {\n            ...selectArgType(SPACE_OPTIONS),\n            description: 'Uniform gap between columns and rows, in `--cds-space-*` steps.',\n        },\n        gapX: { ...selectArgType(SPACE_OPTIONS), description: 'Column gap override, in `--cds-space-*` steps.' },\n        gapY: { ...selectArgType(SPACE_OPTIONS), description: 'Row gap override, in `--cds-space-*` steps.' },\n        align: {\n            ...selectArgType(STACK_ALIGN_OPTIONS),\n            description: 'Cross-axis alignment of cells within their row (`align-items`).',\n        },\n        justify: {\n            ...selectArgType(STACK_JUSTIFY_OPTIONS),\n            description:\n                'Inline distribution of the grid tracks (`justify-content`). No effect while columns are `1fr` and fill the container.',\n        },\n        padding: { ...selectArgType(SPACE_OPTIONS), description: 'Uniform inner padding, in `--cds-space-*` steps.' },\n        paddingX: {\n            ...selectArgType(SPACE_OPTIONS),\n            description: 'Horizontal padding override, in `--cds-space-*` steps.',\n        },\n        paddingY: {\n            ...selectArgType(SPACE_OPTIONS),\n            description: 'Vertical padding override, in `--cds-space-*` steps.',\n        },\n        paddingTop: { ...selectArgType(SPACE_OPTIONS), description: 'Top padding override, in `--cds-space-*` steps.' },\n        paddingRight: {\n            ...selectArgType(SPACE_OPTIONS),\n            description: 'Right padding override, in `--cds-space-*` steps.',\n        },\n        paddingBottom: {\n            ...selectArgType(SPACE_OPTIONS),\n            description: 'Bottom padding override, in `--cds-space-*` steps.',\n        },\n        paddingLeft: {\n            ...selectArgType(SPACE_OPTIONS),\n            description: 'Left padding override, in `--cds-space-*` steps.',\n        },\n    },\n};\nexport default meta;\ntype Story = StoryObj<typeof Grid>;\n\nexport const Playground: Story = {};\n\nexport const ThreeColumns: Story = {\n    parameters: {\n        docs: { description: { story: 'A denser three-up grid; the same children reflow into three `1fr` tracks.' } },\n    },\n    args: {\n        columns: 3,\n        gap: 8,\n        children: ['One', 'Two', 'Three', 'Four', 'Five', 'Six'].map(label => (\n            <GridCard key={label} title={label} body='Grid cell' />\n        )),\n    },\n};\n\nexport const SeparateAxisGaps: Story = {\n    parameters: {\n        docs: { description: { story: '`gapX`/`gapY` set column and row spacing independently, overriding `gap`.' } },\n    },\n    args: {\n        columns: 2,\n        gapX: 20,\n        gapY: 8,\n        children: items.map(item => <GridCard key={item.title} title={item.title} body={item.body} />),\n    },\n};\n\nexport const WithPadding: Story = {\n    parameters: {\n        docs: { description: { story: 'Uniform inner padding around the tracks, on the `--cds-space-*` scale.' } },\n    },\n    args: {\n        columns: 2,\n        gap: 12,\n        padding: 16,\n        children: items.map(item => <GridCard key={item.title} title={item.title} body={item.body} />),\n    },\n};\n\nexport const CenterAligned: Story = {\n    parameters: {\n        docs: {\n            description: {\n                story: '`align=\"center\"` vertically centers each cell within its row when cells differ in height.',\n            },\n        },\n    },\n    args: {\n        columns: 2,\n        gap: 12,\n        align: 'center',\n        children: [\n            <GridCard key='short' title='Short' body='Default height' />,\n            <div key='tall' style={{ minHeight: 'var(--cds-size-160)' }}>\n                <GridCard title='Tall wrapper' body='Aligned center' />\n            </div>,\n        ],\n    },\n};\n\nexport const Justify: Story = {\n    parameters: {\n        docs: {\n            description: {\n                story:\n                    'Wires up `justify` (justify-content). With `1fr` columns the tracks always fill the ' +\n                    'container, so this has no visible effect — `justify` only matters if the tracks are sized ' +\n                    'smaller than their container. Use `align` for the common case of aligning uneven cells.',\n            },\n        },\n    },\n    args: {\n        columns: 2,\n        gap: 12,\n        justify: 'center',\n        children: items.map(item => <GridCard key={item.title} title={item.title} body={item.body} />),\n    },\n};\n\nexport const ColumnMatrix: Story = {\n    parameters: {\n        docs: { description: { story: 'One to four columns side by side to compare tile density at a glance.' } },\n    },\n    render: () => (\n        <VStack gap={24}>\n            {[1, 2, 3, 4].map(columns => (\n                <VStack key={columns} gap={8}>\n                    <Text variant='body-small' color='secondary'>\n                        {`${columns} column${columns === 1 ? '' : 's'}`}\n                    </Text>\n                    <Grid columns={columns} gap={8}>\n                        {manyItems.slice(0, columns * 2).map(label => (\n                            <GridCard key={label} title={label} body='Grid cell' />\n                        ))}\n                    </Grid>\n                </VStack>\n            ))}\n        </VStack>\n    ),\n};\n\nexport const GapMatrix: Story = {\n    parameters: {\n        docs: { description: { story: 'The same 2-column grid at four `--cds-space-*` gap steps, including `0`.' } },\n    },\n    render: () => (\n        <VStack gap={24}>\n            {([0, 4, 12, 24] as const).map(gap => (\n                <VStack key={gap} gap={8}>\n                    <Text variant='body-small' color='secondary'>\n                        {`gap ${gap}`}\n                    </Text>\n                    <Grid columns={2} gap={gap}>\n                        {items.map(item => (\n                            <GridCard key={item.title} title={item.title} body={item.body} />\n                        ))}\n                    </Grid>\n                </VStack>\n            ))}\n        </VStack>\n    ),\n};\n\nexport const ResponsiveMobileWidth: Story = {\n    parameters: {\n        docs: { description: { story: 'The grid inside a phone-width container to preview tile sizing on device.' } },\n    },\n    render: () => (\n        <div style={{ width: 'min(100%, calc(var(--cds-size-240) + var(--cds-size-80)))' }}>\n            <Grid columns={2} gap={12}>\n                {manyItems.map(label => (\n                    <GridCard key={label} title={label} body='Responsive cell' />\n                ))}\n            </Grid>\n        </div>\n    ),\n};\n"
  },
  "specification": {
    "$schema": "../../../specs/component-spec.schema.json",
    "identity": {
      "name": "Grid",
      "status": "preview",
      "version": "1.0.0",
      "summary": "An equal-width column grid backed by CSS Grid, column-first with token-scale gaps and cell alignment."
    },
    "parts": [
      {
        "id": "root",
        "label": "Root",
        "description": "CSS Grid container. Structural: it arranges children into equal-width columns and paints no surface.",
        "required": true
      }
    ],
    "allowedDesignChoices": {
      "variants": {
        "grid": {
          "label": "Grid",
          "description": "The single equal-width column grid."
        }
      },
      "sizes": {},
      "alignments": {
        "start": {
          "label": "Start"
        },
        "center": {
          "label": "Center"
        },
        "end": {
          "label": "End"
        },
        "stretch": {
          "label": "Stretch"
        },
        "baseline": {
          "label": "Baseline"
        }
      },
      "justifications": {
        "start": {
          "label": "Start"
        },
        "center": {
          "label": "Center"
        },
        "end": {
          "label": "End"
        },
        "between": {
          "label": "Between"
        },
        "around": {
          "label": "Around"
        },
        "evenly": {
          "label": "Evenly"
        }
      }
    },
    "variants": [
      {
        "id": "grid",
        "label": "Grid",
        "description": "Equal-width column grid.",
        "platforms": [
          "ios",
          "android",
          "web"
        ]
      }
    ],
    "sizes": [],
    "measurements": [
      {
        "id": "track-gap",
        "label": "Track gap",
        "kind": "example-only",
        "token": "--cds-space-12",
        "value": 12,
        "unit": "px",
        "appliesTo": [
          "root"
        ],
        "notes": "Representative value: gap, gapX, and gapY are author-configurable and accept any step on the spacing scale. 12 is the value rendered and verified by the Playground story."
      }
    ],
    "layout": {
      "alignment": "align sets align-items across rows; justify sets justify-content, usually a no-op while columns are 1fr.",
      "flow": "Column-first: set the column count and rows fill implicitly as children flow in.",
      "notes": [
        "Use VStack/HStack for a single-axis flow and Carousel for one-per-view swiping."
      ]
    },
    "typographyAndColor": {
      "typography": [
        {
          "label": "Inherited",
          "description": "Grid sets no type; children own their text. Ramp noted for parity.",
          "token": "--cds-type-body-size"
        }
      ],
      "colors": [
        {
          "label": "Transparent",
          "description": "Grid paints no background; the surface behind shows through.",
          "token": "--cds-bg-page"
        }
      ]
    },
    "states": [
      {
        "id": "default",
        "label": "Default",
        "description": "Equal-width tracks with a uniform gap."
      },
      {
        "id": "separate-axis-gaps",
        "label": "Separate axis gaps",
        "description": "gapX and gapY set column and row spacing independently."
      },
      {
        "id": "aligned",
        "label": "Aligned",
        "description": "align centers uneven cells within their row."
      }
    ],
    "behavior": [
      {
        "label": "Column-first",
        "description": "Specify columns; rows are created implicitly as children fill up."
      },
      {
        "label": "Token gaps",
        "description": "gap, gapX, and gapY map to the spacing scale."
      }
    ],
    "accessibility": [
      {
        "label": "Presentational",
        "description": "Grid is a layout container and adds no roles; order follows DOM order."
      },
      {
        "label": "Reading order",
        "description": "Children read in source order regardless of visual columns."
      }
    ],
    "contentAdaptation": [
      {
        "label": "Tile density",
        "description": "Change the column count to trade tile size for density."
      },
      {
        "label": "Uneven cells",
        "description": "Use align to line up cells of differing height."
      }
    ],
    "motionHaptics": {
      "motion": [
        {
          "label": "None",
          "description": "Grid does not animate layout changes on its own."
        }
      ],
      "haptics": [
        {
          "label": "None",
          "description": "A layout container requests no haptics."
        }
      ]
    },
    "platformDifferences": []
  },
  "specification_source": "packages/design-system/src/components/layout/Grid/Grid.spec.json",
  "guidance": {
    "summary": "An equal-width column grid backed by CSS Grid, column-first with token-scale gaps and cell alignment.",
    "guidance": [
      {
        "heading": "Overview",
        "body": "Equal-width column grid backed by CSS Grid (`repeat(columns, 1fr)`). Set the column count and\nrows fill implicitly as children flow in."
      },
      {
        "heading": "When to use",
        "body": "Reach for `Grid` when you want a **two-dimensional** layout of uniform tiles — metric cards, a\ndashboard's widget picker, a stat grid. Every column is `1fr`, so tiles share width evenly and\nwrap into new rows automatically.\n\n-   Only laying out **one axis** (a column or a row)? Use `VStack` or `HStack` — they are simpler\n    and don't force equal widths.\n-   Showing **one item per view with swiping**? Use `Carousel`.\n\nBecause tracks are `1fr` and fill the container, `align` (align-items) controls how uneven-height\ncells line up, while `justify` is usually a no-op."
      }
    ],
    "usage": [],
    "examples": [],
    "source": "packages/design-system/src/components/layout/Grid/Grid.mdx",
    "status": "local-preview",
    "note": "Guidance is read from local documentation, originally imported from the frozen source. Platform assertions in guidance are not parity verification."
  },
  "links": {
    "human": "/component-grid",
    "json": "/data/visual/components/grid.json",
    "storybook": "/storybook/?path=/story/cloaked-design-system-layout-grid--playground"
  }
}
