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 committed Mar 7, 2024
1 parent 93d1f5f commit 200fb18
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

0 comments on commit 200fb18

Please sign in to comment.