@@ -61,7 +61,7 @@ export const Simple: Story = {
61
61
render : Default . render ,
62
62
} ;
63
63
64
- export const Scrolling : Story = {
64
+ export const ScrollingHorizontal : Story = {
65
65
render : ( args ) => (
66
66
< Drawer { ...args } >
67
67
< DrawerTrigger asChild >
@@ -86,6 +86,10 @@ export const Scrolling: Story = {
86
86
{ Array . from ( { length : 80 } ) . map ( ( ) => (
87
87
< br key = { Math . random ( ) } />
88
88
) ) }
89
+ < p >
90
+ End of content. This is some placeholder content to show a
91
+ vertically
92
+ </ p >
89
93
</ DrawerBody >
90
94
< DrawerFooter >
91
95
< DrawerClose variant = "outline" > Secondary</ DrawerClose >
@@ -96,24 +100,93 @@ export const Scrolling: Story = {
96
100
) ,
97
101
} ;
98
102
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
+ ) ,
104
140
} ;
105
141
106
142
export const Scrollable : Story = {
107
143
args : {
108
144
scrollable : true ,
109
145
} ,
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 ,
111
154
} ;
112
155
113
156
export const LeftScrollable : Story = {
114
157
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' ,
116
189
scrollable : true ,
117
190
} ,
118
- render : Scrolling . render ,
191
+ render : ScrollingVertical . render ,
119
192
} ;
0 commit comments