Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
c6bd1bc
feat(SearchForm): add SearchForm component
tsck Sep 23, 2025
58544a5
feat(SearchForm): implement SearchForm component with toggle function…
tsck Sep 24, 2025
56e3da1
refactor(CodeEditor): add back in panel import
tsck Sep 24, 2025
5eded55
refactor(SearchForm): further correct styling
tsck Sep 24, 2025
d978333
WIP
tsck Sep 24, 2025
fa6c306
refactor(SearchForm): Further correct styling
tsck Sep 25, 2025
e830312
make top row height more dynamic
tsck Sep 25, 2025
933b80d
fix top section height
tsck Sep 25, 2025
907cbb4
WIP
tsck Sep 26, 2025
a498900
Fix width styling
tsck Sep 29, 2025
3f9b74a
Fix box shadow
tsck Sep 30, 2025
f904171
Add find functionality
tsck Sep 30, 2025
67ecba2
Remove unnecessary space
tsck Sep 30, 2025
78f21f0
Add find selected index rendering
tsck Sep 30, 2025
9b8c567
Add replace functionality
tsck Oct 2, 2025
15d794d
Fix keyboard shortcuts
tsck Oct 2, 2025
df1cb0f
rename SearchForm to SearchPanel
tsck Oct 2, 2025
25a3733
fix top padding
tsck Oct 2, 2025
561ecac
Allow search panel to be disabled
tsck Oct 2, 2025
98257bd
fix dep array
tsck Oct 2, 2025
9bfa487
only load search module when needed
tsck Oct 2, 2025
b717e1d
fix darkmode and font size
tsck Oct 2, 2025
055634a
fix deps
tsck Oct 2, 2025
c1226bf
Fix focus and imports
tsck Oct 2, 2025
7185fd7
prevent panel from overflowing editor
tsck Oct 2, 2025
32806fe
add filter menu
tsck Oct 6, 2025
7847be3
pull out all handler
tsck Oct 6, 2025
4b9d033
add search panel tests
tsck Oct 6, 2025
9cb57dc
fix tests
tsck Oct 6, 2025
27cdca2
changeset
tsck Oct 6, 2025
008a7e7
remove unused styles
tsck Oct 6, 2025
de4fb39
update changeset
tsck Oct 6, 2025
5174e64
ignore react client TS issue
tsck Oct 6, 2025
4e628f3
add non-panel style
tsck Oct 7, 2025
b5d2777
fix dep arr
tsck Oct 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/yummy-jobs-wear.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@leafygreen-ui/code-editor': minor
---

- Adds a custom search panel to the `CodeEditor` component. Contains all of the same functionality that was in the built in panel but matches the LG design language.
- Adds prop to allow consumers to enable/disable the search panel.

1 change: 1 addition & 0 deletions packages/code-editor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ console.log(greet('MongoDB user'));`;
| `enableCodeFolding` _(optional)_ | Enables code folding arrows in the gutter. | `boolean` | `undefined` |
| `enableLineNumbers` _(optional)_ | Enables line numbers in the editor’s gutter. | `boolean` | `true` |
| `enableLineWrapping` _(optional)_ | Enables line wrapping when the text exceeds the editor’s width. | `boolean` | `true` |
| `enableSearchPanel` \_(optional)) | Enables the find and replace search panel in the editor. | `boolean` | `true` |
| `extensions` _(optional)_ | Additional CodeMirror extensions to apply to the editor. These will be applied with high precendence, meaning they can override extensions applied through built in props. See the [CodeMirror v6 System Guide](https://codemirror.net/docs/guide/) for more information. | `Array<CodeMirrorExtension>` | `[]` |
| `forceParsing` _(optional)_ | _**This should be used with caution as it can significantly impact performance!**_<br><br>Forces the parsing of the complete document, even parts not currently visible.<br><br>By default, the editor optimizes performance by only parsing the code that is visible on the screen, which is especially beneficial when dealing with large amounts of code. Enabling this option overrides this behavior and forces the parsing of all code, visible or not. This should generally be reserved for exceptional circumstances. | `boolean` | `false` |
| `height` _(optional)_ | Sets the editor's height. If not set, the editor will automatically adjust its height based on the content. | `string` | `undefined` |
Expand Down
3 changes: 3 additions & 0 deletions packages/code-editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,18 @@
"@leafygreen-ui/a11y": "workspace:^",
"@leafygreen-ui/badge": "workspace:^",
"@leafygreen-ui/button": "workspace:^",
"@leafygreen-ui/checkbox": "workspace:^",
"@leafygreen-ui/emotion": "workspace:^",
"@leafygreen-ui/hooks": "workspace:^",
"@leafygreen-ui/icon": "workspace:^",
"@leafygreen-ui/icon-button": "workspace:^",
"@leafygreen-ui/input-option": "workspace:^",
"@leafygreen-ui/leafygreen-provider": "workspace:^",
"@leafygreen-ui/lib": "workspace:^",
"@leafygreen-ui/menu": "workspace:^",
"@leafygreen-ui/modal": "workspace:^",
"@leafygreen-ui/palette": "workspace:^",
"@leafygreen-ui/text-input": "workspace:^",
"@leafygreen-ui/tokens": "workspace:^",
"@leafygreen-ui/tooltip": "workspace:^",
"@leafygreen-ui/typography": "workspace:^",
Expand Down
4 changes: 4 additions & 0 deletions packages/code-editor/src/CodeEditor.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ const meta: StoryMetaType<typeof CodeEditor> = {
enableCodeFolding: true,
enableLineNumbers: true,
enableLineWrapping: true,
enableSearchPanel: true,
baseFontSize: BaseFontSize.Body1,
forceParsing: false,
placeholder: 'Type your code here...',
Expand Down Expand Up @@ -113,6 +114,9 @@ const meta: StoryMetaType<typeof CodeEditor> = {
enableLineNumbers: {
control: { type: 'boolean' },
},
enableSearchPanel: {
control: { type: 'boolean' },
},
enableLineWrapping: {
control: { type: 'boolean' },
},
Expand Down
Loading
Loading