@@ -61,7 +61,7 @@ export const Simple: Story = {
6161 render : Default . render ,
6262} ;
6363
64- export const Scrolling : Story = {
64+ export const ScrollingHorizontal : Story = {
6565 render : ( args ) => (
6666 < Drawer { ...args } >
6767 < DrawerTrigger asChild >
@@ -86,6 +86,10 @@ export const Scrolling: Story = {
8686 { Array . from ( { length : 80 } ) . map ( ( ) => (
8787 < br key = { Math . random ( ) } />
8888 ) ) }
89+ < p >
90+ End of content. This is some placeholder content to show a
91+ vertically
92+ </ p >
8993 </ DrawerBody >
9094 < DrawerFooter >
9195 < DrawerClose variant = "outline" > Secondary</ DrawerClose >
@@ -96,24 +100,93 @@ export const Scrolling: Story = {
96100 ) ,
97101} ;
98102
99- export const LeftScrolling : Story = {
100- args : {
101- position : 'left' ,
102- } ,
103- render : Scrolling . render ,
103+ export const ScrollingVertical : Story = {
104+ render : ( args ) => (
105+ < Drawer { ...args } >
106+ < DrawerTrigger asChild >
107+ < Button variant = "outline" > Open</ Button >
108+ </ DrawerTrigger >
109+
110+ < DrawerContent className = "max-h-96" >
111+ < DrawerHeader >
112+ < DrawerTitle > Drawer Title</ DrawerTitle >
113+ < DrawerDescription > Drawer Description</ DrawerDescription >
114+ </ DrawerHeader >
115+ < DrawerBody className = "p-6" >
116+ < p >
117+ This is some placeholder content to show a vertically centered
118+ modal. We've added some extra copy here to show how vertically
119+ centering the modal works when combined with scrollable modals. We
120+ also use some repeated line breaks to quickly extend the height of
121+ the content, thereby triggering the scrolling. When content becomes
122+ longer than the predefined max-height of modal, content will be
123+ cropped and scrollable within the modal.
124+ </ p >
125+ { Array . from ( { length : 80 } ) . map ( ( ) => (
126+ < br key = { Math . random ( ) } />
127+ ) ) }
128+ < p >
129+ End of content. This is some placeholder content to show a
130+ vertically
131+ </ p >
132+ </ DrawerBody >
133+ < DrawerFooter >
134+ < DrawerClose variant = "outline" > Secondary</ DrawerClose >
135+ < DrawerClose > Primary</ DrawerClose >
136+ </ DrawerFooter >
137+ </ DrawerContent >
138+ </ Drawer >
139+ ) ,
104140} ;
105141
106142export const Scrollable : Story = {
107143 args : {
108144 scrollable : true ,
109145 } ,
110- render : Scrolling . render ,
146+ render : ScrollingHorizontal . render ,
147+ } ;
148+
149+ export const Left : Story = {
150+ args : {
151+ side : 'left' ,
152+ } ,
153+ render : ScrollingHorizontal . render ,
111154} ;
112155
113156export const LeftScrollable : Story = {
114157 args : {
115- position : 'left' ,
158+ side : 'left' ,
159+ scrollable : true ,
160+ } ,
161+ render : ScrollingHorizontal . render ,
162+ } ;
163+
164+ export const Top : Story = {
165+ args : {
166+ side : 'top' ,
167+ } ,
168+ render : ScrollingVertical . render ,
169+ } ;
170+
171+ export const TopScrollable : Story = {
172+ args : {
173+ side : 'top' ,
174+ scrollable : true ,
175+ } ,
176+ render : ScrollingVertical . render ,
177+ } ;
178+
179+ export const Bottom : Story = {
180+ args : {
181+ side : 'bottom' ,
182+ } ,
183+ render : ScrollingVertical . render ,
184+ } ;
185+
186+ export const BottomScrollable : Story = {
187+ args : {
188+ side : 'bottom' ,
116189 scrollable : true ,
117190 } ,
118- render : Scrolling . render ,
191+ render : ScrollingVertical . render ,
119192} ;
0 commit comments