Skip to content

Commit

Permalink
adds inactive single select story
Browse files Browse the repository at this point in the history
  • Loading branch information
mperrotti committed Nov 17, 2023
1 parent cc05edb commit 883b63d
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/ActionList/ActionList.features.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,25 @@ export const SingleSelect = () => {
)
}

export const InactiveSingleSelect = () => {
const [selectedIndex, setSelectedIndex] = React.useState(1)
return (
<ActionList selectionVariant="single" showDividers role="menu" aria-label="Project">
<ActionList.Item role="menuitem" selected={false} inactiveText="Unavailable due to an outage">
Inactive item
</ActionList.Item>
<ActionList.Item
role="menuitemradio"
selected={selectedIndex === 1}
aria-checked={selectedIndex === 1}
onSelect={() => setSelectedIndex(1)}
>
Item 2
</ActionList.Item>
</ActionList>
)
}

export const MultiSelect = () => {
const [selectedIndices, setSelectedIndices] = React.useState<number[]>([0])
const handleSelect = (index: number) => {
Expand Down

0 comments on commit 883b63d

Please sign in to comment.