13 Commits

Author SHA1 Message Date
12b1d530c4 refactor(cli): change onSubmit typing in SearchBox
The onSubmit function typing in the SearchBox component was changed from handling a string to handling a generic T type object. Also, the onSubmit function now uses the found item in components based on the selected suggestion to submit instead of submitting directly.
2024-06-08 02:51:27 +09:00
62e606f273 fix(cli): update dependencies in SearchBox useEffect
The dependencies array in the useEffect hook within SearchBox.tsx has been updated. The 'suggestions' variable has been added to the dependencies to ensure the function updates accordingly when this state changes.
2024-06-08 02:46:23 +09:00
483930474b feat(cli): add query mode to SearchBox component
Added a new stateful variable, 'queryMode', to the 'SearchBox' component in the CLI to enhance its functionality. As a result, 'Input' and suggestion fetching are now conditioned by this mode, providing more controled user search management and interaction with the autocomplete feature.
2024-06-08 02:15:08 +09:00
f4b79f1f02 refactor(cli): adjust SearchBox styling
Decreased the marginRight property from 2 to 1 in the SearchBox component of the CLI to improve layout. Also modified the placeholder text in the Input field for better readability.
2024-06-08 02:08:44 +09:00
0fea1a50e3 fix(cli): update condition in SearchBox component
This commit modifies a conditional statement in the SearchBox component to properly manage the selected index based on the length of search results. This ensures appropriate selection even when the result length is less than or equal to the selected index.
2024-06-08 02:08:26 +09:00
803659a06b refactor(cli): remove unused Spinner import
The unnecessary Spinner import from 'ink-spinner' was removed in the SearchBox component. This reduces clutter and enhances code readability.
2024-06-08 02:05:21 +09:00
d2a457d1c8 feat(cli): update SearchBox component
In the SearchBox component, a new onSubmit prop has been added for user's search input handling. The UI has also been updated: changed border styles, introduced color changes based on selection and added placeholder for search input.
2024-06-08 01:55:07 +09:00
dd0ed06545 refactor(cli): changed SearchBox component to support generic types
The SearchBox component in the CLI package now supports generic types, enhancing its flexibility. The onChange method now returns selected item details, instead of just returning the key. The SearchBox props have been modified to support the generic type T.
2024-06-08 01:43:09 +09:00
f81a77b452 feat(cli): enhance SearchBox functionality
Added 'onChange' prop to the SearchBox component for active response to selection changes. Also updated the 'components' prop type and handled the related changes in the 'getSuggestion' use case. This includes mapping the components to their keys, updating the display name and handling selected results.
2024-06-07 22:27:28 +09:00
e222b9f7a2 feat(cli): improve search command and user interaction
The search command in the CLI is enhanced to recognize search queries as command arguments. An improved interaction with the search box is also introduced, including key event handlers for up and down arrows and  escape key, allowing users to navigate more intuitively. keyboard-based selection of suggestions is now implemented and the helper message is updated to match these interaction changes.
2024-06-07 21:54:34 +09:00
3e0d29fd56 feat(cli): add initialQuery prop to SearchBox
The SearchBox component in the Command Line Interface (CLI) now accepts an optional initialQuery prop. This prop is used to set the initial state of the search box query, which enables prepopulating the search box with a specific string if desired.
2024-06-07 21:37:42 +09:00
4319053d5d feat(cli): add search command
A new command has been added to the CLI package to search for components. This command fetches the registry and lists accessible components through the SearchBox component. The SearchBox component has also been updated to show a helper text and a new styled border for better user interaction.
2024-06-07 21:36:25 +09:00
339242cc05 feat(cli): add Divider and SearchBox components
A Divider and a SearchBox component have been added to the CLI. The Divider is a simple component for displaying a horizontal line. The SearchBox takes a list of components as props and provides a live search functionality, showing suggestions for user inputs.
2024-06-07 21:32:01 +09:00