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
6 changes: 6 additions & 0 deletions .changeset/happy-llamas-doubt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@shopify/polaris': minor
'polaris.shopify.com': patch
---

Added support for `ul` element on `Box`
8 changes: 8 additions & 0 deletions polaris-react/src/components/Box/Box.scss
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,11 @@
.visuallyHidden {
@include visually-hidden;
}

.listReset {
list-style-type: none;
margin-block-start: 0;
margin-block-end: 0;
outline: none;
padding-inline-start: 0;
}
3 changes: 2 additions & 1 deletion polaris-react/src/components/Box/Box.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {

import styles from './Box.scss';

type Element = 'div' | 'span' | 'section';
type Element = 'div' | 'span' | 'section' | 'ul';
type Overflow = 'hidden' | 'scroll';
type Position = 'relative' | 'absolute' | 'fixed' | 'sticky';

Expand Down Expand Up @@ -321,6 +321,7 @@ export const Box = forwardRef<HTMLElement, BoxProps>(
const className = classNames(
styles.Box,
visuallyHidden && styles.visuallyHidden,
as === 'ul' && styles.listReset,
);

return createElement(
Expand Down
Loading