Skip to content

Commit fc78fcc

Browse files
authored
Fix typo in box property, remove PropsWithChildren (#7561)
1 parent fa708cb commit fc78fcc

File tree

4 files changed

+14
-6
lines changed

4 files changed

+14
-6
lines changed

.changeset/stale-dots-knock.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@shopify/polaris': patch
3+
---
4+
5+
Fix typo in box property, remove PropsWithChildren

polaris-react/src/components/Box/Box.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
--pc-box-border-radius-start-end,
4343
var(--pc-box-border-radius)
4444
);
45-
border-block-end: var(--pc-box-border-bottom, var(--pc-box-border));
45+
border-block-end: var(--pc-box-border-block-end, var(--pc-box-border));
4646
border-inline-start: var(--pc-box-border-inline-start, var(--pc-box-border));
4747
border-inline-end: var(--pc-box-border-inline-end, var(--pc-box-border));
4848
border-block-start: var(--pc-box-border-block-start, var(--pc-box-border));

polaris-react/src/components/Box/Box.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, {createElement, forwardRef, PropsWithChildren} from 'react';
1+
import React, {createElement, forwardRef} from 'react';
22
import type {
33
DepthShadowAlias,
44
SpacingSpaceScale,
@@ -135,7 +135,7 @@ interface Spacing {
135135
inlineEnd: SpacingSpaceScale;
136136
}
137137

138-
export interface BoxProps extends PropsWithChildren {
138+
export interface BoxProps {
139139
/** HTML Element type */
140140
as?: Element;
141141
/** Background color */
@@ -188,6 +188,8 @@ export interface BoxProps extends PropsWithChildren {
188188
shadow?: DepthShadowAlias;
189189
/** Set width of container */
190190
width?: string;
191+
/** Elements to display inside box */
192+
children?: React.ReactNode;
191193
}
192194

193195
export const Box = forwardRef<HTMLElement, BoxProps>(
@@ -248,7 +250,7 @@ export const Box = forwardRef<HTMLElement, BoxProps>(
248250
'--pc-box-color': color ? `var(--p-${color})` : undefined,
249251
'--pc-box-background': background ? `var(--p-${background})` : undefined,
250252
'--pc-box-border': border ? `var(--p-border-${border})` : undefined,
251-
'--pc-box-border-bottom': borders.blockEnd
253+
'--pc-box-border-block-end': borders.blockEnd
252254
? `var(--p-border-${borders.blockEnd})`
253255
: undefined,
254256
'--pc-box-border-inline-start': borders.inlineStart

polaris-react/src/components/Columns/Columns.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, {PropsWithChildren} from 'react';
1+
import React from 'react';
22
import type {
33
BreakpointsAlias,
44
SpacingSpaceScale,
@@ -16,13 +16,14 @@ type Spacing = {
1616
[Breakpoint in BreakpointsAlias]?: SpacingSpaceScale;
1717
};
1818

19-
export interface ColumnsProps extends PropsWithChildren {
19+
export interface ColumnsProps {
2020
/** The space between columns */
2121
spacing?: Spacing;
2222
/** The number of columns to display
2323
* @default {xs: 6, sm: 6, md: 6, lg: 6, xl: 6}
2424
*/
2525
columns?: Columns;
26+
/** Elements to display inside columns */
2627
children?: React.ReactNode;
2728
}
2829

0 commit comments

Comments
 (0)