Skip to content

Commit c6a1814

Browse files
committed
change single selection
1 parent 7c9a479 commit c6a1814

File tree

2 files changed

+3
-21
lines changed

2 files changed

+3
-21
lines changed

packages/components/src/ListBox.tsx

+2-11
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,9 @@ import {
1111
composeRenderProps,
1212
} from 'react-aria-components';
1313

14+
import { Icon } from '@launchpad-ui/icons';
1415
import { CheckboxInner } from './Checkbox';
1516
import { checkbox } from './Checkbox';
16-
import { RadioInner } from './Radio';
17-
import { radio } from './Radio';
1817
import styles from './styles/ListBox.module.css';
1918
const box = cva(styles.box);
2019
const item = cva(styles.item);
@@ -71,16 +70,8 @@ const ListBoxItem = <T extends object>({ ref, ...props }: ListBoxItemProps<T>) =
7170
<CheckboxInner isSelected={isSelected} />
7271
</div>
7372
)}
74-
{selectionMode === 'single' && (
75-
<div
76-
className={radio()}
77-
data-selected={isSelected || undefined}
78-
data-disabled={isDisabled || undefined}
79-
>
80-
<RadioInner isSelected={isSelected} />
81-
</div>
82-
)}
8373
<span className={styles.content}>{children}</span>
74+
{selectionMode === 'single' && isSelected && <Icon name="check-circle" size="small" />}
8475
</>
8576
))}
8677
</AriaListBoxItem>

packages/components/src/Menu.tsx

+1-10
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import {
1818
} from 'react-aria-components';
1919

2020
import { CheckboxInner, checkbox } from './Checkbox';
21-
import { RadioInner, radio } from './Radio';
2221
import styles from './styles/Menu.module.css';
2322

2423
const menu = cva(styles.menu);
@@ -75,16 +74,8 @@ const MenuItem = <T extends object>({ variant = 'default', ref, ...props }: Menu
7574
<CheckboxInner isSelected={isSelected} />
7675
</div>
7776
)}
78-
{selectionMode === 'single' && (
79-
<div
80-
className={radio()}
81-
data-selected={isSelected || undefined}
82-
data-disabled={isDisabled || undefined}
83-
>
84-
<RadioInner isSelected={isSelected} />
85-
</div>
86-
)}
8777
<span className={styles.content}>{children}</span>
78+
{selectionMode === 'single' && isSelected && <Icon name="check-circle" size="small" />}
8879
{hasSubmenu && <Icon name="chevron-right" size="small" />}
8980
</>
9081
),

0 commit comments

Comments
 (0)