Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/twenty-socks-count.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/polaris': patch
---

Fixed visual spacing regressions on `ActionList` and `Modal.Header`
17 changes: 7 additions & 10 deletions polaris-react/src/components/ActionList/ActionList.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,19 @@
padding: 0;
}

.Section-withoutTitle:not(:first-child) {
.Section:not(:first-child) {
border-top: var(--p-border-divider);

// stylelint-disable-next-line selector-max-class, selector-max-combinators, selector-max-specificity
> .Section-withoutTitle .Actions {
padding-top: var(--p-space-2);
}
}

.Actions {
outline: none;
list-style: none;
margin: 0;
border-bottom: var(--p-border-divider);
padding: var(--p-space-2);
}

Expand All @@ -24,7 +28,7 @@
// stylelint-disable-next-line selector-max-class, selector-max-combinators, selector-max-specificity
> .Section-withoutTitle .Actions {
border-top: none;
border-bottom: none;
padding-top: var(--p-space-2);
}
}

Expand All @@ -35,13 +39,6 @@
}
}

.ActionList .Section:last-child {
// stylelint-disable-next-line selector-max-class, selector-max-combinators, selector-max-specificity
.Actions {
border-bottom: none;
}
}

.Item {
--pc-action-list-image-size: 20px;
--pc-action-list-item-min-height: var(--p-space-10);
Expand Down
41 changes: 41 additions & 0 deletions polaris-react/src/components/ActionList/ActionList.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,47 @@ export function WithSections() {
);
}

export function WithSectionsNoTitles() {
const [active, setActive] = useState(true);

const toggleActive = useCallback(() => setActive((active) => !active), []);

const activator = (
<Button onClick={toggleActive} disclosure>
More actions
</Button>
);

return (
<div style={{height: '250px'}}>
<Popover
active={active}
activator={activator}
autofocusTarget="first-node"
onClose={toggleActive}
>
<ActionList
actionRole="menuitem"
sections={[
{
items: [
{content: 'Import file', icon: ImportMinor},
{content: 'Export file', icon: ExportMinor},
],
},
{
items: [
{content: 'Edit', icon: EditMinor},
{content: 'Delete', icon: DeleteMinor},
],
},
]}
/>
</Popover>
</div>
);
}

export function WithDestructiveItem() {
const [active, setActive] = useState(true);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@
.Title {
@include text-breakword;
flex: 1;
margin-top: var(--p-space-1);
align-self: center;
}