Skip to content

Add enterprise table support to shadcn-ui example#7

Open
ryandmonk wants to merge 2 commits into
mainfrom
claude/eager-burnell-0f25be
Open

Add enterprise table support to shadcn-ui example#7
ryandmonk wants to merge 2 commits into
mainfrom
claude/eager-burnell-0f25be

Conversation

@ryandmonk

Copy link
Copy Markdown
Contributor

Summary

Extends examples/shadcn-ui.dspack.json so it can describe a real enterprise access-management surface — a members table with status badges, row-level actions, and a destructive "revoke access" confirmation. The change is purely additive: no existing token, component, pattern, anti-pattern, theme, layout entry, or framework binding was edited, reworded, reordered, or restructured (git show reports 141 insertions, 0 deletions).

What was added

1. components.table — models shadcn/ui's Table primitives, not a monolithic data-table. The 8 exports confirmed from source (apps/v4/registry/new-york-v4/ui/table.tsx): Table<table>, TableHeader<thead>, TableBody<tbody>, TableFooter<tfoot>, TableHead<th>, TableRow<tr>, TableCell<td>, TableCaption<caption>. The root table maps to <table>; the other 7 are composition.subComponents.

2. frameworkBindings.react.components.tableinstallCommand npx shadcn@latest add table, import path, the 7 sub-component export names, and a guidance note that sorting/filtering/pagination are composed with TanStack Table (@tanstack/react-table) on top of these presentational primitives.

3. patterns.data-table-with-row-actions — composes the table with badge (status column), dropdown-menu via the existing contextual-actions-menu pattern (trailing actions column), and alert-dialog via the existing destructive-action-confirmation pattern (destructive row actions). relatedPatterns are set to those two patterns.

Rationale for non-obvious fields

  • Primitives, not a monolith — shadcn ships table parts, so they are modeled as subComponents, mirroring how alert-dialog/dropdown-menu are structured. No data behavior is asserted on them.
  • Accessibility block — concrete requiredAttributes for scope (col/row on every th), aria-sort (sortable column header, one active at a time), and an accessible name (TableCaption preferred, else aria-label/aria-labelledby); notes include an explicit prohibition on using tables for visual layout. A matching must-not constraint reinforces the layout point.
  • Reuse over duplication — the pattern routes destructive actions through AlertDialog (not Dialog) and cites the existing nested-interactive-elements anti-pattern by id (do not make the whole row one clickable target while it contains its own controls). No duplicate anti-pattern was created.
  • TanStack note — recorded in both the component constraints (should) and the React binding guidance, so consumers know the primitives are presentational and state is composed on top.

Validation

  • JSON parses; validates against schema/dspack.v0.2.schema.json (Draft 2020-12) with no errors.
  • Cross-reference sanity: every tokens name reuses an existing token; relatedComponents, pattern components, and relatedPatterns resolve to existing entries; the cited anti-pattern id exists.

Do not merge — for review.

🤖 Generated with Claude Code

Extend examples/shadcn-ui.dspack.json so it can describe an enterprise
access-management surface (members table with status badges, row-level
actions, and a destructive "revoke access" confirmation). Purely additive.

- components.table: models shadcn/ui's Table primitives (Table, TableHeader,
  TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption) as
  composition subComponents, with an accessibility block (scope, aria-sort,
  accessible name, no-layout-tables) and severity-tagged constraints.
- frameworkBindings.react.table: install command, import path, sub-component
  export map, and a note that sorting/filtering/pagination compose with
  TanStack Table on top of the primitives.
- patterns.data-table-with-row-actions: composes table with badge,
  dropdown-menu (contextual-actions-menu), and alert-dialog
  (destructive-action-confirmation); cites the existing
  nested-interactive-elements anti-pattern by id.

Validates against schema/dspack.v0.2.schema.json (Draft 2020-12).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 24, 2026 13:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds enterprise-oriented table modeling to the shadcn-ui dspack example so it can describe an access-management “members table” surface (status badges, row actions, destructive confirmations) using composable primitives rather than a monolithic data-table component.

Changes:

  • Added a new components.table entry modeling shadcn/ui’s table primitives (header/body/footer/row/head/cell/caption) with accessibility guidance and composition constraints.
  • Added a new patterns.data-table-with-row-actions pattern composing table + badge + row actions via dropdown-menu and destructive confirmations via alert-dialog.
  • Added a React framework binding entry for installing/importing table and its sub-component export names.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread examples/shadcn-ui.dspack.json
Comment thread examples/shadcn-ui.dspack.json
- Split the no-caption accessible-name requiredAttribute into separate
  aria-label and aria-labelledby entries so each attribute field matches
  its description (Copilot).
- Make the accessible-name constraint unconditional with severity "must",
  consistent with labelRequirement: required-accessible-name (Copilot).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants