Skip to content

Commit

Permalink
experimental/SelectPanel2: Add back button (#4288)
Browse files Browse the repository at this point in the history
* add back button

* add nested panel example

* fix nested panel focus

* implement save and cancel on second panel

* add onCancel for first panel

* Create fair-sloths-kick.md

* add preview for selection

* show dividers

* hide selection in story

* update snapshots

* make the first ActionList role=list

* add warning to story
  • Loading branch information
siddharthkp authored and lukasoppermann committed Apr 16, 2024
1 parent 9319652 commit 0c7b62f
Show file tree
Hide file tree
Showing 6 changed files with 290 additions and 17 deletions.
5 changes: 5 additions & 0 deletions .changeset/fair-sloths-kick.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/react": minor
---

experimental/SelectPanel: Add back button
6 changes: 4 additions & 2 deletions packages/react/src/ActionList/Selection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ export const Selection: React.FC<React.PropsWithChildren<SelectionProps>> = ({se
}

if (selectionVariant === 'single' || listRole === 'menu') {
return <LeadingVisualContainer>{selected && <CheckIcon />}</LeadingVisualContainer>
return (
<LeadingVisualContainer data-component="ActionList.Selection">{selected && <CheckIcon />}</LeadingVisualContainer>
)
}

/**
Expand Down Expand Up @@ -59,7 +61,7 @@ export const Selection: React.FC<React.PropsWithChildren<SelectionProps>> = ({se
}

return (
<LeadingVisualContainer>
<LeadingVisualContainer data-component="ActionList.Selection">
<Box
sx={{
borderColor: selected ? 'accent.fg' : 'neutral.emphasis',
Expand Down
Loading

0 comments on commit 0c7b62f

Please sign in to comment.