<commit_before>import ComposableArchitecture
import Foundation
import Styleguide
import SwiftUI

/// A view to overlay the map and indicate the next ride
public struct MapOverlayView<Content>: View where Content: View {
  public struct ViewState: Equatable {
    let isVisible: Bool
    let isExpanded: Bool
    
    public init(isVisible: Bool, isExpanded: Bool) {
      self.isVisible = isVisible
      self.isExpanded = isExpanded
    }
  }
  
  @Environment(\.accessibilityReduceTransparency) var reduceTransparency
  @Environment(\.accessibilityReduceMotion) var reduceMotion
  
  let store: Store<ViewState, Never>
  @ObservedObject var viewStore: ViewStore<ViewState, Never>
  
  @State var isExpanded = false
  @State var isVisible = false
  let action: () -> Void
  let content: () -> Content
  
  public init(
    store: Store<ViewState, Never>,
    action: @escaping () -> Void,
    @ViewBuilder content: @escaping () -> Content
  ) {
    self.store = store
    viewStore = ViewStore(store)
    self.action = action
    self.content = content
  }
  
  public var body: some View {
    Button(
      action: action,
      label: {
        HStack {
          Image(uiImage: Asset.cm.image)
          
          if isExpanded {
            content()
              .transition(
                .asymmetric(
                  insertion: .opacity.animation(reduceMotion ? nil : .easeInOut(duration: 0.1).delay(0.2)),
                  removal: .opacity.animation(reduceMotion ? nil : .easeOut(duration: 0.15))
                )
              )
          }
        }
        .padding(.horizontal, isExpanded ? .grid(2) : 0)
      }
    )
    .frame(minWidth: 50, minHeight: 50)
    .foregroundColor(reduceTransparency ? .white : Color(.textPrimary))
    .background(
      Group {
        if reduceTransparency {
          RoundedRectangle(
            cornerRadius: 12,
            style: .circular
          )
          .fill(Color(.backgroundPrimary))
        } else {
          Blur()
            .cornerRadius(12)
        }
      }
    )
    .transition(.scale.animation(reduceMotion ? nil : .easeOut(duration: 0.2)))
    .onChange(of: viewStore.isExpanded, perform: { newValue in
      let updateAction: () -> Void = { self.isExpanded = newValue }<commit_msg>add padding to banner content<commit_after>import ComposableArchitecture
import Foundation
import Styleguide
import SwiftUI

/// A view to overlay the map and indicate the next ride
public struct MapOverlayView<Content>: View where Content: View {
  public struct ViewState: Equatable {
    let isVisible: Bool
    let isExpanded: Bool
    
    public init(isVisible: Bool, isExpanded: Bool) {
      self.isVisible = isVisible
      self.isExpanded = isExpanded
    }
  }
  
  @Environment(\.accessibilityReduceTransparency) var reduceTransparency
  @Environment(\.accessibilityReduceMotion) var reduceMotion
  
  let store: Store<ViewState, Never>
  @ObservedObject var viewStore: ViewStore<ViewState, Never>
  
  @State var isExpanded = false
  @State var isVisible = false
  let action: () -> Void
  let content: () -> Content
  
  public init(
    store: Store<ViewState, Never>,
    action: @escaping () -> Void,
    @ViewBuilder content: @escaping () -> Content
  ) {
    self.store = store
    viewStore = ViewStore(store)
    self.action = action
    self.content = content
  }
  
  public var body: some View {
    Button(
      action: action,
      label: {
        HStack {
          Image(uiImage: Asset.cm.image)
          
          if isExpanded {
            content()
              .padding(.vertical, .grid(1))
              .transition(
                .asymmetric(
                  insertion: .opacity.animation(reduceMotion ? nil : .easeInOut(duration: 0.1).delay(0.2)),
                  removal: .opacity.animation(reduceMotion ? nil : .easeOut(duration: 0.15))
                )
              )
          }
        }
        .padding(.horizontal, isExpanded ? .grid(2) : 0)
      }
    )
    .frame(minWidth: 50, minHeight: 50)
    .foregroundColor(reduceTransparency ? .white : Color(.textPrimary))
    .background(
      Group {
        if reduceTransparency {
          RoundedRectangle(
            cornerRadius: 12,
            style: .circular
          )
          .fill(Color(.backgroundPrimary))
        } else {
          Blur()
            .cornerRadius(12)
        }
      }
    )
    .transition(.scale.animation(reduceMotion ? nil : .easeOut(duration: 0.2)))
    .onChange(of: viewStore.isExpanded, perform: { newValue in
      let updateAction: () -> Void = { self.isExpanded = newValue }
{'fraction_non_alphanumeric': 0.10134841235319704, 'fraction_numerical': 0.008481948673336234, 'mean_word_length': 2.1629986244841817, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2887679', 'n_tokens_mistral': 1395, 'n_tokens_neox': 1316, 'n_words': 324}