Skip to content

Commit 4e628f3

Browse files
committed
add non-panel style
1 parent 5174e64 commit 4e628f3

File tree

5 files changed

+14
-1
lines changed

5 files changed

+14
-1
lines changed

packages/code-editor/src/CodeEditor/CodeEditor.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,8 @@ const BaseCodeEditor = forwardRef<CodeEditorHandle, CodeEditorProps>(
285285
React.createElement(SearchPanel, {
286286
view,
287287
darkMode: props.darkMode,
288+
baseFontSize: props.baseFontSize,
289+
hasPanel: !!panel,
288290
}),
289291
);
290292
return { dom, top: true };

packages/code-editor/src/CodeEditor/hooks/extensions/useThemeExtension.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ export function useThemeExtension({
7676
borderBottomRightRadius: `${borderRadius[300]}px`,
7777
borderTopLeftRadius: hasPanel ? 0 : `${borderRadius[300]}px`,
7878
borderTopRightRadius: hasPanel ? 0 : `${borderRadius[300]}px`,
79-
overflow: 'hidden',
8079
color: color[theme].text[Variant.Primary][InteractionState.Default],
8180
},
8281

packages/code-editor/src/SearchPanel/SearchPanel.styles.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,18 @@ export const getContainerStyles = ({
6868
theme,
6969
isOpen,
7070
baseFontSize,
71+
hasPanel,
7172
}: {
7273
theme: Theme;
7374
isOpen: boolean;
7475
baseFontSize: BaseFontSize;
76+
hasPanel: boolean;
7577
}) =>
7678
cx(getBaseContainerStyles(theme, baseFontSize), {
7779
[openContainerStyles]: isOpen,
80+
[css`
81+
border-top-right-radius: ${borderRadius[300]}px;
82+
`]: !hasPanel,
7883
});
7984

8085
export const findSectionStyles = css`

packages/code-editor/src/SearchPanel/SearchPanel.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ export function SearchPanel({
4848
view,
4949
darkMode,
5050
baseFontSize: baseFontSizeProp,
51+
hasPanel,
5152
}: SearchPanelProps) {
5253
const [isOpen, setIsOpen] = useState(false);
5354
const [searchString, setSearchString] = useState('');
@@ -229,6 +230,7 @@ export function SearchPanel({
229230
theme,
230231
isOpen,
231232
baseFontSize: baseFontSizeProp || baseFontSize,
233+
hasPanel,
232234
})}
233235
data-no-context-menu="true"
234236
>

packages/code-editor/src/SearchPanel/SearchPanel.types.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,9 @@ export interface SearchPanelProps extends DarkModeProps {
1515
* The CodeMirror view instance.
1616
*/
1717
view: CodeMirrorView;
18+
19+
/**
20+
* Whether the CodeEditor is rendered within a panel component as well.
21+
*/
22+
hasPanel: boolean;
1823
}

0 commit comments

Comments
 (0)