You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A searchable menu interface that combines the functionality of Menu and ListBox components. It provides a command-line-like experience for users to quickly find and execute actions through a searchable interface.
10
10
@@ -20,17 +20,17 @@ A searchable menu interface that combines the functionality of Menu and ListBox
20
20
21
21
### Default Usage
22
22
23
-
<Storyof={CommandPaletteStories.Default} />
23
+
<Storyof={CommandMenuStories.Default} />
24
24
25
25
## Props
26
26
27
-
<Controlsof={CommandPaletteStories.Default} />
27
+
<Controlsof={CommandMenuStories.Default} />
28
28
29
29
## Styling
30
30
31
31
### Style Props
32
32
33
-
The CommandPalette component supports all standard style properties:
33
+
The CommandMenu component supports all standard style properties:
Copy file name to clipboardExpand all lines: src/components/actions/CommandMenu/CommandMenu.spec.md
+26-26Lines changed: 26 additions & 26 deletions
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
-
# CommandPalette Component Specification
1
+
# CommandMenu Component Specification
2
2
3
3
## Overview
4
4
5
-
The CommandPalette component is a searchable menu interface that combines the functionality of Menu and ListBox components. It provides a command-line-like experience for users to quickly find and execute actions through a searchable interface.
5
+
The CommandMenu component is a searchable menu interface that combines the functionality of Menu and ListBox components. It provides a command-line-like experience for users to quickly find and execute actions through a searchable interface.
6
6
7
7
## Component Features
8
8
@@ -18,7 +18,7 @@ The CommandPalette component is a searchable menu interface that combines the fu
18
18
-**Enhanced search**: Keywords-based matching and custom value support
19
19
20
20
### Key Behaviors
21
-
- When CommandPalette gains focus, the search input is automatically focused
21
+
- When CommandMenu gains focus, the search input is automatically focused
22
22
- Arrow keys navigate through filtered options while search input retains focus
23
23
- Enter key selects the currently highlighted option
24
24
- Escape key clears search or closes the palette
@@ -32,33 +32,33 @@ The CommandPalette component is a searchable menu interface that combines the fu
32
32
## Required Files
33
33
34
34
### Core Component Files
35
-
1.**CommandPalette.tsx** - Main component implementation
35
+
1.**CommandMenu.tsx** - Main component implementation
6.**CommandMenu.test.tsx** - Unit tests (10-15 comprehensive tests)
43
43
44
44
### Integration Files
45
45
7.**Update src/components/actions/index.ts** - Export new components
46
46
8.**Update src/index.ts** - Export new components
47
47
48
48
## Implementation Approach
49
49
50
-
The CommandPalette will **reuse the existing Menu component** and add search functionality on top. This approach ensures we inherit all Menu features (sections, descriptions, tooltips, hotkeys) while adding search-specific capabilities. The implementation will follow the React Aria command palette example pattern, wrapping Menu with search input and filtering logic.
50
+
The CommandMenu will **reuse the existing Menu component** and add search functionality on top. This approach ensures we inherit all Menu features (sections, descriptions, tooltips, hotkeys) while adding search-specific capabilities. The implementation will follow the React Aria command palette example pattern, wrapping Menu with search input and filtering logic.
51
51
52
52
### Key Technical Insights
53
53
54
-
1.**Reuse Menu component**: CommandPalette will wrap the existing Menu component to inherit all features (sections, descriptions, tooltips, hotkeys)
54
+
1.**Reuse Menu component**: CommandMenu will wrap the existing Menu component to inherit all features (sections, descriptions, tooltips, hotkeys)
55
55
2.**Filter-based search**: Use React Stately's `filter` prop (like ListBox) to implement search functionality
56
56
3.**Virtual focus pattern**: Follow ListBox's search pattern - search input stays focused while arrow keys navigate menu items
57
-
4.**Reuse existing patterns**: Use `useDialogContainer(CommandPalette)` for programmatic usage - no need for a separate hook
57
+
4.**Reuse existing patterns**: Use `useDialogContainer(CommandMenu)` for programmatic usage - no need for a separate hook
0 commit comments