@@ -172,7 +172,6 @@ private extension POSButtonSize {
172172#if DEBUG
173173
174174struct POSButtonStyle_Previews : View {
175- @State private var showsLoadingState : Bool = false
176175 var body : some View {
177176 ScrollView {
178177 VStack ( alignment: . leading, spacing: POSSpacing . xLarge) {
@@ -188,9 +187,9 @@ struct POSButtonStyle_Previews: View {
188187 previewSection ( title: " Outlined Buttons - Extra Small " ,
189188 variant: . outlined, size: . extraSmall)
190189
191- loadingPreviewSection ( title: " Loading Buttons - Normal " , size: . normal)
190+ LoadingPreviewSection ( title: " Loading Buttons - Normal " , size: . normal)
192191
193- loadingPreviewSection ( title: " Loading Buttons - Extra Small " , size: . extraSmall)
192+ LoadingPreviewSection ( title: " Loading Buttons - Extra Small " , size: . extraSmall)
194193
195194 // Example with long text
196195 VStack ( alignment: . leading, spacing: POSSpacing . medium) {
@@ -231,8 +230,14 @@ struct POSButtonStyle_Previews: View {
231230 }
232231 }
233232 }
233+ }
234+
235+ private struct LoadingPreviewSection : View {
236+ let title : String
237+ let size : POSButtonSize
238+ @State private var showsLoadingState : Bool = false
234239
235- private func loadingPreviewSection ( title : String , size : POSButtonSize ) -> some View {
240+ var body : some View {
236241 VStack ( alignment: . leading, spacing: POSSpacing . medium) {
237242 Text ( title)
238243 . font ( . headline)
@@ -242,6 +247,11 @@ struct POSButtonStyle_Previews: View {
242247 }
243248 . buttonStyle ( POSFilledButtonStyle ( size: size, isLoading: showsLoadingState) )
244249
250+ Button ( " Show loading state in \n multiple \n lines " ) {
251+ showsLoadingState. toggle ( )
252+ }
253+ . buttonStyle ( POSFilledButtonStyle ( size: size, isLoading: showsLoadingState) )
254+
245255 Button ( " Enabled Loading Button " ) { }
246256 . buttonStyle ( POSFilledButtonStyle ( size: size, isLoading: true ) )
247257
0 commit comments