@@ -122,9 +122,11 @@ export default function Dialog({
122
122
123
123
export const DialogScrollContainer = ( {
124
124
children,
125
+ horizontalScroll,
125
126
navigate,
126
127
} : {
127
128
children : ReactNode ;
129
+ horizontalScroll ?: boolean ;
128
130
key : string ;
129
131
navigate : boolean ;
130
132
} ) => {
@@ -196,7 +198,10 @@ export const DialogScrollContainer = ({
196
198
197
199
return (
198
200
< div className = { scrollContainerStyle } >
199
- < ScrollContainer className = { scrollStyle } ref = { setRef } >
201
+ < ScrollContainer
202
+ className = { cx ( scrollStyle , horizontalScroll && overflowXStyle ) }
203
+ ref = { setRef }
204
+ >
200
205
{ children }
201
206
</ ScrollContainer >
202
207
< div className = { cx ( scrollDownStyle , showArrow && arrowVisibleStyle ) } >
@@ -208,32 +213,6 @@ export const DialogScrollContainer = ({
208
213
) ;
209
214
} ;
210
215
211
- const scrollDownStyle = css `
212
- background-image : linear-gradient (
213
- 0deg ,
214
- ${ applyVar ( 'background-color' ) } 10px ,
215
- rgba (255 , 255 , 255 , 0 ) 30px
216
- );
217
- bottom : -1px ;
218
- inset : 0 ;
219
- opacity : 0 ;
220
- pointer-events : none;
221
- position : fixed;
222
- transition : opacity 300ms ease;
223
- ` ;
224
-
225
- const scrollDownIconStyle = css `
226
- bottom : 4px ;
227
- color : ${ applyVar ( 'border-color' ) } ;
228
- position : absolute;
229
- right : 4px ;
230
- transform : rotate (-90deg );
231
- ` ;
232
-
233
- const arrowVisibleStyle = css `
234
- opacity : 1 ;
235
- ` ;
236
-
237
216
export const DialogTabBar = ( { children } : { children : ReactNode } ) => (
238
217
< div className = { tabBarStyle } > { children } </ div >
239
218
) ;
@@ -350,6 +329,10 @@ const scrollStyle = css`
350
329
position : absolute;
351
330
` ;
352
331
332
+ const overflowXStyle = css `
333
+ overflow-x : auto;
334
+ ` ;
335
+
353
336
// `translateZ` is required for Safari, otherwise it doesn't place the containing `position: fixed` element correctly.
354
337
const scrollContainerStyle = css `
355
338
inset : 0 ;
@@ -453,3 +436,30 @@ const closeButtonStyle = css`
453
436
top : -${ DoubleSize } px;
454
437
width : ${ DoubleSize } px;
455
438
` ;
439
+
440
+ const scrollDownStyle = css `
441
+ background-image : linear-gradient (
442
+ 0deg ,
443
+ ${ applyVar ( 'background-color' ) } 10px ,
444
+ rgba (255 , 255 , 255 , 0 ) 30px
445
+ );
446
+ bottom : -1px ;
447
+ inset : 0 ;
448
+ opacity : 0 ;
449
+ pointer-events : none;
450
+ position : fixed;
451
+ transition : opacity 300ms ease;
452
+ z-index : 1000 ;
453
+ ` ;
454
+
455
+ const scrollDownIconStyle = css `
456
+ bottom : 4px ;
457
+ color : ${ applyVar ( 'border-color' ) } ;
458
+ position : absolute;
459
+ right : 4px ;
460
+ transform : rotate (-90deg );
461
+ ` ;
462
+
463
+ const arrowVisibleStyle = css `
464
+ opacity : 1 ;
465
+ ` ;
0 commit comments