docs(floating-actions): add row-selection pattern with DataTable#747
docs(floating-actions): add row-selection pattern with DataTable#747paanSinghCoder merged 25 commits intomainfrom
Conversation
A floating bar for surfacing contextual actions (bulk-action toolbar, row hover actions, etc.). Position-agnostic visual primitive with a matching vertical separator; composes freely with existing Chip, Button, and IconButton. - Component source, styles (--rs-shadow-lifted), and tests - Docs page with preview, bulk-actions, and icon-only demos - Playground example and examples/page.tsx section Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Keep the component, docs, and playground — the examples/page.tsx scratch page is out of scope for this PR. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
FloatingActions.Separator now wraps `Separator` from the design system with `orientation="vertical"` and `size="full"` defaults, instead of re-implementing a local 1px×16px div. Drops the local `.separator` CSS class and picks up proper `role="separator"` semantics, size/color variants, and Base UI behavior for free. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The floating bar is horizontal-only, so the separator is always vertical. `Omit<..., 'orientation'>` from the prop type and drop the unused horizontal CSS rule. Scoped `.separator` class overrides the Separator primitive's size variant to --rs-space-5 per the Figma spec. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ute for vertical orientation
Adds a new "Row selection" section in the DataTable docs showing the recommended pattern for integrating FloatingActions with TanStack row selection: - leading checkbox column wired via row.toggleSelected / getIsSelected - SelectionBar that reads useDataTable().table.getSelectedRowModel() - FloatingActions overlay with dismissible count chip (onDismiss → table.resetRowSelection) Ships a live demo (DataTableSelectionDemo) registered in the Demo scope, plus a cross-reference from the FloatingActions docs. Also adds matching horizontal padding on DataTable's toolbar so filter / display controls align with cell content. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThis pull request introduces a row-selection pattern for the DataTable component across demo, documentation, and utility files. A new Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 0/1 reviews remaining, refill in 60 minutes.Comment |
|
@paanSinghCoder Also the selection state should be handled internally from the DataTable. Right now the user is supposed to handle the selection model, which is not ideal. Let's think this through separately cc @ravisuhag |
Introduce variant, side, and align props so the component owns its positioning instead of pushing it onto consumers. Floating is the default and pins the bar to the viewport via position: fixed, mirroring Toast's data-position pattern. Inline preserves the prior in-flow behaviour for embedded contexts (cards, tables, docs demos). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Replace hand-rolled <div role="toolbar"> with Base UI Toolbar primitive to inherit roving focus, arrow-key navigation, and disabled cascade. - Expose FloatingActions.Group wrapping Toolbar.Group. - Move Object.assign out of the 'use client' file into a non-client index.ts (matches Field/Sidebar precedent), avoiding client/server boundary issues. Rename index.tsx -> index.ts (no JSX). - Trim Anatomy intro to the standard "Import and assemble the component:" line used by peer docs. - Document Separator's size and render props, and the Toolbar primitive props (disabled, orientation, loopFocus) on Root. - Add a scrolling-context demo using transform: translateZ(0) so the floating bar is scoped to the demo container instead of the page. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…/floating-actions-datatable
# Conflicts: # apps/www/src/components/demo/demo.tsx
…preview edges Wrap each inline demo's bar in a div with paddingBlock so the rendered preview shows visible breathing room above and below. Inline style keeps the change scoped to floating-actions demos without leaking into other component preview areas. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…/floating-actions-datatable
…context demo - Collapse the separate ### Floating and ### Inline subsections into a single ## Variants section with a tabbed demo (matches the sidebar/ navbar/tabs pattern). - Floating tab is scoped to a 200px transform: translateZ(0) container so the bar pins to that area instead of the docs page. - Scrolling-context demo: replace 20 dummy rows with a single dashed- border placeholder (sidebar precedent), make the scroll wrapper full width, drop the inner padding/border so rows go edge to edge. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
… API FloatingActions accepts arbitrary children (Apsara Button, IconButton, Chip, custom components) rather than wrapping them via a registered Toolbar.Button-style subcomponent, so the Toolbar primitive's disabled cascade only affected items that happened to register with the primitive — not the typical children. Documenting it as "cascades to every focusable item" was misleading. Omit disabled from both FloatingActionsProps and FloatingActionsGroupProps. Consumers can disable individual items explicitly when needed. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…/floating-actions-datatable
…igation in documentation
…/floating-actions-datatable # Conflicts: # apps/www/src/content/docs/components/floating-actions/index.mdx
# Conflicts: # apps/www/src/content/docs/components/floating-actions/demo.ts # apps/www/src/content/docs/components/floating-actions/index.mdx
Summary
FloatingActionswith TanStack row selection (leading checkbox column +useDataTable()+ dismissible count chip wired totable.resetRowSelection()).DataTableSelectionDemoregistered in the Demo scope so the pattern is visible in the docs, not just copy-pasted code.FloatingActionsdocs pointing at the new section..toolbarso filter/display controls align with cell content.Test plan
/components/datatable→ scroll to "Row selection" — live demo renders, clicking checkboxes updates the "N selected" chip; dismissing clears selection./components/floating-actions→ see cross-reference at "Use with DataTable".🤖 Generated with Claude Code