Skip to content

feat(react): add UI primitives and data table updates#158

Open
rax7389 wants to merge 2 commits intomainfrom
feat/mm-invitations-ui-primitives
Open

feat(react): add UI primitives and data table updates#158
rax7389 wants to merge 2 commits intomainfrom
feat/mm-invitations-ui-primitives

Conversation

@rax7389
Copy link
Copy Markdown
Contributor

@rax7389 rax7389 commented Mar 14, 2026

Changes

Summary: Introduces new reusable UI primitive components (Chip, Combobox, TextFieldGroup) and enhances shared DataTable and DataPagination components with server-side sorting and checkpoint-based pagination support.

Why: The existing shared data components (DataTable, DataPagination) only supported client-side sorting and traditional page-number pagination. The upcoming member management feature requires server-side sorting (API-driven) and checkpoint/cursor-based pagination (next/previous tokens), along with new input primitives for invite flows (multi-value inputs, searchable dropdowns, tag chips).
What:

New Components

  1. Chip (chip.tsx) — A removable tag/badge element with multiple variants and sizes.
<Chip variant="info" size="md" onRemove={() => handleRemove(item)}>
  user@example.com
</Chip>
  1. Combobox (combobox.tsx) — Searchable dropdown with single and multi-select support, built on Radix Popover.
<Combobox
  options={[{ label: "Admin", value: "admin" }, { label: "Member", value: "member" }]}
  value={selectedRoles}
  onChange={setSelectedRoles}
  multiple
  placeholder="Select roles..."
/>
  1. TextFieldGroup (text-field-group.tsx) — Input field with chip support for multi-value entry via comma/Enter-based chip creation.
<TextFieldGroup
  chips={emails}
  onChipAdd={(val) => addEmail(val)}
  onChipRemove={(val) => removeEmail(val)}
  chipVariant="secondary"
  placeholder="Enter email addresses..."
/>

Updated Components

  1. DataTable — Server-side sorting support. Added onSortChange and sortConfig props to delegate sorting to the parent (API-driven) instead of client-side TanStack sorting.
// Server-side sorting (new)
<DataTable
  data={items}
  columns={columns}
  sortConfig={{ key: "created_at", direction: "desc" }}
  onSortChange={(config) => fetchSorted(config.key, config.direction)}
/>

// Client-side sorting (unchanged)
<DataTable data={items} columns={columns} />
  1. DataPagination — Checkpoint pagination with page info. Extended CheckpointPaginationState with optional currentPage to display "Showing X-Y of Z" for cursor-based APIs. Removed page-number links (Previous/Next only). Cleaned up unused helpers (generatePageNumbers, interpolate).
<DataPagination
  variant="checkpoint"
  checkpointState={{
    pageSize: 10,
    currentPage: 2,
    totalItems: 47,
    hasNextPage: true,
    hasPreviousPage: true,
  }}
  onPageChange={handlePageChange}
/>

Other

  • color-picker.tsx: Minor import cleanup

References

Part of the member management invitations feature.

Testing

  • This change adds unit test coverage
  • This change has been tested on the latest version of the platform/language

Checklist

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 14, 2026

Codecov Report

❌ Patch coverage is 53.33333% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.55%. Comparing base (8a2cd65) to head (84ef293).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
...s/react/src/components/auth0/shared/data-table.tsx 53.33% 14 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #158      +/-   ##
==========================================
- Coverage   88.64%   88.55%   -0.09%     
==========================================
  Files         154      154              
  Lines       13129    13155      +26     
  Branches     1787     1405     -382     
==========================================
+ Hits        11638    11650      +12     
- Misses       1491     1505      +14     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@rax7389 rax7389 self-assigned this Mar 15, 2026
@rax7389 rax7389 added the enhancement New feature or request label Mar 15, 2026
chakrihacker
chakrihacker previously approved these changes Mar 19, 2026
@rax7389 rax7389 force-pushed the feat/mm-invitations-ui-primitives branch from 4cd1add to f543326 Compare March 29, 2026 17:41
@rax7389 rax7389 requested a review from chakrihacker March 30, 2026 12:02
@rax7389 rax7389 force-pushed the feat/mm-invitations-ui-primitives branch from f543326 to 41ed260 Compare April 8, 2026 08:49
Comment thread packages/react/src/components/auth0/shared/data-table.tsx
Comment thread packages/react/src/components/auth0/shared/data-pagination.tsx Outdated
@rax7389 rax7389 requested a review from NaveenChand755 April 13, 2026 07:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants