Skip to content

feat: DR-7295 Add new native select#7671

Open
carlagn wants to merge 2 commits intomainfrom
feat/DR-7295-native-select
Open

feat: DR-7295 Add new native select#7671
carlagn wants to merge 2 commits intomainfrom
feat/DR-7295-native-select

Conversation

@carlagn
Copy link
Contributor

@carlagn carlagn commented Mar 18, 2026

Fixes #DR-7295

Summary by CodeRabbit

  • New Features

    • Introduced a new Select component to the design system, now available in the public API for use across apps
    • Supports grouped options, size variants, disabled state, form integration, positioning, and scrollable lists; includes accessibility enhancements
  • Documentation

    • Added comprehensive documentation with usage examples, API reference, accessibility notes, and best practices
  • Chores

    • Registered the Select documentation page in the design system navigation/meta list

@vercel
Copy link

vercel bot commented Mar 18, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
blog Ready Ready Preview, Comment Mar 18, 2026 1:49pm
docs Ready Ready Preview, Comment Mar 18, 2026 1:49pm
eclipse Ready Ready Preview, Comment Mar 18, 2026 1:49pm

Request Review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 18, 2026

Walkthrough

Adds a new Select component: a client-side React implementation built on @base-ui/react/select, public re-exports, MDX documentation, and a metadata entry registering the documentation page.

Changes

Cohort / File(s) Summary
Metadata
apps/eclipse/content/design-system/components/meta.json
Added "select" to the pages array and normalized end-of-file newline.
Documentation
apps/eclipse/content/design-system/components/select.mdx
Added comprehensive MDX docs for the Select component (usage examples, API reference, accessibility, demos).
Component Source
packages/eclipse/src/components/select.tsx
New client-side React wrapper around @base-ui/react/select primitives implementing Select, SelectTrigger, SelectValue, SelectContent, SelectItem, SelectGroup, SelectLabel, SelectSeparator, SelectScrollUpButton, and SelectScrollDownButton; includes a handleClassName utility and icon integrations.
Public API Re-exports
packages/eclipse/src/components/index.ts
Re-exported the new Select-related components from the package public surface.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically identifies the main change: adding a new Select component to the design system.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

📝 Coding Plan
  • Generate coding plan for human review comments

Comment @coderabbitai help to get the list of available commands and usage tips.

@argos-ci
Copy link

argos-ci bot commented Mar 18, 2026

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) ⚠️ Changes detected (Review) 1 changed Mar 18, 2026, 1:49 PM

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@apps/eclipse/content/design-system/components/select.mdx`:
- Around line 665-678: The controlled example uses useState but doesn't import
it; add an import for useState from React at the top of the snippet (so the
example that declares const [value, setValue] = useState("option1"); works).
Locate the example using Select, SelectTrigger, SelectValue, SelectContent, and
SelectItem and add the missing import (e.g., import { useState } from 'react')
so copy-paste consumers won't get a ReferenceError.
- Around line 442-447: The docs list for the Select props is out of sync with
the component defaults: update the MDX documentation entries for the Select
props so that `align` default is "start" and `alignItemWithTrigger` default is
false to match the implementation in select.tsx (the component's `align =
"start"` and `alignItemWithTrigger = false` defaults); locate the `align` and
`alignItemWithTrigger` lines in the select.mdx props list and change their
described defaults accordingly while leaving the other prop descriptions
unchanged.

In `@packages/eclipse/src/components/select.tsx`:
- Line 60: The decorative <i> icons in the select component are currently
exposed to assistive tech; update each decorative icon element (e.g., the <i>
with className "fa-regular fa-chevron-down text-foreground-neutral-weak size-4
pointer-events-none" and the other similar <i> occurrences) to include
aria-hidden="true" so screen readers ignore them; locate these <i> elements in
the select component (packages/eclipse/src/components/select.tsx) and add
aria-hidden="true" to each decorative icon instance.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: cd983f93-1e50-4456-89e5-b8f9b0fee68d

📥 Commits

Reviewing files that changed from the base of the PR and between 0d714e4 and 04dc853.

📒 Files selected for processing (4)
  • apps/eclipse/content/design-system/components/meta.json
  • apps/eclipse/content/design-system/components/select.mdx
  • packages/eclipse/src/components/index.ts
  • packages/eclipse/src/components/select.tsx

Comment on lines +442 to +447
- `side` - Position relative to trigger ("top" | "bottom" | "left" | "right", default: "bottom")
- `align` - Alignment relative to trigger ("start" | "center" | "end", default: "center")
- `sideOffset` - Distance from trigger in pixels (number, default: 4)
- `alignOffset` - Alignment offset in pixels (number, default: 0)
- `alignItemWithTrigger` - Align selected item with trigger (boolean, default: true)
- `className` - Additional CSS classes (string or function, optional)
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Align documented defaults with implementation.
Line [443] and Line [446] currently conflict with the component defaults in packages/eclipse/src/components/select.tsx (align = "start", alignItemWithTrigger = false).

Suggested patch
-- `align` - Alignment relative to trigger ("start" | "center" | "end", default: "center")
+- `align` - Alignment relative to trigger ("start" | "center" | "end", default: "start")
...
-- `alignItemWithTrigger` - Align selected item with trigger (boolean, default: true)
+- `alignItemWithTrigger` - Align selected item with trigger (boolean, default: false)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/eclipse/content/design-system/components/select.mdx` around lines 442 -
447, The docs list for the Select props is out of sync with the component
defaults: update the MDX documentation entries for the Select props so that
`align` default is "start" and `alignItemWithTrigger` default is false to match
the implementation in select.tsx (the component's `align = "start"` and
`alignItemWithTrigger = false` defaults); locate the `align` and
`alignItemWithTrigger` lines in the select.mdx props list and change their
described defaults accordingly while leaving the other prop descriptions
unchanged.

Comment on lines +665 to +678
**Controlled (with value and onValueChange):**
```tsx
const [value, setValue] = useState("option1");

<Select value={value} onValueChange={setValue}>
<SelectTrigger>
<SelectValue />
</SelectTrigger>
<SelectContent>
<SelectItem value="option1">Option 1</SelectItem>
<SelectItem value="option2">Option 2</SelectItem>
</SelectContent>
</Select>
```
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Controlled example is missing useState import.
Line [667] uses useState but the snippet doesn’t import it, so copy-paste users will hit an immediate error.

Suggested patch
+import { useState } from "react";
+
 const [value, setValue] = useState("option1");
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
**Controlled (with value and onValueChange):**
```tsx
const [value, setValue] = useState("option1");
<Select value={value} onValueChange={setValue}>
<SelectTrigger>
<SelectValue />
</SelectTrigger>
<SelectContent>
<SelectItem value="option1">Option 1</SelectItem>
<SelectItem value="option2">Option 2</SelectItem>
</SelectContent>
</Select>
```
import { useState } from "react";
const [value, setValue] = useState("option1");
<Select value={value} onValueChange={setValue}>
<SelectTrigger>
<SelectValue />
</SelectTrigger>
<SelectContent>
<SelectItem value="option1">Option 1</SelectItem>
<SelectItem value="option2">Option 2</SelectItem>
</SelectContent>
</Select>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/eclipse/content/design-system/components/select.mdx` around lines 665 -
678, The controlled example uses useState but doesn't import it; add an import
for useState from React at the top of the snippet (so the example that declares
const [value, setValue] = useState("option1"); works). Locate the example using
Select, SelectTrigger, SelectValue, SelectContent, and SelectItem and add the
missing import (e.g., import { useState } from 'react') so copy-paste consumers
won't get a ReferenceError.

{...props}
>
{children}
<i className="fa-regular fa-chevron-down text-foreground-neutral-weak size-4 pointer-events-none" />
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Hide decorative icons from assistive technologies.
These <i> elements are visual-only. Add aria-hidden="true" so screen readers don’t announce them.

Suggested patch
-      <i className="fa-regular fa-chevron-down text-foreground-neutral-weak size-4 pointer-events-none" />
+      <i
+        aria-hidden="true"
+        className="fa-regular fa-chevron-down text-foreground-neutral-weak size-4 pointer-events-none"
+      />

-            <i className="fa-regular fa-check pointer-events-none" />
+            <i aria-hidden="true" className="fa-regular fa-check pointer-events-none" />

-      <i className="fa-regular fa-chevron-up" />
+      <i aria-hidden="true" className="fa-regular fa-chevron-up" />

-      <i className="fa-regular fa-chevron-down" />
+      <i aria-hidden="true" className="fa-regular fa-chevron-down" />

Also applies to: 143-143, 180-180, 198-198

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/eclipse/src/components/select.tsx` at line 60, The decorative <i>
icons in the select component are currently exposed to assistive tech; update
each decorative icon element (e.g., the <i> with className "fa-regular
fa-chevron-down text-foreground-neutral-weak size-4 pointer-events-none" and the
other similar <i> occurrences) to include aria-hidden="true" so screen readers
ignore them; locate these <i> elements in the select component
(packages/eclipse/src/components/select.tsx) and add aria-hidden="true" to each
decorative icon instance.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

♻️ Duplicate comments (2)
apps/eclipse/content/design-system/components/select.mdx (2)

665-678: ⚠️ Potential issue | 🟡 Minor

Add the missing useState import in the controlled snippet.

Line [667] uses useState without importing it, so the snippet is not copy-paste runnable.

Suggested patch
 **Controlled (with value and onValueChange):**
 ```tsx
+import { useState } from "react";
+
 const [value, setValue] = useState("option1");
#!/bin/bash
# Verify whether the controlled example includes a useState import near its usage.
awk 'NR>=662 && NR<=676 {print NR ":" $0}' apps/eclipse/content/design-system/components/select.mdx

Expected result: an import { useState } from "react"; line appears before const [value, setValue] = useState("option1");.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/eclipse/content/design-system/components/select.mdx` around lines 665 -
678, The controlled example uses useState but doesn't import it; add an import
statement importing useState from React (import { useState } from "react";)
before the line that declares const [value, setValue] = useState("option1"); so
the Select example (Select, SelectTrigger, SelectValue, SelectContent,
SelectItem) is copy-paste runnable.

443-446: ⚠️ Potential issue | 🟡 Minor

Correct the documented SelectContent defaults.

Line [443] and Line [446] still document defaults that conflict with the component defaults, which can mislead consumers.

Suggested patch
- - `align` - Alignment relative to trigger ("start" | "center" | "end", default: "center")
+ - `align` - Alignment relative to trigger ("start" | "center" | "end", default: "start")
...
- - `alignItemWithTrigger` - Align selected item with trigger (boolean, default: true)
+ - `alignItemWithTrigger` - Align selected item with trigger (boolean, default: false)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/eclipse/content/design-system/components/select.mdx` around lines 443 -
446, Update the SelectContent documentation so the prop default values match the
actual component implementation: in the SelectContent docs (props: align,
sideOffset, alignOffset, alignItemWithTrigger) change the documented defaults
for `align` and `alignItemWithTrigger` to exactly match the defaults used by the
SelectContent component (use the values from the SelectContent
implementation/props). Ensure the docs list the same default strings/booleans as
the component (refer to SelectContent's prop defaults for the correct values).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@apps/eclipse/content/design-system/components/select.mdx`:
- Around line 665-678: The controlled example uses useState but doesn't import
it; add an import statement importing useState from React (import { useState }
from "react";) before the line that declares const [value, setValue] =
useState("option1"); so the Select example (Select, SelectTrigger, SelectValue,
SelectContent, SelectItem) is copy-paste runnable.
- Around line 443-446: Update the SelectContent documentation so the prop
default values match the actual component implementation: in the SelectContent
docs (props: align, sideOffset, alignOffset, alignItemWithTrigger) change the
documented defaults for `align` and `alignItemWithTrigger` to exactly match the
defaults used by the SelectContent component (use the values from the
SelectContent implementation/props). Ensure the docs list the same default
strings/booleans as the component (refer to SelectContent's prop defaults for
the correct values).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: a7c82757-9b4a-40ab-b509-343a3b0eb6d9

📥 Commits

Reviewing files that changed from the base of the PR and between 04dc853 and a80a889.

📒 Files selected for processing (1)
  • apps/eclipse/content/design-system/components/select.mdx

@ArthurGamby
Copy link
Contributor

Looks good, do you think we could add a subtil hover effect when hovering the select component ?
Also I wonder, is it a design choice to not have cursor:pointer when hovering ?

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.

3 participants