@@ -10,67 +10,67 @@ export interface BleedProps {
1010 /** Negative horizontal space around children
1111 * @default '5'
1212 */
13- horizontal ?: SpacingSpaceScale ;
13+ marginInline ?: SpacingSpaceScale ;
1414 /** Negative vertical space around children */
15- vertical ?: SpacingSpaceScale ;
15+ marginBlock ?: SpacingSpaceScale ;
1616 /** Negative top space around children */
17- top ?: SpacingSpaceScale ;
17+ marginBlockStart ?: SpacingSpaceScale ;
1818 /** Negative bottom space around children */
19- bottom ?: SpacingSpaceScale ;
19+ marginBlockEnd ?: SpacingSpaceScale ;
2020 /** Negative left space around children */
21- left ?: SpacingSpaceScale ;
21+ marginInlineStart ?: SpacingSpaceScale ;
2222 /** Negative right space around children */
23- right ?: SpacingSpaceScale ;
23+ marginInlineEnd ?: SpacingSpaceScale ;
2424}
2525
2626export const Bleed = ( {
27- horizontal = '5' ,
28- vertical ,
29- top ,
30- bottom ,
31- left ,
32- right ,
27+ marginInline = '5' ,
28+ marginBlock ,
29+ marginBlockStart ,
30+ marginBlockEnd ,
31+ marginInlineStart ,
32+ marginInlineEnd ,
3333 children,
3434} : BleedProps ) => {
3535 const getNegativeMargins = ( direction : string ) => {
36- const xAxis = [ 'left ' , 'right ' ] ;
37- const yAxis = [ 'top ' , 'bottom ' ] ;
36+ const xAxis = [ 'marginInlineStart ' , 'marginInlineEnd ' ] ;
37+ const yAxis = [ 'marginBlockStart ' , 'marginBlockEnd ' ] ;
3838
3939 const directionValues : { [ key : string ] : string | undefined } = {
40- top ,
41- bottom ,
42- left ,
43- right ,
44- horizontal ,
45- vertical ,
40+ marginBlockStart ,
41+ marginBlockEnd ,
42+ marginInlineStart ,
43+ marginInlineEnd ,
44+ marginInline ,
45+ marginBlock ,
4646 } ;
4747
4848 if ( directionValues [ direction ] ) {
4949 return directionValues [ direction ] ;
50- } else if ( ! yAxis . includes ( direction ) && horizontal ) {
51- return directionValues . horizontal ;
52- } else if ( ! xAxis . includes ( direction ) && vertical ) {
53- return directionValues . vertical ;
50+ } else if ( xAxis . includes ( direction ) && marginInline ) {
51+ return directionValues . marginInline ;
52+ } else if ( yAxis . includes ( direction ) && marginBlock ) {
53+ return directionValues . marginBlock ;
5454 }
5555 } ;
5656
57- const negativeTop = getNegativeMargins ( 'top ' ) ;
58- const negativeLeft = getNegativeMargins ( 'left ' ) ;
59- const negativeRight = getNegativeMargins ( 'right ' ) ;
60- const negativeBottom = getNegativeMargins ( 'bottom ' ) ;
57+ const negativeMarginBlockStart = getNegativeMargins ( 'marginBlockStart ' ) ;
58+ const negativeMarginBlockEnd = getNegativeMargins ( 'marginBlockEnd ' ) ;
59+ const negativeMarginInlineStart = getNegativeMargins ( 'marginInlineStart ' ) ;
60+ const negativeMarginInlineEnd = getNegativeMargins ( 'marginInlineEnd ' ) ;
6161
6262 const style = {
63- '--pc-bleed-margin-bottom ' : negativeBottom
64- ? `var(--p-space-${ negativeBottom } )`
63+ '--pc-bleed-margin-block-start ' : negativeMarginBlockStart
64+ ? `var(--p-space-${ negativeMarginBlockStart } )`
6565 : undefined ,
66- '--pc-bleed-margin-left ' : negativeLeft
67- ? `var(--p-space-${ negativeLeft } )`
66+ '--pc-bleed-margin-block-end ' : negativeMarginBlockEnd
67+ ? `var(--p-space-${ negativeMarginBlockEnd } )`
6868 : undefined ,
69- '--pc-bleed-margin-right ' : negativeRight
70- ? `var(--p-space-${ negativeRight } )`
69+ '--pc-bleed-margin-inline-start ' : negativeMarginInlineStart
70+ ? `var(--p-space-${ negativeMarginInlineStart } )`
7171 : undefined ,
72- '--pc-bleed-margin-top ' : negativeTop
73- ? `var(--p-space-${ negativeTop } )`
72+ '--pc-bleed-margin-inline-end ' : negativeMarginInlineEnd
73+ ? `var(--p-space-${ negativeMarginInlineEnd } )`
7474 : undefined ,
7575 } as React . CSSProperties ;
7676
0 commit comments