Skip to content

Commit 8dbba1e

Browse files
add a shared InputStyle enum
1 parent 5cd211e commit 8dbba1e

File tree

4 files changed

+15
-17
lines changed

4 files changed

+15
-17
lines changed

Examples/DemosApp/DemosApp/ComponentsPreview/PreviewPages/InputFieldPreview.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ struct InputFieldPreview: View {
6262
Toggle("Secure Input", isOn: self.$model.isSecureInput)
6363
SizePicker(selection: self.$model.size)
6464
Picker("Style", selection: self.$model.style) {
65-
Text("Light").tag(InputFieldVM.Style.light)
66-
Text("Bordered").tag(InputFieldVM.Style.bordered)
67-
Text("Faded").tag(InputFieldVM.Style.faded)
65+
Text("Light").tag(InputStyle.light)
66+
Text("Bordered").tag(InputStyle.bordered)
67+
Text("Faded").tag(InputStyle.faded)
6868
}
6969
SubmitTypePicker(selection: self.$model.submitType)
7070
UniversalColorPicker(

Sources/ComponentsKit/Components/InputField/Models/InputFieldStyle.swift

Lines changed: 0 additions & 13 deletions
This file was deleted.

Sources/ComponentsKit/Components/InputField/Models/InputFieldVM.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public struct InputFieldVM: ComponentVM {
6565
/// The visual style of the input field.
6666
///
6767
/// Defaults to `.light`.
68-
public var style: Style = .light
68+
public var style: InputStyle = .light
6969

7070
/// The type of the submit button on the keyboard.
7171
///
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import Foundation
2+
3+
/// The appearance style of inputs.
4+
public enum InputStyle: Hashable {
5+
/// An input with a partially transparent background.
6+
case light
7+
/// An input with a transparent background and a border.
8+
case bordered
9+
/// An input with a partially transparent background and a border.
10+
case faded
11+
}

0 commit comments

Comments
 (0)