Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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/hip-grapes-build.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@shopify/polaris': minor
'polaris.shopify.com': patch
---

Updated `Box` to accept role attribute
5 changes: 5 additions & 0 deletions polaris-react/src/components/Box/Box.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import styles from './Box.scss';
type Element = 'div' | 'span' | 'section';
type Overflow = 'hidden' | 'scroll';
type Position = 'relative' | 'absolute' | 'fixed' | 'sticky';
type Role = 'status';

export type ColorTokenScale =
| 'text'
Expand Down Expand Up @@ -150,6 +151,8 @@ export interface BoxProps extends React.AriaAttributes {
* paddingInlineEnd={{xs: '2', sm: '3', md: '4', lg: '5', xl: '6'}}
*/
paddingInlineEnd?: Spacing;
/** role of box */
role?: Role;
/** Shadow on box */
shadow?: DepthShadowAlias;
/** Width of container */
Expand Down Expand Up @@ -206,6 +209,7 @@ export const Box = forwardRef<HTMLElement, BoxProps>(
paddingBlockEnd,
paddingInlineStart,
paddingInlineEnd,
role,
shadow,
width,
visuallyHidden,
Expand Down Expand Up @@ -327,6 +331,7 @@ export const Box = forwardRef<HTMLElement, BoxProps>(
id,
ref,
style: sanitizeCustomProperties(style),
role,
...restProps,
},
children,
Expand Down
Loading