Skip to content

Commit c62c33c

Browse files
Move BitwardenMenuField
1 parent cb17d21 commit c62c33c

32 files changed

+52
-25
lines changed

BitwardenShared/UI/Platform/Application/Extensions/View+OnSizeChanged.swift renamed to BitwardenKit/UI/Platform/Application/Extensions/View+OnSizeChanged.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import SwiftUI
22

3-
extension View {
3+
public extension View {
44
/// A view modifier that calculates the size of the containing view.
55
///
66
/// - Parameter perform: A closure called when the size of the view changes.

BitwardenShared/UI/Platform/Application/Views/BitwardenMenuField.swift renamed to BitwardenKit/UI/Platform/Application/Views/BitwardenMenuField.swift

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import SwiftUI
55

66
/// A protocol that defines an object that can be represented and selected in
77
/// a `BitwardenMenuField`.
8-
protocol Menuable: Equatable, Hashable {
8+
public protocol Menuable: Equatable, Hashable {
99
/// The custom localizable title value for this default case, defaults to `Default`.
1010
static var defaultValueLocalizedName: String { get }
1111

@@ -17,7 +17,7 @@ protocol Menuable: Equatable, Hashable {
1717
var localizedName: String { get }
1818
}
1919

20-
extension Menuable {
20+
public extension Menuable {
2121
static var defaultValueLocalizedName: String {
2222
Localizations.default
2323
}
@@ -33,7 +33,7 @@ extension Menuable {
3333
/// options. This view is identical to `BitwardenTextField`, but uses a `Menu`
3434
/// instead of a `TextField` as the input mechanism.
3535
///
36-
struct BitwardenMenuField<
36+
public struct BitwardenMenuField<
3737
T,
3838
AdditionalMenu: View,
3939
TitleAccessory: View,
@@ -74,7 +74,7 @@ struct BitwardenMenuField<
7474

7575
// MARK: View
7676

77-
var body: some View {
77+
public var body: some View {
7878
VStack(alignment: .leading, spacing: 0) {
7979
menu
8080

@@ -175,7 +175,7 @@ struct BitwardenMenuField<
175175
/// - options: The options that the user can choose between.
176176
/// - selection: A `Binding` for the currently selected option.
177177
///
178-
init(
178+
public init(
179179
title: String? = nil,
180180
footer: String? = nil,
181181
accessibilityIdentifier: String? = nil,
@@ -205,7 +205,7 @@ struct BitwardenMenuField<
205205
/// - options: The options that the user can choose between.
206206
/// - selection: A `Binding` for the currently selected option.
207207
///
208-
init(
208+
public init(
209209
title: String,
210210
accessibilityIdentifier: String? = nil,
211211
options: [T],
@@ -233,7 +233,7 @@ struct BitwardenMenuField<
233233
/// - titleAccessoryContent: Optional title accessory view that is displayed on the trailing edge of the title.
234234
/// - trailingContent: Optional content view that is displayed to the right of the menu value.
235235
///
236-
init(
236+
public init(
237237
title: String? = nil,
238238
footer: String? = nil,
239239
accessibilityIdentifier: String? = nil,
@@ -262,7 +262,7 @@ struct BitwardenMenuField<
262262
/// - selection: A `Binding` for the currently selected option.
263263
/// - trailingContent: Optional content view that is displayed to the right of the menu value.
264264
///
265-
init(
265+
public init(
266266
title: String? = nil,
267267
footer: String? = nil,
268268
accessibilityIdentifier: String? = nil,
@@ -290,7 +290,7 @@ struct BitwardenMenuField<
290290
/// - selection: A `Binding` for the currently selected option.
291291
/// - titleAccessoryContent: Optional title accessory view that is displayed on the trailing edge of the title.
292292
///
293-
init(
293+
public init(
294294
title: String? = nil,
295295
footer: String? = nil,
296296
accessibilityIdentifier: String? = nil,
@@ -319,7 +319,7 @@ struct BitwardenMenuField<
319319
/// - additionalMenu: Additional menu options to display at the bottom of the menu.
320320
///
321321
@_disfavoredOverload
322-
init(
322+
public init(
323323
title: String? = nil,
324324
footer: String? = nil,
325325
accessibilityIdentifier: String? = nil,

BitwardenShared/UI/Platform/Application/Views/BitwardenMenuFieldTests.swift renamed to BitwardenKit/UI/Platform/Application/Views/BitwardenMenuFieldTests.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1+
import BitwardenKit
12
import SwiftUI
23
import ViewInspector
34
import XCTest
45

5-
@testable import BitwardenShared
6-
76
class BitwardenMenuFieldTests: BitwardenTestCase {
87
// MARK: Types
98

BitwardenShared/Core/Platform/Models/Domain/DefaultableType.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import BitwardenKit
12
import Foundation
23

34
// MARK: - DefaultableType

BitwardenShared/Core/Platform/Models/Enum/AppTheme.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import BitwardenKit
12
import BitwardenResources
23
import UIKit
34

@@ -23,10 +24,10 @@ public enum AppTheme: String, Menuable, Sendable {
2324
// MARK: Properties
2425

2526
/// Specify the text for the default option.
26-
static var defaultValueLocalizedName: String { Localizations.defaultSystem }
27+
public static var defaultValueLocalizedName: String { Localizations.defaultSystem }
2728

2829
/// The name of the type to display in the dropdown menu.
29-
var localizedName: String {
30+
public var localizedName: String {
3031
switch self {
3132
case .dark:
3233
Localizations.dark

BitwardenShared/Core/Platform/Models/Enum/ClearClipboardValue.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import BitwardenKit
12
import BitwardenResources
23
import Foundation
34

BitwardenShared/Core/Platform/Models/Enum/ExportFormatType.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import BitwardenKit
2+
13
// MARK: - ExportFormatType
24

35
/// An enum describing the format of the vault export.

BitwardenShared/Core/Platform/Models/Enum/FlightRecorderLoggingDuration.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import BitwardenKit
12
import BitwardenResources
23
import Foundation
34

BitwardenShared/Core/Tools/Models/Enum/ForwardedEmailServiceType.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import BitwardenKit
12
import BitwardenResources
23

34
/// The service used to generate a forwarded email alias.

BitwardenShared/Core/Tools/Models/Enum/PasswordGeneratorType.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import BitwardenKit
12
import BitwardenResources
23

34
/// The type of password to generate.

0 commit comments

Comments
 (0)