Skip to content

Commit 9581f89

Browse files
authored
fix(eds-core-react): replace styled-components Progress with spinning icon in Autocomplete (#4982)
* fix(next): replace old styled-components Progress with spinning icon in Autocomplete Removes the styled-components dependency from next/Autocomplete by swapping Progress.Circular for a spinning next/Icon. A TODO marks the spot to restore a proper next/Progress when that component is available. Part of #4978 * fix(eds-core-react): fix Prettier import formatting in Autocomplete
1 parent f11da0b commit 9581f89

2 files changed

Lines changed: 23 additions & 4 deletions

File tree

packages/eds-core-react/src/components/next/Autocomplete/Autocomplete.tsx

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@ import {
1212
type ReactElement,
1313
type RefAttributes,
1414
} from 'react'
15-
import { search as searchIcon, close, add_box } from '@equinor/eds-icons'
15+
import {
16+
search as searchIcon,
17+
close,
18+
add_box,
19+
refresh,
20+
} from '@equinor/eds-icons'
1621
import type { AutocompleteProps } from './Autocomplete.types'
1722
import {
1823
defaultOptionsFilter,
@@ -25,8 +30,6 @@ import { Input } from '../Input'
2530
import { Icon } from '../Icon'
2631
import { Button } from '../Button'
2732
import { Menu, MenuItem } from '../Menu'
28-
// TODO: replace with next/Progress when available
29-
import { Progress } from '../../Progress'
3033

3134
type OptionItem<T> =
3235
| { type: 'list'; value: T }
@@ -486,7 +489,13 @@ function AutocompleteInner<T = string>(
486489
startAdornment={<Icon data={searchIcon} className="search-icon" />}
487490
endAdornment={
488491
loading ? (
489-
<Progress.Circular size={16} />
492+
// TODO: replace with next/Progress when available
493+
<Icon
494+
data={refresh}
495+
size="xs"
496+
className="loading-icon"
497+
aria-label="Loading"
498+
/>
490499
) : (
491500
<Button
492501
variant="ghost"

packages/eds-core-react/src/components/next/Autocomplete/autocomplete.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
1+
@keyframes eds-autocomplete-spin {
2+
to {
3+
transform: rotate(360deg);
4+
}
5+
}
6+
17
@layer eds-components {
28
.eds-autocomplete {
9+
& .loading-icon {
10+
animation: eds-autocomplete-spin 1s linear infinite;
11+
}
12+
313
& .anchor {
414
anchor-name: var(--menu-anchor);
515
}

0 commit comments

Comments
 (0)