Skip to content

Commit

Permalink
fix: remove error div from studio search (#14414)
Browse files Browse the repository at this point in the history
  • Loading branch information
standeren authored Jan 15, 2025
1 parent 3089d3b commit 60ea6c6
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.studioSearch div:empty {
display: contents;
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { forwardRef, useId } from 'react';
import { Label, Search, type SearchProps } from '@digdir/designsystemet-react';
import type { WithoutAsChild } from '../../types/WithoutAsChild';
import classes from './StudioSearch.module.css';

export type StudioSearchProps = WithoutAsChild<SearchProps>;

Expand All @@ -10,14 +11,15 @@ const StudioSearch = forwardRef<HTMLInputElement, StudioSearchProps>(
const searchId = id ?? generatedId;
const showLabel = !!label;

// TODO: Remove studioSearch css class when Design System is updated. See issue: https://github.com/digdir/designsystemet/issues/2765
return (
<div className={className}>
{showLabel && (
<Label htmlFor={searchId} spacing>
{label}
</Label>
)}
<Search {...rest} id={searchId} size={size} ref={ref} />
<Search {...rest} className={classes.studioSearch} id={searchId} size={size} ref={ref} />
</div>
);
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,3 @@
gap: var(--fds-spacing-3);
justify-content: flex-start;
}

.searchField {
display: flex;
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,7 @@ export function CodeListsActionsBar({

return (
<div className={classes.actionsBar}>
<StudioSearch
className={classes.searchField}
label={t('app_content_library.code_lists.search_label')}
/>
<StudioSearch label={t('app_content_library.code_lists.search_label')} />
<CreateNewCodeListModal onUpdateCodeList={onUpdateCodeList} codeListNames={codeListNames} />
<StudioFileUploader
accept='.json'
Expand Down
4 changes: 2 additions & 2 deletions frontend/packages/text-editor/src/TextEditor.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
border-bottom: 1px solid #bcc7cc;
padding: var(--fds-spacing-6);
display: flex;
align-items: center;
align-items: flex-end;
justify-content: space-between;
}

.filterAndSearch {
display: flex;
flex-direction: row;
align-items: center;
align-items: flex-end;
gap: var(--fds-spacing-4);
}

Expand Down

0 comments on commit 60ea6c6

Please sign in to comment.