-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
55 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
DesignToolbox/DesignToolbox/Pages/Utils/DesignToolboxTextField.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// | ||
// Software Name: OUDS iOS | ||
// SPDX-FileCopyrightText: Copyright (c) Orange SA | ||
// SPDX-License-Identifier: MIT | ||
// | ||
// This software is distributed under the MIT license, | ||
// the text of which is available at https://opensource.org/license/MIT/ | ||
// or see the "LICENSE" file for more details. | ||
// | ||
// Authors: See CONTRIBUTORS.txt | ||
// Software description: A SwiftUI components library with code examples for Orange Unified Design System | ||
// | ||
|
||
import OUDS | ||
import OUDSTokensSemantic | ||
import SwiftUI | ||
|
||
struct DesignToolboxTextField: View { | ||
|
||
@Environment(\.theme) private var theme | ||
@Environment(\.colorScheme) private var colorScheme | ||
|
||
let text: Binding<String> | ||
let prompt: String | ||
|
||
var body: some View { | ||
VStack(alignment: .leading) { | ||
Text("app_component_common_userText_label") | ||
.typeHeadingMedium(theme) | ||
.foregroundStyle(theme.colors.colorContentDefault.color(for: colorScheme)) | ||
|
||
TextField(text: text) { | ||
Text(LocalizedStringKey(prompt)) | ||
} | ||
} | ||
.accessibilityElement(children: .combine) | ||
.accessibilityLabel(LocalizedStringKey(prompt)) | ||
.accessibilityValue(text.wrappedValue) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters