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/selfish-poets-lick.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@shopify/polaris': patch
'polaris.shopify.com': patch
---

Renamed `AlphaCard` `shadow` prop
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export function BorderRadiusRoundedAbove() {

export function Flat() {
return (
<AlphaCard elevation="transparent">
<AlphaCard shadow="transparent">
<AlphaStack spacing="5">
<Text as="h3" variant="headingMd">
Online store dashboard
Expand Down
11 changes: 4 additions & 7 deletions polaris-react/src/components/AlphaCard/AlphaCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ import React from 'react';
import {useBreakpoints} from '../../utilities/breakpoints';
import {Box} from '../Box';

type CardElevationTokensScale = Extract<
DepthShadowAlias,
'card' | 'transparent'
>;
type CardShadowTokensScale = Extract<DepthShadowAlias, 'card' | 'transparent'>;

type CardBackgroundColorTokenScale = Extract<
ColorsTokenName,
Expand All @@ -25,7 +22,7 @@ export interface AlphaCardProps {
children?: React.ReactNode;
background?: CardBackgroundColorTokenScale;
hasBorderRadius?: boolean;
elevation?: CardElevationTokensScale;
shadow?: CardShadowTokensScale;
padding?: SpacingSpaceScale;
roundedAbove?: BreakpointsAlias;
}
Expand All @@ -34,7 +31,7 @@ export const AlphaCard = ({
children,
background = 'surface',
hasBorderRadius: hasBorderRadiusProp = true,
elevation = 'card',
shadow = 'card',
padding = '5',
roundedAbove,
}: AlphaCardProps) => {
Expand All @@ -51,7 +48,7 @@ export const AlphaCard = ({
<Box
background={background}
padding={padding}
shadow={elevation}
shadow={shadow}
{...(hasBorderRadius && {borderRadius: defaultBorderRadius})}
>
{children}
Expand Down
2 changes: 1 addition & 1 deletion polaris.shopify.com/pages/examples/alpha-card-flat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {withPolarisExample} from '../../src/components/PolarisExampleWrapper';

function AlphaCardExample() {
return (
<AlphaCard elevation="transparent">
<AlphaCard shadow="transparent">
<AlphaStack spacing="5">
<Text as="h3" variant="headingMd">
Online store dashboard
Expand Down