<commit_before>//
// Xcore
// Copyright © 2021 Xcore
// MIT license, see LICENSE file for details
//

import SwiftUI

// MARK: - Default Style

private struct DefaultFieldPreview: View {
    @State private var height: CGFloat = 0
    @State private var text: String = ""

    public var body: some View {
        VStack(spacing: .maximumPadding) {
            DynamicTextField(value: $text, configuration: .emailAddress) {
                Label("Email Address", systemImage: .mail)
            }
            .readSize {
                height = $0.height
            }
            .accentColor(.secondary)

            Text("Text Field Height \(height)")
                .font(.footnote)
                .foregroundColor(.secondary)
        }
        .padding()
    }
}

// MARK: - Line Style

private struct LineFieldPreview: View {
    @State private var height: CGFloat = 0
    @State private var text: String = "<EMAIL>"

    public var body: some View {
        VStack(spacing: .maximumPadding) {
            DynamicTextField(value: $text, configuration: .emailAddress) {
                Label("Email Address", systemImage: .mail)
            }
            .dynamicTextFieldStyle(.line)
            .readSize {
                height = $0.height
            }
            .accentColor(.secondary)

            Text("Text Field Height \(height)")
                .font(.footnote)
                .foregroundColor(.secondary)
        }
        .padding()
    }
}

// MARK: - Prominent Style

private struct ProminentFieldPreview: View {
    @State private var height: CGFloat = 0
    @State private var text: String = ""

    public var body: some View {
        VStack(spacing: .maximumPadding) {
            DynamicTextField("SSN", value: $text, configuration: .ssn)
                .dynamicTextFieldStyle(.prominent)
                .readSize {
                    height = $0.height
                }

            Text("Text Field Height \(height)")
                .font(.footnote)
                .foregroundColor(.secondary)
        }
        .padding()
    }
}

// MARK: - Preview Provider

struct DynamicTextField_Previews: PreviewProvider {
    static var previews: some View {
        Group {
            DefaultFieldPreview()
            LineFieldPreview()
            ProminentFieldPreview()
        }
        .padding()
        .previewLayout(.sizeThatFits)
    }
}<commit_msg>Linting<commit_after>//
// Xcore
// Copyright © 2021 Xcore
// MIT license, see LICENSE file for details
//

import SwiftUI

// MARK: - Default Style

private struct DefaultFieldPreview: View {
    @State private var height: CGFloat = 0
    @State private var text: String = ""

    var body: some View {
        VStack(spacing: .maximumPadding) {
            DynamicTextField(value: $text, configuration: .emailAddress) {
                Label("Email Address", systemImage: .mail)
            }
            .readSize {
                height = $0.height
            }
            .accentColor(.secondary)

            Text("Text Field Height \(height)")
                .font(.footnote)
                .foregroundColor(.secondary)
        }
        .padding()
    }
}

// MARK: - Line Style

private struct LineFieldPreview: View {
    @State private var height: CGFloat = 0
    @State private var text: String = "<EMAIL>"

    var body: some View {
        VStack(spacing: .maximumPadding) {
            DynamicTextField(value: $text, configuration: .emailAddress) {
                Label("Email Address", systemImage: .mail)
            }
            .dynamicTextFieldStyle(.line)
            .readSize {
                height = $0.height
            }
            .accentColor(.secondary)

            Text("Text Field Height \(height)")
                .font(.footnote)
                .foregroundColor(.secondary)
        }
        .padding()
    }
}

// MARK: - Prominent Style

private struct ProminentFieldPreview: View {
    @State private var height: CGFloat = 0
    @State private var text: String = ""

    var body: some View {
        VStack(spacing: .maximumPadding) {
            DynamicTextField("SSN", value: $text, configuration: .ssn)
                .dynamicTextFieldStyle(.prominent)
                .readSize {
                    height = $0.height
                }

            Text("Text Field Height \(height)")
                .font(.footnote)
                .foregroundColor(.secondary)
        }
        .padding()
    }
}

// MARK: - Preview Provider

struct DynamicTextField_Previews: PreviewProvider {
    static var previews: some View {
        Group {
            DefaultFieldPreview()
            LineFieldPreview()
            ProminentFieldPreview()
        }
        .padding()
        .previewLayout(.sizeThatFits)
    }
}
{'fraction_non_alphanumeric': 0.10249947490023105, 'fraction_numerical': 0.004200798151648814, 'mean_word_length': 1.639689578713969, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '4363069', 'n_tokens_mistral': 1320, 'n_tokens_neox': 1210, 'n_words': 323}